libnm: pass full property meta data to from_dbus_fcn() hook
This commit is contained in:
@@ -4985,9 +4985,10 @@ _routing_rules_dbus_only_synth(const NMSettInfoSetting * sett_info
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_routing_rules_dbus_only_set(NMSetting * setting,
|
||||
_routing_rules_dbus_only_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
@@ -5775,9 +5776,10 @@ enumerate_values(const NMSettInfoProperty *property_info,
|
||||
/*****************************************************************************/
|
||||
|
||||
static gboolean
|
||||
ip_gateway_set(NMSetting * setting,
|
||||
ip_gateway_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
@@ -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,9 +362,10 @@ ip4_addresses_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip4_addresses_set(NMSetting * setting,
|
||||
ip4_addresses_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
@@ -467,9 +468,10 @@ ip4_address_data_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip4_address_data_set(NMSetting * setting,
|
||||
ip4_address_data_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
@@ -503,9 +505,10 @@ ip4_routes_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip4_routes_set(NMSetting * setting,
|
||||
ip4_routes_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
@@ -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,9 +544,10 @@ ip4_route_data_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip4_route_data_set(NMSetting * setting,
|
||||
ip4_route_data_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
|
@@ -403,9 +403,10 @@ ip6_addresses_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip6_addresses_set(NMSetting * setting,
|
||||
ip6_addresses_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
@@ -449,9 +450,10 @@ ip6_address_data_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip6_address_data_set(NMSetting * setting,
|
||||
ip6_address_data_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
@@ -485,9 +487,10 @@ ip6_routes_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip6_routes_set(NMSetting * setting,
|
||||
ip6_routes_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
@@ -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,9 +526,10 @@ ip6_route_data_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip6_route_data_set(NMSetting * setting,
|
||||
ip6_route_data_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
|
@@ -644,9 +644,10 @@ 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,
|
||||
gboolean _nm_utils_bridge_vlans_from_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error);
|
||||
@@ -687,9 +688,10 @@ GVariant *_nm_utils_hwaddr_cloned_get(const NMSettInfoSetting * se
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options);
|
||||
|
||||
gboolean _nm_utils_hwaddr_cloned_set(NMSetting * setting,
|
||||
gboolean _nm_utils_hwaddr_cloned_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error);
|
||||
|
@@ -956,9 +956,10 @@ vfs_to_dbus(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
vfs_from_dbus(NMSetting * setting,
|
||||
vfs_from_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
|
@@ -1501,9 +1501,10 @@ tc_qdiscs_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
tc_qdiscs_set(NMSetting * setting,
|
||||
tc_qdiscs_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
@@ -1699,9 +1700,10 @@ tc_tfilters_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
tc_tfilters_set(NMSetting * setting,
|
||||
tc_tfilters_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
|
@@ -909,9 +909,10 @@ clear_secrets(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
vpn_secrets_from_dbus(NMSetting * setting,
|
||||
vpn_secrets_from_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
|
@@ -1563,9 +1563,10 @@ _peers_dbus_only_synth(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_peers_dbus_only_set(NMSetting * setting,
|
||||
_peers_dbus_only_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
|
@@ -769,9 +769,10 @@ _to_dbus_fcn_seen_bssids(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_from_dbus_fcn_seen_bssids(NMSetting * setting,
|
||||
_from_dbus_fcn_seen_bssids(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
|
@@ -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,9 +4040,10 @@ _nm_utils_hwaddr_cloned_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
gboolean
|
||||
_nm_utils_hwaddr_cloned_set(NMSetting * setting,
|
||||
_nm_utils_hwaddr_cloned_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
@@ -4051,7 +4052,7 @@ _nm_utils_hwaddr_cloned_set(NMSetting * setting,
|
||||
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,
|
||||
_nm_utils_hwaddr_cloned_data_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
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,9 +5512,10 @@ _nm_utils_bridge_vlans_to_dbus(const NMSettInfoSetting * sett_info
|
||||
}
|
||||
|
||||
gboolean
|
||||
_nm_utils_bridge_vlans_from_dbus(NMSetting * setting,
|
||||
_nm_utils_bridge_vlans_from_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
@@ -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,9 +656,10 @@ typedef GVariant *(*NMSettInfoPropToDBusFcn)(const NMSettInfoSetting *
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options);
|
||||
typedef gboolean (*NMSettInfoPropFromDBusFcn)(NMSetting * setting,
|
||||
typedef gboolean (*NMSettInfoPropFromDBusFcn)(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error);
|
||||
|
Reference in New Issue
Block a user