Go to the documentation of this file.
9 #define MAX_TAIL_CALL_CNT 32
14 #define bpf_map _ebpf_map_definition_in_file
17 #define EBPF_HELPER(return_type, name, args) typedef return_type(*name##_t) args
32 #define bpf_map_lookup_elem ((bpf_map_lookup_elem_t)1)
48 #define bpf_map_update_elem ((bpf_map_update_elem_t)2)
61 #define bpf_map_delete_elem ((bpf_map_delete_elem_t)3)
73 EBPF_HELPER(int64_t,
bpf_tail_call, (
void* ctx,
struct bpf_map* prog_array_map, uint32_t index));
75 #define bpf_tail_call ((bpf_tail_call_t)4)
85 #define bpf_get_prandom_u32 ((bpf_get_prandom_u32_t)5)
95 #define bpf_ktime_get_boot_ns ((bpf_ktime_get_boot_ns_t)6)
105 #define bpf_get_smp_processor_id ((bpf_get_smp_processor_id_t)7)
108 #define SEC(name) __attribute__((section(name), used))
uint64_t bpf_get_smp_processor_id()
Return SMP id of the processor running the program.
int64_t bpf_tail_call(void *ctx, struct _ebpf_map_definition_in_file *prog_array_map, uint32_t index)
Perform a tail call into another eBPF program.
int64_t bpf_map_delete_elem(struct _ebpf_map_definition_in_file *map, void *key)
Remove an entry from the map.
void * bpf_map_lookup_elem(struct _ebpf_map_definition_in_file *map, void *key)
Get a pointer to an entry in the map.
int64_t bpf_map_update_elem(struct _ebpf_map_definition_in_file *map, void *key, void *value, uint64_t flags)
Insert or update an entry in the map.
uint64_t bpf_ktime_get_boot_ns()
Return time elapsed since boot in nanoseconds.
#define bpf_map
Definition: ebpf_helpers.h:14
uint32_t bpf_get_prandom_u32()
Get a pseudo-random number.