mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 02:57:58 +02:00
all: use the new NMSettingConnection port-type property
This commit is contained in:
parent
1e3bb7f320
commit
027b259602
29 changed files with 110 additions and 122 deletions
|
|
@ -897,8 +897,8 @@ nm_utils_match_connection(NMConnection *const *connections,
|
|||
if (!nm_streq0(nm_setting_connection_get_connection_type(s_orig),
|
||||
nm_setting_connection_get_connection_type(s_cand)))
|
||||
continue;
|
||||
if (!nm_streq0(nm_setting_connection_get_slave_type(s_orig),
|
||||
nm_setting_connection_get_slave_type(s_cand)))
|
||||
if (!nm_streq0(nm_setting_connection_get_port_type(s_orig),
|
||||
nm_setting_connection_get_port_type(s_cand)))
|
||||
continue;
|
||||
|
||||
/* this is good enough for a match */
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ controller_update_port_connection(NMDevice *self,
|
|||
g_object_set(nm_connection_get_setting_connection(connection),
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
nm_connection_get_uuid(applied_connection),
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_BOND_SETTING_NAME,
|
||||
NULL);
|
||||
return TRUE;
|
||||
|
|
|
|||
|
|
@ -612,7 +612,7 @@ master_update_slave_connection(NMDevice *device,
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
nm_connection_get_uuid(applied_connection),
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_BRIDGE_SETTING_NAME,
|
||||
NULL);
|
||||
return TRUE;
|
||||
|
|
|
|||
|
|
@ -1523,7 +1523,7 @@ _prop_get_ipvx_route_table(NMDevice *self, int addr_family)
|
|||
|
||||
if (route_table == 0u && connection
|
||||
&& (s_con = nm_connection_get_setting_connection(connection))
|
||||
&& (nm_streq0(nm_setting_connection_get_slave_type(s_con), NM_SETTING_VRF_SETTING_NAME)
|
||||
&& (nm_streq0(nm_setting_connection_get_port_type(s_con), NM_SETTING_VRF_SETTING_NAME)
|
||||
&& priv->master && nm_device_get_device_type(priv->master) == NM_DEVICE_TYPE_VRF)) {
|
||||
const NMPlatformLnkVrf *lnk;
|
||||
|
||||
|
|
@ -9441,7 +9441,7 @@ nm_device_check_slave_connection_compatible(NMDevice *self, NMConnection *slave)
|
|||
|
||||
s_con = nm_connection_get_setting_connection(slave);
|
||||
g_assert(s_con);
|
||||
slave_type = nm_setting_connection_get_slave_type(s_con);
|
||||
slave_type = nm_setting_connection_get_port_type(s_con);
|
||||
if (!slave_type)
|
||||
return FALSE;
|
||||
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ master_update_slave_connection(NMDevice *device,
|
|||
g_object_set(nm_connection_get_setting_connection(connection),
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
nm_connection_get_uuid(applied_connection),
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_TEAM_SETTING_NAME,
|
||||
NULL);
|
||||
return TRUE;
|
||||
|
|
|
|||
|
|
@ -4847,7 +4847,7 @@ is_compatible_with_slave(NMConnection *master, NMConnection *slave)
|
|||
s_con = nm_connection_get_setting_connection(slave);
|
||||
g_assert(s_con);
|
||||
|
||||
return nm_connection_is_type(master, nm_setting_connection_get_slave_type(s_con));
|
||||
return nm_connection_is_type(master, nm_setting_connection_get_port_type(s_con));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2284,7 +2284,7 @@ write_connection_setting(NMSettingConnection *s_con, shvarFile *ifcfg, const cha
|
|||
svSetValueStr(ifcfg, "VRF", master_iface);
|
||||
} else {
|
||||
_LOGW("don't know how to set master for a %s slave",
|
||||
nm_setting_connection_get_slave_type(s_con));
|
||||
nm_setting_connection_get_port_type(s_con));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2231,7 +2231,7 @@ test_clear_master(void)
|
|||
s_con = nmtst_connection_assert_setting(connection, NM_TYPE_SETTING_CONNECTION);
|
||||
|
||||
g_assert_cmpstr(nm_setting_connection_get_master(s_con), ==, "br0");
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con), ==, "bridge");
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, "bridge");
|
||||
|
||||
/* 2. write the connection to a new file */
|
||||
_writer_new_connec_exp(connection,
|
||||
|
|
@ -2248,7 +2248,7 @@ test_clear_master(void)
|
|||
NULL);
|
||||
|
||||
g_assert_cmpstr(nm_setting_connection_get_master(s_con), ==, NULL);
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con), ==, NULL);
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NULL);
|
||||
|
||||
nmtst_assert_connection_verifies_after_normalization(connection, 0, 0);
|
||||
|
||||
|
|
@ -7669,9 +7669,7 @@ test_read_bridge_component(void)
|
|||
|
||||
s_con = nmtst_connection_assert_setting(connection, NM_TYPE_SETTING_CONNECTION);
|
||||
g_assert_cmpstr(nm_setting_connection_get_master(s_con), ==, "br0");
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con),
|
||||
==,
|
||||
NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
|
||||
s_port = nmtst_connection_assert_setting(connection, NM_TYPE_SETTING_BRIDGE_PORT);
|
||||
g_assert(nm_setting_bridge_port_get_hairpin_mode(s_port));
|
||||
|
|
@ -8264,7 +8262,7 @@ test_read_bond_slave(void)
|
|||
|
||||
g_assert_cmpstr(nm_setting_connection_get_master(s_con), ==, "bond0");
|
||||
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -8320,7 +8318,7 @@ test_read_bond_port(void)
|
|||
|
||||
s_con = nmtst_connection_assert_setting(connection, NM_TYPE_SETTING_CONNECTION);
|
||||
g_assert_cmpstr(nm_setting_connection_get_master(s_con), ==, "bond99");
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
|
||||
s_port = nmtst_connection_assert_setting(connection, NM_TYPE_SETTING_BOND_PORT);
|
||||
g_assert_cmpuint(nm_setting_bond_port_get_queue_id(s_port), ==, 1);
|
||||
|
|
@ -8559,7 +8557,7 @@ test_read_bond_slave_ib(void)
|
|||
s_con = nmtst_connection_assert_setting(connection, NM_TYPE_SETTING_CONNECTION);
|
||||
|
||||
g_assert_cmpstr(nm_setting_connection_get_master(s_con), ==, "bond0");
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -2048,7 +2048,7 @@ test_write_bridge_component(void)
|
|||
NM_SETTING_WIRED_SETTING_NAME,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"br0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_BRIDGE_SETTING_NAME,
|
||||
NULL);
|
||||
|
||||
|
|
@ -2359,7 +2359,7 @@ test_read_minimal_slave(void)
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"br0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
"bridge",
|
||||
NULL);
|
||||
nmtst_connection_normalize(con_archetype);
|
||||
|
|
|
|||
|
|
@ -1096,7 +1096,7 @@ _normalize_connection_slave_type(NMConnection *self)
|
|||
if (!nm_setting_connection_get_master(s_con))
|
||||
return FALSE;
|
||||
|
||||
slave_type = nm_setting_connection_get_slave_type(s_con);
|
||||
slave_type = nm_setting_connection_get_port_type(s_con);
|
||||
if (slave_type) {
|
||||
if (_nm_setting_slave_type_is_valid(slave_type, &port_type) && port_type) {
|
||||
NMSetting *s_port;
|
||||
|
|
@ -1112,7 +1112,7 @@ _normalize_connection_slave_type(NMConnection *self)
|
|||
}
|
||||
} else {
|
||||
if ((slave_type = _nm_connection_detect_slave_type(self, NULL))) {
|
||||
g_object_set(s_con, NM_SETTING_CONNECTION_SLAVE_TYPE, slave_type, NULL);
|
||||
g_object_set(s_con, NM_SETTING_CONNECTION_PORT_TYPE, slave_type, NULL);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1172,7 +1172,7 @@ _supports_addr_family(NMConnection *self, int family)
|
|||
if (strcmp(connection_type, NM_SETTING_6LOWPAN_SETTING_NAME) == 0)
|
||||
return family == AF_INET6 || family == AF_UNSPEC;
|
||||
if ((s_con = nm_connection_get_setting_connection(self))
|
||||
&& (nm_streq0(nm_setting_connection_get_slave_type(s_con), NM_SETTING_VRF_SETTING_NAME)))
|
||||
&& (nm_streq0(nm_setting_connection_get_port_type(s_con), NM_SETTING_VRF_SETTING_NAME)))
|
||||
return TRUE;
|
||||
|
||||
return !nm_setting_connection_get_master(nm_connection_get_setting_connection(self));
|
||||
|
|
@ -1768,7 +1768,7 @@ _normalize_invalid_slave_port_settings(NMConnection *self)
|
|||
const char *slave_type;
|
||||
gboolean changed = FALSE;
|
||||
|
||||
slave_type = nm_setting_connection_get_slave_type(s_con);
|
||||
slave_type = nm_setting_connection_get_port_type(s_con);
|
||||
|
||||
if (!nm_streq0(slave_type, NM_SETTING_BRIDGE_SETTING_NAME)
|
||||
&& _nm_connection_remove_setting(self, NM_TYPE_SETTING_BRIDGE_PORT))
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
if (s_con) {
|
||||
const char *master = NULL, *slave_type = NULL;
|
||||
|
||||
slave_type = nm_setting_connection_get_slave_type(s_con);
|
||||
slave_type = nm_setting_connection_get_port_type(s_con);
|
||||
if (!g_strcmp0(slave_type, NM_SETTING_6LOWPAN_SETTING_NAME))
|
||||
master = nm_setting_connection_get_master(s_con);
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
slave_type = nm_setting_connection_get_slave_type(s_con);
|
||||
slave_type = nm_setting_connection_get_port_type(s_con);
|
||||
if (slave_type && !nm_streq(slave_type, NM_SETTING_BOND_SETTING_NAME)) {
|
||||
g_set_error(error,
|
||||
NM_CONNECTION_ERROR,
|
||||
|
|
@ -114,7 +114,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
g_prefix_error(error,
|
||||
"%s.%s: ",
|
||||
NM_SETTING_CONNECTION_SETTING_NAME,
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE);
|
||||
NM_SETTING_CONNECTION_PORT_TYPE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -328,7 +328,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
slave_type = nm_setting_connection_get_slave_type(s_con);
|
||||
slave_type = nm_setting_connection_get_port_type(s_con);
|
||||
if (slave_type && strcmp(slave_type, NM_SETTING_BRIDGE_SETTING_NAME)) {
|
||||
g_set_error(error,
|
||||
NM_CONNECTION_ERROR,
|
||||
|
|
@ -341,7 +341,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
g_prefix_error(error,
|
||||
"%s.%s: ",
|
||||
NM_SETTING_CONNECTION_SETTING_NAME,
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE);
|
||||
NM_SETTING_CONNECTION_PORT_TYPE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1136,7 +1136,7 @@ _nm_connection_detect_slave_type_full(NMSettingConnection *s_con,
|
|||
g_prefix_error(error,
|
||||
"%s.%s: ",
|
||||
NM_SETTING_CONNECTION_SETTING_NAME,
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE);
|
||||
NM_SETTING_CONNECTION_PORT_TYPE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1172,11 +1172,11 @@ _nm_connection_detect_slave_type_full(NMSettingConnection *s_con,
|
|||
NM_CONNECTION_ERROR_MISSING_PROPERTY,
|
||||
_("Cannot set '%s' without '%s'"),
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE);
|
||||
NM_SETTING_CONNECTION_PORT_TYPE);
|
||||
g_prefix_error(error,
|
||||
"%s.%s: ",
|
||||
NM_SETTING_CONNECTION_SETTING_NAME,
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE);
|
||||
NM_SETTING_CONNECTION_PORT_TYPE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1387,7 +1387,7 @@ after_interface_name:
|
|||
g_prefix_error(error,
|
||||
"%s.%s: ",
|
||||
NM_SETTING_CONNECTION_SETTING_NAME,
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE);
|
||||
NM_SETTING_CONNECTION_PORT_TYPE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1619,12 +1619,12 @@ after_interface_name:
|
|||
"be set to '%s'"),
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
normerr_missing_slave_type_port,
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
normerr_missing_slave_type);
|
||||
g_prefix_error(error,
|
||||
"%s.%s: ",
|
||||
NM_SETTING_CONNECTION_SETTING_NAME,
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE);
|
||||
NM_SETTING_CONNECTION_PORT_TYPE);
|
||||
return NM_SETTING_VERIFY_NORMALIZABLE_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -1642,14 +1642,14 @@ after_interface_name:
|
|||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_SETTING,
|
||||
_("A slave connection with '%s' set to '%s' cannot have a '%s' setting"),
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
priv->port_type ?: "",
|
||||
has_bridge_port ? NM_SETTING_BRIDGE_PORT_SETTING_NAME
|
||||
: NM_SETTING_TEAM_PORT_SETTING_NAME);
|
||||
g_prefix_error(error,
|
||||
"%s.%s: ",
|
||||
NM_SETTING_CONNECTION_SETTING_NAME,
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE);
|
||||
NM_SETTING_CONNECTION_PORT_TYPE);
|
||||
return NM_SETTING_VERIFY_NORMALIZABLE_ERROR;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
}
|
||||
|
||||
if ((s_con = nm_connection_get_setting_connection(connection))) {
|
||||
if (nm_setting_connection_get_slave_type(s_con)
|
||||
if (nm_setting_connection_get_port_type(s_con)
|
||||
|| nm_setting_connection_get_master(s_con)) {
|
||||
g_set_error(error,
|
||||
NM_CONNECTION_ERROR,
|
||||
|
|
@ -134,8 +134,8 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
g_prefix_error(error,
|
||||
"%s.%s: ",
|
||||
NM_SETTING_CONNECTION_SETTING_NAME,
|
||||
nm_setting_connection_get_slave_type(s_con)
|
||||
? NM_SETTING_CONNECTION_SLAVE_TYPE
|
||||
nm_setting_connection_get_port_type(s_con)
|
||||
? NM_SETTING_CONNECTION_PORT_TYPE
|
||||
: NM_SETTING_CONNECTION_CONTROLLER);
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
if (s_con) {
|
||||
const char *master = NULL, *slave_type = NULL;
|
||||
|
||||
slave_type = nm_setting_connection_get_slave_type(s_con);
|
||||
slave_type = nm_setting_connection_get_port_type(s_con);
|
||||
if (!g_strcmp0(slave_type, NM_SETTING_MACSEC_SETTING_NAME))
|
||||
master = nm_setting_connection_get_master(s_con);
|
||||
|
||||
|
|
|
|||
|
|
@ -321,7 +321,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
slave_type = nm_setting_connection_get_slave_type(s_con);
|
||||
slave_type = nm_setting_connection_get_port_type(s_con);
|
||||
if (slave_type && !nm_streq(slave_type, NM_SETTING_OVS_PORT_SETTING_NAME)) {
|
||||
g_set_error(error,
|
||||
NM_CONNECTION_ERROR,
|
||||
|
|
@ -334,7 +334,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
g_prefix_error(error,
|
||||
"%s.%s: ",
|
||||
NM_SETTING_CONNECTION_SETTING_NAME,
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE);
|
||||
NM_SETTING_CONNECTION_PORT_TYPE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -426,12 +426,12 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
slave_type = nm_setting_connection_get_slave_type(s_con);
|
||||
slave_type = nm_setting_connection_get_port_type(s_con);
|
||||
if (slave_type && strcmp(slave_type, NM_SETTING_OVS_BRIDGE_SETTING_NAME)) {
|
||||
g_set_error(error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
_("A connection with a '%s' setting must have the slave-type set to '%s'. "
|
||||
_("A connection with a '%s' setting must have the port-type set to '%s'. "
|
||||
"Instead it is '%s'"),
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NM_SETTING_OVS_BRIDGE_SETTING_NAME,
|
||||
|
|
@ -439,7 +439,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
g_prefix_error(error,
|
||||
"%s.%s: ",
|
||||
NM_SETTING_CONNECTION_SETTING_NAME,
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE);
|
||||
NM_SETTING_CONNECTION_PORT_TYPE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
slave_type = nm_setting_connection_get_slave_type(s_con);
|
||||
slave_type = nm_setting_connection_get_port_type(s_con);
|
||||
if (slave_type && strcmp(slave_type, NM_SETTING_TEAM_SETTING_NAME)) {
|
||||
g_set_error(error,
|
||||
NM_CONNECTION_ERROR,
|
||||
|
|
@ -336,7 +336,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
g_prefix_error(error,
|
||||
"%s.%s: ",
|
||||
NM_SETTING_CONNECTION_SETTING_NAME,
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE);
|
||||
NM_SETTING_CONNECTION_PORT_TYPE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -614,7 +614,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
if (s_con) {
|
||||
const char *master = NULL, *slave_type = NULL;
|
||||
|
||||
slave_type = nm_setting_connection_get_slave_type(s_con);
|
||||
slave_type = nm_setting_connection_get_port_type(s_con);
|
||||
if (!g_strcmp0(slave_type, NM_SETTING_VLAN_SETTING_NAME))
|
||||
master = nm_setting_connection_get_master(s_con);
|
||||
|
||||
|
|
|
|||
|
|
@ -6239,7 +6239,7 @@ test_connection_normalize_slave_type_1(void)
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
"invalid-type",
|
||||
NULL);
|
||||
|
||||
|
|
@ -6248,7 +6248,7 @@ test_connection_normalize_slave_type_1(void)
|
|||
NM_CONNECTION_ERROR_INVALID_PROPERTY);
|
||||
g_assert(!nm_connection_get_setting_by_name(con, NM_SETTING_BRIDGE_PORT_SETTING_NAME));
|
||||
|
||||
g_object_set(s_con, NM_SETTING_CONNECTION_SLAVE_TYPE, "bridge", NULL);
|
||||
g_object_set(s_con, NM_SETTING_CONNECTION_PORT_TYPE, "bridge", NULL);
|
||||
|
||||
g_assert(!nm_connection_get_setting_by_name(con, NM_SETTING_BRIDGE_PORT_SETTING_NAME));
|
||||
nmtst_assert_connection_verifies_after_normalization(con,
|
||||
|
|
@ -6256,9 +6256,7 @@ test_connection_normalize_slave_type_1(void)
|
|||
NM_CONNECTION_ERROR_MISSING_SETTING);
|
||||
nmtst_connection_normalize(con);
|
||||
g_assert(nm_connection_get_setting_by_name(con, NM_SETTING_BRIDGE_PORT_SETTING_NAME));
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con),
|
||||
==,
|
||||
NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -6275,7 +6273,7 @@ test_connection_normalize_slave_type_2(void)
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
"invalid-type",
|
||||
NULL);
|
||||
|
||||
|
|
@ -6284,19 +6282,17 @@ test_connection_normalize_slave_type_2(void)
|
|||
NM_CONNECTION_ERROR_INVALID_PROPERTY);
|
||||
g_assert(!nm_connection_get_setting_by_name(con, NM_SETTING_BRIDGE_PORT_SETTING_NAME));
|
||||
|
||||
g_object_set(s_con, NM_SETTING_CONNECTION_SLAVE_TYPE, NULL, NULL);
|
||||
g_object_set(s_con, NM_SETTING_CONNECTION_PORT_TYPE, NULL, NULL);
|
||||
nm_connection_add_setting(con, nm_setting_bridge_port_new());
|
||||
|
||||
g_assert(nm_connection_get_setting_by_name(con, NM_SETTING_BRIDGE_PORT_SETTING_NAME));
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con), ==, NULL);
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NULL);
|
||||
nmtst_assert_connection_verifies_after_normalization(con,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_MISSING_PROPERTY);
|
||||
nmtst_connection_normalize(con);
|
||||
g_assert(nm_connection_get_setting_by_name(con, NM_SETTING_BRIDGE_PORT_SETTING_NAME));
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con),
|
||||
==,
|
||||
NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -6576,7 +6572,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data)
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
||||
|
|
@ -6597,7 +6593,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data)
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
||||
|
|
@ -6620,7 +6616,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data)
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
||||
|
|
@ -6638,7 +6634,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data)
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
||||
|
|
@ -6667,7 +6663,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data)
|
|||
NM_SETTING_WIRED_SETTING_NAME,
|
||||
NM_SETTING_OVS_INTERFACE_SETTING_NAME);
|
||||
g_assert(s_con == nm_connection_get_setting_connection(con));
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con),
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con),
|
||||
==,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME);
|
||||
break;
|
||||
|
|
@ -6675,7 +6671,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data)
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_BRIDGE_SETTING_NAME,
|
||||
NULL);
|
||||
|
||||
|
|
@ -6691,7 +6687,7 @@ test_connection_normalize_ovs_interface_type_system(gconstpointer test_data)
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_BRIDGE_SETTING_NAME,
|
||||
NULL);
|
||||
|
||||
|
|
@ -6750,7 +6746,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
NM_SETTING_OVS_INTERFACE_SETTING_NAME);
|
||||
g_assert(s_con == nm_connection_get_setting_connection(con));
|
||||
g_assert(s_ovs_if == nm_connection_get_setting_ovs_interface(con));
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con),
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con),
|
||||
==,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_ovs_interface_get_interface_type(s_ovs_if), ==, "internal");
|
||||
|
|
@ -6759,7 +6755,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
nmtst_assert_connection_verifies_after_normalization(con,
|
||||
|
|
@ -6774,7 +6770,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
NM_SETTING_OVS_INTERFACE_SETTING_NAME);
|
||||
g_assert(s_con == nm_connection_get_setting_connection(con));
|
||||
g_assert(s_ovs_if == nm_connection_get_setting_ovs_interface(con));
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con),
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con),
|
||||
==,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_ovs_interface_get_interface_type(s_ovs_if), ==, "internal");
|
||||
|
|
@ -6794,7 +6790,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
NM_SETTING_OVS_INTERFACE_SETTING_NAME);
|
||||
g_assert(s_con == nm_connection_get_setting_connection(con));
|
||||
g_assert(s_ovs_if == nm_connection_get_setting_ovs_interface(con));
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con),
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con),
|
||||
==,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_ovs_interface_get_interface_type(s_ovs_if), ==, "internal");
|
||||
|
|
@ -6803,7 +6799,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
g_object_set(s_ovs_if, NM_SETTING_OVS_INTERFACE_TYPE, "internal", NULL);
|
||||
|
|
@ -6826,7 +6822,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
g_object_set(s_ovs_if, NM_SETTING_OVS_INTERFACE_TYPE, "internal", NULL);
|
||||
|
|
@ -6840,7 +6836,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
NM_SETTING_OVS_INTERFACE_SETTING_NAME);
|
||||
g_assert(s_con == nm_connection_get_setting_connection(con));
|
||||
g_assert(s_ovs_if == nm_connection_get_setting_ovs_interface(con));
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con),
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con),
|
||||
==,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_ovs_interface_get_interface_type(s_ovs_if), ==, "internal");
|
||||
|
|
@ -6849,7 +6845,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
g_object_set(s_ovs_if, NM_SETTING_OVS_INTERFACE_TYPE, "system", NULL);
|
||||
|
|
@ -6861,7 +6857,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
g_object_set(s_ovs_if, NM_SETTING_OVS_INTERFACE_TYPE, "bogus", NULL);
|
||||
|
|
@ -6873,7 +6869,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
g_object_set(s_ovs_if, NM_SETTING_OVS_INTERFACE_TYPE, "patch", NULL);
|
||||
|
|
@ -6885,7 +6881,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
g_object_set(s_ovs_if, NM_SETTING_OVS_INTERFACE_TYPE, "patch", NULL);
|
||||
|
|
@ -6898,7 +6894,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NM_SETTING_CONNECTION_INTERFACE_NAME,
|
||||
"adsf",
|
||||
|
|
@ -6913,7 +6909,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NM_SETTING_CONNECTION_INTERFACE_NAME,
|
||||
"adsf",
|
||||
|
|
@ -6933,7 +6929,7 @@ test_connection_normalize_ovs_interface_type_ovs_interface(gconstpointer test_da
|
|||
NM_SETTING_OVS_PATCH_SETTING_NAME);
|
||||
g_assert(s_con == nm_connection_get_setting_connection(con));
|
||||
g_assert(s_ovs_if == nm_connection_get_setting_ovs_interface(con));
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con),
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con),
|
||||
==,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_ovs_interface_get_interface_type(s_ovs_if), ==, "patch");
|
||||
|
|
@ -10705,7 +10701,7 @@ test_connection_ovs_ifname(gconstpointer test_data)
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_BRIDGE_SETTING_NAME,
|
||||
NULL);
|
||||
|
||||
|
|
@ -10723,7 +10719,7 @@ test_connection_ovs_ifname(gconstpointer test_data)
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
||||
|
|
@ -10750,7 +10746,7 @@ test_connection_ovs_ifname(gconstpointer test_data)
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
||||
|
|
@ -10766,7 +10762,7 @@ test_connection_ovs_ifname(gconstpointer test_data)
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
||||
|
|
@ -10792,7 +10788,7 @@ test_connection_ovs_ifname(gconstpointer test_data)
|
|||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
"master0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
NM_SETTING_OVS_PORT_SETTING_NAME,
|
||||
NULL);
|
||||
|
||||
|
|
|
|||
|
|
@ -2809,7 +2809,7 @@ _complete_fcn_connection_master(ARGS_COMPLETE_FCN)
|
|||
* slave-type. */
|
||||
s_con = nm_connection_get_setting_connection(operation_context->connection);
|
||||
if (s_con)
|
||||
expected_type = nm_setting_connection_get_slave_type(s_con);
|
||||
expected_type = nm_setting_connection_get_port_type(s_con);
|
||||
}
|
||||
|
||||
text_len = text ? strlen(text) : 0;
|
||||
|
|
|
|||
|
|
@ -924,7 +924,7 @@ reader_parse_master(Reader *reader, char *argument, const char *type_name, const
|
|||
connection = reader_get_connection(reader, slave, NULL, TRUE);
|
||||
s_con = nm_connection_get_setting_connection(connection);
|
||||
g_object_set(s_con,
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
type_name,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
master,
|
||||
|
|
|
|||
|
|
@ -1031,7 +1031,7 @@ test_bond(void)
|
|||
==,
|
||||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth0");
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_master(s_con), ==, master_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
|
|
@ -1047,7 +1047,7 @@ test_bond(void)
|
|||
==,
|
||||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth1");
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_master(s_con), ==, master_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
|
|
@ -1129,7 +1129,7 @@ test_bond_ip(void)
|
|||
==,
|
||||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth0");
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_master(s_con), ==, master_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
|
|
@ -1145,7 +1145,7 @@ test_bond_ip(void)
|
|||
==,
|
||||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth1");
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_master(s_con), ==, master_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
|
|
@ -1208,7 +1208,7 @@ test_bond_default(void)
|
|||
==,
|
||||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth0");
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BOND_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_master(s_con), ==, master_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
|
|
@ -1284,9 +1284,7 @@ test_bridge(void)
|
|||
==,
|
||||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth0");
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con),
|
||||
==,
|
||||
NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_master(s_con), ==, master_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
|
|
@ -1302,9 +1300,7 @@ test_bridge(void)
|
|||
==,
|
||||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth1");
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con),
|
||||
==,
|
||||
NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_master(s_con), ==, master_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
|
|
@ -1365,9 +1361,7 @@ test_bridge_default(void)
|
|||
==,
|
||||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth0");
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con),
|
||||
==,
|
||||
NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_master(s_con), ==, master_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
|
|
@ -1433,7 +1427,7 @@ test_bridge_ip(void)
|
|||
==,
|
||||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, ifname);
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con),
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con),
|
||||
==,
|
||||
NM_SETTING_BRIDGE_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_master(s_con), ==, master_uuid);
|
||||
|
|
@ -1499,7 +1493,7 @@ test_team(void)
|
|||
==,
|
||||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth0");
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con), ==, NM_SETTING_TEAM_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_TEAM_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_master(s_con), ==, master_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
|
|
@ -1515,7 +1509,7 @@ test_team(void)
|
|||
==,
|
||||
NM_SETTING_WIRED_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_id(s_con), ==, "eth1");
|
||||
g_assert_cmpstr(nm_setting_connection_get_slave_type(s_con), ==, NM_SETTING_TEAM_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_port_type(s_con), ==, NM_SETTING_TEAM_SETTING_NAME);
|
||||
g_assert_cmpstr(nm_setting_connection_get_master(s_con), ==, master_uuid);
|
||||
g_assert_cmpint(nm_setting_connection_get_multi_connect(s_con),
|
||||
==,
|
||||
|
|
|
|||
|
|
@ -805,7 +805,7 @@ _metagen_con_show_get_fcn(NMC_META_GENERIC_INFO_GET_FCN_ARGS)
|
|||
case NMC_GENERIC_INFO_TYPE_CON_SHOW_PORT:
|
||||
if (!s_con)
|
||||
return NULL;
|
||||
return nm_setting_connection_get_slave_type(s_con);
|
||||
return nm_setting_connection_get_port_type(s_con);
|
||||
case NMC_GENERIC_INFO_TYPE_CON_SHOW_FILENAME:
|
||||
if (!NM_IS_REMOTE_CONNECTION(c))
|
||||
return NULL;
|
||||
|
|
@ -3865,7 +3865,7 @@ is_setting_mandatory(NMConnection *connection, NMSetting *setting)
|
|||
g_return_val_if_fail(s_con, FALSE);
|
||||
|
||||
c_type = nm_setting_connection_get_connection_type(s_con);
|
||||
s_type = nm_setting_connection_get_slave_type(s_con);
|
||||
s_type = nm_setting_connection_get_port_type(s_con);
|
||||
|
||||
name = nm_setting_get_name(setting);
|
||||
|
||||
|
|
@ -4454,7 +4454,7 @@ con_settings(NMConnection *connection,
|
|||
s_con = nm_connection_get_setting_connection(connection);
|
||||
g_return_val_if_fail(s_con, FALSE);
|
||||
|
||||
con_type = nm_setting_connection_get_slave_type(s_con);
|
||||
con_type = nm_setting_connection_get_port_type(s_con);
|
||||
*port_settings = nm_meta_setting_info_valid_parts_for_slave_type(con_type, NULL);
|
||||
if (!*port_settings) {
|
||||
g_set_error(error,
|
||||
|
|
@ -4554,7 +4554,7 @@ enable_type_settings_and_options(NmCli *nmc, NMConnection *con, GError **error)
|
|||
s_con = nm_connection_get_setting_connection(con);
|
||||
g_return_val_if_fail(s_con, FALSE);
|
||||
|
||||
if (nm_setting_connection_get_slave_type(s_con)) {
|
||||
if (nm_setting_connection_get_port_type(s_con)) {
|
||||
enable_options(NM_SETTING_CONNECTION_SETTING_NAME, NM_SETTING_CONNECTION_CONTROLLER, NULL);
|
||||
}
|
||||
|
||||
|
|
@ -4616,7 +4616,7 @@ set_connection_type(NmCli *nmc,
|
|||
if (!set_property(nmc->client,
|
||||
con,
|
||||
NM_SETTING_CONNECTION_SETTING_NAME,
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
port_type,
|
||||
NM_META_ACCESSOR_MODIFIER_SET,
|
||||
error)) {
|
||||
|
|
@ -4686,14 +4686,14 @@ set_connection_controller(NmCli *nmc,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
port_type = nm_setting_connection_get_slave_type(s_con);
|
||||
port_type = nm_setting_connection_get_port_type(s_con);
|
||||
connections = nmc_get_connections(nmc);
|
||||
value = normalized_controller_for_port(connections, value, port_type, &port_type);
|
||||
|
||||
if (!set_property(nmc->client,
|
||||
con,
|
||||
NM_SETTING_CONNECTION_SETTING_NAME,
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
port_type,
|
||||
NM_META_ACCESSOR_MODIFIER_SET,
|
||||
error)) {
|
||||
|
|
@ -5018,7 +5018,7 @@ complete_property_name(NmCli *nmc,
|
|||
connection_type = nm_connection_get_connection_type(connection);
|
||||
s_con = nm_connection_get_setting_connection(connection);
|
||||
if (s_con)
|
||||
port_type = nm_setting_connection_get_slave_type(s_con);
|
||||
port_type = nm_setting_connection_get_port_type(s_con);
|
||||
valid_settings_main = get_valid_settings_array(connection_type);
|
||||
valid_settings_port = nm_meta_setting_info_valid_parts_for_slave_type(port_type, NULL);
|
||||
|
||||
|
|
@ -5961,7 +5961,7 @@ read_properties:
|
|||
|
||||
/* Traditionally, we didn't ask for these options for ethernet ports. They don't
|
||||
* make much sense, since these are likely to be set by the controller anyway. */
|
||||
if (nm_setting_connection_get_slave_type(s_con)) {
|
||||
if (nm_setting_connection_get_port_type(s_con)) {
|
||||
disable_options(NM_SETTING_WIRED_SETTING_NAME, NM_SETTING_WIRED_MTU);
|
||||
disable_options(NM_SETTING_WIRED_SETTING_NAME, NM_SETTING_WIRED_MAC_ADDRESS);
|
||||
disable_options(NM_SETTING_WIRED_SETTING_NAME, NM_SETTING_WIRED_CLONED_MAC_ADDRESS);
|
||||
|
|
@ -5972,7 +5972,7 @@ read_properties:
|
|||
if (!nm_setting_connection_get_id(s_con)) {
|
||||
const char *ifname = nm_setting_connection_get_interface_name(s_con);
|
||||
const char *type = nm_setting_connection_get_connection_type(s_con);
|
||||
const char *port_type = nm_setting_connection_get_slave_type(s_con);
|
||||
const char *port_type = nm_setting_connection_get_port_type(s_con);
|
||||
|
||||
/* If only bother when there's a type, which is not guaranteed at this point.
|
||||
* Otherwise, the validation will fail anyway. */
|
||||
|
|
@ -6247,7 +6247,7 @@ gen_setting_names(const char *text, int state)
|
|||
/* is_port */
|
||||
s_con = nm_connection_get_setting_connection(nmc_tab_completion.connection);
|
||||
if (s_con)
|
||||
s_type = nm_setting_connection_get_slave_type(s_con);
|
||||
s_type = nm_setting_connection_get_port_type(s_con);
|
||||
valid_settings_arr = nm_meta_setting_info_valid_parts_for_slave_type(s_type, NULL);
|
||||
|
||||
if (list_idx < NM_PTRARRAY_LEN(valid_settings_arr)) {
|
||||
|
|
@ -6614,7 +6614,7 @@ get_setting_and_property(const char *prompt,
|
|||
/* Is this too much (and useless?) effort for an unlikely case? */
|
||||
s_con = nm_connection_get_setting_connection(nmc_tab_completion.connection);
|
||||
if (s_con)
|
||||
s_type = nm_setting_connection_get_slave_type(s_con);
|
||||
s_type = nm_setting_connection_get_port_type(s_con);
|
||||
|
||||
valid_settings_main = get_valid_settings_array(nmc_tab_completion.con_type);
|
||||
valid_settings_port = nm_meta_setting_info_valid_parts_for_slave_type(s_type, NULL);
|
||||
|
|
@ -7985,7 +7985,7 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty
|
|||
|
||||
s_con = nm_connection_get_setting_connection(connection);
|
||||
if (s_con)
|
||||
s_type = nm_setting_connection_get_slave_type(s_con);
|
||||
s_type = nm_setting_connection_get_port_type(s_con);
|
||||
|
||||
valid_settings_main = get_valid_settings_array(connection_type);
|
||||
valid_settings_port = nm_meta_setting_info_valid_parts_for_slave_type(s_type, NULL);
|
||||
|
|
@ -8860,7 +8860,7 @@ editor_init_new_connection(NmCli *nmc, NMConnection *connection, const char *por
|
|||
NM_SETTING_WIRED_SETTING_NAME,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
dev_ifname ?: "eth0",
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
port_type,
|
||||
NULL);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -449,7 +449,7 @@ nm_editor_utils_create_connection(GType type, NMConnection *controller, NMClient
|
|||
!type_data->no_autoconnect,
|
||||
NM_SETTING_CONNECTION_CONTROLLER,
|
||||
controller_uuid,
|
||||
NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_CONNECTION_PORT_TYPE,
|
||||
controller_setting_type,
|
||||
NM_SETTING_CONNECTION_INTERFACE_NAME,
|
||||
ifname,
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ nmt_editor_constructed(GObject *object)
|
|||
add_sections_for_page(editor, grid, page);
|
||||
nmt_editor_grid_append(grid, NULL, nmt_newt_separator_new(), NULL);
|
||||
|
||||
port_type = nm_setting_connection_get_slave_type(s_con);
|
||||
port_type = nm_setting_connection_get_port_type(s_con);
|
||||
if (port_type) {
|
||||
if (!strcmp(port_type, NM_SETTING_BRIDGE_SETTING_NAME))
|
||||
add_sections_for_page(editor, grid, nmt_page_bridge_port_new(priv->edit_connection));
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ nmt_port_list_connection_filter(NmtEditConnectionList *list,
|
|||
s_con = nm_connection_get_setting_connection(connection);
|
||||
g_return_val_if_fail(s_con != NULL, FALSE);
|
||||
|
||||
port_type = nm_setting_connection_get_slave_type(s_con);
|
||||
port_type = nm_setting_connection_get_port_type(s_con);
|
||||
if (g_strcmp0(port_type, priv->controller_type) != 0)
|
||||
return FALSE;
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ edit_connection_list_filter(NmtEditConnectionList *list,
|
|||
controller = nm_setting_connection_get_master(s_con);
|
||||
if (!controller)
|
||||
return TRUE;
|
||||
port_type = nm_setting_connection_get_slave_type(s_con);
|
||||
port_type = nm_setting_connection_get_port_type(s_con);
|
||||
if (g_strcmp0(port_type, NM_SETTING_BOND_SETTING_NAME) != 0
|
||||
&& g_strcmp0(port_type, NM_SETTING_TEAM_SETTING_NAME) != 0
|
||||
&& g_strcmp0(port_type, NM_SETTING_BRIDGE_SETTING_NAME) != 0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue