summaryrefslogtreecommitdiff
path: root/src/platform/nm-platform.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/platform/nm-platform.c')
-rw-r--r--src/platform/nm-platform.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c
index 9c0a2399cf..50a347501a 100644
--- a/src/platform/nm-platform.c
+++ b/src/platform/nm-platform.c
@@ -2570,6 +2570,22 @@ nm_platform_lnk_vlan_to_string (const NMPlatformLnkVlan *lnk, char *buf, gsize l
return buf;
}
+const char *
+nm_platform_lnk_gre_to_string (const NMPlatformLnkGre *lnk, char *buf, gsize len)
+{
+ char buf_local[NM_UTILS_INET_ADDRSTRLEN];
+ char buf_remote[NM_UTILS_INET_ADDRSTRLEN];
+
+ if (!_to_string_buffer_init (lnk, &buf, &len))
+ return buf;
+
+ g_snprintf (buf, len,
+ "gre %s %s",
+ nm_utils_inet4_ntop (lnk->local, buf_local),
+ nm_utils_inet4_ntop (lnk->remote, buf_remote));
+ return buf;
+}
+
/**
* nm_platform_ip4_address_to_string:
* @route: pointer to NMPlatformIP4Address address structure
@@ -2943,6 +2959,23 @@ nm_platform_lnk_vlan_cmp (const NMPlatformLnkVlan *a, const NMPlatformLnkVlan *b
}
int
+nm_platform_lnk_gre_cmp (const NMPlatformLnkGre *a, const NMPlatformLnkGre *b)
+{
+ _CMP_SELF (a, b);
+ _CMP_FIELD (a, b, parent_ifindex);
+ _CMP_FIELD (a, b, input_flags);
+ _CMP_FIELD (a, b, output_flags);
+ _CMP_FIELD (a, b, input_key);
+ _CMP_FIELD (a, b, output_key);
+ _CMP_FIELD (a, b, local);
+ _CMP_FIELD (a, b, remote);
+ _CMP_FIELD (a, b, ttl);
+ _CMP_FIELD (a, b, tos);
+ _CMP_FIELD_BOOL (a, b, path_mtu_discovery);
+ return 0;
+}
+
+int
nm_platform_ip4_address_cmp (const NMPlatformIP4Address *a, const NMPlatformIP4Address *b)
{
in_addr_t p_a, p_b;