mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 15:40:10 +01:00
libnm: merge branch 'th/setting-to-dbus-fcn'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/900
(cherry picked from commit 74996782eb)
This commit is contained in:
commit
11fd85b3e1
36 changed files with 1256 additions and 798 deletions
|
|
@ -196,8 +196,9 @@ finalize(GObject *object)
|
|||
static void
|
||||
nm_setting_6lowpan_class_init(NMSetting6LowpanClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GArray * properties_override = _nm_sett_info_property_override_create_array();
|
||||
|
||||
g_type_class_add_private(klass, sizeof(NMSetting6LowpanPrivate));
|
||||
|
||||
|
|
@ -215,14 +216,17 @@ nm_setting_6lowpan_class_init(NMSetting6LowpanClass *klass)
|
|||
*
|
||||
* Since: 1.14
|
||||
**/
|
||||
obj_properties[PROP_PARENT] = g_param_spec_string(
|
||||
NM_SETTING_6LOWPAN_PARENT,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_6LOWPAN_PARENT,
|
||||
PROP_PARENT,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_6lowpan_get_parent);
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_6LOWPAN);
|
||||
_nm_setting_class_commit_full(setting_class,
|
||||
NM_META_SETTING_TYPE_6LOWPAN,
|
||||
NULL,
|
||||
properties_override);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3513,8 +3513,9 @@ finalize(GObject *object)
|
|||
static void
|
||||
nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GArray * properties_override = _nm_sett_info_property_override_create_array();
|
||||
|
||||
g_type_class_add_private(klass, sizeof(NMSetting8021xPrivate));
|
||||
|
||||
|
|
@ -4587,12 +4588,13 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
* description: a boolean value.
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_SYSTEM_CA_CERTS] =
|
||||
g_param_spec_boolean(NM_SETTING_802_1X_SYSTEM_CA_CERTS,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_802_1X_SYSTEM_CA_CERTS,
|
||||
PROP_SYSTEM_CA_CERTS,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_802_1x_get_system_ca_certs);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:auth-timeout:
|
||||
|
|
@ -4636,14 +4638,18 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
* description: whether the 802.1X authentication is optional
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_OPTIONAL] =
|
||||
g_param_spec_boolean(NM_SETTING_802_1X_OPTIONAL,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_802_1X_OPTIONAL,
|
||||
PROP_OPTIONAL,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_802_1x_get_optional);
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_802_1X);
|
||||
_nm_setting_class_commit_full(setting_class,
|
||||
NM_META_SETTING_TYPE_802_1X,
|
||||
NULL,
|
||||
properties_override);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -351,8 +351,9 @@ finalize(GObject *object)
|
|||
static void
|
||||
nm_setting_adsl_class_init(NMSettingAdslClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GArray * properties_override = _nm_sett_info_property_override_create_array();
|
||||
|
||||
g_type_class_add_private(klass, sizeof(NMSettingAdslPrivate));
|
||||
|
||||
|
|
@ -369,23 +370,24 @@ nm_setting_adsl_class_init(NMSettingAdslClass *klass)
|
|||
*
|
||||
* Username used to authenticate with the ADSL service.
|
||||
**/
|
||||
obj_properties[PROP_USERNAME] = g_param_spec_string(NM_SETTING_ADSL_USERNAME,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_ADSL_USERNAME,
|
||||
PROP_USERNAME,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_adsl_get_username);
|
||||
|
||||
/**
|
||||
* NMSettingAdsl:password:
|
||||
*
|
||||
* Password used to authenticate with the ADSL service.
|
||||
**/
|
||||
obj_properties[PROP_PASSWORD] =
|
||||
g_param_spec_string(NM_SETTING_ADSL_PASSWORD,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_SECRET | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_ADSL_PASSWORD,
|
||||
PROP_PASSWORD,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
nm_setting_adsl_get_password);
|
||||
|
||||
/**
|
||||
* NMSettingAdsl:password-flags:
|
||||
|
|
@ -405,23 +407,24 @@ nm_setting_adsl_class_init(NMSettingAdslClass *klass)
|
|||
*
|
||||
* ADSL connection protocol. Can be "pppoa", "pppoe" or "ipoatm".
|
||||
**/
|
||||
obj_properties[PROP_PROTOCOL] = g_param_spec_string(NM_SETTING_ADSL_PROTOCOL,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_ADSL_PROTOCOL,
|
||||
PROP_PROTOCOL,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_adsl_get_protocol);
|
||||
|
||||
/**
|
||||
* NMSettingAdsl:encapsulation:
|
||||
*
|
||||
* Encapsulation of ADSL connection. Can be "vcmux" or "llc".
|
||||
**/
|
||||
obj_properties[PROP_ENCAPSULATION] =
|
||||
g_param_spec_string(NM_SETTING_ADSL_ENCAPSULATION,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_ADSL_ENCAPSULATION,
|
||||
PROP_ENCAPSULATION,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_adsl_get_encapsulation);
|
||||
|
||||
/**
|
||||
* NMSettingAdsl:vpi:
|
||||
|
|
@ -451,5 +454,8 @@ nm_setting_adsl_class_init(NMSettingAdslClass *klass)
|
|||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_ADSL);
|
||||
_nm_setting_class_commit_full(setting_class,
|
||||
NM_META_SETTING_TYPE_ADSL,
|
||||
NULL,
|
||||
properties_override);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -564,12 +564,13 @@ nm_setting_bridge_port_class_init(NMSettingBridgePortClass *klass)
|
|||
* description: Hairpin mode of the bridge port.
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_HAIRPIN_MODE] = g_param_spec_boolean(
|
||||
NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE,
|
||||
PROP_HAIRPIN_MODE,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_bridge_port_get_hairpin_mode);
|
||||
|
||||
/**
|
||||
* NMSettingBridgePort:vlans: (type GPtrArray(NMBridgeVlan))
|
||||
|
|
|
|||
|
|
@ -1672,12 +1672,13 @@ nm_setting_bridge_class_init(NMSettingBridgeClass *klass)
|
|||
* description: Span tree protocol participation.
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_STP] = g_param_spec_boolean(NM_SETTING_BRIDGE_STP,
|
||||
"",
|
||||
"",
|
||||
NM_BRIDGE_STP_DEF,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE
|
||||
| G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_BRIDGE_STP,
|
||||
PROP_STP,
|
||||
NM_BRIDGE_STP_DEF,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_bridge_get_stp);
|
||||
|
||||
/**
|
||||
* NMSettingBridge:priority:
|
||||
|
|
@ -1830,12 +1831,13 @@ nm_setting_bridge_class_init(NMSettingBridgeClass *klass)
|
|||
* description: IGMP snooping support.
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_MULTICAST_SNOOPING] = g_param_spec_boolean(
|
||||
NM_SETTING_BRIDGE_MULTICAST_SNOOPING,
|
||||
"",
|
||||
"",
|
||||
NM_BRIDGE_MULTICAST_SNOOPING_DEF,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_BRIDGE_MULTICAST_SNOOPING,
|
||||
PROP_MULTICAST_SNOOPING,
|
||||
NM_BRIDGE_MULTICAST_SNOOPING_DEF,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_bridge_get_multicast_snooping);
|
||||
|
||||
/**
|
||||
* NMSettingBridge:vlan-filtering:
|
||||
|
|
@ -1852,12 +1854,13 @@ nm_setting_bridge_class_init(NMSettingBridgeClass *klass)
|
|||
* description: VLAN filtering support.
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_VLAN_FILTERING] = g_param_spec_boolean(
|
||||
NM_SETTING_BRIDGE_VLAN_FILTERING,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_BRIDGE_VLAN_FILTERING,
|
||||
PROP_VLAN_FILTERING,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_bridge_get_vlan_filtering);
|
||||
|
||||
/**
|
||||
* NMSettingBridge:vlan-default-pvid:
|
||||
|
|
@ -1998,12 +2001,13 @@ nm_setting_bridge_class_init(NMSettingBridgeClass *klass)
|
|||
*
|
||||
* Since: 1.24
|
||||
*/
|
||||
obj_properties[PROP_VLAN_STATS_ENABLED] = g_param_spec_boolean(
|
||||
NM_SETTING_BRIDGE_VLAN_STATS_ENABLED,
|
||||
"",
|
||||
"",
|
||||
NM_BRIDGE_VLAN_STATS_ENABLED_DEF,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_BRIDGE_VLAN_STATS_ENABLED,
|
||||
PROP_VLAN_STATS_ENABLED,
|
||||
NM_BRIDGE_VLAN_STATS_ENABLED_DEF,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_bridge_get_vlan_stats_enabled);
|
||||
|
||||
/**
|
||||
* NMSettingBridge:multicast-router:
|
||||
|
|
@ -2048,12 +2052,13 @@ nm_setting_bridge_class_init(NMSettingBridgeClass *klass)
|
|||
*
|
||||
* Since: 1.24
|
||||
*/
|
||||
obj_properties[PROP_MULTICAST_QUERY_USE_IFADDR] = g_param_spec_boolean(
|
||||
NM_SETTING_BRIDGE_MULTICAST_QUERY_USE_IFADDR,
|
||||
"",
|
||||
"",
|
||||
NM_BRIDGE_MULTICAST_QUERY_USE_IFADDR_DEF,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_BRIDGE_MULTICAST_QUERY_USE_IFADDR,
|
||||
PROP_MULTICAST_QUERY_USE_IFADDR,
|
||||
NM_BRIDGE_MULTICAST_QUERY_USE_IFADDR_DEF,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_bridge_get_multicast_query_use_ifaddr);
|
||||
|
||||
/**
|
||||
* NMSettingBridge:multicast-querier:
|
||||
|
|
@ -2070,12 +2075,13 @@ nm_setting_bridge_class_init(NMSettingBridgeClass *klass)
|
|||
*
|
||||
* Since: 1.24
|
||||
*/
|
||||
obj_properties[PROP_MULTICAST_QUERIER] = g_param_spec_boolean(
|
||||
NM_SETTING_BRIDGE_MULTICAST_QUERIER,
|
||||
"",
|
||||
"",
|
||||
NM_BRIDGE_MULTICAST_QUERIER_DEF,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_BRIDGE_MULTICAST_QUERIER,
|
||||
PROP_MULTICAST_QUERIER,
|
||||
NM_BRIDGE_MULTICAST_QUERIER_DEF,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_bridge_get_multicast_querier);
|
||||
|
||||
/**
|
||||
* NMSettingBridge:multicast-hash-max:
|
||||
|
|
|
|||
|
|
@ -1872,12 +1872,12 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
* description: User friendly name for the connection profile.
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_ID] = g_param_spec_string(NM_SETTING_CONNECTION_ID,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_FUZZY_IGNORE
|
||||
| G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_CONNECTION_ID,
|
||||
PROP_ID,
|
||||
NM_SETTING_PARAM_FUZZY_IGNORE,
|
||||
nm_setting_connection_get_id);
|
||||
|
||||
/**
|
||||
* NMSettingConnection:uuid:
|
||||
|
|
@ -1902,12 +1902,12 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
* creates the UUID itself (by hashing the filename).
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_UUID] = g_param_spec_string(
|
||||
NM_SETTING_CONNECTION_UUID,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_FUZZY_IGNORE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_CONNECTION_UUID,
|
||||
PROP_UUID,
|
||||
NM_SETTING_PARAM_FUZZY_IGNORE,
|
||||
nm_setting_connection_get_uuid);
|
||||
|
||||
/**
|
||||
* NMSettingConnection:stable-id:
|
||||
|
|
@ -1956,12 +1956,12 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
* description: Token to generate stable IDs.
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_STABLE_ID] = g_param_spec_string(
|
||||
NM_SETTING_CONNECTION_STABLE_ID,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_FUZZY_IGNORE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_CONNECTION_STABLE_ID,
|
||||
PROP_STABLE_ID,
|
||||
NM_SETTING_PARAM_FUZZY_IGNORE,
|
||||
nm_setting_connection_get_stable_id);
|
||||
|
||||
/**
|
||||
* NMSettingConnection:interface-name:
|
||||
|
|
@ -1986,18 +1986,17 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
* can be required for some connection types.
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_INTERFACE_NAME] = g_param_spec_string(
|
||||
NM_SETTING_CONNECTION_INTERFACE_NAME,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(
|
||||
_nm_setting_property_define_string_full(
|
||||
properties_override,
|
||||
obj_properties[PROP_INTERFACE_NAME],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_STRING,
|
||||
.missing_from_dbus_fcn =
|
||||
nm_setting_connection_no_interface_name, ));
|
||||
obj_properties,
|
||||
NM_SETTING_CONNECTION_INTERFACE_NAME,
|
||||
PROP_INTERFACE_NAME,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(G_VARIANT_TYPE_STRING,
|
||||
.to_dbus_fcn = _nm_setting_property_to_dbus_fcn_get_string,
|
||||
.missing_from_dbus_fcn =
|
||||
nm_setting_connection_no_interface_name),
|
||||
nm_setting_connection_get_interface_name);
|
||||
|
||||
/**
|
||||
* NMSettingConnection:type:
|
||||
|
|
@ -2017,12 +2016,12 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
* example: TYPE=Ethernet; TYPE=Bond; TYPE=Bridge; DEVICETYPE=TeamPort
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_TYPE] = g_param_spec_string(NM_SETTING_CONNECTION_TYPE,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE
|
||||
| G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_CONNECTION_TYPE,
|
||||
PROP_TYPE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_connection_get_connection_type);
|
||||
|
||||
/**
|
||||
* NMSettingConnection:permissions:
|
||||
|
|
@ -2075,12 +2074,13 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
* description: Whether the connection should be autoconnected (not only while booting).
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_AUTOCONNECT] = g_param_spec_boolean(
|
||||
NM_SETTING_CONNECTION_AUTOCONNECT,
|
||||
"",
|
||||
"",
|
||||
TRUE,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_FUZZY_IGNORE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_CONNECTION_AUTOCONNECT,
|
||||
PROP_AUTOCONNECT,
|
||||
TRUE,
|
||||
NM_SETTING_PARAM_FUZZY_IGNORE,
|
||||
nm_setting_connection_get_autoconnect);
|
||||
|
||||
/**
|
||||
* NMSettingConnection:autoconnect-priority:
|
||||
|
|
@ -2182,8 +2182,8 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[PROP_TIMESTAMP],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_UINT64,
|
||||
.to_dbus_fcn = _to_dbus_fcn_timestamp, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(G_VARIANT_TYPE_UINT64,
|
||||
.to_dbus_fcn = _to_dbus_fcn_timestamp, ));
|
||||
|
||||
/**
|
||||
* NMSettingConnection:read-only:
|
||||
|
|
@ -2192,12 +2192,13 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
* service's D-Bus interface with the right privileges, or %TRUE if the
|
||||
* connection is read-only and cannot be modified.
|
||||
**/
|
||||
obj_properties[PROP_READ_ONLY] = g_param_spec_boolean(
|
||||
NM_SETTING_CONNECTION_READ_ONLY,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_FUZZY_IGNORE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_CONNECTION_READ_ONLY,
|
||||
PROP_READ_ONLY,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_FUZZY_IGNORE,
|
||||
nm_setting_connection_get_read_only);
|
||||
|
||||
/**
|
||||
* NMSettingConnection:zone:
|
||||
|
|
@ -2218,13 +2219,13 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
* example: ZONE=Work
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_ZONE] =
|
||||
g_param_spec_string(NM_SETTING_CONNECTION_ZONE,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_FUZZY_IGNORE
|
||||
| NM_SETTING_PARAM_REAPPLY_IMMEDIATELY | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_CONNECTION_ZONE,
|
||||
PROP_ZONE,
|
||||
NM_SETTING_PARAM_FUZZY_IGNORE
|
||||
| NM_SETTING_PARAM_REAPPLY_IMMEDIATELY,
|
||||
nm_setting_connection_get_zone);
|
||||
|
||||
/**
|
||||
* NMSettingConnection:master:
|
||||
|
|
@ -2240,13 +2241,12 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
* for compatibility with legacy tooling.
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_MASTER] =
|
||||
g_param_spec_string(NM_SETTING_CONNECTION_MASTER,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_FUZZY_IGNORE
|
||||
| NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_CONNECTION_MASTER,
|
||||
PROP_MASTER,
|
||||
NM_SETTING_PARAM_FUZZY_IGNORE | NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_connection_get_master);
|
||||
|
||||
/**
|
||||
* NMSettingConnection:slave-type:
|
||||
|
|
@ -2265,13 +2265,12 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
* and BRIDGE_UUID for bridging.
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_SLAVE_TYPE] =
|
||||
g_param_spec_string(NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_FUZZY_IGNORE
|
||||
| NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
PROP_SLAVE_TYPE,
|
||||
NM_SETTING_PARAM_FUZZY_IGNORE | NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_connection_get_slave_type);
|
||||
|
||||
/**
|
||||
* NMSettingConnection:autoconnect-slaves:
|
||||
|
|
@ -2553,11 +2552,12 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
* example: https://yourdevice.example.com/model.json
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_MUD_URL] = g_param_spec_string(NM_SETTING_CONNECTION_MUD_URL,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_CONNECTION_MUD_URL,
|
||||
PROP_MUD_URL,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_connection_get_mud_url);
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
|
|
|
|||
|
|
@ -744,14 +744,6 @@ set_gvalue_from_array(GValue *v, uint *a, size_t len)
|
|||
|
||||
#define SET_GVALUE_FROM_ARRAY(v, a) set_gvalue_from_array(v, a, G_N_ELEMENTS(a))
|
||||
|
||||
static GVariant *
|
||||
_nm_setting_dcb_uint_array_to_dbus(const GValue *prop_value)
|
||||
{
|
||||
GArray *src = g_value_get_boxed(prop_value);
|
||||
|
||||
return nm_g_variant_new_au((const guint32 *) src->data, src->len);
|
||||
}
|
||||
|
||||
static void
|
||||
_nm_setting_dcb_uint_array_from_dbus(GVariant *dbus_value, GValue *prop_value)
|
||||
{
|
||||
|
|
@ -762,11 +754,11 @@ _nm_setting_dcb_uint_array_from_dbus(GVariant *dbus_value, GValue *prop_value)
|
|||
set_gvalue_from_array(prop_value, (guint *) array, length);
|
||||
}
|
||||
|
||||
static const NMSettInfoPropertType nm_sett_info_propert_type_dcb_au = {
|
||||
.dbus_type = NM_G_VARIANT_TYPE("au"),
|
||||
.gprop_to_dbus_fcn = _nm_setting_dcb_uint_array_to_dbus,
|
||||
.gprop_from_dbus_fcn = _nm_setting_dcb_uint_array_from_dbus,
|
||||
};
|
||||
static const NMSettInfoPropertType nm_sett_info_propert_type_dcb_au =
|
||||
NM_SETT_INFO_PROPERT_TYPE_GPROP_INIT(
|
||||
NM_G_VARIANT_TYPE("au"),
|
||||
.typdata_to_dbus.gprop_type = NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_GARRAY_UINT,
|
||||
.gprop_from_dbus_fcn = _nm_setting_dcb_uint_array_from_dbus, );
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
|
|
|||
|
|
@ -667,12 +667,13 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||
*
|
||||
* Since: 1.22
|
||||
**/
|
||||
obj_properties[PROP_AUTO_CONFIG] =
|
||||
g_param_spec_boolean(NM_SETTING_GSM_AUTO_CONFIG,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_GSM_AUTO_CONFIG,
|
||||
PROP_AUTO_CONFIG,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_gsm_get_auto_config);
|
||||
|
||||
/**
|
||||
* NMSettingGsm:number:
|
||||
|
|
@ -793,12 +794,13 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||
* When %TRUE, only connections to the home network will be allowed.
|
||||
* Connections to roaming networks will not be made.
|
||||
**/
|
||||
obj_properties[PROP_HOME_ONLY] =
|
||||
g_param_spec_boolean(NM_SETTING_GSM_HOME_ONLY,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_GSM_HOME_ONLY,
|
||||
PROP_HOME_ONLY,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_gsm_get_home_only);
|
||||
|
||||
/**
|
||||
* NMSettingGsm:device-id:
|
||||
|
|
|
|||
|
|
@ -5760,10 +5760,35 @@ _nm_sett_info_property_override_create_array_ip_config(void)
|
|||
{
|
||||
GArray *properties_override = _nm_sett_info_property_override_create_array();
|
||||
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[PROP_GATEWAY],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_STRING,
|
||||
.from_dbus_fcn = ip_gateway_set, ));
|
||||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[PROP_METHOD],
|
||||
&nm_sett_info_propert_type_string,
|
||||
.to_dbus_data.get_string =
|
||||
(const char *(*) (NMSetting *) ) nm_setting_ip_config_get_method);
|
||||
|
||||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[PROP_GATEWAY],
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(G_VARIANT_TYPE_STRING,
|
||||
.to_dbus_fcn = _nm_setting_property_to_dbus_fcn_get_string,
|
||||
.from_dbus_fcn = ip_gateway_set),
|
||||
.to_dbus_data.get_string =
|
||||
(const char *(*) (NMSetting *) ) nm_setting_ip_config_get_gateway);
|
||||
|
||||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[PROP_DHCP_HOSTNAME],
|
||||
&nm_sett_info_propert_type_string,
|
||||
.to_dbus_data.get_string =
|
||||
(const char *(*) (NMSetting *) ) nm_setting_ip_config_get_dhcp_hostname);
|
||||
|
||||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[PROP_DHCP_IAID],
|
||||
&nm_sett_info_propert_type_string,
|
||||
.to_dbus_data.get_string =
|
||||
(const char *(*) (NMSetting *) ) nm_setting_ip_config_get_dhcp_iaid);
|
||||
|
||||
/* ---dbus---
|
||||
* property: routing-rules
|
||||
|
|
@ -5774,9 +5799,39 @@ _nm_sett_info_property_override_create_array_ip_config(void)
|
|||
_nm_properties_override_dbus(
|
||||
properties_override,
|
||||
NM_SETTING_IP_CONFIG_ROUTING_RULES,
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = _routing_rules_dbus_only_synth,
|
||||
.from_dbus_fcn = _routing_rules_dbus_only_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = _routing_rules_dbus_only_synth,
|
||||
.from_dbus_fcn = _routing_rules_dbus_only_set, ));
|
||||
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[PROP_IGNORE_AUTO_ROUTES],
|
||||
&nm_sett_info_propert_type_boolean,
|
||||
.to_dbus_data.get_boolean = (gboolean(*)(
|
||||
NMSetting *)) nm_setting_ip_config_get_ignore_auto_routes);
|
||||
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[PROP_IGNORE_AUTO_DNS],
|
||||
&nm_sett_info_propert_type_boolean,
|
||||
.to_dbus_data.get_boolean = (gboolean(*)(
|
||||
NMSetting *)) nm_setting_ip_config_get_ignore_auto_dns);
|
||||
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[PROP_DHCP_SEND_HOSTNAME],
|
||||
&nm_sett_info_propert_type_boolean,
|
||||
.to_dbus_data.get_boolean = (gboolean(*)(
|
||||
NMSetting *)) nm_setting_ip_config_get_dhcp_send_hostname);
|
||||
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[PROP_NEVER_DEFAULT],
|
||||
&nm_sett_info_propert_type_boolean,
|
||||
.to_dbus_data.get_boolean = (gboolean(*)(
|
||||
NMSetting *)) nm_setting_ip_config_get_never_default);
|
||||
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[PROP_MAY_FAIL],
|
||||
&nm_sett_info_propert_type_boolean,
|
||||
.to_dbus_data.get_boolean =
|
||||
(gboolean(*)(NMSetting *)) nm_setting_ip_config_get_may_fail);
|
||||
|
||||
return properties_override;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -654,8 +654,9 @@ finalize(GObject *object)
|
|||
static void
|
||||
nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GArray * properties_override = _nm_sett_info_property_override_create_array();
|
||||
|
||||
g_type_class_add_private(klass, sizeof(NMSettingIPTunnelPrivate));
|
||||
|
||||
|
|
@ -674,12 +675,12 @@ nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass)
|
|||
*
|
||||
* Since: 1.2
|
||||
**/
|
||||
obj_properties[PROP_PARENT] = g_param_spec_string(
|
||||
NM_SETTING_IP_TUNNEL_PARENT,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_IP_TUNNEL_PARENT,
|
||||
PROP_PARENT,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_ip_tunnel_get_parent);
|
||||
|
||||
/**
|
||||
* NMSettingIPTunnel:mode:
|
||||
|
|
@ -706,12 +707,12 @@ nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass)
|
|||
*
|
||||
* Since: 1.2
|
||||
**/
|
||||
obj_properties[PROP_LOCAL] = g_param_spec_string(NM_SETTING_IP_TUNNEL_LOCAL,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE
|
||||
| G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_IP_TUNNEL_LOCAL,
|
||||
PROP_LOCAL,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_ip_tunnel_get_local);
|
||||
|
||||
/**
|
||||
* NMSettingIPTunnel:remote:
|
||||
|
|
@ -721,12 +722,12 @@ nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass)
|
|||
*
|
||||
* Since: 1.2
|
||||
**/
|
||||
obj_properties[PROP_REMOTE] = g_param_spec_string(
|
||||
NM_SETTING_IP_TUNNEL_REMOTE,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_IP_TUNNEL_REMOTE,
|
||||
PROP_REMOTE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_ip_tunnel_get_remote);
|
||||
|
||||
/**
|
||||
* NMSettingIPTunnel:ttl
|
||||
|
|
@ -769,12 +770,13 @@ nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass)
|
|||
*
|
||||
* Since: 1.2
|
||||
**/
|
||||
obj_properties[PROP_PATH_MTU_DISCOVERY] = g_param_spec_boolean(
|
||||
NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY,
|
||||
"",
|
||||
"",
|
||||
TRUE,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY,
|
||||
PROP_PATH_MTU_DISCOVERY,
|
||||
TRUE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_ip_tunnel_get_path_mtu_discovery);
|
||||
|
||||
/**
|
||||
* NMSettingIPTunnel:input-key:
|
||||
|
|
@ -784,12 +786,12 @@ nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass)
|
|||
*
|
||||
* Since: 1.2
|
||||
**/
|
||||
obj_properties[PROP_INPUT_KEY] = g_param_spec_string(
|
||||
NM_SETTING_IP_TUNNEL_INPUT_KEY,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_IP_TUNNEL_INPUT_KEY,
|
||||
PROP_INPUT_KEY,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_ip_tunnel_get_input_key);
|
||||
|
||||
/**
|
||||
* NMSettingIPTunnel:output-key:
|
||||
|
|
@ -799,12 +801,12 @@ nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass)
|
|||
*
|
||||
* Since: 1.2
|
||||
**/
|
||||
obj_properties[PROP_OUTPUT_KEY] = g_param_spec_string(
|
||||
NM_SETTING_IP_TUNNEL_OUTPUT_KEY,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_IP_TUNNEL_OUTPUT_KEY,
|
||||
PROP_OUTPUT_KEY,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_ip_tunnel_get_output_key);
|
||||
|
||||
/**
|
||||
* NMSettingIPTunnel:encapsulation-limit:
|
||||
|
|
@ -879,5 +881,8 @@ nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass)
|
|||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_IP_TUNNEL);
|
||||
_nm_setting_class_commit_full(setting_class,
|
||||
NM_META_SETTING_TYPE_IP_TUNNEL,
|
||||
NULL,
|
||||
properties_override);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -847,12 +847,12 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
|
|||
* example: DHCP_CLIENT_ID=ax-srv-1; DHCP_CLIENT_ID=01:44:44:44:44:44:44
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_DHCP_CLIENT_ID] =
|
||||
g_param_spec_string(NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID,
|
||||
PROP_DHCP_CLIENT_ID,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_ip4_config_get_dhcp_client_id);
|
||||
|
||||
/* ---ifcfg-rh---
|
||||
* property: dad-timeout
|
||||
|
|
@ -898,12 +898,12 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
|
|||
* example: DHCP_FQDN=foo.bar.com
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_DHCP_FQDN] =
|
||||
g_param_spec_string(NM_SETTING_IP4_CONFIG_DHCP_FQDN,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_IP4_CONFIG_DHCP_FQDN,
|
||||
PROP_DHCP_FQDN,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_ip4_config_get_dhcp_fqdn);
|
||||
|
||||
/**
|
||||
* NMSettingIP4Config:dhcp-vendor-class-identifier:
|
||||
|
|
@ -924,12 +924,12 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
|
|||
* example: DHCP_VENDOR_CLASS_IDENTIFIER=foo
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_DHCP_VENDOR_CLASS_IDENTIFIER] =
|
||||
g_param_spec_string(NM_SETTING_IP4_CONFIG_DHCP_VENDOR_CLASS_IDENTIFIER,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_IP4_CONFIG_DHCP_VENDOR_CLASS_IDENTIFIER,
|
||||
PROP_DHCP_VENDOR_CLASS_IDENTIFIER,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_ip4_config_get_dhcp_vendor_class_identifier);
|
||||
|
||||
/* IP4-specific property overrides */
|
||||
|
||||
|
|
@ -943,9 +943,9 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
|
|||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
g_object_class_find_property(G_OBJECT_CLASS(setting_class), NM_SETTING_IP_CONFIG_DNS),
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("au"),
|
||||
.gprop_to_dbus_fcn = ip4_dns_to_dbus,
|
||||
.gprop_from_dbus_fcn = ip4_dns_from_dbus, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_GPROP(NM_G_VARIANT_TYPE("au"),
|
||||
.gprop_from_dbus_fcn = ip4_dns_from_dbus, ),
|
||||
.to_dbus_data.gprop_to_dbus_fcn = ip4_dns_to_dbus);
|
||||
|
||||
/* ---dbus---
|
||||
* property: addresses
|
||||
|
|
@ -972,14 +972,14 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
|
|||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
g_object_class_find_property(G_OBJECT_CLASS(setting_class), NM_SETTING_IP_CONFIG_ADDRESSES),
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aau"),
|
||||
.to_dbus_fcn = ip4_addresses_get,
|
||||
.from_dbus_fcn = ip4_addresses_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aau"),
|
||||
.to_dbus_fcn = ip4_addresses_get,
|
||||
.from_dbus_fcn = ip4_addresses_set, ));
|
||||
_nm_properties_override_dbus(
|
||||
properties_override,
|
||||
"address-labels",
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_STRING_ARRAY,
|
||||
.to_dbus_fcn = ip4_address_labels_get, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(G_VARIANT_TYPE_STRING_ARRAY,
|
||||
.to_dbus_fcn = ip4_address_labels_get, ));
|
||||
|
||||
/* ---dbus---
|
||||
* property: address-data
|
||||
|
|
@ -993,9 +993,9 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
|
|||
_nm_properties_override_dbus(
|
||||
properties_override,
|
||||
"address-data",
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = ip4_address_data_get,
|
||||
.from_dbus_fcn = ip4_address_data_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = ip4_address_data_get,
|
||||
.from_dbus_fcn = ip4_address_data_set, ));
|
||||
|
||||
/* ---dbus---
|
||||
* property: routes
|
||||
|
|
@ -1026,9 +1026,9 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
|
|||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
g_object_class_find_property(G_OBJECT_CLASS(setting_class), NM_SETTING_IP_CONFIG_ROUTES),
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aau"),
|
||||
.to_dbus_fcn = ip4_routes_get,
|
||||
.from_dbus_fcn = ip4_routes_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aau"),
|
||||
.to_dbus_fcn = ip4_routes_get,
|
||||
.from_dbus_fcn = ip4_routes_set, ));
|
||||
|
||||
/* ---dbus---
|
||||
* property: route-data
|
||||
|
|
@ -1043,11 +1043,12 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
|
|||
* also exist on some routes.
|
||||
* ---end---
|
||||
*/
|
||||
_nm_properties_override_dbus(properties_override,
|
||||
"route-data",
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = ip4_route_data_get,
|
||||
.from_dbus_fcn = ip4_route_data_set, ));
|
||||
_nm_properties_override_dbus(
|
||||
properties_override,
|
||||
"route-data",
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = ip4_route_data_get,
|
||||
.from_dbus_fcn = ip4_route_data_set, ));
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
|
|
|
|||
|
|
@ -914,12 +914,12 @@ nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
|
|||
* example: IPV6_TOKEN=::53
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_TOKEN] = g_param_spec_string(NM_SETTING_IP6_CONFIG_TOKEN,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE
|
||||
| G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_IP6_CONFIG_TOKEN,
|
||||
PROP_TOKEN,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_ip6_config_get_token);
|
||||
|
||||
/**
|
||||
* NMSettingIP6Config:ra-timeout:
|
||||
|
|
@ -994,12 +994,12 @@ nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
|
|||
* example: DHCPV6_DUID=LL; DHCPV6_DUID=0301deadbeef0001; DHCPV6_DUID=03:01:de:ad:be:ef:00:01
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_DHCP_DUID] =
|
||||
g_param_spec_string(NM_SETTING_IP6_CONFIG_DHCP_DUID,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_IP6_CONFIG_DHCP_DUID,
|
||||
PROP_DHCP_DUID,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_ip6_config_get_dhcp_duid);
|
||||
|
||||
/* IP6-specific property overrides */
|
||||
|
||||
|
|
@ -1012,9 +1012,9 @@ nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
|
|||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
g_object_class_find_property(G_OBJECT_CLASS(setting_class), NM_SETTING_IP_CONFIG_DNS),
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aay"),
|
||||
.gprop_to_dbus_fcn = ip6_dns_to_dbus,
|
||||
.gprop_from_dbus_fcn = ip6_dns_from_dbus, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_GPROP(NM_G_VARIANT_TYPE("aay"),
|
||||
.gprop_from_dbus_fcn = ip6_dns_from_dbus, ),
|
||||
.to_dbus_data.gprop_to_dbus_fcn = ip6_dns_to_dbus);
|
||||
|
||||
/* ---dbus---
|
||||
* property: addresses
|
||||
|
|
@ -1033,9 +1033,9 @@ nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
|
|||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
g_object_class_find_property(G_OBJECT_CLASS(setting_class), NM_SETTING_IP_CONFIG_ADDRESSES),
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("a(ayuay)"),
|
||||
.to_dbus_fcn = ip6_addresses_get,
|
||||
.from_dbus_fcn = ip6_addresses_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("a(ayuay)"),
|
||||
.to_dbus_fcn = ip6_addresses_get,
|
||||
.from_dbus_fcn = ip6_addresses_set, ));
|
||||
|
||||
/* ---dbus---
|
||||
* property: address-data
|
||||
|
|
@ -1049,9 +1049,9 @@ nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
|
|||
_nm_properties_override_dbus(
|
||||
properties_override,
|
||||
"address-data",
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = ip6_address_data_get,
|
||||
.from_dbus_fcn = ip6_address_data_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = ip6_address_data_get,
|
||||
.from_dbus_fcn = ip6_address_data_set, ));
|
||||
|
||||
/* ---dbus---
|
||||
* property: routes
|
||||
|
|
@ -1070,9 +1070,9 @@ nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
|
|||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
g_object_class_find_property(G_OBJECT_CLASS(setting_class), NM_SETTING_IP_CONFIG_ROUTES),
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("a(ayuayu)"),
|
||||
.to_dbus_fcn = ip6_routes_get,
|
||||
.from_dbus_fcn = ip6_routes_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("a(ayuayu)"),
|
||||
.to_dbus_fcn = ip6_routes_get,
|
||||
.from_dbus_fcn = ip6_routes_set, ));
|
||||
|
||||
/* ---dbus---
|
||||
* property: route-data
|
||||
|
|
@ -1087,11 +1087,12 @@ nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
|
|||
* also exist on some routes.
|
||||
* ---end---
|
||||
*/
|
||||
_nm_properties_override_dbus(properties_override,
|
||||
"route-data",
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = ip6_route_data_get,
|
||||
.from_dbus_fcn = ip6_route_data_set, ));
|
||||
_nm_properties_override_dbus(
|
||||
properties_override,
|
||||
"route-data",
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = ip6_route_data_get,
|
||||
.from_dbus_fcn = ip6_route_data_set, ));
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
|
|
|
|||
|
|
@ -529,8 +529,9 @@ finalize(GObject *object)
|
|||
static void
|
||||
nm_setting_macsec_class_init(NMSettingMacsecClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GArray * properties_override = _nm_sett_info_property_override_create_array();
|
||||
|
||||
g_type_class_add_private(klass, sizeof(NMSettingMacsecPrivate));
|
||||
|
||||
|
|
@ -582,11 +583,13 @@ nm_setting_macsec_class_init(NMSettingMacsecClass *klass)
|
|||
*
|
||||
* Since: 1.6
|
||||
**/
|
||||
obj_properties[PROP_ENCRYPT] = g_param_spec_boolean(NM_SETTING_MACSEC_ENCRYPT,
|
||||
"",
|
||||
"",
|
||||
TRUE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_MACSEC_ENCRYPT,
|
||||
PROP_ENCRYPT,
|
||||
TRUE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_macsec_get_encrypt);
|
||||
|
||||
/**
|
||||
* NMSettingMacsec:mka-cak:
|
||||
|
|
@ -673,14 +676,18 @@ nm_setting_macsec_class_init(NMSettingMacsecClass *klass)
|
|||
*
|
||||
* Since: 1.12
|
||||
**/
|
||||
obj_properties[PROP_SEND_SCI] =
|
||||
g_param_spec_boolean(NM_SETTING_MACSEC_SEND_SCI,
|
||||
"",
|
||||
"",
|
||||
TRUE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_MACSEC_SEND_SCI,
|
||||
PROP_SEND_SCI,
|
||||
TRUE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_macsec_get_send_sci);
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_MACSEC);
|
||||
_nm_setting_class_commit_full(setting_class,
|
||||
NM_META_SETTING_TYPE_MACSEC,
|
||||
NULL,
|
||||
properties_override);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -269,8 +269,9 @@ finalize(GObject *object)
|
|||
static void
|
||||
nm_setting_macvlan_class_init(NMSettingMacvlanClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GArray * properties_override = _nm_sett_info_property_override_create_array();
|
||||
|
||||
g_type_class_add_private(klass, sizeof(NMSettingMacvlanPrivate));
|
||||
|
||||
|
|
@ -321,12 +322,13 @@ nm_setting_macvlan_class_init(NMSettingMacvlanClass *klass)
|
|||
*
|
||||
* Since: 1.2
|
||||
**/
|
||||
obj_properties[PROP_PROMISCUOUS] = g_param_spec_boolean(
|
||||
NM_SETTING_MACVLAN_PROMISCUOUS,
|
||||
"",
|
||||
"",
|
||||
TRUE,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_MACVLAN_PROMISCUOUS,
|
||||
PROP_PROMISCUOUS,
|
||||
TRUE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_macvlan_get_promiscuous);
|
||||
|
||||
/**
|
||||
* NMSettingMacvlan:tap:
|
||||
|
|
@ -335,14 +337,18 @@ nm_setting_macvlan_class_init(NMSettingMacvlanClass *klass)
|
|||
*
|
||||
* Since: 1.2
|
||||
**/
|
||||
obj_properties[PROP_TAP] = g_param_spec_boolean(NM_SETTING_MACVLAN_TAP,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE
|
||||
| G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_MACVLAN_TAP,
|
||||
PROP_TAP,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_macvlan_get_tap);
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_MACVLAN);
|
||||
_nm_setting_class_commit_full(setting_class,
|
||||
NM_META_SETTING_TYPE_MACVLAN,
|
||||
NULL,
|
||||
properties_override);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -289,8 +289,9 @@ finalize(GObject *object)
|
|||
static void
|
||||
nm_setting_ovs_bridge_class_init(NMSettingOvsBridgeClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GObjectClass * object_class = G_OBJECT_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->set_property = set_property;
|
||||
|
|
@ -319,12 +320,13 @@ nm_setting_ovs_bridge_class_init(NMSettingOvsBridgeClass *klass)
|
|||
*
|
||||
* Since: 1.10
|
||||
**/
|
||||
obj_properties[PROP_MCAST_SNOOPING_ENABLE] =
|
||||
g_param_spec_boolean(NM_SETTING_OVS_BRIDGE_MCAST_SNOOPING_ENABLE,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_OVS_BRIDGE_MCAST_SNOOPING_ENABLE,
|
||||
PROP_MCAST_SNOOPING_ENABLE,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_ovs_bridge_get_mcast_snooping_enable);
|
||||
|
||||
/**
|
||||
* NMSettingOvsBridge:rstp-enable:
|
||||
|
|
@ -333,12 +335,13 @@ nm_setting_ovs_bridge_class_init(NMSettingOvsBridgeClass *klass)
|
|||
*
|
||||
* Since: 1.10
|
||||
**/
|
||||
obj_properties[PROP_RSTP_ENABLE] =
|
||||
g_param_spec_boolean(NM_SETTING_OVS_BRIDGE_RSTP_ENABLE,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_OVS_BRIDGE_RSTP_ENABLE,
|
||||
PROP_RSTP_ENABLE,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_ovs_bridge_get_rstp_enable);
|
||||
|
||||
/**
|
||||
* NMSettingOvsBridge:stp-enable:
|
||||
|
|
@ -347,12 +350,13 @@ nm_setting_ovs_bridge_class_init(NMSettingOvsBridgeClass *klass)
|
|||
*
|
||||
* Since: 1.10
|
||||
**/
|
||||
obj_properties[PROP_STP_ENABLE] =
|
||||
g_param_spec_boolean(NM_SETTING_OVS_BRIDGE_STP_ENABLE,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_OVS_BRIDGE_STP_ENABLE,
|
||||
PROP_STP_ENABLE,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_ovs_bridge_get_stp_enable);
|
||||
|
||||
/**
|
||||
* NMSettingOvsBridge:datapath-type:
|
||||
|
|
@ -370,5 +374,8 @@ nm_setting_ovs_bridge_class_init(NMSettingOvsBridgeClass *klass)
|
|||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_OVS_BRIDGE);
|
||||
_nm_setting_class_commit_full(setting_class,
|
||||
NM_META_SETTING_TYPE_OVS_BRIDGE,
|
||||
NULL,
|
||||
properties_override);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -534,8 +534,9 @@ nm_setting_ppp_new(void)
|
|||
static void
|
||||
nm_setting_ppp_class_init(NMSettingPppClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GArray * properties_override = _nm_sett_info_property_override_create_array();
|
||||
|
||||
g_type_class_add_private(klass, sizeof(NMSettingPppPrivate));
|
||||
|
||||
|
|
@ -551,107 +552,117 @@ nm_setting_ppp_class_init(NMSettingPppClass *klass)
|
|||
* authenticate itself to the client. If %FALSE, require authentication
|
||||
* from the remote side. In almost all cases, this should be %TRUE.
|
||||
**/
|
||||
obj_properties[PROP_NOAUTH] = g_param_spec_boolean(NM_SETTING_PPP_NOAUTH,
|
||||
"",
|
||||
"",
|
||||
TRUE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_PPP_NOAUTH,
|
||||
PROP_NOAUTH,
|
||||
TRUE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_ppp_get_noauth);
|
||||
|
||||
/**
|
||||
* NMSettingPpp:refuse-eap:
|
||||
*
|
||||
* If %TRUE, the EAP authentication method will not be used.
|
||||
**/
|
||||
obj_properties[PROP_REFUSE_EAP] =
|
||||
g_param_spec_boolean(NM_SETTING_PPP_REFUSE_EAP,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_PPP_REFUSE_EAP,
|
||||
PROP_REFUSE_EAP,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_ppp_get_refuse_eap);
|
||||
|
||||
/**
|
||||
* NMSettingPpp:refuse-pap:
|
||||
*
|
||||
* If %TRUE, the PAP authentication method will not be used.
|
||||
**/
|
||||
obj_properties[PROP_REFUSE_PAP] =
|
||||
g_param_spec_boolean(NM_SETTING_PPP_REFUSE_PAP,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_PPP_REFUSE_PAP,
|
||||
PROP_REFUSE_PAP,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_ppp_get_refuse_pap);
|
||||
|
||||
/**
|
||||
* NMSettingPpp:refuse-chap:
|
||||
*
|
||||
* If %TRUE, the CHAP authentication method will not be used.
|
||||
**/
|
||||
obj_properties[PROP_REFUSE_CHAP] =
|
||||
g_param_spec_boolean(NM_SETTING_PPP_REFUSE_CHAP,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_PPP_REFUSE_CHAP,
|
||||
PROP_REFUSE_CHAP,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_ppp_get_refuse_chap);
|
||||
|
||||
/**
|
||||
* NMSettingPpp:refuse-mschap:
|
||||
*
|
||||
* If %TRUE, the MSCHAP authentication method will not be used.
|
||||
**/
|
||||
obj_properties[PROP_REFUSE_MSCHAP] =
|
||||
g_param_spec_boolean(NM_SETTING_PPP_REFUSE_MSCHAP,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_PPP_REFUSE_MSCHAP,
|
||||
PROP_REFUSE_MSCHAP,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_ppp_get_refuse_mschap);
|
||||
|
||||
/**
|
||||
* NMSettingPpp:refuse-mschapv2:
|
||||
*
|
||||
* If %TRUE, the MSCHAPv2 authentication method will not be used.
|
||||
**/
|
||||
obj_properties[PROP_REFUSE_MSCHAPV2] =
|
||||
g_param_spec_boolean(NM_SETTING_PPP_REFUSE_MSCHAPV2,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_PPP_REFUSE_MSCHAPV2,
|
||||
PROP_REFUSE_MSCHAPV2,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_ppp_get_refuse_mschapv2);
|
||||
|
||||
/**
|
||||
* NMSettingPpp:nobsdcomp:
|
||||
*
|
||||
* If %TRUE, BSD compression will not be requested.
|
||||
**/
|
||||
obj_properties[PROP_NOBSDCOMP] = g_param_spec_boolean(
|
||||
NM_SETTING_PPP_NOBSDCOMP,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_FUZZY_IGNORE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_PPP_NOBSDCOMP,
|
||||
PROP_NOBSDCOMP,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_FUZZY_IGNORE,
|
||||
nm_setting_ppp_get_nobsdcomp);
|
||||
|
||||
/**
|
||||
* NMSettingPpp:nodeflate:
|
||||
*
|
||||
* If %TRUE, "deflate" compression will not be requested.
|
||||
**/
|
||||
obj_properties[PROP_NODEFLATE] = g_param_spec_boolean(
|
||||
NM_SETTING_PPP_NODEFLATE,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_FUZZY_IGNORE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_PPP_NODEFLATE,
|
||||
PROP_NODEFLATE,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_FUZZY_IGNORE,
|
||||
nm_setting_ppp_get_nodeflate);
|
||||
|
||||
/**
|
||||
* NMSettingPpp:no-vj-comp:
|
||||
*
|
||||
* If %TRUE, Van Jacobsen TCP header compression will not be requested.
|
||||
**/
|
||||
obj_properties[PROP_NO_VJ_COMP] = g_param_spec_boolean(
|
||||
NM_SETTING_PPP_NO_VJ_COMP,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_FUZZY_IGNORE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_PPP_NO_VJ_COMP,
|
||||
PROP_NO_VJ_COMP,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_FUZZY_IGNORE,
|
||||
nm_setting_ppp_get_no_vj_comp);
|
||||
|
||||
/**
|
||||
* NMSettingPpp:require-mppe:
|
||||
|
|
@ -661,12 +672,13 @@ nm_setting_ppp_class_init(NMSettingPppClass *klass)
|
|||
* session will fail. Note that MPPE is not used on mobile broadband
|
||||
* connections.
|
||||
**/
|
||||
obj_properties[PROP_REQUIRE_MPPE] =
|
||||
g_param_spec_boolean(NM_SETTING_PPP_REQUIRE_MPPE,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_PPP_REQUIRE_MPPE,
|
||||
PROP_REQUIRE_MPPE,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_ppp_get_require_mppe);
|
||||
|
||||
/**
|
||||
* NMSettingPpp:require-mppe-128:
|
||||
|
|
@ -675,12 +687,13 @@ nm_setting_ppp_class_init(NMSettingPppClass *klass)
|
|||
* required for the PPP session, and the "require-mppe" property must also
|
||||
* be set to %TRUE. If 128-bit MPPE is not available the session will fail.
|
||||
**/
|
||||
obj_properties[PROP_REQUIRE_MPPE_128] =
|
||||
g_param_spec_boolean(NM_SETTING_PPP_REQUIRE_MPPE_128,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_PPP_REQUIRE_MPPE_128,
|
||||
PROP_REQUIRE_MPPE_128,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_ppp_get_require_mppe_128);
|
||||
|
||||
/**
|
||||
* NMSettingPpp:mppe-stateful:
|
||||
|
|
@ -688,12 +701,13 @@ nm_setting_ppp_class_init(NMSettingPppClass *klass)
|
|||
* If %TRUE, stateful MPPE is used. See pppd documentation for more
|
||||
* information on stateful MPPE.
|
||||
**/
|
||||
obj_properties[PROP_MPPE_STATEFUL] =
|
||||
g_param_spec_boolean(NM_SETTING_PPP_MPPE_STATEFUL,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_PPP_MPPE_STATEFUL,
|
||||
PROP_MPPE_STATEFUL,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_ppp_get_mppe_stateful);
|
||||
|
||||
/**
|
||||
* NMSettingPpp:crtscts:
|
||||
|
|
@ -702,11 +716,13 @@ nm_setting_ppp_class_init(NMSettingPppClass *klass)
|
|||
* flow control with RTS and CTS signals. This value should normally be set
|
||||
* to %FALSE.
|
||||
**/
|
||||
obj_properties[PROP_CRTSCTS] = g_param_spec_boolean(NM_SETTING_PPP_CRTSCTS,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_PPP_CRTSCTS,
|
||||
PROP_CRTSCTS,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_ppp_get_crtscts);
|
||||
|
||||
/**
|
||||
* NMSettingPpp:baud:
|
||||
|
|
@ -790,5 +806,8 @@ nm_setting_ppp_class_init(NMSettingPppClass *klass)
|
|||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_PPP);
|
||||
_nm_setting_class_commit_full(setting_class,
|
||||
NM_META_SETTING_TYPE_PPP,
|
||||
NULL,
|
||||
properties_override);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,6 +211,10 @@ gboolean _nm_setting_clear_secrets(NMSetting * setting,
|
|||
NMSettingClearSecretsWithFlagsFn func,
|
||||
gpointer user_data);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#define NM_SETTING_PARAM_NONE 0
|
||||
|
||||
/* The property of the #NMSetting should be considered during comparisons that
|
||||
* use the %NM_SETTING_COMPARE_FLAG_INFERRABLE flag. Properties that don't have
|
||||
* this flag, are ignored when doing an infrerrable comparison. This flag should
|
||||
|
|
@ -249,6 +253,9 @@ extern const NMSettInfoPropertType nm_sett_info_propert_type_deprecated_ignore_u
|
|||
extern const NMSettInfoPropertType nm_sett_info_propert_type_plain_i;
|
||||
extern const NMSettInfoPropertType nm_sett_info_propert_type_plain_u;
|
||||
|
||||
extern const NMSettInfoPropertType nm_sett_info_propert_type_boolean;
|
||||
extern const NMSettInfoPropertType nm_sett_info_propert_type_string;
|
||||
|
||||
NMSettingVerifyResult
|
||||
_nm_setting_verify(NMSetting *setting, NMConnection *connection, GError **error);
|
||||
|
||||
|
|
@ -261,6 +268,29 @@ gboolean _nm_setting_aggregate(NMSetting *setting, NMConnectionAggregateType typ
|
|||
|
||||
gboolean _nm_setting_slave_type_is_valid(const char *slave_type, const char **out_port_type);
|
||||
|
||||
GVariant *_nm_setting_property_to_dbus_fcn_gprop(const NMSettInfoSetting * sett_info,
|
||||
guint property_idx,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options);
|
||||
|
||||
GVariant *
|
||||
_nm_setting_property_to_dbus_fcn_get_boolean(const NMSettInfoSetting * sett_info,
|
||||
guint property_idx,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options);
|
||||
|
||||
GVariant *
|
||||
_nm_setting_property_to_dbus_fcn_get_string(const NMSettInfoSetting * sett_info,
|
||||
guint property_idx,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options);
|
||||
|
||||
GVariant *_nm_setting_to_dbus(NMSetting * setting,
|
||||
NMConnection * connection,
|
||||
NMConnectionSerializationFlags flags,
|
||||
|
|
@ -306,13 +336,30 @@ _nm_setting_class_commit(NMSettingClass *setting_class, NMMetaSettingType meta_t
|
|||
|
||||
#define NM_SETT_INFO_SETT_DETAIL(...) (&((const NMSettInfoSettDetail){__VA_ARGS__}))
|
||||
|
||||
#define NM_SETT_INFO_PROPERT_TYPE(...) \
|
||||
({ \
|
||||
static const NMSettInfoPropertType _g = {__VA_ARGS__}; \
|
||||
\
|
||||
&_g; \
|
||||
#define NM_SETT_INFO_PROPERT_TYPE_DBUS_INIT(_dbus_type, ...) \
|
||||
{ \
|
||||
.dbus_type = _dbus_type, __VA_ARGS__ \
|
||||
}
|
||||
|
||||
#define NM_SETT_INFO_PROPERT_TYPE_GPROP_INIT(_dbus_type, ...) \
|
||||
{ \
|
||||
.dbus_type = _dbus_type, .to_dbus_fcn = _nm_setting_property_to_dbus_fcn_gprop, \
|
||||
__VA_ARGS__ \
|
||||
}
|
||||
|
||||
#define NM_SETT_INFO_PROPERT_TYPE(init) \
|
||||
({ \
|
||||
static const NMSettInfoPropertType _g = init; \
|
||||
\
|
||||
&_g; \
|
||||
})
|
||||
|
||||
#define NM_SETT_INFO_PROPERT_TYPE_DBUS(_dbus_type, ...) \
|
||||
NM_SETT_INFO_PROPERT_TYPE(NM_SETT_INFO_PROPERT_TYPE_DBUS_INIT(_dbus_type, __VA_ARGS__))
|
||||
|
||||
#define NM_SETT_INFO_PROPERT_TYPE_GPROP(_dbus_type, ...) \
|
||||
NM_SETT_INFO_PROPERT_TYPE(NM_SETT_INFO_PROPERT_TYPE_GPROP_INIT(_dbus_type, __VA_ARGS__))
|
||||
|
||||
#define NM_SETT_INFO_PROPERTY(...) (&((const NMSettInfoProperty){__VA_ARGS__}))
|
||||
|
||||
gboolean _nm_properties_override_assert(const NMSettInfoProperty *prop_info);
|
||||
|
|
@ -325,10 +372,12 @@ _nm_properties_override(GArray *properties_override, const NMSettInfoProperty *p
|
|||
g_array_append_vals(properties_override, prop_info, 1);
|
||||
}
|
||||
|
||||
#define _nm_properties_override_gobj(properties_override, p_param_spec, p_property_type) \
|
||||
_nm_properties_override( \
|
||||
(properties_override), \
|
||||
NM_SETT_INFO_PROPERTY(.param_spec = (p_param_spec), .property_type = (p_property_type), ))
|
||||
#define _nm_properties_override_gobj(properties_override, p_param_spec, p_property_type, ...) \
|
||||
_nm_properties_override((properties_override), \
|
||||
NM_SETT_INFO_PROPERTY(.name = NULL, \
|
||||
.param_spec = (p_param_spec), \
|
||||
.property_type = (p_property_type), \
|
||||
__VA_ARGS__))
|
||||
|
||||
#define _nm_properties_override_dbus(properties_override, p_name, p_property_type) \
|
||||
_nm_properties_override( \
|
||||
|
|
@ -337,6 +386,125 @@ _nm_properties_override(GArray *properties_override, const NMSettInfoProperty *p
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
#define _nm_setting_property_define_boolean_full(properties_override, \
|
||||
obj_properties, \
|
||||
prop_name, \
|
||||
prop_id, \
|
||||
default_value, \
|
||||
param_flags, \
|
||||
property_type, \
|
||||
get_fcn, \
|
||||
...) \
|
||||
G_STMT_START \
|
||||
{ \
|
||||
const gboolean _default_value = (default_value); \
|
||||
GParamSpec * _param_spec; \
|
||||
const NMSettInfoPropertType *const _property_type = (property_type); \
|
||||
\
|
||||
G_STATIC_ASSERT( \
|
||||
!NM_FLAGS_ANY((param_flags), \
|
||||
~(NM_SETTING_PARAM_FUZZY_IGNORE | NM_SETTING_PARAM_INFERRABLE \
|
||||
| NM_SETTING_PARAM_REAPPLY_IMMEDIATELY))); \
|
||||
\
|
||||
nm_assert(_property_type); \
|
||||
nm_assert(_property_type->to_dbus_fcn == _nm_setting_property_to_dbus_fcn_get_boolean); \
|
||||
\
|
||||
nm_assert(NM_IN_SET(_default_value, 0, 1)); \
|
||||
\
|
||||
_param_spec = \
|
||||
g_param_spec_boolean("" prop_name "", \
|
||||
"", \
|
||||
"", \
|
||||
_default_value, \
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | (param_flags)); \
|
||||
\
|
||||
(obj_properties)[(prop_id)] = _param_spec; \
|
||||
\
|
||||
_nm_properties_override_gobj((properties_override), \
|
||||
_param_spec, \
|
||||
_property_type, \
|
||||
.to_dbus_data.get_boolean = \
|
||||
(gboolean(*)(NMSetting *)) (get_fcn), \
|
||||
__VA_ARGS__); \
|
||||
} \
|
||||
G_STMT_END
|
||||
|
||||
#define _nm_setting_property_define_boolean(properties_override, \
|
||||
obj_properties, \
|
||||
prop_name, \
|
||||
prop_id, \
|
||||
default_value, \
|
||||
param_flags, \
|
||||
get_fcn, \
|
||||
...) \
|
||||
_nm_setting_property_define_boolean_full((properties_override), \
|
||||
(obj_properties), \
|
||||
prop_name, \
|
||||
(prop_id), \
|
||||
(default_value), \
|
||||
(param_flags), \
|
||||
&nm_sett_info_propert_type_boolean, \
|
||||
(get_fcn), \
|
||||
__VA_ARGS__)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#define _nm_setting_property_define_string_full(properties_override, \
|
||||
obj_properties, \
|
||||
prop_name, \
|
||||
prop_id, \
|
||||
param_flags, \
|
||||
property_type, \
|
||||
get_fcn, \
|
||||
...) \
|
||||
G_STMT_START \
|
||||
{ \
|
||||
GParamSpec * _param_spec; \
|
||||
const NMSettInfoPropertType *const _property_type = (property_type); \
|
||||
\
|
||||
G_STATIC_ASSERT(!NM_FLAGS_ANY((param_flags), \
|
||||
~(NM_SETTING_PARAM_SECRET | NM_SETTING_PARAM_FUZZY_IGNORE \
|
||||
| NM_SETTING_PARAM_INFERRABLE \
|
||||
| NM_SETTING_PARAM_REAPPLY_IMMEDIATELY))); \
|
||||
nm_assert(_property_type); \
|
||||
nm_assert(_property_type->to_dbus_fcn == _nm_setting_property_to_dbus_fcn_get_string); \
|
||||
\
|
||||
_param_spec = \
|
||||
g_param_spec_string("" prop_name "", \
|
||||
"", \
|
||||
"", \
|
||||
NULL, \
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | (param_flags)); \
|
||||
\
|
||||
(obj_properties)[(prop_id)] = _param_spec; \
|
||||
\
|
||||
_nm_properties_override_gobj((properties_override), \
|
||||
_param_spec, \
|
||||
_property_type, \
|
||||
.to_dbus_data.get_string = \
|
||||
(const char *(*) (NMSetting *) ) (get_fcn), \
|
||||
__VA_ARGS__); \
|
||||
} \
|
||||
G_STMT_END
|
||||
|
||||
#define _nm_setting_property_define_string(properties_override, \
|
||||
obj_properties, \
|
||||
prop_name, \
|
||||
prop_id, \
|
||||
param_flags, \
|
||||
get_fcn, \
|
||||
...) \
|
||||
_nm_setting_property_define_string_full((properties_override), \
|
||||
(obj_properties), \
|
||||
prop_name, \
|
||||
(prop_id), \
|
||||
(param_flags), \
|
||||
&nm_sett_info_propert_type_string, \
|
||||
(get_fcn), \
|
||||
__VA_ARGS__)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
gboolean _nm_setting_use_legacy_property(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char *legacy_property,
|
||||
|
|
|
|||
|
|
@ -295,8 +295,9 @@ finalize(GObject *object)
|
|||
static void
|
||||
nm_setting_proxy_class_init(NMSettingProxyClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GArray * properties_override = _nm_sett_info_property_override_create_array();
|
||||
|
||||
g_type_class_add_private(klass, sizeof(NMSettingProxyPrivate));
|
||||
|
||||
|
|
@ -344,12 +345,13 @@ nm_setting_proxy_class_init(NMSettingProxyClass *klass)
|
|||
* description: Whether the proxy configuration is for browser only.
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_BROWSER_ONLY] =
|
||||
g_param_spec_boolean(NM_SETTING_PROXY_BROWSER_ONLY,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_PROXY_BROWSER_ONLY,
|
||||
PROP_BROWSER_ONLY,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_proxy_get_browser_only);
|
||||
|
||||
/**
|
||||
* NMSettingProxy:pac-url:
|
||||
|
|
@ -394,5 +396,8 @@ nm_setting_proxy_class_init(NMSettingProxyClass *klass)
|
|||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_PROXY);
|
||||
_nm_setting_class_commit_full(setting_class,
|
||||
NM_META_SETTING_TYPE_PROXY,
|
||||
NULL,
|
||||
properties_override);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -311,9 +311,9 @@ nm_setting_serial_class_init(NMSettingSerialClass *klass)
|
|||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[PROP_PARITY],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_BYTE,
|
||||
.gprop_to_dbus_fcn = parity_to_dbus,
|
||||
.gprop_from_dbus_fcn = parity_from_dbus, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_GPROP(G_VARIANT_TYPE_BYTE,
|
||||
.gprop_from_dbus_fcn = parity_from_dbus, ),
|
||||
.to_dbus_data.gprop_to_dbus_fcn = parity_to_dbus, );
|
||||
|
||||
/**
|
||||
* NMSettingSerial:stopbits:
|
||||
|
|
|
|||
|
|
@ -1325,9 +1325,9 @@ nm_setting_sriov_class_init(NMSettingSriovClass *klass)
|
|||
| G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[PROP_VFS],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = vfs_to_dbus,
|
||||
.from_dbus_fcn = vfs_from_dbus, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = vfs_to_dbus,
|
||||
.from_dbus_fcn = vfs_from_dbus, ));
|
||||
|
||||
/**
|
||||
* NMSettingSriov:autoprobe-drivers
|
||||
|
|
|
|||
|
|
@ -1838,9 +1838,9 @@ nm_setting_tc_config_class_init(NMSettingTCConfigClass *klass)
|
|||
| G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[PROP_QDISCS],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = tc_qdiscs_get,
|
||||
.from_dbus_fcn = tc_qdiscs_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = tc_qdiscs_get,
|
||||
.from_dbus_fcn = tc_qdiscs_set, ));
|
||||
|
||||
/**
|
||||
* NMSettingTCConfig:tfilters: (type GPtrArray(NMTCTfilter))
|
||||
|
|
@ -1870,11 +1870,12 @@ nm_setting_tc_config_class_init(NMSettingTCConfigClass *klass)
|
|||
"",
|
||||
G_TYPE_PTR_ARRAY,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[PROP_TFILTERS],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = tc_tfilters_get,
|
||||
.from_dbus_fcn = tc_tfilters_set, ));
|
||||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[PROP_TFILTERS],
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = tc_tfilters_get,
|
||||
.from_dbus_fcn = tc_tfilters_set, ));
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
|
|
|
|||
|
|
@ -300,8 +300,9 @@ finalize(GObject *object)
|
|||
static void
|
||||
nm_setting_tun_class_init(NMSettingTunClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GArray * properties_override = _nm_sett_info_property_override_create_array();
|
||||
|
||||
g_type_class_add_private(klass, sizeof(NMSettingTunPrivate));
|
||||
|
||||
|
|
@ -368,12 +369,13 @@ nm_setting_tun_class_init(NMSettingTunClass *klass)
|
|||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
obj_properties[PROP_PI] = g_param_spec_boolean(NM_SETTING_TUN_PI,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE
|
||||
| G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_TUN_PI,
|
||||
PROP_PI,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_tun_get_pi);
|
||||
|
||||
/**
|
||||
* NMSettingTun:vnet-hdr:
|
||||
|
|
@ -383,12 +385,13 @@ nm_setting_tun_class_init(NMSettingTunClass *klass)
|
|||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
obj_properties[PROP_VNET_HDR] = g_param_spec_boolean(
|
||||
NM_SETTING_TUN_VNET_HDR,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_TUN_VNET_HDR,
|
||||
PROP_VNET_HDR,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_tun_get_vnet_hdr);
|
||||
|
||||
/**
|
||||
* NMSettingTun:multi-queue:
|
||||
|
|
@ -400,14 +403,18 @@ nm_setting_tun_class_init(NMSettingTunClass *klass)
|
|||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
obj_properties[PROP_MULTI_QUEUE] = g_param_spec_boolean(
|
||||
NM_SETTING_TUN_MULTI_QUEUE,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_TUN_MULTI_QUEUE,
|
||||
PROP_MULTI_QUEUE,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_tun_get_multi_queue);
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_TUN);
|
||||
_nm_setting_class_commit_full(setting_class,
|
||||
NM_META_SETTING_TYPE_TUN,
|
||||
NULL,
|
||||
properties_override);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -926,9 +926,9 @@ nm_setting_vlan_class_init(NMSettingVlanClass *klass)
|
|||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[PROP_FLAGS],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_UINT32,
|
||||
.to_dbus_fcn = _override_flags_get,
|
||||
.missing_from_dbus_fcn = _override_flags_not_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(G_VARIANT_TYPE_UINT32,
|
||||
.to_dbus_fcn = _override_flags_get,
|
||||
.missing_from_dbus_fcn = _override_flags_not_set, ));
|
||||
|
||||
/**
|
||||
* NMSettingVlan:ingress-priority-map:
|
||||
|
|
|
|||
|
|
@ -1172,12 +1172,13 @@ nm_setting_vpn_class_init(NMSettingVpnClass *klass)
|
|||
* the VPN will attempt to stay connected across link changes and outages,
|
||||
* until explicitly disconnected.
|
||||
**/
|
||||
obj_properties[PROP_PERSISTENT] =
|
||||
g_param_spec_boolean(NM_SETTING_VPN_PERSISTENT,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_VPN_PERSISTENT,
|
||||
PROP_PERSISTENT,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_vpn_get_persistent);
|
||||
|
||||
/**
|
||||
* NMSettingVpn:data: (type GHashTable(utf8,utf8)):
|
||||
|
|
@ -1226,9 +1227,9 @@ nm_setting_vpn_class_init(NMSettingVpnClass *klass)
|
|||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[PROP_SECRETS],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("a{ss}"),
|
||||
.to_dbus_fcn = vpn_secrets_to_dbus,
|
||||
.from_dbus_fcn = vpn_secrets_from_dbus, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("a{ss}"),
|
||||
.to_dbus_fcn = vpn_secrets_to_dbus,
|
||||
.from_dbus_fcn = vpn_secrets_from_dbus, ));
|
||||
|
||||
/**
|
||||
* NMSettingVpn:timeout:
|
||||
|
|
|
|||
|
|
@ -570,8 +570,9 @@ finalize(GObject *object)
|
|||
static void
|
||||
nm_setting_vxlan_class_init(NMSettingVxlanClass *klass)
|
||||
{
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
||||
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
||||
GArray * properties_override = _nm_sett_info_property_override_create_array();
|
||||
|
||||
g_type_class_add_private(klass, sizeof(NMSettingVxlanPrivate));
|
||||
|
||||
|
|
@ -764,12 +765,13 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass)
|
|||
*
|
||||
* Since: 1.2
|
||||
**/
|
||||
obj_properties[PROP_PROXY] = g_param_spec_boolean(
|
||||
NM_SETTING_VXLAN_PROXY,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_VXLAN_PROXY,
|
||||
PROP_PROXY,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_vxlan_get_proxy);
|
||||
|
||||
/**
|
||||
* NMSettingVxlan:learning:
|
||||
|
|
@ -779,12 +781,14 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass)
|
|||
*
|
||||
* Since: 1.2
|
||||
**/
|
||||
obj_properties[PROP_LEARNING] = g_param_spec_boolean(
|
||||
NM_SETTING_VXLAN_LEARNING,
|
||||
"",
|
||||
"",
|
||||
TRUE,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_VXLAN_LEARNING,
|
||||
PROP_LEARNING,
|
||||
TRUE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_vxlan_get_learning);
|
||||
|
||||
/**
|
||||
* NMSettingVxlan:rsc:
|
||||
*
|
||||
|
|
@ -792,12 +796,14 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass)
|
|||
*
|
||||
* Since: 1.2
|
||||
**/
|
||||
obj_properties[PROP_RSC] = g_param_spec_boolean(NM_SETTING_VXLAN_RSC,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE
|
||||
| G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_VXLAN_RSC,
|
||||
PROP_RSC,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_vxlan_get_rsc);
|
||||
|
||||
/**
|
||||
* NMSettingVxlan:l2-miss:
|
||||
*
|
||||
|
|
@ -805,12 +811,13 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass)
|
|||
*
|
||||
* Since: 1.2
|
||||
**/
|
||||
obj_properties[PROP_L2_MISS] = g_param_spec_boolean(
|
||||
NM_SETTING_VXLAN_L2_MISS,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_VXLAN_L2_MISS,
|
||||
PROP_L2_MISS,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_vxlan_get_l2_miss);
|
||||
|
||||
/**
|
||||
* NMSettingVxlan:l3-miss:
|
||||
|
|
@ -819,14 +826,18 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass)
|
|||
*
|
||||
* Since: 1.2
|
||||
**/
|
||||
obj_properties[PROP_L3_MISS] = g_param_spec_boolean(
|
||||
NM_SETTING_VXLAN_L3_MISS,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_VXLAN_L3_MISS,
|
||||
PROP_L3_MISS,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_vxlan_get_l3_miss);
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_VXLAN);
|
||||
_nm_setting_class_commit_full(setting_class,
|
||||
NM_META_SETTING_TYPE_VXLAN,
|
||||
NULL,
|
||||
properties_override);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -995,17 +995,6 @@ compare_property(const NMSettInfoSetting *sett_info,
|
|||
->compare_property(sett_info, property_idx, con_a, set_a, con_b, set_b, flags);
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
_override_autoneg_get(const NMSettInfoSetting * sett_info,
|
||||
guint property_idx,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
{
|
||||
return g_variant_new_boolean(nm_setting_wired_get_auto_negotiate((NMSettingWired *) setting));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
|
|
@ -1302,11 +1291,12 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass)
|
|||
* description: The property is not saved by the plugin.
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_PORT] = g_param_spec_string(NM_SETTING_WIRED_PORT,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_WIRED_PORT,
|
||||
PROP_PORT,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_wired_get_port);
|
||||
|
||||
/**
|
||||
* NMSettingWired:speed:
|
||||
|
|
@ -1363,11 +1353,12 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass)
|
|||
* "duplex" parameter in the ETHOOL_OPTS variable.
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_DUPLEX] = g_param_spec_string(NM_SETTING_WIRED_DUPLEX,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_WIRED_DUPLEX,
|
||||
PROP_DUPLEX,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_wired_get_duplex);
|
||||
|
||||
/**
|
||||
* NMSettingWired:auto-negotiate:
|
||||
|
|
@ -1389,16 +1380,14 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass)
|
|||
* "speed" and "duplex" parameters (skips link configuration).
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_AUTO_NEGOTIATE] =
|
||||
g_param_spec_boolean(NM_SETTING_WIRED_AUTO_NEGOTIATE,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[PROP_AUTO_NEGOTIATE],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_BOOLEAN,
|
||||
.to_dbus_fcn = _override_autoneg_get, ));
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_WIRED_AUTO_NEGOTIATE,
|
||||
PROP_AUTO_NEGOTIATE,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_wired_get_auto_negotiate,
|
||||
.to_dbus_data.including_default = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWired:mac-address:
|
||||
|
|
@ -1542,12 +1531,12 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass)
|
|||
* cloned-mac-address.
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_GENERATE_MAC_ADDRESS_MASK] = g_param_spec_string(
|
||||
NM_SETTING_WIRED_GENERATE_MAC_ADDRESS_MASK,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_FUZZY_IGNORE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_WIRED_GENERATE_MAC_ADDRESS_MASK,
|
||||
PROP_GENERATE_MAC_ADDRESS_MASK,
|
||||
NM_SETTING_PARAM_FUZZY_IGNORE,
|
||||
nm_setting_wired_get_generate_mac_address_mask);
|
||||
|
||||
/**
|
||||
* NMSettingWired:mac-address-blacklist:
|
||||
|
|
@ -1638,12 +1627,12 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass)
|
|||
* example: NETTYPE=qeth
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_S390_NETTYPE] = g_param_spec_string(
|
||||
NM_SETTING_WIRED_S390_NETTYPE,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_WIRED_S390_NETTYPE,
|
||||
PROP_S390_NETTYPE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_wired_get_s390_nettype);
|
||||
|
||||
/**
|
||||
* NMSettingWired:s390-options: (type GHashTable(utf8,utf8)):
|
||||
|
|
@ -1719,12 +1708,13 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass)
|
|||
* example: ETHTOOL_OPTS="wol gs sopass 00:11:22:33:44:55"
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_WAKE_ON_LAN_PASSWORD] =
|
||||
g_param_spec_string(NM_SETTING_WIRED_WAKE_ON_LAN_PASSWORD,
|
||||
"",
|
||||
"",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_string(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_WIRED_WAKE_ON_LAN_PASSWORD,
|
||||
PROP_WAKE_ON_LAN_PASSWORD,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_wired_get_wake_on_lan_password);
|
||||
|
||||
/**
|
||||
* NMSettingWired:accept-all-mac-addresses:
|
||||
*
|
||||
|
|
|
|||
|
|
@ -2514,12 +2514,13 @@ nm_setting_wireguard_class_init(NMSettingWireGuardClass *klass)
|
|||
*
|
||||
* Since: 1.16
|
||||
**/
|
||||
obj_properties[PROP_PEER_ROUTES] = g_param_spec_boolean(
|
||||
NM_SETTING_WIREGUARD_PEER_ROUTES,
|
||||
"",
|
||||
"",
|
||||
TRUE,
|
||||
G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_WIREGUARD_PEER_ROUTES,
|
||||
PROP_PEER_ROUTES,
|
||||
TRUE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
nm_setting_wireguard_get_peer_routes);
|
||||
|
||||
/**
|
||||
* NMSettingWireGuard:mtu:
|
||||
|
|
@ -2594,9 +2595,9 @@ nm_setting_wireguard_class_init(NMSettingWireGuardClass *klass)
|
|||
_nm_properties_override_dbus(
|
||||
properties_override,
|
||||
NM_SETTING_WIREGUARD_PEERS,
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = _peers_dbus_only_synth,
|
||||
.from_dbus_fcn = _peers_dbus_only_set, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = _peers_dbus_only_synth,
|
||||
.from_dbus_fcn = _peers_dbus_only_set, ));
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
|
|
|
|||
|
|
@ -1924,11 +1924,10 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||
NM_TYPE_WEP_KEY_TYPE,
|
||||
NM_WEP_KEY_TYPE_UNKNOWN,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[PROP_WEP_KEY_TYPE],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_UINT32,
|
||||
.gprop_to_dbus_fcn = wep_key_type_to_dbus, ));
|
||||
_nm_properties_override_gobj(properties_override,
|
||||
obj_properties[PROP_WEP_KEY_TYPE],
|
||||
&nm_sett_info_propert_type_plain_u,
|
||||
.to_dbus_data.gprop_to_dbus_fcn = wep_key_type_to_dbus, );
|
||||
|
||||
/**
|
||||
* NMSettingWirelessSecurity:wps-method:
|
||||
|
|
|
|||
|
|
@ -1743,8 +1743,8 @@ nm_setting_wireless_class_init(NMSettingWirelessClass *klass)
|
|||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[PROP_SEEN_BSSIDS],
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_STRING_ARRAY,
|
||||
.to_dbus_fcn = _to_dbus_fcn_seen_bssids, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(G_VARIANT_TYPE_STRING_ARRAY,
|
||||
.to_dbus_fcn = _to_dbus_fcn_seen_bssids, ));
|
||||
|
||||
/**
|
||||
* NMSettingWireless:mtu:
|
||||
|
|
@ -1791,11 +1791,13 @@ nm_setting_wireless_class_init(NMSettingWirelessClass *klass)
|
|||
* description: Whether the network hides the SSID.
|
||||
* ---end---
|
||||
*/
|
||||
obj_properties[PROP_HIDDEN] = g_param_spec_boolean(NM_SETTING_WIRELESS_HIDDEN,
|
||||
"",
|
||||
"",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
_nm_setting_property_define_boolean(properties_override,
|
||||
obj_properties,
|
||||
NM_SETTING_WIRELESS_HIDDEN,
|
||||
PROP_HIDDEN,
|
||||
FALSE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
nm_setting_wireless_get_hidden);
|
||||
|
||||
/**
|
||||
* NMSettingWireless:powersave:
|
||||
|
|
@ -1871,8 +1873,8 @@ nm_setting_wireless_class_init(NMSettingWirelessClass *klass)
|
|||
_nm_properties_override_dbus(
|
||||
properties_override,
|
||||
"security",
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_STRING,
|
||||
.to_dbus_fcn = nm_setting_wireless_get_security, ));
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS(G_VARIANT_TYPE_STRING,
|
||||
.to_dbus_fcn = nm_setting_wireless_get_security, ));
|
||||
|
||||
/**
|
||||
* NMSettingWireless:wake-on-wlan:
|
||||
|
|
|
|||
|
|
@ -156,55 +156,30 @@ _nm_sett_info_property_find_in_array(const NMSettInfoProperty *properties,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
_gprop_to_dbus_fcn_bytes(const GValue *val)
|
||||
{
|
||||
nm_assert(G_VALUE_HOLDS(val, G_TYPE_BYTES));
|
||||
return nm_utils_gbytes_to_variant_ay(g_value_get_boxed(val));
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
_gprop_to_dbus_fcn_enum(const GValue *val)
|
||||
{
|
||||
return g_variant_new_int32(g_value_get_enum(val));
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
_gprop_to_dbus_fcn_flags(const GValue *val)
|
||||
{
|
||||
return g_variant_new_uint32(g_value_get_flags(val));
|
||||
}
|
||||
|
||||
gboolean
|
||||
_nm_properties_override_assert(const NMSettInfoProperty *prop_info)
|
||||
{
|
||||
#if NM_MORE_ASSERTS
|
||||
nm_assert(prop_info);
|
||||
nm_assert((!!prop_info->name) != (!!prop_info->param_spec));
|
||||
nm_assert(!prop_info->param_spec || !prop_info->name
|
||||
|| nm_streq0(prop_info->name, prop_info->param_spec->name));
|
||||
|
||||
#define _PROPERT_EXTRA(prop_info, member) \
|
||||
({ \
|
||||
const NMSettInfoProperty *_prop_info = (prop_info); \
|
||||
\
|
||||
(_prop_info->property_type ? _prop_info->property_type->member : 0); \
|
||||
})
|
||||
if (prop_info->property_type) {
|
||||
const NMSettInfoPropertType *property_type = prop_info->property_type;
|
||||
|
||||
nm_assert(!_PROPERT_EXTRA(prop_info, gprop_from_dbus_fcn)
|
||||
|| _PROPERT_EXTRA(prop_info, dbus_type));
|
||||
nm_assert(!_PROPERT_EXTRA(prop_info, from_dbus_fcn) || _PROPERT_EXTRA(prop_info, dbus_type));
|
||||
nm_assert(!_PROPERT_EXTRA(prop_info, to_dbus_fcn) || _PROPERT_EXTRA(prop_info, dbus_type));
|
||||
/* we always require a dbus_type. */
|
||||
nm_assert(property_type->dbus_type);
|
||||
|
||||
nm_assert(!_PROPERT_EXTRA(prop_info, to_dbus_fcn)
|
||||
|| !_PROPERT_EXTRA(prop_info, gprop_to_dbus_fcn));
|
||||
nm_assert(!_PROPERT_EXTRA(prop_info, from_dbus_fcn)
|
||||
|| !_PROPERT_EXTRA(prop_info, gprop_from_dbus_fcn));
|
||||
|
||||
nm_assert(!_PROPERT_EXTRA(prop_info, gprop_to_dbus_fcn) || prop_info->param_spec);
|
||||
nm_assert(!_PROPERT_EXTRA(prop_info, gprop_from_dbus_fcn) || prop_info->param_spec);
|
||||
|
||||
#undef _PROPERT_EXTRA
|
||||
/* from_dbus_fcn and gprop_from_dbus_fcn cannot both be set. */
|
||||
nm_assert(!property_type->from_dbus_fcn || !property_type->gprop_from_dbus_fcn);
|
||||
|
||||
if (!prop_info->param_spec) {
|
||||
/* if we don't have a param_spec, we cannot have gprop_from_dbus_fcn. */
|
||||
nm_assert(property_type->from_dbus_fcn || !property_type->gprop_from_dbus_fcn);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -379,35 +354,35 @@ _nm_setting_class_commit_full(NMSettingClass * setting_class,
|
|||
|
||||
vtype = p->param_spec->value_type;
|
||||
if (vtype == G_TYPE_BOOLEAN)
|
||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_BOOLEAN);
|
||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE_GPROP(G_VARIANT_TYPE_BOOLEAN);
|
||||
else if (vtype == G_TYPE_UCHAR)
|
||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_BYTE);
|
||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE_GPROP(G_VARIANT_TYPE_BYTE);
|
||||
else if (vtype == G_TYPE_INT)
|
||||
p->property_type = &nm_sett_info_propert_type_plain_i;
|
||||
else if (vtype == G_TYPE_UINT)
|
||||
p->property_type = &nm_sett_info_propert_type_plain_u;
|
||||
else if (vtype == G_TYPE_INT64)
|
||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_INT64);
|
||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE_GPROP(G_VARIANT_TYPE_INT64);
|
||||
else if (vtype == G_TYPE_UINT64)
|
||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_UINT64);
|
||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE_GPROP(G_VARIANT_TYPE_UINT64);
|
||||
else if (vtype == G_TYPE_STRING)
|
||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_STRING);
|
||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE_GPROP(G_VARIANT_TYPE_STRING);
|
||||
else if (vtype == G_TYPE_DOUBLE)
|
||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_DOUBLE);
|
||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE_GPROP(G_VARIANT_TYPE_DOUBLE);
|
||||
else if (vtype == G_TYPE_STRV)
|
||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_STRING_ARRAY);
|
||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE_GPROP(G_VARIANT_TYPE_STRING_ARRAY);
|
||||
else if (vtype == G_TYPE_BYTES) {
|
||||
p->property_type =
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_BYTESTRING,
|
||||
.gprop_to_dbus_fcn = _gprop_to_dbus_fcn_bytes);
|
||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE_GPROP(
|
||||
G_VARIANT_TYPE_BYTESTRING,
|
||||
.typdata_to_dbus.gprop_type = NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_BYTES);
|
||||
} else if (g_type_is_a(vtype, G_TYPE_ENUM)) {
|
||||
p->property_type =
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_INT32,
|
||||
.gprop_to_dbus_fcn = _gprop_to_dbus_fcn_enum);
|
||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE_GPROP(
|
||||
G_VARIANT_TYPE_INT32,
|
||||
.typdata_to_dbus.gprop_type = NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_ENUM);
|
||||
} else if (g_type_is_a(vtype, G_TYPE_FLAGS)) {
|
||||
p->property_type =
|
||||
NM_SETT_INFO_PROPERT_TYPE(.dbus_type = G_VARIANT_TYPE_UINT32,
|
||||
.gprop_to_dbus_fcn = _gprop_to_dbus_fcn_flags);
|
||||
p->property_type = NM_SETT_INFO_PROPERT_TYPE_GPROP(
|
||||
G_VARIANT_TYPE_UINT32,
|
||||
.typdata_to_dbus.gprop_type = NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_FLAGS);
|
||||
} else
|
||||
nm_assert_not_reached();
|
||||
|
||||
|
|
@ -553,6 +528,108 @@ _nm_setting_use_legacy_property(NMSetting * setting,
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
GVariant *
|
||||
_nm_setting_property_to_dbus_fcn_get_boolean(const NMSettInfoSetting * sett_info,
|
||||
guint property_idx,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
{
|
||||
const NMSettInfoProperty *property_info = &sett_info->property_infos[property_idx];
|
||||
gboolean val;
|
||||
|
||||
val = !!property_info->to_dbus_data.get_boolean(setting);
|
||||
if (!property_info->to_dbus_data.including_default
|
||||
&& val == NM_G_PARAM_SPEC_GET_DEFAULT_BOOLEAN(property_info->param_spec))
|
||||
return NULL;
|
||||
return g_variant_ref(nm_g_variant_singleton_b(val));
|
||||
}
|
||||
|
||||
GVariant *
|
||||
_nm_setting_property_to_dbus_fcn_get_string(const NMSettInfoSetting * sett_info,
|
||||
guint property_idx,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
{
|
||||
const NMSettInfoProperty *property_info = &sett_info->property_infos[property_idx];
|
||||
const char * val;
|
||||
|
||||
/* For string properties that are implemented via this function, the default is always NULL.
|
||||
* In general, having strings default to NULL is most advisable.
|
||||
*
|
||||
* Setting "including_default" for a string makes no sense because a
|
||||
* GVariant of type "s" cannot express NULL. */
|
||||
nm_assert(!NM_G_PARAM_SPEC_GET_DEFAULT_STRING(property_info->param_spec));
|
||||
nm_assert(!property_info->to_dbus_data.including_default);
|
||||
|
||||
val = property_info->to_dbus_data.get_string(setting);
|
||||
if (!val)
|
||||
return NULL;
|
||||
if (!val[0])
|
||||
return g_variant_ref(nm_g_variant_singleton_s_empty());
|
||||
return g_variant_new_string(val);
|
||||
}
|
||||
|
||||
GVariant *
|
||||
_nm_setting_property_to_dbus_fcn_gprop(const NMSettInfoSetting * sett_info,
|
||||
guint property_idx,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
{
|
||||
const NMSettInfoProperty *const property = &sett_info->property_infos[property_idx];
|
||||
nm_auto_unset_gvalue GValue prop_value = {
|
||||
0,
|
||||
};
|
||||
GArray *tmp_array;
|
||||
|
||||
nm_assert(property->param_spec);
|
||||
nm_assert(property->property_type->to_dbus_fcn == _nm_setting_property_to_dbus_fcn_gprop);
|
||||
nm_assert(property->property_type->typdata_to_dbus.gprop_type
|
||||
== NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_DEFAULT
|
||||
|| !property->to_dbus_data.gprop_to_dbus_fcn);
|
||||
|
||||
g_value_init(&prop_value, property->param_spec->value_type);
|
||||
|
||||
g_object_get_property(G_OBJECT(setting), property->param_spec->name, &prop_value);
|
||||
|
||||
if (!property->to_dbus_data.including_default
|
||||
&& g_param_value_defaults(property->param_spec, &prop_value))
|
||||
return NULL;
|
||||
|
||||
switch (property->property_type->typdata_to_dbus.gprop_type) {
|
||||
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_DEFAULT:
|
||||
if (property->to_dbus_data.gprop_to_dbus_fcn)
|
||||
return property->to_dbus_data.gprop_to_dbus_fcn(&prop_value);
|
||||
|
||||
return g_dbus_gvalue_to_gvariant(&prop_value, property->property_type->dbus_type);
|
||||
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_BYTES:
|
||||
nm_assert(G_VALUE_HOLDS(&prop_value, G_TYPE_BYTES));
|
||||
return nm_utils_gbytes_to_variant_ay(g_value_get_boxed(&prop_value));
|
||||
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_ENUM:
|
||||
return g_variant_new_int32(g_value_get_enum(&prop_value));
|
||||
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_FLAGS:
|
||||
return g_variant_new_uint32(g_value_get_flags(&prop_value));
|
||||
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_GARRAY_UINT:
|
||||
G_STATIC_ASSERT_EXPR(sizeof(guint) == sizeof(guint32));
|
||||
nm_assert(G_VALUE_HOLDS(&prop_value, G_TYPE_ARRAY));
|
||||
tmp_array = g_value_get_boxed(&prop_value);
|
||||
nm_assert(tmp_array);
|
||||
return nm_g_variant_new_au((const guint32 *) tmp_array->data, tmp_array->len);
|
||||
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_STRDICT:
|
||||
nm_assert(G_VALUE_HOLDS(&prop_value, G_TYPE_HASH_TABLE));
|
||||
return nm_utils_strdict_to_variant_ass(g_value_get_boxed(&prop_value));
|
||||
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_MAC_ADDRESS:
|
||||
return nm_utils_hwaddr_to_dbus(g_value_get_string(&prop_value));
|
||||
}
|
||||
|
||||
return nm_assert_unreachable_val(NULL);
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
property_to_dbus(const NMSettInfoSetting * sett_info,
|
||||
guint property_idx,
|
||||
|
|
@ -560,20 +637,22 @@ property_to_dbus(const NMSettInfoSetting * sett_info,
|
|||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options,
|
||||
gboolean ignore_flags,
|
||||
gboolean ignore_default)
|
||||
gboolean ignore_flags)
|
||||
{
|
||||
const NMSettInfoProperty *property = &sett_info->property_infos[property_idx];
|
||||
GVariant * variant;
|
||||
|
||||
nm_assert(property->property_type->dbus_type);
|
||||
|
||||
if (!property->param_spec) {
|
||||
if (!property->property_type->to_dbus_fcn)
|
||||
return NULL;
|
||||
} else if (!ignore_flags
|
||||
&& !NM_FLAGS_HAS(property->param_spec->flags,
|
||||
NM_SETTING_PARAM_TO_DBUS_IGNORE_FLAGS)) {
|
||||
if (!property->property_type->to_dbus_fcn) {
|
||||
nm_assert(!property->param_spec);
|
||||
nm_assert(!property->to_dbus_data.none);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (property->param_spec
|
||||
&& (!ignore_flags
|
||||
&& !NM_FLAGS_HAS(property->param_spec->flags, NM_SETTING_PARAM_TO_DBUS_IGNORE_FLAGS))) {
|
||||
if (!NM_FLAGS_HAS(property->param_spec->flags, G_PARAM_WRITABLE))
|
||||
return NULL;
|
||||
|
||||
|
|
@ -600,32 +679,10 @@ property_to_dbus(const NMSettInfoSetting * sett_info,
|
|||
}
|
||||
}
|
||||
|
||||
if (property->property_type->to_dbus_fcn) {
|
||||
variant = property->property_type
|
||||
->to_dbus_fcn(sett_info, property_idx, connection, setting, flags, options);
|
||||
nm_g_variant_take_ref(variant);
|
||||
} else {
|
||||
nm_auto_unset_gvalue GValue prop_value = {
|
||||
0,
|
||||
};
|
||||
variant = property->property_type
|
||||
->to_dbus_fcn(sett_info, property_idx, connection, setting, flags, options);
|
||||
nm_g_variant_take_ref(variant);
|
||||
|
||||
nm_assert(property->param_spec);
|
||||
|
||||
g_value_init(&prop_value, property->param_spec->value_type);
|
||||
|
||||
g_object_get_property(G_OBJECT(setting), property->param_spec->name, &prop_value);
|
||||
|
||||
if (ignore_default && g_param_value_defaults(property->param_spec, &prop_value))
|
||||
return NULL;
|
||||
|
||||
if (property->property_type->gprop_to_dbus_fcn) {
|
||||
variant = property->property_type->gprop_to_dbus_fcn(&prop_value);
|
||||
nm_g_variant_take_ref(variant);
|
||||
} else
|
||||
variant = g_dbus_gvalue_to_gvariant(&prop_value, property->property_type->dbus_type);
|
||||
}
|
||||
|
||||
nm_assert(!variant || !g_variant_is_floating(variant));
|
||||
nm_assert(!variant || g_variant_is_of_type(variant, property->property_type->dbus_type));
|
||||
|
||||
return variant;
|
||||
|
|
@ -711,8 +768,7 @@ _nm_setting_to_dbus(NMSetting * setting,
|
|||
for (i = 0; i < sett_info->property_infos_len; i++) {
|
||||
gs_unref_variant GVariant *dbus_value = NULL;
|
||||
|
||||
dbus_value =
|
||||
property_to_dbus(sett_info, i, connection, setting, flags, options, FALSE, TRUE);
|
||||
dbus_value = property_to_dbus(sett_info, i, connection, setting, flags, options, FALSE);
|
||||
if (dbus_value) {
|
||||
g_variant_builder_add(&builder, "{sv}", sett_info->property_infos[i].name, dbus_value);
|
||||
}
|
||||
|
|
@ -1348,7 +1404,6 @@ compare_property(const NMSettInfoSetting *sett_info,
|
|||
set_a,
|
||||
NM_CONNECTION_SERIALIZE_ALL,
|
||||
NULL,
|
||||
TRUE,
|
||||
TRUE);
|
||||
value2 = property_to_dbus(sett_info,
|
||||
property_idx,
|
||||
|
|
@ -1356,7 +1411,6 @@ compare_property(const NMSettInfoSetting *sett_info,
|
|||
set_b,
|
||||
NM_CONNECTION_SERIALIZE_ALL,
|
||||
NULL,
|
||||
TRUE,
|
||||
TRUE);
|
||||
if (nm_property_compare(value1, value2) != 0)
|
||||
return NM_TERNARY_FALSE;
|
||||
|
|
@ -2322,28 +2376,36 @@ _nm_setting_get_deprecated_virtual_interface_name(const NMSettInfoSetting *
|
|||
return NULL;
|
||||
}
|
||||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_deprecated_interface_name = {
|
||||
.dbus_type = G_VARIANT_TYPE_STRING,
|
||||
.to_dbus_fcn = _nm_setting_get_deprecated_virtual_interface_name,
|
||||
};
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_deprecated_interface_name =
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS_INIT(G_VARIANT_TYPE_STRING,
|
||||
.to_dbus_fcn =
|
||||
_nm_setting_get_deprecated_virtual_interface_name, );
|
||||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_deprecated_ignore_i = {
|
||||
.dbus_type = G_VARIANT_TYPE_INT32,
|
||||
/* No functions set. This property type is to silently ignore the value on D-Bus. */
|
||||
};
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_deprecated_ignore_i =
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS_INIT(
|
||||
G_VARIANT_TYPE_INT32,
|
||||
/* No functions set. This property type is to silently ignore the value on D-Bus. */
|
||||
);
|
||||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_deprecated_ignore_u = {
|
||||
.dbus_type = G_VARIANT_TYPE_UINT32,
|
||||
/* No functions set. This property type is to silently ignore the value on D-Bus. */
|
||||
};
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_deprecated_ignore_u =
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS_INIT(
|
||||
G_VARIANT_TYPE_UINT32,
|
||||
/* No functions set. This property type is to silently ignore the value on D-Bus. */
|
||||
);
|
||||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_plain_i = {
|
||||
.dbus_type = G_VARIANT_TYPE_INT32,
|
||||
};
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_plain_i =
|
||||
NM_SETT_INFO_PROPERT_TYPE_GPROP_INIT(G_VARIANT_TYPE_INT32);
|
||||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_plain_u = {
|
||||
.dbus_type = G_VARIANT_TYPE_UINT32,
|
||||
};
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_plain_u =
|
||||
NM_SETT_INFO_PROPERT_TYPE_GPROP_INIT(G_VARIANT_TYPE_UINT32);
|
||||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_boolean = NM_SETT_INFO_PROPERT_TYPE_DBUS_INIT(
|
||||
G_VARIANT_TYPE_BOOLEAN,
|
||||
.to_dbus_fcn = _nm_setting_property_to_dbus_fcn_get_boolean);
|
||||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_string =
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS_INIT(G_VARIANT_TYPE_STRING,
|
||||
.to_dbus_fcn = _nm_setting_property_to_dbus_fcn_get_string);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
|
|
|||
|
|
@ -2786,31 +2786,27 @@ _nm_team_settings_property_from_dbus_link_watchers(GVariant *dbus_value, GValue
|
|||
_nm_utils_team_link_watchers_from_variant(dbus_value, FALSE, NULL));
|
||||
}
|
||||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_team_b = {
|
||||
.dbus_type = G_VARIANT_TYPE_BOOLEAN,
|
||||
.to_dbus_fcn = _nm_team_settings_property_to_dbus,
|
||||
};
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_team_b =
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS_INIT(G_VARIANT_TYPE_BOOLEAN,
|
||||
.to_dbus_fcn = _nm_team_settings_property_to_dbus, );
|
||||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_team_i = {
|
||||
.dbus_type = G_VARIANT_TYPE_INT32,
|
||||
.to_dbus_fcn = _nm_team_settings_property_to_dbus,
|
||||
};
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_team_i =
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS_INIT(G_VARIANT_TYPE_INT32,
|
||||
.to_dbus_fcn = _nm_team_settings_property_to_dbus, );
|
||||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_team_s = {
|
||||
.dbus_type = G_VARIANT_TYPE_STRING,
|
||||
.to_dbus_fcn = _nm_team_settings_property_to_dbus,
|
||||
};
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_team_s =
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS_INIT(G_VARIANT_TYPE_STRING,
|
||||
.to_dbus_fcn = _nm_team_settings_property_to_dbus, );
|
||||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_team_as = {
|
||||
.dbus_type = NM_G_VARIANT_TYPE("as"),
|
||||
.to_dbus_fcn = _nm_team_settings_property_to_dbus,
|
||||
};
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_team_as =
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS_INIT(NM_G_VARIANT_TYPE("as"),
|
||||
.to_dbus_fcn = _nm_team_settings_property_to_dbus, );
|
||||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_team_link_watchers = {
|
||||
.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = _nm_team_settings_property_to_dbus,
|
||||
.gprop_from_dbus_fcn = _nm_team_settings_property_from_dbus_link_watchers,
|
||||
};
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_team_link_watchers =
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS_INIT(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = _nm_team_settings_property_to_dbus,
|
||||
.gprop_from_dbus_fcn =
|
||||
_nm_team_settings_property_from_dbus_link_watchers, );
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
|
|
|||
|
|
@ -758,12 +758,6 @@ _nm_utils_hash_values_to_slist(GHashTable *hash)
|
|||
return list;
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
_nm_utils_strdict_to_dbus(const GValue *prop_value)
|
||||
{
|
||||
return nm_utils_strdict_to_variant_ass(g_value_get_boxed(prop_value));
|
||||
}
|
||||
|
||||
void
|
||||
_nm_utils_strdict_from_dbus(GVariant *dbus_value, GValue *prop_value)
|
||||
{
|
||||
|
|
@ -779,11 +773,11 @@ _nm_utils_strdict_from_dbus(GVariant *dbus_value, GValue *prop_value)
|
|||
g_value_take_boxed(prop_value, hash);
|
||||
}
|
||||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_strdict = {
|
||||
.dbus_type = NM_G_VARIANT_TYPE("a{ss}"),
|
||||
.gprop_to_dbus_fcn = _nm_utils_strdict_to_dbus,
|
||||
.gprop_from_dbus_fcn = _nm_utils_strdict_from_dbus,
|
||||
};
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_strdict =
|
||||
NM_SETT_INFO_PROPERT_TYPE_GPROP_INIT(NM_G_VARIANT_TYPE("a{ss}"),
|
||||
.gprop_from_dbus_fcn = _nm_utils_strdict_from_dbus,
|
||||
.typdata_to_dbus.gprop_type =
|
||||
NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_STRDICT);
|
||||
|
||||
GHashTable *
|
||||
_nm_utils_copy_strdict(GHashTable *strdict)
|
||||
|
|
@ -3994,8 +3988,8 @@ nm_utils_hwaddr_matches(gconstpointer hwaddr1,
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
static GVariant *
|
||||
_nm_utils_hwaddr_to_dbus_impl(const char *str)
|
||||
GVariant *
|
||||
nm_utils_hwaddr_to_dbus(const char *str)
|
||||
{
|
||||
guint8 buf[NM_UTILS_HWADDR_LEN_MAX];
|
||||
gsize len;
|
||||
|
|
@ -4021,7 +4015,7 @@ _nm_utils_hwaddr_cloned_get(const NMSettInfoSetting * sett_info,
|
|||
nm_assert(nm_streq(sett_info->property_infos[property_idx].name, "cloned-mac-address"));
|
||||
|
||||
g_object_get(setting, "cloned-mac-address", &addr, NULL);
|
||||
return _nm_utils_hwaddr_to_dbus_impl(addr);
|
||||
return nm_utils_hwaddr_to_dbus(addr);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
@ -4067,12 +4061,11 @@ _nm_utils_hwaddr_cloned_not_set(NMSetting * setting,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_cloned_mac_address = {
|
||||
.dbus_type = G_VARIANT_TYPE_BYTESTRING,
|
||||
.to_dbus_fcn = _nm_utils_hwaddr_cloned_get,
|
||||
.from_dbus_fcn = _nm_utils_hwaddr_cloned_set,
|
||||
.missing_from_dbus_fcn = _nm_utils_hwaddr_cloned_not_set,
|
||||
};
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_cloned_mac_address =
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS_INIT(G_VARIANT_TYPE_BYTESTRING,
|
||||
.to_dbus_fcn = _nm_utils_hwaddr_cloned_get,
|
||||
.from_dbus_fcn = _nm_utils_hwaddr_cloned_set,
|
||||
.missing_from_dbus_fcn = _nm_utils_hwaddr_cloned_not_set, );
|
||||
|
||||
static GVariant *
|
||||
_nm_utils_hwaddr_cloned_data_synth(const NMSettInfoSetting * sett_info,
|
||||
|
|
@ -4092,7 +4085,7 @@ _nm_utils_hwaddr_cloned_data_synth(const NMSettInfoSetting * sett_
|
|||
g_object_get(setting, "cloned-mac-address", &addr, NULL);
|
||||
|
||||
/* Before introducing the extended "cloned-mac-address" (and its D-Bus
|
||||
* field "assigned-mac-address"), libnm's _nm_utils_hwaddr_to_dbus()
|
||||
* field "assigned-mac-address"), libnm's nm_utils_hwaddr_to_dbus()
|
||||
* would drop invalid values as it was unable to serialize them.
|
||||
*
|
||||
* Now, we would like to send invalid values as "assigned-mac-address"
|
||||
|
|
@ -4131,17 +4124,10 @@ _nm_utils_hwaddr_cloned_data_set(NMSetting * setting,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_assigned_mac_address = {
|
||||
.dbus_type = G_VARIANT_TYPE_STRING,
|
||||
.to_dbus_fcn = _nm_utils_hwaddr_cloned_data_synth,
|
||||
.from_dbus_fcn = _nm_utils_hwaddr_cloned_data_set,
|
||||
};
|
||||
|
||||
static GVariant *
|
||||
_nm_utils_hwaddr_to_dbus(const GValue *prop_value)
|
||||
{
|
||||
return _nm_utils_hwaddr_to_dbus_impl(g_value_get_string(prop_value));
|
||||
}
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_assigned_mac_address =
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS_INIT(G_VARIANT_TYPE_STRING,
|
||||
.to_dbus_fcn = _nm_utils_hwaddr_cloned_data_synth,
|
||||
.from_dbus_fcn = _nm_utils_hwaddr_cloned_data_set, );
|
||||
|
||||
static void
|
||||
_nm_utils_hwaddr_from_dbus(GVariant *dbus_value, GValue *prop_value)
|
||||
|
|
@ -4154,11 +4140,11 @@ _nm_utils_hwaddr_from_dbus(GVariant *dbus_value, GValue *prop_value)
|
|||
g_value_take_string(prop_value, str);
|
||||
}
|
||||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_mac_address = {
|
||||
.dbus_type = G_VARIANT_TYPE_BYTESTRING,
|
||||
.gprop_to_dbus_fcn = _nm_utils_hwaddr_to_dbus,
|
||||
.gprop_from_dbus_fcn = _nm_utils_hwaddr_from_dbus,
|
||||
};
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_mac_address =
|
||||
NM_SETT_INFO_PROPERT_TYPE_GPROP_INIT(
|
||||
G_VARIANT_TYPE_BYTESTRING,
|
||||
.gprop_from_dbus_fcn = _nm_utils_hwaddr_from_dbus,
|
||||
.typdata_to_dbus.gprop_type = NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_MAC_ADDRESS);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
|
@ -5558,11 +5544,10 @@ _nm_utils_bridge_vlans_from_dbus(NMSetting * setting,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_bridge_vlans = {
|
||||
.dbus_type = NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = _nm_utils_bridge_vlans_to_dbus,
|
||||
.from_dbus_fcn = _nm_utils_bridge_vlans_from_dbus,
|
||||
};
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_bridge_vlans =
|
||||
NM_SETT_INFO_PROPERT_TYPE_DBUS_INIT(NM_G_VARIANT_TYPE("aa{sv}"),
|
||||
.to_dbus_fcn = _nm_utils_bridge_vlans_to_dbus,
|
||||
.from_dbus_fcn = _nm_utils_bridge_vlans_from_dbus, );
|
||||
|
||||
gboolean
|
||||
_nm_utils_bridge_vlan_verify_list(GPtrArray * vlans,
|
||||
|
|
|
|||
|
|
@ -4358,6 +4358,7 @@ test_setting_metadata(void)
|
|||
const NMSettInfoProperty *sip = &sis->property_infos[prop_idx];
|
||||
GArray * property_types_data;
|
||||
guint prop_idx_val;
|
||||
gboolean can_set_including_default = FALSE;
|
||||
|
||||
g_assert(sip->name);
|
||||
|
||||
|
|
@ -4368,7 +4369,57 @@ test_setting_metadata(void)
|
|||
g_assert(sip->property_type->dbus_type);
|
||||
g_assert(g_variant_type_string_is_valid((const char *) sip->property_type->dbus_type));
|
||||
|
||||
g_assert(!sip->property_type->to_dbus_fcn || !sip->property_type->gprop_to_dbus_fcn);
|
||||
if (!sip->property_type->to_dbus_fcn) {
|
||||
/* it's allowed to have no to_dbus_fcn(), to ignore a property. But such
|
||||
* properties must not have a param_spec and no gprop_to_dbus_fcn. */
|
||||
g_assert(!sip->param_spec);
|
||||
g_assert(!sip->to_dbus_data.none);
|
||||
} else if (sip->property_type->to_dbus_fcn == _nm_setting_property_to_dbus_fcn_gprop) {
|
||||
g_assert(sip->param_spec);
|
||||
switch (sip->property_type->typdata_to_dbus.gprop_type) {
|
||||
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_BYTES:
|
||||
g_assert(sip->param_spec->value_type == G_TYPE_BYTES);
|
||||
goto check_done;
|
||||
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_ENUM:
|
||||
g_assert(g_type_is_a (sip->param_spec->value_type, G_TYPE_ENUM));
|
||||
goto check_done;
|
||||
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_FLAGS:
|
||||
g_assert(g_type_is_a (sip->param_spec->value_type, G_TYPE_FLAGS));
|
||||
goto check_done;
|
||||
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_GARRAY_UINT:
|
||||
g_assert(sip->param_spec->value_type == G_TYPE_ARRAY);
|
||||
goto check_done;
|
||||
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_STRDICT:
|
||||
g_assert(sip->param_spec->value_type == G_TYPE_HASH_TABLE);
|
||||
goto check_done;
|
||||
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_MAC_ADDRESS:
|
||||
g_assert(sip->param_spec->value_type == G_TYPE_STRING);
|
||||
goto check_done;
|
||||
case NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_DEFAULT:
|
||||
goto check_done;
|
||||
}
|
||||
g_assert_not_reached();
|
||||
check_done:;
|
||||
if (sip->property_type->typdata_to_dbus.gprop_type
|
||||
!= NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_DEFAULT)
|
||||
g_assert(!sip->to_dbus_data.gprop_to_dbus_fcn);
|
||||
can_set_including_default = TRUE;
|
||||
} else if (sip->property_type->to_dbus_fcn
|
||||
== _nm_setting_property_to_dbus_fcn_get_boolean) {
|
||||
g_assert(sip->param_spec);
|
||||
g_assert(sip->param_spec->value_type == G_TYPE_BOOLEAN);
|
||||
g_assert(sip->to_dbus_data.get_boolean);
|
||||
can_set_including_default = TRUE;
|
||||
} else if (sip->property_type->to_dbus_fcn
|
||||
== _nm_setting_property_to_dbus_fcn_get_string) {
|
||||
g_assert(sip->param_spec);
|
||||
g_assert(sip->param_spec->value_type == G_TYPE_STRING);
|
||||
g_assert(sip->to_dbus_data.get_string);
|
||||
}
|
||||
|
||||
if (!can_set_including_default)
|
||||
g_assert(!sip->to_dbus_data.including_default);
|
||||
|
||||
g_assert(!sip->property_type->from_dbus_fcn
|
||||
|| !sip->property_type->gprop_from_dbus_fcn);
|
||||
|
||||
|
|
@ -4486,8 +4537,11 @@ test_setting_metadata(void)
|
|||
|| pt->to_dbus_fcn != pt_2->to_dbus_fcn
|
||||
|| pt->from_dbus_fcn != pt_2->from_dbus_fcn
|
||||
|| pt->missing_from_dbus_fcn != pt_2->missing_from_dbus_fcn
|
||||
|| pt->gprop_to_dbus_fcn != pt_2->gprop_to_dbus_fcn
|
||||
|| pt->gprop_from_dbus_fcn != pt_2->gprop_from_dbus_fcn)
|
||||
|| pt->gprop_from_dbus_fcn != pt_2->gprop_from_dbus_fcn
|
||||
|| memcmp(&pt->typdata_to_dbus,
|
||||
&pt_2->typdata_to_dbus,
|
||||
sizeof(pt->typdata_to_dbus))
|
||||
!= 0)
|
||||
continue;
|
||||
|
||||
if ((pt == &nm_sett_info_propert_type_plain_i
|
||||
|
|
@ -4509,7 +4563,9 @@ test_setting_metadata(void)
|
|||
|
||||
/* the property-types with same content should all be shared. Here we have two that
|
||||
* are the same content, but different instances. Bug. */
|
||||
g_error("The identical property type for D-Bus type \"%s\" is used by: %s and %s",
|
||||
g_error("The identical property type for D-Bus type \"%s\" is used by: %s and %s. "
|
||||
"If a NMSettInfoPropertType is identical, it should be shared by creating "
|
||||
"a common instance of the property type",
|
||||
(const char *) pt->dbus_type,
|
||||
_PROP_IDX_OWNER(h_property_types, pt),
|
||||
_PROP_IDX_OWNER(h_property_types, pt_2));
|
||||
|
|
|
|||
|
|
@ -642,6 +642,10 @@ GVariant * nm_ip_routing_rule_to_dbus(const NMIPRoutingRule *self);
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
GVariant *nm_utils_hwaddr_to_dbus(const char *str);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
typedef struct _NMSettInfoSetting NMSettInfoSetting;
|
||||
typedef struct _NMSettInfoProperty NMSettInfoProperty;
|
||||
|
||||
|
|
@ -667,6 +671,16 @@ typedef void (*NMSettInfoPropGPropFromDBusFcn)(GVariant *from, GValue *to);
|
|||
|
||||
const NMSettInfoSetting *nmtst_sett_info_settings(void);
|
||||
|
||||
typedef enum _nm_packed {
|
||||
NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_DEFAULT = 0,
|
||||
NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_BYTES,
|
||||
NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_ENUM,
|
||||
NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_FLAGS,
|
||||
NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_GARRAY_UINT,
|
||||
NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_STRDICT,
|
||||
NM_SETTING_PROPERTY_TO_DBUS_FCN_GPROP_TYPE_MAC_ADDRESS,
|
||||
} NMSettingPropertyToDBusFcnGPropType;
|
||||
|
||||
typedef struct {
|
||||
const GVariantType *dbus_type;
|
||||
|
||||
|
|
@ -674,10 +688,16 @@ typedef struct {
|
|||
NMSettInfoPropFromDBusFcn from_dbus_fcn;
|
||||
NMSettInfoPropMissingFromDBusFcn missing_from_dbus_fcn;
|
||||
|
||||
/* Simpler variants of @to_dbus_fcn/@from_dbus_fcn that operate solely
|
||||
/* Simpler variants of @from_dbus_fcn that operate solely
|
||||
* on the GValue value of the GObject property. */
|
||||
NMSettInfoPropGPropToDBusFcn gprop_to_dbus_fcn;
|
||||
NMSettInfoPropGPropFromDBusFcn gprop_from_dbus_fcn;
|
||||
|
||||
struct {
|
||||
union {
|
||||
NMSettingPropertyToDBusFcnGPropType gprop_type;
|
||||
};
|
||||
} typdata_to_dbus;
|
||||
|
||||
} NMSettInfoPropertType;
|
||||
|
||||
struct _NMSettInfoProperty {
|
||||
|
|
@ -686,6 +706,21 @@ struct _NMSettInfoProperty {
|
|||
GParamSpec *param_spec;
|
||||
|
||||
const NMSettInfoPropertType *property_type;
|
||||
|
||||
struct {
|
||||
union {
|
||||
gpointer none;
|
||||
NMSettInfoPropGPropToDBusFcn gprop_to_dbus_fcn;
|
||||
gboolean (*get_boolean)(NMSetting *);
|
||||
const char *(*get_string)(NMSetting *);
|
||||
};
|
||||
|
||||
/* Usually, properties that are set to the default value for the GParamSpec
|
||||
* are not serialized to GVariant (and NULL is returned by to_dbus_data().
|
||||
* Set this flag to force always converting the property even if the value
|
||||
* is the default. */
|
||||
bool including_default : 1;
|
||||
} to_dbus_data;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
|
|
|||
|
|
@ -529,24 +529,26 @@ nm_utils_gbytes_to_variant_ay(GBytes *bytes)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
#define _variant_singleton_get(create_variant) \
|
||||
({ \
|
||||
static GVariant *_singleton = NULL; \
|
||||
GVariant * _v; \
|
||||
\
|
||||
again: \
|
||||
_v = g_atomic_pointer_get(&_singleton); \
|
||||
if (G_UNLIKELY(!_v)) { \
|
||||
_v = (create_variant); \
|
||||
nm_assert(_v); \
|
||||
nm_assert(g_variant_is_floating(_v)); \
|
||||
g_variant_ref_sink(_v); \
|
||||
if (!g_atomic_pointer_compare_and_exchange(&_singleton, NULL, _v)) { \
|
||||
g_variant_unref(_v); \
|
||||
goto again; \
|
||||
} \
|
||||
} \
|
||||
_v; \
|
||||
#define _variant_singleton_get(create_variant) \
|
||||
({ \
|
||||
static GVariant *_singleton = NULL; \
|
||||
GVariant * _v; \
|
||||
\
|
||||
while (TRUE) { \
|
||||
_v = g_atomic_pointer_get(&_singleton); \
|
||||
if (G_UNLIKELY(!_v)) { \
|
||||
_v = (create_variant); \
|
||||
nm_assert(_v); \
|
||||
nm_assert(g_variant_is_floating(_v)); \
|
||||
g_variant_ref_sink(_v); \
|
||||
if (!g_atomic_pointer_compare_and_exchange(&_singleton, NULL, _v)) { \
|
||||
g_variant_unref(_v); \
|
||||
continue; \
|
||||
} \
|
||||
} \
|
||||
break; \
|
||||
} \
|
||||
_v; \
|
||||
})
|
||||
|
||||
GVariant *
|
||||
|
|
@ -555,6 +557,19 @@ nm_g_variant_singleton_u_0(void)
|
|||
return _variant_singleton_get(g_variant_new_uint32(0));
|
||||
}
|
||||
|
||||
GVariant *
|
||||
nm_g_variant_singleton_b(gboolean value)
|
||||
{
|
||||
return value ? _variant_singleton_get(g_variant_new_boolean(TRUE))
|
||||
: _variant_singleton_get(g_variant_new_boolean(FALSE));
|
||||
}
|
||||
|
||||
GVariant *
|
||||
nm_g_variant_singleton_s_empty(void)
|
||||
{
|
||||
return _variant_singleton_get(g_variant_new_string(""));
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
_variant_singleton_get_array_init(GVariant **p_singleton, const char *variant_type)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1425,6 +1425,8 @@ GParamSpec *nm_g_object_class_find_property_from_gtype(GType gtype, const char *
|
|||
_NM_G_PARAM_SPEC_CAST(param_spec, G_TYPE_UINT, GParamSpecUInt)
|
||||
#define NM_G_PARAM_SPEC_CAST_UINT64(param_spec) \
|
||||
_NM_G_PARAM_SPEC_CAST(param_spec, G_TYPE_UINT64, GParamSpecUInt64)
|
||||
#define NM_G_PARAM_SPEC_CAST_STRING(param_spec) \
|
||||
_NM_G_PARAM_SPEC_CAST(param_spec, G_TYPE_STRING, GParamSpecString)
|
||||
|
||||
#define NM_G_PARAM_SPEC_GET_DEFAULT_BOOLEAN(param_spec) \
|
||||
(NM_G_PARAM_SPEC_CAST_BOOLEAN(NM_ENSURE_NOT_NULL(param_spec))->default_value)
|
||||
|
|
@ -1432,6 +1434,8 @@ GParamSpec *nm_g_object_class_find_property_from_gtype(GType gtype, const char *
|
|||
(NM_G_PARAM_SPEC_CAST_UINT(NM_ENSURE_NOT_NULL(param_spec))->default_value)
|
||||
#define NM_G_PARAM_SPEC_GET_DEFAULT_UINT64(param_spec) \
|
||||
(NM_G_PARAM_SPEC_CAST_UINT64(NM_ENSURE_NOT_NULL(param_spec))->default_value)
|
||||
#define NM_G_PARAM_SPEC_GET_DEFAULT_STRING(param_spec) \
|
||||
(NM_G_PARAM_SPEC_CAST_STRING(NM_ENSURE_NOT_NULL(param_spec))->default_value)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
|
@ -1487,7 +1491,9 @@ char *nm_utils_str_utf8safe_unescape_cp(const char *str, NMUtilsStrUtf8SafeFlags
|
|||
|
||||
char *nm_utils_str_utf8safe_escape_take(char *str, NMUtilsStrUtf8SafeFlags flags);
|
||||
|
||||
GVariant *nm_g_variant_singleton_b(gboolean value);
|
||||
GVariant *nm_g_variant_singleton_u_0(void);
|
||||
GVariant *nm_g_variant_singleton_s_empty(void);
|
||||
GVariant *nm_g_variant_singleton_aLsvI(void);
|
||||
GVariant *nm_g_variant_singleton_aLsaLsvII(void);
|
||||
GVariant *nm_g_variant_singleton_aaLsvI(void);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue