From 20a773677230374ffa2d5d140f7d46032fb7bc9d Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Fri, 18 Sep 2020 17:39:03 +0200 Subject: Revert to [HICN-638] Check if systemd is running before enabling hicn-light service Signed-off-by: Mauro Sardara Change-Id: I1810d96e001a4e6e097e1efa331b682af750925d --- lib/src/protocol/ah.c | 3 +-- lib/src/protocol/icmp.c | 1 - lib/src/protocol/ipv4.c | 30 ++++++++++++++++-------------- lib/src/protocol/ipv6.c | 30 ++++++++++++++++-------------- lib/src/protocol/tcp.c | 7 ------- 5 files changed, 33 insertions(+), 38 deletions(-) (limited to 'lib/src/protocol') diff --git a/lib/src/protocol/ah.c b/lib/src/protocol/ah.c index 6f143238a..da08d1ee8 100644 --- a/lib/src/protocol/ah.c +++ b/lib/src/protocol/ah.c @@ -32,8 +32,7 @@ DECLARE_set_interest_name (ah, UNEXPECTED); DECLARE_get_interest_name_suffix (ah, UNEXPECTED); DECLARE_set_interest_name_suffix (ah, UNEXPECTED); DECLARE_mark_packet_as_interest (ah, UNEXPECTED) -DECLARE_mark_packet_as_data (ah, UNEXPECTED); -DECLARE_test_packet_is_interest (ah, UNEXPECTED); +DECLARE_mark_packet_as_data (ah, UNEXPECTED) DECLARE_get_data_locator (ah, UNEXPECTED); DECLARE_set_data_locator (ah, UNEXPECTED); DECLARE_get_data_name (ah, UNEXPECTED); diff --git a/lib/src/protocol/icmp.c b/lib/src/protocol/icmp.c index 40a93b099..b24c0f11e 100644 --- a/lib/src/protocol/icmp.c +++ b/lib/src/protocol/icmp.c @@ -27,7 +27,6 @@ DECLARE_get_interest_name_suffix (icmp, UNEXPECTED) DECLARE_set_interest_name_suffix (icmp, UNEXPECTED) DECLARE_mark_packet_as_interest (icmp, UNEXPECTED) DECLARE_mark_packet_as_data (icmp, UNEXPECTED) -DECLARE_test_packet_is_interest (icmp, UNEXPECTED) DECLARE_get_data_locator (icmp, UNEXPECTED) DECLARE_set_data_locator (icmp, UNEXPECTED) DECLARE_get_data_name (icmp, UNEXPECTED) diff --git a/lib/src/protocol/ipv4.c b/lib/src/protocol/ipv4.c index 4bab9980b..781907231 100644 --- a/lib/src/protocol/ipv4.c +++ b/lib/src/protocol/ipv4.c @@ -78,16 +78,20 @@ int ipv4_get_interest_name (hicn_type_t type, const hicn_protocol_t * h, hicn_name_t * name) { - name->prefix.ip4.as_u32 = h->ipv4.daddr.as_u32; - return CHILD_OPS (get_interest_name_suffix, type, h, &(name->suffix)); + name->ip4.prefix_as_ip4 = h->ipv4.daddr; +#ifndef HICN_VPP_PLUGIN + name->type = HNT_CONTIGUOUS_V4; + name->len = HICN_V4_NAME_LEN; +#endif /* HICN_VPP_PLUGIN */ + return CHILD_OPS (get_interest_name_suffix, type, h, &(name->ip4.suffix)); } int ipv4_set_interest_name (hicn_type_t type, hicn_protocol_t * h, const hicn_name_t * name) { - h->ipv4.daddr.as_u32 = name->prefix.ip4.as_u32; - return CHILD_OPS (set_interest_name_suffix, type, h, &(name->suffix)); + h->ipv4.daddr = name->ip4.prefix_as_ip4; + return CHILD_OPS (set_interest_name_suffix, type, h, &(name->ip4.suffix)); } int @@ -116,12 +120,6 @@ ipv4_mark_packet_as_data (hicn_type_t type, hicn_protocol_t * h) return CHILD_OPS (mark_packet_as_data, type, h); } -int -ipv4_test_packet_is_interest (hicn_type_t type, hicn_protocol_t * h, u8 *ret) -{ - return CHILD_OPS (test_packet_is_interest, type, h, ret); -} - int ipv4_reset_interest_for_hash (hicn_type_t type, hicn_protocol_t * h) { @@ -151,16 +149,20 @@ int ipv4_get_data_name (hicn_type_t type, const hicn_protocol_t * h, hicn_name_t * name) { - name->prefix.ip4.as_u32 = h->ipv4.saddr.as_u32; - return CHILD_OPS (get_data_name_suffix, type, h, &(name->suffix)); + name->ip4.prefix_as_ip4 = h->ipv4.saddr; +#ifndef HICN_VPP_PLUGIN + name->type = HNT_CONTIGUOUS_V4; + name->len = HICN_V4_NAME_LEN; +#endif /* HICN_VPP_PLUGIN */ + return CHILD_OPS (get_data_name_suffix, type, h, &(name->ip4.suffix)); } int ipv4_set_data_name (hicn_type_t type, hicn_protocol_t * h, const hicn_name_t * name) { - h->ipv4.saddr.as_u32 = name->prefix.ip4.as_u32; - return CHILD_OPS (set_data_name_suffix, type, h, &(name->suffix)); + h->ipv4.saddr = name->ip4.prefix_as_ip4; + return CHILD_OPS (set_data_name_suffix, type, h, &(name->ip4.suffix)); } int diff --git a/lib/src/protocol/ipv6.c b/lib/src/protocol/ipv6.c index b0ba3117d..f23b01cd8 100644 --- a/lib/src/protocol/ipv6.c +++ b/lib/src/protocol/ipv6.c @@ -68,16 +68,20 @@ int ipv6_get_interest_name (hicn_type_t type, const hicn_protocol_t * h, hicn_name_t * name) { - name->prefix.ip6 = h->ipv6.daddr; - return CHILD_OPS (get_interest_name_suffix, type, h, &(name->suffix)); + name->ip6.prefix_as_ip6 = h->ipv6.daddr; +#ifndef HICN_VPP_PLUGIN + name->type = HNT_CONTIGUOUS_V6; + name->len = HICN_V6_NAME_LEN; +#endif /* HICN_VPP_PLUGIN */ + return CHILD_OPS (get_interest_name_suffix, type, h, &(name->ip6.suffix)); } int ipv6_set_interest_name (hicn_type_t type, hicn_protocol_t * h, const hicn_name_t * name) { - h->ipv6.daddr = name->prefix.ip6; - return CHILD_OPS (set_interest_name_suffix, type, h, &(name->suffix)); + h->ipv6.daddr = name->ip6.prefix_as_ip6; + return CHILD_OPS (set_interest_name_suffix, type, h, &(name->ip6.suffix)); } int @@ -106,12 +110,6 @@ ipv6_mark_packet_as_data (hicn_type_t type, hicn_protocol_t * h) return CHILD_OPS (mark_packet_as_data, type, h); } -int -ipv6_test_packet_is_interest (hicn_type_t type, hicn_protocol_t * h, u8 *ret) -{ - return CHILD_OPS (test_packet_is_interest, type, h, ret); -} - int ipv6_reset_interest_for_hash (hicn_type_t type, hicn_protocol_t * h) { @@ -141,16 +139,20 @@ int ipv6_get_data_name (hicn_type_t type, const hicn_protocol_t * h, hicn_name_t * name) { - name->prefix.ip6 = h->ipv6.saddr; - return CHILD_OPS (get_data_name_suffix, type, h, &(name->suffix)); + name->ip6.prefix_as_ip6 = h->ipv6.saddr; +#ifndef HICN_VPP_PLUGIN + name->type = HNT_CONTIGUOUS_V6; + name->len = HICN_V6_NAME_LEN; +#endif /* HICN_VPP_PLUGIN */ + return CHILD_OPS (get_data_name_suffix, type, h, &(name->ip6.suffix)); } int ipv6_set_data_name (hicn_type_t type, hicn_protocol_t * h, const hicn_name_t * name) { - h->ipv6.saddr = name->prefix.ip6; - return CHILD_OPS (set_data_name_suffix, type, h, &(name->suffix)); + h->ipv6.saddr = name->ip6.prefix_as_ip6; + return CHILD_OPS (set_data_name_suffix, type, h, &(name->ip6.suffix)); } int diff --git a/lib/src/protocol/tcp.c b/lib/src/protocol/tcp.c index ec1eb27dc..31c495ff4 100644 --- a/lib/src/protocol/tcp.c +++ b/lib/src/protocol/tcp.c @@ -96,13 +96,6 @@ tcp_mark_packet_as_data (hicn_type_t type, hicn_protocol_t * h) return HICN_LIB_ERROR_NONE; } -int -tcp_test_packet_is_interest (hicn_type_t type, hicn_protocol_t * h, u8 *ret) -{ - *ret = !(h->tcp.flags & HICN_TCP_FLAG_ECE); - return HICN_LIB_ERROR_NONE; -} - int tcp_reset_interest_for_hash (hicn_type_t type, hicn_protocol_t * h) { -- cgit 1.2.3-korg