From f7cad4436fa94cc24bd75ccce41deee9dd81911b Mon Sep 17 00:00:00 2001 From: Kevin Ji <1146876+kevinji@users.noreply.github.com> Date: Thu, 28 Mar 2024 14:52:11 -0700 Subject: [PATCH] aya-obj: Include VETH_INFO_PEER and ifaddrmsg --- aya-obj/include/linux_wrapper.h | 1 + .../src/generated/linux_bindings_aarch64.rs | 19 +++++ aya-obj/src/generated/linux_bindings_armv7.rs | 19 +++++ .../src/generated/linux_bindings_riscv64.rs | 19 +++++ .../src/generated/linux_bindings_x86_64.rs | 19 +++++ xtask/public-api/aya-obj.txt | 81 +++++++++++++++++++ xtask/src/codegen/aya.rs | 2 + 7 files changed, 160 insertions(+) diff --git a/aya-obj/include/linux_wrapper.h b/aya-obj/include/linux_wrapper.h index 8be2459a..d10e325a 100644 --- a/aya-obj/include/linux_wrapper.h +++ b/aya-obj/include/linux_wrapper.h @@ -6,6 +6,7 @@ #include #include #include +#include /* workaround the fact that bindgen can't parse the IOC macros */ int AYA_PERF_EVENT_IOC_ENABLE = PERF_EVENT_IOC_ENABLE; diff --git a/aya-obj/src/generated/linux_bindings_aarch64.rs b/aya-obj/src/generated/linux_bindings_aarch64.rs index 95b7e0d8..e10bc03e 100644 --- a/aya-obj/src/generated/linux_bindings_aarch64.rs +++ b/aya-obj/src/generated/linux_bindings_aarch64.rs @@ -2384,6 +2384,15 @@ pub const __TCA_BPF_MAX: _bindgen_ty_152 = 12; pub type _bindgen_ty_152 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct ifaddrmsg { + pub ifa_family: __u8, + pub ifa_prefixlen: __u8, + pub ifa_flags: __u8, + pub ifa_scope: __u8, + pub ifa_index: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct ifinfomsg { pub ifi_family: ::core::ffi::c_uchar, pub __ifi_pad: ::core::ffi::c_uchar, @@ -2421,6 +2430,16 @@ pub const TCA_EGRESS_BLOCK: _bindgen_ty_172 = 14; pub const TCA_DUMP_FLAGS: _bindgen_ty_172 = 15; pub const __TCA_MAX: _bindgen_ty_172 = 16; pub type _bindgen_ty_172 = ::core::ffi::c_uint; +pub const VETH_INFO_UNSPEC: _bindgen_ty_175 = _bindgen_ty_175::VETH_INFO_UNSPEC; +pub const VETH_INFO_PEER: _bindgen_ty_175 = _bindgen_ty_175::VETH_INFO_PEER; +pub const __VETH_INFO_MAX: _bindgen_ty_175 = _bindgen_ty_175::__VETH_INFO_MAX; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_175 { + VETH_INFO_UNSPEC = 0, + VETH_INFO_PEER = 1, + __VETH_INFO_MAX = 2, +} 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 4dcfeb80..8090d0b6 100644 --- a/aya-obj/src/generated/linux_bindings_armv7.rs +++ b/aya-obj/src/generated/linux_bindings_armv7.rs @@ -2384,6 +2384,15 @@ pub const __TCA_BPF_MAX: _bindgen_ty_152 = 12; pub type _bindgen_ty_152 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct ifaddrmsg { + pub ifa_family: __u8, + pub ifa_prefixlen: __u8, + pub ifa_flags: __u8, + pub ifa_scope: __u8, + pub ifa_index: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct ifinfomsg { pub ifi_family: ::core::ffi::c_uchar, pub __ifi_pad: ::core::ffi::c_uchar, @@ -2421,6 +2430,16 @@ pub const TCA_EGRESS_BLOCK: _bindgen_ty_172 = 14; pub const TCA_DUMP_FLAGS: _bindgen_ty_172 = 15; pub const __TCA_MAX: _bindgen_ty_172 = 16; pub type _bindgen_ty_172 = ::core::ffi::c_uint; +pub const VETH_INFO_UNSPEC: _bindgen_ty_175 = _bindgen_ty_175::VETH_INFO_UNSPEC; +pub const VETH_INFO_PEER: _bindgen_ty_175 = _bindgen_ty_175::VETH_INFO_PEER; +pub const __VETH_INFO_MAX: _bindgen_ty_175 = _bindgen_ty_175::__VETH_INFO_MAX; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_175 { + VETH_INFO_UNSPEC = 0, + VETH_INFO_PEER = 1, + __VETH_INFO_MAX = 2, +} 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 95b7e0d8..e10bc03e 100644 --- a/aya-obj/src/generated/linux_bindings_riscv64.rs +++ b/aya-obj/src/generated/linux_bindings_riscv64.rs @@ -2384,6 +2384,15 @@ pub const __TCA_BPF_MAX: _bindgen_ty_152 = 12; pub type _bindgen_ty_152 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct ifaddrmsg { + pub ifa_family: __u8, + pub ifa_prefixlen: __u8, + pub ifa_flags: __u8, + pub ifa_scope: __u8, + pub ifa_index: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct ifinfomsg { pub ifi_family: ::core::ffi::c_uchar, pub __ifi_pad: ::core::ffi::c_uchar, @@ -2421,6 +2430,16 @@ pub const TCA_EGRESS_BLOCK: _bindgen_ty_172 = 14; pub const TCA_DUMP_FLAGS: _bindgen_ty_172 = 15; pub const __TCA_MAX: _bindgen_ty_172 = 16; pub type _bindgen_ty_172 = ::core::ffi::c_uint; +pub const VETH_INFO_UNSPEC: _bindgen_ty_175 = _bindgen_ty_175::VETH_INFO_UNSPEC; +pub const VETH_INFO_PEER: _bindgen_ty_175 = _bindgen_ty_175::VETH_INFO_PEER; +pub const __VETH_INFO_MAX: _bindgen_ty_175 = _bindgen_ty_175::__VETH_INFO_MAX; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_175 { + VETH_INFO_UNSPEC = 0, + VETH_INFO_PEER = 1, + __VETH_INFO_MAX = 2, +} 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 95b7e0d8..e10bc03e 100644 --- a/aya-obj/src/generated/linux_bindings_x86_64.rs +++ b/aya-obj/src/generated/linux_bindings_x86_64.rs @@ -2384,6 +2384,15 @@ pub const __TCA_BPF_MAX: _bindgen_ty_152 = 12; pub type _bindgen_ty_152 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct ifaddrmsg { + pub ifa_family: __u8, + pub ifa_prefixlen: __u8, + pub ifa_flags: __u8, + pub ifa_scope: __u8, + pub ifa_index: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct ifinfomsg { pub ifi_family: ::core::ffi::c_uchar, pub __ifi_pad: ::core::ffi::c_uchar, @@ -2421,6 +2430,16 @@ pub const TCA_EGRESS_BLOCK: _bindgen_ty_172 = 14; pub const TCA_DUMP_FLAGS: _bindgen_ty_172 = 15; pub const __TCA_MAX: _bindgen_ty_172 = 16; pub type _bindgen_ty_172 = ::core::ffi::c_uint; +pub const VETH_INFO_UNSPEC: _bindgen_ty_175 = _bindgen_ty_175::VETH_INFO_UNSPEC; +pub const VETH_INFO_PEER: _bindgen_ty_175 = _bindgen_ty_175::VETH_INFO_PEER; +pub const __VETH_INFO_MAX: _bindgen_ty_175 = _bindgen_ty_175::__VETH_INFO_MAX; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_175 { + VETH_INFO_UNSPEC = 0, + VETH_INFO_PEER = 1, + __VETH_INFO_MAX = 2, +} 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/xtask/public-api/aya-obj.txt b/xtask/public-api/aya-obj.txt index e09efd3a..59647123 100644 --- a/xtask/public-api/aya-obj.txt +++ b/xtask/public-api/aya-obj.txt @@ -1321,6 +1321,47 @@ pub const aya_obj::generated::bpf_core_relo_kind::BPF_CORE_TYPE_ID_TARGET: aya_o pub const aya_obj::generated::bpf_core_relo_kind::BPF_CORE_TYPE_MATCHES: aya_obj::generated::bpf_core_relo_kind::Type = 12u32 pub const aya_obj::generated::bpf_core_relo_kind::BPF_CORE_TYPE_SIZE: aya_obj::generated::bpf_core_relo_kind::Type = 9u32 pub type aya_obj::generated::bpf_core_relo_kind::Type = core::ffi::c_uint +#[repr(u32)] pub enum aya_obj::generated::_bindgen_ty_175 +pub aya_obj::generated::_bindgen_ty_175::VETH_INFO_PEER = 1 +pub aya_obj::generated::_bindgen_ty_175::VETH_INFO_UNSPEC = 0 +pub aya_obj::generated::_bindgen_ty_175::__VETH_INFO_MAX = 2 +impl core::clone::Clone for aya_obj::generated::_bindgen_ty_175 +pub fn aya_obj::generated::_bindgen_ty_175::clone(&self) -> aya_obj::generated::_bindgen_ty_175 +impl core::cmp::Eq for aya_obj::generated::_bindgen_ty_175 +impl core::cmp::PartialEq for aya_obj::generated::_bindgen_ty_175 +pub fn aya_obj::generated::_bindgen_ty_175::eq(&self, other: &aya_obj::generated::_bindgen_ty_175) -> bool +impl core::fmt::Debug for aya_obj::generated::_bindgen_ty_175 +pub fn aya_obj::generated::_bindgen_ty_175::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::hash::Hash for aya_obj::generated::_bindgen_ty_175 +pub fn aya_obj::generated::_bindgen_ty_175::hash<__H: core::hash::Hasher>(&self, state: &mut __H) +impl core::marker::Copy for aya_obj::generated::_bindgen_ty_175 +impl core::marker::StructuralPartialEq for aya_obj::generated::_bindgen_ty_175 +impl core::marker::Freeze for aya_obj::generated::_bindgen_ty_175 +impl core::marker::Send for aya_obj::generated::_bindgen_ty_175 +impl core::marker::Sync for aya_obj::generated::_bindgen_ty_175 +impl core::marker::Unpin for aya_obj::generated::_bindgen_ty_175 +impl core::panic::unwind_safe::RefUnwindSafe for aya_obj::generated::_bindgen_ty_175 +impl core::panic::unwind_safe::UnwindSafe for aya_obj::generated::_bindgen_ty_175 +impl core::convert::Into for aya_obj::generated::_bindgen_ty_175 where U: core::convert::From +pub fn aya_obj::generated::_bindgen_ty_175::into(self) -> U +impl core::convert::TryFrom for aya_obj::generated::_bindgen_ty_175 where U: core::convert::Into +pub type aya_obj::generated::_bindgen_ty_175::Error = core::convert::Infallible +pub fn aya_obj::generated::_bindgen_ty_175::try_from(value: U) -> core::result::Result>::Error> +impl core::convert::TryInto for aya_obj::generated::_bindgen_ty_175 where U: core::convert::TryFrom +pub type aya_obj::generated::_bindgen_ty_175::Error = >::Error +pub fn aya_obj::generated::_bindgen_ty_175::try_into(self) -> core::result::Result>::Error> +impl alloc::borrow::ToOwned for aya_obj::generated::_bindgen_ty_175 where T: core::clone::Clone +pub type aya_obj::generated::_bindgen_ty_175::Owned = T +pub fn aya_obj::generated::_bindgen_ty_175::clone_into(&self, target: &mut T) +pub fn aya_obj::generated::_bindgen_ty_175::to_owned(&self) -> T +impl core::any::Any for aya_obj::generated::_bindgen_ty_175 where T: 'static + core::marker::Sized +pub fn aya_obj::generated::_bindgen_ty_175::type_id(&self) -> core::any::TypeId +impl core::borrow::Borrow for aya_obj::generated::_bindgen_ty_175 where T: core::marker::Sized +pub fn aya_obj::generated::_bindgen_ty_175::borrow(&self) -> &T +impl core::borrow::BorrowMut for aya_obj::generated::_bindgen_ty_175 where T: core::marker::Sized +pub fn aya_obj::generated::_bindgen_ty_175::borrow_mut(&mut self) -> &mut T +impl core::convert::From for aya_obj::generated::_bindgen_ty_175 +pub fn aya_obj::generated::_bindgen_ty_175::from(t: T) -> T #[repr(u32)] pub enum aya_obj::generated::bpf_attach_type pub aya_obj::generated::bpf_attach_type::BPF_CGROUP_DEVICE = 6 pub aya_obj::generated::bpf_attach_type::BPF_CGROUP_GETSOCKOPT = 21 @@ -5680,6 +5721,43 @@ impl core::borrow::BorrowMut for aya_obj::generated::btf_var_secinfo where pub fn aya_obj::generated::btf_var_secinfo::borrow_mut(&mut self) -> &mut T impl core::convert::From for aya_obj::generated::btf_var_secinfo pub fn aya_obj::generated::btf_var_secinfo::from(t: T) -> T +#[repr(C)] pub struct aya_obj::generated::ifaddrmsg +pub aya_obj::generated::ifaddrmsg::ifa_family: aya_obj::generated::__u8 +pub aya_obj::generated::ifaddrmsg::ifa_flags: aya_obj::generated::__u8 +pub aya_obj::generated::ifaddrmsg::ifa_index: aya_obj::generated::__u32 +pub aya_obj::generated::ifaddrmsg::ifa_prefixlen: aya_obj::generated::__u8 +pub aya_obj::generated::ifaddrmsg::ifa_scope: aya_obj::generated::__u8 +impl core::clone::Clone for aya_obj::generated::ifaddrmsg +pub fn aya_obj::generated::ifaddrmsg::clone(&self) -> aya_obj::generated::ifaddrmsg +impl core::fmt::Debug for aya_obj::generated::ifaddrmsg +pub fn aya_obj::generated::ifaddrmsg::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::marker::Copy for aya_obj::generated::ifaddrmsg +impl core::marker::Freeze for aya_obj::generated::ifaddrmsg +impl core::marker::Send for aya_obj::generated::ifaddrmsg +impl core::marker::Sync for aya_obj::generated::ifaddrmsg +impl core::marker::Unpin for aya_obj::generated::ifaddrmsg +impl core::panic::unwind_safe::RefUnwindSafe for aya_obj::generated::ifaddrmsg +impl core::panic::unwind_safe::UnwindSafe for aya_obj::generated::ifaddrmsg +impl core::convert::Into for aya_obj::generated::ifaddrmsg where U: core::convert::From +pub fn aya_obj::generated::ifaddrmsg::into(self) -> U +impl core::convert::TryFrom for aya_obj::generated::ifaddrmsg where U: core::convert::Into +pub type aya_obj::generated::ifaddrmsg::Error = core::convert::Infallible +pub fn aya_obj::generated::ifaddrmsg::try_from(value: U) -> core::result::Result>::Error> +impl core::convert::TryInto for aya_obj::generated::ifaddrmsg where U: core::convert::TryFrom +pub type aya_obj::generated::ifaddrmsg::Error = >::Error +pub fn aya_obj::generated::ifaddrmsg::try_into(self) -> core::result::Result>::Error> +impl alloc::borrow::ToOwned for aya_obj::generated::ifaddrmsg where T: core::clone::Clone +pub type aya_obj::generated::ifaddrmsg::Owned = T +pub fn aya_obj::generated::ifaddrmsg::clone_into(&self, target: &mut T) +pub fn aya_obj::generated::ifaddrmsg::to_owned(&self) -> T +impl core::any::Any for aya_obj::generated::ifaddrmsg where T: 'static + core::marker::Sized +pub fn aya_obj::generated::ifaddrmsg::type_id(&self) -> core::any::TypeId +impl core::borrow::Borrow for aya_obj::generated::ifaddrmsg where T: core::marker::Sized +pub fn aya_obj::generated::ifaddrmsg::borrow(&self) -> &T +impl core::borrow::BorrowMut for aya_obj::generated::ifaddrmsg where T: core::marker::Sized +pub fn aya_obj::generated::ifaddrmsg::borrow_mut(&mut self) -> &mut T +impl core::convert::From for aya_obj::generated::ifaddrmsg +pub fn aya_obj::generated::ifaddrmsg::from(t: T) -> T #[repr(C)] pub struct aya_obj::generated::ifinfomsg pub aya_obj::generated::ifinfomsg::__ifi_pad: core::ffi::c_uchar pub aya_obj::generated::ifinfomsg::ifi_change: core::ffi::c_uint @@ -6222,6 +6300,8 @@ pub const aya_obj::generated::TC_H_MIN_MASK: u32 = 65_535u32 pub const aya_obj::generated::TC_H_MIN_PRIORITY: u32 = 65_504u32 pub const aya_obj::generated::TC_H_ROOT: u32 = 4_294_967_295u32 pub const aya_obj::generated::TC_H_UNSPEC: u32 = 0u32 +pub const aya_obj::generated::VETH_INFO_PEER: _bindgen_ty_175::VETH_INFO_PEER +pub const aya_obj::generated::VETH_INFO_UNSPEC: _bindgen_ty_175::VETH_INFO_UNSPEC pub const aya_obj::generated::XDP_FLAGS_DRV_MODE: u32 = 4u32 pub const aya_obj::generated::XDP_FLAGS_HW_MODE: u32 = 8u32 pub const aya_obj::generated::XDP_FLAGS_MASK: u32 = 31u32 @@ -6232,6 +6312,7 @@ pub const aya_obj::generated::XDP_FLAGS_UPDATE_IF_NOEXIST: u32 = 1u32 pub const aya_obj::generated::__IFLA_XDP_MAX: aya_obj::generated::_bindgen_ty_92 = 9u32 pub const aya_obj::generated::__TCA_BPF_MAX: aya_obj::generated::_bindgen_ty_152 = 12u32 pub const aya_obj::generated::__TCA_MAX: aya_obj::generated::_bindgen_ty_172 = 16u32 +pub const aya_obj::generated::__VETH_INFO_MAX: _bindgen_ty_175::__VETH_INFO_MAX pub type aya_obj::generated::__s16 = core::ffi::c_short pub type aya_obj::generated::__s32 = core::ffi::c_int pub type aya_obj::generated::__s64 = core::ffi::c_longlong diff --git a/xtask/src/codegen/aya.rs b/xtask/src/codegen/aya.rs index be447bd5..14cc9d45 100644 --- a/xtask/src/codegen/aya.rs +++ b/xtask/src/codegen/aya.rs @@ -103,6 +103,7 @@ fn codegen_bindings(opts: &SysrootOptions, libbpf_dir: &Path) -> Result<(), anyh "perf_type_id", "perf_event_type", // NETLINK + "ifaddrmsg", "ifinfomsg", "tcmsg", ]; @@ -155,6 +156,7 @@ fn codegen_bindings(opts: &SysrootOptions, libbpf_dir: &Path) -> Result<(), anyh "TC_H_MIN_PRIORITY", "TC_H_MIN_INGRESS", "TC_H_MIN_EGRESS", + "VETH_INFO_PEER", // Ringbuf "BPF_RINGBUF_.*", ];