hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/samples/bpf/tcp_rwnd_kern.c
....@@ -8,7 +8,7 @@
88 * and the first 5.5 bytes of the IPv6 addresses are not the same (in this
99 * example that means both hosts are not 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_rwnd(struct bpf_sock_ops *skops)