Libbpf userspace function bpf_program__set_type
Sets the program type of the passed BPF program.
Definition
int bpf_program__set_type(struct bpf_program *prog, enum bpf_prog_type type);
Parameters
prog
: BPF program to set the program type fortype
: program type to set the BPF map to have
Return
error code; or 0
if no error. An error occurs if the object is already loaded.
Usage
This must be called before the BPF object is loaded, otherwise it has no effect and an error is returned.
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome