diff options
Diffstat (limited to 'clients/common')
| -rw-r--r-- | clients/common/meson.build | 47 | ||||
| -rw-r--r-- | clients/common/nm-client-utils.c | 117 | ||||
| -rw-r--r-- | clients/common/nm-client-utils.h | 22 | ||||
| -rw-r--r-- | clients/common/nm-meta-setting-access.c | 20 | ||||
| -rw-r--r-- | clients/common/nm-meta-setting-access.h | 20 | ||||
| -rw-r--r-- | clients/common/nm-meta-setting-desc.c | 4485 | ||||
| -rw-r--r-- | clients/common/nm-meta-setting-desc.h | 29 | ||||
| -rw-r--r-- | clients/common/nm-polkit-listener.c | 16 | ||||
| -rw-r--r-- | clients/common/nm-polkit-listener.h | 16 | ||||
| -rw-r--r-- | clients/common/nm-secret-agent-simple.c | 20 | ||||
| -rw-r--r-- | clients/common/nm-secret-agent-simple.h | 16 | ||||
| -rw-r--r-- | clients/common/nm-vpn-helpers.c | 31 | ||||
| -rw-r--r-- | clients/common/nm-vpn-helpers.h | 16 | ||||
| -rw-r--r-- | clients/common/qrcodegen.c | 1009 | ||||
| -rw-r--r-- | clients/common/qrcodegen.h | 311 | ||||
| -rw-r--r-- | clients/common/settings-docs.h | 11 | ||||
| -rw-r--r-- | clients/common/settings-docs.h.in | 11 | ||||
| -rw-r--r-- | clients/common/tests/meson.build | 50 | ||||
| -rw-r--r-- | clients/common/tests/test-clients-common.c | 17 | ||||
| -rw-r--r-- | clients/common/tests/test-libnm-core-aux.c | 18 |
20 files changed, 3790 insertions, 2492 deletions
diff --git a/clients/common/meson.build b/clients/common/meson.build index fed0f3bf..afa257b1 100644 --- a/clients/common/meson.build +++ b/clients/common/meson.build @@ -2,28 +2,29 @@ common_inc = include_directories('.') nm_polkit_listener = files('nm-polkit-listener.c') -deps = [ +common_deps = [ libnm_dep, - shared_nm_libnm_core_aux_dep, + libnm_nm_default_dep, ] -cflags = clients_cflags + [ - '-DG_LOG_DOMAIN="libnmc"', -] +common_c_flags = clients_c_flags + ['-DG_LOG_DOMAIN="libnmc"'] + +sources = files( + 'nm-client-utils.c', + 'nm-secret-agent-simple.c', + 'nm-vpn-helpers.c', +) libnmc_base = static_library( 'nmc-base', - sources: files( - 'nm-client-utils.c', - 'nm-secret-agent-simple.c', - 'nm-vpn-helpers.c', - ), - dependencies: deps, - c_args: cflags, + sources: sources, + dependencies: common_deps, + c_args: common_c_flags, ) libnmc_base_dep = declare_dependency( include_directories: common_inc, + dependencies: common_deps, link_with: libnmc_base, ) @@ -39,31 +40,33 @@ if enable_introspection test( 'check-settings-docs', - find_program(join_paths(meson.source_root(), 'tools', 'check-settings-docs.sh')), - args: [meson.source_root(), meson.build_root(), 'clients/common/' + settings_docs] + find_program(join_paths(source_root, 'tools', 'check-settings-docs.sh')), + args: [source_root, build_root, 'clients/common/' + settings_docs], ) else settings_docs_source = configure_file( input: settings_docs + '.in', - output: settings_docs, + output: '@BASENAME@', configuration: configuration_data(), ) endif +sources = nm_meta_setting_source + [settings_docs_source] + files( + 'nm-meta-setting-access.c', + 'nm-meta-setting-desc.c', +) + libnmc = static_library( 'nmc', - sources: files( - 'nm-meta-setting-access.c', - 'nm-meta-setting-desc.c', - ) + shared_nm_meta_setting_c + [settings_docs_source], - dependencies: deps, - c_args: cflags, - link_with: libnmc_base, + sources: sources, + dependencies: common_deps + [libnm_libnm_core_aux_dep], + c_args: c_flags, link_depends: settings_docs_source, ) libnmc_dep = declare_dependency( include_directories: common_inc, + dependencies: common_deps, link_with: libnmc, ) diff --git a/clients/common/nm-client-utils.c b/clients/common/nm-client-utils.c index 0a155dae..4d356edb 100644 --- a/clients/common/nm-client-utils.c +++ b/clients/common/nm-client-utils.c @@ -1,20 +1,6 @@ -/* nmcli - command-line tool to control NetworkManager - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright 2010 - 2017 Red Hat, Inc. +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2010 - 2017 Red Hat, Inc. */ #include "nm-default.h" @@ -448,14 +434,14 @@ nmc_activation_get_effective_state (NMActiveConnection *active, } static gboolean -can_show_graphics (void) +can_show_utf8 (void) { - static gboolean can_show_graphics_set = FALSE; - gboolean can_show_graphics = TRUE; + static gboolean can_show_utf8_set = FALSE; + static gboolean can_show_utf8 = TRUE; char *locale_str; - if (G_LIKELY (can_show_graphics_set)) - return can_show_graphics; + if (G_LIKELY (can_show_utf8_set)) + return can_show_utf8; if (!g_get_charset (NULL)) { /* Non-UTF-8 locale */ @@ -463,9 +449,24 @@ can_show_graphics (void) if (locale_str) g_free (locale_str); else - can_show_graphics = FALSE; + can_show_utf8 = FALSE; } + return can_show_utf8; +} + + +static gboolean +can_show_graphics (void) +{ + static gboolean can_show_graphics_set = FALSE; + static gboolean can_show_graphics = TRUE; + + if (G_LIKELY (can_show_graphics_set)) + return can_show_graphics; + + can_show_graphics = can_show_utf8 (); + /* The linux console font typically doesn't have characters we need */ if (g_strcmp0 (g_getenv ("TERM"), "linux") == 0) can_show_graphics = FALSE; @@ -515,3 +516,73 @@ nmc_password_subst_char (void) else return "*"; } + +/* + * We actually use a small part of qrcodegen.c, but we'd prefer to keep it + * intact. Include it instead of linking to it to give the compiler a + * chance to optimize bits we don't need away. + */ + +#pragma GCC visibility push(hidden) +NM_PRAGMA_WARNING_DISABLE("-Wdeclaration-after-statement") +#define NDEBUG +#include "qrcodegen.c" +NM_PRAGMA_WARNING_REENABLE +#pragma GCC visibility pop + +void +nmc_print_qrcode (const char *str) +{ + uint8_t tempBuffer[qrcodegen_BUFFER_LEN_FOR_VERSION (qrcodegen_VERSION_MAX)]; + uint8_t qrcode[qrcodegen_BUFFER_LEN_FOR_VERSION (qrcodegen_VERSION_MAX)]; + gboolean term_linux; + int size; + int x; + int y; + + term_linux = g_strcmp0 (g_getenv ("TERM"), "linux") == 0; + if (!term_linux && !can_show_graphics ()) + return; + + if (!qrcodegen_encodeText (str, + tempBuffer, + qrcode, + qrcodegen_Ecc_LOW, + qrcodegen_VERSION_MIN, + qrcodegen_VERSION_MAX, + qrcodegen_Mask_AUTO, + FALSE)) { + return; + } + + size = qrcodegen_getSize (qrcode); + + g_print ("\n"); + + if (term_linux) { + /* G1 alternate character set on Linux console. */ + for (y = -1; y < size + 1; y += 1) { + g_print (" \033[37;40;1m\016"); + for (x = -1; x < size + 1; x++) { + g_print ( qrcodegen_getModule (qrcode, x, y) + ? " " : "\060\060"); + } + g_print ("\017\033[0m\n"); + } + } else { + /* UTF-8 */ + for (y = -2; y < size + 2; y += 2) { + g_print (" \033[37;40m"); + for (x = -2; x < size + 2; x++) { + bool top = qrcodegen_getModule (qrcode, x, y); + bool bottom = qrcodegen_getModule (qrcode, x, y + 1); + if (top) { + g_print (bottom ? " " : "\u2584"); + } else { + g_print (bottom ? "\u2580" : "\u2588"); + } + } + g_print ("\033[0m\n"); + } + } +} diff --git a/clients/common/nm-client-utils.h b/clients/common/nm-client-utils.h index 08a39f03..1e3085d5 100644 --- a/clients/common/nm-client-utils.h +++ b/clients/common/nm-client-utils.h @@ -1,20 +1,6 @@ -/* nmcli - command-line tool to control NetworkManager - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright 2010 - 2017 Red Hat, Inc. +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2010 - 2017 Red Hat, Inc. */ #ifndef __NM_CLIENT_UTILS_H__ @@ -55,4 +41,6 @@ const char *nmc_wifi_strength_bars (guint8 strength); const char *nmc_password_subst_char (void); +void nmc_print_qrcode (const char *str); + #endif /* __NM_CLIENT_UTILS_H__ */ diff --git a/clients/common/nm-meta-setting-access.c b/clients/common/nm-meta-setting-access.c index ce5cd331..1167b555 100644 --- a/clients/common/nm-meta-setting-access.c +++ b/clients/common/nm-meta-setting-access.c @@ -1,20 +1,6 @@ -/* NetworkManager - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright 2010 - 2017 Red Hat, Inc. +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2010 - 2017 Red Hat, Inc. */ #include "nm-default.h" diff --git a/clients/common/nm-meta-setting-access.h b/clients/common/nm-meta-setting-access.h index 38f22c7a..543b51fc 100644 --- a/clients/common/nm-meta-setting-access.h +++ b/clients/common/nm-meta-setting-access.h @@ -1,20 +1,6 @@ -/* NetworkManager - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright 2010 - 2017 Red Hat, Inc. +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2010 - 2017 Red Hat, Inc. */ #ifndef _NM_META_SETTING_ACCESS_H__ diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index 3ee25d06..8e05c9bc 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -1,20 +1,6 @@ -/* nmcli - command-line tool to control NetworkManager - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright 2010 - 2018 Red Hat, Inc. +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2010 - 2018 Red Hat, Inc. */ #include "nm-default.h" @@ -367,7 +353,7 @@ _parse_ip_route (int family, } prefix = MAX_PREFIX; if (plen) { - if ((prefix = _nm_utils_ascii_str_to_int64 (plen, 10, 1, MAX_PREFIX, -1)) == -1) { + if ((prefix = _nm_utils_ascii_str_to_int64 (plen, 10, 0, MAX_PREFIX, -1)) == -1) { g_set_error (error, NM_UTILS_ERROR, NM_UTILS_ERROR_INVALID_ARGUMENT, _("invalid prefix '%s'; <1-%d> allowed"), plen, MAX_PREFIX); @@ -638,7 +624,7 @@ _env_warn_fcn (const NMMetaEnvironment *environment, const NMMetaPropertyInfo *property_info, const NMMetaEnvironment *environment, gpointer environment_user_data, NMSetting *setting, NMMetaAccessorGetType get_type, NMMetaAccessorGetFlags get_flags, NMMetaAccessorGetOutFlags *out_flags, gboolean *out_is_default, gpointer *out_to_free #define ARGS_SET_FCN \ - const NMMetaPropertyInfo *property_info, const NMMetaEnvironment *environment, gpointer environment_user_data, NMSetting *setting, char modifier, const char *value, GError **error + const NMMetaPropertyInfo *property_info, const NMMetaEnvironment *environment, gpointer environment_user_data, NMSetting *setting, NMMetaAccessorModifier modifier, const char *value, GError **error #define ARGS_REMOVE_FCN \ const NMMetaPropertyInfo *property_info, const NMMetaEnvironment *environment, gpointer environment_user_data, NMSetting *setting, const char *value, GError **error @@ -653,43 +639,52 @@ _env_warn_fcn (const NMMetaEnvironment *environment, const NMMetaSettingInfoEditor *setting_info, NMSetting *setting, NMMetaAccessorSettingInitType init_type static gboolean -_SET_FCN_DO_RESET_DEFAULT (const NMMetaPropertyInfo *property_info, char modifier, const char *value) +_SET_FCN_DO_RESET_DEFAULT (const NMMetaPropertyInfo *property_info, NMMetaAccessorModifier modifier, const char *value) { nm_assert (property_info); nm_assert (!property_info->property_type->set_supports_remove); - nm_assert (NM_IN_SET (modifier, '\0', '+')); - nm_assert (value || modifier == '\0'); + nm_assert (NM_IN_SET (modifier, NM_META_ACCESSOR_MODIFIER_SET, + NM_META_ACCESSOR_MODIFIER_ADD)); + nm_assert ( value + || modifier == NM_META_ACCESSOR_MODIFIER_SET); return value == NULL; } static gboolean -_SET_FCN_DO_RESET_DEFAULT_WITH_SUPPORTS_REMOVE (const NMMetaPropertyInfo *property_info, char modifier, const char *value) +_SET_FCN_DO_RESET_DEFAULT_WITH_SUPPORTS_REMOVE (const NMMetaPropertyInfo *property_info, NMMetaAccessorModifier modifier, const char *value) { nm_assert (property_info); nm_assert (property_info->property_type->set_supports_remove); - nm_assert (NM_IN_SET (modifier, '\0', '+', '-')); - nm_assert (value || modifier == '\0'); + nm_assert (NM_IN_SET (modifier, NM_META_ACCESSOR_MODIFIER_SET, + NM_META_ACCESSOR_MODIFIER_ADD, + NM_META_ACCESSOR_MODIFIER_DEL)); + nm_assert ( value + || modifier == NM_META_ACCESSOR_MODIFIER_SET); return value == NULL; } static gboolean -_SET_FCN_DO_SET_ALL (char modifier, const char *value) +_SET_FCN_DO_SET_ALL (NMMetaAccessorModifier modifier, const char *value) { - nm_assert (NM_IN_SET (modifier, '\0', '+', '-')); + nm_assert (NM_IN_SET (modifier, NM_META_ACCESSOR_MODIFIER_SET, + NM_META_ACCESSOR_MODIFIER_ADD, + NM_META_ACCESSOR_MODIFIER_DEL)); nm_assert (value); - return modifier == '\0'; + return modifier == NM_META_ACCESSOR_MODIFIER_SET; } static gboolean -_SET_FCN_DO_REMOVE (char modifier, const char *value) +_SET_FCN_DO_REMOVE (NMMetaAccessorModifier modifier, const char *value) { - nm_assert (NM_IN_SET (modifier, '\0', '+', '-')); + nm_assert (NM_IN_SET (modifier, NM_META_ACCESSOR_MODIFIER_SET, + NM_META_ACCESSOR_MODIFIER_ADD, + NM_META_ACCESSOR_MODIFIER_DEL)); nm_assert (value); - return modifier == '-'; + return modifier == NM_META_ACCESSOR_MODIFIER_DEL; } #define RETURN_UNSUPPORTED_GET_TYPE() \ @@ -1458,11 +1453,12 @@ _set_fcn_gobject_enum (ARGS_SET_FCN) 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; int v; - if (_SET_FCN_DO_RESET_DEFAULT (property_info, modifier, value)) + if (_SET_FCN_DO_RESET_DEFAULT_WITH_SUPPORTS_REMOVE (property_info, modifier, value)) return _gobject_property_reset_default (setting, property_info->property_name); if (property_info->property_typ_data) { @@ -1479,15 +1475,15 @@ _set_fcn_gobject_enum (ARGS_SET_FCN) G_TYPE_INT, G_TYPE_UINT) && G_TYPE_IS_CLASSED (gtype) - && (gtype_class = g_type_class_ref (gtype)) - && ( (is_flags = G_IS_FLAGS_CLASS (gtype_class)) - || G_IS_ENUM_CLASS (gtype_class))) { + && (gtype_prop_class = g_type_class_ref (gtype)) + && ( (is_flags = G_IS_FLAGS_CLASS (gtype_prop_class)) + || G_IS_ENUM_CLASS (gtype_prop_class))) { /* valid */ } else if ( !has_gtype && G_TYPE_IS_CLASSED (gtype_prop) - && (gtype_class = g_type_class_ref (gtype_prop)) - && ( (is_flags = G_IS_FLAGS_CLASS (gtype_class)) - || G_IS_ENUM_CLASS (gtype_class))) { + && (gtype_prop_class = g_type_class_ref (gtype_prop)) + && ( (is_flags = G_IS_FLAGS_CLASS (gtype_prop_class)) + || G_IS_ENUM_CLASS (gtype_prop_class))) { gtype = gtype_prop; } else g_return_val_if_reached (FALSE); @@ -1507,16 +1503,33 @@ _set_fcn_gobject_enum (ARGS_SET_FCN) v); } + gtype_class = g_type_class_ref (gtype); + + if ( G_IS_FLAGS_CLASS (gtype_class) + && !_SET_FCN_DO_SET_ALL (modifier, value)) { + nm_auto_unset_gvalue GValue int_value = { }; + guint v_flag; + + g_value_init (&int_value, G_TYPE_UINT); + g_object_get_property (G_OBJECT (setting), property_info->property_name, &int_value); + v_flag = g_value_get_uint (&int_value); + + if (_SET_FCN_DO_REMOVE (modifier, value)) + v = (int) (v_flag & ~((guint) v)); + else + v = (int) (v_flag | ((guint) v)); + } + g_value_init (&gval, gtype_prop); if (gtype_prop == G_TYPE_INT) g_value_set_int (&gval, v); else if (gtype_prop == G_TYPE_UINT) g_value_set_uint (&gval, v); else if (is_flags) { - nm_assert (G_IS_FLAGS_CLASS (gtype_class)); + nm_assert (G_IS_FLAGS_CLASS (gtype_prop_class)); g_value_set_flags (&gval, v); } else { - nm_assert (G_IS_ENUM_CLASS (gtype_class)); + nm_assert (G_IS_ENUM_CLASS (gtype_prop_class)); g_value_set_enum (&gval, v); } @@ -4339,12 +4352,14 @@ static const NMMetaPropertyType _pt_gobject_secret_flags = { .get_fcn = _get_fcn_gobject_secret_flags, .set_fcn = _set_fcn_gobject_enum, .values_fcn = _values_fcn_gobject_enum, + .set_supports_remove = TRUE, }; static const NMMetaPropertyType _pt_gobject_enum = { .get_fcn = _get_fcn_gobject_enum, .set_fcn = _set_fcn_gobject_enum, .values_fcn = _values_fcn_gobject_enum, + .set_supports_remove = TRUE, }; static const NMMetaPropertyType _pt_gobject_devices = { @@ -4462,24 +4477,24 @@ static const NMMetaPropertyType _pt_objlist = { " name=arp_ping source-host=172.16.1.1 target-host=172.16.1.254, name=ethtool delay-up=3\n") #define DEFINE_DCB_PROPRITY_PROPERTY_TYPE \ - .property_type = &_pt_gobject_int, \ - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, \ - .value_infos = INT_VALUE_INFOS ( \ - { \ - .value.i64 = -1, \ - .nick = "unset", \ - }, \ - ), \ - ), + .property_type = &_pt_gobject_int, \ + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, \ + .value_infos = INT_VALUE_INFOS ( \ + { \ + .value.i64 = -1, \ + .nick = "unset", \ + }, \ + ), \ + ), #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_6LOWPAN static const NMMetaPropertyInfo *const property_infos_6LOWPAN[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_6LOWPAN_PARENT, - .is_cli_option = TRUE, - .property_alias = "dev", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = N_("IEEE 802.15.4 (WPAN) parent device or connection UUID"), - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "dev", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = N_("IEEE 802.15.4 (WPAN) parent device or connection UUID"), + .property_type = &_pt_gobject_string, ), NULL }; @@ -4491,255 +4506,255 @@ static const NMMetaPropertyInfo *const property_infos_802_1X[] = { .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_EAP, - .property_type = &_pt_multilist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (multilist, - .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSetting8021x, nm_setting_802_1x_get_num_eap_methods), - .add_fcn = MULTILIST_ADD_FCN (NMSetting8021x, nm_setting_802_1x_add_eap_method), - .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSetting8021x, nm_setting_802_1x_remove_eap_method), - .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSetting8021x, nm_setting_802_1x_remove_eap_method_by_value), - .strsplit_plain = TRUE, - ), - .values_static = NM_MAKE_STRV ("leap", "md5", "tls", "peap", "ttls", "sim", "fast", "pwd"), - ), + .property_type = &_pt_multilist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (multilist, + .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSetting8021x, nm_setting_802_1x_get_num_eap_methods), + .add_fcn = MULTILIST_ADD_FCN (NMSetting8021x, nm_setting_802_1x_add_eap_method), + .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSetting8021x, nm_setting_802_1x_remove_eap_method), + .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSetting8021x, nm_setting_802_1x_remove_eap_method_by_value), + .strsplit_plain = TRUE, + ), + .values_static = NM_MAKE_STRV ("leap", "md5", "tls", "peap", "ttls", "sim", "fast", "pwd"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_IDENTITY, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_ANONYMOUS_IDENTITY, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PAC_FILE, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_CA_CERT, - .describe_message = - N_("Enter file path to CA certificate (optionally prefixed with file://).\n" - " [file://]<file path>\n" - "Note that nmcli does not support specifying certificates as raw blob data.\n" - "Example: /home/cimrman/cacert.crt\n"), - .property_type = &_pt_cert_8021x, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (cert_8021x, - .scheme_type = NM_SETTING_802_1X_SCHEME_TYPE_CA_CERT, - ), + .describe_message = + N_("Enter file path to CA certificate (optionally prefixed with file://).\n" + " [file://]<file path>\n" + "Note that nmcli does not support specifying certificates as raw blob data.\n" + "Example: /home/cimrman/cacert.crt\n"), + .property_type = &_pt_cert_8021x, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (cert_8021x, + .scheme_type = NM_SETTING_802_1X_SCHEME_TYPE_CA_CERT, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_CA_CERT_PASSWORD, - .is_secret = TRUE, - .property_type = &_pt_gobject_string, + .is_secret = TRUE, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_CA_CERT_PASSWORD_FLAGS, - .property_type = &_pt_gobject_secret_flags, + .property_type = &_pt_gobject_secret_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_CA_PATH, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_SUBJECT_MATCH, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_ALTSUBJECT_MATCHES, - .property_type = &_pt_multilist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (multilist, - .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSetting8021x, nm_setting_802_1x_get_num_altsubject_matches), - .add_fcn = MULTILIST_ADD_FCN (NMSetting8021x, nm_setting_802_1x_add_altsubject_match), - .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSetting8021x, nm_setting_802_1x_remove_altsubject_match), - .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSetting8021x, nm_setting_802_1x_remove_altsubject_match_by_value), - .strsplit_plain = TRUE, - ), - ), + .property_type = &_pt_multilist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (multilist, + .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSetting8021x, nm_setting_802_1x_get_num_altsubject_matches), + .add_fcn = MULTILIST_ADD_FCN (NMSetting8021x, nm_setting_802_1x_add_altsubject_match), + .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSetting8021x, nm_setting_802_1x_remove_altsubject_match), + .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSetting8021x, nm_setting_802_1x_remove_altsubject_match_by_value), + .strsplit_plain = TRUE, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_DOMAIN_SUFFIX_MATCH, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_CLIENT_CERT, - .describe_message = - N_("Enter file path to client certificate (optionally prefixed with file://).\n" - " [file://]<file path>\n" - "Note that nmcli does not support specifying certificates as raw blob data.\n" - "Example: /home/cimrman/jara.crt\n"), - .property_type = &_pt_cert_8021x, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (cert_8021x, - .scheme_type = NM_SETTING_802_1X_SCHEME_TYPE_CLIENT_CERT, - ), + .describe_message = + N_("Enter file path to client certificate (optionally prefixed with file://).\n" + " [file://]<file path>\n" + "Note that nmcli does not support specifying certificates as raw blob data.\n" + "Example: /home/cimrman/jara.crt\n"), + .property_type = &_pt_cert_8021x, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (cert_8021x, + .scheme_type = NM_SETTING_802_1X_SCHEME_TYPE_CLIENT_CERT, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_CLIENT_CERT_PASSWORD, - .is_secret = TRUE, - .property_type = &_pt_gobject_string, + .is_secret = TRUE, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_CLIENT_CERT_PASSWORD_FLAGS, - .property_type = &_pt_gobject_secret_flags, + .property_type = &_pt_gobject_secret_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PHASE1_PEAPVER, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV ("0", "1"), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV ("0", "1"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PHASE1_PEAPLABEL, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV ("0", "1"), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV ("0", "1"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV ("0", "1", "2", "3"), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV ("0", "1", "2", "3"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PHASE1_AUTH_FLAGS, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_setting_802_1x_auth_flags_get_type, - ), - .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT, - ), + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_setting_802_1x_auth_flags_get_type, + ), + .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PHASE2_AUTH, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV ("pap", "chap", "mschap", "mschapv2", "gtc", "otp", "md5", "tls"), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV ("pap", "chap", "mschap", "mschapv2", "gtc", "otp", "md5", "tls"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PHASE2_AUTHEAP, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV ("md5", "mschapv2", "otp", "gtc", "tls"), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV ("md5", "mschapv2", "otp", "gtc", "tls"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PHASE2_CA_CERT, - .describe_message = - N_("Enter file path to CA certificate for inner authentication (optionally prefixed\n" - "with file://).\n" - " [file://]<file path>\n" - "Note that nmcli does not support specifying certificates as raw blob data.\n" - "Example: /home/cimrman/ca-zweite-phase.crt\n"), - .property_type = &_pt_cert_8021x, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (cert_8021x, - .scheme_type = NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_CA_CERT, - ), + .describe_message = + N_("Enter file path to CA certificate for inner authentication (optionally prefixed\n" + "with file://).\n" + " [file://]<file path>\n" + "Note that nmcli does not support specifying certificates as raw blob data.\n" + "Example: /home/cimrman/ca-zweite-phase.crt\n"), + .property_type = &_pt_cert_8021x, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (cert_8021x, + .scheme_type = NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_CA_CERT, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PHASE2_CA_CERT_PASSWORD, - .is_secret = TRUE, - .property_type = &_pt_gobject_string, + .is_secret = TRUE, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PHASE2_CA_CERT_PASSWORD_FLAGS, - .property_type = &_pt_gobject_secret_flags, + .property_type = &_pt_gobject_secret_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PHASE2_CA_PATH, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PHASE2_SUBJECT_MATCH, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES, - .property_type = &_pt_multilist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (multilist, - .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSetting8021x, nm_setting_802_1x_get_num_phase2_altsubject_matches), - .add_fcn = MULTILIST_ADD_FCN (NMSetting8021x, nm_setting_802_1x_add_phase2_altsubject_match), - .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSetting8021x, nm_setting_802_1x_remove_phase2_altsubject_match), - .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSetting8021x, nm_setting_802_1x_remove_phase2_altsubject_match_by_value), - .strsplit_plain = TRUE, - ), - ), + .property_type = &_pt_multilist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (multilist, + .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSetting8021x, nm_setting_802_1x_get_num_phase2_altsubject_matches), + .add_fcn = MULTILIST_ADD_FCN (NMSetting8021x, nm_setting_802_1x_add_phase2_altsubject_match), + .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSetting8021x, nm_setting_802_1x_remove_phase2_altsubject_match), + .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSetting8021x, nm_setting_802_1x_remove_phase2_altsubject_match_by_value), + .strsplit_plain = TRUE, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PHASE2_DOMAIN_SUFFIX_MATCH, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PHASE2_CLIENT_CERT, - .describe_message = - N_("Enter file path to client certificate for inner authentication (optionally prefixed\n" - "with file://).\n" - " [file://]<file path>\n" - "Note that nmcli does not support specifying certificates as raw blob data.\n" - "Example: /home/cimrman/jara-zweite-phase.crt\n"), - .property_type = &_pt_cert_8021x, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (cert_8021x, - .scheme_type = NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_CLIENT_CERT, - ), + .describe_message = + N_("Enter file path to client certificate for inner authentication (optionally prefixed\n" + "with file://).\n" + " [file://]<file path>\n" + "Note that nmcli does not support specifying certificates as raw blob data.\n" + "Example: /home/cimrman/jara-zweite-phase.crt\n"), + .property_type = &_pt_cert_8021x, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (cert_8021x, + .scheme_type = NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_CLIENT_CERT, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PHASE2_CLIENT_CERT_PASSWORD, - .is_secret = TRUE, - .property_type = &_pt_gobject_string, + .is_secret = TRUE, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PHASE2_CLIENT_CERT_PASSWORD_FLAGS, - .property_type = &_pt_gobject_secret_flags, + .property_type = &_pt_gobject_secret_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PASSWORD, - .is_secret = TRUE, - .property_type = &_pt_gobject_string, + .is_secret = TRUE, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PASSWORD_FLAGS, - .property_type = &_pt_gobject_secret_flags, + .property_type = &_pt_gobject_secret_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PASSWORD_RAW, - .is_secret = TRUE, - .describe_message = - N_("Enter bytes as a list of hexadecimal values.\n" - "Two formats are accepted:\n" - "(a) a string of hexadecimal digits, where each two digits represent one byte\n" - "(b) space-separated list of bytes written as hexadecimal digits " - "(with optional 0x/0X prefix, and optional leading 0).\n\n" - "Examples: ab0455a6ea3a74C2\n" - " ab 4 55 0xa6 ea 3a 74 C2\n"), - .property_type = &_pt_gobject_bytes, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_bytes, - .legacy_format = TRUE, - ), + .is_secret = TRUE, + .describe_message = + N_("Enter bytes as a list of hexadecimal values.\n" + "Two formats are accepted:\n" + "(a) a string of hexadecimal digits, where each two digits represent one byte\n" + "(b) space-separated list of bytes written as hexadecimal digits " + "(with optional 0x/0X prefix, and optional leading 0).\n\n" + "Examples: ab0455a6ea3a74C2\n" + " ab 4 55 0xa6 ea 3a 74 C2\n"), + .property_type = &_pt_gobject_bytes, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_bytes, + .legacy_format = TRUE, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PASSWORD_RAW_FLAGS, - .property_type = &_pt_gobject_secret_flags, + .property_type = &_pt_gobject_secret_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PRIVATE_KEY, - .describe_message = - N_("Enter path to a private key and the key password (if not set yet):\n" - " [file://]<file path> [<password>]\n" - "Note that nmcli does not support specifying private key as raw blob data.\n" - "Example: /home/cimrman/jara-priv-key Dardanely\n"), - .property_type = &_pt_cert_8021x, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (cert_8021x, - .scheme_type = NM_SETTING_802_1X_SCHEME_TYPE_PRIVATE_KEY, - ), + .describe_message = + N_("Enter path to a private key and the key password (if not set yet):\n" + " [file://]<file path> [<password>]\n" + "Note that nmcli does not support specifying private key as raw blob data.\n" + "Example: /home/cimrman/jara-priv-key Dardanely\n"), + .property_type = &_pt_cert_8021x, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (cert_8021x, + .scheme_type = NM_SETTING_802_1X_SCHEME_TYPE_PRIVATE_KEY, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD, - .is_secret = TRUE, - .property_type = &_pt_gobject_string, + .is_secret = TRUE, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD_FLAGS, - .property_type = &_pt_gobject_secret_flags, + .property_type = &_pt_gobject_secret_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, - .describe_message = - N_("Enter path to a private key and the key password (if not set yet):\n" - " [file://]<file path> [<password>]\n" - "Note that nmcli does not support specifying private key as raw blob data.\n" - "Example: /home/cimrman/jara-priv-key Dardanely\n"), - .property_type = &_pt_cert_8021x, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (cert_8021x, - .scheme_type = NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_PRIVATE_KEY, - ), + .describe_message = + N_("Enter path to a private key and the key password (if not set yet):\n" + " [file://]<file path> [<password>]\n" + "Note that nmcli does not support specifying private key as raw blob data.\n" + "Example: /home/cimrman/jara-priv-key Dardanely\n"), + .property_type = &_pt_cert_8021x, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (cert_8021x, + .scheme_type = NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_PRIVATE_KEY, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD, - .is_secret = TRUE, - .property_type = &_pt_gobject_string, + .is_secret = TRUE, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD_FLAGS, - .property_type = &_pt_gobject_secret_flags, + .property_type = &_pt_gobject_secret_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PIN, - .is_secret = TRUE, - .property_type = &_pt_gobject_string, + .is_secret = TRUE, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_PIN_FLAGS, - .property_type = &_pt_gobject_secret_flags, + .property_type = &_pt_gobject_secret_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_SYSTEM_CA_CERTS, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_802_1X_AUTH_TIMEOUT, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), NULL }; @@ -4748,51 +4763,51 @@ static const NMMetaPropertyInfo *const property_infos_802_1X[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_ADSL static const NMMetaPropertyInfo *const property_infos_ADSL[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_ADSL_USERNAME, - .is_cli_option = TRUE, - .property_alias = "username", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = N_("Username"), - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "username", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = N_("Username"), + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_ADSL_PASSWORD, - .is_cli_option = TRUE, - .property_alias = "password", - .prompt = N_("Password [none]"), - .is_secret = TRUE, - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "password", + .prompt = N_("Password [none]"), + .is_secret = TRUE, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_ADSL_PASSWORD_FLAGS, - .property_type = &_pt_gobject_secret_flags, + .property_type = &_pt_gobject_secret_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_ADSL_PROTOCOL, - .is_cli_option = TRUE, - .property_alias = "protocol", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = NM_META_TEXT_PROMPT_ADSL_PROTO, - .def_hint = NM_META_TEXT_PROMPT_ADSL_PROTO_CHOICES, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV (NM_SETTING_ADSL_PROTOCOL_PPPOA, - NM_SETTING_ADSL_PROTOCOL_PPPOE, - NM_SETTING_ADSL_PROTOCOL_IPOATM), - ), + .is_cli_option = TRUE, + .property_alias = "protocol", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = NM_META_TEXT_PROMPT_ADSL_PROTO, + .def_hint = NM_META_TEXT_PROMPT_ADSL_PROTO_CHOICES, + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV (NM_SETTING_ADSL_PROTOCOL_PPPOA, + NM_SETTING_ADSL_PROTOCOL_PPPOE, + NM_SETTING_ADSL_PROTOCOL_IPOATM), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_ADSL_ENCAPSULATION, - .is_cli_option = TRUE, - .property_alias = "encapsulation", - .prompt = NM_META_TEXT_PROMPT_ADSL_ENCAP, - .def_hint = NM_META_TEXT_PROMPT_ADSL_ENCAP_CHOICES, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV (NM_SETTING_ADSL_ENCAPSULATION_VCMUX, - NM_SETTING_ADSL_ENCAPSULATION_LLC), - ), + .is_cli_option = TRUE, + .property_alias = "encapsulation", + .prompt = NM_META_TEXT_PROMPT_ADSL_ENCAP, + .def_hint = NM_META_TEXT_PROMPT_ADSL_ENCAP_CHOICES, + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV (NM_SETTING_ADSL_ENCAPSULATION_VCMUX, + NM_SETTING_ADSL_ENCAPSULATION_LLC), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_ADSL_VPI, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_ADSL_VCI, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), NULL }; @@ -4801,22 +4816,22 @@ static const NMMetaPropertyInfo *const property_infos_ADSL[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_BLUETOOTH static const NMMetaPropertyInfo *const property_infos_BLUETOOTH[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_BLUETOOTH_BDADDR, - .is_cli_option = TRUE, - .property_alias = "addr", - .prompt = N_("Bluetooth device address"), - .property_type = &_pt_gobject_mac, + .is_cli_option = TRUE, + .property_alias = "addr", + .prompt = N_("Bluetooth device address"), + .property_type = &_pt_gobject_mac, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_BLUETOOTH_TYPE, - .is_cli_option = TRUE, - .property_alias = "bt-type", - .prompt = NM_META_TEXT_PROMPT_BT_TYPE, - .def_hint = NM_META_TEXT_PROMPT_BT_TYPE_CHOICES, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV (NM_SETTING_BLUETOOTH_TYPE_DUN, - NM_SETTING_BLUETOOTH_TYPE_PANU, - NM_SETTING_BLUETOOTH_TYPE_NAP), - ), + .is_cli_option = TRUE, + .property_alias = "bt-type", + .prompt = NM_META_TEXT_PROMPT_BT_TYPE, + .def_hint = NM_META_TEXT_PROMPT_BT_TYPE_CHOICES, + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV (NM_SETTING_BLUETOOTH_TYPE_DUN, + NM_SETTING_BLUETOOTH_TYPE_PANU, + NM_SETTING_BLUETOOTH_TYPE_NAP), + ), ), NULL }; @@ -4825,19 +4840,19 @@ static const NMMetaPropertyInfo *const property_infos_BLUETOOTH[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_BOND static const NMMetaPropertyInfo property_info_BOND_OPTIONS = PROPERTY_INFO_INIT (NM_SETTING_BOND_OPTIONS, DESCRIBE_DOC_NM_SETTING_BOND_OPTIONS, - .property_type = DEFINE_PROPERTY_TYPE ( - .describe_fcn = _describe_fcn_bond_options, - .get_fcn = _get_fcn_bond_options, - .set_fcn = _set_fcn_optionlist, - .set_supports_remove = TRUE, - .values_fcn = _values_fcn_bond_options, - ), - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (optionlist, - .set_fcn = _optionlist_set_fcn_bond_options, - ), - .nested = &nm_meta_property_typ_data_bond, - ), + .property_type = DEFINE_PROPERTY_TYPE ( + .describe_fcn = _describe_fcn_bond_options, + .get_fcn = _get_fcn_bond_options, + .set_fcn = _set_fcn_optionlist, + .set_supports_remove = TRUE, + .values_fcn = _values_fcn_bond_options, + ), + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (optionlist, + .set_fcn = _optionlist_set_fcn_bond_options, + ), + .nested = &nm_meta_property_typ_data_bond, + ), ); static const NMMetaPropertyInfo *const property_infos_BOND[] = { @@ -4849,75 +4864,75 @@ static const NMMetaPropertyInfo *const property_infos_BOND[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_BRIDGE static const NMMetaPropertyInfo *const property_infos_BRIDGE[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_BRIDGE_MAC_ADDRESS, - .is_cli_option = TRUE, - .property_alias = "mac", - .prompt = N_("MAC [none]"), - .property_type = &_pt_gobject_mac, + .is_cli_option = TRUE, + .property_alias = "mac", + .prompt = N_("MAC [none]"), + .property_type = &_pt_gobject_mac, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_BRIDGE_STP, - .is_cli_option = TRUE, - .property_alias = "stp", - .prompt = N_("Enable STP [no]"), - .property_type = &_pt_gobject_bool, + .is_cli_option = TRUE, + .property_alias = "stp", + .prompt = N_("Enable STP [no]"), + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_BRIDGE_PRIORITY, - .is_cli_option = TRUE, - .property_alias = "priority", - .prompt = N_("STP priority [32768]"), - .property_type = &_pt_gobject_int, + .is_cli_option = TRUE, + .property_alias = "priority", + .prompt = N_("STP priority [32768]"), + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_BRIDGE_FORWARD_DELAY, - .is_cli_option = TRUE, - .property_alias = "forward-delay", - .prompt = N_("Forward delay [15]"), - .property_type = &_pt_gobject_int, + .is_cli_option = TRUE, + .property_alias = "forward-delay", + .prompt = N_("Forward delay [15]"), + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_BRIDGE_HELLO_TIME, - .is_cli_option = TRUE, - .property_alias = "hello-time", - .prompt = N_("Hello time [2]"), - .property_type = &_pt_gobject_int, + .is_cli_option = TRUE, + .property_alias = "hello-time", + .prompt = N_("Hello time [2]"), + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_BRIDGE_MAX_AGE, - .is_cli_option = TRUE, - .property_alias = "max-age", - .prompt = N_("Max age [20]"), - .property_type = &_pt_gobject_int, + .is_cli_option = TRUE, + .property_alias = "max-age", + .prompt = N_("Max age [20]"), + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_BRIDGE_AGEING_TIME, - .is_cli_option = TRUE, - .property_alias = "ageing-time", - .prompt = N_("MAC address ageing time [300]"), - .property_type = &_pt_gobject_int, + .is_cli_option = TRUE, + .property_alias = "ageing-time", + .prompt = N_("MAC address ageing time [300]"), + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_BRIDGE_GROUP_FORWARD_MASK, - .is_cli_option = TRUE, - .property_alias = "group-forward-mask", - .prompt = N_("Group forward mask [0]"), - .property_type = &_pt_gobject_int, + .is_cli_option = TRUE, + .property_alias = "group-forward-mask", + .prompt = N_("Group forward mask [0]"), + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_BRIDGE_MULTICAST_SNOOPING, - .is_cli_option = TRUE, - .property_alias = "multicast-snooping", - .prompt = N_("Enable IGMP snooping [no]"), - .property_type = &_pt_gobject_bool, + .is_cli_option = TRUE, + .property_alias = "multicast-snooping", + .prompt = N_("Enable IGMP snooping [no]"), + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_BRIDGE_VLAN_FILTERING, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_BRIDGE_VLAN_DEFAULT_PVID, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_BRIDGE_VLANS, - .property_type = &_pt_objlist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (objlist, - .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingBridge, nm_setting_bridge_get_num_vlans), - .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingBridge, nm_setting_bridge_clear_vlans), - .obj_to_str_fcn = _objlist_obj_to_str_fcn_bridge_vlans, - .set_fcn = _objlist_set_fcn_bridge_vlans, - ), - ), + .property_type = &_pt_objlist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (objlist, + .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingBridge, nm_setting_bridge_get_num_vlans), + .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingBridge, nm_setting_bridge_clear_vlans), + .obj_to_str_fcn = _objlist_obj_to_str_fcn_bridge_vlans, + .set_fcn = _objlist_set_fcn_bridge_vlans, + ), + ), ), NULL }; @@ -4926,33 +4941,33 @@ static const NMMetaPropertyInfo *const property_infos_BRIDGE[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_BRIDGE_PORT static const NMMetaPropertyInfo *const property_infos_BRIDGE_PORT[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_BRIDGE_PORT_PRIORITY, - .is_cli_option = TRUE, - .property_alias = "priority", - .prompt = N_("Bridge port priority [32]"), - .property_type = &_pt_gobject_int, + .is_cli_option = TRUE, + .property_alias = "priority", + .prompt = N_("Bridge port priority [32]"), + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_BRIDGE_PORT_PATH_COST, - .is_cli_option = TRUE, - .property_alias = "path-cost", - .prompt = N_("Bridge port STP path cost [100]"), - .property_type = &_pt_gobject_int, + .is_cli_option = TRUE, + .property_alias = "path-cost", + .prompt = N_("Bridge port STP path cost [100]"), + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE, - .is_cli_option = TRUE, - .property_alias = "hairpin", - .prompt = N_("Hairpin [no]"), - .property_type = &_pt_gobject_bool, + .is_cli_option = TRUE, + .property_alias = "hairpin", + .prompt = N_("Hairpin [no]"), + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_BRIDGE_PORT_VLANS, - .property_type = &_pt_objlist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (objlist, - .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingBridgePort, nm_setting_bridge_port_get_num_vlans), - .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingBridgePort, nm_setting_bridge_port_clear_vlans), - .obj_to_str_fcn = _objlist_obj_to_str_fcn_bridge_vlans, - .set_fcn = _objlist_set_fcn_bridge_vlans, - ), - ), + .property_type = &_pt_objlist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (objlist, + .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingBridgePort, nm_setting_bridge_port_get_num_vlans), + .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingBridgePort, nm_setting_bridge_port_clear_vlans), + .obj_to_str_fcn = _objlist_obj_to_str_fcn_bridge_vlans, + .set_fcn = _objlist_set_fcn_bridge_vlans, + ), + ), ), NULL }; @@ -4961,29 +4976,29 @@ static const NMMetaPropertyInfo *const property_infos_BRIDGE_PORT[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_CDMA static const NMMetaPropertyInfo *const property_infos_CDMA[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_CDMA_NUMBER, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CDMA_USERNAME, - .is_cli_option = TRUE, - .property_alias = "user", - .prompt = N_("Username [none]"), - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "user", + .prompt = N_("Username [none]"), + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CDMA_PASSWORD, - .is_cli_option = TRUE, - .property_alias = "password", - .prompt = N_("Password [none]"), - .is_secret = TRUE, - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "password", + .prompt = N_("Password [none]"), + .is_secret = TRUE, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CDMA_PASSWORD_FLAGS, - .property_type = &_pt_gobject_secret_flags, + .property_type = &_pt_gobject_secret_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CDMA_MTU, - .property_type = &_pt_gobject_mtu, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mtu, - .get_fcn = MTU_GET_FCN (NMSettingCdma, nm_setting_cdma_get_mtu), - ), + .property_type = &_pt_gobject_mtu, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mtu, + .get_fcn = MTU_GET_FCN (NMSettingCdma, nm_setting_cdma_get_mtu), + ), ), NULL }; @@ -4992,205 +5007,204 @@ static const NMMetaPropertyInfo *const property_infos_CDMA[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_CONNECTION static const NMMetaPropertyInfo *const property_infos_CONNECTION[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_ID, - .is_cli_option = TRUE, - .property_alias = "con-name", - .inf_flags = NM_META_PROPERTY_INF_FLAG_DONT_ASK, - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "con-name", + .inf_flags = NM_META_PROPERTY_INF_FLAG_DONT_ASK, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_UUID, - .property_type = DEFINE_PROPERTY_TYPE ( .get_fcn = _get_fcn_gobject ), + .property_type = DEFINE_PROPERTY_TYPE ( .get_fcn = _get_fcn_gobject ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_STABLE_ID, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), [_NM_META_PROPERTY_TYPE_CONNECTION_TYPE] = - PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_TYPE, - .is_cli_option = TRUE, - .property_alias = "type", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = NM_META_TEXT_PROMPT_CON_TYPE, - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_gobject, - .set_fcn = _set_fcn_connection_type, - .complete_fcn = _complete_fcn_connection_type, - ), - ), + PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_TYPE, + .is_cli_option = TRUE, + .property_alias = "type", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = NM_META_TEXT_PROMPT_CON_TYPE, + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_gobject, + .set_fcn = _set_fcn_connection_type, + .complete_fcn = _complete_fcn_connection_type, + ), + ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_INTERFACE_NAME, - .is_cli_option = TRUE, - .property_alias = "ifname", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = NM_META_TEXT_PROMPT_IFNAME, - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_gobject, - .set_fcn = _set_fcn_gobject_ifname, - .complete_fcn = _complete_fcn_gobject_devices, - ), + .is_cli_option = TRUE, + .property_alias = "ifname", + .prompt = NM_META_TEXT_PROMPT_IFNAME, + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_gobject, + .set_fcn = _set_fcn_gobject_ifname, + .complete_fcn = _complete_fcn_gobject_devices, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_AUTOCONNECT, - .is_cli_option = TRUE, - .property_alias = "autoconnect", - .inf_flags = NM_META_PROPERTY_INF_FLAG_DONT_ASK, - .property_type = &_pt_gobject_bool, + .is_cli_option = TRUE, + .property_alias = "autoconnect", + .inf_flags = NM_META_PROPERTY_INF_FLAG_DONT_ASK, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_AUTOCONNECT_PRIORITY, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_AUTOCONNECT_RETRIES, - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = -1, - .nick = "default", - }, - { - .value.i64 = 0, - .nick = "forever", - }, - ), - ), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = -1, + .nick = "default", + }, + { + .value.i64 = 0, + .nick = "forever", + }, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_MULTI_CONNECT, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_connection_multi_connect_get_type, - ), - ), + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_connection_multi_connect_get_type, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_AUTH_RETRIES, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_TIMESTAMP, - .property_type = &_pt_gobject_readonly, + .property_type = &_pt_gobject_readonly, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_READ_ONLY, - .property_type = &_pt_gobject_readonly, + .property_type = &_pt_gobject_readonly, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_PERMISSIONS, - .describe_message = - N_("Enter a list of user permissions. This is a list of user names formatted as:\n" - " [user:]<user name 1>, [user:]<user name 2>,...\n" - "The items can be separated by commas or spaces.\n\n" - "Example: alice bob charlie\n"), - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_connection_permissions, - .set_fcn = _set_fcn_multilist, - .set_supports_remove = TRUE, - ), - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (multilist, - .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSettingConnection, nm_setting_connection_get_num_permissions), - .add_fcn = _multilist_set_fcn_connection_permissions, - .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSettingConnection, nm_setting_connection_remove_permission), - .remove_by_value_fcn = _multilist_remove_by_value_fcn_connection_permissions, - .validate2_fcn = _multilist_validate2_fcn_connection_permissions, - .strsplit_plain = TRUE, - ), - ), + .describe_message = + N_("Enter a list of user permissions. This is a list of user names formatted as:\n" + " [user:]<user name 1>, [user:]<user name 2>,...\n" + "The items can be separated by commas or spaces.\n\n" + "Example: alice bob charlie\n"), + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_connection_permissions, + .set_fcn = _set_fcn_multilist, + .set_supports_remove = TRUE, + ), + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (multilist, + .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSettingConnection, nm_setting_connection_get_num_permissions), + .add_fcn = _multilist_set_fcn_connection_permissions, + .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSettingConnection, nm_setting_connection_remove_permission), + .remove_by_value_fcn = _multilist_remove_by_value_fcn_connection_permissions, + .validate2_fcn = _multilist_validate2_fcn_connection_permissions, + .strsplit_plain = TRUE, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_ZONE, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_MASTER, - .is_cli_option = TRUE, - .property_alias = "master", - .inf_flags = NM_META_PROPERTY_INF_FLAG_DONT_ASK, - .prompt = NM_META_TEXT_PROMPT_MASTER, - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_gobject, - .set_fcn = _set_fcn_connection_master, - .complete_fcn = _complete_fcn_connection_master, - ), + .is_cli_option = TRUE, + .property_alias = "master", + .inf_flags = NM_META_PROPERTY_INF_FLAG_DONT_ASK, + .prompt = NM_META_TEXT_PROMPT_MASTER, + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_gobject, + .set_fcn = _set_fcn_connection_master, + .complete_fcn = _complete_fcn_connection_master, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_SLAVE_TYPE, - .is_cli_option = TRUE, - .property_alias = "slave-type", - .inf_flags = NM_META_PROPERTY_INF_FLAG_DONT_ASK, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV (NM_SETTING_BOND_SETTING_NAME, - NM_SETTING_BRIDGE_SETTING_NAME, - NM_SETTING_OVS_BRIDGE_SETTING_NAME, - NM_SETTING_OVS_PORT_SETTING_NAME, - NM_SETTING_TEAM_SETTING_NAME), - ), + .is_cli_option = TRUE, + .property_alias = "slave-type", + .inf_flags = NM_META_PROPERTY_INF_FLAG_DONT_ASK, + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV (NM_SETTING_BOND_SETTING_NAME, + NM_SETTING_BRIDGE_SETTING_NAME, + NM_SETTING_OVS_BRIDGE_SETTING_NAME, + NM_SETTING_OVS_PORT_SETTING_NAME, + NM_SETTING_TEAM_SETTING_NAME), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES, - .property_type = &_pt_gobject_enum, + .property_type = &_pt_gobject_enum, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_SECONDARIES, - .describe_message = - N_("Enter secondary connections that should be activated when this connection is\n" - "activated. Connections can be specified either by UUID or ID (name). nmcli\n" - "transparently translates names to UUIDs. Note that NetworkManager only supports\n" - "VPNs as secondary connections at the moment.\n" - "The items can be separated by commas or spaces.\n\n" - "Example: private-openvpn, fe6ba5d8-c2fc-4aae-b2e3-97efddd8d9a7\n"), - .property_type = &_pt_multilist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (multilist, - .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSettingConnection, nm_setting_connection_get_num_secondaries), - .add_fcn = MULTILIST_ADD_FCN (NMSettingConnection, nm_setting_connection_add_secondary), - .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSettingConnection, nm_setting_connection_remove_secondary), - .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingConnection, nm_setting_connection_remove_secondary_by_value), - .validate2_fcn = _multilist_validate2_fcn_uuid, - .strsplit_plain = TRUE, - ), - ), + .describe_message = + N_("Enter secondary connections that should be activated when this connection is\n" + "activated. Connections can be specified either by UUID or ID (name). nmcli\n" + "transparently translates names to UUIDs. Note that NetworkManager only supports\n" + "VPNs as secondary connections at the moment.\n" + "The items can be separated by commas or spaces.\n\n" + "Example: private-openvpn, fe6ba5d8-c2fc-4aae-b2e3-97efddd8d9a7\n"), + .property_type = &_pt_multilist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (multilist, + .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSettingConnection, nm_setting_connection_get_num_secondaries), + .add_fcn = MULTILIST_ADD_FCN (NMSettingConnection, nm_setting_connection_add_secondary), + .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSettingConnection, nm_setting_connection_remove_secondary), + .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingConnection, nm_setting_connection_remove_secondary_by_value), + .validate2_fcn = _multilist_validate2_fcn_uuid, + .strsplit_plain = TRUE, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_METERED, - .describe_message = - N_("Enter a value which indicates whether the connection is subject to a data\n" - "quota, usage costs or other limitations. Accepted options are:\n" - "'true','yes','on' to set the connection as metered\n" - "'false','no','off' to set the connection as not metered\n" - "'unknown' to let NetworkManager choose a value using some heuristics\n"), - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_connection_metered, - .set_fcn = _set_fcn_connection_metered, - ), - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV ("yes", "no", "unknown"), - ), + .describe_message = + N_("Enter a value which indicates whether the connection is subject to a data\n" + "quota, usage costs or other limitations. Accepted options are:\n" + "'true','yes','on' to set the connection as metered\n" + "'false','no','off' to set the connection as not metered\n" + "'unknown' to let NetworkManager choose a value using some heuristics\n"), + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_connection_metered, + .set_fcn = _set_fcn_connection_metered, + ), + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV ("yes", "no", "unknown"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_LLDP, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_setting_connection_lldp_get_type, - .value_infos = ENUM_VALUE_INFOS ( - { - .value = NM_SETTING_CONNECTION_LLDP_ENABLE_RX, - .nick = "enable", - }, - ), - ), - .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT - | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, - ), + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_setting_connection_lldp_get_type, + .value_infos = ENUM_VALUE_INFOS ( + { + .value = NM_SETTING_CONNECTION_LLDP_ENABLE_RX, + .nick = "enable", + }, + ), + ), + .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT + | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_MDNS, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_setting_connection_mdns_get_type, - ), - ), + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_setting_connection_mdns_get_type, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_LLMNR, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_setting_connection_llmnr_get_type, - ), - ), + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_setting_connection_llmnr_get_type, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_CONNECTION_WAIT_DEVICE_TIMEOUT, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), NULL }; @@ -5199,97 +5213,97 @@ static const NMMetaPropertyInfo *const property_infos_CONNECTION[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_DCB static const NMMetaPropertyInfo *const property_infos_DCB[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_DCB_APP_FCOE_FLAGS, - .property_type = &_pt_dcb_flags, + .property_type = &_pt_dcb_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_DCB_APP_FCOE_PRIORITY, - DEFINE_DCB_PROPRITY_PROPERTY_TYPE + DEFINE_DCB_PROPRITY_PROPERTY_TYPE ), PROPERTY_INFO_WITH_DESC (NM_SETTING_DCB_APP_FCOE_MODE, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV (NM_SETTING_DCB_FCOE_MODE_FABRIC, - NM_SETTING_DCB_FCOE_MODE_VN2VN), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV (NM_SETTING_DCB_FCOE_MODE_FABRIC, + NM_SETTING_DCB_FCOE_MODE_VN2VN), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_DCB_APP_ISCSI_FLAGS, - .property_type = &_pt_dcb_flags, + .property_type = &_pt_dcb_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_DCB_APP_ISCSI_PRIORITY, - DEFINE_DCB_PROPRITY_PROPERTY_TYPE + DEFINE_DCB_PROPRITY_PROPERTY_TYPE ), PROPERTY_INFO_WITH_DESC (NM_SETTING_DCB_APP_FIP_FLAGS, - .property_type = &_pt_dcb_flags, + .property_type = &_pt_dcb_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_DCB_APP_FIP_PRIORITY, - DEFINE_DCB_PROPRITY_PROPERTY_TYPE + DEFINE_DCB_PROPRITY_PROPERTY_TYPE ), PROPERTY_INFO_WITH_DESC (NM_SETTING_DCB_PRIORITY_FLOW_CONTROL_FLAGS, - .property_type = &_pt_dcb_flags, + .property_type = &_pt_dcb_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_DCB_PRIORITY_FLOW_CONTROL, - .property_type = &_pt_dcb_bool, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (dcb_bool, - .get_fcn = nm_setting_dcb_get_priority_flow_control, - .set_fcn = nm_setting_dcb_set_priority_flow_control, - .with_flow_control_flags = TRUE, - ), + .property_type = &_pt_dcb_bool, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (dcb_bool, + .get_fcn = nm_setting_dcb_get_priority_flow_control, + .set_fcn = nm_setting_dcb_set_priority_flow_control, + .with_flow_control_flags = TRUE, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_DCB_PRIORITY_GROUP_FLAGS, - .property_type = &_pt_dcb_flags, + .property_type = &_pt_dcb_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_DCB_PRIORITY_GROUP_ID, - .property_type = &_pt_dcb, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (dcb, - .get_fcn = nm_setting_dcb_get_priority_group_id, - .set_fcn = nm_setting_dcb_set_priority_group_id, - .max = 7, - .other = 15, - ), + .property_type = &_pt_dcb, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (dcb, + .get_fcn = nm_setting_dcb_get_priority_group_id, + .set_fcn = nm_setting_dcb_set_priority_group_id, + .max = 7, + .other = 15, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_DCB_PRIORITY_GROUP_BANDWIDTH, - .property_type = &_pt_dcb, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (dcb, - .get_fcn = nm_setting_dcb_get_priority_group_bandwidth, - .set_fcn = nm_setting_dcb_set_priority_group_bandwidth, - .max = 100, - .other = 0, - .is_percent = TRUE, - ), + .property_type = &_pt_dcb, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (dcb, + .get_fcn = nm_setting_dcb_get_priority_group_bandwidth, + .set_fcn = nm_setting_dcb_set_priority_group_bandwidth, + .max = 100, + .other = 0, + .is_percent = TRUE, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_DCB_PRIORITY_BANDWIDTH, - .property_type = &_pt_dcb, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (dcb, - .get_fcn = nm_setting_dcb_get_priority_bandwidth, - .set_fcn = nm_setting_dcb_set_priority_bandwidth, - .max = 100, - .other = 0, - ), + .property_type = &_pt_dcb, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (dcb, + .get_fcn = nm_setting_dcb_get_priority_bandwidth, + .set_fcn = nm_setting_dcb_set_priority_bandwidth, + .max = 100, + .other = 0, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_DCB_PRIORITY_STRICT_BANDWIDTH, - .property_type = &_pt_dcb_bool, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (dcb_bool, - .get_fcn = nm_setting_dcb_get_priority_strict_bandwidth, - .set_fcn = nm_setting_dcb_set_priority_strict_bandwidth, - ), + .property_type = &_pt_dcb_bool, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (dcb_bool, + .get_fcn = nm_setting_dcb_get_priority_strict_bandwidth, + .set_fcn = nm_setting_dcb_set_priority_strict_bandwidth, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_DCB_PRIORITY_TRAFFIC_CLASS, - .property_type = &_pt_dcb, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (dcb, - .get_fcn = nm_setting_dcb_get_priority_traffic_class, - .set_fcn = nm_setting_dcb_set_priority_traffic_class, - .max = 7, - .other = 0, - ), + .property_type = &_pt_dcb, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (dcb, + .get_fcn = nm_setting_dcb_get_priority_traffic_class, + .set_fcn = nm_setting_dcb_set_priority_traffic_class, + .max = 7, + .other = 0, + ), ), NULL }; #define PROPERTY_INFO_ETHTOOL(xname) \ PROPERTY_INFO (NM_ETHTOOL_OPTNAME_##xname, NULL, \ - .property_type = &_pt_ethtool, \ - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (ethtool, \ - .ethtool_id = NM_ETHTOOL_ID_##xname, \ - ), \ + .property_type = &_pt_ethtool, \ + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (ethtool, \ + .ethtool_id = NM_ETHTOOL_ID_##xname, \ + ), \ ) #undef _CURRENT_NM_META_SETTING_TYPE @@ -5353,61 +5367,64 @@ static const NMMetaPropertyInfo *const property_infos_ETHTOOL[] = { #undef _CURRENT_NM_META_SETTING_TYPE #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_GSM static const NMMetaPropertyInfo *const property_infos_GSM[] = { + PROPERTY_INFO_WITH_DESC (NM_SETTING_GSM_AUTO_CONFIG, + .property_type = &_pt_gobject_bool, + ), PROPERTY_INFO_WITH_DESC (NM_SETTING_GSM_NUMBER, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_GSM_USERNAME, - .is_cli_option = TRUE, - .property_alias = "user", - .prompt = N_("Username [none]"), - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "user", + .prompt = N_("Username [none]"), + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_GSM_PASSWORD, - .is_cli_option = TRUE, - .property_alias = "password", - .prompt = N_("Password [none]"), - .is_secret = TRUE, - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "password", + .prompt = N_("Password [none]"), + .is_secret = TRUE, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_GSM_PASSWORD_FLAGS, - .property_type = &_pt_gobject_secret_flags, + .property_type = &_pt_gobject_secret_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_GSM_APN, - .is_cli_option = TRUE, - .property_alias = "apn", - .prompt = N_("APN"), - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "apn", + .prompt = N_("APN"), + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_GSM_NETWORK_ID, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_GSM_PIN, - .is_secret = TRUE, - .property_type = &_pt_gobject_string, + .is_secret = TRUE, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_GSM_PIN_FLAGS, - .property_type = &_pt_gobject_secret_flags, + .property_type = &_pt_gobject_secret_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_GSM_HOME_ONLY, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_GSM_DEVICE_ID, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_GSM_SIM_ID, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_GSM_SIM_OPERATOR_ID, - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_gobject, - .set_fcn = _set_fcn_gsm_sim_operator_id, - ), + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_gobject, + .set_fcn = _set_fcn_gsm_sim_operator_id, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_GSM_MTU, - .property_type = &_pt_gobject_mtu, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mtu, - .get_fcn = MTU_GET_FCN (NMSettingGsm, nm_setting_gsm_get_mtu), - ), + .property_type = &_pt_gobject_mtu, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mtu, + .get_fcn = MTU_GET_FCN (NMSettingGsm, nm_setting_gsm_get_mtu), + ), ), NULL }; @@ -5416,50 +5433,50 @@ static const NMMetaPropertyInfo *const property_infos_GSM[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_INFINIBAND static const NMMetaPropertyInfo *const property_infos_INFINIBAND[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_INFINIBAND_MAC_ADDRESS, - .is_cli_option = TRUE, - .property_alias = "mac", - .prompt = N_("MAC [none]"), - .property_type = &_pt_gobject_mac, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mac, - .mode = NM_META_PROPERTY_TYPE_MAC_MODE_INFINIBAND, - ), + .is_cli_option = TRUE, + .property_alias = "mac", + .prompt = N_("MAC [none]"), + .property_type = &_pt_gobject_mac, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mac, + .mode = NM_META_PROPERTY_TYPE_MAC_MODE_INFINIBAND, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_INFINIBAND_MTU, - .is_cli_option = TRUE, - .property_alias = "mtu", - .prompt = N_("MTU [auto]"), - .property_type = &_pt_gobject_mtu, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mtu, - .get_fcn = MTU_GET_FCN (NMSettingInfiniband, nm_setting_infiniband_get_mtu), - ), + .is_cli_option = TRUE, + .property_alias = "mtu", + .prompt = N_("MTU [auto]"), + .property_type = &_pt_gobject_mtu, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mtu, + .get_fcn = MTU_GET_FCN (NMSettingInfiniband, nm_setting_infiniband_get_mtu), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_INFINIBAND_TRANSPORT_MODE, - .is_cli_option = TRUE, - .property_alias = "transport-mode", - .prompt = NM_META_TEXT_PROMPT_IB_MODE, - .def_hint = NM_META_TEXT_PROMPT_IB_MODE_CHOICES, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV ("datagram", "connected"), - ), + .is_cli_option = TRUE, + .property_alias = "transport-mode", + .prompt = NM_META_TEXT_PROMPT_IB_MODE, + .def_hint = NM_META_TEXT_PROMPT_IB_MODE_CHOICES, + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV ("datagram", "connected"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_INFINIBAND_P_KEY, - .is_cli_option = TRUE, - .property_alias = "p-key", - .prompt = N_("P_KEY [none]"), - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_infiniband_p_key, - .set_fcn = _set_fcn_infiniband_p_key, - ), + .is_cli_option = TRUE, + .property_alias = "p-key", + .prompt = N_("P_KEY [none]"), + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_infiniband_p_key, + .set_fcn = _set_fcn_infiniband_p_key, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_INFINIBAND_PARENT, - .is_cli_option = TRUE, - .property_alias = "parent", - .prompt = N_("Parent interface [none]"), - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_gobject, - .set_fcn = _set_fcn_gobject_ifname, - ), + .is_cli_option = TRUE, + .property_alias = "parent", + .prompt = N_("Parent interface [none]"), + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_gobject, + .set_fcn = _set_fcn_gobject_ifname, + ), ), NULL }; @@ -5468,204 +5485,215 @@ static const NMMetaPropertyInfo *const property_infos_INFINIBAND[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_IP4_CONFIG static const NMMetaPropertyInfo *const property_infos_IP4_CONFIG[] = { PROPERTY_INFO (NM_SETTING_IP_CONFIG_METHOD, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_METHOD, - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_gobject, - .set_fcn = _set_fcn_ip_config_method, - ), - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV (NM_SETTING_IP4_CONFIG_METHOD_AUTO, - NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL, - NM_SETTING_IP4_CONFIG_METHOD_MANUAL, - NM_SETTING_IP4_CONFIG_METHOD_SHARED, - NM_SETTING_IP4_CONFIG_METHOD_DISABLED), - ), + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_gobject, + .set_fcn = _set_fcn_ip_config_method, + ), + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV (NM_SETTING_IP4_CONFIG_METHOD_AUTO, + NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL, + NM_SETTING_IP4_CONFIG_METHOD_MANUAL, + NM_SETTING_IP4_CONFIG_METHOD_SHARED, + NM_SETTING_IP4_CONFIG_METHOD_DISABLED), + ), ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_DNS, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DNS, - .describe_message = - N_("Enter a list of IPv4 addresses of DNS servers.\n\n" - "Example: 8.8.8.8, 8.8.4.4\n"), - .property_type = &_pt_multilist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (multilist, - .get_num_fcn_u = MULTILIST_GET_NUM_FCN_U (NMSettingIPConfig, nm_setting_ip_config_get_num_dns), - .add_fcn = MULTILIST_ADD_FCN (NMSettingIPConfig, nm_setting_ip_config_add_dns), - .remove_by_idx_fcn_s = MULTILIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_dns), - .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingIPConfig, nm_setting_ip_config_remove_dns_by_value), - .validate2_fcn = _multilist_validate2_fcn_ip_config_dns, - .strsplit_plain = TRUE, - ), - ), + .describe_message = + N_("Enter a list of IPv4 addresses of DNS servers.\n\n" + "Example: 8.8.8.8, 8.8.4.4\n"), + .property_type = &_pt_multilist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (multilist, + .get_num_fcn_u = MULTILIST_GET_NUM_FCN_U (NMSettingIPConfig, nm_setting_ip_config_get_num_dns), + .add_fcn = MULTILIST_ADD_FCN (NMSettingIPConfig, nm_setting_ip_config_add_dns), + .remove_by_idx_fcn_s = MULTILIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_dns), + .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingIPConfig, nm_setting_ip_config_remove_dns_by_value), + .validate2_fcn = _multilist_validate2_fcn_ip_config_dns, + .strsplit_plain = TRUE, + ), + ), ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_DNS_SEARCH, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DNS_SEARCH, - .property_type = &_pt_multilist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (multilist, - .get_num_fcn_u = MULTILIST_GET_NUM_FCN_U (NMSettingIPConfig, nm_setting_ip_config_get_num_dns_searches), - .add_fcn = MULTILIST_ADD_FCN (NMSettingIPConfig, nm_setting_ip_config_add_dns_search), - .remove_by_idx_fcn_s = MULTILIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_dns_search), - .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingIPConfig, nm_setting_ip_config_remove_dns_search_by_value), - .validate_fcn = _multilist_validate_fcn_is_domain, - .strsplit_plain = TRUE, - ), - ), + .property_type = &_pt_multilist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (multilist, + .get_num_fcn_u = MULTILIST_GET_NUM_FCN_U (NMSettingIPConfig, nm_setting_ip_config_get_num_dns_searches), + .add_fcn = MULTILIST_ADD_FCN (NMSettingIPConfig, nm_setting_ip_config_add_dns_search), + .remove_by_idx_fcn_s = MULTILIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_dns_search), + .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingIPConfig, nm_setting_ip_config_remove_dns_search_by_value), + .validate_fcn = _multilist_validate_fcn_is_domain, + .strsplit_plain = TRUE, + ), + ), ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_DNS_OPTIONS, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DNS_OPTIONS, - .property_type = &_pt_multilist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (multilist, - .get_num_fcn_u = MULTILIST_GET_NUM_FCN_U (NMSettingIPConfig, nm_setting_ip_config_get_num_dns_options), - .add_fcn = _multilist_add_fcn_ip_config_dns_options, - .remove_by_idx_fcn_s = MULTILIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_dns_option), - .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingIPConfig, nm_setting_ip_config_remove_dns_option_by_value), - .clear_emptyunset_fcn = MULTILIST_CLEAR_EMPTYUNSET_FCN (NMSettingIPConfig, nm_setting_ip_config_clear_dns_options), - .strsplit_plain = TRUE, - ), - .is_default_fcn = _is_default_func_ip_config_dns_options, - ), + .property_type = &_pt_multilist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (multilist, + .get_num_fcn_u = MULTILIST_GET_NUM_FCN_U (NMSettingIPConfig, nm_setting_ip_config_get_num_dns_options), + .add_fcn = _multilist_add_fcn_ip_config_dns_options, + .remove_by_idx_fcn_s = MULTILIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_dns_option), + .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingIPConfig, nm_setting_ip_config_remove_dns_option_by_value), + .clear_emptyunset_fcn = MULTILIST_CLEAR_EMPTYUNSET_FCN (NMSettingIPConfig, nm_setting_ip_config_clear_dns_options), + .strsplit_plain = TRUE, + ), + .is_default_fcn = _is_default_func_ip_config_dns_options, + ), ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_DNS_PRIORITY, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DNS_PRIORITY, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_ADDRESSES, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ADDRESSES, - .is_cli_option = TRUE, - .property_alias = "ip4", - .inf_flags = NM_META_PROPERTY_INF_FLAG_MULTI, - .prompt = N_("IPv4 address (IP[/plen]) [none]"), - .describe_message = - N_("Enter a list of IPv4 addresses formatted as:\n" - " ip[/prefix], ip[/prefix],...\n" - "Missing prefix is regarded as prefix of 32.\n\n" - "Example: 192.168.1.5/24, 10.0.0.11/24\n"), - .property_type = &_pt_objlist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (objlist, - .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingIPConfig, nm_setting_ip_config_get_num_addresses), - .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingIPConfig, nm_setting_ip_config_clear_addresses), - .obj_to_str_fcn = _objlist_obj_to_str_fcn_ip_config_addresses, - .set_fcn = _objlist_set_fcn_ip_config_addresses, - .remove_by_idx_fcn_s = OBJLIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_address), - .strsplit_plain = TRUE, - ), - ), + .is_cli_option = TRUE, + .property_alias = "ip4", + .inf_flags = NM_META_PROPERTY_INF_FLAG_MULTI, + .prompt = N_("IPv4 address (IP[/plen]) [none]"), + .describe_message = + N_("Enter a list of IPv4 addresses formatted as:\n" + " ip[/prefix], ip[/prefix],...\n" + "Missing prefix is regarded as prefix of 32.\n\n" + "Example: 192.168.1.5/24, 10.0.0.11/24\n"), + .property_type = &_pt_objlist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (objlist, + .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingIPConfig, nm_setting_ip_config_get_num_addresses), + .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingIPConfig, nm_setting_ip_config_clear_addresses), + .obj_to_str_fcn = _objlist_obj_to_str_fcn_ip_config_addresses, + .set_fcn = _objlist_set_fcn_ip_config_addresses, + .remove_by_idx_fcn_s = OBJLIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_address), + .strsplit_plain = TRUE, + ), + ), ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_GATEWAY, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_GATEWAY, - .is_cli_option = TRUE, - .property_alias = "gw4", - .prompt = N_("IPv4 gateway [none]"), - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_gobject, - .set_fcn = _set_fcn_ip_config_gateway, - ), + .is_cli_option = TRUE, + .property_alias = "gw4", + .prompt = N_("IPv4 gateway [none]"), + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_gobject, + .set_fcn = _set_fcn_ip_config_gateway, + ), ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_ROUTES, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTES, - .describe_message = - N_("Enter a list of IPv4 routes formatted as:\n" - " ip[/prefix] [next-hop] [metric],...\n\n" - "Missing prefix is regarded as a prefix of 32.\n" - "Missing next-hop is regarded as 0.0.0.0.\n" - "Missing metric means default (NM/kernel will set a default value).\n\n" - "Examples: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n" - " 10.1.2.0/24\n"), - .property_type = &_pt_objlist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (objlist, - .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingIPConfig, nm_setting_ip_config_get_num_routes), - .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingIPConfig, nm_setting_ip_config_clear_routes), - .obj_to_str_fcn = _objlist_obj_to_str_fcn_ip_config_routes, - .set_fcn = _objlist_set_fcn_ip_config_routes, - .remove_by_idx_fcn_s = OBJLIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_route), - .delimit_pretty_with_semicolon = TRUE, - .strsplit_plain = TRUE, - ), - ), + .describe_message = + N_("Enter a list of IPv4 routes formatted as:\n" + " ip[/prefix] [next-hop] [metric],...\n\n" + "Missing prefix is regarded as a prefix of 32.\n" + "Missing next-hop is regarded as 0.0.0.0.\n" + "Missing metric means default (NM/kernel will set a default value).\n\n" + "Examples: 192.168.2.0/24 192.168.2.1 3, 10.1.0.0/16 10.0.0.254\n" + " 10.1.2.0/24\n"), + .property_type = &_pt_objlist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (objlist, + .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingIPConfig, nm_setting_ip_config_get_num_routes), + .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingIPConfig, nm_setting_ip_config_clear_routes), + .obj_to_str_fcn = _objlist_obj_to_str_fcn_ip_config_routes, + .set_fcn = _objlist_set_fcn_ip_config_routes, + .remove_by_idx_fcn_s = OBJLIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_route), + .delimit_pretty_with_semicolon = TRUE, + .strsplit_plain = TRUE, + ), + ), ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_ROUTE_METRIC, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTE_METRIC, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_ROUTE_TABLE, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTE_TABLE, - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = 0, - .nick = "unspec", - }, - { - .value.i64 = 254, - .nick = "main", - }, - ), - ), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = 0, + .nick = "unspec", + }, + { + .value.i64 = 254, + .nick = "main", + }, + ), + ), ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_ROUTING_RULES, NULL, - .describe_message = - N_("Enter a list of IPv4 routing rules formatted as:\n" - " priority [prio] [from [src]] [to [dst]], ,...\n" - "\n"), - .property_type = &_pt_objlist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (objlist, - .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingIPConfig, nm_setting_ip_config_get_num_routing_rules), - .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingIPConfig, nm_setting_ip_config_clear_routing_rules), - .obj_to_str_fcn = _objlist_obj_to_str_fcn_ip_config_routing_rules, - .set_fcn = _objlist_set_fcn_ip_config_routing_rules, - .remove_by_idx_fcn_u = OBJLIST_REMOVE_BY_IDX_FCN_U (NMSettingIPConfig, nm_setting_ip_config_remove_routing_rule), - ), - ), + .describe_message = + N_("Enter a list of IPv4 routing rules formatted as:\n" + " priority [prio] [from [src]] [to [dst]], ,...\n" + "\n"), + .property_type = &_pt_objlist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (objlist, + .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingIPConfig, nm_setting_ip_config_get_num_routing_rules), + .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingIPConfig, nm_setting_ip_config_clear_routing_rules), + .obj_to_str_fcn = _objlist_obj_to_str_fcn_ip_config_routing_rules, + .set_fcn = _objlist_set_fcn_ip_config_routing_rules, + .remove_by_idx_fcn_u = OBJLIST_REMOVE_BY_IDX_FCN_U (NMSettingIPConfig, nm_setting_ip_config_remove_routing_rule), + ), + ), ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, + ), + PROPERTY_INFO (NM_SETTING_IP_CONFIG_DHCP_IAID, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_IAID, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_DHCP_TIMEOUT, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT, - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = 0, - .nick = "default", - }, - { - .value.i64 = G_MAXINT32, - .nick = "infinity", - }, - ), - ), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = 0, + .nick = "default", + }, + { + .value.i64 = G_MAXINT32, + .nick = "infinity", + }, + ), + ), ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_IP4_CONFIG_DHCP_FQDN, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, + ), + PROPERTY_INFO (NM_SETTING_IP_CONFIG_DHCP_HOSTNAME_FLAGS, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME_FLAGS, + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_dhcp_hostname_flags_get_type, + ), + ) ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_NEVER_DEFAULT, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_MAY_FAIL, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_MAY_FAIL, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_DAD_TIMEOUT, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DAD_TIMEOUT, - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = -1, - .nick = "default", - }, - { - .value.i64 = 0, - .nick = "off", - }, - ), - ), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = -1, + .nick = "default", + }, + { + .value.i64 = 0, + .nick = "off", + }, + ), + ), ), NULL }; @@ -5674,207 +5702,218 @@ static const NMMetaPropertyInfo *const property_infos_IP4_CONFIG[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_IP6_CONFIG static const NMMetaPropertyInfo *const property_infos_IP6_CONFIG[] = { PROPERTY_INFO (NM_SETTING_IP_CONFIG_METHOD, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_METHOD, - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_gobject, - .set_fcn = _set_fcn_ip_config_method, - ), - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV (NM_SETTING_IP6_CONFIG_METHOD_IGNORE, - NM_SETTING_IP6_CONFIG_METHOD_AUTO, - NM_SETTING_IP6_CONFIG_METHOD_DHCP, - NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL, - NM_SETTING_IP6_CONFIG_METHOD_MANUAL, - NM_SETTING_IP6_CONFIG_METHOD_SHARED, - NM_SETTING_IP6_CONFIG_METHOD_DISABLED), - ), + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_gobject, + .set_fcn = _set_fcn_ip_config_method, + ), + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV (NM_SETTING_IP6_CONFIG_METHOD_IGNORE, + NM_SETTING_IP6_CONFIG_METHOD_AUTO, + NM_SETTING_IP6_CONFIG_METHOD_DHCP, + NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL, + NM_SETTING_IP6_CONFIG_METHOD_MANUAL, + NM_SETTING_IP6_CONFIG_METHOD_SHARED, + NM_SETTING_IP6_CONFIG_METHOD_DISABLED), + ), ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_DNS, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DNS, - .describe_message = - N_("Enter a list of IPv6 addresses of DNS servers. If the IPv6 " - "configuration method is 'auto' these DNS servers are appended " - "to those (if any) returned by automatic configuration. DNS " - "servers cannot be used with the 'shared' or 'link-local' IPv6 " - "configuration methods, as there is no upstream network. In " - "all other IPv6 configuration methods, these DNS " - "servers are used as the only DNS servers for this connection.\n\n" - "Example: 2607:f0d0:1002:51::4, 2607:f0d0:1002:51::1\n"), - .property_type = &_pt_multilist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (multilist, - .get_num_fcn_u = MULTILIST_GET_NUM_FCN_U (NMSettingIPConfig, nm_setting_ip_config_get_num_dns), - .add_fcn = MULTILIST_ADD_FCN (NMSettingIPConfig, nm_setting_ip_config_add_dns), - .remove_by_idx_fcn_s = MULTILIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_dns), - .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingIPConfig, nm_setting_ip_config_remove_dns_by_value), - .validate2_fcn = _multilist_validate2_fcn_ip_config_dns, - .strsplit_plain = TRUE, - ), - ), + .describe_message = + N_("Enter a list of IPv6 addresses of DNS servers. If the IPv6 " + "configuration method is 'auto' these DNS servers are appended " + "to those (if any) returned by automatic configuration. DNS " + "servers cannot be used with the 'shared' or 'link-local' IPv6 " + "configuration methods, as there is no upstream network. In " + "all other IPv6 configuration methods, these DNS " + "servers are used as the only DNS servers for this connection.\n\n" + "Example: 2607:f0d0:1002:51::4, 2607:f0d0:1002:51::1\n"), + .property_type = &_pt_multilist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (multilist, + .get_num_fcn_u = MULTILIST_GET_NUM_FCN_U (NMSettingIPConfig, nm_setting_ip_config_get_num_dns), + .add_fcn = MULTILIST_ADD_FCN (NMSettingIPConfig, nm_setting_ip_config_add_dns), + .remove_by_idx_fcn_s = MULTILIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_dns), + .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingIPConfig, nm_setting_ip_config_remove_dns_by_value), + .validate2_fcn = _multilist_validate2_fcn_ip_config_dns, + .strsplit_plain = TRUE, + ), + ), ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_DNS_SEARCH, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DNS_SEARCH, - .property_type = &_pt_multilist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (multilist, - .get_num_fcn_u = MULTILIST_GET_NUM_FCN_U (NMSettingIPConfig, nm_setting_ip_config_get_num_dns_searches), - .add_fcn = MULTILIST_ADD_FCN (NMSettingIPConfig, nm_setting_ip_config_add_dns_search), - .remove_by_idx_fcn_s = MULTILIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_dns_search), - .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingIPConfig, nm_setting_ip_config_remove_dns_search_by_value), - .validate_fcn = _multilist_validate_fcn_is_domain, - .strsplit_plain = TRUE, - ), - ), + .property_type = &_pt_multilist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (multilist, + .get_num_fcn_u = MULTILIST_GET_NUM_FCN_U (NMSettingIPConfig, nm_setting_ip_config_get_num_dns_searches), + .add_fcn = MULTILIST_ADD_FCN (NMSettingIPConfig, nm_setting_ip_config_add_dns_search), + .remove_by_idx_fcn_s = MULTILIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_dns_search), + .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingIPConfig, nm_setting_ip_config_remove_dns_search_by_value), + .validate_fcn = _multilist_validate_fcn_is_domain, + .strsplit_plain = TRUE, + ), + ), ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_DNS_OPTIONS, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DNS_OPTIONS, - .property_type = &_pt_multilist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (multilist, - .get_num_fcn_u = MULTILIST_GET_NUM_FCN_U (NMSettingIPConfig, nm_setting_ip_config_get_num_dns_options), - .add_fcn = _multilist_add_fcn_ip_config_dns_options, - .remove_by_idx_fcn_s = MULTILIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_dns_option), - .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingIPConfig, nm_setting_ip_config_remove_dns_option_by_value), - .clear_emptyunset_fcn = MULTILIST_CLEAR_EMPTYUNSET_FCN (NMSettingIPConfig, nm_setting_ip_config_clear_dns_options), - .strsplit_plain = TRUE, - ), - .is_default_fcn = _is_default_func_ip_config_dns_options, - ), + .property_type = &_pt_multilist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (multilist, + .get_num_fcn_u = MULTILIST_GET_NUM_FCN_U (NMSettingIPConfig, nm_setting_ip_config_get_num_dns_options), + .add_fcn = _multilist_add_fcn_ip_config_dns_options, + .remove_by_idx_fcn_s = MULTILIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_dns_option), + .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingIPConfig, nm_setting_ip_config_remove_dns_option_by_value), + .clear_emptyunset_fcn = MULTILIST_CLEAR_EMPTYUNSET_FCN (NMSettingIPConfig, nm_setting_ip_config_clear_dns_options), + .strsplit_plain = TRUE, + ), + .is_default_fcn = _is_default_func_ip_config_dns_options, + ), ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_DNS_PRIORITY, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DNS_PRIORITY, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_ADDRESSES, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ADDRESSES, - .is_cli_option = TRUE, - .property_alias = "ip6", - .inf_flags = NM_META_PROPERTY_INF_FLAG_MULTI, - .prompt = N_("IPv6 address (IP[/plen]) [none]"), - .describe_message = - N_("Enter a list of IPv6 addresses formatted as:\n" - " ip[/prefix], ip[/prefix],...\n" - "Missing prefix is regarded as prefix of 128.\n\n" - "Example: 2607:f0d0:1002:51::4/64, 1050:0:0:0:5:600:300c:326b\n"), - .property_type = &_pt_objlist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (objlist, - .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingIPConfig, nm_setting_ip_config_get_num_addresses), - .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingIPConfig, nm_setting_ip_config_clear_addresses), - .obj_to_str_fcn = _objlist_obj_to_str_fcn_ip_config_addresses, - .set_fcn = _objlist_set_fcn_ip_config_addresses, - .remove_by_idx_fcn_s = OBJLIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_address), - .strsplit_plain = TRUE, - ), - ), + .is_cli_option = TRUE, + .property_alias = "ip6", + .inf_flags = NM_META_PROPERTY_INF_FLAG_MULTI, + .prompt = N_("IPv6 address (IP[/plen]) [none]"), + .describe_message = + N_("Enter a list of IPv6 addresses formatted as:\n" + " ip[/prefix], ip[/prefix],...\n" + "Missing prefix is regarded as prefix of 128.\n\n" + "Example: 2607:f0d0:1002:51::4/64, 1050:0:0:0:5:600:300c:326b\n"), + .property_type = &_pt_objlist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (objlist, + .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingIPConfig, nm_setting_ip_config_get_num_addresses), + .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingIPConfig, nm_setting_ip_config_clear_addresses), + .obj_to_str_fcn = _objlist_obj_to_str_fcn_ip_config_addresses, + .set_fcn = _objlist_set_fcn_ip_config_addresses, + .remove_by_idx_fcn_s = OBJLIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_address), + .strsplit_plain = TRUE, + ), + ), ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_GATEWAY, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_GATEWAY, - .is_cli_option = TRUE, - .property_alias = "gw6", - .prompt = N_("IPv6 gateway [none]"), - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_gobject, - .set_fcn = _set_fcn_ip_config_gateway, - ), + .is_cli_option = TRUE, + .property_alias = "gw6", + .prompt = N_("IPv6 gateway [none]"), + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_gobject, + .set_fcn = _set_fcn_ip_config_gateway, + ), ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_ROUTES, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTES, - .describe_message = - N_("Enter a list of IPv6 routes formatted as:\n" - " ip[/prefix] [next-hop] [metric],...\n\n" - "Missing prefix is regarded as a prefix of 128.\n" - "Missing next-hop is regarded as \"::\".\n" - "Missing metric means default (NM/kernel will set a default value).\n\n" - "Examples: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 2001:db8:beef::3 2\n" - " abbe::/64 55\n"), - .property_type = &_pt_objlist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (objlist, - .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingIPConfig, nm_setting_ip_config_get_num_routes), - .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingIPConfig, nm_setting_ip_config_clear_routes), - .obj_to_str_fcn = _objlist_obj_to_str_fcn_ip_config_routes, - .set_fcn = _objlist_set_fcn_ip_config_routes, - .remove_by_idx_fcn_s = OBJLIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_route), - .delimit_pretty_with_semicolon = TRUE, - .strsplit_plain = TRUE, - ), - ), + .describe_message = + N_("Enter a list of IPv6 routes formatted as:\n" + " ip[/prefix] [next-hop] [metric],...\n\n" + "Missing prefix is regarded as a prefix of 128.\n" + "Missing next-hop is regarded as \"::\".\n" + "Missing metric means default (NM/kernel will set a default value).\n\n" + "Examples: 2001:db8:beef:2::/64 2001:db8:beef::2, 2001:db8:beef:3::/64 2001:db8:beef::3 2\n" + " abbe::/64 55\n"), + .property_type = &_pt_objlist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (objlist, + .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingIPConfig, nm_setting_ip_config_get_num_routes), + .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingIPConfig, nm_setting_ip_config_clear_routes), + .obj_to_str_fcn = _objlist_obj_to_str_fcn_ip_config_routes, + .set_fcn = _objlist_set_fcn_ip_config_routes, + .remove_by_idx_fcn_s = OBJLIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_route), + .delimit_pretty_with_semicolon = TRUE, + .strsplit_plain = TRUE, + ), + ), ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_ROUTE_METRIC, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTE_METRIC, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_ROUTE_TABLE, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTE_TABLE, - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = 0, - .nick = "unspec", - }, - { - .value.i64 = 254, - .nick = "main", - }, - ), - ), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = 0, + .nick = "unspec", + }, + { + .value.i64 = 254, + .nick = "main", + }, + ), + ), ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_ROUTING_RULES, NULL, - .describe_message = - N_("Enter a list of IPv6 routing rules formatted as:\n" - " priority [prio] [from [src]] [to [dst]], ,...\n" - "\n"), - .property_type = &_pt_objlist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (objlist, - .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingIPConfig, nm_setting_ip_config_get_num_routing_rules), - .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingIPConfig, nm_setting_ip_config_clear_routing_rules), - .obj_to_str_fcn = _objlist_obj_to_str_fcn_ip_config_routing_rules, - .set_fcn = _objlist_set_fcn_ip_config_routing_rules, - .remove_by_idx_fcn_u = OBJLIST_REMOVE_BY_IDX_FCN_U (NMSettingIPConfig, nm_setting_ip_config_remove_routing_rule), - ), - ), + .describe_message = + N_("Enter a list of IPv6 routing rules formatted as:\n" + " priority [prio] [from [src]] [to [dst]], ,...\n" + "\n"), + .property_type = &_pt_objlist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (objlist, + .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingIPConfig, nm_setting_ip_config_get_num_routing_rules), + .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingIPConfig, nm_setting_ip_config_clear_routing_rules), + .obj_to_str_fcn = _objlist_obj_to_str_fcn_ip_config_routing_rules, + .set_fcn = _objlist_set_fcn_ip_config_routing_rules, + .remove_by_idx_fcn_u = OBJLIST_REMOVE_BY_IDX_FCN_U (NMSettingIPConfig, nm_setting_ip_config_remove_routing_rule), + ), + ), ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_NEVER_DEFAULT, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_NEVER_DEFAULT, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_MAY_FAIL, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_MAY_FAIL, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_IP6_CONFIG_IP6_PRIVACY, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .value_infos_get = ENUM_VALUE_INFOS ( - { - .value = NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_PUBLIC_ADDR, - .nick = "enabled, prefer public IP", - }, - { - .value = NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR, - .nick = "enabled, prefer temporary IP", - }, - ), - ), + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .value_infos_get = ENUM_VALUE_INFOS ( + { + .value = NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_PUBLIC_ADDR, + .nick = "enabled, prefer public IP", + }, + { + .value = NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR, + .nick = "enabled, prefer temporary IP", + }, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_setting_ip6_config_addr_gen_mode_get_type, - ), - .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT - | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, - ), + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_setting_ip6_config_addr_gen_mode_get_type, + ), + .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT + | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, + ), ), PROPERTY_INFO (NM_SETTING_IP6_CONFIG_DHCP_DUID, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_DUID, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, + ), + PROPERTY_INFO (NM_SETTING_IP_CONFIG_DHCP_IAID, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_IAID, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_SEND_HOSTNAME, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_HOSTNAME, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, + ), + PROPERTY_INFO (NM_SETTING_IP_CONFIG_DHCP_HOSTNAME_FLAGS, DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_HOSTNAME_FLAGS, + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_dhcp_hostname_flags_get_type, + ), + ) ), PROPERTY_INFO_WITH_DESC (NM_SETTING_IP6_CONFIG_TOKEN, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), NULL }; @@ -5883,71 +5922,71 @@ static const NMMetaPropertyInfo *const property_infos_IP6_CONFIG[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_IP_TUNNEL static const NMMetaPropertyInfo *const property_infos_IP_TUNNEL[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_IP_TUNNEL_MODE, - .is_cli_option = TRUE, - .property_alias = "mode", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = NM_META_TEXT_PROMPT_IP_TUNNEL_MODE, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_ip_tunnel_mode_get_type, - .min = NM_IP_TUNNEL_MODE_UNKNOWN + 1, - .max = G_MAXINT, - ), - .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT - | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, - ), + .is_cli_option = TRUE, + .property_alias = "mode", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = NM_META_TEXT_PROMPT_IP_TUNNEL_MODE, + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_ip_tunnel_mode_get_type, + .min = NM_IP_TUNNEL_MODE_UNKNOWN + 1, + .max = G_MAXINT, + ), + .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT + | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_IP_TUNNEL_PARENT, - .is_cli_option = TRUE, - .property_alias = "dev", - .prompt = N_("Parent device [none]"), - .property_type = &_pt_gobject_devices, + .is_cli_option = TRUE, + .property_alias = "dev", + .prompt = N_("Parent device [none]"), + .property_type = &_pt_gobject_devices, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_IP_TUNNEL_LOCAL, - .is_cli_option = TRUE, - .property_alias = "local", - .prompt = N_("Local endpoint [none]"), - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "local", + .prompt = N_("Local endpoint [none]"), + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_IP_TUNNEL_REMOTE, - .is_cli_option = TRUE, - .property_alias = "remote", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = N_("Remote"), - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "remote", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = N_("Remote"), + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_IP_TUNNEL_TTL, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_IP_TUNNEL_TOS, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_IP_TUNNEL_INPUT_KEY, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_IP_TUNNEL_OUTPUT_KEY, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_IP_TUNNEL_FLOW_LABEL, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_IP_TUNNEL_MTU, - .property_type = &_pt_gobject_mtu, + .property_type = &_pt_gobject_mtu, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_IP_TUNNEL_FLAGS, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_ip_tunnel_flags_get_type, - ), - ), + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_ip_tunnel_flags_get_type, + ), + ), ), NULL }; @@ -5956,67 +5995,67 @@ static const NMMetaPropertyInfo *const property_infos_IP_TUNNEL[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_MACSEC static const NMMetaPropertyInfo *const property_infos_MACSEC[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_MACSEC_PARENT, - .is_cli_option = TRUE, - .property_alias = "dev", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = N_("MACsec parent device or connection UUID"), - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "dev", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = N_("MACsec parent device or connection UUID"), + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_MACSEC_MODE, - .is_cli_option = TRUE, - .property_alias = "mode", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = NM_META_TEXT_PROMPT_MACSEC_MODE, - .def_hint = NM_META_TEXT_PROMPT_MACSEC_MODE_CHOICES, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_setting_macsec_mode_get_type, - ), - .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT - | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, - ), + .is_cli_option = TRUE, + .property_alias = "mode", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = NM_META_TEXT_PROMPT_MACSEC_MODE, + .def_hint = NM_META_TEXT_PROMPT_MACSEC_MODE_CHOICES, + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_setting_macsec_mode_get_type, + ), + .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT + | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_MACSEC_ENCRYPT, - .is_cli_option = TRUE, - .property_alias = "encrypt", - .prompt = N_("Enable encryption [yes]"), - .property_type = &_pt_gobject_bool, + .is_cli_option = TRUE, + .property_alias = "encrypt", + .prompt = N_("Enable encryption [yes]"), + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_MACSEC_MKA_CAK, - .is_cli_option = TRUE, - .property_alias = "cak", - .prompt = N_("MKA CAK"), - .is_secret = TRUE, - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "cak", + .prompt = N_("MKA CAK"), + .is_secret = TRUE, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_MACSEC_MKA_CAK_FLAGS, - .property_type = &_pt_gobject_secret_flags, + .property_type = &_pt_gobject_secret_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_MACSEC_MKA_CKN, - .is_cli_option = TRUE, - .property_alias = "ckn", - .prompt = N_("MKA_CKN"), - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "ckn", + .prompt = N_("MKA_CKN"), + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_MACSEC_PORT, - .is_cli_option = TRUE, - .property_alias = "port", - .prompt = N_("SCI port [1]"), - .property_type = &_pt_gobject_int, + .is_cli_option = TRUE, + .property_alias = "port", + .prompt = N_("SCI port [1]"), + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_MACSEC_VALIDATION, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_setting_macsec_validation_get_type, - ), - .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT - | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, - ), + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_setting_macsec_validation_get_type, + ), + .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT + | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_MACSEC_SEND_SCI, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), NULL }; @@ -6025,32 +6064,32 @@ static const NMMetaPropertyInfo *const property_infos_MACSEC[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_MACVLAN static const NMMetaPropertyInfo *const property_infos_MACVLAN[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_MACVLAN_PARENT, - .is_cli_option = TRUE, - .property_alias = "dev", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = N_("MACVLAN parent device or connection UUID"), - .property_type = &_pt_gobject_devices, + .is_cli_option = TRUE, + .property_alias = "dev", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = N_("MACVLAN parent device or connection UUID"), + .property_type = &_pt_gobject_devices, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_MACVLAN_MODE, - .is_cli_option = TRUE, - .property_alias = "mode", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = NM_META_TEXT_PROMPT_MACVLAN_MODE, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_setting_macvlan_mode_get_type, - .min = NM_SETTING_MACVLAN_MODE_UNKNOWN + 1, - .max = G_MAXINT, - ), + .is_cli_option = TRUE, + .property_alias = "mode", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = NM_META_TEXT_PROMPT_MACVLAN_MODE, + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_setting_macvlan_mode_get_type, + .min = NM_SETTING_MACVLAN_MODE_UNKNOWN + 1, + .max = G_MAXINT, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_MACVLAN_PROMISCUOUS, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_MACVLAN_TAP, - .is_cli_option = TRUE, - .property_alias = "tap", - .prompt = N_("Tap [no]"), - .property_type = &_pt_gobject_bool, + .is_cli_option = TRUE, + .property_alias = "tap", + .prompt = N_("Tap [no]"), + .property_type = &_pt_gobject_bool, ), NULL }; @@ -6059,20 +6098,20 @@ static const NMMetaPropertyInfo *const property_infos_MACVLAN[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_MATCH static const NMMetaPropertyInfo *const property_infos_MATCH[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_MATCH_INTERFACE_NAME, - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_match_interface_name, - .set_fcn = _set_fcn_multilist, - .set_supports_remove = TRUE, - ), - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (multilist, - .get_num_fcn_u = MULTILIST_GET_NUM_FCN_U (NMSettingMatch, nm_setting_match_get_num_interface_names), - .add2_fcn = MULTILIST_ADD2_FCN (NMSettingMatch, nm_setting_match_add_interface_name), - .remove_by_idx_fcn_s = MULTILIST_REMOVE_BY_IDX_FCN_S (NMSettingMatch, nm_setting_match_remove_interface_name), - .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingMatch, nm_setting_match_remove_interface_name_by_value), - .strsplit_with_spaces = TRUE, - ), - ), + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_match_interface_name, + .set_fcn = _set_fcn_multilist, + .set_supports_remove = TRUE, + ), + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (multilist, + .get_num_fcn_u = MULTILIST_GET_NUM_FCN_U (NMSettingMatch, nm_setting_match_get_num_interface_names), + .add2_fcn = MULTILIST_ADD2_FCN (NMSettingMatch, nm_setting_match_add_interface_name), + .remove_by_idx_fcn_s = MULTILIST_REMOVE_BY_IDX_FCN_S (NMSettingMatch, nm_setting_match_remove_interface_name), + .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingMatch, nm_setting_match_remove_interface_name_by_value), + .strsplit_with_spaces = TRUE, + ), + ), ), NULL }; @@ -6081,29 +6120,29 @@ static const NMMetaPropertyInfo *const property_infos_MATCH[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_OLPC_MESH static const NMMetaPropertyInfo *const property_infos_OLPC_MESH[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_OLPC_MESH_SSID, - .is_cli_option = TRUE, - .property_alias = "ssid", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = N_("SSID"), - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_olpc_mesh_ssid, - .set_fcn = _set_fcn_gobject_ssid, - ), + .is_cli_option = TRUE, + .property_alias = "ssid", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = N_("SSID"), + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_olpc_mesh_ssid, + .set_fcn = _set_fcn_gobject_ssid, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_OLPC_MESH_CHANNEL, - .is_cli_option = TRUE, - .property_alias = "channel", - .prompt = N_("OLPC Mesh channel [1]"), - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_gobject, - .set_fcn = _set_fcn_olpc_mesh_channel, - ), + .is_cli_option = TRUE, + .property_alias = "channel", + .prompt = N_("OLPC Mesh channel [1]"), + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_gobject, + .set_fcn = _set_fcn_olpc_mesh_channel, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS, - .is_cli_option = TRUE, - .property_alias = "dhcp-anycast", - .prompt = N_("DHCP anycast MAC address [none]"), - .property_type = &_pt_gobject_mac, + .is_cli_option = TRUE, + .property_alias = "dhcp-anycast", + .prompt = N_("DHCP anycast MAC address [none]"), + .property_type = &_pt_gobject_mac, ), NULL }; @@ -6112,25 +6151,25 @@ static const NMMetaPropertyInfo *const property_infos_OLPC_MESH[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_OVS_BRIDGE static const NMMetaPropertyInfo *const property_infos_OVS_BRIDGE[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_OVS_BRIDGE_FAIL_MODE, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV ("secure", "standalone"), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV ("secure", "standalone"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_OVS_BRIDGE_MCAST_SNOOPING_ENABLE, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_OVS_BRIDGE_RSTP_ENABLE, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_OVS_BRIDGE_STP_ENABLE, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_OVS_BRIDGE_DATAPATH_TYPE, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV ("system", "netdev"), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV ("system", "netdev"), + ), ), NULL }; @@ -6139,7 +6178,7 @@ static const NMMetaPropertyInfo *const property_infos_OVS_BRIDGE[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_OVS_DPDK static const NMMetaPropertyInfo *const property_infos_OVS_DPDK[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_OVS_DPDK_DEVARGS, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), NULL }; @@ -6148,10 +6187,10 @@ static const NMMetaPropertyInfo *const property_infos_OVS_DPDK[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_OVS_INTERFACE static const NMMetaPropertyInfo *const property_infos_OVS_INTERFACE[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_OVS_INTERFACE_TYPE, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV ("internal", "system", "patch", "dpdk"), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV ("internal", "system", "patch", "dpdk"), + ), ), NULL }; @@ -6160,7 +6199,7 @@ static const NMMetaPropertyInfo *const property_infos_OVS_INTERFACE[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_OVS_PATCH static const NMMetaPropertyInfo *const property_infos_OVS_PATCH[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_OVS_PATCH_PEER, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), NULL }; @@ -6169,31 +6208,31 @@ static const NMMetaPropertyInfo *const property_infos_OVS_PATCH[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_OVS_PORT static const NMMetaPropertyInfo *const property_infos_OVS_PORT[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_OVS_PORT_VLAN_MODE, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV ("access", "native-tagged", "native-untagged", "trunk"), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV ("access", "native-tagged", "native-untagged", "trunk"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_OVS_PORT_TAG, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_OVS_PORT_LACP, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV ("active", "off", "passive"), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV ("active", "off", "passive"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_OVS_PORT_BOND_MODE, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV ("active-backup", "balance-slb", "balance-tcp"), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV ("active-backup", "balance-slb", "balance-tcp"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_OVS_PORT_BOND_UPDELAY, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_OVS_PORT_BOND_DOWNDELAY, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), NULL }; @@ -6202,61 +6241,61 @@ static const NMMetaPropertyInfo *const property_infos_OVS_PORT[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_PPP static const NMMetaPropertyInfo *const property_infos_PPP[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_PPP_NOAUTH, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPP_REFUSE_EAP, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPP_REFUSE_PAP, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPP_REFUSE_CHAP, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPP_REFUSE_MSCHAP, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPP_REFUSE_MSCHAPV2, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPP_NOBSDCOMP, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPP_NODEFLATE, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPP_NO_VJ_COMP, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPP_REQUIRE_MPPE, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPP_REQUIRE_MPPE_128, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPP_MPPE_STATEFUL, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPP_CRTSCTS, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPP_BAUD, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPP_MRU, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPP_MTU, - .property_type = &_pt_gobject_mtu, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mtu, - .get_fcn = MTU_GET_FCN (NMSettingPpp, nm_setting_ppp_get_mtu), - ), + .property_type = &_pt_gobject_mtu, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mtu, + .get_fcn = MTU_GET_FCN (NMSettingPpp, nm_setting_ppp_get_mtu), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPP_LCP_ECHO_FAILURE, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPP_LCP_ECHO_INTERVAL, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), NULL }; @@ -6265,33 +6304,33 @@ static const NMMetaPropertyInfo *const property_infos_PPP[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_PPPOE static const NMMetaPropertyInfo *const property_infos_PPPOE[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_PPPOE_PARENT, - .is_cli_option = TRUE, - .property_alias = "parent", - .prompt = N_("PPPoE parent device"), - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "parent", + .prompt = N_("PPPoE parent device"), + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPPOE_SERVICE, - .is_cli_option = TRUE, - .property_alias = "service", - .prompt = N_("Service [none]"), - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "service", + .prompt = N_("Service [none]"), + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPPOE_USERNAME, - .is_cli_option = TRUE, - .property_alias = "username", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = N_("PPPoE username"), - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "username", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = N_("PPPoE username"), + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPPOE_PASSWORD, - .is_cli_option = TRUE, - .property_alias = "password", - .prompt = N_("Password [none]"), - .is_secret = TRUE, - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "password", + .prompt = N_("Password [none]"), + .is_secret = TRUE, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PPPOE_PASSWORD_FLAGS, - .property_type = &_pt_gobject_secret_flags, + .property_type = &_pt_gobject_secret_flags, ), NULL }; @@ -6300,39 +6339,39 @@ static const NMMetaPropertyInfo *const property_infos_PPPOE[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_PROXY static const NMMetaPropertyInfo *const property_infos_PROXY[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_PROXY_METHOD, - .is_cli_option = TRUE, - .property_alias = "method", - .prompt = NM_META_TEXT_PROMPT_PROXY_METHOD, - .def_hint = NM_META_TEXT_PROMPT_PROXY_METHOD_CHOICES, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_setting_proxy_method_get_type, - ), - .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT - | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, - ), + .is_cli_option = TRUE, + .property_alias = "method", + .prompt = NM_META_TEXT_PROMPT_PROXY_METHOD, + .def_hint = NM_META_TEXT_PROMPT_PROXY_METHOD_CHOICES, + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_setting_proxy_method_get_type, + ), + .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT + | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PROXY_BROWSER_ONLY, - .is_cli_option = TRUE, - .property_alias = "browser-only", - .prompt = N_("Browser only [no]"), - .property_type = &_pt_gobject_bool + .is_cli_option = TRUE, + .property_alias = "browser-only", + .prompt = N_("Browser only [no]"), + .property_type = &_pt_gobject_bool ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PROXY_PAC_URL, - .is_cli_option = TRUE, - .property_alias = "pac-url", - .prompt = N_("PAC URL"), - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "pac-url", + .prompt = N_("PAC URL"), + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_PROXY_PAC_SCRIPT, - .is_cli_option = TRUE, - .property_alias = "pac-script", - .prompt = N_("PAC script"), - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_string, - .validate_fcn = _validate_fcn_proxy_pac_script, - ), + .is_cli_option = TRUE, + .property_alias = "pac-script", + .prompt = N_("PAC script"), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_string, + .validate_fcn = _validate_fcn_proxy_pac_script, + ), ), NULL }; @@ -6341,51 +6380,51 @@ static const NMMetaPropertyInfo *const property_infos_PROXY[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_SERIAL static const NMMetaPropertyInfo *const property_infos_SERIAL[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_SERIAL_BAUD, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_SERIAL_BITS, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_SERIAL_PARITY, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .value_infos = ENUM_VALUE_INFOS ( - { - .value = NM_SETTING_SERIAL_PARITY_EVEN, - .nick = "E", - }, - { - .value = NM_SETTING_SERIAL_PARITY_EVEN, - .nick = "e", - }, - { - .value = NM_SETTING_SERIAL_PARITY_ODD, - .nick = "O", - }, - { - .value = NM_SETTING_SERIAL_PARITY_ODD, - .nick = "o", - }, - { - .value = NM_SETTING_SERIAL_PARITY_NONE, - .nick = "N", - }, - { - .value = NM_SETTING_SERIAL_PARITY_NONE, - .nick = "n", - }, - ), - ), - .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT - | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, - ), + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .value_infos = ENUM_VALUE_INFOS ( + { + .value = NM_SETTING_SERIAL_PARITY_EVEN, + .nick = "E", + }, + { + .value = NM_SETTING_SERIAL_PARITY_EVEN, + .nick = "e", + }, + { + .value = NM_SETTING_SERIAL_PARITY_ODD, + .nick = "O", + }, + { + .value = NM_SETTING_SERIAL_PARITY_ODD, + .nick = "o", + }, + { + .value = NM_SETTING_SERIAL_PARITY_NONE, + .nick = "N", + }, + { + .value = NM_SETTING_SERIAL_PARITY_NONE, + .nick = "n", + }, + ), + ), + .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT + | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_SERIAL_STOPBITS, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_SERIAL_SEND_DELAY, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), NULL }; @@ -6394,22 +6433,22 @@ static const NMMetaPropertyInfo *const property_infos_SERIAL[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_SRIOV static const NMMetaPropertyInfo *const property_infos_SRIOV[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_SRIOV_TOTAL_VFS, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_SRIOV_VFS, - .property_type = &_pt_objlist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (objlist, - .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingSriov, nm_setting_sriov_get_num_vfs), - .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingSriov, nm_setting_sriov_clear_vfs), - .obj_to_str_fcn = _objlist_obj_to_str_fcn_sriov_vfs, - .set_fcn = _objlist_set_fcn_sriov_vfs, - .strsplit_plain = TRUE, - ), - ), + .property_type = &_pt_objlist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (objlist, + .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingSriov, nm_setting_sriov_get_num_vfs), + .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingSriov, nm_setting_sriov_clear_vfs), + .obj_to_str_fcn = _objlist_obj_to_str_fcn_sriov_vfs, + .set_fcn = _objlist_set_fcn_sriov_vfs, + .strsplit_plain = TRUE, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_SRIOV_AUTOPROBE_DRIVERS, - .property_type = &_pt_gobject_enum, + .property_type = &_pt_gobject_enum, ), NULL }; @@ -6418,30 +6457,30 @@ static const NMMetaPropertyInfo *const property_infos_SRIOV[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_TC_CONFIG static const NMMetaPropertyInfo *const property_infos_TC_CONFIG[] = { PROPERTY_INFO (NM_SETTING_TC_CONFIG_QDISCS, DESCRIBE_DOC_NM_SETTING_TC_CONFIG_QDISCS, - .property_type = &_pt_objlist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (objlist, - .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingTCConfig, nm_setting_tc_config_get_num_qdiscs), - .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingTCConfig, nm_setting_tc_config_clear_qdiscs), - .obj_to_str_fcn = _objlist_obj_to_str_fcn_tc_config_qdiscs, - .set_fcn = _objlist_set_fcn_tc_config_qdiscs, - .remove_by_idx_fcn_u = OBJLIST_REMOVE_BY_IDX_FCN_U (NMSettingTCConfig, nm_setting_tc_config_remove_qdisc), - .strsplit_plain = TRUE, - ), - ), + .property_type = &_pt_objlist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (objlist, + .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingTCConfig, nm_setting_tc_config_get_num_qdiscs), + .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingTCConfig, nm_setting_tc_config_clear_qdiscs), + .obj_to_str_fcn = _objlist_obj_to_str_fcn_tc_config_qdiscs, + .set_fcn = _objlist_set_fcn_tc_config_qdiscs, + .remove_by_idx_fcn_u = OBJLIST_REMOVE_BY_IDX_FCN_U (NMSettingTCConfig, nm_setting_tc_config_remove_qdisc), + .strsplit_plain = TRUE, + ), + ), ), PROPERTY_INFO (NM_SETTING_TC_CONFIG_TFILTERS, DESCRIBE_DOC_NM_SETTING_TC_CONFIG_TFILTERS, - .property_type = &_pt_objlist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (objlist, - .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingTCConfig, nm_setting_tc_config_get_num_tfilters), - .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingTCConfig, nm_setting_tc_config_clear_tfilters), - .obj_to_str_fcn = _objlist_obj_to_str_fcn_tc_config_tfilters, - .set_fcn = _objlist_set_fcn_tc_config_tfilters, - .remove_by_idx_fcn_u = OBJLIST_REMOVE_BY_IDX_FCN_U (NMSettingTCConfig, nm_setting_tc_config_remove_tfilter), - .strsplit_plain = TRUE, - ), - ), + .property_type = &_pt_objlist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (objlist, + .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingTCConfig, nm_setting_tc_config_get_num_tfilters), + .clear_all_fcn = OBJLIST_CLEAR_ALL_FCN (NMSettingTCConfig, nm_setting_tc_config_clear_tfilters), + .obj_to_str_fcn = _objlist_obj_to_str_fcn_tc_config_tfilters, + .set_fcn = _objlist_set_fcn_tc_config_tfilters, + .remove_by_idx_fcn_u = OBJLIST_REMOVE_BY_IDX_FCN_U (NMSettingTCConfig, nm_setting_tc_config_remove_tfilter), + .strsplit_plain = TRUE, + ), + ), ), NULL }; @@ -6450,186 +6489,186 @@ static const NMMetaPropertyInfo *const property_infos_TC_CONFIG[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_TEAM static const NMMetaPropertyInfo *const property_infos_TEAM[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_CONFIG, - .is_cli_option = TRUE, - .property_alias = "config", - .prompt = N_("Team JSON configuration [none]"), - .describe_message = TEAM_DESCRIBE_MESSAGE, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_string, - .validate_fcn = _validate_fcn_team_config, - ), + .is_cli_option = TRUE, + .property_alias = "config", + .prompt = N_("Team JSON configuration [none]"), + .describe_message = TEAM_DESCRIBE_MESSAGE, + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_string, + .validate_fcn = _validate_fcn_team_config, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_NOTIFY_PEERS_COUNT, - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = -1, - .nick = "unset", - }, - { - .value.i64 = 0, - .nick = "disabled", - }, - ), - ), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = -1, + .nick = "unset", + }, + { + .value.i64 = 0, + .nick = "disabled", + }, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_NOTIFY_PEERS_INTERVAL, - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = -1, - .nick = "unset", - }, - { - .value.i64 = 0, - .nick = "default", - }, - ), - ), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = -1, + .nick = "unset", + }, + { + .value.i64 = 0, + .nick = "default", + }, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_MCAST_REJOIN_COUNT, - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = -1, - .nick = "unset", - }, - { - .value.i64 = 0, - .nick = "disabled", - }, - ), - ), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = -1, + .nick = "unset", + }, + { + .value.i64 = 0, + .nick = "disabled", + }, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_MCAST_REJOIN_INTERVAL, - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = -1, - .nick = "unset", - }, - { - .value.i64 = 0, - .nick = "default", - }, - ), - ), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = -1, + .nick = "unset", + }, + { + .value.i64 = 0, + .nick = "default", + }, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV (NM_SETTING_TEAM_RUNNER_BROADCAST, - NM_SETTING_TEAM_RUNNER_ROUNDROBIN, - NM_SETTING_TEAM_RUNNER_RANDOM, - NM_SETTING_TEAM_RUNNER_ACTIVEBACKUP, - NM_SETTING_TEAM_RUNNER_LOADBALANCE, - NM_SETTING_TEAM_RUNNER_LACP), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV (NM_SETTING_TEAM_RUNNER_BROADCAST, + NM_SETTING_TEAM_RUNNER_ROUNDROBIN, + NM_SETTING_TEAM_RUNNER_RANDOM, + NM_SETTING_TEAM_RUNNER_ACTIVEBACKUP, + NM_SETTING_TEAM_RUNNER_LOADBALANCE, + NM_SETTING_TEAM_RUNNER_LACP), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER_HWADDR_POLICY, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV (NM_SETTING_TEAM_RUNNER_HWADDR_POLICY_SAME_ALL, - NM_SETTING_TEAM_RUNNER_HWADDR_POLICY_BY_ACTIVE, - NM_SETTING_TEAM_RUNNER_HWADDR_POLICY_ONLY_ACTIVE), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV (NM_SETTING_TEAM_RUNNER_HWADDR_POLICY_SAME_ALL, + NM_SETTING_TEAM_RUNNER_HWADDR_POLICY_BY_ACTIVE, + NM_SETTING_TEAM_RUNNER_HWADDR_POLICY_ONLY_ACTIVE), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER_TX_HASH, - .property_type = &_pt_multilist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (multilist, - .get_num_fcn_u = MULTILIST_GET_NUM_FCN_U (NMSettingTeam, nm_setting_team_get_num_runner_tx_hash), - .add_fcn = MULTILIST_ADD_FCN (NMSettingTeam, nm_setting_team_add_runner_tx_hash), - .remove_by_idx_fcn_u = MULTILIST_REMOVE_BY_IDX_FCN_U (NMSettingTeam, nm_setting_team_remove_runner_tx_hash), - .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingTeam, nm_setting_team_remove_runner_tx_hash_by_value), - .strsplit_plain = TRUE, - ), - .values_static = NM_MAKE_STRV ("eth", "vlan", "ipv4", "ipv6", "ip", - "l3", "tcp", "udp", "sctp", "l4"), - ), + .property_type = &_pt_multilist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (multilist, + .get_num_fcn_u = MULTILIST_GET_NUM_FCN_U (NMSettingTeam, nm_setting_team_get_num_runner_tx_hash), + .add_fcn = MULTILIST_ADD_FCN (NMSettingTeam, nm_setting_team_add_runner_tx_hash), + .remove_by_idx_fcn_u = MULTILIST_REMOVE_BY_IDX_FCN_U (NMSettingTeam, nm_setting_team_remove_runner_tx_hash), + .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingTeam, nm_setting_team_remove_runner_tx_hash_by_value), + .strsplit_plain = TRUE, + ), + .values_static = NM_MAKE_STRV ("eth", "vlan", "ipv4", "ipv6", "ip", + "l3", "tcp", "udp", "sctp", "l4"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER_TX_BALANCER, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV ("basic"), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV ("basic"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER_TX_BALANCER_INTERVAL, - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = -1, - .nick = "unset", - }, - { - .value.i64 = NM_SETTING_TEAM_RUNNER_TX_BALANCER_INTERVAL_DEFAULT, - .nick = "default", - }, - ), - ), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = -1, + .nick = "unset", + }, + { + .value.i64 = NM_SETTING_TEAM_RUNNER_TX_BALANCER_INTERVAL_DEFAULT, + .nick = "default", + }, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER_ACTIVE, - .property_type = & _pt_gobject_bool, + .property_type = & _pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER_FAST_RATE, - .property_type = & _pt_gobject_bool, + .property_type = & _pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER_SYS_PRIO, - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = -1, - .nick = "unset", - }, - { - .value.i64 = NM_SETTING_TEAM_RUNNER_SYS_PRIO_DEFAULT, - .nick = "default", - }, - ), - ), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = -1, + .nick = "unset", + }, + { + .value.i64 = NM_SETTING_TEAM_RUNNER_SYS_PRIO_DEFAULT, + .nick = "default", + }, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER_MIN_PORTS, - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = -1, - .nick = "unset", - }, - { - .value.i64 = 1, - .nick = "default", - }, - ), - ), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = -1, + .nick = "unset", + }, + { + .value.i64 = 1, + .nick = "default", + }, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV (NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY_LACP_PRIO, - NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY_LACP_PRIO_STABLE, - NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY_BANDWIDTH, - NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY_COUNT, - NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY_PORT_CONFIG), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV (NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY_LACP_PRIO, + NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY_LACP_PRIO_STABLE, + NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY_BANDWIDTH, + NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY_COUNT, + NM_SETTING_TEAM_RUNNER_AGG_SELECT_POLICY_PORT_CONFIG), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_LINK_WATCHERS, - .describe_message = TEAM_LINK_WATCHERS_DESCRIBE_MESSAGE, - .property_type = &_pt_objlist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (objlist, - .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingTeam, nm_setting_team_get_num_link_watchers), - .obj_to_str_fcn = _objlist_obj_to_str_fcn_team_link_watchers, - .set_fcn = _objlist_set_fcn_team_link_watchers, - .remove_by_idx_fcn_u = OBJLIST_REMOVE_BY_IDX_FCN_U (NMSettingTeam, nm_setting_team_remove_link_watcher), - ), - ), + .describe_message = TEAM_LINK_WATCHERS_DESCRIBE_MESSAGE, + .property_type = &_pt_objlist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (objlist, + .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingTeam, nm_setting_team_get_num_link_watchers), + .obj_to_str_fcn = _objlist_obj_to_str_fcn_team_link_watchers, + .set_fcn = _objlist_set_fcn_team_link_watchers, + .remove_by_idx_fcn_u = OBJLIST_REMOVE_BY_IDX_FCN_U (NMSettingTeam, nm_setting_team_remove_link_watcher), + ), + ), ), NULL }; @@ -6638,89 +6677,89 @@ static const NMMetaPropertyInfo *const property_infos_TEAM[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_TEAM_PORT static const NMMetaPropertyInfo *const property_infos_TEAM_PORT[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_PORT_CONFIG, - .is_cli_option = TRUE, - .property_alias = "config", - .prompt = N_("Team JSON configuration [none]"), - .describe_message = TEAM_DESCRIBE_MESSAGE, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_string, - .validate_fcn = _validate_fcn_team_config, - ), + .is_cli_option = TRUE, + .property_alias = "config", + .prompt = N_("Team JSON configuration [none]"), + .describe_message = TEAM_DESCRIBE_MESSAGE, + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_string, + .validate_fcn = _validate_fcn_team_config, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_PORT_QUEUE_ID, - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = -1, - .nick = "unset", - }, - { - .value.i64 = 0, - .nick = "default", - }, - ), - ), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = -1, + .nick = "unset", + }, + { + .value.i64 = 0, + .nick = "default", + }, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_PORT_PRIO, - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = 0, - .nick = "unset", - }, - { - .value.i64 = 0, - .nick = "default", - }, - ), - ), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = 0, + .nick = "unset", + }, + { + .value.i64 = 0, + .nick = "default", + }, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_PORT_STICKY, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_PORT_LACP_PRIO, - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = -1, - .nick = "unset", - }, - { - .value.i64 = NM_SETTING_TEAM_PORT_LACP_PRIO_DEFAULT, - .nick = "default", - }, - ), - ), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = -1, + .nick = "unset", + }, + { + .value.i64 = NM_SETTING_TEAM_PORT_LACP_PRIO_DEFAULT, + .nick = "default", + }, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_PORT_LACP_KEY, - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = -1, - .nick = "unset", - }, - { - .value.i64 = 0, - .nick = "default", - }, - ), - ), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = -1, + .nick = "unset", + }, + { + .value.i64 = 0, + .nick = "default", + }, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TEAM_PORT_LINK_WATCHERS, - .describe_message = TEAM_LINK_WATCHERS_DESCRIBE_MESSAGE, - .property_type = &_pt_objlist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (objlist, - .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingTeamPort, nm_setting_team_port_get_num_link_watchers), - .obj_to_str_fcn = _objlist_obj_to_str_fcn_team_link_watchers, - .set_fcn = _objlist_set_fcn_team_link_watchers, - .remove_by_idx_fcn_u = OBJLIST_REMOVE_BY_IDX_FCN_U (NMSettingTeamPort, nm_setting_team_port_remove_link_watcher), - ), - ), + .describe_message = TEAM_LINK_WATCHERS_DESCRIBE_MESSAGE, + .property_type = &_pt_objlist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (objlist, + .get_num_fcn = OBJLIST_GET_NUM_FCN (NMSettingTeamPort, nm_setting_team_port_get_num_link_watchers), + .obj_to_str_fcn = _objlist_obj_to_str_fcn_team_link_watchers, + .set_fcn = _objlist_set_fcn_team_link_watchers, + .remove_by_idx_fcn_u = OBJLIST_REMOVE_BY_IDX_FCN_U (NMSettingTeamPort, nm_setting_team_port_remove_link_watcher), + ), + ), ), NULL }; @@ -6729,46 +6768,46 @@ static const NMMetaPropertyInfo *const property_infos_TEAM_PORT[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_TUN static const NMMetaPropertyInfo *const property_infos_TUN[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_TUN_MODE, - .is_cli_option = TRUE, - .property_alias = "mode", - .prompt = NM_META_TEXT_PROMPT_TUN_MODE, - .def_hint = NM_META_TEXT_PROMPT_TUN_MODE_CHOICES, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_setting_tun_mode_get_type, - .min = NM_SETTING_TUN_MODE_UNKNOWN + 1, - .max = G_MAXINT, - ), + .is_cli_option = TRUE, + .property_alias = "mode", + .prompt = NM_META_TEXT_PROMPT_TUN_MODE, + .def_hint = NM_META_TEXT_PROMPT_TUN_MODE_CHOICES, + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_setting_tun_mode_get_type, + .min = NM_SETTING_TUN_MODE_UNKNOWN + 1, + .max = G_MAXINT, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TUN_OWNER, - .is_cli_option = TRUE, - .property_alias = "owner", - .prompt = N_("User ID [none]"), - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "owner", + .prompt = N_("User ID [none]"), + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TUN_GROUP, - .is_cli_option = TRUE, - .property_alias = "group", - .prompt = N_("Group ID [none]"), - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "group", + .prompt = N_("Group ID [none]"), + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TUN_PI, - .is_cli_option = TRUE, - .property_alias = "pi", - .prompt = N_("Enable PI [no]"), - .property_type = &_pt_gobject_bool, + .is_cli_option = TRUE, + .property_alias = "pi", + .prompt = N_("Enable PI [no]"), + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TUN_VNET_HDR, - .is_cli_option = TRUE, - .property_alias = "vnet-hdr", - .prompt = N_("Enable VNET header [no]"), - .property_type = &_pt_gobject_bool, + .is_cli_option = TRUE, + .property_alias = "vnet-hdr", + .prompt = N_("Enable VNET header [no]"), + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_TUN_MULTI_QUEUE, - .is_cli_option = TRUE, - .property_alias = "multi-queue", - .prompt = N_("Enable multi queue [no]"), - .property_type = &_pt_gobject_bool, + .is_cli_option = TRUE, + .property_alias = "multi-queue", + .prompt = N_("Enable multi queue [no]"), + .property_type = &_pt_gobject_bool, ), NULL }; @@ -6777,47 +6816,47 @@ static const NMMetaPropertyInfo *const property_infos_TUN[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_VLAN static const NMMetaPropertyInfo *const property_infos_VLAN[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_VLAN_PARENT, - .is_cli_option = TRUE, - .property_alias = "dev", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = N_("VLAN parent device or connection UUID"), - .property_type = &_pt_gobject_devices, + .is_cli_option = TRUE, + .property_alias = "dev", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = N_("VLAN parent device or connection UUID"), + .property_type = &_pt_gobject_devices, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VLAN_ID, - .is_cli_option = TRUE, - .property_alias = "id", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = N_("VLAN ID (<0-4094>)"), - .property_type = &_pt_gobject_int, + .is_cli_option = TRUE, + .property_alias = "id", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = N_("VLAN ID (<0-4094>)"), + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VLAN_FLAGS, - .is_cli_option = TRUE, - .property_alias = "flags", - .prompt = N_("VLAN flags (<0-7>) [none]"), - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_vlan_flags, - .set_fcn = _set_fcn_gobject_flags, - ), + .is_cli_option = TRUE, + .property_alias = "flags", + .prompt = N_("VLAN flags (<0-7>) [none]"), + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_vlan_flags, + .set_fcn = _set_fcn_gobject_flags, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VLAN_INGRESS_PRIORITY_MAP, - .is_cli_option = TRUE, - .property_alias = "ingress", - .prompt = N_("Ingress priority maps [none]"), - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_vlan_xgress_priority_map, - .set_fcn = _set_fcn_vlan_xgress_priority_map, - .set_supports_remove = TRUE, - ), + .is_cli_option = TRUE, + .property_alias = "ingress", + .prompt = N_("Ingress priority maps [none]"), + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_vlan_xgress_priority_map, + .set_fcn = _set_fcn_vlan_xgress_priority_map, + .set_supports_remove = TRUE, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VLAN_EGRESS_PRIORITY_MAP, - .is_cli_option = TRUE, - .property_alias = "egress", - .prompt = N_("Egress priority maps [none]"), - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_vlan_xgress_priority_map, - .set_fcn = _set_fcn_vlan_xgress_priority_map, - .set_supports_remove = TRUE, - ), + .is_cli_option = TRUE, + .property_alias = "egress", + .prompt = N_("Egress priority maps [none]"), + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_vlan_xgress_priority_map, + .set_fcn = _set_fcn_vlan_xgress_priority_map, + .set_supports_remove = TRUE, + ), ), NULL }; @@ -6827,50 +6866,50 @@ static const NMMetaPropertyInfo *const property_infos_VLAN[] = { static const NMMetaPropertyInfo *const property_infos_VPN[] = { [_NM_META_PROPERTY_TYPE_VPN_SERVICE_TYPE] = PROPERTY_INFO_WITH_DESC (NM_SETTING_VPN_SERVICE_TYPE, - .is_cli_option = TRUE, - .property_alias = "vpn-type", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = NM_META_TEXT_PROMPT_VPN_TYPE, - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_gobject, - .set_fcn = _set_fcn_vpn_service_type, - .complete_fcn = _complete_fcn_vpn_service_type, - ), + .is_cli_option = TRUE, + .property_alias = "vpn-type", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = NM_META_TEXT_PROMPT_VPN_TYPE, + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_gobject, + .set_fcn = _set_fcn_vpn_service_type, + .complete_fcn = _complete_fcn_vpn_service_type, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VPN_USER_NAME, - .is_cli_option = TRUE, - .property_alias = "user", - .prompt = N_("Username [none]"), - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "user", + .prompt = N_("Username [none]"), + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VPN_DATA, - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_vpn_data, - .set_fcn = _set_fcn_optionlist, - .set_supports_remove = TRUE, - ), - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (optionlist, - .set_fcn = _optionlist_set_fcn_vpn_data, - .no_empty_value = TRUE, - ), + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_vpn_data, + .set_fcn = _set_fcn_optionlist, + .set_supports_remove = TRUE, + ), + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (optionlist, + .set_fcn = _optionlist_set_fcn_vpn_data, + .no_empty_value = TRUE, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VPN_SECRETS, - .is_secret = TRUE, - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_vpn_secrets, - .set_fcn = _set_fcn_optionlist, - .set_supports_remove = TRUE, - ), - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (optionlist, - .set_fcn = _optionlist_set_fcn_vpn_secrets, - .no_empty_value = TRUE, - ), + .is_secret = TRUE, + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_vpn_secrets, + .set_fcn = _set_fcn_optionlist, + .set_supports_remove = TRUE, + ), + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (optionlist, + .set_fcn = _optionlist_set_fcn_vpn_secrets, + .no_empty_value = TRUE, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VPN_PERSISTENT, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VPN_TIMEOUT, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), NULL }; @@ -6879,75 +6918,75 @@ static const NMMetaPropertyInfo *const property_infos_VPN[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_VXLAN static const NMMetaPropertyInfo *const property_infos_VXLAN[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_VXLAN_PARENT, - .is_cli_option = TRUE, - .property_alias = "dev", - .prompt = N_("Parent device [none]"), - .property_type = &_pt_gobject_devices, + .is_cli_option = TRUE, + .property_alias = "dev", + .prompt = N_("Parent device [none]"), + .property_type = &_pt_gobject_devices, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VXLAN_ID, - .is_cli_option = TRUE, - .property_alias = "id", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = N_("VXLAN ID"), - .property_type = &_pt_gobject_int, + .is_cli_option = TRUE, + .property_alias = "id", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = N_("VXLAN ID"), + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VXLAN_LOCAL, - .is_cli_option = TRUE, - .property_alias = "local", - .prompt = N_("Local address [none]"), - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "local", + .prompt = N_("Local address [none]"), + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VXLAN_REMOTE, - .is_cli_option = TRUE, - .property_alias = "remote", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = N_("Remote"), - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "remote", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = N_("Remote"), + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VXLAN_SOURCE_PORT_MIN, - .is_cli_option = TRUE, - .property_alias = "source-port-min", - .prompt = N_("Minimum source port [0]"), - .property_type = &_pt_gobject_int, + .is_cli_option = TRUE, + .property_alias = "source-port-min", + .prompt = N_("Minimum source port [0]"), + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VXLAN_SOURCE_PORT_MAX, - .is_cli_option = TRUE, - .property_alias = "source-port-max", - .prompt = N_("Maximum source port [0]"), - .property_type = &_pt_gobject_int, + .is_cli_option = TRUE, + .property_alias = "source-port-max", + .prompt = N_("Maximum source port [0]"), + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VXLAN_DESTINATION_PORT, - .is_cli_option = TRUE, - .property_alias = "destination-port", - .prompt = N_("Destination port [8472]"), - .property_type = &_pt_gobject_int, + .is_cli_option = TRUE, + .property_alias = "destination-port", + .prompt = N_("Destination port [8472]"), + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VXLAN_TOS, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VXLAN_TTL, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VXLAN_AGEING, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VXLAN_LIMIT, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VXLAN_LEARNING, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VXLAN_PROXY, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VXLAN_RSC, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VXLAN_L2_MISS, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_VXLAN_L3_MISS, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), NULL }; @@ -6956,22 +6995,22 @@ static const NMMetaPropertyInfo *const property_infos_VXLAN[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_WIFI_P2P static const NMMetaPropertyInfo *const property_infos_WIFI_P2P[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_WIFI_P2P_PEER, - .is_cli_option = TRUE, - .property_alias = "peer", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = N_("Peer"), - .property_type = &_pt_gobject_mac, + .is_cli_option = TRUE, + .property_alias = "peer", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = N_("Peer"), + .property_type = &_pt_gobject_mac, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIFI_P2P_WPS_METHOD, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_setting_wireless_security_wps_method_get_type, - ), - ), + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_setting_wireless_security_wps_method_get_type, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIFI_P2P_WFD_IES, - .property_type = &_pt_gobject_bytes, + .property_type = &_pt_gobject_bytes, ), NULL }; @@ -6980,17 +7019,17 @@ static const NMMetaPropertyInfo *const property_infos_WIFI_P2P[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_WIMAX static const NMMetaPropertyInfo *const property_infos_WIMAX[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_WIMAX_MAC_ADDRESS, - .is_cli_option = TRUE, - .property_alias = "mac", - .prompt = N_("MAC [none]"), - .property_type = &_pt_gobject_string, + .is_cli_option = TRUE, + .property_alias = "mac", + .prompt = N_("MAC [none]"), + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIMAX_NETWORK_NAME, - .is_cli_option = TRUE, - .property_alias = "nsp", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = N_("WiMAX NSP name"), - .property_type = &_pt_gobject_mac, + .is_cli_option = TRUE, + .property_alias = "nsp", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = N_("WiMAX NSP name"), + .property_type = &_pt_gobject_mac, ), NULL }; @@ -6999,118 +7038,118 @@ static const NMMetaPropertyInfo *const property_infos_WIMAX[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_WIRED static const NMMetaPropertyInfo *const property_infos_WIRED[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRED_PORT, - /* Do not allow setting 'port' for now. It is not implemented in - * NM core, nor in ifcfg-rh plugin. Enable this when it gets done. - * wired_valid_ports[] = { "tp", "aui", "bnc", "mii", NULL }; - */ - .property_type = &_pt_gobject_readonly, + /* Do not allow setting 'port' for now. It is not implemented in + * NM core, nor in ifcfg-rh plugin. Enable this when it gets done. + * wired_valid_ports[] = { "tp", "aui", "bnc", "mii", NULL }; + */ + .property_type = &_pt_gobject_readonly, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRED_SPEED, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRED_DUPLEX, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV ("half", "full"), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV ("half", "full"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRED_AUTO_NEGOTIATE, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRED_MAC_ADDRESS, - .is_cli_option = TRUE, - .property_alias = "mac", - .prompt = N_("MAC [none]"), - .property_type = &_pt_gobject_mac, + .is_cli_option = TRUE, + .property_alias = "mac", + .prompt = N_("MAC [none]"), + .property_type = &_pt_gobject_mac, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRED_CLONED_MAC_ADDRESS, - .is_cli_option = TRUE, - .property_alias = "cloned-mac", - .prompt = N_("Cloned MAC [none]"), - .property_type = &_pt_gobject_mac, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mac, - .mode = NM_META_PROPERTY_TYPE_MAC_MODE_CLONED, - ), + .is_cli_option = TRUE, + .property_alias = "cloned-mac", + .prompt = N_("Cloned MAC [none]"), + .property_type = &_pt_gobject_mac, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mac, + .mode = NM_META_PROPERTY_TYPE_MAC_MODE_CLONED, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRED_GENERATE_MAC_ADDRESS_MASK, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST, - .property_type = &_pt_multilist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (multilist, - .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSettingWired, nm_setting_wired_get_num_mac_blacklist_items), - .add_fcn = MULTILIST_ADD_FCN (NMSettingWired, nm_setting_wired_add_mac_blacklist_item), - .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSettingWired, nm_setting_wired_remove_mac_blacklist_item), - .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingWired, nm_setting_wired_remove_mac_blacklist_item_by_value), - .validate2_fcn = _multilist_validate2_fcn_mac_addr, - .strsplit_plain = TRUE, - ), - ), + .property_type = &_pt_multilist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (multilist, + .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSettingWired, nm_setting_wired_get_num_mac_blacklist_items), + .add_fcn = MULTILIST_ADD_FCN (NMSettingWired, nm_setting_wired_add_mac_blacklist_item), + .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSettingWired, nm_setting_wired_remove_mac_blacklist_item), + .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingWired, nm_setting_wired_remove_mac_blacklist_item_by_value), + .validate2_fcn = _multilist_validate2_fcn_mac_addr, + .strsplit_plain = TRUE, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRED_MTU, - .is_cli_option = TRUE, - .property_alias = "mtu", - .prompt = N_("MTU [auto]"), - .property_type = &_pt_gobject_mtu, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mtu, - .get_fcn = MTU_GET_FCN (NMSettingWired, nm_setting_wired_get_mtu), - ), + .is_cli_option = TRUE, + .property_alias = "mtu", + .prompt = N_("MTU [auto]"), + .property_type = &_pt_gobject_mtu, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mtu, + .get_fcn = MTU_GET_FCN (NMSettingWired, nm_setting_wired_get_mtu), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRED_S390_SUBCHANNELS, - .describe_message = - N_("Enter a list of subchannels (comma or space separated).\n\n" - "Example: 0.0.0e20 0.0.0e21 0.0.0e22\n"), - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_gobject, - .set_fcn = _set_fcn_wired_s390_subchannels, - ), + .describe_message = + N_("Enter a list of subchannels (comma or space separated).\n\n" + "Example: 0.0.0e20 0.0.0e21 0.0.0e22\n"), + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_gobject, + .set_fcn = _set_fcn_wired_s390_subchannels, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRED_S390_NETTYPE, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV ("qeth", "lcs", "ctc"), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV ("qeth", "lcs", "ctc"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRED_S390_OPTIONS, - .property_type = DEFINE_PROPERTY_TYPE ( - .describe_fcn = _describe_fcn_wired_s390_options, - .get_fcn = _get_fcn_gobject, - .set_fcn = _set_fcn_optionlist, - .set_supports_remove = TRUE, - .values_fcn = _values_fcn_wired_s390_options, - ), - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (optionlist, - .set_fcn = _optionlist_set_fcn_wired_s390_options, - .no_empty_value = TRUE, - ), + .property_type = DEFINE_PROPERTY_TYPE ( + .describe_fcn = _describe_fcn_wired_s390_options, + .get_fcn = _get_fcn_gobject, + .set_fcn = _set_fcn_optionlist, + .set_supports_remove = TRUE, + .values_fcn = _values_fcn_wired_s390_options, + ), + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (optionlist, + .set_fcn = _optionlist_set_fcn_wired_s390_options, + .no_empty_value = TRUE, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRED_WAKE_ON_LAN, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_setting_wired_wake_on_lan_get_type, - .value_infos = ENUM_VALUE_INFOS ( - { - .value = NM_SETTING_WIRED_WAKE_ON_LAN_NONE, - .nick = "none", - }, - { - .value = NM_SETTING_WIRED_WAKE_ON_LAN_NONE, - .nick = "disable", - }, - { - .value = NM_SETTING_WIRED_WAKE_ON_LAN_NONE, - .nick = "disabled", - }, - ), - ), - .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT - | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, - ), + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_setting_wired_wake_on_lan_get_type, + .value_infos = ENUM_VALUE_INFOS ( + { + .value = NM_SETTING_WIRED_WAKE_ON_LAN_NONE, + .nick = "none", + }, + { + .value = NM_SETTING_WIRED_WAKE_ON_LAN_NONE, + .nick = "disable", + }, + { + .value = NM_SETTING_WIRED_WAKE_ON_LAN_NONE, + .nick = "disabled", + }, + ), + ), + .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT + | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRED_WAKE_ON_LAN_PASSWORD, - .property_type = &_pt_gobject_mac, + .property_type = &_pt_gobject_mac, ), NULL }; @@ -7119,32 +7158,32 @@ static const NMMetaPropertyInfo *const property_infos_WIRED[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_WIREGUARD static const NMMetaPropertyInfo *const property_infos_WIREGUARD[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_WIREGUARD_PRIVATE_KEY, - .is_secret = TRUE, - .property_type = &_pt_gobject_string, + .is_secret = TRUE, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIREGUARD_PRIVATE_KEY_FLAGS, - .property_type = &_pt_gobject_secret_flags, + .property_type = &_pt_gobject_secret_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIREGUARD_LISTEN_PORT, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIREGUARD_FWMARK, - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, \ - .base = 16, - ), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, \ + .base = 16, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIREGUARD_PEER_ROUTES, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIREGUARD_MTU, - .property_type = &_pt_gobject_mtu, + .property_type = &_pt_gobject_mtu, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIREGUARD_IP4_AUTO_DEFAULT_ROUTE, - .property_type = &_pt_gobject_enum, + .property_type = &_pt_gobject_enum, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIREGUARD_IP6_AUTO_DEFAULT_ROUTE, - .property_type = &_pt_gobject_enum, + .property_type = &_pt_gobject_enum, ), NULL }; @@ -7153,129 +7192,129 @@ static const NMMetaPropertyInfo *const property_infos_WIREGUARD[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_WIRELESS static const NMMetaPropertyInfo *const property_infos_WIRELESS[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SSID, - .is_cli_option = TRUE, - .property_alias = "ssid", - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .prompt = N_("SSID"), - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_wireless_ssid, - .set_fcn = _set_fcn_gobject_ssid, - ), + .is_cli_option = TRUE, + .property_alias = "ssid", + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .prompt = N_("SSID"), + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_wireless_ssid, + .set_fcn = _set_fcn_gobject_ssid, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_MODE, - .is_cli_option = TRUE, - .property_alias = "mode", - .prompt = NM_META_TEXT_PROMPT_WIFI_MODE, - .def_hint = NM_META_TEXT_PROMPT_WIFI_MODE_CHOICES, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV (NM_SETTING_WIRELESS_MODE_INFRA, - NM_SETTING_WIRELESS_MODE_ADHOC, - NM_SETTING_WIRELESS_MODE_AP, - NM_SETTING_WIRELESS_MODE_MESH), - ), + .is_cli_option = TRUE, + .property_alias = "mode", + .prompt = NM_META_TEXT_PROMPT_WIFI_MODE, + .def_hint = NM_META_TEXT_PROMPT_WIFI_MODE_CHOICES, + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV (NM_SETTING_WIRELESS_MODE_INFRA, + NM_SETTING_WIRELESS_MODE_ADHOC, + NM_SETTING_WIRELESS_MODE_AP, + NM_SETTING_WIRELESS_MODE_MESH), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_BAND, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV ("a", "bg"), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV ("a", "bg"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_CHANNEL, - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_gobject, - .set_fcn = _set_fcn_wireless_channel, - ), + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_gobject, + .set_fcn = _set_fcn_wireless_channel, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_BSSID, - .property_type = &_pt_gobject_mac, + .property_type = &_pt_gobject_mac, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_RATE, - /* Do not allow setting 'rate'. It is not implemented in NM core. */ - .property_type = &_pt_gobject_readonly, + /* Do not allow setting 'rate'. It is not implemented in NM core. */ + .property_type = &_pt_gobject_readonly, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_TX_POWER, - /* Do not allow setting 'tx-power'. It is not implemented in NM core. */ - .property_type = &_pt_gobject_readonly, + /* Do not allow setting 'tx-power'. It is not implemented in NM core. */ + .property_type = &_pt_gobject_readonly, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_MAC_ADDRESS, - .property_type = &_pt_gobject_mac, - .is_cli_option = TRUE, - .property_alias = "mac", - .prompt = N_("MAC [none]"), + .property_type = &_pt_gobject_mac, + .is_cli_option = TRUE, + .property_alias = "mac", + .prompt = N_("MAC [none]"), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS, - .is_cli_option = TRUE, - .property_alias = "cloned-mac", - .prompt = N_("Cloned MAC [none]"), - .property_type = &_pt_gobject_mac, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mac, - .mode = NM_META_PROPERTY_TYPE_MAC_MODE_CLONED, - ), + .is_cli_option = TRUE, + .property_alias = "cloned-mac", + .prompt = N_("Cloned MAC [none]"), + .property_type = &_pt_gobject_mac, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mac, + .mode = NM_META_PROPERTY_TYPE_MAC_MODE_CLONED, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_GENERATE_MAC_ADDRESS_MASK, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST, - .property_type = &_pt_multilist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (multilist, - .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSettingWireless, nm_setting_wireless_get_num_mac_blacklist_items), - .add_fcn = MULTILIST_ADD_FCN (NMSettingWireless, nm_setting_wireless_add_mac_blacklist_item), - .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSettingWireless, nm_setting_wireless_remove_mac_blacklist_item), - .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingWireless, nm_setting_wireless_remove_mac_blacklist_item_by_value), - .validate2_fcn = _multilist_validate2_fcn_mac_addr, - .strsplit_plain = TRUE, - ), - ), + .property_type = &_pt_multilist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (multilist, + .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSettingWireless, nm_setting_wireless_get_num_mac_blacklist_items), + .add_fcn = MULTILIST_ADD_FCN (NMSettingWireless, nm_setting_wireless_add_mac_blacklist_item), + .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSettingWireless, nm_setting_wireless_remove_mac_blacklist_item), + .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingWireless, nm_setting_wireless_remove_mac_blacklist_item_by_value), + .validate2_fcn = _multilist_validate2_fcn_mac_addr, + .strsplit_plain = TRUE, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_MAC_ADDRESS_RANDOMIZATION, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_setting_mac_randomization_get_type, - ), - .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT - | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, - ), + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_setting_mac_randomization_get_type, + ), + .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT + | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_MTU, - .is_cli_option = TRUE, - .property_alias = "mtu", - .prompt = N_("MTU [auto]"), - .property_type = &_pt_gobject_mtu, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mtu, - .get_fcn = MTU_GET_FCN (NMSettingWireless, nm_setting_wireless_get_mtu), - ), + .is_cli_option = TRUE, + .property_alias = "mtu", + .prompt = N_("MTU [auto]"), + .property_type = &_pt_gobject_mtu, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mtu, + .get_fcn = MTU_GET_FCN (NMSettingWireless, nm_setting_wireless_get_mtu), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SEEN_BSSIDS, - .property_type = &_pt_gobject_readonly, + .property_type = &_pt_gobject_readonly, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_HIDDEN, - .property_type = &_pt_gobject_bool, + .property_type = &_pt_gobject_bool, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_POWERSAVE, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_setting_wireless_powersave_get_type, - ), - .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT, - ), + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_setting_wireless_powersave_get_type, + ), + .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_WAKE_ON_WLAN, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_setting_wireless_wake_on_wlan_get_type, - .value_infos = ENUM_VALUE_INFOS ( - { - .value = NM_SETTING_WIRELESS_WAKE_ON_WLAN_NONE, - .nick = "disabled", - }, - ), - ), - ), + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_setting_wireless_wake_on_wlan_get_type, + .value_infos = ENUM_VALUE_INFOS ( + { + .value = NM_SETTING_WIRELESS_WAKE_ON_WLAN_NONE, + .nick = "disabled", + }, + ), + ), + ), ), NULL }; @@ -7284,143 +7323,143 @@ static const NMMetaPropertyInfo *const property_infos_WIRELESS[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_WIRELESS_SECURITY static const NMMetaPropertyInfo *const property_infos_WIRELESS_SECURITY[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV ("none", "ieee8021x", "wpa-none", "wpa-psk", "wpa-eap", "sae"), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV ("none", "ieee8021x", "wpa-psk", "wpa-eap", "sae"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, - .property_type = &_pt_gobject_int, + .property_type = &_pt_gobject_int, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, - .property_type = &_pt_gobject_string, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - .values_static = NM_MAKE_STRV ("open", "shared", "leap"), - ), + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = NM_MAKE_STRV ("open", "shared", "leap"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_PROTO, - .property_type = &_pt_multilist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (multilist, - .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSettingWirelessSecurity, nm_setting_wireless_security_get_num_protos), - .add_fcn = MULTILIST_ADD_FCN (NMSettingWirelessSecurity, nm_setting_wireless_security_add_proto), - .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSettingWirelessSecurity, nm_setting_wireless_security_remove_proto), - .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingWirelessSecurity, nm_setting_wireless_security_remove_proto_by_value), - .strsplit_plain = TRUE, - ), - .values_static = NM_MAKE_STRV ("wpa", "rsn"), - ), + .property_type = &_pt_multilist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (multilist, + .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSettingWirelessSecurity, nm_setting_wireless_security_get_num_protos), + .add_fcn = MULTILIST_ADD_FCN (NMSettingWirelessSecurity, nm_setting_wireless_security_add_proto), + .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSettingWirelessSecurity, nm_setting_wireless_security_remove_proto), + .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingWirelessSecurity, nm_setting_wireless_security_remove_proto_by_value), + .strsplit_plain = TRUE, + ), + .values_static = NM_MAKE_STRV ("wpa", "rsn"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_PAIRWISE, - .property_type = &_pt_multilist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (multilist, - .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSettingWirelessSecurity, nm_setting_wireless_security_get_num_pairwise), - .add_fcn = MULTILIST_ADD_FCN (NMSettingWirelessSecurity, nm_setting_wireless_security_add_pairwise), - .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSettingWirelessSecurity, nm_setting_wireless_security_remove_pairwise), - .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingWirelessSecurity, nm_setting_wireless_security_remove_pairwise_by_value), - .strsplit_plain = TRUE, - ), - .values_static = NM_MAKE_STRV ("tkip", "ccmp"), - ), + .property_type = &_pt_multilist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (multilist, + .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSettingWirelessSecurity, nm_setting_wireless_security_get_num_pairwise), + .add_fcn = MULTILIST_ADD_FCN (NMSettingWirelessSecurity, nm_setting_wireless_security_add_pairwise), + .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSettingWirelessSecurity, nm_setting_wireless_security_remove_pairwise), + .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingWirelessSecurity, nm_setting_wireless_security_remove_pairwise_by_value), + .strsplit_plain = TRUE, + ), + .values_static = NM_MAKE_STRV ("tkip", "ccmp"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_GROUP, - .property_type = &_pt_multilist, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (multilist, - .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSettingWirelessSecurity, nm_setting_wireless_security_get_num_groups), - .add_fcn = MULTILIST_ADD_FCN (NMSettingWirelessSecurity, nm_setting_wireless_security_add_group), - .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSettingWirelessSecurity, nm_setting_wireless_security_remove_group), - .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingWirelessSecurity, nm_setting_wireless_security_remove_group_by_value), - .strsplit_plain = TRUE, - ), - .values_static = NM_MAKE_STRV ("wep40", "wep104", "tkip", "ccmp"), - ), + .property_type = &_pt_multilist, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (multilist, + .get_num_fcn_u32 = MULTILIST_GET_NUM_FCN_U32 (NMSettingWirelessSecurity, nm_setting_wireless_security_get_num_groups), + .add_fcn = MULTILIST_ADD_FCN (NMSettingWirelessSecurity, nm_setting_wireless_security_add_group), + .remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSettingWirelessSecurity, nm_setting_wireless_security_remove_group), + .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingWirelessSecurity, nm_setting_wireless_security_remove_group_by_value), + .strsplit_plain = TRUE, + ), + .values_static = NM_MAKE_STRV ("wep40", "wep104", "tkip", "ccmp"), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_PMF, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_setting_wireless_security_pmf_get_type, - ), - ), + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_setting_wireless_security_pmf_get_type, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, - .property_type = &_pt_gobject_string, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_WEP_KEY0, - .is_secret = TRUE, - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_wireless_security_wep_key, - .set_fcn = _set_fcn_wireless_wep_key, - ), + .is_secret = TRUE, + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_wireless_security_wep_key, + .set_fcn = _set_fcn_wireless_wep_key, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_WEP_KEY1, - .is_secret = TRUE, - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_wireless_security_wep_key, - .set_fcn = _set_fcn_wireless_wep_key, - ), + .is_secret = TRUE, + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_wireless_security_wep_key, + .set_fcn = _set_fcn_wireless_wep_key, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_WEP_KEY2, - .is_secret = TRUE, - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_wireless_security_wep_key, - .set_fcn = _set_fcn_wireless_wep_key, - ), + .is_secret = TRUE, + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_wireless_security_wep_key, + .set_fcn = _set_fcn_wireless_wep_key, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_WEP_KEY3, - .is_secret = TRUE, - .property_type = DEFINE_PROPERTY_TYPE ( - .get_fcn = _get_fcn_wireless_security_wep_key, - .set_fcn = _set_fcn_wireless_wep_key, - ), + .is_secret = TRUE, + .property_type = DEFINE_PROPERTY_TYPE ( + .get_fcn = _get_fcn_wireless_security_wep_key, + .set_fcn = _set_fcn_wireless_wep_key, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_WEP_KEY_FLAGS, - .property_type = &_pt_gobject_secret_flags, + .property_type = &_pt_gobject_secret_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE, - .describe_message = - N_("Enter the type of WEP keys. The accepted values are: " - "0 or unknown, 1 or key, and 2 or passphrase.\n"), - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .pre_set_notify = _gobject_enum_pre_set_notify_fcn_wireless_security_wep_key_type, - ), - .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT - | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, - ), + .describe_message = + N_("Enter the type of WEP keys. The accepted values are: " + "0 or unknown, 1 or key, and 2 or passphrase.\n"), + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .pre_set_notify = _gobject_enum_pre_set_notify_fcn_wireless_security_wep_key_type, + ), + .typ_flags = NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PARSABLE_TEXT + | NM_META_PROPERTY_TYP_FLAG_ENUM_GET_PRETTY_TEXT, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_PSK, - .is_secret = TRUE, - .property_type = &_pt_gobject_string, + .is_secret = TRUE, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_PSK_FLAGS, - .property_type = &_pt_gobject_secret_flags, + .property_type = &_pt_gobject_secret_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD, - .is_secret = TRUE, - .property_type = &_pt_gobject_string, + .is_secret = TRUE, + .property_type = &_pt_gobject_string, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD_FLAGS, - .property_type = &_pt_gobject_secret_flags, + .property_type = &_pt_gobject_secret_flags, ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_WPS_METHOD, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_setting_wireless_security_wps_method_get_type, - ), - ), + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_setting_wireless_security_wps_method_get_type, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_SECURITY_FILS, - .property_type = &_pt_gobject_enum, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( - PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, - .get_gtype = nm_setting_wireless_security_fils_get_type, - ), - ), + .property_type = &_pt_gobject_enum, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + PROPERTY_TYP_DATA_SUBTYPE (gobject_enum, + .get_gtype = nm_setting_wireless_security_fils_get_type, + ), + ), ), NULL }; @@ -7429,72 +7468,72 @@ static const NMMetaPropertyInfo *const property_infos_WIRELESS_SECURITY[] = { #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_WPAN static const NMMetaPropertyInfo *const property_infos_WPAN[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_WPAN_MAC_ADDRESS, - .property_type = &_pt_gobject_mac, - .is_cli_option = TRUE, - .property_alias = "mac", - .prompt = N_("MAC [none]"), - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mac, - .mode = NM_META_PROPERTY_TYPE_MAC_MODE_WPAN, - ), + .property_type = &_pt_gobject_mac, + .is_cli_option = TRUE, + .property_alias = "mac", + .prompt = N_("MAC [none]"), + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (mac, + .mode = NM_META_PROPERTY_TYPE_MAC_MODE_WPAN, + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WPAN_SHORT_ADDRESS, - .is_cli_option = TRUE, - .property_alias = "short-addr", - .prompt = N_("Short address (<0x0000-0xffff>)"), - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, \ - .base = 16, - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = G_MAXUINT16, - .nick = "unset", - }, - ), - ), + .is_cli_option = TRUE, + .property_alias = "short-addr", + .prompt = N_("Short address (<0x0000-0xffff>)"), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, \ + .base = 16, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = G_MAXUINT16, + .nick = "unset", + }, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WPAN_PAN_ID, - .is_cli_option = TRUE, - .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, - .property_alias = "pan-id", - .prompt = N_("PAN Identifier (<0x0000-0xffff>)"), - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, \ - .base = 16, - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = G_MAXUINT16, - .nick = "unset", - }, - ), - ), + .is_cli_option = TRUE, + .inf_flags = NM_META_PROPERTY_INF_FLAG_REQD, + .property_alias = "pan-id", + .prompt = N_("PAN Identifier (<0x0000-0xffff>)"), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, \ + .base = 16, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = G_MAXUINT16, + .nick = "unset", + }, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WPAN_PAGE, - .is_cli_option = TRUE, - .property_alias = "page", - .prompt = N_("Page (<default|0-31>)"), - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, \ - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = NM_SETTING_WPAN_PAGE_DEFAULT, - .nick = "default", - }, - ), - ), + .is_cli_option = TRUE, + .property_alias = "page", + .prompt = N_("Page (<default|0-31>)"), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, \ + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = NM_SETTING_WPAN_PAGE_DEFAULT, + .nick = "default", + }, + ), + ), ), PROPERTY_INFO_WITH_DESC (NM_SETTING_WPAN_CHANNEL, - .is_cli_option = TRUE, - .property_alias = "channel", - .prompt = N_("Channel (<default|0-26>)"), - .property_type = &_pt_gobject_int, - .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, \ - .value_infos = INT_VALUE_INFOS ( - { - .value.i64 = NM_SETTING_WPAN_CHANNEL_DEFAULT, - .nick = "default", - }, - ), - ), + .is_cli_option = TRUE, + .property_alias = "channel", + .prompt = N_("Channel (<default|0-26>)"), + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, \ + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = NM_SETTING_WPAN_CHANNEL_DEFAULT, + .nick = "default", + }, + ), + ), ), NULL }; @@ -7505,10 +7544,10 @@ static void _setting_init_fcn_adsl (ARGS_SETTING_INIT_FCN) { if (init_type == NM_META_ACCESSOR_SETTING_INIT_TYPE_CLI) { - /* Initialize a protocol */ - g_object_set (NM_SETTING_ADSL (setting), - NM_SETTING_ADSL_PROTOCOL, NM_SETTING_ADSL_PROTOCOL_PPPOE, - NULL); + /* Initialize a protocol */ + g_object_set (NM_SETTING_ADSL (setting), + NM_SETTING_ADSL_PROTOCOL, NM_SETTING_ADSL_PROTOCOL_PPPOE, + NULL); } } @@ -7516,10 +7555,10 @@ static void _setting_init_fcn_cdma (ARGS_SETTING_INIT_FCN) { if (init_type == NM_META_ACCESSOR_SETTING_INIT_TYPE_CLI) { - /* Initialize 'number' so that 'cdma' is valid */ - g_object_set (NM_SETTING_CDMA (setting), - NM_SETTING_CDMA_NUMBER, "#777", - NULL); + /* Initialize 'number' so that 'cdma' is valid */ + g_object_set (NM_SETTING_CDMA (setting), + NM_SETTING_CDMA_NUMBER, "#777", + NULL); } } @@ -7527,10 +7566,10 @@ static void _setting_init_fcn_gsm (ARGS_SETTING_INIT_FCN) { if (init_type == NM_META_ACCESSOR_SETTING_INIT_TYPE_CLI) { - /* Initialize 'apn' so that 'gsm' is valid */ - g_object_set (NM_SETTING_GSM (setting), - NM_SETTING_GSM_APN, "internet", - NULL); + /* Initialize 'apn' so that 'gsm' is valid */ + g_object_set (NM_SETTING_GSM (setting), + NM_SETTING_GSM_APN, "internet", + NULL); } } @@ -7538,10 +7577,10 @@ static void _setting_init_fcn_infiniband (ARGS_SETTING_INIT_FCN) { if (init_type == NM_META_ACCESSOR_SETTING_INIT_TYPE_CLI) { - /* Initialize 'transport-mode' so that 'infiniband' is valid */ - g_object_set (NM_SETTING_INFINIBAND (setting), - NM_SETTING_INFINIBAND_TRANSPORT_MODE, "datagram", - NULL); + /* Initialize 'transport-mode' so that 'infiniband' is valid */ + g_object_set (NM_SETTING_INFINIBAND (setting), + NM_SETTING_INFINIBAND_TRANSPORT_MODE, "datagram", + NULL); } } @@ -7549,9 +7588,9 @@ static void _setting_init_fcn_ip4_config (ARGS_SETTING_INIT_FCN) { if (init_type == NM_META_ACCESSOR_SETTING_INIT_TYPE_CLI) { - g_object_set (NM_SETTING_IP_CONFIG (setting), - NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, - NULL); + g_object_set (NM_SETTING_IP_CONFIG (setting), + NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, + NULL); } } @@ -7559,9 +7598,9 @@ static void _setting_init_fcn_ip6_config (ARGS_SETTING_INIT_FCN) { if (init_type == NM_META_ACCESSOR_SETTING_INIT_TYPE_CLI) { - g_object_set (NM_SETTING_IP_CONFIG (setting), - NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, - NULL); + g_object_set (NM_SETTING_IP_CONFIG (setting), + NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_AUTO, + NULL); } } @@ -7569,9 +7608,9 @@ static void _setting_init_fcn_olpc_mesh (ARGS_SETTING_INIT_FCN) { if (init_type == NM_META_ACCESSOR_SETTING_INIT_TYPE_CLI) { - g_object_set (NM_SETTING_OLPC_MESH (setting), - NM_SETTING_OLPC_MESH_CHANNEL, 1, - NULL); + g_object_set (NM_SETTING_OLPC_MESH (setting), + NM_SETTING_OLPC_MESH_CHANNEL, 1, + NULL); } } @@ -7579,9 +7618,9 @@ static void _setting_init_fcn_proxy (ARGS_SETTING_INIT_FCN) { if (init_type == NM_META_ACCESSOR_SETTING_INIT_TYPE_CLI) { - g_object_set (NM_SETTING_PROXY (setting), - NM_SETTING_PROXY_METHOD, (int) NM_SETTING_PROXY_METHOD_NONE, - NULL); + g_object_set (NM_SETTING_PROXY (setting), + NM_SETTING_PROXY_METHOD, (int) NM_SETTING_PROXY_METHOD_NONE, + NULL); } } @@ -7589,9 +7628,9 @@ static void _setting_init_fcn_tun (ARGS_SETTING_INIT_FCN) { if (init_type == NM_META_ACCESSOR_SETTING_INIT_TYPE_CLI) { - g_object_set (NM_SETTING_TUN (setting), - NM_SETTING_TUN_MODE, NM_SETTING_TUN_MODE_TUN, - NULL); + g_object_set (NM_SETTING_TUN (setting), + NM_SETTING_TUN_MODE, NM_SETTING_TUN_MODE_TUN, + NULL); } } @@ -7599,9 +7638,9 @@ static void _setting_init_fcn_vlan (ARGS_SETTING_INIT_FCN) { if (init_type == NM_META_ACCESSOR_SETTING_INIT_TYPE_CLI) { - g_object_set (setting, - NM_SETTING_VLAN_ID, 1, - NULL); + g_object_set (setting, + NM_SETTING_VLAN_ID, 1, + NULL); } } @@ -7609,12 +7648,12 @@ static void _setting_init_fcn_wireless (ARGS_SETTING_INIT_FCN) { if (init_type == NM_META_ACCESSOR_SETTING_INIT_TYPE_CLI) { - /* For Wi-Fi set mode to "infrastructure". Even though mode == NULL - * is regarded as "infrastructure", explicit value makes no doubts. - */ - g_object_set (NM_SETTING_WIRELESS (setting), - NM_SETTING_WIRELESS_MODE, NM_SETTING_WIRELESS_MODE_INFRA, - NULL); + /* For Wi-Fi set mode to "infrastructure". Even though mode == NULL + * is regarded as "infrastructure", explicit value makes no doubts. + */ + g_object_set (NM_SETTING_WIRELESS (setting), + NM_SETTING_WIRELESS_MODE, NM_SETTING_WIRELESS_MODE_INFRA, + NULL); } } @@ -7673,288 +7712,288 @@ _setting_init_fcn_wireless (ARGS_SETTING_INIT_FCN) #define NM_META_SETTING_VALID_PART_ITEM(type, mand) \ (&((const NMMetaSettingValidPartItem) { \ - .setting_info = &nm_meta_setting_infos_editor[NM_META_SETTING_TYPE_##type], \ - .mandatory = mand, \ + .setting_info = &nm_meta_setting_infos_editor[NM_META_SETTING_TYPE_##type], \ + .mandatory = mand, \ })) const NMMetaSettingInfoEditor nm_meta_setting_infos_editor[] = { #define SETTING_INFO_EMPTY(type, ...) \ [NM_META_SETTING_TYPE_##type] = { \ - .meta_type = &nm_meta_type_setting_info_editor, \ - .general = &nm_meta_setting_infos[NM_META_SETTING_TYPE_##type], \ - .pretty_name = SETTING_PRETTY_NAME_##type, \ - __VA_ARGS__ \ + .meta_type = &nm_meta_type_setting_info_editor, \ + .general = &nm_meta_setting_infos[NM_META_SETTING_TYPE_##type], \ + .pretty_name = SETTING_PRETTY_NAME_##type, \ + __VA_ARGS__ \ } #define SETTING_INFO(type, ...) \ [NM_META_SETTING_TYPE_##type] = { \ - .meta_type = &nm_meta_type_setting_info_editor, \ - .general = &nm_meta_setting_infos[NM_META_SETTING_TYPE_##type], \ - .properties = property_infos_##type, \ - .properties_num = G_N_ELEMENTS (property_infos_##type) - 1, \ - .pretty_name = SETTING_PRETTY_NAME_##type, \ - __VA_ARGS__ \ + .meta_type = &nm_meta_type_setting_info_editor, \ + .general = &nm_meta_setting_infos[NM_META_SETTING_TYPE_##type], \ + .properties = property_infos_##type, \ + .properties_num = G_N_ELEMENTS (property_infos_##type) - 1, \ + .pretty_name = SETTING_PRETTY_NAME_##type, \ + __VA_ARGS__ \ } SETTING_INFO (6LOWPAN, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (6LOWPAN, TRUE), - ), + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (6LOWPAN, TRUE), + ), ), SETTING_INFO (802_1X), SETTING_INFO (ADSL, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (ADSL, TRUE), - ), - .setting_init_fcn = _setting_init_fcn_adsl, + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (ADSL, TRUE), + ), + .setting_init_fcn = _setting_init_fcn_adsl, ), SETTING_INFO (BLUETOOTH, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (BLUETOOTH, TRUE), - NM_META_SETTING_VALID_PART_ITEM (BRIDGE, FALSE), - NM_META_SETTING_VALID_PART_ITEM (GSM, FALSE), - NM_META_SETTING_VALID_PART_ITEM (CDMA, FALSE), - ), + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (BLUETOOTH, TRUE), + NM_META_SETTING_VALID_PART_ITEM (BRIDGE, FALSE), + NM_META_SETTING_VALID_PART_ITEM (GSM, FALSE), + NM_META_SETTING_VALID_PART_ITEM (CDMA, FALSE), + ), ), SETTING_INFO (BOND, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (BOND, TRUE), - NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), - NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), - ), + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (BOND, TRUE), + NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), + NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), + ), ), SETTING_INFO (BRIDGE, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (BRIDGE, TRUE), - NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), - NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), - ), + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (BRIDGE, TRUE), + NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), + NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), + ), ), SETTING_INFO (BRIDGE_PORT), SETTING_INFO (CDMA, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (CDMA, TRUE), - NM_META_SETTING_VALID_PART_ITEM (SERIAL, FALSE), - NM_META_SETTING_VALID_PART_ITEM (PPP, FALSE), - ), - .setting_init_fcn = _setting_init_fcn_cdma, + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (CDMA, TRUE), + NM_META_SETTING_VALID_PART_ITEM (SERIAL, FALSE), + NM_META_SETTING_VALID_PART_ITEM (PPP, FALSE), + ), + .setting_init_fcn = _setting_init_fcn_cdma, ), SETTING_INFO (CONNECTION), SETTING_INFO (DCB), SETTING_INFO (ETHTOOL), SETTING_INFO_EMPTY (DUMMY, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (DUMMY, TRUE), - NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), - NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), - ), + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (DUMMY, TRUE), + NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), + NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), + ), ), SETTING_INFO_EMPTY (GENERIC, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (GENERIC, TRUE), - ), + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (GENERIC, TRUE), + ), ), SETTING_INFO (GSM, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (GSM, TRUE), - NM_META_SETTING_VALID_PART_ITEM (SERIAL, FALSE), - NM_META_SETTING_VALID_PART_ITEM (PPP, FALSE), - ), - .setting_init_fcn = _setting_init_fcn_gsm, + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (GSM, TRUE), + NM_META_SETTING_VALID_PART_ITEM (SERIAL, FALSE), + NM_META_SETTING_VALID_PART_ITEM (PPP, FALSE), + ), + .setting_init_fcn = _setting_init_fcn_gsm, ), SETTING_INFO (INFINIBAND, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (INFINIBAND, TRUE), - NM_META_SETTING_VALID_PART_ITEM (SRIOV, FALSE), - NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), - ), - .setting_init_fcn = _setting_init_fcn_infiniband, + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (INFINIBAND, TRUE), + NM_META_SETTING_VALID_PART_ITEM (SRIOV, FALSE), + NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), + ), + .setting_init_fcn = _setting_init_fcn_infiniband, ), SETTING_INFO (IP4_CONFIG, - .setting_init_fcn = _setting_init_fcn_ip4_config, + .setting_init_fcn = _setting_init_fcn_ip4_config, ), SETTING_INFO (IP6_CONFIG, - .setting_init_fcn = _setting_init_fcn_ip6_config, + .setting_init_fcn = _setting_init_fcn_ip6_config, ), SETTING_INFO (IP_TUNNEL, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (IP_TUNNEL, TRUE), - NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), - NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), - ), + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (IP_TUNNEL, TRUE), + NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), + NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), + ), ), SETTING_INFO (MACSEC, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (MACSEC, TRUE), - NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), - NM_META_SETTING_VALID_PART_ITEM (802_1X, FALSE), - NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), - ), + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (MACSEC, TRUE), + NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), + NM_META_SETTING_VALID_PART_ITEM (802_1X, FALSE), + NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), + ), ), SETTING_INFO (MACVLAN, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (MACVLAN, TRUE), - NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), - NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), - ), + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (MACVLAN, TRUE), + NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), + NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), + ), ), SETTING_INFO (MATCH), SETTING_INFO (OLPC_MESH, - .alias = "olpc-mesh", - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (OLPC_MESH, TRUE), - ), - .setting_init_fcn = _setting_init_fcn_olpc_mesh, + .alias = "olpc-mesh", + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (OLPC_MESH, TRUE), + ), + .setting_init_fcn = _setting_init_fcn_olpc_mesh, ), SETTING_INFO (OVS_BRIDGE, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (OVS_BRIDGE, TRUE), - NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), - ), + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (OVS_BRIDGE, TRUE), + NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), + ), ), SETTING_INFO (OVS_DPDK), SETTING_INFO (OVS_INTERFACE, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (OVS_INTERFACE, TRUE), - NM_META_SETTING_VALID_PART_ITEM (OVS_DPDK, FALSE), - NM_META_SETTING_VALID_PART_ITEM (OVS_PATCH, FALSE), - NM_META_SETTING_VALID_PART_ITEM (IP4_CONFIG, FALSE), - NM_META_SETTING_VALID_PART_ITEM (IP6_CONFIG, FALSE), - NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), - NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), - ), + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (OVS_INTERFACE, TRUE), + NM_META_SETTING_VALID_PART_ITEM (OVS_DPDK, FALSE), + NM_META_SETTING_VALID_PART_ITEM (OVS_PATCH, FALSE), + NM_META_SETTING_VALID_PART_ITEM (IP4_CONFIG, FALSE), + NM_META_SETTING_VALID_PART_ITEM (IP6_CONFIG, FALSE), + NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), + NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), + ), ), SETTING_INFO (OVS_PATCH), SETTING_INFO (OVS_PORT, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (OVS_PORT, TRUE), - ), + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (OVS_PORT, TRUE), + ), ), SETTING_INFO (PPPOE, - /* PPPoE is a base connection type from historical reasons. - * See libnm-core/nm-setting.c:_nm_setting_is_base_type() - */ - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (PPPOE, TRUE), - NM_META_SETTING_VALID_PART_ITEM (WIRED, TRUE), - NM_META_SETTING_VALID_PART_ITEM (PPP, FALSE), - NM_META_SETTING_VALID_PART_ITEM (802_1X, FALSE), - NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), - ), + /* PPPoE is a base connection type from historical reasons. + * See libnm-core/nm-setting.c:_nm_setting_is_base_type() + */ + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (PPPOE, TRUE), + NM_META_SETTING_VALID_PART_ITEM (WIRED, TRUE), + NM_META_SETTING_VALID_PART_ITEM (PPP, FALSE), + NM_META_SETTING_VALID_PART_ITEM (802_1X, FALSE), + NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), + ), ), SETTING_INFO (PPP), SETTING_INFO (PROXY, - .setting_init_fcn = _setting_init_fcn_proxy, + .setting_init_fcn = _setting_init_fcn_proxy, ), SETTING_INFO (SERIAL), SETTING_INFO (SRIOV), SETTING_INFO (TC_CONFIG), SETTING_INFO (TEAM, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (TEAM, TRUE), - NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), - NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), - ), + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (TEAM, TRUE), + NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), + NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), + ), ), SETTING_INFO (TEAM_PORT), SETTING_INFO (TUN, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (TUN, TRUE), - NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), - NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), - ), - .setting_init_fcn = _setting_init_fcn_tun, + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (TUN, TRUE), + NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), + NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), + ), + .setting_init_fcn = _setting_init_fcn_tun, ), SETTING_INFO_EMPTY (USER), SETTING_INFO (VLAN, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (VLAN, TRUE), - NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), - NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), - ), - .setting_init_fcn = _setting_init_fcn_vlan, + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (VLAN, TRUE), + NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), + NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), + ), + .setting_init_fcn = _setting_init_fcn_vlan, ), SETTING_INFO (VPN, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (VPN, TRUE), - ), + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (VPN, TRUE), + ), ), SETTING_INFO (VXLAN, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (VXLAN, TRUE), - NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), - NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), - ), + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (VXLAN, TRUE), + NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), + NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), + ), ), SETTING_INFO (WIFI_P2P, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (WIFI_P2P, TRUE), - ), + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (WIFI_P2P, TRUE), + ), ), SETTING_INFO (WIMAX, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (WIMAX, TRUE), - ), + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (WIMAX, TRUE), + ), ), SETTING_INFO (WIRED, - .alias = "ethernet", - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (WIRED, TRUE), - NM_META_SETTING_VALID_PART_ITEM (802_1X, FALSE), - NM_META_SETTING_VALID_PART_ITEM (DCB, FALSE), - NM_META_SETTING_VALID_PART_ITEM (SRIOV, FALSE), - NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), - ), + .alias = "ethernet", + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (WIRED, TRUE), + NM_META_SETTING_VALID_PART_ITEM (802_1X, FALSE), + NM_META_SETTING_VALID_PART_ITEM (DCB, FALSE), + NM_META_SETTING_VALID_PART_ITEM (SRIOV, FALSE), + NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), + ), ), SETTING_INFO (WIREGUARD, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (WIREGUARD, TRUE), - ), + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (WIREGUARD, TRUE), + ), ), SETTING_INFO (WIRELESS, - .alias = "wifi", - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (WIRELESS, TRUE), - NM_META_SETTING_VALID_PART_ITEM (WIRELESS_SECURITY, FALSE), - NM_META_SETTING_VALID_PART_ITEM (802_1X, FALSE), - NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), - ), - .setting_init_fcn = _setting_init_fcn_wireless, + .alias = "wifi", + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (WIRELESS, TRUE), + NM_META_SETTING_VALID_PART_ITEM (WIRELESS_SECURITY, FALSE), + NM_META_SETTING_VALID_PART_ITEM (802_1X, FALSE), + NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), + ), + .setting_init_fcn = _setting_init_fcn_wireless, ), SETTING_INFO (WIRELESS_SECURITY, - .alias = "wifi-sec", + .alias = "wifi-sec", ), SETTING_INFO (WPAN, - .valid_parts = NM_META_SETTING_VALID_PARTS ( - NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), - NM_META_SETTING_VALID_PART_ITEM (WPAN, TRUE), - ), + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (WPAN, TRUE), + ), ), }; diff --git a/clients/common/nm-meta-setting-desc.h b/clients/common/nm-meta-setting-desc.h index 27ae4254..f06dd3db 100644 --- a/clients/common/nm-meta-setting-desc.h +++ b/clients/common/nm-meta-setting-desc.h @@ -1,20 +1,6 @@ -/* nmcli - command-line tool to control NetworkManager - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright 2010 - 2018 Red Hat, Inc. +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2010 - 2018 Red Hat, Inc. */ #ifndef __NM_META_SETTING_DESC_H__ @@ -102,6 +88,7 @@ typedef enum { NM_META_COLOR_DEVICE_FIRMWARE_MISSING, NM_META_COLOR_DEVICE_PLUGIN_MISSING, NM_META_COLOR_DEVICE_UNAVAILABLE, + NM_META_COLOR_DEVICE_DISABLED, NM_META_COLOR_DEVICE_UNKNOWN, NM_META_COLOR_MANAGER_RUNNING, NM_META_COLOR_MANAGER_STARTING, @@ -130,6 +117,12 @@ typedef enum { } NMMetaColor; typedef enum { + NM_META_ACCESSOR_MODIFIER_SET, + NM_META_ACCESSOR_MODIFIER_ADD, + NM_META_ACCESSOR_MODIFIER_DEL, +} NMMetaAccessorModifier; + +typedef enum { NM_META_ACCESSOR_GET_TYPE_PRETTY, NM_META_ACCESSOR_GET_TYPE_PARSABLE, NM_META_ACCESSOR_GET_TYPE_COLOR, @@ -210,7 +203,7 @@ struct _NMMetaPropertyType { const NMMetaEnvironment *environment, gpointer environment_user_data, NMSetting *setting, - char modifier, + NMMetaAccessorModifier modifier, const char *value, GError **error); diff --git a/clients/common/nm-polkit-listener.c b/clients/common/nm-polkit-listener.c index 139bb35a..b2941652 100644 --- a/clients/common/nm-polkit-listener.c +++ b/clients/common/nm-polkit-listener.c @@ -1,18 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ /* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2014 Red Hat, Inc. + * Copyright (C) 2014 Red Hat, Inc. */ /** diff --git a/clients/common/nm-polkit-listener.h b/clients/common/nm-polkit-listener.h index 63939053..42da1bc1 100644 --- a/clients/common/nm-polkit-listener.h +++ b/clients/common/nm-polkit-listener.h @@ -1,18 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ /* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2014 Red Hat, Inc. + * Copyright (C) 2014 Red Hat, Inc. */ #ifndef __NM_POLKIT_LISTENER_H__ diff --git a/clients/common/nm-secret-agent-simple.c b/clients/common/nm-secret-agent-simple.c index 52059f95..2bf69b20 100644 --- a/clients/common/nm-secret-agent-simple.c +++ b/clients/common/nm-secret-agent-simple.c @@ -1,19 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0+ /* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2011-2015 Red Hat, Inc. - * Copyright 2011 Giovanni Campagna <scampa.giovanni@gmail.com> + * Copyright (C) 2011 - 2015 Red Hat, Inc. + * Copyright (C) 2011 Giovanni Campagna <scampa.giovanni@gmail.com> */ /** @@ -317,7 +305,7 @@ add_wireless_secrets (RequestData *request, if (!key_mgmt) return FALSE; - if (NM_IN_STRSET (key_mgmt, "wpa-none", "wpa-psk", "sae")) { + if (NM_IN_STRSET (key_mgmt, "wpa-psk", "sae")) { secret = _secret_real_new_plain (NM_SECRET_AGENT_SECRET_TYPE_SECRET, _("Password"), NM_SETTING (s_wsec), diff --git a/clients/common/nm-secret-agent-simple.h b/clients/common/nm-secret-agent-simple.h index 650b9713..7214203d 100644 --- a/clients/common/nm-secret-agent-simple.h +++ b/clients/common/nm-secret-agent-simple.h @@ -1,18 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ /* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2013 - 2015 Red Hat, Inc. + * Copyright (C) 2013 - 2015 Red Hat, Inc. */ #ifndef __NM_SECRET_AGENT_SIMPLE_H__ diff --git a/clients/common/nm-vpn-helpers.c b/clients/common/nm-vpn-helpers.c index 204b7c28..ffae5f55 100644 --- a/clients/common/nm-vpn-helpers.c +++ b/clients/common/nm-vpn-helpers.c @@ -1,18 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ /* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2013 - 2015 Red Hat, Inc. + * Copyright (C) 2013 - 2015 Red Hat, Inc. */ /** @@ -390,13 +378,14 @@ nm_vpn_wireguard_import (const char *filename, return FALSE; } - if (nm_utils_file_get_contents (-1, - filename, - 10*1024*1024, - NM_UTILS_FILE_GET_CONTENTS_FLAG_SECRET, - &file_content.str, - &file_content.len, - error) < 0) + if (!nm_utils_file_get_contents (-1, + filename, + 10*1024*1024, + NM_UTILS_FILE_GET_CONTENTS_FLAG_SECRET, + &file_content.str, + &file_content.len, + NULL, + error)) return NULL; /* We interpret the file like `wg-quick up` and `wg setconf` do. diff --git a/clients/common/nm-vpn-helpers.h b/clients/common/nm-vpn-helpers.h index 90017534..611f09dd 100644 --- a/clients/common/nm-vpn-helpers.h +++ b/clients/common/nm-vpn-helpers.h @@ -1,18 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ /* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * Copyright 2013 - 2015 Red Hat, Inc. + * Copyright (C) 2013 - 2015 Red Hat, Inc. */ #ifndef __NM_VPN_HELPERS_H__ diff --git a/clients/common/qrcodegen.c b/clients/common/qrcodegen.c new file mode 100644 index 00000000..7cda9659 --- /dev/null +++ b/clients/common/qrcodegen.c @@ -0,0 +1,1009 @@ +/* + * QR Code generator library (C) + * + * Copyright (c) Project Nayuki. (MIT License) + * https://www.nayuki.io/page/qr-code-generator-library + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * - The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * - The Software is provided "as is", without warranty of any kind, express or + * implied, including but not limited to the warranties of merchantability, + * fitness for a particular purpose and noninfringement. In no event shall the + * authors or copyright holders be liable for any claim, damages or other + * liability, whether in an action of contract, tort or otherwise, arising from, + * out of or in connection with the Software or the use or other dealings in the + * Software. + */ + +#include <assert.h> +#include <limits.h> +#include <stdlib.h> +#include <string.h> +#include "qrcodegen.h" + +#ifndef QRCODEGEN_TEST + #define testable static // Keep functions private +#else + #define testable // Expose private functions +#endif + + +/*---- Forward declarations for private functions ----*/ + +// Regarding all public and private functions defined in this source file: +// - They require all pointer/array arguments to be not null unless the array length is zero. +// - They only read input scalar/array arguments, write to output pointer/array +// arguments, and return scalar values; they are "pure" functions. +// - They don't read mutable global variables or write to any global variables. +// - They don't perform I/O, read the clock, print to console, etc. +// - They allocate a small and constant amount of stack memory. +// - They don't allocate or free any memory on the heap. +// - They don't recurse or mutually recurse. All the code +// could be inlined into the top-level public functions. +// - They run in at most quadratic time with respect to input arguments. +// Most functions run in linear time, and some in constant time. +// There are no unbounded loops or non-obvious termination conditions. +// - They are completely thread-safe if the caller does not give the +// same writable buffer to concurrent calls to these functions. + +testable void appendBitsToBuffer(unsigned int val, int numBits, uint8_t buffer[], int *bitLen); + +testable void addEccAndInterleave(uint8_t data[], int version, enum qrcodegen_Ecc ecl, uint8_t result[]); +testable int getNumDataCodewords(int version, enum qrcodegen_Ecc ecl); +testable int getNumRawDataModules(int ver); + +testable void calcReedSolomonGenerator(int degree, uint8_t result[]); +testable void calcReedSolomonRemainder(const uint8_t data[], int dataLen, + const uint8_t generator[], int degree, uint8_t result[]); +testable uint8_t finiteFieldMultiply(uint8_t x, uint8_t y); + +testable void initializeFunctionModules(int version, uint8_t qrcode[]); +static void drawWhiteFunctionModules(uint8_t qrcode[], int version); +static void drawFormatBits(enum qrcodegen_Ecc ecl, enum qrcodegen_Mask mask, uint8_t qrcode[]); +testable int getAlignmentPatternPositions(int version, uint8_t result[7]); +static void fillRectangle(int left, int top, int width, int height, uint8_t qrcode[]); + +static void drawCodewords(const uint8_t data[], int dataLen, uint8_t qrcode[]); +static void applyMask(const uint8_t functionModules[], uint8_t qrcode[], enum qrcodegen_Mask mask); +static long getPenaltyScore(const uint8_t qrcode[]); +static void addRunToHistory(unsigned char run, unsigned char history[7]); +static bool hasFinderLikePattern(unsigned char runHistory[7]); + +testable bool getModule(const uint8_t qrcode[], int x, int y); +testable void setModule(uint8_t qrcode[], int x, int y, bool isBlack); +testable void setModuleBounded(uint8_t qrcode[], int x, int y, bool isBlack); +static bool getBit(int x, int i); + +testable int calcSegmentBitLength(enum qrcodegen_Mode mode, size_t numChars); +testable int getTotalBits(const struct qrcodegen_Segment segs[], size_t len, int version); +static int numCharCountBits(enum qrcodegen_Mode mode, int version); + + + +/*---- Private tables of constants ----*/ + +// The set of all legal characters in alphanumeric mode, where each character +// value maps to the index in the string. For checking text and encoding segments. +static const char *ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"; + +// For generating error correction codes. +testable const int8_t ECC_CODEWORDS_PER_BLOCK[4][41] = { + // Version: (note that index 0 is for padding, and is set to an illegal value) + //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level + {-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, // Low + {-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28}, // Medium + {-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, // Quartile + {-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}, // High +}; + +#define qrcodegen_REED_SOLOMON_DEGREE_MAX 30 // Based on the table above + +// For generating error correction codes. +testable const int8_t NUM_ERROR_CORRECTION_BLOCKS[4][41] = { + // Version: (note that index 0 is for padding, and is set to an illegal value) + //0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level + {-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25}, // Low + {-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49}, // Medium + {-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68}, // Quartile + {-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81}, // High +}; + +// For automatic mask pattern selection. +static const int PENALTY_N1 = 3; +static const int PENALTY_N2 = 3; +static const int PENALTY_N3 = 40; +static const int PENALTY_N4 = 10; + + + +/*---- High-level QR Code encoding functions ----*/ + +// Public function - see documentation comment in header file. +bool qrcodegen_encodeText(const char *text, uint8_t tempBuffer[], uint8_t qrcode[], + enum qrcodegen_Ecc ecl, int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl) { + + size_t textLen = strlen(text); + if (textLen == 0) + return qrcodegen_encodeSegmentsAdvanced(NULL, 0, ecl, minVersion, maxVersion, mask, boostEcl, tempBuffer, qrcode); + size_t bufLen = qrcodegen_BUFFER_LEN_FOR_VERSION(maxVersion); + + struct qrcodegen_Segment seg; + if (qrcodegen_isNumeric(text)) { + if (qrcodegen_calcSegmentBufferSize(qrcodegen_Mode_NUMERIC, textLen) > bufLen) + goto fail; + seg = qrcodegen_makeNumeric(text, tempBuffer); + } else if (qrcodegen_isAlphanumeric(text)) { + if (qrcodegen_calcSegmentBufferSize(qrcodegen_Mode_ALPHANUMERIC, textLen) > bufLen) + goto fail; + seg = qrcodegen_makeAlphanumeric(text, tempBuffer); + } else { + if (textLen > bufLen) + goto fail; + for (size_t i = 0; i < textLen; i++) + tempBuffer[i] = (uint8_t)text[i]; + seg.mode = qrcodegen_Mode_BYTE; + seg.bitLength = calcSegmentBitLength(seg.mode, textLen); + if (seg.bitLength == -1) + goto fail; + seg.numChars = (int)textLen; + seg.data = tempBuffer; + } + return qrcodegen_encodeSegmentsAdvanced(&seg, 1, ecl, minVersion, maxVersion, mask, boostEcl, tempBuffer, qrcode); + +fail: + qrcode[0] = 0; // Set size to invalid value for safety + return false; +} + + +// Public function - see documentation comment in header file. +bool qrcodegen_encodeBinary(uint8_t dataAndTemp[], size_t dataLen, uint8_t qrcode[], + enum qrcodegen_Ecc ecl, int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl) { + + struct qrcodegen_Segment seg; + seg.mode = qrcodegen_Mode_BYTE; + seg.bitLength = calcSegmentBitLength(seg.mode, dataLen); + if (seg.bitLength == -1) { + qrcode[0] = 0; // Set size to invalid value for safety + return false; + } + seg.numChars = (int)dataLen; + seg.data = dataAndTemp; + return qrcodegen_encodeSegmentsAdvanced(&seg, 1, ecl, minVersion, maxVersion, mask, boostEcl, dataAndTemp, qrcode); +} + + +// Appends the given number of low-order bits of the given value to the given byte-based +// bit buffer, increasing the bit length. Requires 0 <= numBits <= 16 and val < 2^numBits. +testable void appendBitsToBuffer(unsigned int val, int numBits, uint8_t buffer[], int *bitLen) { + assert(0 <= numBits && numBits <= 16 && (unsigned long)val >> numBits == 0); + for (int i = numBits - 1; i >= 0; i--, (*bitLen)++) + buffer[*bitLen >> 3] |= ((val >> i) & 1) << (7 - (*bitLen & 7)); +} + + + +/*---- Low-level QR Code encoding functions ----*/ + +// Public function - see documentation comment in header file. +bool qrcodegen_encodeSegments(const struct qrcodegen_Segment segs[], size_t len, + enum qrcodegen_Ecc ecl, uint8_t tempBuffer[], uint8_t qrcode[]) { + return qrcodegen_encodeSegmentsAdvanced(segs, len, ecl, + qrcodegen_VERSION_MIN, qrcodegen_VERSION_MAX, -1, true, tempBuffer, qrcode); +} + + +// Public function - see documentation comment in header file. +bool qrcodegen_encodeSegmentsAdvanced(const struct qrcodegen_Segment segs[], size_t len, enum qrcodegen_Ecc ecl, + int minVersion, int maxVersion, int mask, bool boostEcl, uint8_t tempBuffer[], uint8_t qrcode[]) { + assert(segs != NULL || len == 0); + assert(qrcodegen_VERSION_MIN <= minVersion && minVersion <= maxVersion && maxVersion <= qrcodegen_VERSION_MAX); + assert(0 <= (int)ecl && (int)ecl <= 3 && -1 <= (int)mask && (int)mask <= 7); + + // Find the minimal version number to use + int version, dataUsedBits; + for (version = minVersion; ; version++) { + int dataCapacityBits = getNumDataCodewords(version, ecl) * 8; // Number of data bits available + dataUsedBits = getTotalBits(segs, len, version); + if (dataUsedBits != -1 && dataUsedBits <= dataCapacityBits) + break; // This version number is found to be suitable + if (version >= maxVersion) { // All versions in the range could not fit the given data + qrcode[0] = 0; // Set size to invalid value for safety + return false; + } + } + assert(dataUsedBits != -1); + + // Increase the error correction level while the data still fits in the current version number + for (int i = (int)qrcodegen_Ecc_MEDIUM; i <= (int)qrcodegen_Ecc_HIGH; i++) { // From low to high + if (boostEcl && dataUsedBits <= getNumDataCodewords(version, (enum qrcodegen_Ecc)i) * 8) + ecl = (enum qrcodegen_Ecc)i; + } + + // Concatenate all segments to create the data bit string + memset(qrcode, 0, qrcodegen_BUFFER_LEN_FOR_VERSION(version) * sizeof(qrcode[0])); + int bitLen = 0; + for (size_t i = 0; i < len; i++) { + const struct qrcodegen_Segment *seg = &segs[i]; + appendBitsToBuffer((int)seg->mode, 4, qrcode, &bitLen); + appendBitsToBuffer(seg->numChars, numCharCountBits(seg->mode, version), qrcode, &bitLen); + for (int j = 0; j < seg->bitLength; j++) + appendBitsToBuffer((seg->data[j >> 3] >> (7 - (j & 7))) & 1, 1, qrcode, &bitLen); + } + assert(bitLen == dataUsedBits); + + // Add terminator and pad up to a byte if applicable + int dataCapacityBits = getNumDataCodewords(version, ecl) * 8; + assert(bitLen <= dataCapacityBits); + int terminatorBits = dataCapacityBits - bitLen; + if (terminatorBits > 4) + terminatorBits = 4; + appendBitsToBuffer(0, terminatorBits, qrcode, &bitLen); + appendBitsToBuffer(0, (8 - bitLen % 8) % 8, qrcode, &bitLen); + assert(bitLen % 8 == 0); + + // Pad with alternating bytes until data capacity is reached + for (uint8_t padByte = 0xEC; bitLen < dataCapacityBits; padByte ^= 0xEC ^ 0x11) + appendBitsToBuffer(padByte, 8, qrcode, &bitLen); + + // Draw function and data codeword modules + addEccAndInterleave(qrcode, version, ecl, tempBuffer); + initializeFunctionModules(version, qrcode); + drawCodewords(tempBuffer, getNumRawDataModules(version) / 8, qrcode); + drawWhiteFunctionModules(qrcode, version); + initializeFunctionModules(version, tempBuffer); + + // Handle masking + if (mask == qrcodegen_Mask_AUTO) { // Automatically choose best mask + long minPenalty = LONG_MAX; + for (int i = 0; i < 8; i++) { + enum qrcodegen_Mask msk = (enum qrcodegen_Mask)i; + drawFormatBits(ecl, msk, qrcode); + applyMask(tempBuffer, qrcode, msk); + long penalty = getPenaltyScore(qrcode); + if (penalty < minPenalty) { + mask = msk; + minPenalty = penalty; + } + applyMask(tempBuffer, qrcode, msk); // Undoes the mask due to XOR + } + } + assert(0 <= (int)mask && (int)mask <= 7); + drawFormatBits(ecl, mask, qrcode); + applyMask(tempBuffer, qrcode, mask); + return true; +} + + + +/*---- Error correction code generation functions ----*/ + +// Appends error correction bytes to each block of the given data array, then interleaves +// bytes from the blocks and stores them in the result array. data[0 : dataLen] contains +// the input data. data[dataLen : rawCodewords] is used as a temporary work area and will +// be clobbered by this function. The final answer is stored in result[0 : rawCodewords]. +testable void addEccAndInterleave(uint8_t data[], int version, enum qrcodegen_Ecc ecl, uint8_t result[]) { + // Calculate parameter numbers + assert(0 <= (int)ecl && (int)ecl < 4 && qrcodegen_VERSION_MIN <= version && version <= qrcodegen_VERSION_MAX); + int numBlocks = NUM_ERROR_CORRECTION_BLOCKS[(int)ecl][version]; + int blockEccLen = ECC_CODEWORDS_PER_BLOCK [(int)ecl][version]; + int rawCodewords = getNumRawDataModules(version) / 8; + int dataLen = getNumDataCodewords(version, ecl); + int numShortBlocks = numBlocks - rawCodewords % numBlocks; + int shortBlockDataLen = rawCodewords / numBlocks - blockEccLen; + + // Split data into blocks, calculate ECC, and interleave + // (not concatenate) the bytes into a single sequence + uint8_t generator[qrcodegen_REED_SOLOMON_DEGREE_MAX]; + calcReedSolomonGenerator(blockEccLen, generator); + const uint8_t *dat = data; + for (int i = 0; i < numBlocks; i++) { + int datLen = shortBlockDataLen + (i < numShortBlocks ? 0 : 1); + uint8_t *ecc = &data[dataLen]; // Temporary storage + calcReedSolomonRemainder(dat, datLen, generator, blockEccLen, ecc); + for (int j = 0, k = i; j < datLen; j++, k += numBlocks) { // Copy data + if (j == shortBlockDataLen) + k -= numShortBlocks; + result[k] = dat[j]; + } + for (int j = 0, k = dataLen + i; j < blockEccLen; j++, k += numBlocks) // Copy ECC + result[k] = ecc[j]; + dat += datLen; + } +} + + +// Returns the number of 8-bit codewords that can be used for storing data (not ECC), +// for the given version number and error correction level. The result is in the range [9, 2956]. +testable int getNumDataCodewords(int version, enum qrcodegen_Ecc ecl) { + int v = version, e = (int)ecl; + assert(0 <= e && e < 4); + return getNumRawDataModules(v) / 8 + - ECC_CODEWORDS_PER_BLOCK [e][v] + * NUM_ERROR_CORRECTION_BLOCKS[e][v]; +} + + +// Returns the number of data bits that can be stored in a QR Code of the given version number, after +// all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8. +// The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table. +testable int getNumRawDataModules(int ver) { + assert(qrcodegen_VERSION_MIN <= ver && ver <= qrcodegen_VERSION_MAX); + int result = (16 * ver + 128) * ver + 64; + if (ver >= 2) { + int numAlign = ver / 7 + 2; + result -= (25 * numAlign - 10) * numAlign - 55; + if (ver >= 7) + result -= 36; + } + return result; +} + + + +/*---- Reed-Solomon ECC generator functions ----*/ + +// Calculates the Reed-Solomon generator polynomial of the given degree, storing in result[0 : degree]. +testable void calcReedSolomonGenerator(int degree, uint8_t result[]) { + // Start with the monomial x^0 + assert(1 <= degree && degree <= qrcodegen_REED_SOLOMON_DEGREE_MAX); + memset(result, 0, degree * sizeof(result[0])); + result[degree - 1] = 1; + + // Compute the product polynomial (x - r^0) * (x - r^1) * (x - r^2) * ... * (x - r^{degree-1}), + // drop the highest term, and store the rest of the coefficients in order of descending powers. + // Note that r = 0x02, which is a generator element of this field GF(2^8/0x11D). + uint8_t root = 1; + for (int i = 0; i < degree; i++) { + // Multiply the current product by (x - r^i) + for (int j = 0; j < degree; j++) { + result[j] = finiteFieldMultiply(result[j], root); + if (j + 1 < degree) + result[j] ^= result[j + 1]; + } + root = finiteFieldMultiply(root, 0x02); + } +} + + +// Calculates the remainder of the polynomial data[0 : dataLen] when divided by the generator[0 : degree], where all +// polynomials are in big endian and the generator has an implicit leading 1 term, storing the result in result[0 : degree]. +testable void calcReedSolomonRemainder(const uint8_t data[], int dataLen, + const uint8_t generator[], int degree, uint8_t result[]) { + + // Perform polynomial division + assert(1 <= degree && degree <= qrcodegen_REED_SOLOMON_DEGREE_MAX); + memset(result, 0, degree * sizeof(result[0])); + for (int i = 0; i < dataLen; i++) { + uint8_t factor = data[i] ^ result[0]; + memmove(&result[0], &result[1], (degree - 1) * sizeof(result[0])); + result[degree - 1] = 0; + for (int j = 0; j < degree; j++) + result[j] ^= finiteFieldMultiply(generator[j], factor); + } +} + +#undef qrcodegen_REED_SOLOMON_DEGREE_MAX + + +// Returns the product of the two given field elements modulo GF(2^8/0x11D). +// All inputs are valid. This could be implemented as a 256*256 lookup table. +testable uint8_t finiteFieldMultiply(uint8_t x, uint8_t y) { + // Russian peasant multiplication + uint8_t z = 0; + for (int i = 7; i >= 0; i--) { + z = (z << 1) ^ ((z >> 7) * 0x11D); + z ^= ((y >> i) & 1) * x; + } + return z; +} + + + +/*---- Drawing function modules ----*/ + +// Clears the given QR Code grid with white modules for the given +// version's size, then marks every function module as black. +testable void initializeFunctionModules(int version, uint8_t qrcode[]) { + // Initialize QR Code + int qrsize = version * 4 + 17; + memset(qrcode, 0, ((qrsize * qrsize + 7) / 8 + 1) * sizeof(qrcode[0])); + qrcode[0] = (uint8_t)qrsize; + + // Fill horizontal and vertical timing patterns + fillRectangle(6, 0, 1, qrsize, qrcode); + fillRectangle(0, 6, qrsize, 1, qrcode); + + // Fill 3 finder patterns (all corners except bottom right) and format bits + fillRectangle(0, 0, 9, 9, qrcode); + fillRectangle(qrsize - 8, 0, 8, 9, qrcode); + fillRectangle(0, qrsize - 8, 9, 8, qrcode); + + // Fill numerous alignment patterns + uint8_t alignPatPos[7]; + int numAlign = getAlignmentPatternPositions(version, alignPatPos); + for (int i = 0; i < numAlign; i++) { + for (int j = 0; j < numAlign; j++) { + // Don't draw on the three finder corners + if (!((i == 0 && j == 0) || (i == 0 && j == numAlign - 1) || (i == numAlign - 1 && j == 0))) + fillRectangle(alignPatPos[i] - 2, alignPatPos[j] - 2, 5, 5, qrcode); + } + } + + // Fill version blocks + if (version >= 7) { + fillRectangle(qrsize - 11, 0, 3, 6, qrcode); + fillRectangle(0, qrsize - 11, 6, 3, qrcode); + } +} + + +// Draws white function modules and possibly some black modules onto the given QR Code, without changing +// non-function modules. This does not draw the format bits. This requires all function modules to be previously +// marked black (namely by initializeFunctionModules()), because this may skip redrawing black function modules. +static void drawWhiteFunctionModules(uint8_t qrcode[], int version) { + // Draw horizontal and vertical timing patterns + int qrsize = qrcodegen_getSize(qrcode); + for (int i = 7; i < qrsize - 7; i += 2) { + setModule(qrcode, 6, i, false); + setModule(qrcode, i, 6, false); + } + + // Draw 3 finder patterns (all corners except bottom right; overwrites some timing modules) + for (int dy = -4; dy <= 4; dy++) { + for (int dx = -4; dx <= 4; dx++) { + int dist = abs(dx); + if (abs(dy) > dist) + dist = abs(dy); + if (dist == 2 || dist == 4) { + setModuleBounded(qrcode, 3 + dx, 3 + dy, false); + setModuleBounded(qrcode, qrsize - 4 + dx, 3 + dy, false); + setModuleBounded(qrcode, 3 + dx, qrsize - 4 + dy, false); + } + } + } + + // Draw numerous alignment patterns + uint8_t alignPatPos[7]; + int numAlign = getAlignmentPatternPositions(version, alignPatPos); + for (int i = 0; i < numAlign; i++) { + for (int j = 0; j < numAlign; j++) { + if ((i == 0 && j == 0) || (i == 0 && j == numAlign - 1) || (i == numAlign - 1 && j == 0)) + continue; // Don't draw on the three finder corners + for (int dy = -1; dy <= 1; dy++) { + for (int dx = -1; dx <= 1; dx++) + setModule(qrcode, alignPatPos[i] + dx, alignPatPos[j] + dy, dx == 0 && dy == 0); + } + } + } + + // Draw version blocks + if (version >= 7) { + // Calculate error correction code and pack bits + int rem = version; // version is uint6, in the range [7, 40] + for (int i = 0; i < 12; i++) + rem = (rem << 1) ^ ((rem >> 11) * 0x1F25); + long bits = (long)version << 12 | rem; // uint18 + assert(bits >> 18 == 0); + + // Draw two copies + for (int i = 0; i < 6; i++) { + for (int j = 0; j < 3; j++) { + int k = qrsize - 11 + j; + setModule(qrcode, k, i, (bits & 1) != 0); + setModule(qrcode, i, k, (bits & 1) != 0); + bits >>= 1; + } + } + } +} + + +// Draws two copies of the format bits (with its own error correction code) based +// on the given mask and error correction level. This always draws all modules of +// the format bits, unlike drawWhiteFunctionModules() which might skip black modules. +static void drawFormatBits(enum qrcodegen_Ecc ecl, enum qrcodegen_Mask mask, uint8_t qrcode[]) { + // Calculate error correction code and pack bits + assert(0 <= (int)mask && (int)mask <= 7); + static const int table[] = {1, 0, 3, 2}; + int data = table[(int)ecl] << 3 | (int)mask; // errCorrLvl is uint2, mask is uint3 + int rem = data; + for (int i = 0; i < 10; i++) + rem = (rem << 1) ^ ((rem >> 9) * 0x537); + int bits = (data << 10 | rem) ^ 0x5412; // uint15 + assert(bits >> 15 == 0); + + // Draw first copy + for (int i = 0; i <= 5; i++) + setModule(qrcode, 8, i, getBit(bits, i)); + setModule(qrcode, 8, 7, getBit(bits, 6)); + setModule(qrcode, 8, 8, getBit(bits, 7)); + setModule(qrcode, 7, 8, getBit(bits, 8)); + for (int i = 9; i < 15; i++) + setModule(qrcode, 14 - i, 8, getBit(bits, i)); + + // Draw second copy + int qrsize = qrcodegen_getSize(qrcode); + for (int i = 0; i < 8; i++) + setModule(qrcode, qrsize - 1 - i, 8, getBit(bits, i)); + for (int i = 8; i < 15; i++) + setModule(qrcode, 8, qrsize - 15 + i, getBit(bits, i)); + setModule(qrcode, 8, qrsize - 8, true); // Always black +} + + +// Calculates and stores an ascending list of positions of alignment patterns +// for this version number, returning the length of the list (in the range [0,7]). +// Each position is in the range [0,177), and are used on both the x and y axes. +// This could be implemented as lookup table of 40 variable-length lists of unsigned bytes. +testable int getAlignmentPatternPositions(int version, uint8_t result[7]) { + if (version == 1) + return 0; + int numAlign = version / 7 + 2; + int step = (version == 32) ? 26 : + (version*4 + numAlign*2 + 1) / (numAlign*2 - 2) * 2; + for (int i = numAlign - 1, pos = version * 4 + 10; i >= 1; i--, pos -= step) + result[i] = pos; + result[0] = 6; + return numAlign; +} + + +// Sets every pixel in the range [left : left + width] * [top : top + height] to black. +static void fillRectangle(int left, int top, int width, int height, uint8_t qrcode[]) { + for (int dy = 0; dy < height; dy++) { + for (int dx = 0; dx < width; dx++) + setModule(qrcode, left + dx, top + dy, true); + } +} + + + +/*---- Drawing data modules and masking ----*/ + +// Draws the raw codewords (including data and ECC) onto the given QR Code. This requires the initial state of +// the QR Code to be black at function modules and white at codeword modules (including unused remainder bits). +static void drawCodewords(const uint8_t data[], int dataLen, uint8_t qrcode[]) { + int qrsize = qrcodegen_getSize(qrcode); + int i = 0; // Bit index into the data + // Do the funny zigzag scan + for (int right = qrsize - 1; right >= 1; right -= 2) { // Index of right column in each column pair + if (right == 6) + right = 5; + for (int vert = 0; vert < qrsize; vert++) { // Vertical counter + for (int j = 0; j < 2; j++) { + int x = right - j; // Actual x coordinate + bool upward = ((right + 1) & 2) == 0; + int y = upward ? qrsize - 1 - vert : vert; // Actual y coordinate + if (!getModule(qrcode, x, y) && i < dataLen * 8) { + bool black = getBit(data[i >> 3], 7 - (i & 7)); + setModule(qrcode, x, y, black); + i++; + } + // If this QR Code has any remainder bits (0 to 7), they were assigned as + // 0/false/white by the constructor and are left unchanged by this method + } + } + } + assert(i == dataLen * 8); +} + + +// XORs the codeword modules in this QR Code with the given mask pattern. +// The function modules must be marked and the codeword bits must be drawn +// before masking. Due to the arithmetic of XOR, calling applyMask() with +// the same mask value a second time will undo the mask. A final well-formed +// QR Code needs exactly one (not zero, two, etc.) mask applied. +static void applyMask(const uint8_t functionModules[], uint8_t qrcode[], enum qrcodegen_Mask mask) { + assert(0 <= (int)mask && (int)mask <= 7); // Disallows qrcodegen_Mask_AUTO + int qrsize = qrcodegen_getSize(qrcode); + for (int y = 0; y < qrsize; y++) { + for (int x = 0; x < qrsize; x++) { + if (getModule(functionModules, x, y)) + continue; + bool invert; + switch ((int)mask) { + case 0: invert = (x + y) % 2 == 0; break; + case 1: invert = y % 2 == 0; break; + case 2: invert = x % 3 == 0; break; + case 3: invert = (x + y) % 3 == 0; break; + case 4: invert = (x / 3 + y / 2) % 2 == 0; break; + case 5: invert = x * y % 2 + x * y % 3 == 0; break; + case 6: invert = (x * y % 2 + x * y % 3) % 2 == 0; break; + case 7: invert = ((x + y) % 2 + x * y % 3) % 2 == 0; break; + default: assert(false); return; + } + bool val = getModule(qrcode, x, y); + setModule(qrcode, x, y, val ^ invert); + } + } +} + + +// Calculates and returns the penalty score based on state of the given QR Code's current modules. +// This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score. +static long getPenaltyScore(const uint8_t qrcode[]) { + int qrsize = qrcodegen_getSize(qrcode); + long result = 0; + + // Adjacent modules in row having same color, and finder-like patterns + for (int y = 0; y < qrsize; y++) { + unsigned char runHistory[7] = {0}; + bool color = false; + unsigned char runX = 0; + for (int x = 0; x < qrsize; x++) { + if (getModule(qrcode, x, y) == color) { + runX++; + if (runX == 5) + result += PENALTY_N1; + else if (runX > 5) + result++; + } else { + addRunToHistory(runX, runHistory); + if (!color && hasFinderLikePattern(runHistory)) + result += PENALTY_N3; + color = getModule(qrcode, x, y); + runX = 1; + } + } + addRunToHistory(runX, runHistory); + if (color) + addRunToHistory(0, runHistory); // Dummy run of white + if (hasFinderLikePattern(runHistory)) + result += PENALTY_N3; + } + // Adjacent modules in column having same color, and finder-like patterns + for (int x = 0; x < qrsize; x++) { + unsigned char runHistory[7] = {0}; + bool color = false; + unsigned char runY = 0; + for (int y = 0; y < qrsize; y++) { + if (getModule(qrcode, x, y) == color) { + runY++; + if (runY == 5) + result += PENALTY_N1; + else if (runY > 5) + result++; + } else { + addRunToHistory(runY, runHistory); + if (!color && hasFinderLikePattern(runHistory)) + result += PENALTY_N3; + color = getModule(qrcode, x, y); + runY = 1; + } + } + addRunToHistory(runY, runHistory); + if (color) + addRunToHistory(0, runHistory); // Dummy run of white + if (hasFinderLikePattern(runHistory)) + result += PENALTY_N3; + } + + // 2*2 blocks of modules having same color + for (int y = 0; y < qrsize - 1; y++) { + for (int x = 0; x < qrsize - 1; x++) { + bool color = getModule(qrcode, x, y); + if ( color == getModule(qrcode, x + 1, y) && + color == getModule(qrcode, x, y + 1) && + color == getModule(qrcode, x + 1, y + 1)) + result += PENALTY_N2; + } + } + + // Balance of black and white modules + int black = 0; + for (int y = 0; y < qrsize; y++) { + for (int x = 0; x < qrsize; x++) { + if (getModule(qrcode, x, y)) + black++; + } + } + int total = qrsize * qrsize; // Note that size is odd, so black/total != 1/2 + // Compute the smallest integer k >= 0 such that (45-5k)% <= black/total <= (55+5k)% + int k = (int)((labs(black * 20L - total * 10L) + total - 1) / total) - 1; + result += k * PENALTY_N4; + return result; +} + + +// Inserts the given value to the front of the given array, which shifts over the +// existing values and deletes the last value. A helper function for getPenaltyScore(). +static void addRunToHistory(unsigned char run, unsigned char history[7]) { + memmove(&history[1], &history[0], 6 * sizeof(history[0])); + history[0] = run; +} + + +// Tests whether the given run history has the pattern of ratio 1:1:3:1:1 in the middle, and +// surrounded by at least 4 on either or both ends. A helper function for getPenaltyScore(). +// Must only be called immediately after a run of white modules has ended. +static bool hasFinderLikePattern(unsigned char runHistory[7]) { + unsigned char n = runHistory[1]; + // The maximum QR Code size is 177, hence the run length n <= 177. + // Arithmetic is promoted to int, so n*4 will not overflow. + return n > 0 && runHistory[2] == n && runHistory[4] == n && runHistory[5] == n + && runHistory[3] == n * 3 && (runHistory[0] >= n * 4 || runHistory[6] >= n * 4); +} + + + +/*---- Basic QR Code information ----*/ + +// Public function - see documentation comment in header file. +int qrcodegen_getSize(const uint8_t qrcode[]) { + assert(qrcode != NULL); + int result = qrcode[0]; + assert((qrcodegen_VERSION_MIN * 4 + 17) <= result + && result <= (qrcodegen_VERSION_MAX * 4 + 17)); + return result; +} + + +// Public function - see documentation comment in header file. +bool qrcodegen_getModule(const uint8_t qrcode[], int x, int y) { + assert(qrcode != NULL); + int qrsize = qrcode[0]; + return (0 <= x && x < qrsize && 0 <= y && y < qrsize) && getModule(qrcode, x, y); +} + + +// Gets the module at the given coordinates, which must be in bounds. +testable bool getModule(const uint8_t qrcode[], int x, int y) { + int qrsize = qrcode[0]; + assert(21 <= qrsize && qrsize <= 177 && 0 <= x && x < qrsize && 0 <= y && y < qrsize); + int index = y * qrsize + x; + return getBit(qrcode[(index >> 3) + 1], index & 7); +} + + +// Sets the module at the given coordinates, which must be in bounds. +testable void setModule(uint8_t qrcode[], int x, int y, bool isBlack) { + int qrsize = qrcode[0]; + assert(21 <= qrsize && qrsize <= 177 && 0 <= x && x < qrsize && 0 <= y && y < qrsize); + int index = y * qrsize + x; + int bitIndex = index & 7; + int byteIndex = (index >> 3) + 1; + if (isBlack) + qrcode[byteIndex] |= 1 << bitIndex; + else + qrcode[byteIndex] &= (1 << bitIndex) ^ 0xFF; +} + + +// Sets the module at the given coordinates, doing nothing if out of bounds. +testable void setModuleBounded(uint8_t qrcode[], int x, int y, bool isBlack) { + int qrsize = qrcode[0]; + if (0 <= x && x < qrsize && 0 <= y && y < qrsize) + setModule(qrcode, x, y, isBlack); +} + + +// Returns true iff the i'th bit of x is set to 1. Requires x >= 0 and 0 <= i <= 14. +static bool getBit(int x, int i) { + return ((x >> i) & 1) != 0; +} + + + +/*---- Segment handling ----*/ + +// Public function - see documentation comment in header file. +bool qrcodegen_isAlphanumeric(const char *text) { + assert(text != NULL); + for (; *text != '\0'; text++) { + if (strchr(ALPHANUMERIC_CHARSET, *text) == NULL) + return false; + } + return true; +} + + +// Public function - see documentation comment in header file. +bool qrcodegen_isNumeric(const char *text) { + assert(text != NULL); + for (; *text != '\0'; text++) { + if (*text < '0' || *text > '9') + return false; + } + return true; +} + + +// Public function - see documentation comment in header file. +size_t qrcodegen_calcSegmentBufferSize(enum qrcodegen_Mode mode, size_t numChars) { + int temp = calcSegmentBitLength(mode, numChars); + if (temp == -1) + return SIZE_MAX; + assert(0 <= temp && temp <= INT16_MAX); + return ((size_t)temp + 7) / 8; +} + + +// Returns the number of data bits needed to represent a segment +// containing the given number of characters using the given mode. Notes: +// - Returns -1 on failure, i.e. numChars > INT16_MAX or +// the number of needed bits exceeds INT16_MAX (i.e. 32767). +// - Otherwise, all valid results are in the range [0, INT16_MAX]. +// - For byte mode, numChars measures the number of bytes, not Unicode code points. +// - For ECI mode, numChars must be 0, and the worst-case number of bits is returned. +// An actual ECI segment can have shorter data. For non-ECI modes, the result is exact. +testable int calcSegmentBitLength(enum qrcodegen_Mode mode, size_t numChars) { + // All calculations are designed to avoid overflow on all platforms + if (numChars > (unsigned int)INT16_MAX) + return -1; + long result = (long)numChars; + if (mode == qrcodegen_Mode_NUMERIC) + result = (result * 10 + 2) / 3; // ceil(10/3 * n) + else if (mode == qrcodegen_Mode_ALPHANUMERIC) + result = (result * 11 + 1) / 2; // ceil(11/2 * n) + else if (mode == qrcodegen_Mode_BYTE) + result *= 8; + else if (mode == qrcodegen_Mode_KANJI) + result *= 13; + else if (mode == qrcodegen_Mode_ECI && numChars == 0) + result = 3 * 8; + else { // Invalid argument + assert(false); + return -1; + } + assert(result >= 0); + if (result > (unsigned int)INT16_MAX) + return -1; + return (int)result; +} + + +// Public function - see documentation comment in header file. +struct qrcodegen_Segment qrcodegen_makeBytes(const uint8_t data[], size_t len, uint8_t buf[]) { + assert(data != NULL || len == 0); + struct qrcodegen_Segment result; + result.mode = qrcodegen_Mode_BYTE; + result.bitLength = calcSegmentBitLength(result.mode, len); + assert(result.bitLength != -1); + result.numChars = (int)len; + if (len > 0) + memcpy(buf, data, len * sizeof(buf[0])); + result.data = buf; + return result; +} + + +// Public function - see documentation comment in header file. +struct qrcodegen_Segment qrcodegen_makeNumeric(const char *digits, uint8_t buf[]) { + assert(digits != NULL); + struct qrcodegen_Segment result; + size_t len = strlen(digits); + result.mode = qrcodegen_Mode_NUMERIC; + int bitLen = calcSegmentBitLength(result.mode, len); + assert(bitLen != -1); + result.numChars = (int)len; + if (bitLen > 0) + memset(buf, 0, ((size_t)bitLen + 7) / 8 * sizeof(buf[0])); + result.bitLength = 0; + + unsigned int accumData = 0; + int accumCount = 0; + for (; *digits != '\0'; digits++) { + char c = *digits; + assert('0' <= c && c <= '9'); + accumData = accumData * 10 + (unsigned int)(c - '0'); + accumCount++; + if (accumCount == 3) { + appendBitsToBuffer(accumData, 10, buf, &result.bitLength); + accumData = 0; + accumCount = 0; + } + } + if (accumCount > 0) // 1 or 2 digits remaining + appendBitsToBuffer(accumData, accumCount * 3 + 1, buf, &result.bitLength); + assert(result.bitLength == bitLen); + result.data = buf; + return result; +} + + +// Public function - see documentation comment in header file. +struct qrcodegen_Segment qrcodegen_makeAlphanumeric(const char *text, uint8_t buf[]) { + assert(text != NULL); + struct qrcodegen_Segment result; + size_t len = strlen(text); + result.mode = qrcodegen_Mode_ALPHANUMERIC; + int bitLen = calcSegmentBitLength(result.mode, len); + assert(bitLen != -1); + result.numChars = (int)len; + if (bitLen > 0) + memset(buf, 0, ((size_t)bitLen + 7) / 8 * sizeof(buf[0])); + result.bitLength = 0; + + unsigned int accumData = 0; + int accumCount = 0; + for (; *text != '\0'; text++) { + const char *temp = strchr(ALPHANUMERIC_CHARSET, *text); + assert(temp != NULL); + accumData = accumData * 45 + (unsigned int)(temp - ALPHANUMERIC_CHARSET); + accumCount++; + if (accumCount == 2) { + appendBitsToBuffer(accumData, 11, buf, &result.bitLength); + accumData = 0; + accumCount = 0; + } + } + if (accumCount > 0) // 1 character remaining + appendBitsToBuffer(accumData, 6, buf, &result.bitLength); + assert(result.bitLength == bitLen); + result.data = buf; + return result; +} + + +// Public function - see documentation comment in header file. +struct qrcodegen_Segment qrcodegen_makeEci(long assignVal, uint8_t buf[]) { + struct qrcodegen_Segment result; + result.mode = qrcodegen_Mode_ECI; + result.numChars = 0; + result.bitLength = 0; + if (assignVal < 0) + assert(false); + else if (assignVal < (1 << 7)) { + memset(buf, 0, 1 * sizeof(buf[0])); + appendBitsToBuffer(assignVal, 8, buf, &result.bitLength); + } else if (assignVal < (1 << 14)) { + memset(buf, 0, 2 * sizeof(buf[0])); + appendBitsToBuffer(2, 2, buf, &result.bitLength); + appendBitsToBuffer(assignVal, 14, buf, &result.bitLength); + } else if (assignVal < 1000000L) { + memset(buf, 0, 3 * sizeof(buf[0])); + appendBitsToBuffer(6, 3, buf, &result.bitLength); + appendBitsToBuffer(assignVal >> 10, 11, buf, &result.bitLength); + appendBitsToBuffer(assignVal & 0x3FF, 10, buf, &result.bitLength); + } else + assert(false); + result.data = buf; + return result; +} + + +// Calculates the number of bits needed to encode the given segments at the given version. +// Returns a non-negative number if successful. Otherwise returns -1 if a segment has too +// many characters to fit its length field, or the total bits exceeds INT16_MAX. +testable int getTotalBits(const struct qrcodegen_Segment segs[], size_t len, int version) { + assert(segs != NULL || len == 0); + long result = 0; + for (size_t i = 0; i < len; i++) { + int numChars = segs[i].numChars; + int bitLength = segs[i].bitLength; + assert(0 <= numChars && numChars <= INT16_MAX); + assert(0 <= bitLength && bitLength <= INT16_MAX); + int ccbits = numCharCountBits(segs[i].mode, version); + assert(0 <= ccbits && ccbits <= 16); + if (numChars >= (1L << ccbits)) + return -1; // The segment's length doesn't fit the field's bit width + result += 4L + ccbits + bitLength; + if (result > INT16_MAX) + return -1; // The sum might overflow an int type + } + assert(0 <= result && result <= INT16_MAX); + return (int)result; +} + + +// Returns the bit width of the character count field for a segment in the given mode +// in a QR Code at the given version number. The result is in the range [0, 16]. +static int numCharCountBits(enum qrcodegen_Mode mode, int version) { + assert(qrcodegen_VERSION_MIN <= version && version <= qrcodegen_VERSION_MAX); + int i = (version + 7) / 17; + switch (mode) { + case qrcodegen_Mode_NUMERIC : { static const int temp[] = {10, 12, 14}; return temp[i]; } + case qrcodegen_Mode_ALPHANUMERIC: { static const int temp[] = { 9, 11, 13}; return temp[i]; } + case qrcodegen_Mode_BYTE : { static const int temp[] = { 8, 16, 16}; return temp[i]; } + case qrcodegen_Mode_KANJI : { static const int temp[] = { 8, 10, 12}; return temp[i]; } + case qrcodegen_Mode_ECI : return 0; + default: assert(false); return -1; // Dummy value + } +} diff --git a/clients/common/qrcodegen.h b/clients/common/qrcodegen.h new file mode 100644 index 00000000..55e2bfec --- /dev/null +++ b/clients/common/qrcodegen.h @@ -0,0 +1,311 @@ +/* + * QR Code generator library (C) + * + * Copyright (c) Project Nayuki. (MIT License) + * https://www.nayuki.io/page/qr-code-generator-library + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * - The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * - The Software is provided "as is", without warranty of any kind, express or + * implied, including but not limited to the warranties of merchantability, + * fitness for a particular purpose and noninfringement. In no event shall the + * authors or copyright holders be liable for any claim, damages or other + * liability, whether in an action of contract, tort or otherwise, arising from, + * out of or in connection with the Software or the use or other dealings in the + * Software. + */ + +#pragma once + +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* + * This library creates QR Code symbols, which is a type of two-dimension barcode. + * Invented by Denso Wave and described in the ISO/IEC 18004 standard. + * A QR Code structure is an immutable square grid of black and white cells. + * The library provides functions to create a QR Code from text or binary data. + * The library covers the QR Code Model 2 specification, supporting all versions (sizes) + * from 1 to 40, all 4 error correction levels, and 4 character encoding modes. + * + * Ways to create a QR Code object: + * - High level: Take the payload data and call qrcodegen_encodeText() or qrcodegen_encodeBinary(). + * - Low level: Custom-make the list of segments and call + * qrcodegen_encodeSegments() or qrcodegen_encodeSegmentsAdvanced(). + * (Note that all ways require supplying the desired error correction level and various byte buffers.) + */ + + +/*---- Enum and struct types----*/ + +/* + * The error correction level in a QR Code symbol. + */ +enum qrcodegen_Ecc { + // Must be declared in ascending order of error protection + // so that an internal qrcodegen function works properly + qrcodegen_Ecc_LOW = 0 , // The QR Code can tolerate about 7% erroneous codewords + qrcodegen_Ecc_MEDIUM , // The QR Code can tolerate about 15% erroneous codewords + qrcodegen_Ecc_QUARTILE, // The QR Code can tolerate about 25% erroneous codewords + qrcodegen_Ecc_HIGH , // The QR Code can tolerate about 30% erroneous codewords +}; + + +/* + * The mask pattern used in a QR Code symbol. + */ +enum qrcodegen_Mask { + // A special value to tell the QR Code encoder to + // automatically select an appropriate mask pattern + qrcodegen_Mask_AUTO = -1, + // The eight actual mask patterns + qrcodegen_Mask_0 = 0, + qrcodegen_Mask_1, + qrcodegen_Mask_2, + qrcodegen_Mask_3, + qrcodegen_Mask_4, + qrcodegen_Mask_5, + qrcodegen_Mask_6, + qrcodegen_Mask_7, +}; + + +/* + * Describes how a segment's data bits are interpreted. + */ +enum qrcodegen_Mode { + qrcodegen_Mode_NUMERIC = 0x1, + qrcodegen_Mode_ALPHANUMERIC = 0x2, + qrcodegen_Mode_BYTE = 0x4, + qrcodegen_Mode_KANJI = 0x8, + qrcodegen_Mode_ECI = 0x7, +}; + + +/* + * A segment of character/binary/control data in a QR Code symbol. + * The mid-level way to create a segment is to take the payload data + * and call a factory function such as qrcodegen_makeNumeric(). + * The low-level way to create a segment is to custom-make the bit buffer + * and initialize a qrcodegen_Segment struct with appropriate values. + * Even in the most favorable conditions, a QR Code can only hold 7089 characters of data. + * Any segment longer than this is meaningless for the purpose of generating QR Codes. + * Moreover, the maximum allowed bit length is 32767 because + * the largest QR Code (version 40) has 31329 modules. + */ +struct qrcodegen_Segment { + // The mode indicator of this segment. + enum qrcodegen_Mode mode; + + // The length of this segment's unencoded data. Measured in characters for + // numeric/alphanumeric/kanji mode, bytes for byte mode, and 0 for ECI mode. + // Always zero or positive. Not the same as the data's bit length. + int numChars; + + // The data bits of this segment, packed in bitwise big endian. + // Can be null if the bit length is zero. + uint8_t *data; + + // The number of valid data bits used in the buffer. Requires + // 0 <= bitLength <= 32767, and bitLength <= (capacity of data array) * 8. + // The character count (numChars) must agree with the mode and the bit buffer length. + int bitLength; +}; + + + +/*---- Macro constants and functions ----*/ + +#define qrcodegen_VERSION_MIN 1 // The minimum version number supported in the QR Code Model 2 standard +#define qrcodegen_VERSION_MAX 40 // The maximum version number supported in the QR Code Model 2 standard + +// Calculates the number of bytes needed to store any QR Code up to and including the given version number, +// as a compile-time constant. For example, 'uint8_t buffer[qrcodegen_BUFFER_LEN_FOR_VERSION(25)];' +// can store any single QR Code from version 1 to 25 (inclusive). The result fits in an int (or int16). +// Requires qrcodegen_VERSION_MIN <= n <= qrcodegen_VERSION_MAX. +#define qrcodegen_BUFFER_LEN_FOR_VERSION(n) ((((n) * 4 + 17) * ((n) * 4 + 17) + 7) / 8 + 1) + +// The worst-case number of bytes needed to store one QR Code, up to and including +// version 40. This value equals 3918, which is just under 4 kilobytes. +// Use this more convenient value to avoid calculating tighter memory bounds for buffers. +#define qrcodegen_BUFFER_LEN_MAX qrcodegen_BUFFER_LEN_FOR_VERSION(qrcodegen_VERSION_MAX) + + + +/*---- Functions (high level) to generate QR Codes ----*/ + +/* + * Encodes the given text string to a QR Code, returning true if encoding succeeded. + * If the data is too long to fit in any version in the given range + * at the given ECC level, then false is returned. + * - The input text must be encoded in UTF-8 and contain no NULs. + * - The variables ecl and mask must correspond to enum constant values. + * - Requires 1 <= minVersion <= maxVersion <= 40. + * - The arrays tempBuffer and qrcode must each have a length + * of at least qrcodegen_BUFFER_LEN_FOR_VERSION(maxVersion). + * - After the function returns, tempBuffer contains no useful data. + * - If successful, the resulting QR Code may use numeric, + * alphanumeric, or byte mode to encode the text. + * - In the most optimistic case, a QR Code at version 40 with low ECC + * can hold any UTF-8 string up to 2953 bytes, or any alphanumeric string + * up to 4296 characters, or any digit string up to 7089 characters. + * These numbers represent the hard upper limit of the QR Code standard. + * - Please consult the QR Code specification for information on + * data capacities per version, ECC level, and text encoding mode. + */ +bool qrcodegen_encodeText(const char *text, uint8_t tempBuffer[], uint8_t qrcode[], + enum qrcodegen_Ecc ecl, int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl); + + +/* + * Encodes the given binary data to a QR Code, returning true if encoding succeeded. + * If the data is too long to fit in any version in the given range + * at the given ECC level, then false is returned. + * - The input array range dataAndTemp[0 : dataLen] should normally be + * valid UTF-8 text, but is not required by the QR Code standard. + * - The variables ecl and mask must correspond to enum constant values. + * - Requires 1 <= minVersion <= maxVersion <= 40. + * - The arrays dataAndTemp and qrcode must each have a length + * of at least qrcodegen_BUFFER_LEN_FOR_VERSION(maxVersion). + * - After the function returns, the contents of dataAndTemp may have changed, + * and does not represent useful data anymore. + * - If successful, the resulting QR Code will use byte mode to encode the data. + * - In the most optimistic case, a QR Code at version 40 with low ECC can hold any byte + * sequence up to length 2953. This is the hard upper limit of the QR Code standard. + * - Please consult the QR Code specification for information on + * data capacities per version, ECC level, and text encoding mode. + */ +bool qrcodegen_encodeBinary(uint8_t dataAndTemp[], size_t dataLen, uint8_t qrcode[], + enum qrcodegen_Ecc ecl, int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl); + + +/*---- Functions (low level) to generate QR Codes ----*/ + +/* + * Renders a QR Code representing the given segments at the given error correction level. + * The smallest possible QR Code version is automatically chosen for the output. Returns true if + * QR Code creation succeeded, or false if the data is too long to fit in any version. The ECC level + * of the result may be higher than the ecl argument if it can be done without increasing the version. + * This function allows the user to create a custom sequence of segments that switches + * between modes (such as alphanumeric and byte) to encode text in less space. + * This is a low-level API; the high-level API is qrcodegen_encodeText() and qrcodegen_encodeBinary(). + * To save memory, the segments' data buffers can alias/overlap tempBuffer, and will + * result in them being clobbered, but the QR Code output will still be correct. + * But the qrcode array must not overlap tempBuffer or any segment's data buffer. + */ +bool qrcodegen_encodeSegments(const struct qrcodegen_Segment segs[], size_t len, + enum qrcodegen_Ecc ecl, uint8_t tempBuffer[], uint8_t qrcode[]); + + +/* + * Renders a QR Code representing the given segments with the given encoding parameters. + * Returns true if QR Code creation succeeded, or false if the data is too long to fit in the range of versions. + * The smallest possible QR Code version within the given range is automatically + * chosen for the output. Iff boostEcl is true, then the ECC level of the result + * may be higher than the ecl argument if it can be done without increasing the + * version. The mask number is either between 0 to 7 (inclusive) to force that + * mask, or -1 to automatically choose an appropriate mask (which may be slow). + * This function allows the user to create a custom sequence of segments that switches + * between modes (such as alphanumeric and byte) to encode text in less space. + * This is a low-level API; the high-level API is qrcodegen_encodeText() and qrcodegen_encodeBinary(). + * To save memory, the segments' data buffers can alias/overlap tempBuffer, and will + * result in them being clobbered, but the QR Code output will still be correct. + * But the qrcode array must not overlap tempBuffer or any segment's data buffer. + */ +bool qrcodegen_encodeSegmentsAdvanced(const struct qrcodegen_Segment segs[], size_t len, enum qrcodegen_Ecc ecl, + int minVersion, int maxVersion, int mask, bool boostEcl, uint8_t tempBuffer[], uint8_t qrcode[]); + + +/* + * Tests whether the given string can be encoded as a segment in alphanumeric mode. + * A string is encodable iff each character is in the following set: 0 to 9, A to Z + * (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon. + */ +bool qrcodegen_isAlphanumeric(const char *text); + + +/* + * Tests whether the given string can be encoded as a segment in numeric mode. + * A string is encodable iff each character is in the range 0 to 9. + */ +bool qrcodegen_isNumeric(const char *text); + + +/* + * Returns the number of bytes (uint8_t) needed for the data buffer of a segment + * containing the given number of characters using the given mode. Notes: + * - Returns SIZE_MAX on failure, i.e. numChars > INT16_MAX or + * the number of needed bits exceeds INT16_MAX (i.e. 32767). + * - Otherwise, all valid results are in the range [0, ceil(INT16_MAX / 8)], i.e. at most 4096. + * - It is okay for the user to allocate more bytes for the buffer than needed. + * - For byte mode, numChars measures the number of bytes, not Unicode code points. + * - For ECI mode, numChars must be 0, and the worst-case number of bytes is returned. + * An actual ECI segment can have shorter data. For non-ECI modes, the result is exact. + */ +size_t qrcodegen_calcSegmentBufferSize(enum qrcodegen_Mode mode, size_t numChars); + + +/* + * Returns a segment representing the given binary data encoded in + * byte mode. All input byte arrays are acceptable. Any text string + * can be converted to UTF-8 bytes and encoded as a byte mode segment. + */ +struct qrcodegen_Segment qrcodegen_makeBytes(const uint8_t data[], size_t len, uint8_t buf[]); + + +/* + * Returns a segment representing the given string of decimal digits encoded in numeric mode. + */ +struct qrcodegen_Segment qrcodegen_makeNumeric(const char *digits, uint8_t buf[]); + + +/* + * Returns a segment representing the given text string encoded in alphanumeric mode. + * The characters allowed are: 0 to 9, A to Z (uppercase only), space, + * dollar, percent, asterisk, plus, hyphen, period, slash, colon. + */ +struct qrcodegen_Segment qrcodegen_makeAlphanumeric(const char *text, uint8_t buf[]); + + +/* + * Returns a segment representing an Extended Channel Interpretation + * (ECI) designator with the given assignment value. + */ +struct qrcodegen_Segment qrcodegen_makeEci(long assignVal, uint8_t buf[]); + + +/*---- Functions to extract raw data from QR Codes ----*/ + +/* + * Returns the side length of the given QR Code, assuming that encoding succeeded. + * The result is in the range [21, 177]. Note that the length of the array buffer + * is related to the side length - every 'uint8_t qrcode[]' must have length at least + * qrcodegen_BUFFER_LEN_FOR_VERSION(version), which equals ceil(size^2 / 8 + 1). + */ +int qrcodegen_getSize(const uint8_t qrcode[]); + + +/* + * Returns the color of the module (pixel) at the given coordinates, which is false + * for white or true for black. The top left corner has the coordinates (x=0, y=0). + * If the given coordinates are out of bounds, then false (white) is returned. + */ +bool qrcodegen_getModule(const uint8_t qrcode[], int x, int y); + + +#ifdef __cplusplus +} +#endif diff --git a/clients/common/settings-docs.h b/clients/common/settings-docs.h index b81cee71..f696ca82 100644 --- a/clients/common/settings-docs.h +++ b/clients/common/settings-docs.h @@ -24,7 +24,7 @@ #define DESCRIBE_DOC_NM_SETTING_WIRELESS_SECURITY_AUTH_ALG N_("When WEP is used (ie, key-mgmt = \"none\" or \"ieee8021x\") indicate the 802.11 authentication algorithm required by the AP here. One of \"open\" for Open System, \"shared\" for Shared Key, or \"leap\" for Cisco LEAP. When using Cisco LEAP (ie, key-mgmt = \"ieee8021x\" and auth-alg = \"leap\") the \"leap-username\" and \"leap-password\" properties must be specified.") #define DESCRIBE_DOC_NM_SETTING_WIRELESS_SECURITY_FILS N_("Indicates whether Fast Initial Link Setup (802.11ai) must be enabled for the connection. One of NM_SETTING_WIRELESS_SECURITY_FILS_DEFAULT (0) (use global default value), NM_SETTING_WIRELESS_SECURITY_FILS_DISABLE (1) (disable FILS), NM_SETTING_WIRELESS_SECURITY_FILS_OPTIONAL (2) (enable FILS if the supplicant and the access point support it) or NM_SETTING_WIRELESS_SECURITY_FILS_REQUIRED (3) (enable FILS and fail if not supported). When set to NM_SETTING_WIRELESS_SECURITY_FILS_DEFAULT (0) and no global default is set, FILS will be optionally enabled.") #define DESCRIBE_DOC_NM_SETTING_WIRELESS_SECURITY_GROUP N_("A list of group/broadcast encryption algorithms which prevents connections to Wi-Fi networks that do not utilize one of the algorithms in the list. For maximum compatibility leave this property empty. Each list element may be one of \"wep40\", \"wep104\", \"tkip\", or \"ccmp\".") -#define DESCRIBE_DOC_NM_SETTING_WIRELESS_SECURITY_KEY_MGMT N_("Key management used for the connection. One of \"none\" (WEP), \"ieee8021x\" (Dynamic WEP), \"wpa-none\" (Ad-Hoc WPA-PSK), \"wpa-psk\" (infrastructure WPA-PSK), \"sae\" (SAE) or \"wpa-eap\" (WPA-Enterprise). This property must be set for any Wi-Fi connection that uses security.") +#define DESCRIBE_DOC_NM_SETTING_WIRELESS_SECURITY_KEY_MGMT N_("Key management used for the connection. One of \"none\" (WEP), \"ieee8021x\" (Dynamic WEP), \"wpa-psk\" (infrastructure WPA-PSK), \"sae\" (SAE) or \"wpa-eap\" (WPA-Enterprise). This property must be set for any Wi-Fi connection that uses security.") #define DESCRIBE_DOC_NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD N_("The login password for legacy LEAP connections (ie, key-mgmt = \"ieee8021x\" and auth-alg = \"leap\").") #define DESCRIBE_DOC_NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD_FLAGS N_("Flags indicating how to handle the \"leap-password\" property.") #define DESCRIBE_DOC_NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME N_("The login username for legacy LEAP connections (ie, key-mgmt = \"ieee8021x\" and auth-alg = \"leap\").") @@ -65,8 +65,8 @@ #define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE1_PEAPLABEL N_("Forces use of the new PEAP label during key derivation. Some RADIUS servers may require forcing the new PEAP label to interoperate with PEAPv1. Set to \"1\" to force use of the new PEAP label. See the wpa_supplicant documentation for more details.") #define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE1_PEAPVER N_("Forces which PEAP version is used when PEAP is set as the EAP method in the \"eap\" property. When unset, the version reported by the server will be used. Sometimes when using older RADIUS servers, it is necessary to force the client to use a particular PEAP version. To do so, this property may be set to \"0\" or \"1\" to force that specific PEAP version.") #define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES N_("List of strings to be matched against the altSubjectName of the certificate presented by the authentication server during the inner \"phase 2\" authentication. If the list is empty, no verification of the server certificate's altSubjectName is performed.") -#define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE2_AUTH N_("Specifies the allowed \"phase 2\" inner non-EAP authentication methods when an EAP method that uses an inner TLS tunnel is specified in the \"eap\" property. Recognized non-EAP \"phase 2\" methods are \"pap\", \"chap\", \"mschap\", \"mschapv2\", \"gtc\", \"otp\", \"md5\", and \"tls\". Each \"phase 2\" inner method requires specific parameters for successful authentication; see the wpa_supplicant documentation for more details.") -#define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE2_AUTHEAP N_("Specifies the allowed \"phase 2\" inner EAP-based authentication methods when an EAP method that uses an inner TLS tunnel is specified in the \"eap\" property. Recognized EAP-based \"phase 2\" methods are \"md5\", \"mschapv2\", \"otp\", \"gtc\", and \"tls\". Each \"phase 2\" inner method requires specific parameters for successful authentication; see the wpa_supplicant documentation for more details.") +#define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE2_AUTH N_("Specifies the allowed \"phase 2\" inner non-EAP authentication method when an EAP method that uses an inner TLS tunnel is specified in the \"eap\" property. Recognized non-EAP \"phase 2\" methods are \"pap\", \"chap\", \"mschap\", \"mschapv2\", \"gtc\", \"otp\", \"md5\", and \"tls\". Each \"phase 2\" inner method requires specific parameters for successful authentication; see the wpa_supplicant documentation for more details.") +#define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE2_AUTHEAP N_("Specifies the allowed \"phase 2\" inner EAP-based authentication method when an EAP method that uses an inner TLS tunnel is specified in the \"eap\" property. Recognized EAP-based \"phase 2\" methods are \"md5\", \"mschapv2\", \"otp\", \"gtc\", and \"tls\". Each \"phase 2\" inner method requires specific parameters for successful authentication; see the wpa_supplicant documentation for more details.") #define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE2_CA_CERT N_("Contains the \"phase 2\" CA certificate if used by the EAP method specified in the \"phase2-auth\" or \"phase2-autheap\" properties. Certificate data is specified using a \"scheme\"; two are currently supported: blob and path. When using the blob scheme (which is backwards compatible with NM 0.7.x) this property should be set to the certificate's DER encoded data. When using the path scheme, this property should be set to the full UTF-8 encoded path of the certificate, prefixed with the string \"file://\" and ending with a terminating NUL byte. This property can be unset even if the EAP method supports CA certificates, but this allows man-in-the-middle attacks and is NOT recommended.") #define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE2_CA_CERT_PASSWORD N_("The password used to access the \"phase2\" CA certificate stored in \"phase2-ca-cert\" property. Only makes sense if the certificate is stored on a PKCS#11 token that requires a login.") #define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE2_CA_CERT_PASSWORD_FLAGS N_("Flags indicating how to handle the \"phase2-ca-cert-password\" property.") @@ -171,6 +171,7 @@ #define DESCRIBE_DOC_NM_SETTING_DCB_PRIORITY_STRICT_BANDWIDTH N_("An array of 8 boolean values, where the array index corresponds to the User Priority (0 - 7) and the value indicates whether or not the priority may use all of the bandwidth allocated to its assigned group.") #define DESCRIBE_DOC_NM_SETTING_DCB_PRIORITY_TRAFFIC_CLASS N_("An array of 8 uint values, where the array index corresponds to the User Priority (0 - 7) and the value indicates the traffic class (0 - 7) to which the priority is mapped.") #define DESCRIBE_DOC_NM_SETTING_GSM_APN N_("The GPRS Access Point Name specifying the APN used when establishing a data session with the GSM-based network. The APN often determines how the user will be billed for their network usage and whether the user has access to the Internet or just a provider-specific walled-garden, so it is important to use the correct APN for the user's mobile broadband plan. The APN may only be composed of the characters a-z, 0-9, ., and - per GSM 03.60 Section 14.9.") +#define DESCRIBE_DOC_NM_SETTING_GSM_AUTO_CONFIG N_("When TRUE, the settings such as APN, username, or password will default to values that match the network the modem will register to in the Mobile Broadband Provider database.") #define DESCRIBE_DOC_NM_SETTING_GSM_DEVICE_ID N_("The device unique identifier (as given by the WWAN management service) which this connection applies to. If given, the connection will only apply to the specified device.") #define DESCRIBE_DOC_NM_SETTING_GSM_HOME_ONLY N_("When TRUE, only connections to the home network will be allowed. Connections to roaming networks will not be made.") #define DESCRIBE_DOC_NM_SETTING_GSM_MTU N_("If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple frames.") @@ -206,6 +207,8 @@ #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID N_("A string sent to the DHCP server to identify the local machine which the DHCP server may use to customize the DHCP lease and options. When the property is a hex string ('aa:bb:cc') it is interpreted as a binary client ID, in which case the first byte is assumed to be the 'type' field as per RFC 2132 section 9.14 and the remaining bytes may be an hardware address (e.g. '01:xx:xx:xx:xx:xx:xx' where 1 is the Ethernet ARP type and the rest is a MAC address). If the property is not a hex string it is considered as a non-hardware-address client ID and the 'type' field is set to 0. The special values \"mac\" and \"perm-mac\" are supported, which use the current or permanent MAC address of the device to generate a client identifier with type ethernet (01). Currently, these options only work for ethernet type of links. The special value \"duid\" generates a RFC4361-compliant client identifier based on a hash of the interface name as IAID and /etc/machine-id. The special value \"stable\" is supported to generate a type 0 client identifier based on the stable-id (see connection.stable-id) and a per-host key. If you set the stable-id, you may want to include the \"${DEVICE}\" or \"${MAC}\" specifier to get a per-device key. If unset, a globally configured default is used. If still unset, the default depends on the DHCP plugin.") #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_FQDN N_("If the \"dhcp-send-hostname\" property is TRUE, then the specified FQDN will be sent to the DHCP server when acquiring a lease. This property and \"dhcp-hostname\" are mutually exclusive and cannot be set at the same time.") #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME N_("If the \"dhcp-send-hostname\" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. This property and \"dhcp-fqdn\" are mutually exclusive and cannot be set at the same time.") +#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME_FLAGS N_("Flags for the DHCP hostname and FQDN. Currently this property only includes flags to control the FQDN flags set in the DHCP FQDN option. Supported FQDN flags are NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE (0x1), NM_DHCP_HOSTNAME_FLAG_FQDN_ENCODED (0x2) and NM_DHCP_HOSTNAME_FLAG_FQDN_NO_UPDATE (0x4). When no FQDN flag is set and NM_DHCP_HOSTNAME_FLAG_FQDN_CLEAR_FLAGS (0x8) is set, the DHCP FQDN option will contain no flag. Otherwise, if no FQDN flag is set and NM_DHCP_HOSTNAME_FLAG_FQDN_CLEAR_FLAGS (0x8) is not set, the standard FQDN flags are set in the request: NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE (0x1), NM_DHCP_HOSTNAME_FLAG_FQDN_ENCODED (0x2) for IPv4 and NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE (0x1) for IPv6. When this property is set to the default value NM_DHCP_HOSTNAME_FLAG_NONE (0x0), a global default is looked up in NetworkManager configuration. If that value is unset or also NM_DHCP_HOSTNAME_FLAG_NONE (0x0), then the standard FQDN flags described above are sent in the DHCP requests.") +#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_IAID N_("A string containing the \"Identity Association Identifier\" (IAID) used by the DHCP client. The property is a 32-bit decimal value or a special value among \"mac\", \"perm-mac\", \"ifname\" and \"stable\". When set to \"mac\" (or \"perm-mac\"), the last 4 bytes of the current (or permanent) MAC address are used as IAID. When set to \"ifname\", the IAID is computed by hashing the interface name. The special value \"stable\" can be used to generate an IAID based on the stable-id (see connection.stable-id), a per-host key and the interface name. When the property is unset, the value from global configuration is used; if no global default is set then the IAID is assumed to be \"ifname\". Note that at the moment this property is ignored for IPv6 by dhclient, which always derives the IAID from the MAC address.") #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME N_("If TRUE, a hostname is sent to the DHCP server when acquiring a lease. Some DHCP servers use this hostname to update DNS databases, essentially providing a static hostname for the computer. If the \"dhcp-hostname\" property is NULL and this property is TRUE, the current persistent hostname of the computer is sent.") #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT N_("A timeout for a DHCP transaction in seconds.") #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DNS N_("Array of IP addresses of DNS servers.") @@ -226,6 +229,8 @@ #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.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_DUID N_("A string containing the DHCPv6 Unique Identifier (DUID) used by the dhcp client to identify itself to DHCPv6 servers (RFC 3315). The DUID is carried in the Client Identifier option. If the property is a hex string ('aa:bb:cc') it is interpreted as a binary DUID and filled as an opaque value in the Client Identifier option. The special value \"lease\" will retrieve the DUID previously used from the lease file belonging to the connection. If no DUID is found and \"dhclient\" is the configured dhcp client, the DUID is searched in the system-wide dhclient lease file. If still no DUID is found, or another dhcp client is used, a global and permanent DUID-UUID (RFC 6355) will be generated based on the machine-id. The special values \"llt\" and \"ll\" will generate a DUID of type LLT or LL (see RFC 3315) based on the current MAC address of the device. In order to try providing a stable DUID-LLT, the time field will contain a constant timestamp that is used globally (for all profiles) and persisted to disk. The special values \"stable-llt\", \"stable-ll\" and \"stable-uuid\" will generate a DUID of the corresponding type, derived from the connection's stable-id and a per-host unique key. You may want to include the \"${DEVICE}\" or \"${MAC}\" specifier in the stable-id, in case this profile gets activated on multiple devices. So, the link-layer address of \"stable-ll\" and \"stable-llt\" will be a generated address derived from the stable id. The DUID-LLT time value in the \"stable-llt\" option will be picked among a static timespan of three years (the upper bound of the interval is the same constant timestamp used in \"llt\"). When the property is unset, the global value provided for \"ipv6.dhcp-duid\" is used. If no global value is provided, the default \"lease\" value is assumed.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_HOSTNAME N_("If the \"dhcp-send-hostname\" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. This property and \"dhcp-fqdn\" are mutually exclusive and cannot be set at the same time.") +#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_HOSTNAME_FLAGS N_("Flags for the DHCP hostname and FQDN. Currently this property only includes flags to control the FQDN flags set in the DHCP FQDN option. Supported FQDN flags are NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE (0x1), NM_DHCP_HOSTNAME_FLAG_FQDN_ENCODED (0x2) and NM_DHCP_HOSTNAME_FLAG_FQDN_NO_UPDATE (0x4). When no FQDN flag is set and NM_DHCP_HOSTNAME_FLAG_FQDN_CLEAR_FLAGS (0x8) is set, the DHCP FQDN option will contain no flag. Otherwise, if no FQDN flag is set and NM_DHCP_HOSTNAME_FLAG_FQDN_CLEAR_FLAGS (0x8) is not set, the standard FQDN flags are set in the request: NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE (0x1), NM_DHCP_HOSTNAME_FLAG_FQDN_ENCODED (0x2) for IPv4 and NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE (0x1) for IPv6. When this property is set to the default value NM_DHCP_HOSTNAME_FLAG_NONE (0x0), a global default is looked up in NetworkManager configuration. If that value is unset or also NM_DHCP_HOSTNAME_FLAG_NONE (0x0), then the standard FQDN flags described above are sent in the DHCP requests.") +#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_IAID N_("A string containing the \"Identity Association Identifier\" (IAID) used by the DHCP client. The property is a 32-bit decimal value or a special value among \"mac\", \"perm-mac\", \"ifname\" and \"stable\". When set to \"mac\" (or \"perm-mac\"), the last 4 bytes of the current (or permanent) MAC address are used as IAID. When set to \"ifname\", the IAID is computed by hashing the interface name. The special value \"stable\" can be used to generate an IAID based on the stable-id (see connection.stable-id), a per-host key and the interface name. When the property is unset, the value from global configuration is used; if no global default is set then the IAID is assumed to be \"ifname\". Note that at the moment this property is ignored for IPv6 by dhclient, which always derives the IAID from the MAC address.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_SEND_HOSTNAME N_("If TRUE, a hostname is sent to the DHCP server when acquiring a lease. Some DHCP servers use this hostname to update DNS databases, essentially providing a static hostname for the computer. If the \"dhcp-hostname\" property is NULL and this property is TRUE, the current persistent hostname of the computer is sent.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_TIMEOUT N_("A timeout for a DHCP transaction in seconds.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DNS N_("Array of IP addresses of DNS servers.") diff --git a/clients/common/settings-docs.h.in b/clients/common/settings-docs.h.in index b81cee71..f696ca82 100644 --- a/clients/common/settings-docs.h.in +++ b/clients/common/settings-docs.h.in @@ -24,7 +24,7 @@ #define DESCRIBE_DOC_NM_SETTING_WIRELESS_SECURITY_AUTH_ALG N_("When WEP is used (ie, key-mgmt = \"none\" or \"ieee8021x\") indicate the 802.11 authentication algorithm required by the AP here. One of \"open\" for Open System, \"shared\" for Shared Key, or \"leap\" for Cisco LEAP. When using Cisco LEAP (ie, key-mgmt = \"ieee8021x\" and auth-alg = \"leap\") the \"leap-username\" and \"leap-password\" properties must be specified.") #define DESCRIBE_DOC_NM_SETTING_WIRELESS_SECURITY_FILS N_("Indicates whether Fast Initial Link Setup (802.11ai) must be enabled for the connection. One of NM_SETTING_WIRELESS_SECURITY_FILS_DEFAULT (0) (use global default value), NM_SETTING_WIRELESS_SECURITY_FILS_DISABLE (1) (disable FILS), NM_SETTING_WIRELESS_SECURITY_FILS_OPTIONAL (2) (enable FILS if the supplicant and the access point support it) or NM_SETTING_WIRELESS_SECURITY_FILS_REQUIRED (3) (enable FILS and fail if not supported). When set to NM_SETTING_WIRELESS_SECURITY_FILS_DEFAULT (0) and no global default is set, FILS will be optionally enabled.") #define DESCRIBE_DOC_NM_SETTING_WIRELESS_SECURITY_GROUP N_("A list of group/broadcast encryption algorithms which prevents connections to Wi-Fi networks that do not utilize one of the algorithms in the list. For maximum compatibility leave this property empty. Each list element may be one of \"wep40\", \"wep104\", \"tkip\", or \"ccmp\".") -#define DESCRIBE_DOC_NM_SETTING_WIRELESS_SECURITY_KEY_MGMT N_("Key management used for the connection. One of \"none\" (WEP), \"ieee8021x\" (Dynamic WEP), \"wpa-none\" (Ad-Hoc WPA-PSK), \"wpa-psk\" (infrastructure WPA-PSK), \"sae\" (SAE) or \"wpa-eap\" (WPA-Enterprise). This property must be set for any Wi-Fi connection that uses security.") +#define DESCRIBE_DOC_NM_SETTING_WIRELESS_SECURITY_KEY_MGMT N_("Key management used for the connection. One of \"none\" (WEP), \"ieee8021x\" (Dynamic WEP), \"wpa-psk\" (infrastructure WPA-PSK), \"sae\" (SAE) or \"wpa-eap\" (WPA-Enterprise). This property must be set for any Wi-Fi connection that uses security.") #define DESCRIBE_DOC_NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD N_("The login password for legacy LEAP connections (ie, key-mgmt = \"ieee8021x\" and auth-alg = \"leap\").") #define DESCRIBE_DOC_NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD_FLAGS N_("Flags indicating how to handle the \"leap-password\" property.") #define DESCRIBE_DOC_NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME N_("The login username for legacy LEAP connections (ie, key-mgmt = \"ieee8021x\" and auth-alg = \"leap\").") @@ -65,8 +65,8 @@ #define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE1_PEAPLABEL N_("Forces use of the new PEAP label during key derivation. Some RADIUS servers may require forcing the new PEAP label to interoperate with PEAPv1. Set to \"1\" to force use of the new PEAP label. See the wpa_supplicant documentation for more details.") #define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE1_PEAPVER N_("Forces which PEAP version is used when PEAP is set as the EAP method in the \"eap\" property. When unset, the version reported by the server will be used. Sometimes when using older RADIUS servers, it is necessary to force the client to use a particular PEAP version. To do so, this property may be set to \"0\" or \"1\" to force that specific PEAP version.") #define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES N_("List of strings to be matched against the altSubjectName of the certificate presented by the authentication server during the inner \"phase 2\" authentication. If the list is empty, no verification of the server certificate's altSubjectName is performed.") -#define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE2_AUTH N_("Specifies the allowed \"phase 2\" inner non-EAP authentication methods when an EAP method that uses an inner TLS tunnel is specified in the \"eap\" property. Recognized non-EAP \"phase 2\" methods are \"pap\", \"chap\", \"mschap\", \"mschapv2\", \"gtc\", \"otp\", \"md5\", and \"tls\". Each \"phase 2\" inner method requires specific parameters for successful authentication; see the wpa_supplicant documentation for more details.") -#define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE2_AUTHEAP N_("Specifies the allowed \"phase 2\" inner EAP-based authentication methods when an EAP method that uses an inner TLS tunnel is specified in the \"eap\" property. Recognized EAP-based \"phase 2\" methods are \"md5\", \"mschapv2\", \"otp\", \"gtc\", and \"tls\". Each \"phase 2\" inner method requires specific parameters for successful authentication; see the wpa_supplicant documentation for more details.") +#define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE2_AUTH N_("Specifies the allowed \"phase 2\" inner non-EAP authentication method when an EAP method that uses an inner TLS tunnel is specified in the \"eap\" property. Recognized non-EAP \"phase 2\" methods are \"pap\", \"chap\", \"mschap\", \"mschapv2\", \"gtc\", \"otp\", \"md5\", and \"tls\". Each \"phase 2\" inner method requires specific parameters for successful authentication; see the wpa_supplicant documentation for more details.") +#define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE2_AUTHEAP N_("Specifies the allowed \"phase 2\" inner EAP-based authentication method when an EAP method that uses an inner TLS tunnel is specified in the \"eap\" property. Recognized EAP-based \"phase 2\" methods are \"md5\", \"mschapv2\", \"otp\", \"gtc\", and \"tls\". Each \"phase 2\" inner method requires specific parameters for successful authentication; see the wpa_supplicant documentation for more details.") #define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE2_CA_CERT N_("Contains the \"phase 2\" CA certificate if used by the EAP method specified in the \"phase2-auth\" or \"phase2-autheap\" properties. Certificate data is specified using a \"scheme\"; two are currently supported: blob and path. When using the blob scheme (which is backwards compatible with NM 0.7.x) this property should be set to the certificate's DER encoded data. When using the path scheme, this property should be set to the full UTF-8 encoded path of the certificate, prefixed with the string \"file://\" and ending with a terminating NUL byte. This property can be unset even if the EAP method supports CA certificates, but this allows man-in-the-middle attacks and is NOT recommended.") #define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE2_CA_CERT_PASSWORD N_("The password used to access the \"phase2\" CA certificate stored in \"phase2-ca-cert\" property. Only makes sense if the certificate is stored on a PKCS#11 token that requires a login.") #define DESCRIBE_DOC_NM_SETTING_802_1X_PHASE2_CA_CERT_PASSWORD_FLAGS N_("Flags indicating how to handle the \"phase2-ca-cert-password\" property.") @@ -171,6 +171,7 @@ #define DESCRIBE_DOC_NM_SETTING_DCB_PRIORITY_STRICT_BANDWIDTH N_("An array of 8 boolean values, where the array index corresponds to the User Priority (0 - 7) and the value indicates whether or not the priority may use all of the bandwidth allocated to its assigned group.") #define DESCRIBE_DOC_NM_SETTING_DCB_PRIORITY_TRAFFIC_CLASS N_("An array of 8 uint values, where the array index corresponds to the User Priority (0 - 7) and the value indicates the traffic class (0 - 7) to which the priority is mapped.") #define DESCRIBE_DOC_NM_SETTING_GSM_APN N_("The GPRS Access Point Name specifying the APN used when establishing a data session with the GSM-based network. The APN often determines how the user will be billed for their network usage and whether the user has access to the Internet or just a provider-specific walled-garden, so it is important to use the correct APN for the user's mobile broadband plan. The APN may only be composed of the characters a-z, 0-9, ., and - per GSM 03.60 Section 14.9.") +#define DESCRIBE_DOC_NM_SETTING_GSM_AUTO_CONFIG N_("When TRUE, the settings such as APN, username, or password will default to values that match the network the modem will register to in the Mobile Broadband Provider database.") #define DESCRIBE_DOC_NM_SETTING_GSM_DEVICE_ID N_("The device unique identifier (as given by the WWAN management service) which this connection applies to. If given, the connection will only apply to the specified device.") #define DESCRIBE_DOC_NM_SETTING_GSM_HOME_ONLY N_("When TRUE, only connections to the home network will be allowed. Connections to roaming networks will not be made.") #define DESCRIBE_DOC_NM_SETTING_GSM_MTU N_("If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple frames.") @@ -206,6 +207,8 @@ #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID N_("A string sent to the DHCP server to identify the local machine which the DHCP server may use to customize the DHCP lease and options. When the property is a hex string ('aa:bb:cc') it is interpreted as a binary client ID, in which case the first byte is assumed to be the 'type' field as per RFC 2132 section 9.14 and the remaining bytes may be an hardware address (e.g. '01:xx:xx:xx:xx:xx:xx' where 1 is the Ethernet ARP type and the rest is a MAC address). If the property is not a hex string it is considered as a non-hardware-address client ID and the 'type' field is set to 0. The special values \"mac\" and \"perm-mac\" are supported, which use the current or permanent MAC address of the device to generate a client identifier with type ethernet (01). Currently, these options only work for ethernet type of links. The special value \"duid\" generates a RFC4361-compliant client identifier based on a hash of the interface name as IAID and /etc/machine-id. The special value \"stable\" is supported to generate a type 0 client identifier based on the stable-id (see connection.stable-id) and a per-host key. If you set the stable-id, you may want to include the \"${DEVICE}\" or \"${MAC}\" specifier to get a per-device key. If unset, a globally configured default is used. If still unset, the default depends on the DHCP plugin.") #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_FQDN N_("If the \"dhcp-send-hostname\" property is TRUE, then the specified FQDN will be sent to the DHCP server when acquiring a lease. This property and \"dhcp-hostname\" are mutually exclusive and cannot be set at the same time.") #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME N_("If the \"dhcp-send-hostname\" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. This property and \"dhcp-fqdn\" are mutually exclusive and cannot be set at the same time.") +#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME_FLAGS N_("Flags for the DHCP hostname and FQDN. Currently this property only includes flags to control the FQDN flags set in the DHCP FQDN option. Supported FQDN flags are NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE (0x1), NM_DHCP_HOSTNAME_FLAG_FQDN_ENCODED (0x2) and NM_DHCP_HOSTNAME_FLAG_FQDN_NO_UPDATE (0x4). When no FQDN flag is set and NM_DHCP_HOSTNAME_FLAG_FQDN_CLEAR_FLAGS (0x8) is set, the DHCP FQDN option will contain no flag. Otherwise, if no FQDN flag is set and NM_DHCP_HOSTNAME_FLAG_FQDN_CLEAR_FLAGS (0x8) is not set, the standard FQDN flags are set in the request: NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE (0x1), NM_DHCP_HOSTNAME_FLAG_FQDN_ENCODED (0x2) for IPv4 and NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE (0x1) for IPv6. When this property is set to the default value NM_DHCP_HOSTNAME_FLAG_NONE (0x0), a global default is looked up in NetworkManager configuration. If that value is unset or also NM_DHCP_HOSTNAME_FLAG_NONE (0x0), then the standard FQDN flags described above are sent in the DHCP requests.") +#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_IAID N_("A string containing the \"Identity Association Identifier\" (IAID) used by the DHCP client. The property is a 32-bit decimal value or a special value among \"mac\", \"perm-mac\", \"ifname\" and \"stable\". When set to \"mac\" (or \"perm-mac\"), the last 4 bytes of the current (or permanent) MAC address are used as IAID. When set to \"ifname\", the IAID is computed by hashing the interface name. The special value \"stable\" can be used to generate an IAID based on the stable-id (see connection.stable-id), a per-host key and the interface name. When the property is unset, the value from global configuration is used; if no global default is set then the IAID is assumed to be \"ifname\". Note that at the moment this property is ignored for IPv6 by dhclient, which always derives the IAID from the MAC address.") #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME N_("If TRUE, a hostname is sent to the DHCP server when acquiring a lease. Some DHCP servers use this hostname to update DNS databases, essentially providing a static hostname for the computer. If the \"dhcp-hostname\" property is NULL and this property is TRUE, the current persistent hostname of the computer is sent.") #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT N_("A timeout for a DHCP transaction in seconds.") #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DNS N_("Array of IP addresses of DNS servers.") @@ -226,6 +229,8 @@ #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.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_DUID N_("A string containing the DHCPv6 Unique Identifier (DUID) used by the dhcp client to identify itself to DHCPv6 servers (RFC 3315). The DUID is carried in the Client Identifier option. If the property is a hex string ('aa:bb:cc') it is interpreted as a binary DUID and filled as an opaque value in the Client Identifier option. The special value \"lease\" will retrieve the DUID previously used from the lease file belonging to the connection. If no DUID is found and \"dhclient\" is the configured dhcp client, the DUID is searched in the system-wide dhclient lease file. If still no DUID is found, or another dhcp client is used, a global and permanent DUID-UUID (RFC 6355) will be generated based on the machine-id. The special values \"llt\" and \"ll\" will generate a DUID of type LLT or LL (see RFC 3315) based on the current MAC address of the device. In order to try providing a stable DUID-LLT, the time field will contain a constant timestamp that is used globally (for all profiles) and persisted to disk. The special values \"stable-llt\", \"stable-ll\" and \"stable-uuid\" will generate a DUID of the corresponding type, derived from the connection's stable-id and a per-host unique key. You may want to include the \"${DEVICE}\" or \"${MAC}\" specifier in the stable-id, in case this profile gets activated on multiple devices. So, the link-layer address of \"stable-ll\" and \"stable-llt\" will be a generated address derived from the stable id. The DUID-LLT time value in the \"stable-llt\" option will be picked among a static timespan of three years (the upper bound of the interval is the same constant timestamp used in \"llt\"). When the property is unset, the global value provided for \"ipv6.dhcp-duid\" is used. If no global value is provided, the default \"lease\" value is assumed.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_HOSTNAME N_("If the \"dhcp-send-hostname\" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. This property and \"dhcp-fqdn\" are mutually exclusive and cannot be set at the same time.") +#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_HOSTNAME_FLAGS N_("Flags for the DHCP hostname and FQDN. Currently this property only includes flags to control the FQDN flags set in the DHCP FQDN option. Supported FQDN flags are NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE (0x1), NM_DHCP_HOSTNAME_FLAG_FQDN_ENCODED (0x2) and NM_DHCP_HOSTNAME_FLAG_FQDN_NO_UPDATE (0x4). When no FQDN flag is set and NM_DHCP_HOSTNAME_FLAG_FQDN_CLEAR_FLAGS (0x8) is set, the DHCP FQDN option will contain no flag. Otherwise, if no FQDN flag is set and NM_DHCP_HOSTNAME_FLAG_FQDN_CLEAR_FLAGS (0x8) is not set, the standard FQDN flags are set in the request: NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE (0x1), NM_DHCP_HOSTNAME_FLAG_FQDN_ENCODED (0x2) for IPv4 and NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE (0x1) for IPv6. When this property is set to the default value NM_DHCP_HOSTNAME_FLAG_NONE (0x0), a global default is looked up in NetworkManager configuration. If that value is unset or also NM_DHCP_HOSTNAME_FLAG_NONE (0x0), then the standard FQDN flags described above are sent in the DHCP requests.") +#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_IAID N_("A string containing the \"Identity Association Identifier\" (IAID) used by the DHCP client. The property is a 32-bit decimal value or a special value among \"mac\", \"perm-mac\", \"ifname\" and \"stable\". When set to \"mac\" (or \"perm-mac\"), the last 4 bytes of the current (or permanent) MAC address are used as IAID. When set to \"ifname\", the IAID is computed by hashing the interface name. The special value \"stable\" can be used to generate an IAID based on the stable-id (see connection.stable-id), a per-host key and the interface name. When the property is unset, the value from global configuration is used; if no global default is set then the IAID is assumed to be \"ifname\". Note that at the moment this property is ignored for IPv6 by dhclient, which always derives the IAID from the MAC address.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_SEND_HOSTNAME N_("If TRUE, a hostname is sent to the DHCP server when acquiring a lease. Some DHCP servers use this hostname to update DNS databases, essentially providing a static hostname for the computer. If the \"dhcp-hostname\" property is NULL and this property is TRUE, the current persistent hostname of the computer is sent.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_TIMEOUT N_("A timeout for a DHCP transaction in seconds.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DNS N_("Array of IP addresses of DNS servers.") diff --git a/clients/common/tests/meson.build b/clients/common/tests/meson.build index 624dd89c..479cb781 100644 --- a/clients/common/tests/meson.build +++ b/clients/common/tests/meson.build @@ -1,43 +1,43 @@ +common_c_flags = clients_c_flags + ['-DNETWORKMANAGER_COMPILATION_TEST'] + test_name = 'test-clients-common' +deps = [ + libnmc_base_dep, + libnmc_dep, +] + exe = executable( test_name, test_name + '.c', - dependencies: [ - libnm_dep, - libnmc_dep, - libnmc_base_dep, - libnm_core_dep, - ], - c_args: clients_cflags + [ - '-DNETWORKMANAGER_COMPILATION_TEST', - ], + dependencies: deps, + c_args: common_c_flags, ) test( - test_name, + 'clients/common/tests/' + test_name, test_script, args: test_args + [exe.full_path()], ) -############################################################################### +test_name = 'test-libnm-core-aux' + +deps = [ + libnm_dep, + libnm_libnm_core_aux_dep, + libnm_nm_default_dep, +] exe = executable( - 'test-libnm-core-aux', - [ 'test-libnm-core-aux.c', ], - c_args: [ - '-DNETWORKMANAGER_COMPILATION_TEST', - '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT', - ], - dependencies: [ - libnm_dep, - shared_nm_libnm_core_aux_dep, - shared_nm_libnm_core_intern_dep, - ], + test_name, + test_name + '.c', + dependencies: deps, + c_args: common_c_flags, + link_with: libnm_systemd_logging_stub, ) test( - 'clients/common/tests/test-libnm-core-aux', - test_script, - args: test_args + [exe.full_path()] + 'clients/common/tests/' + test_name, + test_script, + args: test_args + [exe.full_path()] ) diff --git a/clients/common/tests/test-clients-common.c b/clients/common/tests/test-clients-common.c index 75233acd..a5d803df 100644 --- a/clients/common/tests/test-clients-common.c +++ b/clients/common/tests/test-clients-common.c @@ -1,19 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright 2017 Red Hat, Inc. + * Copyright (C) 2017 Red Hat, Inc. */ #include "nm-default.h" diff --git a/clients/common/tests/test-libnm-core-aux.c b/clients/common/tests/test-libnm-core-aux.c index 609a688c..7acbc6e1 100644 --- a/clients/common/tests/test-libnm-core-aux.c +++ b/clients/common/tests/test-libnm-core-aux.c @@ -1,20 +1,6 @@ +// SPDX-License-Identifier: LGPL-2.1+ /* - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA. - * - * Copyright 2019 Red Hat, Inc. + * Copyright (C) 2019 Red Hat, Inc. */ #include "nm-default.h" |