pub struct BpfCode { /* private fields */ }
Expand description
BPF instruction stack in byte representation
Implementations§
Source§impl BpfCode
impl BpfCode
Sourcepub fn left_shift(&mut self, source: Source, arch: Arch) -> Move<'_>
pub fn left_shift(&mut self, source: Source, arch: Arch) -> Move<'_>
create LSHIFT instruction
Sourcepub fn right_shift(&mut self, source: Source, arch: Arch) -> Move<'_>
pub fn right_shift(&mut self, source: Source, arch: Arch) -> Move<'_>
create RSHIFT instruction
Sourcepub fn signed_right_shift(&mut self, source: Source, arch: Arch) -> Move<'_>
pub fn signed_right_shift(&mut self, source: Source, arch: Arch) -> Move<'_>
create SIGNED RSHIFT instruction
Sourcepub fn swap_bytes(&mut self, endian: Endian) -> SwapBytes<'_>
pub fn swap_bytes(&mut self, endian: Endian) -> SwapBytes<'_>
create byte swap instruction
Sourcepub fn load(&mut self, mem_size: MemSize) -> Load<'_>
pub fn load(&mut self, mem_size: MemSize) -> Load<'_>
create LOAD instruction, IMMEDIATE is the source
Sourcepub fn load_x(&mut self, mem_size: MemSize) -> Load<'_>
pub fn load_x(&mut self, mem_size: MemSize) -> Load<'_>
create LOAD instruction, MEMORY is the source
Sourcepub fn store(&mut self, mem_size: MemSize) -> Store<'_>
pub fn store(&mut self, mem_size: MemSize) -> Store<'_>
creates STORE instruction, IMMEDIATE is the source
Sourcepub fn store_x(&mut self, mem_size: MemSize) -> Store<'_>
pub fn store_x(&mut self, mem_size: MemSize) -> Store<'_>
creates STORE instruction, MEMORY is the source
Sourcepub fn jump_unconditional(&mut self) -> Jump<'_>
pub fn jump_unconditional(&mut self) -> Jump<'_>
create unconditional JMP instruction
Sourcepub fn jump_conditional(&mut self, cond: Cond, src_bit: Source) -> Jump<'_>
pub fn jump_conditional(&mut self, cond: Cond, src_bit: Source) -> Jump<'_>
create conditional JMP instruction
Sourcepub fn call(&mut self) -> FunctionCall<'_>
pub fn call(&mut self) -> FunctionCall<'_>
create CALL instruction
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BpfCode
impl RefUnwindSafe for BpfCode
impl Send for BpfCode
impl Sync for BpfCode
impl Unpin for BpfCode
impl UnwindSafe for BpfCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more