|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
19 #ifndef __BIER_HDR_INLINES_H__
20 #define __BIER_HDR_INLINES_H__
32 #define BIER_RX_ITF (~0 - 1)
38 #define BIER_HDR_1ST_NIBBLE_MASK 0xf0000000
39 #define BIER_HDR_VERSION_FIELD_MASK 0x0f000000
40 #define BIER_HDR_LEN_FIELD_MASK 0x00f00000
41 #define BIER_HDR_ENTROPY_FIELD_MASK 0x000fffff
43 #define BIER_HDR_1ST_NIBBLE_SHIFT 28
44 #define BIER_HDR_VERSION_FIELD_SHIFT 24
45 #define BIER_HDR_LEN_FIELD_SHIFT 20
46 #define BIER_HDR_ENTROPY_FIELD_SHIFT 0
48 #define BIER_HDR_1ST_NIBBLE_VALUE 0x5
53 #define BIER_HDR_PROTO_FIELD_MASK 0x003f
54 #define BIER_HDR_OAM_FIELD_MASK 0xc000
55 #define BIER_HDR_DSCP_FIELD_MASK 0x0fc0
56 #define BIER_HDR_DSCP_FIELD_SHIFT 6
57 #define BIER_HDR_PROTO_FIELD_SHIFT 0
58 #define BIER_HDR_OAM_FIELD_SHIFT 14
124 #define BIER_HDR_FIRST_WORD(version, len, entropy) \
125 ((BIER_HDR_1ST_NIBBLE_VALUE << \
126 BIER_HDR_1ST_NIBBLE_SHIFT) | \
127 (version << BIER_HDR_VERSION_FIELD_SHIFT) | \
128 (len << BIER_HDR_LEN_FIELD_SHIFT) | \
129 ((entropy & BIER_HDR_ENTROPY_FIELD_MASK) \
130 << BIER_HDR_ENTROPY_FIELD_SHIFT))
static void bier_hdr_hton(bier_hdr_t *bier_hdr)
u16 bh_oam_dscp_proto
The second word comprises: 2 bits of OAM for passive perf measurement 2 reserved bits; 6 bits of DSCP...
u16 bier_hdr_src_id_t
An identifier of the sender of BIER packets this is the source of the 'tree' - the BFIR.
static void bier_hdr_set_src_id(bier_hdr_t *bier_hdr, bier_hdr_src_id_t src_id)
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.
static bier_hdr_proto_id_t bier_hdr_get_proto_id(const bier_hdr_t *bier_hdr)
#define BIER_HDR_LEN_FIELD_SHIFT
static bier_hdr_version_t bier_hdr_get_version(const bier_hdr_t *bier_hdr)
u32 bier_bp_t
A bit positon as assigned to egress PEs.
#define BIER_HDR_1ST_NIBBLE_MASK
Mask and shift values for the fields incorporated into the header's first word.
static u8 bier_hdr_get_1st_nibble(bier_hdr_t *hdr)
static void bier_hdr_ntoh(bier_hdr_t *bier_hdr)
static size_t bier_hdr_str_num_bytes(const bier_hdr_t *bier_hdr)
u16 bbs_len
The length of the string in BYTES.
#define BIER_HDR_PROTO_FIELD_SHIFT
static void bier_hdr_set_proto_id(bier_hdr_t *bier_hdr, bier_hdr_proto_id_t proto)
#define BIER_HDR_PROTO_FIELD_MASK
Mask and shift values for fields in the headers training word.
#define BIER_HDR_1ST_NIBBLE_SHIFT
static void bier_hdr_set_len_id(bier_hdr_t *hdr, bier_hdr_len_id_t len)
static size_t bier_hdr_num_bytes(const bier_hdr_t *bier_hdr)
static bier_hdr_len_id_t bier_hdr_get_len_id(const bier_hdr_t *bier_hdr)
static void bier_bit_string_init_from_hdr(bier_hdr_t *bier_hdr, bier_bit_string_t *bit_string)
enum bier_hdr_proto_id_t_ bier_hdr_proto_id_t
BIER header protocol payload types.
enum bier_hdr_len_id_t_ bier_hdr_len_id_t
bier_hdr_len_id_t enumerator
static void bier_hdr_clear(bier_hdr_t *bier_hdr)
static void bier_hdr_init(bier_hdr_t *bier_hdr, bier_hdr_version_t version, bier_hdr_proto_id_t proto, bier_hdr_len_id_t len, bier_hdr_entropy_t entropy, bier_bp_t src)
#define BIER_HDR_VERSION_FIELD_MASK
enum bier_hdr_version_t_ bier_hdr_version_t
BIER header versions.
u32 bier_hdr_entropy_t
An entropy value in a BIER header.
static void bier_hdr_set_entropy(bier_hdr_t *hdr, bier_hdr_entropy_t entropy)
bier_bit_mask_bucket_t * bbs_buckets
The buckets in the string.
#define BIER_HDR_ENTROPY_FIELD_MASK
#define BIER_HDR_VERSION_FIELD_SHIFT
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
#define BIER_HDR_LEN_FIELD_MASK
A BIER header of variable length The encoding follows: https://tools.ietf.org/html/draft-ietf-bier-mp...
bier_bit_mask_bucket_t bh_bit_string[0]
The variable length bit-string.
u32 bh_first_word
The first nibble is always set to 0101 to ensure that when carried over MPLS, the BIER packet is not ...
static void bier_hdr_set_version(bier_hdr_t *hdr, bier_hdr_version_t version)
u32 bier_hdr_len_id_to_num_bytes(bier_hdr_len_id_t id)
u16 bh_bfr_id
The BFR-ID of the sender.
A Variable length BitString.
#define BIER_HDR_1ST_NIBBLE_VALUE
static bier_hdr_entropy_t bier_hdr_get_entropy(const bier_hdr_t *bier_hdr)
static void bier_hdr_1st_nibble(bier_hdr_t *hdr)
#define BIER_HDR_ENTROPY_FIELD_SHIFT
static bier_hdr_src_id_t bier_hdr_get_src_id(const bier_hdr_t *bier_hdr)