libnm: use macros function arguments for NMSettInfoPropertType
These functions tend to have many arguments. They are also quite som boilerplate to implement the hundereds of properties we have, while we want that properties have common behaviors and similarities. Instead of repeatedly spelling out the function arguments, use a macro. Advantages: - the usage of a _NM_SETT_INFO_PROP_*_FCN_ARGS macro signals that this is an implementation of a property. You can now grep for these macros to find all implementation. That was previously rather imprecise, you could only `git grep '\.to_dbus_fcn'` to find the uses, but not the implementations. As the goal is to keep properties "similar", there is a desire to reduce the number of similar implementations and to find them. - changing the arguments now no longer will require you to go through all implementations. At least not, if you merely add an argument that has a reasonable default behavior and does not require explicit handling by most implementation. - it's convenient to be able to patch the argument list to let the compiler help to reason about something. For example, the "connection_dict" argument to from_dbus_fcn() is usually unused. If you'd like to find who uses it, rename the parameter, and review the (few) compiler errors. - it does save 573 LOC of boilerplate with no actual logic or useful information. I argue, that this simplifies the code and review, by increasing the relative amount of actually meaningful code. Disadvantages: - the user no longer directly sees the argument list. They would need cscope/ctags or an IDE to jump to the macro definition and conveniently see all arguments. Also use _nm_nil, so that clang-format interprets this as a function parameter list. Otherwise, it formats the function differently.
This commit is contained in:
@@ -1090,13 +1090,7 @@ options_equal(NMSettingBond *s_bond, NMSettingBond *s_bond2, NMSettingCompareFla
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_options(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_options(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
return (!set_b || options_equal(NM_SETTING_BOND(set_a), NM_SETTING_BOND(set_b), flags));
|
||||
}
|
||||
|
@@ -368,13 +368,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_vlans(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_vlans(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
if (set_b) {
|
||||
return _nm_utils_bridge_compare_vlans(NM_SETTING_BRIDGE_PORT_GET_PRIVATE(set_a)->vlans,
|
||||
|
@@ -1315,13 +1315,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_vlans(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_vlans(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
if (set_b) {
|
||||
return _nm_utils_bridge_compare_vlans(NM_SETTING_BRIDGE_GET_PRIVATE(set_a)->vlans,
|
||||
|
@@ -621,12 +621,7 @@ nm_setting_connection_get_timestamp(NMSettingConnection *setting)
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
_to_dbus_fcn_timestamp(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
_to_dbus_fcn_timestamp(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
guint64 v;
|
||||
|
||||
@@ -1540,11 +1535,7 @@ find_virtual_interface_name(GVariant *connection_dict, GVariant **variant_to_fre
|
||||
}
|
||||
|
||||
static gboolean
|
||||
nm_setting_connection_no_interface_name(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
nm_setting_connection_no_interface_name(_NM_SETT_INFO_PROP_MISSING_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
const char * virtual_interface_name;
|
||||
gs_unref_variant GVariant *variant_to_free = NULL;
|
||||
@@ -1558,13 +1549,7 @@ nm_setting_connection_no_interface_name(NMSetting * setting,
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_id(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_id(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
if (NM_FLAGS_HAS(flags, NM_SETTING_COMPARE_FLAG_IGNORE_ID))
|
||||
return NM_TERNARY_DEFAULT;
|
||||
@@ -1579,13 +1564,7 @@ compare_fcn_id(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_timestamp(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_timestamp(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
if (NM_FLAGS_HAS(flags, NM_SETTING_COMPARE_FLAG_IGNORE_TIMESTAMP))
|
||||
return NM_TERNARY_DEFAULT;
|
||||
|
@@ -745,13 +745,13 @@ set_gvalue_from_array(GValue *v, uint *a, size_t len)
|
||||
#define SET_GVALUE_FROM_ARRAY(v, a) set_gvalue_from_array(v, a, G_N_ELEMENTS(a))
|
||||
|
||||
static void
|
||||
_nm_setting_dcb_uint_array_from_dbus(GVariant *dbus_value, GValue *prop_value)
|
||||
_nm_setting_dcb_uint_array_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_GPROP_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gconstpointer array;
|
||||
gsize length;
|
||||
|
||||
array = g_variant_get_fixed_array(dbus_value, &length, sizeof(guint32));
|
||||
set_gvalue_from_array(prop_value, (guint *) array, length);
|
||||
array = g_variant_get_fixed_array(from, &length, sizeof(guint32));
|
||||
set_gvalue_from_array(to, (guint *) array, length);
|
||||
}
|
||||
|
||||
static const NMSettInfoPropertType nm_sett_info_propert_type_dcb_au =
|
||||
|
@@ -4949,12 +4949,7 @@ nm_setting_ip_config_clear_routing_rules(NMSettingIPConfig *setting)
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
_routing_rules_dbus_only_synth(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
_routing_rules_dbus_only_synth(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingIPConfig * self = NM_SETTING_IP_CONFIG(setting);
|
||||
NMSettingIPConfigPrivate *priv;
|
||||
@@ -4985,13 +4980,7 @@ _routing_rules_dbus_only_synth(const NMSettInfoSetting * sett_info
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_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)
|
||||
_routing_rules_dbus_only_set(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
GVariantIter iter_rules;
|
||||
GVariant * rule_var;
|
||||
@@ -5627,13 +5616,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
||||
}
|
||||
|
||||
NMTernary
|
||||
_nm_setting_ip_config_compare_fcn_addresses(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
_nm_setting_ip_config_compare_fcn_addresses(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingIPConfigPrivate *a_priv;
|
||||
NMSettingIPConfigPrivate *b_priv;
|
||||
@@ -5657,13 +5640,7 @@ _nm_setting_ip_config_compare_fcn_addresses(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
NMTernary
|
||||
_nm_setting_ip_config_compare_fcn_routes(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
_nm_setting_ip_config_compare_fcn_routes(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingIPConfigPrivate *a_priv;
|
||||
NMSettingIPConfigPrivate *b_priv;
|
||||
@@ -5686,13 +5663,7 @@ _nm_setting_ip_config_compare_fcn_routes(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_routing_rules(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_routing_rules(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingIPConfigPrivate *a_priv;
|
||||
NMSettingIPConfigPrivate *b_priv;
|
||||
@@ -5776,13 +5747,8 @@ enumerate_values(const NMSettInfoProperty *property_info,
|
||||
/*****************************************************************************/
|
||||
|
||||
gboolean
|
||||
_nm_setting_property_from_dbus_fcn_direct_ip_config_gateway(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
_nm_setting_property_from_dbus_fcn_direct_ip_config_gateway(
|
||||
_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
/* Don't set from 'gateway' if we're going to use the gateway in 'addresses' */
|
||||
if (_nm_setting_use_legacy_property(setting, connection_dict, "addresses", "gateway"))
|
||||
|
@@ -322,12 +322,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
ip4_dns_to_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
ip4_dns_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
GPtrArray *dns;
|
||||
|
||||
@@ -340,18 +335,13 @@ ip4_dns_to_dbus(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static void
|
||||
ip4_dns_from_dbus(GVariant *dbus_value, GValue *prop_value)
|
||||
ip4_dns_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_GPROP_FCN_ARGS _nm_nil)
|
||||
{
|
||||
g_value_take_boxed(prop_value, nm_utils_ip4_dns_from_variant(dbus_value));
|
||||
g_value_take_boxed(to, nm_utils_ip4_dns_from_variant(from));
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
ip4_addresses_get(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
ip4_addresses_get(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gs_unref_ptrarray GPtrArray *addrs = NULL;
|
||||
const char * gateway;
|
||||
@@ -362,13 +352,7 @@ ip4_addresses_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip4_addresses_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
ip4_addresses_set(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
GPtrArray *addrs;
|
||||
GVariant * s_ip4;
|
||||
@@ -407,12 +391,7 @@ ip4_addresses_set(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
ip4_address_labels_get(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
ip4_address_labels_get(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingIPConfig *s_ip = NM_SETTING_IP_CONFIG(setting);
|
||||
gboolean have_labels = FALSE;
|
||||
@@ -451,12 +430,7 @@ ip4_address_labels_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
ip4_address_data_get(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
ip4_address_data_get(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gs_unref_ptrarray GPtrArray *addrs = NULL;
|
||||
|
||||
@@ -468,13 +442,7 @@ ip4_address_data_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip4_address_data_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
ip4_address_data_set(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
GPtrArray *addrs;
|
||||
|
||||
@@ -491,12 +459,7 @@ ip4_address_data_set(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
ip4_routes_get(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
ip4_routes_get(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gs_unref_ptrarray GPtrArray *routes = NULL;
|
||||
|
||||
@@ -505,13 +468,7 @@ ip4_routes_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip4_routes_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
ip4_routes_set(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
GPtrArray *routes;
|
||||
|
||||
@@ -527,12 +484,7 @@ ip4_routes_set(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
ip4_route_data_get(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
ip4_route_data_get(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gs_unref_ptrarray GPtrArray *routes = NULL;
|
||||
|
||||
@@ -544,13 +496,7 @@ ip4_route_data_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip4_route_data_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
ip4_route_data_set(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
GPtrArray *routes;
|
||||
|
||||
|
@@ -363,12 +363,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
ip6_dns_to_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
ip6_dns_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
GPtrArray *dns;
|
||||
|
||||
@@ -381,18 +376,13 @@ ip6_dns_to_dbus(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static void
|
||||
ip6_dns_from_dbus(GVariant *dbus_value, GValue *prop_value)
|
||||
ip6_dns_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_GPROP_FCN_ARGS _nm_nil)
|
||||
{
|
||||
g_value_take_boxed(prop_value, nm_utils_ip6_dns_from_variant(dbus_value));
|
||||
g_value_take_boxed(to, nm_utils_ip6_dns_from_variant(from));
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
ip6_addresses_get(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
ip6_addresses_get(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gs_unref_ptrarray GPtrArray *addrs = NULL;
|
||||
const char * gateway;
|
||||
@@ -403,13 +393,7 @@ ip6_addresses_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip6_addresses_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
ip6_addresses_set(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
GPtrArray *addrs;
|
||||
char * gateway = NULL;
|
||||
@@ -433,12 +417,7 @@ ip6_addresses_set(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
ip6_address_data_get(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
ip6_address_data_get(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gs_unref_ptrarray GPtrArray *addrs = NULL;
|
||||
|
||||
@@ -450,13 +429,7 @@ ip6_address_data_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip6_address_data_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
ip6_address_data_set(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
GPtrArray *addrs;
|
||||
|
||||
@@ -473,12 +446,7 @@ ip6_address_data_set(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
ip6_routes_get(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
ip6_routes_get(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gs_unref_ptrarray GPtrArray *routes = NULL;
|
||||
|
||||
@@ -487,13 +455,7 @@ ip6_routes_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip6_routes_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
ip6_routes_set(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
GPtrArray *routes;
|
||||
|
||||
@@ -509,12 +471,7 @@ ip6_routes_set(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
ip6_route_data_get(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
ip6_route_data_get(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gs_unref_ptrarray GPtrArray *routes = NULL;
|
||||
|
||||
@@ -526,13 +483,7 @@ ip6_route_data_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ip6_route_data_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
ip6_route_data_set(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
GPtrArray *routes;
|
||||
|
||||
|
@@ -387,13 +387,7 @@ connection_type_is_good:
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_data(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_data(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingOvsExternalIDsPrivate *priv;
|
||||
NMSettingOvsExternalIDsPrivate *pri2;
|
||||
|
@@ -311,29 +311,11 @@ gboolean _nm_setting_compare_flags_check(const GParamSpec * param_spec,
|
||||
NMSetting * set_a,
|
||||
NMSetting * set_b);
|
||||
|
||||
NMTernary _nm_setting_property_compare_fcn_ignore(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags);
|
||||
NMTernary _nm_setting_property_compare_fcn_ignore(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil);
|
||||
|
||||
NMTernary _nm_setting_property_compare_fcn_direct(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags);
|
||||
NMTernary _nm_setting_property_compare_fcn_direct(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil);
|
||||
|
||||
NMTernary _nm_setting_property_compare_fcn_default(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags);
|
||||
NMTernary _nm_setting_property_compare_fcn_default(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil);
|
||||
|
||||
void _nm_setting_property_get_property_direct(GObject * object,
|
||||
guint prop_id,
|
||||
@@ -345,76 +327,26 @@ void _nm_setting_property_set_property_direct(GObject * object,
|
||||
const GValue *value,
|
||||
GParamSpec * pspec);
|
||||
|
||||
GVariant *_nm_setting_property_to_dbus_fcn_ignore(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options);
|
||||
GVariant *_nm_setting_property_to_dbus_fcn_ignore(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil);
|
||||
|
||||
GVariant *_nm_setting_property_to_dbus_fcn_gprop(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options);
|
||||
GVariant *_nm_setting_property_to_dbus_fcn_gprop(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil);
|
||||
|
||||
GVariant *_nm_setting_property_to_dbus_fcn_direct(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options);
|
||||
GVariant *_nm_setting_property_to_dbus_fcn_direct(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil);
|
||||
|
||||
GVariant *_nm_setting_property_to_dbus_fcn_direct_mac_address(
|
||||
const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options);
|
||||
GVariant *
|
||||
_nm_setting_property_to_dbus_fcn_direct_mac_address(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil);
|
||||
|
||||
gboolean _nm_setting_property_from_dbus_fcn_ignore(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error);
|
||||
gboolean _nm_setting_property_from_dbus_fcn_ignore(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil);
|
||||
|
||||
gboolean
|
||||
_nm_setting_property_from_dbus_fcn_direct_ip_config_gateway(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error);
|
||||
gboolean _nm_setting_property_from_dbus_fcn_direct_ip_config_gateway(
|
||||
_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil);
|
||||
|
||||
gboolean
|
||||
_nm_setting_property_from_dbus_fcn_direct_mac_address(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error);
|
||||
gboolean _nm_setting_property_from_dbus_fcn_direct_mac_address(
|
||||
_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil);
|
||||
|
||||
gboolean _nm_setting_property_from_dbus_fcn_direct(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error);
|
||||
gboolean _nm_setting_property_from_dbus_fcn_direct(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil);
|
||||
|
||||
gboolean _nm_setting_property_from_dbus_fcn_gprop(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error);
|
||||
gboolean _nm_setting_property_from_dbus_fcn_gprop(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil);
|
||||
|
||||
GVariant *_nm_setting_to_dbus(NMSetting * setting,
|
||||
NMConnection * connection,
|
||||
@@ -780,57 +712,19 @@ 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(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error);
|
||||
gboolean _nm_utils_bridge_vlans_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil);
|
||||
|
||||
GVariant *_nm_utils_bridge_vlans_to_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options);
|
||||
GVariant *_nm_utils_bridge_vlans_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil);
|
||||
|
||||
NMTernary _nm_setting_ip_config_compare_fcn_addresses(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags);
|
||||
NMTernary _nm_setting_ip_config_compare_fcn_addresses(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil);
|
||||
|
||||
NMTernary _nm_setting_ip_config_compare_fcn_routes(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags);
|
||||
NMTernary _nm_setting_ip_config_compare_fcn_routes(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil);
|
||||
|
||||
gboolean _nm_utils_hwaddr_cloned_not_set(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error);
|
||||
gboolean _nm_utils_hwaddr_cloned_not_set(_NM_SETT_INFO_PROP_MISSING_FROM_DBUS_FCN_ARGS _nm_nil);
|
||||
|
||||
GVariant *_nm_utils_hwaddr_cloned_get(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options);
|
||||
GVariant *_nm_utils_hwaddr_cloned_get(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil);
|
||||
|
||||
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);
|
||||
gboolean _nm_utils_hwaddr_cloned_set(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
@@ -130,12 +130,7 @@ nm_setting_serial_get_send_delay(NMSettingSerial *setting)
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
parity_to_dbus_fcn(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
parity_to_dbus_fcn(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
switch (nm_setting_serial_get_parity(NM_SETTING_SERIAL(setting))) {
|
||||
case NM_SETTING_SERIAL_PARITY_EVEN:
|
||||
@@ -151,7 +146,7 @@ parity_to_dbus_fcn(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static void
|
||||
parity_from_dbus(GVariant *from, GValue *to)
|
||||
parity_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_GPROP_FCN_ARGS _nm_nil)
|
||||
{
|
||||
switch (g_variant_get_byte(from)) {
|
||||
case 'E':
|
||||
|
@@ -875,12 +875,7 @@ _nm_setting_sriov_sort_vfs(NMSettingSriov *setting)
|
||||
/*****************************************************************************/
|
||||
|
||||
static GVariant *
|
||||
vfs_to_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
vfs_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gs_unref_ptrarray GPtrArray *vfs = NULL;
|
||||
GVariantBuilder builder;
|
||||
@@ -956,13 +951,7 @@ vfs_to_dbus(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
vfs_from_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
vfs_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
GPtrArray * vfs;
|
||||
GVariantIter vf_iter;
|
||||
@@ -1120,13 +1109,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_vfs(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_vfs(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingSriov *a;
|
||||
NMSettingSriov *b;
|
||||
|
@@ -1314,13 +1314,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_qdiscs(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_qdiscs(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingTCConfig *a_tc_config = NM_SETTING_TC_CONFIG(set_a);
|
||||
NMSettingTCConfig *b_tc_config = NM_SETTING_TC_CONFIG(set_b);
|
||||
@@ -1338,13 +1332,7 @@ compare_fcn_qdiscs(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_tfilter(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_tfilter(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingTCConfig *a_tc_config = NM_SETTING_TC_CONFIG(set_a);
|
||||
NMSettingTCConfig *b_tc_config = NM_SETTING_TC_CONFIG(set_b);
|
||||
@@ -1487,12 +1475,7 @@ next:
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
tc_qdiscs_get(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
tc_qdiscs_get(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gs_unref_ptrarray GPtrArray *qdiscs = NULL;
|
||||
|
||||
@@ -1501,13 +1484,7 @@ tc_qdiscs_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
tc_qdiscs_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
tc_qdiscs_set(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
GPtrArray *qdiscs;
|
||||
|
||||
@@ -1686,12 +1663,7 @@ next:
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
tc_tfilters_get(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
tc_tfilters_get(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gs_unref_ptrarray GPtrArray *tfilters = NULL;
|
||||
|
||||
@@ -1700,13 +1672,7 @@ tc_tfilters_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
tc_tfilters_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
tc_tfilters_set(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gs_unref_ptrarray GPtrArray *tfilters = NULL;
|
||||
|
||||
|
@@ -350,13 +350,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_link_watchers(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_link_watchers(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingTeamPortPrivate *a_priv;
|
||||
NMSettingTeamPortPrivate *b_priv;
|
||||
@@ -373,13 +367,7 @@ compare_fcn_link_watchers(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_config(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_config(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingTeamPortPrivate *a_priv;
|
||||
NMSettingTeamPortPrivate *b_priv;
|
||||
|
@@ -1275,13 +1275,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_link_watchers(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_link_watchers(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingTeamPrivate *a_priv;
|
||||
NMSettingTeamPrivate *b_priv;
|
||||
@@ -1298,13 +1292,7 @@ compare_fcn_link_watchers(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_config(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_config(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingTeamPrivate *a_priv;
|
||||
NMSettingTeamPrivate *b_priv;
|
||||
|
@@ -389,13 +389,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_data(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_data(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingUserPrivate *priv;
|
||||
NMSettingUserPrivate *pri2;
|
||||
|
@@ -676,22 +676,13 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
_override_flags_get(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
_override_flags_get(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
return g_variant_new_uint32(nm_setting_vlan_get_flags((NMSettingVlan *) setting));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_override_flags_not_set(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
_override_flags_not_set(_NM_SETT_INFO_PROP_MISSING_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
/* we changed the default value for FLAGS. When an older client
|
||||
* doesn't serialize the property, we assume it is the old default. */
|
||||
|
@@ -849,13 +849,7 @@ compare_property_secrets(NMSettingVpn *a, NMSettingVpn *b, NMSettingCompareFlags
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_secrets(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_secrets(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
if (NM_FLAGS_HAS(flags, NM_SETTING_COMPARE_FLAG_INFERRABLE))
|
||||
return NM_TERNARY_DEFAULT;
|
||||
@@ -907,13 +901,7 @@ clear_secrets(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
vpn_secrets_from_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
vpn_secrets_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingVpn * self = NM_SETTING_VPN(setting);
|
||||
NMSettingVpnPrivate *priv = NM_SETTING_VPN_GET_PRIVATE(self);
|
||||
@@ -936,12 +924,7 @@ vpn_secrets_from_dbus(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
vpn_secrets_to_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
vpn_secrets_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingVpnPrivate *priv = NM_SETTING_VPN_GET_PRIVATE(setting);
|
||||
GVariantBuilder builder;
|
||||
|
@@ -976,13 +976,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_cloned_mac_address(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_cloned_mac_address(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
return !set_b
|
||||
|| nm_streq0(NM_SETTING_WIRED_GET_PRIVATE(set_a)->cloned_mac_address,
|
||||
|
@@ -1460,12 +1460,7 @@ nm_setting_wireguard_clear_peers(NMSettingWireGuard *self)
|
||||
/*****************************************************************************/
|
||||
|
||||
static GVariant *
|
||||
_peers_dbus_only_synth(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
_peers_dbus_only_synth(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingWireGuard * self = NM_SETTING_WIREGUARD(setting);
|
||||
NMSettingWireGuardPrivate *priv;
|
||||
@@ -1563,13 +1558,7 @@ _peers_dbus_only_synth(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_peers_dbus_only_set(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
_peers_dbus_only_set(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
GVariantIter iter_peers;
|
||||
GVariant * peer_var;
|
||||
@@ -1998,13 +1987,7 @@ update_one_secret(NMSetting *setting, const char *key, GVariant *value, GError *
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_peers(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_peers(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingWireGuardPrivate *a_priv;
|
||||
NMSettingWireGuardPrivate *b_priv;
|
||||
|
@@ -1291,12 +1291,7 @@ set_secret_flags(NMSetting * setting,
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
wep_key_type_to_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
wep_key_type_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMWepKeyType t;
|
||||
|
||||
|
@@ -740,12 +740,7 @@ nm_setting_wireless_get_seen_bssid(NMSettingWireless *setting, guint32 i)
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
_to_dbus_fcn_seen_bssids(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
_to_dbus_fcn_seen_bssids(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
if (options && options->seen_bssids)
|
||||
return options->seen_bssids[0] ? g_variant_new_strv(options->seen_bssids, -1) : NULL;
|
||||
@@ -766,13 +761,7 @@ _to_dbus_fcn_seen_bssids(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_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)
|
||||
_from_dbus_fcn_seen_bssids(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingWirelessPrivate *priv;
|
||||
gs_free const char ** s = NULL;
|
||||
@@ -1100,13 +1089,7 @@ mac_addr_rand_ok:
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_cloned_mac_address(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_cloned_mac_address(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
return !set_b
|
||||
|| nm_streq0(NM_SETTING_WIRELESS_GET_PRIVATE(set_a)->cloned_mac_address,
|
||||
@@ -1114,13 +1097,7 @@ compare_fcn_cloned_mac_address(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
static NMTernary
|
||||
compare_fcn_seen_bssids(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
compare_fcn_seen_bssids(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
return !set_b
|
||||
|| (nm_strv_ptrarray_cmp(NM_SETTING_WIRELESS_GET_PRIVATE(set_a)->seen_bssids,
|
||||
@@ -1131,12 +1108,7 @@ compare_fcn_seen_bssids(const NMSettInfoSetting * sett_info,
|
||||
/*****************************************************************************/
|
||||
|
||||
static GVariant *
|
||||
nm_setting_wireless_get_security(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
nm_setting_wireless_get_security(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
if (!_nm_connection_serialize_non_secret(flags))
|
||||
return NULL;
|
||||
|
@@ -942,12 +942,7 @@ _finalize_direct(NMSetting *setting)
|
||||
/*****************************************************************************/
|
||||
|
||||
GVariant *
|
||||
_nm_setting_property_to_dbus_fcn_direct(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
_nm_setting_property_to_dbus_fcn_direct(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
switch (property_info->property_type->direct_type) {
|
||||
case NM_VALUE_TYPE_BOOL:
|
||||
@@ -1009,12 +1004,7 @@ _nm_setting_property_to_dbus_fcn_direct(const NMSettInfoSetting *
|
||||
}
|
||||
|
||||
GVariant *
|
||||
_nm_setting_property_to_dbus_fcn_direct_mac_address(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
_nm_setting_property_to_dbus_fcn_direct_mac_address(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
const char *val;
|
||||
|
||||
@@ -1030,23 +1020,13 @@ _nm_setting_property_to_dbus_fcn_direct_mac_address(const NMSettInfoSetting *
|
||||
}
|
||||
|
||||
GVariant *
|
||||
_nm_setting_property_to_dbus_fcn_ignore(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
_nm_setting_property_to_dbus_fcn_ignore(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GVariant *
|
||||
_nm_setting_property_to_dbus_fcn_gprop(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
_nm_setting_property_to_dbus_fcn_gprop(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
nm_auto_unset_gvalue GValue prop_value = {
|
||||
0,
|
||||
@@ -1089,25 +1069,13 @@ _nm_setting_property_to_dbus_fcn_gprop(const NMSettInfoSetting * s
|
||||
}
|
||||
|
||||
gboolean
|
||||
_nm_setting_property_from_dbus_fcn_ignore(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
_nm_setting_property_from_dbus_fcn_ignore(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_nm_setting_property_from_dbus_fcn_direct_mac_address(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
_nm_setting_property_from_dbus_fcn_direct_mac_address(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gsize length = 0;
|
||||
const guint8 *array;
|
||||
@@ -1130,13 +1098,7 @@ _nm_setting_property_from_dbus_fcn_direct_mac_address(const NMSettInfoSetting *
|
||||
}
|
||||
|
||||
gboolean
|
||||
_nm_setting_property_from_dbus_fcn_direct(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
_nm_setting_property_from_dbus_fcn_direct(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
nm_assert(property_info->param_spec);
|
||||
nm_assert(NM_FLAGS_HAS(property_info->param_spec->flags, G_PARAM_WRITABLE));
|
||||
@@ -1310,13 +1272,7 @@ out_error_param_spec_validation:
|
||||
}
|
||||
|
||||
gboolean
|
||||
_nm_setting_property_from_dbus_fcn_gprop(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
GVariant * value,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
_nm_setting_property_from_dbus_fcn_gprop(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
nm_auto_unset_gvalue GValue object_value = G_VALUE_INIT;
|
||||
gs_free_error GError *local = NULL;
|
||||
@@ -2096,25 +2052,13 @@ _nm_setting_compare_flags_check(const GParamSpec * param_spec,
|
||||
}
|
||||
|
||||
NMTernary
|
||||
_nm_setting_property_compare_fcn_ignore(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
_nm_setting_property_compare_fcn_ignore(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
return NM_TERNARY_DEFAULT;
|
||||
}
|
||||
|
||||
NMTernary
|
||||
_nm_setting_property_compare_fcn_direct(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
_nm_setting_property_compare_fcn_direct(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gconstpointer p_a;
|
||||
gconstpointer p_b;
|
||||
@@ -2150,13 +2094,7 @@ _nm_setting_property_compare_fcn_direct(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
NMTernary
|
||||
_nm_setting_property_compare_fcn_default(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags)
|
||||
_nm_setting_property_compare_fcn_default(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil)
|
||||
{
|
||||
nm_assert(property_info->property_type->direct_type == NM_VALUE_TYPE_NONE);
|
||||
|
||||
@@ -3121,12 +3059,7 @@ nm_setting_to_string(NMSetting *setting)
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
_nm_setting_get_deprecated_virtual_interface_name(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
_nm_setting_get_deprecated_virtual_interface_name(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMSettingConnection *s_con;
|
||||
|
||||
|
@@ -2725,12 +2725,7 @@ _nm_setting_get_team_setting(struct _NMSetting *setting)
|
||||
}
|
||||
|
||||
GVariant *
|
||||
_nm_team_settings_property_to_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
_nm_team_settings_property_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
NMTeamSetting * self = _nm_setting_get_team_setting(setting);
|
||||
const TeamAttrData *attr_data =
|
||||
@@ -2774,10 +2769,10 @@ _nm_team_settings_property_to_dbus(const NMSettInfoSetting * sett_
|
||||
}
|
||||
|
||||
void
|
||||
_nm_team_settings_property_from_dbus_link_watchers(GVariant *dbus_value, GValue *prop_value)
|
||||
_nm_team_settings_property_from_dbus_link_watchers(
|
||||
_NM_SETT_INFO_PROP_FROM_DBUS_GPROP_FCN_ARGS _nm_nil)
|
||||
{
|
||||
g_value_take_boxed(prop_value,
|
||||
_nm_utils_team_link_watchers_from_variant(dbus_value, FALSE, NULL));
|
||||
g_value_take_boxed(to, _nm_utils_team_link_watchers_from_variant(from, FALSE, NULL));
|
||||
}
|
||||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_team_b =
|
||||
|
@@ -38,7 +38,7 @@ extern const NMSettInfoPropertType nm_sett_info_propert_type_strdict;
|
||||
|
||||
extern const NMSettInfoPropertType nm_sett_info_propert_type_assigned_mac_address;
|
||||
|
||||
void _nm_utils_strdict_from_dbus(GVariant *dbus_value, GValue *prop_value);
|
||||
void _nm_utils_strdict_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_GPROP_FCN_ARGS _nm_nil);
|
||||
|
||||
void _nm_utils_bytes_from_dbus(GVariant *dbus_value, GValue *prop_value);
|
||||
|
||||
@@ -58,14 +58,10 @@ gboolean _nm_utils_bridge_vlan_verify_list(GPtrArray * vlans,
|
||||
|
||||
NMTernary _nm_utils_bridge_compare_vlans(GPtrArray *vlans_a, GPtrArray *vlans_b);
|
||||
|
||||
GVariant *_nm_team_settings_property_to_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options);
|
||||
GVariant *_nm_team_settings_property_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil);
|
||||
|
||||
void _nm_team_settings_property_from_dbus_link_watchers(GVariant *dbus_value, GValue *prop_value);
|
||||
void _nm_team_settings_property_from_dbus_link_watchers(
|
||||
_NM_SETT_INFO_PROP_FROM_DBUS_GPROP_FCN_ARGS _nm_nil);
|
||||
|
||||
GVariant *_nm_utils_ip4_dns_to_variant(const char *const *dns, gssize len);
|
||||
GVariant *_nm_utils_ip6_dns_to_variant(const char *const *dns, gssize len);
|
||||
|
@@ -759,18 +759,18 @@ _nm_utils_hash_values_to_slist(GHashTable *hash)
|
||||
}
|
||||
|
||||
void
|
||||
_nm_utils_strdict_from_dbus(GVariant *dbus_value, GValue *prop_value)
|
||||
_nm_utils_strdict_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_GPROP_FCN_ARGS _nm_nil)
|
||||
{
|
||||
GVariantIter iter;
|
||||
const char * key, *value;
|
||||
GHashTable * hash;
|
||||
|
||||
hash = g_hash_table_new_full(nm_str_hash, g_str_equal, g_free, g_free);
|
||||
g_variant_iter_init(&iter, dbus_value);
|
||||
g_variant_iter_init(&iter, from);
|
||||
while (g_variant_iter_next(&iter, "{&s&s}", &key, &value))
|
||||
g_hash_table_insert(hash, g_strdup(key), g_strdup(value));
|
||||
|
||||
g_value_take_boxed(prop_value, hash);
|
||||
g_value_take_boxed(to, hash);
|
||||
}
|
||||
|
||||
const NMSettInfoPropertType nm_sett_info_propert_type_strdict =
|
||||
@@ -4062,12 +4062,7 @@ nm_utils_hwaddr_to_dbus(const char *str)
|
||||
}
|
||||
|
||||
GVariant *
|
||||
_nm_utils_hwaddr_cloned_get(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
_nm_utils_hwaddr_cloned_get(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gs_free char *addr = NULL;
|
||||
|
||||
@@ -4078,13 +4073,7 @@ _nm_utils_hwaddr_cloned_get(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
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)
|
||||
_nm_utils_hwaddr_cloned_set(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gsize length;
|
||||
const guint8 *array;
|
||||
@@ -4111,23 +4100,14 @@ _nm_utils_hwaddr_cloned_set(const NMSettInfoSetting * sett_info,
|
||||
}
|
||||
|
||||
gboolean
|
||||
_nm_utils_hwaddr_cloned_not_set(NMSetting * setting,
|
||||
GVariant * connection_dict,
|
||||
const char * property,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error)
|
||||
_nm_utils_hwaddr_cloned_not_set(_NM_SETT_INFO_PROP_MISSING_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
nm_assert(nm_streq0(property, "cloned-mac-address"));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
_nm_utils_hwaddr_cloned_data_synth(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
_nm_utils_hwaddr_cloned_data_synth(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gs_free char *addr = NULL;
|
||||
|
||||
@@ -4156,13 +4136,7 @@ _nm_utils_hwaddr_cloned_data_synth(const NMSettInfoSetting * sett_
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_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_utils_hwaddr_cloned_data_set(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
nm_assert(nm_streq0(property_info->name, "assigned-mac-address"));
|
||||
|
||||
@@ -5485,12 +5459,7 @@ nm_utils_base64secret_normalize(const char *base64_key,
|
||||
}
|
||||
|
||||
GVariant *
|
||||
_nm_utils_bridge_vlans_to_dbus(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options)
|
||||
_nm_utils_bridge_vlans_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gs_unref_ptrarray GPtrArray *vlans = NULL;
|
||||
GVariantBuilder builder;
|
||||
@@ -5532,13 +5501,7 @@ _nm_utils_bridge_vlans_to_dbus(const NMSettInfoSetting * sett_info
|
||||
}
|
||||
|
||||
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)
|
||||
_nm_utils_bridge_vlans_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
||||
{
|
||||
gs_unref_ptrarray GPtrArray *vlans = NULL;
|
||||
GVariantIter vlan_iter;
|
||||
|
@@ -655,26 +655,6 @@ GVariant *nm_utils_hwaddr_to_dbus(const char *str);
|
||||
typedef struct _NMSettInfoSetting NMSettInfoSetting;
|
||||
typedef struct _NMSettInfoProperty NMSettInfoProperty;
|
||||
|
||||
typedef GVariant *(*NMSettInfoPropToDBusFcn)(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty * property_info,
|
||||
NMConnection * connection,
|
||||
NMSetting * setting,
|
||||
NMConnectionSerializationFlags flags,
|
||||
const NMConnectionSerializationOptions *options);
|
||||
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,
|
||||
NMSettingParseFlags parse_flags,
|
||||
GError ** error);
|
||||
typedef void (*NMSettInfoPropGPropFromDBusFcn)(GVariant *from, GValue *to);
|
||||
|
||||
const NMSettInfoSetting *nmtst_sett_info_settings(void);
|
||||
|
||||
typedef enum _nm_packed {
|
||||
@@ -713,29 +693,46 @@ typedef struct {
|
||||
* allowed for backward compatibility. */
|
||||
bool from_dbus_direct_allow_transform : 1;
|
||||
|
||||
#define _NM_SETT_INFO_PROP_COMPARE_FCN_ARGS \
|
||||
const NMSettInfoSetting *sett_info, const NMSettInfoProperty *property_info, \
|
||||
NMConnection *con_a, NMSetting *set_a, NMConnection *con_b, NMSetting *set_b, \
|
||||
NMSettingCompareFlags flags
|
||||
|
||||
/* compare_fcn() returns a ternary, where DEFAULT means that the property should not
|
||||
* be compared due to the compare @flags. A TRUE/FALSE result means that the property is
|
||||
* equal/not-equal.
|
||||
*
|
||||
* The "b" setting may be %NULL, in which case the function only determines whether
|
||||
* the setting should be compared (TRUE) or not (DEFAULT). */
|
||||
NMTernary (*compare_fcn)(const NMSettInfoSetting * sett_info,
|
||||
const NMSettInfoProperty *property_info,
|
||||
NMConnection * con_a,
|
||||
NMSetting * set_a,
|
||||
NMConnection * con_b,
|
||||
NMSetting * set_b,
|
||||
NMSettingCompareFlags flags);
|
||||
NMTernary (*compare_fcn)(_NM_SETT_INFO_PROP_COMPARE_FCN_ARGS _nm_nil);
|
||||
|
||||
NMSettInfoPropToDBusFcn to_dbus_fcn;
|
||||
NMSettInfoPropFromDBusFcn from_dbus_fcn;
|
||||
NMSettInfoPropMissingFromDBusFcn missing_from_dbus_fcn;
|
||||
#define _NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS \
|
||||
const NMSettInfoSetting *sett_info, const NMSettInfoProperty *property_info, \
|
||||
NMConnection *connection, NMSetting *setting, NMConnectionSerializationFlags flags, \
|
||||
const NMConnectionSerializationOptions *options
|
||||
|
||||
GVariant *(*to_dbus_fcn)(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil);
|
||||
|
||||
#define _NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS \
|
||||
const NMSettInfoSetting *sett_info, const NMSettInfoProperty *property_info, \
|
||||
NMSetting *setting, GVariant *connection_dict, GVariant *value, \
|
||||
NMSettingParseFlags parse_flags, GError **error
|
||||
|
||||
gboolean (*from_dbus_fcn)(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil);
|
||||
|
||||
#define _NM_SETT_INFO_PROP_MISSING_FROM_DBUS_FCN_ARGS \
|
||||
NMSetting *setting, GVariant *connection_dict, const char *property, \
|
||||
NMSettingParseFlags parse_flags, GError **error
|
||||
|
||||
gboolean (*missing_from_dbus_fcn)(_NM_SETT_INFO_PROP_MISSING_FROM_DBUS_FCN_ARGS _nm_nil);
|
||||
|
||||
struct {
|
||||
#define _NM_SETT_INFO_PROP_FROM_DBUS_GPROP_FCN_ARGS GVariant *from, GValue *to
|
||||
|
||||
/* Only if from_dbus_fcn is set to _nm_setting_property_from_dbus_fcn_gprop.
|
||||
* This is an optional handler for converting between GVariant and
|
||||
* GValue. */
|
||||
NMSettInfoPropGPropFromDBusFcn gprop_fcn;
|
||||
void (*gprop_fcn)(_NM_SETT_INFO_PROP_FROM_DBUS_GPROP_FCN_ARGS _nm_nil);
|
||||
} typdata_from_dbus;
|
||||
|
||||
struct {
|
||||
|
Reference in New Issue
Block a user