Struct libafl_bolts::llmp::LlmpReceiver
source · pub struct LlmpReceiver<SP>where
SP: ShMemProvider,{ /* private fields */ }
Expand description
Receiving end on a (unidirectional) sharedmap channel
Implementations§
source§impl<SP> LlmpReceiver<SP>where
SP: ShMemProvider,
impl<SP> LlmpReceiver<SP>where
SP: ShMemProvider,
Receiving end of an llmp channel
sourcepub fn on_existing_from_env(
shmem_provider: SP,
env_name: &str
) -> Result<Self, Error>
pub fn on_existing_from_env( shmem_provider: SP, env_name: &str ) -> Result<Self, Error>
Reattach to a vacant recv_shmem
, to with a previous sender stored the information in an env before.
sourcepub fn to_env(&self, env_name: &str) -> Result<(), Error>
pub fn to_env(&self, env_name: &str) -> Result<(), Error>
Store the info to this receiver to env.
A new client can reattach to it using LlmpReceiver::on_existing_from_env()
sourcepub fn on_existing_shmem(
shmem_provider: SP,
current_sender_shmem: SP::ShMem,
last_msg_recvd_offset: Option<u64>
) -> Result<Self, Error>
pub fn on_existing_shmem( shmem_provider: SP, current_sender_shmem: SP::ShMem, last_msg_recvd_offset: Option<u64> ) -> Result<Self, Error>
Create a Receiver, reattaching to an existing sender map.
It is essential, that the sender (or someone else) keeps a pointer to the sender_shmem
else reattach will get a new, empty page, from the OS, or fail.
sourcepub unsafe fn recv_blocking(&mut self) -> Result<*mut LlmpMsg, Error>
pub unsafe fn recv_blocking(&mut self) -> Result<*mut LlmpMsg, Error>
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
sourcepub fn recv_buf(&mut self) -> Result<Option<(ClientId, Tag, &[u8])>, Error>
pub fn recv_buf(&mut self) -> Result<Option<(ClientId, Tag, &[u8])>, Error>
Returns the next message, tag, buf, if available, else None
sourcepub fn recv_buf_with_flags(
&mut self
) -> Result<Option<(ClientId, Tag, Flags, &[u8])>, Error>
pub fn recv_buf_with_flags( &mut self ) -> Result<Option<(ClientId, Tag, Flags, &[u8])>, Error>
Receive the buffer, also reading the LLMP internal message flags
sourcepub fn recv_buf_blocking(&mut self) -> Result<(ClientId, Tag, &[u8]), Error>
pub fn recv_buf_blocking(&mut self) -> Result<(ClientId, Tag, &[u8]), Error>
Returns the next sender, tag, buf, looping until it becomes available
sourcepub fn describe(&self) -> Result<LlmpDescription, Error>
pub fn describe(&self) -> Result<LlmpDescription, Error>
Describe this client in a way, that it can be restored later with Self::on_existing_from_description
sourcepub fn on_existing_from_description(
shmem_provider: SP,
description: &LlmpDescription
) -> Result<Self, Error>
pub fn on_existing_from_description( shmem_provider: SP, description: &LlmpDescription ) -> Result<Self, Error>
Create this client on an existing map from the given description. acquired with self.describe
Trait Implementations§
Auto Trait Implementations§
impl<SP> RefUnwindSafe for LlmpReceiver<SP>
impl<SP> !Send for LlmpReceiver<SP>
impl<SP> !Sync for LlmpReceiver<SP>
impl<SP> Unpin for LlmpReceiver<SP>
impl<SP> UnwindSafe for LlmpReceiver<SP>
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
source§impl<Tail, T> Prepend<T> for Tail
impl<Tail, T> Prepend<T> for Tail
§type PreprendResult = Tail
type PreprendResult = Tail
TupleList
, of an Prepend::prepend()
call,
including the prepended entry.