From 1fc9a18f95fd2ff491679e4c8de519afe49d8c47 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Mon, 20 Apr 2020 12:55:28 +0200 Subject: [HICN-598] [HICN-599] Fix hicn_name_t definition conflicts. Change-Id: Ica8db44e27c3a4911ea869e91f96b781809373d8 Signed-off-by: Mauro Sardara --- lib/src/protocol/ipv4.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'lib/src/protocol/ipv4.c') diff --git a/lib/src/protocol/ipv4.c b/lib/src/protocol/ipv4.c index 781907231..5ad4ddbfa 100644 --- a/lib/src/protocol/ipv4.c +++ b/lib/src/protocol/ipv4.c @@ -78,20 +78,16 @@ int ipv4_get_interest_name (hicn_type_t type, const hicn_protocol_t * h, hicn_name_t * name) { - 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)); + name->prefix.ip4.as_u32 = h->ipv4.daddr.as_u32; + return CHILD_OPS (get_interest_name_suffix, type, h, &(name->suffix)); } int ipv4_set_interest_name (hicn_type_t type, hicn_protocol_t * h, const hicn_name_t * name) { - h->ipv4.daddr = name->ip4.prefix_as_ip4; - return CHILD_OPS (set_interest_name_suffix, type, h, &(name->ip4.suffix)); + h->ipv4.daddr.as_u32 = name->prefix.ip4.as_u32; + return CHILD_OPS (set_interest_name_suffix, type, h, &(name->suffix)); } int @@ -149,20 +145,16 @@ int ipv4_get_data_name (hicn_type_t type, const hicn_protocol_t * h, hicn_name_t * name) { - 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)); + name->prefix.ip4.as_u32 = h->ipv4.saddr.as_u32; + return CHILD_OPS (get_data_name_suffix, type, h, &(name->suffix)); } int ipv4_set_data_name (hicn_type_t type, hicn_protocol_t * h, const hicn_name_t * name) { - h->ipv4.saddr = name->ip4.prefix_as_ip4; - return CHILD_OPS (set_data_name_suffix, type, h, &(name->ip4.suffix)); + h->ipv4.saddr.as_u32 = name->prefix.ip4.as_u32; + return CHILD_OPS (set_data_name_suffix, type, h, &(name->suffix)); } int -- cgit 1.2.3-korg