hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/samples/bpf/sockex1_kern.c
....@@ -2,14 +2,15 @@
22 #include <uapi/linux/if_ether.h>
33 #include <uapi/linux/if_packet.h>
44 #include <uapi/linux/ip.h>
5
-#include "bpf_helpers.h"
5
+#include <bpf/bpf_helpers.h>
6
+#include "bpf_legacy.h"
67
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");
1314
1415 SEC("socket1")
1516 int bpf_prog1(struct __sk_buff *skb)