aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip.h
diff options
context:
space:
mode:
authorNick Zavaritsky <nick.zavaritsky@emnify.com>2020-02-27 15:54:58 +0000
committerJohn Lo <loj@cisco.com>2020-03-03 16:15:15 +0000
commit27518c2ffd0ef75e973a64870da0e3339f39ccce (patch)
tree3fb7afdb06963ae3ef36cc74bfe33e10b8668d5d /src/vnet/ip/ip.h
parent297d288ed653abac9d719013c4ead5215230e7da (diff)
geneve gtpu vxlan vxlan-gpe: VRF-aware bypass node
Bypass node MUST NOT intercept a packet if destination IP doesn’t match a local address. However IP address interpretation depends on the VRF, hence bypass node must take that into account. This patch also factors-out common VTEP management and checking code. Type: improvement Signed-off-by: Nick Zavaritsky <nick.zavaritsky@emnify.com> Change-Id: I5665d94882bbf45d15f8da140c7ada528ec7fa94
Diffstat (limited to 'src/vnet/ip/ip.h')
-rw-r--r--src/vnet/ip/ip.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vnet/ip/ip.h b/src/vnet/ip/ip.h
index 040e580c3a1..75750c5a192 100644
--- a/src/vnet/ip/ip.h
+++ b/src/vnet/ip/ip.h
@@ -289,6 +289,15 @@ void ip6_prefix_max_address_host_order (ip6_address_t * ip, u8 plen,
void ip6_preflen_to_mask (u8 pref_len, ip6_address_t * mask);
u32 ip6_mask_to_preflen (ip6_address_t * mask);
+always_inline u32 vlib_buffer_get_ip4_fib_index (vlib_buffer_t * b);
+always_inline u32 vlib_buffer_get_ip6_fib_index (vlib_buffer_t * b);
+always_inline u32
+vlib_buffer_get_ip_fib_index (vlib_buffer_t * b, u8 is_ip4)
+{
+ return (is_ip4 ? vlib_buffer_get_ip4_fib_index
+ : vlib_buffer_get_ip6_fib_index) (b);
+}
+
#endif /* included_ip_main_h */
/*