summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip6.h
diff options
context:
space:
mode:
authorTarun Gupta <tarungup@cisco.com>2019-11-04 16:35:59 -0800
committerFlorin Coras <florin.coras@gmail.com>2019-11-06 00:42:41 +0000
commit2089c69efbc4ae5c64cab8a5418187b21478987a (patch)
treeeefd1469bf359d3e176e8ae352ec78c395dbc4aa /src/vnet/ip/ip6.h
parentead1e536d66d83b546528c32e2112085a97c8e13 (diff)
tcp: IPv6 flow label support
Type:feature For cases when proxy is in use IPv6 flow label received in origin pkt needs to be added to ipv6 header of outgoing pkts from proxy to original destination and vice versa. Signed-off-by: Tarun Gupta <tarungup@cisco.com> Change-Id: I143f7e67237c0f865333078628a016b50ad5e630 Signed-off-by: Tarun Gupta <tarungup@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip6.h')
-rw-r--r--src/vnet/ip/ip6.h29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/vnet/ip/ip6.h b/src/vnet/ip/ip6.h
index 94c5080a0aa..28b1af749f6 100644
--- a/src/vnet/ip/ip6.h
+++ b/src/vnet/ip/ip6.h
@@ -655,21 +655,23 @@ void ip6_hbh_set_next_override (uword next);
* @param src - source IP
* @param dst - destination IP
* @param prot - payload proto
+ * @param flow_label - flow label
*
* @return - pointer to start of IP header
*/
always_inline void *
-vlib_buffer_push_ip6 (vlib_main_t * vm, vlib_buffer_t * b,
- ip6_address_t * src, ip6_address_t * dst, int proto)
+vlib_buffer_push_ip6_custom (vlib_main_t * vm, vlib_buffer_t * b,
+ ip6_address_t * src, ip6_address_t * dst,
+ int proto, u32 flow_label)
{
ip6_header_t *ip6h;
u16 payload_length;
/* make some room */
ip6h = vlib_buffer_push_uninit (b, sizeof (ip6_header_t));
-
+ ASSERT (flow_label < 1 << 20);
ip6h->ip_version_traffic_class_and_flow_label =
- clib_host_to_net_u32 (0x6 << 28);
+ clib_host_to_net_u32 ((0x6 << 28) | flow_label);
/* calculate ip6 payload length */
payload_length = vlib_buffer_length_in_chain (vm, b);
@@ -689,6 +691,25 @@ vlib_buffer_push_ip6 (vlib_main_t * vm, vlib_buffer_t * b,
return ip6h;
}
+/**
+ * Push IPv6 header to buffer
+ *
+ * @param vm - vlib_main
+ * @param b - buffer to write the header to
+ * @param src - source IP
+ * @param dst - destination IP
+ * @param prot - payload proto
+ *
+ * @return - pointer to start of IP header
+ */
+always_inline void *
+vlib_buffer_push_ip6 (vlib_main_t * vm, vlib_buffer_t * b,
+ ip6_address_t * src, ip6_address_t * dst, int proto)
+{
+ return vlib_buffer_push_ip6_custom (vm, b, src, dst, proto,
+ 0 /* flow label */ );
+
+}
#endif /* included_ip_ip6_h */
/*