From e96d74409128c6a977e31f24fad9b267d2feb9a1 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Fri, 9 Aug 2024 18:57:15 +0200 Subject: New upstream version 1.48.8 --- src/nmcli/connections.c | 276 ++++++++++++------------ src/nmcli/devices.c | 30 +-- src/nmcli/devices.h | 2 +- src/nmcli/gen-metadata-nm-settings-nmcli.xml.in | 8 +- src/nmcli/general.c | 2 +- src/nmcli/nmcli.c | 2 +- 6 files changed, 161 insertions(+), 159 deletions(-) (limited to 'src/nmcli') diff --git a/src/nmcli/connections.c b/src/nmcli/connections.c index 72a1fc18..9eac7b9a 100644 --- a/src/nmcli/connections.c +++ b/src/nmcli/connections.c @@ -1120,7 +1120,7 @@ usage(void) " up [[id | uuid | path] ] [ifname ] [ap ] [passwd-file ]\n\n" " down [id | uuid | path | apath] ...\n\n" - " add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS SLAVE_OPTIONS IP_OPTIONS [-- " + " add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS PORT_OPTIONS IP_OPTIONS [-- " "([+|-]. )+]\n\n" " modify [--temporary] [id | uuid | path] ([+|-]. )+\n\n" " clone [--temporary] [id | uuid | path ] \n\n" @@ -1196,130 +1196,131 @@ usage_connection_down(void) static void usage_connection_add(void) { - nmc_printerr(_("Usage: nmcli connection add { ARGUMENTS | help }\n" - "\n" - "ARGUMENTS := COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS SLAVE_OPTIONS IP_OPTIONS [-- " - "([+|-]. )+]\n\n" - " COMMON_OPTIONS:\n" - " type \n" - " [ifname | \"*\"]\n" - " [con-name ]\n" - " [autoconnect yes|no]\n" - " [save yes|no]\n" - " [master ]\n" - " [slave-type ]\n\n" - " TYPE_SPECIFIC_OPTIONS:\n" - " ethernet: [mac ]\n" - " [cloned-mac ]\n" - " [mtu ]\n\n" - " wifi: ssid \n" - " [mac ]\n" - " [cloned-mac ]\n" - " [mtu ]\n" - " [mode infrastructure|ap|adhoc]\n\n" - " wimax: [mac ]\n" - " [nsp ]\n\n" - " pppoe: username \n" - " [password ]\n" - " [service ]\n" - " [mtu ]\n" - " [mac ]\n\n" - " gsm: apn \n" - " [user ]\n" - " [password ]\n\n" - " cdma: [user ]\n" - " [password ]\n\n" - " infiniband: [mac ]\n" - " [mtu ]\n" - " [transport-mode datagram | connected]\n" - " [parent ]\n" - " [p-key ]\n\n" - " bluetooth: [addr ]\n" - " [bt-type panu|nap|dun-gsm|dun-cdma]\n\n" - " vlan: dev \n" - " id \n" - " [flags ]\n" - " [ingress ]\n" - " [egress ]\n" - " [mtu ]\n\n" - " bond: [mode balance-rr (0) | active-backup (1) | balance-xor (2) | " - "broadcast (3) |\n" - " 802.3ad (4) | balance-tlb (5) | balance-alb (6)]\n" - " [primary ]\n" - " [miimon ]\n" - " [downdelay ]\n" - " [updelay ]\n" - " [arp-interval ]\n" - " [arp-ip-target ]\n" - " [lacp-rate slow (0) | fast (1)]\n\n" - " bond-slave: master \n" - " [queue-id <0-65535>]\n\n" - " team: [config |]\n\n" - " team-slave: master \n" - " [config |]\n\n" - " bridge: [stp yes|no]\n" - " [priority ]\n" - " [forward-delay <2-30>]\n" - " [hello-time <1-10>]\n" - " [max-age <6-40>]\n" - " [ageing-time <0-1000000>]\n" - " [multicast-snooping yes|no]\n" - " [mac ]\n\n" - " bridge-slave: master \n" - " [priority <0-63>]\n" - " [path-cost <1-65535>]\n" - " [hairpin yes|no]\n\n" - " vpn: vpn-type " - "vpnc|openvpn|pptp|openconnect|openswan|libreswan|ssh|l2tp|iodine|...\n" - " [user ]\n\n" - " olpc-mesh: ssid \n" - " [channel <1-13>]\n" - " [dhcp-anycast ]\n\n" - " adsl: username \n" - " protocol pppoa|pppoe|ipoatm\n" - " [password ]\n" - " [encapsulation vcmux|llc]\n\n" - " tun: mode tun|tap\n" - " [owner ]\n" - " [group ]\n" - " [pi yes|no]\n" - " [vnet-hdr yes|no]\n" - " [multi-queue yes|no]\n\n" - " ip-tunnel: mode ipip|gre|sit|isatap|vti|ip6ip6|ipip6|ip6gre|vti6\n" - " remote \n" - " [local ]\n" - " [dev ]\n\n" - " macsec: dev \n" - " mode \n" - " [cak ckn ]\n" - " [encrypt yes|no]\n" - " [port 1-65534]\n\n\n" - " macvlan: dev \n" - " mode vepa|bridge|private|passthru|source\n" - " [tap yes|no]\n\n" - " vxlan: id \n" - " [remote ]\n" - " [local ]\n" - " [dev ]\n" - " [source-port-min <0-65535>]\n" - " [source-port-max <0-65535>]\n" - " [destination-port <0-65535>]\n\n" - " wpan: [short-addr <0x0000-0xffff>]\n" - " [pan-id <0x0000-0xffff>]\n" - " [page ]\n" - " [channel ]\n" - " [mac ]\n\n" - " 6lowpan: dev \n" - " dummy:\n\n" - " SLAVE_OPTIONS:\n" - " bridge: [priority <0-63>]\n" - " [path-cost <1-65535>]\n" - " [hairpin yes|no]\n\n" - " team: [config |]\n\n" - " bond: [queue-id <0-65535>]\n\n" - " IP_OPTIONS:\n" - " [ip4 ] [gw4 ]\n" - " [ip6 ] [gw6 ]\n\n")); + nmc_printerr( + _("Usage: nmcli connection add { ARGUMENTS | help }\n" + "\n" + "ARGUMENTS := COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS PORT_OPTIONS IP_OPTIONS [-- " + "([+|-]. )+]\n\n" + " COMMON_OPTIONS:\n" + " type \n" + " [ifname | \"*\"]\n" + " [con-name ]\n" + " [autoconnect yes|no]\n" + " [save yes|no]\n" + " [controller ]\n" + " [port-type ]\n\n" + " TYPE_SPECIFIC_OPTIONS:\n" + " ethernet: [mac ]\n" + " [cloned-mac ]\n" + " [mtu ]\n\n" + " wifi: ssid \n" + " [mac ]\n" + " [cloned-mac ]\n" + " [mtu ]\n" + " [mode infrastructure|ap|adhoc]\n\n" + " wimax: [mac ]\n" + " [nsp ]\n\n" + " pppoe: username \n" + " [password ]\n" + " [service ]\n" + " [mtu ]\n" + " [mac ]\n\n" + " gsm: apn \n" + " [user ]\n" + " [password ]\n\n" + " cdma: [user ]\n" + " [password ]\n\n" + " infiniband: [mac ]\n" + " [mtu ]\n" + " [transport-mode datagram | connected]\n" + " [parent ]\n" + " [p-key ]\n\n" + " bluetooth: [addr ]\n" + " [bt-type panu|nap|dun-gsm|dun-cdma]\n\n" + " vlan: dev \n" + " id \n" + " [flags ]\n" + " [ingress ]\n" + " [egress ]\n" + " [mtu ]\n\n" + " bond: [mode balance-rr (0) | active-backup (1) | balance-xor (2) | " + "broadcast (3) |\n" + " 802.3ad (4) | balance-tlb (5) | balance-alb (6)]\n" + " [primary ]\n" + " [miimon ]\n" + " [downdelay ]\n" + " [updelay ]\n" + " [arp-interval ]\n" + " [arp-ip-target ]\n" + " [lacp-rate slow (0) | fast (1)]\n\n" + " bond-slave: controller \n" + " [queue-id <0-65535>]\n\n" + " team: [config |]\n\n" + " team-slave: controller \n" + " [config |]\n\n" + " bridge: [stp yes|no]\n" + " [priority ]\n" + " [forward-delay <2-30>]\n" + " [hello-time <1-10>]\n" + " [max-age <6-40>]\n" + " [ageing-time <0-1000000>]\n" + " [multicast-snooping yes|no]\n" + " [mac ]\n\n" + " bridge-slave: controller \n" + " [priority <0-63>]\n" + " [path-cost <1-65535>]\n" + " [hairpin yes|no]\n\n" + " vpn: vpn-type " + "vpnc|openvpn|pptp|openconnect|openswan|libreswan|ssh|l2tp|iodine|...\n" + " [user ]\n\n" + " olpc-mesh: ssid \n" + " [channel <1-13>]\n" + " [dhcp-anycast ]\n\n" + " adsl: username \n" + " protocol pppoa|pppoe|ipoatm\n" + " [password ]\n" + " [encapsulation vcmux|llc]\n\n" + " tun: mode tun|tap\n" + " [owner ]\n" + " [group ]\n" + " [pi yes|no]\n" + " [vnet-hdr yes|no]\n" + " [multi-queue yes|no]\n\n" + " ip-tunnel: mode ipip|gre|sit|isatap|vti|ip6ip6|ipip6|ip6gre|vti6\n" + " remote \n" + " [local ]\n" + " [dev ]\n\n" + " macsec: dev \n" + " mode \n" + " [cak ckn ]\n" + " [encrypt yes|no]\n" + " [port 1-65534]\n\n\n" + " macvlan: dev \n" + " mode vepa|bridge|private|passthru|source\n" + " [tap yes|no]\n\n" + " vxlan: id \n" + " [remote ]\n" + " [local ]\n" + " [dev ]\n" + " [source-port-min <0-65535>]\n" + " [source-port-max <0-65535>]\n" + " [destination-port <0-65535>]\n\n" + " wpan: [short-addr <0x0000-0xffff>]\n" + " [pan-id <0x0000-0xffff>]\n" + " [page ]\n" + " [channel ]\n" + " [mac ]\n\n" + " 6lowpan: dev \n" + " dummy:\n\n" + " PORT_OPTIONS:\n" + " bridge: [priority <0-63>]\n" + " [path-cost <1-65535>]\n" + " [hairpin yes|no]\n\n" + " team: [config |]\n\n" + " bond: [queue-id <0-65535>]\n\n" + " IP_OPTIONS:\n" + " [ip4 ] [gw4 ]\n" + " [ip6 ] [gw6 ]\n\n")); } static void @@ -3533,7 +3534,7 @@ get_name_alias_toplevel(const char *name, const char *port_type) if (port_type) { const char *port_name; - if (nm_meta_setting_info_valid_parts_for_slave_type(port_type, &port_name)) + if (nm_meta_setting_info_valid_parts_for_port_type(port_type, &port_name)) return port_name ?: name; return name; } @@ -3873,7 +3874,7 @@ is_setting_mandatory(NMConnection *connection, NMSetting *setting) if (i == 0) item = get_valid_settings_array(c_type); else - item = nm_meta_setting_info_valid_parts_for_slave_type(s_type, NULL); + item = nm_meta_setting_info_valid_parts_for_port_type(s_type, NULL); for (; item && *item; item++) { if (nm_streq(name, (*item)->setting_info->general->setting_name)) return (*item)->mandatory; @@ -3981,7 +3982,8 @@ normalized_controller_for_port(const GPtrArray *connections, } if (!out_controller) { - nmc_print(_("Warning: master='%s' doesn't refer to any existing profile.\n"), controller); + nmc_print(_("Warning: controller='%s' doesn't refer to any existing profile.\n"), + controller); out_controller = controller; if (out_type) *out_type = type; @@ -4455,12 +4457,12 @@ con_settings(NMConnection *connection, g_return_val_if_fail(s_con, FALSE); con_type = nm_setting_connection_get_port_type(s_con); - *port_settings = nm_meta_setting_info_valid_parts_for_slave_type(con_type, NULL); + *port_settings = nm_meta_setting_info_valid_parts_for_port_type(con_type, NULL); if (!*port_settings) { g_set_error(error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, - _("Error: invalid slave type; %s."), + _("Error: invalid port type; %s."), con_type); return FALSE; } @@ -4682,7 +4684,7 @@ set_connection_controller(NmCli *nmc, g_set_error_literal(error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, - _("Error: master is required")); + _("Error: controller is required")); return FALSE; } @@ -5020,7 +5022,7 @@ complete_property_name(NmCli *nmc, if (s_con) port_type = nm_setting_connection_get_port_type(s_con); valid_settings_main = get_valid_settings_array(connection_type); - valid_settings_port = nm_meta_setting_info_valid_parts_for_slave_type(port_type, NULL); + valid_settings_port = nm_meta_setting_info_valid_parts_for_port_type(port_type, NULL); word_list = get_valid_properties_string(valid_settings_main, valid_settings_port, @@ -6239,7 +6241,7 @@ gen_setting_names(const char *text, int state) return g_strdup(s_name); } - /* Let's give a try to parameters related to slave type */ + /* Let's give a try to parameters related to port type */ list_idx = 0; is_port = 1; } @@ -6248,7 +6250,7 @@ gen_setting_names(const char *text, int state) s_con = nm_connection_get_setting_connection(nmc_tab_completion.connection); if (s_con) s_type = nm_setting_connection_get_port_type(s_con); - valid_settings_arr = nm_meta_setting_info_valid_parts_for_slave_type(s_type, NULL); + valid_settings_arr = nm_meta_setting_info_valid_parts_for_port_type(s_type, NULL); if (list_idx < NM_PTRARRAY_LEN(valid_settings_arr)) { while (valid_settings_arr[list_idx]) { @@ -6305,7 +6307,7 @@ gen_property_names(const char *text, int state) port_type = NM_SETTING_BOND_SETTING_NAME; else port_type = NULL; - valid_settings_port = nm_meta_setting_info_valid_parts_for_slave_type(port_type, NULL); + valid_settings_port = nm_meta_setting_info_valid_parts_for_port_type(port_type, NULL); setting_name = check_valid_name(strv[0], valid_settings_main, valid_settings_port, NULL); if (setting_name) { @@ -6617,7 +6619,7 @@ get_setting_and_property(const char *prompt, s_type = nm_setting_connection_get_port_type(s_con); valid_settings_main = get_valid_settings_array(nmc_tab_completion.con_type); - valid_settings_port = nm_meta_setting_info_valid_parts_for_slave_type(s_type, NULL); + valid_settings_port = nm_meta_setting_info_valid_parts_for_port_type(s_type, NULL); setting_name = check_valid_name(sett, valid_settings_main, valid_settings_port, NULL); setting = nm_meta_setting_info_editor_new_setting( @@ -7988,7 +7990,7 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty s_type = nm_setting_connection_get_port_type(s_con); valid_settings_main = get_valid_settings_array(connection_type); - valid_settings_port = nm_meta_setting_info_valid_parts_for_slave_type(s_type, NULL); + valid_settings_port = nm_meta_setting_info_valid_parts_for_port_type(s_type, NULL); valid_settings_str = get_valid_options_string(valid_settings_main, valid_settings_port); nmc_print(_("You may edit the following settings: %s\n"), valid_settings_str); diff --git a/src/nmcli/devices.c b/src/nmcli/devices.c index a3ea7c45..c55f0a39 100644 --- a/src/nmcli/devices.c +++ b/src/nmcli/devices.c @@ -762,12 +762,12 @@ const NmcMetaGenericInfo *const nmc_fields_dev_wimax_list[] = { #define NMC_FIELDS_DEV_WIMAX_LIST_COMMON "NSP,SIGNAL,TYPE,DEVICE,ACTIVE" #define NMC_FIELDS_DEV_WIMAX_LIST_FOR_DEV_LIST "NAME," NMC_FIELDS_DEV_WIMAX_LIST_COMMON -const NmcMetaGenericInfo *const nmc_fields_dev_show_master_prop[] = { +const NmcMetaGenericInfo *const nmc_fields_dev_show_controller_prop[] = { NMC_META_GENERIC("NAME"), /* 0 */ NMC_META_GENERIC("SLAVES"), /* 1 */ NULL, }; -#define NMC_FIELDS_DEV_SHOW_MASTER_PROP_COMMON "NAME,SLAVES" +#define NMC_FIELDS_DEV_SHOW_CONTROLLER_PROP_COMMON "NAME,SLAVES" const NmcMetaGenericInfo *const nmc_fields_dev_show_team_prop[] = { NMC_META_GENERIC("NAME"), /* 0 */ @@ -802,18 +802,18 @@ const NmcMetaGenericInfo *const nmc_fields_dev_show_sections[] = { NMC_META_GENERIC_WITH_NESTED("WIRED-PROPERTIES", metagen_device_detail_wired_properties), /* 5 */ NMC_META_GENERIC_WITH_NESTED("WIMAX-PROPERTIES", - metagen_device_detail_wimax_properties), /* 6 */ - NMC_META_GENERIC_WITH_NESTED("NSP", nmc_fields_dev_wimax_list + 1), /* 7 */ - NMC_META_GENERIC_WITH_NESTED("IP4", metagen_ip4_config), /* 8 */ - NMC_META_GENERIC_WITH_NESTED("DHCP4", metagen_dhcp_config), /* 9 */ - NMC_META_GENERIC_WITH_NESTED("IP6", metagen_ip6_config), /* 10 */ - NMC_META_GENERIC_WITH_NESTED("DHCP6", metagen_dhcp_config), /* 11 */ - NMC_META_GENERIC_WITH_NESTED("BOND", nmc_fields_dev_show_master_prop + 1), /* 12 */ - NMC_META_GENERIC_WITH_NESTED("TEAM", nmc_fields_dev_show_team_prop + 1), /* 13 */ - NMC_META_GENERIC_WITH_NESTED("BRIDGE", nmc_fields_dev_show_master_prop + 1), /* 14 */ - NMC_META_GENERIC_WITH_NESTED("VLAN", nmc_fields_dev_show_vlan_prop + 1), /* 15 */ - NMC_META_GENERIC_WITH_NESTED("BLUETOOTH", nmc_fields_dev_show_bluetooth + 1), /* 16 */ - NMC_META_GENERIC_WITH_NESTED("CONNECTIONS", metagen_device_detail_connections), /* 17 */ + metagen_device_detail_wimax_properties), /* 6 */ + NMC_META_GENERIC_WITH_NESTED("NSP", nmc_fields_dev_wimax_list + 1), /* 7 */ + NMC_META_GENERIC_WITH_NESTED("IP4", metagen_ip4_config), /* 8 */ + NMC_META_GENERIC_WITH_NESTED("DHCP4", metagen_dhcp_config), /* 9 */ + NMC_META_GENERIC_WITH_NESTED("IP6", metagen_ip6_config), /* 10 */ + NMC_META_GENERIC_WITH_NESTED("DHCP6", metagen_dhcp_config), /* 11 */ + NMC_META_GENERIC_WITH_NESTED("BOND", nmc_fields_dev_show_controller_prop + 1), /* 12 */ + NMC_META_GENERIC_WITH_NESTED("TEAM", nmc_fields_dev_show_team_prop + 1), /* 13 */ + NMC_META_GENERIC_WITH_NESTED("BRIDGE", nmc_fields_dev_show_controller_prop + 1), /* 14 */ + NMC_META_GENERIC_WITH_NESTED("VLAN", nmc_fields_dev_show_vlan_prop + 1), /* 15 */ + NMC_META_GENERIC_WITH_NESTED("BLUETOOTH", nmc_fields_dev_show_bluetooth + 1), /* 16 */ + NMC_META_GENERIC_WITH_NESTED("CONNECTIONS", metagen_device_detail_connections), /* 17 */ NULL, }; #define NMC_FIELDS_DEV_SHOW_SECTIONS_COMMON \ @@ -1511,7 +1511,7 @@ print_bond_bridge_info(NMDevice *device, if (ports_str->len > 0) g_string_truncate(ports_str, ports_str->len - 1); /* Chop off last space */ - tmpl = (const NMMetaAbstractInfo *const *) nmc_fields_dev_show_master_prop; + tmpl = (const NMMetaAbstractInfo *const *) nmc_fields_dev_show_controller_prop; out_indices = parse_output_fields(one_field, tmpl, FALSE, NULL, NULL); arr = nmc_dup_fields_array(tmpl, NMC_OF_FLAG_FIELD_NAMES); g_ptr_array_add(out.output_data, arr); diff --git a/src/nmcli/devices.h b/src/nmcli/devices.h index 7ed75909..7e5a88f9 100644 --- a/src/nmcli/devices.h +++ b/src/nmcli/devices.h @@ -27,7 +27,7 @@ extern const NmcMetaGenericInfo *const metagen_device_detail_wifi_properties[]; extern const NmcMetaGenericInfo *const metagen_device_detail_wimax_properties[]; extern const NmcMetaGenericInfo *const nmc_fields_dev_wifi_list[]; extern const NmcMetaGenericInfo *const nmc_fields_dev_wimax_list[]; -extern const NmcMetaGenericInfo *const nmc_fields_dev_show_master_prop[]; +extern const NmcMetaGenericInfo *const nmc_fields_dev_show_controller_prop[]; extern const NmcMetaGenericInfo *const nmc_fields_dev_show_team_prop[]; extern const NmcMetaGenericInfo *const nmc_fields_dev_show_vlan_prop[]; extern const NmcMetaGenericInfo *const nmc_fields_dev_show_bluetooth[]; diff --git a/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in b/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in index 7ac049fc..b35a96a4 100644 --- a/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in +++ b/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in @@ -667,11 +667,11 @@ format="string" />