| .. | .. |
|---|
| 2 | 2 | #include <uapi/linux/if_ether.h> |
|---|
| 3 | 3 | #include <uapi/linux/if_packet.h> |
|---|
| 4 | 4 | #include <uapi/linux/ip.h> |
|---|
| 5 | | -#include "bpf_helpers.h" |
|---|
| 5 | +#include <bpf/bpf_helpers.h> |
|---|
| 6 | +#include "bpf_legacy.h" |
|---|
| 6 | 7 | |
|---|
| 7 | | -struct bpf_map_def SEC("maps") my_map = { |
|---|
| 8 | | - .type = BPF_MAP_TYPE_ARRAY, |
|---|
| 9 | | - .key_size = sizeof(u32), |
|---|
| 10 | | - .value_size = sizeof(long), |
|---|
| 11 | | - .max_entries = 256, |
|---|
| 12 | | -}; |
|---|
| 8 | +struct { |
|---|
| 9 | + __uint(type, BPF_MAP_TYPE_ARRAY); |
|---|
| 10 | + __type(key, u32); |
|---|
| 11 | + __type(value, long); |
|---|
| 12 | + __uint(max_entries, 256); |
|---|
| 13 | +} my_map SEC(".maps"); |
|---|
| 13 | 14 | |
|---|
| 14 | 15 | SEC("socket1") |
|---|
| 15 | 16 | int bpf_prog1(struct __sk_buff *skb) |
|---|