diff options
author | Dan Williams <dcbw@redhat.com> | 2014-05-21 12:46:00 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2014-06-06 13:43:46 -0500 |
commit | 19d7386b2f56fb2126e7140266e5a11ac90c2a08 (patch) | |
tree | a30802a9dc8735798dd6fd8a931a8eb360d35156 | |
parent | 286e926ee848b12305d2c60288c0295b36860470 (diff) | |
download | NetworkManager-19d7386b2f56fb2126e7140266e5a11ac90c2a08.tar.gz |
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".
-rw-r--r-- | src/nm-dispatcher.c | 4 | ||||
-rw-r--r-- | src/nm-dispatcher.h | 2 |
2 files changed, 6 insertions, 0 deletions
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, |