platform/trivial: rename link related functions

Link related functions should have a "nm_platform_link" prefix. Rename.

Naming is a subjective matter and one might argue that omitting
the "link" part from the name is shorter and even preferred.

However, I think functions related to links should have a common
prefix as the underlyings are strongly related.
This commit is contained in:
Thomas Haller
2015-12-09 16:14:49 +01:00
parent 6a7730241b
commit eef388990f
15 changed files with 128 additions and 115 deletions

View File

@@ -618,7 +618,7 @@ _linktype_get_type (NMPlatform *platform,
NMPlatformTunProperties props;
if ( platform
&& nm_platform_tun_get_properties_ifname (platform, ifname, &props)) {
&& nm_platform_link_tun_get_properties_ifname (platform, ifname, &props)) {
if (!g_strcmp0 (props.mode, "tap"))
return NM_LINK_TYPE_TAP;
if (!g_strcmp0 (props.mode, "tun"))

View File

@@ -642,7 +642,7 @@ nm_platform_link_add (NMPlatform *self,
}
/**
* nm_platform_dummy_add:
* nm_platform_link_dummy_add:
* @self: platform instance
* @name: New interface name
* @out_link: on success, the link object
@@ -650,7 +650,7 @@ nm_platform_link_add (NMPlatform *self,
* Create a software ethernet-like interface
*/
NMPlatformError
nm_platform_dummy_add (NMPlatform *self, const char *name, const NMPlatformLink **out_link)
nm_platform_link_dummy_add (NMPlatform *self, const char *name, const NMPlatformLink **out_link)
{
return nm_platform_link_add (self, name, NM_LINK_TYPE_DUMMY, NULL, 0, out_link);
}
@@ -1476,7 +1476,7 @@ nm_platform_link_get_lnk_vxlan (NMPlatform *self, int ifindex, const NMPlatformL
/*****************************************************************************/
/**
* nm_platform_bridge_add:
* nm_platform_link_bridge_add:
* @self: platform instance
* @name: New interface name
* @address: (allow-none): set the mac address of the new bridge
@@ -1486,17 +1486,17 @@ nm_platform_link_get_lnk_vxlan (NMPlatform *self, int ifindex, const NMPlatformL
* Create a software bridge.
*/
NMPlatformError
nm_platform_bridge_add (NMPlatform *self,
const char *name,
const void *address,
size_t address_len,
const NMPlatformLink **out_link)
nm_platform_link_bridge_add (NMPlatform *self,
const char *name,
const void *address,
size_t address_len,
const NMPlatformLink **out_link)
{
return nm_platform_link_add (self, name, NM_LINK_TYPE_BRIDGE, address, address_len, out_link);
}
/**
* nm_platform_bond_add:
* nm_platform_link_bond_add:
* @self: platform instance
* @name: New interface name
* @out_link: on success, the link object
@@ -1504,13 +1504,13 @@ nm_platform_bridge_add (NMPlatform *self,
* Create a software bonding device.
*/
NMPlatformError
nm_platform_bond_add (NMPlatform *self, const char *name, const NMPlatformLink **out_link)
nm_platform_link_bond_add (NMPlatform *self, const char *name, const NMPlatformLink **out_link)
{
return nm_platform_link_add (self, name, NM_LINK_TYPE_BOND, NULL, 0, out_link);
}
/**
* nm_platform_team_add:
* nm_platform_link_team_add:
* @self: platform instance
* @name: New interface name
* @out_link: on success, the link object
@@ -1518,13 +1518,13 @@ nm_platform_bond_add (NMPlatform *self, const char *name, const NMPlatformLink *
* Create a software teaming device.
*/
NMPlatformError
nm_platform_team_add (NMPlatform *self, const char *name, const NMPlatformLink **out_link)
nm_platform_link_team_add (NMPlatform *self, const char *name, const NMPlatformLink **out_link)
{
return nm_platform_link_add (self, name, NM_LINK_TYPE_TEAM, NULL, 0, out_link);
}
/**
* nm_platform_vlan_add:
* nm_platform_link_vlan_add:
* @self: platform instance
* @name: New interface name
* @vlanid: VLAN identifier
@@ -1534,7 +1534,7 @@ nm_platform_team_add (NMPlatform *self, const char *name, const NMPlatformLink *
* Create a software VLAN device.
*/
NMPlatformError
nm_platform_vlan_add (NMPlatform *self,
nm_platform_link_vlan_add (NMPlatform *self,
const char *name,
int parent,
int vlanid,
@@ -1594,7 +1594,7 @@ nm_platform_link_vxlan_add (NMPlatform *self,
}
/**
* nm_platform_tun_add:
* nm_platform_link_tun_add:
* @self: platform instance
* @name: new interface name
* @tap: whether the interface is a TAP
@@ -1608,9 +1608,15 @@ nm_platform_link_vxlan_add (NMPlatform *self,
* Create a TUN or TAP interface.
*/
NMPlatformError
nm_platform_tun_add (NMPlatform *self, const char *name, gboolean tap,
gint64 owner, gint64 group, gboolean pi, gboolean vnet_hdr,
gboolean multi_queue, const NMPlatformLink **out_link)
nm_platform_link_tun_add (NMPlatform *self,
const char *name,
gboolean tap,
gint64 owner,
gint64 group,
gboolean pi,
gboolean vnet_hdr,
gboolean multi_queue,
const NMPlatformLink **out_link)
{
NMPlatformError plerr;
@@ -1747,7 +1753,7 @@ nm_platform_link_vlan_change (NMPlatform *self,
}
gboolean
nm_platform_vlan_set_ingress_map (NMPlatform *self, int ifindex, int from, int to)
nm_platform_link_vlan_set_ingress_map (NMPlatform *self, int ifindex, int from, int to)
{
NMVlanQosMapping map = {
.from = from,
@@ -1758,7 +1764,7 @@ nm_platform_vlan_set_ingress_map (NMPlatform *self, int ifindex, int from, int t
}
gboolean
nm_platform_vlan_set_egress_map (NMPlatform *self, int ifindex, int from, int to)
nm_platform_link_vlan_set_egress_map (NMPlatform *self, int ifindex, int from, int to)
{
NMVlanQosMapping map = {
.from = from,
@@ -1808,7 +1814,7 @@ nm_platform_link_gre_add (NMPlatform *self,
}
NMPlatformError
nm_platform_infiniband_partition_add (NMPlatform *self, int parent, int p_key, const NMPlatformLink **out_link)
nm_platform_link_infiniband_add (NMPlatform *self, int parent, int p_key, const NMPlatformLink **out_link)
{
gs_free char *parent_name = NULL;
gs_free char *name = NULL;
@@ -1838,11 +1844,11 @@ nm_platform_infiniband_partition_add (NMPlatform *self, int parent, int p_key, c
}
gboolean
nm_platform_infiniband_get_properties (NMPlatform *self,
int ifindex,
int *out_parent,
int *out_p_key,
const char **out_mode)
nm_platform_link_infiniband_get_properties (NMPlatform *self,
int ifindex,
int *out_parent,
int *out_p_key,
const char **out_mode)
{
const NMPlatformLnkInfiniband *plnk;
const NMPlatformLink *plink;
@@ -2063,7 +2069,7 @@ nm_platform_link_sit_add (NMPlatform *self,
}
gboolean
nm_platform_veth_get_properties (NMPlatform *self, int ifindex, int *out_peer_ifindex)
nm_platform_link_veth_get_properties (NMPlatform *self, int ifindex, int *out_peer_ifindex)
{
const NMPlatformLink *plink;
int peer_ifindex;
@@ -2093,7 +2099,7 @@ nm_platform_veth_get_properties (NMPlatform *self, int ifindex, int *out_peer_if
}
gboolean
nm_platform_tun_get_properties_ifname (NMPlatform *self, const char *ifname, NMPlatformTunProperties *props)
nm_platform_link_tun_get_properties_ifname (NMPlatform *self, const char *ifname, NMPlatformTunProperties *props)
{
char *path, *val;
gboolean success = TRUE;
@@ -2154,14 +2160,14 @@ nm_platform_tun_get_properties_ifname (NMPlatform *self, const char *ifname, NMP
}
gboolean
nm_platform_tun_get_properties (NMPlatform *self, int ifindex, NMPlatformTunProperties *props)
nm_platform_link_tun_get_properties (NMPlatform *self, int ifindex, NMPlatformTunProperties *props)
{
_CHECK_SELF (self, klass, FALSE);
g_return_val_if_fail (ifindex > 0, FALSE);
g_return_val_if_fail (props != NULL, FALSE);
return nm_platform_tun_get_properties_ifname (self, nm_platform_link_get_name (self, ifindex), props);
return nm_platform_link_tun_get_properties_ifname (self, nm_platform_link_get_name (self, ifindex), props);
}
gboolean

View File

@@ -700,10 +700,10 @@ const NMPlatformLink *nm_platform_link_get_by_ifname (NMPlatform *self, const ch
const NMPlatformLink *nm_platform_link_get_by_address (NMPlatform *self, gconstpointer address, size_t length);
GArray *nm_platform_link_get_all (NMPlatform *self);
NMPlatformError nm_platform_dummy_add (NMPlatform *self, const char *name, const NMPlatformLink **out_link);
NMPlatformError nm_platform_bridge_add (NMPlatform *self, const char *name, const void *address, size_t address_len, const NMPlatformLink **out_link);
NMPlatformError nm_platform_bond_add (NMPlatform *self, const char *name, const NMPlatformLink **out_link);
NMPlatformError nm_platform_team_add (NMPlatform *self, const char *name, const NMPlatformLink **out_link);
NMPlatformError nm_platform_link_dummy_add (NMPlatform *self, const char *name, const NMPlatformLink **out_link);
NMPlatformError nm_platform_link_bridge_add (NMPlatform *self, const char *name, const void *address, size_t address_len, const NMPlatformLink **out_link);
NMPlatformError nm_platform_link_bond_add (NMPlatform *self, const char *name, const NMPlatformLink **out_link);
NMPlatformError nm_platform_link_team_add (NMPlatform *self, const char *name, const NMPlatformLink **out_link);
gboolean nm_platform_link_delete (NMPlatform *self, int ifindex);
/* convienience methods to lookup the link and access fields of NMPlatformLink. */
@@ -756,6 +756,7 @@ gboolean nm_platform_link_supports_vlans (NMPlatform *self, int ifindex);
gboolean nm_platform_link_enslave (NMPlatform *self, int master, int slave);
gboolean nm_platform_link_release (NMPlatform *self, int master, int slave);
gboolean nm_platform_master_set_option (NMPlatform *self, int ifindex, const char *option, const char *value);
char *nm_platform_master_get_option (NMPlatform *self, int ifindex, const char *option);
gboolean nm_platform_slave_set_option (NMPlatform *self, int ifindex, const char *option, const char *value);
@@ -773,9 +774,9 @@ const NMPlatformLnkSit *nm_platform_link_get_lnk_sit (NMPlatform *self, int ifin
const NMPlatformLnkVlan *nm_platform_link_get_lnk_vlan (NMPlatform *self, int ifindex, const NMPlatformLink **out_link);
const NMPlatformLnkVxlan *nm_platform_link_get_lnk_vxlan (NMPlatform *self, int ifindex, const NMPlatformLink **out_link);
NMPlatformError nm_platform_vlan_add (NMPlatform *self, const char *name, int parent, int vlanid, guint32 vlanflags, const NMPlatformLink **out_link);
gboolean nm_platform_vlan_set_ingress_map (NMPlatform *self, int ifindex, int from, int to);
gboolean nm_platform_vlan_set_egress_map (NMPlatform *self, int ifindex, int from, int to);
NMPlatformError nm_platform_link_vlan_add (NMPlatform *self, const char *name, int parent, int vlanid, guint32 vlanflags, const NMPlatformLink **out_link);
gboolean nm_platform_link_vlan_set_ingress_map (NMPlatform *self, int ifindex, int from, int to);
gboolean nm_platform_link_vlan_set_egress_map (NMPlatform *self, int ifindex, int from, int to);
gboolean nm_platform_link_vlan_change (NMPlatform *self,
int ifindex,
NMVlanFlags flags_mask,
@@ -789,16 +790,23 @@ gboolean nm_platform_link_vlan_change (NMPlatform *self,
NMPlatformError nm_platform_link_vxlan_add (NMPlatform *self, const char *name, NMPlatformLnkVxlan *props, const NMPlatformLink **out_link);
NMPlatformError nm_platform_tun_add (NMPlatform *self, const char *name, gboolean tap, gint64 owner, gint64 group, gboolean pi,
gboolean vnet_hdr, gboolean multi_queue, const NMPlatformLink **out_link);
NMPlatformError nm_platform_link_tun_add (NMPlatform *self,
const char *name,
gboolean tap,
gint64 owner,
gint64 group,
gboolean pi,
gboolean vnet_hdr,
gboolean multi_queue,
const NMPlatformLink **out_link);
NMPlatformError nm_platform_infiniband_partition_add (NMPlatform *self, int parent, int p_key, const NMPlatformLink **out_link);
gboolean nm_platform_infiniband_get_properties (NMPlatform *self, int ifindex, int *parent, int *p_key, const char **mode);
NMPlatformError nm_platform_link_infiniband_add (NMPlatform *self, int parent, int p_key, const NMPlatformLink **out_link);
gboolean nm_platform_link_infiniband_get_properties (NMPlatform *self, int ifindex, int *parent, int *p_key, const char **mode);
gboolean nm_platform_veth_get_properties (NMPlatform *self, int ifindex, int *out_peer_ifindex);
gboolean nm_platform_tun_get_properties (NMPlatform *self, int ifindex, NMPlatformTunProperties *properties);
gboolean nm_platform_link_veth_get_properties (NMPlatform *self, int ifindex, int *out_peer_ifindex);
gboolean nm_platform_link_tun_get_properties (NMPlatform *self, int ifindex, NMPlatformTunProperties *properties);
gboolean nm_platform_tun_get_properties_ifname (NMPlatform *platform, const char *ifname, NMPlatformTunProperties *props);
gboolean nm_platform_link_tun_get_properties_ifname (NMPlatform *platform, const char *ifname, NMPlatformTunProperties *props);
gboolean nm_platform_wifi_get_capabilities (NMPlatform *self, int ifindex, NMDeviceWifiCapabilities *caps);
gboolean nm_platform_wifi_get_bssid (NMPlatform *self, int ifindex, guint8 *bssid);

View File

@@ -354,7 +354,7 @@ _g_test_run (gconstpointer user_data)
nm_platform_link_delete (NM_PLATFORM_GET, nm_platform_link_get_ifindex (NM_PLATFORM_GET, DEVICE_NAME));
g_assert (!nm_platform_link_get_by_ifname (NM_PLATFORM_GET, DEVICE_NAME));
g_assert_cmpint (nm_platform_dummy_add (NM_PLATFORM_GET, DEVICE_NAME, NULL), ==, NM_PLATFORM_ERROR_SUCCESS);
g_assert_cmpint (nm_platform_link_dummy_add (NM_PLATFORM_GET, DEVICE_NAME, NULL), ==, NM_PLATFORM_ERROR_SUCCESS);
ifindex = nm_platform_link_get_ifindex (NM_PLATFORM_GET, DEVICE_NAME);
g_assert_cmpint (ifindex, >, 0);

View File

@@ -35,7 +35,7 @@ test_cleanup_internal (void)
inet_pton (AF_INET6, "2001:db8:e:f:1:2:3:4", &gateway6);
/* Create and set up device */
g_assert (nm_platform_dummy_add (NM_PLATFORM_GET, DEVICE_NAME, NULL) == NM_PLATFORM_ERROR_SUCCESS);
g_assert (nm_platform_link_dummy_add (NM_PLATFORM_GET, DEVICE_NAME, NULL) == NM_PLATFORM_ERROR_SUCCESS);
accept_signal (link_added);
free_signal (link_added);
g_assert (nm_platform_link_set_up (NM_PLATFORM_GET, nm_platform_link_get_ifindex (NM_PLATFORM_GET, DEVICE_NAME), NULL));

View File

@@ -61,8 +61,8 @@ test_bogus(void)
g_assert (!nm_platform_link_supports_vlans (NM_PLATFORM_GET, BOGUS_IFINDEX));
g_assert (!nm_platform_link_get_lnk_vlan (NM_PLATFORM_GET, BOGUS_IFINDEX, NULL));
g_assert (!nm_platform_vlan_set_ingress_map (NM_PLATFORM_GET, BOGUS_IFINDEX, 0, 0));
g_assert (!nm_platform_vlan_set_egress_map (NM_PLATFORM_GET, BOGUS_IFINDEX, 0, 0));
g_assert (!nm_platform_link_vlan_set_ingress_map (NM_PLATFORM_GET, BOGUS_IFINDEX, 0, 0));
g_assert (!nm_platform_link_vlan_set_egress_map (NM_PLATFORM_GET, BOGUS_IFINDEX, 0, 0));
}
static void
@@ -83,15 +83,15 @@ software_add (NMLinkType link_type, const char *name)
{
switch (link_type) {
case NM_LINK_TYPE_DUMMY:
return nm_platform_dummy_add (NM_PLATFORM_GET, name, NULL) == NM_PLATFORM_ERROR_SUCCESS;
return nm_platform_link_dummy_add (NM_PLATFORM_GET, name, NULL) == NM_PLATFORM_ERROR_SUCCESS;
case NM_LINK_TYPE_BRIDGE:
return nm_platform_bridge_add (NM_PLATFORM_GET, name, NULL, 0, NULL) == NM_PLATFORM_ERROR_SUCCESS;
return nm_platform_link_bridge_add (NM_PLATFORM_GET, name, NULL, 0, NULL) == NM_PLATFORM_ERROR_SUCCESS;
case NM_LINK_TYPE_BOND:
{
gboolean bond0_exists = !!nm_platform_link_get_by_ifname (NM_PLATFORM_GET, "bond0");
NMPlatformError plerr;
plerr = nm_platform_bond_add (NM_PLATFORM_GET, name, NULL);
plerr = nm_platform_link_bond_add (NM_PLATFORM_GET, name, NULL);
/* Check that bond0 is *not* automatically created. */
if (!bond0_exists)
@@ -99,14 +99,14 @@ software_add (NMLinkType link_type, const char *name)
return plerr == NM_PLATFORM_ERROR_SUCCESS;
}
case NM_LINK_TYPE_TEAM:
return nm_platform_team_add (NM_PLATFORM_GET, name, NULL) == NM_PLATFORM_ERROR_SUCCESS;
return nm_platform_link_team_add (NM_PLATFORM_GET, name, NULL) == NM_PLATFORM_ERROR_SUCCESS;
case NM_LINK_TYPE_VLAN: {
SignalData *parent_added;
SignalData *parent_changed;
/* Don't call link_callback for the bridge interface */
parent_added = add_signal_ifname (NM_PLATFORM_SIGNAL_LINK_CHANGED, NM_PLATFORM_SIGNAL_ADDED, link_callback, PARENT_NAME);
if (nm_platform_bridge_add (NM_PLATFORM_GET, PARENT_NAME, NULL, 0, NULL) == NM_PLATFORM_ERROR_SUCCESS)
if (nm_platform_link_bridge_add (NM_PLATFORM_GET, PARENT_NAME, NULL, 0, NULL) == NM_PLATFORM_ERROR_SUCCESS)
accept_signal (parent_added);
free_signal (parent_added);
@@ -123,7 +123,7 @@ software_add (NMLinkType link_type, const char *name)
accept_signal (parent_changed);
free_signal (parent_changed);
return nm_platform_vlan_add (NM_PLATFORM_GET, name, parent_ifindex, VLAN_ID, 0, NULL) == NM_PLATFORM_ERROR_SUCCESS;
return nm_platform_link_vlan_add (NM_PLATFORM_GET, name, parent_ifindex, VLAN_ID, 0, NULL) == NM_PLATFORM_ERROR_SUCCESS;
}
}
default:
@@ -466,7 +466,7 @@ test_bridge_addr (void)
nm_utils_hwaddr_aton ("de:ad:be:ef:00:11", addr, sizeof (addr));
g_assert_cmpint (nm_platform_bridge_add (NM_PLATFORM_GET, DEVICE_NAME, addr, sizeof (addr), &plink), ==, NM_PLATFORM_ERROR_SUCCESS);
g_assert_cmpint (nm_platform_link_bridge_add (NM_PLATFORM_GET, DEVICE_NAME, addr, sizeof (addr), &plink), ==, NM_PLATFORM_ERROR_SUCCESS);
g_assert (plink);
link = *plink;
g_assert_cmpstr (link.name, ==, DEVICE_NAME);
@@ -518,11 +518,11 @@ test_internal (void)
g_assert (!nm_platform_link_get_ifindex (NM_PLATFORM_GET, DEVICE_NAME));
/* Add device */
g_assert (nm_platform_dummy_add (NM_PLATFORM_GET, DEVICE_NAME, NULL) == NM_PLATFORM_ERROR_SUCCESS);
g_assert (nm_platform_link_dummy_add (NM_PLATFORM_GET, DEVICE_NAME, NULL) == NM_PLATFORM_ERROR_SUCCESS);
accept_signal (link_added);
/* Try to add again */
g_assert (nm_platform_dummy_add (NM_PLATFORM_GET, DEVICE_NAME, NULL) == NM_PLATFORM_ERROR_EXISTS);
g_assert (nm_platform_link_dummy_add (NM_PLATFORM_GET, DEVICE_NAME, NULL) == NM_PLATFORM_ERROR_EXISTS);
/* Check device index, name and type */
ifindex = nm_platform_link_get_ifindex (NM_PLATFORM_GET, DEVICE_NAME);
@@ -1092,58 +1092,58 @@ test_vlan_set_xgress (void)
/* ingress-qos-map */
g_assert (nm_platform_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 4, 5));
g_assert (nm_platform_link_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 4, 5));
_assert_ingress_qos_mappings (ifindex, 1,
4, 5);
g_assert (nm_platform_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 3, 7));
g_assert (nm_platform_link_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 3, 7));
_assert_ingress_qos_mappings (ifindex, 2,
3, 7,
4, 5);
g_assert (nm_platform_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 3, 8));
g_assert (nm_platform_link_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 3, 8));
_assert_ingress_qos_mappings (ifindex, 2,
3, 8,
4, 5);
g_assert (nm_platform_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 0, 4));
g_assert (nm_platform_link_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 0, 4));
_assert_ingress_qos_mappings (ifindex, 3,
0, 4,
3, 8,
4, 5);
g_assert (nm_platform_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 0, G_MAXUINT32));
g_assert (nm_platform_link_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 0, G_MAXUINT32));
_assert_ingress_qos_mappings (ifindex, 3,
0, G_MAXUINT32,
3, 8,
4, 5);
g_assert (nm_platform_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 0, G_MAXUINT32 - 1));
g_assert (nm_platform_link_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 0, G_MAXUINT32 - 1));
_assert_ingress_qos_mappings (ifindex, 3,
0, G_MAXUINT32 - 1,
3, 8,
4, 5);
g_assert (nm_platform_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 0, 5));
g_assert (nm_platform_link_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 0, 5));
_assert_ingress_qos_mappings (ifindex, 3,
0, 5,
3, 8,
4, 5);
g_assert (nm_platform_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 0, 5));
g_assert (nm_platform_link_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 0, 5));
_assert_ingress_qos_mappings (ifindex, 3,
0, 5,
3, 8,
4, 5);
/* Set invalid values: */
g_assert (nm_platform_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 8, 3));
g_assert (nm_platform_link_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 8, 3));
_assert_ingress_qos_mappings (ifindex, 3,
0, 5,
3, 8,
4, 5);
g_assert (nm_platform_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 9, 4));
g_assert (nm_platform_link_vlan_set_ingress_map (NM_PLATFORM_GET, ifindex, 9, 4));
_assert_ingress_qos_mappings (ifindex, 3,
0, 5,
3, 8,
@@ -1151,36 +1151,36 @@ test_vlan_set_xgress (void)
/* egress-qos-map */
g_assert (nm_platform_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 7, 3));
g_assert (nm_platform_link_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 7, 3));
_assert_egress_qos_mappings (ifindex, 1,
7, 3);
g_assert (nm_platform_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 8, 4));
g_assert (nm_platform_link_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 8, 4));
_assert_egress_qos_mappings (ifindex, 2,
7, 3,
8, 4);
g_assert (nm_platform_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 0, 4));
g_assert (nm_platform_link_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 0, 4));
_assert_egress_qos_mappings (ifindex, 3,
0, 4,
7, 3,
8, 4);
g_assert (nm_platform_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 1, 4));
g_assert (nm_platform_link_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 1, 4));
_assert_egress_qos_mappings (ifindex, 4,
0, 4,
1, 4,
7, 3,
8, 4);
g_assert (nm_platform_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 1, 5));
g_assert (nm_platform_link_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 1, 5));
_assert_egress_qos_mappings (ifindex, 4,
0, 4,
1, 5,
7, 3,
8, 4);
g_assert (nm_platform_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 9, 5));
g_assert (nm_platform_link_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 9, 5));
_assert_egress_qos_mappings (ifindex, 5,
0, 4,
1, 5,
@@ -1188,7 +1188,7 @@ test_vlan_set_xgress (void)
8, 4,
9, 5);
g_assert (nm_platform_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 8, 5));
g_assert (nm_platform_link_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 8, 5));
_assert_egress_qos_mappings (ifindex, 5,
0, 4,
1, 5,
@@ -1196,27 +1196,27 @@ test_vlan_set_xgress (void)
8, 5,
9, 5);
g_assert (nm_platform_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 8, 0));
g_assert (nm_platform_link_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 8, 0));
_assert_egress_qos_mappings (ifindex, 4,
0, 4,
1, 5,
7, 3,
9, 5);
g_assert (nm_platform_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 0, 0));
g_assert (nm_platform_link_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 0, 0));
_assert_egress_qos_mappings (ifindex, 3,
1, 5,
7, 3,
9, 5);
g_assert (nm_platform_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 100, 4));
g_assert (nm_platform_link_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 100, 4));
_assert_egress_qos_mappings (ifindex, 4,
1, 5,
7, 3,
9, 5,
100, 4);
g_assert (nm_platform_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, G_MAXUINT32, 4));
g_assert (nm_platform_link_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, G_MAXUINT32, 4));
_assert_egress_qos_mappings (ifindex, 5,
1, 5,
7, 3,
@@ -1224,7 +1224,7 @@ test_vlan_set_xgress (void)
100, 4,
G_MAXUINT32, 4);
g_assert (nm_platform_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, G_MAXUINT32, 8));
g_assert (nm_platform_link_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, G_MAXUINT32, 8));
_assert_egress_qos_mappings (ifindex, 5,
1, 5,
7, 3,
@@ -1232,20 +1232,20 @@ test_vlan_set_xgress (void)
100, 4,
G_MAXUINT32, 4);
g_assert (nm_platform_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, G_MAXUINT32, 0));
g_assert (nm_platform_link_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, G_MAXUINT32, 0));
_assert_egress_qos_mappings (ifindex, 4,
1, 5,
7, 3,
9, 5,
100, 4);
g_assert (nm_platform_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 100, 0));
g_assert (nm_platform_link_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 100, 0));
_assert_egress_qos_mappings (ifindex, 3,
1, 5,
7, 3,
9, 5);
g_assert (nm_platform_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 1, 0));
g_assert (nm_platform_link_vlan_set_egress_map (NM_PLATFORM_GET, ifindex, 1, 0));
_assert_egress_qos_mappings (ifindex, 2,
7, 3,
9, 5);
@@ -1559,11 +1559,11 @@ test_nl_bugs_veth (void)
ifindex_veth0 = nmtstp_assert_wait_for_link (IFACE_VETH0, NM_LINK_TYPE_VETH, 100)->ifindex;
ifindex_veth1 = nmtstp_assert_wait_for_link (IFACE_VETH1, NM_LINK_TYPE_VETH, 100)->ifindex;
/* assert that nm_platform_veth_get_properties() returns the expected peer ifindexes. */
g_assert (nm_platform_veth_get_properties (NM_PLATFORM_GET, ifindex_veth0, &i));
/* assert that nm_platform_link_veth_get_properties() returns the expected peer ifindexes. */
g_assert (nm_platform_link_veth_get_properties (NM_PLATFORM_GET, ifindex_veth0, &i));
g_assert_cmpint (i, ==, ifindex_veth1);
g_assert (nm_platform_veth_get_properties (NM_PLATFORM_GET, ifindex_veth1, &i));
g_assert (nm_platform_link_veth_get_properties (NM_PLATFORM_GET, ifindex_veth1, &i));
g_assert_cmpint (i, ==, ifindex_veth0);
/* assert that NMPlatformLink.parent is the peer-ifindex. */

View File

@@ -295,7 +295,7 @@ setup_tests (void)
nm_platform_link_delete (NM_PLATFORM_GET, nm_platform_link_get_ifindex (NM_PLATFORM_GET, DEVICE_NAME));
g_assert (!nm_platform_link_get_by_ifname (NM_PLATFORM_GET, DEVICE_NAME));
g_assert (nm_platform_dummy_add (NM_PLATFORM_GET, DEVICE_NAME, NULL) == NM_PLATFORM_ERROR_SUCCESS);
g_assert (nm_platform_link_dummy_add (NM_PLATFORM_GET, DEVICE_NAME, NULL) == NM_PLATFORM_ERROR_SUCCESS);
accept_signal (link_added);
free_signal (link_added);