platform/tests: add nmtstp_link_get_typed()
This commit is contained in:
@@ -1081,8 +1081,9 @@ nmtstp_ip6_address_del (gboolean external_command,
|
||||
}
|
||||
|
||||
const NMPlatformLink *
|
||||
nmtstp_link_get (int ifindex,
|
||||
const char *name)
|
||||
nmtstp_link_get_typed (int ifindex,
|
||||
const char *name,
|
||||
NMLinkType link_type)
|
||||
{
|
||||
const NMPlatformLink *pllink = NULL;
|
||||
|
||||
@@ -1108,9 +1109,19 @@ nmtstp_link_get (int ifindex,
|
||||
|
||||
g_assert (!name || nm_utils_iface_valid_name (name));
|
||||
|
||||
if (pllink && link_type != NM_LINK_TYPE_NONE)
|
||||
g_assert_cmpint (pllink->type, ==, link_type);
|
||||
|
||||
return pllink;
|
||||
}
|
||||
|
||||
const NMPlatformLink *
|
||||
nmtstp_link_get (int ifindex,
|
||||
const char *name)
|
||||
{
|
||||
return nmtstp_link_get_typed (ifindex, name, NM_LINK_TYPE_NONE);
|
||||
}
|
||||
|
||||
void
|
||||
nmtstp_link_del (gboolean external_command,
|
||||
int ifindex,
|
||||
|
@@ -136,6 +136,7 @@ void nmtstp_ip6_address_del (gboolean external_command,
|
||||
struct in6_addr address,
|
||||
int plen);
|
||||
|
||||
const NMPlatformLink *nmtstp_link_get_typed (int ifindex, const char *name, NMLinkType link_type);
|
||||
const NMPlatformLink *nmtstp_link_get (int ifindex, const char *name);
|
||||
|
||||
void nmtstp_link_set_updown (gboolean external_command,
|
||||
|
Reference in New Issue
Block a user