Struct solana_rbpf::disassembler::HlInsn[][src]

pub struct HlInsn {
    pub ptr: usize,
    pub opc: u8,
    pub name: String,
    pub desc: String,
    pub dst: u8,
    pub src: u8,
    pub off: i16,
    pub imm: i64,
}

High-level representation of an eBPF instruction.

In addition to standard operation code and various operand, this struct has the following properties:

  • It stores a name, corresponding to a mnemonic for the operation code.
  • It also stores a description, which is a mnemonic for the full instruction, using the actual values of the relevant operands, and that can be used for disassembling the eBPF program for example.
  • Immediate values are stored in an i64 instead of a traditional i32, in order to merge the two parts of (otherwise double-length) LD_DW_IMM instructions.

See https://www.kernel.org/doc/Documentation/networking/filter.txt for the Linux kernel documentation about eBPF, or https://github.com/iovisor/bpf-docs/blob/master/eBPF.md for a more concise version.

Fields

ptr: usize

Instruction pointer.

opc: u8

Operation code.

name: String

Name (mnemonic). This name is not canon.

desc: String

Description of the instruction. This is not canon.

dst: u8

Destination register operand.

src: u8

Source register operand.

off: i16

Offset operand.

imm: i64

Immediate value operand. For LD_DW_IMM instructions, contains the whole value merged from the two 8-bytes parts of the instruction.

Trait Implementations

impl Debug for HlInsn[src]

impl PartialEq<HlInsn> for HlInsn[src]

impl StructuralPartialEq for HlInsn[src]

Auto Trait Implementations

impl RefUnwindSafe for HlInsn

impl Send for HlInsn

impl Sync for HlInsn

impl Unpin for HlInsn

impl UnwindSafe for HlInsn

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,