From 23e7c65244a2c993d2a9cba84c916b1f1197c7f0 Mon Sep 17 00:00:00 2001 From: Tuetuopay Date: Fri, 24 Feb 2023 00:24:17 +0100 Subject: [PATCH 1/7] xtask: generate userspace bindings for bpf_{cpu,dev}map_val --- xtask/src/codegen/aya.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xtask/src/codegen/aya.rs b/xtask/src/codegen/aya.rs index 6628e772..6758eed4 100644 --- a/xtask/src/codegen/aya.rs +++ b/xtask/src/codegen/aya.rs @@ -72,6 +72,8 @@ fn codegen_bindings(opts: &Options) -> Result<(), anyhow::Error> { "bpf_func_info", "bpf_line_info", "bpf_lpm_trie_key", + "bpf_cpumap_val", + "bpf_devmap_val", // BTF "btf_header", "btf_ext_info", From 24f15ea25f413633f8c498ee5be046e797acebae Mon Sep 17 00:00:00 2001 From: dave-tucker Date: Mon, 6 Mar 2023 18:40:27 +0000 Subject: [PATCH 2/7] [codegen] Update libbpf to a41e6ef3251cba858021b90c33abb9efdb17f575Update libbpf to a41e6ef3251cba858021b90c33abb9efdb17f575 Files changed: M aya-obj/src/generated/btf_internal_bindings.rs M aya-obj/src/generated/linux_bindings_aarch64.rs M aya-obj/src/generated/linux_bindings_armv7.rs M aya-obj/src/generated/linux_bindings_riscv64.rs M aya-obj/src/generated/linux_bindings_x86_64.rs M bpf/aya-bpf-bindings/src/aarch64/bindings.rs M bpf/aya-bpf-bindings/src/armv7/bindings.rs M bpf/aya-bpf-bindings/src/riscv64/bindings.rs M bpf/aya-bpf-bindings/src/x86_64/bindings.rs --- .../src/generated/btf_internal_bindings.rs | 2 +- .../src/generated/linux_bindings_aarch64.rs | 170 +++++++++------- aya-obj/src/generated/linux_bindings_armv7.rs | 170 +++++++++------- .../src/generated/linux_bindings_riscv64.rs | 170 +++++++++------- .../src/generated/linux_bindings_x86_64.rs | 170 +++++++++------- bpf/aya-bpf-bindings/src/aarch64/bindings.rs | 192 +++++++++++------- bpf/aya-bpf-bindings/src/armv7/bindings.rs | 190 ++++++++++------- bpf/aya-bpf-bindings/src/riscv64/bindings.rs | 190 ++++++++++------- bpf/aya-bpf-bindings/src/x86_64/bindings.rs | 190 ++++++++++------- 9 files changed, 854 insertions(+), 590 deletions(-) diff --git a/aya-obj/src/generated/btf_internal_bindings.rs b/aya-obj/src/generated/btf_internal_bindings.rs index 4613224a..b4a231e5 100644 --- a/aya-obj/src/generated/btf_internal_bindings.rs +++ b/aya-obj/src/generated/btf_internal_bindings.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.63.0 */ +/* automatically generated by rust-bindgen 0.64.0 */ pub type __u8 = ::core::ffi::c_uchar; pub type __u16 = ::core::ffi::c_ushort; diff --git a/aya-obj/src/generated/linux_bindings_aarch64.rs b/aya-obj/src/generated/linux_bindings_aarch64.rs index 244910f6..c2b201e5 100644 --- a/aya-obj/src/generated/linux_bindings_aarch64.rs +++ b/aya-obj/src/generated/linux_bindings_aarch64.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.63.0 */ +/* automatically generated by rust-bindgen 0.64.0 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -132,6 +132,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; @@ -754,6 +755,8 @@ pub const BPF_F_ADJ_ROOM_ENCAP_L4_GRE: _bindgen_ty_15 = 8; pub const BPF_F_ADJ_ROOM_ENCAP_L4_UDP: _bindgen_ty_15 = 16; pub const BPF_F_ADJ_ROOM_NO_CSUM_RESET: _bindgen_ty_15 = 32; pub const BPF_F_ADJ_ROOM_ENCAP_L2_ETH: _bindgen_ty_15 = 64; +pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV4: _bindgen_ty_15 = 128; +pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV6: _bindgen_ty_15 = 256; pub type _bindgen_ty_15 = ::core::ffi::c_uint; pub const BPF_F_SYSCTL_BASE_NAME: _bindgen_ty_17 = 1; pub type _bindgen_ty_17 = ::core::ffi::c_uint; @@ -769,6 +772,30 @@ pub const BPF_F_BROADCAST: _bindgen_ty_25 = 8; pub const BPF_F_EXCLUDE_INGRESS: _bindgen_ty_25 = 16; pub type _bindgen_ty_25 = ::core::ffi::c_uint; #[repr(C)] +#[derive(Copy, Clone)] +pub struct bpf_devmap_val { + pub ifindex: __u32, + pub bpf_prog: bpf_devmap_val__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union bpf_devmap_val__bindgen_ty_1 { + pub fd: ::core::ffi::c_int, + pub id: __u32, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct bpf_cpumap_val { + pub qsize: __u32, + pub bpf_prog: bpf_cpumap_val__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union bpf_cpumap_val__bindgen_ty_1 { + pub fd: ::core::ffi::c_int, + pub id: __u32, +} +#[repr(C)] #[derive(Debug, Copy, Clone)] pub struct bpf_prog_info { pub type_: __u32, @@ -969,6 +996,8 @@ pub struct bpf_line_info { pub line_off: __u32, pub line_col: __u32, } +pub const BPF_F_TIMER_ABS: _bindgen_ty_39 = 1; +pub type _bindgen_ty_39 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct btf_header { @@ -994,29 +1023,29 @@ pub union btf_type__bindgen_ty_1 { pub size: __u32, pub type_: __u32, } -pub const BTF_KIND_UNKN: _bindgen_ty_39 = 0; -pub const BTF_KIND_INT: _bindgen_ty_39 = 1; -pub const BTF_KIND_PTR: _bindgen_ty_39 = 2; -pub const BTF_KIND_ARRAY: _bindgen_ty_39 = 3; -pub const BTF_KIND_STRUCT: _bindgen_ty_39 = 4; -pub const BTF_KIND_UNION: _bindgen_ty_39 = 5; -pub const BTF_KIND_ENUM: _bindgen_ty_39 = 6; -pub const BTF_KIND_FWD: _bindgen_ty_39 = 7; -pub const BTF_KIND_TYPEDEF: _bindgen_ty_39 = 8; -pub const BTF_KIND_VOLATILE: _bindgen_ty_39 = 9; -pub const BTF_KIND_CONST: _bindgen_ty_39 = 10; -pub const BTF_KIND_RESTRICT: _bindgen_ty_39 = 11; -pub const BTF_KIND_FUNC: _bindgen_ty_39 = 12; -pub const BTF_KIND_FUNC_PROTO: _bindgen_ty_39 = 13; -pub const BTF_KIND_VAR: _bindgen_ty_39 = 14; -pub const BTF_KIND_DATASEC: _bindgen_ty_39 = 15; -pub const BTF_KIND_FLOAT: _bindgen_ty_39 = 16; -pub const BTF_KIND_DECL_TAG: _bindgen_ty_39 = 17; -pub const BTF_KIND_TYPE_TAG: _bindgen_ty_39 = 18; -pub const BTF_KIND_ENUM64: _bindgen_ty_39 = 19; -pub const NR_BTF_KINDS: _bindgen_ty_39 = 20; -pub const BTF_KIND_MAX: _bindgen_ty_39 = 19; -pub type _bindgen_ty_39 = ::core::ffi::c_uint; +pub const BTF_KIND_UNKN: _bindgen_ty_40 = 0; +pub const BTF_KIND_INT: _bindgen_ty_40 = 1; +pub const BTF_KIND_PTR: _bindgen_ty_40 = 2; +pub const BTF_KIND_ARRAY: _bindgen_ty_40 = 3; +pub const BTF_KIND_STRUCT: _bindgen_ty_40 = 4; +pub const BTF_KIND_UNION: _bindgen_ty_40 = 5; +pub const BTF_KIND_ENUM: _bindgen_ty_40 = 6; +pub const BTF_KIND_FWD: _bindgen_ty_40 = 7; +pub const BTF_KIND_TYPEDEF: _bindgen_ty_40 = 8; +pub const BTF_KIND_VOLATILE: _bindgen_ty_40 = 9; +pub const BTF_KIND_CONST: _bindgen_ty_40 = 10; +pub const BTF_KIND_RESTRICT: _bindgen_ty_40 = 11; +pub const BTF_KIND_FUNC: _bindgen_ty_40 = 12; +pub const BTF_KIND_FUNC_PROTO: _bindgen_ty_40 = 13; +pub const BTF_KIND_VAR: _bindgen_ty_40 = 14; +pub const BTF_KIND_DATASEC: _bindgen_ty_40 = 15; +pub const BTF_KIND_FLOAT: _bindgen_ty_40 = 16; +pub const BTF_KIND_DECL_TAG: _bindgen_ty_40 = 17; +pub const BTF_KIND_TYPE_TAG: _bindgen_ty_40 = 18; +pub const BTF_KIND_ENUM64: _bindgen_ty_40 = 19; +pub const NR_BTF_KINDS: _bindgen_ty_40 = 20; +pub const BTF_KIND_MAX: _bindgen_ty_40 = 19; +pub type _bindgen_ty_40 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct btf_enum { @@ -1043,10 +1072,10 @@ pub struct btf_param { pub name_off: __u32, pub type_: __u32, } -pub const BTF_VAR_STATIC: _bindgen_ty_40 = 0; -pub const BTF_VAR_GLOBAL_ALLOCATED: _bindgen_ty_40 = 1; -pub const BTF_VAR_GLOBAL_EXTERN: _bindgen_ty_40 = 2; -pub type _bindgen_ty_40 = ::core::ffi::c_uint; +pub const BTF_VAR_STATIC: _bindgen_ty_41 = 0; +pub const BTF_VAR_GLOBAL_ALLOCATED: _bindgen_ty_41 = 1; +pub const BTF_VAR_GLOBAL_EXTERN: _bindgen_ty_41 = 2; +pub type _bindgen_ty_41 = ::core::ffi::c_uint; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum btf_func_linkage { @@ -1197,6 +1226,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)] @@ -2041,17 +2071,17 @@ pub enum perf_event_type { PERF_RECORD_AUX_OUTPUT_HW_ID = 21, PERF_RECORD_MAX = 22, } -pub const IFLA_XDP_UNSPEC: _bindgen_ty_89 = 0; -pub const IFLA_XDP_FD: _bindgen_ty_89 = 1; -pub const IFLA_XDP_ATTACHED: _bindgen_ty_89 = 2; -pub const IFLA_XDP_FLAGS: _bindgen_ty_89 = 3; -pub const IFLA_XDP_PROG_ID: _bindgen_ty_89 = 4; -pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_89 = 5; -pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_89 = 6; -pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_89 = 7; -pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_89 = 8; -pub const __IFLA_XDP_MAX: _bindgen_ty_89 = 9; -pub type _bindgen_ty_89 = ::core::ffi::c_uint; +pub const IFLA_XDP_UNSPEC: _bindgen_ty_90 = 0; +pub const IFLA_XDP_FD: _bindgen_ty_90 = 1; +pub const IFLA_XDP_ATTACHED: _bindgen_ty_90 = 2; +pub const IFLA_XDP_FLAGS: _bindgen_ty_90 = 3; +pub const IFLA_XDP_PROG_ID: _bindgen_ty_90 = 4; +pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_90 = 5; +pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_90 = 6; +pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_90 = 7; +pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_90 = 8; +pub const __IFLA_XDP_MAX: _bindgen_ty_90 = 9; +pub type _bindgen_ty_90 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ifinfomsg { @@ -2073,37 +2103,37 @@ pub struct tcmsg { pub tcm_parent: __u32, pub tcm_info: __u32, } -pub const TCA_UNSPEC: _bindgen_ty_102 = 0; -pub const TCA_KIND: _bindgen_ty_102 = 1; -pub const TCA_OPTIONS: _bindgen_ty_102 = 2; -pub const TCA_STATS: _bindgen_ty_102 = 3; -pub const TCA_XSTATS: _bindgen_ty_102 = 4; -pub const TCA_RATE: _bindgen_ty_102 = 5; -pub const TCA_FCNT: _bindgen_ty_102 = 6; -pub const TCA_STATS2: _bindgen_ty_102 = 7; -pub const TCA_STAB: _bindgen_ty_102 = 8; -pub const TCA_PAD: _bindgen_ty_102 = 9; -pub const TCA_DUMP_INVISIBLE: _bindgen_ty_102 = 10; -pub const TCA_CHAIN: _bindgen_ty_102 = 11; -pub const TCA_HW_OFFLOAD: _bindgen_ty_102 = 12; -pub const TCA_INGRESS_BLOCK: _bindgen_ty_102 = 13; -pub const TCA_EGRESS_BLOCK: _bindgen_ty_102 = 14; -pub const __TCA_MAX: _bindgen_ty_102 = 15; -pub type _bindgen_ty_102 = ::core::ffi::c_uint; -pub const TCA_BPF_UNSPEC: _bindgen_ty_158 = 0; -pub const TCA_BPF_ACT: _bindgen_ty_158 = 1; -pub const TCA_BPF_POLICE: _bindgen_ty_158 = 2; -pub const TCA_BPF_CLASSID: _bindgen_ty_158 = 3; -pub const TCA_BPF_OPS_LEN: _bindgen_ty_158 = 4; -pub const TCA_BPF_OPS: _bindgen_ty_158 = 5; -pub const TCA_BPF_FD: _bindgen_ty_158 = 6; -pub const TCA_BPF_NAME: _bindgen_ty_158 = 7; -pub const TCA_BPF_FLAGS: _bindgen_ty_158 = 8; -pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_158 = 9; -pub const TCA_BPF_TAG: _bindgen_ty_158 = 10; -pub const TCA_BPF_ID: _bindgen_ty_158 = 11; -pub const __TCA_BPF_MAX: _bindgen_ty_158 = 12; -pub type _bindgen_ty_158 = ::core::ffi::c_uint; +pub const TCA_UNSPEC: _bindgen_ty_103 = 0; +pub const TCA_KIND: _bindgen_ty_103 = 1; +pub const TCA_OPTIONS: _bindgen_ty_103 = 2; +pub const TCA_STATS: _bindgen_ty_103 = 3; +pub const TCA_XSTATS: _bindgen_ty_103 = 4; +pub const TCA_RATE: _bindgen_ty_103 = 5; +pub const TCA_FCNT: _bindgen_ty_103 = 6; +pub const TCA_STATS2: _bindgen_ty_103 = 7; +pub const TCA_STAB: _bindgen_ty_103 = 8; +pub const TCA_PAD: _bindgen_ty_103 = 9; +pub const TCA_DUMP_INVISIBLE: _bindgen_ty_103 = 10; +pub const TCA_CHAIN: _bindgen_ty_103 = 11; +pub const TCA_HW_OFFLOAD: _bindgen_ty_103 = 12; +pub const TCA_INGRESS_BLOCK: _bindgen_ty_103 = 13; +pub const TCA_EGRESS_BLOCK: _bindgen_ty_103 = 14; +pub const __TCA_MAX: _bindgen_ty_103 = 15; +pub type _bindgen_ty_103 = ::core::ffi::c_uint; +pub const TCA_BPF_UNSPEC: _bindgen_ty_159 = 0; +pub const TCA_BPF_ACT: _bindgen_ty_159 = 1; +pub const TCA_BPF_POLICE: _bindgen_ty_159 = 2; +pub const TCA_BPF_CLASSID: _bindgen_ty_159 = 3; +pub const TCA_BPF_OPS_LEN: _bindgen_ty_159 = 4; +pub const TCA_BPF_OPS: _bindgen_ty_159 = 5; +pub const TCA_BPF_FD: _bindgen_ty_159 = 6; +pub const TCA_BPF_NAME: _bindgen_ty_159 = 7; +pub const TCA_BPF_FLAGS: _bindgen_ty_159 = 8; +pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_159 = 9; +pub const TCA_BPF_TAG: _bindgen_ty_159 = 10; +pub const TCA_BPF_ID: _bindgen_ty_159 = 11; +pub const __TCA_BPF_MAX: _bindgen_ty_159 = 12; +pub type _bindgen_ty_159 = ::core::ffi::c_uint; pub const AYA_PERF_EVENT_IOC_ENABLE: ::core::ffi::c_int = 9216; pub const AYA_PERF_EVENT_IOC_DISABLE: ::core::ffi::c_int = 9217; pub const AYA_PERF_EVENT_IOC_SET_BPF: ::core::ffi::c_int = 1074013192; diff --git a/aya-obj/src/generated/linux_bindings_armv7.rs b/aya-obj/src/generated/linux_bindings_armv7.rs index 498d2083..1cc59396 100644 --- a/aya-obj/src/generated/linux_bindings_armv7.rs +++ b/aya-obj/src/generated/linux_bindings_armv7.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.63.0 */ +/* automatically generated by rust-bindgen 0.64.0 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -132,6 +132,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; @@ -754,6 +755,8 @@ pub const BPF_F_ADJ_ROOM_ENCAP_L4_GRE: _bindgen_ty_15 = 8; pub const BPF_F_ADJ_ROOM_ENCAP_L4_UDP: _bindgen_ty_15 = 16; pub const BPF_F_ADJ_ROOM_NO_CSUM_RESET: _bindgen_ty_15 = 32; pub const BPF_F_ADJ_ROOM_ENCAP_L2_ETH: _bindgen_ty_15 = 64; +pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV4: _bindgen_ty_15 = 128; +pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV6: _bindgen_ty_15 = 256; pub type _bindgen_ty_15 = ::core::ffi::c_uint; pub const BPF_F_SYSCTL_BASE_NAME: _bindgen_ty_17 = 1; pub type _bindgen_ty_17 = ::core::ffi::c_uint; @@ -769,6 +772,30 @@ pub const BPF_F_BROADCAST: _bindgen_ty_25 = 8; pub const BPF_F_EXCLUDE_INGRESS: _bindgen_ty_25 = 16; pub type _bindgen_ty_25 = ::core::ffi::c_uint; #[repr(C)] +#[derive(Copy, Clone)] +pub struct bpf_devmap_val { + pub ifindex: __u32, + pub bpf_prog: bpf_devmap_val__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union bpf_devmap_val__bindgen_ty_1 { + pub fd: ::core::ffi::c_int, + pub id: __u32, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct bpf_cpumap_val { + pub qsize: __u32, + pub bpf_prog: bpf_cpumap_val__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union bpf_cpumap_val__bindgen_ty_1 { + pub fd: ::core::ffi::c_int, + pub id: __u32, +} +#[repr(C)] #[derive(Debug, Copy, Clone)] pub struct bpf_prog_info { pub type_: __u32, @@ -969,6 +996,8 @@ pub struct bpf_line_info { pub line_off: __u32, pub line_col: __u32, } +pub const BPF_F_TIMER_ABS: _bindgen_ty_39 = 1; +pub type _bindgen_ty_39 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct btf_header { @@ -994,29 +1023,29 @@ pub union btf_type__bindgen_ty_1 { pub size: __u32, pub type_: __u32, } -pub const BTF_KIND_UNKN: _bindgen_ty_39 = 0; -pub const BTF_KIND_INT: _bindgen_ty_39 = 1; -pub const BTF_KIND_PTR: _bindgen_ty_39 = 2; -pub const BTF_KIND_ARRAY: _bindgen_ty_39 = 3; -pub const BTF_KIND_STRUCT: _bindgen_ty_39 = 4; -pub const BTF_KIND_UNION: _bindgen_ty_39 = 5; -pub const BTF_KIND_ENUM: _bindgen_ty_39 = 6; -pub const BTF_KIND_FWD: _bindgen_ty_39 = 7; -pub const BTF_KIND_TYPEDEF: _bindgen_ty_39 = 8; -pub const BTF_KIND_VOLATILE: _bindgen_ty_39 = 9; -pub const BTF_KIND_CONST: _bindgen_ty_39 = 10; -pub const BTF_KIND_RESTRICT: _bindgen_ty_39 = 11; -pub const BTF_KIND_FUNC: _bindgen_ty_39 = 12; -pub const BTF_KIND_FUNC_PROTO: _bindgen_ty_39 = 13; -pub const BTF_KIND_VAR: _bindgen_ty_39 = 14; -pub const BTF_KIND_DATASEC: _bindgen_ty_39 = 15; -pub const BTF_KIND_FLOAT: _bindgen_ty_39 = 16; -pub const BTF_KIND_DECL_TAG: _bindgen_ty_39 = 17; -pub const BTF_KIND_TYPE_TAG: _bindgen_ty_39 = 18; -pub const BTF_KIND_ENUM64: _bindgen_ty_39 = 19; -pub const NR_BTF_KINDS: _bindgen_ty_39 = 20; -pub const BTF_KIND_MAX: _bindgen_ty_39 = 19; -pub type _bindgen_ty_39 = ::core::ffi::c_uint; +pub const BTF_KIND_UNKN: _bindgen_ty_40 = 0; +pub const BTF_KIND_INT: _bindgen_ty_40 = 1; +pub const BTF_KIND_PTR: _bindgen_ty_40 = 2; +pub const BTF_KIND_ARRAY: _bindgen_ty_40 = 3; +pub const BTF_KIND_STRUCT: _bindgen_ty_40 = 4; +pub const BTF_KIND_UNION: _bindgen_ty_40 = 5; +pub const BTF_KIND_ENUM: _bindgen_ty_40 = 6; +pub const BTF_KIND_FWD: _bindgen_ty_40 = 7; +pub const BTF_KIND_TYPEDEF: _bindgen_ty_40 = 8; +pub const BTF_KIND_VOLATILE: _bindgen_ty_40 = 9; +pub const BTF_KIND_CONST: _bindgen_ty_40 = 10; +pub const BTF_KIND_RESTRICT: _bindgen_ty_40 = 11; +pub const BTF_KIND_FUNC: _bindgen_ty_40 = 12; +pub const BTF_KIND_FUNC_PROTO: _bindgen_ty_40 = 13; +pub const BTF_KIND_VAR: _bindgen_ty_40 = 14; +pub const BTF_KIND_DATASEC: _bindgen_ty_40 = 15; +pub const BTF_KIND_FLOAT: _bindgen_ty_40 = 16; +pub const BTF_KIND_DECL_TAG: _bindgen_ty_40 = 17; +pub const BTF_KIND_TYPE_TAG: _bindgen_ty_40 = 18; +pub const BTF_KIND_ENUM64: _bindgen_ty_40 = 19; +pub const NR_BTF_KINDS: _bindgen_ty_40 = 20; +pub const BTF_KIND_MAX: _bindgen_ty_40 = 19; +pub type _bindgen_ty_40 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct btf_enum { @@ -1043,10 +1072,10 @@ pub struct btf_param { pub name_off: __u32, pub type_: __u32, } -pub const BTF_VAR_STATIC: _bindgen_ty_40 = 0; -pub const BTF_VAR_GLOBAL_ALLOCATED: _bindgen_ty_40 = 1; -pub const BTF_VAR_GLOBAL_EXTERN: _bindgen_ty_40 = 2; -pub type _bindgen_ty_40 = ::core::ffi::c_uint; +pub const BTF_VAR_STATIC: _bindgen_ty_41 = 0; +pub const BTF_VAR_GLOBAL_ALLOCATED: _bindgen_ty_41 = 1; +pub const BTF_VAR_GLOBAL_EXTERN: _bindgen_ty_41 = 2; +pub type _bindgen_ty_41 = ::core::ffi::c_uint; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum btf_func_linkage { @@ -1197,6 +1226,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)] @@ -2041,17 +2071,17 @@ pub enum perf_event_type { PERF_RECORD_AUX_OUTPUT_HW_ID = 21, PERF_RECORD_MAX = 22, } -pub const IFLA_XDP_UNSPEC: _bindgen_ty_89 = 0; -pub const IFLA_XDP_FD: _bindgen_ty_89 = 1; -pub const IFLA_XDP_ATTACHED: _bindgen_ty_89 = 2; -pub const IFLA_XDP_FLAGS: _bindgen_ty_89 = 3; -pub const IFLA_XDP_PROG_ID: _bindgen_ty_89 = 4; -pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_89 = 5; -pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_89 = 6; -pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_89 = 7; -pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_89 = 8; -pub const __IFLA_XDP_MAX: _bindgen_ty_89 = 9; -pub type _bindgen_ty_89 = ::core::ffi::c_uint; +pub const IFLA_XDP_UNSPEC: _bindgen_ty_90 = 0; +pub const IFLA_XDP_FD: _bindgen_ty_90 = 1; +pub const IFLA_XDP_ATTACHED: _bindgen_ty_90 = 2; +pub const IFLA_XDP_FLAGS: _bindgen_ty_90 = 3; +pub const IFLA_XDP_PROG_ID: _bindgen_ty_90 = 4; +pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_90 = 5; +pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_90 = 6; +pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_90 = 7; +pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_90 = 8; +pub const __IFLA_XDP_MAX: _bindgen_ty_90 = 9; +pub type _bindgen_ty_90 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ifinfomsg { @@ -2073,37 +2103,37 @@ pub struct tcmsg { pub tcm_parent: __u32, pub tcm_info: __u32, } -pub const TCA_UNSPEC: _bindgen_ty_102 = 0; -pub const TCA_KIND: _bindgen_ty_102 = 1; -pub const TCA_OPTIONS: _bindgen_ty_102 = 2; -pub const TCA_STATS: _bindgen_ty_102 = 3; -pub const TCA_XSTATS: _bindgen_ty_102 = 4; -pub const TCA_RATE: _bindgen_ty_102 = 5; -pub const TCA_FCNT: _bindgen_ty_102 = 6; -pub const TCA_STATS2: _bindgen_ty_102 = 7; -pub const TCA_STAB: _bindgen_ty_102 = 8; -pub const TCA_PAD: _bindgen_ty_102 = 9; -pub const TCA_DUMP_INVISIBLE: _bindgen_ty_102 = 10; -pub const TCA_CHAIN: _bindgen_ty_102 = 11; -pub const TCA_HW_OFFLOAD: _bindgen_ty_102 = 12; -pub const TCA_INGRESS_BLOCK: _bindgen_ty_102 = 13; -pub const TCA_EGRESS_BLOCK: _bindgen_ty_102 = 14; -pub const __TCA_MAX: _bindgen_ty_102 = 15; -pub type _bindgen_ty_102 = ::core::ffi::c_uint; -pub const TCA_BPF_UNSPEC: _bindgen_ty_158 = 0; -pub const TCA_BPF_ACT: _bindgen_ty_158 = 1; -pub const TCA_BPF_POLICE: _bindgen_ty_158 = 2; -pub const TCA_BPF_CLASSID: _bindgen_ty_158 = 3; -pub const TCA_BPF_OPS_LEN: _bindgen_ty_158 = 4; -pub const TCA_BPF_OPS: _bindgen_ty_158 = 5; -pub const TCA_BPF_FD: _bindgen_ty_158 = 6; -pub const TCA_BPF_NAME: _bindgen_ty_158 = 7; -pub const TCA_BPF_FLAGS: _bindgen_ty_158 = 8; -pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_158 = 9; -pub const TCA_BPF_TAG: _bindgen_ty_158 = 10; -pub const TCA_BPF_ID: _bindgen_ty_158 = 11; -pub const __TCA_BPF_MAX: _bindgen_ty_158 = 12; -pub type _bindgen_ty_158 = ::core::ffi::c_uint; +pub const TCA_UNSPEC: _bindgen_ty_103 = 0; +pub const TCA_KIND: _bindgen_ty_103 = 1; +pub const TCA_OPTIONS: _bindgen_ty_103 = 2; +pub const TCA_STATS: _bindgen_ty_103 = 3; +pub const TCA_XSTATS: _bindgen_ty_103 = 4; +pub const TCA_RATE: _bindgen_ty_103 = 5; +pub const TCA_FCNT: _bindgen_ty_103 = 6; +pub const TCA_STATS2: _bindgen_ty_103 = 7; +pub const TCA_STAB: _bindgen_ty_103 = 8; +pub const TCA_PAD: _bindgen_ty_103 = 9; +pub const TCA_DUMP_INVISIBLE: _bindgen_ty_103 = 10; +pub const TCA_CHAIN: _bindgen_ty_103 = 11; +pub const TCA_HW_OFFLOAD: _bindgen_ty_103 = 12; +pub const TCA_INGRESS_BLOCK: _bindgen_ty_103 = 13; +pub const TCA_EGRESS_BLOCK: _bindgen_ty_103 = 14; +pub const __TCA_MAX: _bindgen_ty_103 = 15; +pub type _bindgen_ty_103 = ::core::ffi::c_uint; +pub const TCA_BPF_UNSPEC: _bindgen_ty_159 = 0; +pub const TCA_BPF_ACT: _bindgen_ty_159 = 1; +pub const TCA_BPF_POLICE: _bindgen_ty_159 = 2; +pub const TCA_BPF_CLASSID: _bindgen_ty_159 = 3; +pub const TCA_BPF_OPS_LEN: _bindgen_ty_159 = 4; +pub const TCA_BPF_OPS: _bindgen_ty_159 = 5; +pub const TCA_BPF_FD: _bindgen_ty_159 = 6; +pub const TCA_BPF_NAME: _bindgen_ty_159 = 7; +pub const TCA_BPF_FLAGS: _bindgen_ty_159 = 8; +pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_159 = 9; +pub const TCA_BPF_TAG: _bindgen_ty_159 = 10; +pub const TCA_BPF_ID: _bindgen_ty_159 = 11; +pub const __TCA_BPF_MAX: _bindgen_ty_159 = 12; +pub type _bindgen_ty_159 = ::core::ffi::c_uint; pub const AYA_PERF_EVENT_IOC_ENABLE: ::core::ffi::c_int = 9216; pub const AYA_PERF_EVENT_IOC_DISABLE: ::core::ffi::c_int = 9217; pub const AYA_PERF_EVENT_IOC_SET_BPF: ::core::ffi::c_int = 1074013192; diff --git a/aya-obj/src/generated/linux_bindings_riscv64.rs b/aya-obj/src/generated/linux_bindings_riscv64.rs index 244910f6..c2b201e5 100644 --- a/aya-obj/src/generated/linux_bindings_riscv64.rs +++ b/aya-obj/src/generated/linux_bindings_riscv64.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.63.0 */ +/* automatically generated by rust-bindgen 0.64.0 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -132,6 +132,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; @@ -754,6 +755,8 @@ pub const BPF_F_ADJ_ROOM_ENCAP_L4_GRE: _bindgen_ty_15 = 8; pub const BPF_F_ADJ_ROOM_ENCAP_L4_UDP: _bindgen_ty_15 = 16; pub const BPF_F_ADJ_ROOM_NO_CSUM_RESET: _bindgen_ty_15 = 32; pub const BPF_F_ADJ_ROOM_ENCAP_L2_ETH: _bindgen_ty_15 = 64; +pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV4: _bindgen_ty_15 = 128; +pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV6: _bindgen_ty_15 = 256; pub type _bindgen_ty_15 = ::core::ffi::c_uint; pub const BPF_F_SYSCTL_BASE_NAME: _bindgen_ty_17 = 1; pub type _bindgen_ty_17 = ::core::ffi::c_uint; @@ -769,6 +772,30 @@ pub const BPF_F_BROADCAST: _bindgen_ty_25 = 8; pub const BPF_F_EXCLUDE_INGRESS: _bindgen_ty_25 = 16; pub type _bindgen_ty_25 = ::core::ffi::c_uint; #[repr(C)] +#[derive(Copy, Clone)] +pub struct bpf_devmap_val { + pub ifindex: __u32, + pub bpf_prog: bpf_devmap_val__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union bpf_devmap_val__bindgen_ty_1 { + pub fd: ::core::ffi::c_int, + pub id: __u32, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct bpf_cpumap_val { + pub qsize: __u32, + pub bpf_prog: bpf_cpumap_val__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union bpf_cpumap_val__bindgen_ty_1 { + pub fd: ::core::ffi::c_int, + pub id: __u32, +} +#[repr(C)] #[derive(Debug, Copy, Clone)] pub struct bpf_prog_info { pub type_: __u32, @@ -969,6 +996,8 @@ pub struct bpf_line_info { pub line_off: __u32, pub line_col: __u32, } +pub const BPF_F_TIMER_ABS: _bindgen_ty_39 = 1; +pub type _bindgen_ty_39 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct btf_header { @@ -994,29 +1023,29 @@ pub union btf_type__bindgen_ty_1 { pub size: __u32, pub type_: __u32, } -pub const BTF_KIND_UNKN: _bindgen_ty_39 = 0; -pub const BTF_KIND_INT: _bindgen_ty_39 = 1; -pub const BTF_KIND_PTR: _bindgen_ty_39 = 2; -pub const BTF_KIND_ARRAY: _bindgen_ty_39 = 3; -pub const BTF_KIND_STRUCT: _bindgen_ty_39 = 4; -pub const BTF_KIND_UNION: _bindgen_ty_39 = 5; -pub const BTF_KIND_ENUM: _bindgen_ty_39 = 6; -pub const BTF_KIND_FWD: _bindgen_ty_39 = 7; -pub const BTF_KIND_TYPEDEF: _bindgen_ty_39 = 8; -pub const BTF_KIND_VOLATILE: _bindgen_ty_39 = 9; -pub const BTF_KIND_CONST: _bindgen_ty_39 = 10; -pub const BTF_KIND_RESTRICT: _bindgen_ty_39 = 11; -pub const BTF_KIND_FUNC: _bindgen_ty_39 = 12; -pub const BTF_KIND_FUNC_PROTO: _bindgen_ty_39 = 13; -pub const BTF_KIND_VAR: _bindgen_ty_39 = 14; -pub const BTF_KIND_DATASEC: _bindgen_ty_39 = 15; -pub const BTF_KIND_FLOAT: _bindgen_ty_39 = 16; -pub const BTF_KIND_DECL_TAG: _bindgen_ty_39 = 17; -pub const BTF_KIND_TYPE_TAG: _bindgen_ty_39 = 18; -pub const BTF_KIND_ENUM64: _bindgen_ty_39 = 19; -pub const NR_BTF_KINDS: _bindgen_ty_39 = 20; -pub const BTF_KIND_MAX: _bindgen_ty_39 = 19; -pub type _bindgen_ty_39 = ::core::ffi::c_uint; +pub const BTF_KIND_UNKN: _bindgen_ty_40 = 0; +pub const BTF_KIND_INT: _bindgen_ty_40 = 1; +pub const BTF_KIND_PTR: _bindgen_ty_40 = 2; +pub const BTF_KIND_ARRAY: _bindgen_ty_40 = 3; +pub const BTF_KIND_STRUCT: _bindgen_ty_40 = 4; +pub const BTF_KIND_UNION: _bindgen_ty_40 = 5; +pub const BTF_KIND_ENUM: _bindgen_ty_40 = 6; +pub const BTF_KIND_FWD: _bindgen_ty_40 = 7; +pub const BTF_KIND_TYPEDEF: _bindgen_ty_40 = 8; +pub const BTF_KIND_VOLATILE: _bindgen_ty_40 = 9; +pub const BTF_KIND_CONST: _bindgen_ty_40 = 10; +pub const BTF_KIND_RESTRICT: _bindgen_ty_40 = 11; +pub const BTF_KIND_FUNC: _bindgen_ty_40 = 12; +pub const BTF_KIND_FUNC_PROTO: _bindgen_ty_40 = 13; +pub const BTF_KIND_VAR: _bindgen_ty_40 = 14; +pub const BTF_KIND_DATASEC: _bindgen_ty_40 = 15; +pub const BTF_KIND_FLOAT: _bindgen_ty_40 = 16; +pub const BTF_KIND_DECL_TAG: _bindgen_ty_40 = 17; +pub const BTF_KIND_TYPE_TAG: _bindgen_ty_40 = 18; +pub const BTF_KIND_ENUM64: _bindgen_ty_40 = 19; +pub const NR_BTF_KINDS: _bindgen_ty_40 = 20; +pub const BTF_KIND_MAX: _bindgen_ty_40 = 19; +pub type _bindgen_ty_40 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct btf_enum { @@ -1043,10 +1072,10 @@ pub struct btf_param { pub name_off: __u32, pub type_: __u32, } -pub const BTF_VAR_STATIC: _bindgen_ty_40 = 0; -pub const BTF_VAR_GLOBAL_ALLOCATED: _bindgen_ty_40 = 1; -pub const BTF_VAR_GLOBAL_EXTERN: _bindgen_ty_40 = 2; -pub type _bindgen_ty_40 = ::core::ffi::c_uint; +pub const BTF_VAR_STATIC: _bindgen_ty_41 = 0; +pub const BTF_VAR_GLOBAL_ALLOCATED: _bindgen_ty_41 = 1; +pub const BTF_VAR_GLOBAL_EXTERN: _bindgen_ty_41 = 2; +pub type _bindgen_ty_41 = ::core::ffi::c_uint; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum btf_func_linkage { @@ -1197,6 +1226,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)] @@ -2041,17 +2071,17 @@ pub enum perf_event_type { PERF_RECORD_AUX_OUTPUT_HW_ID = 21, PERF_RECORD_MAX = 22, } -pub const IFLA_XDP_UNSPEC: _bindgen_ty_89 = 0; -pub const IFLA_XDP_FD: _bindgen_ty_89 = 1; -pub const IFLA_XDP_ATTACHED: _bindgen_ty_89 = 2; -pub const IFLA_XDP_FLAGS: _bindgen_ty_89 = 3; -pub const IFLA_XDP_PROG_ID: _bindgen_ty_89 = 4; -pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_89 = 5; -pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_89 = 6; -pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_89 = 7; -pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_89 = 8; -pub const __IFLA_XDP_MAX: _bindgen_ty_89 = 9; -pub type _bindgen_ty_89 = ::core::ffi::c_uint; +pub const IFLA_XDP_UNSPEC: _bindgen_ty_90 = 0; +pub const IFLA_XDP_FD: _bindgen_ty_90 = 1; +pub const IFLA_XDP_ATTACHED: _bindgen_ty_90 = 2; +pub const IFLA_XDP_FLAGS: _bindgen_ty_90 = 3; +pub const IFLA_XDP_PROG_ID: _bindgen_ty_90 = 4; +pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_90 = 5; +pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_90 = 6; +pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_90 = 7; +pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_90 = 8; +pub const __IFLA_XDP_MAX: _bindgen_ty_90 = 9; +pub type _bindgen_ty_90 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ifinfomsg { @@ -2073,37 +2103,37 @@ pub struct tcmsg { pub tcm_parent: __u32, pub tcm_info: __u32, } -pub const TCA_UNSPEC: _bindgen_ty_102 = 0; -pub const TCA_KIND: _bindgen_ty_102 = 1; -pub const TCA_OPTIONS: _bindgen_ty_102 = 2; -pub const TCA_STATS: _bindgen_ty_102 = 3; -pub const TCA_XSTATS: _bindgen_ty_102 = 4; -pub const TCA_RATE: _bindgen_ty_102 = 5; -pub const TCA_FCNT: _bindgen_ty_102 = 6; -pub const TCA_STATS2: _bindgen_ty_102 = 7; -pub const TCA_STAB: _bindgen_ty_102 = 8; -pub const TCA_PAD: _bindgen_ty_102 = 9; -pub const TCA_DUMP_INVISIBLE: _bindgen_ty_102 = 10; -pub const TCA_CHAIN: _bindgen_ty_102 = 11; -pub const TCA_HW_OFFLOAD: _bindgen_ty_102 = 12; -pub const TCA_INGRESS_BLOCK: _bindgen_ty_102 = 13; -pub const TCA_EGRESS_BLOCK: _bindgen_ty_102 = 14; -pub const __TCA_MAX: _bindgen_ty_102 = 15; -pub type _bindgen_ty_102 = ::core::ffi::c_uint; -pub const TCA_BPF_UNSPEC: _bindgen_ty_158 = 0; -pub const TCA_BPF_ACT: _bindgen_ty_158 = 1; -pub const TCA_BPF_POLICE: _bindgen_ty_158 = 2; -pub const TCA_BPF_CLASSID: _bindgen_ty_158 = 3; -pub const TCA_BPF_OPS_LEN: _bindgen_ty_158 = 4; -pub const TCA_BPF_OPS: _bindgen_ty_158 = 5; -pub const TCA_BPF_FD: _bindgen_ty_158 = 6; -pub const TCA_BPF_NAME: _bindgen_ty_158 = 7; -pub const TCA_BPF_FLAGS: _bindgen_ty_158 = 8; -pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_158 = 9; -pub const TCA_BPF_TAG: _bindgen_ty_158 = 10; -pub const TCA_BPF_ID: _bindgen_ty_158 = 11; -pub const __TCA_BPF_MAX: _bindgen_ty_158 = 12; -pub type _bindgen_ty_158 = ::core::ffi::c_uint; +pub const TCA_UNSPEC: _bindgen_ty_103 = 0; +pub const TCA_KIND: _bindgen_ty_103 = 1; +pub const TCA_OPTIONS: _bindgen_ty_103 = 2; +pub const TCA_STATS: _bindgen_ty_103 = 3; +pub const TCA_XSTATS: _bindgen_ty_103 = 4; +pub const TCA_RATE: _bindgen_ty_103 = 5; +pub const TCA_FCNT: _bindgen_ty_103 = 6; +pub const TCA_STATS2: _bindgen_ty_103 = 7; +pub const TCA_STAB: _bindgen_ty_103 = 8; +pub const TCA_PAD: _bindgen_ty_103 = 9; +pub const TCA_DUMP_INVISIBLE: _bindgen_ty_103 = 10; +pub const TCA_CHAIN: _bindgen_ty_103 = 11; +pub const TCA_HW_OFFLOAD: _bindgen_ty_103 = 12; +pub const TCA_INGRESS_BLOCK: _bindgen_ty_103 = 13; +pub const TCA_EGRESS_BLOCK: _bindgen_ty_103 = 14; +pub const __TCA_MAX: _bindgen_ty_103 = 15; +pub type _bindgen_ty_103 = ::core::ffi::c_uint; +pub const TCA_BPF_UNSPEC: _bindgen_ty_159 = 0; +pub const TCA_BPF_ACT: _bindgen_ty_159 = 1; +pub const TCA_BPF_POLICE: _bindgen_ty_159 = 2; +pub const TCA_BPF_CLASSID: _bindgen_ty_159 = 3; +pub const TCA_BPF_OPS_LEN: _bindgen_ty_159 = 4; +pub const TCA_BPF_OPS: _bindgen_ty_159 = 5; +pub const TCA_BPF_FD: _bindgen_ty_159 = 6; +pub const TCA_BPF_NAME: _bindgen_ty_159 = 7; +pub const TCA_BPF_FLAGS: _bindgen_ty_159 = 8; +pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_159 = 9; +pub const TCA_BPF_TAG: _bindgen_ty_159 = 10; +pub const TCA_BPF_ID: _bindgen_ty_159 = 11; +pub const __TCA_BPF_MAX: _bindgen_ty_159 = 12; +pub type _bindgen_ty_159 = ::core::ffi::c_uint; pub const AYA_PERF_EVENT_IOC_ENABLE: ::core::ffi::c_int = 9216; pub const AYA_PERF_EVENT_IOC_DISABLE: ::core::ffi::c_int = 9217; pub const AYA_PERF_EVENT_IOC_SET_BPF: ::core::ffi::c_int = 1074013192; diff --git a/aya-obj/src/generated/linux_bindings_x86_64.rs b/aya-obj/src/generated/linux_bindings_x86_64.rs index 244910f6..c2b201e5 100644 --- a/aya-obj/src/generated/linux_bindings_x86_64.rs +++ b/aya-obj/src/generated/linux_bindings_x86_64.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.63.0 */ +/* automatically generated by rust-bindgen 0.64.0 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -132,6 +132,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; @@ -754,6 +755,8 @@ pub const BPF_F_ADJ_ROOM_ENCAP_L4_GRE: _bindgen_ty_15 = 8; pub const BPF_F_ADJ_ROOM_ENCAP_L4_UDP: _bindgen_ty_15 = 16; pub const BPF_F_ADJ_ROOM_NO_CSUM_RESET: _bindgen_ty_15 = 32; pub const BPF_F_ADJ_ROOM_ENCAP_L2_ETH: _bindgen_ty_15 = 64; +pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV4: _bindgen_ty_15 = 128; +pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV6: _bindgen_ty_15 = 256; pub type _bindgen_ty_15 = ::core::ffi::c_uint; pub const BPF_F_SYSCTL_BASE_NAME: _bindgen_ty_17 = 1; pub type _bindgen_ty_17 = ::core::ffi::c_uint; @@ -769,6 +772,30 @@ pub const BPF_F_BROADCAST: _bindgen_ty_25 = 8; pub const BPF_F_EXCLUDE_INGRESS: _bindgen_ty_25 = 16; pub type _bindgen_ty_25 = ::core::ffi::c_uint; #[repr(C)] +#[derive(Copy, Clone)] +pub struct bpf_devmap_val { + pub ifindex: __u32, + pub bpf_prog: bpf_devmap_val__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union bpf_devmap_val__bindgen_ty_1 { + pub fd: ::core::ffi::c_int, + pub id: __u32, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct bpf_cpumap_val { + pub qsize: __u32, + pub bpf_prog: bpf_cpumap_val__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union bpf_cpumap_val__bindgen_ty_1 { + pub fd: ::core::ffi::c_int, + pub id: __u32, +} +#[repr(C)] #[derive(Debug, Copy, Clone)] pub struct bpf_prog_info { pub type_: __u32, @@ -969,6 +996,8 @@ pub struct bpf_line_info { pub line_off: __u32, pub line_col: __u32, } +pub const BPF_F_TIMER_ABS: _bindgen_ty_39 = 1; +pub type _bindgen_ty_39 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct btf_header { @@ -994,29 +1023,29 @@ pub union btf_type__bindgen_ty_1 { pub size: __u32, pub type_: __u32, } -pub const BTF_KIND_UNKN: _bindgen_ty_39 = 0; -pub const BTF_KIND_INT: _bindgen_ty_39 = 1; -pub const BTF_KIND_PTR: _bindgen_ty_39 = 2; -pub const BTF_KIND_ARRAY: _bindgen_ty_39 = 3; -pub const BTF_KIND_STRUCT: _bindgen_ty_39 = 4; -pub const BTF_KIND_UNION: _bindgen_ty_39 = 5; -pub const BTF_KIND_ENUM: _bindgen_ty_39 = 6; -pub const BTF_KIND_FWD: _bindgen_ty_39 = 7; -pub const BTF_KIND_TYPEDEF: _bindgen_ty_39 = 8; -pub const BTF_KIND_VOLATILE: _bindgen_ty_39 = 9; -pub const BTF_KIND_CONST: _bindgen_ty_39 = 10; -pub const BTF_KIND_RESTRICT: _bindgen_ty_39 = 11; -pub const BTF_KIND_FUNC: _bindgen_ty_39 = 12; -pub const BTF_KIND_FUNC_PROTO: _bindgen_ty_39 = 13; -pub const BTF_KIND_VAR: _bindgen_ty_39 = 14; -pub const BTF_KIND_DATASEC: _bindgen_ty_39 = 15; -pub const BTF_KIND_FLOAT: _bindgen_ty_39 = 16; -pub const BTF_KIND_DECL_TAG: _bindgen_ty_39 = 17; -pub const BTF_KIND_TYPE_TAG: _bindgen_ty_39 = 18; -pub const BTF_KIND_ENUM64: _bindgen_ty_39 = 19; -pub const NR_BTF_KINDS: _bindgen_ty_39 = 20; -pub const BTF_KIND_MAX: _bindgen_ty_39 = 19; -pub type _bindgen_ty_39 = ::core::ffi::c_uint; +pub const BTF_KIND_UNKN: _bindgen_ty_40 = 0; +pub const BTF_KIND_INT: _bindgen_ty_40 = 1; +pub const BTF_KIND_PTR: _bindgen_ty_40 = 2; +pub const BTF_KIND_ARRAY: _bindgen_ty_40 = 3; +pub const BTF_KIND_STRUCT: _bindgen_ty_40 = 4; +pub const BTF_KIND_UNION: _bindgen_ty_40 = 5; +pub const BTF_KIND_ENUM: _bindgen_ty_40 = 6; +pub const BTF_KIND_FWD: _bindgen_ty_40 = 7; +pub const BTF_KIND_TYPEDEF: _bindgen_ty_40 = 8; +pub const BTF_KIND_VOLATILE: _bindgen_ty_40 = 9; +pub const BTF_KIND_CONST: _bindgen_ty_40 = 10; +pub const BTF_KIND_RESTRICT: _bindgen_ty_40 = 11; +pub const BTF_KIND_FUNC: _bindgen_ty_40 = 12; +pub const BTF_KIND_FUNC_PROTO: _bindgen_ty_40 = 13; +pub const BTF_KIND_VAR: _bindgen_ty_40 = 14; +pub const BTF_KIND_DATASEC: _bindgen_ty_40 = 15; +pub const BTF_KIND_FLOAT: _bindgen_ty_40 = 16; +pub const BTF_KIND_DECL_TAG: _bindgen_ty_40 = 17; +pub const BTF_KIND_TYPE_TAG: _bindgen_ty_40 = 18; +pub const BTF_KIND_ENUM64: _bindgen_ty_40 = 19; +pub const NR_BTF_KINDS: _bindgen_ty_40 = 20; +pub const BTF_KIND_MAX: _bindgen_ty_40 = 19; +pub type _bindgen_ty_40 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct btf_enum { @@ -1043,10 +1072,10 @@ pub struct btf_param { pub name_off: __u32, pub type_: __u32, } -pub const BTF_VAR_STATIC: _bindgen_ty_40 = 0; -pub const BTF_VAR_GLOBAL_ALLOCATED: _bindgen_ty_40 = 1; -pub const BTF_VAR_GLOBAL_EXTERN: _bindgen_ty_40 = 2; -pub type _bindgen_ty_40 = ::core::ffi::c_uint; +pub const BTF_VAR_STATIC: _bindgen_ty_41 = 0; +pub const BTF_VAR_GLOBAL_ALLOCATED: _bindgen_ty_41 = 1; +pub const BTF_VAR_GLOBAL_EXTERN: _bindgen_ty_41 = 2; +pub type _bindgen_ty_41 = ::core::ffi::c_uint; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum btf_func_linkage { @@ -1197,6 +1226,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)] @@ -2041,17 +2071,17 @@ pub enum perf_event_type { PERF_RECORD_AUX_OUTPUT_HW_ID = 21, PERF_RECORD_MAX = 22, } -pub const IFLA_XDP_UNSPEC: _bindgen_ty_89 = 0; -pub const IFLA_XDP_FD: _bindgen_ty_89 = 1; -pub const IFLA_XDP_ATTACHED: _bindgen_ty_89 = 2; -pub const IFLA_XDP_FLAGS: _bindgen_ty_89 = 3; -pub const IFLA_XDP_PROG_ID: _bindgen_ty_89 = 4; -pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_89 = 5; -pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_89 = 6; -pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_89 = 7; -pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_89 = 8; -pub const __IFLA_XDP_MAX: _bindgen_ty_89 = 9; -pub type _bindgen_ty_89 = ::core::ffi::c_uint; +pub const IFLA_XDP_UNSPEC: _bindgen_ty_90 = 0; +pub const IFLA_XDP_FD: _bindgen_ty_90 = 1; +pub const IFLA_XDP_ATTACHED: _bindgen_ty_90 = 2; +pub const IFLA_XDP_FLAGS: _bindgen_ty_90 = 3; +pub const IFLA_XDP_PROG_ID: _bindgen_ty_90 = 4; +pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_90 = 5; +pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_90 = 6; +pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_90 = 7; +pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_90 = 8; +pub const __IFLA_XDP_MAX: _bindgen_ty_90 = 9; +pub type _bindgen_ty_90 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ifinfomsg { @@ -2073,37 +2103,37 @@ pub struct tcmsg { pub tcm_parent: __u32, pub tcm_info: __u32, } -pub const TCA_UNSPEC: _bindgen_ty_102 = 0; -pub const TCA_KIND: _bindgen_ty_102 = 1; -pub const TCA_OPTIONS: _bindgen_ty_102 = 2; -pub const TCA_STATS: _bindgen_ty_102 = 3; -pub const TCA_XSTATS: _bindgen_ty_102 = 4; -pub const TCA_RATE: _bindgen_ty_102 = 5; -pub const TCA_FCNT: _bindgen_ty_102 = 6; -pub const TCA_STATS2: _bindgen_ty_102 = 7; -pub const TCA_STAB: _bindgen_ty_102 = 8; -pub const TCA_PAD: _bindgen_ty_102 = 9; -pub const TCA_DUMP_INVISIBLE: _bindgen_ty_102 = 10; -pub const TCA_CHAIN: _bindgen_ty_102 = 11; -pub const TCA_HW_OFFLOAD: _bindgen_ty_102 = 12; -pub const TCA_INGRESS_BLOCK: _bindgen_ty_102 = 13; -pub const TCA_EGRESS_BLOCK: _bindgen_ty_102 = 14; -pub const __TCA_MAX: _bindgen_ty_102 = 15; -pub type _bindgen_ty_102 = ::core::ffi::c_uint; -pub const TCA_BPF_UNSPEC: _bindgen_ty_158 = 0; -pub const TCA_BPF_ACT: _bindgen_ty_158 = 1; -pub const TCA_BPF_POLICE: _bindgen_ty_158 = 2; -pub const TCA_BPF_CLASSID: _bindgen_ty_158 = 3; -pub const TCA_BPF_OPS_LEN: _bindgen_ty_158 = 4; -pub const TCA_BPF_OPS: _bindgen_ty_158 = 5; -pub const TCA_BPF_FD: _bindgen_ty_158 = 6; -pub const TCA_BPF_NAME: _bindgen_ty_158 = 7; -pub const TCA_BPF_FLAGS: _bindgen_ty_158 = 8; -pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_158 = 9; -pub const TCA_BPF_TAG: _bindgen_ty_158 = 10; -pub const TCA_BPF_ID: _bindgen_ty_158 = 11; -pub const __TCA_BPF_MAX: _bindgen_ty_158 = 12; -pub type _bindgen_ty_158 = ::core::ffi::c_uint; +pub const TCA_UNSPEC: _bindgen_ty_103 = 0; +pub const TCA_KIND: _bindgen_ty_103 = 1; +pub const TCA_OPTIONS: _bindgen_ty_103 = 2; +pub const TCA_STATS: _bindgen_ty_103 = 3; +pub const TCA_XSTATS: _bindgen_ty_103 = 4; +pub const TCA_RATE: _bindgen_ty_103 = 5; +pub const TCA_FCNT: _bindgen_ty_103 = 6; +pub const TCA_STATS2: _bindgen_ty_103 = 7; +pub const TCA_STAB: _bindgen_ty_103 = 8; +pub const TCA_PAD: _bindgen_ty_103 = 9; +pub const TCA_DUMP_INVISIBLE: _bindgen_ty_103 = 10; +pub const TCA_CHAIN: _bindgen_ty_103 = 11; +pub const TCA_HW_OFFLOAD: _bindgen_ty_103 = 12; +pub const TCA_INGRESS_BLOCK: _bindgen_ty_103 = 13; +pub const TCA_EGRESS_BLOCK: _bindgen_ty_103 = 14; +pub const __TCA_MAX: _bindgen_ty_103 = 15; +pub type _bindgen_ty_103 = ::core::ffi::c_uint; +pub const TCA_BPF_UNSPEC: _bindgen_ty_159 = 0; +pub const TCA_BPF_ACT: _bindgen_ty_159 = 1; +pub const TCA_BPF_POLICE: _bindgen_ty_159 = 2; +pub const TCA_BPF_CLASSID: _bindgen_ty_159 = 3; +pub const TCA_BPF_OPS_LEN: _bindgen_ty_159 = 4; +pub const TCA_BPF_OPS: _bindgen_ty_159 = 5; +pub const TCA_BPF_FD: _bindgen_ty_159 = 6; +pub const TCA_BPF_NAME: _bindgen_ty_159 = 7; +pub const TCA_BPF_FLAGS: _bindgen_ty_159 = 8; +pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_159 = 9; +pub const TCA_BPF_TAG: _bindgen_ty_159 = 10; +pub const TCA_BPF_ID: _bindgen_ty_159 = 11; +pub const __TCA_BPF_MAX: _bindgen_ty_159 = 12; +pub type _bindgen_ty_159 = ::core::ffi::c_uint; pub const AYA_PERF_EVENT_IOC_ENABLE: ::core::ffi::c_int = 9216; pub const AYA_PERF_EVENT_IOC_DISABLE: ::core::ffi::c_int = 9217; pub const AYA_PERF_EVENT_IOC_SET_BPF: ::core::ffi::c_int = 1074013192; diff --git a/bpf/aya-bpf-bindings/src/aarch64/bindings.rs b/bpf/aya-bpf-bindings/src/aarch64/bindings.rs index 46730032..8d963f69 100644 --- a/bpf/aya-bpf-bindings/src/aarch64/bindings.rs +++ b/bpf/aya-bpf-bindings/src/aarch64/bindings.rs @@ -177,6 +177,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; @@ -302,7 +303,7 @@ pub const BPF_REG_10: _bindgen_ty_1 = 10; pub const __MAX_BPF_REG: _bindgen_ty_1 = 11; pub type _bindgen_ty_1 = ::aya_bpf_cty::c_uint; #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_insn { pub code: __u8, pub _bitfield_align_1: [u8; 0], @@ -348,12 +349,13 @@ impl bpf_insn { } } #[repr(C)] +#[derive(Debug)] pub struct bpf_lpm_trie_key { pub prefixlen: __u32, pub data: __IncompleteArrayField<__u8>, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_cgroup_storage_key { pub cgroup_inode_id: __u64, pub attach_type: __u32, @@ -374,19 +376,19 @@ pub union bpf_iter_link_info { pub task: bpf_iter_link_info__bindgen_ty_3, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_iter_link_info__bindgen_ty_1 { pub map_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_iter_link_info__bindgen_ty_2 { pub order: bpf_cgroup_iter_order::Type, pub cgroup_fd: __u32, pub cgroup_id: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_iter_link_info__bindgen_ty_3 { pub tid: __u32, pub pid: __u32, @@ -632,7 +634,7 @@ pub union bpf_attr { pub prog_bind_map: bpf_attr__bindgen_ty_19, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_1 { pub map_type: __u32, pub key_size: __u32, @@ -664,7 +666,7 @@ pub union bpf_attr__bindgen_ty_2__bindgen_ty_1 { pub next_key: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_3 { pub in_batch: __u64, pub out_batch: __u64, @@ -711,14 +713,14 @@ pub union bpf_attr__bindgen_ty_4__bindgen_ty_1 { pub attach_btf_obj_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_5 { pub pathname: __u64, pub bpf_fd: __u32, pub file_flags: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_6 { pub target_fd: __u32, pub attach_bpf_fd: __u32, @@ -727,7 +729,7 @@ pub struct bpf_attr__bindgen_ty_6 { pub replace_bpf_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_7 { pub prog_fd: __u32, pub retval: __u32, @@ -762,14 +764,14 @@ pub union bpf_attr__bindgen_ty_8__bindgen_ty_1 { pub link_id: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_9 { pub bpf_fd: __u32, pub info_len: __u32, pub info: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_10 { pub target_fd: __u32, pub attach_type: __u32, @@ -780,13 +782,13 @@ pub struct bpf_attr__bindgen_ty_10 { pub prog_attach_flags: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_11 { pub name: __u64, pub prog_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_12 { pub btf: __u64, pub btf_log_buf: __u64, @@ -795,7 +797,7 @@ pub struct bpf_attr__bindgen_ty_12 { pub btf_log_level: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_13 { pub pid: __u32, pub fd: __u32, @@ -832,18 +834,18 @@ pub union bpf_attr__bindgen_ty_14__bindgen_ty_2 { pub tracing: bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_4, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_1 { pub iter_info: __u64, pub iter_info_len: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_2 { pub bpf_cookie: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_3 { pub flags: __u32, pub cnt: __u32, @@ -852,13 +854,13 @@ pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_3 { pub cookies: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_4 { pub target_btf_id: __u32, pub cookie: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_15 { pub link_fd: __u32, pub new_prog_fd: __u32, @@ -866,23 +868,23 @@ pub struct bpf_attr__bindgen_ty_15 { pub old_prog_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_16 { pub link_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_17 { pub type_: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_18 { pub link_fd: __u32, pub flags: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_19 { pub prog_fd: __u32, pub map_fd: __u32, @@ -1148,6 +1150,8 @@ pub const BPF_F_ADJ_ROOM_ENCAP_L4_GRE: _bindgen_ty_15 = 8; pub const BPF_F_ADJ_ROOM_ENCAP_L4_UDP: _bindgen_ty_15 = 16; pub const BPF_F_ADJ_ROOM_NO_CSUM_RESET: _bindgen_ty_15 = 32; pub const BPF_F_ADJ_ROOM_ENCAP_L2_ETH: _bindgen_ty_15 = 64; +pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV4: _bindgen_ty_15 = 128; +pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV6: _bindgen_ty_15 = 256; pub type _bindgen_ty_15 = ::aya_bpf_cty::c_uint; pub const BPF_ADJ_ROOM_ENCAP_L2_MASK: _bindgen_ty_16 = 255; pub const BPF_ADJ_ROOM_ENCAP_L2_SHIFT: _bindgen_ty_16 = 56; @@ -1328,7 +1332,7 @@ pub mod bpf_ret_code { pub const BPF_FLOW_DISSECTOR_CONTINUE: Type = 129; } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_sock { pub bound_dev_if: __u32, pub family: __u32, @@ -1355,7 +1359,7 @@ impl bpf_sock { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_tcp_sock { pub snd_cwnd: __u32, pub srtt_us: __u32, @@ -1396,7 +1400,7 @@ pub union bpf_sock_tuple__bindgen_ty_1 { pub ipv6: bpf_sock_tuple__bindgen_ty_1__bindgen_ty_2, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_sock_tuple__bindgen_ty_1__bindgen_ty_1 { pub saddr: __be32, pub daddr: __be32, @@ -1404,7 +1408,7 @@ pub struct bpf_sock_tuple__bindgen_ty_1__bindgen_ty_1 { pub dport: __be16, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_sock_tuple__bindgen_ty_1__bindgen_ty_2 { pub saddr: [__be32; 4usize], pub daddr: [__be32; 4usize], @@ -1412,7 +1416,7 @@ pub struct bpf_sock_tuple__bindgen_ty_1__bindgen_ty_2 { pub dport: __be16, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_xdp_sock { pub queue_id: __u32, } @@ -1425,7 +1429,7 @@ pub mod xdp_action { pub const XDP_REDIRECT: Type = 4; } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct xdp_md { pub data: __u32, pub data_end: __u32, @@ -1590,7 +1594,7 @@ impl sk_reuseport_md__bindgen_ty_4 { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_prog_info { pub type_: __u32, pub id: __u32, @@ -1655,7 +1659,7 @@ impl bpf_prog_info { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_map_info { pub type_: __u32, pub id: __u32, @@ -1683,7 +1687,7 @@ impl bpf_map_info { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_btf_info { pub btf: __u64, pub btf_size: __u32, @@ -1711,20 +1715,20 @@ pub union bpf_link_info__bindgen_ty_1 { pub xdp: bpf_link_info__bindgen_ty_1__bindgen_ty_6, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_1 { pub tp_name: __u64, pub tp_name_len: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_2 { pub attach_type: __u32, pub target_obj_id: __u32, pub target_btf_id: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_3 { pub cgroup_id: __u64, pub attach_type: __u32, @@ -1743,7 +1747,7 @@ pub union bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_1 { pub map: bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_1__bindgen_ty_1, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_1__bindgen_ty_1 { pub map_id: __u32, } @@ -1754,25 +1758,25 @@ pub union bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_2 { pub task: bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_2__bindgen_ty_2, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_2__bindgen_ty_1 { pub cgroup_id: __u64, pub order: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_2__bindgen_ty_2 { pub tid: __u32, pub pid: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_5 { pub netns_ino: __u32, pub attach_type: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_6 { pub ifindex: __u32, } @@ -1948,7 +1952,7 @@ pub mod _bindgen_ty_32 { pub const BPF_WRITE_HDR_TCP_SYNACK_COOKIE: Type = 2; } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_perf_event_value { pub counter: __u64, pub enabled: __u64, @@ -1962,18 +1966,20 @@ pub const BPF_DEVCG_DEV_BLOCK: _bindgen_ty_34 = 1; pub const BPF_DEVCG_DEV_CHAR: _bindgen_ty_34 = 2; pub type _bindgen_ty_34 = ::aya_bpf_cty::c_uint; #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_cgroup_dev_ctx { pub access_type: __u32, pub major: __u32, pub minor: __u32, } #[repr(C)] +#[derive(Debug)] pub struct bpf_raw_tracepoint_args { pub args: __IncompleteArrayField<__u64>, } pub const BPF_FIB_LOOKUP_DIRECT: _bindgen_ty_35 = 1; pub const BPF_FIB_LOOKUP_OUTPUT: _bindgen_ty_35 = 2; +pub const BPF_FIB_LOOKUP_SKIP_NEIGH: _bindgen_ty_35 = 4; pub type _bindgen_ty_35 = ::aya_bpf_cty::c_uint; pub const BPF_FIB_LKUP_RET_SUCCESS: _bindgen_ty_36 = 0; pub const BPF_FIB_LKUP_RET_BLACKHOLE: _bindgen_ty_36 = 1; @@ -2086,25 +2092,25 @@ pub union bpf_flow_keys__bindgen_ty_1 { pub __bindgen_anon_2: bpf_flow_keys__bindgen_ty_1__bindgen_ty_2, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_flow_keys__bindgen_ty_1__bindgen_ty_1 { pub ipv4_src: __be32, pub ipv4_dst: __be32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_flow_keys__bindgen_ty_1__bindgen_ty_2 { pub ipv6_src: [__u32; 4usize], pub ipv6_dst: [__u32; 4usize], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_func_info { pub insn_off: __u32, pub type_id: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_line_info { pub insn_off: __u32, pub file_name_off: __u32, @@ -2112,13 +2118,13 @@ pub struct bpf_line_info { pub line_col: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_spin_lock { pub val: __u32, } #[repr(C)] #[repr(align(8))] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_timer { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, @@ -2132,7 +2138,7 @@ impl bpf_timer { } #[repr(C)] #[repr(align(8))] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_dynptr { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, @@ -2146,7 +2152,7 @@ impl bpf_dynptr { } #[repr(C)] #[repr(align(8))] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_list_head { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, @@ -2160,7 +2166,7 @@ impl bpf_list_head { } #[repr(C)] #[repr(align(8))] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_list_node { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, @@ -2173,7 +2179,35 @@ impl bpf_list_node { } } #[repr(C)] -#[derive(Copy, Clone)] +#[repr(align(8))] +#[derive(Debug, 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, 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)] +#[derive(Debug, Copy, Clone)] pub struct bpf_sysctl { pub write: __u32, pub file_pos: __u32, @@ -2232,7 +2266,7 @@ impl bpf_sockopt__bindgen_ty_3 { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_pidns_info { pub pid: __u32, pub tgid: __u32, @@ -2281,7 +2315,7 @@ impl bpf_sk_lookup { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct btf_ptr { pub ptr: *mut ::aya_bpf_cty::c_void, pub type_id: __u32, @@ -2304,15 +2338,17 @@ pub mod bpf_core_relo_kind { pub const BPF_CORE_TYPE_MATCHES: Type = 12; } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_core_relo { pub insn_off: __u32, pub type_id: __u32, pub access_str_off: __u32, pub kind: bpf_core_relo_kind::Type, } +pub const BPF_F_TIMER_ABS: _bindgen_ty_39 = 1; +pub type _bindgen_ty_39 = ::aya_bpf_cty::c_uint; #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct user_pt_regs { pub regs: [__u64; 31usize], pub sp: __u64, @@ -2321,108 +2357,108 @@ pub struct user_pt_regs { } pub type sa_family_t = ::aya_bpf_cty::c_ushort; #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct sockaddr { pub sa_family: sa_family_t, pub sa_data: [::aya_bpf_cty::c_char; 14usize], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_perf_event_data { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct linux_binprm { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct pt_regs { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcphdr { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct seq_file { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcp6_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcp_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcp_timewait_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcp_request_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct udp6_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct unix_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct task_struct { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct cgroup { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct path { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct inode { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct socket { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct file { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct mptcp_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct iphdr { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct ipv6hdr { _unused: [u8; 0], } diff --git a/bpf/aya-bpf-bindings/src/armv7/bindings.rs b/bpf/aya-bpf-bindings/src/armv7/bindings.rs index f9860f77..101843a7 100644 --- a/bpf/aya-bpf-bindings/src/armv7/bindings.rs +++ b/bpf/aya-bpf-bindings/src/armv7/bindings.rs @@ -177,6 +177,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; @@ -297,7 +298,7 @@ pub const BPF_REG_10: _bindgen_ty_1 = 10; pub const __MAX_BPF_REG: _bindgen_ty_1 = 11; pub type _bindgen_ty_1 = ::aya_bpf_cty::c_uint; #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_insn { pub code: __u8, pub _bitfield_align_1: [u8; 0], @@ -343,12 +344,13 @@ impl bpf_insn { } } #[repr(C)] +#[derive(Debug)] pub struct bpf_lpm_trie_key { pub prefixlen: __u32, pub data: __IncompleteArrayField<__u8>, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_cgroup_storage_key { pub cgroup_inode_id: __u64, pub attach_type: __u32, @@ -369,19 +371,19 @@ pub union bpf_iter_link_info { pub task: bpf_iter_link_info__bindgen_ty_3, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_iter_link_info__bindgen_ty_1 { pub map_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_iter_link_info__bindgen_ty_2 { pub order: bpf_cgroup_iter_order::Type, pub cgroup_fd: __u32, pub cgroup_id: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_iter_link_info__bindgen_ty_3 { pub tid: __u32, pub pid: __u32, @@ -627,7 +629,7 @@ pub union bpf_attr { pub prog_bind_map: bpf_attr__bindgen_ty_19, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_1 { pub map_type: __u32, pub key_size: __u32, @@ -659,7 +661,7 @@ pub union bpf_attr__bindgen_ty_2__bindgen_ty_1 { pub next_key: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_3 { pub in_batch: __u64, pub out_batch: __u64, @@ -706,14 +708,14 @@ pub union bpf_attr__bindgen_ty_4__bindgen_ty_1 { pub attach_btf_obj_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_5 { pub pathname: __u64, pub bpf_fd: __u32, pub file_flags: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_6 { pub target_fd: __u32, pub attach_bpf_fd: __u32, @@ -722,7 +724,7 @@ pub struct bpf_attr__bindgen_ty_6 { pub replace_bpf_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_7 { pub prog_fd: __u32, pub retval: __u32, @@ -757,14 +759,14 @@ pub union bpf_attr__bindgen_ty_8__bindgen_ty_1 { pub link_id: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_9 { pub bpf_fd: __u32, pub info_len: __u32, pub info: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_10 { pub target_fd: __u32, pub attach_type: __u32, @@ -775,13 +777,13 @@ pub struct bpf_attr__bindgen_ty_10 { pub prog_attach_flags: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_11 { pub name: __u64, pub prog_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_12 { pub btf: __u64, pub btf_log_buf: __u64, @@ -790,7 +792,7 @@ pub struct bpf_attr__bindgen_ty_12 { pub btf_log_level: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_13 { pub pid: __u32, pub fd: __u32, @@ -827,18 +829,18 @@ pub union bpf_attr__bindgen_ty_14__bindgen_ty_2 { pub tracing: bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_4, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_1 { pub iter_info: __u64, pub iter_info_len: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_2 { pub bpf_cookie: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_3 { pub flags: __u32, pub cnt: __u32, @@ -847,13 +849,13 @@ pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_3 { pub cookies: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_4 { pub target_btf_id: __u32, pub cookie: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_15 { pub link_fd: __u32, pub new_prog_fd: __u32, @@ -861,23 +863,23 @@ pub struct bpf_attr__bindgen_ty_15 { pub old_prog_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_16 { pub link_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_17 { pub type_: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_18 { pub link_fd: __u32, pub flags: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_19 { pub prog_fd: __u32, pub map_fd: __u32, @@ -1143,6 +1145,8 @@ pub const BPF_F_ADJ_ROOM_ENCAP_L4_GRE: _bindgen_ty_15 = 8; pub const BPF_F_ADJ_ROOM_ENCAP_L4_UDP: _bindgen_ty_15 = 16; pub const BPF_F_ADJ_ROOM_NO_CSUM_RESET: _bindgen_ty_15 = 32; pub const BPF_F_ADJ_ROOM_ENCAP_L2_ETH: _bindgen_ty_15 = 64; +pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV4: _bindgen_ty_15 = 128; +pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV6: _bindgen_ty_15 = 256; pub type _bindgen_ty_15 = ::aya_bpf_cty::c_uint; pub const BPF_ADJ_ROOM_ENCAP_L2_MASK: _bindgen_ty_16 = 255; pub const BPF_ADJ_ROOM_ENCAP_L2_SHIFT: _bindgen_ty_16 = 56; @@ -1325,7 +1329,7 @@ pub mod bpf_ret_code { pub const BPF_FLOW_DISSECTOR_CONTINUE: Type = 129; } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_sock { pub bound_dev_if: __u32, pub family: __u32, @@ -1352,7 +1356,7 @@ impl bpf_sock { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_tcp_sock { pub snd_cwnd: __u32, pub srtt_us: __u32, @@ -1393,7 +1397,7 @@ pub union bpf_sock_tuple__bindgen_ty_1 { pub ipv6: bpf_sock_tuple__bindgen_ty_1__bindgen_ty_2, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_sock_tuple__bindgen_ty_1__bindgen_ty_1 { pub saddr: __be32, pub daddr: __be32, @@ -1401,7 +1405,7 @@ pub struct bpf_sock_tuple__bindgen_ty_1__bindgen_ty_1 { pub dport: __be16, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_sock_tuple__bindgen_ty_1__bindgen_ty_2 { pub saddr: [__be32; 4usize], pub daddr: [__be32; 4usize], @@ -1409,7 +1413,7 @@ pub struct bpf_sock_tuple__bindgen_ty_1__bindgen_ty_2 { pub dport: __be16, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_xdp_sock { pub queue_id: __u32, } @@ -1422,7 +1426,7 @@ pub mod xdp_action { pub const XDP_REDIRECT: Type = 4; } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct xdp_md { pub data: __u32, pub data_end: __u32, @@ -1594,7 +1598,7 @@ impl sk_reuseport_md__bindgen_ty_4 { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_prog_info { pub type_: __u32, pub id: __u32, @@ -1659,7 +1663,7 @@ impl bpf_prog_info { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_map_info { pub type_: __u32, pub id: __u32, @@ -1687,7 +1691,7 @@ impl bpf_map_info { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_btf_info { pub btf: __u64, pub btf_size: __u32, @@ -1715,20 +1719,20 @@ pub union bpf_link_info__bindgen_ty_1 { pub xdp: bpf_link_info__bindgen_ty_1__bindgen_ty_6, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_1 { pub tp_name: __u64, pub tp_name_len: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_2 { pub attach_type: __u32, pub target_obj_id: __u32, pub target_btf_id: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_3 { pub cgroup_id: __u64, pub attach_type: __u32, @@ -1747,7 +1751,7 @@ pub union bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_1 { pub map: bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_1__bindgen_ty_1, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_1__bindgen_ty_1 { pub map_id: __u32, } @@ -1758,25 +1762,25 @@ pub union bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_2 { pub task: bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_2__bindgen_ty_2, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_2__bindgen_ty_1 { pub cgroup_id: __u64, pub order: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_2__bindgen_ty_2 { pub tid: __u32, pub pid: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_5 { pub netns_ino: __u32, pub attach_type: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_6 { pub ifindex: __u32, } @@ -1956,7 +1960,7 @@ pub mod _bindgen_ty_32 { pub const BPF_WRITE_HDR_TCP_SYNACK_COOKIE: Type = 2; } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_perf_event_value { pub counter: __u64, pub enabled: __u64, @@ -1970,18 +1974,20 @@ pub const BPF_DEVCG_DEV_BLOCK: _bindgen_ty_34 = 1; pub const BPF_DEVCG_DEV_CHAR: _bindgen_ty_34 = 2; pub type _bindgen_ty_34 = ::aya_bpf_cty::c_uint; #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_cgroup_dev_ctx { pub access_type: __u32, pub major: __u32, pub minor: __u32, } #[repr(C)] +#[derive(Debug)] pub struct bpf_raw_tracepoint_args { pub args: __IncompleteArrayField<__u64>, } pub const BPF_FIB_LOOKUP_DIRECT: _bindgen_ty_35 = 1; pub const BPF_FIB_LOOKUP_OUTPUT: _bindgen_ty_35 = 2; +pub const BPF_FIB_LOOKUP_SKIP_NEIGH: _bindgen_ty_35 = 4; pub type _bindgen_ty_35 = ::aya_bpf_cty::c_uint; pub const BPF_FIB_LKUP_RET_SUCCESS: _bindgen_ty_36 = 0; pub const BPF_FIB_LKUP_RET_BLACKHOLE: _bindgen_ty_36 = 1; @@ -2094,25 +2100,25 @@ pub union bpf_flow_keys__bindgen_ty_1 { pub __bindgen_anon_2: bpf_flow_keys__bindgen_ty_1__bindgen_ty_2, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_flow_keys__bindgen_ty_1__bindgen_ty_1 { pub ipv4_src: __be32, pub ipv4_dst: __be32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_flow_keys__bindgen_ty_1__bindgen_ty_2 { pub ipv6_src: [__u32; 4usize], pub ipv6_dst: [__u32; 4usize], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_func_info { pub insn_off: __u32, pub type_id: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_line_info { pub insn_off: __u32, pub file_name_off: __u32, @@ -2120,13 +2126,13 @@ pub struct bpf_line_info { pub line_col: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_spin_lock { pub val: __u32, } #[repr(C)] #[repr(align(8))] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_timer { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, @@ -2140,7 +2146,7 @@ impl bpf_timer { } #[repr(C)] #[repr(align(8))] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_dynptr { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, @@ -2154,7 +2160,7 @@ impl bpf_dynptr { } #[repr(C)] #[repr(align(8))] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_list_head { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, @@ -2168,7 +2174,7 @@ impl bpf_list_head { } #[repr(C)] #[repr(align(8))] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_list_node { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, @@ -2181,7 +2187,35 @@ impl bpf_list_node { } } #[repr(C)] -#[derive(Copy, Clone)] +#[repr(align(8))] +#[derive(Debug, 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, 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)] +#[derive(Debug, Copy, Clone)] pub struct bpf_sysctl { pub write: __u32, pub file_pos: __u32, @@ -2243,7 +2277,7 @@ impl bpf_sockopt__bindgen_ty_3 { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_pidns_info { pub pid: __u32, pub tgid: __u32, @@ -2293,7 +2327,7 @@ impl bpf_sk_lookup { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct btf_ptr { pub ptr: *mut ::aya_bpf_cty::c_void, pub type_id: __u32, @@ -2316,117 +2350,119 @@ pub mod bpf_core_relo_kind { pub const BPF_CORE_TYPE_MATCHES: Type = 12; } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_core_relo { pub insn_off: __u32, pub type_id: __u32, pub access_str_off: __u32, pub kind: bpf_core_relo_kind::Type, } +pub const BPF_F_TIMER_ABS: _bindgen_ty_39 = 1; +pub type _bindgen_ty_39 = ::aya_bpf_cty::c_uint; #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct pt_regs { pub uregs: [::aya_bpf_cty::c_long; 18usize], } pub type sa_family_t = ::aya_bpf_cty::c_ushort; #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct sockaddr { pub sa_family: sa_family_t, pub sa_data: [::aya_bpf_cty::c_char; 14usize], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_perf_event_data { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct linux_binprm { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcphdr { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct seq_file { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcp6_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcp_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcp_timewait_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcp_request_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct udp6_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct unix_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct task_struct { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct cgroup { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct path { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct inode { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct socket { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct file { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct mptcp_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct iphdr { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct ipv6hdr { _unused: [u8; 0], } diff --git a/bpf/aya-bpf-bindings/src/riscv64/bindings.rs b/bpf/aya-bpf-bindings/src/riscv64/bindings.rs index 6e6f13ce..956818b7 100644 --- a/bpf/aya-bpf-bindings/src/riscv64/bindings.rs +++ b/bpf/aya-bpf-bindings/src/riscv64/bindings.rs @@ -177,6 +177,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; @@ -302,7 +303,7 @@ pub const BPF_REG_10: _bindgen_ty_1 = 10; pub const __MAX_BPF_REG: _bindgen_ty_1 = 11; pub type _bindgen_ty_1 = ::aya_bpf_cty::c_uint; #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_insn { pub code: __u8, pub _bitfield_align_1: [u8; 0], @@ -348,12 +349,13 @@ impl bpf_insn { } } #[repr(C)] +#[derive(Debug)] pub struct bpf_lpm_trie_key { pub prefixlen: __u32, pub data: __IncompleteArrayField<__u8>, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_cgroup_storage_key { pub cgroup_inode_id: __u64, pub attach_type: __u32, @@ -374,19 +376,19 @@ pub union bpf_iter_link_info { pub task: bpf_iter_link_info__bindgen_ty_3, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_iter_link_info__bindgen_ty_1 { pub map_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_iter_link_info__bindgen_ty_2 { pub order: bpf_cgroup_iter_order::Type, pub cgroup_fd: __u32, pub cgroup_id: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_iter_link_info__bindgen_ty_3 { pub tid: __u32, pub pid: __u32, @@ -632,7 +634,7 @@ pub union bpf_attr { pub prog_bind_map: bpf_attr__bindgen_ty_19, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_1 { pub map_type: __u32, pub key_size: __u32, @@ -664,7 +666,7 @@ pub union bpf_attr__bindgen_ty_2__bindgen_ty_1 { pub next_key: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_3 { pub in_batch: __u64, pub out_batch: __u64, @@ -711,14 +713,14 @@ pub union bpf_attr__bindgen_ty_4__bindgen_ty_1 { pub attach_btf_obj_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_5 { pub pathname: __u64, pub bpf_fd: __u32, pub file_flags: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_6 { pub target_fd: __u32, pub attach_bpf_fd: __u32, @@ -727,7 +729,7 @@ pub struct bpf_attr__bindgen_ty_6 { pub replace_bpf_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_7 { pub prog_fd: __u32, pub retval: __u32, @@ -762,14 +764,14 @@ pub union bpf_attr__bindgen_ty_8__bindgen_ty_1 { pub link_id: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_9 { pub bpf_fd: __u32, pub info_len: __u32, pub info: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_10 { pub target_fd: __u32, pub attach_type: __u32, @@ -780,13 +782,13 @@ pub struct bpf_attr__bindgen_ty_10 { pub prog_attach_flags: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_11 { pub name: __u64, pub prog_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_12 { pub btf: __u64, pub btf_log_buf: __u64, @@ -795,7 +797,7 @@ pub struct bpf_attr__bindgen_ty_12 { pub btf_log_level: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_13 { pub pid: __u32, pub fd: __u32, @@ -832,18 +834,18 @@ pub union bpf_attr__bindgen_ty_14__bindgen_ty_2 { pub tracing: bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_4, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_1 { pub iter_info: __u64, pub iter_info_len: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_2 { pub bpf_cookie: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_3 { pub flags: __u32, pub cnt: __u32, @@ -852,13 +854,13 @@ pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_3 { pub cookies: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_4 { pub target_btf_id: __u32, pub cookie: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_15 { pub link_fd: __u32, pub new_prog_fd: __u32, @@ -866,23 +868,23 @@ pub struct bpf_attr__bindgen_ty_15 { pub old_prog_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_16 { pub link_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_17 { pub type_: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_18 { pub link_fd: __u32, pub flags: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_19 { pub prog_fd: __u32, pub map_fd: __u32, @@ -1148,6 +1150,8 @@ pub const BPF_F_ADJ_ROOM_ENCAP_L4_GRE: _bindgen_ty_15 = 8; pub const BPF_F_ADJ_ROOM_ENCAP_L4_UDP: _bindgen_ty_15 = 16; pub const BPF_F_ADJ_ROOM_NO_CSUM_RESET: _bindgen_ty_15 = 32; pub const BPF_F_ADJ_ROOM_ENCAP_L2_ETH: _bindgen_ty_15 = 64; +pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV4: _bindgen_ty_15 = 128; +pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV6: _bindgen_ty_15 = 256; pub type _bindgen_ty_15 = ::aya_bpf_cty::c_uint; pub const BPF_ADJ_ROOM_ENCAP_L2_MASK: _bindgen_ty_16 = 255; pub const BPF_ADJ_ROOM_ENCAP_L2_SHIFT: _bindgen_ty_16 = 56; @@ -1328,7 +1332,7 @@ pub mod bpf_ret_code { pub const BPF_FLOW_DISSECTOR_CONTINUE: Type = 129; } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_sock { pub bound_dev_if: __u32, pub family: __u32, @@ -1355,7 +1359,7 @@ impl bpf_sock { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_tcp_sock { pub snd_cwnd: __u32, pub srtt_us: __u32, @@ -1396,7 +1400,7 @@ pub union bpf_sock_tuple__bindgen_ty_1 { pub ipv6: bpf_sock_tuple__bindgen_ty_1__bindgen_ty_2, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_sock_tuple__bindgen_ty_1__bindgen_ty_1 { pub saddr: __be32, pub daddr: __be32, @@ -1404,7 +1408,7 @@ pub struct bpf_sock_tuple__bindgen_ty_1__bindgen_ty_1 { pub dport: __be16, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_sock_tuple__bindgen_ty_1__bindgen_ty_2 { pub saddr: [__be32; 4usize], pub daddr: [__be32; 4usize], @@ -1412,7 +1416,7 @@ pub struct bpf_sock_tuple__bindgen_ty_1__bindgen_ty_2 { pub dport: __be16, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_xdp_sock { pub queue_id: __u32, } @@ -1425,7 +1429,7 @@ pub mod xdp_action { pub const XDP_REDIRECT: Type = 4; } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct xdp_md { pub data: __u32, pub data_end: __u32, @@ -1590,7 +1594,7 @@ impl sk_reuseport_md__bindgen_ty_4 { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_prog_info { pub type_: __u32, pub id: __u32, @@ -1655,7 +1659,7 @@ impl bpf_prog_info { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_map_info { pub type_: __u32, pub id: __u32, @@ -1683,7 +1687,7 @@ impl bpf_map_info { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_btf_info { pub btf: __u64, pub btf_size: __u32, @@ -1711,20 +1715,20 @@ pub union bpf_link_info__bindgen_ty_1 { pub xdp: bpf_link_info__bindgen_ty_1__bindgen_ty_6, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_1 { pub tp_name: __u64, pub tp_name_len: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_2 { pub attach_type: __u32, pub target_obj_id: __u32, pub target_btf_id: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_3 { pub cgroup_id: __u64, pub attach_type: __u32, @@ -1743,7 +1747,7 @@ pub union bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_1 { pub map: bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_1__bindgen_ty_1, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_1__bindgen_ty_1 { pub map_id: __u32, } @@ -1754,25 +1758,25 @@ pub union bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_2 { pub task: bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_2__bindgen_ty_2, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_2__bindgen_ty_1 { pub cgroup_id: __u64, pub order: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_2__bindgen_ty_2 { pub tid: __u32, pub pid: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_5 { pub netns_ino: __u32, pub attach_type: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_6 { pub ifindex: __u32, } @@ -1948,7 +1952,7 @@ pub mod _bindgen_ty_32 { pub const BPF_WRITE_HDR_TCP_SYNACK_COOKIE: Type = 2; } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_perf_event_value { pub counter: __u64, pub enabled: __u64, @@ -1962,18 +1966,20 @@ pub const BPF_DEVCG_DEV_BLOCK: _bindgen_ty_34 = 1; pub const BPF_DEVCG_DEV_CHAR: _bindgen_ty_34 = 2; pub type _bindgen_ty_34 = ::aya_bpf_cty::c_uint; #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_cgroup_dev_ctx { pub access_type: __u32, pub major: __u32, pub minor: __u32, } #[repr(C)] +#[derive(Debug)] pub struct bpf_raw_tracepoint_args { pub args: __IncompleteArrayField<__u64>, } pub const BPF_FIB_LOOKUP_DIRECT: _bindgen_ty_35 = 1; pub const BPF_FIB_LOOKUP_OUTPUT: _bindgen_ty_35 = 2; +pub const BPF_FIB_LOOKUP_SKIP_NEIGH: _bindgen_ty_35 = 4; pub type _bindgen_ty_35 = ::aya_bpf_cty::c_uint; pub const BPF_FIB_LKUP_RET_SUCCESS: _bindgen_ty_36 = 0; pub const BPF_FIB_LKUP_RET_BLACKHOLE: _bindgen_ty_36 = 1; @@ -2086,25 +2092,25 @@ pub union bpf_flow_keys__bindgen_ty_1 { pub __bindgen_anon_2: bpf_flow_keys__bindgen_ty_1__bindgen_ty_2, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_flow_keys__bindgen_ty_1__bindgen_ty_1 { pub ipv4_src: __be32, pub ipv4_dst: __be32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_flow_keys__bindgen_ty_1__bindgen_ty_2 { pub ipv6_src: [__u32; 4usize], pub ipv6_dst: [__u32; 4usize], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_func_info { pub insn_off: __u32, pub type_id: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_line_info { pub insn_off: __u32, pub file_name_off: __u32, @@ -2112,13 +2118,13 @@ pub struct bpf_line_info { pub line_col: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_spin_lock { pub val: __u32, } #[repr(C)] #[repr(align(8))] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_timer { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, @@ -2132,7 +2138,7 @@ impl bpf_timer { } #[repr(C)] #[repr(align(8))] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_dynptr { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, @@ -2146,7 +2152,7 @@ impl bpf_dynptr { } #[repr(C)] #[repr(align(8))] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_list_head { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, @@ -2160,7 +2166,7 @@ impl bpf_list_head { } #[repr(C)] #[repr(align(8))] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_list_node { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, @@ -2173,7 +2179,35 @@ impl bpf_list_node { } } #[repr(C)] -#[derive(Copy, Clone)] +#[repr(align(8))] +#[derive(Debug, 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, 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)] +#[derive(Debug, Copy, Clone)] pub struct bpf_sysctl { pub write: __u32, pub file_pos: __u32, @@ -2232,7 +2266,7 @@ impl bpf_sockopt__bindgen_ty_3 { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_pidns_info { pub pid: __u32, pub tgid: __u32, @@ -2281,7 +2315,7 @@ impl bpf_sk_lookup { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct btf_ptr { pub ptr: *mut ::aya_bpf_cty::c_void, pub type_id: __u32, @@ -2304,117 +2338,119 @@ pub mod bpf_core_relo_kind { pub const BPF_CORE_TYPE_MATCHES: Type = 12; } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_core_relo { pub insn_off: __u32, pub type_id: __u32, pub access_str_off: __u32, pub kind: bpf_core_relo_kind::Type, } +pub const BPF_F_TIMER_ABS: _bindgen_ty_39 = 1; +pub type _bindgen_ty_39 = ::aya_bpf_cty::c_uint; pub type sa_family_t = ::aya_bpf_cty::c_ushort; #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct sockaddr { pub sa_family: sa_family_t, pub sa_data: [::aya_bpf_cty::c_char; 14usize], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_perf_event_data { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct linux_binprm { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct pt_regs { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcphdr { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct seq_file { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcp6_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcp_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcp_timewait_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcp_request_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct udp6_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct unix_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct task_struct { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct cgroup { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct path { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct inode { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct socket { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct file { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct mptcp_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct iphdr { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct ipv6hdr { _unused: [u8; 0], } diff --git a/bpf/aya-bpf-bindings/src/x86_64/bindings.rs b/bpf/aya-bpf-bindings/src/x86_64/bindings.rs index 3eb2762c..3b79d228 100644 --- a/bpf/aya-bpf-bindings/src/x86_64/bindings.rs +++ b/bpf/aya-bpf-bindings/src/x86_64/bindings.rs @@ -177,6 +177,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; @@ -302,7 +303,7 @@ pub const BPF_REG_10: _bindgen_ty_1 = 10; pub const __MAX_BPF_REG: _bindgen_ty_1 = 11; pub type _bindgen_ty_1 = ::aya_bpf_cty::c_uint; #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_insn { pub code: __u8, pub _bitfield_align_1: [u8; 0], @@ -348,12 +349,13 @@ impl bpf_insn { } } #[repr(C)] +#[derive(Debug)] pub struct bpf_lpm_trie_key { pub prefixlen: __u32, pub data: __IncompleteArrayField<__u8>, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_cgroup_storage_key { pub cgroup_inode_id: __u64, pub attach_type: __u32, @@ -374,19 +376,19 @@ pub union bpf_iter_link_info { pub task: bpf_iter_link_info__bindgen_ty_3, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_iter_link_info__bindgen_ty_1 { pub map_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_iter_link_info__bindgen_ty_2 { pub order: bpf_cgroup_iter_order::Type, pub cgroup_fd: __u32, pub cgroup_id: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_iter_link_info__bindgen_ty_3 { pub tid: __u32, pub pid: __u32, @@ -632,7 +634,7 @@ pub union bpf_attr { pub prog_bind_map: bpf_attr__bindgen_ty_19, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_1 { pub map_type: __u32, pub key_size: __u32, @@ -664,7 +666,7 @@ pub union bpf_attr__bindgen_ty_2__bindgen_ty_1 { pub next_key: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_3 { pub in_batch: __u64, pub out_batch: __u64, @@ -711,14 +713,14 @@ pub union bpf_attr__bindgen_ty_4__bindgen_ty_1 { pub attach_btf_obj_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_5 { pub pathname: __u64, pub bpf_fd: __u32, pub file_flags: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_6 { pub target_fd: __u32, pub attach_bpf_fd: __u32, @@ -727,7 +729,7 @@ pub struct bpf_attr__bindgen_ty_6 { pub replace_bpf_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_7 { pub prog_fd: __u32, pub retval: __u32, @@ -762,14 +764,14 @@ pub union bpf_attr__bindgen_ty_8__bindgen_ty_1 { pub link_id: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_9 { pub bpf_fd: __u32, pub info_len: __u32, pub info: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_10 { pub target_fd: __u32, pub attach_type: __u32, @@ -780,13 +782,13 @@ pub struct bpf_attr__bindgen_ty_10 { pub prog_attach_flags: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_11 { pub name: __u64, pub prog_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_12 { pub btf: __u64, pub btf_log_buf: __u64, @@ -795,7 +797,7 @@ pub struct bpf_attr__bindgen_ty_12 { pub btf_log_level: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_13 { pub pid: __u32, pub fd: __u32, @@ -832,18 +834,18 @@ pub union bpf_attr__bindgen_ty_14__bindgen_ty_2 { pub tracing: bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_4, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_1 { pub iter_info: __u64, pub iter_info_len: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_2 { pub bpf_cookie: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_3 { pub flags: __u32, pub cnt: __u32, @@ -852,13 +854,13 @@ pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_3 { pub cookies: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_14__bindgen_ty_2__bindgen_ty_4 { pub target_btf_id: __u32, pub cookie: __u64, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_15 { pub link_fd: __u32, pub new_prog_fd: __u32, @@ -866,23 +868,23 @@ pub struct bpf_attr__bindgen_ty_15 { pub old_prog_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_16 { pub link_fd: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_17 { pub type_: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_18 { pub link_fd: __u32, pub flags: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_attr__bindgen_ty_19 { pub prog_fd: __u32, pub map_fd: __u32, @@ -1148,6 +1150,8 @@ pub const BPF_F_ADJ_ROOM_ENCAP_L4_GRE: _bindgen_ty_15 = 8; pub const BPF_F_ADJ_ROOM_ENCAP_L4_UDP: _bindgen_ty_15 = 16; pub const BPF_F_ADJ_ROOM_NO_CSUM_RESET: _bindgen_ty_15 = 32; pub const BPF_F_ADJ_ROOM_ENCAP_L2_ETH: _bindgen_ty_15 = 64; +pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV4: _bindgen_ty_15 = 128; +pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV6: _bindgen_ty_15 = 256; pub type _bindgen_ty_15 = ::aya_bpf_cty::c_uint; pub const BPF_ADJ_ROOM_ENCAP_L2_MASK: _bindgen_ty_16 = 255; pub const BPF_ADJ_ROOM_ENCAP_L2_SHIFT: _bindgen_ty_16 = 56; @@ -1328,7 +1332,7 @@ pub mod bpf_ret_code { pub const BPF_FLOW_DISSECTOR_CONTINUE: Type = 129; } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_sock { pub bound_dev_if: __u32, pub family: __u32, @@ -1355,7 +1359,7 @@ impl bpf_sock { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_tcp_sock { pub snd_cwnd: __u32, pub srtt_us: __u32, @@ -1396,7 +1400,7 @@ pub union bpf_sock_tuple__bindgen_ty_1 { pub ipv6: bpf_sock_tuple__bindgen_ty_1__bindgen_ty_2, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_sock_tuple__bindgen_ty_1__bindgen_ty_1 { pub saddr: __be32, pub daddr: __be32, @@ -1404,7 +1408,7 @@ pub struct bpf_sock_tuple__bindgen_ty_1__bindgen_ty_1 { pub dport: __be16, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_sock_tuple__bindgen_ty_1__bindgen_ty_2 { pub saddr: [__be32; 4usize], pub daddr: [__be32; 4usize], @@ -1412,7 +1416,7 @@ pub struct bpf_sock_tuple__bindgen_ty_1__bindgen_ty_2 { pub dport: __be16, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_xdp_sock { pub queue_id: __u32, } @@ -1425,7 +1429,7 @@ pub mod xdp_action { pub const XDP_REDIRECT: Type = 4; } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct xdp_md { pub data: __u32, pub data_end: __u32, @@ -1590,7 +1594,7 @@ impl sk_reuseport_md__bindgen_ty_4 { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_prog_info { pub type_: __u32, pub id: __u32, @@ -1655,7 +1659,7 @@ impl bpf_prog_info { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_map_info { pub type_: __u32, pub id: __u32, @@ -1683,7 +1687,7 @@ impl bpf_map_info { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_btf_info { pub btf: __u64, pub btf_size: __u32, @@ -1711,20 +1715,20 @@ pub union bpf_link_info__bindgen_ty_1 { pub xdp: bpf_link_info__bindgen_ty_1__bindgen_ty_6, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_1 { pub tp_name: __u64, pub tp_name_len: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_2 { pub attach_type: __u32, pub target_obj_id: __u32, pub target_btf_id: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_3 { pub cgroup_id: __u64, pub attach_type: __u32, @@ -1743,7 +1747,7 @@ pub union bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_1 { pub map: bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_1__bindgen_ty_1, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_1__bindgen_ty_1 { pub map_id: __u32, } @@ -1754,25 +1758,25 @@ pub union bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_2 { pub task: bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_2__bindgen_ty_2, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_2__bindgen_ty_1 { pub cgroup_id: __u64, pub order: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_4__bindgen_ty_2__bindgen_ty_2 { pub tid: __u32, pub pid: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_5 { pub netns_ino: __u32, pub attach_type: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_link_info__bindgen_ty_1__bindgen_ty_6 { pub ifindex: __u32, } @@ -1948,7 +1952,7 @@ pub mod _bindgen_ty_32 { pub const BPF_WRITE_HDR_TCP_SYNACK_COOKIE: Type = 2; } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_perf_event_value { pub counter: __u64, pub enabled: __u64, @@ -1962,18 +1966,20 @@ pub const BPF_DEVCG_DEV_BLOCK: _bindgen_ty_34 = 1; pub const BPF_DEVCG_DEV_CHAR: _bindgen_ty_34 = 2; pub type _bindgen_ty_34 = ::aya_bpf_cty::c_uint; #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_cgroup_dev_ctx { pub access_type: __u32, pub major: __u32, pub minor: __u32, } #[repr(C)] +#[derive(Debug)] pub struct bpf_raw_tracepoint_args { pub args: __IncompleteArrayField<__u64>, } pub const BPF_FIB_LOOKUP_DIRECT: _bindgen_ty_35 = 1; pub const BPF_FIB_LOOKUP_OUTPUT: _bindgen_ty_35 = 2; +pub const BPF_FIB_LOOKUP_SKIP_NEIGH: _bindgen_ty_35 = 4; pub type _bindgen_ty_35 = ::aya_bpf_cty::c_uint; pub const BPF_FIB_LKUP_RET_SUCCESS: _bindgen_ty_36 = 0; pub const BPF_FIB_LKUP_RET_BLACKHOLE: _bindgen_ty_36 = 1; @@ -2086,25 +2092,25 @@ pub union bpf_flow_keys__bindgen_ty_1 { pub __bindgen_anon_2: bpf_flow_keys__bindgen_ty_1__bindgen_ty_2, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_flow_keys__bindgen_ty_1__bindgen_ty_1 { pub ipv4_src: __be32, pub ipv4_dst: __be32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_flow_keys__bindgen_ty_1__bindgen_ty_2 { pub ipv6_src: [__u32; 4usize], pub ipv6_dst: [__u32; 4usize], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_func_info { pub insn_off: __u32, pub type_id: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_line_info { pub insn_off: __u32, pub file_name_off: __u32, @@ -2112,13 +2118,13 @@ pub struct bpf_line_info { pub line_col: __u32, } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_spin_lock { pub val: __u32, } #[repr(C)] #[repr(align(8))] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_timer { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, @@ -2132,7 +2138,7 @@ impl bpf_timer { } #[repr(C)] #[repr(align(8))] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_dynptr { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, @@ -2146,7 +2152,7 @@ impl bpf_dynptr { } #[repr(C)] #[repr(align(8))] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_list_head { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, @@ -2160,7 +2166,7 @@ impl bpf_list_head { } #[repr(C)] #[repr(align(8))] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_list_node { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, @@ -2173,7 +2179,35 @@ impl bpf_list_node { } } #[repr(C)] -#[derive(Copy, Clone)] +#[repr(align(8))] +#[derive(Debug, 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, 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)] +#[derive(Debug, Copy, Clone)] pub struct bpf_sysctl { pub write: __u32, pub file_pos: __u32, @@ -2232,7 +2266,7 @@ impl bpf_sockopt__bindgen_ty_3 { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_pidns_info { pub pid: __u32, pub tgid: __u32, @@ -2281,7 +2315,7 @@ impl bpf_sk_lookup { } } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct btf_ptr { pub ptr: *mut ::aya_bpf_cty::c_void, pub type_id: __u32, @@ -2304,15 +2338,17 @@ pub mod bpf_core_relo_kind { pub const BPF_CORE_TYPE_MATCHES: Type = 12; } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_core_relo { pub insn_off: __u32, pub type_id: __u32, pub access_str_off: __u32, pub kind: bpf_core_relo_kind::Type, } +pub const BPF_F_TIMER_ABS: _bindgen_ty_39 = 1; +pub type _bindgen_ty_39 = ::aya_bpf_cty::c_uint; #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct pt_regs { pub r15: ::aya_bpf_cty::c_ulong, pub r14: ::aya_bpf_cty::c_ulong, @@ -2338,103 +2374,103 @@ pub struct pt_regs { } pub type sa_family_t = ::aya_bpf_cty::c_ushort; #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct sockaddr { pub sa_family: sa_family_t, pub sa_data: [::aya_bpf_cty::c_char; 14usize], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct bpf_perf_event_data { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct linux_binprm { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcphdr { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct seq_file { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcp6_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcp_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcp_timewait_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct tcp_request_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct udp6_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct unix_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct task_struct { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct cgroup { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct path { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct inode { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct socket { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct file { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct mptcp_sock { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct iphdr { _unused: [u8; 0], } #[repr(C)] -#[derive(Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub struct ipv6hdr { _unused: [u8; 0], } From 94049ec661ed715e65fb4fb29c92d10d803699cc Mon Sep 17 00:00:00 2001 From: Mary Date: Fri, 10 Mar 2023 16:10:37 +0100 Subject: [PATCH 3/7] aya: Fix MapData Clone implementation The Clone implementation of MapData was previously not storing the result of the dup operation. --- aya/src/maps/mod.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/aya/src/maps/mod.rs b/aya/src/maps/mod.rs index b7eafb6d..505adafd 100644 --- a/aya/src/maps/mod.rs +++ b/aya/src/maps/mod.rs @@ -635,12 +635,7 @@ impl Clone for MapData { fn clone(&self) -> MapData { MapData { obj: self.obj.clone(), - fd: { - if let Some(fd) = self.fd { - unsafe { Some(libc::dup(fd)) }; - } - None - }, + fd: self.fd.map(|fd| unsafe { libc::dup(fd) }), btf_fd: self.btf_fd, pinned: self.pinned, } From 2e3c1779be03898dd6a01644012ef21b2475ad63 Mon Sep 17 00:00:00 2001 From: Mikhail Trishchenkov Date: Mon, 20 Mar 2023 12:20:46 +0700 Subject: [PATCH 4/7] aya: Allow to attach XDP probe by interface index --- aya/src/programs/xdp.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/aya/src/programs/xdp.rs b/aya/src/programs/xdp.rs index d36d5f27..52805bc7 100644 --- a/aya/src/programs/xdp.rs +++ b/aya/src/programs/xdp.rs @@ -98,14 +98,29 @@ impl Xdp { /// [`XdpError::NetlinkError`] is returned for older /// kernels. pub fn attach(&mut self, interface: &str, flags: XdpFlags) -> Result { - let prog_fd = self.data.fd_or_err()?; let c_interface = CString::new(interface).unwrap(); - let if_index = unsafe { if_nametoindex(c_interface.as_ptr()) } as RawFd; + let if_index = unsafe { if_nametoindex(c_interface.as_ptr()) }; if if_index == 0 { return Err(ProgramError::UnknownInterface { name: interface.to_string(), }); } + self.attach_by_ifindex(if_index, flags) + } + + /// Attaches the program to the given `interface`. + /// + /// The returned value can be used to detach, see [Xdp::detach]. + /// + /// # Errors + /// + /// When attaching fails, [`ProgramError::SyscallError`] is returned for + /// kernels `>= 5.9.0`, and instead + /// [`XdpError::NetlinkError`] is returned for older + /// kernels. + pub fn attach_by_ifindex(&mut self, if_index: libc::c_uint, flags: XdpFlags) -> Result { + let prog_fd = self.data.fd_or_err()?; + let if_index = if_index as RawFd; let k_ver = kernel_version().unwrap(); if k_ver >= (5, 9, 0) { From 676b5cdc0df380471090153ab4ff2e641e4e1d03 Mon Sep 17 00:00:00 2001 From: Mikhail Trishchenkov Date: Mon, 20 Mar 2023 14:00:55 +0700 Subject: [PATCH 5/7] Rename method and fix comment --- aya/src/programs/xdp.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aya/src/programs/xdp.rs b/aya/src/programs/xdp.rs index 52805bc7..909f95c4 100644 --- a/aya/src/programs/xdp.rs +++ b/aya/src/programs/xdp.rs @@ -105,10 +105,10 @@ impl Xdp { name: interface.to_string(), }); } - self.attach_by_ifindex(if_index, flags) + self.attach_to_if_index(if_index, flags) } - /// Attaches the program to the given `interface`. + /// Attaches the program to the given interface index. /// /// The returned value can be used to detach, see [Xdp::detach]. /// @@ -118,7 +118,7 @@ impl Xdp { /// kernels `>= 5.9.0`, and instead /// [`XdpError::NetlinkError`] is returned for older /// kernels. - pub fn attach_by_ifindex(&mut self, if_index: libc::c_uint, flags: XdpFlags) -> Result { + pub fn attach_to_if_index(&mut self, if_index: libc::c_uint, flags: XdpFlags) -> Result { let prog_fd = self.data.fd_or_err()?; let if_index = if_index as RawFd; From 896e3ab3130c4de44e8c0f4f974163c13aa50ff0 Mon Sep 17 00:00:00 2001 From: Mikhail Trishchenkov Date: Mon, 20 Mar 2023 16:11:13 +0700 Subject: [PATCH 6/7] Fix formatting --- aya/src/programs/xdp.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aya/src/programs/xdp.rs b/aya/src/programs/xdp.rs index 909f95c4..f88b0e17 100644 --- a/aya/src/programs/xdp.rs +++ b/aya/src/programs/xdp.rs @@ -118,7 +118,11 @@ impl Xdp { /// kernels `>= 5.9.0`, and instead /// [`XdpError::NetlinkError`] is returned for older /// kernels. - pub fn attach_to_if_index(&mut self, if_index: libc::c_uint, flags: XdpFlags) -> Result { + pub fn attach_to_if_index( + &mut self, + if_index: libc::c_uint, + flags: XdpFlags, + ) -> Result { let prog_fd = self.data.fd_or_err()?; let if_index = if_index as RawFd; From ce60854934312c9ebb75178f44faf9369febf6ad Mon Sep 17 00:00:00 2001 From: Mikhail Trishchenkov Date: Mon, 20 Mar 2023 21:47:24 +0700 Subject: [PATCH 7/7] Don't leak libc types --- aya/src/programs/xdp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aya/src/programs/xdp.rs b/aya/src/programs/xdp.rs index f88b0e17..63f00987 100644 --- a/aya/src/programs/xdp.rs +++ b/aya/src/programs/xdp.rs @@ -120,7 +120,7 @@ impl Xdp { /// kernels. pub fn attach_to_if_index( &mut self, - if_index: libc::c_uint, + if_index: u32, flags: XdpFlags, ) -> Result { let prog_fd = self.data.fd_or_err()?;