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
//! BPF programming utilities
//! --------------------------
//!
//! These are functions for building fragments of low-level
//! BPF (Berkeley Packet Filter) code, used for making system
//! call filtering decisions in seccomp.
use crate*;
/// Build a BPF statement with one 32-bit parameter.
///
/// This is suitable for building any instruction other than conditional
/// jumps, which have additional jump target fields.
pub const
/// Build any BPF statement including conditional jumps.
///
/// This is equivalent to constructing a SockFilter from its parts.
pub const
/// Build an unconditional jump instruction.
///
/// In BPF, jumps always go forward, loops are not possible. The parameter
/// is a count of instructions to skip. This is equivalent
/// to `stmt( BPF_JMP + BPF_JA, k )`.
pub const
/// Build an instruction to load a 32-bit immediate value into the accumulator.
///
/// This is equivalent to `stmt( BPF_LD + BPF_W + BPF_IMM, k )`.
pub const
/// Build an instruction to return a 32-bit constant value.
///
/// This is equivalent to `stmt( BPF_RET + BPF_K, k )`
pub const
/// Build an instruction to load a 32-bit value from a constant address.
///
/// This is equivalent to `stmt( BPF_LD + BPF_W + BPF_ABS, k )`
pub const
/// Build an instruction to store a 32-bit value at a constant address.
///
/// This is equivalent to `stmt( BPF_ST, k )`
pub const