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", \ 62 } __attribute__((packed)) bier_hdr_len_id_t;
64 #define BIER_HDR_LEN_IDS { \ 65 [BIER_HDR_LEN_INVALID] = "invalid",\ 66 [BIER_HDR_LEN_64] = "64", \ 67 [BIER_HDR_LEN_128] = "128", \ 68 [BIER_HDR_LEN_256] = "256", \ 69 [BIER_HDR_LEN_512] = "512", \ 70 [BIER_HDR_LEN_1024] = "1024", \ 71 [BIER_HDR_LEN_2048] = "2048", \ 72 [BIER_HDR_LEN_4096] = "4096", \ 75 #define FOR_EACH_BIER_HDR_LEN(_len) \ 76 for (_item = BIER_HDR_LEN_64; \ 77 _item <= BIER_HDR_LEN_4096; \ 88 static inline bier_hdr_len_id_t
113 static inline bier_hdr_len_id_t
136 static inline bier_hdr_len_id_t
185 } __attribute__((packed)) bier_hdr_proto_id_t;
187 #define BIER_HDR_N_PROTO (BIER_HDR_PROTO_OAM + 1) 189 #define BIER_HDR_PROTO_ID_NAMES { \ 190 [BIER_HDR_PROTO_INVALID] = "invalid", \ 191 [BIER_HDR_PROTO_MPLS_DOWN_STREAM] = "mpls-down-stream", \ 192 [BIER_HDR_PROTO_MPLS_UP_STREAM] = "mpls-up-stream", \ 193 [BIER_HDR_PROTO_ETHERNET] = "ethernet", \ 194 [BIER_HDR_PROTO_IPV4] = "ipv4", \ 195 [BIER_HDR_PROTO_IPV6] = "ipv6", \ 196 [BIER_HDR_PROTO_VXLAN] = "vxlan", \ 197 [BIER_HDR_PROTO_CTRL] = "control-plane", \ 198 [BIER_HDR_PROTO_OAM] = "oam", \ 201 #define FOR_EACH_BIER_HDR_PROTO(_proto) \ 202 for (_proto = BIER_HDR_PROTO_MPLS_DOWN_STREAM; \ 203 _proto <= BIER_HDR_PROTO_OAM; \ 307 #define BIER_BIT_MASK_NUM_BUCKETS 32 308 #define BIER_BIT_MASK_MAX_BUCKET (BIER_BIT_MASK_NUM_BUCKETS - 1) 313 #define BIER_BIT_MASK_BITS_PER_BUCKET 8 318 #define BIER_BIT_MASK_MIN_POS (1) 348 #define BIER_BP_TO_INDEX(bp) (bp - 1) 353 #define BIER_BP_MAX 0x10000 366 #define BIER_BP_INVALID 0 424 #define BIER_TABLE_SET_INVALID_ID 0xffffffff 431 #define BIER_TABLE_SUB_DOMAIN_INVALID_ID 0xffffffff 441 #define BIER_ECMP_TABLE_ID_MAIN 0xFFFF 502 #define BIER_ERR_NO_TABLE 1 503 #define BIER_ERR_DUPLICATE_TABLE 2 504 #define BIER_ERR_PANIC 3 516 #define BIER_BIFT_ID_INVALID (~0) 526 bier_table_sub_domain_id_t sd,
527 bier_hdr_len_id_t bsl);
529 bier_table_set_id_t *
set,
530 bier_table_sub_domain_id_t *sd,
531 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.
A BIER Bit-String value of length 128 bits.
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
struct bier_bit_mask_64_t_ bier_bit_mask_64_t
A BIER Bit-String value of length 64 bits.
u16 bbs_len
The length of the string in BYTES.
A BIER Bit-String value of length 4096 bits.
A Variable length BitString.
u16 bier_bfit_id_get_sub_domain(bier_bift_id_t bift_id)
struct bier_bit_mask_128_t_ bier_bit_mask_128_t
A BIER Bit-String value of length 128 bits.
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)
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.
A BIER Bit-String value of length 512 bits.
struct bier_bit_mask_256_t_ bier_bit_mask_256_t
A BIER Bit-String value of length 256 bits.
bier_bit_mask_bucket_t bits[BIER_HDR_BUCKETS_128]
struct bier_bit_mask_2048_t_ bier_bit_mask_2048_t
A BIER Bit-String value of length 2048 bits.
bier_hdr_ctrl_sub_code_t_
bier_hdr_ctrl_sub_code_t enumerator
bier_show_flags_t_
Flags to control show output.
A BIER Bit-String value of length 64 bits.
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'.
struct bier_bit_mask_1024_t_ bier_bit_mask_1024_t
A BIER Bit-String value of length 1024 bits.
struct bier_bit_mask_512_t_ bier_bit_mask_512_t
A BIER Bit-String value of length 512 bits.
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.
A BIER Bit-String value of length 2048 bits.
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.
enum bier_hdr_ctrl_sub_code_t_ bier_hdr_ctrl_sub_code_t
bier_hdr_ctrl_sub_code_t enumerator
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)
struct bier_bit_mask_4096_t_ bier_bit_mask_4096_t
A BIER Bit-String value of length 4096 bits.
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)
A BIER Bit-String value of length 1024 bits.
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)
bier_bit_mask_256_t bier_bit_mask_t
A BIER Bit-mask value.
u8 bier_bit_mask_bucket_t
A bucket is a byte.
A BIER Bit-String value of length 256 bits.
u16 bh_bfr_id
The BFR-ID of the sender.
bier_table_type_t_
Types of BIER tables.