| .. | .. |
|---|
| 1 | 1 | #include <uapi/linux/bpf.h> |
|---|
| 2 | | -#include "bpf_helpers.h" |
|---|
| 3 | 2 | #include <uapi/linux/in.h> |
|---|
| 4 | 3 | #include <uapi/linux/if.h> |
|---|
| 5 | 4 | #include <uapi/linux/if_ether.h> |
|---|
| 6 | 5 | #include <uapi/linux/ip.h> |
|---|
| 7 | 6 | #include <uapi/linux/ipv6.h> |
|---|
| 8 | 7 | #include <uapi/linux/if_tunnel.h> |
|---|
| 8 | +#include <bpf/bpf_helpers.h> |
|---|
| 9 | +#include "bpf_legacy.h" |
|---|
| 9 | 10 | #define IP_MF 0x2000 |
|---|
| 10 | 11 | #define IP_OFFSET 0x1FFF |
|---|
| 11 | 12 | |
|---|
| .. | .. |
|---|
| 189 | 190 | long bytes; |
|---|
| 190 | 191 | }; |
|---|
| 191 | 192 | |
|---|
| 192 | | -struct bpf_map_def SEC("maps") hash_map = { |
|---|
| 193 | | - .type = BPF_MAP_TYPE_HASH, |
|---|
| 194 | | - .key_size = sizeof(__be32), |
|---|
| 195 | | - .value_size = sizeof(struct pair), |
|---|
| 196 | | - .max_entries = 1024, |
|---|
| 197 | | -}; |
|---|
| 193 | +struct { |
|---|
| 194 | + __uint(type, BPF_MAP_TYPE_HASH); |
|---|
| 195 | + __type(key, __be32); |
|---|
| 196 | + __type(value, struct pair); |
|---|
| 197 | + __uint(max_entries, 1024); |
|---|
| 198 | +} hash_map SEC(".maps"); |
|---|
| 198 | 199 | |
|---|
| 199 | 200 | SEC("socket2") |
|---|
| 200 | 201 | int bpf_prog2(struct __sk_buff *skb) |
|---|