diff options
author | Thomas Haller <thaller@redhat.com> | 2015-10-12 13:44:44 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-10-14 20:28:39 +0200 |
commit | 67a0cb8e22cb9c9dcfc03f5fa8a100f7b6e326a9 (patch) | |
tree | e6abb0d6e61e92325195f878725f7699d949974a /src/platform/nm-platform.c | |
parent | 5e2b3888d4fabbda34305b22a79afda64ffb640b (diff) | |
download | NetworkManager-th/platform-parse-nl.tar.gz |
platform: implement gre properties as lnk datath/platform-parse-nl
Diffstat (limited to 'src/platform/nm-platform.c')
-rw-r--r-- | src/platform/nm-platform.c | 33 |
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; |