[][src]Struct solana_rbpf::disassembler::HLInsn

pub struct HLInsn {
    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

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.