mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-22 23:10:18 +01:00
platform/tests: add nmtstp_link_get_typed()
This commit is contained in:
parent
9ae0227591
commit
feab1ff655
2 changed files with 14 additions and 2 deletions
|
|
@ -1081,8 +1081,9 @@ nmtstp_ip6_address_del (gboolean external_command,
|
||||||
}
|
}
|
||||||
|
|
||||||
const NMPlatformLink *
|
const NMPlatformLink *
|
||||||
nmtstp_link_get (int ifindex,
|
nmtstp_link_get_typed (int ifindex,
|
||||||
const char *name)
|
const char *name,
|
||||||
|
NMLinkType link_type)
|
||||||
{
|
{
|
||||||
const NMPlatformLink *pllink = NULL;
|
const NMPlatformLink *pllink = NULL;
|
||||||
|
|
||||||
|
|
@ -1108,9 +1109,19 @@ nmtstp_link_get (int ifindex,
|
||||||
|
|
||||||
g_assert (!name || nm_utils_iface_valid_name (name));
|
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;
|
return pllink;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const NMPlatformLink *
|
||||||
|
nmtstp_link_get (int ifindex,
|
||||||
|
const char *name)
|
||||||
|
{
|
||||||
|
return nmtstp_link_get_typed (ifindex, name, NM_LINK_TYPE_NONE);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nmtstp_link_del (gboolean external_command,
|
nmtstp_link_del (gboolean external_command,
|
||||||
int ifindex,
|
int ifindex,
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,7 @@ void nmtstp_ip6_address_del (gboolean external_command,
|
||||||
struct in6_addr address,
|
struct in6_addr address,
|
||||||
int plen);
|
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);
|
const NMPlatformLink *nmtstp_link_get (int ifindex, const char *name);
|
||||||
|
|
||||||
void nmtstp_link_set_updown (gboolean external_command,
|
void nmtstp_link_set_updown (gboolean external_command,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue