1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// This file is part of ubpf. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/ubpf/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
// Copyright © 2017 The developers of ubpf. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/ubpf/master/COPYRIGHT.
/// bpf syscall command.
///
/// Arguments for the command are passed using the union `bpf_attr`.
///
/// Prefixed with `BPF_` in Linux sources.
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[allow(missing_docs)]
pub enum bpf_cmd
{
/// Set the `bpf_attr.map_create` field.
MAP_CREATE = 0,
/// Set the `bpf_attr.map_element` field.
MAP_LOOKUP_ELEM = 1,
/// Set the `bpf_attr.map_element` field.
MAP_UPDATE_ELEM = 2,
/// Set the `bpf_attr.map_element` field.
MAP_DELETE_ELEM = 3,
MAP_GET_NEXT_KEY = 4,
/// Set the `bpf_attr.program_load` field.
PROG_LOAD = 5,
/// Set the `bpf_attr.object` field.
OBJ_PIN = 6,
/// Set the `bpf_attr.object` field.
OBJ_GET = 7,
PROG_ATTACH = 8,
PROG_DETACH = 9,
PROG_TEST_RUN = 10,
PROG_GET_NEXT_ID = 11,
MAP_GET_NEXT_ID = 12,
PROG_GET_FD_BY_ID = 13,
MAP_GET_FD_BY_ID = 14,
OBJ_GET_INFO_BY_FD = 15,
PROG_QUERY = 16,
RAW_TRACEPOINT_OPEN = 17,
BTF_LOAD = 18,
BTF_GET_FD_BY_ID = 19,
TASK_FD_QUERY = 20,
}