libnm-core: reorder code in settings
Order the code in our common way. No other changes. - ensure to include the main header first (directly after "nm-default.h"). - reorder function definitions: get_property(), set_property(), *_init(), *_new(), finalize(), *_class_init().
This commit is contained in:
@@ -22,10 +22,11 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-connection.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
#include "nm-connection.h"
|
|
||||||
#include "nm-connection-private.h"
|
#include "nm-connection-private.h"
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
@@ -50,19 +51,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
/*****************************************************************************/
|
||||||
NMConnection *self;
|
|
||||||
|
|
||||||
GHashTable *settings;
|
|
||||||
|
|
||||||
/* D-Bus path of the connection, if any */
|
|
||||||
char *path;
|
|
||||||
} NMConnectionPrivate;
|
|
||||||
|
|
||||||
static NMConnectionPrivate *nm_connection_get_private (NMConnection *connection);
|
|
||||||
#define NM_CONNECTION_GET_PRIVATE(o) (nm_connection_get_private ((NMConnection *)o))
|
|
||||||
|
|
||||||
G_DEFINE_INTERFACE (NMConnection, nm_connection, G_TYPE_OBJECT)
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
SECRETS_UPDATED,
|
SECRETS_UPDATED,
|
||||||
@@ -73,6 +62,20 @@ enum {
|
|||||||
|
|
||||||
static guint signals[LAST_SIGNAL] = { 0 };
|
static guint signals[LAST_SIGNAL] = { 0 };
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
NMConnection *self;
|
||||||
|
|
||||||
|
GHashTable *settings;
|
||||||
|
|
||||||
|
/* D-Bus path of the connection, if any */
|
||||||
|
char *path;
|
||||||
|
} NMConnectionPrivate;
|
||||||
|
|
||||||
|
G_DEFINE_INTERFACE (NMConnection, nm_connection, G_TYPE_OBJECT)
|
||||||
|
|
||||||
|
static NMConnectionPrivate *nm_connection_get_private (NMConnection *connection);
|
||||||
|
#define NM_CONNECTION_GET_PRIVATE(o) (nm_connection_get_private ((NMConnection *)o))
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static gpointer
|
static gpointer
|
||||||
|
@@ -19,9 +19,20 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
#include "nm-setting-private.h"
|
|
||||||
#include "nm-setting-6lowpan.h"
|
#include "nm-setting-6lowpan.h"
|
||||||
|
|
||||||
|
#include "nm-setting-private.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SECTION:nm-setting-6lowpan
|
||||||
|
* @short_description: Describes connection properties for 6LoWPAN interfaces
|
||||||
|
*
|
||||||
|
* The #NMSetting6Lowpan object is a #NMSetting subclass that describes properties
|
||||||
|
* necessary for connection to 6LoWPAN interfaces.
|
||||||
|
**/
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_PARENT,
|
PROP_PARENT,
|
||||||
);
|
);
|
||||||
@@ -43,33 +54,11 @@ struct _NMSetting6LowpanClass {
|
|||||||
NMSettingClass parent;
|
NMSettingClass parent;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* SECTION:nm-setting-6lowpan
|
|
||||||
* @short_description: Describes connection properties for 6LoWPAN interfaces
|
|
||||||
*
|
|
||||||
* The #NMSetting6Lowpan object is a #NMSetting subclass that describes properties
|
|
||||||
* necessary for connection to 6LoWPAN interfaces.
|
|
||||||
**/
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSetting6Lowpan, nm_setting_6lowpan, NM_TYPE_SETTING)
|
G_DEFINE_TYPE (NMSetting6Lowpan, nm_setting_6lowpan, NM_TYPE_SETTING)
|
||||||
|
|
||||||
#define NM_SETTING_6LOWPAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_6LOWPAN, NMSetting6LowpanPrivate))
|
#define NM_SETTING_6LOWPAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_6LOWPAN, NMSetting6LowpanPrivate))
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
/**
|
|
||||||
* nm_setting_6lowpan_new:
|
|
||||||
*
|
|
||||||
* Creates a new #NMSetting6Lowpan object with default values.
|
|
||||||
*
|
|
||||||
* Returns: (transfer full): the new empty #NMSetting6Lowpan object
|
|
||||||
*
|
|
||||||
* Since: 1.14
|
|
||||||
**/
|
|
||||||
NMSetting *
|
|
||||||
nm_setting_6lowpan_new (void)
|
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_6LOWPAN, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_6lowpan_get_parent:
|
* nm_setting_6lowpan_get_parent:
|
||||||
@@ -143,9 +132,23 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_6lowpan_init (NMSetting6Lowpan *setting)
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
|
NMSetting6Lowpan *setting = NM_SETTING_6LOWPAN (object);
|
||||||
|
NMSetting6LowpanPrivate *priv = NM_SETTING_6LOWPAN_GET_PRIVATE (setting);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_PARENT:
|
||||||
|
g_value_set_string (value, priv->parent);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -166,21 +169,26 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
get_property (GObject *object, guint prop_id,
|
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSetting6Lowpan *setting = NM_SETTING_6LOWPAN (object);
|
|
||||||
NMSetting6LowpanPrivate *priv = NM_SETTING_6LOWPAN_GET_PRIVATE (setting);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
static void
|
||||||
case PROP_PARENT:
|
nm_setting_6lowpan_init (NMSetting6Lowpan *setting)
|
||||||
g_value_set_string (value, priv->parent);
|
{
|
||||||
break;
|
}
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
/**
|
||||||
break;
|
* nm_setting_6lowpan_new:
|
||||||
}
|
*
|
||||||
|
* Creates a new #NMSetting6Lowpan object with default values.
|
||||||
|
*
|
||||||
|
* Returns: (transfer full): the new empty #NMSetting6Lowpan object
|
||||||
|
*
|
||||||
|
* Since: 1.14
|
||||||
|
**/
|
||||||
|
NMSetting *
|
||||||
|
nm_setting_6lowpan_new (void)
|
||||||
|
{
|
||||||
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_6LOWPAN, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -202,8 +210,8 @@ nm_setting_6lowpan_class_init (NMSetting6LowpanClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSetting6LowpanPrivate));
|
g_type_class_add_private (klass, sizeof (NMSetting6LowpanPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -3369,8 +3369,6 @@ finalize (GObject *object)
|
|||||||
NMSetting8021x *self = NM_SETTING_802_1X (object);
|
NMSetting8021x *self = NM_SETTING_802_1X (object);
|
||||||
NMSetting8021xPrivate *priv = NM_SETTING_802_1X_GET_PRIVATE (self);
|
NMSetting8021xPrivate *priv = NM_SETTING_802_1X_GET_PRIVATE (self);
|
||||||
|
|
||||||
/* Strings first. g_free() already checks for NULLs so we don't have to */
|
|
||||||
|
|
||||||
g_free (priv->identity);
|
g_free (priv->identity);
|
||||||
g_free (priv->anonymous_identity);
|
g_free (priv->anonymous_identity);
|
||||||
g_free (priv->ca_path);
|
g_free (priv->ca_path);
|
||||||
@@ -3416,8 +3414,8 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSetting8021xPrivate));
|
g_type_class_add_private (klass, sizeof (NMSetting8021xPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -21,9 +21,10 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-adsl.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "nm-setting-adsl.h"
|
|
||||||
#include "nm-setting-ppp.h"
|
#include "nm-setting-ppp.h"
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
@@ -37,19 +38,7 @@
|
|||||||
* properties of ADSL connections.
|
* properties of ADSL connections.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingAdsl, nm_setting_adsl, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_ADSL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_ADSL, NMSettingAdslPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char * username;
|
|
||||||
char * password;
|
|
||||||
NMSettingSecretFlags password_flags;
|
|
||||||
char * protocol;
|
|
||||||
char * encapsulation;
|
|
||||||
guint32 vpi;
|
|
||||||
guint32 vci;
|
|
||||||
} NMSettingAdslPrivate;
|
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_USERNAME,
|
PROP_USERNAME,
|
||||||
@@ -61,18 +50,21 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
|||||||
PROP_VCI,
|
PROP_VCI,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
typedef struct {
|
||||||
* nm_setting_adsl_new:
|
char * username;
|
||||||
*
|
char * password;
|
||||||
* Creates a new #NMSettingAdsl object with default values.
|
NMSettingSecretFlags password_flags;
|
||||||
*
|
char * protocol;
|
||||||
* Returns: the new empty #NMSettingAdsl object
|
char * encapsulation;
|
||||||
**/
|
guint32 vpi;
|
||||||
NMSetting *
|
guint32 vci;
|
||||||
nm_setting_adsl_new (void)
|
} NMSettingAdslPrivate;
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_ADSL, NULL);
|
G_DEFINE_TYPE (NMSettingAdsl, nm_setting_adsl, NM_TYPE_SETTING)
|
||||||
}
|
|
||||||
|
#define NM_SETTING_ADSL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_ADSL, NMSettingAdslPrivate))
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_adsl_get_username:
|
* nm_setting_adsl_get_username:
|
||||||
@@ -247,22 +239,40 @@ need_secrets (NMSetting *setting)
|
|||||||
return secrets;
|
return secrets;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
nm_setting_adsl_init (NMSettingAdsl *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
finalize (GObject *object)
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
NMSettingAdslPrivate *priv = NM_SETTING_ADSL_GET_PRIVATE (object);
|
NMSettingAdsl *setting = NM_SETTING_ADSL (object);
|
||||||
|
|
||||||
g_free (priv->username);
|
switch (prop_id) {
|
||||||
g_free (priv->password);
|
case PROP_USERNAME:
|
||||||
g_free (priv->protocol);
|
g_value_set_string (value, nm_setting_adsl_get_username (setting));
|
||||||
g_free (priv->encapsulation);
|
break;
|
||||||
|
case PROP_PASSWORD:
|
||||||
G_OBJECT_CLASS (nm_setting_adsl_parent_class)->finalize (object);
|
g_value_set_string (value, nm_setting_adsl_get_password (setting));
|
||||||
|
break;
|
||||||
|
case PROP_PASSWORD_FLAGS:
|
||||||
|
g_value_set_flags (value, nm_setting_adsl_get_password_flags (setting));
|
||||||
|
break;
|
||||||
|
case PROP_PROTOCOL:
|
||||||
|
g_value_set_string (value, nm_setting_adsl_get_protocol (setting));
|
||||||
|
break;
|
||||||
|
case PROP_ENCAPSULATION:
|
||||||
|
g_value_set_string (value, nm_setting_adsl_get_encapsulation (setting));
|
||||||
|
break;
|
||||||
|
case PROP_VPI:
|
||||||
|
g_value_set_uint (value, nm_setting_adsl_get_vpi (setting));
|
||||||
|
break;
|
||||||
|
case PROP_VCI:
|
||||||
|
g_value_set_uint (value, nm_setting_adsl_get_vci (setting));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -306,38 +316,37 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
get_property (GObject *object, guint prop_id,
|
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingAdsl *setting = NM_SETTING_ADSL (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
static void
|
||||||
case PROP_USERNAME:
|
nm_setting_adsl_init (NMSettingAdsl *setting)
|
||||||
g_value_set_string (value, nm_setting_adsl_get_username (setting));
|
{
|
||||||
break;
|
}
|
||||||
case PROP_PASSWORD:
|
|
||||||
g_value_set_string (value, nm_setting_adsl_get_password (setting));
|
/**
|
||||||
break;
|
* nm_setting_adsl_new:
|
||||||
case PROP_PASSWORD_FLAGS:
|
*
|
||||||
g_value_set_flags (value, nm_setting_adsl_get_password_flags (setting));
|
* Creates a new #NMSettingAdsl object with default values.
|
||||||
break;
|
*
|
||||||
case PROP_PROTOCOL:
|
* Returns: the new empty #NMSettingAdsl object
|
||||||
g_value_set_string (value, nm_setting_adsl_get_protocol (setting));
|
**/
|
||||||
break;
|
NMSetting *
|
||||||
case PROP_ENCAPSULATION:
|
nm_setting_adsl_new (void)
|
||||||
g_value_set_string (value, nm_setting_adsl_get_encapsulation (setting));
|
{
|
||||||
break;
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_ADSL, NULL);
|
||||||
case PROP_VPI:
|
}
|
||||||
g_value_set_uint (value, nm_setting_adsl_get_vpi (setting));
|
|
||||||
break;
|
static void
|
||||||
case PROP_VCI:
|
finalize (GObject *object)
|
||||||
g_value_set_uint (value, nm_setting_adsl_get_vci (setting));
|
{
|
||||||
break;
|
NMSettingAdslPrivate *priv = NM_SETTING_ADSL_GET_PRIVATE (object);
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
g_free (priv->username);
|
||||||
break;
|
g_free (priv->password);
|
||||||
}
|
g_free (priv->protocol);
|
||||||
|
g_free (priv->encapsulation);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (nm_setting_adsl_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -348,8 +357,8 @@ nm_setting_adsl_class_init (NMSettingAdslClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingAdslPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingAdslPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -22,11 +22,12 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-bluetooth.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <net/ethernet.h>
|
#include <net/ethernet.h>
|
||||||
|
|
||||||
#include "nm-connection-private.h"
|
#include "nm-connection-private.h"
|
||||||
#include "nm-setting-bluetooth.h"
|
|
||||||
#include "nm-setting-cdma.h"
|
#include "nm-setting-cdma.h"
|
||||||
#include "nm-setting-gsm.h"
|
#include "nm-setting-gsm.h"
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
@@ -43,31 +44,23 @@
|
|||||||
* Point (NAP) profiles.
|
* Point (NAP) profiles.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingBluetooth, nm_setting_bluetooth, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_BLUETOOTH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_BLUETOOTH, NMSettingBluetoothPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char *bdaddr;
|
|
||||||
char *type;
|
|
||||||
} NMSettingBluetoothPrivate;
|
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_BDADDR,
|
PROP_BDADDR,
|
||||||
PROP_TYPE,
|
PROP_TYPE,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
typedef struct {
|
||||||
* nm_setting_bluetooth_new:
|
char *bdaddr;
|
||||||
*
|
char *type;
|
||||||
* Creates a new #NMSettingBluetooth object with default values.
|
} NMSettingBluetoothPrivate;
|
||||||
*
|
|
||||||
* Returns: (transfer full): the new empty #NMSettingBluetooth object
|
G_DEFINE_TYPE (NMSettingBluetooth, nm_setting_bluetooth, NM_TYPE_SETTING)
|
||||||
**/
|
|
||||||
NMSetting *nm_setting_bluetooth_new (void)
|
#define NM_SETTING_BLUETOOTH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_BLUETOOTH, NMSettingBluetoothPrivate))
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_BLUETOOTH, NULL);
|
/*****************************************************************************/
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_bluetooth_get_connection_type:
|
* nm_setting_bluetooth_get_connection_type:
|
||||||
@@ -221,20 +214,25 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
nm_setting_bluetooth_init (NMSettingBluetooth *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
finalize (GObject *object)
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
NMSettingBluetoothPrivate *priv = NM_SETTING_BLUETOOTH_GET_PRIVATE (object);
|
NMSettingBluetooth *setting = NM_SETTING_BLUETOOTH (object);
|
||||||
|
|
||||||
g_free (priv->bdaddr);
|
switch (prop_id) {
|
||||||
g_free (priv->type);
|
case PROP_BDADDR:
|
||||||
|
g_value_set_string (value, nm_setting_bluetooth_get_bdaddr (setting));
|
||||||
G_OBJECT_CLASS (nm_setting_bluetooth_parent_class)->finalize (object);
|
break;
|
||||||
|
case PROP_TYPE:
|
||||||
|
g_value_set_string (value, nm_setting_bluetooth_get_connection_type (setting));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -258,23 +256,34 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
get_property (GObject *object, guint prop_id,
|
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingBluetooth *setting = NM_SETTING_BLUETOOTH (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
static void
|
||||||
case PROP_BDADDR:
|
nm_setting_bluetooth_init (NMSettingBluetooth *setting)
|
||||||
g_value_set_string (value, nm_setting_bluetooth_get_bdaddr (setting));
|
{
|
||||||
break;
|
}
|
||||||
case PROP_TYPE:
|
|
||||||
g_value_set_string (value, nm_setting_bluetooth_get_connection_type (setting));
|
/**
|
||||||
break;
|
* nm_setting_bluetooth_new:
|
||||||
default:
|
*
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
* Creates a new #NMSettingBluetooth object with default values.
|
||||||
break;
|
*
|
||||||
}
|
* Returns: (transfer full): the new empty #NMSettingBluetooth object
|
||||||
|
**/
|
||||||
|
NMSetting *nm_setting_bluetooth_new (void)
|
||||||
|
{
|
||||||
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_BLUETOOTH, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
finalize (GObject *object)
|
||||||
|
{
|
||||||
|
NMSettingBluetoothPrivate *priv = NM_SETTING_BLUETOOTH_GET_PRIVATE (object);
|
||||||
|
|
||||||
|
g_free (priv->bdaddr);
|
||||||
|
g_free (priv->type);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (nm_setting_bluetooth_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -286,8 +295,8 @@ nm_setting_bluetooth_class_init (NMSettingBluetoothClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingBluetoothPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingBluetoothPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -21,13 +21,14 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-bond.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
#include "nm-setting-bond.h"
|
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-utils-private.h"
|
#include "nm-utils-private.h"
|
||||||
#include "nm-connection-private.h"
|
#include "nm-connection-private.h"
|
||||||
@@ -960,8 +961,8 @@ nm_setting_bond_class_init (NMSettingBondClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingBondPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingBondPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -21,11 +21,12 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-bridge-port.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "nm-setting-bridge-port.h"
|
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-utils-private.h"
|
#include "nm-utils-private.h"
|
||||||
#include "nm-connection-private.h"
|
#include "nm-connection-private.h"
|
||||||
@@ -40,9 +41,13 @@
|
|||||||
* optional properties that apply to bridge ports.
|
* optional properties that apply to bridge ports.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingBridgePort, nm_setting_bridge_port, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_BRIDGE_PORT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_BRIDGE_PORT, NMSettingBridgePortPrivate))
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
|
PROP_PRIORITY,
|
||||||
|
PROP_PATH_COST,
|
||||||
|
PROP_HAIRPIN_MODE,
|
||||||
|
);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
guint16 priority;
|
guint16 priority;
|
||||||
@@ -50,11 +55,9 @@ typedef struct {
|
|||||||
gboolean hairpin_mode;
|
gboolean hairpin_mode;
|
||||||
} NMSettingBridgePortPrivate;
|
} NMSettingBridgePortPrivate;
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
G_DEFINE_TYPE (NMSettingBridgePort, nm_setting_bridge_port, NM_TYPE_SETTING)
|
||||||
PROP_PRIORITY,
|
|
||||||
PROP_PATH_COST,
|
#define NM_SETTING_BRIDGE_PORT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_BRIDGE_PORT, NMSettingBridgePortPrivate))
|
||||||
PROP_HAIRPIN_MODE,
|
|
||||||
);
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
@@ -139,22 +142,26 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
|
||||||
* nm_setting_bridge_port_new:
|
|
||||||
*
|
|
||||||
* Creates a new #NMSettingBridgePort object with default values.
|
|
||||||
*
|
|
||||||
* Returns: (transfer full): the new empty #NMSettingBridgePort object
|
|
||||||
**/
|
|
||||||
NMSetting *
|
|
||||||
nm_setting_bridge_port_new (void)
|
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_BRIDGE_PORT, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_bridge_port_init (NMSettingBridgePort *setting)
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
|
NMSettingBridgePortPrivate *priv = NM_SETTING_BRIDGE_PORT_GET_PRIVATE (object);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_PRIORITY:
|
||||||
|
g_value_set_uint (value, priv->priority);
|
||||||
|
break;
|
||||||
|
case PROP_PATH_COST:
|
||||||
|
g_value_set_uint (value, priv->path_cost);
|
||||||
|
break;
|
||||||
|
case PROP_HAIRPIN_MODE:
|
||||||
|
g_value_set_boolean (value, priv->hairpin_mode);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -179,26 +186,24 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
get_property (GObject *object, guint prop_id,
|
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingBridgePortPrivate *priv = NM_SETTING_BRIDGE_PORT_GET_PRIVATE (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
static void
|
||||||
case PROP_PRIORITY:
|
nm_setting_bridge_port_init (NMSettingBridgePort *setting)
|
||||||
g_value_set_uint (value, priv->priority);
|
{
|
||||||
break;
|
}
|
||||||
case PROP_PATH_COST:
|
|
||||||
g_value_set_uint (value, priv->path_cost);
|
/**
|
||||||
break;
|
* nm_setting_bridge_port_new:
|
||||||
case PROP_HAIRPIN_MODE:
|
*
|
||||||
g_value_set_boolean (value, priv->hairpin_mode);
|
* Creates a new #NMSettingBridgePort object with default values.
|
||||||
break;
|
*
|
||||||
default:
|
* Returns: (transfer full): the new empty #NMSettingBridgePort object
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
**/
|
||||||
break;
|
NMSetting *
|
||||||
}
|
nm_setting_bridge_port_new (void)
|
||||||
|
{
|
||||||
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_BRIDGE_PORT, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -209,8 +214,8 @@ nm_setting_bridge_port_class_init (NMSettingBridgePortClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingBridgePortPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingBridgePortPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
|
||||||
|
@@ -21,11 +21,12 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-bridge.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "nm-setting-bridge.h"
|
|
||||||
#include "nm-connection-private.h"
|
#include "nm-connection-private.h"
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-utils-private.h"
|
#include "nm-utils-private.h"
|
||||||
@@ -38,21 +39,7 @@
|
|||||||
* necessary for bridging connections.
|
* necessary for bridging connections.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingBridge, nm_setting_bridge, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_BRIDGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_BRIDGE, NMSettingBridgePrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char * mac_address;
|
|
||||||
gboolean stp;
|
|
||||||
guint16 priority;
|
|
||||||
guint16 forward_delay;
|
|
||||||
guint16 hello_time;
|
|
||||||
guint16 max_age;
|
|
||||||
guint32 ageing_time;
|
|
||||||
guint16 group_forward_mask;
|
|
||||||
gboolean multicast_snooping;
|
|
||||||
} NMSettingBridgePrivate;
|
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_MAC_ADDRESS,
|
PROP_MAC_ADDRESS,
|
||||||
@@ -66,18 +53,23 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
|||||||
PROP_MULTICAST_SNOOPING,
|
PROP_MULTICAST_SNOOPING,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
typedef struct {
|
||||||
* nm_setting_bridge_new:
|
char * mac_address;
|
||||||
*
|
gboolean stp;
|
||||||
* Creates a new #NMSettingBridge object with default values.
|
guint16 priority;
|
||||||
*
|
guint16 forward_delay;
|
||||||
* Returns: (transfer full): the new empty #NMSettingBridge object
|
guint16 hello_time;
|
||||||
**/
|
guint16 max_age;
|
||||||
NMSetting *
|
guint32 ageing_time;
|
||||||
nm_setting_bridge_new (void)
|
guint16 group_forward_mask;
|
||||||
{
|
gboolean multicast_snooping;
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_BRIDGE, NULL);
|
} NMSettingBridgePrivate;
|
||||||
}
|
|
||||||
|
G_DEFINE_TYPE (NMSettingBridge, nm_setting_bridge, NM_TYPE_SETTING)
|
||||||
|
|
||||||
|
#define NM_SETTING_BRIDGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_BRIDGE, NMSettingBridgePrivate))
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_bridge_get_mac_address:
|
* nm_setting_bridge_get_mac_address:
|
||||||
@@ -290,19 +282,47 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
return _nm_connection_verify_required_interface_name (connection, error);
|
return _nm_connection_verify_required_interface_name (connection, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
nm_setting_bridge_init (NMSettingBridge *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
finalize (GObject *object)
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
NMSettingBridgePrivate *priv = NM_SETTING_BRIDGE_GET_PRIVATE (object);
|
NMSettingBridgePrivate *priv = NM_SETTING_BRIDGE_GET_PRIVATE (object);
|
||||||
|
NMSettingBridge *setting = NM_SETTING_BRIDGE (object);
|
||||||
|
|
||||||
g_free (priv->mac_address);
|
switch (prop_id) {
|
||||||
|
case PROP_MAC_ADDRESS:
|
||||||
G_OBJECT_CLASS (nm_setting_bridge_parent_class)->finalize (object);
|
g_value_set_string (value, nm_setting_bridge_get_mac_address (setting));
|
||||||
|
break;
|
||||||
|
case PROP_STP:
|
||||||
|
g_value_set_boolean (value, priv->stp);
|
||||||
|
break;
|
||||||
|
case PROP_PRIORITY:
|
||||||
|
g_value_set_uint (value, priv->priority);
|
||||||
|
break;
|
||||||
|
case PROP_FORWARD_DELAY:
|
||||||
|
g_value_set_uint (value, priv->forward_delay);
|
||||||
|
break;
|
||||||
|
case PROP_HELLO_TIME:
|
||||||
|
g_value_set_uint (value, priv->hello_time);
|
||||||
|
break;
|
||||||
|
case PROP_MAX_AGE:
|
||||||
|
g_value_set_uint (value, priv->max_age);
|
||||||
|
break;
|
||||||
|
case PROP_AGEING_TIME:
|
||||||
|
g_value_set_uint (value, priv->ageing_time);
|
||||||
|
break;
|
||||||
|
case PROP_GROUP_FORWARD_MASK:
|
||||||
|
g_value_set_uint (value, priv->group_forward_mask);
|
||||||
|
break;
|
||||||
|
case PROP_MULTICAST_SNOOPING:
|
||||||
|
g_value_set_boolean (value, priv->multicast_snooping);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -347,45 +367,34 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object, guint prop_id,
|
nm_setting_bridge_init (NMSettingBridge *setting)
|
||||||
GValue *value, GParamSpec *pspec)
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nm_setting_bridge_new:
|
||||||
|
*
|
||||||
|
* Creates a new #NMSettingBridge object with default values.
|
||||||
|
*
|
||||||
|
* Returns: (transfer full): the new empty #NMSettingBridge object
|
||||||
|
**/
|
||||||
|
NMSetting *
|
||||||
|
nm_setting_bridge_new (void)
|
||||||
|
{
|
||||||
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_BRIDGE, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
finalize (GObject *object)
|
||||||
{
|
{
|
||||||
NMSettingBridgePrivate *priv = NM_SETTING_BRIDGE_GET_PRIVATE (object);
|
NMSettingBridgePrivate *priv = NM_SETTING_BRIDGE_GET_PRIVATE (object);
|
||||||
NMSettingBridge *setting = NM_SETTING_BRIDGE (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
g_free (priv->mac_address);
|
||||||
case PROP_MAC_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_setting_bridge_get_mac_address (setting));
|
G_OBJECT_CLASS (nm_setting_bridge_parent_class)->finalize (object);
|
||||||
break;
|
|
||||||
case PROP_STP:
|
|
||||||
g_value_set_boolean (value, priv->stp);
|
|
||||||
break;
|
|
||||||
case PROP_PRIORITY:
|
|
||||||
g_value_set_uint (value, priv->priority);
|
|
||||||
break;
|
|
||||||
case PROP_FORWARD_DELAY:
|
|
||||||
g_value_set_uint (value, priv->forward_delay);
|
|
||||||
break;
|
|
||||||
case PROP_HELLO_TIME:
|
|
||||||
g_value_set_uint (value, priv->hello_time);
|
|
||||||
break;
|
|
||||||
case PROP_MAX_AGE:
|
|
||||||
g_value_set_uint (value, priv->max_age);
|
|
||||||
break;
|
|
||||||
case PROP_AGEING_TIME:
|
|
||||||
g_value_set_uint (value, priv->ageing_time);
|
|
||||||
break;
|
|
||||||
case PROP_GROUP_FORWARD_MASK:
|
|
||||||
g_value_set_uint (value, priv->group_forward_mask);
|
|
||||||
break;
|
|
||||||
case PROP_MULTICAST_SNOOPING:
|
|
||||||
g_value_set_boolean (value, priv->multicast_snooping);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -397,8 +406,8 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingBridgePrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingBridgePrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -21,9 +21,10 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-cdma.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "nm-setting-cdma.h"
|
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
#include "nm-core-enum-types.h"
|
#include "nm-core-enum-types.h"
|
||||||
@@ -37,17 +38,7 @@
|
|||||||
* networks, including those using CDMA2000/EVDO technology.
|
* networks, including those using CDMA2000/EVDO technology.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingCdma, nm_setting_cdma, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_CDMA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_CDMA, NMSettingCdmaPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char *number; /* For dialing, duh */
|
|
||||||
char *username;
|
|
||||||
char *password;
|
|
||||||
NMSettingSecretFlags password_flags;
|
|
||||||
guint32 mtu;
|
|
||||||
} NMSettingCdmaPrivate;
|
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_NUMBER,
|
PROP_NUMBER,
|
||||||
@@ -57,18 +48,19 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
|||||||
PROP_MTU,
|
PROP_MTU,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
typedef struct {
|
||||||
* nm_setting_cdma_new:
|
char *number; /* For dialing, duh */
|
||||||
*
|
char *username;
|
||||||
* Creates a new #NMSettingCdma object with default values.
|
char *password;
|
||||||
*
|
NMSettingSecretFlags password_flags;
|
||||||
* Returns: the new empty #NMSettingCdma object
|
guint32 mtu;
|
||||||
**/
|
} NMSettingCdmaPrivate;
|
||||||
NMSetting *
|
|
||||||
nm_setting_cdma_new (void)
|
G_DEFINE_TYPE (NMSettingCdma, nm_setting_cdma, NM_TYPE_SETTING)
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_CDMA, NULL);
|
#define NM_SETTING_CDMA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_CDMA, NMSettingCdmaPrivate))
|
||||||
}
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_cdma_get_number:
|
* nm_setting_cdma_get_number:
|
||||||
@@ -203,21 +195,34 @@ need_secrets (NMSetting *setting)
|
|||||||
return secrets;
|
return secrets;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
nm_setting_cdma_init (NMSettingCdma *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
finalize (GObject *object)
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
NMSettingCdmaPrivate *priv = NM_SETTING_CDMA_GET_PRIVATE (object);
|
NMSettingCdma *setting = NM_SETTING_CDMA (object);
|
||||||
|
|
||||||
g_free (priv->number);
|
switch (prop_id) {
|
||||||
g_free (priv->username);
|
case PROP_NUMBER:
|
||||||
g_free (priv->password);
|
g_value_set_string (value, nm_setting_cdma_get_number (setting));
|
||||||
|
break;
|
||||||
G_OBJECT_CLASS (nm_setting_cdma_parent_class)->finalize (object);
|
case PROP_USERNAME:
|
||||||
|
g_value_set_string (value, nm_setting_cdma_get_username (setting));
|
||||||
|
break;
|
||||||
|
case PROP_PASSWORD:
|
||||||
|
g_value_set_string (value, nm_setting_cdma_get_password (setting));
|
||||||
|
break;
|
||||||
|
case PROP_PASSWORD_FLAGS:
|
||||||
|
g_value_set_flags (value, nm_setting_cdma_get_password_flags (setting));
|
||||||
|
break;
|
||||||
|
case PROP_MTU:
|
||||||
|
g_value_set_uint (value, nm_setting_cdma_get_mtu (setting));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -251,32 +256,36 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
get_property (GObject *object, guint prop_id,
|
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingCdma *setting = NM_SETTING_CDMA (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
static void
|
||||||
case PROP_NUMBER:
|
nm_setting_cdma_init (NMSettingCdma *setting)
|
||||||
g_value_set_string (value, nm_setting_cdma_get_number (setting));
|
{
|
||||||
break;
|
}
|
||||||
case PROP_USERNAME:
|
|
||||||
g_value_set_string (value, nm_setting_cdma_get_username (setting));
|
/**
|
||||||
break;
|
* nm_setting_cdma_new:
|
||||||
case PROP_PASSWORD:
|
*
|
||||||
g_value_set_string (value, nm_setting_cdma_get_password (setting));
|
* Creates a new #NMSettingCdma object with default values.
|
||||||
break;
|
*
|
||||||
case PROP_PASSWORD_FLAGS:
|
* Returns: the new empty #NMSettingCdma object
|
||||||
g_value_set_flags (value, nm_setting_cdma_get_password_flags (setting));
|
**/
|
||||||
break;
|
NMSetting *
|
||||||
case PROP_MTU:
|
nm_setting_cdma_new (void)
|
||||||
g_value_set_uint (value, nm_setting_cdma_get_mtu (setting));
|
{
|
||||||
break;
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_CDMA, NULL);
|
||||||
default:
|
}
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
static void
|
||||||
}
|
finalize (GObject *object)
|
||||||
|
{
|
||||||
|
NMSettingCdmaPrivate *priv = NM_SETTING_CDMA_GET_PRIVATE (object);
|
||||||
|
|
||||||
|
g_free (priv->number);
|
||||||
|
g_free (priv->username);
|
||||||
|
g_free (priv->password);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (nm_setting_cdma_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -287,8 +296,8 @@ nm_setting_cdma_class_init (NMSettingCdmaClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingCdmaPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingCdmaPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -45,9 +45,7 @@
|
|||||||
* a #NMSettingConnection setting.
|
* a #NMSettingConnection setting.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingConnection, nm_setting_connection, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_CONNECTION, NMSettingConnectionPrivate))
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
PERM_TYPE_USER = 0,
|
PERM_TYPE_USER = 0,
|
||||||
@@ -58,6 +56,32 @@ typedef struct {
|
|||||||
char *item;
|
char *item;
|
||||||
} Permission;
|
} Permission;
|
||||||
|
|
||||||
|
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingConnection,
|
||||||
|
PROP_ID,
|
||||||
|
PROP_UUID,
|
||||||
|
PROP_INTERFACE_NAME,
|
||||||
|
PROP_TYPE,
|
||||||
|
PROP_PERMISSIONS,
|
||||||
|
PROP_AUTOCONNECT,
|
||||||
|
PROP_AUTOCONNECT_PRIORITY,
|
||||||
|
PROP_AUTOCONNECT_RETRIES,
|
||||||
|
PROP_MULTI_CONNECT,
|
||||||
|
PROP_TIMESTAMP,
|
||||||
|
PROP_READ_ONLY,
|
||||||
|
PROP_ZONE,
|
||||||
|
PROP_MASTER,
|
||||||
|
PROP_SLAVE_TYPE,
|
||||||
|
PROP_AUTOCONNECT_SLAVES,
|
||||||
|
PROP_SECONDARIES,
|
||||||
|
PROP_GATEWAY_PING_TIMEOUT,
|
||||||
|
PROP_METERED,
|
||||||
|
PROP_LLDP,
|
||||||
|
PROP_MDNS,
|
||||||
|
PROP_LLMNR,
|
||||||
|
PROP_STABLE_ID,
|
||||||
|
PROP_AUTH_RETRIES,
|
||||||
|
);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *id;
|
char *id;
|
||||||
char *uuid;
|
char *uuid;
|
||||||
@@ -84,31 +108,9 @@ typedef struct {
|
|||||||
int llmnr;
|
int llmnr;
|
||||||
} NMSettingConnectionPrivate;
|
} NMSettingConnectionPrivate;
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingConnection,
|
G_DEFINE_TYPE (NMSettingConnection, nm_setting_connection, NM_TYPE_SETTING)
|
||||||
PROP_ID,
|
|
||||||
PROP_UUID,
|
#define NM_SETTING_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_CONNECTION, NMSettingConnectionPrivate))
|
||||||
PROP_INTERFACE_NAME,
|
|
||||||
PROP_TYPE,
|
|
||||||
PROP_PERMISSIONS,
|
|
||||||
PROP_AUTOCONNECT,
|
|
||||||
PROP_AUTOCONNECT_PRIORITY,
|
|
||||||
PROP_AUTOCONNECT_RETRIES,
|
|
||||||
PROP_MULTI_CONNECT,
|
|
||||||
PROP_TIMESTAMP,
|
|
||||||
PROP_READ_ONLY,
|
|
||||||
PROP_ZONE,
|
|
||||||
PROP_MASTER,
|
|
||||||
PROP_SLAVE_TYPE,
|
|
||||||
PROP_AUTOCONNECT_SLAVES,
|
|
||||||
PROP_SECONDARIES,
|
|
||||||
PROP_GATEWAY_PING_TIMEOUT,
|
|
||||||
PROP_METERED,
|
|
||||||
PROP_LLDP,
|
|
||||||
PROP_MDNS,
|
|
||||||
PROP_LLMNR,
|
|
||||||
PROP_STABLE_ID,
|
|
||||||
PROP_AUTH_RETRIES,
|
|
||||||
);
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
@@ -193,18 +195,6 @@ permission_free (Permission *p)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
|
||||||
* nm_setting_connection_new:
|
|
||||||
*
|
|
||||||
* Creates a new #NMSettingConnection object with default values.
|
|
||||||
*
|
|
||||||
* Returns: the new empty #NMSettingConnection object
|
|
||||||
**/
|
|
||||||
NMSetting *nm_setting_connection_new (void)
|
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_CONNECTION, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_connection_get_id:
|
* nm_setting_connection_get_id:
|
||||||
* @setting: the #NMSettingConnection
|
* @setting: the #NMSettingConnection
|
||||||
@@ -1300,34 +1290,6 @@ compare_property (const NMSettInfoSetting *sett_info,
|
|||||||
flags);
|
flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
nm_setting_connection_init (NMSettingConnection *setting)
|
|
||||||
{
|
|
||||||
NMSettingConnectionPrivate *priv = NM_SETTING_CONNECTION_GET_PRIVATE (setting);
|
|
||||||
|
|
||||||
priv->mdns = NM_SETTING_CONNECTION_MDNS_DEFAULT;
|
|
||||||
priv->llmnr = NM_SETTING_CONNECTION_LLMNR_DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
finalize (GObject *object)
|
|
||||||
{
|
|
||||||
NMSettingConnectionPrivate *priv = NM_SETTING_CONNECTION_GET_PRIVATE (object);
|
|
||||||
|
|
||||||
g_free (priv->id);
|
|
||||||
g_free (priv->uuid);
|
|
||||||
g_free (priv->stable_id);
|
|
||||||
g_free (priv->interface_name);
|
|
||||||
g_free (priv->type);
|
|
||||||
g_free (priv->zone);
|
|
||||||
g_free (priv->master);
|
|
||||||
g_free (priv->slave_type);
|
|
||||||
g_slist_free_full (priv->permissions, (GDestroyNotify) permission_free);
|
|
||||||
g_slist_free_full (priv->secondaries, g_free);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_setting_connection_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static GSList *
|
static GSList *
|
||||||
perm_strv_to_permlist (char **strv)
|
perm_strv_to_permlist (char **strv)
|
||||||
{
|
{
|
||||||
@@ -1348,6 +1310,105 @@ perm_strv_to_permlist (char **strv)
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char **
|
||||||
|
perm_permlist_to_strv (GSList *permlist)
|
||||||
|
{
|
||||||
|
GPtrArray *strings;
|
||||||
|
GSList *iter;
|
||||||
|
|
||||||
|
strings = g_ptr_array_new ();
|
||||||
|
for (iter = permlist; iter; iter = g_slist_next (iter))
|
||||||
|
g_ptr_array_add (strings, permission_to_string ((Permission *) iter->data));
|
||||||
|
g_ptr_array_add (strings, NULL);
|
||||||
|
|
||||||
|
return (char **) g_ptr_array_free (strings, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMSettingConnection *setting = NM_SETTING_CONNECTION (object);
|
||||||
|
NMSettingConnectionPrivate *priv = NM_SETTING_CONNECTION_GET_PRIVATE (setting);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_ID:
|
||||||
|
g_value_set_string (value, nm_setting_connection_get_id (setting));
|
||||||
|
break;
|
||||||
|
case PROP_UUID:
|
||||||
|
g_value_set_string (value, nm_setting_connection_get_uuid (setting));
|
||||||
|
break;
|
||||||
|
case PROP_STABLE_ID:
|
||||||
|
g_value_set_string (value, nm_setting_connection_get_stable_id (setting));
|
||||||
|
break;
|
||||||
|
case PROP_INTERFACE_NAME:
|
||||||
|
g_value_set_string (value, nm_setting_connection_get_interface_name (setting));
|
||||||
|
break;
|
||||||
|
case PROP_TYPE:
|
||||||
|
g_value_set_string (value, nm_setting_connection_get_connection_type (setting));
|
||||||
|
break;
|
||||||
|
case PROP_PERMISSIONS:
|
||||||
|
g_value_take_boxed (value, perm_permlist_to_strv (priv->permissions));
|
||||||
|
break;
|
||||||
|
case PROP_AUTOCONNECT:
|
||||||
|
g_value_set_boolean (value, nm_setting_connection_get_autoconnect (setting));
|
||||||
|
break;
|
||||||
|
case PROP_AUTOCONNECT_PRIORITY:
|
||||||
|
g_value_set_int (value, nm_setting_connection_get_autoconnect_priority (setting));
|
||||||
|
break;
|
||||||
|
case PROP_AUTOCONNECT_RETRIES:
|
||||||
|
g_value_set_int (value, nm_setting_connection_get_autoconnect_retries (setting));
|
||||||
|
break;
|
||||||
|
case PROP_MULTI_CONNECT:
|
||||||
|
g_value_set_int (value, priv->multi_connect);
|
||||||
|
break;
|
||||||
|
case PROP_TIMESTAMP:
|
||||||
|
g_value_set_uint64 (value, nm_setting_connection_get_timestamp (setting));
|
||||||
|
break;
|
||||||
|
case PROP_READ_ONLY:
|
||||||
|
g_value_set_boolean (value, nm_setting_connection_get_read_only (setting));
|
||||||
|
break;
|
||||||
|
case PROP_ZONE:
|
||||||
|
g_value_set_string (value, nm_setting_connection_get_zone (setting));
|
||||||
|
break;
|
||||||
|
case PROP_MASTER:
|
||||||
|
g_value_set_string (value, nm_setting_connection_get_master (setting));
|
||||||
|
break;
|
||||||
|
case PROP_SLAVE_TYPE:
|
||||||
|
g_value_set_string (value, nm_setting_connection_get_slave_type (setting));
|
||||||
|
break;
|
||||||
|
case PROP_AUTOCONNECT_SLAVES:
|
||||||
|
g_value_set_enum (value, nm_setting_connection_get_autoconnect_slaves (setting));
|
||||||
|
break;
|
||||||
|
case PROP_SECONDARIES:
|
||||||
|
g_value_take_boxed (value, _nm_utils_slist_to_strv (priv->secondaries, TRUE));
|
||||||
|
break;
|
||||||
|
case PROP_GATEWAY_PING_TIMEOUT:
|
||||||
|
g_value_set_uint (value, priv->gateway_ping_timeout);
|
||||||
|
break;
|
||||||
|
case PROP_METERED:
|
||||||
|
g_value_set_enum (value, priv->metered);
|
||||||
|
break;
|
||||||
|
case PROP_LLDP:
|
||||||
|
g_value_set_int (value, priv->lldp);
|
||||||
|
break;
|
||||||
|
case PROP_AUTH_RETRIES:
|
||||||
|
g_value_set_int (value, priv->auth_retries);
|
||||||
|
break;
|
||||||
|
case PROP_MDNS:
|
||||||
|
g_value_set_int (value, priv->mdns);
|
||||||
|
break;
|
||||||
|
case PROP_LLMNR:
|
||||||
|
g_value_set_int (value, priv->llmnr);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_property (GObject *object, guint prop_id,
|
set_property (GObject *object, guint prop_id,
|
||||||
const GValue *value, GParamSpec *pspec)
|
const GValue *value, GParamSpec *pspec)
|
||||||
@@ -1440,101 +1501,46 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static char **
|
/*****************************************************************************/
|
||||||
perm_permlist_to_strv (GSList *permlist)
|
|
||||||
|
static void
|
||||||
|
nm_setting_connection_init (NMSettingConnection *setting)
|
||||||
{
|
{
|
||||||
GPtrArray *strings;
|
NMSettingConnectionPrivate *priv = NM_SETTING_CONNECTION_GET_PRIVATE (setting);
|
||||||
GSList *iter;
|
|
||||||
|
|
||||||
strings = g_ptr_array_new ();
|
priv->mdns = NM_SETTING_CONNECTION_MDNS_DEFAULT;
|
||||||
for (iter = permlist; iter; iter = g_slist_next (iter))
|
priv->llmnr = NM_SETTING_CONNECTION_LLMNR_DEFAULT;
|
||||||
g_ptr_array_add (strings, permission_to_string ((Permission *) iter->data));
|
}
|
||||||
g_ptr_array_add (strings, NULL);
|
|
||||||
|
|
||||||
return (char **) g_ptr_array_free (strings, FALSE);
|
/**
|
||||||
|
* nm_setting_connection_new:
|
||||||
|
*
|
||||||
|
* Creates a new #NMSettingConnection object with default values.
|
||||||
|
*
|
||||||
|
* Returns: the new empty #NMSettingConnection object
|
||||||
|
**/
|
||||||
|
NMSetting *nm_setting_connection_new (void)
|
||||||
|
{
|
||||||
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_CONNECTION, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object, guint prop_id,
|
finalize (GObject *object)
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
{
|
||||||
NMSettingConnection *setting = NM_SETTING_CONNECTION (object);
|
NMSettingConnectionPrivate *priv = NM_SETTING_CONNECTION_GET_PRIVATE (object);
|
||||||
NMSettingConnectionPrivate *priv = NM_SETTING_CONNECTION_GET_PRIVATE (setting);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
g_free (priv->id);
|
||||||
case PROP_ID:
|
g_free (priv->uuid);
|
||||||
g_value_set_string (value, nm_setting_connection_get_id (setting));
|
g_free (priv->stable_id);
|
||||||
break;
|
g_free (priv->interface_name);
|
||||||
case PROP_UUID:
|
g_free (priv->type);
|
||||||
g_value_set_string (value, nm_setting_connection_get_uuid (setting));
|
g_free (priv->zone);
|
||||||
break;
|
g_free (priv->master);
|
||||||
case PROP_STABLE_ID:
|
g_free (priv->slave_type);
|
||||||
g_value_set_string (value, nm_setting_connection_get_stable_id (setting));
|
g_slist_free_full (priv->permissions, (GDestroyNotify) permission_free);
|
||||||
break;
|
g_slist_free_full (priv->secondaries, g_free);
|
||||||
case PROP_INTERFACE_NAME:
|
|
||||||
g_value_set_string (value, nm_setting_connection_get_interface_name (setting));
|
G_OBJECT_CLASS (nm_setting_connection_parent_class)->finalize (object);
|
||||||
break;
|
|
||||||
case PROP_TYPE:
|
|
||||||
g_value_set_string (value, nm_setting_connection_get_connection_type (setting));
|
|
||||||
break;
|
|
||||||
case PROP_PERMISSIONS:
|
|
||||||
g_value_take_boxed (value, perm_permlist_to_strv (priv->permissions));
|
|
||||||
break;
|
|
||||||
case PROP_AUTOCONNECT:
|
|
||||||
g_value_set_boolean (value, nm_setting_connection_get_autoconnect (setting));
|
|
||||||
break;
|
|
||||||
case PROP_AUTOCONNECT_PRIORITY:
|
|
||||||
g_value_set_int (value, nm_setting_connection_get_autoconnect_priority (setting));
|
|
||||||
break;
|
|
||||||
case PROP_AUTOCONNECT_RETRIES:
|
|
||||||
g_value_set_int (value, nm_setting_connection_get_autoconnect_retries (setting));
|
|
||||||
break;
|
|
||||||
case PROP_MULTI_CONNECT:
|
|
||||||
g_value_set_int (value, priv->multi_connect);
|
|
||||||
break;
|
|
||||||
case PROP_TIMESTAMP:
|
|
||||||
g_value_set_uint64 (value, nm_setting_connection_get_timestamp (setting));
|
|
||||||
break;
|
|
||||||
case PROP_READ_ONLY:
|
|
||||||
g_value_set_boolean (value, nm_setting_connection_get_read_only (setting));
|
|
||||||
break;
|
|
||||||
case PROP_ZONE:
|
|
||||||
g_value_set_string (value, nm_setting_connection_get_zone (setting));
|
|
||||||
break;
|
|
||||||
case PROP_MASTER:
|
|
||||||
g_value_set_string (value, nm_setting_connection_get_master (setting));
|
|
||||||
break;
|
|
||||||
case PROP_SLAVE_TYPE:
|
|
||||||
g_value_set_string (value, nm_setting_connection_get_slave_type (setting));
|
|
||||||
break;
|
|
||||||
case PROP_AUTOCONNECT_SLAVES:
|
|
||||||
g_value_set_enum (value, nm_setting_connection_get_autoconnect_slaves (setting));
|
|
||||||
break;
|
|
||||||
case PROP_SECONDARIES:
|
|
||||||
g_value_take_boxed (value, _nm_utils_slist_to_strv (priv->secondaries, TRUE));
|
|
||||||
break;
|
|
||||||
case PROP_GATEWAY_PING_TIMEOUT:
|
|
||||||
g_value_set_uint (value, priv->gateway_ping_timeout);
|
|
||||||
break;
|
|
||||||
case PROP_METERED:
|
|
||||||
g_value_set_enum (value, priv->metered);
|
|
||||||
break;
|
|
||||||
case PROP_LLDP:
|
|
||||||
g_value_set_int (value, priv->lldp);
|
|
||||||
break;
|
|
||||||
case PROP_AUTH_RETRIES:
|
|
||||||
g_value_set_int (value, priv->auth_retries);
|
|
||||||
break;
|
|
||||||
case PROP_MDNS:
|
|
||||||
g_value_set_int (value, priv->mdns);
|
|
||||||
break;
|
|
||||||
case PROP_LLMNR:
|
|
||||||
g_value_set_int (value, priv->llmnr);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1546,8 +1552,8 @@ nm_setting_connection_class_init (NMSettingConnectionClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingConnectionPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingConnectionPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -21,9 +21,10 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-dcb.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "nm-setting-dcb.h"
|
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-utils-private.h"
|
#include "nm-utils-private.h"
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
@@ -40,9 +41,30 @@
|
|||||||
* of storage technologies like Fibre Channel over Ethernet (FCoE) and iSCSI.
|
* of storage technologies like Fibre Channel over Ethernet (FCoE) and iSCSI.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingDcb, nm_setting_dcb, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_DCB_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_DCB, NMSettingDcbPrivate))
|
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingDcb,
|
||||||
|
|
||||||
|
PROP_APP_FCOE_FLAGS,
|
||||||
|
PROP_APP_FCOE_PRIORITY,
|
||||||
|
PROP_APP_FCOE_MODE,
|
||||||
|
|
||||||
|
PROP_APP_ISCSI_FLAGS,
|
||||||
|
PROP_APP_ISCSI_PRIORITY,
|
||||||
|
|
||||||
|
PROP_APP_FIP_FLAGS,
|
||||||
|
PROP_APP_FIP_PRIORITY,
|
||||||
|
|
||||||
|
PROP_PFC_FLAGS,
|
||||||
|
PROP_PRIORITY_FLOW_CONTROL,
|
||||||
|
|
||||||
|
PROP_PRIORITY_GROUP_FLAGS,
|
||||||
|
PROP_PRIORITY_GROUP_ID,
|
||||||
|
PROP_PRIORITY_GROUP_BANDWIDTH,
|
||||||
|
PROP_PRIORITY_BANDWIDTH,
|
||||||
|
PROP_PRIORITY_STRICT_BANDWIDTH,
|
||||||
|
PROP_PRIORITY_TRAFFIC_CLASS,
|
||||||
|
);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NMSettingDcbFlags app_fcoe_flags;
|
NMSettingDcbFlags app_fcoe_flags;
|
||||||
@@ -68,41 +90,11 @@ typedef struct {
|
|||||||
guint priority_traffic_class[8];
|
guint priority_traffic_class[8];
|
||||||
} NMSettingDcbPrivate;
|
} NMSettingDcbPrivate;
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingDcb,
|
G_DEFINE_TYPE (NMSettingDcb, nm_setting_dcb, NM_TYPE_SETTING)
|
||||||
|
|
||||||
PROP_APP_FCOE_FLAGS,
|
#define NM_SETTING_DCB_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_DCB, NMSettingDcbPrivate))
|
||||||
PROP_APP_FCOE_PRIORITY,
|
|
||||||
PROP_APP_FCOE_MODE,
|
|
||||||
|
|
||||||
PROP_APP_ISCSI_FLAGS,
|
/*****************************************************************************/
|
||||||
PROP_APP_ISCSI_PRIORITY,
|
|
||||||
|
|
||||||
PROP_APP_FIP_FLAGS,
|
|
||||||
PROP_APP_FIP_PRIORITY,
|
|
||||||
|
|
||||||
PROP_PFC_FLAGS,
|
|
||||||
PROP_PRIORITY_FLOW_CONTROL,
|
|
||||||
|
|
||||||
PROP_PRIORITY_GROUP_FLAGS,
|
|
||||||
PROP_PRIORITY_GROUP_ID,
|
|
||||||
PROP_PRIORITY_GROUP_BANDWIDTH,
|
|
||||||
PROP_PRIORITY_BANDWIDTH,
|
|
||||||
PROP_PRIORITY_STRICT_BANDWIDTH,
|
|
||||||
PROP_PRIORITY_TRAFFIC_CLASS,
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* nm_setting_dcb_new:
|
|
||||||
*
|
|
||||||
* Creates a new #NMSettingDcb object with default values.
|
|
||||||
*
|
|
||||||
* Returns: (transfer full): the new empty #NMSettingDcb object
|
|
||||||
**/
|
|
||||||
NMSetting *
|
|
||||||
nm_setting_dcb_new (void)
|
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_DCB, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_dcb_get_app_fcoe_flags:
|
* nm_setting_dcb_get_app_fcoe_flags:
|
||||||
@@ -722,11 +714,6 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
|
||||||
nm_setting_dcb_init (NMSettingDcb *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
G_STATIC_ASSERT (sizeof (guint) == sizeof (gboolean));
|
G_STATIC_ASSERT (sizeof (guint) == sizeof (gboolean));
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
@@ -774,64 +761,7 @@ _nm_setting_dcb_uint_array_from_dbus (GVariant *dbus_value,
|
|||||||
set_gvalue_from_array (prop_value, (guint *) array, length);
|
set_gvalue_from_array (prop_value, (guint *) array, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
set_property (GObject *object, guint prop_id,
|
|
||||||
const GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingDcbPrivate *priv = NM_SETTING_DCB_GET_PRIVATE (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_APP_FCOE_FLAGS:
|
|
||||||
priv->app_fcoe_flags = g_value_get_flags (value);
|
|
||||||
break;
|
|
||||||
case PROP_APP_FCOE_PRIORITY:
|
|
||||||
priv->app_fcoe_priority = g_value_get_int (value);
|
|
||||||
break;
|
|
||||||
case PROP_APP_FCOE_MODE:
|
|
||||||
g_free (priv->app_fcoe_mode);
|
|
||||||
priv->app_fcoe_mode = g_value_dup_string (value);
|
|
||||||
break;
|
|
||||||
case PROP_APP_ISCSI_FLAGS:
|
|
||||||
priv->app_iscsi_flags = g_value_get_flags (value);
|
|
||||||
break;
|
|
||||||
case PROP_APP_ISCSI_PRIORITY:
|
|
||||||
priv->app_iscsi_priority = g_value_get_int (value);
|
|
||||||
break;
|
|
||||||
case PROP_APP_FIP_FLAGS:
|
|
||||||
priv->app_fip_flags = g_value_get_flags (value);
|
|
||||||
break;
|
|
||||||
case PROP_APP_FIP_PRIORITY:
|
|
||||||
priv->app_fip_priority = g_value_get_int (value);
|
|
||||||
break;
|
|
||||||
case PROP_PFC_FLAGS:
|
|
||||||
priv->pfc_flags = g_value_get_flags (value);
|
|
||||||
break;
|
|
||||||
case PROP_PRIORITY_FLOW_CONTROL:
|
|
||||||
SET_ARRAY_FROM_GVALUE (value, priv->pfc);
|
|
||||||
break;
|
|
||||||
case PROP_PRIORITY_GROUP_FLAGS:
|
|
||||||
priv->priority_group_flags = g_value_get_flags (value);
|
|
||||||
break;
|
|
||||||
case PROP_PRIORITY_GROUP_ID:
|
|
||||||
SET_ARRAY_FROM_GVALUE (value, priv->priority_group_id);
|
|
||||||
break;
|
|
||||||
case PROP_PRIORITY_GROUP_BANDWIDTH:
|
|
||||||
SET_ARRAY_FROM_GVALUE (value, priv->priority_group_bandwidth);
|
|
||||||
break;
|
|
||||||
case PROP_PRIORITY_BANDWIDTH:
|
|
||||||
SET_ARRAY_FROM_GVALUE (value, priv->priority_bandwidth);
|
|
||||||
break;
|
|
||||||
case PROP_PRIORITY_STRICT_BANDWIDTH:
|
|
||||||
SET_ARRAY_FROM_GVALUE (value, priv->priority_strict);
|
|
||||||
break;
|
|
||||||
case PROP_PRIORITY_TRAFFIC_CLASS:
|
|
||||||
SET_ARRAY_FROM_GVALUE (value, priv->priority_traffic_class);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object, guint prop_id,
|
get_property (GObject *object, guint prop_id,
|
||||||
@@ -892,6 +822,85 @@ get_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
set_property (GObject *object, guint prop_id,
|
||||||
|
const GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMSettingDcbPrivate *priv = NM_SETTING_DCB_GET_PRIVATE (object);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_APP_FCOE_FLAGS:
|
||||||
|
priv->app_fcoe_flags = g_value_get_flags (value);
|
||||||
|
break;
|
||||||
|
case PROP_APP_FCOE_PRIORITY:
|
||||||
|
priv->app_fcoe_priority = g_value_get_int (value);
|
||||||
|
break;
|
||||||
|
case PROP_APP_FCOE_MODE:
|
||||||
|
g_free (priv->app_fcoe_mode);
|
||||||
|
priv->app_fcoe_mode = g_value_dup_string (value);
|
||||||
|
break;
|
||||||
|
case PROP_APP_ISCSI_FLAGS:
|
||||||
|
priv->app_iscsi_flags = g_value_get_flags (value);
|
||||||
|
break;
|
||||||
|
case PROP_APP_ISCSI_PRIORITY:
|
||||||
|
priv->app_iscsi_priority = g_value_get_int (value);
|
||||||
|
break;
|
||||||
|
case PROP_APP_FIP_FLAGS:
|
||||||
|
priv->app_fip_flags = g_value_get_flags (value);
|
||||||
|
break;
|
||||||
|
case PROP_APP_FIP_PRIORITY:
|
||||||
|
priv->app_fip_priority = g_value_get_int (value);
|
||||||
|
break;
|
||||||
|
case PROP_PFC_FLAGS:
|
||||||
|
priv->pfc_flags = g_value_get_flags (value);
|
||||||
|
break;
|
||||||
|
case PROP_PRIORITY_FLOW_CONTROL:
|
||||||
|
SET_ARRAY_FROM_GVALUE (value, priv->pfc);
|
||||||
|
break;
|
||||||
|
case PROP_PRIORITY_GROUP_FLAGS:
|
||||||
|
priv->priority_group_flags = g_value_get_flags (value);
|
||||||
|
break;
|
||||||
|
case PROP_PRIORITY_GROUP_ID:
|
||||||
|
SET_ARRAY_FROM_GVALUE (value, priv->priority_group_id);
|
||||||
|
break;
|
||||||
|
case PROP_PRIORITY_GROUP_BANDWIDTH:
|
||||||
|
SET_ARRAY_FROM_GVALUE (value, priv->priority_group_bandwidth);
|
||||||
|
break;
|
||||||
|
case PROP_PRIORITY_BANDWIDTH:
|
||||||
|
SET_ARRAY_FROM_GVALUE (value, priv->priority_bandwidth);
|
||||||
|
break;
|
||||||
|
case PROP_PRIORITY_STRICT_BANDWIDTH:
|
||||||
|
SET_ARRAY_FROM_GVALUE (value, priv->priority_strict);
|
||||||
|
break;
|
||||||
|
case PROP_PRIORITY_TRAFFIC_CLASS:
|
||||||
|
SET_ARRAY_FROM_GVALUE (value, priv->priority_traffic_class);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
nm_setting_dcb_init (NMSettingDcb *setting)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nm_setting_dcb_new:
|
||||||
|
*
|
||||||
|
* Creates a new #NMSettingDcb object with default values.
|
||||||
|
*
|
||||||
|
* Returns: (transfer full): the new empty #NMSettingDcb object
|
||||||
|
**/
|
||||||
|
NMSetting *
|
||||||
|
nm_setting_dcb_new (void)
|
||||||
|
{
|
||||||
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_DCB, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
finalize (GObject *object)
|
finalize (GObject *object)
|
||||||
{
|
{
|
||||||
@@ -911,9 +920,9 @@ nm_setting_dcb_class_init (NMSettingDcbClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingDcbPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingDcbPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->set_property = set_property;
|
||||||
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
|
||||||
|
@@ -34,8 +34,28 @@
|
|||||||
* necessary for connection to dummy devices
|
* necessary for connection to dummy devices
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingDummy, nm_setting_dummy, NM_TYPE_SETTING)
|
G_DEFINE_TYPE (NMSettingDummy, nm_setting_dummy, NM_TYPE_SETTING)
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
verify (NMSetting *setting, NMConnection *connection, GError **error)
|
||||||
|
{
|
||||||
|
if (!_nm_connection_verify_required_interface_name (connection, error))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
nm_setting_dummy_init (NMSettingDummy *setting)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_dummy_new:
|
* nm_setting_dummy_new:
|
||||||
*
|
*
|
||||||
@@ -51,20 +71,6 @@ nm_setting_dummy_new (void)
|
|||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_DUMMY, NULL);
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_DUMMY, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|
||||||
{
|
|
||||||
if (!_nm_connection_verify_required_interface_name (connection, error))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
nm_setting_dummy_init (NMSettingDummy *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_dummy_class_init (NMSettingDummyClass *klass)
|
nm_setting_dummy_class_init (NMSettingDummyClass *klass)
|
||||||
{
|
{
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
#include "nm-setting-generic.h"
|
#include "nm-setting-generic.h"
|
||||||
|
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,16 +37,23 @@
|
|||||||
* the "connection type" setting on #NMConnections for generic devices.
|
* the "connection type" setting on #NMConnections for generic devices.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingGeneric, nm_setting_generic, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_GENERIC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_GENERIC, NMSettingGenericPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int dummy;
|
int dummy;
|
||||||
} NMSettingGenericPrivate;
|
} NMSettingGenericPrivate;
|
||||||
|
|
||||||
|
G_DEFINE_TYPE (NMSettingGeneric, nm_setting_generic, NM_TYPE_SETTING)
|
||||||
|
|
||||||
|
#define NM_SETTING_GENERIC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_GENERIC, NMSettingGenericPrivate))
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
nm_setting_generic_init (NMSettingGeneric *setting)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_generic_new:
|
* nm_setting_generic_new:
|
||||||
*
|
*
|
||||||
@@ -59,11 +67,6 @@ nm_setting_generic_new (void)
|
|||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_GENERIC, NULL);
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_GENERIC, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
nm_setting_generic_init (NMSettingGeneric *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_generic_class_init (NMSettingGenericClass *klass)
|
nm_setting_generic_class_init (NMSettingGenericClass *klass)
|
||||||
{
|
{
|
||||||
|
@@ -22,9 +22,10 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-gsm.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "nm-setting-gsm.h"
|
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
#include "nm-core-enum-types.h"
|
#include "nm-core-enum-types.h"
|
||||||
@@ -38,9 +39,23 @@
|
|||||||
* networks, including those using GPRS/EDGE and UMTS/HSPA technology.
|
* networks, including those using GPRS/EDGE and UMTS/HSPA technology.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingGsm, nm_setting_gsm, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_GSM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_GSM, NMSettingGsmPrivate))
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
|
PROP_NUMBER,
|
||||||
|
PROP_USERNAME,
|
||||||
|
PROP_PASSWORD,
|
||||||
|
PROP_PASSWORD_FLAGS,
|
||||||
|
PROP_APN,
|
||||||
|
PROP_NETWORK_ID,
|
||||||
|
PROP_PIN,
|
||||||
|
PROP_PIN_FLAGS,
|
||||||
|
PROP_HOME_ONLY,
|
||||||
|
PROP_DEVICE_ID,
|
||||||
|
PROP_SIM_ID,
|
||||||
|
PROP_SIM_OPERATOR_ID,
|
||||||
|
PROP_MTU,
|
||||||
|
);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *number; /* For dialing, duh */
|
char *number; /* For dialing, duh */
|
||||||
@@ -63,34 +78,11 @@ typedef struct {
|
|||||||
guint32 mtu;
|
guint32 mtu;
|
||||||
} NMSettingGsmPrivate;
|
} NMSettingGsmPrivate;
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
G_DEFINE_TYPE (NMSettingGsm, nm_setting_gsm, NM_TYPE_SETTING)
|
||||||
PROP_NUMBER,
|
|
||||||
PROP_USERNAME,
|
|
||||||
PROP_PASSWORD,
|
|
||||||
PROP_PASSWORD_FLAGS,
|
|
||||||
PROP_APN,
|
|
||||||
PROP_NETWORK_ID,
|
|
||||||
PROP_PIN,
|
|
||||||
PROP_PIN_FLAGS,
|
|
||||||
PROP_HOME_ONLY,
|
|
||||||
PROP_DEVICE_ID,
|
|
||||||
PROP_SIM_ID,
|
|
||||||
PROP_SIM_OPERATOR_ID,
|
|
||||||
PROP_MTU,
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
#define NM_SETTING_GSM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_GSM, NMSettingGsmPrivate))
|
||||||
* nm_setting_gsm_new:
|
|
||||||
*
|
/*****************************************************************************/
|
||||||
* Creates a new #NMSettingGsm object with default values.
|
|
||||||
*
|
|
||||||
* Returns: the new empty #NMSettingGsm object
|
|
||||||
**/
|
|
||||||
NMSetting *
|
|
||||||
nm_setting_gsm_new (void)
|
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_GSM, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_gsm_get_number:
|
* nm_setting_gsm_get_number:
|
||||||
@@ -457,27 +449,58 @@ need_secrets (NMSetting *setting)
|
|||||||
return secrets;
|
return secrets;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
nm_setting_gsm_init (NMSettingGsm *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
finalize (GObject *object)
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
NMSettingGsmPrivate *priv = NM_SETTING_GSM_GET_PRIVATE (object);
|
NMSettingGsm *setting = NM_SETTING_GSM (object);
|
||||||
|
|
||||||
g_free (priv->number);
|
switch (prop_id) {
|
||||||
g_free (priv->username);
|
case PROP_NUMBER:
|
||||||
g_free (priv->password);
|
g_value_set_string (value, nm_setting_gsm_get_number (setting));
|
||||||
g_free (priv->apn);
|
break;
|
||||||
g_free (priv->network_id);
|
case PROP_USERNAME:
|
||||||
g_free (priv->pin);
|
g_value_set_string (value, nm_setting_gsm_get_username (setting));
|
||||||
g_free (priv->device_id);
|
break;
|
||||||
g_free (priv->sim_id);
|
case PROP_PASSWORD:
|
||||||
g_free (priv->sim_operator_id);
|
g_value_set_string (value, nm_setting_gsm_get_password (setting));
|
||||||
|
break;
|
||||||
G_OBJECT_CLASS (nm_setting_gsm_parent_class)->finalize (object);
|
case PROP_PASSWORD_FLAGS:
|
||||||
|
g_value_set_flags (value, nm_setting_gsm_get_password_flags (setting));
|
||||||
|
break;
|
||||||
|
case PROP_APN:
|
||||||
|
g_value_set_string (value, nm_setting_gsm_get_apn (setting));
|
||||||
|
break;
|
||||||
|
case PROP_NETWORK_ID:
|
||||||
|
g_value_set_string (value, nm_setting_gsm_get_network_id (setting));
|
||||||
|
break;
|
||||||
|
case PROP_PIN:
|
||||||
|
g_value_set_string (value, nm_setting_gsm_get_pin (setting));
|
||||||
|
break;
|
||||||
|
case PROP_PIN_FLAGS:
|
||||||
|
g_value_set_flags (value, nm_setting_gsm_get_pin_flags (setting));
|
||||||
|
break;
|
||||||
|
case PROP_HOME_ONLY:
|
||||||
|
g_value_set_boolean (value, nm_setting_gsm_get_home_only (setting));
|
||||||
|
break;
|
||||||
|
case PROP_DEVICE_ID:
|
||||||
|
g_value_set_string (value, nm_setting_gsm_get_device_id (setting));
|
||||||
|
break;
|
||||||
|
case PROP_SIM_ID:
|
||||||
|
g_value_set_string (value, nm_setting_gsm_get_sim_id (setting));
|
||||||
|
break;
|
||||||
|
case PROP_SIM_OPERATOR_ID:
|
||||||
|
g_value_set_string (value, nm_setting_gsm_get_sim_operator_id (setting));
|
||||||
|
break;
|
||||||
|
case PROP_MTU:
|
||||||
|
g_value_set_uint (value, nm_setting_gsm_get_mtu (setting));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -548,56 +571,42 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
get_property (GObject *object, guint prop_id,
|
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingGsm *setting = NM_SETTING_GSM (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
static void
|
||||||
case PROP_NUMBER:
|
nm_setting_gsm_init (NMSettingGsm *setting)
|
||||||
g_value_set_string (value, nm_setting_gsm_get_number (setting));
|
{
|
||||||
break;
|
}
|
||||||
case PROP_USERNAME:
|
|
||||||
g_value_set_string (value, nm_setting_gsm_get_username (setting));
|
/**
|
||||||
break;
|
* nm_setting_gsm_new:
|
||||||
case PROP_PASSWORD:
|
*
|
||||||
g_value_set_string (value, nm_setting_gsm_get_password (setting));
|
* Creates a new #NMSettingGsm object with default values.
|
||||||
break;
|
*
|
||||||
case PROP_PASSWORD_FLAGS:
|
* Returns: the new empty #NMSettingGsm object
|
||||||
g_value_set_flags (value, nm_setting_gsm_get_password_flags (setting));
|
**/
|
||||||
break;
|
NMSetting *
|
||||||
case PROP_APN:
|
nm_setting_gsm_new (void)
|
||||||
g_value_set_string (value, nm_setting_gsm_get_apn (setting));
|
{
|
||||||
break;
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_GSM, NULL);
|
||||||
case PROP_NETWORK_ID:
|
}
|
||||||
g_value_set_string (value, nm_setting_gsm_get_network_id (setting));
|
|
||||||
break;
|
static void
|
||||||
case PROP_PIN:
|
finalize (GObject *object)
|
||||||
g_value_set_string (value, nm_setting_gsm_get_pin (setting));
|
{
|
||||||
break;
|
NMSettingGsmPrivate *priv = NM_SETTING_GSM_GET_PRIVATE (object);
|
||||||
case PROP_PIN_FLAGS:
|
|
||||||
g_value_set_flags (value, nm_setting_gsm_get_pin_flags (setting));
|
g_free (priv->number);
|
||||||
break;
|
g_free (priv->username);
|
||||||
case PROP_HOME_ONLY:
|
g_free (priv->password);
|
||||||
g_value_set_boolean (value, nm_setting_gsm_get_home_only (setting));
|
g_free (priv->apn);
|
||||||
break;
|
g_free (priv->network_id);
|
||||||
case PROP_DEVICE_ID:
|
g_free (priv->pin);
|
||||||
g_value_set_string (value, nm_setting_gsm_get_device_id (setting));
|
g_free (priv->device_id);
|
||||||
break;
|
g_free (priv->sim_id);
|
||||||
case PROP_SIM_ID:
|
g_free (priv->sim_operator_id);
|
||||||
g_value_set_string (value, nm_setting_gsm_get_sim_id (setting));
|
|
||||||
break;
|
G_OBJECT_CLASS (nm_setting_gsm_parent_class)->finalize (object);
|
||||||
case PROP_SIM_OPERATOR_ID:
|
|
||||||
g_value_set_string (value, nm_setting_gsm_get_sim_operator_id (setting));
|
|
||||||
break;
|
|
||||||
case PROP_MTU:
|
|
||||||
g_value_set_uint (value, nm_setting_gsm_get_mtu (setting));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -609,8 +618,8 @@ nm_setting_gsm_class_init (NMSettingGsmClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingGsmPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingGsmPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -21,9 +21,10 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-infiniband.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "nm-setting-infiniband.h"
|
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-utils-private.h"
|
#include "nm-utils-private.h"
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
@@ -37,17 +38,7 @@
|
|||||||
* necessary for connection to IP-over-InfiniBand networks.
|
* necessary for connection to IP-over-InfiniBand networks.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingInfiniband, nm_setting_infiniband, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_INFINIBAND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_INFINIBAND, NMSettingInfinibandPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char *mac_address;
|
|
||||||
char *transport_mode;
|
|
||||||
guint32 mtu;
|
|
||||||
int p_key;
|
|
||||||
char *parent, *virtual_iface_name;
|
|
||||||
} NMSettingInfinibandPrivate;
|
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_MAC_ADDRESS,
|
PROP_MAC_ADDRESS,
|
||||||
@@ -57,18 +48,19 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
|||||||
PROP_PARENT,
|
PROP_PARENT,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
typedef struct {
|
||||||
* nm_setting_infiniband_new:
|
char *mac_address;
|
||||||
*
|
char *transport_mode;
|
||||||
* Creates a new #NMSettingInfiniband object with default values.
|
guint32 mtu;
|
||||||
*
|
int p_key;
|
||||||
* Returns: (transfer full): the new empty #NMSettingInfiniband object
|
char *parent, *virtual_iface_name;
|
||||||
**/
|
} NMSettingInfinibandPrivate;
|
||||||
NMSetting *
|
|
||||||
nm_setting_infiniband_new (void)
|
G_DEFINE_TYPE (NMSettingInfiniband, nm_setting_infiniband, NM_TYPE_SETTING)
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_INFINIBAND, NULL);
|
#define NM_SETTING_INFINIBAND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_INFINIBAND, NMSettingInfinibandPrivate))
|
||||||
}
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_infiniband_get_mac_address:
|
* nm_setting_infiniband_get_mac_address:
|
||||||
@@ -292,22 +284,34 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
nm_setting_infiniband_init (NMSettingInfiniband *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
finalize (GObject *object)
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
NMSettingInfinibandPrivate *priv = NM_SETTING_INFINIBAND_GET_PRIVATE (object);
|
NMSettingInfiniband *setting = NM_SETTING_INFINIBAND (object);
|
||||||
|
|
||||||
g_free (priv->transport_mode);
|
switch (prop_id) {
|
||||||
g_free (priv->mac_address);
|
case PROP_MAC_ADDRESS:
|
||||||
g_free (priv->parent);
|
g_value_set_string (value, nm_setting_infiniband_get_mac_address (setting));
|
||||||
g_free (priv->virtual_iface_name);
|
break;
|
||||||
|
case PROP_MTU:
|
||||||
G_OBJECT_CLASS (nm_setting_infiniband_parent_class)->finalize (object);
|
g_value_set_uint (value, nm_setting_infiniband_get_mtu (setting));
|
||||||
|
break;
|
||||||
|
case PROP_TRANSPORT_MODE:
|
||||||
|
g_value_set_string (value, nm_setting_infiniband_get_transport_mode (setting));
|
||||||
|
break;
|
||||||
|
case PROP_P_KEY:
|
||||||
|
g_value_set_int (value, nm_setting_infiniband_get_p_key (setting));
|
||||||
|
break;
|
||||||
|
case PROP_PARENT:
|
||||||
|
g_value_set_string (value, nm_setting_infiniband_get_parent (setting));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -344,32 +348,37 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
get_property (GObject *object, guint prop_id,
|
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingInfiniband *setting = NM_SETTING_INFINIBAND (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
static void
|
||||||
case PROP_MAC_ADDRESS:
|
nm_setting_infiniband_init (NMSettingInfiniband *setting)
|
||||||
g_value_set_string (value, nm_setting_infiniband_get_mac_address (setting));
|
{
|
||||||
break;
|
}
|
||||||
case PROP_MTU:
|
|
||||||
g_value_set_uint (value, nm_setting_infiniband_get_mtu (setting));
|
/**
|
||||||
break;
|
* nm_setting_infiniband_new:
|
||||||
case PROP_TRANSPORT_MODE:
|
*
|
||||||
g_value_set_string (value, nm_setting_infiniband_get_transport_mode (setting));
|
* Creates a new #NMSettingInfiniband object with default values.
|
||||||
break;
|
*
|
||||||
case PROP_P_KEY:
|
* Returns: (transfer full): the new empty #NMSettingInfiniband object
|
||||||
g_value_set_int (value, nm_setting_infiniband_get_p_key (setting));
|
**/
|
||||||
break;
|
NMSetting *
|
||||||
case PROP_PARENT:
|
nm_setting_infiniband_new (void)
|
||||||
g_value_set_string (value, nm_setting_infiniband_get_parent (setting));
|
{
|
||||||
break;
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_INFINIBAND, NULL);
|
||||||
default:
|
}
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
static void
|
||||||
}
|
finalize (GObject *object)
|
||||||
|
{
|
||||||
|
NMSettingInfinibandPrivate *priv = NM_SETTING_INFINIBAND_GET_PRIVATE (object);
|
||||||
|
|
||||||
|
g_free (priv->transport_mode);
|
||||||
|
g_free (priv->mac_address);
|
||||||
|
g_free (priv->parent);
|
||||||
|
g_free (priv->virtual_iface_name);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (nm_setting_infiniband_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -381,8 +390,8 @@ nm_setting_infiniband_class_init (NMSettingInfinibandClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingInfinibandPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingInfinibandPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -22,10 +22,11 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-ip-config.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
#include "nm-setting-ip-config.h"
|
|
||||||
#include "nm-setting-ip4-config.h"
|
#include "nm-setting-ip4-config.h"
|
||||||
#include "nm-setting-ip6-config.h"
|
#include "nm-setting-ip6-config.h"
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
@@ -44,6 +45,8 @@
|
|||||||
* related to IP addressing, routing, and Domain Name Service.
|
* related to IP addressing, routing, and Domain Name Service.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
const NMUtilsDNSOptionDesc _nm_utils_dns_option_descs[] = {
|
const NMUtilsDNSOptionDesc _nm_utils_dns_option_descs[] = {
|
||||||
{ NM_SETTING_DNS_OPTION_DEBUG, FALSE, FALSE },
|
{ NM_SETTING_DNS_OPTION_DEBUG, FALSE, FALSE },
|
||||||
{ NM_SETTING_DNS_OPTION_NDOTS, TRUE, FALSE },
|
{ NM_SETTING_DNS_OPTION_NDOTS, TRUE, FALSE },
|
||||||
@@ -1382,9 +1385,26 @@ _nm_ip_route_attribute_validate_all (const NMIPRoute *route)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
G_DEFINE_ABSTRACT_TYPE (NMSettingIPConfig, nm_setting_ip_config, NM_TYPE_SETTING)
|
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingIPConfig,
|
||||||
|
PROP_METHOD,
|
||||||
#define NM_SETTING_IP_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP_CONFIG, NMSettingIPConfigPrivate))
|
PROP_DNS,
|
||||||
|
PROP_DNS_SEARCH,
|
||||||
|
PROP_DNS_OPTIONS,
|
||||||
|
PROP_DNS_PRIORITY,
|
||||||
|
PROP_ADDRESSES,
|
||||||
|
PROP_GATEWAY,
|
||||||
|
PROP_ROUTES,
|
||||||
|
PROP_ROUTE_METRIC,
|
||||||
|
PROP_ROUTE_TABLE,
|
||||||
|
PROP_IGNORE_AUTO_ROUTES,
|
||||||
|
PROP_IGNORE_AUTO_DNS,
|
||||||
|
PROP_DHCP_HOSTNAME,
|
||||||
|
PROP_DHCP_SEND_HOSTNAME,
|
||||||
|
PROP_NEVER_DEFAULT,
|
||||||
|
PROP_MAY_FAIL,
|
||||||
|
PROP_DAD_TIMEOUT,
|
||||||
|
PROP_DHCP_TIMEOUT,
|
||||||
|
);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *method;
|
char *method;
|
||||||
@@ -1407,26 +1427,11 @@ typedef struct {
|
|||||||
int dhcp_timeout;
|
int dhcp_timeout;
|
||||||
} NMSettingIPConfigPrivate;
|
} NMSettingIPConfigPrivate;
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingIPConfig,
|
G_DEFINE_ABSTRACT_TYPE (NMSettingIPConfig, nm_setting_ip_config, NM_TYPE_SETTING)
|
||||||
PROP_METHOD,
|
|
||||||
PROP_DNS,
|
#define NM_SETTING_IP_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP_CONFIG, NMSettingIPConfigPrivate))
|
||||||
PROP_DNS_SEARCH,
|
|
||||||
PROP_DNS_OPTIONS,
|
/*****************************************************************************/
|
||||||
PROP_DNS_PRIORITY,
|
|
||||||
PROP_ADDRESSES,
|
|
||||||
PROP_GATEWAY,
|
|
||||||
PROP_ROUTES,
|
|
||||||
PROP_ROUTE_METRIC,
|
|
||||||
PROP_ROUTE_TABLE,
|
|
||||||
PROP_IGNORE_AUTO_ROUTES,
|
|
||||||
PROP_IGNORE_AUTO_DNS,
|
|
||||||
PROP_DHCP_HOSTNAME,
|
|
||||||
PROP_DHCP_SEND_HOSTNAME,
|
|
||||||
PROP_NEVER_DEFAULT,
|
|
||||||
PROP_MAY_FAIL,
|
|
||||||
PROP_DAD_TIMEOUT,
|
|
||||||
PROP_DHCP_TIMEOUT,
|
|
||||||
);
|
|
||||||
|
|
||||||
#define NM_SETTING_IP_CONFIG_GET_FAMILY(setting) (NM_IS_SETTING_IP4_CONFIG (setting) ? AF_INET : AF_INET6)
|
#define NM_SETTING_IP_CONFIG_GET_FAMILY(setting) (NM_IS_SETTING_IP4_CONFIG (setting) ? AF_INET : AF_INET6)
|
||||||
|
|
||||||
@@ -2659,36 +2664,112 @@ compare_property (const NMSettInfoSetting *sett_info,
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static gboolean
|
||||||
nm_setting_ip_config_init (NMSettingIPConfig *setting)
|
ip_gateway_set (NMSetting *setting,
|
||||||
|
GVariant *connection_dict,
|
||||||
|
const char *property,
|
||||||
|
GVariant *value,
|
||||||
|
NMSettingParseFlags parse_flags,
|
||||||
|
GError **error)
|
||||||
{
|
{
|
||||||
NMSettingIPConfigPrivate *priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting);
|
/* FIXME: properly handle errors */
|
||||||
|
|
||||||
priv->dns = g_ptr_array_new_with_free_func (g_free);
|
/* Don't set from 'gateway' if we're going to use the gateway in 'addresses' */
|
||||||
priv->dns_search = g_ptr_array_new_with_free_func (g_free);
|
if (_nm_setting_use_legacy_property (setting, connection_dict, "addresses", "gateway"))
|
||||||
priv->dns_options = NULL;
|
return TRUE;
|
||||||
priv->addresses = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip_address_unref);
|
|
||||||
priv->routes = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip_route_unref);
|
g_object_set (setting, property, g_variant_get_string (value, NULL), NULL);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
GArray *
|
||||||
finalize (GObject *object)
|
_nm_sett_info_property_override_create_array_ip_config (void)
|
||||||
{
|
{
|
||||||
NMSettingIPConfig *self = NM_SETTING_IP_CONFIG (object);
|
nm_auto_unref_gtypeclass NMSettingClass *setting_class = g_type_class_ref (NM_TYPE_SETTING_IP_CONFIG);
|
||||||
NMSettingIPConfigPrivate *priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (self);
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
g_free (priv->method);
|
_properties_override_add_override (properties_override,
|
||||||
g_free (priv->gateway);
|
obj_properties[PROP_GATEWAY],
|
||||||
g_free (priv->dhcp_hostname);
|
G_VARIANT_TYPE_STRING,
|
||||||
|
NULL,
|
||||||
|
ip_gateway_set,
|
||||||
|
NULL);
|
||||||
|
|
||||||
g_ptr_array_unref (priv->dns);
|
return properties_override;
|
||||||
g_ptr_array_unref (priv->dns_search);
|
}
|
||||||
if (priv->dns_options)
|
|
||||||
g_ptr_array_unref (priv->dns_options);
|
|
||||||
g_ptr_array_unref (priv->addresses);
|
|
||||||
g_ptr_array_unref (priv->routes);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_setting_ip_config_parent_class)->finalize (object);
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMSettingIPConfig *setting = NM_SETTING_IP_CONFIG (object);
|
||||||
|
NMSettingIPConfigPrivate *priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_METHOD:
|
||||||
|
g_value_set_string (value, nm_setting_ip_config_get_method (setting));
|
||||||
|
break;
|
||||||
|
case PROP_DNS:
|
||||||
|
g_value_take_boxed (value, _nm_utils_ptrarray_to_strv (priv->dns));
|
||||||
|
break;
|
||||||
|
case PROP_DNS_SEARCH:
|
||||||
|
g_value_take_boxed (value, _nm_utils_ptrarray_to_strv (priv->dns_search));
|
||||||
|
break;
|
||||||
|
case PROP_DNS_OPTIONS:
|
||||||
|
g_value_take_boxed (value, priv->dns_options ? _nm_utils_ptrarray_to_strv (priv->dns_options) : NULL);
|
||||||
|
break;
|
||||||
|
case PROP_DNS_PRIORITY:
|
||||||
|
g_value_set_int (value, priv->dns_priority);
|
||||||
|
break;
|
||||||
|
case PROP_ADDRESSES:
|
||||||
|
g_value_take_boxed (value, _nm_utils_copy_array (priv->addresses,
|
||||||
|
(NMUtilsCopyFunc) nm_ip_address_dup,
|
||||||
|
(GDestroyNotify) nm_ip_address_unref));
|
||||||
|
break;
|
||||||
|
case PROP_GATEWAY:
|
||||||
|
g_value_set_string (value, nm_setting_ip_config_get_gateway (setting));
|
||||||
|
break;
|
||||||
|
case PROP_ROUTES:
|
||||||
|
g_value_take_boxed (value, _nm_utils_copy_array (priv->routes,
|
||||||
|
(NMUtilsCopyFunc) nm_ip_route_dup,
|
||||||
|
(GDestroyNotify) nm_ip_route_unref));
|
||||||
|
break;
|
||||||
|
case PROP_ROUTE_METRIC:
|
||||||
|
g_value_set_int64 (value, priv->route_metric);
|
||||||
|
break;
|
||||||
|
case PROP_ROUTE_TABLE:
|
||||||
|
g_value_set_uint (value, priv->route_table);
|
||||||
|
break;
|
||||||
|
case PROP_IGNORE_AUTO_ROUTES:
|
||||||
|
g_value_set_boolean (value, nm_setting_ip_config_get_ignore_auto_routes (setting));
|
||||||
|
break;
|
||||||
|
case PROP_IGNORE_AUTO_DNS:
|
||||||
|
g_value_set_boolean (value, nm_setting_ip_config_get_ignore_auto_dns (setting));
|
||||||
|
break;
|
||||||
|
case PROP_DHCP_HOSTNAME:
|
||||||
|
g_value_set_string (value, nm_setting_ip_config_get_dhcp_hostname (setting));
|
||||||
|
break;
|
||||||
|
case PROP_DHCP_SEND_HOSTNAME:
|
||||||
|
g_value_set_boolean (value, nm_setting_ip_config_get_dhcp_send_hostname (setting));
|
||||||
|
break;
|
||||||
|
case PROP_NEVER_DEFAULT:
|
||||||
|
g_value_set_boolean (value, priv->never_default);
|
||||||
|
break;
|
||||||
|
case PROP_MAY_FAIL:
|
||||||
|
g_value_set_boolean (value, priv->may_fail);
|
||||||
|
break;
|
||||||
|
case PROP_DAD_TIMEOUT:
|
||||||
|
g_value_set_int (value, nm_setting_ip_config_get_dad_timeout (setting));
|
||||||
|
break;
|
||||||
|
case PROP_DHCP_TIMEOUT:
|
||||||
|
g_value_set_int (value, nm_setting_ip_config_get_dhcp_timeout (setting));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -2791,110 +2872,38 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object, guint prop_id,
|
nm_setting_ip_config_init (NMSettingIPConfig *setting)
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
{
|
||||||
NMSettingIPConfig *setting = NM_SETTING_IP_CONFIG (object);
|
|
||||||
NMSettingIPConfigPrivate *priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting);
|
NMSettingIPConfigPrivate *priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting);
|
||||||
|
|
||||||
switch (prop_id) {
|
priv->dns = g_ptr_array_new_with_free_func (g_free);
|
||||||
case PROP_METHOD:
|
priv->dns_search = g_ptr_array_new_with_free_func (g_free);
|
||||||
g_value_set_string (value, nm_setting_ip_config_get_method (setting));
|
priv->dns_options = NULL;
|
||||||
break;
|
priv->addresses = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip_address_unref);
|
||||||
case PROP_DNS:
|
priv->routes = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip_route_unref);
|
||||||
g_value_take_boxed (value, _nm_utils_ptrarray_to_strv (priv->dns));
|
|
||||||
break;
|
|
||||||
case PROP_DNS_SEARCH:
|
|
||||||
g_value_take_boxed (value, _nm_utils_ptrarray_to_strv (priv->dns_search));
|
|
||||||
break;
|
|
||||||
case PROP_DNS_OPTIONS:
|
|
||||||
g_value_take_boxed (value, priv->dns_options ? _nm_utils_ptrarray_to_strv (priv->dns_options) : NULL);
|
|
||||||
break;
|
|
||||||
case PROP_DNS_PRIORITY:
|
|
||||||
g_value_set_int (value, priv->dns_priority);
|
|
||||||
break;
|
|
||||||
case PROP_ADDRESSES:
|
|
||||||
g_value_take_boxed (value, _nm_utils_copy_array (priv->addresses,
|
|
||||||
(NMUtilsCopyFunc) nm_ip_address_dup,
|
|
||||||
(GDestroyNotify) nm_ip_address_unref));
|
|
||||||
break;
|
|
||||||
case PROP_GATEWAY:
|
|
||||||
g_value_set_string (value, nm_setting_ip_config_get_gateway (setting));
|
|
||||||
break;
|
|
||||||
case PROP_ROUTES:
|
|
||||||
g_value_take_boxed (value, _nm_utils_copy_array (priv->routes,
|
|
||||||
(NMUtilsCopyFunc) nm_ip_route_dup,
|
|
||||||
(GDestroyNotify) nm_ip_route_unref));
|
|
||||||
break;
|
|
||||||
case PROP_ROUTE_METRIC:
|
|
||||||
g_value_set_int64 (value, priv->route_metric);
|
|
||||||
break;
|
|
||||||
case PROP_ROUTE_TABLE:
|
|
||||||
g_value_set_uint (value, priv->route_table);
|
|
||||||
break;
|
|
||||||
case PROP_IGNORE_AUTO_ROUTES:
|
|
||||||
g_value_set_boolean (value, nm_setting_ip_config_get_ignore_auto_routes (setting));
|
|
||||||
break;
|
|
||||||
case PROP_IGNORE_AUTO_DNS:
|
|
||||||
g_value_set_boolean (value, nm_setting_ip_config_get_ignore_auto_dns (setting));
|
|
||||||
break;
|
|
||||||
case PROP_DHCP_HOSTNAME:
|
|
||||||
g_value_set_string (value, nm_setting_ip_config_get_dhcp_hostname (setting));
|
|
||||||
break;
|
|
||||||
case PROP_DHCP_SEND_HOSTNAME:
|
|
||||||
g_value_set_boolean (value, nm_setting_ip_config_get_dhcp_send_hostname (setting));
|
|
||||||
break;
|
|
||||||
case PROP_NEVER_DEFAULT:
|
|
||||||
g_value_set_boolean (value, priv->never_default);
|
|
||||||
break;
|
|
||||||
case PROP_MAY_FAIL:
|
|
||||||
g_value_set_boolean (value, priv->may_fail);
|
|
||||||
break;
|
|
||||||
case PROP_DAD_TIMEOUT:
|
|
||||||
g_value_set_int (value, nm_setting_ip_config_get_dad_timeout (setting));
|
|
||||||
break;
|
|
||||||
case PROP_DHCP_TIMEOUT:
|
|
||||||
g_value_set_int (value, nm_setting_ip_config_get_dhcp_timeout (setting));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static void
|
||||||
ip_gateway_set (NMSetting *setting,
|
finalize (GObject *object)
|
||||||
GVariant *connection_dict,
|
|
||||||
const char *property,
|
|
||||||
GVariant *value,
|
|
||||||
NMSettingParseFlags parse_flags,
|
|
||||||
GError **error)
|
|
||||||
{
|
{
|
||||||
/* FIXME: properly handle errors */
|
NMSettingIPConfig *self = NM_SETTING_IP_CONFIG (object);
|
||||||
|
NMSettingIPConfigPrivate *priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (self);
|
||||||
|
|
||||||
/* Don't set from 'gateway' if we're going to use the gateway in 'addresses' */
|
g_free (priv->method);
|
||||||
if (_nm_setting_use_legacy_property (setting, connection_dict, "addresses", "gateway"))
|
g_free (priv->gateway);
|
||||||
return TRUE;
|
g_free (priv->dhcp_hostname);
|
||||||
|
|
||||||
g_object_set (setting, property, g_variant_get_string (value, NULL), NULL);
|
g_ptr_array_unref (priv->dns);
|
||||||
return TRUE;
|
g_ptr_array_unref (priv->dns_search);
|
||||||
}
|
if (priv->dns_options)
|
||||||
|
g_ptr_array_unref (priv->dns_options);
|
||||||
|
g_ptr_array_unref (priv->addresses);
|
||||||
|
g_ptr_array_unref (priv->routes);
|
||||||
|
|
||||||
GArray *
|
G_OBJECT_CLASS (nm_setting_ip_config_parent_class)->finalize (object);
|
||||||
_nm_sett_info_property_override_create_array_ip_config (void)
|
|
||||||
{
|
|
||||||
nm_auto_unref_gtypeclass NMSettingClass *setting_class = g_type_class_ref (NM_TYPE_SETTING_IP_CONFIG);
|
|
||||||
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
|
||||||
|
|
||||||
_properties_override_add_override (properties_override,
|
|
||||||
obj_properties[PROP_GATEWAY],
|
|
||||||
G_VARIANT_TYPE_STRING,
|
|
||||||
NULL,
|
|
||||||
ip_gateway_set,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
return properties_override;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -2905,8 +2914,8 @@ nm_setting_ip_config_class_init (NMSettingIPConfigClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingIPConfigPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingIPConfigPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -30,9 +30,23 @@
|
|||||||
* @short_description: Describes connection properties for IP tunnel devices
|
* @short_description: Describes connection properties for IP tunnel devices
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingIPTunnel, nm_setting_ip_tunnel, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_IP_TUNNEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP_TUNNEL, NMSettingIPTunnelPrivate))
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
|
PROP_PARENT,
|
||||||
|
PROP_MODE,
|
||||||
|
PROP_LOCAL,
|
||||||
|
PROP_REMOTE,
|
||||||
|
PROP_TTL,
|
||||||
|
PROP_TOS,
|
||||||
|
PROP_PATH_MTU_DISCOVERY,
|
||||||
|
PROP_INPUT_KEY,
|
||||||
|
PROP_OUTPUT_KEY,
|
||||||
|
PROP_ENCAPSULATION_LIMIT,
|
||||||
|
PROP_FLOW_LABEL,
|
||||||
|
PROP_MTU,
|
||||||
|
PROP_FLAGS,
|
||||||
|
);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *parent;
|
char *parent;
|
||||||
@@ -50,21 +64,11 @@ typedef struct {
|
|||||||
guint32 flags;
|
guint32 flags;
|
||||||
} NMSettingIPTunnelPrivate;
|
} NMSettingIPTunnelPrivate;
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
G_DEFINE_TYPE (NMSettingIPTunnel, nm_setting_ip_tunnel, NM_TYPE_SETTING)
|
||||||
PROP_PARENT,
|
|
||||||
PROP_MODE,
|
#define NM_SETTING_IP_TUNNEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP_TUNNEL, NMSettingIPTunnelPrivate))
|
||||||
PROP_LOCAL,
|
|
||||||
PROP_REMOTE,
|
/*****************************************************************************/
|
||||||
PROP_TTL,
|
|
||||||
PROP_TOS,
|
|
||||||
PROP_PATH_MTU_DISCOVERY,
|
|
||||||
PROP_INPUT_KEY,
|
|
||||||
PROP_OUTPUT_KEY,
|
|
||||||
PROP_ENCAPSULATION_LIMIT,
|
|
||||||
PROP_FLOW_LABEL,
|
|
||||||
PROP_MTU,
|
|
||||||
PROP_FLAGS,
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_ip_tunnel_get_parent:
|
* nm_setting_ip_tunnel_get_parent:
|
||||||
@@ -471,24 +475,59 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*****************************************************************************/
|
||||||
* nm_setting_ip_tunnel_new:
|
|
||||||
*
|
|
||||||
* Creates a new #NMSettingIPTunnel object with default values.
|
|
||||||
*
|
|
||||||
* Returns: (transfer full): the new empty #NMSettingIPTunnel object
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
**/
|
|
||||||
NMSetting *
|
|
||||||
nm_setting_ip_tunnel_new (void)
|
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_IP_TUNNEL, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_ip_tunnel_init (NMSettingIPTunnel *setting)
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
|
NMSettingIPTunnel *setting = NM_SETTING_IP_TUNNEL (object);
|
||||||
|
NMSettingIPTunnelPrivate *priv = NM_SETTING_IP_TUNNEL_GET_PRIVATE (setting);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_PARENT:
|
||||||
|
g_value_set_string (value, priv->parent);
|
||||||
|
break;
|
||||||
|
case PROP_MODE:
|
||||||
|
g_value_set_uint (value, priv->mode);
|
||||||
|
break;
|
||||||
|
case PROP_LOCAL:
|
||||||
|
g_value_set_string (value, priv->local);
|
||||||
|
break;
|
||||||
|
case PROP_REMOTE:
|
||||||
|
g_value_set_string (value, priv->remote);
|
||||||
|
break;
|
||||||
|
case PROP_TTL:
|
||||||
|
g_value_set_uint (value, priv->ttl);
|
||||||
|
break;
|
||||||
|
case PROP_TOS:
|
||||||
|
g_value_set_uint (value, priv->tos);
|
||||||
|
break;
|
||||||
|
case PROP_PATH_MTU_DISCOVERY:
|
||||||
|
g_value_set_boolean (value, priv->path_mtu_discovery);
|
||||||
|
break;
|
||||||
|
case PROP_INPUT_KEY:
|
||||||
|
g_value_set_string (value, priv->input_key);
|
||||||
|
break;
|
||||||
|
case PROP_OUTPUT_KEY:
|
||||||
|
g_value_set_string (value, priv->output_key);
|
||||||
|
break;
|
||||||
|
case PROP_ENCAPSULATION_LIMIT:
|
||||||
|
g_value_set_uint (value, priv->encapsulation_limit);
|
||||||
|
break;
|
||||||
|
case PROP_FLOW_LABEL:
|
||||||
|
g_value_set_uint (value, priv->flow_label);
|
||||||
|
break;
|
||||||
|
case PROP_MTU:
|
||||||
|
g_value_set_uint (value, priv->mtu);
|
||||||
|
break;
|
||||||
|
case PROP_FLAGS:
|
||||||
|
g_value_set_uint (value, priv->flags);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -549,57 +588,26 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
get_property (GObject *object, guint prop_id,
|
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingIPTunnel *setting = NM_SETTING_IP_TUNNEL (object);
|
|
||||||
NMSettingIPTunnelPrivate *priv = NM_SETTING_IP_TUNNEL_GET_PRIVATE (setting);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
static void
|
||||||
case PROP_PARENT:
|
nm_setting_ip_tunnel_init (NMSettingIPTunnel *setting)
|
||||||
g_value_set_string (value, priv->parent);
|
{
|
||||||
break;
|
}
|
||||||
case PROP_MODE:
|
|
||||||
g_value_set_uint (value, priv->mode);
|
/**
|
||||||
break;
|
* nm_setting_ip_tunnel_new:
|
||||||
case PROP_LOCAL:
|
*
|
||||||
g_value_set_string (value, priv->local);
|
* Creates a new #NMSettingIPTunnel object with default values.
|
||||||
break;
|
*
|
||||||
case PROP_REMOTE:
|
* Returns: (transfer full): the new empty #NMSettingIPTunnel object
|
||||||
g_value_set_string (value, priv->remote);
|
*
|
||||||
break;
|
* Since: 1.2
|
||||||
case PROP_TTL:
|
**/
|
||||||
g_value_set_uint (value, priv->ttl);
|
NMSetting *
|
||||||
break;
|
nm_setting_ip_tunnel_new (void)
|
||||||
case PROP_TOS:
|
{
|
||||||
g_value_set_uint (value, priv->tos);
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_IP_TUNNEL, NULL);
|
||||||
break;
|
|
||||||
case PROP_PATH_MTU_DISCOVERY:
|
|
||||||
g_value_set_boolean (value, priv->path_mtu_discovery);
|
|
||||||
break;
|
|
||||||
case PROP_INPUT_KEY:
|
|
||||||
g_value_set_string (value, priv->input_key);
|
|
||||||
break;
|
|
||||||
case PROP_OUTPUT_KEY:
|
|
||||||
g_value_set_string (value, priv->output_key);
|
|
||||||
break;
|
|
||||||
case PROP_ENCAPSULATION_LIMIT:
|
|
||||||
g_value_set_uint (value, priv->encapsulation_limit);
|
|
||||||
break;
|
|
||||||
case PROP_FLOW_LABEL:
|
|
||||||
g_value_set_uint (value, priv->flow_label);
|
|
||||||
break;
|
|
||||||
case PROP_MTU:
|
|
||||||
g_value_set_uint (value, priv->mtu);
|
|
||||||
break;
|
|
||||||
case PROP_FLAGS:
|
|
||||||
g_value_set_uint (value, priv->flags);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -625,8 +633,8 @@ nm_setting_ip_tunnel_class_init (NMSettingIPTunnelClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingIPTunnelPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingIPTunnelPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -21,9 +21,10 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-ip4-config.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "nm-setting-ip4-config.h"
|
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,32 +51,23 @@
|
|||||||
* connection.
|
* connection.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingIP4Config, nm_setting_ip4_config, NM_TYPE_SETTING_IP_CONFIG)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_IP4_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP4_CONFIG, NMSettingIP4ConfigPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char *dhcp_client_id;
|
|
||||||
char *dhcp_fqdn;
|
|
||||||
} NMSettingIP4ConfigPrivate;
|
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_DHCP_CLIENT_ID,
|
PROP_DHCP_CLIENT_ID,
|
||||||
PROP_DHCP_FQDN,
|
PROP_DHCP_FQDN,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
typedef struct {
|
||||||
* nm_setting_ip4_config_new:
|
char *dhcp_client_id;
|
||||||
*
|
char *dhcp_fqdn;
|
||||||
* Creates a new #NMSettingIP4Config object with default values.
|
} NMSettingIP4ConfigPrivate;
|
||||||
*
|
|
||||||
* Returns: (transfer full): the new empty #NMSettingIP4Config object
|
G_DEFINE_TYPE (NMSettingIP4Config, nm_setting_ip4_config, NM_TYPE_SETTING_IP_CONFIG)
|
||||||
**/
|
|
||||||
NMSetting *
|
#define NM_SETTING_IP4_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP4_CONFIG, NMSettingIP4ConfigPrivate))
|
||||||
nm_setting_ip4_config_new (void)
|
|
||||||
{
|
/*****************************************************************************/
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_IP4_CONFIG, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_ip4_config_get_dhcp_client_id:
|
* nm_setting_ip4_config_get_dhcp_client_id:
|
||||||
@@ -249,62 +241,6 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
nm_setting_ip4_config_init (NMSettingIP4Config *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
finalize (GObject *object)
|
|
||||||
{
|
|
||||||
NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (object);
|
|
||||||
|
|
||||||
g_free (priv->dhcp_client_id);
|
|
||||||
g_free (priv->dhcp_fqdn);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_setting_ip4_config_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
set_property (GObject *object, guint prop_id,
|
|
||||||
const GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_DHCP_CLIENT_ID:
|
|
||||||
g_free (priv->dhcp_client_id);
|
|
||||||
priv->dhcp_client_id = g_value_dup_string (value);
|
|
||||||
break;
|
|
||||||
case PROP_DHCP_FQDN:
|
|
||||||
g_free (priv->dhcp_fqdn);
|
|
||||||
priv->dhcp_fqdn = g_value_dup_string (value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
get_property (GObject *object, guint prop_id,
|
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingIP4Config *s_ip4 = NM_SETTING_IP4_CONFIG (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_DHCP_CLIENT_ID:
|
|
||||||
g_value_set_string (value, nm_setting_ip4_config_get_dhcp_client_id (s_ip4));
|
|
||||||
break;
|
|
||||||
case PROP_DHCP_FQDN:
|
|
||||||
g_value_set_string (value, nm_setting_ip4_config_get_dhcp_fqdn (s_ip4));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static GVariant *
|
static GVariant *
|
||||||
ip4_dns_to_dbus (const GValue *prop_value)
|
ip4_dns_to_dbus (const GValue *prop_value)
|
||||||
{
|
{
|
||||||
@@ -526,6 +462,79 @@ ip4_route_data_set (NMSetting *setting,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMSettingIP4Config *s_ip4 = NM_SETTING_IP4_CONFIG (object);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_DHCP_CLIENT_ID:
|
||||||
|
g_value_set_string (value, nm_setting_ip4_config_get_dhcp_client_id (s_ip4));
|
||||||
|
break;
|
||||||
|
case PROP_DHCP_FQDN:
|
||||||
|
g_value_set_string (value, nm_setting_ip4_config_get_dhcp_fqdn (s_ip4));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
set_property (GObject *object, guint prop_id,
|
||||||
|
const GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (object);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_DHCP_CLIENT_ID:
|
||||||
|
g_free (priv->dhcp_client_id);
|
||||||
|
priv->dhcp_client_id = g_value_dup_string (value);
|
||||||
|
break;
|
||||||
|
case PROP_DHCP_FQDN:
|
||||||
|
g_free (priv->dhcp_fqdn);
|
||||||
|
priv->dhcp_fqdn = g_value_dup_string (value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
nm_setting_ip4_config_init (NMSettingIP4Config *setting)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nm_setting_ip4_config_new:
|
||||||
|
*
|
||||||
|
* Creates a new #NMSettingIP4Config object with default values.
|
||||||
|
*
|
||||||
|
* Returns: (transfer full): the new empty #NMSettingIP4Config object
|
||||||
|
**/
|
||||||
|
NMSetting *
|
||||||
|
nm_setting_ip4_config_new (void)
|
||||||
|
{
|
||||||
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_IP4_CONFIG, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
finalize (GObject *object)
|
||||||
|
{
|
||||||
|
NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (object);
|
||||||
|
|
||||||
|
g_free (priv->dhcp_client_id);
|
||||||
|
g_free (priv->dhcp_fqdn);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (nm_setting_ip4_config_parent_class)->finalize (object);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *klass)
|
nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *klass)
|
||||||
{
|
{
|
||||||
@@ -535,8 +544,8 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (setting_class, sizeof (NMSettingIP4ConfigPrivate));
|
g_type_class_add_private (setting_class, sizeof (NMSettingIP4ConfigPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -52,16 +52,7 @@
|
|||||||
* supported.
|
* supported.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingIP6Config, nm_setting_ip6_config, NM_TYPE_SETTING_IP_CONFIG)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_IP6_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP6_CONFIG, NMSettingIP6ConfigPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
NMSettingIP6ConfigPrivacy ip6_privacy;
|
|
||||||
NMSettingIP6ConfigAddrGenMode addr_gen_mode;
|
|
||||||
char *token;
|
|
||||||
char *dhcp_duid;
|
|
||||||
} NMSettingIP6ConfigPrivate;
|
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_IP6_PRIVACY,
|
PROP_IP6_PRIVACY,
|
||||||
@@ -70,18 +61,18 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
|||||||
PROP_DHCP_DUID,
|
PROP_DHCP_DUID,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
typedef struct {
|
||||||
* nm_setting_ip6_config_new:
|
NMSettingIP6ConfigPrivacy ip6_privacy;
|
||||||
*
|
NMSettingIP6ConfigAddrGenMode addr_gen_mode;
|
||||||
* Creates a new #NMSettingIP6Config object with default values.
|
char *token;
|
||||||
*
|
char *dhcp_duid;
|
||||||
* Returns: (transfer full): the new empty #NMSettingIP6Config object
|
} NMSettingIP6ConfigPrivate;
|
||||||
**/
|
|
||||||
NMSetting *
|
G_DEFINE_TYPE (NMSettingIP6Config, nm_setting_ip6_config, NM_TYPE_SETTING_IP_CONFIG)
|
||||||
nm_setting_ip6_config_new (void)
|
|
||||||
{
|
#define NM_SETTING_IP6_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP6_CONFIG, NMSettingIP6ConfigPrivate))
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_IP6_CONFIG, NULL);
|
|
||||||
}
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_ip6_config_get_ip6_privacy:
|
* nm_setting_ip6_config_get_ip6_privacy:
|
||||||
@@ -309,11 +300,6 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
nm_setting_ip6_config_init (NMSettingIP6Config *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static GVariant *
|
static GVariant *
|
||||||
ip6_dns_to_dbus (const GValue *prop_value)
|
ip6_dns_to_dbus (const GValue *prop_value)
|
||||||
{
|
{
|
||||||
@@ -481,32 +467,7 @@ ip6_route_data_set (NMSetting *setting,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
set_property (GObject *object, guint prop_id,
|
|
||||||
const GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_IP6_PRIVACY:
|
|
||||||
priv->ip6_privacy = g_value_get_enum (value);
|
|
||||||
break;
|
|
||||||
case PROP_ADDR_GEN_MODE:
|
|
||||||
priv->addr_gen_mode = g_value_get_int (value);
|
|
||||||
break;
|
|
||||||
case PROP_TOKEN:
|
|
||||||
g_free (priv->token);
|
|
||||||
priv->token = g_value_dup_string (value);
|
|
||||||
break;
|
|
||||||
case PROP_DHCP_DUID:
|
|
||||||
g_free (priv->dhcp_duid);
|
|
||||||
priv->dhcp_duid = g_value_dup_string (value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object, guint prop_id,
|
get_property (GObject *object, guint prop_id,
|
||||||
@@ -533,6 +494,53 @@ get_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
set_property (GObject *object, guint prop_id,
|
||||||
|
const GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (object);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_IP6_PRIVACY:
|
||||||
|
priv->ip6_privacy = g_value_get_enum (value);
|
||||||
|
break;
|
||||||
|
case PROP_ADDR_GEN_MODE:
|
||||||
|
priv->addr_gen_mode = g_value_get_int (value);
|
||||||
|
break;
|
||||||
|
case PROP_TOKEN:
|
||||||
|
g_free (priv->token);
|
||||||
|
priv->token = g_value_dup_string (value);
|
||||||
|
break;
|
||||||
|
case PROP_DHCP_DUID:
|
||||||
|
g_free (priv->dhcp_duid);
|
||||||
|
priv->dhcp_duid = g_value_dup_string (value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
nm_setting_ip6_config_init (NMSettingIP6Config *setting)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nm_setting_ip6_config_new:
|
||||||
|
*
|
||||||
|
* Creates a new #NMSettingIP6Config object with default values.
|
||||||
|
*
|
||||||
|
* Returns: (transfer full): the new empty #NMSettingIP6Config object
|
||||||
|
**/
|
||||||
|
NMSetting *
|
||||||
|
nm_setting_ip6_config_new (void)
|
||||||
|
{
|
||||||
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_IP6_CONFIG, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
finalize (GObject *object)
|
finalize (GObject *object)
|
||||||
{
|
{
|
||||||
@@ -554,8 +562,8 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingIP6ConfigPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingIP6ConfigPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -42,21 +42,7 @@
|
|||||||
* necessary for connection to MACsec (IEEE 802.1AE) interfaces.
|
* necessary for connection to MACsec (IEEE 802.1AE) interfaces.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingMacsec, nm_setting_macsec, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_MACSEC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_MACSEC, NMSettingMacsecPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char *parent;
|
|
||||||
NMSettingMacsecMode mode;
|
|
||||||
bool encrypt:1;
|
|
||||||
bool send_sci:1;
|
|
||||||
char *mka_cak;
|
|
||||||
NMSettingSecretFlags mka_cak_flags;
|
|
||||||
char *mka_ckn;
|
|
||||||
int port;
|
|
||||||
NMSettingMacsecValidation validation;
|
|
||||||
} NMSettingMacsecPrivate;
|
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_PARENT,
|
PROP_PARENT,
|
||||||
@@ -70,20 +56,23 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
|||||||
PROP_SEND_SCI,
|
PROP_SEND_SCI,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
typedef struct {
|
||||||
* nm_setting_macsec_new:
|
char *parent;
|
||||||
*
|
NMSettingMacsecMode mode;
|
||||||
* Creates a new #NMSettingMacsec object with default values.
|
bool encrypt:1;
|
||||||
*
|
bool send_sci:1;
|
||||||
* Returns: (transfer full): the new empty #NMSettingMacsec object
|
char *mka_cak;
|
||||||
*
|
NMSettingSecretFlags mka_cak_flags;
|
||||||
* Since: 1.6
|
char *mka_ckn;
|
||||||
**/
|
int port;
|
||||||
NMSetting *
|
NMSettingMacsecValidation validation;
|
||||||
nm_setting_macsec_new (void)
|
} NMSettingMacsecPrivate;
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_MACSEC, NULL);
|
G_DEFINE_TYPE (NMSettingMacsec, nm_setting_macsec, NM_TYPE_SETTING)
|
||||||
}
|
|
||||||
|
#define NM_SETTING_MACSEC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_MACSEC, NMSettingMacsecPrivate))
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_macsec_get_parent:
|
* nm_setting_macsec_get_parent:
|
||||||
@@ -395,9 +384,47 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_macsec_init (NMSettingMacsec *setting)
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
|
NMSettingMacsec *setting = NM_SETTING_MACSEC (object);
|
||||||
|
NMSettingMacsecPrivate *priv = NM_SETTING_MACSEC_GET_PRIVATE (setting);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_PARENT:
|
||||||
|
g_value_set_string (value, priv->parent);
|
||||||
|
break;
|
||||||
|
case PROP_MODE:
|
||||||
|
g_value_set_int (value, priv->mode);
|
||||||
|
break;
|
||||||
|
case PROP_ENCRYPT:
|
||||||
|
g_value_set_boolean (value, priv->encrypt);
|
||||||
|
break;
|
||||||
|
case PROP_MKA_CAK:
|
||||||
|
g_value_set_string (value, priv->mka_cak);
|
||||||
|
break;
|
||||||
|
case PROP_MKA_CAK_FLAGS:
|
||||||
|
g_value_set_flags (value, priv->mka_cak_flags);
|
||||||
|
break;
|
||||||
|
case PROP_MKA_CKN:
|
||||||
|
g_value_set_string (value, priv->mka_ckn);
|
||||||
|
break;
|
||||||
|
case PROP_PORT:
|
||||||
|
g_value_set_int (value, priv->port);
|
||||||
|
break;
|
||||||
|
case PROP_VALIDATION:
|
||||||
|
g_value_set_int (value, priv->validation);
|
||||||
|
break;
|
||||||
|
case PROP_SEND_SCI:
|
||||||
|
g_value_set_boolean (value, priv->send_sci);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -444,45 +471,26 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
get_property (GObject *object, guint prop_id,
|
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingMacsec *setting = NM_SETTING_MACSEC (object);
|
|
||||||
NMSettingMacsecPrivate *priv = NM_SETTING_MACSEC_GET_PRIVATE (setting);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
static void
|
||||||
case PROP_PARENT:
|
nm_setting_macsec_init (NMSettingMacsec *setting)
|
||||||
g_value_set_string (value, priv->parent);
|
{
|
||||||
break;
|
}
|
||||||
case PROP_MODE:
|
|
||||||
g_value_set_int (value, priv->mode);
|
/**
|
||||||
break;
|
* nm_setting_macsec_new:
|
||||||
case PROP_ENCRYPT:
|
*
|
||||||
g_value_set_boolean (value, priv->encrypt);
|
* Creates a new #NMSettingMacsec object with default values.
|
||||||
break;
|
*
|
||||||
case PROP_MKA_CAK:
|
* Returns: (transfer full): the new empty #NMSettingMacsec object
|
||||||
g_value_set_string (value, priv->mka_cak);
|
*
|
||||||
break;
|
* Since: 1.6
|
||||||
case PROP_MKA_CAK_FLAGS:
|
**/
|
||||||
g_value_set_flags (value, priv->mka_cak_flags);
|
NMSetting *
|
||||||
break;
|
nm_setting_macsec_new (void)
|
||||||
case PROP_MKA_CKN:
|
{
|
||||||
g_value_set_string (value, priv->mka_ckn);
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_MACSEC, NULL);
|
||||||
break;
|
|
||||||
case PROP_PORT:
|
|
||||||
g_value_set_int (value, priv->port);
|
|
||||||
break;
|
|
||||||
case PROP_VALIDATION:
|
|
||||||
g_value_set_int (value, priv->validation);
|
|
||||||
break;
|
|
||||||
case PROP_SEND_SCI:
|
|
||||||
g_value_set_boolean (value, priv->send_sci);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -506,8 +514,8 @@ nm_setting_macsec_class_init (NMSettingMacsecClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingMacsecPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingMacsecPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -21,10 +21,11 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-macvlan.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "nm-setting-macvlan.h"
|
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-setting-connection.h"
|
#include "nm-setting-connection.h"
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
@@ -39,16 +40,7 @@
|
|||||||
* necessary for connection to macvlan interfaces.
|
* necessary for connection to macvlan interfaces.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingMacvlan, nm_setting_macvlan, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_MACVLAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_MACVLAN, NMSettingMacvlanPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char *parent;
|
|
||||||
NMSettingMacvlanMode mode;
|
|
||||||
gboolean promiscuous;
|
|
||||||
gboolean tap;
|
|
||||||
} NMSettingMacvlanPrivate;
|
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_PARENT,
|
PROP_PARENT,
|
||||||
@@ -57,20 +49,18 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
|||||||
PROP_TAP,
|
PROP_TAP,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
typedef struct {
|
||||||
* nm_setting_macvlan_new:
|
char *parent;
|
||||||
*
|
NMSettingMacvlanMode mode;
|
||||||
* Creates a new #NMSettingMacvlan object with default values.
|
gboolean promiscuous;
|
||||||
*
|
gboolean tap;
|
||||||
* Returns: (transfer full): the new empty #NMSettingMacvlan object
|
} NMSettingMacvlanPrivate;
|
||||||
*
|
|
||||||
* Since: 1.2
|
G_DEFINE_TYPE (NMSettingMacvlan, nm_setting_macvlan, NM_TYPE_SETTING)
|
||||||
**/
|
|
||||||
NMSetting *
|
#define NM_SETTING_MACVLAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_MACVLAN, NMSettingMacvlanPrivate))
|
||||||
nm_setting_macvlan_new (void)
|
|
||||||
{
|
/*****************************************************************************/
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_MACVLAN, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_macvlan_get_parent:
|
* nm_setting_macvlan_get_parent:
|
||||||
@@ -134,11 +124,6 @@ nm_setting_macvlan_get_tap (NMSettingMacvlan *setting)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
|
||||||
nm_setting_macvlan_init (NMSettingMacvlan *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
verify (NMSetting *setting, NMConnection *connection, GError **error)
|
verify (NMSetting *setting, NMConnection *connection, GError **error)
|
||||||
{
|
{
|
||||||
@@ -191,32 +176,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
set_property (GObject *object, guint prop_id,
|
|
||||||
const GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingMacvlan *setting = NM_SETTING_MACVLAN (object);
|
|
||||||
NMSettingMacvlanPrivate *priv = NM_SETTING_MACVLAN_GET_PRIVATE (setting);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_PARENT:
|
|
||||||
g_free (priv->parent);
|
|
||||||
priv->parent = g_value_dup_string (value);
|
|
||||||
break;
|
|
||||||
case PROP_MODE:
|
|
||||||
priv->mode = g_value_get_uint (value);
|
|
||||||
break;
|
|
||||||
case PROP_PROMISCUOUS:
|
|
||||||
priv->promiscuous = g_value_get_boolean (value);
|
|
||||||
break;
|
|
||||||
case PROP_TAP:
|
|
||||||
priv->tap = g_value_get_boolean (value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object, guint prop_id,
|
get_property (GObject *object, guint prop_id,
|
||||||
@@ -244,6 +204,55 @@ get_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
set_property (GObject *object, guint prop_id,
|
||||||
|
const GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMSettingMacvlan *setting = NM_SETTING_MACVLAN (object);
|
||||||
|
NMSettingMacvlanPrivate *priv = NM_SETTING_MACVLAN_GET_PRIVATE (setting);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_PARENT:
|
||||||
|
g_free (priv->parent);
|
||||||
|
priv->parent = g_value_dup_string (value);
|
||||||
|
break;
|
||||||
|
case PROP_MODE:
|
||||||
|
priv->mode = g_value_get_uint (value);
|
||||||
|
break;
|
||||||
|
case PROP_PROMISCUOUS:
|
||||||
|
priv->promiscuous = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
case PROP_TAP:
|
||||||
|
priv->tap = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
nm_setting_macvlan_init (NMSettingMacvlan *setting)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nm_setting_macvlan_new:
|
||||||
|
*
|
||||||
|
* Creates a new #NMSettingMacvlan object with default values.
|
||||||
|
*
|
||||||
|
* Returns: (transfer full): the new empty #NMSettingMacvlan object
|
||||||
|
*
|
||||||
|
* Since: 1.2
|
||||||
|
**/
|
||||||
|
NMSetting *
|
||||||
|
nm_setting_macvlan_new (void)
|
||||||
|
{
|
||||||
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_MACVLAN, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
finalize (GObject *object)
|
finalize (GObject *object)
|
||||||
{
|
{
|
||||||
@@ -263,8 +272,8 @@ nm_setting_macvlan_class_init (NMSettingMacvlanClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingMacvlanPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingMacvlanPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
#include "nm-setting-match.h"
|
#include "nm-setting-match.h"
|
||||||
|
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
#include "nm-utils-private.h"
|
#include "nm-utils-private.h"
|
||||||
|
|
||||||
@@ -24,6 +25,12 @@
|
|||||||
* @include: nm-setting-match.h
|
* @include: nm-setting-match.h
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingMatch,
|
||||||
|
PROP_INTERFACE_NAME,
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingMatch:
|
* NMSettingMatch:
|
||||||
*
|
*
|
||||||
@@ -42,10 +49,6 @@ struct _NMSettingMatchClass {
|
|||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingMatch, nm_setting_match, NM_TYPE_SETTING)
|
G_DEFINE_TYPE (NMSettingMatch, nm_setting_match, NM_TYPE_SETTING)
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingMatch,
|
|
||||||
PROP_INTERFACE_NAME,
|
|
||||||
);
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -194,6 +197,8 @@ nm_setting_match_get_interface_names (NMSettingMatch *setting, guint *length)
|
|||||||
return (const char *const *) setting->interface_name->pdata;
|
return (const char *const *) setting->interface_name->pdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object, guint prop_id,
|
get_property (GObject *object, guint prop_id,
|
||||||
GValue *value, GParamSpec *pspec)
|
GValue *value, GParamSpec *pspec)
|
||||||
@@ -227,6 +232,8 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_match_init (NMSettingMatch *setting)
|
nm_setting_match_init (NMSettingMatch *setting)
|
||||||
{
|
{
|
||||||
@@ -264,9 +271,9 @@ nm_setting_match_class_init (NMSettingMatchClass *klass)
|
|||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
|
||||||
object_class->finalize = finalize;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->set_property = set_property;
|
object_class->set_property = set_property;
|
||||||
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingMatch:interface-name
|
* NMSettingMatch:interface-name
|
||||||
|
@@ -22,9 +22,10 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-olpc-mesh.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "nm-setting-olpc-mesh.h"
|
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-utils-private.h"
|
#include "nm-utils-private.h"
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
@@ -37,17 +38,7 @@
|
|||||||
* necessary for connection to OLPC-Mesh devices.
|
* necessary for connection to OLPC-Mesh devices.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void nm_setting_olpc_mesh_init (NMSettingOlpcMesh *setting);
|
/*****************************************************************************/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingOlpcMesh, nm_setting_olpc_mesh, NM_TYPE_SETTING)
|
|
||||||
|
|
||||||
#define NM_SETTING_OLPC_MESH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_OLPC_MESH, NMSettingOlpcMeshPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
GBytes *ssid;
|
|
||||||
guint32 channel;
|
|
||||||
char *dhcp_anycast_addr;
|
|
||||||
} NMSettingOlpcMeshPrivate;
|
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_SSID,
|
PROP_SSID,
|
||||||
@@ -55,22 +46,17 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
|||||||
PROP_DHCP_ANYCAST_ADDRESS,
|
PROP_DHCP_ANYCAST_ADDRESS,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
typedef struct {
|
||||||
* nm_setting_olpc_mesh_new:
|
GBytes *ssid;
|
||||||
*
|
guint32 channel;
|
||||||
* Creates a new #NMSettingOlpcMesh object with default values.
|
char *dhcp_anycast_addr;
|
||||||
*
|
} NMSettingOlpcMeshPrivate;
|
||||||
* Returns: the new empty #NMSettingOlpcMesh object
|
|
||||||
**/
|
|
||||||
NMSetting *nm_setting_olpc_mesh_new (void)
|
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_OLPC_MESH, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
G_DEFINE_TYPE (NMSettingOlpcMesh, nm_setting_olpc_mesh, NM_TYPE_SETTING)
|
||||||
nm_setting_olpc_mesh_init (NMSettingOlpcMesh *setting)
|
|
||||||
{
|
#define NM_SETTING_OLPC_MESH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_OLPC_MESH, NMSettingOlpcMeshPrivate))
|
||||||
}
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_olpc_mesh_get_ssid:
|
* nm_setting_olpc_mesh_get_ssid:
|
||||||
@@ -149,16 +135,28 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
finalize (GObject *object)
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
NMSettingOlpcMeshPrivate *priv = NM_SETTING_OLPC_MESH_GET_PRIVATE (object);
|
NMSettingOlpcMesh *setting = NM_SETTING_OLPC_MESH (object);
|
||||||
|
|
||||||
if (priv->ssid)
|
switch (prop_id) {
|
||||||
g_bytes_unref (priv->ssid);
|
case PROP_SSID:
|
||||||
g_free (priv->dhcp_anycast_addr);
|
g_value_set_boxed (value, nm_setting_olpc_mesh_get_ssid (setting));
|
||||||
|
break;
|
||||||
G_OBJECT_CLASS (nm_setting_olpc_mesh_parent_class)->finalize (object);
|
case PROP_CHANNEL:
|
||||||
|
g_value_set_uint (value, nm_setting_olpc_mesh_get_channel (setting));
|
||||||
|
break;
|
||||||
|
case PROP_DHCP_ANYCAST_ADDRESS:
|
||||||
|
g_value_set_string (value, nm_setting_olpc_mesh_get_dhcp_anycast_address (setting));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -186,26 +184,35 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
get_property (GObject *object, guint prop_id,
|
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingOlpcMesh *setting = NM_SETTING_OLPC_MESH (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
static void
|
||||||
case PROP_SSID:
|
nm_setting_olpc_mesh_init (NMSettingOlpcMesh *setting)
|
||||||
g_value_set_boxed (value, nm_setting_olpc_mesh_get_ssid (setting));
|
{
|
||||||
break;
|
}
|
||||||
case PROP_CHANNEL:
|
|
||||||
g_value_set_uint (value, nm_setting_olpc_mesh_get_channel (setting));
|
/**
|
||||||
break;
|
* nm_setting_olpc_mesh_new:
|
||||||
case PROP_DHCP_ANYCAST_ADDRESS:
|
*
|
||||||
g_value_set_string (value, nm_setting_olpc_mesh_get_dhcp_anycast_address (setting));
|
* Creates a new #NMSettingOlpcMesh object with default values.
|
||||||
break;
|
*
|
||||||
default:
|
* Returns: the new empty #NMSettingOlpcMesh object
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
**/
|
||||||
break;
|
NMSetting *nm_setting_olpc_mesh_new (void)
|
||||||
}
|
{
|
||||||
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_OLPC_MESH, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
finalize (GObject *object)
|
||||||
|
{
|
||||||
|
NMSettingOlpcMeshPrivate *priv = NM_SETTING_OLPC_MESH_GET_PRIVATE (object);
|
||||||
|
|
||||||
|
if (priv->ssid)
|
||||||
|
g_bytes_unref (priv->ssid);
|
||||||
|
g_free (priv->dhcp_anycast_addr);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (nm_setting_olpc_mesh_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -217,8 +224,8 @@ nm_setting_olpc_mesh_class_init (NMSettingOlpcMeshClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingOlpcMeshPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingOlpcMeshPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -34,6 +34,8 @@
|
|||||||
* necessary for Open vSwitch bridges.
|
* necessary for Open vSwitch bridges.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_FAIL_MODE,
|
PROP_FAIL_MODE,
|
||||||
PROP_MCAST_SNOOPING_ENABLE,
|
PROP_MCAST_SNOOPING_ENABLE,
|
||||||
@@ -265,8 +267,8 @@ nm_setting_ovs_bridge_class_init (NMSettingOvsBridgeClass *klass)
|
|||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -33,6 +33,8 @@
|
|||||||
* necessary for Open vSwitch interfaces.
|
* necessary for Open vSwitch interfaces.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_TYPE,
|
PROP_TYPE,
|
||||||
);
|
);
|
||||||
@@ -364,8 +366,8 @@ nm_setting_ovs_interface_class_init (NMSettingOvsInterfaceClass *klass)
|
|||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -34,6 +34,8 @@
|
|||||||
* necessary for Open vSwitch interfaces of type "patch".
|
* necessary for Open vSwitch interfaces of type "patch".
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_PEER,
|
PROP_PEER,
|
||||||
);
|
);
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
#include "nm-setting-ppp.h"
|
#include "nm-setting-ppp.h"
|
||||||
|
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -35,30 +36,7 @@
|
|||||||
* cable and DSL modems and some mobile broadband devices.
|
* cable and DSL modems and some mobile broadband devices.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingPpp, nm_setting_ppp, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_PPP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_PPP, NMSettingPppPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
gboolean noauth;
|
|
||||||
gboolean refuse_eap;
|
|
||||||
gboolean refuse_pap;
|
|
||||||
gboolean refuse_chap;
|
|
||||||
gboolean refuse_mschap;
|
|
||||||
gboolean refuse_mschapv2;
|
|
||||||
gboolean nobsdcomp;
|
|
||||||
gboolean nodeflate;
|
|
||||||
gboolean no_vj_comp;
|
|
||||||
gboolean require_mppe;
|
|
||||||
gboolean require_mppe_128;
|
|
||||||
gboolean mppe_stateful;
|
|
||||||
gboolean crtscts;
|
|
||||||
guint32 baud;
|
|
||||||
guint32 mru;
|
|
||||||
guint32 mtu;
|
|
||||||
guint32 lcp_echo_failure;
|
|
||||||
guint32 lcp_echo_interval;
|
|
||||||
} NMSettingPppPrivate;
|
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_NOAUTH,
|
PROP_NOAUTH,
|
||||||
@@ -81,18 +59,32 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
|||||||
PROP_LCP_ECHO_INTERVAL,
|
PROP_LCP_ECHO_INTERVAL,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
typedef struct {
|
||||||
* nm_setting_ppp_new:
|
gboolean noauth;
|
||||||
*
|
gboolean refuse_eap;
|
||||||
* Creates a new #NMSettingPpp object with default values.
|
gboolean refuse_pap;
|
||||||
*
|
gboolean refuse_chap;
|
||||||
* Returns: (transfer full): the new empty #NMSettingPpp object
|
gboolean refuse_mschap;
|
||||||
**/
|
gboolean refuse_mschapv2;
|
||||||
NMSetting *
|
gboolean nobsdcomp;
|
||||||
nm_setting_ppp_new (void)
|
gboolean nodeflate;
|
||||||
{
|
gboolean no_vj_comp;
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_PPP, NULL);
|
gboolean require_mppe;
|
||||||
}
|
gboolean require_mppe_128;
|
||||||
|
gboolean mppe_stateful;
|
||||||
|
gboolean crtscts;
|
||||||
|
guint32 baud;
|
||||||
|
guint32 mru;
|
||||||
|
guint32 mtu;
|
||||||
|
guint32 lcp_echo_failure;
|
||||||
|
guint32 lcp_echo_interval;
|
||||||
|
} NMSettingPppPrivate;
|
||||||
|
|
||||||
|
G_DEFINE_TYPE (NMSettingPpp, nm_setting_ppp, NM_TYPE_SETTING)
|
||||||
|
|
||||||
|
#define NM_SETTING_PPP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_PPP, NMSettingPppPrivate))
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_ppp_get_noauth:
|
* nm_setting_ppp_get_noauth:
|
||||||
@@ -380,77 +372,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
nm_setting_ppp_init (NMSettingPpp *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
set_property (GObject *object, guint prop_id,
|
|
||||||
const GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingPppPrivate *priv = NM_SETTING_PPP_GET_PRIVATE (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_NOAUTH:
|
|
||||||
priv->noauth = g_value_get_boolean (value);
|
|
||||||
break;
|
|
||||||
case PROP_REFUSE_EAP:
|
|
||||||
priv->refuse_eap = g_value_get_boolean (value);
|
|
||||||
break;
|
|
||||||
case PROP_REFUSE_PAP:
|
|
||||||
priv->refuse_pap = g_value_get_boolean (value);
|
|
||||||
break;
|
|
||||||
case PROP_REFUSE_CHAP:
|
|
||||||
priv->refuse_chap = g_value_get_boolean (value);
|
|
||||||
break;
|
|
||||||
case PROP_REFUSE_MSCHAP:
|
|
||||||
priv->refuse_mschap = g_value_get_boolean (value);
|
|
||||||
break;
|
|
||||||
case PROP_REFUSE_MSCHAPV2:
|
|
||||||
priv->refuse_mschapv2 = g_value_get_boolean (value);
|
|
||||||
break;
|
|
||||||
case PROP_NOBSDCOMP:
|
|
||||||
priv->nobsdcomp = g_value_get_boolean (value);
|
|
||||||
break;
|
|
||||||
case PROP_NODEFLATE:
|
|
||||||
priv->nodeflate = g_value_get_boolean (value);
|
|
||||||
break;
|
|
||||||
case PROP_NO_VJ_COMP:
|
|
||||||
priv->no_vj_comp = g_value_get_boolean (value);
|
|
||||||
break;
|
|
||||||
case PROP_REQUIRE_MPPE:
|
|
||||||
priv->require_mppe = g_value_get_boolean (value);
|
|
||||||
break;
|
|
||||||
case PROP_REQUIRE_MPPE_128:
|
|
||||||
priv->require_mppe_128 = g_value_get_boolean (value);
|
|
||||||
break;
|
|
||||||
case PROP_MPPE_STATEFUL:
|
|
||||||
priv->mppe_stateful = g_value_get_boolean (value);
|
|
||||||
break;
|
|
||||||
case PROP_CRTSCTS:
|
|
||||||
priv->crtscts = g_value_get_boolean (value);
|
|
||||||
break;
|
|
||||||
case PROP_BAUD:
|
|
||||||
priv->baud = g_value_get_uint (value);
|
|
||||||
break;
|
|
||||||
case PROP_MRU:
|
|
||||||
priv->mru = g_value_get_uint (value);
|
|
||||||
break;
|
|
||||||
case PROP_MTU:
|
|
||||||
priv->mtu = g_value_get_uint (value);
|
|
||||||
break;
|
|
||||||
case PROP_LCP_ECHO_FAILURE:
|
|
||||||
priv->lcp_echo_failure = g_value_get_uint (value);
|
|
||||||
break;
|
|
||||||
case PROP_LCP_ECHO_INTERVAL:
|
|
||||||
priv->lcp_echo_interval = g_value_get_uint (value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object, guint prop_id,
|
get_property (GObject *object, guint prop_id,
|
||||||
@@ -519,6 +441,93 @@ get_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
set_property (GObject *object, guint prop_id,
|
||||||
|
const GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMSettingPppPrivate *priv = NM_SETTING_PPP_GET_PRIVATE (object);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_NOAUTH:
|
||||||
|
priv->noauth = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
case PROP_REFUSE_EAP:
|
||||||
|
priv->refuse_eap = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
case PROP_REFUSE_PAP:
|
||||||
|
priv->refuse_pap = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
case PROP_REFUSE_CHAP:
|
||||||
|
priv->refuse_chap = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
case PROP_REFUSE_MSCHAP:
|
||||||
|
priv->refuse_mschap = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
case PROP_REFUSE_MSCHAPV2:
|
||||||
|
priv->refuse_mschapv2 = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
case PROP_NOBSDCOMP:
|
||||||
|
priv->nobsdcomp = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
case PROP_NODEFLATE:
|
||||||
|
priv->nodeflate = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
case PROP_NO_VJ_COMP:
|
||||||
|
priv->no_vj_comp = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
case PROP_REQUIRE_MPPE:
|
||||||
|
priv->require_mppe = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
case PROP_REQUIRE_MPPE_128:
|
||||||
|
priv->require_mppe_128 = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
case PROP_MPPE_STATEFUL:
|
||||||
|
priv->mppe_stateful = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
case PROP_CRTSCTS:
|
||||||
|
priv->crtscts = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
case PROP_BAUD:
|
||||||
|
priv->baud = g_value_get_uint (value);
|
||||||
|
break;
|
||||||
|
case PROP_MRU:
|
||||||
|
priv->mru = g_value_get_uint (value);
|
||||||
|
break;
|
||||||
|
case PROP_MTU:
|
||||||
|
priv->mtu = g_value_get_uint (value);
|
||||||
|
break;
|
||||||
|
case PROP_LCP_ECHO_FAILURE:
|
||||||
|
priv->lcp_echo_failure = g_value_get_uint (value);
|
||||||
|
break;
|
||||||
|
case PROP_LCP_ECHO_INTERVAL:
|
||||||
|
priv->lcp_echo_interval = g_value_get_uint (value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
nm_setting_ppp_init (NMSettingPpp *setting)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nm_setting_ppp_new:
|
||||||
|
*
|
||||||
|
* Creates a new #NMSettingPpp object with default values.
|
||||||
|
*
|
||||||
|
* Returns: (transfer full): the new empty #NMSettingPpp object
|
||||||
|
**/
|
||||||
|
NMSetting *
|
||||||
|
nm_setting_ppp_new (void)
|
||||||
|
{
|
||||||
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_PPP, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_ppp_class_init (NMSettingPppClass *klass)
|
nm_setting_ppp_class_init (NMSettingPppClass *klass)
|
||||||
{
|
{
|
||||||
@@ -527,8 +536,8 @@ nm_setting_ppp_class_init (NMSettingPppClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingPppPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingPppPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
|
||||||
|
@@ -22,9 +22,10 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-pppoe.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "nm-setting-pppoe.h"
|
|
||||||
#include "nm-setting-ppp.h"
|
#include "nm-setting-ppp.h"
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
#include "nm-core-enum-types.h"
|
#include "nm-core-enum-types.h"
|
||||||
@@ -38,17 +39,7 @@
|
|||||||
* to provide IP transport, for example cable or DSL modems.
|
* to provide IP transport, for example cable or DSL modems.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingPppoe, nm_setting_pppoe, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_PPPOE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_PPPOE, NMSettingPppoePrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char *parent;
|
|
||||||
char *service;
|
|
||||||
char *username;
|
|
||||||
char *password;
|
|
||||||
NMSettingSecretFlags password_flags;
|
|
||||||
} NMSettingPppoePrivate;
|
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_PARENT,
|
PROP_PARENT,
|
||||||
@@ -58,18 +49,19 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
|||||||
PROP_PASSWORD_FLAGS,
|
PROP_PASSWORD_FLAGS,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
typedef struct {
|
||||||
* nm_setting_pppoe_new:
|
char *parent;
|
||||||
*
|
char *service;
|
||||||
* Creates a new #NMSettingPppoe object with default values.
|
char *username;
|
||||||
*
|
char *password;
|
||||||
* Returns: (transfer full): the new empty #NMSettingPppoe object
|
NMSettingSecretFlags password_flags;
|
||||||
**/
|
} NMSettingPppoePrivate;
|
||||||
NMSetting *
|
|
||||||
nm_setting_pppoe_new (void)
|
G_DEFINE_TYPE (NMSettingPppoe, nm_setting_pppoe, NM_TYPE_SETTING)
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_PPPOE, NULL);
|
#define NM_SETTING_PPPOE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_PPPOE, NMSettingPppoePrivate))
|
||||||
}
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_pppoe_get_parent:
|
* nm_setting_pppoe_get_parent:
|
||||||
@@ -204,9 +196,34 @@ need_secrets (NMSetting *setting)
|
|||||||
return secrets;
|
return secrets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_pppoe_init (NMSettingPppoe *setting)
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
|
NMSettingPppoe *setting = NM_SETTING_PPPOE (object);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_PARENT:
|
||||||
|
g_value_set_string (value, nm_setting_pppoe_get_parent (setting));
|
||||||
|
break;
|
||||||
|
case PROP_SERVICE:
|
||||||
|
g_value_set_string (value, nm_setting_pppoe_get_service (setting));
|
||||||
|
break;
|
||||||
|
case PROP_USERNAME:
|
||||||
|
g_value_set_string (value, nm_setting_pppoe_get_username (setting));
|
||||||
|
break;
|
||||||
|
case PROP_PASSWORD:
|
||||||
|
g_value_set_string (value, nm_setting_pppoe_get_password (setting));
|
||||||
|
break;
|
||||||
|
case PROP_PASSWORD_FLAGS:
|
||||||
|
g_value_set_flags (value, nm_setting_pppoe_get_password_flags (setting));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -241,32 +258,24 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
get_property (GObject *object, guint prop_id,
|
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingPppoe *setting = NM_SETTING_PPPOE (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
static void
|
||||||
case PROP_PARENT:
|
nm_setting_pppoe_init (NMSettingPppoe *setting)
|
||||||
g_value_set_string (value, nm_setting_pppoe_get_parent (setting));
|
{
|
||||||
break;
|
}
|
||||||
case PROP_SERVICE:
|
|
||||||
g_value_set_string (value, nm_setting_pppoe_get_service (setting));
|
/**
|
||||||
break;
|
* nm_setting_pppoe_new:
|
||||||
case PROP_USERNAME:
|
*
|
||||||
g_value_set_string (value, nm_setting_pppoe_get_username (setting));
|
* Creates a new #NMSettingPppoe object with default values.
|
||||||
break;
|
*
|
||||||
case PROP_PASSWORD:
|
* Returns: (transfer full): the new empty #NMSettingPppoe object
|
||||||
g_value_set_string (value, nm_setting_pppoe_get_password (setting));
|
**/
|
||||||
break;
|
NMSetting *
|
||||||
case PROP_PASSWORD_FLAGS:
|
nm_setting_pppoe_new (void)
|
||||||
g_value_set_flags (value, nm_setting_pppoe_get_password_flags (setting));
|
{
|
||||||
break;
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_PPPOE, NULL);
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -290,8 +299,8 @@ nm_setting_pppoe_class_init (NMSettingPppoeClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingPppoePrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingPppoePrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
#include "nm-setting-proxy.h"
|
#include "nm-setting-proxy.h"
|
||||||
|
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
|
|
||||||
@@ -39,16 +40,7 @@
|
|||||||
* to fulfill client queries.
|
* to fulfill client queries.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingProxy, nm_setting_proxy, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_PROXY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_PROXY, NMSettingProxyPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
NMSettingProxyMethod method;
|
|
||||||
gboolean browser_only;
|
|
||||||
char *pac_url;
|
|
||||||
char *pac_script;
|
|
||||||
} NMSettingProxyPrivate;
|
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_METHOD,
|
PROP_METHOD,
|
||||||
@@ -57,20 +49,18 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
|||||||
PROP_PAC_SCRIPT,
|
PROP_PAC_SCRIPT,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
typedef struct {
|
||||||
* nm_setting_proxy_new:
|
NMSettingProxyMethod method;
|
||||||
*
|
gboolean browser_only;
|
||||||
* Creates a new #NMSettingProxy object.
|
char *pac_url;
|
||||||
*
|
char *pac_script;
|
||||||
* Returns: the new empty #NMSettingProxy object
|
} NMSettingProxyPrivate;
|
||||||
*
|
|
||||||
* Since: 1.6
|
G_DEFINE_TYPE (NMSettingProxy, nm_setting_proxy, NM_TYPE_SETTING)
|
||||||
**/
|
|
||||||
NMSetting *
|
#define NM_SETTING_PROXY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_PROXY, NMSettingProxyPrivate))
|
||||||
nm_setting_proxy_new (void)
|
|
||||||
{
|
/*****************************************************************************/
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_PROXY, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_proxy_get_method:
|
* nm_setting_proxy_get_method:
|
||||||
@@ -210,22 +200,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
nm_setting_proxy_init (NMSettingProxy *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
finalize (GObject *object)
|
|
||||||
{
|
|
||||||
NMSettingProxy *self = NM_SETTING_PROXY (object);
|
|
||||||
NMSettingProxyPrivate *priv = NM_SETTING_PROXY_GET_PRIVATE (self);
|
|
||||||
|
|
||||||
g_free (priv->pac_url);
|
|
||||||
g_free (priv->pac_script);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_setting_proxy_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object, guint prop_id,
|
get_property (GObject *object, guint prop_id,
|
||||||
@@ -279,6 +254,40 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
nm_setting_proxy_init (NMSettingProxy *setting)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nm_setting_proxy_new:
|
||||||
|
*
|
||||||
|
* Creates a new #NMSettingProxy object.
|
||||||
|
*
|
||||||
|
* Returns: the new empty #NMSettingProxy object
|
||||||
|
*
|
||||||
|
* Since: 1.6
|
||||||
|
**/
|
||||||
|
NMSetting *
|
||||||
|
nm_setting_proxy_new (void)
|
||||||
|
{
|
||||||
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_PROXY, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
finalize (GObject *object)
|
||||||
|
{
|
||||||
|
NMSettingProxy *self = NM_SETTING_PROXY (object);
|
||||||
|
NMSettingProxyPrivate *priv = NM_SETTING_PROXY_GET_PRIVATE (self);
|
||||||
|
|
||||||
|
g_free (priv->pac_url);
|
||||||
|
g_free (priv->pac_script);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (nm_setting_proxy_parent_class)->finalize (object);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_proxy_class_init (NMSettingProxyClass *klass)
|
nm_setting_proxy_class_init (NMSettingProxyClass *klass)
|
||||||
{
|
{
|
||||||
@@ -287,8 +296,8 @@ nm_setting_proxy_class_init (NMSettingProxyClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingProxyPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingProxyPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -22,9 +22,10 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-serial.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "nm-setting-serial.h"
|
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,17 +38,7 @@
|
|||||||
* such as mobile broadband or analog telephone connections.
|
* such as mobile broadband or analog telephone connections.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingSerial, nm_setting_serial, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_SERIAL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_SERIAL, NMSettingSerialPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
guint baud;
|
|
||||||
guint bits;
|
|
||||||
char parity;
|
|
||||||
guint stopbits;
|
|
||||||
guint64 send_delay;
|
|
||||||
} NMSettingSerialPrivate;
|
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_BAUD,
|
PROP_BAUD,
|
||||||
@@ -57,18 +48,19 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
|||||||
PROP_SEND_DELAY,
|
PROP_SEND_DELAY,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
typedef struct {
|
||||||
* nm_setting_serial_new:
|
guint baud;
|
||||||
*
|
guint bits;
|
||||||
* Creates a new #NMSettingSerial object with default values.
|
char parity;
|
||||||
*
|
guint stopbits;
|
||||||
* Returns: (transfer full): the new empty #NMSettingSerial object
|
guint64 send_delay;
|
||||||
**/
|
} NMSettingSerialPrivate;
|
||||||
NMSetting *
|
|
||||||
nm_setting_serial_new (void)
|
G_DEFINE_TYPE (NMSettingSerial, nm_setting_serial, NM_TYPE_SETTING)
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_SERIAL, NULL);
|
#define NM_SETTING_SERIAL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_SERIAL, NMSettingSerialPrivate))
|
||||||
}
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_serial_get_baud:
|
* nm_setting_serial_get_baud:
|
||||||
@@ -140,11 +132,6 @@ nm_setting_serial_get_send_delay (NMSettingSerial *setting)
|
|||||||
return NM_SETTING_SERIAL_GET_PRIVATE (setting)->send_delay;
|
return NM_SETTING_SERIAL_GET_PRIVATE (setting)->send_delay;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
nm_setting_serial_init (NMSettingSerial *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static GVariant *
|
static GVariant *
|
||||||
parity_to_dbus (const GValue *from)
|
parity_to_dbus (const GValue *from)
|
||||||
{
|
{
|
||||||
@@ -176,6 +163,36 @@ parity_from_dbus (GVariant *from, GValue *to)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMSettingSerial *setting = NM_SETTING_SERIAL (object);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_BAUD:
|
||||||
|
g_value_set_uint (value, nm_setting_serial_get_baud (setting));
|
||||||
|
break;
|
||||||
|
case PROP_BITS:
|
||||||
|
g_value_set_uint (value, nm_setting_serial_get_bits (setting));
|
||||||
|
break;
|
||||||
|
case PROP_PARITY:
|
||||||
|
g_value_set_enum (value, nm_setting_serial_get_parity (setting));
|
||||||
|
break;
|
||||||
|
case PROP_STOPBITS:
|
||||||
|
g_value_set_uint (value, nm_setting_serial_get_stopbits (setting));
|
||||||
|
break;
|
||||||
|
case PROP_SEND_DELAY:
|
||||||
|
g_value_set_uint64 (value, nm_setting_serial_get_send_delay (setting));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_property (GObject *object, guint prop_id,
|
set_property (GObject *object, guint prop_id,
|
||||||
const GValue *value, GParamSpec *pspec)
|
const GValue *value, GParamSpec *pspec)
|
||||||
@@ -204,32 +221,24 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
get_property (GObject *object, guint prop_id,
|
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingSerial *setting = NM_SETTING_SERIAL (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
static void
|
||||||
case PROP_BAUD:
|
nm_setting_serial_init (NMSettingSerial *setting)
|
||||||
g_value_set_uint (value, nm_setting_serial_get_baud (setting));
|
{
|
||||||
break;
|
}
|
||||||
case PROP_BITS:
|
|
||||||
g_value_set_uint (value, nm_setting_serial_get_bits (setting));
|
/**
|
||||||
break;
|
* nm_setting_serial_new:
|
||||||
case PROP_PARITY:
|
*
|
||||||
g_value_set_enum (value, nm_setting_serial_get_parity (setting));
|
* Creates a new #NMSettingSerial object with default values.
|
||||||
break;
|
*
|
||||||
case PROP_STOPBITS:
|
* Returns: (transfer full): the new empty #NMSettingSerial object
|
||||||
g_value_set_uint (value, nm_setting_serial_get_stopbits (setting));
|
**/
|
||||||
break;
|
NMSetting *
|
||||||
case PROP_SEND_DELAY:
|
nm_setting_serial_new (void)
|
||||||
g_value_set_uint64 (value, nm_setting_serial_get_send_delay (setting));
|
{
|
||||||
break;
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_SERIAL, NULL);
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -241,8 +250,8 @@ nm_setting_serial_class_init (NMSettingSerialClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingSerialPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingSerialPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingSerial:baud:
|
* NMSettingSerial:baud:
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
#include "nm-setting-sriov.h"
|
#include "nm-setting-sriov.h"
|
||||||
|
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
#include "nm-utils-private.h"
|
#include "nm-utils-private.h"
|
||||||
|
|
||||||
@@ -24,6 +25,14 @@
|
|||||||
* @include: nm-setting-sriov.h
|
* @include: nm-setting-sriov.h
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingSriov,
|
||||||
|
PROP_TOTAL_VFS,
|
||||||
|
PROP_VFS,
|
||||||
|
PROP_AUTOPROBE_DRIVERS,
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingSriov:
|
* NMSettingSriov:
|
||||||
*
|
*
|
||||||
@@ -44,12 +53,6 @@ struct _NMSettingSriovClass {
|
|||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingSriov, nm_setting_sriov, NM_TYPE_SETTING)
|
G_DEFINE_TYPE (NMSettingSriov, nm_setting_sriov, NM_TYPE_SETTING)
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingSriov,
|
|
||||||
PROP_TOTAL_VFS,
|
|
||||||
PROP_VFS,
|
|
||||||
PROP_AUTOPROBE_DRIVERS,
|
|
||||||
);
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
G_DEFINE_BOXED_TYPE (NMSriovVF, nm_sriov_vf, nm_sriov_vf_dup, nm_sriov_vf_unref)
|
G_DEFINE_BOXED_TYPE (NMSriovVF, nm_sriov_vf, nm_sriov_vf_dup, nm_sriov_vf_unref)
|
||||||
@@ -701,21 +704,6 @@ nm_sriov_vf_get_vlan_protocol (const NMSriovVF *vf, guint vlan_id)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
|
||||||
* nm_setting_sriov_new:
|
|
||||||
*
|
|
||||||
* Creates a new #NMSettingSriov object with default values.
|
|
||||||
*
|
|
||||||
* Returns: (transfer full): the new empty #NMSettingSriov object
|
|
||||||
*
|
|
||||||
* Since: 1.14
|
|
||||||
**/
|
|
||||||
NMSetting *
|
|
||||||
nm_setting_sriov_new (void)
|
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_SRIOV, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_sriov_get_total_vfs:
|
* nm_setting_sriov_get_total_vfs:
|
||||||
* @setting: the #NMSettingSriov
|
* @setting: the #NMSettingSriov
|
||||||
@@ -1136,55 +1124,6 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
set_property (GObject *object, guint prop_id,
|
|
||||||
const GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingSriov *self = NM_SETTING_SRIOV (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_TOTAL_VFS:
|
|
||||||
self->total_vfs = g_value_get_uint (value);
|
|
||||||
break;
|
|
||||||
case PROP_VFS:
|
|
||||||
g_ptr_array_unref (self->vfs);
|
|
||||||
self->vfs = _nm_utils_copy_array (g_value_get_boxed (value),
|
|
||||||
(NMUtilsCopyFunc) nm_sriov_vf_dup,
|
|
||||||
(GDestroyNotify) nm_sriov_vf_unref);
|
|
||||||
break;
|
|
||||||
case PROP_AUTOPROBE_DRIVERS:
|
|
||||||
self->autoprobe_drivers = g_value_get_enum (value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
get_property (GObject *object, guint prop_id,
|
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingSriov *self = NM_SETTING_SRIOV (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_TOTAL_VFS:
|
|
||||||
g_value_set_uint (value, self->total_vfs);
|
|
||||||
break;
|
|
||||||
case PROP_VFS:
|
|
||||||
g_value_take_boxed (value, _nm_utils_copy_array (self->vfs,
|
|
||||||
(NMUtilsCopyFunc) nm_sriov_vf_dup,
|
|
||||||
(GDestroyNotify) nm_sriov_vf_unref));
|
|
||||||
break;
|
|
||||||
case PROP_AUTOPROBE_DRIVERS:
|
|
||||||
g_value_set_enum (value, self->autoprobe_drivers);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static NMTernary
|
static NMTernary
|
||||||
compare_property (const NMSettInfoSetting *sett_info,
|
compare_property (const NMSettInfoSetting *sett_info,
|
||||||
guint property_idx,
|
guint property_idx,
|
||||||
@@ -1218,12 +1157,80 @@ compare_property (const NMSettInfoSetting *sett_info,
|
|||||||
flags);
|
flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMSettingSriov *self = NM_SETTING_SRIOV (object);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_TOTAL_VFS:
|
||||||
|
g_value_set_uint (value, self->total_vfs);
|
||||||
|
break;
|
||||||
|
case PROP_VFS:
|
||||||
|
g_value_take_boxed (value, _nm_utils_copy_array (self->vfs,
|
||||||
|
(NMUtilsCopyFunc) nm_sriov_vf_dup,
|
||||||
|
(GDestroyNotify) nm_sriov_vf_unref));
|
||||||
|
break;
|
||||||
|
case PROP_AUTOPROBE_DRIVERS:
|
||||||
|
g_value_set_enum (value, self->autoprobe_drivers);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
set_property (GObject *object, guint prop_id,
|
||||||
|
const GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMSettingSriov *self = NM_SETTING_SRIOV (object);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_TOTAL_VFS:
|
||||||
|
self->total_vfs = g_value_get_uint (value);
|
||||||
|
break;
|
||||||
|
case PROP_VFS:
|
||||||
|
g_ptr_array_unref (self->vfs);
|
||||||
|
self->vfs = _nm_utils_copy_array (g_value_get_boxed (value),
|
||||||
|
(NMUtilsCopyFunc) nm_sriov_vf_dup,
|
||||||
|
(GDestroyNotify) nm_sriov_vf_unref);
|
||||||
|
break;
|
||||||
|
case PROP_AUTOPROBE_DRIVERS:
|
||||||
|
self->autoprobe_drivers = g_value_get_enum (value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_sriov_init (NMSettingSriov *setting)
|
nm_setting_sriov_init (NMSettingSriov *setting)
|
||||||
{
|
{
|
||||||
setting->vfs = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_sriov_vf_unref);
|
setting->vfs = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_sriov_vf_unref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nm_setting_sriov_new:
|
||||||
|
*
|
||||||
|
* Creates a new #NMSettingSriov object with default values.
|
||||||
|
*
|
||||||
|
* Returns: (transfer full): the new empty #NMSettingSriov object
|
||||||
|
*
|
||||||
|
* Since: 1.14
|
||||||
|
**/
|
||||||
|
NMSetting *
|
||||||
|
nm_setting_sriov_new (void)
|
||||||
|
{
|
||||||
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_SRIOV, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
finalize (GObject *object)
|
finalize (GObject *object)
|
||||||
{
|
{
|
||||||
|
@@ -19,9 +19,10 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-tc-config.h"
|
||||||
|
|
||||||
#include <linux/pkt_sched.h>
|
#include <linux/pkt_sched.h>
|
||||||
|
|
||||||
#include "nm-setting-tc-config.h"
|
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -833,20 +834,7 @@ struct _NMSettingTCConfigClass {
|
|||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingTCConfig, nm_setting_tc_config, NM_TYPE_SETTING)
|
G_DEFINE_TYPE (NMSettingTCConfig, nm_setting_tc_config, NM_TYPE_SETTING)
|
||||||
|
|
||||||
/**
|
/*****************************************************************************/
|
||||||
* nm_setting_tc_config_new:
|
|
||||||
*
|
|
||||||
* Creates a new #NMSettingTCConfig object with default values.
|
|
||||||
*
|
|
||||||
* Returns: (transfer full): the new empty #NMSettingTCConfig object
|
|
||||||
*
|
|
||||||
* Since: 1.12
|
|
||||||
**/
|
|
||||||
NMSetting *
|
|
||||||
nm_setting_tc_config_new (void)
|
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_TC_CONFIG, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_tc_config_get_num_qdiscs:
|
* nm_setting_tc_config_get_num_qdiscs:
|
||||||
@@ -1122,65 +1110,6 @@ nm_setting_tc_config_clear_tfilters (NMSettingTCConfig *self)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
|
||||||
set_property (GObject *object, guint prop_id,
|
|
||||||
const GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingTCConfig *self = NM_SETTING_TC_CONFIG (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_QDISCS:
|
|
||||||
g_ptr_array_unref (self->qdiscs);
|
|
||||||
self->qdiscs = _nm_utils_copy_array (g_value_get_boxed (value),
|
|
||||||
(NMUtilsCopyFunc) nm_tc_qdisc_dup,
|
|
||||||
(GDestroyNotify) nm_tc_qdisc_unref);
|
|
||||||
break;
|
|
||||||
case PROP_TFILTERS:
|
|
||||||
g_ptr_array_unref (self->tfilters);
|
|
||||||
self->tfilters = _nm_utils_copy_array (g_value_get_boxed (value),
|
|
||||||
(NMUtilsCopyFunc) nm_tc_tfilter_dup,
|
|
||||||
(GDestroyNotify) nm_tc_tfilter_unref);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
get_property (GObject *object, guint prop_id,
|
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingTCConfig *self = NM_SETTING_TC_CONFIG (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_QDISCS:
|
|
||||||
g_value_take_boxed (value, _nm_utils_copy_array (self->qdiscs,
|
|
||||||
(NMUtilsCopyFunc) nm_tc_qdisc_dup,
|
|
||||||
(GDestroyNotify) nm_tc_qdisc_unref));
|
|
||||||
break;
|
|
||||||
case PROP_TFILTERS:
|
|
||||||
g_value_take_boxed (value, _nm_utils_copy_array (self->tfilters,
|
|
||||||
(NMUtilsCopyFunc) nm_tc_tfilter_dup,
|
|
||||||
(GDestroyNotify) nm_tc_tfilter_unref));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
finalize (GObject *object)
|
|
||||||
{
|
|
||||||
NMSettingTCConfig *self = NM_SETTING_TC_CONFIG (object);
|
|
||||||
|
|
||||||
g_ptr_array_unref (self->qdiscs);
|
|
||||||
g_ptr_array_unref (self->tfilters);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_setting_tc_config_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
verify (NMSetting *setting, NMConnection *connection, GError **error)
|
verify (NMSetting *setting, NMConnection *connection, GError **error)
|
||||||
{
|
{
|
||||||
@@ -1272,13 +1201,6 @@ compare_property (const NMSettInfoSetting *sett_info,
|
|||||||
flags);
|
flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
nm_setting_tc_config_init (NMSettingTCConfig *self)
|
|
||||||
{
|
|
||||||
self->qdiscs = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_tc_qdisc_unref);
|
|
||||||
self->tfilters = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_tc_tfilter_unref);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* _qdiscs_to_variant:
|
* _qdiscs_to_variant:
|
||||||
* @qdiscs: (element-type NMTCQdisc): an array of #NMTCQdisc objects
|
* @qdiscs: (element-type NMTCQdisc): an array of #NMTCQdisc objects
|
||||||
@@ -1590,6 +1512,91 @@ tc_tfilters_set (NMSetting *setting,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMSettingTCConfig *self = NM_SETTING_TC_CONFIG (object);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_QDISCS:
|
||||||
|
g_value_take_boxed (value, _nm_utils_copy_array (self->qdiscs,
|
||||||
|
(NMUtilsCopyFunc) nm_tc_qdisc_dup,
|
||||||
|
(GDestroyNotify) nm_tc_qdisc_unref));
|
||||||
|
break;
|
||||||
|
case PROP_TFILTERS:
|
||||||
|
g_value_take_boxed (value, _nm_utils_copy_array (self->tfilters,
|
||||||
|
(NMUtilsCopyFunc) nm_tc_tfilter_dup,
|
||||||
|
(GDestroyNotify) nm_tc_tfilter_unref));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
set_property (GObject *object, guint prop_id,
|
||||||
|
const GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMSettingTCConfig *self = NM_SETTING_TC_CONFIG (object);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_QDISCS:
|
||||||
|
g_ptr_array_unref (self->qdiscs);
|
||||||
|
self->qdiscs = _nm_utils_copy_array (g_value_get_boxed (value),
|
||||||
|
(NMUtilsCopyFunc) nm_tc_qdisc_dup,
|
||||||
|
(GDestroyNotify) nm_tc_qdisc_unref);
|
||||||
|
break;
|
||||||
|
case PROP_TFILTERS:
|
||||||
|
g_ptr_array_unref (self->tfilters);
|
||||||
|
self->tfilters = _nm_utils_copy_array (g_value_get_boxed (value),
|
||||||
|
(NMUtilsCopyFunc) nm_tc_tfilter_dup,
|
||||||
|
(GDestroyNotify) nm_tc_tfilter_unref);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
nm_setting_tc_config_init (NMSettingTCConfig *self)
|
||||||
|
{
|
||||||
|
self->qdiscs = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_tc_qdisc_unref);
|
||||||
|
self->tfilters = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_tc_tfilter_unref);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nm_setting_tc_config_new:
|
||||||
|
*
|
||||||
|
* Creates a new #NMSettingTCConfig object with default values.
|
||||||
|
*
|
||||||
|
* Returns: (transfer full): the new empty #NMSettingTCConfig object
|
||||||
|
*
|
||||||
|
* Since: 1.12
|
||||||
|
**/
|
||||||
|
NMSetting *
|
||||||
|
nm_setting_tc_config_new (void)
|
||||||
|
{
|
||||||
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_TC_CONFIG, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
finalize (GObject *object)
|
||||||
|
{
|
||||||
|
NMSettingTCConfig *self = NM_SETTING_TC_CONFIG (object);
|
||||||
|
|
||||||
|
g_ptr_array_unref (self->qdiscs);
|
||||||
|
g_ptr_array_unref (self->tfilters);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (nm_setting_tc_config_parent_class)->finalize (object);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_tc_config_class_init (NMSettingTCConfigClass *klass)
|
nm_setting_tc_config_class_init (NMSettingTCConfigClass *klass)
|
||||||
{
|
{
|
||||||
@@ -1597,8 +1604,8 @@ nm_setting_tc_config_class_init (NMSettingTCConfigClass *klass)
|
|||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->compare_property = compare_property;
|
setting_class->compare_property = compare_property;
|
||||||
|
@@ -21,11 +21,12 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-team-port.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "nm-setting-team-port.h"
|
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-utils-private.h"
|
#include "nm-utils-private.h"
|
||||||
#include "nm-connection-private.h"
|
#include "nm-connection-private.h"
|
||||||
@@ -39,19 +40,7 @@
|
|||||||
* optional properties that apply to team ports.
|
* optional properties that apply to team ports.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingTeamPort, nm_setting_team_port, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_TEAM_PORT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_TEAM_PORT, NMSettingTeamPortPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char *config;
|
|
||||||
int queue_id;
|
|
||||||
int prio;
|
|
||||||
gboolean sticky;
|
|
||||||
int lacp_prio;
|
|
||||||
int lacp_key;
|
|
||||||
GPtrArray *link_watchers; /* Array of NMTeamLinkWatcher */
|
|
||||||
} NMSettingTeamPortPrivate;
|
|
||||||
|
|
||||||
/* Keep aligned with _prop_to_keys[] */
|
/* Keep aligned with _prop_to_keys[] */
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingTeamPort,
|
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingTeamPort,
|
||||||
@@ -75,18 +64,21 @@ static const _NMUtilsTeamPropertyKeys _prop_to_keys[_PROPERTY_ENUMS_LAST] = {
|
|||||||
[PROP_LINK_WATCHERS] = { "link_watch", NULL, NULL, 0 }
|
[PROP_LINK_WATCHERS] = { "link_watch", NULL, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
typedef struct {
|
||||||
* nm_setting_team_port_new:
|
char *config;
|
||||||
*
|
int queue_id;
|
||||||
* Creates a new #NMSettingTeamPort object with default values.
|
int prio;
|
||||||
*
|
gboolean sticky;
|
||||||
* Returns: (transfer full): the new empty #NMSettingTeamPort object
|
int lacp_prio;
|
||||||
**/
|
int lacp_key;
|
||||||
NMSetting *
|
GPtrArray *link_watchers; /* Array of NMTeamLinkWatcher */
|
||||||
nm_setting_team_port_new (void)
|
} NMSettingTeamPortPrivate;
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_TEAM_PORT, NULL);
|
G_DEFINE_TYPE (NMSettingTeamPort, nm_setting_team_port, NM_TYPE_SETTING)
|
||||||
}
|
|
||||||
|
#define NM_SETTING_TEAM_PORT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_TEAM_PORT, NMSettingTeamPortPrivate))
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_team_port_get_config:
|
* nm_setting_team_port_get_config:
|
||||||
@@ -462,18 +454,45 @@ compare_property (const NMSettInfoSetting *sett_info,
|
|||||||
flags);
|
flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_team_port_init (NMSettingTeamPort *setting)
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
|
NMSettingTeamPort *setting = NM_SETTING_TEAM_PORT (object);
|
||||||
NMSettingTeamPortPrivate *priv = NM_SETTING_TEAM_PORT_GET_PRIVATE (setting);
|
NMSettingTeamPortPrivate *priv = NM_SETTING_TEAM_PORT_GET_PRIVATE (setting);
|
||||||
|
|
||||||
priv->queue_id = NM_SETTING_TEAM_PORT_QUEUE_ID_DEFAULT;
|
switch (prop_id) {
|
||||||
priv->lacp_prio = NM_SETTING_TEAM_PORT_LACP_PRIO_DEFAULT;
|
case PROP_CONFIG:
|
||||||
priv->link_watchers = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_team_link_watcher_unref);
|
g_value_set_string (value, nm_setting_team_port_get_config (setting));
|
||||||
|
break;
|
||||||
|
case PROP_QUEUE_ID:
|
||||||
|
g_value_set_int (value, priv->queue_id);
|
||||||
|
break;
|
||||||
|
case PROP_PRIO:
|
||||||
|
g_value_set_int (value, priv->prio);
|
||||||
|
break;
|
||||||
|
case PROP_STICKY:
|
||||||
|
g_value_set_boolean (value, priv->sticky);
|
||||||
|
break;
|
||||||
|
case PROP_LACP_PRIO:
|
||||||
|
g_value_set_int (value, priv->lacp_prio);
|
||||||
|
break;
|
||||||
|
case PROP_LACP_KEY:
|
||||||
|
g_value_set_int (value, priv->lacp_key);
|
||||||
|
break;
|
||||||
|
case PROP_LINK_WATCHERS:
|
||||||
|
g_value_take_boxed (value, _nm_utils_copy_array (priv->link_watchers,
|
||||||
|
(NMUtilsCopyFunc) nm_team_link_watcher_dup,
|
||||||
|
(GDestroyNotify) nm_team_link_watcher_unref));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define JSON_TO_VAL(typ, id) _nm_utils_json_extract_##typ (priv->config, _prop_to_keys[id], TRUE)
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_property (GObject *object, guint prop_id,
|
set_property (GObject *object, guint prop_id,
|
||||||
const GValue *value, GParamSpec *pspec)
|
const GValue *value, GParamSpec *pspec)
|
||||||
@@ -482,6 +501,8 @@ set_property (GObject *object, guint prop_id,
|
|||||||
const GValue *align_value = NULL;
|
const GValue *align_value = NULL;
|
||||||
gboolean align_config = FALSE;
|
gboolean align_config = FALSE;
|
||||||
|
|
||||||
|
#define JSON_TO_VAL(typ, id) _nm_utils_json_extract_##typ (priv->config, _prop_to_keys[id], TRUE)
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_CONFIG:
|
case PROP_CONFIG:
|
||||||
g_free (priv->config);
|
g_free (priv->config);
|
||||||
@@ -553,41 +574,29 @@ set_property (GObject *object, guint prop_id,
|
|||||||
_nm_utils_json_append_gvalue (&priv->config, _prop_to_keys[prop_id], align_value);
|
_nm_utils_json_append_gvalue (&priv->config, _prop_to_keys[prop_id], align_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object, guint prop_id,
|
nm_setting_team_port_init (NMSettingTeamPort *setting)
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
{
|
||||||
NMSettingTeamPort *setting = NM_SETTING_TEAM_PORT (object);
|
|
||||||
NMSettingTeamPortPrivate *priv = NM_SETTING_TEAM_PORT_GET_PRIVATE (setting);
|
NMSettingTeamPortPrivate *priv = NM_SETTING_TEAM_PORT_GET_PRIVATE (setting);
|
||||||
|
|
||||||
switch (prop_id) {
|
priv->queue_id = NM_SETTING_TEAM_PORT_QUEUE_ID_DEFAULT;
|
||||||
case PROP_CONFIG:
|
priv->lacp_prio = NM_SETTING_TEAM_PORT_LACP_PRIO_DEFAULT;
|
||||||
g_value_set_string (value, nm_setting_team_port_get_config (setting));
|
priv->link_watchers = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_team_link_watcher_unref);
|
||||||
break;
|
}
|
||||||
case PROP_QUEUE_ID:
|
|
||||||
g_value_set_int (value, priv->queue_id);
|
/**
|
||||||
break;
|
* nm_setting_team_port_new:
|
||||||
case PROP_PRIO:
|
*
|
||||||
g_value_set_int (value, priv->prio);
|
* Creates a new #NMSettingTeamPort object with default values.
|
||||||
break;
|
*
|
||||||
case PROP_STICKY:
|
* Returns: (transfer full): the new empty #NMSettingTeamPort object
|
||||||
g_value_set_boolean (value, priv->sticky);
|
**/
|
||||||
break;
|
NMSetting *
|
||||||
case PROP_LACP_PRIO:
|
nm_setting_team_port_new (void)
|
||||||
g_value_set_int (value, priv->lacp_prio);
|
{
|
||||||
break;
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_TEAM_PORT, NULL);
|
||||||
case PROP_LACP_KEY:
|
|
||||||
g_value_set_int (value, priv->lacp_key);
|
|
||||||
break;
|
|
||||||
case PROP_LINK_WATCHERS:
|
|
||||||
g_value_take_boxed (value, _nm_utils_copy_array (priv->link_watchers,
|
|
||||||
(NMUtilsCopyFunc) nm_team_link_watcher_dup,
|
|
||||||
(GDestroyNotify) nm_team_link_watcher_unref));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -610,8 +619,8 @@ nm_setting_team_port_class_init (NMSettingTeamPortClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingTeamPortPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingTeamPortPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->compare_property = compare_property;
|
setting_class->compare_property = compare_property;
|
||||||
|
@@ -21,10 +21,11 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-team.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "nm-setting-team.h"
|
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-utils-private.h"
|
#include "nm-utils-private.h"
|
||||||
#include "nm-connection-private.h"
|
#include "nm-connection-private.h"
|
||||||
@@ -624,29 +625,6 @@ nm_team_link_watcher_get_flags (NMTeamLinkWatcher *watcher)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingTeam, nm_setting_team, NM_TYPE_SETTING)
|
|
||||||
|
|
||||||
#define NM_SETTING_TEAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_TEAM, NMSettingTeamPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char *config;
|
|
||||||
int notify_peers_count;
|
|
||||||
int notify_peers_interval;
|
|
||||||
int mcast_rejoin_count;
|
|
||||||
int mcast_rejoin_interval;
|
|
||||||
char *runner;
|
|
||||||
char *runner_hwaddr_policy;
|
|
||||||
GPtrArray *runner_tx_hash;
|
|
||||||
char *runner_tx_balancer;
|
|
||||||
int runner_tx_balancer_interval;
|
|
||||||
gboolean runner_active;
|
|
||||||
gboolean runner_fast_rate;
|
|
||||||
int runner_sys_prio;
|
|
||||||
int runner_min_ports;
|
|
||||||
char *runner_agg_select_policy;
|
|
||||||
GPtrArray *link_watchers; /* Array of NMTeamLinkWatcher */
|
|
||||||
} NMSettingTeamPrivate;
|
|
||||||
|
|
||||||
/* Keep aligned with _prop_to_keys[] */
|
/* Keep aligned with _prop_to_keys[] */
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingTeam,
|
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingTeam,
|
||||||
PROP_CONFIG,
|
PROP_CONFIG,
|
||||||
@@ -688,18 +666,30 @@ static const _NMUtilsTeamPropertyKeys _prop_to_keys[_PROPERTY_ENUMS_LAST] = {
|
|||||||
[PROP_LINK_WATCHERS] = { "link_watch", NULL, NULL, 0 }
|
[PROP_LINK_WATCHERS] = { "link_watch", NULL, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
typedef struct {
|
||||||
* nm_setting_team_new:
|
char *config;
|
||||||
*
|
int notify_peers_count;
|
||||||
* Creates a new #NMSettingTeam object with default values.
|
int notify_peers_interval;
|
||||||
*
|
int mcast_rejoin_count;
|
||||||
* Returns: (transfer full): the new empty #NMSettingTeam object
|
int mcast_rejoin_interval;
|
||||||
**/
|
char *runner;
|
||||||
NMSetting *
|
char *runner_hwaddr_policy;
|
||||||
nm_setting_team_new (void)
|
GPtrArray *runner_tx_hash;
|
||||||
{
|
char *runner_tx_balancer;
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_TEAM, NULL);
|
int runner_tx_balancer_interval;
|
||||||
}
|
gboolean runner_active;
|
||||||
|
gboolean runner_fast_rate;
|
||||||
|
int runner_sys_prio;
|
||||||
|
int runner_min_ports;
|
||||||
|
char *runner_agg_select_policy;
|
||||||
|
GPtrArray *link_watchers; /* Array of NMTeamLinkWatcher */
|
||||||
|
} NMSettingTeamPrivate;
|
||||||
|
|
||||||
|
G_DEFINE_TYPE (NMSettingTeam, nm_setting_team, NM_TYPE_SETTING)
|
||||||
|
|
||||||
|
#define NM_SETTING_TEAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_TEAM, NMSettingTeamPrivate))
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_team_get_config:
|
* nm_setting_team_get_config:
|
||||||
@@ -1357,35 +1347,6 @@ compare_property (const NMSettInfoSetting *sett_info,
|
|||||||
flags);
|
flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
nm_setting_team_init (NMSettingTeam *setting)
|
|
||||||
{
|
|
||||||
NMSettingTeamPrivate *priv = NM_SETTING_TEAM_GET_PRIVATE (setting);
|
|
||||||
|
|
||||||
priv->runner = g_strdup (NM_SETTING_TEAM_RUNNER_ROUNDROBIN);
|
|
||||||
priv->runner_tx_balancer_interval = -1;
|
|
||||||
priv->runner_sys_prio = -1;
|
|
||||||
priv->runner_min_ports = -1;
|
|
||||||
priv->link_watchers = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_team_link_watcher_unref);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
finalize (GObject *object)
|
|
||||||
{
|
|
||||||
NMSettingTeamPrivate *priv = NM_SETTING_TEAM_GET_PRIVATE (object);
|
|
||||||
|
|
||||||
g_free (priv->config);
|
|
||||||
g_free (priv->runner);
|
|
||||||
g_free (priv->runner_hwaddr_policy);
|
|
||||||
g_free (priv->runner_tx_balancer);
|
|
||||||
g_free (priv->runner_agg_select_policy);
|
|
||||||
if (priv->runner_tx_hash)
|
|
||||||
g_ptr_array_unref (priv->runner_tx_hash);
|
|
||||||
g_ptr_array_unref (priv->link_watchers);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_setting_team_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define JSON_TO_VAL(typ, id) _nm_utils_json_extract_##typ (priv->config, _prop_to_keys[id], FALSE)
|
#define JSON_TO_VAL(typ, id) _nm_utils_json_extract_##typ (priv->config, _prop_to_keys[id], FALSE)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1430,6 +1391,73 @@ _align_team_properties (NMSettingTeam *setting)
|
|||||||
priv->link_watchers = JSON_TO_VAL (ptr_array, PROP_LINK_WATCHERS);
|
priv->link_watchers = JSON_TO_VAL (ptr_array, PROP_LINK_WATCHERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMSettingTeam *setting = NM_SETTING_TEAM (object);
|
||||||
|
NMSettingTeamPrivate *priv = NM_SETTING_TEAM_GET_PRIVATE (setting);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_CONFIG:
|
||||||
|
g_value_set_string (value, nm_setting_team_get_config (setting));
|
||||||
|
break;
|
||||||
|
case PROP_NOTIFY_PEERS_COUNT:
|
||||||
|
g_value_set_int (value, priv->notify_peers_count);
|
||||||
|
break;
|
||||||
|
case PROP_NOTIFY_PEERS_INTERVAL:
|
||||||
|
g_value_set_int (value, priv->notify_peers_interval);
|
||||||
|
break;
|
||||||
|
case PROP_MCAST_REJOIN_COUNT:
|
||||||
|
g_value_set_int (value, priv->mcast_rejoin_count);
|
||||||
|
break;
|
||||||
|
case PROP_MCAST_REJOIN_INTERVAL:
|
||||||
|
g_value_set_int (value, priv->mcast_rejoin_interval);
|
||||||
|
break;
|
||||||
|
case PROP_RUNNER:
|
||||||
|
g_value_set_string (value, nm_setting_team_get_runner (setting));
|
||||||
|
break;
|
||||||
|
case PROP_RUNNER_HWADDR_POLICY:
|
||||||
|
g_value_set_string (value, nm_setting_team_get_runner_hwaddr_policy (setting));
|
||||||
|
break;
|
||||||
|
case PROP_RUNNER_TX_HASH:
|
||||||
|
g_value_take_boxed (value, priv->runner_tx_hash ?
|
||||||
|
_nm_utils_ptrarray_to_strv (priv->runner_tx_hash): NULL);
|
||||||
|
break;
|
||||||
|
case PROP_RUNNER_TX_BALANCER:
|
||||||
|
g_value_set_string (value, nm_setting_team_get_runner_tx_balancer (setting));
|
||||||
|
break;
|
||||||
|
case PROP_RUNNER_TX_BALANCER_INTERVAL:
|
||||||
|
g_value_set_int (value, priv->runner_tx_balancer_interval);
|
||||||
|
break;
|
||||||
|
case PROP_RUNNER_ACTIVE:
|
||||||
|
g_value_set_boolean (value, nm_setting_team_get_runner_active (setting));
|
||||||
|
break;
|
||||||
|
case PROP_RUNNER_FAST_RATE:
|
||||||
|
g_value_set_boolean (value, nm_setting_team_get_runner_fast_rate (setting));
|
||||||
|
break;
|
||||||
|
case PROP_RUNNER_SYS_PRIO:
|
||||||
|
g_value_set_int (value, priv->runner_sys_prio);
|
||||||
|
break;
|
||||||
|
case PROP_RUNNER_MIN_PORTS:
|
||||||
|
g_value_set_int (value, priv->runner_min_ports);
|
||||||
|
break;
|
||||||
|
case PROP_RUNNER_AGG_SELECT_POLICY:
|
||||||
|
g_value_set_string (value, nm_setting_team_get_runner_agg_select_policy (setting));
|
||||||
|
break;
|
||||||
|
case PROP_LINK_WATCHERS:
|
||||||
|
g_value_take_boxed (value, _nm_utils_copy_array (priv->link_watchers,
|
||||||
|
(NMUtilsCopyFunc) nm_team_link_watcher_dup,
|
||||||
|
(GDestroyNotify) nm_team_link_watcher_unref));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_property (GObject *object, guint prop_id,
|
set_property (GObject *object, guint prop_id,
|
||||||
const GValue *value, GParamSpec *pspec)
|
const GValue *value, GParamSpec *pspec)
|
||||||
@@ -1573,69 +1601,48 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object, guint prop_id,
|
nm_setting_team_init (NMSettingTeam *setting)
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
{
|
||||||
NMSettingTeam *setting = NM_SETTING_TEAM (object);
|
|
||||||
NMSettingTeamPrivate *priv = NM_SETTING_TEAM_GET_PRIVATE (setting);
|
NMSettingTeamPrivate *priv = NM_SETTING_TEAM_GET_PRIVATE (setting);
|
||||||
|
|
||||||
switch (prop_id) {
|
priv->runner = g_strdup (NM_SETTING_TEAM_RUNNER_ROUNDROBIN);
|
||||||
case PROP_CONFIG:
|
priv->runner_tx_balancer_interval = -1;
|
||||||
g_value_set_string (value, nm_setting_team_get_config (setting));
|
priv->runner_sys_prio = -1;
|
||||||
break;
|
priv->runner_min_ports = -1;
|
||||||
case PROP_NOTIFY_PEERS_COUNT:
|
priv->link_watchers = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_team_link_watcher_unref);
|
||||||
g_value_set_int (value, priv->notify_peers_count);
|
}
|
||||||
break;
|
|
||||||
case PROP_NOTIFY_PEERS_INTERVAL:
|
/**
|
||||||
g_value_set_int (value, priv->notify_peers_interval);
|
* nm_setting_team_new:
|
||||||
break;
|
*
|
||||||
case PROP_MCAST_REJOIN_COUNT:
|
* Creates a new #NMSettingTeam object with default values.
|
||||||
g_value_set_int (value, priv->mcast_rejoin_count);
|
*
|
||||||
break;
|
* Returns: (transfer full): the new empty #NMSettingTeam object
|
||||||
case PROP_MCAST_REJOIN_INTERVAL:
|
**/
|
||||||
g_value_set_int (value, priv->mcast_rejoin_interval);
|
NMSetting *
|
||||||
break;
|
nm_setting_team_new (void)
|
||||||
case PROP_RUNNER:
|
{
|
||||||
g_value_set_string (value, nm_setting_team_get_runner (setting));
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_TEAM, NULL);
|
||||||
break;
|
}
|
||||||
case PROP_RUNNER_HWADDR_POLICY:
|
|
||||||
g_value_set_string (value, nm_setting_team_get_runner_hwaddr_policy (setting));
|
static void
|
||||||
break;
|
finalize (GObject *object)
|
||||||
case PROP_RUNNER_TX_HASH:
|
{
|
||||||
g_value_take_boxed (value, priv->runner_tx_hash ?
|
NMSettingTeamPrivate *priv = NM_SETTING_TEAM_GET_PRIVATE (object);
|
||||||
_nm_utils_ptrarray_to_strv (priv->runner_tx_hash): NULL);
|
|
||||||
break;
|
g_free (priv->config);
|
||||||
case PROP_RUNNER_TX_BALANCER:
|
g_free (priv->runner);
|
||||||
g_value_set_string (value, nm_setting_team_get_runner_tx_balancer (setting));
|
g_free (priv->runner_hwaddr_policy);
|
||||||
break;
|
g_free (priv->runner_tx_balancer);
|
||||||
case PROP_RUNNER_TX_BALANCER_INTERVAL:
|
g_free (priv->runner_agg_select_policy);
|
||||||
g_value_set_int (value, priv->runner_tx_balancer_interval);
|
if (priv->runner_tx_hash)
|
||||||
break;
|
g_ptr_array_unref (priv->runner_tx_hash);
|
||||||
case PROP_RUNNER_ACTIVE:
|
g_ptr_array_unref (priv->link_watchers);
|
||||||
g_value_set_boolean (value, nm_setting_team_get_runner_active (setting));
|
|
||||||
break;
|
G_OBJECT_CLASS (nm_setting_team_parent_class)->finalize (object);
|
||||||
case PROP_RUNNER_FAST_RATE:
|
|
||||||
g_value_set_boolean (value, nm_setting_team_get_runner_fast_rate (setting));
|
|
||||||
break;
|
|
||||||
case PROP_RUNNER_SYS_PRIO:
|
|
||||||
g_value_set_int (value, priv->runner_sys_prio);
|
|
||||||
break;
|
|
||||||
case PROP_RUNNER_MIN_PORTS:
|
|
||||||
g_value_set_int (value, priv->runner_min_ports);
|
|
||||||
break;
|
|
||||||
case PROP_RUNNER_AGG_SELECT_POLICY:
|
|
||||||
g_value_set_string (value, nm_setting_team_get_runner_agg_select_policy (setting));
|
|
||||||
break;
|
|
||||||
case PROP_LINK_WATCHERS:
|
|
||||||
g_value_take_boxed (value, _nm_utils_copy_array (priv->link_watchers,
|
|
||||||
(NMUtilsCopyFunc) nm_team_link_watcher_dup,
|
|
||||||
(GDestroyNotify) nm_team_link_watcher_unref));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1647,8 +1654,8 @@ nm_setting_team_class_init (NMSettingTeamClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingTeamPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingTeamPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->compare_property = compare_property;
|
setting_class->compare_property = compare_property;
|
||||||
|
@@ -21,10 +21,11 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-tun.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "nm-setting-tun.h"
|
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-setting-connection.h"
|
#include "nm-setting-connection.h"
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
@@ -38,18 +39,7 @@
|
|||||||
* necessary for connection to TUN/TAP interfaces.
|
* necessary for connection to TUN/TAP interfaces.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingTun, nm_setting_tun, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_TUN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_TUN, NMSettingTunPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
NMSettingTunMode mode;
|
|
||||||
char *owner;
|
|
||||||
char *group;
|
|
||||||
gboolean pi;
|
|
||||||
gboolean vnet_hdr;
|
|
||||||
gboolean multi_queue;
|
|
||||||
} NMSettingTunPrivate;
|
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_MODE,
|
PROP_MODE,
|
||||||
@@ -60,20 +50,20 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
|||||||
PROP_MULTI_QUEUE,
|
PROP_MULTI_QUEUE,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
typedef struct {
|
||||||
* nm_setting_tun_new:
|
NMSettingTunMode mode;
|
||||||
*
|
char *owner;
|
||||||
* Creates a new #NMSettingTun object with default values.
|
char *group;
|
||||||
*
|
gboolean pi;
|
||||||
* Returns: (transfer full): the new empty #NMSettingTun object
|
gboolean vnet_hdr;
|
||||||
*
|
gboolean multi_queue;
|
||||||
* Since: 1.2
|
} NMSettingTunPrivate;
|
||||||
**/
|
|
||||||
NMSetting *
|
G_DEFINE_TYPE (NMSettingTun, nm_setting_tun, NM_TYPE_SETTING)
|
||||||
nm_setting_tun_new (void)
|
|
||||||
{
|
#define NM_SETTING_TUN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_TUN, NMSettingTunPrivate))
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_TUN, NULL);
|
|
||||||
}
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_tun_get_mode:
|
* nm_setting_tun_get_mode:
|
||||||
@@ -165,11 +155,6 @@ nm_setting_tun_get_multi_queue (NMSettingTun *setting)
|
|||||||
return NM_SETTING_TUN_GET_PRIVATE (setting)->multi_queue;
|
return NM_SETTING_TUN_GET_PRIVATE (setting)->multi_queue;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
nm_setting_tun_init (NMSettingTun *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
verify (NMSetting *setting, NMConnection *connection, GError **error)
|
verify (NMSetting *setting, NMConnection *connection, GError **error)
|
||||||
{
|
{
|
||||||
@@ -210,39 +195,8 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
set_property (GObject *object, guint prop_id,
|
|
||||||
const GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingTun *setting = NM_SETTING_TUN (object);
|
|
||||||
NMSettingTunPrivate *priv = NM_SETTING_TUN_GET_PRIVATE (setting);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_MODE:
|
|
||||||
priv->mode = g_value_get_uint (value);
|
|
||||||
break;
|
|
||||||
case PROP_OWNER:
|
|
||||||
g_free (priv->owner);
|
|
||||||
priv->owner = g_value_dup_string (value);
|
|
||||||
break;
|
|
||||||
case PROP_GROUP:
|
|
||||||
g_free (priv->group);
|
|
||||||
priv->group = g_value_dup_string (value);
|
|
||||||
break;
|
|
||||||
case PROP_PI:
|
|
||||||
priv->pi = g_value_get_boolean (value);
|
|
||||||
break;
|
|
||||||
case PROP_VNET_HDR:
|
|
||||||
priv->vnet_hdr = g_value_get_boolean (value);
|
|
||||||
break;
|
|
||||||
case PROP_MULTI_QUEUE:
|
|
||||||
priv->multi_queue = g_value_get_boolean (value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object, guint prop_id,
|
get_property (GObject *object, guint prop_id,
|
||||||
GValue *value, GParamSpec *pspec)
|
GValue *value, GParamSpec *pspec)
|
||||||
@@ -275,6 +229,61 @@ get_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
set_property (GObject *object, guint prop_id,
|
||||||
|
const GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMSettingTun *setting = NM_SETTING_TUN (object);
|
||||||
|
NMSettingTunPrivate *priv = NM_SETTING_TUN_GET_PRIVATE (setting);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_MODE:
|
||||||
|
priv->mode = g_value_get_uint (value);
|
||||||
|
break;
|
||||||
|
case PROP_OWNER:
|
||||||
|
g_free (priv->owner);
|
||||||
|
priv->owner = g_value_dup_string (value);
|
||||||
|
break;
|
||||||
|
case PROP_GROUP:
|
||||||
|
g_free (priv->group);
|
||||||
|
priv->group = g_value_dup_string (value);
|
||||||
|
break;
|
||||||
|
case PROP_PI:
|
||||||
|
priv->pi = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
case PROP_VNET_HDR:
|
||||||
|
priv->vnet_hdr = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
case PROP_MULTI_QUEUE:
|
||||||
|
priv->multi_queue = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
nm_setting_tun_init (NMSettingTun *setting)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nm_setting_tun_new:
|
||||||
|
*
|
||||||
|
* Creates a new #NMSettingTun object with default values.
|
||||||
|
*
|
||||||
|
* Returns: (transfer full): the new empty #NMSettingTun object
|
||||||
|
*
|
||||||
|
* Since: 1.2
|
||||||
|
**/
|
||||||
|
NMSetting *
|
||||||
|
nm_setting_tun_new (void)
|
||||||
|
{
|
||||||
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_TUN, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
finalize (GObject *object)
|
finalize (GObject *object)
|
||||||
{
|
{
|
||||||
@@ -295,8 +304,8 @@ nm_setting_tun_class_init (NMSettingTunClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingTunPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingTunPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -550,8 +550,8 @@ nm_setting_user_class_init (NMSettingUserClass *klass)
|
|||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->compare_property = compare_property;
|
setting_class->compare_property = compare_property;
|
||||||
@@ -584,15 +584,14 @@ nm_setting_user_class_init (NMSettingUserClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS);
|
G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
|
||||||
|
|
||||||
_properties_override_add_transform (properties_override,
|
_properties_override_add_transform (properties_override,
|
||||||
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
obj_properties[PROP_DATA],
|
||||||
NM_SETTING_USER_DATA),
|
|
||||||
G_VARIANT_TYPE ("a{ss}"),
|
G_VARIANT_TYPE ("a{ss}"),
|
||||||
_nm_utils_strdict_to_dbus,
|
_nm_utils_strdict_to_dbus,
|
||||||
_nm_utils_strdict_from_dbus);
|
_nm_utils_strdict_from_dbus);
|
||||||
|
|
||||||
|
g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_USER,
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_USER,
|
||||||
NULL, properties_override);
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -41,17 +41,7 @@
|
|||||||
* necessary for connection to VLAN interfaces.
|
* necessary for connection to VLAN interfaces.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingVlan, nm_setting_vlan, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_VLAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_VLAN, NMSettingVlanPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char *parent;
|
|
||||||
guint32 id;
|
|
||||||
guint32 flags;
|
|
||||||
GSList *ingress_priority_map;
|
|
||||||
GSList *egress_priority_map;
|
|
||||||
} NMSettingVlanPrivate;
|
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingVlan,
|
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingVlan,
|
||||||
PROP_PARENT,
|
PROP_PARENT,
|
||||||
@@ -61,22 +51,23 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMSettingVlan,
|
|||||||
PROP_EGRESS_PRIORITY_MAP,
|
PROP_EGRESS_PRIORITY_MAP,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
char *parent;
|
||||||
|
guint32 id;
|
||||||
|
guint32 flags;
|
||||||
|
GSList *ingress_priority_map;
|
||||||
|
GSList *egress_priority_map;
|
||||||
|
} NMSettingVlanPrivate;
|
||||||
|
|
||||||
|
G_DEFINE_TYPE (NMSettingVlan, nm_setting_vlan, NM_TYPE_SETTING)
|
||||||
|
|
||||||
|
#define NM_SETTING_VLAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_VLAN, NMSettingVlanPrivate))
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define MAX_SKB_PRIO G_MAXUINT32
|
#define MAX_SKB_PRIO G_MAXUINT32
|
||||||
#define MAX_8021P_PRIO 7 /* Max 802.1p priority */
|
#define MAX_8021P_PRIO 7 /* Max 802.1p priority */
|
||||||
|
|
||||||
/**
|
|
||||||
* nm_setting_vlan_new:
|
|
||||||
*
|
|
||||||
* Creates a new #NMSettingVlan object with default values.
|
|
||||||
*
|
|
||||||
* Returns: (transfer full): the new empty #NMSettingVlan object
|
|
||||||
**/
|
|
||||||
NMSetting *
|
|
||||||
nm_setting_vlan_new (void)
|
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_VLAN, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_vlan_get_parent:
|
* nm_setting_vlan_get_parent:
|
||||||
* @setting: the #NMSettingVlan
|
* @setting: the #NMSettingVlan
|
||||||
@@ -591,11 +582,6 @@ nm_setting_vlan_clear_priorities (NMSettingVlan *setting, NMVlanPriorityMap map)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
|
||||||
nm_setting_vlan_init (NMSettingVlan *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
verify (NMSetting *setting, NMConnection *connection, GError **error)
|
verify (NMSetting *setting, NMConnection *connection, GError **error)
|
||||||
{
|
{
|
||||||
@@ -734,6 +720,55 @@ priority_strv_to_maplist (NMVlanPriorityMap map, char **strv)
|
|||||||
return g_slist_sort (list, prio_map_compare);
|
return g_slist_sort (list, prio_map_compare);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char **
|
||||||
|
priority_maplist_to_strv (GSList *list)
|
||||||
|
{
|
||||||
|
GSList *iter;
|
||||||
|
GPtrArray *strv;
|
||||||
|
|
||||||
|
strv = g_ptr_array_new ();
|
||||||
|
|
||||||
|
for (iter = list; iter; iter = g_slist_next (iter)) {
|
||||||
|
NMVlanQosMapping *item = iter->data;
|
||||||
|
|
||||||
|
g_ptr_array_add (strv, g_strdup_printf ("%d:%d", item->from, item->to));
|
||||||
|
}
|
||||||
|
g_ptr_array_add (strv, NULL);
|
||||||
|
|
||||||
|
return (char **) g_ptr_array_free (strv, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMSettingVlan *setting = NM_SETTING_VLAN (object);
|
||||||
|
NMSettingVlanPrivate *priv = NM_SETTING_VLAN_GET_PRIVATE (setting);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_PARENT:
|
||||||
|
g_value_set_string (value, priv->parent);
|
||||||
|
break;
|
||||||
|
case PROP_ID:
|
||||||
|
g_value_set_uint (value, priv->id);
|
||||||
|
break;
|
||||||
|
case PROP_FLAGS:
|
||||||
|
g_value_set_flags (value, priv->flags);
|
||||||
|
break;
|
||||||
|
case PROP_INGRESS_PRIORITY_MAP:
|
||||||
|
g_value_take_boxed (value, priority_maplist_to_strv (priv->ingress_priority_map));
|
||||||
|
break;
|
||||||
|
case PROP_EGRESS_PRIORITY_MAP:
|
||||||
|
g_value_take_boxed (value, priority_maplist_to_strv (priv->egress_priority_map));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_property (GObject *object, guint prop_id,
|
set_property (GObject *object, guint prop_id,
|
||||||
const GValue *value, GParamSpec *pspec)
|
const GValue *value, GParamSpec *pspec)
|
||||||
@@ -766,51 +801,24 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static char **
|
/*****************************************************************************/
|
||||||
priority_maplist_to_strv (GSList *list)
|
|
||||||
{
|
|
||||||
GSList *iter;
|
|
||||||
GPtrArray *strv;
|
|
||||||
|
|
||||||
strv = g_ptr_array_new ();
|
|
||||||
|
|
||||||
for (iter = list; iter; iter = g_slist_next (iter)) {
|
|
||||||
NMVlanQosMapping *item = iter->data;
|
|
||||||
|
|
||||||
g_ptr_array_add (strv, g_strdup_printf ("%d:%d", item->from, item->to));
|
|
||||||
}
|
|
||||||
g_ptr_array_add (strv, NULL);
|
|
||||||
|
|
||||||
return (char **) g_ptr_array_free (strv, FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object, guint prop_id,
|
nm_setting_vlan_init (NMSettingVlan *setting)
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
{
|
||||||
NMSettingVlan *setting = NM_SETTING_VLAN (object);
|
}
|
||||||
NMSettingVlanPrivate *priv = NM_SETTING_VLAN_GET_PRIVATE (setting);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
/**
|
||||||
case PROP_PARENT:
|
* nm_setting_vlan_new:
|
||||||
g_value_set_string (value, priv->parent);
|
*
|
||||||
break;
|
* Creates a new #NMSettingVlan object with default values.
|
||||||
case PROP_ID:
|
*
|
||||||
g_value_set_uint (value, priv->id);
|
* Returns: (transfer full): the new empty #NMSettingVlan object
|
||||||
break;
|
**/
|
||||||
case PROP_FLAGS:
|
NMSetting *
|
||||||
g_value_set_flags (value, priv->flags);
|
nm_setting_vlan_new (void)
|
||||||
break;
|
{
|
||||||
case PROP_INGRESS_PRIORITY_MAP:
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_VLAN, NULL);
|
||||||
g_value_take_boxed (value, priority_maplist_to_strv (priv->ingress_priority_map));
|
|
||||||
break;
|
|
||||||
case PROP_EGRESS_PRIORITY_MAP:
|
|
||||||
g_value_take_boxed (value, priority_maplist_to_strv (priv->egress_priority_map));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -835,8 +843,8 @@ nm_setting_vlan_class_init (NMSettingVlanClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingVlanPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingVlanPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -21,13 +21,13 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-vpn.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "nm-utils/nm-secret-utils.h"
|
#include "nm-utils/nm-secret-utils.h"
|
||||||
|
|
||||||
#include "nm-setting-vpn.h"
|
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-utils-private.h"
|
#include "nm-utils-private.h"
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
@@ -45,9 +45,16 @@
|
|||||||
* properties.
|
* properties.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingVpn, nm_setting_vpn, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_VPN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_VPN, NMSettingVpnPrivate))
|
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingVpn,
|
||||||
|
PROP_SERVICE_TYPE,
|
||||||
|
PROP_USER_NAME,
|
||||||
|
PROP_PERSISTENT,
|
||||||
|
PROP_DATA,
|
||||||
|
PROP_SECRETS,
|
||||||
|
PROP_TIMEOUT,
|
||||||
|
);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *service_type;
|
char *service_type;
|
||||||
@@ -85,27 +92,11 @@ typedef struct {
|
|||||||
guint32 timeout;
|
guint32 timeout;
|
||||||
} NMSettingVpnPrivate;
|
} NMSettingVpnPrivate;
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingVpn,
|
G_DEFINE_TYPE (NMSettingVpn, nm_setting_vpn, NM_TYPE_SETTING)
|
||||||
PROP_SERVICE_TYPE,
|
|
||||||
PROP_USER_NAME,
|
|
||||||
PROP_PERSISTENT,
|
|
||||||
PROP_DATA,
|
|
||||||
PROP_SECRETS,
|
|
||||||
PROP_TIMEOUT,
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
#define NM_SETTING_VPN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_VPN, NMSettingVpnPrivate))
|
||||||
* nm_setting_vpn_new:
|
|
||||||
*
|
/*****************************************************************************/
|
||||||
* Creates a new #NMSettingVpn object with default values.
|
|
||||||
*
|
|
||||||
* Returns: (transfer full): the new empty #NMSettingVpn object
|
|
||||||
**/
|
|
||||||
NMSetting *
|
|
||||||
nm_setting_vpn_new (void)
|
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_VPN, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_vpn_get_service_type:
|
* nm_setting_vpn_get_service_type:
|
||||||
@@ -853,26 +844,38 @@ clear_secrets_with_flags (NMSetting *setting,
|
|||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_vpn_init (NMSettingVpn *setting)
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
|
NMSettingVpn *setting = NM_SETTING_VPN (object);
|
||||||
NMSettingVpnPrivate *priv = NM_SETTING_VPN_GET_PRIVATE (setting);
|
NMSettingVpnPrivate *priv = NM_SETTING_VPN_GET_PRIVATE (setting);
|
||||||
|
|
||||||
priv->data = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, g_free);
|
switch (prop_id) {
|
||||||
priv->secrets = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, (GDestroyNotify) nm_free_secret);
|
case PROP_SERVICE_TYPE:
|
||||||
}
|
g_value_set_string (value, nm_setting_vpn_get_service_type (setting));
|
||||||
|
break;
|
||||||
static void
|
case PROP_USER_NAME:
|
||||||
finalize (GObject *object)
|
g_value_set_string (value, nm_setting_vpn_get_user_name (setting));
|
||||||
{
|
break;
|
||||||
NMSettingVpnPrivate *priv = NM_SETTING_VPN_GET_PRIVATE (object);
|
case PROP_PERSISTENT:
|
||||||
|
g_value_set_boolean (value, priv->persistent);
|
||||||
g_free (priv->service_type);
|
break;
|
||||||
g_free (priv->user_name);
|
case PROP_DATA:
|
||||||
g_hash_table_destroy (priv->data);
|
g_value_take_boxed (value, _nm_utils_copy_strdict (priv->data));
|
||||||
g_hash_table_destroy (priv->secrets);
|
break;
|
||||||
|
case PROP_SECRETS:
|
||||||
G_OBJECT_CLASS (nm_setting_vpn_parent_class)->finalize (object);
|
g_value_take_boxed (value, _nm_utils_copy_strdict (priv->secrets));
|
||||||
|
break;
|
||||||
|
case PROP_TIMEOUT:
|
||||||
|
g_value_set_uint (value, nm_setting_vpn_get_timeout (setting));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -910,36 +913,41 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object, guint prop_id,
|
nm_setting_vpn_init (NMSettingVpn *setting)
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
{
|
||||||
NMSettingVpn *setting = NM_SETTING_VPN (object);
|
|
||||||
NMSettingVpnPrivate *priv = NM_SETTING_VPN_GET_PRIVATE (setting);
|
NMSettingVpnPrivate *priv = NM_SETTING_VPN_GET_PRIVATE (setting);
|
||||||
|
|
||||||
switch (prop_id) {
|
priv->data = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, g_free);
|
||||||
case PROP_SERVICE_TYPE:
|
priv->secrets = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, (GDestroyNotify) nm_free_secret);
|
||||||
g_value_set_string (value, nm_setting_vpn_get_service_type (setting));
|
}
|
||||||
break;
|
|
||||||
case PROP_USER_NAME:
|
/**
|
||||||
g_value_set_string (value, nm_setting_vpn_get_user_name (setting));
|
* nm_setting_vpn_new:
|
||||||
break;
|
*
|
||||||
case PROP_PERSISTENT:
|
* Creates a new #NMSettingVpn object with default values.
|
||||||
g_value_set_boolean (value, priv->persistent);
|
*
|
||||||
break;
|
* Returns: (transfer full): the new empty #NMSettingVpn object
|
||||||
case PROP_DATA:
|
**/
|
||||||
g_value_take_boxed (value, _nm_utils_copy_strdict (priv->data));
|
NMSetting *
|
||||||
break;
|
nm_setting_vpn_new (void)
|
||||||
case PROP_SECRETS:
|
{
|
||||||
g_value_take_boxed (value, _nm_utils_copy_strdict (priv->secrets));
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_VPN, NULL);
|
||||||
break;
|
}
|
||||||
case PROP_TIMEOUT:
|
|
||||||
g_value_set_uint (value, nm_setting_vpn_get_timeout (setting));
|
static void
|
||||||
break;
|
finalize (GObject *object)
|
||||||
default:
|
{
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
NMSettingVpnPrivate *priv = NM_SETTING_VPN_GET_PRIVATE (object);
|
||||||
break;
|
|
||||||
}
|
g_free (priv->service_type);
|
||||||
|
g_free (priv->user_name);
|
||||||
|
g_hash_table_destroy (priv->data);
|
||||||
|
g_hash_table_destroy (priv->secrets);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (nm_setting_vpn_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -951,8 +959,8 @@ nm_setting_vpn_class_init (NMSettingVpnClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingVpnPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingVpnPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -21,10 +21,11 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-vxlan.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "nm-setting-vxlan.h"
|
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
|
|
||||||
@@ -36,28 +37,9 @@
|
|||||||
* necessary for connection to VXLAN interfaces.
|
* necessary for connection to VXLAN interfaces.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingVxlan, nm_setting_vxlan, NM_TYPE_SETTING)
|
#define DST_PORT_DEFAULT 8472
|
||||||
|
|
||||||
#define NM_SETTING_VXLAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_VXLAN, NMSettingVxlanPrivate))
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char *parent;
|
|
||||||
guint id;
|
|
||||||
char *local;
|
|
||||||
char *remote;
|
|
||||||
guint source_port_min;
|
|
||||||
guint source_port_max;
|
|
||||||
guint destination_port;
|
|
||||||
guint tos;
|
|
||||||
guint ttl;
|
|
||||||
guint ageing;
|
|
||||||
guint limit;
|
|
||||||
gboolean learning;
|
|
||||||
gboolean proxy;
|
|
||||||
gboolean rsc;
|
|
||||||
gboolean l2_miss;
|
|
||||||
gboolean l3_miss;
|
|
||||||
} NMSettingVxlanPrivate;
|
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_PARENT,
|
PROP_PARENT,
|
||||||
@@ -78,22 +60,30 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
|||||||
PROP_L3_MISS,
|
PROP_L3_MISS,
|
||||||
);
|
);
|
||||||
|
|
||||||
#define DST_PORT_DEFAULT 8472
|
typedef struct {
|
||||||
|
char *parent;
|
||||||
|
guint id;
|
||||||
|
char *local;
|
||||||
|
char *remote;
|
||||||
|
guint source_port_min;
|
||||||
|
guint source_port_max;
|
||||||
|
guint destination_port;
|
||||||
|
guint tos;
|
||||||
|
guint ttl;
|
||||||
|
guint ageing;
|
||||||
|
guint limit;
|
||||||
|
gboolean learning;
|
||||||
|
gboolean proxy;
|
||||||
|
gboolean rsc;
|
||||||
|
gboolean l2_miss;
|
||||||
|
gboolean l3_miss;
|
||||||
|
} NMSettingVxlanPrivate;
|
||||||
|
|
||||||
/**
|
G_DEFINE_TYPE (NMSettingVxlan, nm_setting_vxlan, NM_TYPE_SETTING)
|
||||||
* nm_setting_vxlan_new:
|
|
||||||
*
|
#define NM_SETTING_VXLAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_VXLAN, NMSettingVxlanPrivate))
|
||||||
* Creates a new #NMSettingVxlan object with default values.
|
|
||||||
*
|
/*****************************************************************************/
|
||||||
* Returns: (transfer full): the new empty #NMSettingVxlan object
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
**/
|
|
||||||
NMSetting *
|
|
||||||
nm_setting_vxlan_new (void)
|
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_VXLAN, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_vxlan_get_parent:
|
* nm_setting_vxlan_get_parent:
|
||||||
@@ -337,11 +327,6 @@ nm_setting_vxlan_get_l3_miss (NMSettingVxlan *setting)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
|
||||||
nm_setting_vxlan_init (NMSettingVxlan *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
verify (NMSetting *setting, NMConnection *connection, GError **error)
|
verify (NMSetting *setting, NMConnection *connection, GError **error)
|
||||||
{
|
{
|
||||||
@@ -419,6 +404,70 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMSettingVxlan *setting = NM_SETTING_VXLAN (object);
|
||||||
|
NMSettingVxlanPrivate *priv = NM_SETTING_VXLAN_GET_PRIVATE (setting);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_PARENT:
|
||||||
|
g_value_set_string (value, priv->parent);
|
||||||
|
break;
|
||||||
|
case PROP_ID:
|
||||||
|
g_value_set_uint (value, priv->id);
|
||||||
|
break;
|
||||||
|
case PROP_LOCAL:
|
||||||
|
g_value_set_string (value, priv->local);
|
||||||
|
break;
|
||||||
|
case PROP_REMOTE:
|
||||||
|
g_value_set_string (value, priv->remote);
|
||||||
|
break;
|
||||||
|
case PROP_SOURCE_PORT_MIN:
|
||||||
|
g_value_set_uint (value, priv->source_port_min);
|
||||||
|
break;
|
||||||
|
case PROP_SOURCE_PORT_MAX:
|
||||||
|
g_value_set_uint (value, priv->source_port_max);
|
||||||
|
break;
|
||||||
|
case PROP_DESTINATION_PORT:
|
||||||
|
g_value_set_uint (value, priv->destination_port);
|
||||||
|
break;
|
||||||
|
case PROP_TOS:
|
||||||
|
g_value_set_uint (value, priv->tos);
|
||||||
|
break;
|
||||||
|
case PROP_AGEING:
|
||||||
|
g_value_set_uint (value, priv->ageing);
|
||||||
|
break;
|
||||||
|
case PROP_LIMIT:
|
||||||
|
g_value_set_uint (value, priv->limit);
|
||||||
|
break;
|
||||||
|
case PROP_PROXY:
|
||||||
|
g_value_set_boolean (value, priv->proxy);
|
||||||
|
break;
|
||||||
|
case PROP_TTL:
|
||||||
|
g_value_set_uint (value, priv->ttl);
|
||||||
|
break;
|
||||||
|
case PROP_LEARNING:
|
||||||
|
g_value_set_boolean (value, priv->learning);
|
||||||
|
break;
|
||||||
|
case PROP_RSC:
|
||||||
|
g_value_set_boolean (value, priv->rsc);
|
||||||
|
break;
|
||||||
|
case PROP_L2_MISS:
|
||||||
|
g_value_set_boolean (value, priv->l2_miss);
|
||||||
|
break;
|
||||||
|
case PROP_L3_MISS:
|
||||||
|
g_value_set_boolean (value, priv->l3_miss);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_property (GObject *object, guint prop_id,
|
set_property (GObject *object, guint prop_id,
|
||||||
const GValue *value, GParamSpec *pspec)
|
const GValue *value, GParamSpec *pspec)
|
||||||
@@ -484,66 +533,26 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
get_property (GObject *object, guint prop_id,
|
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingVxlan *setting = NM_SETTING_VXLAN (object);
|
|
||||||
NMSettingVxlanPrivate *priv = NM_SETTING_VXLAN_GET_PRIVATE (setting);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
static void
|
||||||
case PROP_PARENT:
|
nm_setting_vxlan_init (NMSettingVxlan *setting)
|
||||||
g_value_set_string (value, priv->parent);
|
{
|
||||||
break;
|
}
|
||||||
case PROP_ID:
|
|
||||||
g_value_set_uint (value, priv->id);
|
/**
|
||||||
break;
|
* nm_setting_vxlan_new:
|
||||||
case PROP_LOCAL:
|
*
|
||||||
g_value_set_string (value, priv->local);
|
* Creates a new #NMSettingVxlan object with default values.
|
||||||
break;
|
*
|
||||||
case PROP_REMOTE:
|
* Returns: (transfer full): the new empty #NMSettingVxlan object
|
||||||
g_value_set_string (value, priv->remote);
|
*
|
||||||
break;
|
* Since: 1.2
|
||||||
case PROP_SOURCE_PORT_MIN:
|
**/
|
||||||
g_value_set_uint (value, priv->source_port_min);
|
NMSetting *
|
||||||
break;
|
nm_setting_vxlan_new (void)
|
||||||
case PROP_SOURCE_PORT_MAX:
|
{
|
||||||
g_value_set_uint (value, priv->source_port_max);
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_VXLAN, NULL);
|
||||||
break;
|
|
||||||
case PROP_DESTINATION_PORT:
|
|
||||||
g_value_set_uint (value, priv->destination_port);
|
|
||||||
break;
|
|
||||||
case PROP_TOS:
|
|
||||||
g_value_set_uint (value, priv->tos);
|
|
||||||
break;
|
|
||||||
case PROP_AGEING:
|
|
||||||
g_value_set_uint (value, priv->ageing);
|
|
||||||
break;
|
|
||||||
case PROP_LIMIT:
|
|
||||||
g_value_set_uint (value, priv->limit);
|
|
||||||
break;
|
|
||||||
case PROP_PROXY:
|
|
||||||
g_value_set_boolean (value, priv->proxy);
|
|
||||||
break;
|
|
||||||
case PROP_TTL:
|
|
||||||
g_value_set_uint (value, priv->ttl);
|
|
||||||
break;
|
|
||||||
case PROP_LEARNING:
|
|
||||||
g_value_set_boolean (value, priv->learning);
|
|
||||||
break;
|
|
||||||
case PROP_RSC:
|
|
||||||
g_value_set_boolean (value, priv->rsc);
|
|
||||||
break;
|
|
||||||
case PROP_L2_MISS:
|
|
||||||
g_value_set_boolean (value, priv->l2_miss);
|
|
||||||
break;
|
|
||||||
case PROP_L3_MISS:
|
|
||||||
g_value_set_boolean (value, priv->l3_miss);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -567,8 +576,8 @@ nm_setting_vxlan_class_init (NMSettingVxlanClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingVxlanPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingVxlanPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -22,10 +22,11 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-wimax.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <net/ethernet.h>
|
#include <net/ethernet.h>
|
||||||
|
|
||||||
#include "nm-setting-wimax.h"
|
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-utils-private.h"
|
#include "nm-utils-private.h"
|
||||||
@@ -42,34 +43,23 @@
|
|||||||
* connections cannot be activated.
|
* connections cannot be activated.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingWimax, nm_setting_wimax, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_WIMAX_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIMAX, NMSettingWimaxPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char *network_name;
|
|
||||||
char *mac_address;
|
|
||||||
} NMSettingWimaxPrivate;
|
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_NETWORK_NAME,
|
PROP_NETWORK_NAME,
|
||||||
PROP_MAC_ADDRESS,
|
PROP_MAC_ADDRESS,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
typedef struct {
|
||||||
* nm_setting_wimax_new:
|
char *network_name;
|
||||||
*
|
char *mac_address;
|
||||||
* Creates a new #NMSettingWimax object with default values.
|
} NMSettingWimaxPrivate;
|
||||||
*
|
|
||||||
* Returns: the new empty #NMSettingWimax object
|
G_DEFINE_TYPE (NMSettingWimax, nm_setting_wimax, NM_TYPE_SETTING)
|
||||||
*
|
|
||||||
* Deprecated: 1.2: WiMAX is no longer supported.
|
#define NM_SETTING_WIMAX_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIMAX, NMSettingWimaxPrivate))
|
||||||
**/
|
|
||||||
NMSetting *
|
/*****************************************************************************/
|
||||||
nm_setting_wimax_new (void)
|
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_WIMAX, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_wimax_get_network_name:
|
* nm_setting_wimax_get_network_name:
|
||||||
@@ -144,20 +134,25 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
nm_setting_wimax_init (NMSettingWimax *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
finalize (GObject *object)
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
NMSettingWimaxPrivate *priv = NM_SETTING_WIMAX_GET_PRIVATE (object);
|
NMSettingWimax *setting = NM_SETTING_WIMAX (object);
|
||||||
|
|
||||||
g_free (priv->network_name);
|
switch (prop_id) {
|
||||||
g_free (priv->mac_address);
|
case PROP_NETWORK_NAME:
|
||||||
|
g_value_set_string (value, nm_setting_wimax_get_network_name (setting));
|
||||||
G_OBJECT_CLASS (nm_setting_wimax_parent_class)->finalize (object);
|
break;
|
||||||
|
case PROP_MAC_ADDRESS:
|
||||||
|
g_value_set_string (value, nm_setting_wimax_get_mac_address (setting));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -182,23 +177,37 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
get_property (GObject *object, guint prop_id,
|
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingWimax *setting = NM_SETTING_WIMAX (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
static void
|
||||||
case PROP_NETWORK_NAME:
|
nm_setting_wimax_init (NMSettingWimax *setting)
|
||||||
g_value_set_string (value, nm_setting_wimax_get_network_name (setting));
|
{
|
||||||
break;
|
}
|
||||||
case PROP_MAC_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_setting_wimax_get_mac_address (setting));
|
/**
|
||||||
break;
|
* nm_setting_wimax_new:
|
||||||
default:
|
*
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
* Creates a new #NMSettingWimax object with default values.
|
||||||
break;
|
*
|
||||||
}
|
* Returns: the new empty #NMSettingWimax object
|
||||||
|
*
|
||||||
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
||||||
|
**/
|
||||||
|
NMSetting *
|
||||||
|
nm_setting_wimax_new (void)
|
||||||
|
{
|
||||||
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_WIMAX, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
finalize (GObject *object)
|
||||||
|
{
|
||||||
|
NMSettingWimaxPrivate *priv = NM_SETTING_WIMAX_GET_PRIVATE (object);
|
||||||
|
|
||||||
|
g_free (priv->network_name);
|
||||||
|
g_free (priv->mac_address);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (nm_setting_wimax_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -210,8 +219,8 @@ nm_setting_wimax_class_init (NMSettingWimaxClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingWimaxPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingWimaxPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -40,26 +40,7 @@
|
|||||||
* necessary for connection to Ethernet networks.
|
* necessary for connection to Ethernet networks.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingWired, nm_setting_wired, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_WIRED_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIRED, NMSettingWiredPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char *port;
|
|
||||||
guint32 speed;
|
|
||||||
char *duplex;
|
|
||||||
gboolean auto_negotiate;
|
|
||||||
char *device_mac_address;
|
|
||||||
char *cloned_mac_address;
|
|
||||||
char *generate_mac_address_mask;
|
|
||||||
GArray *mac_address_blacklist;
|
|
||||||
guint32 mtu;
|
|
||||||
char **s390_subchannels;
|
|
||||||
char *s390_nettype;
|
|
||||||
GHashTable *s390_options;
|
|
||||||
NMSettingWiredWakeOnLan wol;
|
|
||||||
char *wol_password;
|
|
||||||
} NMSettingWiredPrivate;
|
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingWired,
|
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingWired,
|
||||||
PROP_PORT,
|
PROP_PORT,
|
||||||
@@ -78,6 +59,29 @@ NM_GOBJECT_PROPERTIES_DEFINE (NMSettingWired,
|
|||||||
PROP_WAKE_ON_LAN_PASSWORD,
|
PROP_WAKE_ON_LAN_PASSWORD,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
char *port;
|
||||||
|
guint32 speed;
|
||||||
|
char *duplex;
|
||||||
|
gboolean auto_negotiate;
|
||||||
|
char *device_mac_address;
|
||||||
|
char *cloned_mac_address;
|
||||||
|
char *generate_mac_address_mask;
|
||||||
|
GArray *mac_address_blacklist;
|
||||||
|
guint32 mtu;
|
||||||
|
char **s390_subchannels;
|
||||||
|
char *s390_nettype;
|
||||||
|
GHashTable *s390_options;
|
||||||
|
NMSettingWiredWakeOnLan wol;
|
||||||
|
char *wol_password;
|
||||||
|
} NMSettingWiredPrivate;
|
||||||
|
|
||||||
|
G_DEFINE_TYPE (NMSettingWired, nm_setting_wired, NM_TYPE_SETTING)
|
||||||
|
|
||||||
|
#define NM_SETTING_WIRED_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIRED, NMSettingWiredPrivate))
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static const char *valid_s390_opts[] = {
|
static const char *valid_s390_opts[] = {
|
||||||
"portno", "layer2", "portname", "protocol", "priority_queueing",
|
"portno", "layer2", "portname", "protocol", "priority_queueing",
|
||||||
"buffer_count", "isolation", "total", "inter", "inter_jumbo", "route4",
|
"buffer_count", "isolation", "total", "inter", "inter_jumbo", "route4",
|
||||||
@@ -88,19 +92,6 @@ static const char *valid_s390_opts[] = {
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* nm_setting_wired_new:
|
|
||||||
*
|
|
||||||
* Creates a new #NMSettingWired object with default values.
|
|
||||||
*
|
|
||||||
* Returns: (transfer full): the new empty #NMSettingWired object
|
|
||||||
**/
|
|
||||||
NMSetting *
|
|
||||||
nm_setting_wired_new (void)
|
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_WIRED, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_wired_get_port:
|
* nm_setting_wired_get_port:
|
||||||
* @setting: the #NMSettingWired
|
* @setting: the #NMSettingWired
|
||||||
@@ -807,40 +798,62 @@ clear_blacklist_item (char **item_p)
|
|||||||
g_free (*item_p);
|
g_free (*item_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_wired_init (NMSettingWired *setting)
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
|
NMSettingWired *setting = NM_SETTING_WIRED (object);
|
||||||
NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE (setting);
|
NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE (setting);
|
||||||
|
|
||||||
priv->s390_options = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, g_free);
|
switch (prop_id) {
|
||||||
|
case PROP_PORT:
|
||||||
/* We use GArray rather than GPtrArray so it will automatically be NULL-terminated */
|
g_value_set_string (value, nm_setting_wired_get_port (setting));
|
||||||
priv->mac_address_blacklist = g_array_new (TRUE, FALSE, sizeof (char *));
|
break;
|
||||||
g_array_set_clear_func (priv->mac_address_blacklist, (GDestroyNotify) clear_blacklist_item);
|
case PROP_SPEED:
|
||||||
}
|
g_value_set_uint (value, nm_setting_wired_get_speed (setting));
|
||||||
|
break;
|
||||||
static void
|
case PROP_DUPLEX:
|
||||||
finalize (GObject *object)
|
g_value_set_string (value, nm_setting_wired_get_duplex (setting));
|
||||||
{
|
break;
|
||||||
NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE (object);
|
case PROP_AUTO_NEGOTIATE:
|
||||||
|
g_value_set_boolean (value, nm_setting_wired_get_auto_negotiate (setting));
|
||||||
g_free (priv->port);
|
break;
|
||||||
g_free (priv->duplex);
|
case PROP_MAC_ADDRESS:
|
||||||
g_free (priv->s390_nettype);
|
g_value_set_string (value, nm_setting_wired_get_mac_address (setting));
|
||||||
|
break;
|
||||||
g_hash_table_destroy (priv->s390_options);
|
case PROP_CLONED_MAC_ADDRESS:
|
||||||
|
g_value_set_string (value, nm_setting_wired_get_cloned_mac_address (setting));
|
||||||
g_free (priv->device_mac_address);
|
break;
|
||||||
g_free (priv->cloned_mac_address);
|
case PROP_GENERATE_MAC_ADDRESS_MASK:
|
||||||
g_free (priv->generate_mac_address_mask);
|
g_value_set_string (value, nm_setting_wired_get_generate_mac_address_mask (setting));
|
||||||
g_array_unref (priv->mac_address_blacklist);
|
break;
|
||||||
|
case PROP_MAC_ADDRESS_BLACKLIST:
|
||||||
if (priv->s390_subchannels)
|
g_value_set_boxed (value, (char **) priv->mac_address_blacklist->data);
|
||||||
g_strfreev (priv->s390_subchannels);
|
break;
|
||||||
|
case PROP_MTU:
|
||||||
g_free (priv->wol_password);
|
g_value_set_uint (value, nm_setting_wired_get_mtu (setting));
|
||||||
|
break;
|
||||||
G_OBJECT_CLASS (nm_setting_wired_parent_class)->finalize (object);
|
case PROP_S390_SUBCHANNELS:
|
||||||
|
g_value_set_boxed (value, priv->s390_subchannels);
|
||||||
|
break;
|
||||||
|
case PROP_S390_NETTYPE:
|
||||||
|
g_value_set_string (value, nm_setting_wired_get_s390_nettype (setting));
|
||||||
|
break;
|
||||||
|
case PROP_S390_OPTIONS:
|
||||||
|
g_value_take_boxed (value, _nm_utils_copy_strdict (priv->s390_options));
|
||||||
|
break;
|
||||||
|
case PROP_WAKE_ON_LAN:
|
||||||
|
g_value_set_uint (value, priv->wol);
|
||||||
|
break;
|
||||||
|
case PROP_WAKE_ON_LAN_PASSWORD:
|
||||||
|
g_value_set_string (value, priv->wol_password);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -920,60 +933,55 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object, guint prop_id,
|
nm_setting_wired_init (NMSettingWired *setting)
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
{
|
||||||
NMSettingWired *setting = NM_SETTING_WIRED (object);
|
|
||||||
NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE (setting);
|
NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE (setting);
|
||||||
|
|
||||||
switch (prop_id) {
|
priv->s390_options = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, g_free);
|
||||||
case PROP_PORT:
|
|
||||||
g_value_set_string (value, nm_setting_wired_get_port (setting));
|
/* We use GArray rather than GPtrArray so it will automatically be NULL-terminated */
|
||||||
break;
|
priv->mac_address_blacklist = g_array_new (TRUE, FALSE, sizeof (char *));
|
||||||
case PROP_SPEED:
|
g_array_set_clear_func (priv->mac_address_blacklist, (GDestroyNotify) clear_blacklist_item);
|
||||||
g_value_set_uint (value, nm_setting_wired_get_speed (setting));
|
}
|
||||||
break;
|
|
||||||
case PROP_DUPLEX:
|
/**
|
||||||
g_value_set_string (value, nm_setting_wired_get_duplex (setting));
|
* nm_setting_wired_new:
|
||||||
break;
|
*
|
||||||
case PROP_AUTO_NEGOTIATE:
|
* Creates a new #NMSettingWired object with default values.
|
||||||
g_value_set_boolean (value, nm_setting_wired_get_auto_negotiate (setting));
|
*
|
||||||
break;
|
* Returns: (transfer full): the new empty #NMSettingWired object
|
||||||
case PROP_MAC_ADDRESS:
|
**/
|
||||||
g_value_set_string (value, nm_setting_wired_get_mac_address (setting));
|
NMSetting *
|
||||||
break;
|
nm_setting_wired_new (void)
|
||||||
case PROP_CLONED_MAC_ADDRESS:
|
{
|
||||||
g_value_set_string (value, nm_setting_wired_get_cloned_mac_address (setting));
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_WIRED, NULL);
|
||||||
break;
|
}
|
||||||
case PROP_GENERATE_MAC_ADDRESS_MASK:
|
|
||||||
g_value_set_string (value, nm_setting_wired_get_generate_mac_address_mask (setting));
|
static void
|
||||||
break;
|
finalize (GObject *object)
|
||||||
case PROP_MAC_ADDRESS_BLACKLIST:
|
{
|
||||||
g_value_set_boxed (value, (char **) priv->mac_address_blacklist->data);
|
NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE (object);
|
||||||
break;
|
|
||||||
case PROP_MTU:
|
g_free (priv->port);
|
||||||
g_value_set_uint (value, nm_setting_wired_get_mtu (setting));
|
g_free (priv->duplex);
|
||||||
break;
|
g_free (priv->s390_nettype);
|
||||||
case PROP_S390_SUBCHANNELS:
|
|
||||||
g_value_set_boxed (value, priv->s390_subchannels);
|
g_hash_table_destroy (priv->s390_options);
|
||||||
break;
|
|
||||||
case PROP_S390_NETTYPE:
|
g_free (priv->device_mac_address);
|
||||||
g_value_set_string (value, nm_setting_wired_get_s390_nettype (setting));
|
g_free (priv->cloned_mac_address);
|
||||||
break;
|
g_free (priv->generate_mac_address_mask);
|
||||||
case PROP_S390_OPTIONS:
|
g_array_unref (priv->mac_address_blacklist);
|
||||||
g_value_take_boxed (value, _nm_utils_copy_strdict (priv->s390_options));
|
|
||||||
break;
|
if (priv->s390_subchannels)
|
||||||
case PROP_WAKE_ON_LAN:
|
g_strfreev (priv->s390_subchannels);
|
||||||
g_value_set_uint (value, priv->wol);
|
|
||||||
break;
|
g_free (priv->wol_password);
|
||||||
case PROP_WAKE_ON_LAN_PASSWORD:
|
|
||||||
g_value_set_string (value, priv->wol_password);
|
G_OBJECT_CLASS (nm_setting_wired_parent_class)->finalize (object);
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -985,8 +993,8 @@ nm_setting_wired_class_init (NMSettingWiredClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingWiredPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingWiredPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -22,9 +22,10 @@
|
|||||||
|
|
||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
|
#include "nm-setting-wireless-security.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "nm-setting-wireless-security.h"
|
|
||||||
#include "nm-setting-8021x.h"
|
#include "nm-setting-8021x.h"
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-utils-private.h"
|
#include "nm-utils-private.h"
|
||||||
@@ -53,9 +54,30 @@
|
|||||||
* ISBN: 978-1587051548
|
* ISBN: 978-1587051548
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingWirelessSecurity, nm_setting_wireless_security, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIRELESS_SECURITY, NMSettingWirelessSecurityPrivate))
|
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingWirelessSecurity,
|
||||||
|
PROP_KEY_MGMT,
|
||||||
|
PROP_WEP_TX_KEYIDX,
|
||||||
|
PROP_AUTH_ALG,
|
||||||
|
PROP_PROTO,
|
||||||
|
PROP_PAIRWISE,
|
||||||
|
PROP_GROUP,
|
||||||
|
PROP_PMF,
|
||||||
|
PROP_LEAP_USERNAME,
|
||||||
|
PROP_WEP_KEY0,
|
||||||
|
PROP_WEP_KEY1,
|
||||||
|
PROP_WEP_KEY2,
|
||||||
|
PROP_WEP_KEY3,
|
||||||
|
PROP_WEP_KEY_FLAGS,
|
||||||
|
PROP_WEP_KEY_TYPE,
|
||||||
|
PROP_PSK,
|
||||||
|
PROP_PSK_FLAGS,
|
||||||
|
PROP_LEAP_PASSWORD,
|
||||||
|
PROP_LEAP_PASSWORD_FLAGS,
|
||||||
|
PROP_WPS_METHOD,
|
||||||
|
PROP_FILS,
|
||||||
|
);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *key_mgmt;
|
char *key_mgmt;
|
||||||
@@ -90,41 +112,11 @@ typedef struct {
|
|||||||
NMSettingWirelessSecurityFils fils;
|
NMSettingWirelessSecurityFils fils;
|
||||||
} NMSettingWirelessSecurityPrivate;
|
} NMSettingWirelessSecurityPrivate;
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingWirelessSecurity,
|
G_DEFINE_TYPE (NMSettingWirelessSecurity, nm_setting_wireless_security, NM_TYPE_SETTING)
|
||||||
PROP_KEY_MGMT,
|
|
||||||
PROP_WEP_TX_KEYIDX,
|
|
||||||
PROP_AUTH_ALG,
|
|
||||||
PROP_PROTO,
|
|
||||||
PROP_PAIRWISE,
|
|
||||||
PROP_GROUP,
|
|
||||||
PROP_PMF,
|
|
||||||
PROP_LEAP_USERNAME,
|
|
||||||
PROP_WEP_KEY0,
|
|
||||||
PROP_WEP_KEY1,
|
|
||||||
PROP_WEP_KEY2,
|
|
||||||
PROP_WEP_KEY3,
|
|
||||||
PROP_WEP_KEY_FLAGS,
|
|
||||||
PROP_WEP_KEY_TYPE,
|
|
||||||
PROP_PSK,
|
|
||||||
PROP_PSK_FLAGS,
|
|
||||||
PROP_LEAP_PASSWORD,
|
|
||||||
PROP_LEAP_PASSWORD_FLAGS,
|
|
||||||
PROP_WPS_METHOD,
|
|
||||||
PROP_FILS,
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
#define NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIRELESS_SECURITY, NMSettingWirelessSecurityPrivate))
|
||||||
* nm_setting_wireless_security_new:
|
|
||||||
*
|
/*****************************************************************************/
|
||||||
* Creates a new #NMSettingWirelessSecurity object with default values.
|
|
||||||
*
|
|
||||||
* Returns: (transfer full): the new empty #NMSettingWirelessSecurity object
|
|
||||||
**/
|
|
||||||
NMSetting *
|
|
||||||
nm_setting_wireless_security_new (void)
|
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_WIRELESS_SECURITY, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_wireless_security_get_key_mgmt:
|
* nm_setting_wireless_security_get_key_mgmt:
|
||||||
@@ -1226,36 +1218,6 @@ set_secret_flags (NMSetting *setting,
|
|||||||
return NM_SETTING_CLASS (nm_setting_wireless_security_parent_class)->set_secret_flags (setting, secret_name, flags, error);
|
return NM_SETTING_CLASS (nm_setting_wireless_security_parent_class)->set_secret_flags (setting, secret_name, flags, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
nm_setting_wireless_security_init (NMSettingWirelessSecurity *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
finalize (GObject *object)
|
|
||||||
{
|
|
||||||
NMSettingWirelessSecurity *self = NM_SETTING_WIRELESS_SECURITY (object);
|
|
||||||
NMSettingWirelessSecurityPrivate *priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (self);
|
|
||||||
|
|
||||||
/* Strings first. g_free() already checks for NULLs so we don't have to */
|
|
||||||
|
|
||||||
g_free (priv->key_mgmt);
|
|
||||||
g_free (priv->auth_alg);
|
|
||||||
g_free (priv->leap_username);
|
|
||||||
g_free (priv->wep_key0);
|
|
||||||
g_free (priv->wep_key1);
|
|
||||||
g_free (priv->wep_key2);
|
|
||||||
g_free (priv->wep_key3);
|
|
||||||
g_free (priv->psk);
|
|
||||||
g_free (priv->leap_password);
|
|
||||||
|
|
||||||
g_slist_free_full (priv->proto, g_free);
|
|
||||||
g_slist_free_full (priv->pairwise, g_free);
|
|
||||||
g_slist_free_full (priv->group, g_free);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_setting_wireless_security_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* NMSettingWirelessSecurity:wep-key-type is an enum, but needs to be marshalled
|
/* NMSettingWirelessSecurity:wep-key-type is an enum, but needs to be marshalled
|
||||||
* as 'u', not 'i', for backward-compatibility.
|
* as 'u', not 'i', for backward-compatibility.
|
||||||
*/
|
*/
|
||||||
@@ -1265,6 +1227,82 @@ wep_key_type_to_dbus (const GValue *from)
|
|||||||
return g_variant_new_uint32 (g_value_get_enum (from));
|
return g_variant_new_uint32 (g_value_get_enum (from));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
NMSettingWirelessSecurity *setting = NM_SETTING_WIRELESS_SECURITY (object);
|
||||||
|
NMSettingWirelessSecurityPrivate *priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
case PROP_KEY_MGMT:
|
||||||
|
g_value_set_string (value, priv->key_mgmt);
|
||||||
|
break;
|
||||||
|
case PROP_WEP_TX_KEYIDX:
|
||||||
|
g_value_set_uint (value, priv->wep_tx_keyidx);
|
||||||
|
break;
|
||||||
|
case PROP_AUTH_ALG:
|
||||||
|
g_value_set_string (value, priv->auth_alg);
|
||||||
|
break;
|
||||||
|
case PROP_PROTO:
|
||||||
|
g_value_take_boxed (value, _nm_utils_slist_to_strv (priv->proto, TRUE));
|
||||||
|
break;
|
||||||
|
case PROP_PAIRWISE:
|
||||||
|
g_value_take_boxed (value, _nm_utils_slist_to_strv (priv->pairwise, TRUE));
|
||||||
|
break;
|
||||||
|
case PROP_GROUP:
|
||||||
|
g_value_take_boxed (value, _nm_utils_slist_to_strv (priv->group, TRUE));
|
||||||
|
break;
|
||||||
|
case PROP_PMF:
|
||||||
|
g_value_set_int (value, nm_setting_wireless_security_get_pmf (setting));
|
||||||
|
break;
|
||||||
|
case PROP_LEAP_USERNAME:
|
||||||
|
g_value_set_string (value, priv->leap_username);
|
||||||
|
break;
|
||||||
|
case PROP_WEP_KEY0:
|
||||||
|
g_value_set_string (value, priv->wep_key0);
|
||||||
|
break;
|
||||||
|
case PROP_WEP_KEY1:
|
||||||
|
g_value_set_string (value, priv->wep_key1);
|
||||||
|
break;
|
||||||
|
case PROP_WEP_KEY2:
|
||||||
|
g_value_set_string (value, priv->wep_key2);
|
||||||
|
break;
|
||||||
|
case PROP_WEP_KEY3:
|
||||||
|
g_value_set_string (value, priv->wep_key3);
|
||||||
|
break;
|
||||||
|
case PROP_WEP_KEY_FLAGS:
|
||||||
|
g_value_set_flags (value, priv->wep_key_flags);
|
||||||
|
break;
|
||||||
|
case PROP_PSK:
|
||||||
|
g_value_set_string (value, priv->psk);
|
||||||
|
break;
|
||||||
|
case PROP_PSK_FLAGS:
|
||||||
|
g_value_set_flags (value, priv->psk_flags);
|
||||||
|
break;
|
||||||
|
case PROP_LEAP_PASSWORD:
|
||||||
|
g_value_set_string (value, priv->leap_password);
|
||||||
|
break;
|
||||||
|
case PROP_LEAP_PASSWORD_FLAGS:
|
||||||
|
g_value_set_flags (value, priv->leap_password_flags);
|
||||||
|
break;
|
||||||
|
case PROP_WEP_KEY_TYPE:
|
||||||
|
g_value_set_enum (value, priv->wep_key_type);
|
||||||
|
break;
|
||||||
|
case PROP_WPS_METHOD:
|
||||||
|
g_value_set_uint (value, priv->wps_method);
|
||||||
|
break;
|
||||||
|
case PROP_FILS:
|
||||||
|
g_value_set_int (value, nm_setting_wireless_security_get_fils (setting));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_property (GObject *object, guint prop_id,
|
set_property (GObject *object, guint prop_id,
|
||||||
const GValue *value, GParamSpec *pspec)
|
const GValue *value, GParamSpec *pspec)
|
||||||
@@ -1354,78 +1392,47 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
get_property (GObject *object, guint prop_id,
|
|
||||||
GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingWirelessSecurity *setting = NM_SETTING_WIRELESS_SECURITY (object);
|
|
||||||
NMSettingWirelessSecurityPrivate *priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
static void
|
||||||
case PROP_KEY_MGMT:
|
nm_setting_wireless_security_init (NMSettingWirelessSecurity *setting)
|
||||||
g_value_set_string (value, priv->key_mgmt);
|
{
|
||||||
break;
|
}
|
||||||
case PROP_WEP_TX_KEYIDX:
|
|
||||||
g_value_set_uint (value, priv->wep_tx_keyidx);
|
/**
|
||||||
break;
|
* nm_setting_wireless_security_new:
|
||||||
case PROP_AUTH_ALG:
|
*
|
||||||
g_value_set_string (value, priv->auth_alg);
|
* Creates a new #NMSettingWirelessSecurity object with default values.
|
||||||
break;
|
*
|
||||||
case PROP_PROTO:
|
* Returns: (transfer full): the new empty #NMSettingWirelessSecurity object
|
||||||
g_value_take_boxed (value, _nm_utils_slist_to_strv (priv->proto, TRUE));
|
**/
|
||||||
break;
|
NMSetting *
|
||||||
case PROP_PAIRWISE:
|
nm_setting_wireless_security_new (void)
|
||||||
g_value_take_boxed (value, _nm_utils_slist_to_strv (priv->pairwise, TRUE));
|
{
|
||||||
break;
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_WIRELESS_SECURITY, NULL);
|
||||||
case PROP_GROUP:
|
}
|
||||||
g_value_take_boxed (value, _nm_utils_slist_to_strv (priv->group, TRUE));
|
|
||||||
break;
|
static void
|
||||||
case PROP_PMF:
|
finalize (GObject *object)
|
||||||
g_value_set_int (value, nm_setting_wireless_security_get_pmf (setting));
|
{
|
||||||
break;
|
NMSettingWirelessSecurity *self = NM_SETTING_WIRELESS_SECURITY (object);
|
||||||
case PROP_LEAP_USERNAME:
|
NMSettingWirelessSecurityPrivate *priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (self);
|
||||||
g_value_set_string (value, priv->leap_username);
|
|
||||||
break;
|
g_free (priv->key_mgmt);
|
||||||
case PROP_WEP_KEY0:
|
g_free (priv->auth_alg);
|
||||||
g_value_set_string (value, priv->wep_key0);
|
g_free (priv->leap_username);
|
||||||
break;
|
g_free (priv->wep_key0);
|
||||||
case PROP_WEP_KEY1:
|
g_free (priv->wep_key1);
|
||||||
g_value_set_string (value, priv->wep_key1);
|
g_free (priv->wep_key2);
|
||||||
break;
|
g_free (priv->wep_key3);
|
||||||
case PROP_WEP_KEY2:
|
g_free (priv->psk);
|
||||||
g_value_set_string (value, priv->wep_key2);
|
g_free (priv->leap_password);
|
||||||
break;
|
|
||||||
case PROP_WEP_KEY3:
|
g_slist_free_full (priv->proto, g_free);
|
||||||
g_value_set_string (value, priv->wep_key3);
|
g_slist_free_full (priv->pairwise, g_free);
|
||||||
break;
|
g_slist_free_full (priv->group, g_free);
|
||||||
case PROP_WEP_KEY_FLAGS:
|
|
||||||
g_value_set_flags (value, priv->wep_key_flags);
|
G_OBJECT_CLASS (nm_setting_wireless_security_parent_class)->finalize (object);
|
||||||
break;
|
|
||||||
case PROP_PSK:
|
|
||||||
g_value_set_string (value, priv->psk);
|
|
||||||
break;
|
|
||||||
case PROP_PSK_FLAGS:
|
|
||||||
g_value_set_flags (value, priv->psk_flags);
|
|
||||||
break;
|
|
||||||
case PROP_LEAP_PASSWORD:
|
|
||||||
g_value_set_string (value, priv->leap_password);
|
|
||||||
break;
|
|
||||||
case PROP_LEAP_PASSWORD_FLAGS:
|
|
||||||
g_value_set_flags (value, priv->leap_password_flags);
|
|
||||||
break;
|
|
||||||
case PROP_WEP_KEY_TYPE:
|
|
||||||
g_value_set_enum (value, priv->wep_key_type);
|
|
||||||
break;
|
|
||||||
case PROP_WPS_METHOD:
|
|
||||||
g_value_set_uint (value, priv->wps_method);
|
|
||||||
break;
|
|
||||||
case PROP_FILS:
|
|
||||||
g_value_set_int (value, nm_setting_wireless_security_get_fils (setting));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1437,8 +1444,8 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingWirelessSecurityPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingWirelessSecurityPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -40,9 +40,27 @@
|
|||||||
* necessary for connection to 802.11 Wi-Fi networks.
|
* necessary for connection to 802.11 Wi-Fi networks.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingWireless, nm_setting_wireless, NM_TYPE_SETTING)
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define NM_SETTING_WIRELESS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIRELESS, NMSettingWirelessPrivate))
|
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingWireless,
|
||||||
|
PROP_SSID,
|
||||||
|
PROP_MODE,
|
||||||
|
PROP_BAND,
|
||||||
|
PROP_CHANNEL,
|
||||||
|
PROP_BSSID,
|
||||||
|
PROP_RATE,
|
||||||
|
PROP_TX_POWER,
|
||||||
|
PROP_MAC_ADDRESS,
|
||||||
|
PROP_CLONED_MAC_ADDRESS,
|
||||||
|
PROP_GENERATE_MAC_ADDRESS_MASK,
|
||||||
|
PROP_MAC_ADDRESS_BLACKLIST,
|
||||||
|
PROP_MTU,
|
||||||
|
PROP_SEEN_BSSIDS,
|
||||||
|
PROP_HIDDEN,
|
||||||
|
PROP_POWERSAVE,
|
||||||
|
PROP_MAC_ADDRESS_RANDOMIZATION,
|
||||||
|
PROP_WAKE_ON_WLAN,
|
||||||
|
);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
GBytes *ssid;
|
GBytes *ssid;
|
||||||
@@ -64,25 +82,11 @@ typedef struct {
|
|||||||
guint32 wowl;
|
guint32 wowl;
|
||||||
} NMSettingWirelessPrivate;
|
} NMSettingWirelessPrivate;
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE (NMSettingWireless,
|
G_DEFINE_TYPE (NMSettingWireless, nm_setting_wireless, NM_TYPE_SETTING)
|
||||||
PROP_SSID,
|
|
||||||
PROP_MODE,
|
#define NM_SETTING_WIRELESS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WIRELESS, NMSettingWirelessPrivate))
|
||||||
PROP_BAND,
|
|
||||||
PROP_CHANNEL,
|
/*****************************************************************************/
|
||||||
PROP_BSSID,
|
|
||||||
PROP_RATE,
|
|
||||||
PROP_TX_POWER,
|
|
||||||
PROP_MAC_ADDRESS,
|
|
||||||
PROP_CLONED_MAC_ADDRESS,
|
|
||||||
PROP_GENERATE_MAC_ADDRESS_MASK,
|
|
||||||
PROP_MAC_ADDRESS_BLACKLIST,
|
|
||||||
PROP_MTU,
|
|
||||||
PROP_SEEN_BSSIDS,
|
|
||||||
PROP_HIDDEN,
|
|
||||||
PROP_POWERSAVE,
|
|
||||||
PROP_MAC_ADDRESS_RANDOMIZATION,
|
|
||||||
PROP_WAKE_ON_WLAN,
|
|
||||||
);
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
match_cipher (const char *cipher,
|
match_cipher (const char *cipher,
|
||||||
@@ -281,19 +285,6 @@ nm_setting_wireless_ap_security_compatible (NMSettingWireless *s_wireless,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* nm_setting_wireless_new:
|
|
||||||
*
|
|
||||||
* Creates a new #NMSettingWireless object with default values.
|
|
||||||
*
|
|
||||||
* Returns: (transfer full): the new empty #NMSettingWireless object
|
|
||||||
**/
|
|
||||||
NMSetting *
|
|
||||||
nm_setting_wireless_new (void)
|
|
||||||
{
|
|
||||||
return (NMSetting *) g_object_new (NM_TYPE_SETTING_WIRELESS, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_wireless_get_ssid:
|
* nm_setting_wireless_get_ssid:
|
||||||
* @setting: the #NMSettingWireless
|
* @setting: the #NMSettingWireless
|
||||||
@@ -991,34 +982,71 @@ clear_blacklist_item (char **item_p)
|
|||||||
g_free (*item_p);
|
g_free (*item_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/*****************************************************************************/
|
||||||
nm_setting_wireless_init (NMSettingWireless *setting)
|
|
||||||
{
|
|
||||||
NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE (setting);
|
|
||||||
|
|
||||||
/* We use GArray rather than GPtrArray so it will automatically be NULL-terminated */
|
|
||||||
priv->mac_address_blacklist = g_array_new (TRUE, FALSE, sizeof (char *));
|
|
||||||
g_array_set_clear_func (priv->mac_address_blacklist, (GDestroyNotify) clear_blacklist_item);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
finalize (GObject *object)
|
get_property (GObject *object, guint prop_id,
|
||||||
|
GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
|
NMSettingWireless *setting = NM_SETTING_WIRELESS (object);
|
||||||
NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE (object);
|
NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE (object);
|
||||||
|
|
||||||
g_free (priv->mode);
|
switch (prop_id) {
|
||||||
g_free (priv->band);
|
case PROP_SSID:
|
||||||
|
g_value_set_boxed (value, nm_setting_wireless_get_ssid (setting));
|
||||||
if (priv->ssid)
|
break;
|
||||||
g_bytes_unref (priv->ssid);
|
case PROP_MODE:
|
||||||
g_free (priv->bssid);
|
g_value_set_string (value, nm_setting_wireless_get_mode (setting));
|
||||||
g_free (priv->device_mac_address);
|
break;
|
||||||
g_free (priv->cloned_mac_address);
|
case PROP_BAND:
|
||||||
g_free (priv->generate_mac_address_mask);
|
g_value_set_string (value, nm_setting_wireless_get_band (setting));
|
||||||
g_array_unref (priv->mac_address_blacklist);
|
break;
|
||||||
g_slist_free_full (priv->seen_bssids, g_free);
|
case PROP_CHANNEL:
|
||||||
|
g_value_set_uint (value, nm_setting_wireless_get_channel (setting));
|
||||||
G_OBJECT_CLASS (nm_setting_wireless_parent_class)->finalize (object);
|
break;
|
||||||
|
case PROP_BSSID:
|
||||||
|
g_value_set_string (value, nm_setting_wireless_get_bssid (setting));
|
||||||
|
break;
|
||||||
|
case PROP_RATE:
|
||||||
|
g_value_set_uint (value, nm_setting_wireless_get_rate (setting));
|
||||||
|
break;
|
||||||
|
case PROP_TX_POWER:
|
||||||
|
g_value_set_uint (value, nm_setting_wireless_get_tx_power (setting));
|
||||||
|
break;
|
||||||
|
case PROP_MAC_ADDRESS:
|
||||||
|
g_value_set_string (value, nm_setting_wireless_get_mac_address (setting));
|
||||||
|
break;
|
||||||
|
case PROP_CLONED_MAC_ADDRESS:
|
||||||
|
g_value_set_string (value, nm_setting_wireless_get_cloned_mac_address (setting));
|
||||||
|
break;
|
||||||
|
case PROP_GENERATE_MAC_ADDRESS_MASK:
|
||||||
|
g_value_set_string (value, nm_setting_wireless_get_generate_mac_address_mask (setting));
|
||||||
|
break;
|
||||||
|
case PROP_MAC_ADDRESS_BLACKLIST:
|
||||||
|
g_value_set_boxed (value, (char **) priv->mac_address_blacklist->data);
|
||||||
|
break;
|
||||||
|
case PROP_MTU:
|
||||||
|
g_value_set_uint (value, nm_setting_wireless_get_mtu (setting));
|
||||||
|
break;
|
||||||
|
case PROP_SEEN_BSSIDS:
|
||||||
|
g_value_take_boxed (value, _nm_utils_slist_to_strv (priv->seen_bssids, TRUE));
|
||||||
|
break;
|
||||||
|
case PROP_HIDDEN:
|
||||||
|
g_value_set_boolean (value, nm_setting_wireless_get_hidden (setting));
|
||||||
|
break;
|
||||||
|
case PROP_POWERSAVE:
|
||||||
|
g_value_set_uint (value, nm_setting_wireless_get_powersave (setting));
|
||||||
|
break;
|
||||||
|
case PROP_MAC_ADDRESS_RANDOMIZATION:
|
||||||
|
g_value_set_uint (value, nm_setting_wireless_get_mac_address_randomization (setting));
|
||||||
|
break;
|
||||||
|
case PROP_WAKE_ON_WLAN:
|
||||||
|
g_value_set_uint (value, nm_setting_wireless_get_wake_on_wlan (setting));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1116,69 +1144,49 @@ set_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object, guint prop_id,
|
nm_setting_wireless_init (NMSettingWireless *setting)
|
||||||
GValue *value, GParamSpec *pspec)
|
{
|
||||||
|
NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE (setting);
|
||||||
|
|
||||||
|
/* We use GArray rather than GPtrArray so it will automatically be NULL-terminated */
|
||||||
|
priv->mac_address_blacklist = g_array_new (TRUE, FALSE, sizeof (char *));
|
||||||
|
g_array_set_clear_func (priv->mac_address_blacklist, (GDestroyNotify) clear_blacklist_item);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nm_setting_wireless_new:
|
||||||
|
*
|
||||||
|
* Creates a new #NMSettingWireless object with default values.
|
||||||
|
*
|
||||||
|
* Returns: (transfer full): the new empty #NMSettingWireless object
|
||||||
|
**/
|
||||||
|
NMSetting *
|
||||||
|
nm_setting_wireless_new (void)
|
||||||
|
{
|
||||||
|
return (NMSetting *) g_object_new (NM_TYPE_SETTING_WIRELESS, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
finalize (GObject *object)
|
||||||
{
|
{
|
||||||
NMSettingWireless *setting = NM_SETTING_WIRELESS (object);
|
|
||||||
NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE (object);
|
NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
g_free (priv->mode);
|
||||||
case PROP_SSID:
|
g_free (priv->band);
|
||||||
g_value_set_boxed (value, nm_setting_wireless_get_ssid (setting));
|
|
||||||
break;
|
if (priv->ssid)
|
||||||
case PROP_MODE:
|
g_bytes_unref (priv->ssid);
|
||||||
g_value_set_string (value, nm_setting_wireless_get_mode (setting));
|
g_free (priv->bssid);
|
||||||
break;
|
g_free (priv->device_mac_address);
|
||||||
case PROP_BAND:
|
g_free (priv->cloned_mac_address);
|
||||||
g_value_set_string (value, nm_setting_wireless_get_band (setting));
|
g_free (priv->generate_mac_address_mask);
|
||||||
break;
|
g_array_unref (priv->mac_address_blacklist);
|
||||||
case PROP_CHANNEL:
|
g_slist_free_full (priv->seen_bssids, g_free);
|
||||||
g_value_set_uint (value, nm_setting_wireless_get_channel (setting));
|
|
||||||
break;
|
G_OBJECT_CLASS (nm_setting_wireless_parent_class)->finalize (object);
|
||||||
case PROP_BSSID:
|
|
||||||
g_value_set_string (value, nm_setting_wireless_get_bssid (setting));
|
|
||||||
break;
|
|
||||||
case PROP_RATE:
|
|
||||||
g_value_set_uint (value, nm_setting_wireless_get_rate (setting));
|
|
||||||
break;
|
|
||||||
case PROP_TX_POWER:
|
|
||||||
g_value_set_uint (value, nm_setting_wireless_get_tx_power (setting));
|
|
||||||
break;
|
|
||||||
case PROP_MAC_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_setting_wireless_get_mac_address (setting));
|
|
||||||
break;
|
|
||||||
case PROP_CLONED_MAC_ADDRESS:
|
|
||||||
g_value_set_string (value, nm_setting_wireless_get_cloned_mac_address (setting));
|
|
||||||
break;
|
|
||||||
case PROP_GENERATE_MAC_ADDRESS_MASK:
|
|
||||||
g_value_set_string (value, nm_setting_wireless_get_generate_mac_address_mask (setting));
|
|
||||||
break;
|
|
||||||
case PROP_MAC_ADDRESS_BLACKLIST:
|
|
||||||
g_value_set_boxed (value, (char **) priv->mac_address_blacklist->data);
|
|
||||||
break;
|
|
||||||
case PROP_MTU:
|
|
||||||
g_value_set_uint (value, nm_setting_wireless_get_mtu (setting));
|
|
||||||
break;
|
|
||||||
case PROP_SEEN_BSSIDS:
|
|
||||||
g_value_take_boxed (value, _nm_utils_slist_to_strv (priv->seen_bssids, TRUE));
|
|
||||||
break;
|
|
||||||
case PROP_HIDDEN:
|
|
||||||
g_value_set_boolean (value, nm_setting_wireless_get_hidden (setting));
|
|
||||||
break;
|
|
||||||
case PROP_POWERSAVE:
|
|
||||||
g_value_set_uint (value, nm_setting_wireless_get_powersave (setting));
|
|
||||||
break;
|
|
||||||
case PROP_MAC_ADDRESS_RANDOMIZATION:
|
|
||||||
g_value_set_uint (value, nm_setting_wireless_get_mac_address_randomization (setting));
|
|
||||||
break;
|
|
||||||
case PROP_WAKE_ON_WLAN:
|
|
||||||
g_value_set_uint (value, nm_setting_wireless_get_wake_on_wlan (setting));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -26,6 +26,14 @@
|
|||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
#include "nm-utils-private.h"
|
#include "nm-utils-private.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SECTION:nm-setting-wpan
|
||||||
|
* @short_description: Describes connection properties for IEEE 802.15.4 (WPAN) MAC
|
||||||
|
*
|
||||||
|
* The #NMSettingWpan object is a #NMSetting subclass that describes properties
|
||||||
|
* necessary for configuring IEEE 802.15.4 (WPAN) MAC layer devices.
|
||||||
|
**/
|
||||||
|
|
||||||
/* Ideally we'll be able to get these from a public header. */
|
/* Ideally we'll be able to get these from a public header. */
|
||||||
#ifndef IEEE802154_ADDR_LEN
|
#ifndef IEEE802154_ADDR_LEN
|
||||||
#define IEEE802154_ADDR_LEN 8
|
#define IEEE802154_ADDR_LEN 8
|
||||||
@@ -39,6 +47,8 @@
|
|||||||
#define IEEE802154_MAX_CHANNEL 26
|
#define IEEE802154_MAX_CHANNEL 26
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||||
PROP_MAC_ADDRESS,
|
PROP_MAC_ADDRESS,
|
||||||
PROP_PAN_ID,
|
PROP_PAN_ID,
|
||||||
@@ -68,18 +78,12 @@ struct _NMSettingWpanClass {
|
|||||||
NMSettingClass parent;
|
NMSettingClass parent;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* SECTION:nm-setting-wpan
|
|
||||||
* @short_description: Describes connection properties for IEEE 802.15.4 (WPAN) MAC
|
|
||||||
*
|
|
||||||
* The #NMSettingWpan object is a #NMSetting subclass that describes properties
|
|
||||||
* necessary for configuring IEEE 802.15.4 (WPAN) MAC layer devices.
|
|
||||||
**/
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (NMSettingWpan, nm_setting_wpan, NM_TYPE_SETTING)
|
G_DEFINE_TYPE (NMSettingWpan, nm_setting_wpan, NM_TYPE_SETTING)
|
||||||
|
|
||||||
#define NM_SETTING_WPAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WPAN, NMSettingWpanPrivate))
|
#define NM_SETTING_WPAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_WPAN, NMSettingWpanPrivate))
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_wpan_get_mac_address:
|
* nm_setting_wpan_get_mac_address:
|
||||||
* @setting: the #NMSettingWpan
|
* @setting: the #NMSettingWpan
|
||||||
@@ -208,6 +212,8 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
@@ -264,6 +270,8 @@ set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *p
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_wpan_init (NMSettingWpan *setting)
|
nm_setting_wpan_init (NMSettingWpan *setting)
|
||||||
{
|
{
|
||||||
@@ -308,8 +316,8 @@ nm_setting_wpan_class_init (NMSettingWpanClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (setting_class, sizeof (NMSettingWpanPrivate));
|
g_type_class_add_private (setting_class, sizeof (NMSettingWpanPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
@@ -2516,11 +2516,6 @@ _nm_setting_gendata_reset_from_hash (NMSetting *setting,
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
|
||||||
nm_setting_init (NMSetting *setting)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_property (GObject *object, guint prop_id,
|
get_property (GObject *object, guint prop_id,
|
||||||
GValue *value, GParamSpec *pspec)
|
GValue *value, GParamSpec *pspec)
|
||||||
@@ -2537,6 +2532,13 @@ get_property (GObject *object, guint prop_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void
|
||||||
|
nm_setting_init (NMSetting *setting)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
finalize (GObject *object)
|
finalize (GObject *object)
|
||||||
{
|
{
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
#include "nm-default.h"
|
#include "nm-default.h"
|
||||||
|
|
||||||
#include "nm-simple-connection.h"
|
#include "nm-simple-connection.h"
|
||||||
|
|
||||||
#include "nm-setting-private.h"
|
#include "nm-setting-private.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32,12 +33,16 @@
|
|||||||
* but might be used in the process of creating a new one.
|
* but might be used in the process of creating a new one.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void nm_simple_connection_interface_init (NMConnectionInterface *iface);
|
static void nm_simple_connection_interface_init (NMConnectionInterface *iface);
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (NMSimpleConnection, nm_simple_connection, G_TYPE_OBJECT,
|
G_DEFINE_TYPE_WITH_CODE (NMSimpleConnection, nm_simple_connection, G_TYPE_OBJECT,
|
||||||
G_IMPLEMENT_INTERFACE (NM_TYPE_CONNECTION, nm_simple_connection_interface_init);
|
G_IMPLEMENT_INTERFACE (NM_TYPE_CONNECTION, nm_simple_connection_interface_init);
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_simple_connection_init (NMSimpleConnection *self)
|
nm_simple_connection_init (NMSimpleConnection *self)
|
||||||
{
|
{
|
||||||
|
@@ -29,6 +29,8 @@
|
|||||||
|
|
||||||
#include "nm-core-internal.h"
|
#include "nm-core-internal.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void nm_vpn_editor_plugin_default_init (NMVpnEditorPluginInterface *iface);
|
static void nm_vpn_editor_plugin_default_init (NMVpnEditorPluginInterface *iface);
|
||||||
|
|
||||||
G_DEFINE_INTERFACE (NMVpnEditorPlugin, nm_vpn_editor_plugin, G_TYPE_OBJECT)
|
G_DEFINE_INTERFACE (NMVpnEditorPlugin, nm_vpn_editor_plugin, G_TYPE_OBJECT)
|
||||||
@@ -36,18 +38,16 @@ G_DEFINE_INTERFACE (NMVpnEditorPlugin, nm_vpn_editor_plugin, G_TYPE_OBJECT)
|
|||||||
static void
|
static void
|
||||||
nm_vpn_editor_plugin_default_init (NMVpnEditorPluginInterface *iface)
|
nm_vpn_editor_plugin_default_init (NMVpnEditorPluginInterface *iface)
|
||||||
{
|
{
|
||||||
/* Properties */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMVpnEditorPlugin:name:
|
* NMVpnEditorPlugin:name:
|
||||||
*
|
*
|
||||||
* Short display name of the VPN plugin.
|
* Short display name of the VPN plugin.
|
||||||
*/
|
*/
|
||||||
g_object_interface_install_property (iface,
|
g_object_interface_install_property (iface,
|
||||||
g_param_spec_string (NM_VPN_EDITOR_PLUGIN_NAME, "", "",
|
g_param_spec_string (NM_VPN_EDITOR_PLUGIN_NAME, "", "",
|
||||||
NULL,
|
NULL,
|
||||||
G_PARAM_READABLE |
|
G_PARAM_READABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMVpnEditorPlugin:description:
|
* NMVpnEditorPlugin:description:
|
||||||
@@ -55,10 +55,10 @@ nm_vpn_editor_plugin_default_init (NMVpnEditorPluginInterface *iface)
|
|||||||
* Longer description of the VPN plugin.
|
* Longer description of the VPN plugin.
|
||||||
*/
|
*/
|
||||||
g_object_interface_install_property (iface,
|
g_object_interface_install_property (iface,
|
||||||
g_param_spec_string (NM_VPN_EDITOR_PLUGIN_DESCRIPTION, "", "",
|
g_param_spec_string (NM_VPN_EDITOR_PLUGIN_DESCRIPTION, "", "",
|
||||||
NULL,
|
NULL,
|
||||||
G_PARAM_READABLE |
|
G_PARAM_READABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMVpnEditorPlugin:service:
|
* NMVpnEditorPlugin:service:
|
||||||
@@ -66,10 +66,10 @@ nm_vpn_editor_plugin_default_init (NMVpnEditorPluginInterface *iface)
|
|||||||
* D-Bus service name of the plugin's VPN service.
|
* D-Bus service name of the plugin's VPN service.
|
||||||
*/
|
*/
|
||||||
g_object_interface_install_property (iface,
|
g_object_interface_install_property (iface,
|
||||||
g_param_spec_string (NM_VPN_EDITOR_PLUGIN_SERVICE, "", "",
|
g_param_spec_string (NM_VPN_EDITOR_PLUGIN_SERVICE, "", "",
|
||||||
NULL,
|
NULL,
|
||||||
G_PARAM_READABLE |
|
G_PARAM_READABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@@ -1095,60 +1095,42 @@ nm_vpn_plugin_info_load_editor_plugin (NMVpnPluginInfo *self, GError **error)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
static void
|
||||||
* nm_vpn_plugin_info_new_from_file:
|
get_property (GObject *object, guint prop_id,
|
||||||
* @filename: filename to read.
|
GValue *value, GParamSpec *pspec)
|
||||||
* @error: on failure, the error reason.
|
|
||||||
*
|
|
||||||
* Read the plugin info from file @filename. Does not do
|
|
||||||
* any further verification on the file. You might want to check
|
|
||||||
* file permissions and ownership of the file.
|
|
||||||
*
|
|
||||||
* Returns: %NULL if there is any error or a newly created
|
|
||||||
* #NMVpnPluginInfo instance.
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
*/
|
|
||||||
NMVpnPluginInfo *
|
|
||||||
nm_vpn_plugin_info_new_from_file (const char *filename,
|
|
||||||
GError **error)
|
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (filename, NULL);
|
NMVpnPluginInfoPrivate *priv = NM_VPN_PLUGIN_INFO_GET_PRIVATE (object);
|
||||||
|
|
||||||
return NM_VPN_PLUGIN_INFO (g_initable_new (NM_TYPE_VPN_PLUGIN_INFO,
|
switch (prop_id) {
|
||||||
NULL,
|
case PROP_NAME:
|
||||||
error,
|
g_value_set_string (value, priv->name);
|
||||||
NM_VPN_PLUGIN_INFO_FILENAME, filename,
|
break;
|
||||||
NULL));
|
case PROP_FILENAME:
|
||||||
|
g_value_set_string (value, priv->filename);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
static void
|
||||||
* nm_vpn_plugin_info_new_with_data:
|
set_property (GObject *object, guint prop_id,
|
||||||
* @filename: optional filename.
|
const GValue *value, GParamSpec *pspec)
|
||||||
* @keyfile: inject data for the plugin info instance.
|
|
||||||
* @error: construction may fail if the keyfile lacks mandatory fields.
|
|
||||||
* In this case, return the error reason.
|
|
||||||
*
|
|
||||||
* This constructor does not read any data from file but
|
|
||||||
* takes instead a @keyfile argument.
|
|
||||||
*
|
|
||||||
* Returns: new plugin info instance.
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
*/
|
|
||||||
NMVpnPluginInfo *
|
|
||||||
nm_vpn_plugin_info_new_with_data (const char *filename,
|
|
||||||
GKeyFile *keyfile,
|
|
||||||
GError **error)
|
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (keyfile, NULL);
|
NMVpnPluginInfoPrivate *priv = NM_VPN_PLUGIN_INFO_GET_PRIVATE (object);
|
||||||
|
|
||||||
return NM_VPN_PLUGIN_INFO (g_initable_new (NM_TYPE_VPN_PLUGIN_INFO,
|
switch (prop_id) {
|
||||||
NULL,
|
case PROP_FILENAME:
|
||||||
error,
|
priv->filename = g_value_dup_string (value);
|
||||||
NM_VPN_PLUGIN_INFO_FILENAME, filename,
|
break;
|
||||||
NM_VPN_PLUGIN_INFO_KEYFILE, keyfile,
|
case PROP_KEYFILE:
|
||||||
NULL));
|
priv->keyfile = g_value_dup_boxed (value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -1224,42 +1206,60 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/**
|
||||||
set_property (GObject *object, guint prop_id,
|
* nm_vpn_plugin_info_new_from_file:
|
||||||
const GValue *value, GParamSpec *pspec)
|
* @filename: filename to read.
|
||||||
|
* @error: on failure, the error reason.
|
||||||
|
*
|
||||||
|
* Read the plugin info from file @filename. Does not do
|
||||||
|
* any further verification on the file. You might want to check
|
||||||
|
* file permissions and ownership of the file.
|
||||||
|
*
|
||||||
|
* Returns: %NULL if there is any error or a newly created
|
||||||
|
* #NMVpnPluginInfo instance.
|
||||||
|
*
|
||||||
|
* Since: 1.2
|
||||||
|
*/
|
||||||
|
NMVpnPluginInfo *
|
||||||
|
nm_vpn_plugin_info_new_from_file (const char *filename,
|
||||||
|
GError **error)
|
||||||
{
|
{
|
||||||
NMVpnPluginInfoPrivate *priv = NM_VPN_PLUGIN_INFO_GET_PRIVATE (object);
|
g_return_val_if_fail (filename, NULL);
|
||||||
|
|
||||||
switch (prop_id) {
|
return NM_VPN_PLUGIN_INFO (g_initable_new (NM_TYPE_VPN_PLUGIN_INFO,
|
||||||
case PROP_FILENAME:
|
NULL,
|
||||||
priv->filename = g_value_dup_string (value);
|
error,
|
||||||
break;
|
NM_VPN_PLUGIN_INFO_FILENAME, filename,
|
||||||
case PROP_KEYFILE:
|
NULL));
|
||||||
priv->keyfile = g_value_dup_boxed (value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
/**
|
||||||
get_property (GObject *object, guint prop_id,
|
* nm_vpn_plugin_info_new_with_data:
|
||||||
GValue *value, GParamSpec *pspec)
|
* @filename: optional filename.
|
||||||
|
* @keyfile: inject data for the plugin info instance.
|
||||||
|
* @error: construction may fail if the keyfile lacks mandatory fields.
|
||||||
|
* In this case, return the error reason.
|
||||||
|
*
|
||||||
|
* This constructor does not read any data from file but
|
||||||
|
* takes instead a @keyfile argument.
|
||||||
|
*
|
||||||
|
* Returns: new plugin info instance.
|
||||||
|
*
|
||||||
|
* Since: 1.2
|
||||||
|
*/
|
||||||
|
NMVpnPluginInfo *
|
||||||
|
nm_vpn_plugin_info_new_with_data (const char *filename,
|
||||||
|
GKeyFile *keyfile,
|
||||||
|
GError **error)
|
||||||
{
|
{
|
||||||
NMVpnPluginInfoPrivate *priv = NM_VPN_PLUGIN_INFO_GET_PRIVATE (object);
|
g_return_val_if_fail (keyfile, NULL);
|
||||||
|
|
||||||
switch (prop_id) {
|
return NM_VPN_PLUGIN_INFO (g_initable_new (NM_TYPE_VPN_PLUGIN_INFO,
|
||||||
case PROP_NAME:
|
NULL,
|
||||||
g_value_set_string (value, priv->name);
|
error,
|
||||||
break;
|
NM_VPN_PLUGIN_INFO_FILENAME, filename,
|
||||||
case PROP_FILENAME:
|
NM_VPN_PLUGIN_INFO_KEYFILE, keyfile,
|
||||||
g_value_set_string (value, priv->filename);
|
NULL));
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1298,14 +1298,11 @@ nm_vpn_plugin_info_class_init (NMVpnPluginInfoClass *plugin_class)
|
|||||||
|
|
||||||
g_type_class_add_private (object_class, sizeof (NMVpnPluginInfoPrivate));
|
g_type_class_add_private (object_class, sizeof (NMVpnPluginInfoPrivate));
|
||||||
|
|
||||||
/* virtual methods */
|
|
||||||
object_class->set_property = set_property;
|
object_class->set_property = set_property;
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->dispose = dispose;
|
object_class->dispose = dispose;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
/* properties */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMVpnPluginInfo:name:
|
* NMVpnPluginInfo:name:
|
||||||
*
|
*
|
||||||
@@ -1361,4 +1358,3 @@ nm_vpn_plugin_info_initable_iface_init (GInitableIface *iface)
|
|||||||
{
|
{
|
||||||
iface->init = init_sync;
|
iface->init = init_sync;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user