From 814a1d82905196af2df9803de0083b62f37d703a Mon Sep 17 00:00:00 2001 From: Alex Forster Date: Tue, 4 Jul 2023 16:52:02 -0500 Subject: [PATCH] Release 1.2.0+v1.2.0 --- Cargo.toml | 10 +- src/bindings.rs | 282 +++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 234 insertions(+), 58 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 080aabc..d76c5a4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libbpf-sys" -version = "1.1.1+v1.1.0" +version = "1.2.0+v1.2.0" description = "Rust bindings to libbpf from the Linux kernel" readme = "README.md" repository = "https://github.com/libbpf/libbpf-sys" @@ -21,11 +21,11 @@ github = { repository = "libbpf/libbpf-sys" } maintenance = { status = "passively-maintained" } [build-dependencies] -bindgen = { version = "^0.63", optional = true } -cc = "^1.0.3" -pkg-config = "^0.3.3" +bindgen = { version = "^0.66", optional = true } +cc = "^1.0.79" +pkg-config = "^0.3.27" nix = "^0.26.2" -num_cpus = "^1.15.0" +num_cpus = "^1.16.0" [lib] crate-type = ["lib", "staticlib"] diff --git a/src/bindings.rs b/src/bindings.rs index 99ab8a6..0c307d0 100644 --- a/src/bindings.rs +++ b/src/bindings.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.63.0 */ +/* automatically generated by rust-bindgen 0.66.1 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -127,6 +127,7 @@ pub const PERF_ATTR_SIZE_VER4: u32 = 104; pub const PERF_ATTR_SIZE_VER5: u32 = 112; pub const PERF_ATTR_SIZE_VER6: u32 = 120; pub const PERF_ATTR_SIZE_VER7: u32 = 128; +pub const PERF_ATTR_SIZE_VER8: u32 = 136; pub const PERF_RECORD_MISC_CPUMODE_MASK: u32 = 7; pub const PERF_RECORD_MISC_CPUMODE_UNKNOWN: u32 = 0; pub const PERF_RECORD_MISC_KERNEL: u32 = 1; @@ -290,6 +291,7 @@ pub const BPF_F_TEST_RND_HI32: u32 = 4; pub const BPF_F_TEST_STATE_FREQ: u32 = 8; pub const BPF_F_SLEEPABLE: u32 = 16; pub const BPF_F_XDP_HAS_FRAGS: u32 = 32; +pub const BPF_F_XDP_DEV_BOUND_ONLY: u32 = 64; pub const BPF_F_KPROBE_MULTI_RETURN: u32 = 1; pub const BPF_PSEUDO_MAP_FD: u32 = 1; pub const BPF_PSEUDO_MAP_IDX: u32 = 5; @@ -315,8 +317,8 @@ pub const BTF_MAX_VLEN: u32 = 65535; pub const BTF_INT_SIGNED: u32 = 1; pub const BTF_INT_CHAR: u32 = 2; pub const BTF_INT_BOOL: u32 = 4; -pub const BTF_ELF_SEC: &[u8; 5usize] = b".BTF\0"; -pub const BTF_EXT_ELF_SEC: &[u8; 9usize] = b".BTF.ext\0"; +pub const BTF_ELF_SEC: &[u8; 5] = b".BTF\0"; +pub const BTF_EXT_ELF_SEC: &[u8; 9] = b".BTF.ext\0"; pub type size_t = ::std::os::raw::c_ulong; pub type __pid_t = ::std::os::raw::c_int; pub type __u8 = ::std::os::raw::c_uchar; @@ -543,6 +545,7 @@ pub struct perf_event_attr { pub aux_sample_size: __u32, pub __reserved_3: __u32, pub sig_data: __u64, + pub config3: __u64, } #[repr(C)] #[derive(Copy, Clone)] @@ -2156,7 +2159,8 @@ pub const BPF_SK_REUSEPORT_SELECT_OR_MIGRATE: bpf_attach_type = 40; pub const BPF_PERF_EVENT: bpf_attach_type = 41; pub const BPF_TRACE_KPROBE_MULTI: bpf_attach_type = 42; pub const BPF_LSM_CGROUP: bpf_attach_type = 43; -pub const __MAX_BPF_ATTACH_TYPE: bpf_attach_type = 44; +pub const BPF_STRUCT_OPS: bpf_attach_type = 44; +pub const __MAX_BPF_ATTACH_TYPE: bpf_attach_type = 45; pub type bpf_attach_type = ::std::os::raw::c_uint; pub const BPF_LINK_TYPE_UNSPEC: bpf_link_type = 0; pub const BPF_LINK_TYPE_RAW_TRACEPOINT: bpf_link_type = 1; @@ -2188,6 +2192,7 @@ pub const BPF_F_CLONE: _bindgen_ty_56 = 512; pub const BPF_F_MMAPABLE: _bindgen_ty_56 = 1024; pub const BPF_F_PRESERVE_ELEMS: _bindgen_ty_56 = 2048; pub const BPF_F_INNER_MAP: _bindgen_ty_56 = 4096; +pub const BPF_F_LINK: _bindgen_ty_56 = 8192; pub type _bindgen_ty_56 = ::std::os::raw::c_uint; pub const BPF_STATS_RUN_TIME: bpf_stats_type = 0; pub type bpf_stats_type = ::std::os::raw::c_uint; @@ -2340,7 +2345,7 @@ pub struct bpf_attr__bindgen_ty_4 { pub fd_array: __u64, pub core_relos: __u64, pub core_relo_rec_size: __u32, - pub __bindgen_padding_0: [u8; 4usize], + pub log_true_size: __u32, } #[repr(C)] #[derive(Copy, Clone)] @@ -2470,7 +2475,7 @@ pub struct bpf_attr__bindgen_ty_12 { pub btf_size: __u32, pub btf_log_size: __u32, pub btf_log_level: __u32, - pub __bindgen_padding_0: [u8; 4usize], + pub btf_log_true_size: __u32, } #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -2488,17 +2493,17 @@ pub struct bpf_attr__bindgen_ty_13 { #[repr(C)] #[derive(Copy, Clone)] pub struct bpf_attr__bindgen_ty_14 { - pub prog_fd: __u32, pub __bindgen_anon_1: bpf_attr__bindgen_ty_14__bindgen_ty_1, + pub __bindgen_anon_2: bpf_attr__bindgen_ty_14__bindgen_ty_2, pub attach_type: __u32, pub flags: __u32, - pub __bindgen_anon_2: bpf_attr__bindgen_ty_14__bindgen_ty_2, + pub __bindgen_anon_3: bpf_attr__bindgen_ty_14__bindgen_ty_3, } #[repr(C)] #[derive(Copy, Clone)] pub union bpf_attr__bindgen_ty_14__bindgen_ty_1 { - pub target_fd: __u32, - pub target_ifindex: __u32, + pub prog_fd: __u32, + pub map_fd: __u32, } impl Default for bpf_attr__bindgen_ty_14__bindgen_ty_1 { fn default() -> Self { @@ -2512,27 +2517,42 @@ impl Default for bpf_attr__bindgen_ty_14__bindgen_ty_1 { #[repr(C)] #[derive(Copy, Clone)] pub union bpf_attr__bindgen_ty_14__bindgen_ty_2 { + pub target_fd: __u32, + pub target_ifindex: __u32, +} +impl Default for bpf_attr__bindgen_ty_14__bindgen_ty_2 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union bpf_attr__bindgen_ty_14__bindgen_ty_3 { pub target_btf_id: __u32, - pub __bindgen_anon_1: bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_1, - pub perf_event: bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_2, - pub kprobe_multi: bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_3, - pub tracing: bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_4, + pub __bindgen_anon_1: bpf_attr__bindgen_ty_14__bindgen_ty_3__bindgen_ty_1, + pub perf_event: bpf_attr__bindgen_ty_14__bindgen_ty_3__bindgen_ty_2, + pub kprobe_multi: bpf_attr__bindgen_ty_14__bindgen_ty_3__bindgen_ty_3, + pub tracing: bpf_attr__bindgen_ty_14__bindgen_ty_3__bindgen_ty_4, } #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_1 { +pub struct bpf_attr__bindgen_ty_14__bindgen_ty_3__bindgen_ty_1 { pub iter_info: __u64, pub iter_info_len: __u32, pub __bindgen_padding_0: [u8; 4usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_2 { +pub struct bpf_attr__bindgen_ty_14__bindgen_ty_3__bindgen_ty_2 { pub bpf_cookie: __u64, } #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_3 { +pub struct bpf_attr__bindgen_ty_14__bindgen_ty_3__bindgen_ty_3 { pub flags: __u32, pub cnt: __u32, pub syms: __u64, @@ -2541,12 +2561,12 @@ pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_3 { } #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_4 { +pub struct bpf_attr__bindgen_ty_14__bindgen_ty_3__bindgen_ty_4 { pub target_btf_id: __u32, pub __bindgen_padding_0: [u8; 4usize], pub cookie: __u64, } -impl Default for bpf_attr__bindgen_ty_14__bindgen_ty_2 { +impl Default for bpf_attr__bindgen_ty_14__bindgen_ty_3 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2565,12 +2585,51 @@ impl Default for bpf_attr__bindgen_ty_14 { } } #[repr(C)] -#[derive(Debug, Default, Copy, Clone)] +#[derive(Copy, Clone)] pub struct bpf_attr__bindgen_ty_15 { pub link_fd: __u32, - pub new_prog_fd: __u32, + pub __bindgen_anon_1: bpf_attr__bindgen_ty_15__bindgen_ty_1, pub flags: __u32, + pub __bindgen_anon_2: bpf_attr__bindgen_ty_15__bindgen_ty_2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union bpf_attr__bindgen_ty_15__bindgen_ty_1 { + pub new_prog_fd: __u32, + pub new_map_fd: __u32, +} +impl Default for bpf_attr__bindgen_ty_15__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union bpf_attr__bindgen_ty_15__bindgen_ty_2 { pub old_prog_fd: __u32, + pub old_map_fd: __u32, +} +impl Default for bpf_attr__bindgen_ty_15__bindgen_ty_2 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl Default for bpf_attr__bindgen_ty_15 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } } #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -2862,6 +2921,8 @@ pub const BPF_F_ADJ_ROOM_ENCAP_L4_GRE: _bindgen_ty_68 = 8; pub const BPF_F_ADJ_ROOM_ENCAP_L4_UDP: _bindgen_ty_68 = 16; pub const BPF_F_ADJ_ROOM_NO_CSUM_RESET: _bindgen_ty_68 = 32; pub const BPF_F_ADJ_ROOM_ENCAP_L2_ETH: _bindgen_ty_68 = 64; +pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV4: _bindgen_ty_68 = 128; +pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV6: _bindgen_ty_68 = 256; pub type _bindgen_ty_68 = ::std::os::raw::c_uint; pub const BPF_ADJ_ROOM_ENCAP_L2_MASK: _bindgen_ty_69 = 255; pub const BPF_ADJ_ROOM_ENCAP_L2_SHIFT: _bindgen_ty_69 = 56; @@ -3315,6 +3376,7 @@ pub union bpf_link_info__bindgen_ty_1 { pub iter: bpf_link_info__bindgen_ty_1__bindgen_ty_4, pub netns: bpf_link_info__bindgen_ty_1__bindgen_ty_5, pub xdp: bpf_link_info__bindgen_ty_1__bindgen_ty_6, + pub struct_ops: bpf_link_info__bindgen_ty_1__bindgen_ty_7, } #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -3412,6 +3474,11 @@ pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_5 { pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_6 { pub ifindex: __u32, } +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_7 { + pub map_id: __u32, +} impl Default for bpf_link_info__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -3689,6 +3756,7 @@ pub struct bpf_raw_tracepoint_args { } pub const BPF_FIB_LOOKUP_DIRECT: _bindgen_ty_88 = 1; pub const BPF_FIB_LOOKUP_OUTPUT: _bindgen_ty_88 = 2; +pub const BPF_FIB_LOOKUP_SKIP_NEIGH: _bindgen_ty_88 = 4; pub type _bindgen_ty_88 = ::std::os::raw::c_uint; pub const BPF_FIB_LKUP_RET_SUCCESS: _bindgen_ty_89 = 0; pub const BPF_FIB_LKUP_RET_BLACKHOLE: _bindgen_ty_89 = 1; @@ -3963,6 +4031,48 @@ impl bpf_list_node { } } #[repr(C)] +#[repr(align(8))] +#[derive(Debug, Default, Copy, Clone)] +pub struct bpf_rb_root { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, +} +impl bpf_rb_root { + #[inline] + pub fn new_bitfield_1() -> __BindgenBitfieldUnit<[u8; 16usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 16usize]> = Default::default(); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[repr(align(8))] +#[derive(Debug, Default, Copy, Clone)] +pub struct bpf_rb_node { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 24usize]>, +} +impl bpf_rb_node { + #[inline] + pub fn new_bitfield_1() -> __BindgenBitfieldUnit<[u8; 24usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 24usize]> = Default::default(); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Default, Copy, Clone)] +pub struct bpf_refcount { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +impl bpf_refcount { + #[inline] + pub fn new_bitfield_1() -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit + } +} +#[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct bpf_sysctl { pub write: __u32, @@ -4186,6 +4296,13 @@ impl Default for bpf_core_relo { } } } +pub const BPF_F_TIMER_ABS: _bindgen_ty_92 = 1; +pub type _bindgen_ty_92 = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct bpf_iter_num { + pub __opaque: [__u64; 1usize], +} pub const LIBBPF_STRICT_ALL: libbpf_strict_mode = 4294967295; pub const LIBBPF_STRICT_NONE: libbpf_strict_mode = 0; pub const LIBBPF_STRICT_CLEAN_PTRS: libbpf_strict_mode = 1; @@ -4294,6 +4411,8 @@ pub struct bpf_prog_load_opts { pub log_level: __u32, pub log_size: __u32, pub log_buf: *mut ::std::os::raw::c_char, + pub log_true_size: __u32, + pub __bindgen_padding_1: [u8; 4usize], } impl Default for bpf_prog_load_opts { fn default() -> Self { @@ -4311,7 +4430,7 @@ extern "C" { license: *const ::std::os::raw::c_char, insns: *const bpf_insn, insn_cnt: size_t, - opts: *const bpf_prog_load_opts, + opts: *mut bpf_prog_load_opts, ) -> ::std::os::raw::c_int; } #[repr(C)] @@ -4321,6 +4440,8 @@ pub struct bpf_btf_load_opts { pub log_buf: *mut ::std::os::raw::c_char, pub log_level: __u32, pub log_size: __u32, + pub log_true_size: __u32, + pub __bindgen_padding_0: [u8; 4usize], } impl Default for bpf_btf_load_opts { fn default() -> Self { @@ -4335,7 +4456,7 @@ extern "C" { pub fn bpf_btf_load( btf_data: *const ::std::os::raw::c_void, btf_size: size_t, - opts: *const bpf_btf_load_opts, + opts: *mut bpf_btf_load_opts, ) -> ::std::os::raw::c_int; } extern "C" { @@ -4584,6 +4705,8 @@ pub struct bpf_link_update_opts { pub sz: size_t, pub flags: __u32, pub old_prog_fd: __u32, + pub old_map_fd: __u32, + pub __bindgen_padding_0: [u8; 4usize], } extern "C" { pub fn bpf_link_update( @@ -4686,6 +4809,34 @@ extern "C" { info_len: *mut __u32, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn bpf_prog_get_info_by_fd( + prog_fd: ::std::os::raw::c_int, + info: *mut bpf_prog_info, + info_len: *mut __u32, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn bpf_map_get_info_by_fd( + map_fd: ::std::os::raw::c_int, + info: *mut bpf_map_info, + info_len: *mut __u32, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn bpf_btf_get_info_by_fd( + btf_fd: ::std::os::raw::c_int, + info: *mut bpf_btf_info, + info_len: *mut __u32, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn bpf_link_get_info_by_fd( + link_fd: ::std::os::raw::c_int, + info: *mut bpf_link_info, + info_len: *mut __u32, + ) -> ::std::os::raw::c_int; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct bpf_prog_query_opts { @@ -4838,29 +4989,29 @@ impl Default for btf_type { } } } -pub const BTF_KIND_UNKN: _bindgen_ty_92 = 0; -pub const BTF_KIND_INT: _bindgen_ty_92 = 1; -pub const BTF_KIND_PTR: _bindgen_ty_92 = 2; -pub const BTF_KIND_ARRAY: _bindgen_ty_92 = 3; -pub const BTF_KIND_STRUCT: _bindgen_ty_92 = 4; -pub const BTF_KIND_UNION: _bindgen_ty_92 = 5; -pub const BTF_KIND_ENUM: _bindgen_ty_92 = 6; -pub const BTF_KIND_FWD: _bindgen_ty_92 = 7; -pub const BTF_KIND_TYPEDEF: _bindgen_ty_92 = 8; -pub const BTF_KIND_VOLATILE: _bindgen_ty_92 = 9; -pub const BTF_KIND_CONST: _bindgen_ty_92 = 10; -pub const BTF_KIND_RESTRICT: _bindgen_ty_92 = 11; -pub const BTF_KIND_FUNC: _bindgen_ty_92 = 12; -pub const BTF_KIND_FUNC_PROTO: _bindgen_ty_92 = 13; -pub const BTF_KIND_VAR: _bindgen_ty_92 = 14; -pub const BTF_KIND_DATASEC: _bindgen_ty_92 = 15; -pub const BTF_KIND_FLOAT: _bindgen_ty_92 = 16; -pub const BTF_KIND_DECL_TAG: _bindgen_ty_92 = 17; -pub const BTF_KIND_TYPE_TAG: _bindgen_ty_92 = 18; -pub const BTF_KIND_ENUM64: _bindgen_ty_92 = 19; -pub const NR_BTF_KINDS: _bindgen_ty_92 = 20; -pub const BTF_KIND_MAX: _bindgen_ty_92 = 19; -pub type _bindgen_ty_92 = ::std::os::raw::c_uint; +pub const BTF_KIND_UNKN: _bindgen_ty_93 = 0; +pub const BTF_KIND_INT: _bindgen_ty_93 = 1; +pub const BTF_KIND_PTR: _bindgen_ty_93 = 2; +pub const BTF_KIND_ARRAY: _bindgen_ty_93 = 3; +pub const BTF_KIND_STRUCT: _bindgen_ty_93 = 4; +pub const BTF_KIND_UNION: _bindgen_ty_93 = 5; +pub const BTF_KIND_ENUM: _bindgen_ty_93 = 6; +pub const BTF_KIND_FWD: _bindgen_ty_93 = 7; +pub const BTF_KIND_TYPEDEF: _bindgen_ty_93 = 8; +pub const BTF_KIND_VOLATILE: _bindgen_ty_93 = 9; +pub const BTF_KIND_CONST: _bindgen_ty_93 = 10; +pub const BTF_KIND_RESTRICT: _bindgen_ty_93 = 11; +pub const BTF_KIND_FUNC: _bindgen_ty_93 = 12; +pub const BTF_KIND_FUNC_PROTO: _bindgen_ty_93 = 13; +pub const BTF_KIND_VAR: _bindgen_ty_93 = 14; +pub const BTF_KIND_DATASEC: _bindgen_ty_93 = 15; +pub const BTF_KIND_FLOAT: _bindgen_ty_93 = 16; +pub const BTF_KIND_DECL_TAG: _bindgen_ty_93 = 17; +pub const BTF_KIND_TYPE_TAG: _bindgen_ty_93 = 18; +pub const BTF_KIND_ENUM64: _bindgen_ty_93 = 19; +pub const NR_BTF_KINDS: _bindgen_ty_93 = 20; +pub const BTF_KIND_MAX: _bindgen_ty_93 = 19; +pub type _bindgen_ty_93 = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct btf_enum { @@ -4887,10 +5038,10 @@ pub struct btf_param { pub name_off: __u32, pub type_: __u32, } -pub const BTF_VAR_STATIC: _bindgen_ty_93 = 0; -pub const BTF_VAR_GLOBAL_ALLOCATED: _bindgen_ty_93 = 1; -pub const BTF_VAR_GLOBAL_EXTERN: _bindgen_ty_93 = 2; -pub type _bindgen_ty_93 = ::std::os::raw::c_uint; +pub const BTF_VAR_STATIC: _bindgen_ty_94 = 0; +pub const BTF_VAR_GLOBAL_ALLOCATED: _bindgen_ty_94 = 1; +pub const BTF_VAR_GLOBAL_EXTERN: _bindgen_ty_94 = 2; +pub type _bindgen_ty_94 = ::std::os::raw::c_uint; pub const BTF_FUNC_STATIC: btf_func_linkage = 0; pub const BTF_FUNC_GLOBAL: btf_func_linkage = 1; pub const BTF_FUNC_EXTERN: btf_func_linkage = 2; @@ -5457,7 +5608,7 @@ extern "C" { pub fn bpf_object__load(obj: *mut bpf_object) -> ::std::os::raw::c_int; } extern "C" { - pub fn bpf_object__close(object: *mut bpf_object); + pub fn bpf_object__close(obj: *mut bpf_object); } extern "C" { pub fn bpf_object__pin_maps( @@ -5645,6 +5796,8 @@ extern "C" { pub struct bpf_perf_event_opts { pub sz: size_t, pub bpf_cookie: __u64, + pub force_ioctl_attach: bool, + pub __bindgen_padding_0: [u8; 7usize], } extern "C" { pub fn bpf_program__attach_perf_event( @@ -5659,14 +5812,29 @@ extern "C" { opts: *const bpf_perf_event_opts, ) -> *mut bpf_link; } +pub const PROBE_ATTACH_MODE_DEFAULT: probe_attach_mode = 0; +pub const PROBE_ATTACH_MODE_LEGACY: probe_attach_mode = 1; +pub const PROBE_ATTACH_MODE_PERF: probe_attach_mode = 2; +pub const PROBE_ATTACH_MODE_LINK: probe_attach_mode = 3; +pub type probe_attach_mode = ::std::os::raw::c_uint; #[repr(C)] -#[derive(Debug, Default, Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_kprobe_opts { pub sz: size_t, pub bpf_cookie: __u64, pub offset: size_t, pub retprobe: bool, - pub __bindgen_padding_0: [u8; 7usize], + pub __bindgen_padding_0: [u8; 3usize], + pub attach_mode: probe_attach_mode, +} +impl Default for bpf_kprobe_opts { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } } extern "C" { pub fn bpf_program__attach_kprobe( @@ -5733,6 +5901,8 @@ pub struct bpf_uprobe_opts { pub retprobe: bool, pub __bindgen_padding_0: [u8; 7usize], pub func_name: *const ::std::os::raw::c_char, + pub attach_mode: probe_attach_mode, + pub __bindgen_padding_1: [u8; 4usize], } impl Default for bpf_uprobe_opts { fn default() -> Self { @@ -5850,6 +6020,9 @@ extern "C" { extern "C" { pub fn bpf_map__attach_struct_ops(map: *const bpf_map) -> *mut bpf_link; } +extern "C" { + pub fn bpf_link__update_map(link: *mut bpf_link, map: *const bpf_map) -> ::std::os::raw::c_int; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct bpf_iter_attach_opts { @@ -6134,6 +6307,7 @@ pub struct bpf_xdp_query_opts { pub skb_prog_id: __u32, pub attach_mode: __u8, pub __bindgen_padding_0: [u8; 7usize], + pub feature_flags: __u64, } extern "C" { pub fn bpf_xdp_attach( @@ -6286,6 +6460,8 @@ pub type perf_buffer_lost_fn = ::std::option::Option< #[derive(Debug, Default, Copy, Clone)] pub struct perf_buffer_opts { pub sz: size_t, + pub sample_period: __u32, + pub __bindgen_padding_0: [u8; 4usize], } extern "C" { pub fn perf_buffer__new(