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".
This commit is contained in:
Dan Williams 2014-05-21 12:46:00 -05:00
parent 286e926ee8
commit 19d7386b2f
2 changed files with 6 additions and 0 deletions

View file

@ -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:

View file

@ -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,