From 2ba7f1f0bef4ecb20af57283d456e66e31fa667a Mon Sep 17 00:00:00 2001 From: Alberto Compagno Date: Sat, 23 Mar 2019 14:46:14 +0100 Subject: [HICN-138] Added number of received/transmitted bytes and packets on each face Change-Id: Icfe9cd84bdc72afef3d714064e695d1abef368f5 Signed-off-by: Alberto Compagno --- hicn-plugin/src/faces/udp/face_udp.c | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to 'hicn-plugin/src/faces/udp/face_udp.c') diff --git a/hicn-plugin/src/faces/udp/face_udp.c b/hicn-plugin/src/faces/udp/face_udp.c index 6f345925b..7858db644 100644 --- a/hicn-plugin/src/faces/udp/face_udp.c +++ b/hicn-plugin/src/faces/udp/face_udp.c @@ -81,15 +81,17 @@ hicn_face_udp_init (vlib_main_t * vm) /* Default Strategy has index 0 and it always exists */ strategy_face_udp4_vlib_edge = vlib_node_add_next (vm, hicn_dpo_get_strategy_vft - (default_dpo.hicn_dpo_get_type - ())->get_strategy_node_index + (default_dpo. + hicn_dpo_get_type ())-> + get_strategy_node_index (), - hicn_face_udp4_output_node.index); + hicn_face_udp4_output_node. + index); strategy_face_udp6_vlib_edge = vlib_node_add_next (vm, - hicn_dpo_get_strategy_vft - (default_dpo.hicn_dpo_get_type - ())->get_strategy_node_index (), + hicn_dpo_get_strategy_vft (default_dpo. + hicn_dpo_get_type ())-> + get_strategy_node_index (), hicn_face_udp6_output_node.index); /* @@ -265,17 +267,31 @@ hicn_face_udp_add (const ip46_address_t * local_addr, return HICN_ERROR_IPS_ADDR_TYPE_NONUNIFORM; } + for (int i = 0; i < HICN_N_COUNTER; i++) + { + vlib_validate_combined_counter (&counters[(*pfaceid) * HICN_N_COUNTER], + i); + vlib_zero_combined_counter (&counters[(*pfaceid) * HICN_N_COUNTER], i); + } + retx_t *retx = vlib_process_signal_event_data (vlib_get_main (), - hicn_mapme_eventmgr_process_node.index, + hicn_mapme_eventmgr_process_node. + index, HICN_MAPME_EVENT_FACE_ADD, 1, sizeof (retx_t)); + /* *INDENT-OFF* */ *retx = (retx_t) { - .prefix = 0,.dpo = (dpo_id_t) + .prefix = 0, + .dpo = (dpo_id_t) { - .dpoi_type = hicn_face_udp_type,.dpoi_proto = - dpo_proto,.dpoi_next_node = 0,.dpoi_index = *pfaceid,} + .dpoi_type = hicn_face_udp_type, + .dpoi_proto = dpo_proto, + .dpoi_next_node = 0, + .dpoi_index = *pfaceid, + } }; + /* *INDENT-ON* */ return ret; } -- cgit 1.2.3-korg