device: renew dhcp leases on awake for software devices
[NetworkManager.git] / libnm / nm-active-connection.c
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /*
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the
15  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  * Boston, MA 02110-1301 USA.
17  *
18  * Copyright 2007 - 2014 Red Hat, Inc.
19  * Copyright 2008 Novell, Inc.
20  */
21
22 #include "nm-default.h"
23
24 #include <string.h>
25
26 #include "nm-dbus-interface.h"
27 #include "nm-active-connection.h"
28 #include "nm-object-private.h"
29 #include "nm-core-internal.h"
30 #include "nm-device.h"
31 #include "nm-device-private.h"
32 #include "nm-connection.h"
33 #include "nm-vpn-connection.h"
34 #include "nm-dbus-helpers.h"
35 #include "nm-dhcp4-config.h"
36 #include "nm-dhcp6-config.h"
37 #include "nm-ip4-config.h"
38 #include "nm-ip6-config.h"
39 #include "nm-remote-connection.h"
40
41 static GType _nm_active_connection_decide_type (GVariant *value);
42
43 G_DEFINE_TYPE_WITH_CODE (NMActiveConnection, nm_active_connection, NM_TYPE_OBJECT,
44                          _nm_object_register_type_func (g_define_type_id,
45                                                         _nm_active_connection_decide_type,
46                                                         NM_DBUS_INTERFACE_ACTIVE_CONNECTION,
47                                                         "Vpn");
48                          )
49
50 #define NM_ACTIVE_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_ACTIVE_CONNECTION, NMActiveConnectionPrivate))
51
52 typedef struct {
53         NMRemoteConnection *connection;
54         char *id;
55         char *uuid;
56         char *type;
57         char *specific_object_path;
58         GPtrArray *devices;
59         NMActiveConnectionState state;
60         gboolean is_default;
61         NMIPConfig *ip4_config;
62         NMDhcpConfig *dhcp4_config;
63         gboolean is_default6;
64         NMIPConfig *ip6_config;
65         NMDhcpConfig *dhcp6_config;
66         gboolean is_vpn;
67         NMDevice *master;
68 } NMActiveConnectionPrivate;
69
70 enum {
71         PROP_0,
72         PROP_CONNECTION,
73         PROP_ID,
74         PROP_UUID,
75         PROP_TYPE,
76         PROP_SPECIFIC_OBJECT_PATH,
77         PROP_DEVICES,
78         PROP_STATE,
79         PROP_DEFAULT,
80         PROP_IP4_CONFIG,
81         PROP_DHCP4_CONFIG,
82         PROP_DEFAULT6,
83         PROP_IP6_CONFIG,
84         PROP_DHCP6_CONFIG,
85         PROP_VPN,
86         PROP_MASTER,
87
88         LAST_PROP
89 };
90
91 static GType
92 _nm_active_connection_decide_type (GVariant *value)
93 {
94         /* @value is the value of the o.fd.NM.ActiveConnection property "VPN" */
95         if (g_variant_get_boolean (value))
96                 return NM_TYPE_VPN_CONNECTION;
97         else
98                 return NM_TYPE_ACTIVE_CONNECTION;
99 }
100
101 /**
102  * nm_active_connection_get_connection:
103  * @connection: a #NMActiveConnection
104  *
105  * Gets the #NMRemoteConnection associated with @connection.
106  *
107  * Returns: (transfer none): the #NMRemoteConnection which this
108  * #NMActiveConnection is an active instance of.
109  **/
110 NMRemoteConnection *
111 nm_active_connection_get_connection (NMActiveConnection *connection)
112 {
113         g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
114
115         return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->connection;
116 }
117
118 /**
119  * nm_active_connection_get_id:
120  * @connection: a #NMActiveConnection
121  *
122  * Gets the #NMConnection's ID.
123  *
124  * Returns: the ID of the #NMConnection that backs the #NMActiveConnection.
125  * This is the internal string used by the connection, and must not be modified.
126  **/
127 const char *
128 nm_active_connection_get_id (NMActiveConnection *connection)
129 {
130         g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
131
132         return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->id;
133 }
134
135 /**
136  * nm_active_connection_get_uuid:
137  * @connection: a #NMActiveConnection
138  *
139  * Gets the #NMConnection's UUID.
140  *
141  * Returns: the UUID of the #NMConnection that backs the #NMActiveConnection.
142  * This is the internal string used by the connection, and must not be modified.
143  **/
144 const char *
145 nm_active_connection_get_uuid (NMActiveConnection *connection)
146 {
147         g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
148
149         return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->uuid;
150 }
151
152 /**
153  * nm_active_connection_get_connection_type:
154  * @connection: a #NMActiveConnection
155  *
156  * Gets the #NMConnection's type.
157  *
158  * Returns: the type of the #NMConnection that backs the #NMActiveConnection.
159  * This is the internal string used by the connection, and must not be modified.
160  **/
161 const char *
162 nm_active_connection_get_connection_type (NMActiveConnection *connection)
163 {
164         g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
165
166         return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->type;
167 }
168
169 /**
170  * nm_active_connection_get_specific_object_path:
171  * @connection: a #NMActiveConnection
172  *
173  * Gets the path of the "specific object" used at activation.
174  *
175  * Currently there is no single method that will allow you to automatically turn
176  * this into an appropriate #NMObject; you need to know what kind of object it
177  * is based on other information. (Eg, if @connection corresponds to a Wi-Fi
178  * connection, then the specific object will be an #NMAccessPoint, and you can
179  * resolve it with nm_device_wifi_get_access_point_by_path().)
180  *
181  * Returns: the specific object's D-Bus path. This is the internal string used
182  * by the connection, and must not be modified.
183  **/
184 const char *
185 nm_active_connection_get_specific_object_path (NMActiveConnection *connection)
186 {
187         g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
188
189         return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->specific_object_path;
190 }
191
192 /**
193  * nm_active_connection_get_devices:
194  * @connection: a #NMActiveConnection
195  *
196  * Gets the #NMDevices used for the active connections.
197  *
198  * Returns: (element-type NMDevice): the #GPtrArray containing #NMDevices.
199  * This is the internal copy used by the connection, and must not be modified.
200  **/
201 const GPtrArray *
202 nm_active_connection_get_devices (NMActiveConnection *connection)
203 {
204         g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
205
206         return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->devices;
207 }
208
209 /**
210  * nm_active_connection_get_state:
211  * @connection: a #NMActiveConnection
212  *
213  * Gets the active connection's state.
214  *
215  * Returns: the state
216  **/
217 NMActiveConnectionState
218 nm_active_connection_get_state (NMActiveConnection *connection)
219 {
220         g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NM_ACTIVE_CONNECTION_STATE_UNKNOWN);
221
222         return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->state;
223 }
224
225 /**
226  * nm_active_connection_get_default:
227  * @connection: a #NMActiveConnection
228  *
229  * Whether the active connection is the default IPv4 one (that is, is used for
230  * the default IPv4 route and DNS information).
231  *
232  * Returns: %TRUE if the active connection is the default IPv4 connection
233  **/
234 gboolean
235 nm_active_connection_get_default (NMActiveConnection *connection)
236 {
237         g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), FALSE);
238
239         return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->is_default;
240 }
241
242 /**
243  * nm_active_connection_get_ip4_config:
244  * @connection: an #NMActiveConnection
245  *
246  * Gets the current IPv4 #NMIPConfig associated with the #NMActiveConnection.
247  *
248  * Returns: (transfer none): the IPv4 #NMIPConfig, or %NULL if the connection is
249  *   not in the %NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.
250  **/
251 NMIPConfig *
252 nm_active_connection_get_ip4_config (NMActiveConnection *connection)
253 {
254         g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
255
256         return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->ip4_config;
257 }
258
259 /**
260  * nm_active_connection_get_dhcp4_config:
261  * @connection: an #NMActiveConnection
262  *
263  * Gets the current IPv4 #NMDhcpConfig (if any) associated with the
264  * #NMActiveConnection.
265  *
266  * Returns: (transfer none): the IPv4 #NMDhcpConfig, or %NULL if the connection
267  *   does not use DHCP, or is not in the %NM_ACTIVE_CONNECTION_STATE_ACTIVATED
268  *   state.
269  **/
270 NMDhcpConfig *
271 nm_active_connection_get_dhcp4_config (NMActiveConnection *connection)
272 {
273         g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
274
275         return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->dhcp4_config;
276 }
277
278 /**
279  * nm_active_connection_get_default6:
280  * @connection: a #NMActiveConnection
281  *
282  * Whether the active connection is the default IPv6 one (that is, is used for
283  * the default IPv6 route and DNS information).
284  *
285  * Returns: %TRUE if the active connection is the default IPv6 connection
286  **/
287 gboolean
288 nm_active_connection_get_default6 (NMActiveConnection *connection)
289 {
290         g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), FALSE);
291
292         return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->is_default6;
293 }
294
295 /**
296  * nm_active_connection_get_ip6_config:
297  * @connection: an #NMActiveConnection
298  *
299  * Gets the current IPv6 #NMIPConfig associated with the #NMActiveConnection.
300  *
301  * Returns: (transfer none): the IPv6 #NMIPConfig, or %NULL if the connection is
302  *   not in the %NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.
303  **/
304 NMIPConfig *
305 nm_active_connection_get_ip6_config (NMActiveConnection *connection)
306 {
307         g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
308
309         return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->ip6_config;
310 }
311
312 /**
313  * nm_active_connection_get_dhcp6_config:
314  * @connection: an #NMActiveConnection
315  *
316  * Gets the current IPv6 #NMDhcpConfig (if any) associated with the
317  * #NMActiveConnection.
318  *
319  * Returns: (transfer none): the IPv6 #NMDhcpConfig, or %NULL if the connection
320  *   does not use DHCPv6, or is not in the %NM_ACTIVE_CONNECTION_STATE_ACTIVATED
321  *   state.
322  **/
323 NMDhcpConfig *
324 nm_active_connection_get_dhcp6_config (NMActiveConnection *connection)
325 {
326         g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
327
328         return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->dhcp6_config;
329 }
330
331 /**
332  * nm_active_connection_get_vpn:
333  * @connection: a #NMActiveConnection
334  *
335  * Whether the active connection is a VPN connection.
336  *
337  * Returns: %TRUE if the active connection is a VPN connection
338  **/
339 gboolean
340 nm_active_connection_get_vpn (NMActiveConnection *connection)
341 {
342         g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), FALSE);
343
344         return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->is_vpn;
345 }
346
347 /**
348  * nm_active_connection_get_master:
349  * @connection: a #NMActiveConnection
350  *
351  * Gets the master #NMDevice of the connection.
352  *
353  * Returns: (transfer none): the master #NMDevice of the #NMActiveConnection.
354  **/
355 NMDevice *
356 nm_active_connection_get_master (NMActiveConnection *connection)
357 {
358         g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
359
360         return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->master;
361 }
362
363 static void
364 nm_active_connection_init (NMActiveConnection *connection)
365 {
366         NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (connection);
367
368         priv->devices = g_ptr_array_new ();
369 }
370
371 static void
372 dispose (GObject *object)
373 {
374         NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (object);
375
376         g_clear_pointer (&priv->devices, g_ptr_array_unref);
377
378         g_clear_object (&priv->connection);
379         g_clear_object (&priv->master);
380         g_clear_object (&priv->ip4_config);
381         g_clear_object (&priv->dhcp4_config);
382         g_clear_object (&priv->ip6_config);
383         g_clear_object (&priv->dhcp6_config);
384
385         G_OBJECT_CLASS (nm_active_connection_parent_class)->dispose (object);
386 }
387
388 static void
389 finalize (GObject *object)
390 {
391         NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (object);
392
393         g_free (priv->id);
394         g_free (priv->uuid);
395         g_free (priv->type);
396         g_free (priv->specific_object_path);
397
398         G_OBJECT_CLASS (nm_active_connection_parent_class)->finalize (object);
399 }
400
401 static void
402 get_property (GObject *object,
403               guint prop_id,
404               GValue *value,
405               GParamSpec *pspec)
406 {
407         NMActiveConnection *self = NM_ACTIVE_CONNECTION (object);
408
409         switch (prop_id) {
410         case PROP_CONNECTION:
411                 g_value_set_object (value, nm_active_connection_get_connection (self));
412                 break;
413         case PROP_ID:
414                 g_value_set_string (value, nm_active_connection_get_id (self));
415                 break;
416         case PROP_UUID:
417                 g_value_set_string (value, nm_active_connection_get_uuid (self));
418                 break;
419         case PROP_TYPE:
420                 g_value_set_string (value, nm_active_connection_get_connection_type (self));
421                 break;
422         case PROP_SPECIFIC_OBJECT_PATH:
423                 g_value_set_string (value, nm_active_connection_get_specific_object_path (self));
424                 break;
425         case PROP_DEVICES:
426                 g_value_take_boxed (value, _nm_utils_copy_object_array (nm_active_connection_get_devices (self)));
427                 break;
428         case PROP_STATE:
429                 g_value_set_enum (value, nm_active_connection_get_state (self));
430                 break;
431         case PROP_DEFAULT:
432                 g_value_set_boolean (value, nm_active_connection_get_default (self));
433                 break;
434         case PROP_IP4_CONFIG:
435                 g_value_set_object (value, nm_active_connection_get_ip4_config (self));
436                 break;
437         case PROP_DHCP4_CONFIG:
438                 g_value_set_object (value, nm_active_connection_get_dhcp4_config (self));
439                 break;
440         case PROP_DEFAULT6:
441                 g_value_set_boolean (value, nm_active_connection_get_default6 (self));
442                 break;
443         case PROP_IP6_CONFIG:
444                 g_value_set_object (value, nm_active_connection_get_ip6_config (self));
445                 break;
446         case PROP_DHCP6_CONFIG:
447                 g_value_set_object (value, nm_active_connection_get_dhcp6_config (self));
448                 break;
449         case PROP_VPN:
450                 g_value_set_boolean (value, nm_active_connection_get_vpn (self));
451                 break;
452         case PROP_MASTER:
453                 g_value_set_object (value, nm_active_connection_get_master (self));
454                 break;
455         default:
456                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
457                 break;
458         }
459 }
460
461 static gboolean
462 demarshal_specific_object_path (NMObject *object, GParamSpec *pspec, GVariant *value, gpointer field)
463 {
464         char **param = (char **) field;
465
466         /* We have to demarshal this manually, because the D-Bus property name
467          * ("SpecificObject"), doesn't match the object property name
468          * ("specific-object-path"). (The name "specific-object" is reserved for
469          * future use as an NMObject-valued property.)
470          */
471         if (!g_variant_is_of_type (value, G_VARIANT_TYPE_OBJECT_PATH))
472                 return FALSE;
473
474         g_free (*param);
475         *param = g_variant_dup_string (value, NULL);
476         return TRUE;
477 }
478
479 static void
480 init_dbus (NMObject *object)
481 {
482         NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (object);
483         const NMPropertiesInfo property_info[] = {
484                 { NM_ACTIVE_CONNECTION_CONNECTION,           &priv->connection, NULL, NM_TYPE_REMOTE_CONNECTION },
485                 { NM_ACTIVE_CONNECTION_ID,                   &priv->id },
486                 { NM_ACTIVE_CONNECTION_UUID,                 &priv->uuid },
487                 { NM_ACTIVE_CONNECTION_TYPE,                 &priv->type },
488                 { "specific-object",                         &priv->specific_object_path, demarshal_specific_object_path },
489                 { NM_ACTIVE_CONNECTION_DEVICES,              &priv->devices, NULL, NM_TYPE_DEVICE },
490                 { NM_ACTIVE_CONNECTION_STATE,                &priv->state },
491                 { NM_ACTIVE_CONNECTION_DEFAULT,              &priv->is_default },
492                 { NM_ACTIVE_CONNECTION_IP4_CONFIG,           &priv->ip4_config, NULL, NM_TYPE_IP4_CONFIG },
493                 { NM_ACTIVE_CONNECTION_DHCP4_CONFIG,         &priv->dhcp4_config, NULL, NM_TYPE_DHCP4_CONFIG },
494                 { NM_ACTIVE_CONNECTION_DEFAULT6,             &priv->is_default6 },
495                 { NM_ACTIVE_CONNECTION_IP6_CONFIG,           &priv->ip6_config, NULL, NM_TYPE_IP6_CONFIG },
496                 { NM_ACTIVE_CONNECTION_DHCP6_CONFIG,         &priv->dhcp6_config, NULL, NM_TYPE_DHCP6_CONFIG },
497                 { NM_ACTIVE_CONNECTION_VPN,                  &priv->is_vpn },
498                 { NM_ACTIVE_CONNECTION_MASTER,               &priv->master, NULL, NM_TYPE_DEVICE },
499
500                 { NULL },
501         };
502
503         NM_OBJECT_CLASS (nm_active_connection_parent_class)->init_dbus (object);
504
505         _nm_object_register_properties (object,
506                                         NM_DBUS_INTERFACE_ACTIVE_CONNECTION,
507                                         property_info);
508 }
509
510
511 static void
512 nm_active_connection_class_init (NMActiveConnectionClass *ap_class)
513 {
514         GObjectClass *object_class = G_OBJECT_CLASS (ap_class);
515         NMObjectClass *nm_object_class = NM_OBJECT_CLASS (ap_class);
516
517         g_type_class_add_private (ap_class, sizeof (NMActiveConnectionPrivate));
518
519         _nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_ACTIVE_CONNECTION);
520
521         /* virtual methods */
522         object_class->get_property = get_property;
523         object_class->dispose = dispose;
524         object_class->finalize = finalize;
525
526         nm_object_class->init_dbus = init_dbus;
527
528         /* properties */
529
530         /**
531          * NMActiveConnection:connection:
532          *
533          * The connection that this is an active instance of.
534          **/
535         g_object_class_install_property
536                 (object_class, PROP_CONNECTION,
537                  g_param_spec_object (NM_ACTIVE_CONNECTION_CONNECTION, "", "",
538                                       NM_TYPE_REMOTE_CONNECTION,
539                                       G_PARAM_READABLE |
540                                       G_PARAM_STATIC_STRINGS));
541
542         /**
543          * NMActiveConnection:id:
544          *
545          * The active connection's ID
546          **/
547         g_object_class_install_property
548                 (object_class, PROP_ID,
549                  g_param_spec_string (NM_ACTIVE_CONNECTION_ID, "", "",
550                                       NULL,
551                                       G_PARAM_READABLE |
552                                       G_PARAM_STATIC_STRINGS));
553
554         /**
555          * NMActiveConnection:uuid:
556          *
557          * The active connection's UUID
558          **/
559         g_object_class_install_property
560                 (object_class, PROP_UUID,
561                  g_param_spec_string (NM_ACTIVE_CONNECTION_UUID, "", "",
562                                       NULL,
563                                       G_PARAM_READABLE |
564                                       G_PARAM_STATIC_STRINGS));
565
566         /**
567          * NMActiveConnection:type:
568          *
569          * The active connection's type
570          **/
571         g_object_class_install_property
572                 (object_class, PROP_TYPE,
573                  g_param_spec_string (NM_ACTIVE_CONNECTION_TYPE, "", "",
574                                       NULL,
575                                       G_PARAM_READABLE |
576                                       G_PARAM_STATIC_STRINGS));
577
578         /**
579          * NMActiveConnection:specific-object-path:
580          *
581          * The path to the "specific object" of the active connection; see
582          * nm_active_connection_get_specific_object_path() for more details.
583          **/
584         g_object_class_install_property
585                 (object_class, PROP_SPECIFIC_OBJECT_PATH,
586                  g_param_spec_string (NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT_PATH, "", "",
587                                       NULL,
588                                       G_PARAM_READABLE |
589                                       G_PARAM_STATIC_STRINGS));
590
591         /**
592          * NMActiveConnection:devices:
593          *
594          * The devices of the active connection.
595          *
596          * Element-type: NMDevice
597          **/
598         g_object_class_install_property
599                 (object_class, PROP_DEVICES,
600                  g_param_spec_boxed (NM_ACTIVE_CONNECTION_DEVICES, "", "",
601                                      G_TYPE_PTR_ARRAY,
602                                      G_PARAM_READABLE |
603                                      G_PARAM_STATIC_STRINGS));
604
605         /**
606          * NMActiveConnection:state:
607          *
608          * The state of the active connection.
609          **/
610         g_object_class_install_property
611                 (object_class, PROP_STATE,
612                  g_param_spec_enum (NM_ACTIVE_CONNECTION_STATE, "", "",
613                                     NM_TYPE_ACTIVE_CONNECTION_STATE,
614                                     NM_ACTIVE_CONNECTION_STATE_UNKNOWN,
615                                     G_PARAM_READABLE |
616                                     G_PARAM_STATIC_STRINGS));
617
618         /**
619          * NMActiveConnection:default:
620          *
621          * Whether the active connection is the default IPv4 one.
622          **/
623         g_object_class_install_property
624                 (object_class, PROP_DEFAULT,
625                  g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT, "", "",
626                                        FALSE,
627                                        G_PARAM_READABLE |
628                                        G_PARAM_STATIC_STRINGS));
629
630         /**
631          * NMActiveConnection:ip4-config:
632          *
633          * The IPv4 #NMIPConfig of the connection.
634          **/
635         g_object_class_install_property
636                 (object_class, PROP_IP4_CONFIG,
637                  g_param_spec_object (NM_ACTIVE_CONNECTION_IP4_CONFIG, "", "",
638                                       NM_TYPE_IP_CONFIG,
639                                       G_PARAM_READABLE |
640                                       G_PARAM_STATIC_STRINGS));
641
642         /**
643          * NMActiveConnection:dhcp4-config:
644          *
645          * The IPv4 #NMDhcpConfig of the connection.
646          **/
647         g_object_class_install_property
648                 (object_class, PROP_DHCP4_CONFIG,
649                  g_param_spec_object (NM_ACTIVE_CONNECTION_DHCP4_CONFIG, "", "",
650                                       NM_TYPE_DHCP_CONFIG,
651                                       G_PARAM_READABLE |
652                                       G_PARAM_STATIC_STRINGS));
653
654         /**
655          * NMActiveConnection:default6:
656          *
657          * Whether the active connection is the default IPv6 one.
658          **/
659         g_object_class_install_property
660                 (object_class, PROP_DEFAULT6,
661                  g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT6, "", "",
662                                        FALSE,
663                                        G_PARAM_READABLE |
664                                        G_PARAM_STATIC_STRINGS));
665
666         /**
667          * NMActiveConnection:ip6-config:
668          *
669          * The IPv6 #NMIPConfig of the connection.
670          **/
671         g_object_class_install_property
672                 (object_class, PROP_IP6_CONFIG,
673                  g_param_spec_object (NM_ACTIVE_CONNECTION_IP6_CONFIG, "", "",
674                                       NM_TYPE_IP_CONFIG,
675                                       G_PARAM_READABLE |
676                                       G_PARAM_STATIC_STRINGS));
677
678         /**
679          * NMActiveConnection:dhcp6-config:
680          *
681          * The IPv6 #NMDhcpConfig of the connection.
682          **/
683         g_object_class_install_property
684                 (object_class, PROP_DHCP6_CONFIG,
685                  g_param_spec_object (NM_ACTIVE_CONNECTION_DHCP6_CONFIG, "", "",
686                                       NM_TYPE_DHCP_CONFIG,
687                                       G_PARAM_READABLE |
688                                       G_PARAM_STATIC_STRINGS));
689
690         /**
691          * NMActiveConnection:vpn:
692          *
693          * Whether the active connection is a VPN connection.
694          **/
695         g_object_class_install_property
696                 (object_class, PROP_VPN,
697                  g_param_spec_boolean (NM_ACTIVE_CONNECTION_VPN, "", "",
698                                        FALSE,
699                                        G_PARAM_READABLE |
700                                        G_PARAM_STATIC_STRINGS));
701
702         /**
703          * NMActiveConnection:master:
704          *
705          * The master device if one exists.
706          **/
707         g_object_class_install_property
708                 (object_class, PROP_MASTER,
709                  g_param_spec_object (NM_ACTIVE_CONNECTION_MASTER, "", "",
710                                       NM_TYPE_DEVICE,
711                                       G_PARAM_READABLE |
712                                       G_PARAM_STATIC_STRINGS));
713 }