From 3ae22de77996e7138107be9716545867210468db Mon Sep 17 00:00:00 2001 From: Alberto Compagno Date: Thu, 14 Mar 2019 10:58:58 +0100 Subject: [HICN-112] Fixed bug on dymanic udp face creation. Fixed visualization of udp faces with "hicn show" command Change-Id: I8d2898427b19abc707ac7a0c2942576f81094ef9 Signed-off-by: Alberto Compagno --- hicn-plugin/src/faces/udp/iface_udp_node.c | 35 +++++++++++++++++++----------- 1 file changed, 22 insertions(+), 13 deletions(-) (limited to 'hicn-plugin/src/faces/udp/iface_udp_node.c') diff --git a/hicn-plugin/src/faces/udp/iface_udp_node.c b/hicn-plugin/src/faces/udp/iface_udp_node.c index c71616b77..9558ebfce 100644 --- a/hicn-plugin/src/faces/udp/iface_udp_node.c +++ b/hicn-plugin/src/faces/udp/iface_udp_node.c @@ -39,11 +39,13 @@ hicn_iface_udp_init (vlib_main_t * vm) { data_fwd_face_udp4_vlib_edge = vlib_node_add_next (vm, hicn_data_fwd_node.index, - hicn_iface_udp4_output_node.index); + hicn_iface_udp4_output_node. + index); data_fwd_face_udp6_vlib_edge = vlib_node_add_next (vm, hicn_data_fwd_node.index, - hicn_iface_udp6_output_node.index); + hicn_iface_udp6_output_node. + index); u32 temp_index4 = vlib_node_add_next (vm, hicn_interest_hitcs_node.index, @@ -185,7 +187,8 @@ typedef enum udp_hdr->src_port, \ GET_FACE_UDP##ipv \ (), \ - &hicnb0->flags); \ + &hicnb0->flags, \ + vnet_buffer(b0)->sw_if_index[VLIB_RX]); \ \ vlib_buffer_advance(b0, sizeof(IP_HEADER_##ipv) + \ sizeof(udp_header_t)); \ @@ -275,7 +278,8 @@ typedef enum udp_hdr0->src_port, \ GET_FACE_UDP##ipv \ (), \ - &hicnb0->flags); \ + &hicnb0->flags, \ + vnet_buffer(b0)->sw_if_index[VLIB_RX]); \ \ \ HICN_IFACE_UDP_ADD_LOCK_IP##ipv \ @@ -286,7 +290,8 @@ typedef enum udp_hdr1->src_port, \ GET_FACE_UDP##ipv \ (), \ - &hicnb1->flags); \ + &hicnb1->flags, \ + vnet_buffer(b1)->sw_if_index[VLIB_RX]); \ \ vlib_buffer_advance(b0, sizeof(IP_HEADER_##ipv) + \ sizeof(udp_header_t)); \ @@ -379,8 +384,9 @@ hicn_iface_udp4_input_format_trace (u8 * s, va_list * args) s = format (s, "IFACE_UDP4_INPUT: pkt: %d, sw_if_index %d, next index %d\n%U", (int) t->pkt_type, t->sw_if_index, t->next_index, - (t->packet_data[0] & 0xf0) == 0x40 ? format_ip4_header : format_ip6_header, - t->packet_data, sizeof (t->packet_data)); + (t->packet_data[0] & 0xf0) == + 0x40 ? format_ip4_header : format_ip6_header, t->packet_data, + sizeof (t->packet_data)); return (s); } @@ -460,8 +466,9 @@ hicn_iface_udp6_input_format_trace (u8 * s, va_list * args) s = format (s, "IFACE_UDP6_INPUT: pkt: %d, sw_if_index %d, next index %d\n%U", (int) t->pkt_type, t->sw_if_index, t->next_index, - (t->packet_data[0] & 0xf0) == 0x40 ? format_ip4_header : format_ip6_header, - t->packet_data, sizeof (t->packet_data)); + (t->packet_data[0] & 0xf0) == + 0x40 ? format_ip4_header : format_ip6_header, t->packet_data, + sizeof (t->packet_data)); return (s); } @@ -819,8 +826,9 @@ hicn_iface_udp4_output_format_trace (u8 * s, va_list * args) format (s, "IFACE_UDP4_OUTPUT: pkt: %d, out face %d, next index %d\n%U", (int) t->pkt_type, t->sw_if_index, t->next_index, - (t->packet_data[0] & 0xf0) == 0x40 ? format_ip4_header : format_ip6_header, - t->packet_data, sizeof (t->packet_data)); + (t->packet_data[0] & 0xf0) == + 0x40 ? format_ip4_header : format_ip6_header, t->packet_data, + sizeof (t->packet_data)); return (s); } @@ -899,8 +907,9 @@ hicn_iface_udp6_output_format_trace (u8 * s, va_list * args) format (s, "IFACE_UDP6_OUTPUT: pkt: %d, out face %d, next index %d\n%U", (int) t->pkt_type, t->sw_if_index, t->next_index, - (t->packet_data[0] & 0xf0) == 0x40 ? format_ip4_header : format_ip6_header, - t->packet_data, sizeof (t->packet_data)); + (t->packet_data[0] & 0xf0) == + 0x40 ? format_ip4_header : format_ip6_header, t->packet_data, + sizeof (t->packet_data)); return (s); } -- cgit 1.2.3-korg