mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 16:20:14 +01:00
platform: add nm_platform_ip_address_get_peer_address() helper
This commit is contained in:
parent
97c1bed37e
commit
137d02a7e6
1 changed files with 12 additions and 0 deletions
|
|
@ -1919,6 +1919,18 @@ gboolean nm_platform_ip_address_flush (NMPlatform *self,
|
|||
int addr_family,
|
||||
int ifindex);
|
||||
|
||||
static inline gconstpointer
|
||||
nm_platform_ip_address_get_peer_address (int addr_family,
|
||||
const NMPlatformIPAddress *addr)
|
||||
{
|
||||
nm_assert_addr_family (addr_family);
|
||||
nm_assert (addr);
|
||||
|
||||
if (NM_IS_IPv4 (addr_family))
|
||||
return &((NMPlatformIP4Address *) addr)->peer_address;
|
||||
return &((NMPlatformIP6Address *) addr)->peer_address;
|
||||
}
|
||||
|
||||
void nm_platform_ip_route_normalize (int addr_family,
|
||||
NMPlatformIPRoute *route);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue