2014-07-24 08:53:33 -04:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
|
|
|
|
/*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
|
* Boston, MA 02110-1301 USA.
|
|
|
|
|
*
|
|
|
|
|
* Copyright 2007 - 2014 Red Hat, Inc.
|
|
|
|
|
* Copyright 2008 Novell, Inc.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
2014-07-05 16:23:30 -04:00
|
|
|
#include "nm-dbus-interface.h"
|
2014-07-24 08:53:33 -04:00
|
|
|
#include "nm-active-connection.h"
|
|
|
|
|
#include "nm-object-private.h"
|
2014-08-26 08:31:04 -04:00
|
|
|
#include "nm-core-internal.h"
|
2014-07-24 08:53:33 -04:00
|
|
|
#include "nm-device.h"
|
|
|
|
|
#include "nm-device-private.h"
|
|
|
|
|
#include "nm-connection.h"
|
|
|
|
|
#include "nm-vpn-connection.h"
|
|
|
|
|
#include "nm-glib-compat.h"
|
2014-08-19 09:52:41 -04:00
|
|
|
#include "nm-dbus-helpers.h"
|
2014-10-09 09:12:42 -04:00
|
|
|
#include "nm-dhcp4-config.h"
|
|
|
|
|
#include "nm-dhcp6-config.h"
|
|
|
|
|
#include "nm-ip4-config.h"
|
|
|
|
|
#include "nm-ip6-config.h"
|
2014-10-09 09:24:05 -04:00
|
|
|
#include "nm-remote-connection.h"
|
2014-07-24 08:53:33 -04:00
|
|
|
|
2014-09-10 13:51:53 -04:00
|
|
|
static GType _nm_active_connection_decide_type (GVariant *value);
|
2014-07-24 08:53:33 -04:00
|
|
|
|
|
|
|
|
G_DEFINE_TYPE_WITH_CODE (NMActiveConnection, nm_active_connection, NM_TYPE_OBJECT,
|
|
|
|
|
_nm_object_register_type_func (g_define_type_id,
|
2014-08-18 18:12:01 -04:00
|
|
|
_nm_active_connection_decide_type,
|
|
|
|
|
NM_DBUS_INTERFACE_ACTIVE_CONNECTION,
|
|
|
|
|
"Vpn");
|
2014-07-24 08:53:33 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
#define NM_ACTIVE_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_ACTIVE_CONNECTION, NMActiveConnectionPrivate))
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
2014-10-09 09:24:05 -04:00
|
|
|
NMRemoteConnection *connection;
|
2014-07-24 08:53:33 -04:00
|
|
|
char *id;
|
|
|
|
|
char *uuid;
|
|
|
|
|
char *type;
|
2014-10-09 09:24:05 -04:00
|
|
|
char *specific_object_path;
|
2014-07-24 08:53:33 -04:00
|
|
|
GPtrArray *devices;
|
|
|
|
|
NMActiveConnectionState state;
|
|
|
|
|
gboolean is_default;
|
|
|
|
|
NMIP4Config *ip4_config;
|
libnm, core, cli, tui: fix the capitalization of various types
GLib/Gtk have mostly settled on the convention that two-letter
acronyms in type names remain all-caps (eg, "IO"), but longer acronyms
become initial-caps-only (eg, "Tcp").
NM was inconsistent, with most long acronyms using initial caps only
(Adsl, Cdma, Dcb, Gsm, Olpc, Vlan), but others using all caps (DHCP,
PPP, PPPOE, VPN). Fix libnm and src/ to use initial-caps only for all
three-or-more-letter-long acronyms (and update nmcli and nmtui for the
libnm changes).
2014-06-26 13:44:36 -04:00
|
|
|
NMDhcp4Config *dhcp4_config;
|
2014-07-24 08:53:33 -04:00
|
|
|
gboolean is_default6;
|
|
|
|
|
NMIP6Config *ip6_config;
|
libnm, core, cli, tui: fix the capitalization of various types
GLib/Gtk have mostly settled on the convention that two-letter
acronyms in type names remain all-caps (eg, "IO"), but longer acronyms
become initial-caps-only (eg, "Tcp").
NM was inconsistent, with most long acronyms using initial caps only
(Adsl, Cdma, Dcb, Gsm, Olpc, Vlan), but others using all caps (DHCP,
PPP, PPPOE, VPN). Fix libnm and src/ to use initial-caps only for all
three-or-more-letter-long acronyms (and update nmcli and nmtui for the
libnm changes).
2014-06-26 13:44:36 -04:00
|
|
|
NMDhcp6Config *dhcp6_config;
|
2014-07-24 08:53:33 -04:00
|
|
|
gboolean is_vpn;
|
2014-10-09 09:24:05 -04:00
|
|
|
NMDevice *master;
|
2014-07-24 08:53:33 -04:00
|
|
|
} NMActiveConnectionPrivate;
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
PROP_0,
|
|
|
|
|
PROP_CONNECTION,
|
|
|
|
|
PROP_ID,
|
|
|
|
|
PROP_UUID,
|
|
|
|
|
PROP_TYPE,
|
2014-10-09 09:24:05 -04:00
|
|
|
PROP_SPECIFIC_OBJECT_PATH,
|
2014-07-24 08:53:33 -04:00
|
|
|
PROP_DEVICES,
|
|
|
|
|
PROP_STATE,
|
|
|
|
|
PROP_DEFAULT,
|
|
|
|
|
PROP_IP4_CONFIG,
|
|
|
|
|
PROP_DHCP4_CONFIG,
|
|
|
|
|
PROP_DEFAULT6,
|
|
|
|
|
PROP_IP6_CONFIG,
|
|
|
|
|
PROP_DHCP6_CONFIG,
|
|
|
|
|
PROP_VPN,
|
|
|
|
|
PROP_MASTER,
|
|
|
|
|
|
|
|
|
|
LAST_PROP
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static GType
|
2014-09-10 13:51:53 -04:00
|
|
|
_nm_active_connection_decide_type (GVariant *value)
|
2014-07-24 08:53:33 -04:00
|
|
|
{
|
2014-08-18 18:12:01 -04:00
|
|
|
/* @value is the value of the o.fd.NM.ActiveConnection property "VPN" */
|
2014-09-10 13:51:53 -04:00
|
|
|
if (g_variant_get_boolean (value))
|
2014-08-18 18:12:01 -04:00
|
|
|
return NM_TYPE_VPN_CONNECTION;
|
|
|
|
|
else
|
|
|
|
|
return NM_TYPE_ACTIVE_CONNECTION;
|
2014-07-24 08:53:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* nm_active_connection_get_connection:
|
|
|
|
|
* @connection: a #NMActiveConnection
|
|
|
|
|
*
|
2014-10-09 09:24:05 -04:00
|
|
|
* Gets the #NMRemoteConnection associated with @connection.
|
2014-07-24 08:53:33 -04:00
|
|
|
*
|
2014-10-09 09:24:05 -04:00
|
|
|
* Returns: (transfer none): the #NMRemoteConnection which this
|
|
|
|
|
* #NMActiveConnection is an active instance of.
|
2014-07-24 08:53:33 -04:00
|
|
|
**/
|
2014-10-09 09:24:05 -04:00
|
|
|
NMRemoteConnection *
|
2014-07-24 08:53:33 -04:00
|
|
|
nm_active_connection_get_connection (NMActiveConnection *connection)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
|
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->connection;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* nm_active_connection_get_id:
|
|
|
|
|
* @connection: a #NMActiveConnection
|
|
|
|
|
*
|
|
|
|
|
* Gets the #NMConnection's ID.
|
|
|
|
|
*
|
|
|
|
|
* Returns: the ID of the #NMConnection that backs the #NMActiveConnection.
|
|
|
|
|
* This is the internal string used by the connection, and must not be modified.
|
|
|
|
|
**/
|
|
|
|
|
const char *
|
|
|
|
|
nm_active_connection_get_id (NMActiveConnection *connection)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
|
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* nm_active_connection_get_uuid:
|
|
|
|
|
* @connection: a #NMActiveConnection
|
|
|
|
|
*
|
|
|
|
|
* Gets the #NMConnection's UUID.
|
|
|
|
|
*
|
|
|
|
|
* Returns: the UUID of the #NMConnection that backs the #NMActiveConnection.
|
|
|
|
|
* This is the internal string used by the connection, and must not be modified.
|
|
|
|
|
**/
|
|
|
|
|
const char *
|
|
|
|
|
nm_active_connection_get_uuid (NMActiveConnection *connection)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
|
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->uuid;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* nm_active_connection_get_connection_type:
|
|
|
|
|
* @connection: a #NMActiveConnection
|
|
|
|
|
*
|
|
|
|
|
* Gets the #NMConnection's type.
|
|
|
|
|
*
|
|
|
|
|
* Returns: the type of the #NMConnection that backs the #NMActiveConnection.
|
|
|
|
|
* This is the internal string used by the connection, and must not be modified.
|
|
|
|
|
**/
|
|
|
|
|
const char *
|
|
|
|
|
nm_active_connection_get_connection_type (NMActiveConnection *connection)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
|
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2014-10-09 09:24:05 -04:00
|
|
|
* nm_active_connection_get_specific_object_path:
|
2014-07-24 08:53:33 -04:00
|
|
|
* @connection: a #NMActiveConnection
|
|
|
|
|
*
|
2014-10-09 09:24:05 -04:00
|
|
|
* Gets the path of the "specific object" used at activation.
|
|
|
|
|
*
|
|
|
|
|
* Currently there is no single method that will allow you to automatically turn
|
|
|
|
|
* this into an appropriate #NMObject; you need to know what kind of object it
|
|
|
|
|
* is based on other information. (Eg, if @connection corresponds to a Wi-Fi
|
|
|
|
|
* connection, then the specific object will be an #NMAccessPoint, and you can
|
|
|
|
|
* resolve it with nm_device_wifi_get_access_point_by_path().)
|
2014-07-24 08:53:33 -04:00
|
|
|
*
|
2014-10-09 09:24:05 -04:00
|
|
|
* Returns: the specific object's D-Bus path. This is the internal string used
|
|
|
|
|
* by the connection, and must not be modified.
|
2014-07-24 08:53:33 -04:00
|
|
|
**/
|
|
|
|
|
const char *
|
2014-10-09 09:24:05 -04:00
|
|
|
nm_active_connection_get_specific_object_path (NMActiveConnection *connection)
|
2014-07-24 08:53:33 -04:00
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
|
2014-10-09 09:24:05 -04:00
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->specific_object_path;
|
2014-07-24 08:53:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* nm_active_connection_get_devices:
|
|
|
|
|
* @connection: a #NMActiveConnection
|
|
|
|
|
*
|
|
|
|
|
* Gets the #NMDevices used for the active connections.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (element-type NMDevice): the #GPtrArray containing #NMDevices.
|
|
|
|
|
* This is the internal copy used by the connection, and must not be modified.
|
|
|
|
|
**/
|
|
|
|
|
const GPtrArray *
|
|
|
|
|
nm_active_connection_get_devices (NMActiveConnection *connection)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
|
2014-08-25 10:33:53 -04:00
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->devices;
|
2014-07-24 08:53:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* nm_active_connection_get_state:
|
|
|
|
|
* @connection: a #NMActiveConnection
|
|
|
|
|
*
|
|
|
|
|
* Gets the active connection's state.
|
|
|
|
|
*
|
|
|
|
|
* Returns: the state
|
|
|
|
|
**/
|
|
|
|
|
NMActiveConnectionState
|
|
|
|
|
nm_active_connection_get_state (NMActiveConnection *connection)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NM_ACTIVE_CONNECTION_STATE_UNKNOWN);
|
|
|
|
|
|
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->state;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* nm_active_connection_get_default:
|
|
|
|
|
* @connection: a #NMActiveConnection
|
|
|
|
|
*
|
|
|
|
|
* Whether the active connection is the default IPv4 one (that is, is used for
|
|
|
|
|
* the default IPv4 route and DNS information).
|
|
|
|
|
*
|
|
|
|
|
* Returns: %TRUE if the active connection is the default IPv4 connection
|
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
nm_active_connection_get_default (NMActiveConnection *connection)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), FALSE);
|
|
|
|
|
|
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->is_default;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* nm_active_connection_get_ip4_config:
|
|
|
|
|
* @connection: an #NMActiveConnection
|
|
|
|
|
*
|
|
|
|
|
* Gets the current #NMIP4Config associated with the #NMActiveConnection.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (transfer none): the #NMIP4Config, or %NULL if the
|
|
|
|
|
* connection is not in the %NM_ACTIVE_CONNECTION_STATE_ACTIVATED
|
|
|
|
|
* state.
|
|
|
|
|
**/
|
|
|
|
|
NMIP4Config *
|
|
|
|
|
nm_active_connection_get_ip4_config (NMActiveConnection *connection)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
|
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->ip4_config;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* nm_active_connection_get_dhcp4_config:
|
|
|
|
|
* @connection: an #NMActiveConnection
|
|
|
|
|
*
|
libnm, core, cli, tui: fix the capitalization of various types
GLib/Gtk have mostly settled on the convention that two-letter
acronyms in type names remain all-caps (eg, "IO"), but longer acronyms
become initial-caps-only (eg, "Tcp").
NM was inconsistent, with most long acronyms using initial caps only
(Adsl, Cdma, Dcb, Gsm, Olpc, Vlan), but others using all caps (DHCP,
PPP, PPPOE, VPN). Fix libnm and src/ to use initial-caps only for all
three-or-more-letter-long acronyms (and update nmcli and nmtui for the
libnm changes).
2014-06-26 13:44:36 -04:00
|
|
|
* Gets the current #NMDhcp4Config (if any) associated with the
|
2014-07-24 08:53:33 -04:00
|
|
|
* #NMActiveConnection.
|
|
|
|
|
*
|
libnm, core, cli, tui: fix the capitalization of various types
GLib/Gtk have mostly settled on the convention that two-letter
acronyms in type names remain all-caps (eg, "IO"), but longer acronyms
become initial-caps-only (eg, "Tcp").
NM was inconsistent, with most long acronyms using initial caps only
(Adsl, Cdma, Dcb, Gsm, Olpc, Vlan), but others using all caps (DHCP,
PPP, PPPOE, VPN). Fix libnm and src/ to use initial-caps only for all
three-or-more-letter-long acronyms (and update nmcli and nmtui for the
libnm changes).
2014-06-26 13:44:36 -04:00
|
|
|
* Returns: (transfer none): the #NMDhcp4Config, or %NULL if the
|
2014-07-24 08:53:33 -04:00
|
|
|
* connection does not use DHCP, or is not in the
|
|
|
|
|
* %NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.
|
|
|
|
|
**/
|
libnm, core, cli, tui: fix the capitalization of various types
GLib/Gtk have mostly settled on the convention that two-letter
acronyms in type names remain all-caps (eg, "IO"), but longer acronyms
become initial-caps-only (eg, "Tcp").
NM was inconsistent, with most long acronyms using initial caps only
(Adsl, Cdma, Dcb, Gsm, Olpc, Vlan), but others using all caps (DHCP,
PPP, PPPOE, VPN). Fix libnm and src/ to use initial-caps only for all
three-or-more-letter-long acronyms (and update nmcli and nmtui for the
libnm changes).
2014-06-26 13:44:36 -04:00
|
|
|
NMDhcp4Config *
|
2014-07-24 08:53:33 -04:00
|
|
|
nm_active_connection_get_dhcp4_config (NMActiveConnection *connection)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
|
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->dhcp4_config;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* nm_active_connection_get_default6:
|
|
|
|
|
* @connection: a #NMActiveConnection
|
|
|
|
|
*
|
|
|
|
|
* Whether the active connection is the default IPv6 one (that is, is used for
|
|
|
|
|
* the default IPv6 route and DNS information).
|
|
|
|
|
*
|
|
|
|
|
* Returns: %TRUE if the active connection is the default IPv6 connection
|
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
nm_active_connection_get_default6 (NMActiveConnection *connection)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), FALSE);
|
|
|
|
|
|
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->is_default6;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* nm_active_connection_get_ip6_config:
|
|
|
|
|
* @connection: an #NMActiveConnection
|
|
|
|
|
*
|
|
|
|
|
* Gets the current #NMIP6Config associated with the #NMActiveConnection.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (transfer none): the #NMIP6Config, or %NULL if the
|
|
|
|
|
* connection is not in the %NM_ACTIVE_CONNECTION_STATE_ACTIVATED
|
|
|
|
|
* state.
|
|
|
|
|
**/
|
|
|
|
|
NMIP6Config *
|
|
|
|
|
nm_active_connection_get_ip6_config (NMActiveConnection *connection)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
|
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->ip6_config;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* nm_active_connection_get_dhcp6_config:
|
|
|
|
|
* @connection: an #NMActiveConnection
|
|
|
|
|
*
|
libnm, core, cli, tui: fix the capitalization of various types
GLib/Gtk have mostly settled on the convention that two-letter
acronyms in type names remain all-caps (eg, "IO"), but longer acronyms
become initial-caps-only (eg, "Tcp").
NM was inconsistent, with most long acronyms using initial caps only
(Adsl, Cdma, Dcb, Gsm, Olpc, Vlan), but others using all caps (DHCP,
PPP, PPPOE, VPN). Fix libnm and src/ to use initial-caps only for all
three-or-more-letter-long acronyms (and update nmcli and nmtui for the
libnm changes).
2014-06-26 13:44:36 -04:00
|
|
|
* Gets the current #NMDhcp6Config (if any) associated with the
|
2014-07-24 08:53:33 -04:00
|
|
|
* #NMActiveConnection.
|
|
|
|
|
*
|
libnm, core, cli, tui: fix the capitalization of various types
GLib/Gtk have mostly settled on the convention that two-letter
acronyms in type names remain all-caps (eg, "IO"), but longer acronyms
become initial-caps-only (eg, "Tcp").
NM was inconsistent, with most long acronyms using initial caps only
(Adsl, Cdma, Dcb, Gsm, Olpc, Vlan), but others using all caps (DHCP,
PPP, PPPOE, VPN). Fix libnm and src/ to use initial-caps only for all
three-or-more-letter-long acronyms (and update nmcli and nmtui for the
libnm changes).
2014-06-26 13:44:36 -04:00
|
|
|
* Returns: (transfer none): the #NMDhcp6Config, or %NULL if the
|
2014-07-24 08:53:33 -04:00
|
|
|
* connection does not use DHCPv6, or is not in the
|
|
|
|
|
* %NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.
|
|
|
|
|
**/
|
libnm, core, cli, tui: fix the capitalization of various types
GLib/Gtk have mostly settled on the convention that two-letter
acronyms in type names remain all-caps (eg, "IO"), but longer acronyms
become initial-caps-only (eg, "Tcp").
NM was inconsistent, with most long acronyms using initial caps only
(Adsl, Cdma, Dcb, Gsm, Olpc, Vlan), but others using all caps (DHCP,
PPP, PPPOE, VPN). Fix libnm and src/ to use initial-caps only for all
three-or-more-letter-long acronyms (and update nmcli and nmtui for the
libnm changes).
2014-06-26 13:44:36 -04:00
|
|
|
NMDhcp6Config *
|
2014-07-24 08:53:33 -04:00
|
|
|
nm_active_connection_get_dhcp6_config (NMActiveConnection *connection)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
|
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->dhcp6_config;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* nm_active_connection_get_vpn:
|
|
|
|
|
* @connection: a #NMActiveConnection
|
|
|
|
|
*
|
|
|
|
|
* Whether the active connection is a VPN connection.
|
|
|
|
|
*
|
|
|
|
|
* Returns: %TRUE if the active connection is a VPN connection
|
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
nm_active_connection_get_vpn (NMActiveConnection *connection)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), FALSE);
|
|
|
|
|
|
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->is_vpn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* nm_active_connection_get_master:
|
|
|
|
|
* @connection: a #NMActiveConnection
|
|
|
|
|
*
|
2014-10-09 09:24:05 -04:00
|
|
|
* Gets the master #NMDevice of the connection.
|
2014-07-24 08:53:33 -04:00
|
|
|
*
|
2014-10-09 09:24:05 -04:00
|
|
|
* Returns: (transfer none): the master #NMDevice of the #NMActiveConnection.
|
2014-07-24 08:53:33 -04:00
|
|
|
**/
|
2014-10-09 09:24:05 -04:00
|
|
|
NMDevice *
|
2014-07-24 08:53:33 -04:00
|
|
|
nm_active_connection_get_master (NMActiveConnection *connection)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
|
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->master;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2014-10-06 21:16:00 -04:00
|
|
|
nm_active_connection_init (NMActiveConnection *connection)
|
2014-07-24 08:53:33 -04:00
|
|
|
{
|
2014-10-06 21:16:00 -04:00
|
|
|
NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (connection);
|
|
|
|
|
|
|
|
|
|
priv->devices = g_ptr_array_new ();
|
2014-07-24 08:53:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
dispose (GObject *object)
|
|
|
|
|
{
|
|
|
|
|
NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (object);
|
|
|
|
|
|
2014-08-26 08:31:04 -04:00
|
|
|
g_clear_pointer (&priv->devices, g_ptr_array_unref);
|
2014-07-24 08:53:33 -04:00
|
|
|
|
2014-10-09 09:24:05 -04:00
|
|
|
g_clear_object (&priv->connection);
|
|
|
|
|
g_clear_object (&priv->master);
|
2014-07-24 08:53:33 -04:00
|
|
|
g_clear_object (&priv->ip4_config);
|
|
|
|
|
g_clear_object (&priv->dhcp4_config);
|
|
|
|
|
g_clear_object (&priv->ip6_config);
|
|
|
|
|
g_clear_object (&priv->dhcp6_config);
|
|
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (nm_active_connection_parent_class)->dispose (object);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
finalize (GObject *object)
|
|
|
|
|
{
|
|
|
|
|
NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (object);
|
|
|
|
|
|
|
|
|
|
g_free (priv->id);
|
|
|
|
|
g_free (priv->uuid);
|
|
|
|
|
g_free (priv->type);
|
2014-10-09 09:24:05 -04:00
|
|
|
g_free (priv->specific_object_path);
|
2014-07-24 08:53:33 -04:00
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (nm_active_connection_parent_class)->finalize (object);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
get_property (GObject *object,
|
|
|
|
|
guint prop_id,
|
|
|
|
|
GValue *value,
|
|
|
|
|
GParamSpec *pspec)
|
|
|
|
|
{
|
|
|
|
|
NMActiveConnection *self = NM_ACTIVE_CONNECTION (object);
|
|
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
|
case PROP_CONNECTION:
|
2014-10-09 09:24:05 -04:00
|
|
|
g_value_set_object (value, nm_active_connection_get_connection (self));
|
2014-07-24 08:53:33 -04:00
|
|
|
break;
|
|
|
|
|
case PROP_ID:
|
|
|
|
|
g_value_set_string (value, nm_active_connection_get_id (self));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_UUID:
|
|
|
|
|
g_value_set_string (value, nm_active_connection_get_uuid (self));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_TYPE:
|
|
|
|
|
g_value_set_string (value, nm_active_connection_get_connection_type (self));
|
|
|
|
|
break;
|
2014-10-09 09:24:05 -04:00
|
|
|
case PROP_SPECIFIC_OBJECT_PATH:
|
|
|
|
|
g_value_set_string (value, nm_active_connection_get_specific_object_path (self));
|
2014-07-24 08:53:33 -04:00
|
|
|
break;
|
|
|
|
|
case PROP_DEVICES:
|
2014-08-26 08:31:04 -04:00
|
|
|
g_value_take_boxed (value, _nm_utils_copy_object_array (nm_active_connection_get_devices (self)));
|
2014-07-24 08:53:33 -04:00
|
|
|
break;
|
|
|
|
|
case PROP_STATE:
|
2014-06-26 16:47:46 -04:00
|
|
|
g_value_set_enum (value, nm_active_connection_get_state (self));
|
2014-07-24 08:53:33 -04:00
|
|
|
break;
|
|
|
|
|
case PROP_DEFAULT:
|
|
|
|
|
g_value_set_boolean (value, nm_active_connection_get_default (self));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_IP4_CONFIG:
|
|
|
|
|
g_value_set_object (value, nm_active_connection_get_ip4_config (self));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_DHCP4_CONFIG:
|
|
|
|
|
g_value_set_object (value, nm_active_connection_get_dhcp4_config (self));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_DEFAULT6:
|
|
|
|
|
g_value_set_boolean (value, nm_active_connection_get_default6 (self));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_IP6_CONFIG:
|
|
|
|
|
g_value_set_object (value, nm_active_connection_get_ip6_config (self));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_DHCP6_CONFIG:
|
|
|
|
|
g_value_set_object (value, nm_active_connection_get_dhcp6_config (self));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_VPN:
|
|
|
|
|
g_value_set_boolean (value, nm_active_connection_get_vpn (self));
|
|
|
|
|
break;
|
|
|
|
|
case PROP_MASTER:
|
2014-10-09 09:24:05 -04:00
|
|
|
g_value_set_object (value, nm_active_connection_get_master (self));
|
2014-07-24 08:53:33 -04:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-21 09:18:47 -04:00
|
|
|
static gboolean
|
|
|
|
|
demarshal_specific_object_path (NMObject *object, GParamSpec *pspec, GVariant *value, gpointer field)
|
|
|
|
|
{
|
|
|
|
|
char **param = (char **) field;
|
|
|
|
|
|
|
|
|
|
/* We have to demarshal this manually, because the D-Bus property name
|
|
|
|
|
* ("SpecificObject"), doesn't match the object property name
|
|
|
|
|
* ("specific-object-path"). (The name "specific-object" is reserved for
|
|
|
|
|
* future use as an NMObject-valued property.)
|
|
|
|
|
*/
|
|
|
|
|
if (!g_variant_is_of_type (value, G_VARIANT_TYPE_OBJECT_PATH))
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
|
g_free (*param);
|
|
|
|
|
*param = g_variant_dup_string (value, NULL);
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-24 08:53:33 -04:00
|
|
|
static void
|
2014-05-15 14:24:56 -04:00
|
|
|
init_dbus (NMObject *object)
|
2014-07-24 08:53:33 -04:00
|
|
|
{
|
2014-05-15 14:24:56 -04:00
|
|
|
NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (object);
|
2014-07-24 08:53:33 -04:00
|
|
|
const NMPropertiesInfo property_info[] = {
|
2014-10-09 09:24:05 -04:00
|
|
|
{ NM_ACTIVE_CONNECTION_CONNECTION, &priv->connection, NULL, NM_TYPE_REMOTE_CONNECTION },
|
|
|
|
|
{ NM_ACTIVE_CONNECTION_ID, &priv->id },
|
|
|
|
|
{ NM_ACTIVE_CONNECTION_UUID, &priv->uuid },
|
|
|
|
|
{ NM_ACTIVE_CONNECTION_TYPE, &priv->type },
|
2014-10-21 09:18:47 -04:00
|
|
|
{ "specific-object", &priv->specific_object_path, demarshal_specific_object_path },
|
2014-10-09 09:24:05 -04:00
|
|
|
{ NM_ACTIVE_CONNECTION_DEVICES, &priv->devices, NULL, NM_TYPE_DEVICE },
|
|
|
|
|
{ NM_ACTIVE_CONNECTION_STATE, &priv->state },
|
|
|
|
|
{ NM_ACTIVE_CONNECTION_DEFAULT, &priv->is_default },
|
|
|
|
|
{ NM_ACTIVE_CONNECTION_IP4_CONFIG, &priv->ip4_config, NULL, NM_TYPE_IP4_CONFIG },
|
|
|
|
|
{ NM_ACTIVE_CONNECTION_DHCP4_CONFIG, &priv->dhcp4_config, NULL, NM_TYPE_DHCP4_CONFIG },
|
|
|
|
|
{ NM_ACTIVE_CONNECTION_DEFAULT6, &priv->is_default6 },
|
|
|
|
|
{ NM_ACTIVE_CONNECTION_IP6_CONFIG, &priv->ip6_config, NULL, NM_TYPE_IP6_CONFIG },
|
|
|
|
|
{ NM_ACTIVE_CONNECTION_DHCP6_CONFIG, &priv->dhcp6_config, NULL, NM_TYPE_DHCP6_CONFIG },
|
|
|
|
|
{ NM_ACTIVE_CONNECTION_VPN, &priv->is_vpn },
|
|
|
|
|
{ NM_ACTIVE_CONNECTION_MASTER, &priv->master, NULL, NM_TYPE_DEVICE },
|
2014-07-24 08:53:33 -04:00
|
|
|
|
|
|
|
|
{ NULL },
|
|
|
|
|
};
|
|
|
|
|
|
2014-05-15 14:24:56 -04:00
|
|
|
NM_OBJECT_CLASS (nm_active_connection_parent_class)->init_dbus (object);
|
|
|
|
|
|
|
|
|
|
_nm_object_register_properties (object,
|
2014-08-18 14:17:52 -04:00
|
|
|
NM_DBUS_INTERFACE_ACTIVE_CONNECTION,
|
2014-07-24 08:53:33 -04:00
|
|
|
property_info);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
nm_active_connection_class_init (NMActiveConnectionClass *ap_class)
|
|
|
|
|
{
|
|
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (ap_class);
|
2014-05-15 14:24:56 -04:00
|
|
|
NMObjectClass *nm_object_class = NM_OBJECT_CLASS (ap_class);
|
2014-07-24 08:53:33 -04:00
|
|
|
|
|
|
|
|
g_type_class_add_private (ap_class, sizeof (NMActiveConnectionPrivate));
|
|
|
|
|
|
2014-08-18 14:17:52 -04:00
|
|
|
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_ACTIVE_CONNECTION);
|
|
|
|
|
|
2014-07-24 08:53:33 -04:00
|
|
|
/* virtual methods */
|
|
|
|
|
object_class->get_property = get_property;
|
|
|
|
|
object_class->dispose = dispose;
|
|
|
|
|
object_class->finalize = finalize;
|
|
|
|
|
|
2014-05-15 14:24:56 -04:00
|
|
|
nm_object_class->init_dbus = init_dbus;
|
|
|
|
|
|
2014-07-24 08:53:33 -04:00
|
|
|
/* properties */
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* NMActiveConnection:connection:
|
|
|
|
|
*
|
2014-10-09 09:24:05 -04:00
|
|
|
* The connection that this is an active instance of.
|
2014-07-24 08:53:33 -04:00
|
|
|
**/
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_CONNECTION,
|
2014-10-09 09:24:05 -04:00
|
|
|
g_param_spec_object (NM_ACTIVE_CONNECTION_CONNECTION, "", "",
|
|
|
|
|
NM_TYPE_REMOTE_CONNECTION,
|
2014-07-24 08:53:33 -04:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* NMActiveConnection:id:
|
|
|
|
|
*
|
|
|
|
|
* The active connection's ID
|
|
|
|
|
**/
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_ID,
|
|
|
|
|
g_param_spec_string (NM_ACTIVE_CONNECTION_ID, "", "",
|
|
|
|
|
NULL,
|
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* NMActiveConnection:uuid:
|
|
|
|
|
*
|
|
|
|
|
* The active connection's UUID
|
|
|
|
|
**/
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_UUID,
|
|
|
|
|
g_param_spec_string (NM_ACTIVE_CONNECTION_UUID, "", "",
|
|
|
|
|
NULL,
|
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* NMActiveConnection:type:
|
|
|
|
|
*
|
|
|
|
|
* The active connection's type
|
|
|
|
|
**/
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_TYPE,
|
|
|
|
|
g_param_spec_string (NM_ACTIVE_CONNECTION_TYPE, "", "",
|
|
|
|
|
NULL,
|
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
|
|
|
|
|
|
|
|
|
/**
|
2014-10-09 09:24:05 -04:00
|
|
|
* NMActiveConnection:specific-object-path:
|
2014-07-24 08:53:33 -04:00
|
|
|
*
|
2014-10-09 09:24:05 -04:00
|
|
|
* The path to the "specific object" of the active connection; see
|
|
|
|
|
* nm_active_connection_get_specific_object_path() for more details.
|
2014-07-24 08:53:33 -04:00
|
|
|
**/
|
|
|
|
|
g_object_class_install_property
|
2014-10-09 09:24:05 -04:00
|
|
|
(object_class, PROP_SPECIFIC_OBJECT_PATH,
|
|
|
|
|
g_param_spec_string (NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT_PATH, "", "",
|
2014-07-24 08:53:33 -04:00
|
|
|
NULL,
|
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
|
|
|
|
|
|
|
|
|
/**
|
2014-08-26 08:31:04 -04:00
|
|
|
* NMActiveConnection:devices:
|
|
|
|
|
*
|
|
|
|
|
* The devices of the active connection.
|
2014-07-24 08:53:33 -04:00
|
|
|
*
|
2014-08-26 08:31:04 -04:00
|
|
|
* Element-type: NMDevice
|
2014-07-24 08:53:33 -04:00
|
|
|
**/
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_DEVICES,
|
|
|
|
|
g_param_spec_boxed (NM_ACTIVE_CONNECTION_DEVICES, "", "",
|
2014-08-26 08:31:04 -04:00
|
|
|
G_TYPE_PTR_ARRAY,
|
2014-07-24 08:53:33 -04:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* NMActiveConnection:state:
|
|
|
|
|
*
|
|
|
|
|
* The state of the active connection.
|
|
|
|
|
**/
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_STATE,
|
2014-06-26 16:47:46 -04:00
|
|
|
g_param_spec_enum (NM_ACTIVE_CONNECTION_STATE, "", "",
|
|
|
|
|
NM_TYPE_ACTIVE_CONNECTION_STATE,
|
2014-07-24 08:53:33 -04:00
|
|
|
NM_ACTIVE_CONNECTION_STATE_UNKNOWN,
|
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* NMActiveConnection:default:
|
|
|
|
|
*
|
|
|
|
|
* Whether the active connection is the default IPv4 one.
|
|
|
|
|
**/
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_DEFAULT,
|
|
|
|
|
g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT, "", "",
|
|
|
|
|
FALSE,
|
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* NMActiveConnection:ip4-config:
|
|
|
|
|
*
|
|
|
|
|
* The #NMIP4Config of the connection.
|
|
|
|
|
**/
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_IP4_CONFIG,
|
|
|
|
|
g_param_spec_object (NM_ACTIVE_CONNECTION_IP4_CONFIG, "", "",
|
|
|
|
|
NM_TYPE_IP4_CONFIG,
|
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* NMActiveConnection:dhcp4-config:
|
|
|
|
|
*
|
libnm, core, cli, tui: fix the capitalization of various types
GLib/Gtk have mostly settled on the convention that two-letter
acronyms in type names remain all-caps (eg, "IO"), but longer acronyms
become initial-caps-only (eg, "Tcp").
NM was inconsistent, with most long acronyms using initial caps only
(Adsl, Cdma, Dcb, Gsm, Olpc, Vlan), but others using all caps (DHCP,
PPP, PPPOE, VPN). Fix libnm and src/ to use initial-caps only for all
three-or-more-letter-long acronyms (and update nmcli and nmtui for the
libnm changes).
2014-06-26 13:44:36 -04:00
|
|
|
* The #NMDhcp4Config of the connection.
|
2014-07-24 08:53:33 -04:00
|
|
|
**/
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_DHCP4_CONFIG,
|
|
|
|
|
g_param_spec_object (NM_ACTIVE_CONNECTION_DHCP4_CONFIG, "", "",
|
|
|
|
|
NM_TYPE_DHCP4_CONFIG,
|
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* NMActiveConnection:default6:
|
|
|
|
|
*
|
|
|
|
|
* Whether the active connection is the default IPv6 one.
|
|
|
|
|
**/
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_DEFAULT6,
|
|
|
|
|
g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT6, "", "",
|
|
|
|
|
FALSE,
|
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* NMActiveConnection:ip6-config:
|
|
|
|
|
*
|
|
|
|
|
* The #NMIP6Config of the connection.
|
|
|
|
|
**/
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_IP6_CONFIG,
|
|
|
|
|
g_param_spec_object (NM_ACTIVE_CONNECTION_IP6_CONFIG, "", "",
|
|
|
|
|
NM_TYPE_IP6_CONFIG,
|
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* NMActiveConnection:dhcp6-config:
|
|
|
|
|
*
|
libnm, core, cli, tui: fix the capitalization of various types
GLib/Gtk have mostly settled on the convention that two-letter
acronyms in type names remain all-caps (eg, "IO"), but longer acronyms
become initial-caps-only (eg, "Tcp").
NM was inconsistent, with most long acronyms using initial caps only
(Adsl, Cdma, Dcb, Gsm, Olpc, Vlan), but others using all caps (DHCP,
PPP, PPPOE, VPN). Fix libnm and src/ to use initial-caps only for all
three-or-more-letter-long acronyms (and update nmcli and nmtui for the
libnm changes).
2014-06-26 13:44:36 -04:00
|
|
|
* The #NMDhcp6Config of the connection.
|
2014-07-24 08:53:33 -04:00
|
|
|
**/
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_DHCP6_CONFIG,
|
|
|
|
|
g_param_spec_object (NM_ACTIVE_CONNECTION_DHCP6_CONFIG, "", "",
|
|
|
|
|
NM_TYPE_DHCP6_CONFIG,
|
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* NMActiveConnection:vpn:
|
|
|
|
|
*
|
|
|
|
|
* Whether the active connection is a VPN connection.
|
|
|
|
|
**/
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_VPN,
|
|
|
|
|
g_param_spec_boolean (NM_ACTIVE_CONNECTION_VPN, "", "",
|
|
|
|
|
FALSE,
|
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* NMActiveConnection:master:
|
|
|
|
|
*
|
2014-10-09 09:24:05 -04:00
|
|
|
* The master device if one exists.
|
2014-07-24 08:53:33 -04:00
|
|
|
**/
|
|
|
|
|
g_object_class_install_property
|
|
|
|
|
(object_class, PROP_MASTER,
|
2014-10-09 09:24:05 -04:00
|
|
|
g_param_spec_object (NM_ACTIVE_CONNECTION_MASTER, "", "",
|
|
|
|
|
NM_TYPE_DEVICE,
|
2014-07-24 08:53:33 -04:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
|
|
|
|
}
|