Struct libafl::bolts::llmp::LlmpReceiver[][src]

pub struct LlmpReceiver<SP> where
    SP: ShMemProvider
{ pub id: u32, pub last_msg_recvd: *const LlmpMsg, pub shmem_provider: SP, pub current_recv_map: LlmpSharedMap<SP::Mem>, }

Receiving end on a (unidirectional) sharedmap channel

Fields

id: u32

Id of this provider

last_msg_recvd: *const LlmpMsg

Pointer to the last meg this received

shmem_provider: SP

The shmem provider

current_recv_map: LlmpSharedMap<SP::Mem>

current page. After EOP, this gets replaced with the new one

Implementations

impl<SP> LlmpReceiver<SP> where
    SP: ShMemProvider
[src]

Receiving end of an llmp channel

pub fn on_existing_from_env(
    shmem_provider: SP,
    env_name: &str
) -> Result<Self, Error>
[src]

Reattach to a vacant recv_map, to with a previous sender stored the information in an env before.

pub fn to_env(&self, env_name: &str) -> Result<(), Error>[src]

Store the info to this receiver to env. A new client can reattach to it using LlmpReceiver::on_existing_from_env()

pub fn on_existing_map(
    shmem_provider: SP,
    current_sender_map: SP::Mem,
    last_msg_recvd_offset: Option<u64>
) -> Result<Self, Error>
[src]

Create a Receiver, reattaching to an existing sender map. It is essential, that the sender (or someone else) keeps a pointer to the sender_map else reattach will get a new, empty page, from the OS, or fail.

pub unsafe fn recv_blocking(&mut self) -> Result<*mut LlmpMsg, Error>[src]

Blocks/spins until the next message gets posted to the page, then returns that message.

Safety

Returns a raw ptr, on the recv map. Should be safe in general

pub fn recv_buf(&mut self) -> Result<Option<(u32, Tag, &[u8])>, Error>[src]

Returns the next message, tag, buf, if avaliable, else None

pub fn recv_buf_with_flags(
    &mut self
) -> Result<Option<(ClientId, Tag, Flags, &[u8])>, Error>
[src]

Receive the buffer, also reading the LLMP internal message flags

pub fn recv_buf_blocking(&mut self) -> Result<(ClientId, Tag, &[u8]), Error>[src]

Returns the next sender, tag, buf, looping until it becomes available

pub fn describe(&self) -> Result<LlmpDescription, Error>[src]

Describe this client in a way, that it can be restored later with Self::on_existing_from_description

pub fn on_existing_from_description(
    shmem_provider: SP,
    description: &LlmpDescription
) -> Result<Self, Error>
[src]

Create this client on an existing map from the given description. acquired with self.describe

Trait Implementations

impl<SP: Debug> Debug for LlmpReceiver<SP> where
    SP: ShMemProvider,
    SP::Mem: Debug
[src]

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

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<SP> RefUnwindSafe for LlmpReceiver<SP> where
    SP: RefUnwindSafe,
    <SP as ShMemProvider>::Mem: RefUnwindSafe

impl<SP> !Send for LlmpReceiver<SP>

impl<SP> !Sync for LlmpReceiver<SP>

impl<SP> Unpin for LlmpReceiver<SP> where
    SP: Unpin,
    <SP as ShMemProvider>::Mem: Unpin

impl<SP> UnwindSafe for LlmpReceiver<SP> where
    SP: UnwindSafe,
    <SP as ShMemProvider>::Mem: UnwindSafe

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

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

Performs the conversion.

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.

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

Performs the conversion.