ubpf_load

Function ubpf_load 

Source
pub unsafe extern "C" fn ubpf_load(
    vm: *mut ubpf_vm,
    code: *const c_void,
    code_len: u32,
    errmsg: *mut *mut c_char,
) -> c_int
Expand description

@brief Load code into a VM. This must be done before calling ubpf_exec or ubpf_compile and after registering all functions.

‘code’ should point to eBPF bytecodes and ‘code_len’ should be the size in bytes of that buffer.

@param[in] vm The VM to load the code into. @param[in] code The eBPF bytecodes to load. @param[in] code_len The length of the eBPF bytecodes. @param[out] errmsg The error message, if any. This should be freed by the caller. @retval 0 Success. @retval -1 Failure.