summaryrefslogtreecommitdiff
blob: 05b2808e3f25aab40a1b53a72f3e60c5ddb8451c (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
Index: ChangeLog
===================================================================
--- ChangeLog	(Revision 2679)
+++ ChangeLog	(Revision 2678)
@@ -1,9 +1,3 @@
-2007-08-14  Dan Williams  <dcbw@redhat.com>
-
-	* src/nm-openvpn-service.c
-		- Handle NM_VPN_STATE_* -> NM_VPN_SERVICE_STATE_* and NMVPNState -> 
-			NMVPNServiceState renames
-
 2007-07-26  Dan Williams  <dcbw@redhat.com>
 
     Patch from Kelemen Gábor <kelemeng@gnome.hu>
Index: src/nm-ppp-starter.c
===================================================================
--- src/nm-ppp-starter.c	(Revision 2679)
+++ src/nm-ppp-starter.c	(Revision 2678)
@@ -76,7 +76,7 @@
 {
   GMainLoop         *loop;
   DBusConnection	*con;
-  NMVPNServiceState	state;
+  NMVPNState		state;
   GPid				pid;
   guint		     	quit_timer;
   guint			    helper_timer;
@@ -162,7 +162,7 @@
  * Signal the bus that our state changed.
  *
  */
-static void nm_ppp_dbus_signal_state_change (NmPPPData *data, NMVPNServiceState old_state)
+static void nm_ppp_dbus_signal_state_change (NmPPPData *data, NMVPNState old_state)
 {
   DBusMessage	*message;
 
@@ -189,9 +189,9 @@
  * Set our state and make sure to signal the bus.
  *
  */
-static void nm_ppp_set_state (NmPPPData *data, NMVPNServiceState new_state)
+static void nm_ppp_set_state (NmPPPData *data, NMVPNState new_state)
 {
-  NMVPNServiceState	old_state;
+  NMVPNState	old_state;
 
   g_return_if_fail (data != NULL);
 
@@ -356,7 +356,7 @@
       break;
     }
 
-  nm_ppp_set_state (data, NM_VPN_SERVICE_STATE_STOPPED);
+  nm_ppp_set_state (data, NM_VPN_STATE_STOPPED);
   nm_ppp_schedule_quit_timer (data, 10000);
 }
 
@@ -425,7 +425,7 @@
     }
 
 
-  nm_ppp_set_state (data, NM_VPN_SERVICE_STATE_STOPPED);
+  nm_ppp_set_state (data, NM_VPN_STATE_STOPPED);
   nm_ppp_schedule_quit_timer (data, 10000);
 }
 
@@ -1110,7 +1110,7 @@
   g_return_val_if_fail (message != NULL, FALSE);
   g_return_val_if_fail (data != NULL, FALSE);
 
-  nm_ppp_set_state (data, NM_VPN_SERVICE_STATE_STARTING);
+  nm_ppp_set_state (data, NM_VPN_STATE_STARTING);
 
   dbus_error_init (&error);
   if (!dbus_message_get_args (message, &error,
@@ -1152,7 +1152,7 @@
   dbus_free_string_array (auth_items);
   dbus_free_string_array (user_routes);
   if (!success)
-    nm_ppp_set_state (data, NM_VPN_SERVICE_STATE_STOPPED);
+    nm_ppp_set_state (data, NM_VPN_STATE_STOPPED);
   return success;
 }
 
@@ -1169,13 +1169,13 @@
 
   if (data->pid > 0)
     {
-      nm_ppp_set_state (data, NM_VPN_SERVICE_STATE_STOPPING);
+      nm_ppp_set_state (data, NM_VPN_STATE_STOPPING);
 
       kill (data->pid, SIGTERM);
       nm_info ("Terminated pppd with PID %d.", data->pid);
       data->pid = 0;
 
-      nm_ppp_set_state (data, NM_VPN_SERVICE_STATE_STOPPED);
+      nm_ppp_set_state (data, NM_VPN_STATE_STOPPED);
       nm_ppp_schedule_quit_timer (data, 10000);
     }
 
@@ -1194,13 +1194,13 @@
 
   if (data->pid > 0)
     {
-      nm_ppp_set_state (data, NM_VPN_SERVICE_STATE_STOPPING);
+      nm_ppp_set_state (data, NM_VPN_STATE_STOPPING);
 
       kill (data->pid, SIGTERM);
       nm_info ("Terminated pppd with PID %d.", data->pid);
       data->pid = 0;
 
-      nm_ppp_set_state (data, NM_VPN_SERVICE_STATE_STOPPED);
+      nm_ppp_set_state (data, NM_VPN_STATE_STOPPED);
       nm_ppp_schedule_quit_timer (data, 10000);
     }
 
@@ -1224,22 +1224,22 @@
 
   switch (data->state)
     {
-    case NM_VPN_SERVICE_STATE_STARTING:
+    case NM_VPN_STATE_STARTING:
       reply = nm_dbus_create_error_message (message, NM_DBUS_INTERFACE_PPP_STARTER, NM_DBUS_VPN_STARTING_IN_PROGRESS,
 					    "Could not process the request because the VPN connection is already being started.");
       break;
 
-    case NM_VPN_SERVICE_STATE_STARTED:
+    case NM_VPN_STATE_STARTED:
       reply = nm_dbus_create_error_message (message, NM_DBUS_INTERFACE_PPP_STARTER, NM_DBUS_VPN_ALREADY_STARTED,
 					    "Could not process the request because a VPN connection was already active.");
       break;
 
-    case NM_VPN_SERVICE_STATE_STOPPING:
+    case NM_VPN_STATE_STOPPING:
       reply = nm_dbus_create_error_message (message, NM_DBUS_INTERFACE_PPP_STARTER, NM_DBUS_VPN_STOPPING_IN_PROGRESS,
 					    "Could not process the request because the VPN connection is being stopped.");
       break;
 
-    case NM_VPN_SERVICE_STATE_STOPPED:
+    case NM_VPN_STATE_STOPPED:
       nm_ppp_cancel_quit_timer (data);
       nm_ppp_dbus_handle_start_vpn (message, data);
       reply = dbus_message_new_method_return (message);
@@ -1270,18 +1270,18 @@
   
   switch (data->state)
     {
-    case NM_VPN_SERVICE_STATE_STOPPING:
+    case NM_VPN_STATE_STOPPING:
       reply = nm_dbus_create_error_message (message, NM_DBUS_INTERFACE_PPP_STARTER, NM_DBUS_VPN_STOPPING_IN_PROGRESS,
 					    "Could not process the request because the VPN connection is already being stopped.");
       break;
 
-    case NM_VPN_SERVICE_STATE_STOPPED:
+    case NM_VPN_STATE_STOPPED:
       reply = nm_dbus_create_error_message (message, NM_DBUS_INTERFACE_PPP_STARTER, NM_DBUS_VPN_ALREADY_STOPPED,
 					    "Could not process the request because no VPN connection was active.");
       break;
 
-    case NM_VPN_SERVICE_STATE_STARTING:
-    case NM_VPN_SERVICE_STATE_STARTED:
+    case NM_VPN_STATE_STARTING:
+    case NM_VPN_STATE_STARTED:
       nm_ppp_dbus_handle_stop_vpn (data);
       reply = dbus_message_new_method_return (message);
       break;
@@ -1398,7 +1398,7 @@
   g_return_if_fail (message != NULL);
 
   /* Only accept the config info if we're in STARTING state */
-  if (data->state != NM_VPN_SERVICE_STATE_STARTING)
+  if (data->state != NM_VPN_STATE_STARTING)
     return;
 
   if (dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &error_item, DBUS_TYPE_INVALID))
@@ -1446,7 +1446,7 @@
   g_return_if_fail (message != NULL);
   
   /* Only accept the config info if we're in STARTING state */
-  if (data->state != NM_VPN_SERVICE_STATE_STARTING)
+  if (data->state != NM_VPN_STATE_STARTING)
     return;
 
   /* If IP is up then we don't need to leave the auth info lying around */
@@ -1568,7 +1568,7 @@
       }
 
       dbus_message_unref (signal);
-      nm_ppp_set_state (data, NM_VPN_SERVICE_STATE_STARTED);
+      nm_ppp_set_state (data, NM_VPN_STATE_STARTED);
       success = TRUE;
     }
 
@@ -1608,7 +1608,7 @@
   /* nm_info ("nm_ppp_dbus_message_handler() got method '%s' for path '%s'.", method, path); */
 
   /* If we aren't ready to accept dbus messages, don't */
-  if ((data->state == NM_VPN_SERVICE_STATE_INIT) || (data->state == NM_VPN_SERVICE_STATE_SHUTDOWN))
+  if ((data->state == NM_VPN_STATE_INIT) || (data->state == NM_VPN_STATE_SHUTDOWN))
     {
       nm_warning ("Received dbus messages but couldn't handle them due to INIT or SHUTDOWN states.");
       reply = nm_dbus_create_error_message (message, NM_DBUS_INTERFACE_PPP_STARTER, NM_DBUS_VPN_WRONG_STATE,
@@ -1792,7 +1792,7 @@
   vpn_data = g_malloc0 (sizeof (NmPPPData));
 
   vpn_data->debug = FALSE;
-  vpn_data->state = NM_VPN_SERVICE_STATE_INIT;
+  vpn_data->state = NM_VPN_STATE_INIT;
 
   vpn_data->loop = g_main_loop_new (NULL, FALSE);
 
@@ -1806,7 +1806,7 @@
   sigaction (SIGINT, &action, NULL);
   sigaction (SIGTERM, &action, NULL);
 
-  nm_ppp_set_state (vpn_data, NM_VPN_SERVICE_STATE_STOPPED);
+  nm_ppp_set_state (vpn_data, NM_VPN_STATE_STOPPED);
   g_main_loop_run (vpn_data->loop);
 
   nm_ppp_dbus_handle_stop_vpn (vpn_data);