From 2f94dba7385fd0e0ef19a06eb4a2fcf6c43d7946 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Mon, 14 Feb 2022 19:23:28 +0100 Subject: New upstream version 1.35.91 --- src/libnmc-setting/nm-meta-setting-access.c | 74 +-- src/libnmc-setting/nm-meta-setting-access.h | 40 +- src/libnmc-setting/nm-meta-setting-base-impl.c | 4 +- src/libnmc-setting/nm-meta-setting-base-impl.h | 16 +- src/libnmc-setting/nm-meta-setting-desc.c | 598 ++++++++++++++----------- src/libnmc-setting/nm-meta-setting-desc.h | 94 ++-- src/libnmc-setting/settings-docs-input.xml | 274 ++++++----- src/libnmc-setting/settings-docs.h | 3 + src/libnmc-setting/settings-docs.h.in | 3 + src/libnmc-setting/tests/test-libnmc-setting.c | 98 ++-- 10 files changed, 677 insertions(+), 527 deletions(-) (limited to 'src/libnmc-setting') diff --git a/src/libnmc-setting/nm-meta-setting-access.c b/src/libnmc-setting/nm-meta-setting-access.c index cd4cbdd5..7f679ae5 100644 --- a/src/libnmc-setting/nm-meta-setting-access.c +++ b/src/libnmc-setting/nm-meta-setting-access.c @@ -72,7 +72,7 @@ nm_meta_setting_info_editor_find_by_setting(NMSetting *setting) const NMMetaPropertyInfo * nm_meta_setting_info_editor_get_property_info(const NMMetaSettingInfoEditor *setting_info, - const char * property_name) + const char *property_name) { guint i; @@ -109,7 +109,7 @@ const NMMetaPropertyInfo * nm_meta_property_info_find_by_name(const char *setting_name, const char *property_name) { const NMMetaSettingInfoEditor *setting_info; - const NMMetaPropertyInfo * property_info; + const NMMetaPropertyInfo *property_info; setting_info = nm_meta_setting_info_editor_find_by_name(setting_name, FALSE); if (!setting_info) @@ -128,7 +128,7 @@ const NMMetaPropertyInfo * nm_meta_property_info_find_by_setting(NMSetting *setting, const char *property_name) { const NMMetaSettingInfoEditor *setting_info; - const NMMetaPropertyInfo * property_info; + const NMMetaPropertyInfo *property_info; setting_info = nm_meta_setting_info_editor_find_by_setting(setting); if (!setting_info) @@ -193,8 +193,8 @@ nm_meta_abstract_info_get_name(const NMMetaAbstractInfo *abstract_info, gboolean const NMMetaAbstractInfo *const * nm_meta_abstract_info_get_nested(const NMMetaAbstractInfo *abstract_info, - guint * out_len, - gpointer * nested_to_free) + guint *out_len, + gpointer *nested_to_free) { const NMMetaAbstractInfo *const *nested; guint l = 0; @@ -219,16 +219,16 @@ nm_meta_abstract_info_get_nested(const NMMetaAbstractInfo *abstract_info, } gconstpointer -nm_meta_abstract_info_get(const NMMetaAbstractInfo * abstract_info, - const NMMetaEnvironment * environment, +nm_meta_abstract_info_get(const NMMetaAbstractInfo *abstract_info, + const NMMetaEnvironment *environment, gpointer environment_user_data, gpointer target, gpointer target_data, NMMetaAccessorGetType get_type, NMMetaAccessorGetFlags get_flags, NMMetaAccessorGetOutFlags *out_flags, - gboolean * out_is_default, - gpointer * out_to_free) + gboolean *out_is_default, + gpointer *out_to_free) { nm_assert(abstract_info); nm_assert(abstract_info->meta_type); @@ -254,13 +254,13 @@ nm_meta_abstract_info_get(const NMMetaAbstractInfo * abstract_info, } const char *const * -nm_meta_abstract_info_complete(const NMMetaAbstractInfo * abstract_info, - const NMMetaEnvironment * environment, +nm_meta_abstract_info_complete(const NMMetaAbstractInfo *abstract_info, + const NMMetaEnvironment *environment, gpointer environment_user_data, const NMMetaOperationContext *operation_context, - const char * text, - gboolean * out_complete_filename, - char *** out_to_free) + const char *text, + gboolean *out_complete_filename, + char ***out_to_free) { const char *const *values; gsize i, j, text_len; @@ -319,7 +319,7 @@ nm_meta_abstract_info_complete(const NMMetaAbstractInfo * abstract_info, return (const char *const *) v; } else { const char *const *v = values; - char ** r; + char **r; for (i = 0, j = 0; v[i]; i++) { if (strncmp(v[i], text, text_len) != 0) @@ -347,7 +347,7 @@ nm_meta_abstract_info_complete(const NMMetaAbstractInfo * abstract_info, char * nm_meta_abstract_info_get_nested_names_str(const NMMetaAbstractInfo *abstract_info, - const char * name_prefix) + const char *name_prefix) { gs_free gpointer nested_to_free = NULL; const NMMetaAbstractInfo *const *nested; @@ -364,7 +364,7 @@ nm_meta_abstract_info_get_nested_names_str(const NMMetaAbstractInfo *abstract_in char * nm_meta_abstract_infos_get_names_str(const NMMetaAbstractInfo *const *fields_array, - const char * name_prefix) + const char *name_prefix) { GString *str; guint i; @@ -417,7 +417,7 @@ _output_selection_pack(const NMMetaAbstractInfo *const *fields_array, GArray *ar memcpy(pdata, str->str, str->len); for (i = 0; i < len; i++) { const OutputSelectionItem *a = &g_array_index(array, OutputSelectionItem, i); - NMMetaSelectionItem * p = (NMMetaSelectionItem *) &result->items[i]; + NMMetaSelectionItem *p = (NMMetaSelectionItem *) &result->items[i]; p->info = fields_array[a->idx]; p->idx = a->idx; @@ -433,19 +433,19 @@ _output_selection_pack(const NMMetaAbstractInfo *const *fields_array, GArray *ar static gboolean _output_selection_select_one(const NMMetaAbstractInfo *const *fields_array, - const char * fields_prefix, - const char * fields_str, + const char *fields_prefix, + const char *fields_str, gboolean validate_nested, - GArray ** p_array, - GString ** p_str, - GError ** error) + GArray **p_array, + GString **p_str, + GError **error) { guint i, j; - const char * i_name; - const char * right; + const char *i_name; + const char *right; gboolean found = FALSE; const NMMetaAbstractInfo *fields_array_failure = NULL; - gs_free char * fields_str_clone = NULL; + gs_free char *fields_str_clone = NULL; nm_assert(fields_str); nm_assert(p_array); @@ -465,7 +465,7 @@ _output_selection_select_one(const NMMetaAbstractInfo *const *fields_array, goto not_found; for (i = 0; fields_array[i]; i++) { - const NMMetaAbstractInfo * fi = fields_array[i]; + const NMMetaAbstractInfo *fi = fields_array[i]; const NMMetaAbstractInfo *const *nested; gs_free gpointer nested_to_free = NULL; @@ -536,7 +536,7 @@ not_found: } { - GString * str; + GString *str; OutputSelectionItem s = { .idx = i, }; @@ -588,14 +588,14 @@ nm_meta_selection_create_all(const NMMetaAbstractInfo *const *fields_array) NMMetaSelectionResultList * nm_meta_selection_create_parse_one( const NMMetaAbstractInfo *const *fields_array, - const char * fields_prefix, + const char *fields_prefix, const char * fields_str, /* one field selector (contains no commas) and is already stripped of spaces. */ gboolean validate_nested, GError **error) { - gs_unref_array GArray *array = NULL; - nm_auto_free_gstring GString *str = NULL; + gs_unref_array GArray *array = NULL; + nm_auto_free_gstring GString *str = NULL; g_return_val_if_fail(!error || !*error, NULL); nm_assert(fields_str && !strchr(fields_str, ',')); @@ -614,15 +614,15 @@ nm_meta_selection_create_parse_one( NMMetaSelectionResultList * nm_meta_selection_create_parse_list( const NMMetaAbstractInfo *const *fields_array, - const char * fields_str, /* a comma separated list of selectors */ + const char *fields_str, /* a comma separated list of selectors */ gboolean validate_nested, - GError ** error) + GError **error) { - gs_unref_array GArray *array = NULL; + gs_unref_array GArray *array = NULL; nm_auto_free_gstring GString *str = NULL; - gs_free char * fields_str_clone = NULL; - char * fields_str_cur; - char * fields_str_next; + gs_free char *fields_str_clone = NULL; + char *fields_str_cur; + char *fields_str_next; g_return_val_if_fail(!error || !*error, NULL); diff --git a/src/libnmc-setting/nm-meta-setting-access.h b/src/libnmc-setting/nm-meta-setting-access.h index 81aa3b6f..9b00eb0a 100644 --- a/src/libnmc-setting/nm-meta-setting-access.h +++ b/src/libnmc-setting/nm-meta-setting-access.h @@ -20,10 +20,10 @@ const NMMetaSettingInfoEditor *nm_meta_setting_info_editor_find_by_setting(NMSet const NMMetaPropertyInfo * nm_meta_setting_info_editor_get_property_info(const NMMetaSettingInfoEditor *setting_info, - const char * property_name); + const char *property_name); const NMMetaPropertyInfo *nm_meta_property_info_find_by_name(const char *setting_name, const char *property_name); -const NMMetaPropertyInfo *nm_meta_property_info_find_by_setting(NMSetting * setting, +const NMMetaPropertyInfo *nm_meta_property_info_find_by_setting(NMSetting *setting, const char *property_name); gboolean nm_meta_setting_info_editor_has_secrets(const NMMetaSettingInfoEditor *setting_info); @@ -39,41 +39,41 @@ const char *nm_meta_abstract_info_get_name(const NMMetaAbstractInfo *abstract_in const NMMetaAbstractInfo *const * nm_meta_abstract_info_get_nested(const NMMetaAbstractInfo *abstract_info, - guint * out_len, - gpointer * nested_to_free); + guint *out_len, + gpointer *nested_to_free); -gconstpointer nm_meta_abstract_info_get(const NMMetaAbstractInfo * abstract_info, - const NMMetaEnvironment * environment, +gconstpointer nm_meta_abstract_info_get(const NMMetaAbstractInfo *abstract_info, + const NMMetaEnvironment *environment, gpointer environment_user_data, gpointer target, gpointer target_data, NMMetaAccessorGetType get_type, NMMetaAccessorGetFlags get_flags, NMMetaAccessorGetOutFlags *out_flags, - gboolean * out_is_default, - gpointer * out_to_free); + gboolean *out_is_default, + gpointer *out_to_free); const char *const *nm_meta_abstract_info_complete(const NMMetaAbstractInfo *abstract_info, - const NMMetaEnvironment * environment, + const NMMetaEnvironment *environment, gpointer environment_user_data, const NMMetaOperationContext *operation_context, - const char * text, + const char *text, gboolean *out_complete_filename, - char *** out_to_free); + char ***out_to_free); /*****************************************************************************/ char *nm_meta_abstract_info_get_nested_names_str(const NMMetaAbstractInfo *abstract_info, - const char * name_prefix); + const char *name_prefix); char *nm_meta_abstract_infos_get_names_str(const NMMetaAbstractInfo *const *fields_array, - const char * name_prefix); + const char *name_prefix); /*****************************************************************************/ typedef struct { const NMMetaAbstractInfo *info; - const char * self_selection; - const char * sub_selection; + const char *self_selection; + const char *sub_selection; guint idx; } NMMetaSelectionItem; @@ -86,14 +86,14 @@ NMMetaSelectionResultList * nm_meta_selection_create_all(const NMMetaAbstractInfo *const *fields_array); NMMetaSelectionResultList * nm_meta_selection_create_parse_one(const NMMetaAbstractInfo *const *fields_array, - const char * fields_prefix, - const char * fields_str, + const char *fields_prefix, + const char *fields_str, gboolean validate_nested, - GError ** error); + GError **error); NMMetaSelectionResultList * nm_meta_selection_create_parse_list(const NMMetaAbstractInfo *const *fields_array, - const char * fields_str, + const char *fields_str, gboolean validate_nested, - GError ** error); + GError **error); #endif /* _NM_META_SETTING_ACCESS_H__ */ diff --git a/src/libnmc-setting/nm-meta-setting-base-impl.c b/src/libnmc-setting/nm-meta-setting-base-impl.c index 8c1ad10e..cd55779f 100644 --- a/src/libnmc-setting/nm-meta-setting-base-impl.c +++ b/src/libnmc-setting/nm-meta-setting-base-impl.c @@ -646,8 +646,8 @@ nm_meta_setting_infos_by_gtype(GType gtype) { #if _NM_META_SETTING_BASE_IMPL_LIBNM nm_auto_unref_gtypeclass GTypeClass *gtypeclass_unref = NULL; - GTypeClass * gtypeclass; - NMSettingClass * klass; + GTypeClass *gtypeclass; + NMSettingClass *klass; if (!g_type_is_a(gtype, NM_TYPE_SETTING)) goto out_none; diff --git a/src/libnmc-setting/nm-meta-setting-base-impl.h b/src/libnmc-setting/nm-meta-setting-base-impl.h index eba1fb96..ea4f85ff 100644 --- a/src/libnmc-setting/nm-meta-setting-base-impl.h +++ b/src/libnmc-setting/nm-meta-setting-base-impl.h @@ -73,18 +73,18 @@ typedef struct { const char *(*uri_func)(NMSetting8021x *setting); const char *(*passwd_func)(NMSetting8021x *setting); NMSettingSecretFlags (*pwflag_func)(NMSetting8021x *setting); - gboolean (*set_cert_func)(NMSetting8021x * setting, - const char * value, + gboolean (*set_cert_func)(NMSetting8021x *setting, + const char *value, NMSetting8021xCKScheme scheme, NMSetting8021xCKFormat *out_format, - GError ** error); - gboolean (*set_private_key_func)(NMSetting8021x * setting, - const char * value, - const char * password, + GError **error); + gboolean (*set_private_key_func)(NMSetting8021x *setting, + const char *value, + const char *password, NMSetting8021xCKScheme scheme, NMSetting8021xCKFormat *out_format, - GError ** error); - const char * file_suffix; + GError **error); + const char *file_suffix; NMSetting8021xSchemeType scheme_type; bool is_secret : 1; } NMSetting8021xSchemeVtable; diff --git a/src/libnmc-setting/nm-meta-setting-desc.c b/src/libnmc-setting/nm-meta-setting-desc.c index 5bb2b451..4a6f3882 100644 --- a/src/libnmc-setting/nm-meta-setting-desc.c +++ b/src/libnmc-setting/nm-meta-setting-desc.c @@ -49,7 +49,7 @@ _gtype_property_get_gtype(GType gtype, const char *property_name) /* given @gtype, a type for a GObject, lookup the property @property_name * and return its value_type. */ if (G_TYPE_IS_CLASSED(gtype)) { - GParamSpec * param_spec; + GParamSpec *param_spec; nm_auto_unref_gtypeclass GTypeClass *gtypeclass = g_type_class_ref(gtype); if (G_IS_OBJECT_CLASS(gtypeclass)) { @@ -88,12 +88,12 @@ _int64_cmp_desc(gconstpointer a, gconstpointer b, gpointer user_data) static gint64 * _value_str_as_index_list(const char *value, gsize *out_len) { - gs_free char *str_clone_free = NULL; - gboolean str_cloned = FALSE; - char * str; - gsize i, j; - gsize n_alloc; - gsize len; + gs_free char *str_clone_free = NULL; + gboolean str_cloned = FALSE; + char *str; + gsize i, j; + gsize n_alloc; + gsize len; gs_free gint64 *arr = NULL; *out_len = 0; @@ -244,10 +244,10 @@ _parse_ip_address(int family, const char *address, GError **error) { gs_free char *ip_str = NULL; const int MAX_PREFIX = (family == AF_INET) ? 32 : 128; - NMIPAddress * addr; - char * plen; + NMIPAddress *addr; + char *plen; int prefix; - GError * local = NULL; + GError *local = NULL; g_return_val_if_fail(address, NULL); g_return_val_if_fail(!error || !*error, NULL); @@ -285,19 +285,19 @@ _parse_ip_address(int family, const char *address, GError **error) static NMIPRoute * _parse_ip_route(int family, const char *str, GError **error) { - const int MAX_PREFIX = (family == AF_INET) ? 32 : 128; - const char * next_hop = NULL; - int prefix; - NMIPRoute * route = NULL; - GError * local = NULL; - gint64 metric = -1; - guint i; - gs_free const char **routev = NULL; - gs_free char * str_clean_free = NULL; - const char * str_clean; - gs_free char * dest_clone = NULL; - const char * dest; - const char * plen; + const int MAX_PREFIX = (family == AF_INET) ? 32 : 128; + const char *next_hop = NULL; + int prefix; + NMIPRoute *route = NULL; + GError *local = NULL; + gint64 metric = -1; + guint i; + gs_free const char **routev = NULL; + gs_free char *str_clean_free = NULL; + const char *str_clean; + gs_free char *dest_clone = NULL; + const char *dest; + const char *plen; gs_unref_hashtable GHashTable *attrs = NULL; #define ROUTE_SYNTAX \ _("The valid syntax is: 'ip[/prefix] [next-hop] [metric] [attribute=val]... [,ip[/prefix] " \ @@ -357,9 +357,9 @@ _parse_ip_route(int family, const char *str, GError **error) } metric = tmp64; } else if (strchr(routev[i], '=')) { - GHashTableIter iter; - char * iter_key; - GVariant * iter_value; + GHashTableIter iter; + char *iter_key; + GVariant *iter_value; gs_unref_hashtable GHashTable *tmp_attrs = NULL; tmp_attrs = nm_utils_parse_variant_attributes(routev[i], @@ -409,8 +409,8 @@ _parse_ip_route(int family, const char *str, GError **error) if (attrs) { GHashTableIter iter; - char * name; - GVariant * variant; + char *name; + GVariant *variant; g_hash_table_iter_init(&iter, attrs); while (g_hash_table_iter_next(&iter, (gpointer *) &name, (gpointer *) &variant)) @@ -445,7 +445,7 @@ nmc_proxy_check_script(const char *script, char **out_script, GError **error) _PAC_SCRIPT_TYPE_FILE, _PAC_SCRIPT_TYPE_JSON, } desired_type = _PAC_SCRIPT_TYPE_GUESS; - const char * filename = NULL; + const char *filename = NULL; size_t c_len = 0; gs_free char *script_clone = NULL; @@ -588,7 +588,7 @@ static void _env_warn_fcn(const NMMetaEnvironment *environment, gpointer environment_user_data, NMMetaEnvWarnLevel warn_level, - const char * fmt_l10n, + const char *fmt_l10n, ...) { va_list ap; @@ -636,7 +636,7 @@ static gboolean _set_fcn_optionlist(ARGS_SET_FCN); static gboolean _SET_FCN_DO_RESET_DEFAULT(const NMMetaPropertyInfo *property_info, NMMetaAccessorModifier modifier, - const char * value) + const char *value) { nm_assert(property_info); nm_assert(!property_info->property_type->set_supports_remove); @@ -649,7 +649,7 @@ _SET_FCN_DO_RESET_DEFAULT(const NMMetaPropertyInfo *property_info, static gboolean _SET_FCN_DO_RESET_DEFAULT_WITH_SUPPORTS_REMOVE(const NMMetaPropertyInfo *property_info, NMMetaAccessorModifier modifier, - const char * value) + const char *value) { nm_assert(property_info); nm_assert(property_info->property_type->set_supports_remove); @@ -724,9 +724,9 @@ static gboolean _gobject_property_is_default(NMSetting *setting, const char *prop_name) { nm_auto_unset_gvalue GValue v = G_VALUE_INIT; - GParamSpec * pspec; - GHashTable * ht; - char ** strv; + GParamSpec *pspec; + GHashTable *ht; + char **strv; pspec = g_object_class_find_property(G_OBJECT_GET_CLASS(G_OBJECT(setting)), prop_name); if (!G_IS_PARAM_SPEC(pspec)) @@ -750,7 +750,7 @@ static gboolean _gobject_property_reset(NMSetting *setting, const char *prop_name, gboolean reset_default) { nm_auto_unset_gvalue GValue v = G_VALUE_INIT; - GParamSpec * pspec; + GParamSpec *pspec; pspec = g_object_class_find_property(G_OBJECT_GET_CLASS(G_OBJECT(setting)), prop_name); if (!G_IS_PARAM_SPEC(pspec)) @@ -772,8 +772,8 @@ _gobject_property_reset_default(NMSetting *setting, const char *prop_name) static const char * _coerce_str_emptyunset(NMMetaAccessorGetType get_type, gboolean is_default, - const char * cstr, - char ** out_str) + const char *cstr, + char **out_str) { nm_assert(out_str && !*out_str); nm_assert((!is_default && cstr && cstr[0] != '\0') || NM_IN_STRSET(cstr, NULL, "")); @@ -803,7 +803,7 @@ _coerce_str_emptyunset(NMMetaAccessorGetType get_type, #define RETURN_STR_EMPTYUNSET(get_type, is_default, cstr) \ G_STMT_START \ { \ - char * _str = NULL; \ + char *_str = NULL; \ const char *_cstr; \ \ _cstr = _coerce_str_emptyunset((get_type), (is_default), (cstr), &_str); \ @@ -824,13 +824,13 @@ _is_default(const NMMetaPropertyInfo *property_info, NMSetting *setting) static gconstpointer _get_fcn_gobject_impl(const NMMetaPropertyInfo *property_info, - NMSetting * setting, + NMSetting *setting, NMMetaAccessorGetType get_type, gboolean handle_emptyunset, - gboolean * out_is_default, - gpointer * out_to_free) + gboolean *out_is_default, + gpointer *out_to_free) { - const char * cstr; + const char *cstr; GType gtype_prop; nm_auto_unset_gvalue GValue val = G_VALUE_INIT; gboolean is_default; @@ -910,9 +910,9 @@ _get_fcn_gobject_impl(const NMMetaPropertyInfo *property_info, } if (gtype_prop == G_TYPE_HASH_TABLE) { - GHashTable * strdict; + GHashTable *strdict; gs_free const char **keys = NULL; - GString * str; + GString *str; gsize i; nm_assert(property_info->setting_info @@ -927,8 +927,8 @@ _get_fcn_gobject_impl(const NMMetaPropertyInfo *property_info, str = g_string_new(NULL); for (i = 0; keys[i]; i++) { - const char * key = keys[i]; - const char * v = g_hash_table_lookup(strdict, key); + const char *key = keys[i]; + const char *v = g_hash_table_lookup(strdict, key); gs_free char *escaped_key = NULL; gs_free char *escaped_val = NULL; @@ -945,7 +945,8 @@ _get_fcn_gobject_impl(const NMMetaPropertyInfo *property_info, return NULL; } -static gconstpointer _get_fcn_gobject(ARGS_GET_FCN) +static gconstpointer +_get_fcn_gobject(ARGS_GET_FCN) { return _get_fcn_gobject_impl(property_info, setting, @@ -955,15 +956,16 @@ static gconstpointer _get_fcn_gobject(ARGS_GET_FCN) out_to_free); } -static gconstpointer _get_fcn_gobject_int(ARGS_GET_FCN) +static gconstpointer +_get_fcn_gobject_int(ARGS_GET_FCN) { - GParamSpec * pspec; + GParamSpec *pspec; nm_auto_unset_gvalue GValue gval = G_VALUE_INIT; gboolean is_uint64 = FALSE; NMMetaSignUnsignInt64 v; guint base = 10; const NMMetaUtilsIntValueInfo *value_infos; - char * return_str; + char *return_str; RETURN_UNSUPPORTED_GET_TYPE(); @@ -1034,7 +1036,8 @@ static gconstpointer _get_fcn_gobject_int(ARGS_GET_FCN) RETURN_STR_TO_FREE(return_str); } -static gconstpointer _get_fcn_gobject_mtu(ARGS_GET_FCN) +static gconstpointer +_get_fcn_gobject_mtu(ARGS_GET_FCN) { guint32 mtu; @@ -1058,7 +1061,8 @@ static gconstpointer _get_fcn_gobject_mtu(ARGS_GET_FCN) RETURN_STR_TO_FREE(g_strdup_printf("%u", (unsigned) mtu)); } -static gconstpointer _get_fcn_gobject_secret_flags(ARGS_GET_FCN) +static gconstpointer +_get_fcn_gobject_secret_flags(ARGS_GET_FCN) { guint v; GValue val = G_VALUE_INIT; @@ -1072,12 +1076,13 @@ static gconstpointer _get_fcn_gobject_secret_flags(ARGS_GET_FCN) RETURN_STR_TO_FREE(secret_flags_to_string(v, get_type)); } -static gconstpointer _get_fcn_gobject_enum(ARGS_GET_FCN) +static gconstpointer +_get_fcn_gobject_enum(ARGS_GET_FCN) { - GType gtype = 0; + GType gtype = 0; nm_auto_unref_gtypeclass GTypeClass *gtype_class = NULL; nm_auto_unref_gtypeclass GTypeClass *gtype_prop_class = NULL; - const struct _NMUtilsEnumValueInfo * value_infos = NULL; + const struct _NMUtilsEnumValueInfo *value_infos = NULL; gboolean has_gtype = FALSE; nm_auto_unset_gvalue GValue gval = G_VALUE_INIT; gint64 v; @@ -1086,9 +1091,9 @@ static gconstpointer _get_fcn_gobject_enum(ARGS_GET_FCN) gboolean format_numeric_hex_unknown = FALSE; gboolean format_text = FALSE; gboolean format_text_l10n = FALSE; - gs_free char * s = NULL; + gs_free char *s = NULL; char s_numeric[64]; - GParamSpec * pspec; + GParamSpec *pspec; RETURN_UNSUPPORTED_GET_TYPE(); @@ -1221,7 +1226,8 @@ static gconstpointer _get_fcn_gobject_enum(ARGS_GET_FCN) /*****************************************************************************/ -static gboolean _set_fcn_gobject_string(ARGS_SET_FCN) +static gboolean +_set_fcn_gobject_string(ARGS_SET_FCN) { gs_free char *to_free = NULL; @@ -1264,10 +1270,10 @@ static gboolean _set_fcn_gobject_string(ARGS_SET_FCN) static gboolean _set_fcn_gobject_bool_impl(const NMMetaPropertyInfo *property_info, - NMSetting * setting, + NMSetting *setting, NMMetaAccessorModifier modifier, - const char * value, - GError ** error) + const char *value, + GError **error) { gboolean val_bool; @@ -1281,12 +1287,14 @@ _set_fcn_gobject_bool_impl(const NMMetaPropertyInfo *property_info, return TRUE; } -static gboolean _set_fcn_gobject_bool(ARGS_SET_FCN) +static gboolean +_set_fcn_gobject_bool(ARGS_SET_FCN) { return _set_fcn_gobject_bool_impl(property_info, setting, modifier, value, error); } -static gboolean _set_fcn_gobject_ternary(ARGS_SET_FCN) +static gboolean +_set_fcn_gobject_ternary(ARGS_SET_FCN) { NMTernary val; @@ -1303,10 +1311,11 @@ static gboolean _set_fcn_gobject_ternary(ARGS_SET_FCN) return TRUE; } -static gboolean _set_fcn_gobject_int(ARGS_SET_FCN) +static gboolean +_set_fcn_gobject_int(ARGS_SET_FCN) { int errsv; - const GParamSpec * pspec; + const GParamSpec *pspec; nm_auto_unset_gvalue GValue gval = G_VALUE_INIT; gboolean is_uint64; NMMetaSignUnsignInt64 v; @@ -1330,7 +1339,7 @@ static gboolean _set_fcn_gobject_int(ARGS_SET_FCN) if (value && (value_infos = property_info->property_typ_data->subtype.gobject_int.value_infos)) { gs_free char *vv_free = NULL; - const char * vv; + const char *vv; vv = nm_strstrip_avoid_copy_a(300, value, &vv_free); for (; value_infos->nick; value_infos++) { @@ -1454,10 +1463,11 @@ have_value_from_nick: return TRUE; } -static gboolean _set_fcn_gobject_mtu(ARGS_SET_FCN) +static gboolean +_set_fcn_gobject_mtu(ARGS_SET_FCN) { nm_auto_unset_gvalue GValue gval = G_VALUE_INIT; - const GParamSpec * pspec; + const GParamSpec *pspec; gint64 v; if (_SET_FCN_DO_RESET_DEFAULT(property_info, modifier, value)) @@ -1496,7 +1506,8 @@ static gboolean _set_fcn_gobject_mtu(ARGS_SET_FCN) #define IEEE802154_ADDR_LEN 8 #endif -static gboolean _set_fcn_gobject_mac(ARGS_SET_FCN) +static gboolean +_set_fcn_gobject_mac(ARGS_SET_FCN) { NMMetaPropertyTypeMacMode mode; gboolean valid; @@ -1528,12 +1539,13 @@ static gboolean _set_fcn_gobject_mac(ARGS_SET_FCN) return TRUE; } -static gboolean _set_fcn_gobject_enum(ARGS_SET_FCN) +static gboolean +_set_fcn_gobject_enum(ARGS_SET_FCN) { - GType gtype = 0; - GType gtype_prop; - gboolean has_gtype = FALSE; - nm_auto_unset_gvalue GValue gval = G_VALUE_INIT; + GType gtype = 0; + GType gtype_prop; + gboolean has_gtype = FALSE; + nm_auto_unset_gvalue GValue gval = G_VALUE_INIT; nm_auto_unref_gtypeclass GTypeClass *gtype_prop_class = NULL; nm_auto_unref_gtypeclass GTypeClass *gtype_class = NULL; gboolean is_flags; @@ -1619,7 +1631,7 @@ static gboolean _set_fcn_gobject_enum(ARGS_SET_FCN) fail: if (error) { gs_free const char **valid_all = NULL; - gs_free const char * valid_str = NULL; + gs_free const char *valid_str = NULL; gboolean has_minmax = FALSE; int min = G_MININT; int max = G_MAXINT; @@ -1661,14 +1673,15 @@ fail: /*****************************************************************************/ -static const char *const *_values_fcn_gobject_enum(ARGS_VALUES_FCN) +static const char *const * +_values_fcn_gobject_enum(ARGS_VALUES_FCN) { GType gtype = 0; gboolean has_gtype = FALSE; gboolean has_minmax = FALSE; int min = G_MININT; int max = G_MAXINT; - char ** v; + char **v; if (property_info->property_typ_data) { if (property_info->property_typ_data->subtype.gobject_enum.min @@ -1707,7 +1720,8 @@ static const char *const *_values_fcn_gobject_enum(ARGS_VALUES_FCN) /*****************************************************************************/ -static const char *const *_complete_fcn_gobject_bool(ARGS_COMPLETE_FCN) +static const char *const * +_complete_fcn_gobject_bool(ARGS_COMPLETE_FCN) { static const char *const v[] = { "true", @@ -1726,7 +1740,8 @@ static const char *const *_complete_fcn_gobject_bool(ARGS_COMPLETE_FCN) return v; } -static const char *const *_complete_fcn_gobject_ternary(ARGS_COMPLETE_FCN) +static const char *const * +_complete_fcn_gobject_ternary(ARGS_COMPLETE_FCN) { static const char *const v[] = { "on", @@ -1748,12 +1763,13 @@ static const char *const *_complete_fcn_gobject_ternary(ARGS_COMPLETE_FCN) return v; } -static const char *const *_complete_fcn_gobject_devices(ARGS_COMPLETE_FCN) +static const char *const * +_complete_fcn_gobject_devices(ARGS_COMPLETE_FCN) { NMDevice *const *devices = NULL; guint i, j; guint len = 0; - char ** ifnames; + char **ifnames; if (environment && environment->get_nm_devices) { devices = environment->get_nm_devices(environment, environment_user_data, &len); @@ -1860,9 +1876,9 @@ secret_flags_to_string(guint32 flags, NMMetaAccessorGetType get_type) static const char * _multilist_do_validate(const NMMetaPropertyInfo *property_info, - NMSetting * setting, - const char * item, - GError ** error) + NMSetting *setting, + const char *item, + GError **error) { if (property_info->property_typ_data->values_static) { nm_assert(!property_info->property_typ_data->subtype.multilist.validate_fcn); @@ -1882,7 +1898,8 @@ _multilist_do_validate(const NMMetaPropertyInfo *property_info, return item; } -static gconstpointer _get_fcn_multilist(ARGS_GET_FCN) +static gconstpointer +_get_fcn_multilist(ARGS_GET_FCN) { return _get_fcn_gobject_impl( property_info, @@ -1895,7 +1912,7 @@ static gconstpointer _get_fcn_multilist(ARGS_GET_FCN) static gboolean _multilist_clear_property(const NMMetaPropertyInfo *property_info, - NMSetting * setting, + NMSetting *setting, gboolean is_set /* or else set default */) { if (property_info->property_typ_data->subtype.multilist.clear_emptyunset_fcn) { @@ -1909,7 +1926,8 @@ _multilist_clear_property(const NMMetaPropertyInfo *property_info, return _gobject_property_reset(setting, property_info->property_name, FALSE); } -static gboolean _set_fcn_multilist(ARGS_SET_FCN) +static gboolean +_set_fcn_multilist(ARGS_SET_FCN) { gs_free const char **strv = NULL; gsize i, j, nstrv; @@ -2000,7 +2018,8 @@ static gboolean _set_fcn_multilist(ARGS_SET_FCN) return TRUE; } -static gboolean _set_fcn_optionlist(ARGS_SET_FCN) +static gboolean +_set_fcn_optionlist(ARGS_SET_FCN) { gs_free const char **strv = NULL; gs_free const char **strv_val = NULL; @@ -2112,7 +2131,7 @@ validate_flags(NMSetting *setting, const char *prop, guint val, GError **error) if (g_param_value_validate(pspec, &value)) { GParamSpecFlags *pspec_flags = (GParamSpecFlags *) pspec; - gs_free char * flag_values = NULL; + gs_free char *flag_values = NULL; flag_values = flag_values_to_string(pspec_flags->flags_class->values, pspec_flags->flags_class->n_values); @@ -2129,7 +2148,8 @@ validate_flags(NMSetting *setting, const char *prop, guint val, GError **error) return success; } -static gboolean _set_fcn_gobject_flags(ARGS_SET_FCN) +static gboolean +_set_fcn_gobject_flags(ARGS_SET_FCN) { unsigned long val_int; @@ -2149,7 +2169,8 @@ static gboolean _set_fcn_gobject_flags(ARGS_SET_FCN) return TRUE; } -static gboolean _set_fcn_gobject_ssid(ARGS_SET_FCN) +static gboolean +_set_fcn_gobject_ssid(ARGS_SET_FCN) { gs_unref_bytes GBytes *ssid = NULL; @@ -2166,7 +2187,8 @@ static gboolean _set_fcn_gobject_ssid(ARGS_SET_FCN) return TRUE; } -static gboolean _set_fcn_gobject_ifname(ARGS_SET_FCN) +static gboolean +_set_fcn_gobject_ifname(ARGS_SET_FCN) { if (_SET_FCN_DO_RESET_DEFAULT(property_info, modifier, value)) return _gobject_property_reset_default(setting, property_info->property_name); @@ -2175,7 +2197,8 @@ static gboolean _set_fcn_gobject_ifname(ARGS_SET_FCN) return TRUE; } -static gboolean _set_fcn_vpn_service_type(ARGS_SET_FCN) +static gboolean +_set_fcn_vpn_service_type(ARGS_SET_FCN) { gs_free char *service_name = NULL; @@ -2187,7 +2210,8 @@ static gboolean _set_fcn_vpn_service_type(ARGS_SET_FCN) return TRUE; } -static const char *const *_complete_fcn_vpn_service_type(ARGS_COMPLETE_FCN) +static const char *const * +_complete_fcn_vpn_service_type(ARGS_COMPLETE_FCN) { gsize i, j; char **values; @@ -2240,14 +2264,15 @@ _multilist_validate_fcn_is_ipv4_addr_or_subnet(const char *value, GError **error return value; } -static gboolean _set_fcn_gobject_bytes(ARGS_SET_FCN) +static gboolean +_set_fcn_gobject_bytes(ARGS_SET_FCN) { - gs_free char * val_strip_free = NULL; - gs_free const char **strv = NULL; - const char * val_strip; - const char ** iter; + gs_free char *val_strip_free = NULL; + gs_free const char **strv = NULL; + const char *val_strip; + const char **iter; gs_unref_bytes GBytes *bytes = NULL; - GByteArray * array; + GByteArray *array; if (_SET_FCN_DO_RESET_DEFAULT(property_info, modifier, value)) return _gobject_property_reset_default(setting, property_info->property_name); @@ -2294,11 +2319,12 @@ done: /*****************************************************************************/ -static gconstpointer _get_fcn_cert_8021x(ARGS_GET_FCN) +static gconstpointer +_get_fcn_cert_8021x(ARGS_GET_FCN) { - NMSetting8021x * s_8021X = NM_SETTING_802_1X(setting); + NMSetting8021x *s_8021X = NM_SETTING_802_1X(setting); const NMSetting8021xSchemeVtable *vtable; - char * str = NULL; + char *str = NULL; RETURN_UNSUPPORTED_GET_TYPE(); @@ -2325,9 +2351,10 @@ static gconstpointer _get_fcn_cert_8021x(ARGS_GET_FCN) RETURN_STR_TO_FREE(str); } -static gboolean _set_fcn_cert_8021x(ARGS_SET_FCN) +static gboolean +_set_fcn_cert_8021x(ARGS_SET_FCN) { - gs_free char * value_to_free = NULL; + gs_free char *value_to_free = NULL; NMSetting8021xCKScheme scheme = NM_SETTING_802_1X_CK_SCHEME_PATH; const NMSetting8021xSchemeVtable *vtable; @@ -2352,9 +2379,9 @@ static gboolean _set_fcn_cert_8021x(ARGS_SET_FCN) if (vtable->is_secret) { nm_auto_free_secret char *password_free = NULL; - gs_free const char ** strv = NULL; - const char * password; - const char * path; + gs_free const char **strv = NULL; + const char *password; + const char *path; gsize len; strv = nm_utils_escaped_tokens_split(value, NM_ASCII_SPACES); @@ -2383,7 +2410,8 @@ static gboolean _set_fcn_cert_8021x(ARGS_SET_FCN) } } -static const char *const *_complete_fcn_cert_8021x(ARGS_COMPLETE_FCN) +static const char *const * +_complete_fcn_cert_8021x(ARGS_COMPLETE_FCN) { const NMSetting8021xSchemeVtable *vtable; @@ -2403,10 +2431,11 @@ static const char *const *_complete_fcn_cert_8021x(ARGS_COMPLETE_FCN) return NULL; } -static gconstpointer _get_fcn_bond_options(ARGS_GET_FCN) +static gconstpointer +_get_fcn_bond_options(ARGS_GET_FCN) { NMSettingBond *s_bond = NM_SETTING_BOND(setting); - GString * str; + GString *str; guint32 i, len; RETURN_UNSUPPORTED_GET_TYPE(); @@ -2414,10 +2443,10 @@ static gconstpointer _get_fcn_bond_options(ARGS_GET_FCN) str = g_string_new(NULL); len = nm_setting_bond_get_num_options(s_bond); for (i = 0; i < len; i++) { - const char * key; - const char * val; + const char *key; + const char *val; gs_free char *val_tmp = NULL; - char * p; + char *p; gs_free char *escaped_key = NULL; gs_free char *escaped_val = NULL; @@ -2444,15 +2473,15 @@ static gconstpointer _get_fcn_bond_options(ARGS_GET_FCN) } gboolean -_nm_meta_setting_bond_add_option(NMSetting * setting, +_nm_meta_setting_bond_add_option(NMSetting *setting, const char *name, const char *value, - GError ** error) + GError **error) { NMSettingBond *s_bond = NM_SETTING_BOND(setting); - gs_free char * tmp_value = NULL; - const char * val2; - char * p; + gs_free char *tmp_value = NULL; + const char *val2; + char *p; if (!value || !value[0]) { /* This call only fails if name is currently not tracked. It's not an @@ -2513,11 +2542,12 @@ _nm_meta_setting_bond_add_option(NMSetting * setting, return TRUE; } -static const char *_describe_fcn_bond_options(ARGS_DESCRIBE_FCN) +static const char * +_describe_fcn_bond_options(ARGS_DESCRIBE_FCN) { gs_free char *options_str = NULL; - const char ** valid_options; - char * s; + const char **valid_options; + char *s; valid_options = nm_setting_bond_get_valid_options(NULL); options_str = g_strjoinv(", ", (char **) valid_options); @@ -2538,17 +2568,19 @@ static const char *_describe_fcn_bond_options(ARGS_DESCRIBE_FCN) return (*out_to_free = s); } -static const char *const *_values_fcn_bond_options(ARGS_VALUES_FCN) +static const char *const * +_values_fcn_bond_options(ARGS_VALUES_FCN) { return nm_setting_bond_get_valid_options(NULL); } -static gconstpointer _get_fcn_connection_permissions(ARGS_GET_FCN) +static gconstpointer +_get_fcn_connection_permissions(ARGS_GET_FCN) { NMSettingConnection *s_con = NM_SETTING_CONNECTION(setting); - GString * perm = NULL; - const char * perm_item; - const char * perm_type; + GString *perm = NULL; + const char *perm_item; + const char *perm_type; guint i, n; RETURN_UNSUPPORTED_GET_TYPE(); @@ -2575,7 +2607,8 @@ static gconstpointer _get_fcn_connection_permissions(ARGS_GET_FCN) return NULL; } -static gboolean _set_fcn_connection_type(ARGS_SET_FCN) +static gboolean +_set_fcn_connection_type(ARGS_SET_FCN) { gs_free char *uuid = NULL; @@ -2603,10 +2636,11 @@ static gboolean _set_fcn_connection_type(ARGS_SET_FCN) return TRUE; } -static const char *const *_complete_fcn_connection_type(ARGS_COMPLETE_FCN) +static const char *const * +_complete_fcn_connection_type(ARGS_COMPLETE_FCN) { guint i, j; - char ** result; + char **result; gsize text_len; const char *slave_types[] = {"bond-slave", "bridge-slave", "team-slave"}; @@ -2617,7 +2651,7 @@ static const char *const *_complete_fcn_connection_type(ARGS_COMPLETE_FCN) for (i = 0, j = 0; i < _NM_META_SETTING_TYPE_NUM; i++) { const NMMetaSettingInfoEditor *setting_info = &nm_meta_setting_infos_editor[i]; GType gtype = setting_info->general->get_setting_gtype(); - const char * v; + const char *v; if (_nm_setting_type_get_base_type_priority(gtype) == NM_SETTING_PRIORITY_INVALID) { nm_assert(!setting_info->valid_parts); @@ -2662,9 +2696,9 @@ _sanitize_connection_permission_user(const char *perm) } static const char * -_multilist_validate2_fcn_connection_permissions(NMSetting * setting, +_multilist_validate2_fcn_connection_permissions(NMSetting *setting, const char *item, - GError ** error) + GError **error) { if (!_sanitize_connection_permission_user(item)) { nm_utils_error_set(error, @@ -2703,14 +2737,15 @@ _multilist_remove_by_value_fcn_connection_permissions(NMSetting *setting, const return TRUE; } -static const char *const *_complete_fcn_connection_master(ARGS_COMPLETE_FCN) +static const char *const * +_complete_fcn_connection_master(ARGS_COMPLETE_FCN) { NMRemoteConnection *const *connections = NULL; guint len = 0; guint i, j; - char ** result; - NMSettingConnection * s_con; - const char * expected_type = NULL; + char **result; + NMSettingConnection *s_con; + const char *expected_type = NULL; gsize text_len; if (environment && environment->get_nm_connections) { @@ -2776,10 +2811,11 @@ _multilist_validate2_fcn_uuid(NMSetting *setting, const char *item, GError **err return item; } -static gconstpointer _get_fcn_connection_metered(ARGS_GET_FCN) +static gconstpointer +_get_fcn_connection_metered(ARGS_GET_FCN) { NMSettingConnection *s_conn = NM_SETTING_CONNECTION(setting); - const char * s; + const char *s; RETURN_UNSUPPORTED_GET_TYPE(); @@ -2802,7 +2838,8 @@ static gconstpointer _get_fcn_connection_metered(ARGS_GET_FCN) return s; } -static gboolean _set_fcn_connection_metered(ARGS_SET_FCN) +static gboolean +_set_fcn_connection_metered(ARGS_SET_FCN) { NMMetered metered; NMTernary ts_val; @@ -2859,10 +2896,11 @@ dcb_flags_to_string(NMSettingDcbFlags flags) return g_string_free(flag_str, FALSE); } -static gconstpointer _get_fcn_dcb(ARGS_GET_FCN) +static gconstpointer +_get_fcn_dcb(ARGS_GET_FCN) { NMSettingDcb *s_dcb = NM_SETTING_DCB(setting); - GString * str; + GString *str; guint i; RETURN_UNSUPPORTED_GET_TYPE(); @@ -2884,7 +2922,8 @@ static gconstpointer _get_fcn_dcb(ARGS_GET_FCN) #define DCB_ALL_FLAGS \ (NM_SETTING_DCB_FLAG_ENABLE | NM_SETTING_DCB_FLAG_ADVERTISE | NM_SETTING_DCB_FLAG_WILLING) -static gconstpointer _get_fcn_dcb_flags(ARGS_GET_FCN) +static gconstpointer +_get_fcn_dcb_flags(ARGS_GET_FCN) { nm_auto_unset_gvalue GValue val = G_VALUE_INIT; guint v; @@ -2898,7 +2937,8 @@ static gconstpointer _get_fcn_dcb_flags(ARGS_GET_FCN) RETURN_STR_TO_FREE(dcb_flags_to_string(v)); } -static gboolean _set_fcn_dcb_flags(ARGS_SET_FCN) +static gboolean +_set_fcn_dcb_flags(ARGS_SET_FCN) { NMSettingDcbFlags flags = NM_SETTING_DCB_FLAG_NONE; long int t; @@ -2912,7 +2952,7 @@ static gboolean _set_fcn_dcb_flags(ARGS_SET_FCN) flags = (guint) t; else { gs_free const char **strv = NULL; - const char *const * iter; + const char *const *iter; /* Check for individual flag numbers */ strv = nm_strsplit_set(value, " \t,"); @@ -2950,10 +2990,10 @@ dcb_parse_uint_array(const char *val, guint max, guint other, guint out_array[static 8], - GError ** error) + GError **error) { gs_free const char **items = NULL; - const char *const * iter; + const char *const *iter; gsize i; items = nm_strsplit_set_with_empty(val, ","); @@ -2997,9 +3037,9 @@ dcb_parse_uint_array(const char *val, static void dcb_check_feature_enabled(const NMMetaEnvironment *environment, - gpointer * environment_user_data, - NMSettingDcb * s_dcb, - const char * flags_prop) + gpointer *environment_user_data, + NMSettingDcb *s_dcb, + const char *flags_prop) { NMSettingDcbFlags flags = NM_SETTING_DCB_FLAG_NONE; @@ -3013,7 +3053,8 @@ dcb_check_feature_enabled(const NMMetaEnvironment *environment, } } -static gboolean _set_fcn_dcb(ARGS_SET_FCN) +static gboolean +_set_fcn_dcb(ARGS_SET_FCN) { guint i = 0; guint nums[8] = { @@ -3054,10 +3095,11 @@ static gboolean _set_fcn_dcb(ARGS_SET_FCN) return TRUE; } -static gconstpointer _get_fcn_dcb_bool(ARGS_GET_FCN) +static gconstpointer +_get_fcn_dcb_bool(ARGS_GET_FCN) { NMSettingDcb *s_dcb = NM_SETTING_DCB(setting); - GString * str; + GString *str; guint i; RETURN_UNSUPPORTED_GET_TYPE(); @@ -3076,7 +3118,8 @@ static gconstpointer _get_fcn_dcb_bool(ARGS_GET_FCN) RETURN_STR_TO_FREE(g_string_free(str, FALSE)); } -static gboolean _set_fcn_dcb_bool(ARGS_SET_FCN) +static gboolean +_set_fcn_dcb_bool(ARGS_SET_FCN) { guint i = 0; guint nums[8] = { @@ -3105,7 +3148,8 @@ static gboolean _set_fcn_dcb_bool(ARGS_SET_FCN) return TRUE; } -static gboolean _set_fcn_gsm_auto_config(ARGS_SET_FCN) +static gboolean +_set_fcn_gsm_auto_config(ARGS_SET_FCN) { if (!_set_fcn_gobject_bool_impl(property_info, setting, modifier, value, error)) return FALSE; @@ -3127,7 +3171,8 @@ static gboolean _set_fcn_gsm_auto_config(ARGS_SET_FCN) return TRUE; } -static gboolean _set_fcn_gsm_sim_operator_id(ARGS_SET_FCN) +static gboolean +_set_fcn_gsm_sim_operator_id(ARGS_SET_FCN) { const char *p = value; @@ -3152,7 +3197,8 @@ static gboolean _set_fcn_gsm_sim_operator_id(ARGS_SET_FCN) return TRUE; } -static gboolean _set_fcn_infiniband_p_key(ARGS_SET_FCN) +static gboolean +_set_fcn_infiniband_p_key(ARGS_SET_FCN) { gint64 p_key; @@ -3173,7 +3219,8 @@ static gboolean _set_fcn_infiniband_p_key(ARGS_SET_FCN) return TRUE; } -static gconstpointer _get_fcn_infiniband_p_key(ARGS_GET_FCN) +static gconstpointer +_get_fcn_infiniband_p_key(ARGS_GET_FCN) { NMSettingInfiniband *s_infiniband = NM_SETTING_INFINIBAND(setting); int p_key; @@ -3192,7 +3239,8 @@ static gconstpointer _get_fcn_infiniband_p_key(ARGS_GET_FCN) RETURN_STR_TO_FREE(g_strdup_printf("0x%04x", p_key)); } -static gconstpointer _get_fcn_objlist(ARGS_GET_FCN) +static gconstpointer +_get_fcn_objlist(ARGS_GET_FCN) { GString *str = NULL; guint num; @@ -3247,9 +3295,9 @@ static gconstpointer _get_fcn_objlist(ARGS_GET_FCN) static void _objlist_obj_to_str_fcn_ip_config_addresses(NMMetaAccessorGetType get_type, - NMSetting * setting, + NMSetting *setting, guint idx, - GString * str) + GString *str) { NMIPAddress *obj; @@ -3262,14 +3310,14 @@ _objlist_obj_to_str_fcn_ip_config_addresses(NMMetaAccessorGetType get_type, static void _objlist_obj_to_str_fcn_ip_config_routes(NMMetaAccessorGetType get_type, - NMSetting * setting, + NMSetting *setting, guint idx, - GString * str) + GString *str) { - NMIPRoute * route; - gs_free char * attr_str = NULL; - gs_strfreev char **attr_names = NULL; - gs_unref_hashtable GHashTable *hash = g_hash_table_new(nm_str_hash, g_str_equal); + NMIPRoute *route; + gs_free char *attr_str = NULL; + gs_strfreev char **attr_names = NULL; + gs_unref_hashtable GHashTable *hash = g_hash_table_new(nm_str_hash, g_str_equal); int j; route = nm_setting_ip_config_get_route(NM_SETTING_IP_CONFIG(setting), idx); @@ -3314,7 +3362,8 @@ _objlist_obj_to_str_fcn_ip_config_routes(NMMetaAccessorGetType get_type, } } -static gboolean _set_fcn_ip_config_method(ARGS_SET_FCN) +static gboolean +_set_fcn_ip_config_method(ARGS_SET_FCN) { if (_SET_FCN_DO_RESET_DEFAULT(property_info, modifier, value)) return _gobject_property_reset_default(setting, property_info->property_name); @@ -3367,7 +3416,8 @@ _multilist_add_fcn_ip_config_dns_options(NMSetting *setting, const char *item) return TRUE; } -static gboolean _set_fcn_objlist(ARGS_SET_FCN) +static gboolean +_set_fcn_objlist(ARGS_SET_FCN) { gs_free const char **strv = NULL; gsize i, nstrv; @@ -3439,10 +3489,10 @@ static gboolean _set_fcn_objlist(ARGS_SET_FCN) } static gboolean -_objlist_set_fcn_ip_config_addresses(NMSetting * setting, +_objlist_set_fcn_ip_config_addresses(NMSetting *setting, gboolean do_add, const char *value, - GError ** error) + GError **error) { int addr_family = nm_setting_ip_config_get_addr_family(NM_SETTING_IP_CONFIG(setting)); nm_auto_unref_ip_address NMIPAddress *addr = NULL; @@ -3457,7 +3507,8 @@ _objlist_set_fcn_ip_config_addresses(NMSetting * setting, return TRUE; } -static gboolean _set_fcn_ip_config_gateway(ARGS_SET_FCN) +static gboolean +_set_fcn_ip_config_gateway(ARGS_SET_FCN) { gs_free char *value_to_free = NULL; int addr_family = nm_setting_ip_config_get_addr_family(NM_SETTING_IP_CONFIG(setting)); @@ -3489,10 +3540,10 @@ static gboolean _set_fcn_ip_config_gateway(ARGS_SET_FCN) } static gboolean -_objlist_set_fcn_ip_config_routes(NMSetting * setting, +_objlist_set_fcn_ip_config_routes(NMSetting *setting, gboolean do_add, const char *value, - GError ** error) + GError **error) { int addr_family = nm_setting_ip_config_get_addr_family(NM_SETTING_IP_CONFIG(setting)); nm_auto_unref_ip_route NMIPRoute *route = NULL; @@ -3515,12 +3566,12 @@ _is_default_func_ip_config_dns_options(NMSetting *setting) static void _objlist_obj_to_str_fcn_ip_config_routing_rules(NMMetaAccessorGetType get_type, - NMSetting * setting, + NMSetting *setting, guint idx, - GString * str) + GString *str) { NMIPRoutingRule *rule; - gs_free char * s = NULL; + gs_free char *s = NULL; rule = nm_setting_ip_config_get_routing_rule(NM_SETTING_IP_CONFIG(setting), idx); s = nm_ip_routing_rule_to_string(rule, NM_IP_ROUTING_RULE_AS_STRING_FLAGS_NONE, NULL, NULL); @@ -3529,12 +3580,12 @@ _objlist_obj_to_str_fcn_ip_config_routing_rules(NMMetaAccessorGetType get_type, } static gboolean -_objlist_set_fcn_ip_config_routing_rules(NMSetting * setting, +_objlist_set_fcn_ip_config_routing_rules(NMSetting *setting, gboolean do_add, const char *str, - GError ** error) + GError **error) { - NMSettingIPConfig * s_ip = NM_SETTING_IP_CONFIG(setting); + NMSettingIPConfig *s_ip = NM_SETTING_IP_CONFIG(setting); nm_auto_unref_ip_routing_rule NMIPRoutingRule *rule = NULL; guint i, n; @@ -3581,7 +3632,7 @@ _multilist_get_num_fcn_ip_config_dhcp_reject_servers(NMSettingIPConfig *setting) static gboolean _multilist_remove_by_value_fcn_ip_config_dhcp_reject_servers(NMSettingIPConfig *setting, - const char * item) + const char *item) { const char *const *strv; guint num; @@ -3594,11 +3645,12 @@ _multilist_remove_by_value_fcn_ip_config_dhcp_reject_servers(NMSettingIPConfig * return TRUE; } -static gconstpointer _get_fcn_olpc_mesh_ssid(ARGS_GET_FCN) +static gconstpointer +_get_fcn_olpc_mesh_ssid(ARGS_GET_FCN) { NMSettingOlpcMesh *s_olpc_mesh = NM_SETTING_OLPC_MESH(setting); - GBytes * ssid; - char * ssid_str = NULL; + GBytes *ssid; + char *ssid_str = NULL; RETURN_UNSUPPORTED_GET_TYPE(); @@ -3611,7 +3663,8 @@ static gconstpointer _get_fcn_olpc_mesh_ssid(ARGS_GET_FCN) RETURN_STR_TO_FREE(ssid_str); } -static gboolean _set_fcn_olpc_mesh_channel(ARGS_SET_FCN) +static gboolean +_set_fcn_olpc_mesh_channel(ARGS_SET_FCN) { unsigned long chan_int; @@ -3638,12 +3691,12 @@ _validate_fcn_proxy_pac_script(const char *value, char **out_to_free, GError **e static void _objlist_obj_to_str_fcn_sriov_vfs(NMMetaAccessorGetType get_type, - NMSetting * setting, + NMSetting *setting, guint idx, - GString * str) + GString *str) { gs_free char *s = NULL; - NMSriovVF * vf; + NMSriovVF *vf; vf = nm_setting_sriov_get_vf(NM_SETTING_SRIOV(setting), idx); s = nm_utils_sriov_vf_to_str(vf, FALSE, NULL); @@ -3653,12 +3706,12 @@ _objlist_obj_to_str_fcn_sriov_vfs(NMMetaAccessorGetType get_type, static void _objlist_obj_to_str_fcn_tc_config_qdiscs(NMMetaAccessorGetType get_type, - NMSetting * setting, + NMSetting *setting, guint idx, - GString * str) + GString *str) { gs_free char *s = NULL; - NMTCQdisc * qdisc; + NMTCQdisc *qdisc; qdisc = nm_setting_tc_config_get_qdisc(NM_SETTING_TC_CONFIG(setting), idx); s = nm_utils_tc_qdisc_to_str(qdisc, NULL); @@ -3668,9 +3721,9 @@ _objlist_obj_to_str_fcn_tc_config_qdiscs(NMMetaAccessorGetType get_type, static void _objlist_obj_to_str_fcn_bridge_vlans(NMMetaAccessorGetType get_type, - NMSetting * setting, + NMSetting *setting, guint idx, - GString * str) + GString *str) { gs_free char *s = NULL; NMBridgeVlan *vlan; @@ -3688,8 +3741,8 @@ _objlist_obj_to_str_fcn_bridge_vlans(NMMetaAccessorGetType get_type, static gboolean _objlist_set_fcn_sriov_vfs(NMSetting *setting, gboolean do_add, const char *value, GError **error) { - nm_auto_unref_sriov_vf NMSriovVF *vf = NULL; - gs_free_error GError *local = NULL; + nm_auto_unref_sriov_vf NMSriovVF *vf = NULL; + gs_free_error GError *local = NULL; vf = nm_utils_sriov_vf_from_str(value, &local); if (!vf) { @@ -3709,13 +3762,13 @@ _objlist_set_fcn_sriov_vfs(NMSetting *setting, gboolean do_add, const char *valu } static gboolean -_objlist_set_fcn_tc_config_qdiscs(NMSetting * setting, +_objlist_set_fcn_tc_config_qdiscs(NMSetting *setting, gboolean do_add, const char *value, - GError ** error) + GError **error) { nm_auto_unref_tc_qdisc NMTCQdisc *tc_qdisc = NULL; - gs_free_error GError *local = NULL; + gs_free_error GError *local = NULL; tc_qdisc = nm_utils_tc_qdisc_from_str(value, &local); if (!tc_qdisc) { @@ -3735,14 +3788,14 @@ _objlist_set_fcn_tc_config_qdiscs(NMSetting * setting, } static gboolean -_objlist_set_fcn_bridge_vlans(NMSetting * setting, +_objlist_set_fcn_bridge_vlans(NMSetting *setting, gboolean do_add, const char *value, - GError ** error) + GError **error) { - nm_auto_unref_bridge_vlan NMBridgeVlan *vlan = NULL; - gs_free_error GError *local = NULL; - guint16 vid_start, vid_end; + nm_auto_unref_bridge_vlan NMBridgeVlan *vlan = NULL; + gs_free_error GError *local = NULL; + guint16 vid_start, vid_end; vlan = nm_bridge_vlan_from_str(value, &local); if (!vlan) { @@ -3777,11 +3830,11 @@ _objlist_set_fcn_bridge_vlans(NMSetting * setting, static void _objlist_obj_to_str_fcn_tc_config_tfilters(NMMetaAccessorGetType get_type, - NMSetting * setting, + NMSetting *setting, guint idx, - GString * str) + GString *str) { - NMTCTfilter * tfilter; + NMTCTfilter *tfilter; gs_free char *s = NULL; tfilter = nm_setting_tc_config_get_tfilter(NM_SETTING_TC_CONFIG(setting), idx); @@ -3791,12 +3844,12 @@ _objlist_obj_to_str_fcn_tc_config_tfilters(NMMetaAccessorGetType get_type, } static gboolean -_objlist_set_fcn_tc_config_tfilters(NMSetting * setting, +_objlist_set_fcn_tc_config_tfilters(NMSetting *setting, gboolean do_add, const char *value, - GError ** error) + GError **error) { - gs_free_error GError * local = NULL; + gs_free_error GError *local = NULL; nm_auto_unref_tc_tfilter NMTCTfilter *tc_tfilter = NULL; tc_tfilter = nm_utils_tc_tfilter_from_str(value, &local); @@ -3828,12 +3881,12 @@ _validate_fcn_team_config(const char *value, char **out_to_free, GError **error) static void _objlist_obj_to_str_fcn_team_link_watchers(NMMetaAccessorGetType get_type, - NMSetting * setting, + NMSetting *setting, guint idx, - GString * str) + GString *str) { NMTeamLinkWatcher *watcher; - gs_free char * s = NULL; + gs_free char *s = NULL; if (NM_IS_SETTING_TEAM(setting)) watcher = nm_setting_team_get_link_watcher(NM_SETTING_TEAM(setting), idx); @@ -3846,10 +3899,10 @@ _objlist_obj_to_str_fcn_team_link_watchers(NMMetaAccessorGetType get_type, } static gboolean -_objlist_set_fcn_team_link_watchers(NMSetting * setting, +_objlist_set_fcn_team_link_watchers(NMSetting *setting, gboolean do_add, const char *value, - GError ** error) + GError **error) { nm_auto_unref_team_link_watcher NMTeamLinkWatcher *watcher = NULL; @@ -3871,7 +3924,8 @@ _objlist_set_fcn_team_link_watchers(NMSetting * setting, return TRUE; } -static gconstpointer _get_fcn_vlan_flags(ARGS_GET_FCN) +static gconstpointer +_get_fcn_vlan_flags(ARGS_GET_FCN) { NMSettingVlan *s_vlan = NM_SETTING_VLAN(setting); guint32 flags; @@ -3898,11 +3952,12 @@ _vlan_priority_map_type_from_property_info(const NMMetaPropertyInfo *property_in : NM_VLAN_EGRESS_MAP; } -static gconstpointer _get_fcn_vlan_xgress_priority_map(ARGS_GET_FCN) +static gconstpointer +_get_fcn_vlan_xgress_priority_map(ARGS_GET_FCN) { NMVlanPriorityMap map_type = _vlan_priority_map_type_from_property_info(property_info); - NMSettingVlan * s_vlan = NM_SETTING_VLAN(setting); - GString * str = NULL; + NMSettingVlan *s_vlan = NM_SETTING_VLAN(setting); + GString *str = NULL; gint32 i, num; RETURN_UNSUPPORTED_GET_TYPE(); @@ -3927,7 +3982,8 @@ static gconstpointer _get_fcn_vlan_xgress_priority_map(ARGS_GET_FCN) RETURN_STR_TO_FREE(g_string_free(str, FALSE)); } -static gboolean _set_fcn_vlan_xgress_priority_map(ARGS_SET_FCN) +static gboolean +_set_fcn_vlan_xgress_priority_map(ARGS_SET_FCN) { NMVlanPriorityMap map_type = _vlan_priority_map_type_from_property_info(property_info); gs_free const char **prio_map = NULL; @@ -3970,7 +4026,7 @@ static gboolean _set_fcn_vlan_xgress_priority_map(ARGS_SET_FCN) static void _vpn_options_callback(const char *key, const char *val, gpointer user_data) { - GString * str = user_data; + GString *str = user_data; gs_free char *escaped_key = NULL; gs_free char *escaped_val = NULL; @@ -3982,10 +4038,11 @@ _vpn_options_callback(const char *key, const char *val, gpointer user_data) g_string_append(str, nm_utils_escaped_tokens_options_escape_val(val, &escaped_val)); } -static gconstpointer _get_fcn_vpn_options(ARGS_GET_FCN) +static gconstpointer +_get_fcn_vpn_options(ARGS_GET_FCN) { NMSettingVpn *s_vpn = NM_SETTING_VPN(setting); - GString * str; + GString *str; RETURN_UNSUPPORTED_GET_TYPE(); @@ -3999,10 +4056,10 @@ static gconstpointer _get_fcn_vpn_options(ARGS_GET_FCN) } static gboolean -_optionlist_set_fcn_vpn_data(NMSetting * setting, +_optionlist_set_fcn_vpn_data(NMSetting *setting, const char *option, const char *value, - GError ** error) + GError **error) { if (value) nm_setting_vpn_add_data_item(NM_SETTING_VPN(setting), option, value); @@ -4012,10 +4069,10 @@ _optionlist_set_fcn_vpn_data(NMSetting * setting, } static gboolean -_optionlist_set_fcn_vpn_secrets(NMSetting * setting, +_optionlist_set_fcn_vpn_secrets(NMSetting *setting, const char *option, const char *value, - GError ** error) + GError **error) { if (value) nm_setting_vpn_add_secret(NM_SETTING_VPN(setting), option, value); @@ -4024,7 +4081,8 @@ _optionlist_set_fcn_vpn_secrets(NMSetting * setting, return TRUE; } -static gboolean _set_fcn_wired_s390_subchannels(ARGS_SET_FCN) +static gboolean +_set_fcn_wired_s390_subchannels(ARGS_SET_FCN) { gs_free const char **strv = NULL; gsize len; @@ -4044,10 +4102,10 @@ static gboolean _set_fcn_wired_s390_subchannels(ARGS_SET_FCN) } static gboolean -_optionlist_set_fcn_wired_s390_options(NMSetting * setting, +_optionlist_set_fcn_wired_s390_options(NMSetting *setting, const char *name, const char *value, - GError ** error) + GError **error) { if (value) nm_setting_wired_add_s390_option(NM_SETTING_WIRED(setting), name, value); @@ -4056,16 +4114,18 @@ _optionlist_set_fcn_wired_s390_options(NMSetting * setting, return TRUE; } -static const char *const *_values_fcn_wired_s390_options(ARGS_VALUES_FCN) +static const char *const * +_values_fcn_wired_s390_options(ARGS_VALUES_FCN) { return nm_setting_wired_get_valid_s390_options(NULL); } -static const char *_describe_fcn_wired_s390_options(ARGS_DESCRIBE_FCN) +static const char * +_describe_fcn_wired_s390_options(ARGS_DESCRIBE_FCN) { gs_free char *options_str = NULL; - const char ** valid_options; - char * s; + const char **valid_options; + char *s; valid_options = nm_setting_wired_get_valid_s390_options(NULL); @@ -4078,11 +4138,12 @@ static const char *_describe_fcn_wired_s390_options(ARGS_DESCRIBE_FCN) return (*out_to_free = s); } -static gconstpointer _get_fcn_wireless_ssid(ARGS_GET_FCN) +static gconstpointer +_get_fcn_wireless_ssid(ARGS_GET_FCN) { NMSettingWireless *s_wireless = NM_SETTING_WIRELESS(setting); - GBytes * ssid; - char * ssid_str = NULL; + GBytes *ssid; + char *ssid_str = NULL; RETURN_UNSUPPORTED_GET_TYPE(); @@ -4095,7 +4156,8 @@ static gconstpointer _get_fcn_wireless_ssid(ARGS_GET_FCN) RETURN_STR_TO_FREE(ssid_str); } -static gboolean _set_fcn_wireless_channel(ARGS_SET_FCN) +static gboolean +_set_fcn_wireless_channel(ARGS_SET_FCN) { unsigned long chan_int; @@ -4133,10 +4195,11 @@ _multilist_validate2_fcn_mac_addr(NMSetting *setting, const char *item, GError * return item; } -static gconstpointer _get_fcn_wireless_security_wep_key(ARGS_GET_FCN) +static gconstpointer +_get_fcn_wireless_security_wep_key(ARGS_GET_FCN) { NMSettingWirelessSecurity *s_wireless_sec = NM_SETTING_WIRELESS_SECURITY(setting); - char * key; + char *key; guint index; RETURN_UNSUPPORTED_GET_TYPE(); @@ -4152,7 +4215,8 @@ static gconstpointer _get_fcn_wireless_security_wep_key(ARGS_GET_FCN) RETURN_STR_TO_FREE(key); } -static gboolean _set_fcn_wireless_wep_key(ARGS_SET_FCN) +static gboolean +_set_fcn_wireless_wep_key(ARGS_SET_FCN) { NMWepKeyType guessed_type = NM_WEP_KEY_TYPE_UNKNOWN; NMWepKeyType type; @@ -4221,9 +4285,9 @@ static gboolean _set_fcn_wireless_wep_key(ARGS_SET_FCN) static void _gobject_enum_pre_set_notify_fcn_wireless_security_wep_key_type( const NMMetaPropertyInfo *property_info, - const NMMetaEnvironment * environment, + const NMMetaEnvironment *environment, gpointer environment_user_data, - NMSetting * setting, + NMSetting *setting, int value) { guint i; @@ -4255,7 +4319,8 @@ _gobject_enum_pre_set_notify_fcn_wireless_security_wep_key_type( /*****************************************************************************/ -static gconstpointer _get_fcn_ethtool(ARGS_GET_FCN) +static gconstpointer +_get_fcn_ethtool(ARGS_GET_FCN) { NMEthtoolID ethtool_id = property_info->property_typ_data->subtype.ethtool.ethtool_id; const char *s; @@ -4286,7 +4351,8 @@ static gconstpointer _get_fcn_ethtool(ARGS_GET_FCN) return s; } -static gboolean _set_fcn_ethtool(ARGS_SET_FCN) +static gboolean +_set_fcn_ethtool(ARGS_SET_FCN) { NMEthtoolID ethtool_id = property_info->property_typ_data->subtype.ethtool.ethtool_id; gint64 i64; @@ -4336,7 +4402,8 @@ do_unset: return TRUE; } -static const char *const *_complete_fcn_ethtool(ARGS_COMPLETE_FCN) +static const char *const * +_complete_fcn_ethtool(ARGS_COMPLETE_FCN) { static const char *const v[] = { "true", @@ -6618,7 +6685,10 @@ static const NMMetaPropertyInfo *const property_infos_OVS_BRIDGE[] = { static const NMMetaPropertyInfo *const property_infos_OVS_DPDK[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_OVS_DPDK_DEVARGS, .property_type = &_pt_gobject_string, - ), + ), + PROPERTY_INFO_WITH_DESC (NM_SETTING_OVS_DPDK_N_RXQ, + .property_type = &_pt_gobject_int, + ), NULL }; @@ -8596,16 +8666,16 @@ _meta_type_property_info_get_name(const NMMetaAbstractInfo *abstract_info, gbool } static gconstpointer -_meta_type_setting_info_editor_get_fcn(const NMMetaAbstractInfo * abstract_info, - const NMMetaEnvironment * environment, +_meta_type_setting_info_editor_get_fcn(const NMMetaAbstractInfo *abstract_info, + const NMMetaEnvironment *environment, gpointer environment_user_data, gpointer target, gpointer target_data, NMMetaAccessorGetType get_type, NMMetaAccessorGetFlags get_flags, NMMetaAccessorGetOutFlags *out_flags, - gboolean * out_is_default, - gpointer * out_to_free) + gboolean *out_is_default, + gpointer *out_to_free) { const NMMetaSettingInfoEditor *info = (const NMMetaSettingInfoEditor *) abstract_info; @@ -8622,16 +8692,16 @@ _meta_type_setting_info_editor_get_fcn(const NMMetaAbstractInfo * abstract_info, } static gconstpointer -_meta_type_property_info_get_fcn(const NMMetaAbstractInfo * abstract_info, - const NMMetaEnvironment * environment, +_meta_type_property_info_get_fcn(const NMMetaAbstractInfo *abstract_info, + const NMMetaEnvironment *environment, gpointer environment_user_data, gpointer target, gpointer target_data, NMMetaAccessorGetType get_type, NMMetaAccessorGetFlags get_flags, NMMetaAccessorGetOutFlags *out_flags, - gboolean * out_is_default, - gpointer * out_to_free) + gboolean *out_is_default, + gpointer *out_to_free) { const NMMetaPropertyInfo *info = (const NMMetaPropertyInfo *) abstract_info; gboolean is_default_local = FALSE; @@ -8671,8 +8741,8 @@ _meta_type_property_info_get_fcn(const NMMetaAbstractInfo * abstract_info, static const NMMetaAbstractInfo *const * _meta_type_setting_info_editor_get_nested(const NMMetaAbstractInfo *abstract_info, - guint * out_len, - gpointer * out_to_free) + guint *out_len, + gpointer *out_to_free) { const NMMetaSettingInfoEditor *info; @@ -8684,21 +8754,21 @@ _meta_type_setting_info_editor_get_nested(const NMMetaAbstractInfo *abstract_inf static const NMMetaAbstractInfo *const * _meta_type_property_info_get_nested(const NMMetaAbstractInfo *abstract_info, - guint * out_len, - gpointer * out_to_free) + guint *out_len, + gpointer *out_to_free) { NM_SET_OUT(out_len, 0); return NULL; } static const char *const * -_meta_type_property_info_complete_fcn(const NMMetaAbstractInfo * abstract_info, - const NMMetaEnvironment * environment, +_meta_type_property_info_complete_fcn(const NMMetaAbstractInfo *abstract_info, + const NMMetaEnvironment *environment, gpointer environment_user_data, const NMMetaOperationContext *operation_context, - const char * text, - gboolean * out_complete_filename, - char *** out_to_free) + const char *text, + gboolean *out_complete_filename, + char ***out_to_free) { const NMMetaPropertyInfo *info = (const NMMetaPropertyInfo *) abstract_info; diff --git a/src/libnmc-setting/nm-meta-setting-desc.h b/src/libnmc-setting/nm-meta-setting-desc.h index 29416dcb..91905253 100644 --- a/src/libnmc-setting/nm-meta-setting-desc.h +++ b/src/libnmc-setting/nm-meta-setting-desc.h @@ -203,32 +203,32 @@ struct _NMMetaPropertyType { /* should return a translated string */ const char *(*describe_fcn)(const NMMetaPropertyInfo *property_info, char **out_to_free); - gconstpointer (*get_fcn)(const NMMetaPropertyInfo * property_info, - const NMMetaEnvironment * environment, + gconstpointer (*get_fcn)(const NMMetaPropertyInfo *property_info, + const NMMetaEnvironment *environment, gpointer environment_user_data, - NMSetting * setting, + NMSetting *setting, NMMetaAccessorGetType get_type, NMMetaAccessorGetFlags get_flags, NMMetaAccessorGetOutFlags *out_flags, - gboolean * out_is_default, - gpointer * out_to_free); + gboolean *out_is_default, + gpointer *out_to_free); gboolean (*set_fcn)(const NMMetaPropertyInfo *property_info, - const NMMetaEnvironment * environment, + const NMMetaEnvironment *environment, gpointer environment_user_data, - NMSetting * setting, + NMSetting *setting, NMMetaAccessorModifier modifier, - const char * value, - GError ** error); + const char *value, + GError **error); const char *const *(*values_fcn)(const NMMetaPropertyInfo *property_info, char ***out_to_free); - const char *const *(*complete_fcn)(const NMMetaPropertyInfo * property_info, - const NMMetaEnvironment * environment, + const char *const *(*complete_fcn)(const NMMetaPropertyInfo *property_info, + const NMMetaEnvironment *environment, gpointer environment_user_data, const NMMetaOperationContext *operation_context, - const char * text, - gboolean * out_complete_filename, - char *** out_to_free); + const char *text, + gboolean *out_complete_filename, + char ***out_to_free); /* Whether set_fcn() supports the '-' modifier. That is, whether the property * is a list type. */ @@ -243,7 +243,7 @@ typedef union { } NMMetaSignUnsignInt64; typedef struct { - const char * nick; + const char *nick; NMMetaSignUnsignInt64 value; } NMMetaUtilsIntValueInfo; @@ -256,9 +256,9 @@ struct _NMMetaPropertyTypData { const struct _NMUtilsEnumValueInfo *value_infos_get; /* nicks for get function */ const struct _NMUtilsEnumValueInfo *value_infos; /* nicks for set function */ void (*pre_set_notify)(const NMMetaPropertyInfo *property_info, - const NMMetaEnvironment * environment, + const NMMetaEnvironment *environment, gpointer environment_user_data, - NMSetting * setting, + NMSetting *setting, int value); } gobject_enum; struct { @@ -299,13 +299,13 @@ struct _NMMetaPropertyTypData { struct { guint (*get_num_fcn)(NMSetting *setting); void (*obj_to_str_fcn)(NMMetaAccessorGetType get_type, - NMSetting * setting, + NMSetting *setting, guint idx, - GString * str); - gboolean (*set_fcn)(NMSetting * setting, + GString *str); + gboolean (*set_fcn)(NMSetting *setting, gboolean do_add /* or else remove. */, const char *value, - GError ** error); + GError **error); void (*clear_all_fcn)(NMSetting *setting); void (*remove_by_idx_fcn_u)(NMSetting *setting, guint idx); void (*remove_by_idx_fcn_s)(NMSetting *setting, int idx); @@ -313,10 +313,10 @@ struct _NMMetaPropertyTypData { bool strsplit_plain : 1; } objlist; struct { - gboolean (*set_fcn)(NMSetting * setting, + gboolean (*set_fcn)(NMSetting *setting, const char *option, const char *value, - GError ** error); + GError **error); bool no_empty_value : 1; } optionlist; struct { @@ -345,7 +345,7 @@ struct _NMMetaPropertyTypData { } ethtool; } subtype; gboolean (*is_default_fcn)(NMSetting *setting); - const char *const * values_static; + const char *const *values_static; const NMMetaPropertyTypDataNested *nested; NMMetaPropertyTypFlags typ_flags; }; @@ -396,7 +396,7 @@ struct _NMMetaPropertyInfo { /* a non-translated but translatable static description (marked with N_()). */ const char *describe_message; - const NMMetaPropertyType * property_type; + const NMMetaPropertyType *property_type; const NMMetaPropertyTypData *property_typ_data; }; @@ -410,9 +410,9 @@ struct _NMMetaSettingInfoEditor { NMObjBaseInst parent; const NMMetaType *meta_type; }; - const NMMetaSettingInfo * general; - const char * alias; - const char * pretty_name; + const NMMetaSettingInfo *general; + const char *alias; + const char *pretty_name; const NMMetaPropertyInfo *const *properties; guint properties_num; @@ -429,34 +429,34 @@ struct _NMMetaSettingInfoEditor { const NMMetaSettingValidPartItem *const *valid_parts; void (*setting_init_fcn)(const NMMetaSettingInfoEditor *setting_info, - NMSetting * setting, + NMSetting *setting, NMMetaAccessorSettingInitType init_type); }; struct _NMMetaType { NMObjBaseClass parent; - const char * type_name; + const char *type_name; const char *(*get_name)(const NMMetaAbstractInfo *abstract_info, gboolean for_header); const NMMetaAbstractInfo *const *(*get_nested)(const NMMetaAbstractInfo *abstract_info, - guint * out_len, - gpointer * out_to_free); - gconstpointer (*get_fcn)(const NMMetaAbstractInfo * info, - const NMMetaEnvironment * environment, + guint *out_len, + gpointer *out_to_free); + gconstpointer (*get_fcn)(const NMMetaAbstractInfo *info, + const NMMetaEnvironment *environment, gpointer environment_user_data, gpointer target, gpointer target_data, NMMetaAccessorGetType get_type, NMMetaAccessorGetFlags get_flags, NMMetaAccessorGetOutFlags *out_flags, - gboolean * out_is_default, - gpointer * out_to_free); - const char *const *(*complete_fcn)(const NMMetaAbstractInfo * info, - const NMMetaEnvironment * environment, + gboolean *out_is_default, + gpointer *out_to_free); + const char *const *(*complete_fcn)(const NMMetaAbstractInfo *info, + const NMMetaEnvironment *environment, gpointer environment_user_data, const NMMetaOperationContext *operation_context, - const char * text, - gboolean * out_complete_filename, - char *** out_to_free); + const char *text, + gboolean *out_complete_filename, + char ***out_to_free); }; struct _NMMetaAbstractInfo { @@ -474,7 +474,7 @@ extern const NMMetaSettingInfoEditor nm_meta_setting_infos_editor[_NM_META_SETTI extern const NMMetaSettingValidPartItem *const nm_meta_setting_info_valid_parts_default[]; const NMMetaSettingValidPartItem *const * -nm_meta_setting_info_valid_parts_for_slave_type(const char * slave_type, +nm_meta_setting_info_valid_parts_for_slave_type(const char *slave_type, const char **out_slave_name); /*****************************************************************************/ @@ -499,11 +499,11 @@ struct _NMMetaEnvironment { struct _NMDevice *const *(*get_nm_devices)(const NMMetaEnvironment *environment, gpointer environment_user_data, - guint * out_len); + guint *out_len); struct _NMRemoteConnection *const *(*get_nm_connections)(const NMMetaEnvironment *environment, gpointer environment_user_data, - guint * out_len); + guint *out_len); }; /*****************************************************************************/ @@ -516,7 +516,7 @@ extern const NMMetaType nm_meta_type_nested_property_info; struct _NMMetaNestedPropertyInfo { union { - const NMMetaType * meta_type; + const NMMetaType *meta_type; NMMetaPropertyInfo base; }; const NMMetaPropertyInfo *parent_info; @@ -531,10 +531,10 @@ extern const NMMetaPropertyTypDataNested nm_meta_property_typ_data_bond; /*****************************************************************************/ -gboolean _nm_meta_setting_bond_add_option(NMSetting * setting, +gboolean _nm_meta_setting_bond_add_option(NMSetting *setting, const char *name, const char *value, - GError ** error); + GError **error); /*****************************************************************************/ diff --git a/src/libnmc-setting/settings-docs-input.xml b/src/libnmc-setting/settings-docs-input.xml index 3555f302..37ad35ba 100644 --- a/src/libnmc-setting/settings-docs-input.xml +++ b/src/libnmc-setting/settings-docs-input.xml @@ -1,4 +1,144 @@ - + + +A list of IPv4 destination addresses, prefix length, optional IPv4 +next hop addresses, optional route metric, optional attribute. The valid syntax is: +"ip[/prefix] [next-hop] [metric] [attribute=val]...[,ip[/prefix]...]". +For example "192.0.2.0/24 10.1.1.1 77, 198.51.100.0/24". + + +Various attributes are supported: + + +"cwnd" - an unsigned 32 bit integer. + + +"initcwnd" - an unsigned 32 bit integer. + + +"initrwnd" - an unsigned 32 bit integer. + + +"lock-cwnd" - a boolean value. + + +"lock-initcwnd" - a boolean value. + + +"lock-initrwnd" - a boolean value. + + +"lock-mtu" - a boolean value. + + +"lock-window" - a boolean value. + + +"mtu" - an unsigned 32 bit integer. + + +"onlink" - a boolean value. + + +"scope" - an unsigned 8 bit integer. IPv4 only. + + +"src" - an IPv4 address. + + +"table" - an unsigned 32 bit integer. The default depends on ipv4.route-table. + + +"tos" - an unsigned 8 bit integer. IPv4 only. + + +"type" - one of unicast, local, blackhole, +unavailable, prohibit. The default is unicast. + + +"window" - an unsigned 32 bit integer. + + + + +For details see also `man ip-route`. + + +A comma separated list of routing rules for policy routing. The format +is based on ip rule add syntax and mostly compatible. +One difference is that routing rules in NetworkManager always need a +fixed priority. + + +Example: priority 5 from 192.167.4.0/24 table 45 + + +A list of IPv6 destination addresses, prefix length, optional IPv6 +next hop addresses, optional route metric, optional attribute. The valid syntax is: +"ip[/prefix] [next-hop] [metric] [attribute=val]...[,ip[/prefix]...]". + + +Various attributes are supported: + + +"cwnd" - an unsigned 32 bit integer. + + +"from" - an IPv6 address with optional prefix. IPv6 only. + + +"initcwnd" - an unsigned 32 bit integer. + + +"initrwnd" - an unsigned 32 bit integer. + + +"lock-cwnd" - a boolean value. + + +"lock-initcwnd" - a boolean value. + + +"lock-initrwnd" - a boolean value. + + +"lock-mtu" - a boolean value. + + +"lock-window" - a boolean value. + + +"mtu" - an unsigned 32 bit integer. + + +"onlink" - a boolean value. + + +"src" - an IPv6 address. + + +"table" - an unsigned 32 bit integer. The default depends on ipv6.route-table. + + +"type" - one of unicast, local, blackhole, +unavailable, prohibit. The default is unicast. + + +"window" - an unsigned 32 bit integer. + + + + +For details see also `man ip-route`. + + +A comma separated list of routing rules for policy routing. The format +is based on ip rule add syntax and mostly compatible. +One difference is that routing rules in NetworkManager always need a +fixed priority. + + +Example: priority 5 from 1:2:3::5/128 table 45 + Array of TC queueing disciplines. qdisc is a basic block in the Linux traffic control subsystem @@ -8,9 +148,7 @@ Each qdisc can be specified by the following attributes: - -handle HANDLE - +handle HANDLE specifies the qdisc handle. A qdisc, which potentially can have children, gets @@ -21,9 +159,7 @@ explicitly assign a handle to qdiscs expected to have children. - -parent HANDLE - +parent HANDLE specifies the handle of the parent qdisc the current qdisc must be @@ -32,9 +168,7 @@ attached to. - -root - +root specifies that the qdisc is attached to the root of device. @@ -42,9 +176,7 @@ specifies that the qdisc is attached to the root of device. - -KIND - +KIND this is the qdisc kind. NetworkManager currently supports the @@ -61,9 +193,7 @@ Parameters for 'fq_codel': - -limit U32 - +limit U32 the hard limit on the real queue size. When this limit is @@ -72,9 +202,7 @@ reached, incoming packets are dropped. Default is 10240 packets. - -memory_limit U32 - +memory_limit U32 sets a limit on the total number of bytes that can be queued in @@ -85,9 +213,7 @@ limit parameter and the memory limit will be enforced. Default is - -flows U32 - +flows U32 the number of flows into which the incoming packets are @@ -100,9 +226,7 @@ Default value is 1024. - -target U32 - +target U32 the acceptable minimum standing/persistent queue delay. This minimum @@ -112,9 +236,7 @@ experience. The unit of measurement is microsecond(us). Default value is 5ms. - -interval U32 - +interval U32 used to ensure that the measured minimum delay does not become too stale. @@ -126,9 +248,7 @@ react. Default value is 100ms. - -quantum U32 - +quantum U32 the number of bytes used as 'deficit' in the fair queuing @@ -138,9 +258,7 @@ Ethernet MTU plus the hardware header length of 14 bytes. - -ecn BOOL - +ecn BOOL can be used to mark packets instead of dropping them. ecn is turned @@ -149,9 +267,7 @@ on by default. - -ce_threshold U32 - +ce_threshold U32 sets a threshold above which all packets are marked with ECN @@ -167,9 +283,7 @@ Parameters for 'sfq': - -divisor U32 - +divisor U32 can be used to set a different hash table size, available @@ -180,9 +294,7 @@ value: 1024. - -limit U32 - +limit U32 Upper limit of the SFQ. Can be used to reduce the default @@ -191,9 +303,7 @@ length of 127 packets. - -depth U32 - +depth U32 Limit of packets per flow. Default to @@ -202,9 +312,7 @@ Limit of packets per flow. Default to - -perturb_period U32 - +perturb_period U32 Interval in seconds for queue algorithm perturbation. @@ -218,9 +326,7 @@ collisions. - -quantum U32 - +quantum U32 Amount of bytes a flow is allowed to dequeue during a @@ -231,9 +337,7 @@ minimum value. - -flows U32 - +flows U32 Default value is 127. @@ -246,9 +350,7 @@ Parameters for 'tbf': - -rate U64 - +rate U64 Bandwidth or rate. These parameters accept a floating @@ -260,9 +362,7 @@ device's speed. - -burst U32 - +burst U32 Also known as buffer or maxburst. Size of the bucket, in @@ -289,9 +389,7 @@ have to set this. Must be an integral power of 2. - -limit U32 - +limit U32 Limit is the number of bytes that can be queued waiting @@ -300,9 +398,7 @@ for tokens to become available. - -latency U32 - +latency U32 specifies the maximum amount of time a packet can @@ -312,9 +408,7 @@ the size of the bucket, the rate and possibly the peakrate - - - + Array of TC traffic filters. Traffic control can manage the packet content during classification by using filters. @@ -324,9 +418,7 @@ Each tfilters can be specified by the following attributes: - -handle HANDLE - +handle HANDLE specifies the tfilters handle. A filter is used by a classful qdisc to determine in which class @@ -336,9 +428,7 @@ see qdiscs handle for detailed information. - -parent HANDLE - +parent HANDLE specifies the handle of the parent qdisc the current qdisc must be @@ -347,9 +437,7 @@ attached to. - -root - +root specifies that the qdisc is attached to the root of device. @@ -357,9 +445,7 @@ specifies that the qdisc is attached to the root of device. - -KIND - +KIND this is the tfilters kind. NetworkManager currently supports @@ -375,9 +461,7 @@ Actions for 'mirred': - -egress bool - +egress bool Define whether the packet should exit from the interface. @@ -385,9 +469,7 @@ Define whether the packet should exit from the interface. - -ingress bool - +ingress bool Define whether the packet should come into the interface. @@ -395,9 +477,7 @@ Define whether the packet should come into the interface. - -mirror bool - +mirror bool Define whether the packet should be copied to the destination space. @@ -405,9 +485,7 @@ Define whether the packet should be copied to the destination space. - -redirect bool - +redirect bool Define whether the packet should be moved to the destination space. @@ -420,15 +498,11 @@ Action for 'simple': - -sdata char[32] - +sdata char[32] The actual string to print. - - - \ No newline at end of file + \ No newline at end of file diff --git a/src/libnmc-setting/settings-docs.h b/src/libnmc-setting/settings-docs.h index 06346b1e..5ba6302d 100644 --- a/src/libnmc-setting/settings-docs.h +++ b/src/libnmc-setting/settings-docs.h @@ -253,6 +253,7 @@ #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTE_METRIC N_("The default metric for routes that don't explicitly specify a metric. The default value -1 means that the metric is chosen automatically based on the device type. The metric applies to dynamic routes, manual (static) routes that don't have an explicit metric setting, address prefix routes, and the default route. Note that for IPv6, the kernel accepts zero (0) but coerces it to 1024 (user default). Hence, setting this property to zero effectively mean setting it to 1024. For IPv4, zero is a regular value for the metric.") #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTE_TABLE N_("Enable policy routing (source routing) and set the routing table used when adding routes. This affects all routes, including device-routes, IPv4LL, DHCP, SLAAC, default-routes and static routes. But note that static routes can individually overwrite the setting by explicitly specifying a non-zero routing table. If the table setting is left at zero, it is eligible to be overwritten via global configuration. If the property is zero even after applying the global configuration value, policy routing is disabled for the address family of this connection. Policy routing disabled means that NetworkManager will add all routes to the main table (except static routes that explicitly configure a different table). Additionally, NetworkManager will not delete any extraneous routes from tables except the main table. This is to preserve backward compatibility for users who manage routing tables outside of NetworkManager.") #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTES N_("A list of IPv4 destination addresses, prefix length, optional IPv4 next hop addresses, optional route metric, optional attribute. The valid syntax is: \"ip[/prefix] [next-hop] [metric] [attribute=val]...[,ip[/prefix]...]\". For example \"192.0.2.0/24 10.1.1.1 77, 198.51.100.0/24\".") +#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTING_RULES N_("A comma separated list of routing rules for policy routing.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE N_("Configure method for creating the address for use with RFC4862 IPv6 Stateless Address Autoconfiguration. The permitted values are: NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64 (0) or NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY (1). If the property is set to EUI64, the addresses will be generated using the interface tokens derived from hardware address. This makes the host part of the address to stay constant, making it possible to track host's presence when it changes networks. The address changes when the interface hardware is replaced. The value of stable-privacy enables use of cryptographically secure hash of a secret host-specific key along with the connection's stable-id and the network address as specified by RFC7217. This makes it impossible to use the address track host's presence, and makes the address stable when the network interface hardware is replaced. On D-Bus, the absence of an addr-gen-mode setting equals enabling stable-privacy. For keyfile plugin, the absence of the setting on disk means EUI64 so that the property doesn't change on upgrade from older versions. Note that this setting is distinct from the Privacy Extensions as configured by \"ip6-privacy\" property and it does not affect the temporary addresses configured with this option.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ADDRESSES N_("A list of IPv6 addresses and their prefix length. Multiple addresses can be separated by comma. For example \"2001:db8:85a3::8a2e:370:7334/64, 2001:db8:85a3::5/64\". The addresses are listed in increasing priority, meaning the last address will be the primary address.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DAD_TIMEOUT N_("Timeout in milliseconds used to check for the presence of duplicate IP addresses on the network. If an address conflict is detected, the activation will fail. A zero value means that no duplicate address detection is performed, -1 means the default value (either configuration ipvx.dad-timeout override or zero). A value greater than zero is a timeout in milliseconds. The property is currently implemented only for IPv4.") @@ -279,6 +280,7 @@ #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTE_METRIC N_("The default metric for routes that don't explicitly specify a metric. The default value -1 means that the metric is chosen automatically based on the device type. The metric applies to dynamic routes, manual (static) routes that don't have an explicit metric setting, address prefix routes, and the default route. Note that for IPv6, the kernel accepts zero (0) but coerces it to 1024 (user default). Hence, setting this property to zero effectively mean setting it to 1024. For IPv4, zero is a regular value for the metric.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTE_TABLE N_("Enable policy routing (source routing) and set the routing table used when adding routes. This affects all routes, including device-routes, IPv4LL, DHCP, SLAAC, default-routes and static routes. But note that static routes can individually overwrite the setting by explicitly specifying a non-zero routing table. If the table setting is left at zero, it is eligible to be overwritten via global configuration. If the property is zero even after applying the global configuration value, policy routing is disabled for the address family of this connection. Policy routing disabled means that NetworkManager will add all routes to the main table (except static routes that explicitly configure a different table). Additionally, NetworkManager will not delete any extraneous routes from tables except the main table. This is to preserve backward compatibility for users who manage routing tables outside of NetworkManager.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTES N_("Array of IP routes.") +#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTING_RULES N_("A comma separated list of routing rules for policy routing.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_TOKEN N_("Configure the token for draft-chown-6man-tokenised-ipv6-identifiers-02 IPv6 tokenized interface identifiers. Useful with eui64 addr-gen-mode.") #define DESCRIBE_DOC_NM_SETTING_MACSEC_ENCRYPT N_("Whether the transmitted traffic must be encrypted.") #define DESCRIBE_DOC_NM_SETTING_MACSEC_MKA_CAK N_("The pre-shared CAK (Connectivity Association Key) for MACsec Key Agreement.") @@ -303,6 +305,7 @@ #define DESCRIBE_DOC_NM_SETTING_OVS_BRIDGE_RSTP_ENABLE N_("Enable or disable RSTP.") #define DESCRIBE_DOC_NM_SETTING_OVS_BRIDGE_STP_ENABLE N_("Enable or disable STP.") #define DESCRIBE_DOC_NM_SETTING_OVS_DPDK_DEVARGS N_("Open vSwitch DPDK device arguments.") +#define DESCRIBE_DOC_NM_SETTING_OVS_DPDK_N_RXQ N_("Open vSwitch DPDK number of rx queues. Defaults to zero which means to leave the parameter in OVS unspecified and effectively configures one queue.") #define DESCRIBE_DOC_NM_SETTING_OVS_EXTERNAL_IDS_DATA N_("A dictionary of key/value pairs with exernal-ids for OVS.") #define DESCRIBE_DOC_NM_SETTING_OVS_INTERFACE_TYPE N_("The interface type. Either \"internal\", \"system\", \"patch\", \"dpdk\", or empty.") #define DESCRIBE_DOC_NM_SETTING_OVS_PATCH_PEER N_("Specifies the name of the interface for the other side of the patch. The patch on the other side must also set this interface as peer.") diff --git a/src/libnmc-setting/settings-docs.h.in b/src/libnmc-setting/settings-docs.h.in index 06346b1e..5ba6302d 100644 --- a/src/libnmc-setting/settings-docs.h.in +++ b/src/libnmc-setting/settings-docs.h.in @@ -253,6 +253,7 @@ #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTE_METRIC N_("The default metric for routes that don't explicitly specify a metric. The default value -1 means that the metric is chosen automatically based on the device type. The metric applies to dynamic routes, manual (static) routes that don't have an explicit metric setting, address prefix routes, and the default route. Note that for IPv6, the kernel accepts zero (0) but coerces it to 1024 (user default). Hence, setting this property to zero effectively mean setting it to 1024. For IPv4, zero is a regular value for the metric.") #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTE_TABLE N_("Enable policy routing (source routing) and set the routing table used when adding routes. This affects all routes, including device-routes, IPv4LL, DHCP, SLAAC, default-routes and static routes. But note that static routes can individually overwrite the setting by explicitly specifying a non-zero routing table. If the table setting is left at zero, it is eligible to be overwritten via global configuration. If the property is zero even after applying the global configuration value, policy routing is disabled for the address family of this connection. Policy routing disabled means that NetworkManager will add all routes to the main table (except static routes that explicitly configure a different table). Additionally, NetworkManager will not delete any extraneous routes from tables except the main table. This is to preserve backward compatibility for users who manage routing tables outside of NetworkManager.") #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTES N_("A list of IPv4 destination addresses, prefix length, optional IPv4 next hop addresses, optional route metric, optional attribute. The valid syntax is: \"ip[/prefix] [next-hop] [metric] [attribute=val]...[,ip[/prefix]...]\". For example \"192.0.2.0/24 10.1.1.1 77, 198.51.100.0/24\".") +#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTING_RULES N_("A comma separated list of routing rules for policy routing.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE N_("Configure method for creating the address for use with RFC4862 IPv6 Stateless Address Autoconfiguration. The permitted values are: NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64 (0) or NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY (1). If the property is set to EUI64, the addresses will be generated using the interface tokens derived from hardware address. This makes the host part of the address to stay constant, making it possible to track host's presence when it changes networks. The address changes when the interface hardware is replaced. The value of stable-privacy enables use of cryptographically secure hash of a secret host-specific key along with the connection's stable-id and the network address as specified by RFC7217. This makes it impossible to use the address track host's presence, and makes the address stable when the network interface hardware is replaced. On D-Bus, the absence of an addr-gen-mode setting equals enabling stable-privacy. For keyfile plugin, the absence of the setting on disk means EUI64 so that the property doesn't change on upgrade from older versions. Note that this setting is distinct from the Privacy Extensions as configured by \"ip6-privacy\" property and it does not affect the temporary addresses configured with this option.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ADDRESSES N_("A list of IPv6 addresses and their prefix length. Multiple addresses can be separated by comma. For example \"2001:db8:85a3::8a2e:370:7334/64, 2001:db8:85a3::5/64\". The addresses are listed in increasing priority, meaning the last address will be the primary address.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DAD_TIMEOUT N_("Timeout in milliseconds used to check for the presence of duplicate IP addresses on the network. If an address conflict is detected, the activation will fail. A zero value means that no duplicate address detection is performed, -1 means the default value (either configuration ipvx.dad-timeout override or zero). A value greater than zero is a timeout in milliseconds. The property is currently implemented only for IPv4.") @@ -279,6 +280,7 @@ #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTE_METRIC N_("The default metric for routes that don't explicitly specify a metric. The default value -1 means that the metric is chosen automatically based on the device type. The metric applies to dynamic routes, manual (static) routes that don't have an explicit metric setting, address prefix routes, and the default route. Note that for IPv6, the kernel accepts zero (0) but coerces it to 1024 (user default). Hence, setting this property to zero effectively mean setting it to 1024. For IPv4, zero is a regular value for the metric.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTE_TABLE N_("Enable policy routing (source routing) and set the routing table used when adding routes. This affects all routes, including device-routes, IPv4LL, DHCP, SLAAC, default-routes and static routes. But note that static routes can individually overwrite the setting by explicitly specifying a non-zero routing table. If the table setting is left at zero, it is eligible to be overwritten via global configuration. If the property is zero even after applying the global configuration value, policy routing is disabled for the address family of this connection. Policy routing disabled means that NetworkManager will add all routes to the main table (except static routes that explicitly configure a different table). Additionally, NetworkManager will not delete any extraneous routes from tables except the main table. This is to preserve backward compatibility for users who manage routing tables outside of NetworkManager.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTES N_("Array of IP routes.") +#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTING_RULES N_("A comma separated list of routing rules for policy routing.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_TOKEN N_("Configure the token for draft-chown-6man-tokenised-ipv6-identifiers-02 IPv6 tokenized interface identifiers. Useful with eui64 addr-gen-mode.") #define DESCRIBE_DOC_NM_SETTING_MACSEC_ENCRYPT N_("Whether the transmitted traffic must be encrypted.") #define DESCRIBE_DOC_NM_SETTING_MACSEC_MKA_CAK N_("The pre-shared CAK (Connectivity Association Key) for MACsec Key Agreement.") @@ -303,6 +305,7 @@ #define DESCRIBE_DOC_NM_SETTING_OVS_BRIDGE_RSTP_ENABLE N_("Enable or disable RSTP.") #define DESCRIBE_DOC_NM_SETTING_OVS_BRIDGE_STP_ENABLE N_("Enable or disable STP.") #define DESCRIBE_DOC_NM_SETTING_OVS_DPDK_DEVARGS N_("Open vSwitch DPDK device arguments.") +#define DESCRIBE_DOC_NM_SETTING_OVS_DPDK_N_RXQ N_("Open vSwitch DPDK number of rx queues. Defaults to zero which means to leave the parameter in OVS unspecified and effectively configures one queue.") #define DESCRIBE_DOC_NM_SETTING_OVS_EXTERNAL_IDS_DATA N_("A dictionary of key/value pairs with exernal-ids for OVS.") #define DESCRIBE_DOC_NM_SETTING_OVS_INTERFACE_TYPE N_("The interface type. Either \"internal\", \"system\", \"patch\", \"dpdk\", or empty.") #define DESCRIBE_DOC_NM_SETTING_OVS_PATCH_PEER N_("Specifies the name of the interface for the other side of the patch. The patch on the other side must also set this interface as peer.") diff --git a/src/libnmc-setting/tests/test-libnmc-setting.c b/src/libnmc-setting/tests/test-libnmc-setting.c index fe196ad0..d34bf028 100644 --- a/src/libnmc-setting/tests/test-libnmc-setting.c +++ b/src/libnmc-setting/tests/test-libnmc-setting.c @@ -106,7 +106,7 @@ test_client_meta_check(void) g_assert((!!info->valid_parts) == is_base_type); if (info->valid_parts) { - gsize i, l; + gsize i, l; gs_unref_hashtable GHashTable *dup = g_hash_table_new(nm_direct_hash, NULL); l = NM_PTRARRAY_LEN(info->valid_parts); @@ -161,12 +161,12 @@ test_client_meta_check(void) static void test_client_import_wireguard_test0(void) { - gs_unref_object NMConnection *connection; - NMSettingWireGuard * s_wg; - NMSettingIPConfig * s_ip4; - NMSettingIPConfig * s_ip6; - NMWireGuardPeer * peer; - gs_free_error GError *error = NULL; + gs_unref_object NMConnection *connection = NULL; + NMSettingWireGuard *s_wg; + NMSettingIPConfig *s_ip4; + NMSettingIPConfig *s_ip6; + NMWireGuardPeer *peer; + gs_free_error GError *error = NULL; connection = nm_vpn_wireguard_import(NM_BUILD_SRCDIR "/src/libnmc-setting/tests/wg-test0.conf", &error); @@ -271,48 +271,48 @@ test_client_import_wireguard_missing(void) /*****************************************************************************/ -#define _do_test_parse_passwd_file(contents, success, exp_error_line, ...) \ - G_STMT_START \ - { \ - static const NMUtilsNamedValue _values[] = {__VA_ARGS__}; \ - gs_free char * _contents = g_strndup(contents, NM_STRLEN(contents)); \ - gs_unref_hashtable GHashTable *_secrets = NULL; \ - gs_free_error GError *_local = NULL; \ - gssize _error_line; \ - GError ** _p_local = nmtst_get_rand_bool() ? &_local : NULL; \ - gssize * _p_error_line = nmtst_get_rand_bool() ? &_error_line : NULL; \ - gboolean _success = !!(success); \ - gssize _exp_error_line = (exp_error_line); \ - int _i; \ - \ - g_assert(_success || (G_N_ELEMENTS(_values) == 0)); \ - \ - _secrets = nmc_utils_parse_passwd_file(_contents, _p_error_line, _p_local); \ - \ - g_assert(_success == (!!_secrets)); \ - if (!_success) { \ - if (_p_error_line) \ - g_assert_cmpint(_exp_error_line, ==, *_p_error_line); \ - if (_p_local) \ - g_assert(_local); \ - } else { \ - if (_p_error_line) \ - g_assert_cmpint(-1, ==, *_p_error_line); \ - g_assert(!_local); \ - \ - for (_i = 0; _i < (int) G_N_ELEMENTS(_values); _i++) { \ - const NMUtilsNamedValue *_n = &_values[_i]; \ - const char * _v; \ - \ - _v = g_hash_table_lookup(_secrets, _n->name); \ - if (!_v) \ - g_error("cannot find key \"%s\"", _n->name); \ - g_assert_cmpstr(_v, ==, _n->value_str); \ - } \ - \ - g_assert_cmpint(g_hash_table_size(_secrets), ==, G_N_ELEMENTS(_values)); \ - } \ - } \ +#define _do_test_parse_passwd_file(contents, success, exp_error_line, ...) \ + G_STMT_START \ + { \ + static const NMUtilsNamedValue _values[] = {__VA_ARGS__}; \ + gs_free char *_contents = g_strndup(contents, NM_STRLEN(contents)); \ + gs_unref_hashtable GHashTable *_secrets = NULL; \ + gs_free_error GError *_local = NULL; \ + gssize _error_line; \ + GError **_p_local = nmtst_get_rand_bool() ? &_local : NULL; \ + gssize *_p_error_line = nmtst_get_rand_bool() ? &_error_line : NULL; \ + gboolean _success = !!(success); \ + gssize _exp_error_line = (exp_error_line); \ + int _i; \ + \ + g_assert(_success || (G_N_ELEMENTS(_values) == 0)); \ + \ + _secrets = nmc_utils_parse_passwd_file(_contents, _p_error_line, _p_local); \ + \ + g_assert(_success == (!!_secrets)); \ + if (!_success) { \ + if (_p_error_line) \ + g_assert_cmpint(_exp_error_line, ==, *_p_error_line); \ + if (_p_local) \ + g_assert(_local); \ + } else { \ + if (_p_error_line) \ + g_assert_cmpint(-1, ==, *_p_error_line); \ + g_assert(!_local); \ + \ + for (_i = 0; _i < (int) G_N_ELEMENTS(_values); _i++) { \ + const NMUtilsNamedValue *_n = &_values[_i]; \ + const char *_v; \ + \ + _v = g_hash_table_lookup(_secrets, _n->name); \ + if (!_v) \ + g_error("cannot find key \"%s\"", _n->name); \ + g_assert_cmpstr(_v, ==, _n->value_str); \ + } \ + \ + g_assert_cmpint(g_hash_table_size(_secrets), ==, G_N_ELEMENTS(_values)); \ + } \ + } \ G_STMT_END #define _do_test_parse_passwd_file_bad(contents, exp_error_line) \ -- cgit 1.3.0-6-gf8a5