diff options
Diffstat (limited to 'libnm-util/nm-setting-ip4-config.c')
| -rw-r--r-- | libnm-util/nm-setting-ip4-config.c | 391 |
1 files changed, 121 insertions, 270 deletions
diff --git a/libnm-util/nm-setting-ip4-config.c b/libnm-util/nm-setting-ip4-config.c index a2c104d5..532231ab 100644 --- a/libnm-util/nm-setting-ip4-config.c +++ b/libnm-util/nm-setting-ip4-config.c @@ -1,9 +1,6 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* - * Dan Williams <dcbw@redhat.com> - * Tambet Ingo <tambet@gmail.com> - * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -19,13 +16,15 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * (C) Copyright 2007 - 2014 Red Hat, Inc. - * (C) Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2014 Red Hat, Inc. + * Copyright 2007 - 2008 Novell, Inc. */ +#include "config.h" + #include <string.h> #include <dbus/dbus-glib.h> -#include <glib/gi18n.h> +#include <glib/gi18n-lib.h> #include "nm-setting-ip4-config.h" #include "nm-param-spec-specialized.h" @@ -78,8 +77,8 @@ typedef struct { GArray *dns; /* array of guint32; elements in network byte order */ GSList *dns_search; /* list of strings */ GSList *addresses; /* array of NMIP4Address */ - GSList *address_labels; /* list of strings */ GSList *routes; /* array of NMIP4Route */ + gint64 route_metric; gboolean ignore_auto_routes; gboolean ignore_auto_dns; char *dhcp_client_id; @@ -95,8 +94,8 @@ enum { PROP_DNS, PROP_DNS_SEARCH, PROP_ADDRESSES, - PROP_ADDRESS_LABELS, PROP_ROUTES, + PROP_ROUTE_METRIC, PROP_IGNORE_AUTO_ROUTES, PROP_IGNORE_AUTO_DNS, PROP_DHCP_CLIENT_ID, @@ -442,19 +441,6 @@ nm_setting_ip4_config_get_address (NMSettingIP4Config *setting, guint32 i) return (NMIP4Address *) g_slist_nth_data (priv->addresses, i); } -const char * -nm_setting_ip4_config_get_address_label (NMSettingIP4Config *setting, guint32 i) -{ - NMSettingIP4ConfigPrivate *priv; - - g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), NULL); - - priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting); - g_return_val_if_fail (i <= g_slist_length (priv->address_labels), NULL); - - return (const char *) g_slist_nth_data (priv->address_labels, i); -} - /** * nm_setting_ip4_config_add_address: * @setting: the #NMSettingIP4Config @@ -470,14 +456,6 @@ gboolean nm_setting_ip4_config_add_address (NMSettingIP4Config *setting, NMIP4Address *address) { - return nm_setting_ip4_config_add_address_with_label (setting, address, NULL); -} - -gboolean -nm_setting_ip4_config_add_address_with_label (NMSettingIP4Config *setting, - NMIP4Address *address, - const char *label) -{ NMSettingIP4ConfigPrivate *priv; NMIP4Address *copy; GSList *iter; @@ -493,8 +471,6 @@ nm_setting_ip4_config_add_address_with_label (NMSettingIP4Config *setting, copy = nm_ip4_address_dup (address); priv->addresses = g_slist_append (priv->addresses, copy); - priv->address_labels = g_slist_append (priv->address_labels, g_strdup (label)); - g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_ADDRESSES); return TRUE; } @@ -510,21 +486,16 @@ void nm_setting_ip4_config_remove_address (NMSettingIP4Config *setting, guint32 i) { NMSettingIP4ConfigPrivate *priv; - GSList *addr, *label; + GSList *elt; g_return_if_fail (NM_IS_SETTING_IP4_CONFIG (setting)); priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting); - addr = g_slist_nth (priv->addresses, i); - label = g_slist_nth (priv->address_labels, i); - g_return_if_fail (addr != NULL && label != NULL); - - nm_ip4_address_unref ((NMIP4Address *) addr->data); - priv->addresses = g_slist_delete_link (priv->addresses, addr); - if (label->data) - g_free (label->data); - priv->address_labels = g_slist_delete_link (priv->address_labels, label); + elt = g_slist_nth (priv->addresses, i); + g_return_if_fail (elt != NULL); + nm_ip4_address_unref ((NMIP4Address *) elt->data); + priv->addresses = g_slist_delete_link (priv->addresses, elt); g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_ADDRESSES); } @@ -576,8 +547,6 @@ nm_setting_ip4_config_clear_addresses (NMSettingIP4Config *setting) g_slist_free_full (priv->addresses, (GDestroyNotify) nm_ip4_address_unref); priv->addresses = NULL; - g_slist_free_full (priv->address_labels, g_free); - priv->address_labels = NULL; g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_ADDRESSES); } @@ -724,6 +693,26 @@ nm_setting_ip4_config_clear_routes (NMSettingIP4Config *setting) } /** + * nm_setting_ip4_config_get_route_metric: + * @setting: the #NMSettingIP4Config + * + * Returns the value contained in the #NMSettingIP4Config:route-metric + * property. + * + * Returns: the route metric that is used for IPv4 routes that don't explicitly + * specify a metric. See #NMSettingIP4Config:route-metric for more details. + * + * Since: 1.0 + **/ +gint64 +nm_setting_ip4_config_get_route_metric (NMSettingIP4Config *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), -1); + + return NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->route_metric; +} + +/** * nm_setting_ip4_config_get_ignore_auto_routes: * @setting: the #NMSettingIP4Config * @@ -850,34 +839,10 @@ nm_setting_ip4_config_get_may_fail (NMSettingIP4Config *setting) } static gboolean -verify_label (const char *label) -{ - const char *p; - char *iface; - - p = strchr (label, ':'); - if (!p) - return FALSE; - iface = g_strndup (label, p - label); - if (!nm_utils_iface_valid_name (iface)) { - g_free (iface); - return FALSE; - } - g_free (iface); - - for (p++; *p; p++) { - if (!g_ascii_isalnum (*p) && *p != '_') - return FALSE; - } - - return TRUE; -} - -static gboolean verify (NMSetting *setting, GSList *all_settings, GError **error) { NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting); - GSList *iter, *l_iter; + GSList *iter; int i; if (!priv->method) { @@ -964,11 +929,8 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) } /* Validate addresses */ - for (iter = priv->addresses, l_iter = priv->address_labels, i = 0; - iter && l_iter; - iter = g_slist_next (iter), l_iter = g_slist_next (l_iter), i++) { + for (iter = priv->addresses, i = 0; iter; iter = g_slist_next (iter), i++) { NMIP4Address *addr = (NMIP4Address *) iter->data; - const char *label = (const char *) l_iter->data; guint32 prefix = nm_ip4_address_get_prefix (addr); if (!nm_ip4_address_get_address (addr)) { @@ -990,27 +952,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_ADDRESSES); return FALSE; } - - if (label && !verify_label (label)) { - g_set_error (error, - NM_SETTING_IP4_CONFIG_ERROR, - NM_SETTING_IP4_CONFIG_ERROR_INVALID_PROPERTY, - _("%d. IPv4 address has invalid label '%s'"), - i+1, label); - g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, "address-labels"); - return FALSE; - } - } - - if (iter || l_iter) { - g_set_error (error, - NM_SETTING_IP4_CONFIG_ERROR, - NM_SETTING_IP4_CONFIG_ERROR_INVALID_PROPERTY, - _("IPv4 address / label count mismatch (%d vs %d)"), - g_slist_length (priv->addresses), - g_slist_length (priv->address_labels)); - g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, "address-labels"); - return FALSE; } /* Validate routes */ @@ -1066,7 +1007,6 @@ finalize (GObject *object) g_slist_free_full (priv->dns_search, g_free); g_slist_free_full (priv->addresses, (GDestroyNotify) nm_ip4_address_unref); - g_slist_free_full (priv->address_labels, g_free); g_slist_free_full (priv->routes, (GDestroyNotify) nm_ip4_route_unref); G_OBJECT_CLASS (nm_setting_ip4_config_parent_class)->finalize (object); @@ -1074,11 +1014,10 @@ finalize (GObject *object) static void set_property (GObject *object, guint prop_id, - const GValue *value, GParamSpec *pspec) + const GValue *value, GParamSpec *pspec) { NMSettingIP4Config *setting = NM_SETTING_IP4_CONFIG (object); NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting); - GSList *iter; switch (prop_id) { case PROP_METHOD: @@ -1098,29 +1037,14 @@ set_property (GObject *object, guint prop_id, case PROP_ADDRESSES: g_slist_free_full (priv->addresses, (GDestroyNotify) nm_ip4_address_unref); priv->addresses = nm_utils_ip4_addresses_from_gvalue (value); - - if (g_slist_length (priv->addresses) != g_slist_length (priv->address_labels)) { - g_slist_free_full (priv->address_labels, g_free); - priv->address_labels = NULL; - for (iter = priv->addresses; iter; iter = iter->next) - priv->address_labels = g_slist_prepend (priv->address_labels, NULL); - } - break; - case PROP_ADDRESS_LABELS: - g_slist_free_full (priv->address_labels, g_free); - priv->address_labels = g_value_dup_boxed (value); - /* NULLs get converted to "" when this is sent over D-Bus. */ - for (iter = priv->address_labels; iter; iter = iter->next) { - if (!g_strcmp0 (iter->data, "")) { - g_free (iter->data); - iter->data = NULL; - } - } break; case PROP_ROUTES: g_slist_free_full (priv->routes, (GDestroyNotify) nm_ip4_route_unref); priv->routes = nm_utils_ip4_routes_from_gvalue (value); break; + case PROP_ROUTE_METRIC: + priv->route_metric = g_value_get_int64 (value); + break; case PROP_IGNORE_AUTO_ROUTES: priv->ignore_auto_routes = g_value_get_boolean (value); break; @@ -1152,7 +1076,7 @@ set_property (GObject *object, guint prop_id, static void get_property (GObject *object, guint prop_id, - GValue *value, GParamSpec *pspec) + GValue *value, GParamSpec *pspec) { NMSettingIP4Config *setting = NM_SETTING_IP4_CONFIG (object); NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting); @@ -1170,12 +1094,12 @@ get_property (GObject *object, guint prop_id, case PROP_ADDRESSES: nm_utils_ip4_addresses_to_gvalue (priv->addresses, value); break; - case PROP_ADDRESS_LABELS: - g_value_set_boxed (value, priv->address_labels); - break; case PROP_ROUTES: nm_utils_ip4_routes_to_gvalue (priv->routes, value); break; + case PROP_ROUTE_METRIC: + g_value_set_int64 (value, priv->route_metric); + break; case PROP_IGNORE_AUTO_ROUTES: g_value_set_boolean (value, nm_setting_ip4_config_get_ignore_auto_routes (setting)); break; @@ -1236,27 +1160,11 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) **/ g_object_class_install_property (object_class, PROP_METHOD, - g_param_spec_string (NM_SETTING_IP4_CONFIG_METHOD, - "Method", - "IPv4 configuration method. If 'auto' is specified " - "then the appropriate automatic method (DHCP, PPP, " - "etc) is used for the interface and most other " - "properties can be left unset. If 'link-local' " - "is specified, then a link-local address in the " - "169.254/16 range will be assigned to the " - "interface. If 'manual' is specified, static IP " - "addressing is used and at least one IP address " - "must be given in the 'addresses' property. If " - "'shared' is specified (indicating that this " - "connection will provide network access to other " - "computers) then the interface is assigned an " - "address in the 10.42.x.1/24 range and a DHCP and " - "forwarding DNS server are started, and the " - "interface is NAT-ed to the current default network " - "connection. 'disabled' means IPv4 will not be " - "used on this connection. This property must be set.", - NULL, - G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE)); + g_param_spec_string (NM_SETTING_IP4_CONFIG_METHOD, "", "", + NULL, + G_PARAM_READWRITE | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); /** * NMSettingIP4Config:dns: @@ -1270,18 +1178,10 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) **/ g_object_class_install_property (object_class, PROP_DNS, - _nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_DNS, - "DNS", - "List of DNS servers (network byte order). For " - "the 'auto' method, these DNS servers are " - "appended to those (if any) returned by automatic " - "configuration. DNS servers cannot be used with " - "the 'shared', 'link-local', or 'disabled' " - "methods as there is no upstream network. In all " - "other methods, these DNS servers are used as the " - "only DNS servers for this connection.", - DBUS_TYPE_G_UINT_ARRAY, - G_PARAM_READWRITE)); + _nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_DNS, "", "", + DBUS_TYPE_G_UINT_ARRAY, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSettingIP4Config:dns-search: @@ -1294,18 +1194,10 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) **/ g_object_class_install_property (object_class, PROP_DNS_SEARCH, - _nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_DNS_SEARCH, - "DNS search", - "List of DNS search domains. For the 'auto' " - "method, these search domains are appended to " - "those returned by automatic configuration. " - "Search domains cannot be used with the 'shared', " - "'link-local', or 'disabled' methods as there is " - "no upstream network. In all other methods, these " - "search domains are used as the only search domains " - "for this connection.", - DBUS_TYPE_G_LIST_OF_STRING, - G_PARAM_READWRITE)); + _nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_DNS_SEARCH, "", "", + DBUS_TYPE_G_LIST_OF_STRING, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSettingIP4Config:addresses: @@ -1321,35 +1213,11 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) **/ g_object_class_install_property (object_class, PROP_ADDRESSES, - _nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_ADDRESSES, - "Addresses", - "Array of IPv4 address structures. Each IPv4 " - "address structure is composed of 3 32-bit values; " - "the first being the IPv4 address (network byte " - "order), the second the prefix (1 - 32), and " - "last the IPv4 gateway (network byte order). The " - "gateway may be left as 0 if no gateway exists " - "for that subnet. For the 'auto' method, given " - "IP addresses are appended to those returned by " - "automatic configuration. Addresses cannot be " - "used with the 'shared', 'link-local', or " - "'disabled' methods as addressing is either " - "automatic or disabled with these methods.", - DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT, - G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE)); - - /** - * NMSettingIP4Config:address-labels: - * - * Internal use only. - **/ - g_object_class_install_property - (object_class, PROP_ADDRESS_LABELS, - _nm_param_spec_specialized ("address-labels", - "Address labels", - "Internal use only", - DBUS_TYPE_G_LIST_OF_STRING, - G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE)); + _nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_ADDRESSES, "", "", + DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT, + G_PARAM_READWRITE | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); /** * NMSettingIP4Config:routes: @@ -1365,22 +1233,33 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) **/ g_object_class_install_property (object_class, PROP_ROUTES, - _nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_ROUTES, - "Routes", - "Array of IPv4 route structures. Each IPv4 route " - "structure is composed of 4 32-bit values; the " - "first being the destination IPv4 network or " - "address (network byte order), the second the " - "destination network or address prefix (1 - 32), " - "the third being the next-hop (network byte order) " - "if any, and the fourth being the route metric. " - "For the 'auto' method, given IP routes are " - "appended to those returned by automatic " - "configuration. Routes cannot be used with the " - "'shared', 'link-local', or 'disabled', methods " - "as there is no upstream network.", - DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT, - G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE)); + _nm_param_spec_specialized (NM_SETTING_IP4_CONFIG_ROUTES, "", "", + DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT, + G_PARAM_READWRITE | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingIP4Config:route-metric: + * + * The default metric for routes that don't explicitly specify a metric. + * The default value -1 means that the metric is choosen automatically + * based on the device type. + * The metric applies to dynamic routes, manual (static) routes that + * don't have an explicit metric setting, address prefix routes, and + * the default route. + * As the linux kernel accepts zero (0) as a valid metric, zero is + * a valid value. + * + * Since: 1.0 + **/ + g_object_class_install_property + (object_class, PROP_ROUTE_METRIC, + g_param_spec_int64 (NM_SETTING_IP4_CONFIG_ROUTE_METRIC, "", "", + -1, G_MAXUINT32, -1, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); /** * NMSettingIP4Config:ignore-auto-routes: @@ -1391,14 +1270,11 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) **/ g_object_class_install_property (object_class, PROP_IGNORE_AUTO_ROUTES, - g_param_spec_boolean (NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, - "Ignore automatic routes", - "When the method is set to 'auto' and this property " - "to TRUE, automatically configured routes are " - "ignored and only routes specified in the 'routes' " - "property, if any, are used.", - FALSE, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + g_param_spec_boolean (NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, "", "", + FALSE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); /** * NMSettingIP4Config:ignore-auto-dns: @@ -1411,15 +1287,11 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) **/ g_object_class_install_property (object_class, PROP_IGNORE_AUTO_DNS, - g_param_spec_boolean (NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, - "Ignore automatic DNS", - "When the method is set to 'auto' and this property " - "to TRUE, automatically configured nameservers and " - "search domains are ignored and only nameservers and " - "search domains specified in the 'dns' and 'dns-search' " - "properties, if any, are used.", - FALSE, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + g_param_spec_boolean (NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, "", "", + FALSE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); /** * NMSettingIP4Config:dhcp-client-id: @@ -1429,13 +1301,10 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) **/ g_object_class_install_property (object_class, PROP_DHCP_CLIENT_ID, - g_param_spec_string (NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, - "DHCP Client ID", - "A string sent to the DHCP server to identify the " - "local machine which the DHCP server may use to " - "customize the DHCP lease and options.", - NULL, - G_PARAM_READWRITE)); + g_param_spec_string (NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); /** * NMSettingIP4Config:dhcp-send-hostname: @@ -1448,17 +1317,11 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) **/ g_object_class_install_property (object_class, PROP_DHCP_SEND_HOSTNAME, - g_param_spec_boolean (NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME, - "Send DHCP hostname", - "If TRUE, a hostname is sent to the DHCP server when " - "acquiring a lease. Some DHCP servers use this " - "hostname to update DNS databases, essentially " - "providing a static hostname for the computer. If " - "the 'dhcp-hostname' property is empty and this " - "property is TRUE, the current persistent hostname " - "of the computer is sent.", - TRUE, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + g_param_spec_boolean (NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME, "", "", + TRUE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); /** * NMSettingIP4Config:dhcp-hostname: @@ -1468,13 +1331,11 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) **/ g_object_class_install_property (object_class, PROP_DHCP_HOSTNAME, - g_param_spec_string (NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, - "DHCP Hostname", - "If the 'dhcp-send-hostname' property is TRUE, then " - "the specified name will be sent to the DHCP server " - "when acquiring a lease.", - NULL, - G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE)); + g_param_spec_string (NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, "", "", + NULL, + G_PARAM_READWRITE | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); /** * NMSettingIP4Config:never-default: @@ -1484,13 +1345,11 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) **/ g_object_class_install_property (object_class, PROP_NEVER_DEFAULT, - g_param_spec_boolean (NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, - "Never default", - "If TRUE, this connection will never be the default " - "IPv4 connection, meaning it will never be assigned " - "the default route by NetworkManager.", - FALSE, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + g_param_spec_boolean (NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, "", "", + FALSE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); /** * NMSettingIP4Config:may-fail: @@ -1504,18 +1363,11 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) **/ g_object_class_install_property (object_class, PROP_MAY_FAIL, - g_param_spec_boolean (NM_SETTING_IP4_CONFIG_MAY_FAIL, - "May Fail", - "If TRUE, allow overall network configuration to " - "proceed even if IPv4 configuration times out. " - "Note that at least one IP configuration must " - "succeed or overall network configuration will still " - "fail. For example, in IPv6-only networks, setting " - "this property to TRUE allows the overall network " - "configuration to succeed if IPv4 configuration " - "fails but IPv6 configuration completes successfully.", - TRUE, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + g_param_spec_boolean (NM_SETTING_IP4_CONFIG_MAY_FAIL, "", "", + TRUE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); } @@ -1977,4 +1829,3 @@ nm_ip4_route_set_metric (NMIP4Route *route, guint32 metric) route->metric = metric; } - |