@brief Register an external function.
The immediate field of a CALL instruction is an index into an array of
functions registered by the user. This API associates a function with
an index.
@brief Register a function that dispatches to external helpers
The immediate field of a CALL instruction is an index of a helper
function to invoke. This API sets a callback that will choose the
helper function to invoke (based on the index) and then invoke it.
This API also sets a callback that the validator will use to determine
if a given index is a valid external function.
@brief Set the instruction limit for the VM. This is the maximum number
of instructions that a program may execute during a call to ubpf_exec.
It has no effect on JIT’d programs.
@brief Set a size for the buffer allocated to machine code generated during JIT compilation.
The JIT compiler allocates a buffer to store the code while it is being generated. The default
may be too big for some embedded platforms. Use this to customize the size of that buffer.
Note: The buffer being sized here is not the final location of the machine code returned by
ubpf_compile – that buffer is perfectly sized to match the size of the generated machine code.
@brief Instruct the uBPF runtime to apply unwind-on-success semantics to a helper function.
If the function returns 0, the uBPF runtime will end execution of
the eBPF program and immediately return control to the caller. This is used
for implementing function like the “bpf_tail_call” helper.
@brief Enable or disable undefined behavior checks. Undefined behavior includes
reading from uninitialized memory or using uninitialized registers. Default is disabled to
preserve performance and compatibility with existing eBPF programs.