16 #ifndef __BIER_TYPES_H__ 17 #define __BIER_TYPES_H__ 43 } __attribute__((packed)) bier_table_type_t;
45 #define BIER_TABLE_TYPES { \ 46 [BIER_TABLE_MPLS_SPF] = "mpls-spf", \ 47 [BIER_TABLE_MPLS_TE] = "mpls-te", \ 67 } __attribute__((packed)) bier_hdr_len_id_t;
69 #define BIER_HDR_LEN_IDS { \ 70 [BIER_HDR_LEN_INVALID] = "invalid",\ 71 [BIER_HDR_LEN_64] = "64", \ 72 [BIER_HDR_LEN_128] = "128", \ 73 [BIER_HDR_LEN_256] = "256", \ 74 [BIER_HDR_LEN_512] = "512", \ 75 [BIER_HDR_LEN_1024] = "1024", \ 76 [BIER_HDR_LEN_2048] = "2048", \ 77 [BIER_HDR_LEN_4096] = "4096", \ 80 #define FOR_EACH_BIER_HDR_LEN(_len) \ 81 for (_item = BIER_HDR_LEN_64; \ 82 _item <= BIER_HDR_LEN_4096; \ 93 static inline bier_hdr_len_id_t
118 static inline bier_hdr_len_id_t
141 static inline bier_hdr_len_id_t
190 } __attribute__((packed)) bier_hdr_proto_id_t;
192 #define BIER_HDR_N_PROTO (BIER_HDR_PROTO_OAM + 1) 194 #define BIER_HDR_PROTO_ID_NAMES { \ 195 [BIER_HDR_PROTO_INVALID] = "invalid", \ 196 [BIER_HDR_PROTO_MPLS_DOWN_STREAM] = "mpls-down-stream", \ 197 [BIER_HDR_PROTO_MPLS_UP_STREAM] = "mpls-up-stream", \ 198 [BIER_HDR_PROTO_ETHERNET] = "ethernet", \ 199 [BIER_HDR_PROTO_IPV4] = "ipv4", \ 200 [BIER_HDR_PROTO_IPV6] = "ipv6", \ 201 [BIER_HDR_PROTO_VXLAN] = "vxlan", \ 202 [BIER_HDR_PROTO_CTRL] = "control-plane", \ 203 [BIER_HDR_PROTO_OAM] = "oam", \ 206 #define FOR_EACH_BIER_HDR_PROTO(_proto) \ 207 for (_proto = BIER_HDR_PROTO_MPLS_DOWN_STREAM; \ 208 _proto <= BIER_HDR_PROTO_OAM; \ 252 } __attribute__((packed)) bier_hdr_ctrl_sub_code_t;
257 typedef
u8 bier_bit_mask_bucket_t;
262 #define BIER_BIT_MASK_NUM_BUCKETS 32 263 #define BIER_BIT_MASK_MAX_BUCKET (BIER_BIT_MASK_NUM_BUCKETS - 1) 268 #define BIER_BIT_MASK_BITS_PER_BUCKET 8 273 #define BIER_BIT_MASK_MIN_POS (1) 296 #define BIER_BP_TO_INDEX(bp) (bp - 1) 301 #define BIER_BP_MAX 0x10000 314 #define BIER_BP_INVALID 0 359 bier_bit_mask_bucket_t bh_bit_string[0];
372 #define BIER_TABLE_SET_INVALID_ID 0xffffffff 379 #define BIER_TABLE_SUB_DOMAIN_INVALID_ID 0xffffffff 389 #define BIER_ECMP_TABLE_ID_MAIN 0xFFFF 450 #define BIER_ERR_NO_TABLE 1 451 #define BIER_ERR_DUPLICATE_TABLE 2 452 #define BIER_ERR_PANIC 3 464 #define BIER_BIFT_ID_INVALID (~0) 474 bier_table_sub_domain_id_t sd,
475 bier_hdr_len_id_t bsl);
477 bier_table_set_id_t *
set,
478 bier_table_sub_domain_id_t *sd,
479 bier_hdr_len_id_t *bsl);
u32 bier_table_set_id_t
The BIER Set ID assigned to a BIER table.
enum bier_hdr_oam_sub_code_t_ bier_hdr_oam_sub_code_t
bier_hdr_oam_sub_code_t enumerator
u32 bh_first_word
The first nibble is always set to 0101 to ensure that when carried over MPLS, the BIER packet is not ...
u32 bier_hdr_len_id_to_max_bit(bier_hdr_len_id_t id)
struct bier_bit_string_t_ bier_bit_string_t
A Variable length BitString.
enum bier_show_flags_t_ bier_show_flags_t
Flags to control show output.
bier_hdr_proto_id_t_
BIER header protocol payload types.
u8 * format_bier_table_id(u8 *s, va_list *ap)
Format a BIER table ID.
u32 bier_table_ecmp_id_t
An ID or instance number of a BIER sub-table.
dpo_proto_t bier_hdr_proto_to_dpo(bier_hdr_proto_id_t bproto)
Convert from BIER next-hop proto to DPO proto.
enum bier_hdr_code_t_ bier_hdr_code_t
bier_hdr_code_t enumerator
u16 bbs_len
The length of the string in BYTES.
A Variable length BitString.
u16 bier_bfit_id_get_sub_domain(bier_bift_id_t bift_id)
bier_hdr_len_id_t_
bier_hdr_len_id_t enumerator
bier_table_ecmp_id_t bti_ecmp
The SUB/ECMP-ID Constructed by FIB to achieve ECMP between BFR-NBRs.
bier_table_set_id_t bti_set
The SET-ID The control plane divdies the bit-position space into sets in the case the max bit-positio...
enum bier_hdr_len_num_buckets_t_ bier_hdr_len_num_buckets_t
bier_hdr_len_num_buckets_t enumerator
static bier_hdr_len_id_t bier_prefix_len_to_hdr_id(u16 prfx_len)
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
bier_hdr_oam_sub_code_t_
bier_hdr_oam_sub_code_t enumerator
u32 bier_bp_t
A bit positon as assigned to egress PEs.
u16 bh_oam_dscp_proto
The second word comprises: 2 bits of OAM for passive perf measurement 2 reserved bits; 6 bits of DSCP...
bier_hdr_len_num_buckets_t_
bier_hdr_len_num_buckets_t enumerator
u16 bier_bfit_id_get_set(bier_bift_id_t bift_id)
Bit-string lengths greater than 1024 are not supported due to the limited about pf space available in...
bier_hdr_len_id_t bti_hdr_len
The size of the bit string processed by this table.
struct bier_table_id_t_ bier_table_id_t
The ID of a table.
u16 bier_hdr_src_id_t
An identifier of the sender of BIER packets this is the source of the 'tree' - the BFIR...
u8 * format_bier_hdr_len_id(u8 *s, va_list *ap)
Format the header length field.
u8 * format_bier_hdr_proto(u8 *s, va_list *ap)
Format the header length field.
u32 bier_hdr_len_id_to_num_buckets(bier_hdr_len_id_t id)
Conversion functions for the enumerated bit-string length values, to bit and bytes.
u32 bier_hdr_entropy_t
An entropy value in a BIER header.
bier_hdr_ctrl_sub_code_t_
bier_hdr_ctrl_sub_code_t enumerator
bier_show_flags_t_
Flags to control show output.
int bier_table_id_cmp(const bier_table_id_t *btid1, const bier_table_id_t *btid2)
Compare to BIER table IDs for equality.
u32 bier_bift_id_t
The BIER universal 'label'.
bier_bift_id_t bier_bift_id_encode(bier_table_set_id_t set, bier_table_sub_domain_id_t sd, bier_hdr_len_id_t bsl)
Encode a BIFT-ID as per draft-wijnandsxu-bier-non-mpls-bift-encoding-00.txt.
struct bier_hdr_t_ bier_hdr_t
A BIER header of variable length The encoding follows: https://tools.ietf.org/html/draft-ietf-bier-mp...
enum bier_hdr_version_t_ bier_hdr_version_t
BIER header versions.
u32 bier_hdr_len_id_to_num_bytes(bier_hdr_len_id_t id)
void bier_bift_id_decode(bier_bift_id_t id, bier_table_set_id_t *set, bier_table_sub_domain_id_t *sd, bier_hdr_len_id_t *bsl)
bier_bit_mask_bucket_t * bbs_buckets
The buckets in the string.
bier_hdr_code_t_
bier_hdr_code_t enumerator
bier_hdr_version_t_
BIER header versions.
u32 bier_table_sub_domain_id_t
The BIER Sub-domain ID assigned to a BIER table.
u32 bier_hdr_len_id_to_max_bucket(bier_hdr_len_id_t id)
A BIER header of variable length The encoding follows: https://tools.ietf.org/html/draft-ietf-bier-mp...
u32 bier_hdr_len_id_to_prefix_len(bier_hdr_len_id_t id)
bier_table_type_t bti_type
The type of the table; SPF or TE, MPLS or IPv6.
bier_hdr_proto_id_t bier_bift_id_get_bit_string_length(bier_bift_id_t bift_id)
bier_table_sub_domain_id_t bti_sub_domain
The Sub-Domain-ID The control plane has the configuration option to specify multiple domains or topol...
u8 * format_bier_hdr(u8 *s, va_list *ap)
Format a BIER header.
static bier_hdr_len_id_t bier_hdr_byte_len_to_id(u32 bytes)
u8 * format_bier_bift_id(u8 *s, va_list *ap)
static bier_hdr_len_id_t bier_hdr_bit_len_to_id(u32 bytes)
u32 bier_hdr_len_id_to_num_bits(bier_hdr_len_id_t id)
u16 bh_bfr_id
The BFR-ID of the sender.
bier_table_type_t_
Types of BIER tables.