FD.io VPP  v19.01.3-6-g70449b9b9
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_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_string_t_ bier_bit_string_t
 A Variable length BitString. 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

◆ BIER_BIFT_ID_INVALID

#define BIER_BIFT_ID_INVALID   (~0)

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

Definition at line 464 of file bier_types.h.

◆ BIER_BIT_MASK_BITS_PER_BUCKET

#define BIER_BIT_MASK_BITS_PER_BUCKET   8

number of bits in a bucket

Definition at line 268 of file bier_types.h.

◆ BIER_BIT_MASK_MAX_BUCKET

#define BIER_BIT_MASK_MAX_BUCKET   (BIER_BIT_MASK_NUM_BUCKETS - 1)

Definition at line 263 of file bier_types.h.

◆ BIER_BIT_MASK_MIN_POS

#define BIER_BIT_MASK_MIN_POS   (1)

Supported bit-posiotn range.

Definition at line 273 of file bier_types.h.

◆ BIER_BIT_MASK_NUM_BUCKETS

#define BIER_BIT_MASK_NUM_BUCKETS   32

256 bits = 32 bytes

Definition at line 262 of file bier_types.h.

◆ BIER_BP_INVALID

#define BIER_BP_INVALID   0

Definition at line 314 of file bier_types.h.

◆ BIER_BP_MAX

#define BIER_BP_MAX   0x10000

The maximum BP that can be assigned.

Definition at line 301 of file bier_types.h.

◆ BIER_BP_TO_INDEX

#define BIER_BP_TO_INDEX (   bp)    (bp - 1)

Definition at line 296 of file bier_types.h.

◆ BIER_ECMP_TABLE_ID_MAIN

#define BIER_ECMP_TABLE_ID_MAIN   0xFFFF

Definition of the ID of the BIER main table.

Definition at line 389 of file bier_types.h.

◆ BIER_ERR_DUPLICATE_TABLE

#define BIER_ERR_DUPLICATE_TABLE   2

Definition at line 451 of file bier_types.h.

◆ BIER_ERR_NO_TABLE

#define BIER_ERR_NO_TABLE   1

Definition at line 450 of file bier_types.h.

◆ BIER_ERR_PANIC

#define BIER_ERR_PANIC   3

Definition at line 452 of file bier_types.h.

◆ BIER_HDR_LEN_IDS

#define BIER_HDR_LEN_IDS
Value:
{ \
[BIER_HDR_LEN_INVALID] = "invalid",\
[BIER_HDR_LEN_64] = "64", \
[BIER_HDR_LEN_128] = "128", \
[BIER_HDR_LEN_256] = "256", \
[BIER_HDR_LEN_512] = "512", \
[BIER_HDR_LEN_1024] = "1024", \
[BIER_HDR_LEN_2048] = "2048", \
[BIER_HDR_LEN_4096] = "4096", \
}
Bit-string lengths greater than 1024 are not supported due to the limited about pf space available in...
Definition: bier_types.h:64

Definition at line 69 of file bier_types.h.

◆ BIER_HDR_N_PROTO

#define BIER_HDR_N_PROTO   (BIER_HDR_PROTO_OAM + 1)

Definition at line 192 of file bier_types.h.

◆ BIER_HDR_PROTO_ID_NAMES

◆ BIER_OK

#define BIER_OK   0

Definition at line 449 of file bier_types.h.

◆ BIER_TABLE_SET_INVALID_ID

#define BIER_TABLE_SET_INVALID_ID   0xffffffff

Definition at line 372 of file bier_types.h.

◆ BIER_TABLE_SUB_DOMAIN_INVALID_ID

#define BIER_TABLE_SUB_DOMAIN_INVALID_ID   0xffffffff

Definition at line 379 of file bier_types.h.

◆ BIER_TABLE_TYPES

#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.

◆ FOR_EACH_BIER_HDR_LEN

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

Definition at line 80 of file bier_types.h.

◆ FOR_EACH_BIER_HDR_PROTO

#define FOR_EACH_BIER_HDR_PROTO (   _proto)
Value:

Definition at line 206 of file bier_types.h.

Typedef Documentation

◆ bier_bift_id_t

The BIER universal 'label'.

Definition at line 458 of file bier_types.h.

◆ bier_bit_mask_bucket_t

A bucket is a byte.

The byte string is thus always in network byte order.

Definition at line 257 of file bier_types.h.

◆ bier_bit_string_t

A Variable length BitString.

◆ bier_bp_t

typedef u32 bier_bp_t

A bit positon as assigned to egress PEs.

Definition at line 294 of file bier_types.h.

◆ bier_hdr_code_t

bier_hdr_code_t enumerator

◆ bier_hdr_ctrl_sub_code_t

bier_hdr_ctrl_sub_code_t enumerator

◆ bier_hdr_entropy_t

An entropy value in a BIER header.

Definition at line 312 of file bier_types.h.

◆ bier_hdr_len_id_t

bier_hdr_len_id_t enumerator

◆ bier_hdr_len_num_buckets_t

bier_hdr_len_num_buckets_t enumerator

◆ bier_hdr_oam_sub_code_t

bier_hdr_oam_sub_code_t enumerator

◆ bier_hdr_proto_id_t

BIER header protocol payload types.

◆ bier_hdr_src_id_t

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

Definition at line 307 of file bier_types.h.

◆ bier_hdr_t

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_hdr_version_t

BIER header versions.

◆ bier_rc

typedef int bier_rc

Definition at line 453 of file bier_types.h.

◆ bier_show_flags_t

Flags to control show output.

◆ bier_table_ecmp_id_t

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

Definition at line 384 of file bier_types.h.

◆ bier_table_id_t

The ID of a table.

◆ bier_table_set_id_t

The BIER Set ID assigned to a BIER table.

Definition at line 370 of file bier_types.h.

◆ bier_table_sub_domain_id_t

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

Definition at line 377 of file bier_types.h.

◆ bier_table_type_t

Types of BIER tables.

Enumeration Type Documentation

◆ bier_hdr_code_t_

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 231 of file bier_types.h.

◆ bier_hdr_ctrl_sub_code_t_

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 249 of file bier_types.h.

◆ bier_hdr_len_id_t_

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 

Bit-string lengths greater than 1024 are not supported due to the limited about pf space available in a vlib_buffer_t to prepend a BIER header at imposition.

BIER_HDR_LEN_4096 
BIER_HDR_LEN_INVALID 

Definition at line 53 of file bier_types.h.

◆ bier_hdr_len_num_buckets_t_

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 167 of file bier_types.h.

◆ bier_hdr_oam_sub_code_t_

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 241 of file bier_types.h.

◆ bier_hdr_proto_id_t_

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 180 of file bier_types.h.

◆ bier_hdr_version_t_

BIER header versions.

Enumerator
BIER_HDR_VERSION_1 

Definition at line 224 of file bier_types.h.

◆ bier_show_flags_t_

Flags to control show output.

Enumerator
BIER_SHOW_BRIEF 
BIER_SHOW_DETAIL 

Definition at line 25 of file bier_types.h.

◆ bier_table_type_t_

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

◆ bier_bfit_id_get_set()

u16 bier_bfit_id_get_set ( bier_bift_id_t  bift_id)

◆ bier_bfit_id_get_sub_domain()

u16 bier_bfit_id_get_sub_domain ( bier_bift_id_t  bift_id)

◆ bier_bift_id_decode()

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:

◆ bier_bift_id_encode()

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_bift_id_get_bit_string_length()

bier_hdr_proto_id_t bier_bift_id_get_bit_string_length ( bier_bift_id_t  bift_id)

◆ bier_hdr_bit_len_to_id()

static bier_hdr_len_id_t bier_hdr_bit_len_to_id ( u32  bytes)
inlinestatic

Definition at line 142 of file bier_types.h.

+ Here is the caller graph for this function:

◆ bier_hdr_byte_len_to_id()

static bier_hdr_len_id_t bier_hdr_byte_len_to_id ( u32  bytes)
inlinestatic

Definition at line 119 of file bier_types.h.

◆ bier_hdr_len_id_to_max_bit()

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:

◆ bier_hdr_len_id_to_max_bucket()

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:

◆ bier_hdr_len_id_to_num_bits()

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:

◆ bier_hdr_len_id_to_num_buckets()

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:

◆ bier_hdr_len_id_to_num_bytes()

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:

◆ bier_hdr_len_id_to_prefix_len()

u32 bier_hdr_len_id_to_prefix_len ( bier_hdr_len_id_t  id)

Definition at line 90 of file bier_types.c.

◆ bier_hdr_proto_to_dpo()

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:

◆ bier_prefix_len_to_hdr_id()

static bier_hdr_len_id_t bier_prefix_len_to_hdr_id ( u16  prfx_len)
inlinestatic

Definition at line 94 of file bier_types.h.

◆ bier_table_id_cmp()

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:

◆ format_bier_bift_id()

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:

◆ format_bier_hdr()

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:

◆ format_bier_hdr_len_id()

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:

◆ format_bier_hdr_proto()

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:

◆ format_bier_table_id()

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: