[codegen] Update libbpf to 324f3c3846d99c8a1e1384a55591f893f0ae5de4Update libbpf to 324f3c3846d99c8a1e1384a55591f893f0ae5de4

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
A	aya-obj/src/generated/linux_bindings_mips.rs
M	aya-obj/src/generated/linux_bindings_powerpc64.rs
M	aya-obj/src/generated/linux_bindings_riscv64.rs
M	aya-obj/src/generated/linux_bindings_s390x.rs
M	aya-obj/src/generated/linux_bindings_x86_64.rs
M	ebpf/aya-ebpf-bindings/src/aarch64/bindings.rs
M	ebpf/aya-ebpf-bindings/src/armv7/bindings.rs
A	ebpf/aya-ebpf-bindings/src/mips/bindings.rs
A	ebpf/aya-ebpf-bindings/src/mips/helpers.rs
M	ebpf/aya-ebpf-bindings/src/powerpc64/bindings.rs
M	ebpf/aya-ebpf-bindings/src/riscv64/bindings.rs
M	ebpf/aya-ebpf-bindings/src/s390x/bindings.rs
M	ebpf/aya-ebpf-bindings/src/x86_64/bindings.rs
reviewable/pr1153/r1
dave-tucker 3 months ago
parent b960fd27b3
commit 2852bcab8e

@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.70.1 */
/* automatically generated by rust-bindgen 0.71.1 */
pub type __u8 = ::core::ffi::c_uchar;
pub type __u16 = ::core::ffi::c_ushort;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -14,10 +14,7 @@ where
Storage: AsRef<[u8]> + AsMut<[u8]>,
{
#[inline]
pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = self.storage.as_ref()[byte_index];
fn extract_bit(byte: u8, index: usize) -> bool {
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
@ -27,10 +24,21 @@ where
byte & mask == mask
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
let byte = self.storage.as_ref()[byte_index];
Self::extract_bit(byte, index)
}
#[inline]
pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
let byte_index = index / 8;
let byte = *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize);
Self::extract_bit(byte, index)
}
#[inline]
fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
@ -38,12 +46,27 @@ where
};
let mask = 1 << bit_index;
if val {
*byte |= mask;
byte | mask
} else {
*byte &= !mask;
byte & !mask
}
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
*byte = Self::change_bit(*byte, index, val);
}
#[inline]
pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
let byte_index = index / 8;
let byte =
(core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize);
*byte = Self::change_bit(*byte, index, val);
}
#[inline]
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@ -62,6 +85,24 @@ where
val
}
#[inline]
pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
let mut val = 0;
for i in 0..(bit_width as usize) {
if Self::raw_get_bit(this, i + bit_offset) {
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
val |= 1 << index;
}
}
val
}
#[inline]
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@ -77,6 +118,22 @@ where
self.set_bit(index + bit_offset, val_bit_is_set);
}
}
#[inline]
pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
for i in 0..(bit_width as usize) {
let mask = 1 << i;
let val_bit_is_set = val & mask == mask;
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
Self::raw_set_bit(this, index + bit_offset, val_bit_is_set);
}
}
}
#[repr(C)]
#[derive(Default)]
@ -176,6 +233,7 @@ pub const BPF_F_REPLACE: u32 = 4;
pub const BPF_F_BEFORE: u32 = 8;
pub const BPF_F_AFTER: u32 = 16;
pub const BPF_F_ID: u32 = 32;
pub const BPF_F_LINK: u32 = 8192;
pub const BPF_F_STRICT_ALIGNMENT: u32 = 1;
pub const BPF_F_ANY_ALIGNMENT: u32 = 2;
pub const BPF_F_TEST_RND_HI32: u32 = 4;
@ -211,6 +269,9 @@ pub const TC_ACT_REDIRECT: u32 = 7;
pub const TC_ACT_TRAP: u32 = 8;
pub const TC_ACT_VALUE_MAX: u32 = 8;
pub const TC_ACT_EXT_VAL_MASK: u32 = 268435455;
pub const TC_ACT_JUMP: u32 = 268435456;
pub const TC_ACT_GOTO_CHAIN: u32 = 536870912;
pub const TC_ACT_EXT_OPCODE_MAX: u32 = 536870912;
pub const SOL_SOCKET: u32 = 1;
pub const SO_DEBUG: u32 = 1;
pub const SO_REUSEADDR: u32 = 2;
@ -434,6 +495,28 @@ impl bpf_insn {
}
}
#[inline]
pub unsafe fn dst_reg_raw(this: *const Self) -> __u8 {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
0usize,
4u8,
) as u8)
}
}
#[inline]
pub unsafe fn set_dst_reg_raw(this: *mut Self, val: __u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
0usize,
4u8,
val as u64,
)
}
}
#[inline]
pub fn src_reg(&self) -> __u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
}
@ -445,6 +528,28 @@ impl bpf_insn {
}
}
#[inline]
pub unsafe fn src_reg_raw(this: *const Self) -> __u8 {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
4usize,
4u8,
) as u8)
}
}
#[inline]
pub unsafe fn set_src_reg_raw(this: *mut Self, val: __u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
4usize,
4u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(dst_reg: __u8, src_reg: __u8) -> __BindgenBitfieldUnit<[u8; 1usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
__bindgen_bitfield_unit.set(0usize, 4u8, {
@ -1957,6 +2062,28 @@ impl bpf_prog_info {
}
}
#[inline]
pub unsafe fn gpl_compatible_raw(this: *const Self) -> __u32 {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
0usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_gpl_compatible_raw(this: *mut Self, val: __u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
0usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(gpl_compatible: __u32) -> __BindgenBitfieldUnit<[u8; 4usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
__bindgen_bitfield_unit.set(0usize, 1u8, {

@ -14,10 +14,7 @@ where
Storage: AsRef<[u8]> + AsMut<[u8]>,
{
#[inline]
pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = self.storage.as_ref()[byte_index];
fn extract_bit(byte: u8, index: usize) -> bool {
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
@ -27,10 +24,21 @@ where
byte & mask == mask
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
let byte = self.storage.as_ref()[byte_index];
Self::extract_bit(byte, index)
}
#[inline]
pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
let byte_index = index / 8;
let byte = *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize);
Self::extract_bit(byte, index)
}
#[inline]
fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
@ -38,12 +46,27 @@ where
};
let mask = 1 << bit_index;
if val {
*byte |= mask;
byte | mask
} else {
*byte &= !mask;
byte & !mask
}
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
*byte = Self::change_bit(*byte, index, val);
}
#[inline]
pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
let byte_index = index / 8;
let byte =
(core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize);
*byte = Self::change_bit(*byte, index, val);
}
#[inline]
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@ -62,6 +85,24 @@ where
val
}
#[inline]
pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
let mut val = 0;
for i in 0..(bit_width as usize) {
if Self::raw_get_bit(this, i + bit_offset) {
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
val |= 1 << index;
}
}
val
}
#[inline]
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@ -77,6 +118,22 @@ where
self.set_bit(index + bit_offset, val_bit_is_set);
}
}
#[inline]
pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
for i in 0..(bit_width as usize) {
let mask = 1 << i;
let val_bit_is_set = val & mask == mask;
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
Self::raw_set_bit(this, index + bit_offset, val_bit_is_set);
}
}
}
#[repr(C)]
#[derive(Default)]
@ -176,6 +233,7 @@ pub const BPF_F_REPLACE: u32 = 4;
pub const BPF_F_BEFORE: u32 = 8;
pub const BPF_F_AFTER: u32 = 16;
pub const BPF_F_ID: u32 = 32;
pub const BPF_F_LINK: u32 = 8192;
pub const BPF_F_STRICT_ALIGNMENT: u32 = 1;
pub const BPF_F_ANY_ALIGNMENT: u32 = 2;
pub const BPF_F_TEST_RND_HI32: u32 = 4;
@ -211,6 +269,9 @@ pub const TC_ACT_REDIRECT: u32 = 7;
pub const TC_ACT_TRAP: u32 = 8;
pub const TC_ACT_VALUE_MAX: u32 = 8;
pub const TC_ACT_EXT_VAL_MASK: u32 = 268435455;
pub const TC_ACT_JUMP: u32 = 268435456;
pub const TC_ACT_GOTO_CHAIN: u32 = 536870912;
pub const TC_ACT_EXT_OPCODE_MAX: u32 = 536870912;
pub const SOL_SOCKET: u32 = 1;
pub const SO_DEBUG: u32 = 1;
pub const SO_REUSEADDR: u32 = 2;
@ -280,6 +341,11 @@ pub const SO_TIMESTAMPING_NEW: u32 = 65;
pub const SO_RCVTIMEO_NEW: u32 = 66;
pub const SO_SNDTIMEO_NEW: u32 = 67;
pub const SO_DETACH_REUSEPORT_BPF: u32 = 68;
pub const SO_TIMESTAMP: u32 = 29;
pub const SO_TIMESTAMPNS: u32 = 35;
pub const SO_TIMESTAMPING: u32 = 37;
pub const SO_RCVTIMEO: u32 = 20;
pub const SO_SNDTIMEO: u32 = 21;
pub type __u8 = ::aya_ebpf_cty::c_uchar;
pub type __s16 = ::aya_ebpf_cty::c_short;
pub type __u16 = ::aya_ebpf_cty::c_ushort;
@ -424,6 +490,28 @@ impl bpf_insn {
}
}
#[inline]
pub unsafe fn dst_reg_raw(this: *const Self) -> __u8 {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
0usize,
4u8,
) as u8)
}
}
#[inline]
pub unsafe fn set_dst_reg_raw(this: *mut Self, val: __u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
0usize,
4u8,
val as u64,
)
}
}
#[inline]
pub fn src_reg(&self) -> __u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
}
@ -435,6 +523,28 @@ impl bpf_insn {
}
}
#[inline]
pub unsafe fn src_reg_raw(this: *const Self) -> __u8 {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
4usize,
4u8,
) as u8)
}
}
#[inline]
pub unsafe fn set_src_reg_raw(this: *mut Self, val: __u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
4usize,
4u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(dst_reg: __u8, src_reg: __u8) -> __BindgenBitfieldUnit<[u8; 1usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
__bindgen_bitfield_unit.set(0usize, 4u8, {
@ -1956,6 +2066,28 @@ impl bpf_prog_info {
}
}
#[inline]
pub unsafe fn gpl_compatible_raw(this: *const Self) -> __u32 {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
0usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_gpl_compatible_raw(this: *mut Self, val: __u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
0usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(gpl_compatible: __u32) -> __BindgenBitfieldUnit<[u8; 4usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
__bindgen_bitfield_unit.set(0usize, 1u8, {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -14,10 +14,7 @@ where
Storage: AsRef<[u8]> + AsMut<[u8]>,
{
#[inline]
pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = self.storage.as_ref()[byte_index];
fn extract_bit(byte: u8, index: usize) -> bool {
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
@ -27,10 +24,21 @@ where
byte & mask == mask
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
let byte = self.storage.as_ref()[byte_index];
Self::extract_bit(byte, index)
}
#[inline]
pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
let byte_index = index / 8;
let byte = *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize);
Self::extract_bit(byte, index)
}
#[inline]
fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
@ -38,12 +46,27 @@ where
};
let mask = 1 << bit_index;
if val {
*byte |= mask;
byte | mask
} else {
*byte &= !mask;
byte & !mask
}
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
*byte = Self::change_bit(*byte, index, val);
}
#[inline]
pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
let byte_index = index / 8;
let byte =
(core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize);
*byte = Self::change_bit(*byte, index, val);
}
#[inline]
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@ -62,6 +85,24 @@ where
val
}
#[inline]
pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
let mut val = 0;
for i in 0..(bit_width as usize) {
if Self::raw_get_bit(this, i + bit_offset) {
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
val |= 1 << index;
}
}
val
}
#[inline]
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@ -77,6 +118,22 @@ where
self.set_bit(index + bit_offset, val_bit_is_set);
}
}
#[inline]
pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
for i in 0..(bit_width as usize) {
let mask = 1 << i;
let val_bit_is_set = val & mask == mask;
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
Self::raw_set_bit(this, index + bit_offset, val_bit_is_set);
}
}
}
#[repr(C)]
#[derive(Default)]
@ -176,6 +233,7 @@ pub const BPF_F_REPLACE: u32 = 4;
pub const BPF_F_BEFORE: u32 = 8;
pub const BPF_F_AFTER: u32 = 16;
pub const BPF_F_ID: u32 = 32;
pub const BPF_F_LINK: u32 = 8192;
pub const BPF_F_STRICT_ALIGNMENT: u32 = 1;
pub const BPF_F_ANY_ALIGNMENT: u32 = 2;
pub const BPF_F_TEST_RND_HI32: u32 = 4;
@ -211,6 +269,9 @@ pub const TC_ACT_REDIRECT: u32 = 7;
pub const TC_ACT_TRAP: u32 = 8;
pub const TC_ACT_VALUE_MAX: u32 = 8;
pub const TC_ACT_EXT_VAL_MASK: u32 = 268435455;
pub const TC_ACT_JUMP: u32 = 268435456;
pub const TC_ACT_GOTO_CHAIN: u32 = 536870912;
pub const TC_ACT_EXT_OPCODE_MAX: u32 = 536870912;
pub const SO_RCVLOWAT: u32 = 16;
pub const SO_SNDLOWAT: u32 = 17;
pub const SO_RCVTIMEO_OLD: u32 = 18;
@ -429,6 +490,28 @@ impl bpf_insn {
}
}
#[inline]
pub unsafe fn dst_reg_raw(this: *const Self) -> __u8 {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
0usize,
4u8,
) as u8)
}
}
#[inline]
pub unsafe fn set_dst_reg_raw(this: *mut Self, val: __u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
0usize,
4u8,
val as u64,
)
}
}
#[inline]
pub fn src_reg(&self) -> __u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
}
@ -440,6 +523,28 @@ impl bpf_insn {
}
}
#[inline]
pub unsafe fn src_reg_raw(this: *const Self) -> __u8 {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
4usize,
4u8,
) as u8)
}
}
#[inline]
pub unsafe fn set_src_reg_raw(this: *mut Self, val: __u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
4usize,
4u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(dst_reg: __u8, src_reg: __u8) -> __BindgenBitfieldUnit<[u8; 1usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
__bindgen_bitfield_unit.set(0usize, 4u8, {
@ -1952,6 +2057,28 @@ impl bpf_prog_info {
}
}
#[inline]
pub unsafe fn gpl_compatible_raw(this: *const Self) -> __u32 {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
0usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_gpl_compatible_raw(this: *mut Self, val: __u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
0usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(gpl_compatible: __u32) -> __BindgenBitfieldUnit<[u8; 4usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
__bindgen_bitfield_unit.set(0usize, 1u8, {

@ -14,10 +14,7 @@ where
Storage: AsRef<[u8]> + AsMut<[u8]>,
{
#[inline]
pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = self.storage.as_ref()[byte_index];
fn extract_bit(byte: u8, index: usize) -> bool {
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
@ -27,10 +24,21 @@ where
byte & mask == mask
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
let byte = self.storage.as_ref()[byte_index];
Self::extract_bit(byte, index)
}
#[inline]
pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
let byte_index = index / 8;
let byte = *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize);
Self::extract_bit(byte, index)
}
#[inline]
fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
@ -38,12 +46,27 @@ where
};
let mask = 1 << bit_index;
if val {
*byte |= mask;
byte | mask
} else {
*byte &= !mask;
byte & !mask
}
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
*byte = Self::change_bit(*byte, index, val);
}
#[inline]
pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
let byte_index = index / 8;
let byte =
(core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize);
*byte = Self::change_bit(*byte, index, val);
}
#[inline]
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@ -62,6 +85,24 @@ where
val
}
#[inline]
pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
let mut val = 0;
for i in 0..(bit_width as usize) {
if Self::raw_get_bit(this, i + bit_offset) {
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
val |= 1 << index;
}
}
val
}
#[inline]
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@ -77,6 +118,22 @@ where
self.set_bit(index + bit_offset, val_bit_is_set);
}
}
#[inline]
pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
for i in 0..(bit_width as usize) {
let mask = 1 << i;
let val_bit_is_set = val & mask == mask;
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
Self::raw_set_bit(this, index + bit_offset, val_bit_is_set);
}
}
}
#[repr(C)]
#[derive(Default)]
@ -176,6 +233,7 @@ pub const BPF_F_REPLACE: u32 = 4;
pub const BPF_F_BEFORE: u32 = 8;
pub const BPF_F_AFTER: u32 = 16;
pub const BPF_F_ID: u32 = 32;
pub const BPF_F_LINK: u32 = 8192;
pub const BPF_F_STRICT_ALIGNMENT: u32 = 1;
pub const BPF_F_ANY_ALIGNMENT: u32 = 2;
pub const BPF_F_TEST_RND_HI32: u32 = 4;
@ -211,6 +269,9 @@ pub const TC_ACT_REDIRECT: u32 = 7;
pub const TC_ACT_TRAP: u32 = 8;
pub const TC_ACT_VALUE_MAX: u32 = 8;
pub const TC_ACT_EXT_VAL_MASK: u32 = 268435455;
pub const TC_ACT_JUMP: u32 = 268435456;
pub const TC_ACT_GOTO_CHAIN: u32 = 536870912;
pub const TC_ACT_EXT_OPCODE_MAX: u32 = 536870912;
pub const SOL_SOCKET: u32 = 1;
pub const SO_DEBUG: u32 = 1;
pub const SO_REUSEADDR: u32 = 2;
@ -434,6 +495,28 @@ impl bpf_insn {
}
}
#[inline]
pub unsafe fn dst_reg_raw(this: *const Self) -> __u8 {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
0usize,
4u8,
) as u8)
}
}
#[inline]
pub unsafe fn set_dst_reg_raw(this: *mut Self, val: __u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
0usize,
4u8,
val as u64,
)
}
}
#[inline]
pub fn src_reg(&self) -> __u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
}
@ -445,6 +528,28 @@ impl bpf_insn {
}
}
#[inline]
pub unsafe fn src_reg_raw(this: *const Self) -> __u8 {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
4usize,
4u8,
) as u8)
}
}
#[inline]
pub unsafe fn set_src_reg_raw(this: *mut Self, val: __u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
4usize,
4u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(dst_reg: __u8, src_reg: __u8) -> __BindgenBitfieldUnit<[u8; 1usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
__bindgen_bitfield_unit.set(0usize, 4u8, {
@ -1957,6 +2062,28 @@ impl bpf_prog_info {
}
}
#[inline]
pub unsafe fn gpl_compatible_raw(this: *const Self) -> __u32 {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
0usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_gpl_compatible_raw(this: *mut Self, val: __u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
0usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(gpl_compatible: __u32) -> __BindgenBitfieldUnit<[u8; 4usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
__bindgen_bitfield_unit.set(0usize, 1u8, {

@ -14,10 +14,7 @@ where
Storage: AsRef<[u8]> + AsMut<[u8]>,
{
#[inline]
pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = self.storage.as_ref()[byte_index];
fn extract_bit(byte: u8, index: usize) -> bool {
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
@ -27,10 +24,21 @@ where
byte & mask == mask
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
let byte = self.storage.as_ref()[byte_index];
Self::extract_bit(byte, index)
}
#[inline]
pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
let byte_index = index / 8;
let byte = *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize);
Self::extract_bit(byte, index)
}
#[inline]
fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
@ -38,12 +46,27 @@ where
};
let mask = 1 << bit_index;
if val {
*byte |= mask;
byte | mask
} else {
*byte &= !mask;
byte & !mask
}
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
*byte = Self::change_bit(*byte, index, val);
}
#[inline]
pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
let byte_index = index / 8;
let byte =
(core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize);
*byte = Self::change_bit(*byte, index, val);
}
#[inline]
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@ -62,6 +85,24 @@ where
val
}
#[inline]
pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
let mut val = 0;
for i in 0..(bit_width as usize) {
if Self::raw_get_bit(this, i + bit_offset) {
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
val |= 1 << index;
}
}
val
}
#[inline]
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@ -77,6 +118,22 @@ where
self.set_bit(index + bit_offset, val_bit_is_set);
}
}
#[inline]
pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
for i in 0..(bit_width as usize) {
let mask = 1 << i;
let val_bit_is_set = val & mask == mask;
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
Self::raw_set_bit(this, index + bit_offset, val_bit_is_set);
}
}
}
#[repr(C)]
#[derive(Default)]
@ -176,6 +233,7 @@ pub const BPF_F_REPLACE: u32 = 4;
pub const BPF_F_BEFORE: u32 = 8;
pub const BPF_F_AFTER: u32 = 16;
pub const BPF_F_ID: u32 = 32;
pub const BPF_F_LINK: u32 = 8192;
pub const BPF_F_STRICT_ALIGNMENT: u32 = 1;
pub const BPF_F_ANY_ALIGNMENT: u32 = 2;
pub const BPF_F_TEST_RND_HI32: u32 = 4;
@ -211,6 +269,9 @@ pub const TC_ACT_REDIRECT: u32 = 7;
pub const TC_ACT_TRAP: u32 = 8;
pub const TC_ACT_VALUE_MAX: u32 = 8;
pub const TC_ACT_EXT_VAL_MASK: u32 = 268435455;
pub const TC_ACT_JUMP: u32 = 268435456;
pub const TC_ACT_GOTO_CHAIN: u32 = 536870912;
pub const TC_ACT_EXT_OPCODE_MAX: u32 = 536870912;
pub const SOL_SOCKET: u32 = 1;
pub const SO_DEBUG: u32 = 1;
pub const SO_REUSEADDR: u32 = 2;
@ -434,6 +495,28 @@ impl bpf_insn {
}
}
#[inline]
pub unsafe fn dst_reg_raw(this: *const Self) -> __u8 {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
0usize,
4u8,
) as u8)
}
}
#[inline]
pub unsafe fn set_dst_reg_raw(this: *mut Self, val: __u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
0usize,
4u8,
val as u64,
)
}
}
#[inline]
pub fn src_reg(&self) -> __u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
}
@ -445,6 +528,28 @@ impl bpf_insn {
}
}
#[inline]
pub unsafe fn src_reg_raw(this: *const Self) -> __u8 {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
4usize,
4u8,
) as u8)
}
}
#[inline]
pub unsafe fn set_src_reg_raw(this: *mut Self, val: __u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
4usize,
4u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(dst_reg: __u8, src_reg: __u8) -> __BindgenBitfieldUnit<[u8; 1usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
__bindgen_bitfield_unit.set(0usize, 4u8, {
@ -1957,6 +2062,28 @@ impl bpf_prog_info {
}
}
#[inline]
pub unsafe fn gpl_compatible_raw(this: *const Self) -> __u32 {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
0usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_gpl_compatible_raw(this: *mut Self, val: __u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
0usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(gpl_compatible: __u32) -> __BindgenBitfieldUnit<[u8; 4usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
__bindgen_bitfield_unit.set(0usize, 1u8, {
@ -2805,6 +2932,28 @@ impl per_cr_bits {
}
}
#[inline]
pub unsafe fn em_branching_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
32usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_em_branching_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
32usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn em_instruction_fetch(&self) -> ::aya_ebpf_cty::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(33usize, 1u8) as u32) }
}
@ -2816,6 +2965,28 @@ impl per_cr_bits {
}
}
#[inline]
pub unsafe fn em_instruction_fetch_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
33usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_em_instruction_fetch_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
33usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn em_storage_alteration(&self) -> ::aya_ebpf_cty::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(34usize, 1u8) as u32) }
}
@ -2827,6 +2998,28 @@ impl per_cr_bits {
}
}
#[inline]
pub unsafe fn em_storage_alteration_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
34usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_em_storage_alteration_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
34usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn em_gpr_alt_unused(&self) -> ::aya_ebpf_cty::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(35usize, 1u8) as u32) }
}
@ -2838,6 +3031,28 @@ impl per_cr_bits {
}
}
#[inline]
pub unsafe fn em_gpr_alt_unused_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
35usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_em_gpr_alt_unused_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
35usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn em_store_real_address(&self) -> ::aya_ebpf_cty::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(36usize, 1u8) as u32) }
}
@ -2849,6 +3064,28 @@ impl per_cr_bits {
}
}
#[inline]
pub unsafe fn em_store_real_address_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
36usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_em_store_real_address_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
36usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn branch_addr_ctl(&self) -> ::aya_ebpf_cty::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(40usize, 1u8) as u32) }
}
@ -2860,6 +3097,28 @@ impl per_cr_bits {
}
}
#[inline]
pub unsafe fn branch_addr_ctl_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
40usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_branch_addr_ctl_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
40usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn storage_alt_space_ctl(&self) -> ::aya_ebpf_cty::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(42usize, 1u8) as u32) }
}
@ -2871,6 +3130,28 @@ impl per_cr_bits {
}
}
#[inline]
pub unsafe fn storage_alt_space_ctl_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
42usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_storage_alt_space_ctl_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
42usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(
em_branching: ::aya_ebpf_cty::c_uint,
em_instruction_fetch: ::aya_ebpf_cty::c_uint,
@ -2945,6 +3226,28 @@ impl per_lowcore_bits {
}
}
#[inline]
pub unsafe fn perc_branching_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
0usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_perc_branching_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
0usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn perc_instruction_fetch(&self) -> ::aya_ebpf_cty::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) }
}
@ -2956,6 +3259,28 @@ impl per_lowcore_bits {
}
}
#[inline]
pub unsafe fn perc_instruction_fetch_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
1usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_perc_instruction_fetch_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
1usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn perc_storage_alteration(&self) -> ::aya_ebpf_cty::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) }
}
@ -2967,6 +3292,28 @@ impl per_lowcore_bits {
}
}
#[inline]
pub unsafe fn perc_storage_alteration_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
2usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_perc_storage_alteration_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
2usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn perc_gpr_alt_unused(&self) -> ::aya_ebpf_cty::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) }
}
@ -2978,6 +3325,28 @@ impl per_lowcore_bits {
}
}
#[inline]
pub unsafe fn perc_gpr_alt_unused_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
3usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_perc_gpr_alt_unused_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
3usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn perc_store_real_address(&self) -> ::aya_ebpf_cty::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) }
}
@ -2989,6 +3358,28 @@ impl per_lowcore_bits {
}
}
#[inline]
pub unsafe fn perc_store_real_address_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
4usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_perc_store_real_address_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
4usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn atmid_psw_bit_31(&self) -> ::aya_ebpf_cty::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u32) }
}
@ -3000,6 +3391,28 @@ impl per_lowcore_bits {
}
}
#[inline]
pub unsafe fn atmid_psw_bit_31_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
8usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_atmid_psw_bit_31_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
8usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn atmid_validity_bit(&self) -> ::aya_ebpf_cty::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u32) }
}
@ -3011,6 +3424,28 @@ impl per_lowcore_bits {
}
}
#[inline]
pub unsafe fn atmid_validity_bit_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
9usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_atmid_validity_bit_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
9usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn atmid_psw_bit_32(&self) -> ::aya_ebpf_cty::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u32) }
}
@ -3022,6 +3457,28 @@ impl per_lowcore_bits {
}
}
#[inline]
pub unsafe fn atmid_psw_bit_32_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
10usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_atmid_psw_bit_32_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
10usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn atmid_psw_bit_5(&self) -> ::aya_ebpf_cty::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u32) }
}
@ -3033,6 +3490,28 @@ impl per_lowcore_bits {
}
}
#[inline]
pub unsafe fn atmid_psw_bit_5_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
11usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_atmid_psw_bit_5_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
11usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn atmid_psw_bit_16(&self) -> ::aya_ebpf_cty::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u32) }
}
@ -3044,6 +3523,28 @@ impl per_lowcore_bits {
}
}
#[inline]
pub unsafe fn atmid_psw_bit_16_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
12usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_atmid_psw_bit_16_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
12usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn atmid_psw_bit_17(&self) -> ::aya_ebpf_cty::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u32) }
}
@ -3055,6 +3556,28 @@ impl per_lowcore_bits {
}
}
#[inline]
pub unsafe fn atmid_psw_bit_17_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
13usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_atmid_psw_bit_17_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
13usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn si(&self) -> ::aya_ebpf_cty::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 2u8) as u32) }
}
@ -3066,6 +3589,28 @@ impl per_lowcore_bits {
}
}
#[inline]
pub unsafe fn si_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
14usize,
2u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_si_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
14usize,
2u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(
perc_branching: ::aya_ebpf_cty::c_uint,
perc_instruction_fetch: ::aya_ebpf_cty::c_uint,
@ -3146,6 +3691,28 @@ impl per_lowcore_bits {
}
}
#[inline]
pub unsafe fn access_id_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_2),
4usize,
4u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_access_id_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_2),
4usize,
4u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_2(
access_id: ::aya_ebpf_cty::c_uint,
) -> __BindgenBitfieldUnit<[u8; 1usize]> {
@ -3192,6 +3759,28 @@ impl per_struct {
}
}
#[inline]
pub unsafe fn single_step_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
0usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_single_step_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
0usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn instruction_fetch(&self) -> ::aya_ebpf_cty::c_uint {
unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) }
}
@ -3203,6 +3792,28 @@ impl per_struct {
}
}
#[inline]
pub unsafe fn instruction_fetch_raw(this: *const Self) -> ::aya_ebpf_cty::c_uint {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
1usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_instruction_fetch_raw(this: *mut Self, val: ::aya_ebpf_cty::c_uint) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
1usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(
single_step: ::aya_ebpf_cty::c_uint,
instruction_fetch: ::aya_ebpf_cty::c_uint,

@ -14,10 +14,7 @@ where
Storage: AsRef<[u8]> + AsMut<[u8]>,
{
#[inline]
pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = self.storage.as_ref()[byte_index];
fn extract_bit(byte: u8, index: usize) -> bool {
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
@ -27,10 +24,21 @@ where
byte & mask == mask
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
let byte = self.storage.as_ref()[byte_index];
Self::extract_bit(byte, index)
}
#[inline]
pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
let byte_index = index / 8;
let byte = *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize);
Self::extract_bit(byte, index)
}
#[inline]
fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
@ -38,12 +46,27 @@ where
};
let mask = 1 << bit_index;
if val {
*byte |= mask;
byte | mask
} else {
*byte &= !mask;
byte & !mask
}
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
*byte = Self::change_bit(*byte, index, val);
}
#[inline]
pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
let byte_index = index / 8;
let byte =
(core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize);
*byte = Self::change_bit(*byte, index, val);
}
#[inline]
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@ -62,6 +85,24 @@ where
val
}
#[inline]
pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
let mut val = 0;
for i in 0..(bit_width as usize) {
if Self::raw_get_bit(this, i + bit_offset) {
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
val |= 1 << index;
}
}
val
}
#[inline]
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
@ -77,6 +118,22 @@ where
self.set_bit(index + bit_offset, val_bit_is_set);
}
}
#[inline]
pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
for i in 0..(bit_width as usize) {
let mask = 1 << i;
let val_bit_is_set = val & mask == mask;
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
Self::raw_set_bit(this, index + bit_offset, val_bit_is_set);
}
}
}
#[repr(C)]
#[derive(Default)]
@ -176,6 +233,7 @@ pub const BPF_F_REPLACE: u32 = 4;
pub const BPF_F_BEFORE: u32 = 8;
pub const BPF_F_AFTER: u32 = 16;
pub const BPF_F_ID: u32 = 32;
pub const BPF_F_LINK: u32 = 8192;
pub const BPF_F_STRICT_ALIGNMENT: u32 = 1;
pub const BPF_F_ANY_ALIGNMENT: u32 = 2;
pub const BPF_F_TEST_RND_HI32: u32 = 4;
@ -211,6 +269,9 @@ pub const TC_ACT_REDIRECT: u32 = 7;
pub const TC_ACT_TRAP: u32 = 8;
pub const TC_ACT_VALUE_MAX: u32 = 8;
pub const TC_ACT_EXT_VAL_MASK: u32 = 268435455;
pub const TC_ACT_JUMP: u32 = 268435456;
pub const TC_ACT_GOTO_CHAIN: u32 = 536870912;
pub const TC_ACT_EXT_OPCODE_MAX: u32 = 536870912;
pub const SOL_SOCKET: u32 = 1;
pub const SO_DEBUG: u32 = 1;
pub const SO_REUSEADDR: u32 = 2;
@ -429,6 +490,28 @@ impl bpf_insn {
}
}
#[inline]
pub unsafe fn dst_reg_raw(this: *const Self) -> __u8 {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
0usize,
4u8,
) as u8)
}
}
#[inline]
pub unsafe fn set_dst_reg_raw(this: *mut Self, val: __u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
0usize,
4u8,
val as u64,
)
}
}
#[inline]
pub fn src_reg(&self) -> __u8 {
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
}
@ -440,6 +523,28 @@ impl bpf_insn {
}
}
#[inline]
pub unsafe fn src_reg_raw(this: *const Self) -> __u8 {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
4usize,
4u8,
) as u8)
}
}
#[inline]
pub unsafe fn set_src_reg_raw(this: *mut Self, val: __u8) {
unsafe {
let val: u8 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
4usize,
4u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(dst_reg: __u8, src_reg: __u8) -> __BindgenBitfieldUnit<[u8; 1usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
__bindgen_bitfield_unit.set(0usize, 4u8, {
@ -1952,6 +2057,28 @@ impl bpf_prog_info {
}
}
#[inline]
pub unsafe fn gpl_compatible_raw(this: *const Self) -> __u32 {
unsafe {
::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::core::ptr::addr_of!((*this)._bitfield_1),
0usize,
1u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_gpl_compatible_raw(this: *mut Self, val: __u32) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::core::ptr::addr_of_mut!((*this)._bitfield_1),
0usize,
1u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(gpl_compatible: __u32) -> __BindgenBitfieldUnit<[u8; 4usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
__bindgen_bitfield_unit.set(0usize, 1u8, {

Loading…
Cancel
Save