diff options
author | Neale Ranns <nranns@cisco.com> | 2020-01-02 04:06:10 +0000 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2020-11-02 08:49:08 +0000 |
commit | 041add7d12217494934b651e4e38b5eab5216ddc (patch) | |
tree | 42f6ed8c3e4477b7c7cf93b19f227e4fc0afb4cb /src/vnet/ip/ip6_packet.h | |
parent | 62877029aac3e05a1e1db579aeaad42bca5a70a4 (diff) |
ipsec: Tunnel SA DSCP behaviour
Type: feature
- use tunnel_encap_decap_flags to control the copying of DSCP/ECN/etc
during IPSEC tunnel mode encap.
- use DSCP value to have fixed encap value.
Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: If4f51fd4c1dcbb0422aac9bd078e5c14af5bf11f
Diffstat (limited to 'src/vnet/ip/ip6_packet.h')
-rw-r--r-- | src/vnet/ip/ip6_packet.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/vnet/ip/ip6_packet.h b/src/vnet/ip/ip6_packet.h index 7bbdd197f2f..34bc7a8ec1a 100644 --- a/src/vnet/ip/ip6_packet.h +++ b/src/vnet/ip/ip6_packet.h @@ -310,31 +310,36 @@ typedef struct ip6_address_t src_address, dst_address; } ip6_header_t; +#define IP6_PACKET_TC_MASK 0x0FF00000 +#define IP6_PACKET_DSCP_MASK 0x0FC00000 +#define IP6_PACKET_ECN_MASK 0x00300000 + always_inline ip_dscp_t ip6_traffic_class (const ip6_header_t * i) { - return (i->ip_version_traffic_class_and_flow_label & 0x0FF00000) >> 20; + return (i->ip_version_traffic_class_and_flow_label & IP6_PACKET_TC_MASK) >> + 20; } static_always_inline ip_dscp_t ip6_traffic_class_network_order (const ip6_header_t * ip6) { return (clib_net_to_host_u32 (ip6->ip_version_traffic_class_and_flow_label) - & 0x0ff00000) >> 20; + & IP6_PACKET_TC_MASK) >> 20; } static_always_inline ip_dscp_t ip6_dscp_network_order (const ip6_header_t * ip6) { return (clib_net_to_host_u32 (ip6->ip_version_traffic_class_and_flow_label) - & 0x0fc00000) >> 22; + & IP6_PACKET_DSCP_MASK) >> 22; } static_always_inline ip_ecn_t ip6_ecn_network_order (const ip6_header_t * ip6) { return (clib_net_to_host_u32 (ip6->ip_version_traffic_class_and_flow_label) - & 0x00300000) >> 20; + & IP6_PACKET_ECN_MASK) >> 20; } static_always_inline void |