libnm: refactor some NMSetting to use direct properties for string
This commit is contained in:
@@ -39,14 +39,14 @@ NM_GOBJECT_PROPERTIES_DEFINE_BASE(PROP_AUTO_CONFIG,
|
|||||||
PROP_MTU, );
|
PROP_MTU, );
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *number; /* For dialing, duh */
|
char *number;
|
||||||
char *username;
|
char *username;
|
||||||
char *password;
|
char *password;
|
||||||
char *device_id;
|
char *device_id;
|
||||||
char *sim_id;
|
char *sim_id;
|
||||||
char *sim_operator_id;
|
char *sim_operator_id;
|
||||||
char *apn;
|
char *apn;
|
||||||
char *network_id; /* for manual registration or NULL for automatic */
|
char *network_id;
|
||||||
char *pin;
|
char *pin;
|
||||||
guint password_flags;
|
guint password_flags;
|
||||||
guint pin_flags;
|
guint pin_flags;
|
||||||
@@ -480,104 +480,6 @@ need_secrets(NMSetting *setting)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
|
||||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingGsm *setting = NM_SETTING_GSM(object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_AUTO_CONFIG:
|
|
||||||
g_value_set_boolean(value, nm_setting_gsm_get_auto_config(setting));
|
|
||||||
break;
|
|
||||||
case PROP_NUMBER:
|
|
||||||
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;
|
|
||||||
case PROP_PASSWORD:
|
|
||||||
g_value_set_string(value, nm_setting_gsm_get_password(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_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;
|
|
||||||
default:
|
|
||||||
_nm_setting_property_get_property_direct(object, prop_id, value, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingGsmPrivate *priv = NM_SETTING_GSM_GET_PRIVATE(object);
|
|
||||||
char *tmp;
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_AUTO_CONFIG:
|
|
||||||
priv->auto_config = g_value_get_boolean(value);
|
|
||||||
break;
|
|
||||||
case PROP_NUMBER:
|
|
||||||
g_free(priv->number);
|
|
||||||
priv->number = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_USERNAME:
|
|
||||||
g_free(priv->username);
|
|
||||||
priv->username = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_PASSWORD:
|
|
||||||
g_free(priv->password);
|
|
||||||
priv->password = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_NETWORK_ID:
|
|
||||||
g_free(priv->network_id);
|
|
||||||
priv->network_id = NULL;
|
|
||||||
tmp = g_value_dup_string(value);
|
|
||||||
if (tmp)
|
|
||||||
priv->network_id = g_strstrip(tmp);
|
|
||||||
break;
|
|
||||||
case PROP_PIN:
|
|
||||||
g_free(priv->pin);
|
|
||||||
priv->pin = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_HOME_ONLY:
|
|
||||||
priv->home_only = g_value_get_boolean(value);
|
|
||||||
break;
|
|
||||||
case PROP_DEVICE_ID:
|
|
||||||
g_free(priv->device_id);
|
|
||||||
priv->device_id = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_SIM_ID:
|
|
||||||
g_free(priv->sim_id);
|
|
||||||
priv->sim_id = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_SIM_OPERATOR_ID:
|
|
||||||
g_free(priv->sim_operator_id);
|
|
||||||
priv->sim_operator_id = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_nm_setting_property_set_property_direct(object, prop_id, value, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_gsm_init(NMSettingGsm *setting)
|
nm_setting_gsm_init(NMSettingGsm *setting)
|
||||||
{}
|
{}
|
||||||
@@ -595,23 +497,6 @@ nm_setting_gsm_new(void)
|
|||||||
return g_object_new(NM_TYPE_SETTING_GSM, NULL);
|
return g_object_new(NM_TYPE_SETTING_GSM, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
finalize(GObject *object)
|
|
||||||
{
|
|
||||||
NMSettingGsmPrivate *priv = NM_SETTING_GSM_GET_PRIVATE(object);
|
|
||||||
|
|
||||||
g_free(priv->number);
|
|
||||||
g_free(priv->username);
|
|
||||||
g_free(priv->password);
|
|
||||||
g_free(priv->network_id);
|
|
||||||
g_free(priv->pin);
|
|
||||||
g_free(priv->device_id);
|
|
||||||
g_free(priv->sim_id);
|
|
||||||
g_free(priv->sim_operator_id);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS(nm_setting_gsm_parent_class)->finalize(object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
||||||
{
|
{
|
||||||
@@ -621,9 +506,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->get_property = get_property;
|
object_class->get_property = _nm_setting_property_get_property_direct;
|
||||||
object_class->set_property = set_property;
|
object_class->set_property = _nm_setting_property_set_property_direct;
|
||||||
object_class->finalize = finalize;
|
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
setting_class->verify_secrets = verify_secrets;
|
setting_class->verify_secrets = verify_secrets;
|
||||||
@@ -655,11 +539,13 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||||||
*
|
*
|
||||||
* Deprecated: 1.16: User-provided values for this setting are no longer used.
|
* Deprecated: 1.16: User-provided values for this setting are no longer used.
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_NUMBER] = g_param_spec_string(NM_SETTING_GSM_NUMBER,
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
"",
|
obj_properties,
|
||||||
"",
|
NM_SETTING_GSM_NUMBER,
|
||||||
NULL,
|
PROP_NUMBER,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
NM_SETTING_PARAM_NONE,
|
||||||
|
NMSettingGsmPrivate,
|
||||||
|
number);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingGsm:username:
|
* NMSettingGsm:username:
|
||||||
@@ -668,11 +554,13 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||||||
* providers do not require a username, or accept any username. But if a
|
* providers do not require a username, or accept any username. But if a
|
||||||
* username is required, it is specified here.
|
* username is required, it is specified here.
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_USERNAME] = g_param_spec_string(NM_SETTING_GSM_USERNAME,
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
"",
|
obj_properties,
|
||||||
"",
|
NM_SETTING_GSM_USERNAME,
|
||||||
NULL,
|
PROP_USERNAME,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
NM_SETTING_PARAM_NONE,
|
||||||
|
NMSettingGsmPrivate,
|
||||||
|
username);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingGsm:password:
|
* NMSettingGsm:password:
|
||||||
@@ -681,12 +569,13 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||||||
* providers do not require a password, or accept any password. But if a
|
* providers do not require a password, or accept any password. But if a
|
||||||
* password is required, it is specified here.
|
* password is required, it is specified here.
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_PASSWORD] =
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
g_param_spec_string(NM_SETTING_GSM_PASSWORD,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_GSM_PASSWORD,
|
||||||
"",
|
PROP_PASSWORD,
|
||||||
NULL,
|
NM_SETTING_PARAM_SECRET,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_SECRET | G_PARAM_STATIC_STRINGS);
|
NMSettingGsmPrivate,
|
||||||
|
password);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingGsm:password-flags:
|
* NMSettingGsm:password-flags:
|
||||||
@@ -728,12 +617,14 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||||||
* This can be used to ensure that the device does not roam when direct
|
* This can be used to ensure that the device does not roam when direct
|
||||||
* roaming control of the device is not otherwise possible.
|
* roaming control of the device is not otherwise possible.
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_NETWORK_ID] =
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
g_param_spec_string(NM_SETTING_GSM_NETWORK_ID,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_GSM_NETWORK_ID,
|
||||||
"",
|
PROP_NETWORK_ID,
|
||||||
NULL,
|
NM_SETTING_PARAM_NONE,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
NMSettingGsmPrivate,
|
||||||
|
network_id,
|
||||||
|
.direct_set_string_strip = TRUE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingGsm:pin:
|
* NMSettingGsm:pin:
|
||||||
@@ -742,12 +633,13 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||||||
* operations are requested. Specify the PIN here to allow operation of the
|
* operations are requested. Specify the PIN here to allow operation of the
|
||||||
* device.
|
* device.
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_PIN] =
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
g_param_spec_string(NM_SETTING_GSM_PIN,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_GSM_PIN,
|
||||||
"",
|
PROP_PIN,
|
||||||
NULL,
|
NM_SETTING_PARAM_SECRET,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_SECRET | G_PARAM_STATIC_STRINGS);
|
NMSettingGsmPrivate,
|
||||||
|
pin);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingGsm:pin-flags:
|
* NMSettingGsm:pin-flags:
|
||||||
@@ -785,12 +677,13 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||||||
*
|
*
|
||||||
* Since: 1.2
|
* Since: 1.2
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_DEVICE_ID] =
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
g_param_spec_string(NM_SETTING_GSM_DEVICE_ID,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_GSM_DEVICE_ID,
|
||||||
"",
|
PROP_DEVICE_ID,
|
||||||
NULL,
|
NM_SETTING_PARAM_NONE,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
NMSettingGsmPrivate,
|
||||||
|
device_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingGsm:sim-id:
|
* NMSettingGsm:sim-id:
|
||||||
@@ -802,11 +695,13 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||||||
*
|
*
|
||||||
* Since: 1.2
|
* Since: 1.2
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_SIM_ID] = g_param_spec_string(NM_SETTING_GSM_SIM_ID,
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
"",
|
obj_properties,
|
||||||
"",
|
NM_SETTING_GSM_SIM_ID,
|
||||||
NULL,
|
PROP_SIM_ID,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
NM_SETTING_PARAM_NONE,
|
||||||
|
NMSettingGsmPrivate,
|
||||||
|
sim_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingGsm:sim-operator-id:
|
* NMSettingGsm:sim-operator-id:
|
||||||
@@ -819,12 +714,13 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||||||
*
|
*
|
||||||
* Since: 1.2
|
* Since: 1.2
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_SIM_OPERATOR_ID] =
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
g_param_spec_string(NM_SETTING_GSM_SIM_OPERATOR_ID,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_GSM_SIM_OPERATOR_ID,
|
||||||
"",
|
PROP_SIM_OPERATOR_ID,
|
||||||
NULL,
|
NM_SETTING_PARAM_NONE,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
NMSettingGsmPrivate,
|
||||||
|
sim_operator_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingGsm:mtu:
|
* NMSettingGsm:mtu:
|
||||||
|
@@ -304,57 +304,6 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
|
||||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingInfiniband *setting = NM_SETTING_INFINIBAND(object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_MAC_ADDRESS:
|
|
||||||
g_value_set_string(value, nm_setting_infiniband_get_mac_address(setting));
|
|
||||||
break;
|
|
||||||
case PROP_TRANSPORT_MODE:
|
|
||||||
g_value_set_string(value, nm_setting_infiniband_get_transport_mode(setting));
|
|
||||||
break;
|
|
||||||
case PROP_PARENT:
|
|
||||||
g_value_set_string(value, nm_setting_infiniband_get_parent(setting));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_nm_setting_property_get_property_direct(object, prop_id, value, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingInfinibandPrivate *priv = NM_SETTING_INFINIBAND_GET_PRIVATE(object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_MAC_ADDRESS:
|
|
||||||
g_free(priv->mac_address);
|
|
||||||
priv->mac_address =
|
|
||||||
_nm_utils_hwaddr_canonical_or_invalid(g_value_get_string(value), INFINIBAND_ALEN);
|
|
||||||
break;
|
|
||||||
case PROP_TRANSPORT_MODE:
|
|
||||||
g_free(priv->transport_mode);
|
|
||||||
priv->transport_mode = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_P_KEY:
|
|
||||||
priv->p_key = g_value_get_int(value);
|
|
||||||
break;
|
|
||||||
case PROP_PARENT:
|
|
||||||
g_free(priv->parent);
|
|
||||||
priv->parent = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_nm_setting_property_set_property_direct(object, prop_id, value, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_infiniband_init(NMSettingInfiniband *self)
|
nm_setting_infiniband_init(NMSettingInfiniband *self)
|
||||||
{}
|
{}
|
||||||
@@ -377,8 +326,6 @@ finalize(GObject *object)
|
|||||||
{
|
{
|
||||||
NMSettingInfinibandPrivate *priv = NM_SETTING_INFINIBAND_GET_PRIVATE(object);
|
NMSettingInfinibandPrivate *priv = NM_SETTING_INFINIBAND_GET_PRIVATE(object);
|
||||||
|
|
||||||
g_free(priv->transport_mode);
|
|
||||||
g_free(priv->parent);
|
|
||||||
g_free(priv->virtual_iface_name);
|
g_free(priv->virtual_iface_name);
|
||||||
|
|
||||||
G_OBJECT_CLASS(nm_setting_infiniband_parent_class)->finalize(object);
|
G_OBJECT_CLASS(nm_setting_infiniband_parent_class)->finalize(object);
|
||||||
@@ -393,8 +340,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->get_property = get_property;
|
object_class->get_property = _nm_setting_property_get_property_direct;
|
||||||
object_class->set_property = set_property;
|
object_class->set_property = _nm_setting_property_set_property_direct;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
@@ -471,12 +418,13 @@ nm_setting_infiniband_class_init(NMSettingInfinibandClass *klass)
|
|||||||
* "datagram" mode
|
* "datagram" mode
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
obj_properties[PROP_TRANSPORT_MODE] = g_param_spec_string(
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
NM_SETTING_INFINIBAND_TRANSPORT_MODE,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_INFINIBAND_TRANSPORT_MODE,
|
||||||
"",
|
PROP_TRANSPORT_MODE,
|
||||||
NULL,
|
NM_SETTING_PARAM_INFERRABLE,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
NMSettingInfinibandPrivate,
|
||||||
|
transport_mode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingInfiniband:p-key:
|
* NMSettingInfiniband:p-key:
|
||||||
@@ -523,12 +471,13 @@ nm_setting_infiniband_class_init(NMSettingInfinibandClass *klass)
|
|||||||
* example: PHYSDEV=ib0
|
* example: PHYSDEV=ib0
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
obj_properties[PROP_PARENT] = g_param_spec_string(
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
NM_SETTING_INFINIBAND_PARENT,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_INFINIBAND_PARENT,
|
||||||
"",
|
PROP_PARENT,
|
||||||
NULL,
|
NM_SETTING_PARAM_INFERRABLE,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
NMSettingInfinibandPrivate,
|
||||||
|
parent);
|
||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
|
@@ -84,6 +84,7 @@ const char *
|
|||||||
nm_setting_macsec_get_parent(NMSettingMacsec *setting)
|
nm_setting_macsec_get_parent(NMSettingMacsec *setting)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail(NM_IS_SETTING_MACSEC(setting), NULL);
|
g_return_val_if_fail(NM_IS_SETTING_MACSEC(setting), NULL);
|
||||||
|
|
||||||
return NM_SETTING_MACSEC_GET_PRIVATE(setting)->parent;
|
return NM_SETTING_MACSEC_GET_PRIVATE(setting)->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,6 +131,7 @@ const char *
|
|||||||
nm_setting_macsec_get_mka_cak(NMSettingMacsec *setting)
|
nm_setting_macsec_get_mka_cak(NMSettingMacsec *setting)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail(NM_IS_SETTING_MACSEC(setting), NULL);
|
g_return_val_if_fail(NM_IS_SETTING_MACSEC(setting), NULL);
|
||||||
|
|
||||||
return NM_SETTING_MACSEC_GET_PRIVATE(setting)->mka_cak;
|
return NM_SETTING_MACSEC_GET_PRIVATE(setting)->mka_cak;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,6 +163,7 @@ const char *
|
|||||||
nm_setting_macsec_get_mka_ckn(NMSettingMacsec *setting)
|
nm_setting_macsec_get_mka_ckn(NMSettingMacsec *setting)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail(NM_IS_SETTING_MACSEC(setting), NULL);
|
g_return_val_if_fail(NM_IS_SETTING_MACSEC(setting), NULL);
|
||||||
|
|
||||||
return NM_SETTING_MACSEC_GET_PRIVATE(setting)->mka_ckn;
|
return NM_SETTING_MACSEC_GET_PRIVATE(setting)->mka_ckn;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -396,67 +399,6 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
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) {
|
|
||||||
case PROP_PARENT:
|
|
||||||
g_value_set_string(value, priv->parent);
|
|
||||||
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_CKN:
|
|
||||||
g_value_set_string(value, priv->mka_ckn);
|
|
||||||
break;
|
|
||||||
case PROP_SEND_SCI:
|
|
||||||
g_value_set_boolean(value, priv->send_sci);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_nm_setting_property_get_property_direct(object, prop_id, value, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
set_property(GObject *object, guint prop_id, const 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_free(priv->parent);
|
|
||||||
priv->parent = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_ENCRYPT:
|
|
||||||
priv->encrypt = g_value_get_boolean(value);
|
|
||||||
break;
|
|
||||||
case PROP_MKA_CAK:
|
|
||||||
nm_free_secret(priv->mka_cak);
|
|
||||||
priv->mka_cak = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_MKA_CKN:
|
|
||||||
g_free(priv->mka_ckn);
|
|
||||||
priv->mka_ckn = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_SEND_SCI:
|
|
||||||
priv->send_sci = g_value_get_boolean(value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_nm_setting_property_set_property_direct(object, prop_id, value, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_macsec_init(NMSettingMacsec *self)
|
nm_setting_macsec_init(NMSettingMacsec *self)
|
||||||
{}
|
{}
|
||||||
@@ -476,19 +418,6 @@ nm_setting_macsec_new(void)
|
|||||||
return g_object_new(NM_TYPE_SETTING_MACSEC, NULL);
|
return g_object_new(NM_TYPE_SETTING_MACSEC, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
finalize(GObject *object)
|
|
||||||
{
|
|
||||||
NMSettingMacsec *setting = NM_SETTING_MACSEC(object);
|
|
||||||
NMSettingMacsecPrivate *priv = NM_SETTING_MACSEC_GET_PRIVATE(setting);
|
|
||||||
|
|
||||||
g_free(priv->parent);
|
|
||||||
nm_free_secret(priv->mka_cak);
|
|
||||||
g_free(priv->mka_ckn);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS(nm_setting_macsec_parent_class)->finalize(object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_macsec_class_init(NMSettingMacsecClass *klass)
|
nm_setting_macsec_class_init(NMSettingMacsecClass *klass)
|
||||||
{
|
{
|
||||||
@@ -498,9 +427,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->get_property = get_property;
|
object_class->get_property = _nm_setting_property_get_property_direct;
|
||||||
object_class->set_property = set_property;
|
object_class->set_property = _nm_setting_property_set_property_direct;
|
||||||
object_class->finalize = finalize;
|
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
setting_class->need_secrets = need_secrets;
|
setting_class->need_secrets = need_secrets;
|
||||||
@@ -515,12 +443,13 @@ nm_setting_macsec_class_init(NMSettingMacsecClass *klass)
|
|||||||
*
|
*
|
||||||
* Since: 1.6
|
* Since: 1.6
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_PARENT] = g_param_spec_string(
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
NM_SETTING_MACSEC_PARENT,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_MACSEC_PARENT,
|
||||||
"",
|
PROP_PARENT,
|
||||||
NULL,
|
NM_SETTING_PARAM_INFERRABLE,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
NMSettingMacsecPrivate,
|
||||||
|
parent);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingMacsec:mode:
|
* NMSettingMacsec:mode:
|
||||||
@@ -565,12 +494,13 @@ nm_setting_macsec_class_init(NMSettingMacsecClass *klass)
|
|||||||
*
|
*
|
||||||
* Since: 1.6
|
* Since: 1.6
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_MKA_CAK] =
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
g_param_spec_string(NM_SETTING_MACSEC_MKA_CAK,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_MACSEC_MKA_CAK,
|
||||||
"",
|
PROP_MKA_CAK,
|
||||||
NULL,
|
NM_SETTING_PARAM_SECRET,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_SECRET | G_PARAM_STATIC_STRINGS);
|
NMSettingMacsecPrivate,
|
||||||
|
mka_cak);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingMacsec:mka-cak-flags:
|
* NMSettingMacsec:mka-cak-flags:
|
||||||
@@ -595,11 +525,13 @@ nm_setting_macsec_class_init(NMSettingMacsecClass *klass)
|
|||||||
*
|
*
|
||||||
* Since: 1.6
|
* Since: 1.6
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_MKA_CKN] = g_param_spec_string(NM_SETTING_MACSEC_MKA_CKN,
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
"",
|
obj_properties,
|
||||||
"",
|
NM_SETTING_MACSEC_MKA_CKN,
|
||||||
NULL,
|
PROP_MKA_CKN,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
NM_SETTING_PARAM_NONE,
|
||||||
|
NMSettingMacsecPrivate,
|
||||||
|
mka_ckn);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingMacsec:port:
|
* NMSettingMacsec:port:
|
||||||
|
@@ -69,6 +69,7 @@ const char *
|
|||||||
nm_setting_macvlan_get_parent(NMSettingMacvlan *setting)
|
nm_setting_macvlan_get_parent(NMSettingMacvlan *setting)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail(NM_IS_SETTING_MACVLAN(setting), NULL);
|
g_return_val_if_fail(NM_IS_SETTING_MACVLAN(setting), NULL);
|
||||||
|
|
||||||
return NM_SETTING_MACVLAN_GET_PRIVATE(setting)->parent;
|
return NM_SETTING_MACVLAN_GET_PRIVATE(setting)->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,53 +181,6 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
|
||||||
get_property(GObject *object, guint prop_id, 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_value_set_string(value, priv->parent);
|
|
||||||
break;
|
|
||||||
case PROP_PROMISCUOUS:
|
|
||||||
g_value_set_boolean(value, priv->promiscuous);
|
|
||||||
break;
|
|
||||||
case PROP_TAP:
|
|
||||||
g_value_set_boolean(value, priv->tap);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_nm_setting_property_get_property_direct(object, prop_id, value, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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_PROMISCUOUS:
|
|
||||||
priv->promiscuous = g_value_get_boolean(value);
|
|
||||||
break;
|
|
||||||
case PROP_TAP:
|
|
||||||
priv->tap = g_value_get_boolean(value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_nm_setting_property_set_property_direct(object, prop_id, value, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_macvlan_init(NMSettingMacvlan *self)
|
nm_setting_macvlan_init(NMSettingMacvlan *self)
|
||||||
{}
|
{}
|
||||||
@@ -246,17 +200,6 @@ nm_setting_macvlan_new(void)
|
|||||||
return g_object_new(NM_TYPE_SETTING_MACVLAN, NULL);
|
return g_object_new(NM_TYPE_SETTING_MACVLAN, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
finalize(GObject *object)
|
|
||||||
{
|
|
||||||
NMSettingMacvlan *setting = NM_SETTING_MACVLAN(object);
|
|
||||||
NMSettingMacvlanPrivate *priv = NM_SETTING_MACVLAN_GET_PRIVATE(setting);
|
|
||||||
|
|
||||||
g_free(priv->parent);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS(nm_setting_macvlan_parent_class)->finalize(object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_macvlan_class_init(NMSettingMacvlanClass *klass)
|
nm_setting_macvlan_class_init(NMSettingMacvlanClass *klass)
|
||||||
{
|
{
|
||||||
@@ -266,9 +209,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->get_property = get_property;
|
object_class->get_property = _nm_setting_property_get_property_direct;
|
||||||
object_class->set_property = set_property;
|
object_class->set_property = _nm_setting_property_set_property_direct;
|
||||||
object_class->finalize = finalize;
|
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
|
||||||
@@ -282,12 +224,13 @@ nm_setting_macvlan_class_init(NMSettingMacvlanClass *klass)
|
|||||||
*
|
*
|
||||||
* Since: 1.2
|
* Since: 1.2
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_PARENT] = g_param_spec_string(
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
NM_SETTING_MACVLAN_PARENT,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_MACVLAN_PARENT,
|
||||||
"",
|
PROP_PARENT,
|
||||||
NULL,
|
NM_SETTING_PARAM_INFERRABLE,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
NMSettingMacvlanPrivate,
|
||||||
|
parent);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingMacvlan:mode:
|
* NMSettingMacvlan:mode:
|
||||||
|
@@ -198,64 +198,6 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
|
||||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingOvsBridge *self = NM_SETTING_OVS_BRIDGE(object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_FAIL_MODE:
|
|
||||||
g_value_set_string(value, self->fail_mode);
|
|
||||||
break;
|
|
||||||
case PROP_MCAST_SNOOPING_ENABLE:
|
|
||||||
g_value_set_boolean(value, self->mcast_snooping_enable);
|
|
||||||
break;
|
|
||||||
case PROP_RSTP_ENABLE:
|
|
||||||
g_value_set_boolean(value, self->rstp_enable);
|
|
||||||
break;
|
|
||||||
case PROP_STP_ENABLE:
|
|
||||||
g_value_set_boolean(value, self->stp_enable);
|
|
||||||
break;
|
|
||||||
case PROP_DATAPATH_TYPE:
|
|
||||||
g_value_set_string(value, self->datapath_type);
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
NMSettingOvsBridge *self = NM_SETTING_OVS_BRIDGE(object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_FAIL_MODE:
|
|
||||||
g_free(self->fail_mode);
|
|
||||||
self->fail_mode = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_MCAST_SNOOPING_ENABLE:
|
|
||||||
self->mcast_snooping_enable = g_value_get_boolean(value);
|
|
||||||
break;
|
|
||||||
case PROP_RSTP_ENABLE:
|
|
||||||
self->rstp_enable = g_value_get_boolean(value);
|
|
||||||
break;
|
|
||||||
case PROP_STP_ENABLE:
|
|
||||||
self->stp_enable = g_value_get_boolean(value);
|
|
||||||
break;
|
|
||||||
case PROP_DATAPATH_TYPE:
|
|
||||||
g_free(self->datapath_type);
|
|
||||||
self->datapath_type = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_ovs_bridge_init(NMSettingOvsBridge *self)
|
nm_setting_ovs_bridge_init(NMSettingOvsBridge *self)
|
||||||
{}
|
{}
|
||||||
@@ -275,17 +217,6 @@ nm_setting_ovs_bridge_new(void)
|
|||||||
return g_object_new(NM_TYPE_SETTING_OVS_BRIDGE, NULL);
|
return g_object_new(NM_TYPE_SETTING_OVS_BRIDGE, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
finalize(GObject *object)
|
|
||||||
{
|
|
||||||
NMSettingOvsBridge *self = NM_SETTING_OVS_BRIDGE(object);
|
|
||||||
|
|
||||||
g_free(self->fail_mode);
|
|
||||||
g_free(self->datapath_type);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS(nm_setting_ovs_bridge_parent_class)->finalize(object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_ovs_bridge_class_init(NMSettingOvsBridgeClass *klass)
|
nm_setting_ovs_bridge_class_init(NMSettingOvsBridgeClass *klass)
|
||||||
{
|
{
|
||||||
@@ -293,9 +224,8 @@ nm_setting_ovs_bridge_class_init(NMSettingOvsBridgeClass *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->get_property = get_property;
|
object_class->get_property = _nm_setting_property_get_property_direct;
|
||||||
object_class->set_property = set_property;
|
object_class->set_property = _nm_setting_property_set_property_direct;
|
||||||
object_class->finalize = finalize;
|
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
|
||||||
@@ -306,12 +236,13 @@ nm_setting_ovs_bridge_class_init(NMSettingOvsBridgeClass *klass)
|
|||||||
*
|
*
|
||||||
* Since: 1.10
|
* Since: 1.10
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_FAIL_MODE] = g_param_spec_string(
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
NM_SETTING_OVS_BRIDGE_FAIL_MODE,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_OVS_BRIDGE_FAIL_MODE,
|
||||||
"",
|
PROP_FAIL_MODE,
|
||||||
NULL,
|
NM_SETTING_PARAM_INFERRABLE,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
NMSettingOvsBridge,
|
||||||
|
fail_mode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingOvsBridge:mcast-snooping-enable:
|
* NMSettingOvsBridge:mcast-snooping-enable:
|
||||||
@@ -368,12 +299,13 @@ nm_setting_ovs_bridge_class_init(NMSettingOvsBridgeClass *klass)
|
|||||||
*
|
*
|
||||||
* Since: 1.20
|
* Since: 1.20
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_DATAPATH_TYPE] = g_param_spec_string(
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
NM_SETTING_OVS_BRIDGE_DATAPATH_TYPE,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_OVS_BRIDGE_DATAPATH_TYPE,
|
||||||
"",
|
PROP_DATAPATH_TYPE,
|
||||||
NULL,
|
NM_SETTING_PARAM_INFERRABLE,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
NMSettingOvsBridge,
|
||||||
|
datapath_type);
|
||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
|
@@ -78,39 +78,6 @@ nm_setting_ovs_dpdk_get_n_rxq(NMSettingOvsDpdk *self)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
|
||||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingOvsDpdk *self = NM_SETTING_OVS_DPDK(object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_DEVARGS:
|
|
||||||
g_value_set_string(value, self->devargs);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_nm_setting_property_get_property_direct(object, prop_id, value, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingOvsDpdk *self = NM_SETTING_OVS_DPDK(object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_DEVARGS:
|
|
||||||
g_free(self->devargs);
|
|
||||||
self->devargs = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_nm_setting_property_set_property_direct(object, prop_id, value, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_ovs_dpdk_init(NMSettingOvsDpdk *self)
|
nm_setting_ovs_dpdk_init(NMSettingOvsDpdk *self)
|
||||||
{}
|
{}
|
||||||
@@ -130,16 +97,6 @@ nm_setting_ovs_dpdk_new(void)
|
|||||||
return g_object_new(NM_TYPE_SETTING_OVS_DPDK, NULL);
|
return g_object_new(NM_TYPE_SETTING_OVS_DPDK, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
finalize(GObject *object)
|
|
||||||
{
|
|
||||||
NMSettingOvsDpdk *self = NM_SETTING_OVS_DPDK(object);
|
|
||||||
|
|
||||||
g_free(self->devargs);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS(nm_setting_ovs_dpdk_parent_class)->finalize(object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_ovs_dpdk_class_init(NMSettingOvsDpdkClass *klass)
|
nm_setting_ovs_dpdk_class_init(NMSettingOvsDpdkClass *klass)
|
||||||
{
|
{
|
||||||
@@ -147,9 +104,8 @@ nm_setting_ovs_dpdk_class_init(NMSettingOvsDpdkClass *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 = _nm_setting_property_get_property_direct;
|
||||||
object_class->get_property = get_property;
|
object_class->set_property = _nm_setting_property_set_property_direct;
|
||||||
object_class->finalize = finalize;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingOvsDpdk:devargs:
|
* NMSettingOvsDpdk:devargs:
|
||||||
@@ -158,12 +114,13 @@ nm_setting_ovs_dpdk_class_init(NMSettingOvsDpdkClass *klass)
|
|||||||
*
|
*
|
||||||
* Since: 1.20
|
* Since: 1.20
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_DEVARGS] = g_param_spec_string(
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
NM_SETTING_OVS_DPDK_DEVARGS,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_OVS_DPDK_DEVARGS,
|
||||||
"",
|
PROP_DEVARGS,
|
||||||
NULL,
|
NM_SETTING_PARAM_INFERRABLE,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
NMSettingOvsDpdk,
|
||||||
|
devargs);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingOvsDpdk:n-rxq:
|
* NMSettingOvsDpdk:n-rxq:
|
||||||
|
@@ -333,39 +333,6 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
|
||||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingOvsInterface *self = NM_SETTING_OVS_INTERFACE(object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_TYPE:
|
|
||||||
g_value_set_string(value, self->type);
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
NMSettingOvsInterface *self = NM_SETTING_OVS_INTERFACE(object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_TYPE:
|
|
||||||
g_free(self->type);
|
|
||||||
self->type = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_ovs_interface_init(NMSettingOvsInterface *self)
|
nm_setting_ovs_interface_init(NMSettingOvsInterface *self)
|
||||||
{}
|
{}
|
||||||
@@ -385,25 +352,15 @@ nm_setting_ovs_interface_new(void)
|
|||||||
return g_object_new(NM_TYPE_SETTING_OVS_INTERFACE, NULL);
|
return g_object_new(NM_TYPE_SETTING_OVS_INTERFACE, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
finalize(GObject *object)
|
|
||||||
{
|
|
||||||
NMSettingOvsInterface *self = NM_SETTING_OVS_INTERFACE(object);
|
|
||||||
|
|
||||||
g_free(self->type);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS(nm_setting_ovs_interface_parent_class)->finalize(object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_ovs_interface_class_init(NMSettingOvsInterfaceClass *klass)
|
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);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array();
|
||||||
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = _nm_setting_property_get_property_direct;
|
||||||
object_class->set_property = set_property;
|
object_class->set_property = _nm_setting_property_set_property_direct;
|
||||||
object_class->finalize = finalize;
|
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
|
||||||
@@ -414,14 +371,19 @@ nm_setting_ovs_interface_class_init(NMSettingOvsInterfaceClass *klass)
|
|||||||
*
|
*
|
||||||
* Since: 1.10
|
* Since: 1.10
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_TYPE] = g_param_spec_string(NM_SETTING_OVS_INTERFACE_TYPE,
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
"",
|
obj_properties,
|
||||||
"",
|
NM_SETTING_OVS_INTERFACE_TYPE,
|
||||||
NULL,
|
PROP_TYPE,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE
|
NM_SETTING_PARAM_INFERRABLE,
|
||||||
| G_PARAM_STATIC_STRINGS);
|
NMSettingOvsInterface,
|
||||||
|
type);
|
||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_OVS_INTERFACE, NULL, NULL, 0);
|
_nm_setting_class_commit(setting_class,
|
||||||
|
NM_META_SETTING_TYPE_OVS_INTERFACE,
|
||||||
|
NULL,
|
||||||
|
properties_override,
|
||||||
|
0);
|
||||||
}
|
}
|
||||||
|
@@ -93,39 +93,6 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
|
||||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingOvsPatch *self = NM_SETTING_OVS_PATCH(object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_PEER:
|
|
||||||
g_value_set_string(value, self->peer);
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
NMSettingOvsPatch *self = NM_SETTING_OVS_PATCH(object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_PEER:
|
|
||||||
g_free(self->peer);
|
|
||||||
self->peer = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_ovs_patch_init(NMSettingOvsPatch *self)
|
nm_setting_ovs_patch_init(NMSettingOvsPatch *self)
|
||||||
{}
|
{}
|
||||||
@@ -145,25 +112,15 @@ nm_setting_ovs_patch_new(void)
|
|||||||
return g_object_new(NM_TYPE_SETTING_OVS_PATCH, NULL);
|
return g_object_new(NM_TYPE_SETTING_OVS_PATCH, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
finalize(GObject *object)
|
|
||||||
{
|
|
||||||
NMSettingOvsPatch *self = NM_SETTING_OVS_PATCH(object);
|
|
||||||
|
|
||||||
g_free(self->peer);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS(nm_setting_ovs_patch_parent_class)->finalize(object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_ovs_patch_class_init(NMSettingOvsPatchClass *klass)
|
nm_setting_ovs_patch_class_init(NMSettingOvsPatchClass *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);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array();
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
object_class->get_property = _nm_setting_property_get_property_direct;
|
||||||
object_class->get_property = get_property;
|
object_class->set_property = _nm_setting_property_set_property_direct;
|
||||||
object_class->finalize = finalize;
|
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
|
||||||
@@ -175,14 +132,19 @@ nm_setting_ovs_patch_class_init(NMSettingOvsPatchClass *klass)
|
|||||||
*
|
*
|
||||||
* Since: 1.10
|
* Since: 1.10
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_PEER] = g_param_spec_string(NM_SETTING_OVS_PATCH_PEER,
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
"",
|
obj_properties,
|
||||||
"",
|
NM_SETTING_OVS_PATCH_PEER,
|
||||||
NULL,
|
PROP_PEER,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE
|
NM_SETTING_PARAM_INFERRABLE,
|
||||||
| G_PARAM_STATIC_STRINGS);
|
NMSettingOvsPatch,
|
||||||
|
peer);
|
||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_OVS_PATCH, NULL, NULL, 0);
|
_nm_setting_class_commit(setting_class,
|
||||||
|
NM_META_SETTING_TYPE_OVS_PATCH,
|
||||||
|
NULL,
|
||||||
|
properties_override,
|
||||||
|
0);
|
||||||
}
|
}
|
||||||
|
@@ -690,7 +690,7 @@ _nm_properties_override(GArray *properties_override, const NMSettInfoProperty *p
|
|||||||
\
|
\
|
||||||
G_STATIC_ASSERT(!NM_FLAGS_ANY((param_flags), \
|
G_STATIC_ASSERT(!NM_FLAGS_ANY((param_flags), \
|
||||||
~(NM_SETTING_PARAM_SECRET | NM_SETTING_PARAM_FUZZY_IGNORE \
|
~(NM_SETTING_PARAM_SECRET | NM_SETTING_PARAM_FUZZY_IGNORE \
|
||||||
| NM_SETTING_PARAM_INFERRABLE \
|
| NM_SETTING_PARAM_INFERRABLE | NM_SETTING_PARAM_REQUIRED \
|
||||||
| NM_SETTING_PARAM_REAPPLY_IMMEDIATELY))); \
|
| NM_SETTING_PARAM_REAPPLY_IMMEDIATELY))); \
|
||||||
\
|
\
|
||||||
nm_assert(_property_type); \
|
nm_assert(_property_type); \
|
||||||
|
@@ -63,6 +63,7 @@ const char *
|
|||||||
nm_setting_veth_get_peer(NMSettingVeth *setting)
|
nm_setting_veth_get_peer(NMSettingVeth *setting)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail(NM_IS_SETTING_VETH(setting), NULL);
|
g_return_val_if_fail(NM_IS_SETTING_VETH(setting), NULL);
|
||||||
|
|
||||||
return NM_SETTING_VETH_GET_PRIVATE(setting)->peer;
|
return NM_SETTING_VETH_GET_PRIVATE(setting)->peer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,35 +101,6 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
|
||||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingVeth *setting = NM_SETTING_VETH(object);
|
|
||||||
NMSettingVethPrivate *priv = NM_SETTING_VETH_GET_PRIVATE(setting);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_PEER:
|
|
||||||
g_value_set_string(value, priv->peer);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingVeth *setting = NM_SETTING_VETH(object);
|
|
||||||
NMSettingVethPrivate *priv = NM_SETTING_VETH_GET_PRIVATE(setting);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_PEER:
|
|
||||||
g_free(priv->peer);
|
|
||||||
priv->peer = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_veth_init(NMSettingVeth *setting)
|
nm_setting_veth_init(NMSettingVeth *setting)
|
||||||
{}
|
{}
|
||||||
@@ -148,26 +120,15 @@ nm_setting_veth_new(void)
|
|||||||
return g_object_new(NM_TYPE_SETTING_VETH, NULL);
|
return g_object_new(NM_TYPE_SETTING_VETH, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
finalize(GObject *object)
|
|
||||||
{
|
|
||||||
NMSettingVeth *setting = NM_SETTING_VETH(object);
|
|
||||||
NMSettingVethPrivate *priv = NM_SETTING_VETH_GET_PRIVATE(setting);
|
|
||||||
|
|
||||||
g_free(priv->peer);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS(nm_setting_veth_parent_class)->finalize(object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_veth_class_init(NMSettingVethClass *klass)
|
nm_setting_veth_class_init(NMSettingVethClass *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);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array();
|
||||||
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = _nm_setting_property_get_property_direct;
|
||||||
object_class->set_property = set_property;
|
object_class->set_property = _nm_setting_property_set_property_direct;
|
||||||
object_class->finalize = finalize;
|
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
|
||||||
@@ -179,14 +140,19 @@ nm_setting_veth_class_init(NMSettingVethClass *klass)
|
|||||||
*
|
*
|
||||||
* Since: 1.30
|
* Since: 1.30
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_PEER] = g_param_spec_string(NM_SETTING_VETH_PEER,
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
"",
|
obj_properties,
|
||||||
"",
|
NM_SETTING_VETH_PEER,
|
||||||
NULL,
|
PROP_PEER,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE
|
NM_SETTING_PARAM_INFERRABLE,
|
||||||
| G_PARAM_STATIC_STRINGS);
|
NMSettingVeth,
|
||||||
|
_priv.peer);
|
||||||
|
|
||||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_VETH, NULL, NULL, 0);
|
_nm_setting_class_commit(setting_class,
|
||||||
|
NM_META_SETTING_TYPE_VETH,
|
||||||
|
NULL,
|
||||||
|
properties_override,
|
||||||
|
0);
|
||||||
}
|
}
|
||||||
|
@@ -77,6 +77,7 @@ const char *
|
|||||||
nm_setting_vlan_get_parent(NMSettingVlan *setting)
|
nm_setting_vlan_get_parent(NMSettingVlan *setting)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail(NM_IS_SETTING_VLAN(setting), NULL);
|
g_return_val_if_fail(NM_IS_SETTING_VLAN(setting), NULL);
|
||||||
|
|
||||||
return NM_SETTING_VLAN_GET_PRIVATE(setting)->parent;
|
return NM_SETTING_VLAN_GET_PRIVATE(setting)->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -736,9 +737,6 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|||||||
NMSettingVlanPrivate *priv = NM_SETTING_VLAN_GET_PRIVATE(setting);
|
NMSettingVlanPrivate *priv = NM_SETTING_VLAN_GET_PRIVATE(setting);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_PARENT:
|
|
||||||
g_value_set_string(value, priv->parent);
|
|
||||||
break;
|
|
||||||
case PROP_FLAGS:
|
case PROP_FLAGS:
|
||||||
g_value_set_flags(value, priv->flags);
|
g_value_set_flags(value, priv->flags);
|
||||||
break;
|
break;
|
||||||
@@ -761,10 +759,6 @@ set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *ps
|
|||||||
NMSettingVlanPrivate *priv = NM_SETTING_VLAN_GET_PRIVATE(setting);
|
NMSettingVlanPrivate *priv = NM_SETTING_VLAN_GET_PRIVATE(setting);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_PARENT:
|
|
||||||
g_free(priv->parent);
|
|
||||||
priv->parent = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_FLAGS:
|
case PROP_FLAGS:
|
||||||
priv->flags = g_value_get_flags(value);
|
priv->flags = g_value_get_flags(value);
|
||||||
break;
|
break;
|
||||||
@@ -813,7 +807,6 @@ finalize(GObject *object)
|
|||||||
NMSettingVlan *setting = NM_SETTING_VLAN(object);
|
NMSettingVlan *setting = NM_SETTING_VLAN(object);
|
||||||
NMSettingVlanPrivate *priv = NM_SETTING_VLAN_GET_PRIVATE(setting);
|
NMSettingVlanPrivate *priv = NM_SETTING_VLAN_GET_PRIVATE(setting);
|
||||||
|
|
||||||
g_free(priv->parent);
|
|
||||||
g_slist_free_full(priv->ingress_priority_map, g_free);
|
g_slist_free_full(priv->ingress_priority_map, g_free);
|
||||||
g_slist_free_full(priv->egress_priority_map, g_free);
|
g_slist_free_full(priv->egress_priority_map, g_free);
|
||||||
|
|
||||||
@@ -849,12 +842,13 @@ nm_setting_vlan_class_init(NMSettingVlanClass *klass)
|
|||||||
* description: Parent interface of the VLAN.
|
* description: Parent interface of the VLAN.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
obj_properties[PROP_PARENT] = g_param_spec_string(
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
NM_SETTING_VLAN_PARENT,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_VLAN_PARENT,
|
||||||
"",
|
PROP_PARENT,
|
||||||
NULL,
|
NM_SETTING_PARAM_INFERRABLE,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
NMSettingVlanPrivate,
|
||||||
|
parent);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingVlan:id:
|
* NMSettingVlan:id:
|
||||||
|
@@ -969,15 +969,6 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|||||||
NMSettingVpnPrivate *priv = NM_SETTING_VPN_GET_PRIVATE(setting);
|
NMSettingVpnPrivate *priv = NM_SETTING_VPN_GET_PRIVATE(setting);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_SERVICE_TYPE:
|
|
||||||
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));
|
|
||||||
break;
|
|
||||||
case PROP_PERSISTENT:
|
|
||||||
g_value_set_boolean(value, priv->persistent);
|
|
||||||
break;
|
|
||||||
case PROP_DATA:
|
case PROP_DATA:
|
||||||
g_value_take_boxed(value, _nm_utils_copy_strdict(priv->data));
|
g_value_take_boxed(value, _nm_utils_copy_strdict(priv->data));
|
||||||
break;
|
break;
|
||||||
@@ -996,17 +987,6 @@ set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *ps
|
|||||||
NMSettingVpnPrivate *priv = NM_SETTING_VPN_GET_PRIVATE(object);
|
NMSettingVpnPrivate *priv = NM_SETTING_VPN_GET_PRIVATE(object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_SERVICE_TYPE:
|
|
||||||
g_free(priv->service_type);
|
|
||||||
priv->service_type = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_USER_NAME:
|
|
||||||
g_free(priv->user_name);
|
|
||||||
priv->user_name = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_PERSISTENT:
|
|
||||||
priv->persistent = g_value_get_boolean(value);
|
|
||||||
break;
|
|
||||||
case PROP_DATA:
|
case PROP_DATA:
|
||||||
case PROP_SECRETS:
|
case PROP_SECRETS:
|
||||||
{
|
{
|
||||||
@@ -1072,12 +1052,8 @@ finalize(GObject *object)
|
|||||||
{
|
{
|
||||||
NMSettingVpnPrivate *priv = NM_SETTING_VPN_GET_PRIVATE(object);
|
NMSettingVpnPrivate *priv = NM_SETTING_VPN_GET_PRIVATE(object);
|
||||||
|
|
||||||
g_free(priv->service_type);
|
nm_g_hash_table_unref(priv->data);
|
||||||
g_free(priv->user_name);
|
nm_g_hash_table_unref(priv->secrets);
|
||||||
if (priv->data)
|
|
||||||
g_hash_table_unref(priv->data);
|
|
||||||
if (priv->secrets)
|
|
||||||
g_hash_table_unref(priv->secrets);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS(nm_setting_vpn_parent_class)->finalize(object);
|
G_OBJECT_CLASS(nm_setting_vpn_parent_class)->finalize(object);
|
||||||
}
|
}
|
||||||
@@ -1111,12 +1087,13 @@ nm_setting_vpn_class_init(NMSettingVpnClass *klass)
|
|||||||
* its network. i.e. org.freedesktop.NetworkManager.vpnc for the vpnc
|
* its network. i.e. org.freedesktop.NetworkManager.vpnc for the vpnc
|
||||||
* plugin.
|
* plugin.
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_SERVICE_TYPE] =
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
g_param_spec_string(NM_SETTING_VPN_SERVICE_TYPE,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_VPN_SERVICE_TYPE,
|
||||||
"",
|
PROP_SERVICE_TYPE,
|
||||||
NULL,
|
NM_SETTING_PARAM_NONE,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
NMSettingVpnPrivate,
|
||||||
|
service_type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingVpn:user-name:
|
* NMSettingVpn:user-name:
|
||||||
@@ -1128,12 +1105,13 @@ nm_setting_vpn_class_init(NMSettingVpnClass *klass)
|
|||||||
* will automatically supply the username of the user which requested the
|
* will automatically supply the username of the user which requested the
|
||||||
* VPN connection.
|
* VPN connection.
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_USER_NAME] =
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
g_param_spec_string(NM_SETTING_VPN_USER_NAME,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_VPN_USER_NAME,
|
||||||
"",
|
PROP_USER_NAME,
|
||||||
NULL,
|
NM_SETTING_PARAM_NONE,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
NMSettingVpnPrivate,
|
||||||
|
user_name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingVpn:persistent:
|
* NMSettingVpn:persistent:
|
||||||
|
@@ -95,6 +95,7 @@ const char *
|
|||||||
nm_setting_vxlan_get_parent(NMSettingVxlan *setting)
|
nm_setting_vxlan_get_parent(NMSettingVxlan *setting)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail(NM_IS_SETTING_VXLAN(setting), NULL);
|
g_return_val_if_fail(NM_IS_SETTING_VXLAN(setting), NULL);
|
||||||
|
|
||||||
return NM_SETTING_VXLAN_GET_PRIVATE(setting)->parent;
|
return NM_SETTING_VXLAN_GET_PRIVATE(setting)->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,6 +127,7 @@ const char *
|
|||||||
nm_setting_vxlan_get_local(NMSettingVxlan *setting)
|
nm_setting_vxlan_get_local(NMSettingVxlan *setting)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail(NM_IS_SETTING_VXLAN(setting), NULL);
|
g_return_val_if_fail(NM_IS_SETTING_VXLAN(setting), NULL);
|
||||||
|
|
||||||
return NM_SETTING_VXLAN_GET_PRIVATE(setting)->local;
|
return NM_SETTING_VXLAN_GET_PRIVATE(setting)->local;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,6 +143,7 @@ const char *
|
|||||||
nm_setting_vxlan_get_remote(NMSettingVxlan *setting)
|
nm_setting_vxlan_get_remote(NMSettingVxlan *setting)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail(NM_IS_SETTING_VXLAN(setting), NULL);
|
g_return_val_if_fail(NM_IS_SETTING_VXLAN(setting), NULL);
|
||||||
|
|
||||||
return NM_SETTING_VXLAN_GET_PRIVATE(setting)->remote;
|
return NM_SETTING_VXLAN_GET_PRIVATE(setting)->remote;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -399,96 +402,6 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
|
||||||
_addrstr_set(char **dst, const char *src)
|
|
||||||
{
|
|
||||||
gs_free char *old = NULL;
|
|
||||||
|
|
||||||
old = *dst;
|
|
||||||
if (!src)
|
|
||||||
*dst = NULL;
|
|
||||||
else if (!nm_utils_parse_inaddr(AF_UNSPEC, src, dst))
|
|
||||||
*dst = g_strdup(src);
|
|
||||||
}
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
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_LOCAL:
|
|
||||||
g_value_set_string(value, priv->local);
|
|
||||||
break;
|
|
||||||
case PROP_REMOTE:
|
|
||||||
g_value_set_string(value, priv->remote);
|
|
||||||
break;
|
|
||||||
case PROP_PROXY:
|
|
||||||
g_value_set_boolean(value, priv->proxy);
|
|
||||||
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:
|
|
||||||
_nm_setting_property_get_property_direct(object, prop_id, value, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
set_property(GObject *object, guint prop_id, const 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_free(priv->parent);
|
|
||||||
priv->parent = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_LOCAL:
|
|
||||||
_addrstr_set(&priv->local, g_value_get_string(value));
|
|
||||||
break;
|
|
||||||
case PROP_REMOTE:
|
|
||||||
_addrstr_set(&priv->remote, g_value_get_string(value));
|
|
||||||
break;
|
|
||||||
case PROP_PROXY:
|
|
||||||
priv->proxy = g_value_get_boolean(value);
|
|
||||||
break;
|
|
||||||
case PROP_LEARNING:
|
|
||||||
priv->learning = g_value_get_boolean(value);
|
|
||||||
break;
|
|
||||||
case PROP_RSC:
|
|
||||||
priv->rsc = g_value_get_boolean(value);
|
|
||||||
break;
|
|
||||||
case PROP_L2_MISS:
|
|
||||||
priv->l2_miss = g_value_get_boolean(value);
|
|
||||||
break;
|
|
||||||
case PROP_L3_MISS:
|
|
||||||
priv->l3_miss = g_value_get_boolean(value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_nm_setting_property_set_property_direct(object, prop_id, value, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_vxlan_init(NMSettingVxlan *self)
|
nm_setting_vxlan_init(NMSettingVxlan *self)
|
||||||
{}
|
{}
|
||||||
@@ -508,19 +421,6 @@ nm_setting_vxlan_new(void)
|
|||||||
return g_object_new(NM_TYPE_SETTING_VXLAN, NULL);
|
return g_object_new(NM_TYPE_SETTING_VXLAN, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
finalize(GObject *object)
|
|
||||||
{
|
|
||||||
NMSettingVxlan *setting = NM_SETTING_VXLAN(object);
|
|
||||||
NMSettingVxlanPrivate *priv = NM_SETTING_VXLAN_GET_PRIVATE(setting);
|
|
||||||
|
|
||||||
g_free(priv->parent);
|
|
||||||
g_free(priv->local);
|
|
||||||
g_free(priv->remote);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS(nm_setting_vxlan_parent_class)->finalize(object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_vxlan_class_init(NMSettingVxlanClass *klass)
|
nm_setting_vxlan_class_init(NMSettingVxlanClass *klass)
|
||||||
{
|
{
|
||||||
@@ -530,9 +430,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->get_property = get_property;
|
object_class->get_property = _nm_setting_property_get_property_direct;
|
||||||
object_class->set_property = set_property;
|
object_class->set_property = _nm_setting_property_set_property_direct;
|
||||||
object_class->finalize = finalize;
|
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
|
||||||
@@ -543,12 +442,13 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass)
|
|||||||
*
|
*
|
||||||
* Since: 1.2
|
* Since: 1.2
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_PARENT] = g_param_spec_string(
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
NM_SETTING_VXLAN_PARENT,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_VXLAN_PARENT,
|
||||||
"",
|
PROP_PARENT,
|
||||||
NULL,
|
NM_SETTING_PARAM_INFERRABLE,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
NMSettingVxlanPrivate,
|
||||||
|
parent);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingVxlan:id:
|
* NMSettingVxlan:id:
|
||||||
@@ -576,12 +476,15 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass)
|
|||||||
*
|
*
|
||||||
* Since: 1.2
|
* Since: 1.2
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_LOCAL] = g_param_spec_string(NM_SETTING_VXLAN_LOCAL,
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
"",
|
obj_properties,
|
||||||
"",
|
NM_SETTING_VXLAN_LOCAL,
|
||||||
NULL,
|
PROP_LOCAL,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE
|
NM_SETTING_PARAM_INFERRABLE,
|
||||||
| G_PARAM_STATIC_STRINGS);
|
NMSettingVxlanPrivate,
|
||||||
|
local,
|
||||||
|
.direct_set_string_ip_address_addr_family =
|
||||||
|
AF_UNSPEC + 1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingVxlan:remote:
|
* NMSettingVxlan:remote:
|
||||||
@@ -592,12 +495,15 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass)
|
|||||||
*
|
*
|
||||||
* Since: 1.2
|
* Since: 1.2
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_REMOTE] = g_param_spec_string(
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
NM_SETTING_VXLAN_REMOTE,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_VXLAN_REMOTE,
|
||||||
"",
|
PROP_REMOTE,
|
||||||
NULL,
|
NM_SETTING_PARAM_INFERRABLE,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
NMSettingVxlanPrivate,
|
||||||
|
remote,
|
||||||
|
.direct_set_string_ip_address_addr_family =
|
||||||
|
AF_UNSPEC + 1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingVxlan:source-port-min:
|
* NMSettingVxlan:source-port-min:
|
||||||
|
@@ -131,47 +131,6 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
|
||||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
NMSettingWimax *setting = NM_SETTING_WIMAX(object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_NETWORK_NAME:
|
|
||||||
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;
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
NMSettingWimaxPrivate *priv = NM_SETTING_WIMAX_GET_PRIVATE(object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
case PROP_NETWORK_NAME:
|
|
||||||
g_free(priv->network_name);
|
|
||||||
priv->network_name = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_MAC_ADDRESS:
|
|
||||||
g_free(priv->mac_address);
|
|
||||||
priv->mac_address =
|
|
||||||
_nm_utils_hwaddr_canonical_or_invalid(g_value_get_string(value), ETH_ALEN);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_wimax_init(NMSettingWimax *setting)
|
nm_setting_wimax_init(NMSettingWimax *setting)
|
||||||
{}
|
{}
|
||||||
@@ -191,16 +150,6 @@ nm_setting_wimax_new(void)
|
|||||||
return g_object_new(NM_TYPE_SETTING_WIMAX, NULL);
|
return 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_OBJECT_CLASS(nm_setting_wimax_parent_class)->finalize(object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_wimax_class_init(NMSettingWimaxClass *klass)
|
nm_setting_wimax_class_init(NMSettingWimaxClass *klass)
|
||||||
{
|
{
|
||||||
@@ -210,9 +159,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->get_property = get_property;
|
object_class->get_property = _nm_setting_property_get_property_direct;
|
||||||
object_class->set_property = set_property;
|
object_class->set_property = _nm_setting_property_set_property_direct;
|
||||||
object_class->finalize = finalize;
|
|
||||||
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
|
||||||
@@ -224,12 +172,13 @@ nm_setting_wimax_class_init(NMSettingWimaxClass *klass)
|
|||||||
*
|
*
|
||||||
* Deprecated: 1.2: WiMAX is no longer supported.
|
* Deprecated: 1.2: WiMAX is no longer supported.
|
||||||
**/
|
**/
|
||||||
obj_properties[PROP_NETWORK_NAME] =
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
g_param_spec_string(NM_SETTING_WIMAX_NETWORK_NAME,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_WIMAX_NETWORK_NAME,
|
||||||
"",
|
PROP_NETWORK_NAME,
|
||||||
NULL,
|
NM_SETTING_PARAM_NONE,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
NMSettingWimaxPrivate,
|
||||||
|
network_name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWimax:mac-address:
|
* NMSettingWimax:mac-address:
|
||||||
|
@@ -1301,12 +1301,6 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|||||||
NMSettingWirelessSecurityPrivate *priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE(setting);
|
NMSettingWirelessSecurityPrivate *priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE(setting);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_KEY_MGMT:
|
|
||||||
g_value_set_string(value, priv->key_mgmt);
|
|
||||||
break;
|
|
||||||
case PROP_AUTH_ALG:
|
|
||||||
g_value_set_string(value, priv->auth_alg);
|
|
||||||
break;
|
|
||||||
case PROP_PROTO:
|
case PROP_PROTO:
|
||||||
g_value_take_boxed(value, _nm_utils_slist_to_strv(priv->proto, TRUE));
|
g_value_take_boxed(value, _nm_utils_slist_to_strv(priv->proto, TRUE));
|
||||||
break;
|
break;
|
||||||
@@ -1316,27 +1310,6 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|||||||
case PROP_GROUP:
|
case PROP_GROUP:
|
||||||
g_value_take_boxed(value, _nm_utils_slist_to_strv(priv->group, TRUE));
|
g_value_take_boxed(value, _nm_utils_slist_to_strv(priv->group, TRUE));
|
||||||
break;
|
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_PSK:
|
|
||||||
g_value_set_string(value, priv->psk);
|
|
||||||
break;
|
|
||||||
case PROP_LEAP_PASSWORD:
|
|
||||||
g_value_set_string(value, priv->leap_password);
|
|
||||||
break;
|
|
||||||
case PROP_WEP_KEY_TYPE:
|
case PROP_WEP_KEY_TYPE:
|
||||||
g_value_set_enum(value, priv->wep_key_type);
|
g_value_set_enum(value, priv->wep_key_type);
|
||||||
break;
|
break;
|
||||||
@@ -1351,19 +1324,8 @@ set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *ps
|
|||||||
{
|
{
|
||||||
NMSettingWirelessSecurity *setting = NM_SETTING_WIRELESS_SECURITY(object);
|
NMSettingWirelessSecurity *setting = NM_SETTING_WIRELESS_SECURITY(object);
|
||||||
NMSettingWirelessSecurityPrivate *priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE(setting);
|
NMSettingWirelessSecurityPrivate *priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE(setting);
|
||||||
const char *str;
|
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_KEY_MGMT:
|
|
||||||
g_free(priv->key_mgmt);
|
|
||||||
str = g_value_get_string(value);
|
|
||||||
priv->key_mgmt = str ? g_ascii_strdown(str, -1) : NULL;
|
|
||||||
break;
|
|
||||||
case PROP_AUTH_ALG:
|
|
||||||
g_free(priv->auth_alg);
|
|
||||||
str = g_value_get_string(value);
|
|
||||||
priv->auth_alg = str ? g_ascii_strdown(str, -1) : NULL;
|
|
||||||
break;
|
|
||||||
case PROP_PROTO:
|
case PROP_PROTO:
|
||||||
g_slist_free_full(priv->proto, g_free);
|
g_slist_free_full(priv->proto, g_free);
|
||||||
priv->proto = nm_strv_to_gslist(g_value_get_boxed(value), TRUE);
|
priv->proto = nm_strv_to_gslist(g_value_get_boxed(value), TRUE);
|
||||||
@@ -1376,34 +1338,6 @@ set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *ps
|
|||||||
g_slist_free_full(priv->group, g_free);
|
g_slist_free_full(priv->group, g_free);
|
||||||
priv->group = nm_strv_to_gslist(g_value_get_boxed(value), TRUE);
|
priv->group = nm_strv_to_gslist(g_value_get_boxed(value), TRUE);
|
||||||
break;
|
break;
|
||||||
case PROP_LEAP_USERNAME:
|
|
||||||
g_free(priv->leap_username);
|
|
||||||
priv->leap_username = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_WEP_KEY0:
|
|
||||||
nm_free_secret(priv->wep_key0);
|
|
||||||
priv->wep_key0 = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_WEP_KEY1:
|
|
||||||
nm_free_secret(priv->wep_key1);
|
|
||||||
priv->wep_key1 = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_WEP_KEY2:
|
|
||||||
nm_free_secret(priv->wep_key2);
|
|
||||||
priv->wep_key2 = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_WEP_KEY3:
|
|
||||||
nm_free_secret(priv->wep_key3);
|
|
||||||
priv->wep_key3 = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_PSK:
|
|
||||||
nm_free_secret(priv->psk);
|
|
||||||
priv->psk = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_LEAP_PASSWORD:
|
|
||||||
nm_free_secret(priv->leap_password);
|
|
||||||
priv->leap_password = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_WEP_KEY_TYPE:
|
case PROP_WEP_KEY_TYPE:
|
||||||
priv->wep_key_type = g_value_get_enum(value);
|
priv->wep_key_type = g_value_get_enum(value);
|
||||||
break;
|
break;
|
||||||
@@ -1441,16 +1375,6 @@ finalize(GObject *object)
|
|||||||
NMSettingWirelessSecurity *self = NM_SETTING_WIRELESS_SECURITY(object);
|
NMSettingWirelessSecurity *self = NM_SETTING_WIRELESS_SECURITY(object);
|
||||||
NMSettingWirelessSecurityPrivate *priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE(self);
|
NMSettingWirelessSecurityPrivate *priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE(self);
|
||||||
|
|
||||||
g_free(priv->key_mgmt);
|
|
||||||
g_free(priv->auth_alg);
|
|
||||||
g_free(priv->leap_username);
|
|
||||||
nm_free_secret(priv->wep_key0);
|
|
||||||
nm_free_secret(priv->wep_key1);
|
|
||||||
nm_free_secret(priv->wep_key2);
|
|
||||||
nm_free_secret(priv->wep_key3);
|
|
||||||
nm_free_secret(priv->psk);
|
|
||||||
nm_free_secret(priv->leap_password);
|
|
||||||
|
|
||||||
g_slist_free_full(priv->proto, g_free);
|
g_slist_free_full(priv->proto, g_free);
|
||||||
g_slist_free_full(priv->pairwise, g_free);
|
g_slist_free_full(priv->pairwise, g_free);
|
||||||
g_slist_free_full(priv->group, g_free);
|
g_slist_free_full(priv->group, g_free);
|
||||||
@@ -1495,12 +1419,14 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||||||
* description: Key management method.
|
* description: Key management method.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
obj_properties[PROP_KEY_MGMT] =
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
g_param_spec_string(NM_SETTING_WIRELESS_SECURITY_KEY_MGMT,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_WIRELESS_SECURITY_KEY_MGMT,
|
||||||
"",
|
PROP_KEY_MGMT,
|
||||||
NULL,
|
NM_SETTING_PARAM_REQUIRED,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_REQUIRED | G_PARAM_STATIC_STRINGS);
|
NMSettingWirelessSecurityPrivate,
|
||||||
|
key_mgmt,
|
||||||
|
.direct_set_string_ascii_strdown = TRUE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWirelessSecurity:wep-tx-keyidx:
|
* NMSettingWirelessSecurity:wep-tx-keyidx:
|
||||||
@@ -1546,11 +1472,14 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||||||
* description: Authentication algorithm for WEP.
|
* description: Authentication algorithm for WEP.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
obj_properties[PROP_AUTH_ALG] = g_param_spec_string(NM_SETTING_WIRELESS_SECURITY_AUTH_ALG,
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
"",
|
obj_properties,
|
||||||
"",
|
NM_SETTING_WIRELESS_SECURITY_AUTH_ALG,
|
||||||
NULL,
|
PROP_AUTH_ALG,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
NM_SETTING_PARAM_NONE,
|
||||||
|
NMSettingWirelessSecurityPrivate,
|
||||||
|
auth_alg,
|
||||||
|
.direct_set_string_ascii_strdown = TRUE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWirelessSecurity:proto:
|
* NMSettingWirelessSecurity:proto:
|
||||||
@@ -1662,12 +1591,13 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||||||
* description: Login name for LEAP.
|
* description: Login name for LEAP.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
obj_properties[PROP_LEAP_USERNAME] =
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
g_param_spec_string(NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME,
|
||||||
"",
|
PROP_LEAP_USERNAME,
|
||||||
NULL,
|
NM_SETTING_PARAM_NONE,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
NMSettingWirelessSecurityPrivate,
|
||||||
|
leap_username);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWirelessSecurity:wep-key0:
|
* NMSettingWirelessSecurity:wep-key0:
|
||||||
@@ -1681,12 +1611,13 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||||||
* description: The first WEP key (used in most networks). See also DEFAULTKEY for key index.
|
* description: The first WEP key (used in most networks). See also DEFAULTKEY for key index.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
obj_properties[PROP_WEP_KEY0] =
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
g_param_spec_string(NM_SETTING_WIRELESS_SECURITY_WEP_KEY0,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_WIRELESS_SECURITY_WEP_KEY0,
|
||||||
"",
|
PROP_WEP_KEY0,
|
||||||
NULL,
|
NM_SETTING_PARAM_SECRET,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_SECRET | G_PARAM_STATIC_STRINGS);
|
NMSettingWirelessSecurityPrivate,
|
||||||
|
wep_key0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWirelessSecurity:wep-key1:
|
* NMSettingWirelessSecurity:wep-key1:
|
||||||
@@ -1700,12 +1631,13 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||||||
* description: WEP key with index 1. See also DEFAULTKEY for key index.
|
* description: WEP key with index 1. See also DEFAULTKEY for key index.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
obj_properties[PROP_WEP_KEY1] =
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
g_param_spec_string(NM_SETTING_WIRELESS_SECURITY_WEP_KEY1,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_WIRELESS_SECURITY_WEP_KEY1,
|
||||||
"",
|
PROP_WEP_KEY1,
|
||||||
NULL,
|
NM_SETTING_PARAM_SECRET,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_SECRET | G_PARAM_STATIC_STRINGS);
|
NMSettingWirelessSecurityPrivate,
|
||||||
|
wep_key1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWirelessSecurity:wep-key2:
|
* NMSettingWirelessSecurity:wep-key2:
|
||||||
@@ -1719,12 +1651,13 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||||||
* description: WEP key with index 2. See also DEFAULTKEY for key index.
|
* description: WEP key with index 2. See also DEFAULTKEY for key index.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
obj_properties[PROP_WEP_KEY2] =
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
g_param_spec_string(NM_SETTING_WIRELESS_SECURITY_WEP_KEY2,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_WIRELESS_SECURITY_WEP_KEY2,
|
||||||
"",
|
PROP_WEP_KEY2,
|
||||||
NULL,
|
NM_SETTING_PARAM_SECRET,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_SECRET | G_PARAM_STATIC_STRINGS);
|
NMSettingWirelessSecurityPrivate,
|
||||||
|
wep_key2);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWirelessSecurity:wep-key3:
|
* NMSettingWirelessSecurity:wep-key3:
|
||||||
@@ -1738,12 +1671,13 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||||||
* description: WEP key with index 3. See also DEFAULTKEY for key index.
|
* description: WEP key with index 3. See also DEFAULTKEY for key index.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
obj_properties[PROP_WEP_KEY3] =
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
g_param_spec_string(NM_SETTING_WIRELESS_SECURITY_WEP_KEY3,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_WIRELESS_SECURITY_WEP_KEY3,
|
||||||
"",
|
PROP_WEP_KEY3,
|
||||||
NULL,
|
NM_SETTING_PARAM_SECRET,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_SECRET | G_PARAM_STATIC_STRINGS);
|
NMSettingWirelessSecurityPrivate,
|
||||||
|
wep_key3);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWirelessSecurity:wep-key-flags:
|
* NMSettingWirelessSecurity:wep-key-flags:
|
||||||
@@ -1781,12 +1715,13 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||||||
* description: Pre-Shared-Key for WPA networks.
|
* description: Pre-Shared-Key for WPA networks.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
obj_properties[PROP_PSK] =
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
g_param_spec_string(NM_SETTING_WIRELESS_SECURITY_PSK,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_WIRELESS_SECURITY_PSK,
|
||||||
"",
|
PROP_PSK,
|
||||||
NULL,
|
NM_SETTING_PARAM_SECRET,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_SECRET | G_PARAM_STATIC_STRINGS);
|
NMSettingWirelessSecurityPrivate,
|
||||||
|
psk);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWirelessSecurity:psk-flags:
|
* NMSettingWirelessSecurity:psk-flags:
|
||||||
@@ -1822,12 +1757,13 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||||||
* lookaside file, or it can be owned by a secret agent.
|
* lookaside file, or it can be owned by a secret agent.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
obj_properties[PROP_LEAP_PASSWORD] =
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
g_param_spec_string(NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD,
|
||||||
"",
|
PROP_LEAP_PASSWORD,
|
||||||
NULL,
|
NM_SETTING_PARAM_SECRET,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_SECRET | G_PARAM_STATIC_STRINGS);
|
NMSettingWirelessSecurityPrivate,
|
||||||
|
leap_password);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWirelessSecurity:leap-password-flags:
|
* NMSettingWirelessSecurity:leap-password-flags:
|
||||||
|
@@ -1166,18 +1166,9 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|||||||
NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE(object);
|
NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE(object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_MODE:
|
|
||||||
g_value_set_string(value, nm_setting_wireless_get_mode(setting));
|
|
||||||
break;
|
|
||||||
case PROP_BAND:
|
|
||||||
g_value_set_string(value, nm_setting_wireless_get_band(setting));
|
|
||||||
break;
|
|
||||||
case PROP_CLONED_MAC_ADDRESS:
|
case PROP_CLONED_MAC_ADDRESS:
|
||||||
g_value_set_string(value, nm_setting_wireless_get_cloned_mac_address(setting));
|
g_value_set_string(value, nm_setting_wireless_get_cloned_mac_address(setting));
|
||||||
break;
|
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:
|
case PROP_MAC_ADDRESS_BLACKLIST:
|
||||||
g_value_set_boxed(value, (char **) priv->mac_address_blacklist->data);
|
g_value_set_boxed(value, (char **) priv->mac_address_blacklist->data);
|
||||||
break;
|
break;
|
||||||
@@ -1203,14 +1194,6 @@ set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *ps
|
|||||||
gboolean bool_val;
|
gboolean bool_val;
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_MODE:
|
|
||||||
g_free(priv->mode);
|
|
||||||
priv->mode = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_BAND:
|
|
||||||
g_free(priv->band);
|
|
||||||
priv->band = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_CLONED_MAC_ADDRESS:
|
case PROP_CLONED_MAC_ADDRESS:
|
||||||
bool_val = !!priv->cloned_mac_address;
|
bool_val = !!priv->cloned_mac_address;
|
||||||
g_free(priv->cloned_mac_address);
|
g_free(priv->cloned_mac_address);
|
||||||
@@ -1225,10 +1208,6 @@ set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *ps
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PROP_GENERATE_MAC_ADDRESS_MASK:
|
|
||||||
g_free(priv->generate_mac_address_mask);
|
|
||||||
priv->generate_mac_address_mask = g_value_dup_string(value);
|
|
||||||
break;
|
|
||||||
case PROP_MAC_ADDRESS_BLACKLIST:
|
case PROP_MAC_ADDRESS_BLACKLIST:
|
||||||
blacklist = g_value_get_boxed(value);
|
blacklist = g_value_get_boxed(value);
|
||||||
g_array_set_size(priv->mac_address_blacklist, 0);
|
g_array_set_size(priv->mac_address_blacklist, 0);
|
||||||
@@ -1295,11 +1274,7 @@ finalize(GObject *object)
|
|||||||
{
|
{
|
||||||
NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE(object);
|
NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE(object);
|
||||||
|
|
||||||
g_free(priv->mode);
|
|
||||||
g_free(priv->band);
|
|
||||||
|
|
||||||
g_free(priv->cloned_mac_address);
|
g_free(priv->cloned_mac_address);
|
||||||
g_free(priv->generate_mac_address_mask);
|
|
||||||
g_array_unref(priv->mac_address_blacklist);
|
g_array_unref(priv->mac_address_blacklist);
|
||||||
nm_clear_pointer(&priv->seen_bssids, g_ptr_array_unref);
|
nm_clear_pointer(&priv->seen_bssids, g_ptr_array_unref);
|
||||||
|
|
||||||
@@ -1360,11 +1335,13 @@ nm_setting_wireless_class_init(NMSettingWirelessClass *klass)
|
|||||||
* description: Wi-Fi network mode.
|
* description: Wi-Fi network mode.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
obj_properties[PROP_MODE] = g_param_spec_string(NM_SETTING_WIRELESS_MODE,
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
"",
|
obj_properties,
|
||||||
"",
|
NM_SETTING_WIRELESS_MODE,
|
||||||
NULL,
|
PROP_MODE,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
NM_SETTING_PARAM_NONE,
|
||||||
|
NMSettingWirelessPrivate,
|
||||||
|
mode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWireless:band:
|
* NMSettingWireless:band:
|
||||||
@@ -1385,11 +1362,13 @@ nm_setting_wireless_class_init(NMSettingWirelessClass *klass)
|
|||||||
* example: BAND=bg
|
* example: BAND=bg
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
obj_properties[PROP_BAND] = g_param_spec_string(NM_SETTING_WIRELESS_BAND,
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
"",
|
obj_properties,
|
||||||
"",
|
NM_SETTING_WIRELESS_BAND,
|
||||||
NULL,
|
PROP_BAND,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
NM_SETTING_PARAM_NONE,
|
||||||
|
NMSettingWirelessPrivate,
|
||||||
|
band);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWireless:channel:
|
* NMSettingWireless:channel:
|
||||||
@@ -1637,12 +1616,13 @@ nm_setting_wireless_class_init(NMSettingWirelessClass *klass)
|
|||||||
* cloned-mac-address.
|
* cloned-mac-address.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
obj_properties[PROP_GENERATE_MAC_ADDRESS_MASK] = g_param_spec_string(
|
_nm_setting_property_define_direct_string(properties_override,
|
||||||
NM_SETTING_WIRELESS_GENERATE_MAC_ADDRESS_MASK,
|
obj_properties,
|
||||||
"",
|
NM_SETTING_WIRELESS_GENERATE_MAC_ADDRESS_MASK,
|
||||||
"",
|
PROP_GENERATE_MAC_ADDRESS_MASK,
|
||||||
NULL,
|
NM_SETTING_PARAM_FUZZY_IGNORE,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_FUZZY_IGNORE | G_PARAM_STATIC_STRINGS);
|
NMSettingWirelessPrivate,
|
||||||
|
generate_mac_address_mask);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWireless:mac-address-blacklist:
|
* NMSettingWireless:mac-address-blacklist:
|
||||||
|
@@ -376,25 +376,27 @@ _nm_setting_class_commit(NMSettingClass *setting_class,
|
|||||||
nm_assert(p->param_spec);
|
nm_assert(p->param_spec);
|
||||||
|
|
||||||
vtype = p->param_spec->value_type;
|
vtype = p->param_spec->value_type;
|
||||||
|
|
||||||
|
if (vtype == G_TYPE_STRING) {
|
||||||
|
/* The "name" property is a bit special because it's defined in the
|
||||||
|
* parent class NMSetting. We set the property_type here, because
|
||||||
|
* it's more convenient (albeit a bit ugly).
|
||||||
|
*
|
||||||
|
* FIXME: let _nm_sett_info_property_override_create_array() always add
|
||||||
|
* the handling of the name property.*/
|
||||||
|
nm_assert(nm_streq(p->name, NM_SETTING_NAME));
|
||||||
|
nm_assert(!NM_FLAGS_HAS(p->param_spec->flags, G_PARAM_WRITABLE));
|
||||||
|
p->property_type = &nm_sett_info_propert_type_setting_name;
|
||||||
|
goto has_property_type;
|
||||||
|
}
|
||||||
|
|
||||||
if (vtype == G_TYPE_INT64)
|
if (vtype == G_TYPE_INT64)
|
||||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE_GPROP(
|
p->property_type = NM_SETT_INFO_PROPERT_TYPE_GPROP(
|
||||||
G_VARIANT_TYPE_INT64,
|
G_VARIANT_TYPE_INT64,
|
||||||
.compare_fcn = _nm_setting_property_compare_fcn_default,
|
.compare_fcn = _nm_setting_property_compare_fcn_default,
|
||||||
.from_dbus_fcn = _nm_setting_property_from_dbus_fcn_gprop,
|
.from_dbus_fcn = _nm_setting_property_from_dbus_fcn_gprop,
|
||||||
.from_dbus_is_full = TRUE);
|
.from_dbus_is_full = TRUE);
|
||||||
else if (vtype == G_TYPE_STRING) {
|
else if (vtype == G_TYPE_STRV)
|
||||||
nm_assert(nm_streq(p->name, NM_SETTING_NAME)
|
|
||||||
== (!NM_FLAGS_HAS(p->param_spec->flags, G_PARAM_WRITABLE)));
|
|
||||||
if (!NM_FLAGS_HAS(p->param_spec->flags, G_PARAM_WRITABLE))
|
|
||||||
p->property_type = &nm_sett_info_propert_type_setting_name;
|
|
||||||
else {
|
|
||||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE_GPROP(
|
|
||||||
G_VARIANT_TYPE_STRING,
|
|
||||||
.compare_fcn = _nm_setting_property_compare_fcn_default,
|
|
||||||
.from_dbus_fcn = _nm_setting_property_from_dbus_fcn_gprop,
|
|
||||||
.from_dbus_is_full = TRUE);
|
|
||||||
}
|
|
||||||
} else if (vtype == G_TYPE_STRV)
|
|
||||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE_GPROP(
|
p->property_type = NM_SETT_INFO_PROPERT_TYPE_GPROP(
|
||||||
G_VARIANT_TYPE_STRING_ARRAY,
|
G_VARIANT_TYPE_STRING_ARRAY,
|
||||||
.compare_fcn = _nm_setting_property_compare_fcn_default,
|
.compare_fcn = _nm_setting_property_compare_fcn_default,
|
||||||
|
@@ -4751,9 +4751,10 @@ check_done:;
|
|||||||
NULL);
|
NULL);
|
||||||
g_assert(!NM_G_PARAM_SPEC_GET_DEFAULT_STRING(sip->param_spec));
|
g_assert(!NM_G_PARAM_SPEC_GET_DEFAULT_STRING(sip->param_spec));
|
||||||
|
|
||||||
if (nm_streq(sip->name, NM_SETTING_NAME))
|
if (nm_streq(sip->name, NM_SETTING_NAME)) {
|
||||||
g_assert_cmpstr(g_value_get_string(&val), ==, msi->setting_name);
|
g_assert_cmpstr(g_value_get_string(&val), ==, msi->setting_name);
|
||||||
else
|
g_assert(sip->property_type == &nm_sett_info_propert_type_setting_name);
|
||||||
|
} else
|
||||||
g_assert_cmpstr(g_value_get_string(&val), ==, NULL);
|
g_assert_cmpstr(g_value_get_string(&val), ==, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user