#include <stdint.h>
#include "ebpf_structs.h"
Go to the source code of this file.
◆ bpf_map
◆ MAX_TAIL_CALL_CNT
#define MAX_TAIL_CALL_CNT 32 |
◆ SEC
#define SEC |
( |
|
name | ) |
__attribute__((section(name), used)) |
◆ bpf_get_prandom_u32()
uint32_t bpf_get_prandom_u32 |
( |
| ) |
|
Get a pseudo-random number.
- Returns
- A random 32-bit unsigned value.
◆ bpf_get_smp_processor_id()
uint64_t bpf_get_smp_processor_id |
( |
| ) |
|
Return SMP id of the processor running the program.
- Returns
- SMP id of the processor running the program.
◆ bpf_ktime_get_boot_ns()
uint64_t bpf_ktime_get_boot_ns |
( |
| ) |
|
Return time elapsed since boot in nanoseconds.
- Returns
- Time elapsed since boot in nanosecond units.
◆ bpf_map_delete_elem()
Remove an entry from the map.
- Parameters
-
[in] | map | Map to update. |
[in] | key | Key to use when searching and updating the map. |
- Return values
-
EBPF_SUCCESS | The operation was successful. |
-EBPF_INVALID_ARGUMENT | One or more parameters are invalid. |
◆ bpf_map_lookup_elem()
Get a pointer to an entry in the map.
- Parameters
-
[in] | map | Map to search. |
[in] | key | Key to use when searching map. |
- Returns
- Pointer to the value if found or NULL.
◆ bpf_map_update_elem()
Insert or update an entry in the map.
- Parameters
-
[in] | map | Map to update. |
[in] | key | Key to use when searching and updating the map. |
[in] | value | Value to insert into the map. |
[in] | flags | Map flags. |
- Return values
-
EBPF_SUCCESS | The operation was successful. |
-EBPF_NO_MEMORY | Unable to allocate resources for this entry. |
◆ bpf_tail_call()
Perform a tail call into another eBPF program.
- Parameters
-
[in] | ctx | Context to pass to the called program. |
[in] | prog_array_map | Map of program fds. |
[in] | index | Index in map of program to call. |
- Return values
-
EBPF_SUCCESS | The operation was successful. |
-EBPF_INVALID_ARGUMENT | One or more parameters are invalid. |