From a91cb45909642978592c7e21a8f6d2da2e44e506 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Thu, 4 Feb 2021 11:02:52 +0000 Subject: tunnel: support copying TTL and flow label from inner to outer Type: feature The added functionality is to support copying TTL and flow label from inner to outer. The .api was extened to support expressing this and also adding a common tunnel endpoint type. i find it best to make API changes in one patch so there are less versions of the API. Signed-off-by: Neale Ranns Change-Id: I755c1e3f4c475058792af39c1abeda92129efb76 --- src/vnet/ip/ip4_packet.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/vnet/ip/ip4_packet.h') diff --git a/src/vnet/ip/ip4_packet.h b/src/vnet/ip/ip4_packet.h index 06530926120..513a7449b54 100644 --- a/src/vnet/ip/ip4_packet.h +++ b/src/vnet/ip/ip4_packet.h @@ -359,6 +359,18 @@ ip4_header_get_ecn (const ip4_header_t * ip4) return (ip4->tos & IP_PACKET_TC_FIELD_ECN_MASK); } +always_inline u8 +ip4_header_get_ttl (const ip4_header_t *ip4) +{ + return (ip4->ttl); +} + +always_inline void +ip4_header_set_ttl (ip4_header_t *ip4, u8 ttl) +{ + ip4->ttl = ttl; +} + always_inline void ip4_header_set_df (ip4_header_t * ip4) { -- cgit 1.2.3-korg