libnm: pass full property meta data to from_dbus_fcn() hook
This commit is contained in:
@@ -4985,12 +4985,13 @@ _routing_rules_dbus_only_synth(const NMSettInfoSetting * sett_info
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_routing_rules_dbus_only_set(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
_routing_rules_dbus_only_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
{
|
||||
GVariantIter iter_rules;
|
||||
GVariant * rule_var;
|
||||
@@ -5775,12 +5776,13 @@ enumerate_values(const NMSettInfoProperty *property_info,
|
||||
/*****************************************************************************/
|
||||
|
||||
static gboolean
|
||||
ip_gateway_set(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
ip_gateway_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
{
|
||||
/* FIXME: properly handle errors */
|
||||
|
||||
@@ -5788,7 +5790,7 @@ ip_gateway_set(NMSetting * setting,
|
||||
if (_nm_setting_use_legacy_property(setting, connection_dict, "addresses", "gateway"))
|
||||
return TRUE;
|
||||
|
||||
g_object_set(setting, property, g_variant_get_string(value, NULL), NULL);
|
||||
g_object_set(setting, property_info->name, g_variant_get_string(value, NULL), NULL);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@@ -362,12 +362,13 @@ ip4_addresses_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip4_addresses_set(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
ip4_addresses_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
{
|
||||
GPtrArray *addrs;
|
||||
GVariant * s_ip4;
|
||||
@@ -467,12 +468,13 @@ ip4_address_data_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip4_address_data_set(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
ip4_address_data_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
{
|
||||
GPtrArray *addrs;
|
||||
|
||||
@@ -503,12 +505,13 @@ ip4_routes_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip4_routes_set(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
ip4_routes_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
{
|
||||
GPtrArray *routes;
|
||||
|
||||
@@ -518,7 +521,7 @@ ip4_routes_set(NMSetting * setting,
|
||||
return TRUE;
|
||||
|
||||
routes = nm_utils_ip4_routes_from_variant(value);
|
||||
g_object_set(setting, property, routes, NULL);
|
||||
g_object_set(setting, property_info->name, routes, NULL);
|
||||
g_ptr_array_unref(routes);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -541,12 +544,13 @@ ip4_route_data_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip4_route_data_set(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
ip4_route_data_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
{
|
||||
GPtrArray *routes;
|
||||
|
||||
|
@@ -403,12 +403,13 @@ ip6_addresses_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip6_addresses_set(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
ip6_addresses_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
{
|
||||
GPtrArray *addrs;
|
||||
char * gateway = NULL;
|
||||
@@ -449,12 +450,13 @@ ip6_address_data_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip6_address_data_set(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
ip6_address_data_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
{
|
||||
GPtrArray *addrs;
|
||||
|
||||
@@ -485,12 +487,13 @@ ip6_routes_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip6_routes_set(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
ip6_routes_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
{
|
||||
GPtrArray *routes;
|
||||
|
||||
@@ -500,7 +503,7 @@ ip6_routes_set(NMSetting * setting,
|
||||
return TRUE;
|
||||
|
||||
routes = nm_utils_ip6_routes_from_variant(value);
|
||||
g_object_set(setting, property, routes, NULL);
|
||||
g_object_set(setting, property_info->name, routes, NULL);
|
||||
g_ptr_array_unref(routes);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -523,12 +526,13 @@ ip6_route_data_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip6_route_data_set(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
ip6_route_data_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
{
|
||||
GPtrArray *routes;
|
||||
|
||||
|
@@ -644,12 +644,13 @@ gboolean _nm_setting_should_compare_secret_property(NMSetting * settin
|
||||
NMBridgeVlan *_nm_bridge_vlan_dup(const NMBridgeVlan *vlan);
|
||||
NMBridgeVlan *_nm_bridge_vlan_dup_and_seal(const NMBridgeVlan *vlan);
|
||||
|
||||
gboolean _nm_utils_bridge_vlans_from_dbus(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error);
|
||||
gboolean _nm_utils_bridge_vlans_from_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error);
|
||||
|
||||
GVariant *_nm_utils_bridge_vlans_to_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
@@ -687,12 +688,13 @@ GVariant *_nm_utils_hwaddr_cloned_get(const NMSettInfoSetting * se
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options);
|
||||
|
||||
gboolean _nm_utils_hwaddr_cloned_set(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error);
|
||||
gboolean _nm_utils_hwaddr_cloned_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
@@ -956,12 +956,13 @@ vfs_to_dbus(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
vfs_from_dbus(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
vfs_from_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
{
|
||||
GPtrArray * vfs;
|
||||
GVariantIter vf_iter;
|
||||
|
@@ -1501,12 +1501,13 @@ tc_qdiscs_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
tc_qdiscs_set(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
tc_qdiscs_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
{
|
||||
GPtrArray *qdiscs;
|
||||
|
||||
@@ -1699,12 +1700,13 @@ tc_tfilters_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
tc_tfilters_set(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
tc_tfilters_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
{
|
||||
gs_unref_ptrarray GPtrArray *tfilters = NULL;
|
||||
|
||||
|
@@ -909,12 +909,13 @@ clear_secrets(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
vpn_secrets_from_dbus(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
vpn_secrets_from_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
{
|
||||
NMSettingVpn * self = NM_SETTING_VPN(setting);
|
||||
NMSettingVpnPrivate *priv = NM_SETTING_VPN_GET_PRIVATE(self);
|
||||
|
@@ -1563,12 +1563,13 @@ _peers_dbus_only_synth(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_peers_dbus_only_set(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
_peers_dbus_only_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
{
|
||||
GVariantIter iter_peers;
|
||||
GVariant * peer_var;
|
||||
|
@@ -769,12 +769,13 @@ _to_dbus_fcn_seen_bssids(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_from_dbus_fcn_seen_bssids(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
_from_dbus_fcn_seen_bssids(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
{
|
||||
NMSettingWirelessPrivate *priv;
|
||||
gs_free const char ** s = NULL;
|
||||
|
@@ -1347,9 +1347,10 @@ init_from_dbus(NMSetting * setting,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!property_info->property_type->from_dbus_fcn(setting,
|
||||
if (!property_info->property_type->from_dbus_fcn(sett_info,
|
||||
property_info,
|
||||
setting,
|
||||
connection_dict,
|
||||
property_info->name,
|
||||
value,
|
||||
parse_flags,
|
||||
&local)) {
|
||||
|
@@ -4040,18 +4040,19 @@ _nm_utils_hwaddr_cloned_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
gboolean
|
||||
_nm_utils_hwaddr_cloned_set(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
_nm_utils_hwaddr_cloned_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
{
|
||||
gsize length;
|
||||
const guint8 *array;
|
||||
char * str;
|
||||
|
||||
nm_assert(nm_streq0(property, "cloned-mac-address"));
|
||||
nm_assert(nm_streq0(property_info->name, "cloned-mac-address"));
|
||||
|
||||
if (!_nm_setting_use_legacy_property(setting,
|
||||
connection_dict,
|
||||
@@ -4117,14 +4118,15 @@ _nm_utils_hwaddr_cloned_data_synth(const NMSettInfoSetting * sett_
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_nm_utils_hwaddr_cloned_data_set(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
_nm_utils_hwaddr_cloned_data_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
{
|
||||
nm_assert(nm_streq0(property, "assigned-mac-address"));
|
||||
nm_assert(nm_streq0(property_info->name, "assigned-mac-address"));
|
||||
|
||||
if (_nm_setting_use_legacy_property(setting,
|
||||
connection_dict,
|
||||
@@ -5510,12 +5512,13 @@ _nm_utils_bridge_vlans_to_dbus(const NMSettInfoSetting * sett_info
|
||||
}
|
||||
|
||||
gboolean
|
||||
_nm_utils_bridge_vlans_from_dbus(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
_nm_utils_bridge_vlans_from_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
{
|
||||
gs_unref_ptrarray GPtrArray *vlans = NULL;
|
||||
GVariantIter vlan_iter;
|
||||
@@ -5556,7 +5559,7 @@ _nm_utils_bridge_vlans_from_dbus(NMSetting * setting,
|
||||
g_ptr_array_add(vlans, vlan);
|
||||
}
|
||||
|
||||
g_object_set(setting, property, vlans, NULL);
|
||||
g_object_set(setting, property_info->name, vlans, NULL);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@@ -656,12 +656,13 @@ typedef GVariant *(*NMSettInfoPropToDBusFcn)(const NMSettInfoSetting *
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options);
|
||||
typedef gboolean (*NMSettInfoPropFromDBusFcn)(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error);
|
||||
typedef gboolean (*NMSettInfoPropFromDBusFcn)(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error);
|
||||
typedef gboolean (*NMSettInfoPropMissingFromDBusFcn)(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
|
Reference in New Issue
Block a user