diff options
author | Neale Ranns <nranns@cisco.com> | 2018-02-23 05:29:09 -0800 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2018-03-09 11:59:58 +0000 |
commit | 31ed74407643595fdce206e9d7487108fb8b33ab (patch) | |
tree | c22c3703c30b7d457b858fe899f56e57613cbb52 /src/vnet/mpls/packet.h | |
parent | 8f931a47b0fa58d5d33a792062650a42ff8bef70 (diff) |
MPLS Unifom mode
- support both pipe and uniform modes for all MPLS LSP
- all API programming for output-labels requires that the mode (and associated data) is specificed
- API changes in MPLS, BIER and IP are involved
- new DPO [sub] types for MPLS labels to handle the two modes.
Change-Id: I87b76401e996f10dfbdbe4552ff6b19af958783c
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/mpls/packet.h')
-rw-r--r-- | src/vnet/mpls/packet.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/vnet/mpls/packet.h b/src/vnet/mpls/packet.h index bc67445be89..ca6ac407686 100644 --- a/src/vnet/mpls/packet.h +++ b/src/vnet/mpls/packet.h @@ -42,6 +42,32 @@ typedef enum mpls_eos_bit_t_ [MPLS_EOS] = "eos", \ } +/** + * The Default TTL added to MPLS label headers when no other value is available + */ +#define MPLS_LABEL_DEFAULT_TTL 64 + +/** + * The Default EXP added to MPLS label headers when no other value is available + */ +#define MPLS_LABEL_DEFAULT_EXP 0 + +/** + * When in uniform mode convert an IPv[46] DSCP value to an MPLS EXP value + */ +static inline u8 ip_dscp_to_mpls_exp (u8 tos) +{ + return (tos >> 5); +} + +/** + * When in uniform mode convert an MPLS EXP value to an IPv[46] DSCP value + */ +static inline u8 mpls_exp_to_ip_dscp (u8 exp) +{ + return (exp << 5); +} + #define FOR_EACH_MPLS_EOS_BIT(_eos) \ for (_eos = MPLS_NON_EOS; _eos <= MPLS_EOS; _eos++) |