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

Shrinks the allocated LlmpMsg to a given size.

Safety

The msg pointer will be dereferenced, if it’s not null.

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.

Create this client on an existing map from the given description. Acquired with [self.describe].

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The Resulting TupleList, of an Prepend::prepend() call, including the prepended entry. Read more

Prepend a value to this tuple, returning a new tuple with prepended value.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.