18 #ifndef included_vnet_mpls_packet_h 19 #define included_vnet_mpls_packet_h 42 #define MPLS_EOS_BITS { \ 43 [MPLS_NON_EOS] = "neos", \ 50 #define MPLS_LABEL_DEFAULT_TTL 64 55 #define MPLS_LABEL_DEFAULT_EXP 0 73 #define FOR_EACH_MPLS_EOS_BIT(_eos) \ 74 for (_eos = MPLS_NON_EOS; _eos <= MPLS_EOS; _eos++) 76 #define MPLS_ENTRY_LABEL_OFFSET 0 77 #define MPLS_ENTRY_LABEL_SHIFT 12 78 #define MPLS_ENTRY_LABEL_MASK 0x000fffff 79 #define MPLS_ENTRY_LABEL_BITS \ 80 (MPLS_ENTRY_LABEL_MASK << MPLS_ENTRY_LABEL_SHIFT) 82 #define MPLS_ENTRY_EXP_OFFSET 2 83 #define MPLS_ENTRY_EXP_SHIFT 9 84 #define MPLS_ENTRY_EXP_MASK 0x07 85 #define MPLS_ENTRY_EXP(mpls) \ 86 (((mpls)>>MPLS_ENTRY_EXP_SHIFT) & MPLS_ENTRY_EXP_MASK) 87 #define MPLS_ENTRY_EXP_BITS \ 88 (MPLS_ENTRY_EXP_MASK << MPLS_ENTRY_EXP_SHIFT) 90 #define MPLS_ENTRY_EOS_OFFSET 2 91 #define MPLS_ENTRY_EOS_SHIFT 8 92 #define MPLS_ENTRY_EOS_MASK 0x01 93 #define MPLS_ENTRY_EOS(mpls) \ 94 (((mpls) >> MPLS_ENTRY_EOS_SHIFT) & MPLS_ENTRY_EOS_MASK) 95 #define MPLS_ENTRY_EOS_BIT (MPLS_ENTRY_EOS_MASK << MPLS_ENTRY_EOS_SHIFT) 97 #define MPLS_ENTRY_TTL_OFFSET 3 98 #define MPLS_ENTRY_TTL_SHIFT 0 99 #define MPLS_ENTRY_TTL_MASK 0xff 100 #define MPLS_ENTRY_TTL(mpls) \ 101 (((mpls) >> MPLS_ENTRY_TTL_SHIFT) & MPLS_ENTRY_TTL_MASK) 102 #define MPLS_ENTRY_TTL_BITS \ 103 (MPLS_ENTRY_TTL_MASK << MPLS_ENTRY_TTL_SHIFT)
#define MPLS_ENTRY_TTL_BITS
static void vnet_mpls_uc_set_s(mpls_label_t *label_exp_s_ttl, u32 eos)
#define MPLS_ENTRY_EOS_SHIFT
enum mpls_eos_bit_t_ mpls_eos_bit_t
#define MPLS_ENTRY_EXP_MASK
static u32 vnet_mpls_uc_get_ttl(mpls_label_t label_exp_s_ttl)
#define MPLS_ENTRY_EOS(mpls)
u32 mpls_label_t
A label value only, i.e.
static void vnet_mpls_uc_set_exp(mpls_label_t *label_exp_s_ttl, u32 exp)
#define MPLS_ENTRY_EOS_BIT
#define MPLS_ENTRY_TTL(mpls)
static u32 vnet_mpls_uc_get_s(mpls_label_t label_exp_s_ttl)
#define MPLS_ENTRY_LABEL_SHIFT
#define MPLS_ENTRY_LABEL_MASK
static void vnet_mpls_uc_set_ttl(mpls_label_t *label_exp_s_ttl, u32 ttl)
#define MPLS_ENTRY_EXP_SHIFT
static u32 vnet_mpls_uc_get_label(mpls_label_t label_exp_s_ttl)
#define MPLS_ENTRY_TTL_MASK
static void vnet_mpls_uc_set_label(mpls_label_t *label_exp_s_ttl, u32 value)
#define MPLS_ENTRY_EXP_BITS
enum ip_dscp_t_ ip_dscp_t
static u32 vnet_mpls_uc_get_exp(mpls_label_t label_exp_s_ttl)
#define MPLS_ENTRY_EOS_MASK
static u8 mpls_exp_to_ip_dscp(u8 exp)
When in uniform mode convert an MPLS EXP value to an IPv[46] DSCP value.
#define MPLS_ENTRY_LABEL_BITS
#define MPLS_ENTRY_EXP(mpls)
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.