authorgravatar for tw19881113@gmail.comTw <tw19881113@gmail.com> 2024-07-08 15:19:32+08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-07-09 17:16:51-04:00
log49f2cca872c24d617082e9b21cbd8ac50e96bc50
tree5685b286c0379ba323ac0cca7675b51e3a14a65f
parent1824bee579fffad3f17b639ebb1a94fd890ad68d

bpf: sync map/prog/attach type with latest linux kernel

Note that the original `cgroup_storage` MapType has been deprecated, so renamed to `cgroup_storage_deprecated`. Signed-off-by: Tw <tw19881113@gmail.com>

1 files changed, 29 insertions(+), 1 deletions(-)

lib/std/os/linux/bpf.zig+29-1
...@@ -1001,7 +1001,7 @@ pub const MapType = enum(u32) {...@@ -1001,7 +1001,7 @@ pub const MapType = enum(u32) {
1001 cpumap,1001 cpumap,
1002 xskmap,1002 xskmap,
1003 sockhash,1003 sockhash,
1004 cgroup_storage,1004 cgroup_storage_deprecated,
1005 reuseport_sockarray,1005 reuseport_sockarray,
1006 percpu_cgroup_storage,1006 percpu_cgroup_storage,
1007 queue,1007 queue,
...@@ -1044,6 +1044,12 @@ pub const MapType = enum(u32) {...@@ -1044,6 +1044,12 @@ pub const MapType = enum(u32) {
1044 /// value size: 01044 /// value size: 0
1045 /// max entries: size of ringbuf, must be power of 21045 /// max entries: size of ringbuf, must be power of 2
1046 ringbuf,1046 ringbuf,
1047 inode_storage,
1048 task_storage,
1049 bloom_filter,
1050 user_ringbuf,
1051 cgroup_storage,
1052 arena,
10471053
1048 _,1054 _,
1049};1055};
...@@ -1144,6 +1150,9 @@ pub const ProgType = enum(u32) {...@@ -1144,6 +1150,9 @@ pub const ProgType = enum(u32) {
1144 /// context type: void *1150 /// context type: void *
1145 syscall,1151 syscall,
11461152
1153 /// context type: bpf_nf_ctx
1154 netfilter,
1155
1147 _,1156 _,
1148};1157};
11491158
...@@ -1186,6 +1195,25 @@ pub const AttachType = enum(u32) {...@@ -1186,6 +1195,25 @@ pub const AttachType = enum(u32) {
1186 xdp_cpumap,1195 xdp_cpumap,
1187 sk_lookup,1196 sk_lookup,
1188 xdp,1197 xdp,
1198 sk_skb_verdict,
1199 sk_reuseport_select,
1200 sk_reuseport_select_or_migrate,
1201 perf_event,
1202 trace_kprobe_multi,
1203 lsm_cgroup,
1204 struct_ops,
1205 netfilter,
1206 tcx_ingress,
1207 tcx_egress,
1208 trace_uprobe_multi,
1209 cgroup_unix_connect,
1210 cgroup_unix_sendmsg,
1211 cgroup_unix_recvmsg,
1212 cgroup_unix_getpeername,
1213 cgroup_unix_getsockname,
1214 netkit_primary,
1215 netkit_peer,
1216 trace_kprobe_session,
1189 _,1217 _,
1190};1218};
11911219