summaryrefslogtreecommitdiffstats
path: root/src/vnet/bier/bier_fmask_db.h
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2018-06-07 02:08:07 -0700
committerFlorin Coras <florin.coras@gmail.com>2018-06-21 07:44:37 +0000
commit586479a73162426a02b2bbc8ab724e0dfb9921e0 (patch)
tree05701dd882dbc218ffb1bd28f20fce50bbcda61c /src/vnet/bier/bier_fmask_db.h
parent0c58ad4045c03552a6c6100e8e8441558aaea972 (diff)
BIER neighbor stats
Change-Id: I2f638f1932b4aeddf2408c06d1b8393551675b72 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vnet/bier/bier_fmask_db.h')
-rw-r--r--src/vnet/bier/bier_fmask_db.h40
1 files changed, 30 insertions, 10 deletions
diff --git a/src/vnet/bier/bier_fmask_db.h b/src/vnet/bier/bier_fmask_db.h
index a7f29c2b6a6..36e555f8680 100644
--- a/src/vnet/bier/bier_fmask_db.h
+++ b/src/vnet/bier/bier_fmask_db.h
@@ -36,23 +36,28 @@ typedef enum bier_hdr_type_t_ {
* BIER header in non-MPLS networks
*/
BIER_HDR_O_OTHER,
-} bier_hdr_type_t;
+} __attribute__((packed)) bier_hdr_type_t;
/**
- * A key/ID for a BIER forwarding Mas (FMask).
- * This is a simplified version of a fib_route_path_t.
+ * BIER next-hop type
*/
-typedef struct bier_fmask_id_t_ {
+typedef enum bier_nh_type_t_ {
/**
- * Type of BIER header this fmask supports
+ * BIER Header in MPLS networks
*/
- bier_hdr_type_t bfmi_hdr_type;
+ BIER_NH_IP,
/**
- * The BIER table this fmask is in
+ * BIER header in non-MPLS networks
*/
- index_t bfmi_bti;
+ BIER_NH_UDP,
+} __attribute__((packed)) bier_nh_type_t;
+/**
+ * A key/ID for a BIER forwarding Mas (FMask).
+ * This is a simplified version of a fib_route_path_t.
+ */
+typedef struct bier_fmask_id_t_ {
union {
/**
* next-hop of the peer
@@ -64,11 +69,20 @@ typedef struct bier_fmask_id_t_ {
*/
u32 bfmi_id;
};
+ /**
+ * The BIER table this fmask is in
+ */
+ index_t bfmi_bti;
/**
- * Software interface index
+ * Type of BIER header this fmask supports
*/
- u32 bfmi_sw_if_index;
+ bier_hdr_type_t bfmi_hdr_type;
+
+ /**
+ * Union discriminatrr
+ */
+ bier_nh_type_t bfmi_nh_type;
} __attribute__((packed)) bier_fmask_id_t;
extern index_t
@@ -79,5 +93,11 @@ extern index_t bier_fmask_db_find (index_t bti,
extern void bier_fmask_db_remove (const bier_fmask_id_t *fmid);
+/**
+ * Walk all the BIER fmasks
+ */
+typedef walk_rc_t (*bier_fmask_walk_fn_t) (index_t bfmi, void *ctx);
+
+extern void bier_fmask_db_walk(bier_fmask_walk_fn_t fn, void *ctx);
#endif