2012-03-07 17:44:25 +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 2012 Red Hat, Inc.
|
2012-03-07 17:44:25 +00:00
|
|
|
*/
|
|
|
|
|
2016-02-19 13:57:48 +00:00
|
|
|
#include "nm-default.h"
|
2014-11-13 15:07:02 +00:00
|
|
|
|
2012-03-07 17:44:25 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <netinet/ether.h>
|
|
|
|
|
2016-02-19 13:57:48 +00:00
|
|
|
#include "nm-setting-connection.h"
|
|
|
|
#include "nm-setting-vlan.h"
|
|
|
|
#include "nm-utils.h"
|
2012-03-07 17:44:25 +00:00
|
|
|
|
|
|
|
#include "nm-device-vlan.h"
|
|
|
|
#include "nm-device-private.h"
|
|
|
|
#include "nm-object-private.h"
|
|
|
|
|
|
|
|
G_DEFINE_TYPE (NMDeviceVlan, nm_device_vlan, NM_TYPE_DEVICE)
|
|
|
|
|
|
|
|
#define NM_DEVICE_VLAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_VLAN, NMDeviceVlanPrivate))
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
DBusGProxy *proxy;
|
|
|
|
|
|
|
|
char *hw_address;
|
|
|
|
gboolean carrier;
|
2014-07-21 10:32:10 +00:00
|
|
|
NMDevice *parent;
|
2012-03-07 17:44:25 +00:00
|
|
|
guint vlan_id;
|
|
|
|
} NMDeviceVlanPrivate;
|
|
|
|
|
|
|
|
enum {
|
|
|
|
PROP_0,
|
|
|
|
PROP_HW_ADDRESS,
|
|
|
|
PROP_CARRIER,
|
2014-07-21 10:32:10 +00:00
|
|
|
PROP_PARENT,
|
2012-03-07 17:44:25 +00:00
|
|
|
PROP_VLAN_ID,
|
|
|
|
|
|
|
|
LAST_PROP
|
|
|
|
};
|
|
|
|
|
2012-03-14 13:10:03 +00:00
|
|
|
/**
|
|
|
|
* nm_device_vlan_error_quark:
|
|
|
|
*
|
|
|
|
* Registers an error quark for #NMDeviceVlan if necessary.
|
|
|
|
*
|
|
|
|
* Returns: the error quark used for #NMDeviceVlan errors.
|
|
|
|
**/
|
|
|
|
GQuark
|
|
|
|
nm_device_vlan_error_quark (void)
|
|
|
|
{
|
|
|
|
static GQuark quark = 0;
|
|
|
|
|
|
|
|
if (G_UNLIKELY (quark == 0))
|
|
|
|
quark = g_quark_from_static_string ("nm-device-vlan-error-quark");
|
|
|
|
return quark;
|
|
|
|
}
|
|
|
|
|
2012-03-07 17:44:25 +00:00
|
|
|
/**
|
|
|
|
* nm_device_vlan_new:
|
|
|
|
* @connection: the #DBusGConnection
|
|
|
|
* @path: the DBus object path of the device
|
|
|
|
*
|
|
|
|
* Creates a new #NMDeviceVlan.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): a new device
|
|
|
|
**/
|
|
|
|
GObject *
|
|
|
|
nm_device_vlan_new (DBusGConnection *connection, const char *path)
|
|
|
|
{
|
|
|
|
GObject *device;
|
|
|
|
|
|
|
|
g_return_val_if_fail (connection != NULL, NULL);
|
|
|
|
g_return_val_if_fail (path != NULL, NULL);
|
|
|
|
|
|
|
|
device = g_object_new (NM_TYPE_DEVICE_VLAN,
|
|
|
|
NM_OBJECT_DBUS_CONNECTION, connection,
|
|
|
|
NM_OBJECT_DBUS_PATH, path,
|
|
|
|
NULL);
|
|
|
|
_nm_object_ensure_inited (NM_OBJECT (device));
|
|
|
|
return device;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* nm_device_vlan_get_hw_address:
|
|
|
|
* @device: a #NMDeviceVlan
|
|
|
|
*
|
|
|
|
* Gets the hardware (MAC) address of the #NMDeviceVlan
|
|
|
|
*
|
|
|
|
* Returns: the hardware address. This is the internal string used by the
|
|
|
|
* device, and must not be modified.
|
|
|
|
**/
|
|
|
|
const char *
|
|
|
|
nm_device_vlan_get_hw_address (NMDeviceVlan *device)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_DEVICE_VLAN (device), NULL);
|
|
|
|
|
|
|
|
_nm_object_ensure_inited (NM_OBJECT (device));
|
|
|
|
return NM_DEVICE_VLAN_GET_PRIVATE (device)->hw_address;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* nm_device_vlan_get_carrier:
|
|
|
|
* @device: a #NMDeviceVlan
|
|
|
|
*
|
|
|
|
* Whether the device has carrier.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if the device has carrier
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
nm_device_vlan_get_carrier (NMDeviceVlan *device)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_DEVICE_VLAN (device), FALSE);
|
|
|
|
|
|
|
|
_nm_object_ensure_inited (NM_OBJECT (device));
|
|
|
|
return NM_DEVICE_VLAN_GET_PRIVATE (device)->carrier;
|
|
|
|
}
|
|
|
|
|
2014-07-21 10:32:10 +00:00
|
|
|
/**
|
|
|
|
* nm_device_vlan_get_parent:
|
|
|
|
* @device: a #NMDeviceVlan
|
|
|
|
*
|
2014-11-25 11:48:11 +00:00
|
|
|
* Returns: (transfer none): the device's parent device
|
2014-07-21 10:32:10 +00:00
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
**/
|
|
|
|
NMDevice *
|
|
|
|
nm_device_vlan_get_parent (NMDeviceVlan *device)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_DEVICE_VLAN (device), FALSE);
|
|
|
|
|
|
|
|
_nm_object_ensure_inited (NM_OBJECT (device));
|
|
|
|
return NM_DEVICE_VLAN_GET_PRIVATE (device)->parent;
|
|
|
|
}
|
|
|
|
|
2012-03-07 17:44:25 +00:00
|
|
|
/**
|
|
|
|
* nm_device_vlan_get_vlan_id:
|
|
|
|
* @device: a #NMDeviceVlan
|
|
|
|
*
|
|
|
|
* Returns: the device's VLAN ID
|
|
|
|
**/
|
|
|
|
guint
|
|
|
|
nm_device_vlan_get_vlan_id (NMDeviceVlan *device)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (NM_IS_DEVICE_VLAN (device), FALSE);
|
|
|
|
|
|
|
|
_nm_object_ensure_inited (NM_OBJECT (device));
|
|
|
|
return NM_DEVICE_VLAN_GET_PRIVATE (device)->vlan_id;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2012-03-14 13:10:03 +00:00
|
|
|
connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
|
2012-03-07 17:44:25 +00:00
|
|
|
{
|
|
|
|
NMSettingConnection *s_con;
|
|
|
|
NMSettingVlan *s_vlan;
|
all: standardize on NMSettingWired:mac-address for all VLANs
Currently, ethernet-based VLANs can specify the hardware address of
the parent device (and, in theory, the cloned hardware address and MTU
of the VLAN device) by using an NMSettingWired in addition to the
NMSettingVlan.
The theory was that non-ethernet-based VLANs, when we eventually
supported them, would likewise use the setting type corresponding to
their parent device. However, this turns out to be both complicated
(the settings plugins and connection editor would have a
hard-to-impossible time figuring out which setting type to use in some
cases) and incorrect (for most L2 settings [eg, BSSID, bond mode,
etc], the VLAN can't have its own values separate from the parent
device).
What we should have done was just have :mac-address,
:cloned-mac-address, and :mtu properties on NMSettingVlan. However, at
this point, for backward-compatibility, we will just stick with using
a combination of NMSettingVlan and NMSettingWired, but we will use
NMSettingWired regardless of the underlying hardware type.
2013-09-09 13:40:40 +00:00
|
|
|
NMSettingWired *s_wired;
|
2012-03-07 17:44:25 +00:00
|
|
|
const char *ctype, *dev_iface_name, *vlan_iface_name;
|
all: standardize on NMSettingWired:mac-address for all VLANs
Currently, ethernet-based VLANs can specify the hardware address of
the parent device (and, in theory, the cloned hardware address and MTU
of the VLAN device) by using an NMSettingWired in addition to the
NMSettingVlan.
The theory was that non-ethernet-based VLANs, when we eventually
supported them, would likewise use the setting type corresponding to
their parent device. However, this turns out to be both complicated
(the settings plugins and connection editor would have a
hard-to-impossible time figuring out which setting type to use in some
cases) and incorrect (for most L2 settings [eg, BSSID, bond mode,
etc], the VLAN can't have its own values separate from the parent
device).
What we should have done was just have :mac-address,
:cloned-mac-address, and :mtu properties on NMSettingVlan. However, at
this point, for backward-compatibility, we will just stick with using
a combination of NMSettingVlan and NMSettingWired, but we will use
NMSettingWired regardless of the underlying hardware type.
2013-09-09 13:40:40 +00:00
|
|
|
const GByteArray *mac_address;
|
|
|
|
char *mac_address_str;
|
2012-03-07 17:44:25 +00:00
|
|
|
|
|
|
|
s_con = nm_connection_get_setting_connection (connection);
|
|
|
|
g_assert (s_con);
|
|
|
|
|
|
|
|
ctype = nm_setting_connection_get_connection_type (s_con);
|
2012-03-14 13:10:03 +00:00
|
|
|
if (strcmp (ctype, NM_SETTING_VLAN_SETTING_NAME) != 0) {
|
|
|
|
g_set_error (error, NM_DEVICE_VLAN_ERROR, NM_DEVICE_VLAN_ERROR_NOT_VLAN_CONNECTION,
|
|
|
|
"The connection was not a VLAN connection.");
|
2012-03-07 17:44:25 +00:00
|
|
|
return FALSE;
|
2012-03-14 13:10:03 +00:00
|
|
|
}
|
2012-03-07 17:44:25 +00:00
|
|
|
|
|
|
|
s_vlan = nm_connection_get_setting_vlan (connection);
|
2012-03-14 13:10:03 +00:00
|
|
|
if (!s_vlan) {
|
|
|
|
g_set_error (error, NM_DEVICE_VLAN_ERROR, NM_DEVICE_VLAN_ERROR_INVALID_VLAN_CONNECTION,
|
|
|
|
"The connection was not a valid VLAN connection.");
|
2012-03-07 17:44:25 +00:00
|
|
|
return FALSE;
|
2012-03-14 13:10:03 +00:00
|
|
|
}
|
2012-03-07 17:44:25 +00:00
|
|
|
|
2012-03-14 13:10:03 +00:00
|
|
|
if (nm_setting_vlan_get_id (s_vlan) != nm_device_vlan_get_vlan_id (NM_DEVICE_VLAN (device))) {
|
|
|
|
g_set_error (error, NM_DEVICE_VLAN_ERROR, NM_DEVICE_VLAN_ERROR_ID_MISMATCH,
|
|
|
|
"The VLAN identifiers of the device and the connection didn't match.");
|
2012-03-07 17:44:25 +00:00
|
|
|
return FALSE;
|
2012-03-14 13:10:03 +00:00
|
|
|
}
|
2012-03-07 17:44:25 +00:00
|
|
|
|
|
|
|
dev_iface_name = nm_device_get_iface (device);
|
|
|
|
vlan_iface_name = nm_setting_vlan_get_interface_name (s_vlan);
|
2012-03-14 13:10:03 +00:00
|
|
|
if (vlan_iface_name && g_strcmp0 (dev_iface_name, vlan_iface_name) != 0) {
|
|
|
|
g_set_error (error, NM_DEVICE_VLAN_ERROR, NM_DEVICE_VLAN_ERROR_INTERFACE_MISMATCH,
|
|
|
|
"The interfaces of the device and the connection didn't match.");
|
2012-03-07 17:44:25 +00:00
|
|
|
return FALSE;
|
2012-03-14 13:10:03 +00:00
|
|
|
}
|
2012-03-07 17:44:25 +00:00
|
|
|
|
all: standardize on NMSettingWired:mac-address for all VLANs
Currently, ethernet-based VLANs can specify the hardware address of
the parent device (and, in theory, the cloned hardware address and MTU
of the VLAN device) by using an NMSettingWired in addition to the
NMSettingVlan.
The theory was that non-ethernet-based VLANs, when we eventually
supported them, would likewise use the setting type corresponding to
their parent device. However, this turns out to be both complicated
(the settings plugins and connection editor would have a
hard-to-impossible time figuring out which setting type to use in some
cases) and incorrect (for most L2 settings [eg, BSSID, bond mode,
etc], the VLAN can't have its own values separate from the parent
device).
What we should have done was just have :mac-address,
:cloned-mac-address, and :mtu properties on NMSettingVlan. However, at
this point, for backward-compatibility, we will just stick with using
a combination of NMSettingVlan and NMSettingWired, but we will use
NMSettingWired regardless of the underlying hardware type.
2013-09-09 13:40:40 +00:00
|
|
|
s_wired = nm_connection_get_setting_wired (connection);
|
|
|
|
if (s_wired)
|
|
|
|
mac_address = nm_setting_wired_get_mac_address (s_wired);
|
|
|
|
else
|
|
|
|
mac_address = NULL;
|
|
|
|
if (mac_address) {
|
|
|
|
mac_address_str = nm_utils_hwaddr_ntoa_len (mac_address->data, mac_address->len);
|
|
|
|
if (!g_strcmp0 (mac_address_str, NM_DEVICE_VLAN_GET_PRIVATE (device)->hw_address)) {
|
|
|
|
g_set_error (error, NM_DEVICE_VLAN_ERROR, NM_DEVICE_VLAN_ERROR_MAC_MISMATCH,
|
|
|
|
"The hardware address of the device and the connection didn't match.");
|
|
|
|
}
|
|
|
|
g_free (mac_address_str);
|
|
|
|
}
|
|
|
|
|
2013-03-11 14:16:24 +00:00
|
|
|
return NM_DEVICE_CLASS (nm_device_vlan_parent_class)->connection_compatible (device, connection, error);
|
2012-03-07 17:44:25 +00:00
|
|
|
}
|
|
|
|
|
2014-02-11 14:55:04 +00:00
|
|
|
static GType
|
|
|
|
get_setting_type (NMDevice *device)
|
|
|
|
{
|
|
|
|
return NM_TYPE_SETTING_VLAN;
|
|
|
|
}
|
|
|
|
|
2013-12-16 15:30:59 +00:00
|
|
|
static const char *
|
|
|
|
get_hw_address (NMDevice *device)
|
|
|
|
{
|
|
|
|
return nm_device_vlan_get_hw_address (NM_DEVICE_VLAN (device));
|
|
|
|
}
|
|
|
|
|
2012-03-07 17:44:25 +00:00
|
|
|
/***********************************************************/
|
|
|
|
|
|
|
|
static void
|
|
|
|
nm_device_vlan_init (NMDeviceVlan *device)
|
|
|
|
{
|
2012-03-12 18:46:20 +00:00
|
|
|
_nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_VLAN);
|
2012-03-07 17:44:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
register_properties (NMDeviceVlan *device)
|
|
|
|
{
|
|
|
|
NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (device);
|
|
|
|
const NMPropertiesInfo property_info[] = {
|
|
|
|
{ NM_DEVICE_VLAN_HW_ADDRESS, &priv->hw_address },
|
|
|
|
{ NM_DEVICE_VLAN_CARRIER, &priv->carrier },
|
2014-07-21 10:32:10 +00:00
|
|
|
{ NM_DEVICE_VLAN_PARENT, &priv->parent, NULL, NM_TYPE_DEVICE },
|
2012-03-07 17:44:25 +00:00
|
|
|
{ NM_DEVICE_VLAN_VLAN_ID, &priv->vlan_id },
|
|
|
|
{ NULL },
|
|
|
|
};
|
|
|
|
|
|
|
|
_nm_object_register_properties (NM_OBJECT (device),
|
|
|
|
priv->proxy,
|
|
|
|
property_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
constructed (GObject *object)
|
|
|
|
{
|
2013-03-01 21:58:31 +00:00
|
|
|
NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (object);
|
2012-03-07 17:44:25 +00:00
|
|
|
|
|
|
|
G_OBJECT_CLASS (nm_device_vlan_parent_class)->constructed (object);
|
|
|
|
|
2013-03-01 21:58:31 +00:00
|
|
|
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_VLAN);
|
2012-03-07 17:44:25 +00:00
|
|
|
register_properties (NM_DEVICE_VLAN (object));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dispose (GObject *object)
|
|
|
|
{
|
|
|
|
NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (object);
|
|
|
|
|
2014-07-21 10:32:10 +00:00
|
|
|
g_clear_object (&priv->parent);
|
2012-04-23 15:02:48 +00:00
|
|
|
g_clear_object (&priv->proxy);
|
2012-03-07 17:44:25 +00:00
|
|
|
|
|
|
|
G_OBJECT_CLASS (nm_device_vlan_parent_class)->dispose (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
finalize (GObject *object)
|
|
|
|
{
|
|
|
|
NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (object);
|
|
|
|
|
|
|
|
g_free (priv->hw_address);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (nm_device_vlan_parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
NMDeviceVlan *device = NM_DEVICE_VLAN (object);
|
|
|
|
|
2012-03-28 13:06:12 +00:00
|
|
|
_nm_object_ensure_inited (NM_OBJECT (object));
|
|
|
|
|
2012-03-07 17:44:25 +00:00
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_HW_ADDRESS:
|
|
|
|
g_value_set_string (value, nm_device_vlan_get_hw_address (device));
|
|
|
|
break;
|
|
|
|
case PROP_CARRIER:
|
|
|
|
g_value_set_boolean (value, nm_device_vlan_get_carrier (device));
|
|
|
|
break;
|
2014-07-21 10:32:10 +00:00
|
|
|
case PROP_PARENT:
|
|
|
|
g_value_set_object (value, nm_device_vlan_get_parent (device));
|
|
|
|
break;
|
2012-03-07 17:44:25 +00:00
|
|
|
case PROP_VLAN_ID:
|
|
|
|
g_value_set_uint (value, nm_device_vlan_get_vlan_id (device));
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-08-18 15:09:29 +00:00
|
|
|
nm_device_vlan_class_init (NMDeviceVlanClass *vlan_class)
|
2012-03-07 17:44:25 +00:00
|
|
|
{
|
2014-08-18 15:09:29 +00:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (vlan_class);
|
|
|
|
NMDeviceClass *device_class = NM_DEVICE_CLASS (vlan_class);
|
2012-03-07 17:44:25 +00:00
|
|
|
|
2014-08-18 15:09:29 +00:00
|
|
|
g_type_class_add_private (vlan_class, sizeof (NMDeviceVlanPrivate));
|
2012-03-07 17:44:25 +00:00
|
|
|
|
|
|
|
/* virtual methods */
|
|
|
|
object_class->constructed = constructed;
|
|
|
|
object_class->dispose = dispose;
|
|
|
|
object_class->finalize = finalize;
|
|
|
|
object_class->get_property = get_property;
|
2012-03-14 13:10:03 +00:00
|
|
|
device_class->connection_compatible = connection_compatible;
|
2014-02-11 14:55:04 +00:00
|
|
|
device_class->get_setting_type = get_setting_type;
|
2013-12-16 15:30:59 +00:00
|
|
|
device_class->get_hw_address = get_hw_address;
|
2012-03-07 17:44:25 +00:00
|
|
|
|
|
|
|
/* properties */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* NMDeviceVlan:hw-address:
|
|
|
|
*
|
|
|
|
* The hardware (MAC) address of the device.
|
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_HW_ADDRESS,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_string (NM_DEVICE_VLAN_HW_ADDRESS, "", "",
|
2012-03-07 17:44:25 +00:00
|
|
|
NULL,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2012-03-07 17:44:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* NMDeviceVlan:carrier:
|
|
|
|
*
|
|
|
|
* Whether the device has carrier.
|
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_CARRIER,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_boolean (NM_DEVICE_VLAN_CARRIER, "", "",
|
2012-03-07 17:44:25 +00:00
|
|
|
FALSE,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2012-03-07 17:44:25 +00:00
|
|
|
|
2014-07-21 10:32:10 +00:00
|
|
|
/**
|
|
|
|
* NMDeviceVlan:parent:
|
|
|
|
*
|
|
|
|
* The devices's parent device.
|
|
|
|
*
|
|
|
|
* Since: 1.0
|
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_PARENT,
|
|
|
|
g_param_spec_object (NM_DEVICE_VLAN_PARENT, "", "",
|
|
|
|
NM_TYPE_DEVICE,
|
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
|
|
|
|
2012-03-07 17:44:25 +00:00
|
|
|
/**
|
|
|
|
* NMDeviceVlan:vlan-id:
|
|
|
|
*
|
|
|
|
* The device's VLAN ID.
|
|
|
|
**/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class, PROP_VLAN_ID,
|
2014-06-09 20:17:37 +00:00
|
|
|
g_param_spec_uint (NM_DEVICE_VLAN_VLAN_ID, "", "",
|
2012-03-07 17:44:25 +00:00
|
|
|
0, 4095, 0,
|
2014-06-09 20:17:37 +00:00
|
|
|
G_PARAM_READABLE |
|
|
|
|
G_PARAM_STATIC_STRINGS));
|
2012-03-07 17:44:25 +00:00
|
|
|
}
|