diff options
author | 2020-09-18 17:39:03 +0200 | |
---|---|---|
committer | 2020-09-18 17:41:14 +0200 | |
commit | 20a773677230374ffa2d5d140f7d46032fb7bc9d (patch) | |
tree | 972ba743c7b1cfbbabd38024215af670d4dc2e3c /lib/src/protocol/ipv4.c | |
parent | 22738e6177e9e1348e5a9c23c5a71e1d1ef7246f (diff) |
Revert to [HICN-638] Check if systemd is running before enabling hicn-light service
Signed-off-by: Mauro Sardara <msardara@cisco.com>
Change-Id: I1810d96e001a4e6e097e1efa331b682af750925d
Diffstat (limited to 'lib/src/protocol/ipv4.c')
-rw-r--r-- | lib/src/protocol/ipv4.c | 30 |
1 files changed, 16 insertions, 14 deletions
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 @@ -117,12 +121,6 @@ ipv4_mark_packet_as_data (hicn_type_t type, hicn_protocol_t * 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) { /* Sets everything to 0 up to IP destination address */ @@ -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 |