* 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
*/
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 discriminator
+ */
+ bier_nh_type_t bfmi_nh_type;
} __attribute__((packed)) bier_fmask_id_t;
extern index_t
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