| .. | .. |
|---|
| 9 | 9 | * would usually be done after doing appropriate checks that indicate |
|---|
| 10 | 10 | * the hosts are far enough away (i.e. large RTT). |
|---|
| 11 | 11 | * |
|---|
| 12 | | - * Use load_sock_ops to load this BPF program. |
|---|
| 12 | + * Use "bpftool cgroup attach $cg sock_ops $prog" to load this BPF program. |
|---|
| 13 | 13 | */ |
|---|
| 14 | 14 | |
|---|
| 15 | 15 | #include <uapi/linux/bpf.h> |
|---|
| .. | .. |
|---|
| 17 | 17 | #include <uapi/linux/if_packet.h> |
|---|
| 18 | 18 | #include <uapi/linux/ip.h> |
|---|
| 19 | 19 | #include <linux/socket.h> |
|---|
| 20 | | -#include "bpf_helpers.h" |
|---|
| 21 | | -#include "bpf_endian.h" |
|---|
| 20 | +#include <bpf/bpf_helpers.h> |
|---|
| 21 | +#include <bpf/bpf_endian.h> |
|---|
| 22 | 22 | |
|---|
| 23 | 23 | #define DEBUG 1 |
|---|
| 24 | | - |
|---|
| 25 | | -#define bpf_printk(fmt, ...) \ |
|---|
| 26 | | -({ \ |
|---|
| 27 | | - char ____fmt[] = fmt; \ |
|---|
| 28 | | - bpf_trace_printk(____fmt, sizeof(____fmt), \ |
|---|
| 29 | | - ##__VA_ARGS__); \ |
|---|
| 30 | | -}) |
|---|
| 31 | 24 | |
|---|
| 32 | 25 | SEC("sockops") |
|---|
| 33 | 26 | int bpf_iw(struct bpf_sock_ops *skops) |
|---|