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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// This file is part of linux-support. 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/linux-support/master/COPYRIGHT. No part of linux-support, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
// Copyright © 2020 The developers of linux-support. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/linux-support/master/COPYRIGHT.
/// Instruction class.
///
/// jmp mode in word width.
pub const BPF_JMP32: u8 = 0x06;
/// Instruction class.
///
/// alu mode in double word width.
pub const BPF_ALU64: u8 = 0x07;
/// ld/ldx fields.
///
/// double word (64-bit).
///
/// Extends the range of classic BPF sizes `BPF_W`, `BPF_H` and `BPF_B`.
pub const BPF_DW: u8 = 0x18;
/// exclusive add.
pub const BPF_XADD: u8 = 0xC0;
/// alu/jmp fields.
///
/// mov reg to reg.
pub const BPF_MOV: u8 = 0xB0;
/// alu/jmp fields.
///
/// sign extending arithmetic shift right.
pub const BPF_ARSH: u8 = 0xC0;
/// change endianness of a register.
///
/// flags for endianness conversion.
pub const BPF_END: u8 = 0xD0;
/// change endianness of a register.
///
/// convert to little-endian.
pub const BPF_TO_LE: u8 = 0x00;
/// change endianness of a register.
///
/// convert to big-endian.
pub const BPF_TO_BE: u8 = 0x08;
/// change endianness of a register.
pub const BPF_FROM_LE: u8 = BPF_TO_LE;
/// change endianness of a register.
pub const BPF_FROM_BE: u8 = BPF_TO_BE;
/// jmp encodings.
///
/// jump !=.
pub const BPF_JNE: u8 = 0x50;
/// jmp encodings.
///
/// LT is unsigned, '<'.
pub const BPF_JLT: u8 = 0xA0;
/// jmp encodings.
///
/// LE is unsigned, '<='.
pub const BPF_JLE: u8 = 0xB0;
/// jmp encodings.
///
/// SGT is signed '>', GT in x86.
pub const BPF_JSGT: u8 = 0x60;
/// jmp encodings.
///
/// SGE is signed '>=', GE in x86.
pub const BPF_JSGE: u8 = 0x70;
/// jmp encodings.
///
/// SLT is signed, '<'.
pub const BPF_JSLT: u8 = 0xC0;
/// jmp encodings.
///
/// SLE is signed, '<='.
pub const BPF_JSLE: u8 = 0xD0;
/// jmp encodings.
///
/// function call.
pub const BPF_CALL: u8 = 0x80;
/// jmp encodings.
///
/// function return.
pub const BPF_EXIT: u8 = 0x90;