From 81836c2d44802b4cca833d7775dd627e0797a7e2 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Fri, 28 Aug 2015 01:13:48 +0200 Subject: Imported Upstream version 1.0.6 --- Makefile.in | 2 +- NEWS | 24 ++ clients/cli/common.c | 17 + clients/cli/common.h | 1 + clients/cli/devices.c | 158 ++++++-- clients/cli/nmcli-completion | 12 +- clients/cli/settings-docs.c | 7 +- clients/cli/settings.c | 197 ++++++++- clients/cli/utils.c | 38 +- clients/cli/utils.h | 7 + config.h.in | 2 +- configure | 30 +- configure.ac | 8 +- data/85-nm-unmanaged.rules | 7 +- docs/api/html/index.html | 2 +- docs/api/html/ref-settings.html | 18 + docs/api/html/spec.html | 41 +- docs/api/settings-spec.xml | 3 + docs/api/spec.html | 41 +- docs/api/version.xml | 2 +- docs/libnm-glib/html/NMAccessPoint.html | 76 +++- docs/libnm-glib/html/NMActiveConnection.html | 8 +- docs/libnm-glib/html/NMSecretAgent.html | 2 +- docs/libnm-glib/html/api-index-full.html | 12 + docs/libnm-glib/html/index.html | 2 +- docs/libnm-glib/html/index.sgml | 3 + docs/libnm-glib/html/libnm-glib.devhelp2 | 3 + docs/libnm-glib/libnm-glib-sections.txt | 2 + docs/libnm-glib/version.xml | 2 +- docs/libnm-util/html/index.html | 2 +- docs/libnm-util/version.xml | 2 +- docs/libnm/Makefile.am | 3 +- docs/libnm/Makefile.in | 3 +- docs/libnm/html/NMAccessPoint.html | 72 +++- docs/libnm/html/NMClient.html | 30 +- docs/libnm/html/NMDevice.html | 99 ++++- docs/libnm/html/NMDeviceWifi.html | 141 ++++++- docs/libnm/html/NMSettingConnection.html | 60 ++- docs/libnm/html/NMSettingWired.html | 221 ++++++++++- docs/libnm/html/api-index-full.html | 127 ++++++ docs/libnm/html/index.html | 2 +- docs/libnm/html/index.sgml | 45 ++- docs/libnm/html/libnm-nm-dbus-interface.html | 64 ++- docs/libnm/html/libnm-nm-utils.html | 208 ++++++++-- docs/libnm/html/libnm-nm-version.html | 48 ++- docs/libnm/html/libnm.devhelp2 | 45 ++- docs/libnm/html/object-tree.html | 2 + docs/libnm/libnm-sections.txt | 35 +- docs/libnm/libnm.types | 2 + docs/libnm/version.xml | 2 +- include/nm-macros-internal.h | 98 ++++- introspection/nm-access-point.xml | 7 + introspection/nm-device-wifi.xml | 3 +- introspection/nm-device.xml | 34 ++ introspection/nm-manager.xml | 8 + libnm-core/nm-connection.c | 3 +- libnm-core/nm-core-enum-types.c | 46 +++ libnm-core/nm-core-enum-types.h | 4 + libnm-core/nm-core-internal.h | 2 + libnm-core/nm-dbus-interface.h | 21 +- libnm-core/nm-setting-connection.c | 60 +++ libnm-core/nm-setting-connection.h | 3 + libnm-core/nm-setting-ip-config.c | 11 +- libnm-core/nm-setting-vlan.c | 2 +- libnm-core/nm-setting-wired.c | 120 ++++++ libnm-core/nm-setting-wired.h | 37 ++ libnm-core/nm-utils.c | 220 +++++++++++ libnm-core/nm-utils.h | 10 + libnm-core/nm-version.h | 28 +- libnm-core/nm-version.h.in | 26 +- libnm-core/tests/Makefile.am | 15 + libnm-core/tests/Makefile.in | 42 +- libnm-core/tests/nm-core-tests-enum-types.c | 74 ++++ libnm-core/tests/nm-core-tests-enum-types.h | 23 ++ libnm-core/tests/test-general-enums.h | 46 +++ libnm-core/tests/test-general.c | 168 ++++++++ libnm-glib/libnm-glib.ver | 1 + libnm-glib/nm-access-point.c | 44 +++ libnm-glib/nm-access-point.h | 3 + libnm-glib/nm-vpn-plugin.c | 93 ++--- libnm-glib/tests/common.c | 2 +- libnm-util/NetworkManager.h | 14 +- libnm-util/nm-utils.c | 15 + libnm-util/nm-version.h.in | 34 +- libnm/libnm.ver | 16 + libnm/nm-access-point.c | 43 ++ libnm/nm-access-point.h | 3 + libnm/nm-client.c | 18 +- libnm/nm-client.h | 1 + libnm/nm-device-wifi.c | 154 ++++++-- libnm/nm-device-wifi.h | 12 +- libnm/nm-device.c | 38 ++ libnm/nm-device.h | 3 + libnm/nm-ifcfg-rh-docs.xml | 3 +- libnm/nm-manager.c | 19 + libnm/nm-manager.h | 1 + libnm/nm-property-docs.xml | 3 + libnm/nm-setting-docs.xml | 3 + libnm/nm-vpn-plugin-old.c | 93 ++--- libnm/tests/common.c | 2 +- man/NetworkManager.8 | 2 +- man/NetworkManager.conf.5 | 6 +- man/NetworkManager.conf.xml.in | 3 + man/nm-settings-ifcfg-rh.5 | 22 +- man/nm-settings-ifcfg-rh.xml | 10 +- man/nm-settings-keyfile.5 | 6 +- man/nm-settings-keyfile.xml | 2 +- man/nm-settings.5 | 36 +- man/nm-settings.xml | 5 +- man/nmcli.1.in | 16 +- src/NetworkManagerUtils.c | 88 ++++- src/NetworkManagerUtils.h | 2 + src/devices/nm-device-ethernet.c | 60 +++ src/devices/nm-device-infiniband.c | 2 +- src/devices/nm-device-logging.h | 10 +- src/devices/nm-device-macvlan.c | 5 +- src/devices/nm-device-vlan.c | 41 +- src/devices/nm-device.c | 438 +++++++++++++++------ src/devices/nm-device.h | 3 +- src/devices/team/nm-device-team.c | 21 + src/devices/wifi/nm-device-wifi.c | 39 +- src/devices/wifi/nm-wifi-ap.c | 25 +- src/devices/wifi/nm-wifi-ap.h | 1 + src/dhcp-manager/nm-dhcp-client.c | 21 +- src/dhcp-manager/nm-dhcp-manager.c | 2 + src/dhcp-manager/nm-dhcp-systemd.c | 7 + src/dhcp-manager/nm-dhcp-utils.c | 3 + .../src/libsystemd-network/dhcp-lease-internal.h | 2 + .../src/libsystemd-network/dhcp-protocol.h | 1 + .../src/libsystemd-network/sd-dhcp-lease.c | 52 +++ .../systemd-dhcp/src/systemd/sd-dhcp-lease.h | 1 + src/dhcp-manager/tests/test-dhcp-utils.c | 60 ++- src/main.c | 8 +- src/nm-access-point-glue.h | 2 +- src/nm-active-connection.c | 67 +++- src/nm-active-connection.h | 6 +- src/nm-auth-manager.c | 20 +- src/nm-connectivity.c | 58 +-- src/nm-default-route-manager.c | 32 +- src/nm-device-glue.h | 2 +- src/nm-enum-types.c | 20 + src/nm-enum-types.h | 2 + src/nm-iface-helper.c | 5 +- src/nm-ip4-config.c | 183 +++++++-- src/nm-ip4-config.h | 9 +- src/nm-ip6-config.c | 66 +++- src/nm-ip6-config.h | 3 +- src/nm-logging.h | 31 ++ src/nm-manager-glue.h | 2 +- src/nm-manager.c | 138 +++++-- src/nm-manager.h | 4 +- src/nm-route-manager.c | 45 +-- src/nm-types.h | 6 + src/org.freedesktop.NetworkManager.conf | 2 + src/platform/nm-linux-platform.c | 106 +++-- src/platform/nm-platform-utils.c | 62 ++- src/platform/nm-platform-utils.h | 6 + src/platform/nm-platform.c | 54 +-- src/platform/nm-platform.h | 7 + src/platform/nmp-object.c | 28 +- src/platform/tests/test-link.c | 5 +- src/platform/wifi/wifi-utils-wext.c | 4 + src/settings/nm-settings-connection.c | 422 ++++++++++---------- src/settings/nm-settings-connection.h | 68 ++-- .../plugins/ifcfg-rh/nm-ifcfg-connection.c | 27 +- src/settings/plugins/ifcfg-rh/plugin.c | 15 +- src/settings/plugins/ifcfg-rh/reader.c | 87 ++++ src/settings/plugins/ifcfg-rh/shvar.c | 6 +- src/settings/plugins/ifcfg-rh/shvar.h | 2 +- .../ifcfg-rh/tests/network-scripts/Makefile.am | 3 +- .../ifcfg-rh/tests/network-scripts/Makefile.in | 3 +- .../network-scripts/ifcfg-test-wired-wake-on-lan | 22 ++ .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 125 +++++- src/settings/plugins/ifcfg-rh/writer.c | 114 ++++-- src/supplicant-manager/nm-supplicant-config.c | 66 +++- src/supplicant-manager/nm-supplicant-interface.c | 10 +- src/tests/config/nm-test-device.c | 16 +- src/tests/test-general-with-expect.c | 39 +- src/tests/test-ip4-config.c | 4 +- src/tests/test-route-manager.c | 2 +- src/vpn-manager/nm-vpn-connection.c | 4 +- 181 files changed, 5479 insertions(+), 1200 deletions(-) create mode 100644 libnm-core/tests/nm-core-tests-enum-types.c create mode 100644 libnm-core/tests/nm-core-tests-enum-types.h create mode 100644 libnm-core/tests/test-general-enums.h create mode 100644 src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-wake-on-lan diff --git a/Makefile.in b/Makefile.in index e409d1c71..58cc69bfe 100644 --- a/Makefile.in +++ b/Makefile.in @@ -222,7 +222,7 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/NetworkManager.pc.in \ $(top_srcdir)/initscript/linexa/networkmanager.in ABOUT-NLS \ AUTHORS COPYING ChangeLog INSTALL NEWS README TODO \ build-aux/compile build-aux/config.guess \ - build-aux/config.rpath build-aux/config.sub \ + build-aux/config.rpath build-aux/config.sub build-aux/depcomp \ build-aux/install-sh build-aux/ltmain.sh build-aux/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) diff --git a/NEWS b/NEWS index 0c201660f..5f6e145a8 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,27 @@ +=============================================== +NetworkManager-1.0.6 +Overview of changes since NetworkManager-1.0.4 +=============================================== + +This is a new stable release of NetworkManager. Notable changes include: + +* Improved capture portal detection. + +* Default route through WiFi connection is now preferred to Mobile + Broadband if both are available. + +* Expose a flag to determine whether a particular connection is metered + via API and client tools. + +* Add support for locking connections to a channel within a particular + band. + +* Add support for configuring Wake-on-LAN capabilitites. + +* Allow overriding the MTU for team device. + +* Usual pile of bug fixes and robustness improvements. + =============================================== NetworkManager-1.0.4 Overview of changes since NetworkManager-1.0.2 diff --git a/clients/cli/common.c b/clients/cli/common.c index 97d0bb940..35676d0f2 100644 --- a/clients/cli/common.c +++ b/clients/cli/common.c @@ -521,6 +521,23 @@ nmc_device_state_to_string (NMDeviceState state) } } +const char * +nmc_device_metered_to_string (NMMetered value) +{ + switch (value) { + case NM_METERED_YES: + return _("yes"); + case NM_METERED_NO: + return _("no"); + case NM_METERED_GUESS_YES: + return _("yes (guessed)"); + case NM_METERED_GUESS_NO: + return _("no (guessed)"); + default: + return _("unknown"); + } +} + const char * nmc_device_reason_to_string (NMDeviceStateReason reason) { diff --git a/clients/cli/common.h b/clients/cli/common.h index 8bb043f4d..bb3f44e85 100644 --- a/clients/cli/common.h +++ b/clients/cli/common.h @@ -35,6 +35,7 @@ NMIPRoute *nmc_parse_and_build_route (int family, const char *first, const char const char * nmc_device_state_to_string (NMDeviceState state); const char * nmc_device_reason_to_string (NMDeviceStateReason reason); +const char * nmc_device_metered_to_string (NMMetered value); char ** nmc_vlan_parse_priority_maps (const char *priority_map, diff --git a/clients/cli/devices.c b/clients/cli/devices.c index 979c59063..c9ff8970f 100644 --- a/clients/cli/devices.c +++ b/clients/cli/devices.c @@ -78,11 +78,12 @@ static NmcOutputField nmc_fields_dev_show_general[] = { {"CONNECTION", N_("CONNECTION"), 20}, /* 20 */ {"CON-UUID", N_("CON-UUID"), 38}, /* 21 */ {"CON-PATH", N_("CON-PATH"), 51}, /* 22 */ + {"METERED", N_("METERED"), 10}, /* 23 */ {NULL, NULL, 0} }; #define NMC_FIELDS_DEV_SHOW_GENERAL_ALL "NAME,DEVICE,TYPE,NM-TYPE,VENDOR,PRODUCT,DRIVER,DRIVER-VERSION,FIRMWARE-VERSION,HWADDR,MTU,"\ "STATE,REASON,UDI,IP-IFACE,IS-SOFTWARE,NM-MANAGED,AUTOCONNECT,FIRMWARE-MISSING,PHYS-PORT-ID,"\ - "CONNECTION,CON-UUID,CON-PATH" + "CONNECTION,CON-UUID,CON-PATH,METERED" #define NMC_FIELDS_DEV_SHOW_GENERAL_COMMON "NAME,DEVICE,TYPE,VENDOR,PRODUCT,DRIVER,HWADDR,STATE" /* Available fields for 'device show' - CONNECTIONS part */ @@ -275,8 +276,8 @@ usage (void) " delete ...\n\n" " wifi [list [ifname ] [bssid ]]\n\n" " wifi connect <(B)SSID> [password ] [wep-key-type key|phrase] [ifname ]\n" - " [bssid ] [name ] [private yes|no]\n\n" - " wifi rescan [[ifname] ]\n\n" + " [bssid ] [name ] [private yes|no] [hidden yes|no]\n\n" + " wifi rescan [ifname ] [[ssid ] ...]\n\n" #if WITH_WIMAX " wimax [list [ifname ] [nsp ]]\n\n" #endif @@ -359,7 +360,7 @@ usage_device_wifi (void) "used to list APs for a particular interface, or with a specific BSSID.\n" "\n" "ARGUMENTS := connect <(B)SSID> [password ] [wep-key-type key|phrase] [ifname ]\n" - " [bssid ] [name ] [private yes|no]\n" + " [bssid ] [name ] [private yes|no] [hidden yes|no]\n" "\n" "Connect to a Wi-Fi network specified by SSID or BSSID. The command creates\n" "a new connection and then activates it on a device. This is a command-line\n" @@ -370,12 +371,14 @@ usage_device_wifi (void) "only open, WEP and WPA-PSK networks are supported at the moment. It is also\n" "assumed that IP configuration is obtained via DHCP.\n" "\n" - "ARGUMENTS := rescan [[ifname] ]\n" + "ARGUMENTS := rescan [ifname ] [[ssid ] ...]\n" "\n" "Request that NetworkManager immediately re-scan for available access points.\n" "NetworkManager scans Wi-Fi networks periodically, but in some cases it might\n" - "be useful to start scanning manually. Note that this command does not show\n" - "the APs, use 'nmcli device wifi list' for that.\n\n")); + "be useful to start scanning manually. 'ssid' allows scanning for a specific\n" + "SSID, which is useful for APs with hidden SSIDs. More 'ssid' parameters can be\n" + "given. Note that this command does not show the APs,\n" + "use 'nmcli device wifi list' for that.\n\n")); } #if WITH_WIMAX @@ -858,6 +861,8 @@ show_device_info (NMDevice *device, NmCli *nmc) set_val_strc (arr, 20, get_active_connection_id (device)); set_val_strc (arr, 21, acon ? nm_active_connection_get_uuid (acon) : NULL); set_val_strc (arr, 22, acon ? nm_object_get_path (NM_OBJECT (acon)) : NULL); + set_val_strc (arr, 23, nmc_device_metered_to_string (nm_device_get_metered (device))); + g_ptr_array_add (nmc->output_data, arr); print_data (nmc); /* Print all data */ @@ -2300,9 +2305,9 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv) { NMDevice *device = NULL; NMAccessPoint *ap = NULL; - NM80211ApFlags ap_flags; - NM80211ApSecurityFlags ap_wpa_flags; - NM80211ApSecurityFlags ap_rsn_flags; + NM80211ApFlags ap_flags = NM_802_11_AP_FLAGS_NONE; + NM80211ApSecurityFlags ap_wpa_flags = NM_802_11_AP_SEC_NONE; + NM80211ApSecurityFlags ap_rsn_flags = NM_802_11_AP_SEC_NONE; NMConnection *connection = NULL; NMSettingConnection *s_con; NMSettingWireless *s_wifi; @@ -2314,6 +2319,7 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv) const char *password = NULL; const char *con_name = NULL; gboolean private = FALSE; + gboolean hidden = FALSE; gboolean wep_passphrase = FALSE; GByteArray *bssid1_arr = NULL; GByteArray *bssid2_arr = NULL; @@ -2413,6 +2419,19 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv) g_clear_error (&err_tmp); goto error; } + } else if (strcmp (*argv, "hidden") == 0) { + GError *err_tmp = NULL; + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1)); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + if (!nmc_string_to_bool (*argv, &hidden, &err_tmp)) { + g_string_printf (nmc->return_text, _("Error: %s: %s."), *(argv-1), err_tmp->message); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + g_clear_error (&err_tmp); + goto error; + } } else { g_printerr (_("Unknown parameter: %s\n"), *argv); } @@ -2449,14 +2468,41 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv) goto error; } + /* For hidden SSID first scan it so that NM learns about the AP */ + if (hidden) { + GVariantBuilder builder, array_builder; + GVariant *options; + GError *scan_err = NULL; + + g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT); + g_variant_builder_init (&array_builder, G_VARIANT_TYPE ("aay")); + g_variant_builder_add (&array_builder, "@ay", + g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE, param_user, strlen (param_user), 1)); + g_variant_builder_add (&builder, "{sv}", "ssids", g_variant_builder_end (&array_builder)); + options = g_variant_builder_end (&builder); + + nm_device_wifi_request_scan_options (NM_DEVICE_WIFI (device), options, NULL, &scan_err); + if (scan_err) { + g_string_printf (nmc->return_text, _("Error: Failed to scan hidden SSID: %s."), + scan_err->message); + g_clear_error (&scan_err); + nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND; + goto error; + } + } + /* Find an AP to connect to */ ap = find_ap_on_device (device, bssid1_arr, bssid1_arr ? NULL : param_user); if (!ap && !ifname) { - /* AP not found. ifname was not specified, so try finding the AP on another device. */ - while ((device = find_wifi_device_by_iface (devices, NULL, &devices_idx)) != NULL) { - ap = find_ap_on_device (device, bssid1_arr, bssid1_arr ? NULL : param_user); - if (ap) + NMDevice *dev; + + /* AP not found, ifname was not specified, so try finding the AP on another device. */ + while ((dev = find_wifi_device_by_iface (devices, NULL, &devices_idx)) != NULL) { + ap = find_ap_on_device (dev, bssid1_arr, bssid1_arr ? NULL : param_user); + if (ap) { + device = dev; break; + } } } @@ -2471,7 +2517,7 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv) /* If there are some connection data from user, create a connection and * fill them into proper settings. */ - if (con_name || private || bssid2_arr || password) + if (con_name || private || bssid2_arr || password || hidden) connection = nm_simple_connection_new (); if (con_name || private) { @@ -2486,12 +2532,24 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv) if (private) nm_setting_connection_add_permission (s_con, "user", g_get_user_name (), NULL); } - if (bssid2_arr) { + if (bssid2_arr || hidden) { s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); nm_connection_add_setting (connection, NM_SETTING (s_wifi)); - /* 'bssid' parameter is used to restrict the conenction only to the BSSID */ - g_object_set (s_wifi, NM_SETTING_WIRELESS_BSSID, bssid2_arr, NULL); + /* 'bssid' parameter is used to restrict the connection only to the BSSID */ + if (bssid2_arr) + g_object_set (s_wifi, NM_SETTING_WIRELESS_BSSID, bssid2_arr, NULL); + + /* 'hidden' parameter is used to indicate that SSID is not broadcasted */ + if (hidden) { + GBytes *ssid = g_bytes_new (param_user, strlen (param_user)); + + g_object_set (s_wifi, + NM_SETTING_WIRELESS_SSID, ssid, + NM_SETTING_WIRELESS_HIDDEN, hidden, + NULL); + g_bytes_unref (ssid); + } } /* handle password */ @@ -2582,21 +2640,44 @@ do_device_wifi_rescan (NmCli *nmc, int argc, char **argv) { NMDevice *device; const char *ifname = NULL; + GPtrArray *ssids; const GPtrArray *devices; int devices_idx; + GVariantBuilder builder, array_builder; + GVariant *options; + const char *ssid; + int i; nmc->should_wait = TRUE; + ssids = g_ptr_array_new (); + /* Get the parameters */ - if (argc > 0) { + while (argc > 0) { if (strcmp (*argv, "ifname") == 0) { + if (ifname) { + g_string_printf (nmc->return_text, _("Error: '%s' cannot repeat."), *(argv-1)); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } if (next_arg (&argc, &argv) != 0) { g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1)); nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto error; } - } - ifname = *argv; + ifname = *argv; + } else if (strcmp (*argv, "ssid") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1)); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + g_ptr_array_add (ssids, *argv); + } else + g_printerr (_("Unknown parameter: %s\n"), *argv); + + argc--; + argv++; } /* Find Wi-Fi device to scan on. When no ifname is provided, the first Wi-Fi is used. */ @@ -2605,26 +2686,39 @@ do_device_wifi_rescan (NmCli *nmc, int argc, char **argv) device = find_wifi_device_by_iface (devices, ifname, &devices_idx); if (!device) { - if (ifname) { - const char *err_msg; - if ( nm_device_get_device_type (device) == NM_DEVICE_TYPE_GENERIC - && g_strcmp0 (nm_device_get_type_description (device), "wifi") == 0) - err_msg = _("Error: Device '%s' was not recognized as a Wi-Fi device, check NetworkManager Wi-Fi plugin."); - else - err_msg = _("Error: Device '%s' is not a Wi-Fi device."); - g_string_printf (nmc->return_text, err_msg, ifname); - } else + if (ifname) + g_string_printf (nmc->return_text, _("Error: Device '%s' is not a Wi-Fi device."), ifname); + else g_string_printf (nmc->return_text, _("Error: No Wi-Fi device found.")); nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; goto error; } - nm_device_wifi_request_scan_async (NM_DEVICE_WIFI (device), NULL, - request_rescan_cb, nmc); + if (ssids->len) { + g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT); + g_variant_builder_init (&array_builder, G_VARIANT_TYPE ("aay")); + + for (i = 0; i < ssids->len; i++) { + ssid = g_ptr_array_index (ssids, i); + g_variant_builder_add (&array_builder, "@ay", + g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE, ssid, strlen (ssid), 1)); + } + + g_variant_builder_add (&builder, "{sv}", "ssids", g_variant_builder_end (&array_builder)); + options = g_variant_builder_end (&builder); + + nm_device_wifi_request_scan_options_async (NM_DEVICE_WIFI (device), options, + NULL, request_rescan_cb, nmc); + } else + nm_device_wifi_request_scan_async (NM_DEVICE_WIFI (device), + NULL, request_rescan_cb, nmc); + + g_ptr_array_free (ssids, FALSE); return nmc->return_value; error: nmc->should_wait = FALSE; + g_ptr_array_free (ssids, FALSE); return nmc->return_value; } diff --git a/clients/cli/nmcli-completion b/clients/cli/nmcli-completion index 38d7e5857..4146eae09 100644 --- a/clients/cli/nmcli-completion +++ b/clients/cli/nmcli-completion @@ -455,6 +455,7 @@ _nmcli_compl_ARGS() stp| \ hairpin| \ save| \ + hidden| \ private) if [[ "${#words[@]}" -eq 2 ]]; then _nmcli_list "yes no" @@ -539,7 +540,9 @@ _nmcli_compl_ARGS() # remove the options already seen. for i in ${!OPTIONS[*]}; do if [[ "${OPTIONS[$i]}" = "${REMOVE_OPTIONS[0]}" || "${OPTIONS[$i]}" = "${REMOVE_OPTIONS[1]}" ]]; then - unset OPTIONS[$i] + if ! _nmcli_array_has_value OPTIONS_REPEATABLE "${OPTIONS[$i]}" ; then + unset OPTIONS[$i] + fi fi done for i in ${!OPTIONS_MANDATORY[*]}; do @@ -678,7 +681,7 @@ _nmcli() cur='' fi - local OPTIONS_UNKNOWN_OPTION OPTIONS_TYPE OPTIONS_TYPED OPTIONS OPTIONS_MANDATORY COMMAND_ARGS_WAIT_OPTIONS OPTIONS_IP OPTIONS_MANDATORY OPTIONS_NEXT_GROUP + local OPTIONS_UNKNOWN_OPTION OPTIONS_TYPE OPTIONS_TYPED OPTIONS OPTIONS_MANDATORY COMMAND_ARGS_WAIT_OPTIONS OPTIONS_IP OPTIONS_MANDATORY OPTIONS_NEXT_GROUP OPTIONS_REPEATABLE local COMMAND_CONNECTION_TYPE COMMAND_CONNECTION_ID OPTIONS_MANDATORY_IFNAME HELP_ONLY_AS_FIRST local COMMAND_CONNECTION_ACTIVE="" @@ -1248,13 +1251,14 @@ _nmcli() fi else _nmcli_array_delete_at words 0 3 - local OPTIONS=(password wep-key-type ifname bssid name private) + local OPTIONS=(password wep-key-type ifname bssid name private hidden) _nmcli_compl_ARGS fi ;; r|re|res|resc|resca|rescan) _nmcli_array_delete_at words 0 2 - OPTIONS=(ifname) + OPTIONS_REPEATABLE=(ssid) + OPTIONS=(ifname ssid) _nmcli_compl_ARGS ;; esac diff --git a/clients/cli/settings-docs.c b/clients/cli/settings-docs.c index 2ed41cb86..d48d4b087 100644 --- a/clients/cli/settings-docs.c +++ b/clients/cli/settings-docs.c @@ -99,6 +99,8 @@ NmcPropertyDesc setting_802_3_ethernet[] = { { "s390-options", "Dictionary of key/value pairs of s390-specific device options. Both keys and values must be strings. Allowed keys include \"portno\", \"layer2\", \"portname\", \"protocol\", among others. Key names must contain only alphanumeric characters (ie, [a-zA-Z0-9])." }, { "s390-subchannels", "Identifies specific subchannels that this network device uses for communication with z/VM or s390 host. Like the \"mac-address\" property for non-z/VM devices, this property can be used to ensure this connection only applies to the network device that uses these subchannels. The list should contain exactly 3 strings, and each string may only be composed of hexadecimal characters and the period (.) character." }, { "speed", "If non-zero, request that the device use only the specified speed. In Mbit/s, ie 100 == 100Mbit/s." }, + { "wake-on-lan", "The NMSettingWiredWakeOnLan options to enable. Not all devices support all options. May be any combination of NM_SETTING_WIRED_WAKE_ON_LAN_PHY (0x2), NM_SETTING_WIRED_WAKE_ON_LAN_UNICAST (0x4), NM_SETTING_WIRED_WAKE_ON_LAN_MULTICAST (0x8), NM_SETTING_WIRED_WAKE_ON_LAN_BROADCAST (0x10), NM_SETTING_WIRED_WAKE_ON_LAN_ARP (0x20), NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC (0x40)." }, + { "wake-on-lan-password", "If specified, the password used with magic-packet-based Wake-on-LAN, represented as an Ethernet MAC address. If NULL, no password will be required." }, }; NmcPropertyDesc setting_adsl[] = { @@ -157,6 +159,7 @@ NmcPropertyDesc setting_connection[] = { { "id", "A human readable unique identifier for the connection, like \"Work Wi-Fi\" or \"T-Mobile 3G\"." }, { "interface-name", "The name of the network interface this connection is bound to. If not set, then the connection can be attached to any interface of the appropriate type (subject to restrictions imposed by other settings). For software devices this specifies the name of the created device. For connection types where interface names cannot easily be made persistent (e.g. mobile broadband or USB Ethernet), this property should not be used. Setting this property restricts the interfaces a connection can be used with, and if interface names change or are reordered the connection may be applied to the wrong interface." }, { "master", "Interface name of the master device or UUID of the master connection." }, + { "metered", "Whether the connection is metered." }, { "name", "The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\"." }, { "permissions", "An array of strings defining what access a given user has to this connection. If this is NULL or empty, all users are allowed to access this connection. Otherwise a user is allowed to access this connection if and only if they are in this list. Each entry is of the form \"[type]:[id]:[reserved]\"; for example, \"user:dcbw:blah\". At this time only the \"user\" [type] is allowed. Any other values are ignored and reserved for future use. [id] is the username that this permission refers to, which may not contain the \":\" character. Any [reserved] information present must be ignored and is reserved for future use. All of [type], [id], and [reserved] must be valid UTF-8." }, { "read-only", "FALSE if the connection can be modified using the provided settings service's D-Bus interface with the right privileges, or TRUE if the connection is read-only and cannot be modified." }, @@ -335,14 +338,14 @@ NmcSettingDesc all_settings[] = { { "802-11-wireless", setting_802_11_wireless, 14 }, { "802-11-wireless-security", setting_802_11_wireless_security, 18 }, { "802-1x", setting_802_1x, 33 }, - { "802-3-ethernet", setting_802_3_ethernet, 12 }, + { "802-3-ethernet", setting_802_3_ethernet, 14 }, { "adsl", setting_adsl, 8 }, { "bluetooth", setting_bluetooth, 3 }, { "bond", setting_bond, 2 }, { "bridge", setting_bridge, 8 }, { "bridge-port", setting_bridge_port, 4 }, { "cdma", setting_cdma, 5 }, - { "connection", setting_connection, 16 }, + { "connection", setting_connection, 17 }, { "dcb", setting_dcb, 16 }, { "generic", setting_generic, 1 }, { "gsm", setting_gsm, 10 }, diff --git a/clients/cli/settings.c b/clients/cli/settings.c index 66e6f6224..8c4af22d4 100644 --- a/clients/cli/settings.c +++ b/clients/cli/settings.c @@ -30,6 +30,7 @@ #include "settings.h" #include "nm-glib-compat.h" #include "nm-macros-internal.h" +#include "gsystem-local-alloc.h" /* Forward declarations */ static char *wep_key_type_to_string (NMWepKeyType type); @@ -60,6 +61,7 @@ NmcOutputField nmc_fields_setting_connection[] = { SETTING_FIELD (NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES, 13), /* 13 */ SETTING_FIELD (NM_SETTING_CONNECTION_SECONDARIES, 40), /* 14 */ SETTING_FIELD (NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT, 30), /* 15 */ + SETTING_FIELD (NM_SETTING_CONNECTION_METERED, 10), /* 16 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_CONNECTION_ALL "name"","\ @@ -77,7 +79,8 @@ NmcOutputField nmc_fields_setting_connection[] = { NM_SETTING_CONNECTION_SLAVE_TYPE","\ NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES","\ NM_SETTING_CONNECTION_SECONDARIES","\ - NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT + NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT","\ + NM_SETTING_CONNECTION_METERED #define NMC_FIELDS_SETTING_CONNECTION_COMMON NMC_FIELDS_SETTING_CONNECTION_ALL /* Available fields for NM_SETTING_WIRED_SETTING_NAME */ @@ -94,6 +97,8 @@ NmcOutputField nmc_fields_setting_wired[] = { SETTING_FIELD (NM_SETTING_WIRED_S390_SUBCHANNELS, 20), /* 9 */ SETTING_FIELD (NM_SETTING_WIRED_S390_NETTYPE, 15), /* 10 */ SETTING_FIELD (NM_SETTING_WIRED_S390_OPTIONS, 20), /* 11 */ + SETTING_FIELD (NM_SETTING_WIRED_WAKE_ON_LAN, 10), /* 12 */ + SETTING_FIELD (NM_SETTING_WIRED_WAKE_ON_LAN_PASSWORD, 20), /* 13 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_WIRED_ALL "name"","\ @@ -107,7 +112,9 @@ NmcOutputField nmc_fields_setting_wired[] = { NM_SETTING_WIRED_MTU","\ NM_SETTING_WIRED_S390_SUBCHANNELS","\ NM_SETTING_WIRED_S390_NETTYPE","\ - NM_SETTING_WIRED_S390_OPTIONS + NM_SETTING_WIRED_S390_OPTIONS","\ + NM_SETTING_WIRED_WAKE_ON_LAN","\ + NM_SETTING_WIRED_WAKE_ON_LAN_PASSWORD #define NMC_FIELDS_SETTING_WIRED_COMMON NMC_FIELDS_SETTING_WIRED_ALL /* Available fields for NM_SETTING_802_1X_SETTING_NAME */ @@ -1497,6 +1504,7 @@ DEFINE_GETTER (nmc_property_wired_get_mac_address_blacklist, NM_SETTING_WIRED_MA DEFINE_GETTER (nmc_property_wired_get_s390_subchannels, NM_SETTING_WIRED_S390_SUBCHANNELS) DEFINE_GETTER (nmc_property_wired_get_s390_nettype, NM_SETTING_WIRED_S390_NETTYPE) DEFINE_GETTER (nmc_property_wired_get_s390_options, NM_SETTING_WIRED_S390_OPTIONS) +DEFINE_GETTER (nmc_property_wired_get_wake_on_lan_password, NM_SETTING_WIRED_WAKE_ON_LAN_PASSWORD) static char * nmc_property_wired_get_mtu (NMSetting *setting, NmcPropertyGetType get_type) @@ -1511,6 +1519,45 @@ nmc_property_wired_get_mtu (NMSetting *setting, NmcPropertyGetType get_type) return g_strdup_printf ("%d", mtu); } +static char * +nmc_property_wired_get_wake_on_lan (NMSetting *setting, NmcPropertyGetType get_type) +{ + NMSettingWired *s_wired = NM_SETTING_WIRED (setting); + NMSettingWiredWakeOnLan wol; + + wol = nm_setting_wired_get_wake_on_lan (s_wired); + return nm_utils_enum_to_str (nm_setting_wired_wake_on_lan_get_type (), wol); +} + +static gboolean +nmc_property_wired_set_wake_on_lan (NMSetting *setting, const char *prop, + const char *val, GError **error) +{ + NMSettingWiredWakeOnLan wol; + gs_free char *err_token = NULL; + gboolean ret; + + ret = nm_utils_enum_from_str (nm_setting_wired_wake_on_lan_get_type (), val, + (int *) &wol, &err_token); + + if (!ret) { + g_set_error (error, 1, 0, _("invalid option '%s', use a combination of %s or 'default'"), + err_token, + nm_utils_enum_to_str (nm_setting_wired_wake_on_lan_get_type (), + NM_SETTING_WIRED_WAKE_ON_LAN_ALL)); + return FALSE; + } + + if (NM_FLAGS_HAS (wol, NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT) && + NM_FLAGS_ANY (wol, NM_SETTING_WIRED_WAKE_ON_LAN_ALL)) { + g_set_error_literal (error, 1, 0, _("'default' is incompatible with other flags")); + return FALSE; + } + + g_object_set (setting, prop, (guint) wol, NULL); + return TRUE; +} + /* --- NM_SETTING_WIRELESS_SETTING_NAME property get functions --- */ DEFINE_GETTER (nmc_property_wireless_get_mode, NM_SETTING_WIRELESS_MODE) DEFINE_GETTER (nmc_property_wireless_get_band, NM_SETTING_WIRELESS_BAND) @@ -2034,6 +2081,46 @@ validate_uint (NMSetting *setting, const char* prop, guint val, GError **error) return success; } +static char * +flag_values_to_string (GFlagsValue *array, guint n) +{ + GString *str; + guint i; + + str = g_string_new (NULL); + for (i = 0; i < n; i++) + g_string_append_printf (str, "%u, ", array[i].value); + if (str->len) + g_string_truncate (str, str->len-2); /* chop off trailing ', ' */ + return g_string_free (str, FALSE); +} + +static gboolean +validate_flags (NMSetting *setting, const char* prop, guint val, GError **error) +{ + GParamSpec *pspec; + GValue value = G_VALUE_INIT; + gboolean success = TRUE; + + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (G_OBJECT (setting)), prop); + g_assert (G_IS_PARAM_SPEC (pspec)); + + g_value_init (&value, pspec->value_type); + g_value_set_flags (&value, val); + + if (g_param_value_validate (pspec, &value)) { + GParamSpecFlags *pspec_flags = (GParamSpecFlags *) pspec; + char *flag_values = flag_values_to_string (pspec_flags->flags_class->values, + pspec_flags->flags_class->n_values); + g_set_error (error, 1, 0, _("'%u' flags are not valid; use combination of %s"), + val, flag_values); + g_free (flag_values); + success = FALSE; + } + g_value_unset (&value); + return success; +} + static gboolean check_and_set_string (NMSetting *setting, const char *prop, @@ -2256,6 +2343,26 @@ nmc_property_set_int64 (NMSetting *setting, const char *prop, const char *val, G return TRUE; } +static gboolean +nmc_property_set_flags (NMSetting *setting, const char *prop, const char *val, GError **error) +{ + unsigned long val_int; + + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + if (!nmc_string_to_uint (val, TRUE, 0, G_MAXUINT, &val_int)) { + g_set_error (error, 1, 0, _("'%s' is not a valid number (or out of range)"), val); + return FALSE; + } + + /* Validate the flags according to the property spec */ + if (!validate_flags (setting, prop, (guint) val_int, error)) + return FALSE; + + g_object_set (setting, prop, (guint) val_int, NULL); + return TRUE; +} + static gboolean nmc_property_set_bool (NMSetting *setting, const char *prop, const char *val, GError **error) { @@ -2684,6 +2791,62 @@ nmc_property_connection_describe_secondaries (NMSetting *setting, const char *pr "Example: private-openvpn, fe6ba5d8-c2fc-4aae-b2e3-97efddd8d9a7\n"); } +/* 'metered' */ +static char * +nmc_property_connection_get_metered (NMSetting *setting, NmcPropertyGetType get_type) +{ + NMSettingConnection *s_conn = NM_SETTING_CONNECTION (setting); + + if (get_type == NMC_PROPERTY_GET_PARSABLE) { + switch (nm_setting_connection_get_metered (s_conn)) { + case NM_METERED_YES: + return g_strdup ("yes"); + case NM_METERED_NO: + return g_strdup ("no"); + case NM_METERED_UNKNOWN: + default: + return g_strdup ("unknown"); + } + } + switch (nm_setting_connection_get_metered (s_conn)) { + case NM_METERED_YES: + return g_strdup (_("yes")); + case NM_METERED_NO: + return g_strdup (_("no")); + case NM_METERED_UNKNOWN: + default: + return g_strdup (_("unknown")); + } +} + +static gboolean +nmc_property_connection_set_metered (NMSetting *setting, const char *prop, + const char *val, GError **error) +{ + NMMetered metered; + NMCTriStateValue ts_val; + + if (!nmc_string_to_tristate (val, &ts_val, error)) + return FALSE; + + switch (ts_val) { + case NMC_TRI_STATE_YES: + metered = NM_METERED_YES; + break; + case NMC_TRI_STATE_NO: + metered = NM_METERED_NO; + break; + case NMC_TRI_STATE_UNKNOWN: + metered = NM_METERED_UNKNOWN; + break; + default: + g_assert_not_reached(); + } + + g_object_set (setting, prop, metered, NULL); + return TRUE; +} + /* --- NM_SETTING_802_1X_SETTING_NAME property setter functions --- */ #define DEFINE_SETTER_STR_LIST(def_func, set_func) \ static gboolean \ @@ -4495,8 +4658,8 @@ nmc_property_dcb_set_flags (NMSetting *setting, const char *prop, const char *va g_strfreev (strv); } - /* Validate the number according to the property spec */ - if (!validate_uint (setting, prop, (guint) flags, error)) + /* Validate the flags according to the property spec */ + if (!validate_flags (setting, prop, (guint) flags, error)) return FALSE; g_object_set (setting, prop, (guint) flags, NULL); @@ -5264,6 +5427,13 @@ nmc_properties_init (void) NULL, NULL, NULL); + nmc_add_prop_funcs (GLUE (CONNECTION, METERED), + nmc_property_connection_get_metered, + nmc_property_connection_set_metered, + NULL, + NULL, + NULL, + NULL); /* Add editable properties for NM_SETTING_DCB_SETTING_NAME */ nmc_add_prop_funcs (GLUE (DCB, APP_FCOE_FLAGS), @@ -5927,7 +6097,7 @@ nmc_properties_init (void) NULL); nmc_add_prop_funcs (GLUE (VLAN, FLAGS), nmc_property_vlan_get_flags, - nmc_property_set_uint, + nmc_property_set_flags, NULL, NULL, NULL, @@ -6078,6 +6248,20 @@ nmc_properties_init (void) nmc_property_wired_describe_s390_options, nmc_property_wired_allowed_s390_options, NULL); + nmc_add_prop_funcs (GLUE (WIRED, WAKE_ON_LAN), + nmc_property_wired_get_wake_on_lan, + nmc_property_wired_set_wake_on_lan, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (WIRED, WAKE_ON_LAN_PASSWORD), + nmc_property_wired_get_wake_on_lan_password, + nmc_property_set_mac, + NULL, + NULL, + NULL, + NULL); /* Add editable properties for NM_SETTING_WIRELESS_SETTING_NAME */ nmc_add_prop_funcs (GLUE (WIRELESS, SSID), @@ -6624,6 +6808,7 @@ setting_connection_details (NMSetting *setting, NmCli *nmc, const char *one_pro set_val_str (arr, 13, nmc_property_connection_get_autoconnect_slaves (setting, NMC_PROPERTY_GET_PRETTY)); set_val_str (arr, 14, nmc_property_connection_get_secondaries (setting, NMC_PROPERTY_GET_PRETTY)); set_val_str (arr, 15, nmc_property_connection_get_gateway_ping_timeout (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 16, nmc_property_connection_get_metered (setting, NMC_PROPERTY_GET_PRETTY)); g_ptr_array_add (nmc->output_data, arr); print_data (nmc); /* Print all data */ @@ -6660,6 +6845,8 @@ setting_wired_details (NMSetting *setting, NmCli *nmc, const char *one_prop, gb set_val_str (arr, 9, nmc_property_wired_get_s390_subchannels (setting, NMC_PROPERTY_GET_PRETTY)); set_val_str (arr, 10, nmc_property_wired_get_s390_nettype (setting, NMC_PROPERTY_GET_PRETTY)); set_val_str (arr, 11, nmc_property_wired_get_s390_options (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 12, nmc_property_wired_get_wake_on_lan (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 13, nmc_property_wired_get_wake_on_lan_password (setting, NMC_PROPERTY_GET_PRETTY)); g_ptr_array_add (nmc->output_data, arr); print_data (nmc); /* Print all data */ diff --git a/clients/cli/utils.c b/clients/cli/utils.c index dfd002edc..3cc836d83 100644 --- a/clients/cli/utils.c +++ b/clients/cli/utils.c @@ -407,7 +407,10 @@ nmc_string_to_bool (const char *str, gboolean *val_bool, GError **error) if (g_strcmp0 (str, "o") == 0) { g_set_error (error, 1, 0, - _("'%s' is ambiguous (on x off)"), str); + /* Translators: the first %s is the partial value entered by + * the user, the second %s a list of compatible values. + */ + _("'%s' is ambiguous (%s)"), str, "on x off"); return FALSE; } @@ -424,6 +427,39 @@ nmc_string_to_bool (const char *str, gboolean *val_bool, GError **error) return TRUE; } +gboolean +nmc_string_to_tristate (const char *str, NMCTriStateValue *val, GError **error) +{ + const char *s_true[] = { "true", "yes", "on", NULL }; + const char *s_false[] = { "false", "no", "off", NULL }; + const char *s_unknown[] = { "unknown", NULL }; + + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + if (g_strcmp0 (str, "o") == 0) { + g_set_error (error, 1, 0, + /* Translators: the first %s is the partial value entered by + * the user, the second %s a list of compatible values. + */ + _("'%s' is ambiguous (%s)"), str, "on x off"); + return FALSE; + } + + if (nmc_string_is_valid (str, s_true, NULL)) + *val = NMC_TRI_STATE_YES; + else if (nmc_string_is_valid (str, s_false, NULL)) + *val = NMC_TRI_STATE_NO; + else if (nmc_string_is_valid (str, s_unknown, NULL)) + *val = NMC_TRI_STATE_UNKNOWN; + else { + g_set_error (error, 1, 0, + _("'%s' is not valid; use [%s], [%s] or [%s]"), + str, "true, yes, on", "false, no, off", "unknown"); + return FALSE; + } + return TRUE; +} + /* * Ask user for input and return the string. * The caller is responsible for freeing the returned string. diff --git a/clients/cli/utils.h b/clients/cli/utils.h index 77e697af6..ba649f8fa 100644 --- a/clients/cli/utils.h +++ b/clients/cli/utils.h @@ -32,6 +32,12 @@ typedef struct { gboolean found; } nmc_arg_t; +typedef enum { + NMC_TRI_STATE_NO, + NMC_TRI_STATE_YES, + NMC_TRI_STATE_UNKNOWN, +} NMCTriStateValue; + /* === Functions === */ int matches (const char *cmd, const char *pattern); int next_arg (int *argc, char ***argv); @@ -62,6 +68,7 @@ gboolean nmc_string_to_uint (const char *str, unsigned long int max, unsigned long int *value); gboolean nmc_string_to_bool (const char *str, gboolean *val_bool, GError **error); +gboolean nmc_string_to_tristate (const char *str, NMCTriStateValue *val, GError **error); char *nmc_ip4_address_as_string (guint32 ip, GError **error); char *nmc_ip6_address_as_string (const struct in6_addr *ip, GError **error); void nmc_terminal_erase_line (void); diff --git a/config.h.in b/config.h.in index 689a497ea..ce3d6c43c 100644 --- a/config.h.in +++ b/config.h.in @@ -151,7 +151,7 @@ /* Define if more asserts are enabled */ #undef NM_MORE_ASSERTS -/* Define if more asserts are enabled */ +/* Define if more debug logging is enabled */ #undef NM_MORE_LOGGING /* Name of package */ diff --git a/configure b/configure index 363895c29..8c825c28b 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for NetworkManager 1.0.4. +# Generated by GNU Autoconf 2.69 for NetworkManager 1.0.6. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='NetworkManager' PACKAGE_TARNAME='NetworkManager' -PACKAGE_VERSION='1.0.4' -PACKAGE_STRING='NetworkManager 1.0.4' +PACKAGE_VERSION='1.0.6' +PACKAGE_STRING='NetworkManager 1.0.6' PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager' PACKAGE_URL='' @@ -1680,7 +1680,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures NetworkManager 1.0.4 to adapt to many kinds of systems. +\`configure' configures NetworkManager 1.0.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1750,7 +1750,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of NetworkManager 1.0.4:";; + short | recursive ) echo "Configuration of NetworkManager 1.0.6:";; esac cat <<\_ACEOF @@ -2032,7 +2032,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -NetworkManager configure 1.0.4 +NetworkManager configure 1.0.6 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2576,7 +2576,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by NetworkManager $as_me 1.0.4, which was +It was created by NetworkManager $as_me 1.0.6, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3446,7 +3446,7 @@ fi # Define the identity of the package. PACKAGE='NetworkManager' - VERSION='1.0.4' + VERSION='1.0.6' cat >>confdefs.h <<_ACEOF @@ -16731,9 +16731,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu NM_MAJOR_VERSION=1 NM_MINOR_VERSION=0 -NM_MICRO_VERSION=4 -NM_VERSION=1.0.4 -NM_GIT_SHA=f27429138ff951309556c30c67e2f34e7ed29281 +NM_MICRO_VERSION=6 +NM_VERSION=1.0.6 +NM_GIT_SHA=59deb78f851961eec159ba7e11c01f5d9ae667d4 @@ -23258,9 +23258,9 @@ fi GLIB_MAKEFILE='$(top_srcdir)/Makefile.glib' -GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0` +GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` -GLIB_MKENUMS=`pkg-config --variable=glib_mkenums glib-2.0` +GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` @@ -26415,7 +26415,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by NetworkManager $as_me 1.0.4, which was +This file was extended by NetworkManager $as_me 1.0.6, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26481,7 +26481,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -NetworkManager config.status 1.0.4 +NetworkManager config.status 1.0.6 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 381b6215d..74dacb63a 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.63]) dnl The NM version number m4_define([nm_major_version], [1]) m4_define([nm_minor_version], [0]) -m4_define([nm_micro_version], [4]) +m4_define([nm_micro_version], [6]) m4_define([nm_version], [nm_major_version.nm_minor_version.nm_micro_version]) m4_define([nm_git_sha], [m4_esyscmd([ ( [ -d ./.git/ ] && [ "$(readlink -f ./.git/)" = "$(readlink -f "$(git rev-parse --git-dir 2>/dev/null)" 2>/dev/null)" ] && git rev-parse --verify -q HEAD 2>/dev/null ) || true ])]) @@ -588,9 +588,9 @@ fi GLIB_MAKEFILE='$(top_srcdir)/Makefile.glib' AC_SUBST(GLIB_MAKEFILE) -GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0` +GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` AC_SUBST(GLIB_GENMARSHAL) -GLIB_MKENUMS=`pkg-config --variable=glib_mkenums glib-2.0` +GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` AC_SUBST(GLIB_MKENUMS) AC_ARG_WITH(dbus-sys-dir, AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is])) @@ -848,7 +848,7 @@ fi AC_ARG_ENABLE(more-logging, AS_HELP_STRING([--enable-more-logging], [Enable more debug logging (default: no)])) if test "${enable_more_logging}" = "yes"; then - AC_DEFINE(NM_MORE_LOGGING, [1], [Define if more asserts are enabled]) + AC_DEFINE(NM_MORE_LOGGING, [1], [Define if more debug logging is enabled]) fi AC_ARG_ENABLE(lto, AS_HELP_STRING([--enable-lto], [Enable Link Time Optimization for smaller size (default: no)])) diff --git a/data/85-nm-unmanaged.rules b/data/85-nm-unmanaged.rules index aefab5c46..9d2ad7737 100644 --- a/data/85-nm-unmanaged.rules +++ b/data/85-nm-unmanaged.rules @@ -2,11 +2,12 @@ # To override or extend the rules place a file in /etc/udev/rules.d SUBSYSTEM!="net", GOTO="nm_unmanaged_end" +ACTION!="add|change", GOTO="nm_unmanaged_end" # Determine ID_NET_DRIVER if there's no ID_NET_DRIVER or DRIVERS (old udev?) ENV{ID_NET_DRIVER}=="?*", GOTO="nm_unmanaged_driver" DRIVERS=="?*", GOTO="nm_unmanaged_driver" -PROGRAM="/bin/sh -c '/usr/sbin/ethtool -i $env{INTERFACE} |/bin/sed -n s/^driver:\ //p'", RESULT=="?*", ENV{ID_NET_DRIVER}="%c" +PROGRAM="/bin/sh -c '/usr/sbin/ethtool -i $1 | /bin/sed -n s/^driver:\ //p' -- $env{INTERFACE}", RESULT=="?*", ENV{ID_NET_DRIVER}="%c" LABEL="nm_unmanaged_driver" # VirtualBox host networking. Out-of-tree driver that looks like an ordinary @@ -19,13 +20,13 @@ ENV{INTERFACE}=="vboxnet[0-9]*", ENV{NM_UNMANAGED}="1" # Ethernet. No parent device (lives in /virtual/), no support for # ethtool to identify the driver. They have their own MAC prefix that # can not be changed. -PROGRAM="/bin/cat %S%p/address", RESULT=="00:50:56:*", ENV{INTERFACE}=="vmnet[0-9]*", ENV{NM_UNMANAGED}="1" +ATTR{address}=="00:50:56:*", ENV{INTERFACE}=="vmnet[0-9]*", ENV{NM_UNMANAGED}="1" # Parallels Workstation host networking. Out-of-tree driver that looks like # an ordinary Ethernet. No parent device (lives in /virtual/), no support for # ethtool to identify the driver and the interface name is too generic. # However, they have their own MAC prefix that can not be changed. -PROGRAM="/bin/cat %S%p/address", RESULT=="00:1c:42:*", ENV{INTERFACE}=="vnic[0-9]*", ENV{NM_UNMANAGED}="1" +ATTR{address}=="00:1c:42:*", ENV{INTERFACE}=="vnic[0-9]*", ENV{NM_UNMANAGED}="1" # Virtual Ethernet device pair. Often used to communicate with a peer interface # in another net namespace and managed by libvirt, Docker or the like. diff --git a/docs/api/html/index.html b/docs/api/html/index.html index c2c59933b..5656932f8 100644 --- a/docs/api/html/index.html +++ b/docs/api/html/index.html @@ -14,7 +14,7 @@
-

Version 1.0.4 +

Version 1.0.6

diff --git a/docs/api/html/ref-settings.html b/docs/api/html/ref-settings.html index 10405a35e..501656bca 100644 --- a/docs/api/html/ref-settings.html +++ b/docs/api/html/ref-settings.html @@ -625,6 +625,12 @@ Interface name of the master device or UUID of the master connection. +
metered
+
NMMetered (int32)
+

+Whether the connection is metered.
+
+
 
name
string
connection
@@ -1800,6 +1806,18 @@
0
If non-zero, request that the device use only the specified speed. In Mbit/s, ie 100 == 100Mbit/s. + +
wake-on-lan
+
uint32
+
1
+The NMSettingWiredWakeOnLan options to enable. Not all devices support all options. May be any combination of NM_SETTING_WIRED_WAKE_ON_LAN_PHY (0x2), NM_SETTING_WIRED_WAKE_ON_LAN_UNICAST (0x4), NM_SETTING_WIRED_WAKE_ON_LAN_MULTICAST (0x8), NM_SETTING_WIRED_WAKE_ON_LAN_BROADCAST (0x10), NM_SETTING_WIRED_WAKE_ON_LAN_ARP (0x20), NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC (0x40). + + +
wake-on-lan-password
+
string
+

+If specified, the password used with magic-packet-based Wake-on-LAN, represented as an Ethernet MAC address.  If NULL, no password will be required.
+
 
 
diff --git a/docs/api/html/spec.html b/docs/api/html/spec.html index bcd634dd7..7f7559c57 100644 --- a/docs/api/html/spec.html +++ b/docs/api/html/spec.html @@ -1,4 +1,4 @@ -NetworkManager D-Bus Interface Specification version 1.0.4

NetworkManager D-Bus Interface Specification

Version 1.0.4

Copyright (C) 2008 - 2011 Red Hat, Inc.
Copyright (C) 2008 - 2009 Novell, Inc.
+

NetworkManager D-Bus Interface Specification

Version 1.0.6

Copyright (C) 2008 - 2011 Red Hat, Inc.
Copyright (C) 2008 - 2009 Novell, Inc.

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 @@ -381,6 +381,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Metered - + u - + (read) + (NM_METERED) +
+ Wheter the connectivity is metered. This is equivalent to the + metered property of the device associated with the primary + connection.
ActivatingConnection - o - (read)
@@ -478,7 +486,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.u - (read)
The maximum bitrate this access point is capable of, in kilobits/second (Kb/s).
Strength - y - - (read)
The current signal quality of the access point, in percent.

Sets of flags:

NM_802_11_AP_FLAGS

+ (read)
The current signal quality of the access point, in percent.
LastSeen - + i - + (read)
+ The timestamp (in CLOCK_BOOTTIME seconds) for the last time the access + point was found in scan results. A value of -1 means the access point + has never been found in scan results. +

Sets of flags:

NM_802_11_AP_FLAGS

Flags describing the general capabilities of the access point.
NM_802_11_AP_FLAGS_NONE = 0x0
Null capability - says nothing about the access point.
NM_802_11_AP_FLAGS_PRIVACY = 0x1
Access point supports privacy measures.

NM_802_11_AP_SEC

Flags describing the security capabilities of the access point. @@ -635,6 +649,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.u - (read)
The device MTU (maximum transmission unit). +
Metered - + u - + (read) + (NM_METERED) +
+ Whether the amount of traffic flowing through the device is + subject to limitations, for example set by service providers.

Enumerated types:

NM_DEVICE_STATE

NM_DEVICE_STATE_UNKNOWN = 0
The device is in an unknown state.
NM_DEVICE_STATE_UNMANAGED = 10
@@ -817,6 +838,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
NM_DEVICE_STATE_REASON_PARENT_MANAGED_CHANGED = 62
The device parent's management changed. +

NM_METERED

NM_METERED_UNKNOWN = 0
+ The device metered status is unknown. +
NM_METERED_YES = 1
+ The device is metered and the value was statically set. +
NM_METERED_NO = 2
+ The device is not metered and the value was statically set. +
NM_METERED_GUESS_YES = 3
+ The device is metered and the value was guessed. +
NM_METERED_GUESS_NO = 4
+ The device is not metered and the value was guessed.

Sets of flags:

NM_DEVICE_CAP

NM_DEVICE_CAP_NONE = 0x0
Null capability.
NM_DEVICE_CAP_NM_SUPPORTED = 0x1
The device is supported by NetworkManager.
NM_DEVICE_CAP_CARRIER_DETECT = 0x2
The device supports carrier detection.

Structure types:

NM_DEVICE_STATE_REASON_STRUCT - ( u: state, u: reason ) @@ -885,7 +916,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Parameters

options - a{sv}
- Options of scan (currently unused argument). + Options of scan. + Currently 'ssids' option with value of "aay" type is supported.

Signals:

PropertiesChanged ( a{sv}: properties )

@@ -2372,6 +2404,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  • NM_DEVICE_STATE_REASON_STRUCT - ( u, u )
  • NM_DEVICE_TYPE + - u
  • NM_METERED - u
  • NM_SECRET_AGENT_CAPABILITIES - u
  • NM_SECRET_AGENT_GET_SECRETS_FLAGS - u
  • NM_STATE diff --git a/docs/api/settings-spec.xml b/docs/api/settings-spec.xml index f1b507fe0..6f8645a76 100644 --- a/docs/api/settings-spec.xml +++ b/docs/api/settings-spec.xml @@ -88,6 +88,7 @@ idstringA human readable unique identifier for the connection, like "Work Wi-Fi" or "T-Mobile 3G". interface-namestringThe name of the network interface this connection is bound to. If not set, then the connection can be attached to any interface of the appropriate type (subject to restrictions imposed by other settings). For software devices this specifies the name of the created device. For connection types where interface names cannot easily be made persistent (e.g. mobile broadband or USB Ethernet), this property should not be used. Setting this property restricts the interfaces a connection can be used with, and if interface names change or are reordered the connection may be applied to the wrong interface. masterstringInterface name of the master device or UUID of the master connection. + meteredNMMetered (int32)Whether the connection is metered. namestringconnectionThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired". permissionsarray of string[]An array of strings defining what access a given user has to this connection. If this is NULL or empty, all users are allowed to access this connection. Otherwise a user is allowed to access this connection if and only if they are in this list. Each entry is of the form "[type]:[id]:[reserved]"; for example, "user:dcbw:blah". At this time only the "user" [type] is allowed. Any other values are ignored and reserved for future use. [id] is the username that this permission refers to, which may not contain the ":" character. Any [reserved] information present must be ignored and is reserved for future use. All of [type], [id], and [reserved] must be valid UTF-8. read-onlybooleanFALSEFALSE if the connection can be modified using the provided settings service's D-Bus interface with the right privileges, or TRUE if the connection is read-only and cannot be modified. @@ -263,6 +264,8 @@ s390-optionsdict of string to string{}Dictionary of key/value pairs of s390-specific device options. Both keys and values must be strings. Allowed keys include "portno", "layer2", "portname", "protocol", among others. Key names must contain only alphanumeric characters (ie, [a-zA-Z0-9]). s390-subchannelsarray of string[]Identifies specific subchannels that this network device uses for communication with z/VM or s390 host. Like the "mac-address" property for non-z/VM devices, this property can be used to ensure this connection only applies to the network device that uses these subchannels. The list should contain exactly 3 strings, and each string may only be composed of hexadecimal characters and the period (.) character. speeduint320If non-zero, request that the device use only the specified speed. In Mbit/s, ie 100 == 100Mbit/s. + wake-on-lanuint321The NMSettingWiredWakeOnLan options to enable. Not all devices support all options. May be any combination of NM_SETTING_WIRED_WAKE_ON_LAN_PHY (0x2), NM_SETTING_WIRED_WAKE_ON_LAN_UNICAST (0x4), NM_SETTING_WIRED_WAKE_ON_LAN_MULTICAST (0x8), NM_SETTING_WIRED_WAKE_ON_LAN_BROADCAST (0x10), NM_SETTING_WIRED_WAKE_ON_LAN_ARP (0x20), NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC (0x40). + wake-on-lan-passwordstringIf specified, the password used with magic-packet-based Wake-on-LAN, represented as an Ethernet MAC address. If NULL, no password will be required. 802-11-wireless settingKey NameValue TypeDefault ValueValue Descriptionbandstring802.11 frequency band of the network. One of "a" for 5GHz 802.11a or "bg" for 2.4GHz 802.11. This will lock associations to the Wi-Fi network to the specific band, i.e. if "a" is specified, the device will not associate with the same network in the 2.4GHz band even if the network's settings are compatible. This setting depends on specific driver capability and may not work with all drivers. diff --git a/docs/api/spec.html b/docs/api/spec.html index bcd634dd7..7f7559c57 100644 --- a/docs/api/spec.html +++ b/docs/api/spec.html @@ -1,4 +1,4 @@ -NetworkManager D-Bus Interface Specification version 1.0.4

    NetworkManager D-Bus Interface Specification

    Version 1.0.4

    Copyright (C) 2008 - 2011 Red Hat, Inc.
    Copyright (C) 2008 - 2009 Novell, Inc.
    +

    NetworkManager D-Bus Interface Specification

    Version 1.0.6

    Copyright (C) 2008 - 2011 Red Hat, Inc.
    Copyright (C) 2008 - 2009 Novell, Inc.

    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 @@ -381,6 +381,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

    Metered - + u - + (read) + (NM_METERED) +
    + Wheter the connectivity is metered. This is equivalent to the + metered property of the device associated with the primary + connection.
    ActivatingConnection - o - (read)
    @@ -478,7 +486,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.u - (read)
    The maximum bitrate this access point is capable of, in kilobits/second (Kb/s).
    Strength - y - - (read)
    The current signal quality of the access point, in percent.

    Sets of flags:

    NM_802_11_AP_FLAGS

    + (read)
    The current signal quality of the access point, in percent.
    LastSeen - + i - + (read)
    + The timestamp (in CLOCK_BOOTTIME seconds) for the last time the access + point was found in scan results. A value of -1 means the access point + has never been found in scan results. +

    Sets of flags:

    NM_802_11_AP_FLAGS

    Flags describing the general capabilities of the access point.
    NM_802_11_AP_FLAGS_NONE = 0x0
    Null capability - says nothing about the access point.
    NM_802_11_AP_FLAGS_PRIVACY = 0x1
    Access point supports privacy measures.

    NM_802_11_AP_SEC

    Flags describing the security capabilities of the access point. @@ -635,6 +649,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.u - (read)
    The device MTU (maximum transmission unit). +
    Metered - + u - + (read) + (NM_METERED) +
    + Whether the amount of traffic flowing through the device is + subject to limitations, for example set by service providers.

    Enumerated types:

    NM_DEVICE_STATE

    NM_DEVICE_STATE_UNKNOWN = 0
    The device is in an unknown state.
    NM_DEVICE_STATE_UNMANAGED = 10
    @@ -817,6 +838,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
    NM_DEVICE_STATE_REASON_PARENT_MANAGED_CHANGED = 62
    The device parent's management changed. +

    NM_METERED

    NM_METERED_UNKNOWN = 0
    + The device metered status is unknown. +
    NM_METERED_YES = 1
    + The device is metered and the value was statically set. +
    NM_METERED_NO = 2
    + The device is not metered and the value was statically set. +
    NM_METERED_GUESS_YES = 3
    + The device is metered and the value was guessed. +
    NM_METERED_GUESS_NO = 4
    + The device is not metered and the value was guessed.

    Sets of flags:

    NM_DEVICE_CAP

    NM_DEVICE_CAP_NONE = 0x0
    Null capability.
    NM_DEVICE_CAP_NM_SUPPORTED = 0x1
    The device is supported by NetworkManager.
    NM_DEVICE_CAP_CARRIER_DETECT = 0x2
    The device supports carrier detection.

    Structure types:

    NM_DEVICE_STATE_REASON_STRUCT - ( u: state, u: reason ) @@ -885,7 +916,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

    Parameters

    options - a{sv}
    - Options of scan (currently unused argument). + Options of scan. + Currently 'ssids' option with value of "aay" type is supported.

    Signals:

    PropertiesChanged ( a{sv}: properties )

    @@ -2372,6 +2404,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  • NM_DEVICE_STATE_REASON_STRUCT - ( u, u )
  • NM_DEVICE_TYPE + - u
  • NM_METERED - u
  • NM_SECRET_AGENT_CAPABILITIES - u
  • NM_SECRET_AGENT_GET_SECRETS_FLAGS - u
  • NM_STATE diff --git a/docs/api/version.xml b/docs/api/version.xml index ee90284c2..af0b7ddbf 100644 --- a/docs/api/version.xml +++ b/docs/api/version.xml @@ -1 +1 @@ -1.0.4 +1.0.6 diff --git a/docs/libnm-glib/html/NMAccessPoint.html b/docs/libnm-glib/html/NMAccessPoint.html index 9182a27a7..b6e6a3788 100644 --- a/docs/libnm-glib/html/NMAccessPoint.html +++ b/docs/libnm-glib/html/NMAccessPoint.html @@ -121,6 +121,14 @@
  • + + + + + + + + + @@ -256,6 +269,10 @@ + + + + @@ -546,6 +563,35 @@ nm_access_point_get_strength ( +

    nm_access_point_get_last_seen ()

    +
    gint32
    +nm_access_point_get_last_seen (NMAccessPoint *ap);
    +

    Returns the timestamp (in CLOCK_BOOTTIME seconds) for the last time the +access point was found in scan results. A value of -1 means the access +point has not been found in a scan.

    +
    +

    Parameters

    +
    +gint32 + +nm_access_point_get_last_seen () +
    GSList * @@ -177,6 +185,11 @@ Read
    gintlast-seenRead
    guint max-bitrate Read
    #defineNM_ACCESS_POINT_LAST_SEEN
    #define NM_ACCESS_POINT_HW_ADDRESS
    +++++ + + + + + +

    ap

    a NMAccessPoint

     
  • +
    +
    +

    Returns

    +

    the last seen time in seconds

    +
    +

    Since: 1.0.6

    +
    +
    +

    nm_access_point_filter_connections ()

    GSList *
     nm_access_point_filter_connections (NMAccessPoint *ap,
    @@ -560,7 +606,7 @@ use NMDevice using nm_device_filter_connections() and finally
     filter that list with this function.

    -

    Parameters

    +

    Parameters

    @@ -583,7 +629,7 @@ filter that list with this function.

    -

    Returns

    +

    Returns

    a list of NMConnection objects that could be activated with the given ap . @@ -605,7 +651,7 @@ the connection may be activated with that AP. The connection must match the 's SSID, (if given) BSSID, and other attributes like security settings, channel, band, etc.

    -

    Parameters

    +

    Parameters

    @@ -629,7 +675,7 @@ against

    -

    Returns

    +

    Returns

    TRUE if the connection may be activated with this Wi-Fi AP, FALSE if it cannot be.

    @@ -645,7 +691,7 @@ nm_access_point_get_hw_address (

    Gets the hardware (MAC) address of the access point.

    -

    Parameters

    +

    Parameters

    @@ -660,7 +706,7 @@ nm_access_point_get_hw_address (
    -

    Returns

    +

    Returns

    the hardware address of the access point. This is the internal string used by the access point and must not be modified.

    @@ -723,6 +769,12 @@ access point and must not be modified.


    +

    NM_ACCESS_POINT_LAST_SEEN

    +
    #define NM_ACCESS_POINT_LAST_SEEN   "last-seen"
    +
    +
    +
    +

    NM_ACCESS_POINT_HW_ADDRESS

    #define NM_ACCESS_POINT_HW_ADDRESS  "hw-address"
     
    @@ -765,6 +817,18 @@ access point and must not be modified.


    +

    The “last-seen” property

    +
      “last-seen”                gint
    +

    The timestamp (in CLOCK_BOOTTIME seconds) for the last time the +access point was found in scan results. A value of -1 means the +access point has not been found in a scan.

    +

    Flags: Read

    +

    Allowed values: >= -1

    +

    Default value: -1

    +

    Since: 1.0.6

    +
    +
    +

    The “max-bitrate” property

      “max-bitrate”              guint

    The maximum bit rate of the access point in kbit/s.

    diff --git a/docs/libnm-glib/html/NMActiveConnection.html b/docs/libnm-glib/html/NMActiveConnection.html index 51037dca3..e14a0408a 100644 --- a/docs/libnm-glib/html/NMActiveConnection.html +++ b/docs/libnm-glib/html/NMActiveConnection.html @@ -655,7 +655,7 @@ nm_active_connection_get_ip4_config (

    Returns

    the NMIP4Config, or NULL if the -connection is not in the NM_ACTIVE_CONNECTION_STATE_ACTIVATED +connection is not in the NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.

    [transfer none]

    @@ -687,7 +687,7 @@ nm_active_connection_get_dhcp4_config (

    Returns

    the NMDHCP4Config, or NULL if the connection does not use DHCP, or is not in the -NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.

    +NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.

    [transfer none]

    Since: 0.9.10

    @@ -743,7 +743,7 @@ nm_active_connection_get_ip6_config (

    Returns

    the NMIP6Config, or NULL if the -connection is not in the NM_ACTIVE_CONNECTION_STATE_ACTIVATED +connection is not in the NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.

    [transfer none]

    @@ -775,7 +775,7 @@ nm_active_connection_get_dhcp6_config (

    Returns

    the NMDHCP6Config, or NULL if the connection does not use DHCPv6, or is not in the -NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.

    +NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.

    [transfer none]

    Since: 0.9.10

    diff --git a/docs/libnm-glib/html/NMSecretAgent.html b/docs/libnm-glib/html/NMSecretAgent.html index 8acd02c17..354c1209d 100644 --- a/docs/libnm-glib/html/NMSecretAgent.html +++ b/docs/libnm-glib/html/NMSecretAgent.html @@ -289,7 +289,7 @@ something like this:

    NM_SETTING_WIRELESS_SECURITY_PSK, "my really cool PSK", NULL); nm_connection_add_setting (secrets, NM_SETTING (s_wsec)); -secrets_hash = nm_connection_to_hash (secrets, NM_SETTING_HASH_FLAG_ALL); +secrets_hash = nm_connection_to_hash (secrets, NM_SETTING_HASH_FLAG_ALL); (call the NMSecretAgentGetSecretsFunc with secrets_hash) diff --git a/docs/libnm-glib/html/api-index-full.html b/docs/libnm-glib/html/api-index-full.html index 1f09388cc..e11ae148c 100644 --- a/docs/libnm-glib/html/api-index-full.html +++ b/docs/libnm-glib/html/api-index-full.html @@ -56,6 +56,10 @@
    +NMAccessPoint:last-seen, object property in NMAccessPoint +
    +
    +
    NMAccessPoint:max-bitrate, object property in NMAccessPoint
    @@ -116,6 +120,10 @@
    +nm_access_point_get_last_seen, function in NMAccessPoint +
    +
    +
    nm_access_point_get_max_bitrate, function in NMAccessPoint
    @@ -144,6 +152,10 @@
    +NM_ACCESS_POINT_LAST_SEEN, macro in NMAccessPoint +
    +
    +
    NM_ACCESS_POINT_MAX_BITRATE, macro in NMAccessPoint
    diff --git a/docs/libnm-glib/html/index.html b/docs/libnm-glib/html/index.html index bec4797cf..6a1342929 100644 --- a/docs/libnm-glib/html/index.html +++ b/docs/libnm-glib/html/index.html @@ -15,7 +15,7 @@

    - for libnm-glib 1.0.4 + for libnm-glib 1.0.6 The latest version of this documentation can be found on-line at https://developer.gnome.org/libnm-glib/0.9/. diff --git a/docs/libnm-glib/html/index.sgml b/docs/libnm-glib/html/index.sgml index 5b020fd0b..80069edb6 100644 --- a/docs/libnm-glib/html/index.sgml +++ b/docs/libnm-glib/html/index.sgml @@ -678,6 +678,7 @@ + @@ -691,12 +692,14 @@ + + diff --git a/docs/libnm-glib/html/libnm-glib.devhelp2 b/docs/libnm-glib/html/libnm-glib.devhelp2 index 00b0f0756..017e1861f 100644 --- a/docs/libnm-glib/html/libnm-glib.devhelp2 +++ b/docs/libnm-glib/html/libnm-glib.devhelp2 @@ -467,6 +467,7 @@ + @@ -479,11 +480,13 @@ + + diff --git a/docs/libnm-glib/libnm-glib-sections.txt b/docs/libnm-glib/libnm-glib-sections.txt index d21040d20..420d1610f 100644 --- a/docs/libnm-glib/libnm-glib-sections.txt +++ b/docs/libnm-glib/libnm-glib-sections.txt @@ -10,6 +10,7 @@ NM_ACCESS_POINT_FREQUENCY NM_ACCESS_POINT_MODE NM_ACCESS_POINT_MAX_BITRATE NM_ACCESS_POINT_STRENGTH +NM_ACCESS_POINT_LAST_SEEN NM_ACCESS_POINT_HW_ADDRESS nm_access_point_new nm_access_point_get_flags @@ -21,6 +22,7 @@ nm_access_point_get_frequency nm_access_point_get_mode nm_access_point_get_max_bitrate nm_access_point_get_strength +nm_access_point_get_last_seen nm_access_point_filter_connections nm_access_point_connection_valid nm_access_point_get_hw_address diff --git a/docs/libnm-glib/version.xml b/docs/libnm-glib/version.xml index ee90284c2..af0b7ddbf 100644 --- a/docs/libnm-glib/version.xml +++ b/docs/libnm-glib/version.xml @@ -1 +1 @@ -1.0.4 +1.0.6 diff --git a/docs/libnm-util/html/index.html b/docs/libnm-util/html/index.html index 7be228838..453e0d983 100644 --- a/docs/libnm-util/html/index.html +++ b/docs/libnm-util/html/index.html @@ -15,7 +15,7 @@

    - for libnm-util 1.0.4 + for libnm-util 1.0.6 The latest version of this documentation can be found on-line at https://developer.gnome.org/libnm-util/0.9/. diff --git a/docs/libnm-util/version.xml b/docs/libnm-util/version.xml index ee90284c2..af0b7ddbf 100644 --- a/docs/libnm-util/version.xml +++ b/docs/libnm-util/version.xml @@ -1 +1 @@ -1.0.4 +1.0.6 diff --git a/docs/libnm/Makefile.am b/docs/libnm/Makefile.am index 28938f89f..2525856d5 100644 --- a/docs/libnm/Makefile.am +++ b/docs/libnm/Makefile.am @@ -53,7 +53,8 @@ IGNORE_HFILES= \ nm-setting-private.h \ nm-types.h \ nm-utils-private.h \ - nm-vpn-plugin-old.h + nm-vpn-plugin-old.h \ + nm-core-tests-enum-types.h # Images to copy into HTML directory. HTML_IMAGES = libnm.png diff --git a/docs/libnm/Makefile.in b/docs/libnm/Makefile.in index 54ad32871..bb41ba14c 100644 --- a/docs/libnm/Makefile.in +++ b/docs/libnm/Makefile.in @@ -455,7 +455,8 @@ IGNORE_HFILES = \ nm-setting-private.h \ nm-types.h \ nm-utils-private.h \ - nm-vpn-plugin-old.h + nm-vpn-plugin-old.h \ + nm-core-tests-enum-types.h # Images to copy into HTML directory. diff --git a/docs/libnm/html/NMAccessPoint.html b/docs/libnm/html/NMAccessPoint.html index 1daa7c012..4aa880dcb 100644 --- a/docs/libnm/html/NMAccessPoint.html +++ b/docs/libnm/html/NMAccessPoint.html @@ -114,6 +114,14 @@ +gint + + +nm_access_point_get_last_seen () + + + + GPtrArray * @@ -163,6 +171,11 @@ Read +gint +last-seen +Read + + guint max-bitrate Read @@ -242,6 +255,10 @@ #define +NM_ACCESS_POINT_LAST_SEEN + + +#define NM_ACCESS_POINT_HW_ADDRESS @@ -498,6 +515,35 @@ nm_access_point_get_strength ( +

    nm_access_point_get_last_seen ()

    +
    gint
    +nm_access_point_get_last_seen (NMAccessPoint *ap);
    +

    Returns the timestamp (in CLOCK_BOOTTIME seconds) for the last time the +access point was found in scan results. A value of -1 means the access +point has not been found in a scan.

    +
    +

    Parameters

    +
    +++++ + + + + + +

    ap

    a NMAccessPoint

     
    +
    +
    +

    Returns

    +

    the last seen time in seconds

    +
    +

    Since: 1.0.6

    +
    +
    +

    nm_access_point_filter_connections ()

    GPtrArray *
     nm_access_point_filter_connections (NMAccessPoint *ap,
    @@ -512,7 +558,7 @@ use NMDevice using nm_device_filter_connections() and finally filter that list
     with this function.

    -

    Parameters

    +

    Parameters

    @@ -535,7 +581,7 @@ filter.

    -

    Returns

    +

    Returns

    an array of NMConnections that could be activated with the given ap . The array should @@ -555,7 +601,7 @@ the connection may be activated with that AP. The connection must match the 's SSID, (if given) BSSID, and other attributes like security settings, channel, band, etc.

    -

    Parameters

    +

    Parameters

    @@ -579,7 +625,7 @@ against

    -

    Returns

    +

    Returns

    TRUE if the connection may be activated with this Wi-Fi AP, FALSE if it cannot be.

    @@ -642,6 +688,12 @@ against


    +

    NM_ACCESS_POINT_LAST_SEEN

    +
    #define NM_ACCESS_POINT_LAST_SEEN   "last-seen"
    +
    +
    +
    +

    NM_ACCESS_POINT_HW_ADDRESS

    #define NM_ACCESS_POINT_HW_ADDRESS  "hw-address"
     
    @@ -686,6 +738,18 @@ against


    +

    The “last-seen” property

    +
      “last-seen”                gint
    +

    The timestamp (in CLOCK_BOOTTIME seconds) for the last time the +access point was found in scan results. A value of -1 means the +access point has not been found in a scan.

    +

    Flags: Read

    +

    Allowed values: >= -1

    +

    Default value: -1

    +

    Since: 1.0.6

    +
    +
    +

    The “max-bitrate” property

      “max-bitrate”              guint

    The maximum bit rate of the access point in kbit/s.

    diff --git a/docs/libnm/html/NMClient.html b/docs/libnm/html/NMClient.html index 950d72514..1914ba7b1 100644 --- a/docs/libnm/html/NMClient.html +++ b/docs/libnm/html/NMClient.html @@ -523,6 +523,11 @@ Read +guint +metered +Read + + gboolean networking-enabled Read / Write @@ -710,6 +715,10 @@ #define +NM_CLIENT_METERED + + +#define NM_CLIENT_DEVICE_ADDED @@ -2989,6 +2998,12 @@ nm_client_reload_connections_finish (
    +

    NM_CLIENT_METERED

    +
    #define NM_CLIENT_METERED "metered"
    +
    +
    +
    +

    NM_CLIENT_DEVICE_ADDED

    #define NM_CLIENT_DEVICE_ADDED "device-added"
     
    @@ -3023,7 +3038,7 @@ nm_client_reload_connections_finish (NMClientPermission values indicate various permissions that NetworkManager clients can obtain to perform certain tasks on behalf of the current user.

    -

    Members

    +

    Members

    @@ -3143,7 +3158,7 @@ clients can obtain to perform certain tasks on behalf of the current user.

    NMClientPermissionResult values indicate what authorizations and permissions the user requires to obtain a given NMClientPermission

    -

    Members

    +

    Members

    @@ -3192,7 +3207,7 @@ the user requires to obtain a given NMManagerError, NMSettingsError, NMAgentManagerError, and NMConnectionError.

    -

    Members

    +

    Members

    @@ -3299,6 +3314,15 @@ modified by calling
    +

    The “metered” property

    +
      “metered”                  guint
    +

    Whether the connectivity is metered.

    +

    Flags: Read

    +

    Default value: 0

    +

    Since: 1.0.6

    +
    +
    +

    The “networking-enabled” property

      “networking-enabled”       gboolean

    Whether networking is enabled.

    diff --git a/docs/libnm/html/NMDevice.html b/docs/libnm/html/NMDevice.html index 8065247c7..ff38ac071 100644 --- a/docs/libnm/html/NMDevice.html +++ b/docs/libnm/html/NMDevice.html @@ -255,6 +255,14 @@
    + + + + + + + + + @@ -601,6 +614,10 @@ + + + +
    +NMMetered + +nm_device_get_metered () +
    char ** @@ -446,6 +454,11 @@
    guintmeteredRead
    guint mtu Read
    #define NM_DEVICE_MTU
    #defineNM_DEVICE_METERED
    @@ -1410,6 +1427,33 @@ product name is unknown, this returns the interface name.


    +

    nm_device_get_metered ()

    +
    NMMetered
    +nm_device_get_metered (NMDevice *device);
    +

    Gets the metered setting of a NMDevice.

    +
    +

    Parameters

    +
    +++++ + + + + + +

    device

    a NMDevice

     
    +
    +
    +

    Returns

    +

    the metered setting.

    +
    +

    Since: 1.0.6

    +
    +
    +

    nm_device_disambiguate_names ()

    char **
     nm_device_disambiguate_names (NMDevice **devices,
    @@ -1418,7 +1462,7 @@ nm_device_disambiguate_names (devices
     .

    -

    Parameters

    +

    Parameters

    @@ -1441,7 +1485,7 @@ devices in devices
    -

    Returns

    +

    Returns

    the device names.

    [transfer full][array zero-terminated=1]

    @@ -1457,7 +1501,7 @@ nm_device_disconnect ( -

    Parameters

    +

    Parameters

    @@ -1484,7 +1528,7 @@ request.

    -

    Returns

    +

    Returns

    TRUE on success, FALSE on error, in which case error will be set.

    @@ -1501,7 +1545,7 @@ nm_device_disconnect_async ( -

    Parameters

    +

    Parameters

    @@ -1543,7 +1587,7 @@ nm_device_disconnect_finish (GError **error);

    Gets the result of a call to nm_device_disconnect_async().

    -

    Parameters

    +

    Parameters

    @@ -1570,7 +1614,7 @@ nm_device_disconnect_finish ( -

    Returns

    +

    Returns

    TRUE on success, FALSE on error, in which case error will be set.

    @@ -1584,7 +1628,7 @@ nm_device_delete (GError **error);

    Deletes the software device. Hardware devices can't be deleted.

    -

    Parameters

    +

    Parameters

    @@ -1611,7 +1655,7 @@ nm_device_delete ( -

    Returns

    +

    Returns

    TRUE on success, FALSE on error, in which case error will be set.

    @@ -1627,7 +1671,7 @@ nm_device_delete_async ( -

    Parameters

    +

    Parameters

    @@ -1669,7 +1713,7 @@ nm_device_delete_finish (GError **error);

    Gets the result of a call to nm_device_delete_async().

    -

    Parameters

    +

    Parameters

    @@ -1696,7 +1740,7 @@ nm_device_delete_finish ( -

    Returns

    +

    Returns

    TRUE on success, FALSE on error, in which case error will be set.

    @@ -1718,7 +1762,7 @@ Ethernet, Bluetooth, Wi-Fi WPA connections, or any other connection that is incompatible with the device. To get the full list of connections see nm_client_get_connections().

    -

    Parameters

    +

    Parameters

    @@ -1740,7 +1784,7 @@ incompatible with the device. To get the full list of connections see
    -

    Returns

    +

    Returns

    an array of NMConnections that could be activated with the given device . The array @@ -1763,7 +1807,7 @@ network, and will not be valid if it describes a WPA network, or if it is an Ethernet, Bluetooth, WWAN, etc connection that is incompatible with the device.

    -

    Parameters

    +

    Parameters

    @@ -1787,7 +1831,7 @@ against

    -

    Returns

    +

    Returns

    TRUE if the connection may be activated with this device, FALSE if is incompatible with the device's capabilities and characteristics.

    @@ -1811,7 +1855,7 @@ device.

    compatibility of the given device and connection. But, in addition, it sets GError when FALSE is returned.

    -

    Parameters

    +

    Parameters

    @@ -1840,7 +1884,7 @@ against

    -

    Returns

    +

    Returns

    TRUE if the connection may be activated with this device, FALSE if is incompatible with the device's capabilities and characteristics.

    @@ -1854,7 +1898,7 @@ nm_device_get_setting_type (device .

    -

    Parameters

    +

    Parameters

    @@ -1869,7 +1913,7 @@ that can be used on device
    -

    Returns

    +

    Returns

    device 's associated NMSetting type

    @@ -2014,6 +2058,12 @@ that can be used on device
    #define NM_DEVICE_MTU "mtu"
     
    +
    +
    +

    NM_DEVICE_METERED

    +
    #define NM_DEVICE_METERED "metered"
    +
    +

    Property Details

    @@ -2142,6 +2192,15 @@ operations like addressing and routing.


    +

    The “metered” property

    +
      “metered”                  guint
    +

    Whether the device is metered.

    +

    Flags: Read

    +

    Default value: 0

    +

    Since: 1.0.6

    +
    +
    +

    The “mtu” property

      “mtu”                      guint

    The MTU of the device.

    diff --git a/docs/libnm/html/NMDeviceWifi.html b/docs/libnm/html/NMDeviceWifi.html index db0dca479..776aba148 100644 --- a/docs/libnm/html/NMDeviceWifi.html +++ b/docs/libnm/html/NMDeviceWifi.html @@ -113,6 +113,14 @@ +gboolean + + +nm_device_wifi_request_scan_options () + + + + void @@ -121,6 +129,14 @@ +void + + +nm_device_wifi_request_scan_options_async () + + + + gboolean @@ -527,6 +543,64 @@ set.


    +

    nm_device_wifi_request_scan_options ()

    +
    gboolean
    +nm_device_wifi_request_scan_options (NMDeviceWifi *device,
    +                                     GVariant *options,
    +                                     GCancellable *cancellable,
    +                                     GError **error);
    +

    Request NM to scan for access points on device +. Note that the function +returns immediately after requesting the scan, and it may take some time +after that for the scan to complete. +This is the same as nm_device_wifi_request_scan + except it accepts options + +for the scanning. The argument is the dictionary passed to RequestScan() +D-Bus call. Valid otions inside the dictionary are: +'ssids' => array of SSIDs (saay)

    +
    +

    Parameters

    +
    +++++ + + + + + + + + + + + + + + + + + + + + + + +

    device

    a NMDeviceWifi

     

    options

    dictionary with options for RequestScan(), or NULL

     

    cancellable

    a GCancellable, or NULL

     

    error

    location for a GError, or NULL

     
    +
    +
    +

    Returns

    +

    TRUE on success, FALSE on error, in which case error +will be +set.

    +
    +

    Since: 1.0.6

    +
    +
    +

    nm_device_wifi_request_scan_async ()

    void
     nm_device_wifi_request_scan_async (NMDeviceWifi *device,
    @@ -539,7 +613,7 @@ nm_device_wifi_request_scan_async (
     
    -

    Parameters

    +

    Parameters

    @@ -574,6 +648,67 @@ that for the scan to complete.


    +

    nm_device_wifi_request_scan_options_async ()

    +
    void
    +nm_device_wifi_request_scan_options_async
    +                               (NMDeviceWifi *device,
    +                                GVariant *options,
    +                                GCancellable *cancellable,
    +                                GAsyncReadyCallback callback,
    +                                gpointer user_data);
    +

    Request NM to scan for access points on device +. Note that callback + will be +called immediately after requesting the scan, and it may take some time after +that for the scan to complete. +This is the same as nm_device_wifi_request_scan_async + except it accepts options + +for the scanning. The argument is the dictionary passed to RequestScan() +D-Bus call. Valid otions inside the dictionary are: +'ssids' => array of SSIDs (saay)

    +
    +

    Parameters

    +
    +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    device

    a NMDeviceWifi

     

    options

    dictionary with options for RequestScan(), or NULL

     

    cancellable

    a GCancellable, or NULL

     

    callback

    callback to be called when the scan has been requested

     

    user_data

    caller-specific data passed to callback +

     
    +
    +

    Since: 1.0.6

    +
    +
    +

    nm_device_wifi_request_scan_finish ()

    gboolean
     nm_device_wifi_request_scan_finish (NMDeviceWifi *device,
    @@ -581,7 +716,7 @@ nm_device_wifi_request_scan_finish (GError **error);

    Gets the result of a call to nm_device_wifi_request_scan_async().

    -

    Parameters

    +

    Parameters

    @@ -608,7 +743,7 @@ nm_device_wifi_request_scan_finish (
    -

    Returns

    +

    Returns

    TRUE on success, FALSE on error, in which case error will be set.

    diff --git a/docs/libnm/html/NMSettingConnection.html b/docs/libnm/html/NMSettingConnection.html index f33e2b888..aef026589 100644 --- a/docs/libnm/html/NMSettingConnection.html +++ b/docs/libnm/html/NMSettingConnection.html @@ -241,6 +241,14 @@ nm_setting_connection_get_gateway_ping_timeout () +
    + + +
    +NMMetered + +nm_setting_connection_get_metered () +
    @@ -292,6 +300,11 @@ Read / Write +NMMetered +metered +Read / Write + + GStrv permissions Read / Write @@ -423,6 +436,10 @@ NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT +#define +NM_SETTING_CONNECTION_METERED + + enum NMSettingConnectionAutoconnectSlaves @@ -1264,6 +1281,32 @@ nm_setting_connection_get_gateway_ping_timeout property.

    +
    +
    +

    nm_setting_connection_get_metered ()

    +
    NMMetered
    +nm_setting_connection_get_metered (NMSettingConnection *setting);
    +
    +

    Parameters

    +
    +++++ + + + + + +

    setting

    the NMSettingConnection

     
    +
    +
    +

    Returns

    +

    the “metered” property of the setting.

    +
    +

    Since: 1.0.6

    +

    Types and Values

    @@ -1382,11 +1425,17 @@ property.


    +

    NM_SETTING_CONNECTION_METERED

    +
    #define NM_SETTING_CONNECTION_METERED        "metered"
    +
    +
    +
    +

    enum NMSettingConnectionAutoconnectSlaves

    NMSettingConnectionAutoconnectSlaves values indicate whether slave connections should be activated when master is activated.

    -

    Members

    +

    Members

    @@ -1512,6 +1561,15 @@ connection may be applied to the wrong interface.


    +

    The “metered” property

    +
      “metered”                  NMMetered
    +

    Whether the connection is metered.

    +

    Flags: Read / Write

    +

    Default value: NM_METERED_UNKNOWN

    +

    Since: 1.0.6

    +
    +
    +

    The “permissions” property

      “permissions”              GStrv

    An array of strings defining what access a given user has to this diff --git a/docs/libnm/html/NMSettingWired.html b/docs/libnm/html/NMSettingWired.html index 6255f6c83..1ee7de448 100644 --- a/docs/libnm/html/NMSettingWired.html +++ b/docs/libnm/html/NMSettingWired.html @@ -215,6 +215,21 @@ nm_setting_wired_get_valid_s390_options () +

    + + + + + + +
    +NMSettingWiredWakeOnLan + +nm_setting_wired_get_wake_on_lan () +
    const char * + +nm_setting_wired_get_wake_on_lan_password () +
    @@ -288,6 +303,17 @@ speed Read / Write / Construct + +guint +wake-on-lan +Read / Write / Construct + + + +gchar * +wake-on-lan-password +Read / Write +
    @@ -304,6 +330,10 @@ NM_SETTING_WIRED_SETTING_NAME +enum +NMSettingWiredWakeOnLan + + #define NM_SETTING_WIRED_PORT @@ -347,12 +377,22 @@ #define NM_SETTING_WIRED_S390_OPTIONS + +#define +NM_SETTING_WIRED_WAKE_ON_LAN + + +#define +NM_SETTING_WIRED_WAKE_ON_LAN_PASSWORD +

    Object Hierarchy

    -
        GObject
    +
        GFlags
    +    ╰── NMSettingWiredWakeOnLan
    +    GObject
         ╰── NMSetting
             ╰── NMSettingWired
     
    @@ -1055,6 +1095,62 @@ nm_setting_wired_get_valid_s390_options

    [transfer none]

    +
    +
    +

    nm_setting_wired_get_wake_on_lan ()

    +
    NMSettingWiredWakeOnLan
    +nm_setting_wired_get_wake_on_lan (NMSettingWired *setting);
    +

    Returns the Wake-on-LAN options enabled for the connection

    +
    +

    Parameters

    +
    +++++ + + + + + +

    setting

    the NMSettingWired

     
    +
    +
    +

    Returns

    +

    the Wake-on-LAN options

    +
    +

    Since: 1.0.6

    +
    +
    +
    +

    nm_setting_wired_get_wake_on_lan_password ()

    +
    const char *
    +nm_setting_wired_get_wake_on_lan_password
    +                               (NMSettingWired *setting);
    +

    Returns the Wake-on-LAN password. This only applies to +NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC.

    +
    +

    Parameters

    +
    +++++ + + + + + +

    setting

    the NMSettingWired

     
    +
    +
    +

    Returns

    +

    the Wake-on-LAN setting password, or NULL if there is no password.

    +
    +

    Since: 1.0.6

    +

    Types and Values

    @@ -1065,6 +1161,93 @@ nm_setting_wired_get_valid_s390_options

    +

    enum NMSettingWiredWakeOnLan

    +

    Options for “wake-on-lan”. Note that not all options +are supported by all devices.

    +
    +

    Members

    +
    +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    NM_SETTING_WIRED_WAKE_ON_LAN_NONE

    +

    Wake-on-LAN disabled

    +
     

    NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT

    +

    Use the default value

    +
     

    NM_SETTING_WIRED_WAKE_ON_LAN_PHY

    +

    Wake on PHY activity

    +
     

    NM_SETTING_WIRED_WAKE_ON_LAN_UNICAST

    +

    Wake on unicast messages

    +
     

    NM_SETTING_WIRED_WAKE_ON_LAN_MULTICAST

    +

    Wake on multicast messages

    +
     

    NM_SETTING_WIRED_WAKE_ON_LAN_BROADCAST

    +

    Wake on broadcast messages

    +
     

    NM_SETTING_WIRED_WAKE_ON_LAN_ARP

    +

    Wake on ARP

    +
     

    NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC

    +

    Wake on magic packet

    +
     

    _NM_SETTING_WIRED_WAKE_ON_LAN_LAST

      

    NM_SETTING_WIRED_WAKE_ON_LAN_ALL

    +

    Wake on all events

    +
     
    +
    +

    Since: 1.0.6

    +
    +
    +

    NM_SETTING_WIRED_PORT

    #define NM_SETTING_WIRED_PORT "port"
     
    @@ -1129,6 +1312,18 @@ nm_setting_wired_get_valid_s390_options
    #define NM_SETTING_WIRED_S390_OPTIONS "s390-options"
     
    +
    +
    +

    NM_SETTING_WIRED_WAKE_ON_LAN

    +
    #define NM_SETTING_WIRED_WAKE_ON_LAN "wake-on-lan"
    +
    +
    +
    +
    +

    NM_SETTING_WIRED_WAKE_ON_LAN_PASSWORD

    +
    #define NM_SETTING_WIRED_WAKE_ON_LAN_PASSWORD "wake-on-lan-password"
    +
    +

    Property Details

    @@ -1241,6 +1436,30 @@ Mbit/s, ie 100 == 100Mbit/s.

    Flags: Read / Write / Construct

    Default value: 0

    +
    +
    +

    The “wake-on-lan” property

    +
      “wake-on-lan”              guint
    +

    The NMSettingWiredWakeOnLan options to enable. Not all devices support all options. +May be any combination of NM_SETTING_WIRED_WAKE_ON_LAN_PHY, +NM_SETTING_WIRED_WAKE_ON_LAN_UNICAST, NM_SETTING_WIRED_WAKE_ON_LAN_MULTICAST, +NM_SETTING_WIRED_WAKE_ON_LAN_BROADCAST, NM_SETTING_WIRED_WAKE_ON_LAN_ARP, +NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC.

    +

    Flags: Read / Write / Construct

    +

    Default value: 1

    +

    Since: 1.0.6

    +
    +
    +
    +

    The “wake-on-lan-password” property

    +
      “wake-on-lan-password”     gchar *
    +

    If specified, the password used with magic-packet-based +Wake-on-LAN, represented as an Ethernet MAC address. If NULL, +no password will be required.

    +

    Flags: Read / Write

    +

    Default value: NULL

    +

    Since: 1.0.6

    +