Module solana_rbpf::ebpf [−][src]
This module contains all the definitions related to eBPF, and some functions permitting to manipulate eBPF instructions.
The number of bytes in an instruction, the maximum number of instructions in a program, and also all operation codes are defined here as constants.
The structure for an instruction used by this crate, as well as the function to extract it from a program, is also defined in the module.
To learn more about these instructions, see the Linux kernel documentation: https://www.kernel.org/doc/Documentation/networking/filter.txt, or for a shorter version of the list of the operation codes: https://github.com/iovisor/bpf-docs/blob/master/eBPF.md
Structs
Insn | An eBPF instruction. |
Constants
ADD32_IMM | BPF opcode: |
ADD32_REG | BPF opcode: |
ADD64_IMM | BPF opcode: |
ADD64_REG | BPF opcode: |
AND32_IMM | BPF opcode: |
AND32_REG | BPF opcode: |
AND64_IMM | BPF opcode: |
AND64_REG | BPF opcode: |
ARSH32_IMM | BPF opcode: |
ARSH32_REG | BPF opcode: |
ARSH64_IMM | BPF opcode: |
ARSH64_REG | BPF opcode: |
BE | BPF opcode: |
BPF_ABS | BPF mode modifier: absolute load. |
BPF_ADD | BPF ALU/ALU64 operation code: addition. |
BPF_ALU | BPF operation class: 32 bits arithmetic operation. |
BPF_ALU64 | BPF operation class: 64 bits arithmetic operation. |
BPF_ALU_OP_MASK | Mask to extract the arithmetic operation code from an instruction operation code. |
BPF_AND | BPF ALU/ALU64 operation code: and. |
BPF_ARSH | BPF ALU/ALU64 operation code: sign extending right shift. |
BPF_B | BPF size modifier: byte (1 byte). |
BPF_CALL | BPF JMP operation code: syscall function call. |
BPF_CLS_MASK | Mask to extract the operation class from an operation code. |
BPF_DIV | BPF ALU/ALU64 operation code: division. |
BPF_DW | BPF size modifier: double word (8 bytes). |
BPF_END | BPF ALU/ALU64 operation code: endianness conversion. |
BPF_EXIT | BPF JMP operation code: return from program. |
BPF_H | BPF size modifier: half-word (2 bytes). |
BPF_IMM | BPF mode modifier: immediate value. |
BPF_IND | BPF mode modifier: indirect load. |
BPF_JA | BPF JMP operation code: jump. |
BPF_JEQ | BPF JMP operation code: jump if equal. |
BPF_JGE | BPF JMP operation code: jump if greater or equal. |
BPF_JGT | BPF JMP operation code: jump if greater than. |
BPF_JLE | BPF JMP operation code: jump if lower or equal. |
BPF_JLT | BPF JMP operation code: jump if lower than. |
BPF_JMP | BPF operation class: jump. |
BPF_JNE | BPF JMP operation code: jump if not equal. |
BPF_JSET | BPF JMP operation code: jump if |
BPF_JSGE | BPF JMP operation code: jump if greater or equal (signed). |
BPF_JSGT | BPF JMP operation code: jump if greater than (signed). |
BPF_JSLE | BPF JMP operation code: jump if lower or equal (signed). |
BPF_JSLT | BPF JMP operation code: jump if lower than (signed). |
BPF_K | BPF source operand modifier: 32-bit immediate value. |
BPF_LD | BPF operation class: load from immediate. |
BPF_LDX | BPF operation class: load from register. |
BPF_LSH | BPF ALU/ALU64 operation code: left shift. |
BPF_MEM | BPF mode modifier: load from / store to memory. |
BPF_MOD | BPF ALU/ALU64 operation code: modulus. |
BPF_MOV | BPF ALU/ALU64 operation code: move. |
BPF_MUL | BPF ALU/ALU64 operation code: multiplication. |
BPF_NEG | BPF ALU/ALU64 operation code: negation. |
BPF_OR | BPF ALU/ALU64 operation code: or. |
BPF_RSH | BPF ALU/ALU64 operation code: right shift. |
BPF_ST | BPF operation class: store immediate. |
BPF_STX | BPF operation class: store value from register. |
BPF_SUB | BPF ALU/ALU64 operation code: subtraction. |
BPF_W | BPF size modifier: word (4 bytes). |
BPF_X | BPF source operand modifier: |
BPF_XADD | BPF mode modifier: exclusive add. |
BPF_XOR | BPF ALU/ALU64 operation code: exclusive or. |
CALL_IMM | BPF opcode: |
CALL_REG | BPF opcode: tail call. |
DIV32_IMM | BPF opcode: |
DIV32_REG | BPF opcode: |
DIV64_IMM | BPF opcode: |
DIV64_REG | BPF opcode: |
ELF_INSN_DUMP_OFFSET | ELF dump instruction offset Instruction numbers typically start at 29 in the ELF dump, use this offset when reporting so that trace aligns with the dump. |
EXIT | BPF opcode: |
FIRST_SCRATCH_REG | First scratch register |
INSN_SIZE | Size of an eBPF instructions, in bytes. |
JA | BPF opcode: |
JEQ_IMM | BPF opcode: |
JEQ_REG | BPF opcode: |
JGE_IMM | BPF opcode: |
JGE_REG | BPF opcode: |
JGT_IMM | BPF opcode: |
JGT_REG | BPF opcode: |
JLE_IMM | BPF opcode: |
JLE_REG | BPF opcode: |
JLT_IMM | BPF opcode: |
JLT_REG | BPF opcode: |
JNE_IMM | BPF opcode: |
JNE_REG | BPF opcode: |
JSET_IMM | BPF opcode: |
JSET_REG | BPF opcode: |
JSGE_IMM | BPF opcode: |
JSGE_REG | BPF opcode: |
JSGT_IMM | BPF opcode: |
JSGT_REG | BPF opcode: |
JSLE_IMM | BPF opcode: |
JSLE_REG | BPF opcode: |
JSLT_IMM | BPF opcode: |
JSLT_REG | BPF opcode: |
LD_ABS_B | BPF opcode: |
LD_ABS_DW | BPF opcode: |
LD_ABS_H | BPF opcode: |
LD_ABS_W | BPF opcode: |
LD_B_REG | BPF opcode: |
LD_DW_IMM | BPF opcode: |
LD_DW_REG | BPF opcode: |
LD_H_REG | BPF opcode: |
LD_IND_B | BPF opcode: |
LD_IND_DW | BPF opcode: |
LD_IND_H | BPF opcode: |
LD_IND_W | BPF opcode: |
LD_W_REG | BPF opcode: |
LE | BPF opcode: |
LSH32_IMM | BPF opcode: |
LSH32_REG | BPF opcode: |
LSH64_IMM | BPF opcode: |
LSH64_REG | BPF opcode: |
MM_HEAP_START | Start of the heap in the memory map |
MM_INPUT_START | Start of the input buffers in the memory map |
MM_PROGRAM_START | Start of the program bits (text and ro segments) in the memory map |
MM_STACK_START | Start of the stack in the memory map |
MOD32_IMM | BPF opcode: |
MOD32_REG | BPF opcode: |
MOD64_IMM | BPF opcode: |
MOD64_REG | BPF opcode: |
MOV32_IMM | BPF opcode: |
MOV32_REG | BPF opcode: |
MOV64_IMM | BPF opcode: |
MOV64_REG | BPF opcode: |
MUL32_IMM | BPF opcode: |
MUL32_REG | BPF opcode: |
MUL64_IMM | BPF opcode: |
MUL64_REG | BPF opcode: |
NEG32 | BPF opcode: |
NEG64 | BPF opcode: |
OR32_IMM | BPF opcode: |
OR32_REG | BPF opcode: |
OR64_IMM | BPF opcode: |
OR64_REG | BPF opcode: |
PROG_MAX_INSNS | Maximum number of instructions in an eBPF program. |
PROG_MAX_SIZE | Maximum size of an eBPF program, in bytes. |
RSH32_IMM | BPF opcode: |
RSH32_REG | BPF opcode: |
RSH64_IMM | BPF opcode: |
RSH64_REG | BPF opcode: |
SCRATCH_REGS | Number of scratch registers |
STACK_REG | Stack register |
ST_B_IMM | BPF opcode: |
ST_B_REG | BPF opcode: |
ST_DW_IMM | BPF opcode: |
ST_DW_REG | BPF opcode: |
ST_DW_XADD | BPF opcode: |
ST_H_IMM | BPF opcode: |
ST_H_REG | BPF opcode: |
ST_W_IMM | BPF opcode: |
ST_W_REG | BPF opcode: |
ST_W_XADD | BPF opcode: |
SUB32_IMM | BPF opcode: |
SUB32_REG | BPF opcode: |
SUB64_IMM | BPF opcode: |
SUB64_REG | BPF opcode: |
XOR32_IMM | BPF opcode: |
XOR32_REG | BPF opcode: |
XOR64_IMM | BPF opcode: |
XOR64_REG | BPF opcode: |
Functions
get_insn | Get the instruction at |
get_insn_unchecked | Same as |
hash_symbol_name | Hash a symbol name |
to_insn_vec | Return a vector of |