diff options
author | Thomas Haller <thaller@redhat.com> | 2014-08-27 19:57:24 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-11-05 23:49:55 +0100 |
commit | 8bbd90d02a6ed4625fb067c9ea265bf18e4d50ff (patch) | |
tree | c0c0549de8c764edfa318d77fb0f7cb66f927a3b | |
parent | 5a7b0b738d51dfa572e8e10ebe79e4471acc5390 (diff) | |
download | NetworkManager-8bbd90d02a6ed4625fb067c9ea265bf18e4d50ff.tar.gz |
libnm: add NMSettingIP4Config:route-metric and NMSettingIP6Config:route-metric setting
https://bugzilla.gnome.org/show_bug.cgi?id=735512
https://bugzilla.redhat.com/show_bug.cgi?id=663730
Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r-- | libnm-core/nm-setting-ip4-config.c | 46 | ||||
-rw-r--r-- | libnm-core/nm-setting-ip4-config.h | 3 | ||||
-rw-r--r-- | libnm-core/nm-setting-ip6-config.c | 46 | ||||
-rw-r--r-- | libnm-core/nm-setting-ip6-config.h | 3 | ||||
-rw-r--r-- | libnm-core/tests/test-general.c | 1 | ||||
-rwxr-xr-x | libnm-util/generate-setting-docs.py | 6 | ||||
-rw-r--r-- | libnm-util/libnm-util.ver | 2 | ||||
-rw-r--r-- | libnm-util/nm-setting-ip4-config.c | 50 | ||||
-rw-r--r-- | libnm-util/nm-setting-ip4-config.h | 4 | ||||
-rw-r--r-- | libnm-util/nm-setting-ip6-config.c | 50 | ||||
-rw-r--r-- | libnm-util/nm-setting-ip6-config.h | 4 | ||||
-rw-r--r-- | libnm-util/tests/test-general.c | 1 | ||||
-rw-r--r-- | libnm/libnm.ver | 2 |
13 files changed, 217 insertions, 1 deletions
diff --git a/libnm-core/nm-setting-ip4-config.c b/libnm-core/nm-setting-ip4-config.c index 00f2df502e..f44c3be260 100644 --- a/libnm-core/nm-setting-ip4-config.c +++ b/libnm-core/nm-setting-ip4-config.c @@ -55,6 +55,7 @@ typedef struct { 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; @@ -72,6 +73,7 @@ enum { PROP_ADDRESSES, PROP_ADDRESS_LABELS, PROP_ROUTES, + PROP_ROUTE_METRIC, PROP_IGNORE_AUTO_ROUTES, PROP_IGNORE_AUTO_DNS, PROP_DHCP_CLIENT_ID, @@ -715,6 +717,24 @@ 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. + **/ +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 * @@ -1158,6 +1178,9 @@ set_property (GObject *object, guint prop_id, priv->routes = _nm_utils_copy_array_to_slist (g_value_get_boxed (value), (NMUtilsCopyFunc) nm_ip4_route_dup); 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; @@ -1213,6 +1236,9 @@ get_property (GObject *object, guint prop_id, case PROP_ROUTES: g_value_take_boxed (value, _nm_utils_copy_slist_to_array (priv->routes, (NMUtilsCopyFunc) nm_ip4_route_dup, (GDestroyNotify) nm_ip4_route_unref)); 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; @@ -1375,6 +1401,26 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) ip4_routes_from_dbus); /** + * 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. + **/ + 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: * * When the method is set to "auto" and this property to %TRUE, diff --git a/libnm-core/nm-setting-ip4-config.h b/libnm-core/nm-setting-ip4-config.h index 369e1d46d2..f317a63b46 100644 --- a/libnm-core/nm-setting-ip4-config.h +++ b/libnm-core/nm-setting-ip4-config.h @@ -45,6 +45,7 @@ G_BEGIN_DECLS #define NM_SETTING_IP4_CONFIG_DNS_SEARCH "dns-search" #define NM_SETTING_IP4_CONFIG_ADDRESSES "addresses" #define NM_SETTING_IP4_CONFIG_ROUTES "routes" +#define NM_SETTING_IP4_CONFIG_ROUTE_METRIC "route-metric" #define NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes" #define NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS "ignore-auto-dns" #define NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID "dhcp-client-id" @@ -192,6 +193,8 @@ void nm_setting_ip4_config_remove_route (NMSettingIP4Config * gboolean nm_setting_ip4_config_remove_route_by_value (NMSettingIP4Config *setting, NMIP4Route *route); void nm_setting_ip4_config_clear_routes (NMSettingIP4Config *setting); +gint64 nm_setting_ip4_config_get_route_metric (NMSettingIP4Config *setting); + gboolean nm_setting_ip4_config_get_ignore_auto_routes (NMSettingIP4Config *setting); gboolean nm_setting_ip4_config_get_ignore_auto_dns (NMSettingIP4Config *setting); const char * nm_setting_ip4_config_get_dhcp_client_id (NMSettingIP4Config *setting); diff --git a/libnm-core/nm-setting-ip6-config.c b/libnm-core/nm-setting-ip6-config.c index cbc5e2c8be..b007880c19 100644 --- a/libnm-core/nm-setting-ip6-config.c +++ b/libnm-core/nm-setting-ip6-config.c @@ -53,6 +53,7 @@ typedef struct { GSList *dns_search; /* list of strings */ GSList *addresses; /* array of NMIP6Address */ GSList *routes; /* array of NMIP6Route */ + gint64 route_metric; gboolean ignore_auto_routes; gboolean ignore_auto_dns; gboolean never_default; @@ -69,6 +70,7 @@ enum { PROP_DNS_SEARCH, PROP_ADDRESSES, PROP_ROUTES, + PROP_ROUTE_METRIC, PROP_IGNORE_AUTO_ROUTES, PROP_IGNORE_AUTO_DNS, PROP_NEVER_DEFAULT, @@ -697,6 +699,24 @@ nm_setting_ip6_config_clear_routes (NMSettingIP6Config *setting) } /** + * nm_setting_ip6_config_get_route_metric: + * @setting: the #NMSettingIP4Config + * + * Returns the value contained in the #NMSettingIP6Config:route-metric + * property. + * + * Returns: the route metric that is used for IPv6 routes that don't explicitly + * specify a metric. See #NMSettingIP6Config:route-metric for more details. + **/ +gint64 +nm_setting_ip6_config_get_route_metric (NMSettingIP6Config *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), -1); + + return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->route_metric; +} + +/** * nm_setting_ip6_config_get_ignore_auto_routes: * @setting: the #NMSettingIP6Config * @@ -973,6 +993,9 @@ set_property (GObject *object, guint prop_id, priv->routes = _nm_utils_copy_array_to_slist (g_value_get_boxed (value), (NMUtilsCopyFunc) nm_ip6_route_dup); 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; @@ -1020,6 +1043,9 @@ get_property (GObject *object, guint prop_id, case PROP_ROUTES: g_value_take_boxed (value, _nm_utils_copy_slist_to_array (priv->routes, (NMUtilsCopyFunc) nm_ip6_route_dup, (GDestroyNotify) nm_ip6_route_unref)); break; + case PROP_ROUTE_METRIC: + g_value_set_int64 (value, priv->route_metric); + break; case PROP_IGNORE_AUTO_ROUTES: g_value_set_boolean (value, priv->ignore_auto_routes); break; @@ -1175,6 +1201,26 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class) ip6_routes_from_dbus); /** + * NMSettingIP6Config: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 replaces zero (0) by 1024 (user-default), setting + * this property to 0 means effectively setting it to 1024. + **/ + g_object_class_install_property + (object_class, PROP_ROUTE_METRIC, + g_param_spec_int64 (NM_SETTING_IP6_CONFIG_ROUTE_METRIC, "", "", + -1, G_MAXUINT32, -1, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); + + /** * NMSettingIP6Config:ignore-auto-routes: * * When the method is set to "auto" or "dhcp" and this property is set to diff --git a/libnm-core/nm-setting-ip6-config.h b/libnm-core/nm-setting-ip6-config.h index 831f212bb6..4d97a9fd26 100644 --- a/libnm-core/nm-setting-ip6-config.h +++ b/libnm-core/nm-setting-ip6-config.h @@ -46,6 +46,7 @@ G_BEGIN_DECLS #define NM_SETTING_IP6_CONFIG_DNS_SEARCH "dns-search" #define NM_SETTING_IP6_CONFIG_ADDRESSES "addresses" #define NM_SETTING_IP6_CONFIG_ROUTES "routes" +#define NM_SETTING_IP6_CONFIG_ROUTE_METRIC "route-metric" #define NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes" #define NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS "ignore-auto-dns" #define NM_SETTING_IP6_CONFIG_NEVER_DEFAULT "never-default" @@ -223,6 +224,8 @@ gboolean nm_setting_ip6_config_remove_route_by_value (NMSettingIP void nm_setting_ip6_config_clear_routes (NMSettingIP6Config *setting); gboolean nm_setting_ip6_config_get_ignore_auto_routes (NMSettingIP6Config *setting); +gint64 nm_setting_ip6_config_get_route_metric (NMSettingIP6Config *setting); + gboolean nm_setting_ip6_config_get_ignore_auto_dns (NMSettingIP6Config *setting); const char * nm_setting_ip6_config_get_dhcp_hostname (NMSettingIP6Config *setting); gboolean nm_setting_ip6_config_get_never_default (NMSettingIP6Config *setting); diff --git a/libnm-core/tests/test-general.c b/libnm-core/tests/test-general.c index a71238929f..d0594ddfe3 100644 --- a/libnm-core/tests/test-general.c +++ b/libnm-core/tests/test-general.c @@ -1645,6 +1645,7 @@ test_connection_diff_a_only (void) { NM_SETTING_IP4_CONFIG_ADDRESSES, NM_SETTING_DIFF_RESULT_IN_A }, { "address-labels", NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP4_CONFIG_ROUTES, NM_SETTING_DIFF_RESULT_IN_A }, + { NM_SETTING_IP4_CONFIG_ROUTE_METRIC, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, NM_SETTING_DIFF_RESULT_IN_A }, diff --git a/libnm-util/generate-setting-docs.py b/libnm-util/generate-setting-docs.py index 69b115a7e1..463d0f2ec7 100755 --- a/libnm-util/generate-setting-docs.py +++ b/libnm-util/generate-setting-docs.py @@ -48,7 +48,11 @@ identifier_key = '{%s}identifier' % ns_map['c'] nick_key = '{%s}nick' % ns_map['glib'] symbol_prefix_key = '{%s}symbol-prefix' % ns_map['c'] -constants = { 'TRUE': 'TRUE', 'FALSE': 'FALSE', 'NULL': 'NULL' } +constants = { + 'TRUE': 'TRUE', + 'FALSE': 'FALSE', + 'G_MAXUINT32': 'G_MAXUINT32', + 'NULL': 'NULL' } setting_names = {} def init_constants(girxml): diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver index c6fc0d7f69..794cc87f43 100644 --- a/libnm-util/libnm-util.ver +++ b/libnm-util/libnm-util.ver @@ -367,6 +367,7 @@ global: nm_setting_ip4_config_get_num_dns_searches; nm_setting_ip4_config_get_num_routes; nm_setting_ip4_config_get_route; + nm_setting_ip4_config_get_route_metric; nm_setting_ip4_config_get_type; nm_setting_ip4_config_new; nm_setting_ip4_config_remove_address; @@ -402,6 +403,7 @@ global: nm_setting_ip6_config_get_num_dns_searches; nm_setting_ip6_config_get_num_routes; nm_setting_ip6_config_get_route; + nm_setting_ip6_config_get_route_metric; nm_setting_ip6_config_get_type; nm_setting_ip6_config_new; nm_setting_ip6_config_privacy_get_type; diff --git a/libnm-util/nm-setting-ip4-config.c b/libnm-util/nm-setting-ip4-config.c index f7f709ec54..c7a730769c 100644 --- a/libnm-util/nm-setting-ip4-config.c +++ b/libnm-util/nm-setting-ip4-config.c @@ -76,6 +76,7 @@ typedef struct { GSList *dns_search; /* list of strings */ GSList *addresses; /* array of NMIP4Address */ GSList *routes; /* array of NMIP4Route */ + gint64 route_metric; gboolean ignore_auto_routes; gboolean ignore_auto_dns; char *dhcp_client_id; @@ -92,6 +93,7 @@ enum { PROP_DNS_SEARCH, PROP_ADDRESSES, PROP_ROUTES, + PROP_ROUTE_METRIC, PROP_IGNORE_AUTO_ROUTES, PROP_IGNORE_AUTO_DNS, PROP_DHCP_CLIENT_ID, @@ -689,6 +691,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 * @@ -1018,6 +1040,9 @@ set_property (GObject *object, guint prop_id, 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; @@ -1070,6 +1095,9 @@ get_property (GObject *object, guint prop_id, 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; @@ -1276,6 +1304,28 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) 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: * * When the method is set to "auto" and this property to %TRUE, diff --git a/libnm-util/nm-setting-ip4-config.h b/libnm-util/nm-setting-ip4-config.h index 1b7c23072d..6e9a9a227a 100644 --- a/libnm-util/nm-setting-ip4-config.h +++ b/libnm-util/nm-setting-ip4-config.h @@ -60,6 +60,7 @@ GQuark nm_setting_ip4_config_error_quark (void); #define NM_SETTING_IP4_CONFIG_DNS_SEARCH "dns-search" #define NM_SETTING_IP4_CONFIG_ADDRESSES "addresses" #define NM_SETTING_IP4_CONFIG_ROUTES "routes" +#define NM_SETTING_IP4_CONFIG_ROUTE_METRIC "route-metric" #define NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes" #define NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS "ignore-auto-dns" #define NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID "dhcp-client-id" @@ -214,6 +215,9 @@ NM_AVAILABLE_IN_0_9_10 gboolean nm_setting_ip4_config_remove_route_by_value (NMSettingIP4Config *setting, NMIP4Route *route); void nm_setting_ip4_config_clear_routes (NMSettingIP4Config *setting); +NM_AVAILABLE_IN_1_0 +gint64 nm_setting_ip4_config_get_route_metric (NMSettingIP4Config *setting); + gboolean nm_setting_ip4_config_get_ignore_auto_routes (NMSettingIP4Config *setting); gboolean nm_setting_ip4_config_get_ignore_auto_dns (NMSettingIP4Config *setting); const char * nm_setting_ip4_config_get_dhcp_client_id (NMSettingIP4Config *setting); diff --git a/libnm-util/nm-setting-ip6-config.c b/libnm-util/nm-setting-ip6-config.c index ec90fd2bd7..64a81136a9 100644 --- a/libnm-util/nm-setting-ip6-config.c +++ b/libnm-util/nm-setting-ip6-config.c @@ -75,6 +75,7 @@ typedef struct { GSList *dns_search; /* list of strings */ GSList *addresses; /* array of NMIP6Address */ GSList *routes; /* array of NMIP6Route */ + gint64 route_metric; gboolean ignore_auto_routes; gboolean ignore_auto_dns; gboolean never_default; @@ -91,6 +92,7 @@ enum { PROP_DNS_SEARCH, PROP_ADDRESSES, PROP_ROUTES, + PROP_ROUTE_METRIC, PROP_IGNORE_AUTO_ROUTES, PROP_IGNORE_AUTO_DNS, PROP_NEVER_DEFAULT, @@ -709,6 +711,26 @@ nm_setting_ip6_config_clear_routes (NMSettingIP6Config *setting) } /** + * nm_setting_ip6_config_get_route_metric: + * @setting: the #NMSettingIP4Config + * + * Returns the value contained in the #NMSettingIP6Config:route-metric + * property. + * + * Returns: the route metric that is used for IPv6 routes that don't explicitly + * specify a metric. See #NMSettingIP6Config:route-metric for more details. + * + * Since: 1.0 + **/ +gint64 +nm_setting_ip6_config_get_route_metric (NMSettingIP6Config *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), -1); + + return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->route_metric; +} + +/** * nm_setting_ip6_config_get_ignore_auto_routes: * @setting: the #NMSettingIP6Config * @@ -927,6 +949,9 @@ set_property (GObject *object, guint prop_id, g_slist_free_full (priv->routes, g_free); priv->routes = nm_utils_ip6_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; @@ -974,6 +999,9 @@ get_property (GObject *object, guint prop_id, case PROP_ROUTES: nm_utils_ip6_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, priv->ignore_auto_routes); break; @@ -1187,6 +1215,28 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class) G_PARAM_STATIC_STRINGS)); /** + * NMSettingIP6Config: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 replaces zero (0) by 1024 (user-default), setting + * this property to 0 means effectively setting it to 1024. + * + * Since: 1.0 + **/ + g_object_class_install_property + (object_class, PROP_ROUTE_METRIC, + g_param_spec_int64 (NM_SETTING_IP6_CONFIG_ROUTE_METRIC, "", "", + -1, G_MAXUINT32, -1, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); + + /** * NMSettingIP6Config:ignore-auto-routes: * * When the method is set to "auto" or "dhcp" and this property is set to diff --git a/libnm-util/nm-setting-ip6-config.h b/libnm-util/nm-setting-ip6-config.h index 4486a40e26..0a2f00ddcc 100644 --- a/libnm-util/nm-setting-ip6-config.h +++ b/libnm-util/nm-setting-ip6-config.h @@ -61,6 +61,7 @@ GQuark nm_setting_ip6_config_error_quark (void); #define NM_SETTING_IP6_CONFIG_DNS_SEARCH "dns-search" #define NM_SETTING_IP6_CONFIG_ADDRESSES "addresses" #define NM_SETTING_IP6_CONFIG_ROUTES "routes" +#define NM_SETTING_IP6_CONFIG_ROUTE_METRIC "route-metric" #define NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes" #define NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS "ignore-auto-dns" #define NM_SETTING_IP6_CONFIG_NEVER_DEFAULT "never-default" @@ -245,6 +246,9 @@ gboolean nm_setting_ip6_config_remove_route_by_value (NMSettingIP void nm_setting_ip6_config_clear_routes (NMSettingIP6Config *setting); gboolean nm_setting_ip6_config_get_ignore_auto_routes (NMSettingIP6Config *setting); +NM_AVAILABLE_IN_1_0 +gint64 nm_setting_ip6_config_get_route_metric (NMSettingIP6Config *setting); + gboolean nm_setting_ip6_config_get_ignore_auto_dns (NMSettingIP6Config *setting); const char * nm_setting_ip6_config_get_dhcp_hostname (NMSettingIP6Config *setting); gboolean nm_setting_ip6_config_get_never_default (NMSettingIP6Config *setting); diff --git a/libnm-util/tests/test-general.c b/libnm-util/tests/test-general.c index bdec7e1354..eea22b5f3b 100644 --- a/libnm-util/tests/test-general.c +++ b/libnm-util/tests/test-general.c @@ -1268,6 +1268,7 @@ test_connection_diff_a_only (void) { NM_SETTING_IP4_CONFIG_DNS_SEARCH, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP4_CONFIG_ADDRESSES, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP4_CONFIG_ROUTES, NM_SETTING_DIFF_RESULT_IN_A }, + { NM_SETTING_IP4_CONFIG_ROUTE_METRIC, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, NM_SETTING_DIFF_RESULT_IN_A }, diff --git a/libnm/libnm.ver b/libnm/libnm.ver index d735a30e38..b57f033ffb 100644 --- a/libnm/libnm.ver +++ b/libnm/libnm.ver @@ -587,6 +587,7 @@ global: nm_setting_ip4_config_get_num_dns_searches; nm_setting_ip4_config_get_num_routes; nm_setting_ip4_config_get_route; + nm_setting_ip4_config_get_route_metric; nm_setting_ip4_config_get_type; nm_setting_ip4_config_new; nm_setting_ip4_config_remove_address; @@ -620,6 +621,7 @@ global: nm_setting_ip6_config_get_num_dns_searches; nm_setting_ip6_config_get_num_routes; nm_setting_ip6_config_get_route; + nm_setting_ip6_config_get_route_metric; nm_setting_ip6_config_get_type; nm_setting_ip6_config_new; nm_setting_ip6_config_privacy_get_type; |