summaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/faces/udp/face_udp.c
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2019-03-23 14:46:14 +0100
committerAlberto Compagno <acompagn+fdio@cisco.com>2019-03-23 16:05:19 +0100
commit2ba7f1f0bef4ecb20af57283d456e66e31fa667a (patch)
tree5c29f03e3259bc9def5623152ae9e3eff771f39f /hicn-plugin/src/faces/udp/face_udp.c
parenta2bdc00ea25f89185c1095a48a8f51cb2c1a20e6 (diff)
[HICN-138] Added number of received/transmitted bytes and packets on each face
Change-Id: Icfe9cd84bdc72afef3d714064e695d1abef368f5 Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Diffstat (limited to 'hicn-plugin/src/faces/udp/face_udp.c')
-rw-r--r--hicn-plugin/src/faces/udp/face_udp.c36
1 files changed, 26 insertions, 10 deletions
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;
}