Source code for pythonbpf.helper.helpers

import ctypes


[docs] def ktime(): """get current ktime""" return ctypes.c_int64(0)
[docs] def pid(): """get current process id""" return ctypes.c_int32(0)
[docs] def deref(ptr): """dereference a pointer""" result = ctypes.cast(ptr, ctypes.POINTER(ctypes.c_void_p)).contents.value return result if result is not None else 0
[docs] def comm(buf): """get current process command name""" return ctypes.c_int64(0)
[docs] def probe_read_str(dst, src): """Safely read a null-terminated string from kernel memory""" return ctypes.c_int64(0)
[docs] def random(): """get a pseudorandom u32 number""" return ctypes.c_int32(0)
[docs] def probe_read(dst, size, src): """Safely read data from kernel memory""" return ctypes.c_int64(0)
[docs] def smp_processor_id(): """get the current CPU id""" return ctypes.c_int32(0)
[docs] def uid(): """get current user id""" return ctypes.c_int32(0)
[docs] def skb_store_bytes(offset, from_buf, size, flags=0): """store bytes into a socket buffer""" return ctypes.c_int64(0)
[docs] def get_stack(buf, flags=0): """get the current stack trace""" return ctypes.c_int64(0)
[docs] def get_current_cgroup_id(): """Get the current cgroup ID""" return ctypes.c_int64(0)
XDP_ABORTED = ctypes.c_int64(0) XDP_DROP = ctypes.c_int64(1) XDP_PASS = ctypes.c_int64(2) XDP_TX = ctypes.c_int64(3) XDP_REDIRECT = ctypes.c_int64(4)