Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bpf: sync bpf.h to tools/

Export new prog type and hook points to the libbpf.

Cc: Andrii Nakryiko <andriin@fb.com>
Cc: Martin Lau <kafai@fb.com>
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Stanislav Fomichev and committed by
Alexei Starovoitov
aa6ab647 0d01da6a

+14
+14
tools/include/uapi/linux/bpf.h
··· 170 170 BPF_PROG_TYPE_FLOW_DISSECTOR, 171 171 BPF_PROG_TYPE_CGROUP_SYSCTL, 172 172 BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE, 173 + BPF_PROG_TYPE_CGROUP_SOCKOPT, 173 174 }; 174 175 175 176 enum bpf_attach_type { ··· 195 194 BPF_CGROUP_SYSCTL, 196 195 BPF_CGROUP_UDP4_RECVMSG, 197 196 BPF_CGROUP_UDP6_RECVMSG, 197 + BPF_CGROUP_GETSOCKOPT, 198 + BPF_CGROUP_SETSOCKOPT, 198 199 __MAX_BPF_ATTACH_TYPE 199 200 }; 200 201 ··· 3542 3539 __u32 file_pos; /* Sysctl file position to read from, write to. 3543 3540 * Allows 1,2,4-byte read an 4-byte write. 3544 3541 */ 3542 + }; 3543 + 3544 + struct bpf_sockopt { 3545 + __bpf_md_ptr(struct bpf_sock *, sk); 3546 + __bpf_md_ptr(void *, optval); 3547 + __bpf_md_ptr(void *, optval_end); 3548 + 3549 + __s32 level; 3550 + __s32 optname; 3551 + __s32 optlen; 3552 + __s32 retval; 3545 3553 }; 3546 3554 3547 3555 #endif /* _UAPI__LINUX_BPF_H__ */