2008-11-14 17:41:16 +00: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.
|
|
|
|
*
|
2014-07-04 17:33:18 +00:00
|
|
|
* Copyright 2007 - 2014 Red Hat, Inc.
|
|
|
|
* Copyright 2008 Novell, Inc.
|
2008-11-14 17:41:16 +00:00
|
|
|
*/
|
2008-03-24 15:17:30 +00:00
|
|
|
|
2016-02-19 13:57:48 +00:00
|
|
|
#include "nm-default.h"
|
2014-11-13 15:07:02 +00:00
|
|
|
|
2008-03-24 15:17:30 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "NetworkManager.h"
|
|
|
|
#include "nm-active-connection.h"
|
|
|
|
#include "nm-object-private.h"
|
|
|
|
#include "nm-types-private.h"
|
|
|
|
#include "nm-device.h"
|
2012-01-11 12:56:04 +00:00
|
|
|
#include "nm-device-private.h"
|
2008-03-26 13:43:01 +00:00
|
|
|
#include "nm-connection.h"
|
2012-01-11 12:56:04 +00:00
|
|
|
#include "nm-vpn-connection.h"
|
2013-03-01 21:58:31 +00:00
|
|
|
#include "nm-dbus-helpers-private.h"
|
2008-03-24 15:17:30 +00:00
|
|
|
|
2012-02-10 21:03:12 +00:00
|
|
|
static GType _nm_active_connection_type_for_path (DBusGConnection *connection,
|
|
|
|
const char *path);
|
|
|
|
static void _nm_active_connection_type_for_path_async (DBusGConnection *connection,
|
|
|
|
const char *path,
|
|
|
|
NMObjectTypeCallbackFunc callback,
|
|
|
|
gpointer user_data);
|
2008-03-24 15:17:30 +00:00
|
|
|
|
2012-01-11 12:56:04 +00:00
|
|
|
G_DEFINE_TYPE_WITH_CODE (NMActiveConnection, nm_active_connection, NM_TYPE_OBJECT,
|
|
|
|
_nm_object_register_type_func (g_define_type_id,
|
2012-02-10 21:03:12 +00:00
|
|
|
_nm_active_connection_type_for_path,
|
|
|
|
_nm_active_connection_type_for_path_async);
|
2012-01-11 12:56:04 +00:00
|
|
|
)
|
2008-03-24 15:17:30 +00:00
|
|
|
|
2012-01-11 12:56:04 +00:00
|
|
|
#define NM_ACTIVE_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_ACTIVE_CONNECTION, NMActiveConnectionPrivate))
|
2008-03-24 15:17:30 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
DBusGProxy *proxy;
|
|
|
|
|
|
|
|
char *connection;
|
2014-03-03 14:06:11 +00:00
|
|
|
char *id;
|
2011-04-22 16:29:09 +00:00
|
|
|
char *uuid;
|
2014-03-03 14:06:11 +00:00
|
|
|
char *type;
|
2008-03-24 15:17:30 +00:00
|
|
|
char *specific_object;
|
|
|
|
GPtrArray *devices;
|
2008-04-22 00:28:02 +00:00
|
|
|
NMActiveConnectionState state;
|
|
|
|
gboolean is_default;
|
2013-12-18 15:56:09 +00:00
|
|
|
NMIP4Config *ip4_config;
|
|
|
|
NMDHCP4Config *dhcp4_config;
|
2010-04-15 22:18:08 +00:00
|
|
|
gboolean is_default6;
|
2013-12-18 15:56:09 +00:00
|
|
|
NMIP6Config *ip6_config;
|
|
|
|
NMDHCP6Config *dhcp6_config;
|
2014-01-15 11:52:13 +00:00
|
|
|
gboolean is_vpn;
|
2012-01-11 09:45:05 +00:00
|
|
|
char *master;
|
2008-03-24 15:17:30 +00:00
|
|
|
} NMActiveConnectionPrivate;
|
|
|
|
|
|
|
|
enum {
|
|
|
|
PROP_0,
|
|
|
|
PROP_CONNECTION,
|
2014-03-03 14:06:11 +00:00
|
|
|
PROP_ID,
|
2011-04-22 16:29:09 +00:00
|
|
|
PROP_UUID,
|
2014-03-03 14:06:11 +00:00
|
|
|
PROP_TYPE,
|
2008-03-24 15:17:30 +00:00
|
|
|
PROP_SPECIFIC_OBJECT,
|
|
|
|
PROP_DEVICES,
|
2008-04-22 00:28:02 +00:00
|
|
|
PROP_STATE,
|
|
|
|
PROP_DEFAULT,
|
2013-12-18 15:56:09 +00:00
|
|
|
PROP_IP4_CONFIG,
|
|
|
|
PROP_DHCP4_CONFIG,
|
2010-04-15 22:18:08 +00:00
|
|
|
PROP_DEFAULT6,
|
2013-12-18 15:56:09 +00:00
|
|
|
PROP_IP6_CONFIG,
|
|
|
|
PROP_DHCP6_CONFIG,
|
2014-01-15 11:52:13 +00:00
|
|
|
PROP_VPN,
|
2012-01-11 09:45:05 +00:00
|
|
|
PROP_MASTER,
|
2008-03-24 15:17:30 +00:00
|
|
|
|
|
|
|
LAST_PROP
|
|
|
|
};
|
|
|
|
|
2008-08-12 12:59:33 +00:00
|
|
|
/**
|
|
|
|
* nm_active_connection_new:
|
|
|
|
* @connection: the #DBusGConnection
|
|
|
|
* @path: the DBus object path of the device
|
|
|
|
*
|
|
|
|
* Creates a new #NMActiveConnection.
|
|
|
|
*
|
2011-03-10 18:35:43 +00:00
|
|
|
* Returns: (transfer full): a new active connection
|
2008-08-12 12:59:33 +00:00
|
|
|
**/
|
2008-03-24 15:17:30 +00:00
|
|
|
GObject *
|
|
|
|
nm_active_connection_new (DBusGConnection *connection, const char *path)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (connection != NULL, NULL);
|
|
|
|
g_return_val_if_fail (path != NULL, NULL);
|
|
|
|
|
|
|
|
return g_object_new (NM_TYPE_ACTIVE_CONNECTION,
|
2014-05-09 18:45:59 +00:00
|
|
|
NM_OBJECT_DBUS_CONNECTION, connection,
|
|
|
|
NM_OBJECT_DBUS_PATH, path,
|
|
|
|
NULL);
|
2008-03-24 15:17:30 +00:00
|
|
|
}
|
|
|
|
|
2012-01-11 12:56:04 +00:00
|
|
|
static GType
|
2012-02-10 21:03:12 +00:00
|
|
|
_nm_active_connection_type_for_path (DBusGConnection *connection,
|
|
|
|
const char *path)
|
2012-01-11 12:56:04 +00:00
|
|
|
{
|
|
|
|
DBusGProxy *proxy;
|
|
|
|
GError *error = NULL;
|
2013-03-22 09:49:19 +00:00
|
|
|
GValue value = G_VALUE_INIT;
|
2012-01-11 12:56:04 +00:00
|
|
|
GType type;
|
|
|
|
|
2015-04-13 14:28:17 +00:00
|
|
|
proxy = _nm_dbus_new_proxy_for_connection (connection, path, DBUS_INTERFACE_PROPERTIES);
|
2012-01-11 12:56:04 +00:00
|
|
|
if (!proxy) {
|
|
|
|
g_warning ("%s: couldn't create D-Bus object proxy.", __func__);
|
|
|
|
return G_TYPE_INVALID;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Have to create an NMVPNConnection if it's a VPN connection, otherwise
|
|
|
|
* a plain NMActiveConnection.
|
|
|
|
*/
|
|
|
|
if (dbus_g_proxy_call (proxy,
|
|
|
|
"Get", &error,
|
|
|
|
G_TYPE_STRING, NM_DBUS_INTERFACE_ACTIVE_CONNECTION,
|
|
|
|
G_TYPE_STRING, "Vpn",
|
|
|
|
G_TYPE_INVALID,
|
|
|
|
G_TYPE_VALUE, &value, G_TYPE_INVALID)) {
|
|
|
|
if (g_value_get_boolean (&value))
|
|
|
|
type = NM_TYPE_VPN_CONNECTION;
|
|
|
|
else
|
|
|
|
type = NM_TYPE_ACTIVE_CONNECTION;
|
|
|
|
} else {
|
2016-02-28 17:12:28 +00:00
|
|
|
g_warning ("Error in getting active connection 'Vpn' property: %s",
|
|
|
|
error->message);
|
2012-01-11 12:56:04 +00:00
|
|
|
g_error_free (error);
|
|
|
|
type = G_TYPE_INVALID;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_object_unref (proxy);
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
DBusGConnection *connection;
|
|
|
|
NMObjectTypeCallbackFunc callback;
|
|
|
|
gpointer user_data;
|
|
|
|
} NMActiveConnectionAsyncData;
|
|
|
|
|
|
|
|
static void
|
|
|
|
async_got_type (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data)
|
|
|
|
{
|
|
|
|
NMActiveConnectionAsyncData *async_data = user_data;
|
|
|
|
GValue value = G_VALUE_INIT;
|
|
|
|
const char *path = dbus_g_proxy_get_path (proxy);
|
|
|
|
GError *error = NULL;
|
|
|
|
GType type;
|
|
|
|
|
|
|
|
if (dbus_g_proxy_end_call (proxy, call, &error,
|
|
|
|
G_TYPE_VALUE, &value,
|
|
|
|
G_TYPE_INVALID)) {
|
|
|
|
if (g_value_get_boolean (&value))
|
|
|
|
type = NM_TYPE_VPN_CONNECTION;
|
|
|
|
else
|
|
|
|
type = NM_TYPE_ACTIVE_CONNECTION;
|
|
|
|
} else {
|
|
|
|
g_warning ("%s: could not read properties for %s: %s", __func__, path, error->message);
|
|
|
|
type = G_TYPE_INVALID;
|
|
|
|
}
|
|
|
|
|
|
|
|
async_data->callback (type, async_data->user_data);
|
|
|
|
|
|
|
|
g_object_unref (proxy);
|
|
|
|
g_slice_free (NMActiveConnectionAsyncData, async_data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-02-10 21:03:12 +00:00
|
|
|
_nm_active_connection_type_for_path_async (DBusGConnection *connection,
|
|
|
|
const char *path,
|
|
|
|
NMObjectTypeCallbackFunc callback,
|
|
|
|
gpointer user_data)
|
2012-01-11 12:56:04 +00:00
|
|
|
{
|
|
|
|
NMActiveConnectionAsyncData *async_data;
|
|
|
|
DBusGProxy *proxy;
|
|
|
|
|
|
|
|
async_data = g_slice_new (NMActiveConnectionAsyncData);
|
|
|
|
async_data->connection = connection;
|
|
|
|
async_data->callback = callback;
|
|
|
|
async_data->user_data = user_data;
|
|
|
|
|
2015-04-13 14:28:17 +00:00
|
|
|
proxy = _nm_dbus_new_proxy_for_connection (connection, path, DBUS_INTERFACE_PROPERTIES);
|
2012-01-11 12:56:04 +00:00
|
|
|
dbus_g_proxy_begin_call (proxy, "Get",
|
|
|
|
async_got_type, async_data, NULL,
|
|
|
|
G_TYPE_STRING, NM_DBUS_INTERFACE_ACTIVE_CONNECTION,
|
|
|
|
G_TYPE_STRING, "Vpn",
|
|
|
|
G_TYPE_INVALID);
|
|
|
|
}
|
|
|
|
|
2008-08-12 12:59:33 +00:00
|
|
|
/**
|
|
|
|
* nm_active_connection_get_connection:
|
|
|
|
* @connection: a #NMActiveConnection
|
|
|
|
*
|
2014-05-22 14:06:46 +00:00
|
|
|
* Gets the #NMConnection's DBus object path. This is often used with
|
|
|
|
* nm_remote_settings_get_connection_by_path() to retrieve the
|
|
|
|
* #NMRemoteConnection object that describes the connection.
|
2008-08-12 12:59:33 +00:00
|
|
|
*
|
2014-05-22 14:06:46 +00:00
|
|
|
* Returns: the object path of the #NMConnection which this #NMActiveConnection
|
|
|
|
* is an active instance of. This is the internal string used by the
|
|
|
|
* connection, and must not be modified.
|
2008-08-12 12:59:33 +00:00
|
|
|
**/
|
2008-03-24 15:17:30 +00:00
|
|
|
const char *
|
|
|
|
nm_active_connection_get_connection (NMActiveConnection *connection)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (connection));
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->connection;
|
2008-03-24 15:17:30 +00:00
|
|
|
}
|
|
|
|
|
2014-03-03 14:06:11 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* Since: 0.9.10
|
|
|
|
**/
|
|
|
|
const char *
|
|
|
|
nm_active_connection_get_id (NMActiveConnection *connection)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
|
|
|
_nm_object_ensure_inited (NM_OBJECT (connection));
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->id;
|
|
|
|
}
|
|
|
|
|
2011-04-22 16:29:09 +00:00
|
|
|
/**
|
|
|
|
* nm_active_connection_get_uuid:
|
|
|
|
* @connection: a #NMActiveConnection
|
|
|
|
*
|
2013-10-11 14:12:44 +00:00
|
|
|
* Gets the #NMConnection's UUID.
|
2011-04-22 16:29:09 +00:00
|
|
|
*
|
|
|
|
* 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);
|
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (connection));
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->uuid;
|
2011-04-22 16:29:09 +00:00
|
|
|
}
|
|
|
|
|
2014-03-03 14:06:11 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* Since: 0.9.10
|
|
|
|
**/
|
|
|
|
const char *
|
|
|
|
nm_active_connection_get_connection_type (NMActiveConnection *connection)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
|
|
|
_nm_object_ensure_inited (NM_OBJECT (connection));
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->type;
|
|
|
|
}
|
|
|
|
|
2008-08-12 12:59:33 +00:00
|
|
|
/**
|
|
|
|
* nm_active_connection_get_specific_object:
|
|
|
|
* @connection: a #NMActiveConnection
|
|
|
|
*
|
|
|
|
* Gets the "specific object" used at the activation.
|
|
|
|
*
|
|
|
|
* Returns: the specific object's DBus path. This is the internal string used by the
|
|
|
|
* connection, and must not be modified.
|
|
|
|
**/
|
2008-03-24 15:17:30 +00:00
|
|
|
const char *
|
|
|
|
nm_active_connection_get_specific_object (NMActiveConnection *connection)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (connection));
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->specific_object;
|
2008-03-24 15:17:30 +00:00
|
|
|
}
|
|
|
|
|
2008-08-12 12:59:33 +00:00
|
|
|
/**
|
|
|
|
* nm_active_connection_get_devices:
|
|
|
|
* @connection: a #NMActiveConnection
|
|
|
|
*
|
2013-10-11 14:12:44 +00:00
|
|
|
* Gets the #NMDevices used for the active connections.
|
2008-08-12 12:59:33 +00:00
|
|
|
*
|
2014-07-07 18:09:04 +00:00
|
|
|
* Returns: (element-type NMDevice): the #GPtrArray containing #NMDevices.
|
2008-08-12 12:59:33 +00:00
|
|
|
* This is the internal copy used by the connection, and must not be modified.
|
|
|
|
**/
|
2008-03-24 15:17:30 +00:00
|
|
|
const GPtrArray *
|
|
|
|
nm_active_connection_get_devices (NMActiveConnection *connection)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (connection));
|
|
|
|
return handle_ptr_array_return (NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->devices);
|
2008-03-24 15:17:30 +00:00
|
|
|
}
|
|
|
|
|
2008-08-12 12:59:33 +00:00
|
|
|
/**
|
|
|
|
* nm_active_connection_get_state:
|
|
|
|
* @connection: a #NMActiveConnection
|
|
|
|
*
|
|
|
|
* Gets the active connection's state.
|
|
|
|
*
|
|
|
|
* Returns: the state
|
|
|
|
**/
|
2008-04-22 00:28:02 +00:00
|
|
|
NMActiveConnectionState
|
|
|
|
nm_active_connection_get_state (NMActiveConnection *connection)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NM_ACTIVE_CONNECTION_STATE_UNKNOWN);
|
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (connection));
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->state;
|
2008-04-22 00:28:02 +00:00
|
|
|
}
|
|
|
|
|
2008-08-12 12:59:33 +00:00
|
|
|
/**
|
|
|
|
* nm_active_connection_get_default:
|
|
|
|
* @connection: a #NMActiveConnection
|
|
|
|
*
|
2010-04-15 22:18:08 +00:00
|
|
|
* Whether the active connection is the default IPv4 one (that is, is used for
|
|
|
|
* the default IPv4 route and DNS information).
|
2008-08-12 12:59:33 +00:00
|
|
|
*
|
2010-04-15 22:18:08 +00:00
|
|
|
* Returns: %TRUE if the active connection is the default IPv4 connection
|
2008-08-12 12:59:33 +00:00
|
|
|
**/
|
2008-04-22 00:28:02 +00:00
|
|
|
gboolean
|
|
|
|
nm_active_connection_get_default (NMActiveConnection *connection)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), FALSE);
|
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (connection));
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->is_default;
|
2008-04-22 00:28:02 +00:00
|
|
|
}
|
|
|
|
|
2013-12-18 15:56:09 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* Since: 0.9.10
|
|
|
|
**/
|
|
|
|
NMIP4Config *
|
|
|
|
nm_active_connection_get_ip4_config (NMActiveConnection *connection)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
|
|
|
_nm_object_ensure_inited (NM_OBJECT (connection));
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->ip4_config;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* nm_active_connection_get_dhcp4_config:
|
|
|
|
* @connection: an #NMActiveConnection
|
|
|
|
*
|
|
|
|
* Gets the current #NMDHCP4Config (if any) associated with the
|
|
|
|
* #NMActiveConnection.
|
|
|
|
*
|
|
|
|
* Returns: (transfer none): the #NMDHCP4Config, or %NULL if the
|
|
|
|
* connection does not use DHCP, or is not in the
|
|
|
|
* %NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.
|
|
|
|
*
|
|
|
|
* Since: 0.9.10
|
|
|
|
**/
|
|
|
|
NMDHCP4Config *
|
|
|
|
nm_active_connection_get_dhcp4_config (NMActiveConnection *connection)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
|
|
|
_nm_object_ensure_inited (NM_OBJECT (connection));
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->dhcp4_config;
|
|
|
|
}
|
|
|
|
|
2010-04-15 22:18:08 +00:00
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (connection));
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->is_default6;
|
2010-04-15 22:18:08 +00:00
|
|
|
}
|
|
|
|
|
2013-12-18 15:56:09 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* Since: 0.9.10
|
|
|
|
**/
|
|
|
|
NMIP6Config *
|
|
|
|
nm_active_connection_get_ip6_config (NMActiveConnection *connection)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
|
|
|
_nm_object_ensure_inited (NM_OBJECT (connection));
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->ip6_config;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* nm_active_connection_get_dhcp6_config:
|
|
|
|
* @connection: an #NMActiveConnection
|
|
|
|
*
|
|
|
|
* Gets the current #NMDHCP6Config (if any) associated with the
|
|
|
|
* #NMActiveConnection.
|
|
|
|
*
|
|
|
|
* Returns: (transfer none): the #NMDHCP6Config, or %NULL if the
|
|
|
|
* connection does not use DHCPv6, or is not in the
|
|
|
|
* %NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.
|
|
|
|
*
|
|
|
|
* Since: 0.9.10
|
|
|
|
**/
|
|
|
|
NMDHCP6Config *
|
|
|
|
nm_active_connection_get_dhcp6_config (NMActiveConnection *connection)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
|
|
|
_nm_object_ensure_inited (NM_OBJECT (connection));
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->dhcp6_config;
|
|
|
|
}
|
|
|
|
|
2014-01-15 11:52:13 +00:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
* Since: 0.9.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
nm_active_connection_get_vpn (NMActiveConnection *connection)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), FALSE);
|
|
|
|
|
|
|
|
_nm_object_ensure_inited (NM_OBJECT (connection));
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->is_vpn;
|
|
|
|
}
|
|
|
|
|
2012-01-11 09:45:05 +00:00
|
|
|
/**
|
|
|
|
* nm_active_connection_get_master:
|
|
|
|
* @connection: a #NMActiveConnection
|
|
|
|
*
|
|
|
|
* Gets the path to the master #NMDevice of the connection.
|
|
|
|
*
|
|
|
|
* Returns: the path of the master #NMDevice of the #NMActiveConnection.
|
|
|
|
* This is the internal string used by the connection, and must not be modified.
|
|
|
|
**/
|
|
|
|
const char *
|
|
|
|
nm_active_connection_get_master (NMActiveConnection *connection)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
|
|
|
|
|
2012-01-19 23:23:28 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (connection));
|
|
|
|
return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->master;
|
2012-01-11 09:45:05 +00:00
|
|
|
}
|
|
|
|
|
2008-03-24 15:17:30 +00:00
|
|
|
static void
|
|
|
|
nm_active_connection_init (NMActiveConnection *ap)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dispose (GObject *object)
|
|
|
|
{
|
|
|
|
NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (object);
|
|
|
|
|
|
|
|
if (priv->devices) {
|
2013-10-18 14:07:26 +00:00
|
|
|
g_ptr_array_set_free_func (priv->devices, g_object_unref);
|
2008-03-24 15:17:30 +00:00
|
|
|
g_ptr_array_free (priv->devices, TRUE);
|
2012-04-23 15:02:48 +00:00
|
|
|
priv->devices = NULL;
|
2008-03-24 15:17:30 +00:00
|
|
|
}
|
2012-04-23 15:02:48 +00:00
|
|
|
|
2013-12-18 15:56:09 +00: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);
|
|
|
|
|
2012-04-23 15:02:48 +00:00
|
|
|
g_clear_object (&priv->proxy);
|
2008-03-24 15:17:30 +00:00
|
|
|
|
|
|
|
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->connection);
|
2014-03-03 14:06:11 +00:00
|
|
|
g_free (priv->id);
|
2011-04-22 16:29:09 +00:00
|
|
|
g_free (priv->uuid);
|
2014-03-03 14:06:11 +00:00
|
|
|
g_free (priv->type);
|
2008-03-24 15:17:30 +00:00
|
|
|
g_free (priv->specific_object);
|
2012-01-11 09:45:05 +00:00
|
|
|
g_free (priv->master);
|
2008-03-24 15:17:30 +00: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);
|
|
|
|
|
2012-03-28 13:06:12 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (object));
|
|
|
|
|
2008-03-24 15:17:30 +00:00
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_CONNECTION:
|
2011-01-21 20:46:09 +00:00
|
|
|
g_value_set_string (value, nm_active_connection_get_connection (self));
|
2008-03-24 15:17:30 +00:00
|
|
|
break;
|
2014-03-03 14:06:11 +00:00
|
|
|
case PROP_ID:
|
|
|
|
g_value_set_string (value, nm_active_connection_get_id (self));
|
|
|
|
break;
|
2012-01-05 18:34:58 +00:00
|
|
|
case PROP_UUID:
|
|
|
|
g_value_set_string (value, nm_active_connection_get_uuid (self));
|
|
|
|
break;
|
2014-03-03 14:06:11 +00:00
|
|
|
case PROP_TYPE:
|
|
|
|
g_value_set_string (value, nm_active_connection_get_connection_type (self));
|
|
|
|
break;
|
2008-03-24 15:17:30 +00:00
|
|
|
case PROP_SPECIFIC_OBJECT:
|
|
|
|
g_value_set_boxed (value, nm_active_connection_get_specific_object (self));
|
|
|
|
break;
|
|
|
|
case PROP_DEVICES:
|
|
|
|
g_value_set_boxed (value, nm_active_connection_get_devices (self));
|
|
|
|
break;
|
2008-04-22 00:28:02 +00:00
|
|
|
case PROP_STATE:
|
|
|
|
g_value_set_uint (value, nm_active_connection_get_state (self));
|
|
|
|
break;
|
|
|
|
case PROP_DEFAULT:
|
|
|
|
g_value_set_boolean (value, nm_active_connection_get_default (self));
|
|
|
|
break;
|
2013-12-18 15:56:09 +00:00
|
|
|
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;
|
2010-04-15 22:18:08 +00:00
|
|
|
case PROP_DEFAULT6:
|
|
|
|
g_value_set_boolean (value, nm_active_connection_get_default6 (self));
|
|
|
|
break;
|
2013-12-18 15:56:09 +00:00
|
|
|
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;
|
2014-01-15 11:52:13 +00:00
|
|
|
case PROP_VPN:
|
|
|
|
g_value_set_boolean (value, nm_active_connection_get_vpn (self));
|
|
|
|
break;
|
2012-01-11 09:45:05 +00:00
|
|
|
case PROP_MASTER:
|
|
|
|
g_value_set_string (value, nm_active_connection_get_master (self));
|
|
|
|
break;
|
2008-03-24 15:17:30 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-01-20 12:52:17 +00:00
|
|
|
register_properties (NMActiveConnection *connection)
|
2008-03-24 15:17:30 +00:00
|
|
|
{
|
|
|
|
NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (connection);
|
2012-01-20 12:52:17 +00:00
|
|
|
const NMPropertiesInfo property_info[] = {
|
|
|
|
{ NM_ACTIVE_CONNECTION_CONNECTION, &priv->connection },
|
2014-03-03 14:06:11 +00:00
|
|
|
{ NM_ACTIVE_CONNECTION_ID, &priv->id },
|
2012-01-20 12:52:17 +00:00
|
|
|
{ NM_ACTIVE_CONNECTION_UUID, &priv->uuid },
|
2014-03-03 14:06:11 +00:00
|
|
|
{ NM_ACTIVE_CONNECTION_TYPE, &priv->type },
|
2012-01-20 12:52:17 +00:00
|
|
|
{ NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT, &priv->specific_object },
|
2012-01-11 12:56:04 +00:00
|
|
|
{ NM_ACTIVE_CONNECTION_DEVICES, &priv->devices, NULL, NM_TYPE_DEVICE },
|
2012-01-20 12:52:17 +00:00
|
|
|
{ NM_ACTIVE_CONNECTION_STATE, &priv->state },
|
|
|
|
{ NM_ACTIVE_CONNECTION_DEFAULT, &priv->is_default },
|
2013-12-18 15:56:09 +00:00
|
|
|
{ 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 },
|
2012-01-20 12:52:17 +00:00
|
|
|
{ NM_ACTIVE_CONNECTION_DEFAULT6, &priv->is_default6 },
|
2013-12-18 15:56:09 +00:00
|
|
|
{ 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 },
|
2014-01-15 11:52:13 +00:00
|
|
|
{ NM_ACTIVE_CONNECTION_VPN, &priv->is_vpn },
|
2012-01-20 12:52:17 +00:00
|
|
|
{ NM_ACTIVE_CONNECTION_MASTER, &priv->master },
|
2012-02-20 16:09:25 +00:00
|
|
|
|
2008-03-24 15:17:30 +00:00
|
|
|
{ NULL },
|
|
|
|
};
|
|
|
|
|
2012-01-20 12:52:17 +00:00
|
|
|
_nm_object_register_properties (NM_OBJECT (connection),
|
|
|
|
priv->proxy,
|
|
|
|
property_info);
|
2008-03-24 15:17:30 +00:00
|
|
|
}
|
|
|
|
|
2011-12-20 20:15:42 +00:00
|
|
|
static void
|
|
|
|
constructed (GObject *object)
|
2008-03-24 15:17:30 +00:00
|
|
|
{
|
2013-03-01 21:58:31 +00:00
|
|
|
NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (object);
|
2008-03-24 15:17:30 +00:00
|
|
|
|
2011-12-20 20:15:42 +00:00
|
|
|
G_OBJECT_CLASS (nm_active_connection_parent_class)->constructed (object);
|
2008-03-24 15:17:30 +00:00
|
|
|
|
2013-03-01 21:58:31 +00:00
|
|
|
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_ACTIVE_CONNECTION);
|
2012-01-20 12:52:17 +00:00
|
|
|
register_properties (NM_ACTIVE_CONNECTION (object));
|
2008-03-24 15:17:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
nm_active_connection_class_init (NMActiveConnectionClass *ap_class)
|
|
|
|
{
|
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (ap_class);
|
|
|
|
|
|
|
|
g_type_class_add_private (ap_class, sizeof (NMActiveConnectionPrivate));
|
|
|
|
|
|
|
|
/* virtual methods */
|
2011-12-20 20:15:42 +00:00
|
|
|
object_class->constructed = constructed;
|
2008-03-24 15:17:30 +00:00
|
|
|
object_class->get_property = get_property;
|
|
|
|
object_class->dispose = dispose;
|
|
|
|
object_class->finalize = finalize;
|
|
|
|
|
|
|
|
/* properties */
|
2008-08-12 12:59:33 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* NMActiveConnection:connection:
|
|
|
|
*
|
|
|
|
* The connection's path of the active connection.
|
|
|
|
**/
|
2008-03-24 15:17:30 +00:00
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_CONNECTION,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_string (NM_ACTIVE_CONNECTION_CONNECTION, "", "",
|
|
|
|
NULL,
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2008-03-24 15:17:30 +00:00
|
|
|
|
2014-03-03 14:06:11 +00:00
|
|
|
/**
|
|
|
|
* NMActiveConnection:id:
|
|
|
|
*
|
|
|
|
* The active connection's ID
|
|
|
|
*
|
|
|
|
* Since: 0.9.10
|
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_ID,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_string (NM_ACTIVE_CONNECTION_ID, "", "",
|
|
|
|
NULL,
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2014-03-03 14:06:11 +00:00
|
|
|
|
2012-01-05 18:34:58 +00:00
|
|
|
/**
|
|
|
|
* NMActiveConnection:uuid:
|
|
|
|
*
|
|
|
|
* The active connection's UUID
|
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_UUID,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_string (NM_ACTIVE_CONNECTION_UUID, "", "",
|
|
|
|
NULL,
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2012-01-05 18:34:58 +00:00
|
|
|
|
2014-03-03 14:06:11 +00:00
|
|
|
/**
|
|
|
|
* NMActiveConnection:type:
|
|
|
|
*
|
|
|
|
* The active connection's type
|
|
|
|
*
|
|
|
|
* Since: 0.9.10
|
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_TYPE,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_string (NM_ACTIVE_CONNECTION_TYPE, "", "",
|
|
|
|
NULL,
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2014-03-03 14:06:11 +00:00
|
|
|
|
2008-08-12 12:59:33 +00:00
|
|
|
/**
|
|
|
|
* NMActiveConnection:specific-object:
|
|
|
|
*
|
|
|
|
* The specific object's path of the active connection.
|
|
|
|
**/
|
2008-03-24 15:17:30 +00:00
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_SPECIFIC_OBJECT,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_string (NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT, "", "",
|
|
|
|
NULL,
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2008-03-24 15:17:30 +00:00
|
|
|
|
2008-08-12 12:59:33 +00:00
|
|
|
/**
|
|
|
|
* NMActiveConnection:device:
|
|
|
|
*
|
|
|
|
* The devices (#NMDevice) of the active connection.
|
|
|
|
**/
|
2008-03-24 15:17:30 +00:00
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_DEVICES,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_boxed (NM_ACTIVE_CONNECTION_DEVICES, "", "",
|
|
|
|
NM_TYPE_OBJECT_ARRAY,
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2008-04-22 00:28:02 +00:00
|
|
|
|
2008-08-12 12:59:33 +00:00
|
|
|
/**
|
|
|
|
* NMActiveConnection:state:
|
|
|
|
*
|
|
|
|
* The state of the active connection.
|
|
|
|
**/
|
2008-04-22 00:28:02 +00:00
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_STATE,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_uint (NM_ACTIVE_CONNECTION_STATE, "", "",
|
|
|
|
NM_ACTIVE_CONNECTION_STATE_UNKNOWN,
|
|
|
|
NM_ACTIVE_CONNECTION_STATE_DEACTIVATING,
|
|
|
|
NM_ACTIVE_CONNECTION_STATE_UNKNOWN,
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2008-04-22 00:28:02 +00:00
|
|
|
|
2008-08-12 12:59:33 +00:00
|
|
|
/**
|
|
|
|
* NMActiveConnection:default:
|
|
|
|
*
|
2010-04-15 22:18:08 +00:00
|
|
|
* Whether the active connection is the default IPv4 one.
|
2008-08-12 12:59:33 +00:00
|
|
|
**/
|
2008-04-22 00:28:02 +00:00
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_DEFAULT,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT, "", "",
|
|
|
|
FALSE,
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2010-04-15 22:18:08 +00:00
|
|
|
|
2013-12-18 15:56:09 +00:00
|
|
|
/**
|
|
|
|
* NMActiveConnection:ip4-config:
|
|
|
|
*
|
|
|
|
* The #NMIP4Config of the connection.
|
|
|
|
*
|
|
|
|
* Since: 0.9.10
|
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_IP4_CONFIG,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_object (NM_ACTIVE_CONNECTION_IP4_CONFIG, "", "",
|
2013-12-18 15:56:09 +00:00
|
|
|
NM_TYPE_IP4_CONFIG,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2013-12-18 15:56:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* NMActiveConnection:dhcp4-config:
|
|
|
|
*
|
|
|
|
* The #NMDHCP4Config of the connection.
|
|
|
|
*
|
|
|
|
* Since: 0.9.10
|
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_DHCP4_CONFIG,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_object (NM_ACTIVE_CONNECTION_DHCP4_CONFIG, "", "",
|
2013-12-18 15:56:09 +00:00
|
|
|
NM_TYPE_DHCP4_CONFIG,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2013-12-18 15:56:09 +00:00
|
|
|
|
2010-04-15 22:18:08 +00:00
|
|
|
/**
|
|
|
|
* NMActiveConnection:default6:
|
|
|
|
*
|
|
|
|
* Whether the active connection is the default IPv6 one.
|
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_DEFAULT6,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT6, "", "",
|
|
|
|
FALSE,
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2012-01-11 09:45:05 +00:00
|
|
|
|
2013-12-18 15:56:09 +00:00
|
|
|
/**
|
|
|
|
* NMActiveConnection:ip6-config:
|
|
|
|
*
|
|
|
|
* The #NMIP6Config of the connection.
|
|
|
|
*
|
|
|
|
* Since: 0.9.10
|
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_IP6_CONFIG,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_object (NM_ACTIVE_CONNECTION_IP6_CONFIG, "", "",
|
2013-12-18 15:56:09 +00:00
|
|
|
NM_TYPE_IP6_CONFIG,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2013-12-18 15:56:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* NMActiveConnection:dhcp6-config:
|
|
|
|
*
|
|
|
|
* The #NMDHCP6Config of the connection.
|
|
|
|
*
|
|
|
|
* Since: 0.9.10
|
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_DHCP6_CONFIG,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_object (NM_ACTIVE_CONNECTION_DHCP6_CONFIG, "", "",
|
2013-12-18 15:56:09 +00:00
|
|
|
NM_TYPE_DHCP6_CONFIG,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2013-12-18 15:56:09 +00:00
|
|
|
|
2014-01-15 11:52:13 +00:00
|
|
|
/**
|
|
|
|
* NMActiveConnection:vpn:
|
|
|
|
*
|
|
|
|
* Whether the active connection is a VPN connection.
|
|
|
|
*
|
|
|
|
* Since: 0.9.10
|
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_VPN,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_boolean (NM_ACTIVE_CONNECTION_VPN, "", "",
|
2014-01-15 11:52:13 +00:00
|
|
|
FALSE,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2014-01-15 11:52:13 +00:00
|
|
|
|
2012-01-11 09:45:05 +00:00
|
|
|
/**
|
|
|
|
* NMActiveConnection:master:
|
|
|
|
*
|
|
|
|
* The path of the master device if one exists.
|
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_MASTER,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_string (NM_ACTIVE_CONNECTION_MASTER, "", "",
|
|
|
|
NULL,
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2008-03-24 15:17:30 +00:00
|
|
|
}
|