From 19d7386b2f56fb2126e7140266e5a11ac90c2a08 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 21 May 2014 12:46:00 -0500 Subject: [PATCH] dispatcher: add PRE_UP states This event runs before a connection/device is announced as "activated" or "connected", to enable scripts to do things before applications begin using connectivity. For example, this could be used to manage /etc/resolv.conf outside of NetworkManager and ensure that resolv.conf had correct information before DNS is used. Note that this is different than the Debian or Gentoo "pre-up" event used in /etc/network/interfaces, as that event runs before any L2 configuration has started. If we really need an event like that, we'll add it later as "lower-up". --- src/nm-dispatcher.c | 4 ++++ src/nm-dispatcher.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/nm-dispatcher.c b/src/nm-dispatcher.c index 87a89cab28..6ebf427fd0 100644 --- a/src/nm-dispatcher.c +++ b/src/nm-dispatcher.c @@ -276,12 +276,16 @@ action_to_string (DispatcherAction action) switch (action) { case DISPATCHER_ACTION_HOSTNAME: return "hostname"; + case DISPATCHER_ACTION_PRE_UP: + return "pre-up"; case DISPATCHER_ACTION_UP: return "up"; case DISPATCHER_ACTION_PRE_DOWN: return "pre-down"; case DISPATCHER_ACTION_DOWN: return "down"; + case DISPATCHER_ACTION_VPN_PRE_UP: + return "vpn-pre-up"; case DISPATCHER_ACTION_VPN_UP: return "vpn-up"; case DISPATCHER_ACTION_VPN_PRE_DOWN: diff --git a/src/nm-dispatcher.h b/src/nm-dispatcher.h index 7b50954fea..464f6310cb 100644 --- a/src/nm-dispatcher.h +++ b/src/nm-dispatcher.h @@ -32,9 +32,11 @@ typedef enum { DISPATCHER_ACTION_HOSTNAME, + DISPATCHER_ACTION_PRE_UP, DISPATCHER_ACTION_UP, DISPATCHER_ACTION_PRE_DOWN, DISPATCHER_ACTION_DOWN, + DISPATCHER_ACTION_VPN_PRE_UP, DISPATCHER_ACTION_VPN_UP, DISPATCHER_ACTION_VPN_PRE_DOWN, DISPATCHER_ACTION_VPN_DOWN,