Skip to main content

Abi

Enum Abi 

Source
pub enum Abi {
    X86_64,
    I386,
    Aarch64,
    Arm,
}
Expand description

The ABI a request came through.

Variants§

§

X86_64

§

I386

§

Aarch64

§

Arm

32-bit ARM (EABI) compat on an aarch64 kernel.

Implementations§

Source§

impl Abi

Source

pub fn from_audit(arch: u32) -> Option<Abi>

ABI from a seccomp arch field; None for x32 and anything else.

Source

pub fn native() -> Abi

The 64-bit ABI of the host this binary was built for.

Source

pub fn compat() -> Abi

The 32-bit compat ABI of the host, if any.

Source

pub fn audit(self) -> u32

Audit arch value the kernel reports for this ABI.

Source

pub fn ptr_size(self) -> usize

Size of a pointer in the tracee.

Source

pub fn to_canonical(self, nr: i64) -> Option<(i64, Variant)>

Maps a syscall number of this ABI onto the canonical (x86_64) number.

§Arguments
  • nr - Syscall number as the tracee issued it.
§Returns

The canonical number and the argument variant, or None when the syscall is not one we filter (or the ABI is not served).

Source

pub fn open_flags_arg(self, nr: i64) -> Option<usize>

This ABI’s number for a canonical open-family syscall, with the index of its flags argument (for the filter’s O_PATH routing).

Source

pub fn open_flags_to_host(self, flags: i64) -> i64

Converts this ABI’s open(2) flag bits into the host’s.

The generic values are shared by x86 and aarch64; ARM differs in O_DIRECTORY, O_NOFOLLOW, O_DIRECT and O_LARGEFILE, so a 32-bit ARM caller’s flags are remapped before any handler interprets them.

§Arguments
  • flags - Flags as the tracee passed them.
Source

pub fn socketcall_nr(self) -> Option<i64>

The legacy socketcall multiplexer of this ABI, if it has one.

i386 glibc issues every socket operation through it, so a 32-bit program’s bind and connect arrive here rather than as syscalls.

Source

pub fn numbers_for(self, canonical: &[i64]) -> Vec<i64>

This ABI’s numbers for every canonical syscall in canonical.

§Arguments
  • canonical - x86_64 numbers (the lists in syscall).

Trait Implementations§

Source§

impl Clone for Abi

Source§

fn clone(&self) -> Abi

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Abi

Source§

impl Debug for Abi

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Abi

Source§

impl PartialEq for Abi

Source§

fn eq(&self, other: &Abi) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Abi

Auto Trait Implementations§

§

impl Freeze for Abi

§

impl RefUnwindSafe for Abi

§

impl Send for Abi

§

impl Sync for Abi

§

impl Unpin for Abi

§

impl UnsafeUnpin for Abi

§

impl UnwindSafe for Abi

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.