#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct __BindgenBitfieldUnit<Storage, Align> {
storage: Storage,
align: [Align; 0],
}
impl<Storage, Align> __BindgenBitfieldUnit<Storage, Align> {
#[inline]
pub const fn new(storage: Storage) -> Self {
Self { storage, align: [] }
}
}
impl<Storage, Align> __BindgenBitfieldUnit<Storage, Align>
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];
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
index % 8
};
let mask = 1 << bit_index;
byte & mask == 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];
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
index % 8
};
let mask = 1 << bit_index;
if val {
*byte |= mask;
} else {
*byte &= !mask;
}
}
#[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());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
let mut val = 0;
for i in 0..(bit_width as usize) {
if self.get_bit(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());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
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.set_bit(index + bit_offset, val_bit_is_set);
}
}
}
#[repr(C)]
#[derive(Default)]
pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]);
impl<T> __IncompleteArrayField<T> {
#[inline]
pub const fn new() -> Self {
__IncompleteArrayField(::std::marker::PhantomData, [])
}
#[inline]
pub fn as_ptr(&self) -> *const T {
self as *const _ as *const T
}
#[inline]
pub fn as_mut_ptr(&mut self) -> *mut T {
self as *mut _ as *mut T
}
#[inline]
pub unsafe fn as_slice(&self, len: usize) -> &[T] {
::std::slice::from_raw_parts(self.as_ptr(), len)
}
#[inline]
pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
}
}
impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
fmt.write_str("__IncompleteArrayField")
}
}
pub const BPF_LD: u32 = 0;
pub const BPF_LDX: u32 = 1;
pub const BPF_ST: u32 = 2;
pub const BPF_STX: u32 = 3;
pub const BPF_ALU: u32 = 4;
pub const BPF_JMP: u32 = 5;
pub const BPF_RET: u32 = 6;
pub const BPF_MISC: u32 = 7;
pub const BPF_W: u32 = 0;
pub const BPF_H: u32 = 8;
pub const BPF_B: u32 = 16;
pub const BPF_IMM: u32 = 0;
pub const BPF_ABS: u32 = 32;
pub const BPF_IND: u32 = 64;
pub const BPF_MEM: u32 = 96;
pub const BPF_LEN: u32 = 128;
pub const BPF_MSH: u32 = 160;
pub const BPF_ADD: u32 = 0;
pub const BPF_SUB: u32 = 16;
pub const BPF_MUL: u32 = 32;
pub const BPF_DIV: u32 = 48;
pub const BPF_OR: u32 = 64;
pub const BPF_AND: u32 = 80;
pub const BPF_LSH: u32 = 96;
pub const BPF_RSH: u32 = 112;
pub const BPF_NEG: u32 = 128;
pub const BPF_MOD: u32 = 144;
pub const BPF_XOR: u32 = 160;
pub const BPF_JA: u32 = 0;
pub const BPF_JEQ: u32 = 16;
pub const BPF_JGT: u32 = 32;
pub const BPF_JGE: u32 = 48;
pub const BPF_JSET: u32 = 64;
pub const BPF_K: u32 = 0;
pub const BPF_X: u32 = 8;
pub const BPF_MAXINSNS: u32 = 4096;
pub const BPF_JMP32: u32 = 6;
pub const BPF_ALU64: u32 = 7;
pub const BPF_DW: u32 = 24;
pub const BPF_XADD: u32 = 192;
pub const BPF_MOV: u32 = 176;
pub const BPF_ARSH: u32 = 192;
pub const BPF_END: u32 = 208;
pub const BPF_TO_LE: u32 = 0;
pub const BPF_TO_BE: u32 = 8;
pub const BPF_FROM_LE: u32 = 0;
pub const BPF_FROM_BE: u32 = 8;
pub const BPF_JNE: u32 = 80;
pub const BPF_JLT: u32 = 160;
pub const BPF_JLE: u32 = 176;
pub const BPF_JSGT: u32 = 96;
pub const BPF_JSGE: u32 = 112;
pub const BPF_JSLT: u32 = 192;
pub const BPF_JSLE: u32 = 208;
pub const BPF_CALL: u32 = 128;
pub const BPF_EXIT: u32 = 144;
pub const BPF_F_ALLOW_OVERRIDE: u32 = 1;
pub const BPF_F_ALLOW_MULTI: u32 = 2;
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;
pub const BPF_F_TEST_STATE_FREQ: u32 = 8;
pub const BPF_PSEUDO_MAP_FD: u32 = 1;
pub const BPF_PSEUDO_MAP_VALUE: u32 = 2;
pub const BPF_PSEUDO_CALL: u32 = 1;
pub const BPF_ANY: u32 = 0;
pub const BPF_NOEXIST: u32 = 1;
pub const BPF_EXIST: u32 = 2;
pub const BPF_F_LOCK: u32 = 4;
pub const BPF_F_NO_PREALLOC: u32 = 1;
pub const BPF_F_NO_COMMON_LRU: u32 = 2;
pub const BPF_F_NUMA_NODE: u32 = 4;
pub const BPF_OBJ_NAME_LEN: u32 = 16;
pub const BPF_F_RDONLY: u32 = 8;
pub const BPF_F_WRONLY: u32 = 16;
pub const BPF_F_STACK_BUILD_ID: u32 = 32;
pub const BPF_F_ZERO_SEED: u32 = 64;
pub const BPF_F_RDONLY_PROG: u32 = 128;
pub const BPF_F_WRONLY_PROG: u32 = 256;
pub const BPF_F_CLONE: u32 = 512;
pub const BPF_F_MMAPABLE: u32 = 1024;
pub const BPF_F_QUERY_EFFECTIVE: u32 = 1;
pub const BPF_BUILD_ID_SIZE: u32 = 20;
pub const BPF_F_RECOMPUTE_CSUM: u32 = 1;
pub const BPF_F_INVALIDATE_HASH: u32 = 2;
pub const BPF_F_HDR_FIELD_MASK: u32 = 15;
pub const BPF_F_PSEUDO_HDR: u32 = 16;
pub const BPF_F_MARK_MANGLED_0: u32 = 32;
pub const BPF_F_MARK_ENFORCE: u32 = 64;
pub const BPF_F_INGRESS: u32 = 1;
pub const BPF_F_TUNINFO_IPV6: u32 = 1;
pub const BPF_F_SKIP_FIELD_MASK: u32 = 255;
pub const BPF_F_USER_STACK: u32 = 256;
pub const BPF_F_FAST_STACK_CMP: u32 = 512;
pub const BPF_F_REUSE_STACKID: u32 = 1024;
pub const BPF_F_USER_BUILD_ID: u32 = 2048;
pub const BPF_F_ZERO_CSUM_TX: u32 = 2;
pub const BPF_F_DONT_FRAGMENT: u32 = 4;
pub const BPF_F_SEQ_NUMBER: u32 = 8;
pub const BPF_F_INDEX_MASK: u32 = 4294967295;
pub const BPF_F_CURRENT_CPU: u32 = 4294967295;
pub const BPF_F_CTXLEN_MASK: u64 = 4503595332403200;
pub const BPF_F_CURRENT_NETNS: i32 = -1;
pub const BPF_F_ADJ_ROOM_FIXED_GSO: u32 = 1;
pub const BPF_ADJ_ROOM_ENCAP_L2_MASK: u32 = 255;
pub const BPF_ADJ_ROOM_ENCAP_L2_SHIFT: u32 = 56;
pub const BPF_F_ADJ_ROOM_ENCAP_L3_IPV4: u32 = 2;
pub const BPF_F_ADJ_ROOM_ENCAP_L3_IPV6: u32 = 4;
pub const BPF_F_ADJ_ROOM_ENCAP_L4_GRE: u32 = 8;
pub const BPF_F_ADJ_ROOM_ENCAP_L4_UDP: u32 = 16;
pub const BPF_F_SYSCTL_BASE_NAME: u32 = 1;
pub const BPF_SK_STORAGE_GET_F_CREATE: u32 = 1;
pub const BPF_TAG_SIZE: u32 = 8;
pub const BPF_SOCK_OPS_RTO_CB_FLAG: u32 = 1;
pub const BPF_SOCK_OPS_RETRANS_CB_FLAG: u32 = 2;
pub const BPF_SOCK_OPS_STATE_CB_FLAG: u32 = 4;
pub const BPF_SOCK_OPS_RTT_CB_FLAG: u32 = 8;
pub const BPF_SOCK_OPS_ALL_CB_FLAGS: u32 = 15;
pub const BPF_DEVCG_ACC_MKNOD: u32 = 1;
pub const BPF_DEVCG_ACC_READ: u32 = 2;
pub const BPF_DEVCG_ACC_WRITE: u32 = 4;
pub const BPF_DEVCG_DEV_BLOCK: u32 = 1;
pub const BPF_DEVCG_DEV_CHAR: u32 = 2;
pub const BPF_FIB_LOOKUP_DIRECT: u32 = 1;
pub const BPF_FIB_LOOKUP_OUTPUT: u32 = 2;
pub const BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG: u32 = 1;
pub const BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL: u32 = 2;
pub const BPF_FLOW_DISSECTOR_F_STOP_AT_ENCAP: u32 = 4;
pub const BPF_LOG_BUF_SIZE: u32 = 16777215;
pub const BTF_MAGIC: u32 = 60319;
pub const BTF_VERSION: u32 = 1;
pub const BTF_MAX_TYPE: u32 = 65535;
pub const BTF_MAX_NAME_OFFSET: u32 = 65535;
pub const BTF_MAX_VLEN: u32 = 65535;
pub const BTF_KIND_UNKN: u32 = 0;
pub const BTF_KIND_INT: u32 = 1;
pub const BTF_KIND_PTR: u32 = 2;
pub const BTF_KIND_ARRAY: u32 = 3;
pub const BTF_KIND_STRUCT: u32 = 4;
pub const BTF_KIND_UNION: u32 = 5;
pub const BTF_KIND_ENUM: u32 = 6;
pub const BTF_KIND_FWD: u32 = 7;
pub const BTF_KIND_TYPEDEF: u32 = 8;
pub const BTF_KIND_VOLATILE: u32 = 9;
pub const BTF_KIND_CONST: u32 = 10;
pub const BTF_KIND_RESTRICT: u32 = 11;
pub const BTF_KIND_FUNC: u32 = 12;
pub const BTF_KIND_FUNC_PROTO: u32 = 13;
pub const BTF_KIND_VAR: u32 = 14;
pub const BTF_KIND_DATASEC: u32 = 15;
pub const BTF_KIND_MAX: u32 = 15;
pub const BTF_INT_SIGNED: u32 = 1;
pub const BTF_INT_CHAR: u32 = 2;
pub const BTF_INT_BOOL: u32 = 4;
pub const BTF_ELF_SEC: &'static [u8; 5usize] = b".BTF\0";
pub const BTF_EXT_ELF_SEC: &'static [u8; 9usize] = b".BTF.ext\0";
pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: u32 = 48;
pub const XSK_UNALIGNED_BUF_ADDR_MASK: u64 = 281474976710655;
pub const XSK_RING_CONS__DEFAULT_NUM_DESCS: u32 = 2048;
pub const XSK_RING_PROD__DEFAULT_NUM_DESCS: u32 = 2048;
pub const XSK_UMEM__DEFAULT_FRAME_SHIFT: u32 = 12;
pub const XSK_UMEM__DEFAULT_FRAME_SIZE: u32 = 4096;
pub const XSK_UMEM__DEFAULT_FRAME_HEADROOM: u32 = 0;
pub const XSK_UMEM__DEFAULT_FLAGS: u32 = 0;
pub const XSK_LIBBPF_FLAGS__INHIBIT_PROG_LOAD: u32 = 1;
pub type __pid_t = ::std::os::raw::c_int;
pub type __u8 = ::std::os::raw::c_uchar;
pub type __s16 = ::std::os::raw::c_short;
pub type __u16 = ::std::os::raw::c_ushort;
pub type __s32 = ::std::os::raw::c_int;
pub type __u32 = ::std::os::raw::c_uint;
pub type __s64 = ::std::os::raw::c_longlong;
pub type __u64 = ::std::os::raw::c_ulonglong;
pub const BPF_REG_0: _bindgen_ty_1 = 0;
pub const BPF_REG_1: _bindgen_ty_1 = 1;
pub const BPF_REG_2: _bindgen_ty_1 = 2;
pub const BPF_REG_3: _bindgen_ty_1 = 3;
pub const BPF_REG_4: _bindgen_ty_1 = 4;
pub const BPF_REG_5: _bindgen_ty_1 = 5;
pub const BPF_REG_6: _bindgen_ty_1 = 6;
pub const BPF_REG_7: _bindgen_ty_1 = 7;
pub const BPF_REG_8: _bindgen_ty_1 = 8;
pub const BPF_REG_9: _bindgen_ty_1 = 9;
pub const BPF_REG_10: _bindgen_ty_1 = 10;
pub const __MAX_BPF_REG: _bindgen_ty_1 = 11;
pub type _bindgen_ty_1 = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct bpf_insn {
pub code: __u8,
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
pub off: __s16,
pub imm: __s32,
}
impl bpf_insn {
#[inline]
pub fn dst_reg(&self) -> __u8 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
}
#[inline]
pub fn set_dst_reg(&mut self, val: __u8) {
unsafe {
let val: u8 = ::std::mem::transmute(val);
self._bitfield_1.set(0usize, 4u8, val as u64)
}
}
#[inline]
pub fn src_reg(&self) -> __u8 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
}
#[inline]
pub fn set_src_reg(&mut self, val: __u8) {
unsafe {
let val: u8 = ::std::mem::transmute(val);
self._bitfield_1.set(4usize, 4u8, val as u64)
}
}
#[inline]
pub fn new_bitfield_1(dst_reg: __u8, src_reg: __u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> =
Default::default();
__bindgen_bitfield_unit.set(0usize, 4u8, {
let dst_reg: u8 = unsafe { ::std::mem::transmute(dst_reg) };
dst_reg as u64
});
__bindgen_bitfield_unit.set(4usize, 4u8, {
let src_reg: u8 = unsafe { ::std::mem::transmute(src_reg) };
src_reg as u64
});
__bindgen_bitfield_unit
}
}
pub const BPF_MAP_TYPE_UNSPEC: bpf_map_type = 0;
pub const BPF_MAP_TYPE_HASH: bpf_map_type = 1;
pub const BPF_MAP_TYPE_ARRAY: bpf_map_type = 2;
pub const BPF_MAP_TYPE_PROG_ARRAY: bpf_map_type = 3;
pub const BPF_MAP_TYPE_PERF_EVENT_ARRAY: bpf_map_type = 4;
pub const BPF_MAP_TYPE_PERCPU_HASH: bpf_map_type = 5;
pub const BPF_MAP_TYPE_PERCPU_ARRAY: bpf_map_type = 6;
pub const BPF_MAP_TYPE_STACK_TRACE: bpf_map_type = 7;
pub const BPF_MAP_TYPE_CGROUP_ARRAY: bpf_map_type = 8;
pub const BPF_MAP_TYPE_LRU_HASH: bpf_map_type = 9;
pub const BPF_MAP_TYPE_LRU_PERCPU_HASH: bpf_map_type = 10;
pub const BPF_MAP_TYPE_LPM_TRIE: bpf_map_type = 11;
pub const BPF_MAP_TYPE_ARRAY_OF_MAPS: bpf_map_type = 12;
pub const BPF_MAP_TYPE_HASH_OF_MAPS: bpf_map_type = 13;
pub const BPF_MAP_TYPE_DEVMAP: bpf_map_type = 14;
pub const BPF_MAP_TYPE_SOCKMAP: bpf_map_type = 15;
pub const BPF_MAP_TYPE_CPUMAP: bpf_map_type = 16;
pub const BPF_MAP_TYPE_XSKMAP: bpf_map_type = 17;
pub const BPF_MAP_TYPE_SOCKHASH: bpf_map_type = 18;
pub const BPF_MAP_TYPE_CGROUP_STORAGE: bpf_map_type = 19;
pub const BPF_MAP_TYPE_REUSEPORT_SOCKARRAY: bpf_map_type = 20;
pub const BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE: bpf_map_type = 21;
pub const BPF_MAP_TYPE_QUEUE: bpf_map_type = 22;
pub const BPF_MAP_TYPE_STACK: bpf_map_type = 23;
pub const BPF_MAP_TYPE_SK_STORAGE: bpf_map_type = 24;
pub const BPF_MAP_TYPE_DEVMAP_HASH: bpf_map_type = 25;
pub type bpf_map_type = u32;
pub const BPF_PROG_TYPE_UNSPEC: bpf_prog_type = 0;
pub const BPF_PROG_TYPE_SOCKET_FILTER: bpf_prog_type = 1;
pub const BPF_PROG_TYPE_KPROBE: bpf_prog_type = 2;
pub const BPF_PROG_TYPE_SCHED_CLS: bpf_prog_type = 3;
pub const BPF_PROG_TYPE_SCHED_ACT: bpf_prog_type = 4;
pub const BPF_PROG_TYPE_TRACEPOINT: bpf_prog_type = 5;
pub const BPF_PROG_TYPE_XDP: bpf_prog_type = 6;
pub const BPF_PROG_TYPE_PERF_EVENT: bpf_prog_type = 7;
pub const BPF_PROG_TYPE_CGROUP_SKB: bpf_prog_type = 8;
pub const BPF_PROG_TYPE_CGROUP_SOCK: bpf_prog_type = 9;
pub const BPF_PROG_TYPE_LWT_IN: bpf_prog_type = 10;
pub const BPF_PROG_TYPE_LWT_OUT: bpf_prog_type = 11;
pub const BPF_PROG_TYPE_LWT_XMIT: bpf_prog_type = 12;
pub const BPF_PROG_TYPE_SOCK_OPS: bpf_prog_type = 13;
pub const BPF_PROG_TYPE_SK_SKB: bpf_prog_type = 14;
pub const BPF_PROG_TYPE_CGROUP_DEVICE: bpf_prog_type = 15;
pub const BPF_PROG_TYPE_SK_MSG: bpf_prog_type = 16;
pub const BPF_PROG_TYPE_RAW_TRACEPOINT: bpf_prog_type = 17;
pub const BPF_PROG_TYPE_CGROUP_SOCK_ADDR: bpf_prog_type = 18;
pub const BPF_PROG_TYPE_LWT_SEG6LOCAL: bpf_prog_type = 19;
pub const BPF_PROG_TYPE_LIRC_MODE2: bpf_prog_type = 20;
pub const BPF_PROG_TYPE_SK_REUSEPORT: bpf_prog_type = 21;
pub const BPF_PROG_TYPE_FLOW_DISSECTOR: bpf_prog_type = 22;
pub const BPF_PROG_TYPE_CGROUP_SYSCTL: bpf_prog_type = 23;
pub const BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE: bpf_prog_type = 24;
pub const BPF_PROG_TYPE_CGROUP_SOCKOPT: bpf_prog_type = 25;
pub const BPF_PROG_TYPE_TRACING: bpf_prog_type = 26;
pub type bpf_prog_type = u32;
pub const BPF_CGROUP_INET_INGRESS: bpf_attach_type = 0;
pub const BPF_CGROUP_INET_EGRESS: bpf_attach_type = 1;
pub const BPF_CGROUP_INET_SOCK_CREATE: bpf_attach_type = 2;
pub const BPF_CGROUP_SOCK_OPS: bpf_attach_type = 3;
pub const BPF_SK_SKB_STREAM_PARSER: bpf_attach_type = 4;
pub const BPF_SK_SKB_STREAM_VERDICT: bpf_attach_type = 5;
pub const BPF_CGROUP_DEVICE: bpf_attach_type = 6;
pub const BPF_SK_MSG_VERDICT: bpf_attach_type = 7;
pub const BPF_CGROUP_INET4_BIND: bpf_attach_type = 8;
pub const BPF_CGROUP_INET6_BIND: bpf_attach_type = 9;
pub const BPF_CGROUP_INET4_CONNECT: bpf_attach_type = 10;
pub const BPF_CGROUP_INET6_CONNECT: bpf_attach_type = 11;
pub const BPF_CGROUP_INET4_POST_BIND: bpf_attach_type = 12;
pub const BPF_CGROUP_INET6_POST_BIND: bpf_attach_type = 13;
pub const BPF_CGROUP_UDP4_SENDMSG: bpf_attach_type = 14;
pub const BPF_CGROUP_UDP6_SENDMSG: bpf_attach_type = 15;
pub const BPF_LIRC_MODE2: bpf_attach_type = 16;
pub const BPF_FLOW_DISSECTOR: bpf_attach_type = 17;
pub const BPF_CGROUP_SYSCTL: bpf_attach_type = 18;
pub const BPF_CGROUP_UDP4_RECVMSG: bpf_attach_type = 19;
pub const BPF_CGROUP_UDP6_RECVMSG: bpf_attach_type = 20;
pub const BPF_CGROUP_GETSOCKOPT: bpf_attach_type = 21;
pub const BPF_CGROUP_SETSOCKOPT: bpf_attach_type = 22;
pub const BPF_TRACE_RAW_TP: bpf_attach_type = 23;
pub const BPF_TRACE_FENTRY: bpf_attach_type = 24;
pub const BPF_TRACE_FEXIT: bpf_attach_type = 25;
pub const __MAX_BPF_ATTACH_TYPE: bpf_attach_type = 26;
pub type bpf_attach_type = u32;
pub const BPF_FUNC_unspec: bpf_func_id = 0;
pub const BPF_FUNC_map_lookup_elem: bpf_func_id = 1;
pub const BPF_FUNC_map_update_elem: bpf_func_id = 2;
pub const BPF_FUNC_map_delete_elem: bpf_func_id = 3;
pub const BPF_FUNC_probe_read: bpf_func_id = 4;
pub const BPF_FUNC_ktime_get_ns: bpf_func_id = 5;
pub const BPF_FUNC_trace_printk: bpf_func_id = 6;
pub const BPF_FUNC_get_prandom_u32: bpf_func_id = 7;
pub const BPF_FUNC_get_smp_processor_id: bpf_func_id = 8;
pub const BPF_FUNC_skb_store_bytes: bpf_func_id = 9;
pub const BPF_FUNC_l3_csum_replace: bpf_func_id = 10;
pub const BPF_FUNC_l4_csum_replace: bpf_func_id = 11;
pub const BPF_FUNC_tail_call: bpf_func_id = 12;
pub const BPF_FUNC_clone_redirect: bpf_func_id = 13;
pub const BPF_FUNC_get_current_pid_tgid: bpf_func_id = 14;
pub const BPF_FUNC_get_current_uid_gid: bpf_func_id = 15;
pub const BPF_FUNC_get_current_comm: bpf_func_id = 16;
pub const BPF_FUNC_get_cgroup_classid: bpf_func_id = 17;
pub const BPF_FUNC_skb_vlan_push: bpf_func_id = 18;
pub const BPF_FUNC_skb_vlan_pop: bpf_func_id = 19;
pub const BPF_FUNC_skb_get_tunnel_key: bpf_func_id = 20;
pub const BPF_FUNC_skb_set_tunnel_key: bpf_func_id = 21;
pub const BPF_FUNC_perf_event_read: bpf_func_id = 22;
pub const BPF_FUNC_redirect: bpf_func_id = 23;
pub const BPF_FUNC_get_route_realm: bpf_func_id = 24;
pub const BPF_FUNC_perf_event_output: bpf_func_id = 25;
pub const BPF_FUNC_skb_load_bytes: bpf_func_id = 26;
pub const BPF_FUNC_get_stackid: bpf_func_id = 27;
pub const BPF_FUNC_csum_diff: bpf_func_id = 28;
pub const BPF_FUNC_skb_get_tunnel_opt: bpf_func_id = 29;
pub const BPF_FUNC_skb_set_tunnel_opt: bpf_func_id = 30;
pub const BPF_FUNC_skb_change_proto: bpf_func_id = 31;
pub const BPF_FUNC_skb_change_type: bpf_func_id = 32;
pub const BPF_FUNC_skb_under_cgroup: bpf_func_id = 33;
pub const BPF_FUNC_get_hash_recalc: bpf_func_id = 34;
pub const BPF_FUNC_get_current_task: bpf_func_id = 35;
pub const BPF_FUNC_probe_write_user: bpf_func_id = 36;
pub const BPF_FUNC_current_task_under_cgroup: bpf_func_id = 37;
pub const BPF_FUNC_skb_change_tail: bpf_func_id = 38;
pub const BPF_FUNC_skb_pull_data: bpf_func_id = 39;
pub const BPF_FUNC_csum_update: bpf_func_id = 40;
pub const BPF_FUNC_set_hash_invalid: bpf_func_id = 41;
pub const BPF_FUNC_get_numa_node_id: bpf_func_id = 42;
pub const BPF_FUNC_skb_change_head: bpf_func_id = 43;
pub const BPF_FUNC_xdp_adjust_head: bpf_func_id = 44;
pub const BPF_FUNC_probe_read_str: bpf_func_id = 45;
pub const BPF_FUNC_get_socket_cookie: bpf_func_id = 46;
pub const BPF_FUNC_get_socket_uid: bpf_func_id = 47;
pub const BPF_FUNC_set_hash: bpf_func_id = 48;
pub const BPF_FUNC_setsockopt: bpf_func_id = 49;
pub const BPF_FUNC_skb_adjust_room: bpf_func_id = 50;
pub const BPF_FUNC_redirect_map: bpf_func_id = 51;
pub const BPF_FUNC_sk_redirect_map: bpf_func_id = 52;
pub const BPF_FUNC_sock_map_update: bpf_func_id = 53;
pub const BPF_FUNC_xdp_adjust_meta: bpf_func_id = 54;
pub const BPF_FUNC_perf_event_read_value: bpf_func_id = 55;
pub const BPF_FUNC_perf_prog_read_value: bpf_func_id = 56;
pub const BPF_FUNC_getsockopt: bpf_func_id = 57;
pub const BPF_FUNC_override_return: bpf_func_id = 58;
pub const BPF_FUNC_sock_ops_cb_flags_set: bpf_func_id = 59;
pub const BPF_FUNC_msg_redirect_map: bpf_func_id = 60;
pub const BPF_FUNC_msg_apply_bytes: bpf_func_id = 61;
pub const BPF_FUNC_msg_cork_bytes: bpf_func_id = 62;
pub const BPF_FUNC_msg_pull_data: bpf_func_id = 63;
pub const BPF_FUNC_bind: bpf_func_id = 64;
pub const BPF_FUNC_xdp_adjust_tail: bpf_func_id = 65;
pub const BPF_FUNC_skb_get_xfrm_state: bpf_func_id = 66;
pub const BPF_FUNC_get_stack: bpf_func_id = 67;
pub const BPF_FUNC_skb_load_bytes_relative: bpf_func_id = 68;
pub const BPF_FUNC_fib_lookup: bpf_func_id = 69;
pub const BPF_FUNC_sock_hash_update: bpf_func_id = 70;
pub const BPF_FUNC_msg_redirect_hash: bpf_func_id = 71;
pub const BPF_FUNC_sk_redirect_hash: bpf_func_id = 72;
pub const BPF_FUNC_lwt_push_encap: bpf_func_id = 73;
pub const BPF_FUNC_lwt_seg6_store_bytes: bpf_func_id = 74;
pub const BPF_FUNC_lwt_seg6_adjust_srh: bpf_func_id = 75;
pub const BPF_FUNC_lwt_seg6_action: bpf_func_id = 76;
pub const BPF_FUNC_rc_repeat: bpf_func_id = 77;
pub const BPF_FUNC_rc_keydown: bpf_func_id = 78;
pub const BPF_FUNC_skb_cgroup_id: bpf_func_id = 79;
pub const BPF_FUNC_get_current_cgroup_id: bpf_func_id = 80;
pub const BPF_FUNC_get_local_storage: bpf_func_id = 81;
pub const BPF_FUNC_sk_select_reuseport: bpf_func_id = 82;
pub const BPF_FUNC_skb_ancestor_cgroup_id: bpf_func_id = 83;
pub const BPF_FUNC_sk_lookup_tcp: bpf_func_id = 84;
pub const BPF_FUNC_sk_lookup_udp: bpf_func_id = 85;
pub const BPF_FUNC_sk_release: bpf_func_id = 86;
pub const BPF_FUNC_map_push_elem: bpf_func_id = 87;
pub const BPF_FUNC_map_pop_elem: bpf_func_id = 88;
pub const BPF_FUNC_map_peek_elem: bpf_func_id = 89;
pub const BPF_FUNC_msg_push_data: bpf_func_id = 90;
pub const BPF_FUNC_msg_pop_data: bpf_func_id = 91;
pub const BPF_FUNC_rc_pointer_rel: bpf_func_id = 92;
pub const BPF_FUNC_spin_lock: bpf_func_id = 93;
pub const BPF_FUNC_spin_unlock: bpf_func_id = 94;
pub const BPF_FUNC_sk_fullsock: bpf_func_id = 95;
pub const BPF_FUNC_tcp_sock: bpf_func_id = 96;
pub const BPF_FUNC_skb_ecn_set_ce: bpf_func_id = 97;
pub const BPF_FUNC_get_listener_sock: bpf_func_id = 98;
pub const BPF_FUNC_skc_lookup_tcp: bpf_func_id = 99;
pub const BPF_FUNC_tcp_check_syncookie: bpf_func_id = 100;
pub const BPF_FUNC_sysctl_get_name: bpf_func_id = 101;
pub const BPF_FUNC_sysctl_get_current_value: bpf_func_id = 102;
pub const BPF_FUNC_sysctl_get_new_value: bpf_func_id = 103;
pub const BPF_FUNC_sysctl_set_new_value: bpf_func_id = 104;
pub const BPF_FUNC_strtol: bpf_func_id = 105;
pub const BPF_FUNC_strtoul: bpf_func_id = 106;
pub const BPF_FUNC_sk_storage_get: bpf_func_id = 107;
pub const BPF_FUNC_sk_storage_delete: bpf_func_id = 108;
pub const BPF_FUNC_send_signal: bpf_func_id = 109;
pub const BPF_FUNC_tcp_gen_syncookie: bpf_func_id = 110;
pub const BPF_FUNC_skb_output: bpf_func_id = 111;
pub const BPF_FUNC_probe_read_user: bpf_func_id = 112;
pub const BPF_FUNC_probe_read_kernel: bpf_func_id = 113;
pub const BPF_FUNC_probe_read_user_str: bpf_func_id = 114;
pub const BPF_FUNC_probe_read_kernel_str: bpf_func_id = 115;
pub const __BPF_FUNC_MAX_ID: bpf_func_id = 116;
pub type bpf_func_id = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct bpf_prog_info {
pub type_: __u32,
pub id: __u32,
pub tag: [__u8; 8usize],
pub jited_prog_len: __u32,
pub xlated_prog_len: __u32,
pub jited_prog_insns: __u64,
pub xlated_prog_insns: __u64,
pub load_time: __u64,
pub created_by_uid: __u32,
pub nr_map_ids: __u32,
pub map_ids: __u64,
pub name: [::std::os::raw::c_char; 16usize],
pub ifindex: __u32,
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u8>,
pub netns_dev: __u64,
pub netns_ino: __u64,
pub nr_jited_ksyms: __u32,
pub nr_jited_func_lens: __u32,
pub jited_ksyms: __u64,
pub jited_func_lens: __u64,
pub btf_id: __u32,
pub func_info_rec_size: __u32,
pub func_info: __u64,
pub nr_func_info: __u32,
pub nr_line_info: __u32,
pub line_info: __u64,
pub jited_line_info: __u64,
pub nr_jited_line_info: __u32,
pub line_info_rec_size: __u32,
pub jited_line_info_rec_size: __u32,
pub nr_prog_tags: __u32,
pub prog_tags: __u64,
pub run_time_ns: __u64,
pub run_cnt: __u64,
}
impl bpf_prog_info {
#[inline]
pub fn gpl_compatible(&self) -> __u32 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) }
}
#[inline]
pub fn set_gpl_compatible(&mut self, val: __u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
self._bitfield_1.set(0usize, 1u8, val as u64)
}
}
#[inline]
pub fn new_bitfield_1(gpl_compatible: __u32) -> __BindgenBitfieldUnit<[u8; 4usize], u8> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u8> =
Default::default();
__bindgen_bitfield_unit.set(0usize, 1u8, {
let gpl_compatible: u32 = unsafe { ::std::mem::transmute(gpl_compatible) };
gpl_compatible as u64
});
__bindgen_bitfield_unit
}
}
pub const BPF_SOCK_OPS_VOID: _bindgen_ty_2 = 0;
pub const BPF_SOCK_OPS_TIMEOUT_INIT: _bindgen_ty_2 = 1;
pub const BPF_SOCK_OPS_RWND_INIT: _bindgen_ty_2 = 2;
pub const BPF_SOCK_OPS_TCP_CONNECT_CB: _bindgen_ty_2 = 3;
pub const BPF_SOCK_OPS_ACTIVE_ESTABLISHED_CB: _bindgen_ty_2 = 4;
pub const BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB: _bindgen_ty_2 = 5;
pub const BPF_SOCK_OPS_NEEDS_ECN: _bindgen_ty_2 = 6;
pub const BPF_SOCK_OPS_BASE_RTT: _bindgen_ty_2 = 7;
pub const BPF_SOCK_OPS_RTO_CB: _bindgen_ty_2 = 8;
pub const BPF_SOCK_OPS_RETRANS_CB: _bindgen_ty_2 = 9;
pub const BPF_SOCK_OPS_STATE_CB: _bindgen_ty_2 = 10;
pub const BPF_SOCK_OPS_TCP_LISTEN_CB: _bindgen_ty_2 = 11;
pub const BPF_SOCK_OPS_RTT_CB: _bindgen_ty_2 = 12;
pub type _bindgen_ty_2 = u32;
pub const BPF_TCP_ESTABLISHED: _bindgen_ty_3 = 1;
pub const BPF_TCP_SYN_SENT: _bindgen_ty_3 = 2;
pub const BPF_TCP_SYN_RECV: _bindgen_ty_3 = 3;
pub const BPF_TCP_FIN_WAIT1: _bindgen_ty_3 = 4;
pub const BPF_TCP_FIN_WAIT2: _bindgen_ty_3 = 5;
pub const BPF_TCP_TIME_WAIT: _bindgen_ty_3 = 6;
pub const BPF_TCP_CLOSE: _bindgen_ty_3 = 7;
pub const BPF_TCP_CLOSE_WAIT: _bindgen_ty_3 = 8;
pub const BPF_TCP_LAST_ACK: _bindgen_ty_3 = 9;
pub const BPF_TCP_LISTEN: _bindgen_ty_3 = 10;
pub const BPF_TCP_CLOSING: _bindgen_ty_3 = 11;
pub const BPF_TCP_NEW_SYN_RECV: _bindgen_ty_3 = 12;
pub const BPF_TCP_MAX_STATES: _bindgen_ty_3 = 13;
pub type _bindgen_ty_3 = u32;
pub const BPF_FIB_LKUP_RET_SUCCESS: _bindgen_ty_4 = 0;
pub const BPF_FIB_LKUP_RET_BLACKHOLE: _bindgen_ty_4 = 1;
pub const BPF_FIB_LKUP_RET_UNREACHABLE: _bindgen_ty_4 = 2;
pub const BPF_FIB_LKUP_RET_PROHIBIT: _bindgen_ty_4 = 3;
pub const BPF_FIB_LKUP_RET_NOT_FWDED: _bindgen_ty_4 = 4;
pub const BPF_FIB_LKUP_RET_FWD_DISABLED: _bindgen_ty_4 = 5;
pub const BPF_FIB_LKUP_RET_UNSUPP_LWT: _bindgen_ty_4 = 6;
pub const BPF_FIB_LKUP_RET_NO_NEIGH: _bindgen_ty_4 = 7;
pub const BPF_FIB_LKUP_RET_FRAG_NEEDED: _bindgen_ty_4 = 8;
pub type _bindgen_ty_4 = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct bpf_line_info {
pub insn_off: __u32,
pub file_name_off: __u32,
pub line_off: __u32,
pub line_col: __u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct bpf_create_map_attr {
pub name: *const ::std::os::raw::c_char,
pub map_type: bpf_map_type,
pub map_flags: __u32,
pub key_size: __u32,
pub value_size: __u32,
pub max_entries: __u32,
pub numa_node: __u32,
pub btf_fd: __u32,
pub btf_key_type_id: __u32,
pub btf_value_type_id: __u32,
pub map_ifindex: __u32,
pub inner_map_fd: __u32,
}
extern "C" {
pub fn bpf_create_map_xattr(create_attr: *const bpf_create_map_attr) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_create_map_node(
map_type: bpf_map_type,
name: *const ::std::os::raw::c_char,
key_size: ::std::os::raw::c_int,
value_size: ::std::os::raw::c_int,
max_entries: ::std::os::raw::c_int,
map_flags: __u32,
node: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_create_map_name(
map_type: bpf_map_type,
name: *const ::std::os::raw::c_char,
key_size: ::std::os::raw::c_int,
value_size: ::std::os::raw::c_int,
max_entries: ::std::os::raw::c_int,
map_flags: __u32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_create_map(
map_type: bpf_map_type,
key_size: ::std::os::raw::c_int,
value_size: ::std::os::raw::c_int,
max_entries: ::std::os::raw::c_int,
map_flags: __u32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_create_map_in_map_node(
map_type: bpf_map_type,
name: *const ::std::os::raw::c_char,
key_size: ::std::os::raw::c_int,
inner_map_fd: ::std::os::raw::c_int,
max_entries: ::std::os::raw::c_int,
map_flags: __u32,
node: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_create_map_in_map(
map_type: bpf_map_type,
name: *const ::std::os::raw::c_char,
key_size: ::std::os::raw::c_int,
inner_map_fd: ::std::os::raw::c_int,
max_entries: ::std::os::raw::c_int,
map_flags: __u32,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct bpf_load_program_attr {
pub prog_type: bpf_prog_type,
pub expected_attach_type: bpf_attach_type,
pub name: *const ::std::os::raw::c_char,
pub insns: *const bpf_insn,
pub insns_cnt: usize,
pub license: *const ::std::os::raw::c_char,
pub __bindgen_anon_1: bpf_load_program_attr__bindgen_ty_1,
pub __bindgen_anon_2: bpf_load_program_attr__bindgen_ty_2,
pub prog_btf_fd: __u32,
pub func_info_rec_size: __u32,
pub func_info: *const ::std::os::raw::c_void,
pub func_info_cnt: __u32,
pub line_info_rec_size: __u32,
pub line_info: *const ::std::os::raw::c_void,
pub line_info_cnt: __u32,
pub log_level: __u32,
pub prog_flags: __u32,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union bpf_load_program_attr__bindgen_ty_1 {
pub kern_version: __u32,
pub attach_prog_fd: __u32,
_bindgen_union_align: u32,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union bpf_load_program_attr__bindgen_ty_2 {
pub prog_ifindex: __u32,
pub attach_btf_id: __u32,
_bindgen_union_align: u32,
}
extern "C" {
pub fn bpf_load_program_xattr(
load_attr: *const bpf_load_program_attr,
log_buf: *mut ::std::os::raw::c_char,
log_buf_sz: usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_load_program(
type_: bpf_prog_type,
insns: *const bpf_insn,
insns_cnt: usize,
license: *const ::std::os::raw::c_char,
kern_version: __u32,
log_buf: *mut ::std::os::raw::c_char,
log_buf_sz: usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_verify_program(
type_: bpf_prog_type,
insns: *const bpf_insn,
insns_cnt: usize,
prog_flags: __u32,
license: *const ::std::os::raw::c_char,
kern_version: __u32,
log_buf: *mut ::std::os::raw::c_char,
log_buf_sz: usize,
log_level: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_map_update_elem(
fd: ::std::os::raw::c_int,
key: *const ::std::os::raw::c_void,
value: *const ::std::os::raw::c_void,
flags: __u64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_map_lookup_elem(
fd: ::std::os::raw::c_int,
key: *const ::std::os::raw::c_void,
value: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_map_lookup_elem_flags(
fd: ::std::os::raw::c_int,
key: *const ::std::os::raw::c_void,
value: *mut ::std::os::raw::c_void,
flags: __u64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_map_lookup_and_delete_elem(
fd: ::std::os::raw::c_int,
key: *const ::std::os::raw::c_void,
value: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_map_delete_elem(
fd: ::std::os::raw::c_int,
key: *const ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_map_get_next_key(
fd: ::std::os::raw::c_int,
key: *const ::std::os::raw::c_void,
next_key: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_map_freeze(fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_obj_pin(
fd: ::std::os::raw::c_int,
pathname: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_obj_get(pathname: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_prog_attach(
prog_fd: ::std::os::raw::c_int,
attachable_fd: ::std::os::raw::c_int,
type_: bpf_attach_type,
flags: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_prog_detach(
attachable_fd: ::std::os::raw::c_int,
type_: bpf_attach_type,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_prog_detach2(
prog_fd: ::std::os::raw::c_int,
attachable_fd: ::std::os::raw::c_int,
type_: bpf_attach_type,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct bpf_prog_test_run_attr {
pub prog_fd: ::std::os::raw::c_int,
pub repeat: ::std::os::raw::c_int,
pub data_in: *const ::std::os::raw::c_void,
pub data_size_in: __u32,
pub data_out: *mut ::std::os::raw::c_void,
pub data_size_out: __u32,
pub retval: __u32,
pub duration: __u32,
pub ctx_in: *const ::std::os::raw::c_void,
pub ctx_size_in: __u32,
pub ctx_out: *mut ::std::os::raw::c_void,
pub ctx_size_out: __u32,
}
extern "C" {
pub fn bpf_prog_test_run_xattr(test_attr: *mut bpf_prog_test_run_attr)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_prog_test_run(
prog_fd: ::std::os::raw::c_int,
repeat: ::std::os::raw::c_int,
data: *mut ::std::os::raw::c_void,
size: __u32,
data_out: *mut ::std::os::raw::c_void,
size_out: *mut __u32,
retval: *mut __u32,
duration: *mut __u32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_prog_get_next_id(start_id: __u32, next_id: *mut __u32) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_map_get_next_id(start_id: __u32, next_id: *mut __u32) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_btf_get_next_id(start_id: __u32, next_id: *mut __u32) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_prog_get_fd_by_id(id: __u32) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_map_get_fd_by_id(id: __u32) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_btf_get_fd_by_id(id: __u32) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_obj_get_info_by_fd(
prog_fd: ::std::os::raw::c_int,
info: *mut ::std::os::raw::c_void,
info_len: *mut __u32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_prog_query(
target_fd: ::std::os::raw::c_int,
type_: bpf_attach_type,
query_flags: __u32,
attach_flags: *mut __u32,
prog_ids: *mut __u32,
prog_cnt: *mut __u32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_raw_tracepoint_open(
name: *const ::std::os::raw::c_char,
prog_fd: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_load_btf(
btf: *mut ::std::os::raw::c_void,
btf_size: __u32,
log_buf: *mut ::std::os::raw::c_char,
log_buf_size: __u32,
do_log: bool,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_task_fd_query(
pid: ::std::os::raw::c_int,
fd: ::std::os::raw::c_int,
flags: __u32,
buf: *mut ::std::os::raw::c_char,
buf_len: *mut __u32,
prog_id: *mut __u32,
fd_type: *mut __u32,
probe_offset: *mut __u64,
probe_addr: *mut __u64,
) -> ::std::os::raw::c_int;
}
pub type va_list = __builtin_va_list;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct btf_type {
pub name_off: __u32,
pub info: __u32,
pub __bindgen_anon_1: btf_type__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union btf_type__bindgen_ty_1 {
pub size: __u32,
pub type_: __u32,
_bindgen_union_align: u32,
}
pub const BTF_VAR_STATIC: _bindgen_ty_5 = 0;
pub const BTF_VAR_GLOBAL_ALLOCATED: _bindgen_ty_5 = 1;
pub type _bindgen_ty_5 = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btf {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btf_ext {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct bpf_object {
_unused: [u8; 0],
}
extern "C" {
pub fn btf__free(btf: *mut btf);
}
extern "C" {
pub fn btf__new(data: *mut __u8, size: __u32) -> *mut btf;
}
extern "C" {
pub fn btf__parse_elf(
path: *const ::std::os::raw::c_char,
btf_ext: *mut *mut btf_ext,
) -> *mut btf;
}
extern "C" {
pub fn btf__finalize_data(obj: *mut bpf_object, btf: *mut btf) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn btf__load(btf: *mut btf) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn btf__find_by_name(btf: *const btf, type_name: *const ::std::os::raw::c_char) -> __s32;
}
extern "C" {
pub fn btf__find_by_name_kind(
btf: *const btf,
type_name: *const ::std::os::raw::c_char,
kind: __u32,
) -> __s32;
}
extern "C" {
pub fn btf__get_nr_types(btf: *const btf) -> __u32;
}
extern "C" {
pub fn btf__type_by_id(btf: *const btf, id: __u32) -> *const btf_type;
}
extern "C" {
pub fn btf__resolve_size(btf: *const btf, type_id: __u32) -> __s64;
}
extern "C" {
pub fn btf__resolve_type(btf: *const btf, type_id: __u32) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn btf__fd(btf: *const btf) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn btf__get_raw_data(btf: *const btf, size: *mut __u32) -> *const ::std::os::raw::c_void;
}
extern "C" {
pub fn btf__name_by_offset(btf: *const btf, offset: __u32) -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn btf__get_from_id(id: __u32, btf: *mut *mut btf) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn btf__get_map_kv_tids(
btf: *const btf,
map_name: *const ::std::os::raw::c_char,
expected_key_size: __u32,
expected_value_size: __u32,
key_type_id: *mut __u32,
value_type_id: *mut __u32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn btf_ext__new(data: *mut __u8, size: __u32) -> *mut btf_ext;
}
extern "C" {
pub fn btf_ext__free(btf_ext: *mut btf_ext);
}
extern "C" {
pub fn btf_ext__get_raw_data(
btf_ext: *const btf_ext,
size: *mut __u32,
) -> *const ::std::os::raw::c_void;
}
extern "C" {
pub fn btf_ext__reloc_func_info(
btf: *const btf,
btf_ext: *const btf_ext,
sec_name: *const ::std::os::raw::c_char,
insns_cnt: __u32,
func_info: *mut *mut ::std::os::raw::c_void,
cnt: *mut __u32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn btf_ext__reloc_line_info(
btf: *const btf,
btf_ext: *const btf_ext,
sec_name: *const ::std::os::raw::c_char,
insns_cnt: __u32,
line_info: *mut *mut ::std::os::raw::c_void,
cnt: *mut __u32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn btf_ext__func_info_rec_size(btf_ext: *const btf_ext) -> __u32;
}
extern "C" {
pub fn btf_ext__line_info_rec_size(btf_ext: *const btf_ext) -> __u32;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btf_dedup_opts {
pub dedup_table_size: ::std::os::raw::c_uint,
pub dont_resolve_fwds: bool,
}
extern "C" {
pub fn btf__dedup(
btf: *mut btf,
btf_ext: *mut btf_ext,
opts: *const btf_dedup_opts,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btf_dump {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btf_dump_opts {
pub ctx: *mut ::std::os::raw::c_void,
}
pub type btf_dump_printf_fn_t = ::std::option::Option<
unsafe extern "C" fn(
ctx: *mut ::std::os::raw::c_void,
fmt: *const ::std::os::raw::c_char,
args: *mut __va_list_tag,
),
>;
extern "C" {
pub fn btf_dump__new(
btf: *const btf,
btf_ext: *const btf_ext,
opts: *const btf_dump_opts,
printf_fn: btf_dump_printf_fn_t,
) -> *mut btf_dump;
}
extern "C" {
pub fn btf_dump__free(d: *mut btf_dump);
}
extern "C" {
pub fn btf_dump__dump_type(d: *mut btf_dump, id: __u32) -> ::std::os::raw::c_int;
}
pub type pid_t = __pid_t;
extern "C" {
pub fn libbpf_strerror(
err: ::std::os::raw::c_int,
buf: *mut ::std::os::raw::c_char,
size: usize,
) -> ::std::os::raw::c_int;
}
pub const LIBBPF_WARN: libbpf_print_level = 0;
pub const LIBBPF_INFO: libbpf_print_level = 1;
pub const LIBBPF_DEBUG: libbpf_print_level = 2;
pub type libbpf_print_level = u32;
pub type libbpf_print_fn_t = ::std::option::Option<
unsafe extern "C" fn(
level: libbpf_print_level,
arg1: *const ::std::os::raw::c_char,
ap: *mut __va_list_tag,
) -> ::std::os::raw::c_int,
>;
extern "C" {
pub fn libbpf_set_print(fn_: libbpf_print_fn_t) -> libbpf_print_fn_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct bpf_object_open_attr {
pub file: *const ::std::os::raw::c_char,
pub prog_type: bpf_prog_type,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct bpf_object_open_opts {
pub sz: usize,
pub object_name: *const ::std::os::raw::c_char,
pub relaxed_maps: bool,
pub relaxed_core_relocs: bool,
pub pin_root_path: *const ::std::os::raw::c_char,
pub attach_prog_fd: __u32,
}
extern "C" {
pub fn bpf_object__open(path: *const ::std::os::raw::c_char) -> *mut bpf_object;
}
extern "C" {
pub fn bpf_object__open_file(
path: *const ::std::os::raw::c_char,
opts: *mut bpf_object_open_opts,
) -> *mut bpf_object;
}
extern "C" {
pub fn bpf_object__open_mem(
obj_buf: *const ::std::os::raw::c_void,
obj_buf_sz: usize,
opts: *mut bpf_object_open_opts,
) -> *mut bpf_object;
}
extern "C" {
pub fn bpf_object__open_buffer(
obj_buf: *const ::std::os::raw::c_void,
obj_buf_sz: usize,
name: *const ::std::os::raw::c_char,
) -> *mut bpf_object;
}
extern "C" {
pub fn bpf_object__open_xattr(attr: *mut bpf_object_open_attr) -> *mut bpf_object;
}
extern "C" {
pub fn bpf_object__section_size(
obj: *const bpf_object,
name: *const ::std::os::raw::c_char,
size: *mut __u32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_object__variable_offset(
obj: *const bpf_object,
name: *const ::std::os::raw::c_char,
off: *mut __u32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_object__pin_maps(
obj: *mut bpf_object,
path: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_object__unpin_maps(
obj: *mut bpf_object,
path: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_object__pin_programs(
obj: *mut bpf_object,
path: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_object__unpin_programs(
obj: *mut bpf_object,
path: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_object__pin(
object: *mut bpf_object,
path: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_object__close(object: *mut bpf_object);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct bpf_object_load_attr {
pub obj: *mut bpf_object,
pub log_level: ::std::os::raw::c_int,
pub target_btf_path: *const ::std::os::raw::c_char,
}
extern "C" {
pub fn bpf_object__load(obj: *mut bpf_object) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_object__load_xattr(attr: *mut bpf_object_load_attr) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_object__unload(obj: *mut bpf_object) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_object__name(obj: *const bpf_object) -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn bpf_object__kversion(obj: *const bpf_object) -> ::std::os::raw::c_uint;
}
extern "C" {
pub fn bpf_object__btf(obj: *const bpf_object) -> *mut btf;
}
extern "C" {
pub fn bpf_object__btf_fd(obj: *const bpf_object) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct bpf_program {
_unused: [u8; 0],
}
extern "C" {
pub fn bpf_object__find_program_by_title(
obj: *const bpf_object,
title: *const ::std::os::raw::c_char,
) -> *mut bpf_program;
}
extern "C" {
pub fn bpf_object__next(prev: *mut bpf_object) -> *mut bpf_object;
}
pub type bpf_object_clear_priv_t = ::std::option::Option<
unsafe extern "C" fn(arg1: *mut bpf_object, arg2: *mut ::std::os::raw::c_void),
>;
extern "C" {
pub fn bpf_object__set_priv(
obj: *mut bpf_object,
priv_: *mut ::std::os::raw::c_void,
clear_priv: bpf_object_clear_priv_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_object__priv(prog: *const bpf_object) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn libbpf_prog_type_by_name(
name: *const ::std::os::raw::c_char,
prog_type: *mut bpf_prog_type,
expected_attach_type: *mut bpf_attach_type,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn libbpf_attach_type_by_name(
name: *const ::std::os::raw::c_char,
attach_type: *mut bpf_attach_type,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn libbpf_find_vmlinux_btf_id(
name: *const ::std::os::raw::c_char,
attach_type: bpf_attach_type,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__next(prog: *mut bpf_program, obj: *const bpf_object) -> *mut bpf_program;
}
extern "C" {
pub fn bpf_program__prev(prog: *mut bpf_program, obj: *const bpf_object) -> *mut bpf_program;
}
pub type bpf_program_clear_priv_t = ::std::option::Option<
unsafe extern "C" fn(arg1: *mut bpf_program, arg2: *mut ::std::os::raw::c_void),
>;
extern "C" {
pub fn bpf_program__set_priv(
prog: *mut bpf_program,
priv_: *mut ::std::os::raw::c_void,
clear_priv: bpf_program_clear_priv_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__priv(prog: *const bpf_program) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn bpf_program__set_ifindex(prog: *mut bpf_program, ifindex: __u32);
}
extern "C" {
pub fn bpf_program__title(
prog: *const bpf_program,
needs_copy: bool,
) -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn bpf_program__size(prog: *const bpf_program) -> usize;
}
extern "C" {
pub fn bpf_program__load(
prog: *mut bpf_program,
license: *mut ::std::os::raw::c_char,
kern_version: __u32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__fd(prog: *const bpf_program) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__pin_instance(
prog: *mut bpf_program,
path: *const ::std::os::raw::c_char,
instance: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__unpin_instance(
prog: *mut bpf_program,
path: *const ::std::os::raw::c_char,
instance: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__pin(
prog: *mut bpf_program,
path: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__unpin(
prog: *mut bpf_program,
path: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__unload(prog: *mut bpf_program);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct bpf_link {
_unused: [u8; 0],
}
extern "C" {
pub fn bpf_link__destroy(link: *mut bpf_link) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__attach_perf_event(
prog: *mut bpf_program,
pfd: ::std::os::raw::c_int,
) -> *mut bpf_link;
}
extern "C" {
pub fn bpf_program__attach_kprobe(
prog: *mut bpf_program,
retprobe: bool,
func_name: *const ::std::os::raw::c_char,
) -> *mut bpf_link;
}
extern "C" {
pub fn bpf_program__attach_uprobe(
prog: *mut bpf_program,
retprobe: bool,
pid: pid_t,
binary_path: *const ::std::os::raw::c_char,
func_offset: usize,
) -> *mut bpf_link;
}
extern "C" {
pub fn bpf_program__attach_tracepoint(
prog: *mut bpf_program,
tp_category: *const ::std::os::raw::c_char,
tp_name: *const ::std::os::raw::c_char,
) -> *mut bpf_link;
}
extern "C" {
pub fn bpf_program__attach_raw_tracepoint(
prog: *mut bpf_program,
tp_name: *const ::std::os::raw::c_char,
) -> *mut bpf_link;
}
extern "C" {
pub fn bpf_program__attach_trace(prog: *mut bpf_program) -> *mut bpf_link;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct bpf_prog_prep_result {
pub new_insn_ptr: *mut bpf_insn,
pub new_insn_cnt: ::std::os::raw::c_int,
pub pfd: *mut ::std::os::raw::c_int,
}
pub type bpf_program_prep_t = ::std::option::Option<
unsafe extern "C" fn(
prog: *mut bpf_program,
n: ::std::os::raw::c_int,
insns: *mut bpf_insn,
insns_cnt: ::std::os::raw::c_int,
res: *mut bpf_prog_prep_result,
) -> ::std::os::raw::c_int,
>;
extern "C" {
pub fn bpf_program__set_prep(
prog: *mut bpf_program,
nr_instance: ::std::os::raw::c_int,
prep: bpf_program_prep_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__nth_fd(
prog: *const bpf_program,
n: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__set_socket_filter(prog: *mut bpf_program) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__set_tracepoint(prog: *mut bpf_program) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__set_raw_tracepoint(prog: *mut bpf_program) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__set_kprobe(prog: *mut bpf_program) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__set_sched_cls(prog: *mut bpf_program) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__set_sched_act(prog: *mut bpf_program) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__set_xdp(prog: *mut bpf_program) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__set_perf_event(prog: *mut bpf_program) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__set_tracing(prog: *mut bpf_program) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_program__get_type(prog: *mut bpf_program) -> bpf_prog_type;
}
extern "C" {
pub fn bpf_program__set_type(prog: *mut bpf_program, type_: bpf_prog_type);
}
extern "C" {
pub fn bpf_program__get_expected_attach_type(prog: *mut bpf_program) -> bpf_attach_type;
}
extern "C" {
pub fn bpf_program__set_expected_attach_type(prog: *mut bpf_program, type_: bpf_attach_type);
}
extern "C" {
pub fn bpf_program__is_socket_filter(prog: *const bpf_program) -> bool;
}
extern "C" {
pub fn bpf_program__is_tracepoint(prog: *const bpf_program) -> bool;
}
extern "C" {
pub fn bpf_program__is_raw_tracepoint(prog: *const bpf_program) -> bool;
}
extern "C" {
pub fn bpf_program__is_kprobe(prog: *const bpf_program) -> bool;
}
extern "C" {
pub fn bpf_program__is_sched_cls(prog: *const bpf_program) -> bool;
}
extern "C" {
pub fn bpf_program__is_sched_act(prog: *const bpf_program) -> bool;
}
extern "C" {
pub fn bpf_program__is_xdp(prog: *const bpf_program) -> bool;
}
extern "C" {
pub fn bpf_program__is_perf_event(prog: *const bpf_program) -> bool;
}
extern "C" {
pub fn bpf_program__is_tracing(prog: *const bpf_program) -> bool;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct bpf_map_def {
pub type_: ::std::os::raw::c_uint,
pub key_size: ::std::os::raw::c_uint,
pub value_size: ::std::os::raw::c_uint,
pub max_entries: ::std::os::raw::c_uint,
pub map_flags: ::std::os::raw::c_uint,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct bpf_map {
_unused: [u8; 0],
}
extern "C" {
pub fn bpf_object__find_map_by_name(
obj: *const bpf_object,
name: *const ::std::os::raw::c_char,
) -> *mut bpf_map;
}
extern "C" {
pub fn bpf_object__find_map_fd_by_name(
obj: *const bpf_object,
name: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_object__find_map_by_offset(obj: *mut bpf_object, offset: usize) -> *mut bpf_map;
}
extern "C" {
pub fn bpf_map__next(map: *const bpf_map, obj: *const bpf_object) -> *mut bpf_map;
}
extern "C" {
pub fn bpf_map__prev(map: *const bpf_map, obj: *const bpf_object) -> *mut bpf_map;
}
extern "C" {
pub fn bpf_map__fd(map: *const bpf_map) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_map__def(map: *const bpf_map) -> *const bpf_map_def;
}
extern "C" {
pub fn bpf_map__name(map: *const bpf_map) -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn bpf_map__btf_key_type_id(map: *const bpf_map) -> __u32;
}
extern "C" {
pub fn bpf_map__btf_value_type_id(map: *const bpf_map) -> __u32;
}
pub type bpf_map_clear_priv_t = ::std::option::Option<
unsafe extern "C" fn(arg1: *mut bpf_map, arg2: *mut ::std::os::raw::c_void),
>;
extern "C" {
pub fn bpf_map__set_priv(
map: *mut bpf_map,
priv_: *mut ::std::os::raw::c_void,
clear_priv: bpf_map_clear_priv_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_map__priv(map: *const bpf_map) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn bpf_map__reuse_fd(map: *mut bpf_map, fd: ::std::os::raw::c_int)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_map__resize(map: *mut bpf_map, max_entries: __u32) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_map__is_offload_neutral(map: *const bpf_map) -> bool;
}
extern "C" {
pub fn bpf_map__is_internal(map: *const bpf_map) -> bool;
}
extern "C" {
pub fn bpf_map__set_ifindex(map: *mut bpf_map, ifindex: __u32);
}
extern "C" {
pub fn bpf_map__set_pin_path(
map: *mut bpf_map,
path: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_map__get_pin_path(map: *const bpf_map) -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn bpf_map__is_pinned(map: *const bpf_map) -> bool;
}
extern "C" {
pub fn bpf_map__pin(
map: *mut bpf_map,
path: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_map__unpin(
map: *mut bpf_map,
path: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_map__set_inner_map_fd(
map: *mut bpf_map,
fd: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn libbpf_get_error(ptr: *const ::std::os::raw::c_void) -> ::std::os::raw::c_long;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct bpf_prog_load_attr {
pub file: *const ::std::os::raw::c_char,
pub prog_type: bpf_prog_type,
pub expected_attach_type: bpf_attach_type,
pub ifindex: ::std::os::raw::c_int,
pub log_level: ::std::os::raw::c_int,
pub prog_flags: ::std::os::raw::c_int,
}
extern "C" {
pub fn bpf_prog_load_xattr(
attr: *const bpf_prog_load_attr,
pobj: *mut *mut bpf_object,
prog_fd: *mut ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_prog_load(
file: *const ::std::os::raw::c_char,
type_: bpf_prog_type,
pobj: *mut *mut bpf_object,
prog_fd: *mut ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct xdp_link_info {
pub prog_id: __u32,
pub drv_prog_id: __u32,
pub hw_prog_id: __u32,
pub skb_prog_id: __u32,
pub attach_mode: __u8,
}
extern "C" {
pub fn bpf_set_link_xdp_fd(
ifindex: ::std::os::raw::c_int,
fd: ::std::os::raw::c_int,
flags: __u32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_get_link_xdp_id(
ifindex: ::std::os::raw::c_int,
prog_id: *mut __u32,
flags: __u32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bpf_get_link_xdp_info(
ifindex: ::std::os::raw::c_int,
info: *mut xdp_link_info,
info_size: usize,
flags: __u32,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct perf_buffer {
_unused: [u8; 0],
}
pub type perf_buffer_sample_fn = ::std::option::Option<
unsafe extern "C" fn(
ctx: *mut ::std::os::raw::c_void,
cpu: ::std::os::raw::c_int,
data: *mut ::std::os::raw::c_void,
size: __u32,
),
>;
pub type perf_buffer_lost_fn = ::std::option::Option<
unsafe extern "C" fn(ctx: *mut ::std::os::raw::c_void, cpu: ::std::os::raw::c_int, cnt: __u64),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct perf_buffer_opts {
pub sample_cb: perf_buffer_sample_fn,
pub lost_cb: perf_buffer_lost_fn,
pub ctx: *mut ::std::os::raw::c_void,
}
extern "C" {
pub fn perf_buffer__new(
map_fd: ::std::os::raw::c_int,
page_cnt: usize,
opts: *const perf_buffer_opts,
) -> *mut perf_buffer;
}
pub const LIBBPF_PERF_EVENT_DONE: bpf_perf_event_ret = 0;
pub const LIBBPF_PERF_EVENT_ERROR: bpf_perf_event_ret = -1;
pub const LIBBPF_PERF_EVENT_CONT: bpf_perf_event_ret = -2;
pub type bpf_perf_event_ret = i32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct perf_event_header {
_unused: [u8; 0],
}
pub type perf_buffer_event_fn = ::std::option::Option<
unsafe extern "C" fn(
ctx: *mut ::std::os::raw::c_void,
cpu: ::std::os::raw::c_int,
event: *mut perf_event_header,
) -> bpf_perf_event_ret,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct perf_buffer_raw_opts {
pub attr: *mut perf_event_attr,
pub event_cb: perf_buffer_event_fn,
pub ctx: *mut ::std::os::raw::c_void,
pub cpu_cnt: ::std::os::raw::c_int,
pub cpus: *mut ::std::os::raw::c_int,
pub map_keys: *mut ::std::os::raw::c_int,
}
extern "C" {
pub fn perf_buffer__new_raw(
map_fd: ::std::os::raw::c_int,
page_cnt: usize,
opts: *const perf_buffer_raw_opts,
) -> *mut perf_buffer;
}
extern "C" {
pub fn perf_buffer__free(pb: *mut perf_buffer);
}
extern "C" {
pub fn perf_buffer__poll(
pb: *mut perf_buffer,
timeout_ms: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
pub type bpf_perf_event_print_t = ::std::option::Option<
unsafe extern "C" fn(
hdr: *mut perf_event_header,
private_data: *mut ::std::os::raw::c_void,
) -> bpf_perf_event_ret,
>;
extern "C" {
pub fn bpf_perf_event_read_simple(
mmap_mem: *mut ::std::os::raw::c_void,
mmap_size: usize,
page_size: usize,
copy_mem: *mut *mut ::std::os::raw::c_void,
copy_size: *mut usize,
fn_: bpf_perf_event_print_t,
private_data: *mut ::std::os::raw::c_void,
) -> bpf_perf_event_ret;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nlattr {
_unused: [u8; 0],
}
pub type libbpf_dump_nlmsg_t = ::std::option::Option<
unsafe extern "C" fn(
cookie: *mut ::std::os::raw::c_void,
msg: *mut ::std::os::raw::c_void,
tb: *mut *mut nlattr,
) -> ::std::os::raw::c_int,
>;
extern "C" {
pub fn libbpf_netlink_open(nl_pid: *mut ::std::os::raw::c_uint) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn libbpf_nl_get_link(
sock: ::std::os::raw::c_int,
nl_pid: ::std::os::raw::c_uint,
dump_link_nlmsg: libbpf_dump_nlmsg_t,
cookie: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn libbpf_nl_get_class(
sock: ::std::os::raw::c_int,
nl_pid: ::std::os::raw::c_uint,
ifindex: ::std::os::raw::c_int,
dump_class_nlmsg: libbpf_dump_nlmsg_t,
cookie: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn libbpf_nl_get_qdisc(
sock: ::std::os::raw::c_int,
nl_pid: ::std::os::raw::c_uint,
ifindex: ::std::os::raw::c_int,
dump_qdisc_nlmsg: libbpf_dump_nlmsg_t,
cookie: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn libbpf_nl_get_filter(
sock: ::std::os::raw::c_int,
nl_pid: ::std::os::raw::c_uint,
ifindex: ::std::os::raw::c_int,
handle: ::std::os::raw::c_int,
dump_filter_nlmsg: libbpf_dump_nlmsg_t,
cookie: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct bpf_prog_linfo {
_unused: [u8; 0],
}
extern "C" {
pub fn bpf_prog_linfo__free(prog_linfo: *mut bpf_prog_linfo);
}
extern "C" {
pub fn bpf_prog_linfo__new(info: *const bpf_prog_info) -> *mut bpf_prog_linfo;
}
extern "C" {
pub fn bpf_prog_linfo__lfind_addr_func(
prog_linfo: *const bpf_prog_linfo,
addr: __u64,
func_idx: __u32,
nr_skip: __u32,
) -> *const bpf_line_info;
}
extern "C" {
pub fn bpf_prog_linfo__lfind(
prog_linfo: *const bpf_prog_linfo,
insn_off: __u32,
nr_skip: __u32,
) -> *const bpf_line_info;
}
extern "C" {
pub fn bpf_probe_prog_type(prog_type: bpf_prog_type, ifindex: __u32) -> bool;
}
extern "C" {
pub fn bpf_probe_map_type(map_type: bpf_map_type, ifindex: __u32) -> bool;
}
extern "C" {
pub fn bpf_probe_helper(id: bpf_func_id, prog_type: bpf_prog_type, ifindex: __u32) -> bool;
}
#[repr(C)]
#[derive(Debug)]
pub struct bpf_prog_info_linear {
pub info_len: __u32,
pub data_len: __u32,
pub arrays: __u64,
pub info: bpf_prog_info,
pub data: __IncompleteArrayField<__u8>,
}
extern "C" {
pub fn bpf_program__get_prog_info_linear(
fd: ::std::os::raw::c_int,
arrays: __u64,
) -> *mut bpf_prog_info_linear;
}
extern "C" {
pub fn bpf_program__bpil_addr_to_offs(info_linear: *mut bpf_prog_info_linear);
}
extern "C" {
pub fn bpf_program__bpil_offs_to_addr(info_linear: *mut bpf_prog_info_linear);
}
extern "C" {
pub fn libbpf_num_possible_cpus() -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct xsk_ring_prod {
pub cached_prod: __u32,
pub cached_cons: __u32,
pub mask: __u32,
pub size: __u32,
pub producer: *mut __u32,
pub consumer: *mut __u32,
pub ring: *mut ::std::os::raw::c_void,
pub flags: *mut __u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct xsk_ring_cons {
pub cached_prod: __u32,
pub cached_cons: __u32,
pub mask: __u32,
pub size: __u32,
pub producer: *mut __u32,
pub consumer: *mut __u32,
pub ring: *mut ::std::os::raw::c_void,
pub flags: *mut __u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct xsk_umem {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct xsk_socket {
_unused: [u8; 0],
}
extern "C" {
pub fn xsk_umem__fd(umem: *const xsk_umem) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn xsk_socket__fd(xsk: *const xsk_socket) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct xsk_umem_config {
pub fill_size: __u32,
pub comp_size: __u32,
pub frame_size: __u32,
pub frame_headroom: __u32,
pub flags: __u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct xsk_socket_config {
pub rx_size: __u32,
pub tx_size: __u32,
pub libbpf_flags: __u32,
pub xdp_flags: __u32,
pub bind_flags: __u16,
}
extern "C" {
pub fn xsk_umem__create(
umem: *mut *mut xsk_umem,
umem_area: *mut ::std::os::raw::c_void,
size: __u64,
fill: *mut xsk_ring_prod,
comp: *mut xsk_ring_cons,
config: *const xsk_umem_config,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn xsk_umem__create_v0_0_2(
umem: *mut *mut xsk_umem,
umem_area: *mut ::std::os::raw::c_void,
size: __u64,
fill: *mut xsk_ring_prod,
comp: *mut xsk_ring_cons,
config: *const xsk_umem_config,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn xsk_umem__create_v0_0_4(
umem: *mut *mut xsk_umem,
umem_area: *mut ::std::os::raw::c_void,
size: __u64,
fill: *mut xsk_ring_prod,
comp: *mut xsk_ring_cons,
config: *const xsk_umem_config,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn xsk_socket__create(
xsk: *mut *mut xsk_socket,
ifname: *const ::std::os::raw::c_char,
queue_id: __u32,
umem: *mut xsk_umem,
rx: *mut xsk_ring_cons,
tx: *mut xsk_ring_prod,
config: *const xsk_socket_config,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn xsk_umem__delete(umem: *mut xsk_umem) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn xsk_socket__delete(xsk: *mut xsk_socket);
}
pub type __builtin_va_list = [__va_list_tag; 1usize];
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __va_list_tag {
pub gp_offset: ::std::os::raw::c_uint,
pub fp_offset: ::std::os::raw::c_uint,
pub overflow_arg_area: *mut ::std::os::raw::c_void,
pub reg_save_area: *mut ::std::os::raw::c_void,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct perf_event_attr {
pub _address: u8,
}