diff options
author | Neale Ranns <nranns@cisco.com> | 2020-12-21 09:52:24 +0000 |
---|---|---|
committer | Neale Ranns <neale@graphiant.com> | 2021-01-07 15:48:43 +0000 |
commit | e294de6f876587ddc34ab02771771aea60087adc (patch) | |
tree | a68640401fac25d1d137dd119dbb6a03c7938173 /src/vnet/tunnel | |
parent | a9e2774f5561ccb77c8243a196f93f5070f6c5ad (diff) |
ipip: Support MPLS over IP
Type: feature
Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ief1755131297afcaa14fe74fd8dd28c71a92fbe6
Diffstat (limited to 'src/vnet/tunnel')
-rw-r--r-- | src/vnet/tunnel/tunnel_dp.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/vnet/tunnel/tunnel_dp.h b/src/vnet/tunnel/tunnel_dp.h index f84e764f7ea..d6f07b5ec21 100644 --- a/src/vnet/tunnel/tunnel_dp.h +++ b/src/vnet/tunnel/tunnel_dp.h @@ -121,6 +121,25 @@ tunnel_encap_fixup_4o6 (tunnel_encap_decap_flags_t flags, } static_always_inline void +tunnel_encap_fixup_mplso6 (tunnel_encap_decap_flags_t flags, + const mpls_unicast_header_t *inner, + ip6_header_t *outer) +{ + if (flags & TUNNEL_ENCAP_DECAP_FLAG_ENCAP_COPY_DSCP) + ip6_set_dscp_network_order (outer, + vnet_mpls_uc_get_exp (inner->label_exp_s_ttl)); +} + +static_always_inline void +tunnel_encap_fixup_mplso4 (tunnel_encap_decap_flags_t flags, + const mpls_unicast_header_t *inner, + ip4_header_t *outer) +{ + if (flags & TUNNEL_ENCAP_DECAP_FLAG_ENCAP_COPY_DSCP) + ip4_header_set_dscp (outer, vnet_mpls_uc_get_exp (inner->label_exp_s_ttl)); +} + +static_always_inline void tunnel_decap_fixup_4o6 (tunnel_encap_decap_flags_t flags, ip4_header_t * inner, const ip6_header_t * outer) { @@ -152,6 +171,20 @@ tunnel_decap_fixup_4o4 (tunnel_encap_decap_flags_t flags, ip4_header_set_ecn_w_chksum (inner, ip4_header_get_ecn (outer)); } +static_always_inline void +tunnel_decap_fixup_mplso6 (tunnel_encap_decap_flags_t flags, + mpls_unicast_header_t *inner, + const ip6_header_t *outer) +{ +} + +static_always_inline void +tunnel_decap_fixup_mplso4 (tunnel_encap_decap_flags_t flags, + mpls_unicast_header_t *inner, + const ip4_header_t *outer) +{ +} + #endif /* |