From 0f6fe2a38ae23a814a424ea653a0ed78ccd01c6f Mon Sep 17 00:00:00 2001 From: Francesco Giudici Date: Thu, 3 Jan 2019 14:19:21 +0100 Subject: [PATCH] core: move bridge port min/max/default values to core-internal We have bridge min/max/default values in core-internal. Do the same for bridge port ones. We will soon use those values to enforce limits when assuming a bridge port configuration. --- libnm-core/nm-core-internal.h | 5 +++++ libnm-core/nm-setting-bridge-port.c | 10 ++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/libnm-core/nm-core-internal.h b/libnm-core/nm-core-internal.h index 1e7ec9bcb..ae43d2754 100644 --- a/libnm-core/nm-core-internal.h +++ b/libnm-core/nm-core-internal.h @@ -101,6 +101,11 @@ #define NM_BR_MIN_AGEING_TIME 0 #define NM_BR_MAX_AGEING_TIME 1000000 +#define NM_BR_PORT_MAX_PRIORITY 63 +#define NM_BR_PORT_DEF_PRIORITY 32 + +#define NM_BR_PORT_MAX_PATH_COST 65535 + /* NM_SETTING_COMPARE_FLAG_INFERRABLE: check whether a device-generated * connection can be replaced by a already-defined connection. This flag only * takes into account properties marked with the %NM_SETTING_PARAM_INFERRABLE diff --git a/libnm-core/nm-setting-bridge-port.c b/libnm-core/nm-setting-bridge-port.c index 86ac9172a..bc9c3e6fe 100644 --- a/libnm-core/nm-setting-bridge-port.c +++ b/libnm-core/nm-setting-bridge-port.c @@ -104,12 +104,6 @@ nm_setting_bridge_port_get_hairpin_mode (NMSettingBridgePort *setting) /*****************************************************************************/ -#define BR_MAX_PORT_PRIORITY 63 -#define BR_DEF_PRIORITY 32 - -#define BR_MIN_PATH_COST 1 -#define BR_MAX_PATH_COST 65535 - static gboolean verify (NMSetting *setting, NMConnection *connection, GError **error) { @@ -238,7 +232,7 @@ nm_setting_bridge_port_class_init (NMSettingBridgePortClass *klass) g_object_class_install_property (object_class, PROP_PRIORITY, g_param_spec_uint (NM_SETTING_BRIDGE_PORT_PRIORITY, "", "", - 0, BR_MAX_PORT_PRIORITY, BR_DEF_PRIORITY, + 0, NM_BR_PORT_MAX_PRIORITY, NM_BR_PORT_DEF_PRIORITY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_INFERRABLE | @@ -261,7 +255,7 @@ nm_setting_bridge_port_class_init (NMSettingBridgePortClass *klass) g_object_class_install_property (object_class, PROP_PATH_COST, g_param_spec_uint (NM_SETTING_BRIDGE_PORT_PATH_COST, "", "", - 0, BR_MAX_PATH_COST, 100, + 0, NM_BR_PORT_MAX_PATH_COST, 100, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));