FD.io VPP  v18.01-8-g0eacf49
Vector Packet Processing
bier_types.h File Reference
+ Include dependency graph for bier_types.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  bier_bit_mask_64_t_
 A BIER Bit-String value of length 64 bits. More...
 
struct  bier_bit_mask_128_t_
 A BIER Bit-String value of length 128 bits. More...
 
struct  bier_bit_mask_256_t_
 A BIER Bit-String value of length 256 bits. More...
 
struct  bier_bit_mask_512_t_
 A BIER Bit-String value of length 512 bits. More...
 
struct  bier_bit_mask_1024_t_
 A BIER Bit-String value of length 1024 bits. More...
 
struct  bier_bit_mask_2048_t_
 A BIER Bit-String value of length 2048 bits. More...
 
struct  bier_bit_mask_4096_t_
 A BIER Bit-String value of length 4096 bits. More...
 
struct  bier_bit_string_t_
 A Variable length BitString. More...
 
struct  bier_hdr_t_
 A BIER header of variable length The encoding follows: https://tools.ietf.org/html/draft-ietf-bier-mpls-encapsulation-10. More...
 
struct  bier_table_id_t_
 The ID of a table. More...
 

Macros

#define BIER_TABLE_TYPES
 
#define BIER_HDR_LEN_IDS
 
#define FOR_EACH_BIER_HDR_LEN(_len)
 
#define BIER_HDR_N_PROTO   (BIER_HDR_PROTO_OAM + 1)
 
#define BIER_HDR_PROTO_ID_NAMES
 
#define FOR_EACH_BIER_HDR_PROTO(_proto)
 
#define BIER_BIT_MASK_NUM_BUCKETS   32
 256 bits = 32 bytes More...
 
#define BIER_BIT_MASK_MAX_BUCKET   (BIER_BIT_MASK_NUM_BUCKETS - 1)
 
#define BIER_BIT_MASK_BITS_PER_BUCKET   8
 number of bits in a bucket More...
 
#define BIER_BIT_MASK_MIN_POS   (1)
 Supported bit-posiotn range. More...
 
#define BIER_BP_TO_INDEX(bp)   (bp - 1)
 
#define BIER_BP_MAX   0x10000
 The maximum BP that can be assigned. More...
 
#define BIER_BP_INVALID   0
 
#define BIER_TABLE_SET_INVALID_ID   0xffffffff
 
#define BIER_TABLE_SUB_DOMAIN_INVALID_ID   0xffffffff
 
#define BIER_ECMP_TABLE_ID_MAIN   0xFFFF
 Definition of the ID of the BIER main table. More...
 
#define BIER_OK   0
 
#define BIER_ERR_NO_TABLE   1
 
#define BIER_ERR_DUPLICATE_TABLE   2
 
#define BIER_ERR_PANIC   3
 
#define BIER_BIFT_ID_INVALID   (~0)
 An invalid value for the BIFT ID all ones implies a BSL that's invalid. More...
 

Typedefs

typedef enum bier_show_flags_t_ bier_show_flags_t
 Flags to control show output. More...
 
typedef enum bier_table_type_t_ bier_table_type_t
 Types of BIER tables. More...
 
typedef enum bier_hdr_len_id_t_ bier_hdr_len_id_t
 bier_hdr_len_id_t enumerator More...
 
typedef enum bier_hdr_len_num_buckets_t_ bier_hdr_len_num_buckets_t
 bier_hdr_len_num_buckets_t enumerator More...
 
typedef enum bier_hdr_proto_id_t_ bier_hdr_proto_id_t
 BIER header protocol payload types. More...
 
typedef enum bier_hdr_version_t_ bier_hdr_version_t
 BIER header versions. More...
 
typedef enum bier_hdr_code_t_ bier_hdr_code_t
 bier_hdr_code_t enumerator More...
 
typedef enum bier_hdr_oam_sub_code_t_ bier_hdr_oam_sub_code_t
 bier_hdr_oam_sub_code_t enumerator More...
 
typedef enum bier_hdr_ctrl_sub_code_t_ bier_hdr_ctrl_sub_code_t
 bier_hdr_ctrl_sub_code_t enumerator More...
 
typedef u8 bier_bit_mask_bucket_t
 A bucket is a byte. More...
 
typedef struct bier_bit_mask_64_t_ bier_bit_mask_64_t
 A BIER Bit-String value of length 64 bits. More...
 
typedef struct bier_bit_mask_128_t_ bier_bit_mask_128_t
 A BIER Bit-String value of length 128 bits. More...
 
typedef struct bier_bit_mask_256_t_ bier_bit_mask_256_t
 A BIER Bit-String value of length 256 bits. More...
 
typedef struct bier_bit_mask_512_t_ bier_bit_mask_512_t
 A BIER Bit-String value of length 512 bits. More...
 
typedef struct bier_bit_mask_1024_t_ bier_bit_mask_1024_t
 A BIER Bit-String value of length 1024 bits. More...
 
typedef struct bier_bit_mask_2048_t_ bier_bit_mask_2048_t
 A BIER Bit-String value of length 2048 bits. More...
 
typedef struct bier_bit_mask_4096_t_ bier_bit_mask_4096_t
 A BIER Bit-String value of length 4096 bits. More...
 
typedef struct bier_bit_string_t_ bier_bit_string_t
 A Variable length BitString. More...
 
typedef bier_bit_mask_256_t bier_bit_mask_t
 A BIER Bit-mask value. More...
 
typedef u32 bier_bp_t
 A bit positon as assigned to egress PEs. More...
 
typedef u16 bier_hdr_src_id_t
 An identifier of the sender of BIER packets this is the source of the 'tree' - the BFIR. More...
 
typedef u32 bier_hdr_entropy_t
 An entropy value in a BIER header. More...
 
typedef struct bier_hdr_t_ bier_hdr_t
 A BIER header of variable length The encoding follows: https://tools.ietf.org/html/draft-ietf-bier-mpls-encapsulation-10. More...
 
typedef u32 bier_table_set_id_t
 The BIER Set ID assigned to a BIER table. More...
 
typedef u32 bier_table_sub_domain_id_t
 The BIER Sub-domain ID assigned to a BIER table. More...
 
typedef u32 bier_table_ecmp_id_t
 An ID or instance number of a BIER sub-table. More...
 
typedef struct bier_table_id_t_ bier_table_id_t
 The ID of a table. More...
 
typedef int bier_rc
 
typedef u32 bier_bift_id_t
 The BIER universal 'label'. More...
 

Enumerations

enum  bier_show_flags_t_ { BIER_SHOW_BRIEF, BIER_SHOW_DETAIL = (1 << 0) }
 Flags to control show output. More...
 
enum  bier_table_type_t_ { BIER_TABLE_MPLS_SPF, BIER_TABLE_MPLS_TE }
 Types of BIER tables. More...
 
enum  bier_hdr_len_id_t_ {
  BIER_HDR_LEN_64 = 0, BIER_HDR_LEN_128, BIER_HDR_LEN_256, BIER_HDR_LEN_512,
  BIER_HDR_LEN_1024, BIER_HDR_LEN_2048, BIER_HDR_LEN_4096, BIER_HDR_LEN_INVALID
}
 bier_hdr_len_id_t enumerator More...
 
enum  bier_hdr_len_num_buckets_t_ {
  BIER_HDR_BUCKETS_64 = 8, BIER_HDR_BUCKETS_128 = 16, BIER_HDR_BUCKETS_256 = 32, BIER_HDR_BUCKETS_512 = 64,
  BIER_HDR_BUCKETS_1024 = 128, BIER_HDR_BUCKETS_2048 = 256, BIER_HDR_BUCKETS_4096 = 512
}
 bier_hdr_len_num_buckets_t enumerator More...
 
enum  bier_hdr_proto_id_t_ {
  BIER_HDR_PROTO_INVALID = 0, BIER_HDR_PROTO_MPLS_DOWN_STREAM, BIER_HDR_PROTO_MPLS_UP_STREAM, BIER_HDR_PROTO_ETHERNET,
  BIER_HDR_PROTO_IPV4, BIER_HDR_PROTO_IPV6, BIER_HDR_PROTO_VXLAN, BIER_HDR_PROTO_CTRL,
  BIER_HDR_PROTO_OAM
}
 BIER header protocol payload types. More...
 
enum  bier_hdr_version_t_ { BIER_HDR_VERSION_1 = 0 }
 BIER header versions. More...
 
enum  bier_hdr_code_t_ { BIER_HDR_CODE_OAM_IPV4 = 0, BIER_HDR_CODE_OAM_IPV6 = 1, BIER_HDR_CODE_CTRL_IPV4 = 2, BIER_HDR_CODE_CTRL_IPV6 = 3 }
 bier_hdr_code_t enumerator More...
 
enum  bier_hdr_oam_sub_code_t_ { BIER_HDR_SUB_CODE_OAM_PING_REQ = 0, BIER_HDR_SUB_CODE_OAM_PING_RESP = 1 }
 bier_hdr_oam_sub_code_t enumerator More...
 
enum  bier_hdr_ctrl_sub_code_t_ { BIER_HDR_SUB_CODE_CTRL_MEMBER_REQ = 0, BIER_HDR_SUB_CODE_CTRL_ATTACHED_NET = 1 }
 bier_hdr_ctrl_sub_code_t enumerator More...
 

Functions

u8format_bier_hdr_len_id (u8 *s, va_list *ap)
 Format the header length field. More...
 
static bier_hdr_len_id_t bier_prefix_len_to_hdr_id (u16 prfx_len)
 
static bier_hdr_len_id_t bier_hdr_byte_len_to_id (u32 bytes)
 
static bier_hdr_len_id_t bier_hdr_bit_len_to_id (u32 bytes)
 
u8format_bier_hdr_proto (u8 *s, va_list *ap)
 Format the header length field. More...
 
dpo_proto_t bier_hdr_proto_to_dpo (bier_hdr_proto_id_t bproto)
 Convert from BIER next-hop proto to DPO proto. More...
 
u8format_bier_hdr (u8 *s, va_list *ap)
 Format a BIER header. More...
 
u8format_bier_table_id (u8 *s, va_list *ap)
 Format a BIER table ID. More...
 
int bier_table_id_cmp (const bier_table_id_t *btid1, const bier_table_id_t *btid2)
 Compare to BIER table IDs for equality. More...
 
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. More...
 
u32 bier_hdr_len_id_to_num_bytes (bier_hdr_len_id_t id)
 
u32 bier_hdr_len_id_to_max_bucket (bier_hdr_len_id_t id)
 
u32 bier_hdr_len_id_to_num_bits (bier_hdr_len_id_t id)
 
u32 bier_hdr_len_id_to_max_bit (bier_hdr_len_id_t id)
 
u32 bier_hdr_len_id_to_prefix_len (bier_hdr_len_id_t id)
 
u16 bier_bfit_id_get_sub_domain (bier_bift_id_t bift_id)
 
u16 bier_bfit_id_get_set (bier_bift_id_t bift_id)
 
bier_hdr_proto_id_t bier_bift_id_get_bit_string_length (bier_bift_id_t bift_id)
 
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. More...
 
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)
 
u8format_bier_bift_id (u8 *s, va_list *ap)
 

Macro Definition Documentation

#define BIER_BIFT_ID_INVALID   (~0)

An invalid value for the BIFT ID all ones implies a BSL that's invalid.

Definition at line 516 of file bier_types.h.

#define BIER_BIT_MASK_BITS_PER_BUCKET   8

number of bits in a bucket

Definition at line 313 of file bier_types.h.

#define BIER_BIT_MASK_MAX_BUCKET   (BIER_BIT_MASK_NUM_BUCKETS - 1)

Definition at line 308 of file bier_types.h.

#define BIER_BIT_MASK_MIN_POS   (1)

Supported bit-posiotn range.

Definition at line 318 of file bier_types.h.

#define BIER_BIT_MASK_NUM_BUCKETS   32

256 bits = 32 bytes

Definition at line 307 of file bier_types.h.

#define BIER_BP_INVALID   0

Definition at line 366 of file bier_types.h.

#define BIER_BP_MAX   0x10000

The maximum BP that can be assigned.

Definition at line 353 of file bier_types.h.

#define BIER_BP_TO_INDEX (   bp)    (bp - 1)

Definition at line 348 of file bier_types.h.

#define BIER_ECMP_TABLE_ID_MAIN   0xFFFF

Definition of the ID of the BIER main table.

Definition at line 441 of file bier_types.h.

#define BIER_ERR_DUPLICATE_TABLE   2

Definition at line 503 of file bier_types.h.

#define BIER_ERR_NO_TABLE   1

Definition at line 502 of file bier_types.h.

#define BIER_ERR_PANIC   3

Definition at line 504 of file bier_types.h.

#define BIER_HDR_LEN_IDS
#define BIER_HDR_N_PROTO   (BIER_HDR_PROTO_OAM + 1)

Definition at line 187 of file bier_types.h.

#define BIER_OK   0

Definition at line 501 of file bier_types.h.

#define BIER_TABLE_SET_INVALID_ID   0xffffffff

Definition at line 424 of file bier_types.h.

#define BIER_TABLE_SUB_DOMAIN_INVALID_ID   0xffffffff

Definition at line 431 of file bier_types.h.

#define BIER_TABLE_TYPES
Value:
{ \
[BIER_TABLE_MPLS_SPF] = "mpls-spf", \
[BIER_TABLE_MPLS_TE] = "mpls-te", \
}
BIER over MPLS for TE.
Definition: bier_types.h:42
BIER over MPLS with SPF.
Definition: bier_types.h:37

Definition at line 45 of file bier_types.h.

#define FOR_EACH_BIER_HDR_LEN (   _len)
Value:
for (_item = BIER_HDR_LEN_64; \
_item <= BIER_HDR_LEN_4096; \
_item++)

Definition at line 75 of file bier_types.h.

#define FOR_EACH_BIER_HDR_PROTO (   _proto)
Value:

Definition at line 201 of file bier_types.h.

Typedef Documentation

The BIER universal 'label'.

Definition at line 510 of file bier_types.h.

A BIER Bit-String value of length 1024 bits.

A BIER Bit-String value of length 128 bits.

A BIER Bit-String value of length 2048 bits.

A BIER Bit-String value of length 256 bits.

A BIER Bit-String value of length 4096 bits.

A BIER Bit-String value of length 512 bits.

A BIER Bit-String value of length 64 bits.

A bucket is a byte.

The byte string is thus always in network byte order.

Definition at line 252 of file bier_types.h.

A BIER Bit-mask value.

The size of this mask represents this platforms BIER capabilities

Definition at line 340 of file bier_types.h.

A Variable length BitString.

typedef u32 bier_bp_t

A bit positon as assigned to egress PEs.

Definition at line 346 of file bier_types.h.

bier_hdr_code_t enumerator

bier_hdr_ctrl_sub_code_t enumerator

An entropy value in a BIER header.

Definition at line 364 of file bier_types.h.

bier_hdr_len_id_t enumerator

bier_hdr_len_num_buckets_t enumerator

bier_hdr_oam_sub_code_t enumerator

BIER header protocol payload types.

An identifier of the sender of BIER packets this is the source of the 'tree' - the BFIR.

Definition at line 359 of file bier_types.h.

typedef struct bier_hdr_t_ bier_hdr_t

A BIER header of variable length The encoding follows: https://tools.ietf.org/html/draft-ietf-bier-mpls-encapsulation-10.

BIER header versions.

typedef int bier_rc

Definition at line 505 of file bier_types.h.

Flags to control show output.

An ID or instance number of a BIER sub-table.

Definition at line 436 of file bier_types.h.

The ID of a table.

The BIER Set ID assigned to a BIER table.

Definition at line 422 of file bier_types.h.

The BIER Sub-domain ID assigned to a BIER table.

Definition at line 429 of file bier_types.h.

Types of BIER tables.

Enumeration Type Documentation

bier_hdr_code_t enumerator

Enumerator
BIER_HDR_CODE_OAM_IPV4 
BIER_HDR_CODE_OAM_IPV6 
BIER_HDR_CODE_CTRL_IPV4 
BIER_HDR_CODE_CTRL_IPV6 

Definition at line 226 of file bier_types.h.

bier_hdr_ctrl_sub_code_t enumerator

Enumerator
BIER_HDR_SUB_CODE_CTRL_MEMBER_REQ 
BIER_HDR_SUB_CODE_CTRL_ATTACHED_NET 

Definition at line 244 of file bier_types.h.

bier_hdr_len_id_t enumerator

Enumerator
BIER_HDR_LEN_64 
BIER_HDR_LEN_128 
BIER_HDR_LEN_256 
BIER_HDR_LEN_512 
BIER_HDR_LEN_1024 
BIER_HDR_LEN_2048 
BIER_HDR_LEN_4096 
BIER_HDR_LEN_INVALID 

Definition at line 53 of file bier_types.h.

bier_hdr_len_num_buckets_t enumerator

Enumerator
BIER_HDR_BUCKETS_64 
BIER_HDR_BUCKETS_128 
BIER_HDR_BUCKETS_256 
BIER_HDR_BUCKETS_512 
BIER_HDR_BUCKETS_1024 
BIER_HDR_BUCKETS_2048 
BIER_HDR_BUCKETS_4096 

Definition at line 162 of file bier_types.h.

bier_hdr_oam_sub_code_t enumerator

Enumerator
BIER_HDR_SUB_CODE_OAM_PING_REQ 
BIER_HDR_SUB_CODE_OAM_PING_RESP 

Definition at line 236 of file bier_types.h.

BIER header protocol payload types.

Enumerator
BIER_HDR_PROTO_INVALID 
BIER_HDR_PROTO_MPLS_DOWN_STREAM 
BIER_HDR_PROTO_MPLS_UP_STREAM 
BIER_HDR_PROTO_ETHERNET 
BIER_HDR_PROTO_IPV4 
BIER_HDR_PROTO_IPV6 
BIER_HDR_PROTO_VXLAN 
BIER_HDR_PROTO_CTRL 
BIER_HDR_PROTO_OAM 

Definition at line 175 of file bier_types.h.

BIER header versions.

Enumerator
BIER_HDR_VERSION_1 

Definition at line 219 of file bier_types.h.

Flags to control show output.

Enumerator
BIER_SHOW_BRIEF 
BIER_SHOW_DETAIL 

Definition at line 25 of file bier_types.h.

Types of BIER tables.

Enumerator
BIER_TABLE_MPLS_SPF 

BIER over MPLS with SPF.

BIER_TABLE_MPLS_TE 

BIER over MPLS for TE.

Definition at line 33 of file bier_types.h.

Function Documentation

u16 bier_bfit_id_get_set ( bier_bift_id_t  bift_id)
u16 bier_bfit_id_get_sub_domain ( bier_bift_id_t  bift_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 
)

Definition at line 180 of file bier_types.c.

+ Here is the caller graph for this function:

Encode a BIFT-ID as per draft-wijnandsxu-bier-non-mpls-bift-encoding-00.txt.

Definition at line 164 of file bier_types.c.

+ Here is the caller graph for this function:

bier_hdr_proto_id_t bier_bift_id_get_bit_string_length ( bier_bift_id_t  bift_id)
static bier_hdr_len_id_t bier_hdr_bit_len_to_id ( u32  bytes)
inlinestatic

Definition at line 137 of file bier_types.h.

+ Here is the caller graph for this function:

static bier_hdr_len_id_t bier_hdr_byte_len_to_id ( u32  bytes)
inlinestatic

Definition at line 114 of file bier_types.h.

u32 bier_hdr_len_id_to_max_bit ( bier_hdr_len_id_t  id)

Definition at line 84 of file bier_types.c.

+ Here is the call graph for this function:

u32 bier_hdr_len_id_to_max_bucket ( bier_hdr_len_id_t  id)

Definition at line 72 of file bier_types.c.

+ Here is the call graph for this function:

u32 bier_hdr_len_id_to_num_bits ( bier_hdr_len_id_t  id)

Definition at line 78 of file bier_types.c.

+ Here is the caller graph for this function:

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.

Definition at line 60 of file bier_types.c.

+ Here is the caller graph for this function:

u32 bier_hdr_len_id_to_num_bytes ( bier_hdr_len_id_t  id)

Definition at line 66 of file bier_types.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 bier_hdr_len_id_to_prefix_len ( bier_hdr_len_id_t  id)

Definition at line 90 of file bier_types.c.

dpo_proto_t bier_hdr_proto_to_dpo ( bier_hdr_proto_id_t  bproto)

Convert from BIER next-hop proto to DPO proto.

Definition at line 139 of file bier_types.c.

+ Here is the caller graph for this function:

static bier_hdr_len_id_t bier_prefix_len_to_hdr_id ( u16  prfx_len)
inlinestatic

Definition at line 89 of file bier_types.h.

int bier_table_id_cmp ( const bier_table_id_t btid1,
const bier_table_id_t btid2 
)

Compare to BIER table IDs for equality.

Definition at line 112 of file bier_types.c.

+ Here is the caller graph for this function:

u8* format_bier_bift_id ( u8 s,
va_list *  ap 
)

Definition at line 222 of file bier_types.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_bier_hdr ( u8 s,
va_list *  ap 
)

Format a BIER header.

Definition at line 205 of file bier_types.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_bier_hdr_len_id ( u8 s,
va_list *  ap 
)

Format the header length field.

Definition at line 96 of file bier_types.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_bier_hdr_proto ( u8 s,
va_list *  ap 
)

Format the header length field.

Definition at line 104 of file bier_types.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_bier_table_id ( u8 s,
va_list *  ap 
)

Format a BIER table ID.

Definition at line 193 of file bier_types.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: