History

bpf: Add support for reading socket family, type, protocol

Add socket family, type and protocol to bpf_sock allowing bpf programs read-only access. Add __sk_flags_offset[0] to struct sock before the bitfield to programmtically determine the offset of the unsigned int containing protocol and type.

David Ahern committed 9 years ago

Commit aa4c1031 parent ad2805d3 files · +39 −0Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/bpf.h+3−0
@@ -571,6 +571,9 @@ enum bpf_ret_code { · 570 unmodified lines
571 571
572struct bpf_sock {572struct bpf_sock {
573 __u32 bound_dev_if;573 __u32 bound_dev_if;
574 __u32 family;
575 __u32 type;
576 __u32 protocol;
574};577};
575 578
576/* User return codes for XDP prog type.579/* User return codes for XDP prog type.