Skip to content

Commit aa6ab64

Browse files
fomichevAlexei Starovoitov
authored andcommitted
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>
1 parent 0d01da6 commit aa6ab64

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

  • tools/include/uapi/linux

‎tools/include/uapi/linux/bpf.h‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ enum bpf_prog_type {
170170
BPF_PROG_TYPE_FLOW_DISSECTOR,
171171
BPF_PROG_TYPE_CGROUP_SYSCTL,
172172
BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE,
173+
BPF_PROG_TYPE_CGROUP_SOCKOPT,
173174
};
174175

175176
enum bpf_attach_type {
@@ -194,6 +195,8 @@ enum bpf_attach_type {
194195
BPF_CGROUP_SYSCTL,
195196
BPF_CGROUP_UDP4_RECVMSG,
196197
BPF_CGROUP_UDP6_RECVMSG,
198+
BPF_CGROUP_GETSOCKOPT,
199+
BPF_CGROUP_SETSOCKOPT,
197200
__MAX_BPF_ATTACH_TYPE
198201
};
199202

@@ -3541,4 +3544,15 @@ struct bpf_sysctl {
35413544
*/
35423545
};
35433546

3547+
struct bpf_sockopt {
3548+
__bpf_md_ptr(struct bpf_sock *, sk);
3549+
__bpf_md_ptr(void *, optval);
3550+
__bpf_md_ptr(void *, optval_end);
3551+
3552+
__s32 level;
3553+
__s32 optname;
3554+
__s32 optlen;
3555+
__s32 retval;
3556+
};
3557+
35443558
#endif /* _UAPI__LINUX_BPF_H__ */

0 commit comments

Comments
 (0)