Go to the source code of this file.
|
|
int | bpf_create_map (enum bpf_map_type map_type, int key_size, int value_size, int max_entries, __u32 map_flags) |
| Create a new map. More...
|
|
int | bpf_create_map_in_map (enum bpf_map_type map_type, const char *name, int key_size, int inner_map_fd, int max_entries, __u32 map_flags) |
| Create a new map-in-map. More...
|
|
int | bpf_create_map_xattr (const struct bpf_create_map_attr *create_attr) |
| Create a new map. More...
|
|
|
int | bpf_load_program (enum bpf_prog_type type, const struct bpf_insn *insns, size_t insns_cnt, const char *license, __u32 kern_version, char *log_buf, size_t log_buf_sz) |
| Load (but do not attach) an eBPF program from eBPF instructions supplied by the caller. More...
|
|
int | bpf_load_program_xattr (const struct bpf_load_program_attr *load_attr, char *log_buf, size_t log_buf_sz) |
| Load (but do not attach) an eBPF program from eBPF instructions supplied by the caller. More...
|
|
◆ bpf_create_map()
int bpf_create_map |
( |
enum bpf_map_type |
map_type, |
|
|
int |
key_size, |
|
|
int |
value_size, |
|
|
int |
max_entries, |
|
|
__u32 |
map_flags |
|
) |
| |
Create a new map.
- Parameters
-
[in] | map_type | Type of map to create. |
[in] | key_size | Size in bytes of keys. |
[in] | value_size | Size in bytes of values. |
[in] | max_entries | Maximum number of entries in the map. |
[in] | map_flags | Flags (currently 0). |
- Returns
- A new file descriptor that refers to the map. The caller should call _close() on the fd to close this when done. A negative value indicates an error occurred and errno was set.
- Deprecated:
- Use bpf_map_create() instead.
- Exceptions
-
EINVAL | An invalid argument was provided. |
ENOMEM | Out of memory. |
◆ bpf_create_map_in_map()
int bpf_create_map_in_map |
( |
enum bpf_map_type |
map_type, |
|
|
const char * |
name, |
|
|
int |
key_size, |
|
|
int |
inner_map_fd, |
|
|
int |
max_entries, |
|
|
__u32 |
map_flags |
|
) |
| |
Create a new map-in-map.
- Parameters
-
[in] | map_type | Type of outer map to create. |
[in] | name | Optionally, the name to use for the map. |
[in] | key_size | Size in bytes of keys. |
[in] | inner_map_fd | File descriptor of the inner map template. |
[in] | max_entries | Maximum number of entries in the map. |
[in] | map_flags | Flags (currently 0). |
- Returns
- A new file descriptor that refers to the map. The caller should call _close() on the fd to close this when done. A negative value indicates an error occurred and errno was set.
- Deprecated:
- Use bpf_map_create() instead.
- Exceptions
-
EBADF | The file descriptor was not found. |
EINVAL | An invalid argument was provided. |
ENOMEM | Out of memory. |
◆ bpf_create_map_xattr()
Create a new map.
- Parameters
-
[in] | create_attr | Structure of attributes using which a map gets created. |
- Returns
- A new file descriptor that refers to the map. The caller should call _close() on the fd to close this when done. A negative value indicates an error occurred and errno was set.
- Exceptions
-
EINVAL | An invalid argument was provided. |
ENOMEM | Out of memory. |
- Deprecated:
- Use bpf_map_create() instead.
◆ bpf_load_program()
int bpf_load_program |
( |
enum bpf_prog_type |
type, |
|
|
const struct bpf_insn * |
insns, |
|
|
size_t |
insns_cnt, |
|
|
const char * |
license, |
|
|
__u32 |
kern_version, |
|
|
char * |
log_buf, |
|
|
size_t |
log_buf_sz |
|
) |
| |
Load (but do not attach) an eBPF program from eBPF instructions supplied by the caller.
- Parameters
-
[in] | type | Program type to use. |
[in] | insns | Array of eBPF instructions. |
[in] | insns_cnt | Number of eBPF instructions in the array. |
[in] | license | License. |
[in] | kern_version | Kernel version. |
[out] | log_buf | Buffer in which to write any log messages. |
[in] | log_buf_size | Size in bytes of the log buffer. |
- Returns
- File descriptor that refers to the program, or <0 on error. The caller should call _close() on the fd to close this when done.
- Deprecated:
- Use bpf_prog_load() instead.
- Exceptions
-
EACCES | The program failed verification. |
EINVAL | One or more parameters are incorrect. |
ENOMEM | Out of memory. |
- See also
- bpf_prog_load
-
bpf_load_program_xattr
◆ bpf_load_program_xattr()
int bpf_load_program_xattr |
( |
const struct bpf_load_program_attr * |
load_attr, |
|
|
char * |
log_buf, |
|
|
size_t |
log_buf_sz |
|
) |
| |
Load (but do not attach) an eBPF program from eBPF instructions supplied by the caller.
- Parameters
-
[in] | load_attr | Parameters to use to load the eBPF program. |
[out] | log_buf | Buffer in which to write any log messages. |
[in] | log_buf_size | Size in bytes of the log buffer. |
- Returns
- File descriptor that refers to the program, or <0 on error. The caller should call _close() on the fd to close this when done.
- Exceptions
-
EACCES | The program failed verification. |
EINVAL | One or more parameters are incorrect. |
ENOMEM | Out of memory. |
- Deprecated:
- Use bpf_prog_load() instead.
- See also
- bpf_prog_load
-
bpf_load_program