hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/samples/bpf/tcp_synrto_kern.c
....@@ -8,7 +8,7 @@
88 * and the first 5.5 bytes of the IPv6 addresses are the same (in this example
99 * that means both hosts are in the same datacenter).
1010 *
11
- * Use load_sock_ops to load this BPF program.
11
+ * Use "bpftool cgroup attach $cg sock_ops $prog" to load this BPF program.
1212 */
1313
1414 #include <uapi/linux/bpf.h>
....@@ -16,17 +16,10 @@
1616 #include <uapi/linux/if_packet.h>
1717 #include <uapi/linux/ip.h>
1818 #include <linux/socket.h>
19
-#include "bpf_helpers.h"
20
-#include "bpf_endian.h"
19
+#include <bpf/bpf_helpers.h>
20
+#include <bpf/bpf_endian.h>
2121
2222 #define DEBUG 1
23
-
24
-#define bpf_printk(fmt, ...) \
25
-({ \
26
- char ____fmt[] = fmt; \
27
- bpf_trace_printk(____fmt, sizeof(____fmt), \
28
- ##__VA_ARGS__); \
29
-})
3023
3124 SEC("sockops")
3225 int bpf_synrto(struct bpf_sock_ops *skops)