about summary refs log tree commit diff
path: root/debian/patches/06-dispatch_more_events.patch
blob: 8b85f49a6cc1b3eb8fe4b89f052ed2fe52688302 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
--- dispatcher-daemon/NetworkManagerDispatcher.c.old	2006-08-13 22:40:18.000000000 +0200
+++ dispatcher-daemon/NetworkManagerDispatcher.c	2006-08-13 22:40:27.000000000 +0200
@@ -44,6 +44,8 @@
 	NMD_DEVICE_DONT_KNOW,
 	NMD_DEVICE_NOW_INACTIVE,
 	NMD_DEVICE_NOW_ACTIVE,
+	NMD_DEVICE_GOING_INACTIVE,
+	NMD_DEVICE_GOING_ACTIVE,
 };
 typedef enum NMDAction	NMDAction;
 
@@ -95,6 +97,10 @@
 	if (action == NMD_DEVICE_NOW_ACTIVE)
 		char_act = "up";
 	else if (action == NMD_DEVICE_NOW_INACTIVE)
+		char_act = "post-down";
+	else if (action == NMD_DEVICE_GOING_ACTIVE)
+		char_act = "pre-up";
+	else if (action == NMD_DEVICE_GOING_INACTIVE)
 		char_act = "down";
 	else
 		return;
@@ -217,9 +223,13 @@
 	}
 
 	if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceNoLongerActive"))
-		action = NMD_DEVICE_NOW_INACTIVE;
+		action = NMD_DEVICE_GOING_INACTIVE;
 	else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceNowActive"))
 		action = NMD_DEVICE_NOW_ACTIVE;
+	else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceActivating"))
+		action = NMD_DEVICE_GOING_ACTIVE;
+	else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceDeactivated"))
+		action = NMD_DEVICE_NOW_INACTIVE;
 
 	if (action != NMD_DEVICE_DONT_KNOW)
 	{
@@ -234,8 +244,10 @@
 			if (dev_object_path && dev_iface_name)
 			{
 				nm_info ("Device %s (%s) is now %s.", dev_object_path, dev_iface_name,
-						(action == NMD_DEVICE_NOW_INACTIVE ? "down" :
-						(action == NMD_DEVICE_NOW_ACTIVE ? "up" : "error")));
+						(action == NMD_DEVICE_NOW_INACTIVE ? "going down" :
+						(action == NMD_DEVICE_NOW_ACTIVE ? "up" :
+						(action == NMD_DEVICE_GOING_INACTIVE ? "going down" :
+						(action == NMD_DEVICE_GOING_ACTIVE ? "going up" : "error")))));
 
 				nmd_execute_scripts (action, dev_iface_name);
 			}