diff options
author | Jordan Augé <jordan.auge+fdio@cisco.com> | 2019-01-21 13:25:59 +0100 |
---|---|---|
committer | Jordan Augé <jordan.auge+fdio@cisco.com> | 2019-01-21 15:35:34 +0100 |
commit | 8a2e408a3fc20f1055a8ca796a4d32ebc9fb9aa0 (patch) | |
tree | 6924ea2da917504e9381cf54ce976e56ff66d0dd /lib/src/compat.c | |
parent | 29fb58203e5a44dbfafc6b788f50ca412c5f3c4b (diff) |
HICN-4 - Fix Windows compilation issue with named struct initializers
Change-Id: I9c9e8780ec1132d3d74b6202b9b142ed64b4e13f
Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Diffstat (limited to 'lib/src/compat.c')
-rwxr-xr-x | lib/src/compat.c | 45 |
1 files changed, 9 insertions, 36 deletions
diff --git a/lib/src/compat.c b/lib/src/compat.c index 7d9eef025..8b558a56e 100755 --- a/lib/src/compat.c +++ b/lib/src/compat.c @@ -91,52 +91,25 @@ hicn_format_to_type (hicn_format_t format) switch (format) { case HF_INET_TCP: - return (hicn_type_t) - { - .l4 = IPPROTO_NONE,.l3 = IPPROTO_NONE,.l2 = IPPROTO_TCP,.l1 = - IPPROTO_IP}; + return HICN_TYPE_IPV4_TCP; case HF_INET6_TCP: - return (hicn_type_t) - { - .l4 = IPPROTO_NONE,.l3 = IPPROTO_NONE,.l2 = IPPROTO_TCP,.l1 = - IPPROTO_IPV6}; + return HICN_TYPE_IPV6_TCP; case HF_INET_ICMP: - return (hicn_type_t) - { - .l4 = IPPROTO_NONE,.l3 = IPPROTO_NONE,.l2 = IPPROTO_ICMP,.l1 = - IPPROTO_IP}; + return HICN_TYPE_IPV4_ICMP; case HF_INET6_ICMP: - return (hicn_type_t) - { - .l4 = IPPROTO_NONE,.l3 = IPPROTO_NONE,.l2 = IPPROTO_ICMPV6,.l1 = - IPPROTO_IPV6}; + return HICN_TYPE_IPV6_ICMP; case HF_INET_TCP_AH: - return (hicn_type_t) - { - .l4 = IPPROTO_NONE,.l3 = IPPROTO_AH,.l2 = IPPROTO_TCP,.l1 = IPPROTO_IP}; + return HICN_TYPE_IPV4_TCP_AH; case HF_INET6_TCP_AH: - return (hicn_type_t) - { - .l4 = IPPROTO_NONE,.l3 = IPPROTO_AH,.l2 = IPPROTO_TCP,.l1 = - IPPROTO_IPV6}; + return HICN_TYPE_IPV6_TCP_AH; case HF_INET_ICMP_AH: - return (hicn_type_t) - { - .l4 = IPPROTO_NONE,.l3 = IPPROTO_AH,.l2 = IPPROTO_ICMP,.l1 = - IPPROTO_IP}; + return HICN_TYPE_IPV4_ICMP_AH; case HF_INET6_ICMP_AH: - return (hicn_type_t) - { - .l4 = IPPROTO_NONE,.l3 = IPPROTO_AH,.l2 = IPPROTO_ICMPV6,.l1 = - IPPROTO_IPV6}; + return HICN_TYPE_IPV6_ICMP_AH; default: break; } - return (hicn_type_t) - { - { - IPPROTO_NONE} - }; + return HICN_TYPE_NONE; } /** |