mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-01 07:58:02 +02:00
platform: add nm_platform_ip_route_get_gateway() helper
This commit is contained in:
parent
1e3f5b7c01
commit
7eb94b7dcc
1 changed files with 12 additions and 0 deletions
|
|
@ -1848,6 +1848,18 @@ gboolean nm_platform_ip_address_flush (NMPlatform *self,
|
|||
void nm_platform_ip_route_normalize (int addr_family,
|
||||
NMPlatformIPRoute *route);
|
||||
|
||||
static inline gconstpointer
|
||||
nm_platform_ip_route_get_gateway (int addr_family,
|
||||
const NMPlatformIPRoute *route)
|
||||
{
|
||||
nm_assert_addr_family (addr_family);
|
||||
nm_assert (route);
|
||||
|
||||
if (NM_IS_IPv4 (addr_family))
|
||||
return &((NMPlatformIP4Route *) route)->gateway;
|
||||
return &((NMPlatformIP6Route *) route)->gateway;
|
||||
}
|
||||
|
||||
int nm_platform_ip_route_add (NMPlatform *self,
|
||||
NMPNlmFlags flags,
|
||||
const NMPObject *route);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue