libnm: rework setting metadata for property handling
NMSetting internally already tracked a list of all proper GObject properties and D-Bus-only properties. Rework the tracking of the list, so that: - instead of attaching the data to the GType of the setting via g_type_set_qdata(), it is tracked in a static array indexed by NMMetaSettingType. This allows to find the setting-data by simple pointer arithmetic, instead of taking a look and iterating (like g_type_set_qdata() does). Note, that this is still thread safe, because the static table entry is initialized in the class-init function with _nm_setting_class_commit(). And it only accessed by following a NMSettingClass instance, thus the class constructor already ran (maybe not for all setting classes, but for the particular one that we look up). I think this makes initialization of the metadata simpler to understand. Previously, in a first phase each class would attach the metadata to the GType as setting_property_overrides_quark(). Then during nm_setting_class_ensure_properties() it would merge them and set as setting_properties_quark(). Now, during the first phase, we only incrementally build a properties_override GArray, which we finally hand over during nm_setting_class_commit(). - sort the property infos by name and do binary search. Also expose this meta data types as internal API in nm-setting-private.h. While not accessed yet, it can prove beneficial, to have direct (internal) access to these structures. Also, rename NMSettingProperty to NMSettInfoProperty to use a distinct naming scheme. We already have 40+ subclasses of NMSetting that are called NMSetting*. Likewise, NMMetaSetting* is heavily used already. So, choose a new, distinct name.
This commit is contained in:
@@ -479,4 +479,57 @@ gboolean _nm_utils_dhcp_duid_valid (const char *duid, GBytes **out_duid_bin);
|
|||||||
|
|
||||||
gboolean _nm_setting_sriov_sort_vfs (NMSettingSriov *setting);
|
gboolean _nm_setting_sriov_sort_vfs (NMSettingSriov *setting);
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
typedef GVariant *(*NMSettingPropertyGetFunc) (NMSetting *setting,
|
||||||
|
const char *property);
|
||||||
|
typedef GVariant *(*NMSettingPropertySynthFunc) (NMSetting *setting,
|
||||||
|
NMConnection *connection,
|
||||||
|
const char *property);
|
||||||
|
typedef gboolean (*NMSettingPropertySetFunc) (NMSetting *setting,
|
||||||
|
GVariant *connection_dict,
|
||||||
|
const char *property,
|
||||||
|
GVariant *value,
|
||||||
|
NMSettingParseFlags parse_flags,
|
||||||
|
GError **error);
|
||||||
|
typedef gboolean (*NMSettingPropertyNotSetFunc) (NMSetting *setting,
|
||||||
|
GVariant *connection_dict,
|
||||||
|
const char *property,
|
||||||
|
NMSettingParseFlags parse_flags,
|
||||||
|
GError **error);
|
||||||
|
typedef GVariant *(*NMSettingPropertyTransformToFunc) (const GValue *from);
|
||||||
|
typedef void (*NMSettingPropertyTransformFromFunc) (GVariant *from,
|
||||||
|
GValue *to);
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
const char *name;
|
||||||
|
GParamSpec *param_spec;
|
||||||
|
const GVariantType *dbus_type;
|
||||||
|
|
||||||
|
NMSettingPropertyGetFunc get_func;
|
||||||
|
NMSettingPropertySynthFunc synth_func;
|
||||||
|
NMSettingPropertySetFunc set_func;
|
||||||
|
NMSettingPropertyNotSetFunc not_set_func;
|
||||||
|
|
||||||
|
NMSettingPropertyTransformToFunc to_dbus;
|
||||||
|
NMSettingPropertyTransformFromFunc from_dbus;
|
||||||
|
} NMSettInfoProperty;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
} NMSettInfoSettDetail;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
NMSettingClass *setting_class;
|
||||||
|
const NMSettInfoProperty *property_infos;
|
||||||
|
guint property_infos_len;
|
||||||
|
NMSettInfoSettDetail detail;
|
||||||
|
} NMSettInfoSetting;
|
||||||
|
|
||||||
|
const NMSettInfoSetting *_nm_sett_info_setting_get (NMSettingClass *setting_class);
|
||||||
|
|
||||||
|
const NMSettInfoProperty *_nm_sett_info_property_get (NMSettingClass *setting_class,
|
||||||
|
const char *property_name);
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -206,8 +206,7 @@ nm_setting_6lowpan_class_init (NMSetting6LowpanClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_6LOWPAN];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSetting6Lowpan:parent:
|
* NMSetting6Lowpan:parent:
|
||||||
@@ -226,4 +225,6 @@ nm_setting_6lowpan_class_init (NMSetting6LowpanClass *klass)
|
|||||||
G_PARAM_STATIC_STRINGS);
|
G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_6LOWPAN);
|
||||||
}
|
}
|
||||||
|
@@ -3771,7 +3771,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_802_1X];
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
setting_class->need_secrets = need_secrets;
|
setting_class->need_secrets = need_secrets;
|
||||||
|
|
||||||
@@ -4803,4 +4802,6 @@ nm_setting_802_1x_class_init (NMSetting8021xClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
NM_SETTING_PARAM_FUZZY_IGNORE |
|
NM_SETTING_PARAM_FUZZY_IGNORE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_802_1X);
|
||||||
}
|
}
|
||||||
|
@@ -355,7 +355,6 @@ nm_setting_adsl_class_init (NMSettingAdslClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_ADSL];
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
setting_class->verify_secrets = verify_secrets;
|
setting_class->verify_secrets = verify_secrets;
|
||||||
setting_class->need_secrets = need_secrets;
|
setting_class->need_secrets = need_secrets;
|
||||||
@@ -445,4 +444,6 @@ nm_setting_adsl_class_init (NMSettingAdslClass *klass)
|
|||||||
0, 65536, 0,
|
0, 65536, 0,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_ADSL);
|
||||||
}
|
}
|
||||||
|
@@ -285,6 +285,7 @@ nm_setting_bluetooth_class_init (NMSettingBluetoothClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingBluetoothPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingBluetoothPrivate));
|
||||||
|
|
||||||
@@ -292,7 +293,6 @@ nm_setting_bluetooth_class_init (NMSettingBluetoothClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_BLUETOOTH];
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -307,10 +307,13 @@ nm_setting_bluetooth_class_init (NMSettingBluetoothClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class, NM_SETTING_BLUETOOTH_BDADDR,
|
|
||||||
G_VARIANT_TYPE_BYTESTRING,
|
_properties_override_add_transform (properties_override,
|
||||||
_nm_utils_hwaddr_to_dbus,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_utils_hwaddr_from_dbus);
|
NM_SETTING_BLUETOOTH_BDADDR),
|
||||||
|
G_VARIANT_TYPE_BYTESTRING,
|
||||||
|
_nm_utils_hwaddr_to_dbus,
|
||||||
|
_nm_utils_hwaddr_from_dbus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingBluetooth:type:
|
* NMSettingBluetooth:type:
|
||||||
@@ -325,4 +328,7 @@ nm_setting_bluetooth_class_init (NMSettingBluetoothClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_BLUETOOTH,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -962,6 +962,7 @@ nm_setting_bond_class_init (NMSettingBondClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingBondPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingBondPrivate));
|
||||||
|
|
||||||
@@ -969,7 +970,6 @@ nm_setting_bond_class_init (NMSettingBondClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_BOND];
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
setting_class->compare_property = compare_property;
|
setting_class->compare_property = compare_property;
|
||||||
|
|
||||||
@@ -994,10 +994,13 @@ nm_setting_bond_class_init (NMSettingBondClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class, NM_SETTING_BOND_OPTIONS,
|
|
||||||
G_VARIANT_TYPE ("a{ss}"),
|
_properties_override_add_transform (properties_override,
|
||||||
_nm_utils_strdict_to_dbus,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_utils_strdict_from_dbus);
|
NM_SETTING_BOND_OPTIONS),
|
||||||
|
G_VARIANT_TYPE ("a{ss}"),
|
||||||
|
_nm_utils_strdict_to_dbus,
|
||||||
|
_nm_utils_strdict_from_dbus);
|
||||||
|
|
||||||
/* ---dbus---
|
/* ---dbus---
|
||||||
* property: interface-name
|
* property: interface-name
|
||||||
@@ -1007,8 +1010,12 @@ nm_setting_bond_class_init (NMSettingBondClass *klass)
|
|||||||
* bond's interface name.
|
* bond's interface name.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
_nm_setting_class_add_dbus_only_property (setting_class, "interface-name",
|
_properties_override_add_dbus_only (properties_override,
|
||||||
G_VARIANT_TYPE_STRING,
|
"interface-name",
|
||||||
_nm_setting_get_deprecated_virtual_interface_name,
|
G_VARIANT_TYPE_STRING,
|
||||||
NULL);
|
_nm_setting_get_deprecated_virtual_interface_name,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_BOND,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -220,8 +220,7 @@ nm_setting_bridge_port_class_init (NMSettingBridgePortClass *klass)
|
|||||||
object_class->set_property = set_property;
|
object_class->set_property = set_property;
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_BRIDGE_PORT];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingBridgePort:priority:
|
* NMSettingBridgePort:priority:
|
||||||
@@ -288,4 +287,6 @@ nm_setting_bridge_port_class_init (NMSettingBridgePortClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_BRIDGE_PORT);
|
||||||
}
|
}
|
||||||
|
@@ -395,6 +395,7 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingBridgePrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingBridgePrivate));
|
||||||
|
|
||||||
@@ -402,8 +403,7 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_BRIDGE];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingBridge:mac-address:
|
* NMSettingBridge:mac-address:
|
||||||
@@ -442,10 +442,13 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class, NM_SETTING_BRIDGE_MAC_ADDRESS,
|
|
||||||
G_VARIANT_TYPE_BYTESTRING,
|
_properties_override_add_transform (properties_override,
|
||||||
_nm_utils_hwaddr_to_dbus,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_utils_hwaddr_from_dbus);
|
NM_SETTING_BRIDGE_MAC_ADDRESS),
|
||||||
|
G_VARIANT_TYPE_BYTESTRING,
|
||||||
|
_nm_utils_hwaddr_to_dbus,
|
||||||
|
_nm_utils_hwaddr_from_dbus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingBridge:stp:
|
* NMSettingBridge:stp:
|
||||||
@@ -636,8 +639,12 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *klass)
|
|||||||
* bridge's interface name.
|
* bridge's interface name.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
_nm_setting_class_add_dbus_only_property (setting_class, "interface-name",
|
_properties_override_add_dbus_only (properties_override,
|
||||||
G_VARIANT_TYPE_STRING,
|
"interface-name",
|
||||||
_nm_setting_get_deprecated_virtual_interface_name,
|
G_VARIANT_TYPE_STRING,
|
||||||
NULL);
|
_nm_setting_get_deprecated_virtual_interface_name,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_BRIDGE,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -294,7 +294,6 @@ nm_setting_cdma_class_init (NMSettingCdmaClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_CDMA];
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
setting_class->verify_secrets = verify_secrets;
|
setting_class->verify_secrets = verify_secrets;
|
||||||
setting_class->need_secrets = need_secrets;
|
setting_class->need_secrets = need_secrets;
|
||||||
@@ -372,4 +371,5 @@ nm_setting_cdma_class_init (NMSettingCdmaClass *klass)
|
|||||||
NM_SETTING_PARAM_FUZZY_IGNORE |
|
NM_SETTING_PARAM_FUZZY_IGNORE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_CDMA);
|
||||||
}
|
}
|
||||||
|
@@ -1505,6 +1505,7 @@ nm_setting_connection_class_init (NMSettingConnectionClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingConnectionPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingConnectionPrivate));
|
||||||
|
|
||||||
@@ -1512,7 +1513,6 @@ nm_setting_connection_class_init (NMSettingConnectionClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_CONNECTION];
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
setting_class->compare_property = compare_property;
|
setting_class->compare_property = compare_property;
|
||||||
|
|
||||||
@@ -1651,11 +1651,14 @@ nm_setting_connection_class_init (NMSettingConnectionClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_override_property (setting_class, NM_SETTING_CONNECTION_INTERFACE_NAME,
|
|
||||||
G_VARIANT_TYPE_STRING,
|
_properties_override_add_override (properties_override,
|
||||||
NULL,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
nm_setting_connection_set_interface_name,
|
NM_SETTING_CONNECTION_INTERFACE_NAME),
|
||||||
nm_setting_connection_no_interface_name);
|
G_VARIANT_TYPE_STRING,
|
||||||
|
NULL,
|
||||||
|
nm_setting_connection_set_interface_name,
|
||||||
|
nm_setting_connection_no_interface_name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingConnection:type:
|
* NMSettingConnection:type:
|
||||||
@@ -2125,4 +2128,7 @@ nm_setting_connection_class_init (NMSettingConnectionClass *klass)
|
|||||||
NM_SETTING_CONNECTION_MDNS_DEFAULT,
|
NM_SETTING_CONNECTION_MDNS_DEFAULT,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_CONNECTION,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -909,6 +909,7 @@ nm_setting_dcb_class_init (NMSettingDcbClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingDcbPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingDcbPrivate));
|
||||||
|
|
||||||
@@ -916,8 +917,7 @@ nm_setting_dcb_class_init (NMSettingDcbClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_DCB];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingDcb:app-fcoe-flags:
|
* NMSettingDcb:app-fcoe-flags:
|
||||||
@@ -1117,10 +1117,13 @@ nm_setting_dcb_class_init (NMSettingDcbClass *klass)
|
|||||||
G_TYPE_ARRAY,
|
G_TYPE_ARRAY,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class, NM_SETTING_DCB_PRIORITY_FLOW_CONTROL,
|
|
||||||
G_VARIANT_TYPE ("au"),
|
_properties_override_add_transform (properties_override,
|
||||||
_nm_setting_dcb_uint_array_to_dbus,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_setting_dcb_uint_array_from_dbus);
|
NM_SETTING_DCB_PRIORITY_FLOW_CONTROL),
|
||||||
|
G_VARIANT_TYPE ("au"),
|
||||||
|
_nm_setting_dcb_uint_array_to_dbus,
|
||||||
|
_nm_setting_dcb_uint_array_from_dbus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingDcb:priority-group-flags:
|
* NMSettingDcb:priority-group-flags:
|
||||||
@@ -1165,10 +1168,13 @@ nm_setting_dcb_class_init (NMSettingDcbClass *klass)
|
|||||||
G_TYPE_ARRAY,
|
G_TYPE_ARRAY,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class, NM_SETTING_DCB_PRIORITY_GROUP_ID,
|
|
||||||
G_VARIANT_TYPE ("au"),
|
_properties_override_add_transform (properties_override,
|
||||||
_nm_setting_dcb_uint_array_to_dbus,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_setting_dcb_uint_array_from_dbus);
|
NM_SETTING_DCB_PRIORITY_GROUP_ID),
|
||||||
|
G_VARIANT_TYPE ("au"),
|
||||||
|
_nm_setting_dcb_uint_array_to_dbus,
|
||||||
|
_nm_setting_dcb_uint_array_from_dbus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingDcb:priority-group-bandwidth: (type GArray(guint))
|
* NMSettingDcb:priority-group-bandwidth: (type GArray(guint))
|
||||||
@@ -1191,10 +1197,13 @@ nm_setting_dcb_class_init (NMSettingDcbClass *klass)
|
|||||||
G_TYPE_ARRAY,
|
G_TYPE_ARRAY,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class, NM_SETTING_DCB_PRIORITY_GROUP_BANDWIDTH,
|
|
||||||
G_VARIANT_TYPE ("au"),
|
_properties_override_add_transform (properties_override,
|
||||||
_nm_setting_dcb_uint_array_to_dbus,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_setting_dcb_uint_array_from_dbus);
|
NM_SETTING_DCB_PRIORITY_GROUP_BANDWIDTH),
|
||||||
|
G_VARIANT_TYPE ("au"),
|
||||||
|
_nm_setting_dcb_uint_array_to_dbus,
|
||||||
|
_nm_setting_dcb_uint_array_from_dbus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingDcb:priority-bandwidth: (type GArray(guint))
|
* NMSettingDcb:priority-bandwidth: (type GArray(guint))
|
||||||
@@ -1219,10 +1228,13 @@ nm_setting_dcb_class_init (NMSettingDcbClass *klass)
|
|||||||
G_TYPE_ARRAY,
|
G_TYPE_ARRAY,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class, NM_SETTING_DCB_PRIORITY_BANDWIDTH,
|
|
||||||
G_VARIANT_TYPE ("au"),
|
_properties_override_add_transform (properties_override,
|
||||||
_nm_setting_dcb_uint_array_to_dbus,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_setting_dcb_uint_array_from_dbus);
|
NM_SETTING_DCB_PRIORITY_BANDWIDTH),
|
||||||
|
G_VARIANT_TYPE ("au"),
|
||||||
|
_nm_setting_dcb_uint_array_to_dbus,
|
||||||
|
_nm_setting_dcb_uint_array_from_dbus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingDcb:priority-strict-bandwidth: (type GArray(gboolean))
|
* NMSettingDcb:priority-strict-bandwidth: (type GArray(gboolean))
|
||||||
@@ -1245,10 +1257,13 @@ nm_setting_dcb_class_init (NMSettingDcbClass *klass)
|
|||||||
G_TYPE_ARRAY,
|
G_TYPE_ARRAY,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class, NM_SETTING_DCB_PRIORITY_STRICT_BANDWIDTH,
|
|
||||||
G_VARIANT_TYPE ("au"),
|
_properties_override_add_transform (properties_override,
|
||||||
_nm_setting_dcb_uint_array_to_dbus,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_setting_dcb_uint_array_from_dbus);
|
NM_SETTING_DCB_PRIORITY_STRICT_BANDWIDTH),
|
||||||
|
G_VARIANT_TYPE ("au"),
|
||||||
|
_nm_setting_dcb_uint_array_to_dbus,
|
||||||
|
_nm_setting_dcb_uint_array_from_dbus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingDcb:priority-traffic-class: (type GArray(guint))
|
* NMSettingDcb:priority-traffic-class: (type GArray(guint))
|
||||||
@@ -1270,8 +1285,14 @@ nm_setting_dcb_class_init (NMSettingDcbClass *klass)
|
|||||||
G_TYPE_ARRAY,
|
G_TYPE_ARRAY,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class, NM_SETTING_DCB_PRIORITY_TRAFFIC_CLASS,
|
|
||||||
G_VARIANT_TYPE ("au"),
|
_properties_override_add_transform (properties_override,
|
||||||
_nm_setting_dcb_uint_array_to_dbus,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_setting_dcb_uint_array_from_dbus);
|
NM_SETTING_DCB_PRIORITY_TRAFFIC_CLASS),
|
||||||
|
G_VARIANT_TYPE ("au"),
|
||||||
|
_nm_setting_dcb_uint_array_to_dbus,
|
||||||
|
_nm_setting_dcb_uint_array_from_dbus);
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_DCB,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -70,6 +70,7 @@ nm_setting_dummy_class_init (NMSettingDummyClass *klass)
|
|||||||
{
|
{
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_DUMMY];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_DUMMY);
|
||||||
}
|
}
|
||||||
|
@@ -71,5 +71,5 @@ nm_setting_generic_class_init (NMSettingGenericClass *klass)
|
|||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingGenericPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingGenericPrivate));
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_GENERIC];
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_GENERIC);
|
||||||
}
|
}
|
||||||
|
@@ -606,6 +606,7 @@ nm_setting_gsm_class_init (NMSettingGsmClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingGsmPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingGsmPrivate));
|
||||||
|
|
||||||
@@ -613,7 +614,6 @@ nm_setting_gsm_class_init (NMSettingGsmClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_GSM];
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
setting_class->verify_secrets = verify_secrets;
|
setting_class->verify_secrets = verify_secrets;
|
||||||
setting_class->need_secrets = need_secrets;
|
setting_class->need_secrets = need_secrets;
|
||||||
@@ -819,10 +819,18 @@ nm_setting_gsm_class_init (NMSettingGsmClass *klass)
|
|||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
/* Ignore incoming deprecated properties */
|
/* Ignore incoming deprecated properties */
|
||||||
_nm_setting_class_add_dbus_only_property (setting_class, "allowed-bands",
|
_properties_override_add_dbus_only (properties_override,
|
||||||
G_VARIANT_TYPE_UINT32,
|
"allowed-bands",
|
||||||
NULL, NULL);
|
G_VARIANT_TYPE_UINT32,
|
||||||
_nm_setting_class_add_dbus_only_property (setting_class, "network-type",
|
NULL,
|
||||||
G_VARIANT_TYPE_INT32,
|
NULL);
|
||||||
NULL, NULL);
|
|
||||||
|
_properties_override_add_dbus_only (properties_override,
|
||||||
|
"network-type",
|
||||||
|
G_VARIANT_TYPE_INT32,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_GSM,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -380,6 +380,7 @@ nm_setting_infiniband_class_init (NMSettingInfinibandClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingInfinibandPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingInfinibandPrivate));
|
||||||
|
|
||||||
@@ -387,8 +388,7 @@ nm_setting_infiniband_class_init (NMSettingInfinibandClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_INFINIBAND];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingInfiniband:mac-address:
|
* NMSettingInfiniband:mac-address:
|
||||||
@@ -422,10 +422,13 @@ nm_setting_infiniband_class_init (NMSettingInfinibandClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class, NM_SETTING_INFINIBAND_MAC_ADDRESS,
|
|
||||||
G_VARIANT_TYPE_BYTESTRING,
|
_properties_override_add_transform (properties_override,
|
||||||
_nm_utils_hwaddr_to_dbus,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_utils_hwaddr_from_dbus);
|
NM_SETTING_INFINIBAND_MAC_ADDRESS),
|
||||||
|
G_VARIANT_TYPE_BYTESTRING,
|
||||||
|
_nm_utils_hwaddr_to_dbus,
|
||||||
|
_nm_utils_hwaddr_from_dbus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingInfiniband:mtu:
|
* NMSettingInfiniband:mtu:
|
||||||
@@ -523,4 +526,6 @@ nm_setting_infiniband_class_init (NMSettingInfinibandClass *klass)
|
|||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_INFINIBAND,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -2878,6 +2878,23 @@ ip_gateway_set (NMSetting *setting,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GArray *
|
||||||
|
_nm_sett_info_property_override_create_array_ip_config (void)
|
||||||
|
{
|
||||||
|
nm_auto_unref_gtypeclass NMSettingClass *setting_class = g_type_class_ref (NM_TYPE_SETTING_IP_CONFIG);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
|
_properties_override_add_override (properties_override,
|
||||||
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
|
NM_SETTING_IP_CONFIG_GATEWAY),
|
||||||
|
G_VARIANT_TYPE_STRING,
|
||||||
|
NULL,
|
||||||
|
ip_gateway_set,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
return properties_override;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nm_setting_ip_config_class_init (NMSettingIPConfigClass *klass)
|
nm_setting_ip_config_class_init (NMSettingIPConfigClass *klass)
|
||||||
{
|
{
|
||||||
@@ -3041,13 +3058,6 @@ nm_setting_ip_config_class_init (NMSettingIPConfigClass *klass)
|
|||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
_nm_setting_class_override_property (setting_class,
|
|
||||||
NM_SETTING_IP_CONFIG_GATEWAY,
|
|
||||||
G_VARIANT_TYPE_STRING,
|
|
||||||
NULL,
|
|
||||||
ip_gateway_set,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingIPConfig:routes: (type GPtrArray(NMIPRoute))
|
* NMSettingIPConfig:routes: (type GPtrArray(NMIPRoute))
|
||||||
*
|
*
|
||||||
|
@@ -632,8 +632,7 @@ nm_setting_ip_tunnel_class_init (NMSettingIPTunnelClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_IP_TUNNEL];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingIPTunnel:parent:
|
* NMSettingIPTunnel:parent:
|
||||||
@@ -851,4 +850,6 @@ nm_setting_ip_tunnel_class_init (NMSettingIPTunnelClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
NM_SETTING_PARAM_FUZZY_IGNORE |
|
NM_SETTING_PARAM_FUZZY_IGNORE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_IP_TUNNEL);
|
||||||
}
|
}
|
||||||
|
@@ -527,6 +527,7 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array_ip_config ();
|
||||||
|
|
||||||
g_type_class_add_private (setting_class, sizeof (NMSettingIP4ConfigPrivate));
|
g_type_class_add_private (setting_class, sizeof (NMSettingIP4ConfigPrivate));
|
||||||
|
|
||||||
@@ -534,8 +535,7 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_IP4_CONFIG];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/* ---ifcfg-rh---
|
/* ---ifcfg-rh---
|
||||||
* property: method
|
* property: method
|
||||||
@@ -795,11 +795,12 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *klass)
|
|||||||
* integers)
|
* integers)
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
_nm_setting_class_transform_property (setting_class,
|
_properties_override_add_transform (properties_override,
|
||||||
NM_SETTING_IP_CONFIG_DNS,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
G_VARIANT_TYPE ("au"),
|
NM_SETTING_IP_CONFIG_DNS),
|
||||||
ip4_dns_to_dbus,
|
G_VARIANT_TYPE ("au"),
|
||||||
ip4_dns_from_dbus);
|
ip4_dns_to_dbus,
|
||||||
|
ip4_dns_from_dbus);
|
||||||
|
|
||||||
/* ---dbus---
|
/* ---dbus---
|
||||||
* property: addresses
|
* property: addresses
|
||||||
@@ -816,18 +817,19 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *klass)
|
|||||||
* for that subnet.
|
* for that subnet.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
_nm_setting_class_override_property (setting_class,
|
_properties_override_add_override (properties_override,
|
||||||
NM_SETTING_IP_CONFIG_ADDRESSES,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
G_VARIANT_TYPE ("aau"),
|
NM_SETTING_IP_CONFIG_ADDRESSES),
|
||||||
ip4_addresses_get,
|
G_VARIANT_TYPE ("aau"),
|
||||||
ip4_addresses_set,
|
ip4_addresses_get,
|
||||||
NULL);
|
ip4_addresses_set,
|
||||||
|
NULL);
|
||||||
|
|
||||||
_nm_setting_class_add_dbus_only_property (setting_class,
|
_properties_override_add_dbus_only (properties_override,
|
||||||
"address-labels",
|
"address-labels",
|
||||||
G_VARIANT_TYPE_STRING_ARRAY,
|
G_VARIANT_TYPE_STRING_ARRAY,
|
||||||
ip4_address_labels_get,
|
ip4_address_labels_get,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
/* ---dbus---
|
/* ---dbus---
|
||||||
* property: address-data
|
* property: address-data
|
||||||
@@ -838,11 +840,11 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *klass)
|
|||||||
* also exist on some addresses.
|
* also exist on some addresses.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
_nm_setting_class_add_dbus_only_property (setting_class,
|
_properties_override_add_dbus_only (properties_override,
|
||||||
"address-data",
|
"address-data",
|
||||||
G_VARIANT_TYPE ("aa{sv}"),
|
G_VARIANT_TYPE ("aa{sv}"),
|
||||||
ip4_address_data_get,
|
ip4_address_data_get,
|
||||||
ip4_address_data_set);
|
ip4_address_data_set);
|
||||||
|
|
||||||
/* ---dbus---
|
/* ---dbus---
|
||||||
* property: routes
|
* property: routes
|
||||||
@@ -861,12 +863,13 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *klass)
|
|||||||
* property.)
|
* property.)
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
_nm_setting_class_override_property (setting_class,
|
_properties_override_add_override (properties_override,
|
||||||
NM_SETTING_IP_CONFIG_ROUTES,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
G_VARIANT_TYPE ("aau"),
|
NM_SETTING_IP_CONFIG_ROUTES),
|
||||||
ip4_routes_get,
|
G_VARIANT_TYPE ("aau"),
|
||||||
ip4_routes_set,
|
ip4_routes_get,
|
||||||
NULL);
|
ip4_routes_set,
|
||||||
|
NULL);
|
||||||
|
|
||||||
/* ---dbus---
|
/* ---dbus---
|
||||||
* property: route-data
|
* property: route-data
|
||||||
@@ -881,10 +884,12 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *klass)
|
|||||||
* also exist on some routes.
|
* also exist on some routes.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
_nm_setting_class_add_dbus_only_property (setting_class,
|
_properties_override_add_dbus_only (properties_override,
|
||||||
"route-data",
|
"route-data",
|
||||||
G_VARIANT_TYPE ("aa{sv}"),
|
G_VARIANT_TYPE ("aa{sv}"),
|
||||||
ip4_route_data_get,
|
ip4_route_data_get,
|
||||||
ip4_route_data_set);
|
ip4_route_data_set);
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_IP4_CONFIG,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -551,6 +551,7 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array_ip_config ();
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingIP6ConfigPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingIP6ConfigPrivate));
|
||||||
|
|
||||||
@@ -558,8 +559,7 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_IP6_CONFIG];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/* ---ifcfg-rh---
|
/* ---ifcfg-rh---
|
||||||
* property: method
|
* property: method
|
||||||
@@ -888,11 +888,12 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *klass)
|
|||||||
* description: Array of IP addresses of DNS servers (in network byte order)
|
* description: Array of IP addresses of DNS servers (in network byte order)
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
_nm_setting_class_transform_property (setting_class,
|
_properties_override_add_transform (properties_override,
|
||||||
NM_SETTING_IP_CONFIG_DNS,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
G_VARIANT_TYPE ("aay"),
|
NM_SETTING_IP_CONFIG_DNS),
|
||||||
ip6_dns_to_dbus,
|
G_VARIANT_TYPE ("aay"),
|
||||||
ip6_dns_from_dbus);
|
ip6_dns_to_dbus,
|
||||||
|
ip6_dns_from_dbus);
|
||||||
|
|
||||||
/* ---dbus---
|
/* ---dbus---
|
||||||
* property: addresses
|
* property: addresses
|
||||||
@@ -908,12 +909,13 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *klass)
|
|||||||
* that subnet.
|
* that subnet.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
_nm_setting_class_override_property (setting_class,
|
_properties_override_add_override (properties_override,
|
||||||
NM_SETTING_IP_CONFIG_ADDRESSES,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
G_VARIANT_TYPE ("a(ayuay)"),
|
NM_SETTING_IP_CONFIG_ADDRESSES),
|
||||||
ip6_addresses_get,
|
G_VARIANT_TYPE ("a(ayuay)"),
|
||||||
ip6_addresses_set,
|
ip6_addresses_get,
|
||||||
NULL);
|
ip6_addresses_set,
|
||||||
|
NULL);
|
||||||
|
|
||||||
/* ---dbus---
|
/* ---dbus---
|
||||||
* property: address-data
|
* property: address-data
|
||||||
@@ -924,11 +926,11 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *klass)
|
|||||||
* also exist on some addresses.
|
* also exist on some addresses.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
_nm_setting_class_add_dbus_only_property (setting_class,
|
_properties_override_add_dbus_only (properties_override,
|
||||||
"address-data",
|
"address-data",
|
||||||
G_VARIANT_TYPE ("aa{sv}"),
|
G_VARIANT_TYPE ("aa{sv}"),
|
||||||
ip6_address_data_get,
|
ip6_address_data_get,
|
||||||
ip6_address_data_set);
|
ip6_address_data_set);
|
||||||
|
|
||||||
/* ---dbus---
|
/* ---dbus---
|
||||||
* property: routes
|
* property: routes
|
||||||
@@ -944,12 +946,13 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *klass)
|
|||||||
* default metric for the device.
|
* default metric for the device.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
_nm_setting_class_override_property (setting_class,
|
_properties_override_add_override (properties_override,
|
||||||
NM_SETTING_IP_CONFIG_ROUTES,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
G_VARIANT_TYPE ("a(ayuayu)"),
|
NM_SETTING_IP_CONFIG_ROUTES),
|
||||||
ip6_routes_get,
|
G_VARIANT_TYPE ("a(ayuayu)"),
|
||||||
ip6_routes_set,
|
ip6_routes_get,
|
||||||
NULL);
|
ip6_routes_set,
|
||||||
|
NULL);
|
||||||
|
|
||||||
/* ---dbus---
|
/* ---dbus---
|
||||||
* property: route-data
|
* property: route-data
|
||||||
@@ -964,9 +967,12 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *klass)
|
|||||||
* also exist on some routes.
|
* also exist on some routes.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
_nm_setting_class_add_dbus_only_property (setting_class,
|
_properties_override_add_dbus_only (properties_override,
|
||||||
"route-data",
|
"route-data",
|
||||||
G_VARIANT_TYPE ("aa{sv}"),
|
G_VARIANT_TYPE ("aa{sv}"),
|
||||||
ip6_route_data_get,
|
ip6_route_data_get,
|
||||||
ip6_route_data_set);
|
ip6_route_data_set);
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_IP6_CONFIG,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -483,7 +483,6 @@ nm_setting_macsec_class_init (NMSettingMacsecClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_MACSEC];
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
setting_class->need_secrets = need_secrets;
|
setting_class->need_secrets = need_secrets;
|
||||||
|
|
||||||
@@ -627,4 +626,6 @@ nm_setting_macsec_class_init (NMSettingMacsecClass *klass)
|
|||||||
G_PARAM_STATIC_STRINGS);
|
G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_MACSEC);
|
||||||
}
|
}
|
||||||
|
@@ -269,8 +269,7 @@ nm_setting_macvlan_class_init (NMSettingMacvlanClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_MACVLAN];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingMacvlan:parent:
|
* NMSettingMacvlan:parent:
|
||||||
@@ -339,4 +338,6 @@ nm_setting_macvlan_class_init (NMSettingMacvlanClass *klass)
|
|||||||
G_PARAM_CONSTRUCT |
|
G_PARAM_CONSTRUCT |
|
||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_MACVLAN);
|
||||||
}
|
}
|
||||||
|
@@ -216,6 +216,7 @@ nm_setting_olpc_mesh_class_init (NMSettingOlpcMeshClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingOlpcMeshPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingOlpcMeshPrivate));
|
||||||
|
|
||||||
@@ -223,8 +224,7 @@ nm_setting_olpc_mesh_class_init (NMSettingOlpcMeshClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_OLPC_MESH];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingOlpcMesh:ssid:
|
* NMSettingOlpcMesh:ssid:
|
||||||
@@ -266,8 +266,14 @@ nm_setting_olpc_mesh_class_init (NMSettingOlpcMeshClass *klass)
|
|||||||
NULL,
|
NULL,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class, NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS,
|
|
||||||
G_VARIANT_TYPE_BYTESTRING,
|
_properties_override_add_transform (properties_override,
|
||||||
_nm_utils_hwaddr_to_dbus,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_utils_hwaddr_from_dbus);
|
NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS),
|
||||||
|
G_VARIANT_TYPE_BYTESTRING,
|
||||||
|
_nm_utils_hwaddr_to_dbus,
|
||||||
|
_nm_utils_hwaddr_from_dbus);
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_OLPC_MESH,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -271,8 +271,7 @@ nm_setting_ovs_bridge_class_init (NMSettingOvsBridgeClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_OVS_BRIDGE];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingOvsBridge:fail-mode:
|
* NMSettingOvsBridge:fail-mode:
|
||||||
@@ -334,4 +333,6 @@ nm_setting_ovs_bridge_class_init (NMSettingOvsBridgeClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_CONSTRUCT |
|
G_PARAM_CONSTRUCT |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_OVS_BRIDGE);
|
||||||
}
|
}
|
||||||
|
@@ -370,8 +370,7 @@ nm_setting_ovs_interface_class_init (NMSettingOvsInterfaceClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_OVS_INTERFACE];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingOvsInterface:type:
|
* NMSettingOvsInterface:type:
|
||||||
@@ -388,4 +387,6 @@ nm_setting_ovs_interface_class_init (NMSettingOvsInterfaceClass *klass)
|
|||||||
G_PARAM_CONSTRUCT |
|
G_PARAM_CONSTRUCT |
|
||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_OVS_INTERFACE);
|
||||||
}
|
}
|
||||||
|
@@ -189,8 +189,7 @@ nm_setting_ovs_patch_class_init (NMSettingOvsPatchClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_OVS_PATCH];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingOvsPatch:peer:
|
* NMSettingOvsPatch:peer:
|
||||||
@@ -208,4 +207,6 @@ nm_setting_ovs_patch_class_init (NMSettingOvsPatchClass *klass)
|
|||||||
G_PARAM_CONSTRUCT |
|
G_PARAM_CONSTRUCT |
|
||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_OVS_PATCH);
|
||||||
}
|
}
|
||||||
|
@@ -368,8 +368,7 @@ nm_setting_ovs_port_class_init (NMSettingOvsPortClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_OVS_PORT];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingOvsPort:vlan-mode:
|
* NMSettingOvsPort:vlan-mode:
|
||||||
@@ -467,4 +466,6 @@ nm_setting_ovs_port_class_init (NMSettingOvsPortClass *klass)
|
|||||||
G_PARAM_CONSTRUCT |
|
G_PARAM_CONSTRUCT |
|
||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_OVS_PORT);
|
||||||
}
|
}
|
||||||
|
@@ -533,8 +533,7 @@ nm_setting_ppp_class_init (NMSettingPppClass *klass)
|
|||||||
object_class->set_property = set_property;
|
object_class->set_property = set_property;
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_PPP];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingPpp:noauth:
|
* NMSettingPpp:noauth:
|
||||||
@@ -796,4 +795,6 @@ nm_setting_ppp_class_init (NMSettingPppClass *klass)
|
|||||||
G_PARAM_CONSTRUCT |
|
G_PARAM_CONSTRUCT |
|
||||||
NM_SETTING_PARAM_FUZZY_IGNORE |
|
NM_SETTING_PARAM_FUZZY_IGNORE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_PPP);
|
||||||
}
|
}
|
||||||
|
@@ -297,7 +297,6 @@ nm_setting_pppoe_class_init (NMSettingPppoeClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_PPPOE];
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
setting_class->need_secrets = need_secrets;
|
setting_class->need_secrets = need_secrets;
|
||||||
|
|
||||||
@@ -372,4 +371,6 @@ nm_setting_pppoe_class_init (NMSettingPppoeClass *klass)
|
|||||||
NM_SETTING_SECRET_FLAG_NONE,
|
NM_SETTING_SECRET_FLAG_NONE,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_PPPOE);
|
||||||
}
|
}
|
||||||
|
@@ -105,44 +105,69 @@ NMSetting *_nm_setting_new_from_dbus (GType setting_type,
|
|||||||
NMSettingParseFlags parse_flags,
|
NMSettingParseFlags parse_flags,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
typedef GVariant * (*NMSettingPropertyGetFunc) (NMSetting *setting,
|
/*****************************************************************************/
|
||||||
const char *property);
|
|
||||||
typedef GVariant * (*NMSettingPropertySynthFunc) (NMSetting *setting,
|
|
||||||
NMConnection *connection,
|
|
||||||
const char *property);
|
|
||||||
typedef gboolean (*NMSettingPropertySetFunc) (NMSetting *setting,
|
|
||||||
GVariant *connection_dict,
|
|
||||||
const char *property,
|
|
||||||
GVariant *value,
|
|
||||||
NMSettingParseFlags parse_flags,
|
|
||||||
GError **error);
|
|
||||||
typedef gboolean (*NMSettingPropertyNotSetFunc) (NMSetting *setting,
|
|
||||||
GVariant *connection_dict,
|
|
||||||
const char *property,
|
|
||||||
NMSettingParseFlags parse_flags,
|
|
||||||
GError **error);
|
|
||||||
|
|
||||||
void _nm_setting_class_add_dbus_only_property (NMSettingClass *setting_class,
|
static inline GArray *
|
||||||
const char *property_name,
|
_nm_sett_info_property_override_create_array (void)
|
||||||
const GVariantType *dbus_type,
|
{
|
||||||
NMSettingPropertySynthFunc synth_func,
|
return g_array_new (FALSE, FALSE, sizeof (NMSettInfoProperty));
|
||||||
NMSettingPropertySetFunc set_func);
|
}
|
||||||
|
|
||||||
void _nm_setting_class_override_property (NMSettingClass *setting_class,
|
GArray *_nm_sett_info_property_override_create_array_ip_config (void);
|
||||||
const char *property_name,
|
|
||||||
const GVariantType *dbus_type,
|
|
||||||
NMSettingPropertyGetFunc get_func,
|
|
||||||
NMSettingPropertySetFunc set_func,
|
|
||||||
NMSettingPropertyNotSetFunc not_set_func);
|
|
||||||
|
|
||||||
typedef GVariant * (*NMSettingPropertyTransformToFunc) (const GValue *from);
|
void _nm_setting_class_commit_full (NMSettingClass *setting_class,
|
||||||
typedef void (*NMSettingPropertyTransformFromFunc) (GVariant *from, GValue *to);
|
NMMetaSettingType meta_type,
|
||||||
|
const NMSettInfoSettDetail *detail,
|
||||||
|
GArray *properties_override);
|
||||||
|
|
||||||
void _nm_setting_class_transform_property (NMSettingClass *setting_class,
|
static inline void
|
||||||
const char *property_name,
|
_nm_setting_class_commit (NMSettingClass *setting_class,
|
||||||
const GVariantType *dbus_type,
|
NMMetaSettingType meta_type)
|
||||||
NMSettingPropertyTransformToFunc to_dbus,
|
{
|
||||||
NMSettingPropertyTransformFromFunc from_dbus);
|
_nm_setting_class_commit_full (setting_class, meta_type, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define NM_SETT_INFO_SETT_DETAIL(...) \
|
||||||
|
(&((const NMSettInfoSettDetail) { \
|
||||||
|
__VA_ARGS__ \
|
||||||
|
}))
|
||||||
|
|
||||||
|
#define NM_SETT_INFO_PROPERTY(...) \
|
||||||
|
(&((const NMSettInfoProperty) { \
|
||||||
|
__VA_ARGS__ \
|
||||||
|
}))
|
||||||
|
|
||||||
|
void _properties_override_add_struct (GArray *properties_override,
|
||||||
|
const NMSettInfoProperty *prop_info);
|
||||||
|
|
||||||
|
void _properties_override_add__helper (GArray *properties_override,
|
||||||
|
NMSettInfoProperty *prop_info);
|
||||||
|
|
||||||
|
#define _properties_override_add(properties_override, \
|
||||||
|
...) \
|
||||||
|
(_properties_override_add_struct (properties_override, \
|
||||||
|
NM_SETT_INFO_PROPERTY (__VA_ARGS__)))
|
||||||
|
|
||||||
|
void _properties_override_add_dbus_only (GArray *properties_override,
|
||||||
|
const char *property_name,
|
||||||
|
const GVariantType *dbus_type,
|
||||||
|
NMSettingPropertySynthFunc synth_func,
|
||||||
|
NMSettingPropertySetFunc set_func);
|
||||||
|
|
||||||
|
void _properties_override_add_override (GArray *properties_override,
|
||||||
|
GParamSpec *param_spec,
|
||||||
|
const GVariantType *dbus_type,
|
||||||
|
NMSettingPropertyGetFunc get_func,
|
||||||
|
NMSettingPropertySetFunc set_func,
|
||||||
|
NMSettingPropertyNotSetFunc not_set_func);
|
||||||
|
|
||||||
|
void _properties_override_add_transform (GArray *properties_override,
|
||||||
|
GParamSpec *param_spec,
|
||||||
|
const GVariantType *dbus_type,
|
||||||
|
NMSettingPropertyTransformToFunc to_dbus,
|
||||||
|
NMSettingPropertyTransformFromFunc from_dbus);
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
gboolean _nm_setting_use_legacy_property (NMSetting *setting,
|
gboolean _nm_setting_use_legacy_property (NMSetting *setting,
|
||||||
GVariant *connection_dict,
|
GVariant *connection_dict,
|
||||||
@@ -151,4 +176,6 @@ gboolean _nm_setting_use_legacy_property (NMSetting *setting,
|
|||||||
|
|
||||||
GPtrArray *_nm_setting_need_secrets (NMSetting *setting);
|
GPtrArray *_nm_setting_need_secrets (NMSetting *setting);
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
#endif /* NM_SETTING_PRIVATE_H */
|
#endif /* NM_SETTING_PRIVATE_H */
|
||||||
|
@@ -294,8 +294,7 @@ nm_setting_proxy_class_init (NMSettingProxyClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_PROXY];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingProxy:method:
|
* NMSettingProxy:method:
|
||||||
@@ -383,4 +382,6 @@ nm_setting_proxy_class_init (NMSettingProxyClass *klass)
|
|||||||
NULL,
|
NULL,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_PROXY);
|
||||||
}
|
}
|
||||||
|
@@ -240,14 +240,13 @@ nm_setting_serial_class_init (NMSettingSerialClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingSerialPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingSerialPrivate));
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
object_class->set_property = set_property;
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_SERIAL];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingSerial:baud:
|
* NMSettingSerial:baud:
|
||||||
*
|
*
|
||||||
@@ -304,11 +303,13 @@ nm_setting_serial_class_init (NMSettingSerialClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_CONSTRUCT |
|
G_PARAM_CONSTRUCT |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class,
|
|
||||||
NM_SETTING_SERIAL_PARITY,
|
_properties_override_add_transform (properties_override,
|
||||||
G_VARIANT_TYPE_BYTE,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
parity_to_dbus,
|
NM_SETTING_SERIAL_PARITY),
|
||||||
parity_from_dbus);
|
G_VARIANT_TYPE_BYTE,
|
||||||
|
parity_to_dbus,
|
||||||
|
parity_from_dbus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingSerial:stopbits:
|
* NMSettingSerial:stopbits:
|
||||||
@@ -336,4 +337,7 @@ nm_setting_serial_class_init (NMSettingSerialClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_CONSTRUCT |
|
G_PARAM_CONSTRUCT |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_SERIAL,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -1234,12 +1234,12 @@ nm_setting_sriov_class_init (NMSettingSriovClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->set_property = set_property;
|
object_class->set_property = set_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_SRIOV];
|
|
||||||
setting_class->compare_property = compare_property;
|
setting_class->compare_property = compare_property;
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
|
||||||
@@ -1308,12 +1308,13 @@ nm_setting_sriov_class_init (NMSettingSriovClass *klass)
|
|||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
_nm_setting_class_override_property (setting_class,
|
_properties_override_add_override (properties_override,
|
||||||
NM_SETTING_SRIOV_VFS,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
G_VARIANT_TYPE ("aa{sv}"),
|
NM_SETTING_SRIOV_VFS),
|
||||||
vfs_to_dbus,
|
G_VARIANT_TYPE ("aa{sv}"),
|
||||||
vfs_from_dbus,
|
vfs_to_dbus,
|
||||||
NULL);
|
vfs_from_dbus,
|
||||||
|
NULL);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingSriov:autoprobe-drivers
|
* NMSettingSriov:autoprobe-drivers
|
||||||
@@ -1350,4 +1351,7 @@ nm_setting_sriov_class_init (NMSettingSriovClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_CONSTRUCT |
|
G_PARAM_CONSTRUCT |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_SRIOV,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -1591,12 +1591,12 @@ nm_setting_tc_config_class_init (NMSettingTCConfigClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
object_class->set_property = set_property;
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_TC_CONFIG];
|
|
||||||
setting_class->compare_property = compare_property;
|
setting_class->compare_property = compare_property;
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
|
||||||
@@ -1620,12 +1620,13 @@ nm_setting_tc_config_class_init (NMSettingTCConfigClass *klass)
|
|||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
_nm_setting_class_override_property (setting_class,
|
_properties_override_add_override (properties_override,
|
||||||
NM_SETTING_TC_CONFIG_QDISCS,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
G_VARIANT_TYPE ("aa{sv}"),
|
NM_SETTING_TC_CONFIG_QDISCS),
|
||||||
tc_qdiscs_get,
|
G_VARIANT_TYPE ("aa{sv}"),
|
||||||
tc_qdiscs_set,
|
tc_qdiscs_get,
|
||||||
NULL);
|
tc_qdiscs_set,
|
||||||
|
NULL);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingTCConfig:tfilters: (type GPtrArray(NMTCTfilter))
|
* NMSettingTCConfig:tfilters: (type GPtrArray(NMTCTfilter))
|
||||||
@@ -1647,10 +1648,14 @@ nm_setting_tc_config_class_init (NMSettingTCConfigClass *klass)
|
|||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
_nm_setting_class_override_property (setting_class,
|
_properties_override_add_override (properties_override,
|
||||||
NM_SETTING_TC_CONFIG_TFILTERS,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
G_VARIANT_TYPE ("aa{sv}"),
|
NM_SETTING_TC_CONFIG_TFILTERS),
|
||||||
tc_tfilters_get,
|
G_VARIANT_TYPE ("aa{sv}"),
|
||||||
tc_tfilters_set,
|
tc_tfilters_get,
|
||||||
NULL);
|
tc_tfilters_set,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_TC_CONFIG,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -589,6 +589,7 @@ nm_setting_team_port_class_init (NMSettingTeamPortClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingTeamPortPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingTeamPortPrivate));
|
||||||
|
|
||||||
@@ -596,7 +597,6 @@ nm_setting_team_port_class_init (NMSettingTeamPortClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_TEAM_PORT];
|
|
||||||
setting_class->compare_property = compare_property;
|
setting_class->compare_property = compare_property;
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
|
||||||
@@ -713,10 +713,14 @@ nm_setting_team_port_class_init (NMSettingTeamPortClass *klass)
|
|||||||
G_TYPE_PTR_ARRAY,
|
G_TYPE_PTR_ARRAY,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class,
|
|
||||||
NM_SETTING_TEAM_PORT_LINK_WATCHERS,
|
|
||||||
G_VARIANT_TYPE ("aa{sv}"),
|
|
||||||
team_link_watchers_to_dbus,
|
|
||||||
team_link_watchers_from_dbus);
|
|
||||||
|
|
||||||
|
_properties_override_add_transform (properties_override,
|
||||||
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
|
NM_SETTING_TEAM_PORT_LINK_WATCHERS),
|
||||||
|
G_VARIANT_TYPE ("aa{sv}"),
|
||||||
|
team_link_watchers_to_dbus,
|
||||||
|
team_link_watchers_from_dbus);
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_TEAM_PORT,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -1560,6 +1560,7 @@ nm_setting_team_class_init (NMSettingTeamClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingTeamPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingTeamPrivate));
|
||||||
|
|
||||||
@@ -1567,7 +1568,6 @@ nm_setting_team_class_init (NMSettingTeamClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_TEAM];
|
|
||||||
setting_class->compare_property = compare_property;
|
setting_class->compare_property = compare_property;
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
|
||||||
@@ -1816,11 +1816,13 @@ nm_setting_team_class_init (NMSettingTeamClass *klass)
|
|||||||
G_TYPE_PTR_ARRAY,
|
G_TYPE_PTR_ARRAY,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class,
|
|
||||||
NM_SETTING_TEAM_LINK_WATCHERS,
|
_properties_override_add_transform (properties_override,
|
||||||
G_VARIANT_TYPE ("aa{sv}"),
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
team_link_watchers_to_dbus,
|
NM_SETTING_TEAM_LINK_WATCHERS),
|
||||||
team_link_watchers_from_dbus);
|
G_VARIANT_TYPE ("aa{sv}"),
|
||||||
|
team_link_watchers_to_dbus,
|
||||||
|
team_link_watchers_from_dbus);
|
||||||
|
|
||||||
/* ---dbus---
|
/* ---dbus---
|
||||||
* property: interface-name
|
* property: interface-name
|
||||||
@@ -1830,8 +1832,12 @@ nm_setting_team_class_init (NMSettingTeamClass *klass)
|
|||||||
* team's interface name.
|
* team's interface name.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
_nm_setting_class_add_dbus_only_property (setting_class, "interface-name",
|
_properties_override_add_dbus_only (properties_override,
|
||||||
G_VARIANT_TYPE_STRING,
|
"interface-name",
|
||||||
_nm_setting_get_deprecated_virtual_interface_name,
|
G_VARIANT_TYPE_STRING,
|
||||||
NULL);
|
_nm_setting_get_deprecated_virtual_interface_name,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_TEAM,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -301,8 +301,7 @@ nm_setting_tun_class_init (NMSettingTunClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_TUN];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingTun:mode:
|
* NMSettingTun:mode:
|
||||||
@@ -404,4 +403,6 @@ nm_setting_tun_class_init (NMSettingTunClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_TUN);
|
||||||
}
|
}
|
||||||
|
@@ -547,12 +547,12 @@ nm_setting_user_class_init (NMSettingUserClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
object_class->set_property = set_property;
|
object_class->set_property = set_property;
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_USER];
|
|
||||||
setting_class->compare_property = compare_property;
|
setting_class->compare_property = compare_property;
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
|
|
||||||
@@ -585,8 +585,13 @@ nm_setting_user_class_init (NMSettingUserClass *klass)
|
|||||||
|
|
||||||
g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||||
|
|
||||||
_nm_setting_class_transform_property (setting_class, NM_SETTING_USER_DATA,
|
_properties_override_add_transform (properties_override,
|
||||||
G_VARIANT_TYPE ("a{ss}"),
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_utils_strdict_to_dbus,
|
NM_SETTING_USER_DATA),
|
||||||
_nm_utils_strdict_from_dbus);
|
G_VARIANT_TYPE ("a{ss}"),
|
||||||
|
_nm_utils_strdict_to_dbus,
|
||||||
|
_nm_utils_strdict_from_dbus);
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_USER,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -833,6 +833,7 @@ nm_setting_vlan_class_init (NMSettingVlanClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingVlanPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingVlanPrivate));
|
||||||
|
|
||||||
@@ -840,8 +841,7 @@ nm_setting_vlan_class_init (NMSettingVlanClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_VLAN];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingVlan:parent:
|
* NMSettingVlan:parent:
|
||||||
@@ -918,11 +918,14 @@ nm_setting_vlan_class_init (NMSettingVlanClass *klass)
|
|||||||
G_PARAM_CONSTRUCT |
|
G_PARAM_CONSTRUCT |
|
||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_override_property (setting_class, NM_SETTING_VLAN_FLAGS,
|
|
||||||
NULL,
|
_properties_override_add_override (properties_override,
|
||||||
_override_flags_get,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
NULL,
|
NM_SETTING_VLAN_FLAGS),
|
||||||
_override_flags_not_set);
|
NULL,
|
||||||
|
_override_flags_get,
|
||||||
|
NULL,
|
||||||
|
_override_flags_not_set);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingVlan:ingress-priority-map:
|
* NMSettingVlan:ingress-priority-map:
|
||||||
@@ -984,8 +987,12 @@ nm_setting_vlan_class_init (NMSettingVlanClass *klass)
|
|||||||
* vlan's interface name.
|
* vlan's interface name.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
_nm_setting_class_add_dbus_only_property (setting_class, "interface-name",
|
_properties_override_add_dbus_only (properties_override,
|
||||||
G_VARIANT_TYPE_STRING,
|
"interface-name",
|
||||||
_nm_setting_get_deprecated_virtual_interface_name,
|
G_VARIANT_TYPE_STRING,
|
||||||
NULL);
|
_nm_setting_get_deprecated_virtual_interface_name,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_VLAN,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -891,6 +891,7 @@ nm_setting_vpn_class_init (NMSettingVpnClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingVpnPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingVpnPrivate));
|
||||||
|
|
||||||
@@ -898,7 +899,6 @@ nm_setting_vpn_class_init (NMSettingVpnClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_VPN];
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
setting_class->update_one_secret = update_one_secret;
|
setting_class->update_one_secret = update_one_secret;
|
||||||
setting_class->get_secret_flags = get_secret_flags;
|
setting_class->get_secret_flags = get_secret_flags;
|
||||||
@@ -972,10 +972,13 @@ nm_setting_vpn_class_init (NMSettingVpnClass *klass)
|
|||||||
G_TYPE_HASH_TABLE,
|
G_TYPE_HASH_TABLE,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class, NM_SETTING_VPN_DATA,
|
|
||||||
G_VARIANT_TYPE ("a{ss}"),
|
_properties_override_add_transform (properties_override,
|
||||||
_nm_utils_strdict_to_dbus,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_utils_strdict_from_dbus);
|
NM_SETTING_VPN_DATA),
|
||||||
|
G_VARIANT_TYPE ("a{ss}"),
|
||||||
|
_nm_utils_strdict_to_dbus,
|
||||||
|
_nm_utils_strdict_from_dbus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingVpn:secrets: (type GHashTable(utf8,utf8)):
|
* NMSettingVpn:secrets: (type GHashTable(utf8,utf8)):
|
||||||
@@ -998,10 +1001,13 @@ nm_setting_vpn_class_init (NMSettingVpnClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
NM_SETTING_PARAM_SECRET |
|
NM_SETTING_PARAM_SECRET |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class, NM_SETTING_VPN_SECRETS,
|
|
||||||
G_VARIANT_TYPE ("a{ss}"),
|
_properties_override_add_transform (properties_override,
|
||||||
_nm_utils_strdict_to_dbus,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_utils_strdict_from_dbus);
|
NM_SETTING_VPN_SECRETS),
|
||||||
|
G_VARIANT_TYPE ("a{ss}"),
|
||||||
|
_nm_utils_strdict_to_dbus,
|
||||||
|
_nm_utils_strdict_from_dbus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingVpn:timeout:
|
* NMSettingVpn:timeout:
|
||||||
@@ -1020,4 +1026,7 @@ nm_setting_vpn_class_init (NMSettingVpnClass *klass)
|
|||||||
0, G_MAXUINT32, 0,
|
0, G_MAXUINT32, 0,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_VPN,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -574,8 +574,7 @@ nm_setting_vxlan_class_init (NMSettingVxlanClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_VXLAN];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingVxlan:parent:
|
* NMSettingVxlan:parent:
|
||||||
@@ -837,4 +836,6 @@ nm_setting_vxlan_class_init (NMSettingVxlanClass *klass)
|
|||||||
G_PARAM_CONSTRUCT |
|
G_PARAM_CONSTRUCT |
|
||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_VXLAN);
|
||||||
}
|
}
|
||||||
|
@@ -209,6 +209,7 @@ nm_setting_wimax_class_init (NMSettingWimaxClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingWimaxPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingWimaxPrivate));
|
||||||
|
|
||||||
@@ -216,8 +217,7 @@ nm_setting_wimax_class_init (NMSettingWimaxClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_WIMAX];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWimax:network-name:
|
* NMSettingWimax:network-name:
|
||||||
@@ -249,8 +249,14 @@ nm_setting_wimax_class_init (NMSettingWimaxClass *klass)
|
|||||||
NULL,
|
NULL,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class, NM_SETTING_WIMAX_MAC_ADDRESS,
|
|
||||||
G_VARIANT_TYPE_BYTESTRING,
|
_properties_override_add_transform (properties_override,
|
||||||
_nm_utils_hwaddr_to_dbus,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_utils_hwaddr_from_dbus);
|
NM_SETTING_WIMAX_MAC_ADDRESS),
|
||||||
|
G_VARIANT_TYPE_BYTESTRING,
|
||||||
|
_nm_utils_hwaddr_to_dbus,
|
||||||
|
_nm_utils_hwaddr_from_dbus);
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_WIMAX,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -980,6 +980,7 @@ nm_setting_wired_class_init (NMSettingWiredClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingWiredPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingWiredPrivate));
|
||||||
|
|
||||||
@@ -987,7 +988,6 @@ nm_setting_wired_class_init (NMSettingWiredClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_WIRED];
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
setting_class->compare_property = compare_property;
|
setting_class->compare_property = compare_property;
|
||||||
|
|
||||||
@@ -1101,12 +1101,14 @@ nm_setting_wired_class_init (NMSettingWiredClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_CONSTRUCT |
|
G_PARAM_CONSTRUCT |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_override_property (setting_class,
|
|
||||||
NM_SETTING_WIRED_AUTO_NEGOTIATE,
|
_properties_override_add_override (properties_override,
|
||||||
G_VARIANT_TYPE_BOOLEAN,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_override_autoneg_get,
|
NM_SETTING_WIRED_AUTO_NEGOTIATE),
|
||||||
NULL,
|
G_VARIANT_TYPE_BOOLEAN,
|
||||||
NULL);
|
_override_autoneg_get,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWired:mac-address:
|
* NMSettingWired:mac-address:
|
||||||
@@ -1139,10 +1141,13 @@ nm_setting_wired_class_init (NMSettingWiredClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class, NM_SETTING_WIRED_MAC_ADDRESS,
|
|
||||||
G_VARIANT_TYPE_BYTESTRING,
|
_properties_override_add_transform (properties_override,
|
||||||
_nm_utils_hwaddr_to_dbus,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_utils_hwaddr_from_dbus);
|
NM_SETTING_WIRED_MAC_ADDRESS),
|
||||||
|
G_VARIANT_TYPE_BYTESTRING,
|
||||||
|
_nm_utils_hwaddr_to_dbus,
|
||||||
|
_nm_utils_hwaddr_from_dbus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWired:cloned-mac-address:
|
* NMSettingWired:cloned-mac-address:
|
||||||
@@ -1194,8 +1199,10 @@ nm_setting_wired_class_init (NMSettingWiredClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_override_property (setting_class,
|
|
||||||
NM_SETTING_WIRED_CLONED_MAC_ADDRESS,
|
_properties_override_add_override (properties_override,
|
||||||
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
|
NM_SETTING_WIRED_CLONED_MAC_ADDRESS),
|
||||||
G_VARIANT_TYPE_BYTESTRING,
|
G_VARIANT_TYPE_BYTESTRING,
|
||||||
_nm_utils_hwaddr_cloned_get,
|
_nm_utils_hwaddr_cloned_get,
|
||||||
_nm_utils_hwaddr_cloned_set,
|
_nm_utils_hwaddr_cloned_set,
|
||||||
@@ -1213,11 +1220,11 @@ nm_setting_wired_class_init (NMSettingWiredClass *klass)
|
|||||||
* "cloned-mac-address".
|
* "cloned-mac-address".
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
_nm_setting_class_add_dbus_only_property (setting_class,
|
_properties_override_add_dbus_only (properties_override,
|
||||||
"assigned-mac-address",
|
"assigned-mac-address",
|
||||||
G_VARIANT_TYPE_STRING,
|
G_VARIANT_TYPE_STRING,
|
||||||
_nm_utils_hwaddr_cloned_data_synth,
|
_nm_utils_hwaddr_cloned_data_synth,
|
||||||
_nm_utils_hwaddr_cloned_data_set);
|
_nm_utils_hwaddr_cloned_data_set);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWired:generate-mac-address-mask:
|
* NMSettingWired:generate-mac-address-mask:
|
||||||
@@ -1387,10 +1394,13 @@ nm_setting_wired_class_init (NMSettingWiredClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
NM_SETTING_PARAM_INFERRABLE |
|
NM_SETTING_PARAM_INFERRABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class, NM_SETTING_WIRED_S390_OPTIONS,
|
|
||||||
G_VARIANT_TYPE ("a{ss}"),
|
_properties_override_add_transform (properties_override,
|
||||||
_nm_utils_strdict_to_dbus,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_utils_strdict_from_dbus);
|
NM_SETTING_WIRED_S390_OPTIONS),
|
||||||
|
G_VARIANT_TYPE ("a{ss}"),
|
||||||
|
_nm_utils_strdict_to_dbus,
|
||||||
|
_nm_utils_strdict_from_dbus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWired:wake-on-lan:
|
* NMSettingWired:wake-on-lan:
|
||||||
@@ -1429,4 +1439,7 @@ nm_setting_wired_class_init (NMSettingWiredClass *klass)
|
|||||||
NULL,
|
NULL,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_WIRED,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -1433,6 +1433,7 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingWirelessSecurityPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingWirelessSecurityPrivate));
|
||||||
|
|
||||||
@@ -1440,7 +1441,6 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_WIRELESS_SECURITY];
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
setting_class->verify_secrets = verify_secrets;
|
setting_class->verify_secrets = verify_secrets;
|
||||||
setting_class->need_secrets = need_secrets;
|
setting_class->need_secrets = need_secrets;
|
||||||
@@ -1853,11 +1853,13 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *klass)
|
|||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_CONSTRUCT |
|
G_PARAM_CONSTRUCT |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class,
|
|
||||||
NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE,
|
_properties_override_add_transform (properties_override,
|
||||||
G_VARIANT_TYPE_UINT32,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
wep_key_type_to_dbus,
|
NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE),
|
||||||
NULL);
|
G_VARIANT_TYPE_UINT32,
|
||||||
|
wep_key_type_to_dbus,
|
||||||
|
NULL);
|
||||||
/**
|
/**
|
||||||
* NMSettingWirelessSecurity:wps-method:
|
* NMSettingWirelessSecurity:wps-method:
|
||||||
*
|
*
|
||||||
@@ -1919,4 +1921,7 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *klass)
|
|||||||
G_PARAM_CONSTRUCT |
|
G_PARAM_CONSTRUCT |
|
||||||
NM_SETTING_PARAM_FUZZY_IGNORE |
|
NM_SETTING_PARAM_FUZZY_IGNORE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_WIRELESS_SECURITY,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -1178,6 +1178,7 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
NMSettingClass *setting_class = NM_SETTING_CLASS (klass);
|
||||||
|
GArray *properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (NMSettingWirelessPrivate));
|
g_type_class_add_private (klass, sizeof (NMSettingWirelessPrivate));
|
||||||
|
|
||||||
@@ -1185,7 +1186,6 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_WIRELESS];
|
|
||||||
setting_class->verify = verify;
|
setting_class->verify = verify;
|
||||||
setting_class->compare_property = compare_property;
|
setting_class->compare_property = compare_property;
|
||||||
|
|
||||||
@@ -1306,10 +1306,13 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *klass)
|
|||||||
NULL,
|
NULL,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class, NM_SETTING_WIRELESS_BSSID,
|
|
||||||
G_VARIANT_TYPE_BYTESTRING,
|
_properties_override_add_transform (properties_override,
|
||||||
_nm_utils_hwaddr_to_dbus,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_utils_hwaddr_from_dbus);
|
NM_SETTING_WIRELESS_BSSID),
|
||||||
|
G_VARIANT_TYPE_BYTESTRING,
|
||||||
|
_nm_utils_hwaddr_to_dbus,
|
||||||
|
_nm_utils_hwaddr_from_dbus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWireless:rate:
|
* NMSettingWireless:rate:
|
||||||
@@ -1386,10 +1389,13 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *klass)
|
|||||||
NULL,
|
NULL,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_transform_property (setting_class, NM_SETTING_WIRELESS_MAC_ADDRESS,
|
|
||||||
G_VARIANT_TYPE_BYTESTRING,
|
_properties_override_add_transform (properties_override,
|
||||||
_nm_utils_hwaddr_to_dbus,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_utils_hwaddr_from_dbus);
|
NM_SETTING_WIRELESS_MAC_ADDRESS),
|
||||||
|
G_VARIANT_TYPE_BYTESTRING,
|
||||||
|
_nm_utils_hwaddr_to_dbus,
|
||||||
|
_nm_utils_hwaddr_from_dbus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWireless:cloned-mac-address:
|
* NMSettingWireless:cloned-mac-address:
|
||||||
@@ -1439,12 +1445,14 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *klass)
|
|||||||
NULL,
|
NULL,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
_nm_setting_class_override_property (setting_class,
|
|
||||||
NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS,
|
_properties_override_add_override (properties_override,
|
||||||
G_VARIANT_TYPE_BYTESTRING,
|
g_object_class_find_property (G_OBJECT_CLASS (setting_class),
|
||||||
_nm_utils_hwaddr_cloned_get,
|
NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS),
|
||||||
_nm_utils_hwaddr_cloned_set,
|
G_VARIANT_TYPE_BYTESTRING,
|
||||||
_nm_utils_hwaddr_cloned_not_set);
|
_nm_utils_hwaddr_cloned_get,
|
||||||
|
_nm_utils_hwaddr_cloned_set,
|
||||||
|
_nm_utils_hwaddr_cloned_not_set);
|
||||||
|
|
||||||
/* ---dbus---
|
/* ---dbus---
|
||||||
* property: assigned-mac-address
|
* property: assigned-mac-address
|
||||||
@@ -1458,11 +1466,11 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *klass)
|
|||||||
* "cloned-mac-address".
|
* "cloned-mac-address".
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
_nm_setting_class_add_dbus_only_property (setting_class,
|
_properties_override_add_dbus_only (properties_override,
|
||||||
"assigned-mac-address",
|
"assigned-mac-address",
|
||||||
G_VARIANT_TYPE_STRING,
|
G_VARIANT_TYPE_STRING,
|
||||||
_nm_utils_hwaddr_cloned_data_synth,
|
_nm_utils_hwaddr_cloned_data_synth,
|
||||||
_nm_utils_hwaddr_cloned_data_set);
|
_nm_utils_hwaddr_cloned_data_set);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWireless:generate-mac-address-mask:
|
* NMSettingWireless:generate-mac-address-mask:
|
||||||
@@ -1677,9 +1685,11 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *klass)
|
|||||||
* NetworkManager daemons.
|
* NetworkManager daemons.
|
||||||
* ---end---
|
* ---end---
|
||||||
*/
|
*/
|
||||||
_nm_setting_class_add_dbus_only_property (setting_class, "security",
|
_properties_override_add_dbus_only (properties_override,
|
||||||
G_VARIANT_TYPE_STRING,
|
"security",
|
||||||
nm_setting_wireless_get_security, NULL);
|
G_VARIANT_TYPE_STRING,
|
||||||
|
nm_setting_wireless_get_security,
|
||||||
|
NULL);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWireless:wake-on-wlan:
|
* NMSettingWireless:wake-on-wlan:
|
||||||
@@ -1706,4 +1716,7 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *klass)
|
|||||||
G_PARAM_CONSTRUCT |
|
G_PARAM_CONSTRUCT |
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit_full (setting_class, NM_META_SETTING_TYPE_WIRELESS,
|
||||||
|
NULL, properties_override);
|
||||||
}
|
}
|
||||||
|
@@ -224,8 +224,7 @@ nm_setting_wpan_class_init (NMSettingWpanClass *klass)
|
|||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->finalize = finalize;
|
object_class->finalize = finalize;
|
||||||
|
|
||||||
setting_class->setting_info = &nm_meta_setting_infos[NM_META_SETTING_TYPE_WPAN];
|
setting_class->verify = verify;
|
||||||
setting_class->verify = verify;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingWpan:mac-address:
|
* NMSettingWpan:mac-address:
|
||||||
@@ -270,4 +269,6 @@ nm_setting_wpan_class_init (NMSettingWpanClass *klass)
|
|||||||
0, G_MAXUINT16, G_MAXUINT16,
|
0, G_MAXUINT16, G_MAXUINT16,
|
||||||
G_PARAM_READWRITE |
|
G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
_nm_setting_class_commit (setting_class, NM_META_SETTING_TYPE_WPAN);
|
||||||
}
|
}
|
||||||
|
@@ -191,90 +191,53 @@ _nm_setting_slave_type_is_valid (const char *slave_type, const char **out_port_t
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct {
|
static const NMSettInfoProperty *
|
||||||
const char *name;
|
_nm_sett_info_property_find_in_array (const NMSettInfoProperty *properties, guint len, const char *name)
|
||||||
GParamSpec *param_spec;
|
|
||||||
const GVariantType *dbus_type;
|
|
||||||
|
|
||||||
NMSettingPropertyGetFunc get_func;
|
|
||||||
NMSettingPropertySynthFunc synth_func;
|
|
||||||
NMSettingPropertySetFunc set_func;
|
|
||||||
NMSettingPropertyNotSetFunc not_set_func;
|
|
||||||
|
|
||||||
NMSettingPropertyTransformToFunc to_dbus;
|
|
||||||
NMSettingPropertyTransformFromFunc from_dbus;
|
|
||||||
} NMSettingProperty;
|
|
||||||
|
|
||||||
static NM_CACHED_QUARK_FCN ("nm-setting-property-overrides", setting_property_overrides_quark)
|
|
||||||
static NM_CACHED_QUARK_FCN ("nm-setting-properties", setting_properties_quark)
|
|
||||||
|
|
||||||
static NMSettingProperty *
|
|
||||||
find_property (GArray *properties, const char *name)
|
|
||||||
{
|
{
|
||||||
NMSettingProperty *property;
|
guint i;
|
||||||
int i;
|
|
||||||
|
|
||||||
if (!properties)
|
for (i = 0; i < len; i++) {
|
||||||
return NULL;
|
if (nm_streq (name, properties[i].name))
|
||||||
|
return &properties[i];
|
||||||
for (i = 0; i < properties->len; i++) {
|
|
||||||
property = &g_array_index (properties, NMSettingProperty, i);
|
|
||||||
if (strcmp (name, property->name) == 0)
|
|
||||||
return property;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
add_property_override (NMSettingClass *setting_class,
|
_properties_override_add_struct (GArray *properties_override,
|
||||||
const char *property_name,
|
const NMSettInfoProperty *prop_info)
|
||||||
GParamSpec *param_spec,
|
|
||||||
const GVariantType *dbus_type,
|
|
||||||
NMSettingPropertyGetFunc get_func,
|
|
||||||
NMSettingPropertySynthFunc synth_func,
|
|
||||||
NMSettingPropertySetFunc set_func,
|
|
||||||
NMSettingPropertyNotSetFunc not_set_func,
|
|
||||||
NMSettingPropertyTransformToFunc to_dbus,
|
|
||||||
NMSettingPropertyTransformFromFunc from_dbus)
|
|
||||||
{
|
{
|
||||||
GType setting_type = G_TYPE_FROM_CLASS (setting_class);
|
nm_assert (properties_override);
|
||||||
GArray *overrides;
|
nm_assert (prop_info);
|
||||||
NMSettingProperty override;
|
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));
|
||||||
|
nm_assert (!_nm_sett_info_property_find_in_array ((NMSettInfoProperty *) properties_override->data,
|
||||||
|
properties_override->len,
|
||||||
|
prop_info->name ?: prop_info->param_spec->name));
|
||||||
|
|
||||||
g_return_if_fail (g_type_get_qdata (setting_type, setting_properties_quark ()) == NULL);
|
nm_assert (!prop_info->from_dbus || prop_info->dbus_type);
|
||||||
|
nm_assert (!prop_info->set_func || prop_info->dbus_type);
|
||||||
|
|
||||||
memset (&override, 0, sizeof (override));
|
g_array_append_vals (properties_override, prop_info, 1);
|
||||||
override.name = property_name;
|
|
||||||
override.param_spec = param_spec;
|
|
||||||
override.dbus_type = dbus_type;
|
|
||||||
override.get_func = get_func;
|
|
||||||
override.synth_func = synth_func;
|
|
||||||
override.set_func = set_func;
|
|
||||||
override.not_set_func = not_set_func;
|
|
||||||
override.to_dbus = to_dbus;
|
|
||||||
override.from_dbus = from_dbus;
|
|
||||||
|
|
||||||
overrides = g_type_get_qdata (setting_type, setting_property_overrides_quark ());
|
if (!prop_info->name) {
|
||||||
if (!overrides) {
|
/* for convenience, allow omitting "name" if "param_spec" is given. */
|
||||||
overrides = g_array_new (FALSE, FALSE, sizeof (NMSettingProperty));
|
g_array_index (properties_override,
|
||||||
g_type_set_qdata (setting_type, setting_property_overrides_quark (), overrides);
|
NMSettInfoProperty,
|
||||||
|
properties_override->len - 1).name = prop_info->param_spec->name;
|
||||||
}
|
}
|
||||||
g_return_if_fail (find_property (overrides, property_name) == NULL);
|
|
||||||
|
|
||||||
g_array_append_val (overrides, override);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* _nm_setting_class_add_dbus_only_property:
|
* _properties_override_add_dbus_only:
|
||||||
* @setting_class: the setting class
|
* @properties_override: an array collecting the overrides
|
||||||
* @property_name: the name of the property to override
|
* @property_name: the name of the property to override
|
||||||
* @dbus_type: the type of the property (in its D-Bus representation)
|
* @dbus_type: the type of the property (in its D-Bus representation)
|
||||||
* @synth_func: (allow-none): function to call to synthesize a value for the property
|
* @synth_func: (allow-none): function to call to synthesize a value for the property
|
||||||
* @set_func: (allow-none): function to call to set the value of the property
|
* @set_func: (allow-none): function to call to set the value of the property
|
||||||
*
|
*
|
||||||
* Registers a property named @property_name, which will be used in the D-Bus
|
* Registers a property named @property_name, which will be used in the D-Bus
|
||||||
* serialization of objects of @setting_class, but which does not correspond to
|
* serialization of objects of this setting type, but which does not correspond to
|
||||||
* a #GObject property.
|
* a #GObject property.
|
||||||
*
|
*
|
||||||
* When serializing a setting to D-Bus, @synth_func will be called to synthesize
|
* When serializing a setting to D-Bus, @synth_func will be called to synthesize
|
||||||
@@ -287,35 +250,30 @@ add_property_override (NMSettingClass *setting_class,
|
|||||||
* then the property will be ignored when deserializing.)
|
* then the property will be ignored when deserializing.)
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
_nm_setting_class_add_dbus_only_property (NMSettingClass *setting_class,
|
_properties_override_add_dbus_only (GArray *properties_override,
|
||||||
const char *property_name,
|
const char *property_name,
|
||||||
const GVariantType *dbus_type,
|
const GVariantType *dbus_type,
|
||||||
NMSettingPropertySynthFunc synth_func,
|
NMSettingPropertySynthFunc synth_func,
|
||||||
NMSettingPropertySetFunc set_func)
|
NMSettingPropertySetFunc set_func)
|
||||||
{
|
{
|
||||||
g_return_if_fail (NM_IS_SETTING_CLASS (setting_class));
|
_properties_override_add (properties_override,
|
||||||
g_return_if_fail (property_name != NULL);
|
.name = property_name,
|
||||||
|
.dbus_type = dbus_type,
|
||||||
/* Must not match any GObject property. */
|
.synth_func = synth_func,
|
||||||
g_return_if_fail (!g_object_class_find_property (G_OBJECT_CLASS (setting_class), property_name));
|
.set_func = set_func);
|
||||||
|
|
||||||
add_property_override (setting_class,
|
|
||||||
property_name, NULL, dbus_type,
|
|
||||||
NULL, synth_func, set_func, NULL,
|
|
||||||
NULL, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* _nm_setting_class_override_property:
|
* _properties_override_add_override:
|
||||||
* @setting_class: the setting class
|
* @properties_override: an array collecting the overrides
|
||||||
* @property_name: the name of the property to override
|
* @param_spec: the name of the property to override
|
||||||
* @dbus_type: the type of the property (in its D-Bus representation)
|
* @dbus_type: the type of the property (in its D-Bus representation)
|
||||||
* @get_func: (allow-none): function to call to get the value of the property
|
* @get_func: (allow-none): function to call to get the value of the property
|
||||||
* @set_func: (allow-none): function to call to set the value of the property
|
* @set_func: (allow-none): function to call to set the value of the property
|
||||||
* @not_set_func: (allow-none): function to call to indicate the property was not set
|
* @not_set_func: (allow-none): function to call to indicate the property was not set
|
||||||
*
|
*
|
||||||
* Overrides the D-Bus representation of the #GObject property named
|
* Overrides the D-Bus representation of the #GObject property that shares the
|
||||||
* @property_name on @setting_class.
|
* same name as @param_spec.
|
||||||
*
|
*
|
||||||
* When serializing a setting to D-Bus, if @get_func is non-%NULL, then it will
|
* When serializing a setting to D-Bus, if @get_func is non-%NULL, then it will
|
||||||
* be called to get the property's value. If it returns a #GVariant, the
|
* be called to get the property's value. If it returns a #GVariant, the
|
||||||
@@ -324,38 +282,38 @@ _nm_setting_class_add_dbus_only_property (NMSettingClass *setting_class,
|
|||||||
* with g_object_get_property(), and added to the hash if it is not the default
|
* with g_object_get_property(), and added to the hash if it is not the default
|
||||||
* value.)
|
* value.)
|
||||||
*
|
*
|
||||||
* When deserializing a D-Bus representation into a setting, if @property_name
|
* When deserializing a D-Bus representation into a setting, if a value with
|
||||||
* is present, then @set_func will be called to set it. (If @set_func is %NULL
|
* the name of @param_spec is present, then @set_func will be called to set it.
|
||||||
* then the property will be set normally with g_object_set_property().)
|
* (If @set_func is %NULL then the property will be set normally with
|
||||||
|
* g_object_set_property().)
|
||||||
*
|
*
|
||||||
* If @not_set_func is non-%NULL, then it will be called when deserializing a
|
* If @not_set_func is non-%NULL, then it will be called when deserializing a
|
||||||
* representation that does NOT contain @property_name. This can be used, eg, if
|
* representation that does NOT contain a value for the property. This can be used,
|
||||||
* a new property needs to be initialized from some older deprecated property
|
* eg, if a new property needs to be initialized from some older deprecated property
|
||||||
* when it is not present.
|
* when it is not present.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
_nm_setting_class_override_property (NMSettingClass *setting_class,
|
_properties_override_add_override (GArray *properties_override,
|
||||||
const char *property_name,
|
GParamSpec *param_spec,
|
||||||
const GVariantType *dbus_type,
|
const GVariantType *dbus_type,
|
||||||
NMSettingPropertyGetFunc get_func,
|
NMSettingPropertyGetFunc get_func,
|
||||||
NMSettingPropertySetFunc set_func,
|
NMSettingPropertySetFunc set_func,
|
||||||
NMSettingPropertyNotSetFunc not_set_func)
|
NMSettingPropertyNotSetFunc not_set_func)
|
||||||
{
|
{
|
||||||
GParamSpec *param_spec;
|
nm_assert (param_spec);
|
||||||
|
|
||||||
param_spec = g_object_class_find_property (G_OBJECT_CLASS (setting_class), property_name);
|
_properties_override_add (properties_override,
|
||||||
g_return_if_fail (param_spec != NULL);
|
.param_spec = param_spec,
|
||||||
|
.dbus_type = dbus_type,
|
||||||
add_property_override (setting_class,
|
.get_func = get_func,
|
||||||
property_name, param_spec, dbus_type,
|
.set_func = set_func,
|
||||||
get_func, NULL, set_func, not_set_func,
|
.not_set_func = not_set_func);
|
||||||
NULL, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* _nm_setting_class_transform_property:
|
* _properties_override_add_transform:
|
||||||
* @setting_class: the setting class
|
* @properties_override: an array collecting the overrides
|
||||||
* @property: the name of the property to transform
|
* @param_spec: the param spec of the property to transform.
|
||||||
* @dbus_type: the type of the property (in its D-Bus representation)
|
* @dbus_type: the type of the property (in its D-Bus representation)
|
||||||
* @to_dbus: function to convert from object to D-Bus format
|
* @to_dbus: function to convert from object to D-Bus format
|
||||||
* @from_dbus: function to convert from D-Bus to object format
|
* @from_dbus: function to convert from D-Bus to object format
|
||||||
@@ -369,92 +327,139 @@ _nm_setting_class_override_property (NMSettingClass *setting_class,
|
|||||||
* nm_property_compare() recognizes, as long as it recognizes @dbus_type.
|
* nm_property_compare() recognizes, as long as it recognizes @dbus_type.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
_nm_setting_class_transform_property (NMSettingClass *setting_class,
|
_properties_override_add_transform (GArray *properties_override,
|
||||||
const char *property,
|
GParamSpec *param_spec,
|
||||||
const GVariantType *dbus_type,
|
const GVariantType *dbus_type,
|
||||||
NMSettingPropertyTransformToFunc to_dbus,
|
NMSettingPropertyTransformToFunc to_dbus,
|
||||||
NMSettingPropertyTransformFromFunc from_dbus)
|
NMSettingPropertyTransformFromFunc from_dbus)
|
||||||
{
|
{
|
||||||
GParamSpec *param_spec;
|
nm_assert (param_spec);
|
||||||
|
|
||||||
param_spec = g_object_class_find_property (G_OBJECT_CLASS (setting_class), property);
|
_properties_override_add (properties_override,
|
||||||
g_return_if_fail (param_spec != NULL);
|
.param_spec = param_spec,
|
||||||
|
.dbus_type = dbus_type,
|
||||||
add_property_override (setting_class,
|
.to_dbus = to_dbus,
|
||||||
property, param_spec, dbus_type,
|
.from_dbus = from_dbus);
|
||||||
NULL, NULL, NULL, NULL,
|
|
||||||
to_dbus, from_dbus);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static GArray *
|
static NMSettInfoSetting _sett_info_settings[_NM_META_SETTING_TYPE_NUM];
|
||||||
nm_setting_class_ensure_properties (NMSettingClass *setting_class)
|
|
||||||
|
void
|
||||||
|
_nm_setting_class_commit_full (NMSettingClass *setting_class,
|
||||||
|
NMMetaSettingType meta_type,
|
||||||
|
const NMSettInfoSettDetail *detail,
|
||||||
|
GArray *properties_override)
|
||||||
{
|
{
|
||||||
GType type = G_TYPE_FROM_CLASS (setting_class), otype;
|
NMSettInfoSetting *sett_info;
|
||||||
NMSettingProperty property, *override;
|
gs_free GParamSpec **property_specs = NULL;
|
||||||
GArray *overrides, *type_overrides, *properties;
|
guint i, n_property_specs, override_len;
|
||||||
GParamSpec **property_specs;
|
|
||||||
guint n_property_specs, i;
|
|
||||||
|
|
||||||
properties = g_type_get_qdata (type, setting_properties_quark ());
|
nm_assert (NM_IS_SETTING_CLASS (setting_class));
|
||||||
if (properties)
|
nm_assert (!setting_class->setting_info);
|
||||||
return properties;
|
|
||||||
|
|
||||||
/* Build overrides array from @setting_class and its superclasses */
|
nm_assert (meta_type < G_N_ELEMENTS (_sett_info_settings));
|
||||||
overrides = g_array_new (FALSE, FALSE, sizeof (NMSettingProperty));
|
|
||||||
for (otype = type; otype != G_TYPE_OBJECT; otype = g_type_parent (otype)) {
|
|
||||||
type_overrides = g_type_get_qdata (otype, setting_property_overrides_quark ());
|
|
||||||
if (type_overrides)
|
|
||||||
g_array_append_vals (overrides, (NMSettingProperty *)type_overrides->data, type_overrides->len);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Build the properties array from the GParamSpecs, obeying overrides */
|
sett_info = &_sett_info_settings[meta_type];
|
||||||
properties = g_array_new (FALSE, FALSE, sizeof (NMSettingProperty));
|
|
||||||
|
nm_assert (!sett_info->setting_class);
|
||||||
|
nm_assert (!sett_info->property_infos_len);
|
||||||
|
nm_assert (!sett_info->property_infos);
|
||||||
|
|
||||||
|
if (!properties_override) {
|
||||||
|
override_len = 0;
|
||||||
|
properties_override = _nm_sett_info_property_override_create_array ();
|
||||||
|
} else
|
||||||
|
override_len = properties_override->len;
|
||||||
|
|
||||||
property_specs = g_object_class_list_properties (G_OBJECT_CLASS (setting_class),
|
property_specs = g_object_class_list_properties (G_OBJECT_CLASS (setting_class),
|
||||||
&n_property_specs);
|
&n_property_specs);
|
||||||
for (i = 0; i < n_property_specs; i++) {
|
|
||||||
override = find_property (overrides, property_specs[i]->name);
|
#if NM_MORE_ASSERTS > 10
|
||||||
if (override)
|
/* assert that properties_override is constructed consistently. */
|
||||||
property = *override;
|
for (i = 0; i < override_len; i++) {
|
||||||
else {
|
guint j;
|
||||||
memset (&property, 0, sizeof (property));
|
const NMSettInfoProperty *p = &g_array_index (properties_override, NMSettInfoProperty, i);
|
||||||
property.name = property_specs[i]->name;
|
|
||||||
property.param_spec = property_specs[i];
|
nm_assert (!_nm_sett_info_property_find_in_array ((NMSettInfoProperty *) properties_override->data,
|
||||||
|
i,
|
||||||
|
p->name));
|
||||||
|
for (j = 0; j < n_property_specs; j++) {
|
||||||
|
if (nm_streq (property_specs[j]->name, p->name)) {
|
||||||
|
nm_assert (p->param_spec == property_specs[j]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
g_array_append_val (properties, property);
|
nm_assert ((j == n_property_specs) == (p->param_spec == NULL));
|
||||||
}
|
}
|
||||||
g_free (property_specs);
|
#endif
|
||||||
|
|
||||||
/* Add any remaining overrides not corresponding to GObject properties */
|
for (i = 0; i < n_property_specs; i++) {
|
||||||
for (i = 0; i < overrides->len; i++) {
|
const char *name = property_specs[i]->name;
|
||||||
override = &g_array_index (overrides, NMSettingProperty, i);
|
NMSettInfoProperty *p;
|
||||||
if (!g_object_class_find_property (G_OBJECT_CLASS (setting_class), override->name))
|
|
||||||
g_array_append_val (properties, *override);
|
if (_nm_sett_info_property_find_in_array ((NMSettInfoProperty *) properties_override->data,
|
||||||
|
override_len,
|
||||||
|
name))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
g_array_set_size (properties_override, properties_override->len + 1);
|
||||||
|
p = &g_array_index (properties_override, NMSettInfoProperty, properties_override->len - 1);
|
||||||
|
memset (p, 0, sizeof (*p));
|
||||||
|
p->name = name;
|
||||||
|
p->param_spec = property_specs[i];
|
||||||
}
|
}
|
||||||
g_array_unref (overrides);
|
|
||||||
|
|
||||||
g_type_set_qdata (type, setting_properties_quark (), properties);
|
G_STATIC_ASSERT_EXPR (G_STRUCT_OFFSET (NMSettInfoProperty, name) == 0);
|
||||||
return properties;
|
g_array_sort (properties_override, nm_strcmp_p);
|
||||||
|
|
||||||
|
setting_class->setting_info = &nm_meta_setting_infos[meta_type];
|
||||||
|
sett_info->setting_class = setting_class;
|
||||||
|
if (detail)
|
||||||
|
sett_info->detail = *detail;
|
||||||
|
sett_info->property_infos_len = properties_override->len;
|
||||||
|
sett_info->property_infos = (const NMSettInfoProperty *) g_array_free (properties_override,
|
||||||
|
properties_override->len == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const NMSettingProperty *
|
const NMSettInfoSetting *
|
||||||
nm_setting_class_get_properties (NMSettingClass *setting_class, guint *n_properties)
|
_nm_sett_info_setting_get (NMSettingClass *setting_class)
|
||||||
{
|
{
|
||||||
GArray *properties;
|
if ( NM_IS_SETTING_CLASS (setting_class)
|
||||||
|
&& setting_class->setting_info) {
|
||||||
properties = nm_setting_class_ensure_properties (setting_class);
|
nm_assert (setting_class->setting_info->meta_type < G_N_ELEMENTS (_sett_info_settings));
|
||||||
|
return &_sett_info_settings[setting_class->setting_info->meta_type];
|
||||||
*n_properties = properties->len;
|
}
|
||||||
return (NMSettingProperty *) properties->data;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const NMSettingProperty *
|
const NMSettInfoProperty *
|
||||||
nm_setting_class_find_property (NMSettingClass *setting_class, const char *property_name)
|
_nm_sett_info_property_get (NMSettingClass *setting_class,
|
||||||
|
const char *property_name)
|
||||||
{
|
{
|
||||||
GArray *properties;
|
const NMSettInfoSetting *sett_info = _nm_sett_info_setting_get (setting_class);
|
||||||
|
const NMSettInfoProperty *property;
|
||||||
|
gssize idx;
|
||||||
|
|
||||||
properties = nm_setting_class_ensure_properties (setting_class);
|
if (!sett_info)
|
||||||
return find_property (properties, property_name);
|
return NULL;
|
||||||
|
|
||||||
|
G_STATIC_ASSERT_EXPR (G_STRUCT_OFFSET (NMSettInfoProperty, name) == 0);
|
||||||
|
idx = nm_utils_array_find_binary_search (sett_info->property_infos,
|
||||||
|
sizeof (NMSettInfoProperty),
|
||||||
|
sett_info->property_infos_len,
|
||||||
|
&property_name,
|
||||||
|
nm_strcmp_p_with_data,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
if (idx < 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
property = &sett_info->property_infos[idx];
|
||||||
|
|
||||||
|
nm_assert (idx == 0 || strcmp (property[-1].name, property[0].name) < 0);
|
||||||
|
nm_assert (idx == sett_info->property_infos_len - 1 || strcmp (property[0].name, property[1].name) < 0);
|
||||||
|
|
||||||
|
return property;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -530,7 +535,7 @@ variant_type_for_gtype (GType type)
|
|||||||
|
|
||||||
static GVariant *
|
static GVariant *
|
||||||
get_property_for_dbus (NMSetting *setting,
|
get_property_for_dbus (NMSetting *setting,
|
||||||
const NMSettingProperty *property,
|
const NMSettInfoProperty *property,
|
||||||
gboolean ignore_default)
|
gboolean ignore_default)
|
||||||
{
|
{
|
||||||
GValue prop_value = { 0, };
|
GValue prop_value = { 0, };
|
||||||
@@ -567,7 +572,7 @@ get_property_for_dbus (NMSetting *setting,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
set_property_from_dbus (const NMSettingProperty *property,
|
set_property_from_dbus (const NMSettInfoProperty *property,
|
||||||
GVariant *src_value,
|
GVariant *src_value,
|
||||||
GValue *dst_value)
|
GValue *dst_value)
|
||||||
{
|
{
|
||||||
@@ -620,17 +625,16 @@ _nm_setting_to_dbus (NMSetting *setting, NMConnection *connection, NMConnectionS
|
|||||||
{
|
{
|
||||||
GVariantBuilder builder;
|
GVariantBuilder builder;
|
||||||
GVariant *dbus_value;
|
GVariant *dbus_value;
|
||||||
const NMSettingProperty *properties;
|
const NMSettInfoSetting *sett_info;
|
||||||
guint n_properties, i;
|
guint i;
|
||||||
|
|
||||||
g_return_val_if_fail (NM_IS_SETTING (setting), NULL);
|
g_return_val_if_fail (NM_IS_SETTING (setting), NULL);
|
||||||
|
|
||||||
properties = nm_setting_class_get_properties (NM_SETTING_GET_CLASS (setting), &n_properties);
|
|
||||||
|
|
||||||
g_variant_builder_init (&builder, NM_VARIANT_TYPE_SETTING);
|
g_variant_builder_init (&builder, NM_VARIANT_TYPE_SETTING);
|
||||||
|
|
||||||
for (i = 0; i < n_properties; i++) {
|
sett_info = _nm_sett_info_setting_get (NM_SETTING_GET_CLASS (setting));
|
||||||
const NMSettingProperty *property = &properties[i];
|
for (i = 0; i < sett_info->property_infos_len; i++) {
|
||||||
|
const NMSettInfoProperty *property = &sett_info->property_infos[i];
|
||||||
GParamSpec *prop_spec = property->param_spec;
|
GParamSpec *prop_spec = property->param_spec;
|
||||||
|
|
||||||
if (!prop_spec) {
|
if (!prop_spec) {
|
||||||
@@ -701,8 +705,8 @@ _nm_setting_new_from_dbus (GType setting_type,
|
|||||||
{
|
{
|
||||||
gs_unref_object NMSetting *setting = NULL;
|
gs_unref_object NMSetting *setting = NULL;
|
||||||
gs_unref_hashtable GHashTable *keys = NULL;
|
gs_unref_hashtable GHashTable *keys = NULL;
|
||||||
const NMSettingProperty *properties;
|
const NMSettInfoSetting *sett_info;
|
||||||
guint i, n_properties;
|
guint i;
|
||||||
|
|
||||||
g_return_val_if_fail (G_TYPE_IS_INSTANTIATABLE (setting_type), NULL);
|
g_return_val_if_fail (G_TYPE_IS_INSTANTIATABLE (setting_type), NULL);
|
||||||
g_return_val_if_fail (g_variant_is_of_type (setting_dict, NM_VARIANT_TYPE_SETTING), NULL);
|
g_return_val_if_fail (g_variant_is_of_type (setting_dict, NM_VARIANT_TYPE_SETTING), NULL);
|
||||||
@@ -746,9 +750,9 @@ _nm_setting_new_from_dbus (GType setting_type,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
properties = nm_setting_class_get_properties (NM_SETTING_GET_CLASS (setting), &n_properties);
|
sett_info = _nm_sett_info_setting_get (NM_SETTING_GET_CLASS (setting));
|
||||||
for (i = 0; i < n_properties; i++) {
|
for (i = 0; i < sett_info->property_infos_len; i++) {
|
||||||
const NMSettingProperty *property = &properties[i];
|
const NMSettInfoProperty *property = &sett_info->property_infos[i];
|
||||||
gs_unref_variant GVariant *value = NULL;
|
gs_unref_variant GVariant *value = NULL;
|
||||||
gs_free_error GError *local = NULL;
|
gs_free_error GError *local = NULL;
|
||||||
|
|
||||||
@@ -867,12 +871,12 @@ const GVariantType *
|
|||||||
nm_setting_get_dbus_property_type (NMSetting *setting,
|
nm_setting_get_dbus_property_type (NMSetting *setting,
|
||||||
const char *property_name)
|
const char *property_name)
|
||||||
{
|
{
|
||||||
const NMSettingProperty *property;
|
const NMSettInfoProperty *property;
|
||||||
|
|
||||||
g_return_val_if_fail (NM_IS_SETTING (setting), NULL);
|
g_return_val_if_fail (NM_IS_SETTING (setting), NULL);
|
||||||
g_return_val_if_fail (property_name != NULL, NULL);
|
g_return_val_if_fail (property_name != NULL, NULL);
|
||||||
|
|
||||||
property = nm_setting_class_find_property (NM_SETTING_GET_CLASS (setting), property_name);
|
property = _nm_sett_info_property_get (NM_SETTING_GET_CLASS (setting), property_name);
|
||||||
g_return_val_if_fail (property != NULL, NULL);
|
g_return_val_if_fail (property != NULL, NULL);
|
||||||
|
|
||||||
if (property->dbus_type)
|
if (property->dbus_type)
|
||||||
@@ -1049,7 +1053,7 @@ compare_property (NMSetting *setting,
|
|||||||
const GParamSpec *prop_spec,
|
const GParamSpec *prop_spec,
|
||||||
NMSettingCompareFlags flags)
|
NMSettingCompareFlags flags)
|
||||||
{
|
{
|
||||||
const NMSettingProperty *property;
|
const NMSettInfoProperty *property;
|
||||||
GVariant *value1, *value2;
|
GVariant *value1, *value2;
|
||||||
int cmp;
|
int cmp;
|
||||||
|
|
||||||
@@ -1081,7 +1085,7 @@ compare_property (NMSetting *setting,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
property = nm_setting_class_find_property (NM_SETTING_GET_CLASS (setting), prop_spec->name);
|
property = _nm_sett_info_property_get (NM_SETTING_GET_CLASS (setting), prop_spec->name);
|
||||||
g_return_val_if_fail (property != NULL, FALSE);
|
g_return_val_if_fail (property != NULL, FALSE);
|
||||||
|
|
||||||
value1 = get_property_for_dbus (setting, property, TRUE);
|
value1 = get_property_for_dbus (setting, property, TRUE);
|
||||||
@@ -1595,11 +1599,11 @@ _nm_setting_need_secrets (NMSetting *setting)
|
|||||||
static int
|
static int
|
||||||
update_one_secret (NMSetting *setting, const char *key, GVariant *value, GError **error)
|
update_one_secret (NMSetting *setting, const char *key, GVariant *value, GError **error)
|
||||||
{
|
{
|
||||||
const NMSettingProperty *property;
|
const NMSettInfoProperty *property;
|
||||||
GParamSpec *prop_spec;
|
GParamSpec *prop_spec;
|
||||||
GValue prop_value = { 0, };
|
GValue prop_value = { 0, };
|
||||||
|
|
||||||
property = nm_setting_class_find_property (NM_SETTING_GET_CLASS (setting), key);
|
property = _nm_sett_info_property_get (NM_SETTING_GET_CLASS (setting), key);
|
||||||
if (!property) {
|
if (!property) {
|
||||||
g_set_error_literal (error,
|
g_set_error_literal (error,
|
||||||
NM_CONNECTION_ERROR,
|
NM_CONNECTION_ERROR,
|
||||||
@@ -1688,10 +1692,10 @@ _nm_setting_update_secrets (NMSetting *setting, GVariant *secrets, GError **erro
|
|||||||
static gboolean
|
static gboolean
|
||||||
is_secret_prop (NMSetting *setting, const char *secret_name, GError **error)
|
is_secret_prop (NMSetting *setting, const char *secret_name, GError **error)
|
||||||
{
|
{
|
||||||
const NMSettingProperty *property;
|
const NMSettInfoProperty *property;
|
||||||
GParamSpec *pspec;
|
GParamSpec *pspec;
|
||||||
|
|
||||||
property = nm_setting_class_find_property (NM_SETTING_GET_CLASS (setting), secret_name);
|
property = _nm_sett_info_property_get (NM_SETTING_GET_CLASS (setting), secret_name);
|
||||||
if (!property) {
|
if (!property) {
|
||||||
g_set_error_literal (error,
|
g_set_error_literal (error,
|
||||||
NM_CONNECTION_ERROR,
|
NM_CONNECTION_ERROR,
|
||||||
|
Reference in New Issue
Block a user