aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/test_iptunnel_common.h
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@fb.com>2017-03-30 21:45:42 -0700
committerDavid S. Miller <davem@davemloft.net>2017-04-01 12:45:57 -0700
commit8d48f5e427923fa6f6482c716082d310b7f3bcd5 (patch)
tree99977dea886502e8240b4030b5b29512d9827458 /tools/testing/selftests/bpf/test_iptunnel_common.h
parentselftests/bpf: add a test for overlapping packet range checks (diff)
downloadlinux-dev-8d48f5e427923fa6f6482c716082d310b7f3bcd5.tar.xz
linux-dev-8d48f5e427923fa6f6482c716082d310b7f3bcd5.zip
selftests/bpf: add a test for basic XDP functionality
add C test for xdp_adjust_head(), packet rewrite and map lookups Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/bpf/test_iptunnel_common.h')
-rw-r--r--tools/testing/selftests/bpf/test_iptunnel_common.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/test_iptunnel_common.h b/tools/testing/selftests/bpf/test_iptunnel_common.h
new file mode 100644
index 000000000000..e4cd252a1b20
--- /dev/null
+++ b/tools/testing/selftests/bpf/test_iptunnel_common.h
@@ -0,0 +1,37 @@
+/* Copyright (c) 2016 Facebook
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ */
+#ifndef _TEST_IPTNL_COMMON_H
+#define _TEST_IPTNL_COMMON_H
+
+#include <linux/types.h>
+
+#define MAX_IPTNL_ENTRIES 256U
+
+struct vip {
+ union {
+ __u32 v6[4];
+ __u32 v4;
+ } daddr;
+ __u16 dport;
+ __u16 family;
+ __u8 protocol;
+};
+
+struct iptnl_info {
+ union {
+ __u32 v6[4];
+ __u32 v4;
+ } saddr;
+ union {
+ __u32 v6[4];
+ __u32 v4;
+ } daddr;
+ __u16 family;
+ __u8 dmac[6];
+};
+
+#endif