Struct libafl::bolts::llmp::LlmpSender [−][src]
pub struct LlmpSender<SP> where
SP: ShMemProvider, { pub id: u32, pub last_msg_sent: *const LlmpMsg, pub out_maps: Vec<LlmpSharedMap<SP::Mem>>, pub keep_pages_forever: bool, // some fields omitted }
Expand description
Sending end on a (unidirectional) sharedmap channel
Fields
id: u32
ID of this sender.
last_msg_sent: *const LlmpMsg
Ref to the last message this sender sent on the last page. If null, a new page (just) started.
out_maps: Vec<LlmpSharedMap<SP::Mem>>
A vec of page wrappers, each containing an intialized AfShmem
keep_pages_forever: bool
If true, pages will never be pruned. The broker uses this feature. By keeping the message history around, new clients may join at any time in the future.
Implementations
An actor on the sending part of the shared map
Create a new LlmpSender
using a given ShMemProvider
, and id
.
If keep_pages_forever
is true
, ShMem
will never be freed.
If it is false
, the pages will be unmapped once they are full, and have been mapped by at least one LlmpReceiver
.
Completely reset the current sender map. Afterwards, no receiver should read from it at a different location. This is only useful if all connected llmp parties start over, for example after a crash.
Safety
Only safe if you really really restart the page on everything connected
Reattach to a vacant out_map
, to with a previous sender stored the information in an env before.
Store the info to this sender to env.
A new client can reattach to it using LlmpSender::on_existing_from_env()
.
Waits for this sender to be save to unmap. If a receiver is involved, this function should always be called.
If we are allowed to unmap this client
Reattach to a vacant out_map
.
It is essential, that the receiver (or someone else) keeps a pointer to this map
else reattach will get a new, empty page, from the OS, or fail.
Allocates the next space on this sender page
Cancel send of the next message, this allows us to allocate a new message without sending this one.
Safety
They msg pointer may no longer be used after cancel_send
Allocates a message of the given size, tags it, and sends it off.
Send a buf
with the given flags
.
Describe this LlmpClient
in a way that it can be restored later, using Self::on_existing_from_description
.
pub 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 LlmpSender<SP> where
SP: RefUnwindSafe,
<SP as ShMemProvider>::Mem: RefUnwindSafe,
impl<SP> !Send for LlmpSender<SP>
impl<SP> !Sync for LlmpSender<SP>
impl<SP> Unpin for LlmpSender<SP> where
SP: Unpin,
<SP as ShMemProvider>::Mem: Unpin,
impl<SP> UnwindSafe for LlmpSender<SP> where
SP: UnwindSafe,
<SP as ShMemProvider>::Mem: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
type PreprendResult = Tail
type PreprendResult = Tail
The Resulting TupleList
, of an Prepend::prepend()
call,
including the prepended entry. Read more
type Output = T
type Output = T
Should always be Self