FD.io VPP  v18.07-34-g55fbdb9
Vector Packet Processing
packet.h File Reference
+ 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 (u8 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

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

Definition at line 71 of file packet.h.

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

Definition at line 91 of file packet.h.

#define MPLS_ENTRY_EOS_BIT   (MPLS_ENTRY_EOS_MASK << MPLS_ENTRY_EOS_SHIFT)

Definition at line 93 of file packet.h.

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

Definition at line 90 of file packet.h.

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

Definition at line 88 of file packet.h.

#define MPLS_ENTRY_EOS_SHIFT   8

Definition at line 89 of file packet.h.

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

Definition at line 83 of file packet.h.

#define MPLS_ENTRY_EXP_BITS   (MPLS_ENTRY_EXP_MASK << MPLS_ENTRY_EXP_SHIFT)

Definition at line 85 of file packet.h.

#define MPLS_ENTRY_EXP_MASK   0x07

Definition at line 82 of file packet.h.

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

Definition at line 80 of file packet.h.

#define MPLS_ENTRY_EXP_SHIFT   9

Definition at line 81 of file packet.h.

#define MPLS_ENTRY_LABEL_BITS   (MPLS_ENTRY_LABEL_MASK << MPLS_ENTRY_LABEL_SHIFT)

Definition at line 77 of file packet.h.

#define MPLS_ENTRY_LABEL_MASK   0x000fffff

Definition at line 76 of file packet.h.

#define MPLS_ENTRY_LABEL_OFFSET   0

Definition at line 74 of file packet.h.

#define MPLS_ENTRY_LABEL_SHIFT   12

Definition at line 75 of file packet.h.

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

Definition at line 98 of file packet.h.

#define MPLS_ENTRY_TTL_BITS   (MPLS_ENTRY_TTL_MASK << MPLS_ENTRY_TTL_SHIFT)

Definition at line 100 of file packet.h.

#define MPLS_ENTRY_TTL_MASK   0xff

Definition at line 97 of file packet.h.

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

Definition at line 95 of file packet.h.

#define MPLS_ENTRY_TTL_SHIFT   0

Definition at line 96 of file packet.h.

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

Definition at line 40 of file packet.h.

#define MPLS_LABEL_DEFAULT_EXP   0

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

Definition at line 53 of file packet.h.

#define MPLS_LABEL_DEFAULT_TTL   64

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

Definition at line 48 of file packet.h.

Typedef Documentation

typedef u32 mpls_label_t

A label value only, i.e.

20bits.

Definition at line 24 of file packet.h.

Enumeration Type Documentation

Enumerator
MPLS_NON_EOS 
MPLS_EOS 

Definition at line 34 of file packet.h.

Function Documentation

static u8 ip_dscp_to_mpls_exp ( u8  tos)
inlinestatic

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

Definition at line 58 of file packet.h.

+ Here is the caller graph for this function:

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 66 of file packet.h.

+ Here is the caller graph for this function:

static u32 vnet_mpls_uc_get_exp ( mpls_label_t  label_exp_s_ttl)
inlinestatic

Definition at line 108 of file packet.h.

+ Here is the caller graph for this function:

static u32 vnet_mpls_uc_get_label ( mpls_label_t  label_exp_s_ttl)
inlinestatic

Definition at line 103 of file packet.h.

+ Here is the caller graph for this function:

static u32 vnet_mpls_uc_get_s ( mpls_label_t  label_exp_s_ttl)
inlinestatic

Definition at line 113 of file packet.h.

+ Here is the caller graph for this function:

static u32 vnet_mpls_uc_get_ttl ( mpls_label_t  label_exp_s_ttl)
inlinestatic

Definition at line 118 of file packet.h.

+ Here is the caller graph for this function:

static void vnet_mpls_uc_set_exp ( mpls_label_t label_exp_s_ttl,
u32  exp 
)
inlinestatic

Definition at line 130 of file packet.h.

+ Here is the caller graph for this function:

static void vnet_mpls_uc_set_label ( mpls_label_t label_exp_s_ttl,
u32  value 
)
inlinestatic

Definition at line 123 of file packet.h.

+ Here is the caller graph for this function:

static void vnet_mpls_uc_set_s ( mpls_label_t label_exp_s_ttl,
u32  eos 
)
inlinestatic

Definition at line 137 of file packet.h.

+ Here is the caller graph for this function:

static void vnet_mpls_uc_set_ttl ( mpls_label_t label_exp_s_ttl,
u32  ttl 
)
inlinestatic

Definition at line 144 of file packet.h.

+ Here is the caller graph for this function: