1 #ifndef included_vnet_mpls_packet_h 2 #define included_vnet_mpls_packet_h 40 #define MPLS_EOS_BITS { \ 41 [MPLS_NON_EOS] = "neos", \ 48 #define MPLS_LABEL_DEFAULT_TTL 64 53 #define MPLS_LABEL_DEFAULT_EXP 0 71 #define FOR_EACH_MPLS_EOS_BIT(_eos) \ 72 for (_eos = MPLS_NON_EOS; _eos <= MPLS_EOS; _eos++) 74 #define MPLS_ENTRY_LABEL_OFFSET 0 75 #define MPLS_ENTRY_LABEL_SHIFT 12 76 #define MPLS_ENTRY_LABEL_MASK 0x000fffff 77 #define MPLS_ENTRY_LABEL_BITS \ 78 (MPLS_ENTRY_LABEL_MASK << MPLS_ENTRY_LABEL_SHIFT) 80 #define MPLS_ENTRY_EXP_OFFSET 2 81 #define MPLS_ENTRY_EXP_SHIFT 9 82 #define MPLS_ENTRY_EXP_MASK 0x07 83 #define MPLS_ENTRY_EXP(mpls) \ 84 (((mpls)>>MPLS_ENTRY_EXP_SHIFT) & MPLS_ENTRY_EXP_MASK) 85 #define MPLS_ENTRY_EXP_BITS \ 86 (MPLS_ENTRY_EXP_MASK << MPLS_ENTRY_EXP_SHIFT) 88 #define MPLS_ENTRY_EOS_OFFSET 2 89 #define MPLS_ENTRY_EOS_SHIFT 8 90 #define MPLS_ENTRY_EOS_MASK 0x01 91 #define MPLS_ENTRY_EOS(mpls) \ 92 (((mpls) >> MPLS_ENTRY_EOS_SHIFT) & MPLS_ENTRY_EOS_MASK) 93 #define MPLS_ENTRY_EOS_BIT (MPLS_ENTRY_EOS_MASK << MPLS_ENTRY_EOS_SHIFT) 95 #define MPLS_ENTRY_TTL_OFFSET 3 96 #define MPLS_ENTRY_TTL_SHIFT 0 97 #define MPLS_ENTRY_TTL_MASK 0xff 98 #define MPLS_ENTRY_TTL(mpls) \ 99 (((mpls) >> MPLS_ENTRY_TTL_SHIFT) & MPLS_ENTRY_TTL_MASK) 100 #define MPLS_ENTRY_TTL_BITS \ 101 (MPLS_ENTRY_TTL_MASK << MPLS_ENTRY_TTL_SHIFT)
#define MPLS_ENTRY_LABEL_SHIFT
#define MPLS_ENTRY_EOS_MASK
#define MPLS_ENTRY_TTL_MASK
u32 mpls_label_t
A label value only, i.e.
#define MPLS_ENTRY_LABEL_BITS
#define MPLS_ENTRY_EXP_MASK
#define MPLS_ENTRY_EOS_SHIFT
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)
#define MPLS_ENTRY_EOS_BIT
static u32 vnet_mpls_uc_get_label(mpls_label_t label_exp_s_ttl)
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_MASK
#define MPLS_ENTRY_EXP_BITS
#define MPLS_ENTRY_EOS(mpls)
#define MPLS_ENTRY_TTL(mpls)
static u8 ip_dscp_to_mpls_exp(u8 tos)
When in uniform mode convert an IPv[46] DSCP value to an MPLS EXP value.
static void vnet_mpls_uc_set_s(mpls_label_t *label_exp_s_ttl, u32 eos)
#define MPLS_ENTRY_EXP_SHIFT
static u32 vnet_mpls_uc_get_s(mpls_label_t label_exp_s_ttl)
static void vnet_mpls_uc_set_ttl(mpls_label_t *label_exp_s_ttl, u32 ttl)
static u32 vnet_mpls_uc_get_exp(mpls_label_t label_exp_s_ttl)
#define MPLS_ENTRY_EXP(mpls)
#define MPLS_ENTRY_TTL_BITS
enum mpls_eos_bit_t_ mpls_eos_bit_t