summaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/faces/face.h
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-03-23 15:32:22 +0000
committerGerrit Code Review <gerrit@fd.io>2019-03-23 15:32:22 +0000
commit43562f9f02d35e5d540ab4028a0326c0c7cd4898 (patch)
treea015156872de191b209ca90da4bee8224e41b3f8 /hicn-plugin/src/faces/face.h
parentdfc988a222a38da36999395e393e3b1ed1ccdfde (diff)
parent2ba7f1f0bef4ecb20af57283d456e66e31fa667a (diff)
Merge "[HICN-138] Added number of received/transmitted bytes and packets on each face"
Diffstat (limited to 'hicn-plugin/src/faces/face.h')
-rw-r--r--hicn-plugin/src/faces/face.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/hicn-plugin/src/faces/face.h b/hicn-plugin/src/faces/face.h
index 313f8ec86..d4f7f356a 100644
--- a/hicn-plugin/src/faces/face.h
+++ b/hicn-plugin/src/faces/face.h
@@ -51,6 +51,9 @@ typedef struct __attribute__ ((packed)) hicn_face_shared_s
/* And a network or application face (1B) */
hicn_face_flags_t flags;
+ /* Align the upcoming fields */
+ u8 align;
+
/* Path label (2B) */
u16 pl_id;
@@ -82,7 +85,6 @@ typedef struct __attribute__ ((packed)) hicn_face_s
/* Additional space to fill with face_type specific information */
u8 data[2 * CLIB_CACHE_LINE_BYTES - sizeof (hicn_face_shared_t)];
hicn_face_shared_t shared;
-
}
hicn_face_t;
@@ -140,6 +142,24 @@ typedef struct hicn_face_vft_s
void (*hicn_face_get_dpo) (hicn_face_t * face, dpo_id_t * dpo);
} hicn_face_vft_t;
+#define foreach_hicn_face_counter \
+ _(INTEREST_RX, 0, "Interest rx") \
+ _(INTEREST_TX, 1, "Interest tx") \
+ _(DATA_RX, 2, "Data rx") \
+ _(DATA_TX, 3, "Data tx") \
+
+typedef enum
+{
+#define _(a,b,c) HICN_FACE_COUNTERS_##a = (b),
+ foreach_hicn_face_counter
+#undef _
+ HICN_N_COUNTER
+} hicn_face_counters_t;
+
+extern const char *HICN_FACE_CTRX_STRING[];
+
+#define get_face_counter_string(ctrxno) (char *)(HICN_FACE_CTRX_STRING[ctrxno])
+
/* Vector maintaining a dpo per face */
extern dpo_id_t *face_dpo_vec;
@@ -151,6 +171,9 @@ extern char **face_type_names_vec;
/* First face type registered in the sytem.*/
extern dpo_type_t first_type;
+/* Per-face counters */
+extern vlib_combined_counter_main_t *counters;
+
/**
* @brief Return the face id from the face state
*