FD.io VPP  v19.08.3-2-gbabecb413
Vector Packet Processing
packet.h File Reference
+ Include dependency graph for packet.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mpls_unicast_header_t
 

Macros

#define MPLS_EOS_BITS
 
#define MPLS_LABEL_DEFAULT_TTL   64
 The Default TTL added to MPLS label headers when no other value is available. More...
 
#define MPLS_LABEL_DEFAULT_EXP   0
 The Default EXP added to MPLS label headers when no other value is available. More...
 
#define FOR_EACH_MPLS_EOS_BIT(_eos)   for (_eos = MPLS_NON_EOS; _eos <= MPLS_EOS; _eos++)
 
#define MPLS_ENTRY_LABEL_OFFSET   0
 
#define MPLS_ENTRY_LABEL_SHIFT   12
 
#define MPLS_ENTRY_LABEL_MASK   0x000fffff
 
#define MPLS_ENTRY_LABEL_BITS   (MPLS_ENTRY_LABEL_MASK << MPLS_ENTRY_LABEL_SHIFT)
 
#define MPLS_ENTRY_EXP_OFFSET   2 /* byte offset to EXP bits */
 
#define MPLS_ENTRY_EXP_SHIFT   9
 
#define MPLS_ENTRY_EXP_MASK   0x07
 
#define MPLS_ENTRY_EXP(mpls)   (((mpls)>>MPLS_ENTRY_EXP_SHIFT) & MPLS_ENTRY_EXP_MASK)
 
#define MPLS_ENTRY_EXP_BITS   (MPLS_ENTRY_EXP_MASK << MPLS_ENTRY_EXP_SHIFT)
 
#define MPLS_ENTRY_EOS_OFFSET   2 /* byte offset to EOS bit */
 
#define MPLS_ENTRY_EOS_SHIFT   8
 
#define MPLS_ENTRY_EOS_MASK   0x01 /* EOS bit in its byte */
 
#define MPLS_ENTRY_EOS(mpls)   (((mpls) >> MPLS_ENTRY_EOS_SHIFT) & MPLS_ENTRY_EOS_MASK)
 
#define MPLS_ENTRY_EOS_BIT   (MPLS_ENTRY_EOS_MASK << MPLS_ENTRY_EOS_SHIFT)
 
#define MPLS_ENTRY_TTL_OFFSET   3 /* byte offset to ttl field */
 
#define MPLS_ENTRY_TTL_SHIFT   0
 
#define MPLS_ENTRY_TTL_MASK   0xff
 
#define MPLS_ENTRY_TTL(mpls)   (((mpls) >> MPLS_ENTRY_TTL_SHIFT) & MPLS_ENTRY_TTL_MASK)
 
#define MPLS_ENTRY_TTL_BITS   (MPLS_ENTRY_TTL_MASK << MPLS_ENTRY_TTL_SHIFT)
 

Typedefs

typedef u32 mpls_label_t
 A label value only, i.e. More...
 
typedef enum mpls_eos_bit_t_ mpls_eos_bit_t
 

Enumerations

enum  mpls_eos_bit_t_ { MPLS_NON_EOS = 0, MPLS_EOS = 1 }
 

Functions

static u8 ip_dscp_to_mpls_exp (ip_dscp_t tos)
 When in uniform mode convert an IPv[46] DSCP value to an MPLS EXP value. More...
 
static u8 mpls_exp_to_ip_dscp (u8 exp)
 When in uniform mode convert an MPLS EXP value to an IPv[46] DSCP value. More...
 
static u32 vnet_mpls_uc_get_label (mpls_label_t label_exp_s_ttl)
 
static u32 vnet_mpls_uc_get_exp (mpls_label_t label_exp_s_ttl)
 
static u32 vnet_mpls_uc_get_s (mpls_label_t label_exp_s_ttl)
 
static u32 vnet_mpls_uc_get_ttl (mpls_label_t label_exp_s_ttl)
 
static void vnet_mpls_uc_set_label (mpls_label_t *label_exp_s_ttl, u32 value)
 
static void vnet_mpls_uc_set_exp (mpls_label_t *label_exp_s_ttl, u32 exp)
 
static void vnet_mpls_uc_set_s (mpls_label_t *label_exp_s_ttl, u32 eos)
 
static void vnet_mpls_uc_set_ttl (mpls_label_t *label_exp_s_ttl, u32 ttl)
 

Macro Definition Documentation

◆ FOR_EACH_MPLS_EOS_BIT

#define FOR_EACH_MPLS_EOS_BIT (   _eos)    for (_eos = MPLS_NON_EOS; _eos <= MPLS_EOS; _eos++)

Definition at line 73 of file packet.h.

◆ MPLS_ENTRY_EOS

#define MPLS_ENTRY_EOS (   mpls)    (((mpls) >> MPLS_ENTRY_EOS_SHIFT) & MPLS_ENTRY_EOS_MASK)

Definition at line 93 of file packet.h.

◆ MPLS_ENTRY_EOS_BIT

#define MPLS_ENTRY_EOS_BIT   (MPLS_ENTRY_EOS_MASK << MPLS_ENTRY_EOS_SHIFT)

Definition at line 95 of file packet.h.

◆ MPLS_ENTRY_EOS_MASK

#define MPLS_ENTRY_EOS_MASK   0x01 /* EOS bit in its byte */

Definition at line 92 of file packet.h.

◆ MPLS_ENTRY_EOS_OFFSET

#define MPLS_ENTRY_EOS_OFFSET   2 /* byte offset to EOS bit */

Definition at line 90 of file packet.h.

◆ MPLS_ENTRY_EOS_SHIFT

#define MPLS_ENTRY_EOS_SHIFT   8

Definition at line 91 of file packet.h.

◆ MPLS_ENTRY_EXP

#define MPLS_ENTRY_EXP (   mpls)    (((mpls)>>MPLS_ENTRY_EXP_SHIFT) & MPLS_ENTRY_EXP_MASK)

Definition at line 85 of file packet.h.

◆ MPLS_ENTRY_EXP_BITS

#define MPLS_ENTRY_EXP_BITS   (MPLS_ENTRY_EXP_MASK << MPLS_ENTRY_EXP_SHIFT)

Definition at line 87 of file packet.h.

◆ MPLS_ENTRY_EXP_MASK

#define MPLS_ENTRY_EXP_MASK   0x07

Definition at line 84 of file packet.h.

◆ MPLS_ENTRY_EXP_OFFSET

#define MPLS_ENTRY_EXP_OFFSET   2 /* byte offset to EXP bits */

Definition at line 82 of file packet.h.

◆ MPLS_ENTRY_EXP_SHIFT

#define MPLS_ENTRY_EXP_SHIFT   9

Definition at line 83 of file packet.h.

◆ MPLS_ENTRY_LABEL_BITS

#define MPLS_ENTRY_LABEL_BITS   (MPLS_ENTRY_LABEL_MASK << MPLS_ENTRY_LABEL_SHIFT)

Definition at line 79 of file packet.h.

◆ MPLS_ENTRY_LABEL_MASK

#define MPLS_ENTRY_LABEL_MASK   0x000fffff

Definition at line 78 of file packet.h.

◆ MPLS_ENTRY_LABEL_OFFSET

#define MPLS_ENTRY_LABEL_OFFSET   0

Definition at line 76 of file packet.h.

◆ MPLS_ENTRY_LABEL_SHIFT

#define MPLS_ENTRY_LABEL_SHIFT   12

Definition at line 77 of file packet.h.

◆ MPLS_ENTRY_TTL

#define MPLS_ENTRY_TTL (   mpls)    (((mpls) >> MPLS_ENTRY_TTL_SHIFT) & MPLS_ENTRY_TTL_MASK)

Definition at line 100 of file packet.h.

◆ MPLS_ENTRY_TTL_BITS

#define MPLS_ENTRY_TTL_BITS   (MPLS_ENTRY_TTL_MASK << MPLS_ENTRY_TTL_SHIFT)

Definition at line 102 of file packet.h.

◆ MPLS_ENTRY_TTL_MASK

#define MPLS_ENTRY_TTL_MASK   0xff

Definition at line 99 of file packet.h.

◆ MPLS_ENTRY_TTL_OFFSET

#define MPLS_ENTRY_TTL_OFFSET   3 /* byte offset to ttl field */

Definition at line 97 of file packet.h.

◆ MPLS_ENTRY_TTL_SHIFT

#define MPLS_ENTRY_TTL_SHIFT   0

Definition at line 98 of file packet.h.

◆ MPLS_EOS_BITS

#define MPLS_EOS_BITS
Value:
{ \
[MPLS_NON_EOS] = "neos", \
[MPLS_EOS] = "eos", \
}

Definition at line 42 of file packet.h.

◆ MPLS_LABEL_DEFAULT_EXP

#define MPLS_LABEL_DEFAULT_EXP   0

The Default EXP added to MPLS label headers when no other value is available.

Definition at line 55 of file packet.h.

◆ MPLS_LABEL_DEFAULT_TTL

#define MPLS_LABEL_DEFAULT_TTL   64

The Default TTL added to MPLS label headers when no other value is available.

Definition at line 50 of file packet.h.

Typedef Documentation

◆ mpls_eos_bit_t

◆ mpls_label_t

typedef u32 mpls_label_t

A label value only, i.e.

20bits.

Definition at line 26 of file packet.h.

Enumeration Type Documentation

◆ mpls_eos_bit_t_

Enumerator
MPLS_NON_EOS 
MPLS_EOS 

Definition at line 36 of file packet.h.

Function Documentation

◆ ip_dscp_to_mpls_exp()

static u8 ip_dscp_to_mpls_exp ( ip_dscp_t  tos)
inlinestatic

When in uniform mode convert an IPv[46] DSCP value to an MPLS EXP value.

Definition at line 60 of file packet.h.

+ Here is the caller graph for this function:

◆ mpls_exp_to_ip_dscp()

static u8 mpls_exp_to_ip_dscp ( u8  exp)
inlinestatic

When in uniform mode convert an MPLS EXP value to an IPv[46] DSCP value.

Definition at line 68 of file packet.h.

+ Here is the caller graph for this function:

◆ vnet_mpls_uc_get_exp()

static u32 vnet_mpls_uc_get_exp ( mpls_label_t  label_exp_s_ttl)
inlinestatic

Definition at line 110 of file packet.h.

+ Here is the caller graph for this function:

◆ vnet_mpls_uc_get_label()

static u32 vnet_mpls_uc_get_label ( mpls_label_t  label_exp_s_ttl)
inlinestatic

Definition at line 105 of file packet.h.

+ Here is the caller graph for this function:

◆ vnet_mpls_uc_get_s()

static u32 vnet_mpls_uc_get_s ( mpls_label_t  label_exp_s_ttl)
inlinestatic

Definition at line 115 of file packet.h.

+ Here is the caller graph for this function:

◆ vnet_mpls_uc_get_ttl()

static u32 vnet_mpls_uc_get_ttl ( mpls_label_t  label_exp_s_ttl)
inlinestatic

Definition at line 120 of file packet.h.

+ Here is the caller graph for this function:

◆ vnet_mpls_uc_set_exp()

static void vnet_mpls_uc_set_exp ( mpls_label_t label_exp_s_ttl,
u32  exp 
)
inlinestatic

Definition at line 132 of file packet.h.

+ Here is the caller graph for this function:

◆ vnet_mpls_uc_set_label()

static void vnet_mpls_uc_set_label ( mpls_label_t label_exp_s_ttl,
u32  value 
)
inlinestatic

Definition at line 125 of file packet.h.

+ Here is the caller graph for this function:

◆ vnet_mpls_uc_set_s()

static void vnet_mpls_uc_set_s ( mpls_label_t label_exp_s_ttl,
u32  eos 
)
inlinestatic

Definition at line 139 of file packet.h.

+ Here is the caller graph for this function:

◆ vnet_mpls_uc_set_ttl()

static void vnet_mpls_uc_set_ttl ( mpls_label_t label_exp_s_ttl,
u32  ttl 
)
inlinestatic

Definition at line 146 of file packet.h.

+ Here is the caller graph for this function: