aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/bpf_tracing_net.h
diff options
context:
space:
mode:
authorKuniyuki Iwashima <[email protected]>2022-01-13 00:28:48 +0000
committerAlexei Starovoitov <[email protected]>2022-01-18 23:45:06 +0000
commit7ff8985cc1aa462532f4afa2cc880dfd6892dd68 (patch)
tree526de3f83a63e588c9a32746b0122b4c5b93dab7 /tools/testing/selftests/bpf/progs/bpf_tracing_net.h
parentbpf: Support bpf_(get|set)sockopt() in bpf unix iter. (diff)
downloadkernel-7ff8985cc1aa462532f4afa2cc880dfd6892dd68.tar.gz
kernel-7ff8985cc1aa462532f4afa2cc880dfd6892dd68.zip
selftest/bpf: Test batching and bpf_(get|set)sockopt in bpf unix iter.
This patch adds a test for the batching and bpf_(get|set)sockopt in bpf unix iter. It does the following. 1. Creates an abstract UNIX domain socket 2. Call bpf_setsockopt() 3. Call bpf_getsockopt() and save the value 4. Call setsockopt() 5. Call getsockopt() and save the value 6. Compare the saved values Signed-off-by: Kuniyuki Iwashima <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/bpf_tracing_net.h')
-rw-r--r--tools/testing/selftests/bpf/progs/bpf_tracing_net.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/bpf_tracing_net.h b/tools/testing/selftests/bpf/progs/bpf_tracing_net.h
index e0f42601be9b..1c1289ba5fc5 100644
--- a/tools/testing/selftests/bpf/progs/bpf_tracing_net.h
+++ b/tools/testing/selftests/bpf/progs/bpf_tracing_net.h
@@ -5,6 +5,8 @@
#define AF_INET 2
#define AF_INET6 10
+#define SOL_SOCKET 1
+#define SO_SNDBUF 7
#define __SO_ACCEPTCON (1 << 16)
#define SOL_TCP 6