Struct libafl_bolts::llmp::LlmpSharedMap
source · pub struct LlmpSharedMap<SHM>where
SHM: ShMem,{ /* private fields */ }
Expand description
A page wrapper
Implementations§
The page struct, placed on a shared mem instance.
A thin wrapper around a ShMem
implementation, with special crate::llmp
funcs
sourcepub fn new(sender: ClientId, new_shmem: SHM) -> Self
pub fn new(sender: ClientId, new_shmem: SHM) -> Self
Creates a new page, initializing the passed shared mem struct
sourcepub fn mark_safe_to_unmap(&mut self)
pub fn mark_safe_to_unmap(&mut self)
Marks the containing page as safe_to_unmap
.
This indicates, that the page may safely be unmapped by the sender.
sourcepub unsafe fn page_mut(&mut self) -> *mut LlmpPage
pub unsafe fn page_mut(&mut self) -> *mut LlmpPage
Get the unsafe ptr to this page, situated on the shared map
Safety
The unsafe page pointer is obviously unsafe.
sourcepub unsafe fn page(&self) -> *const LlmpPage
pub unsafe fn page(&self) -> *const LlmpPage
Get the unsafe ptr to this page, situated on the shared map
Safety
The unsafe page pointer is obviously unsafe.
sourcepub unsafe fn msg_to_offset(&self, msg: *const LlmpMsg) -> Result<u64, Error>
pub unsafe fn msg_to_offset(&self, msg: *const LlmpMsg) -> Result<u64, Error>
Gets the offset of a message on this here page.
Will return crate::Error::illegal_argument
error if msg is not on page.
Safety
This dereferences msg, make sure to pass a proper pointer to it.
sourcepub fn msg_from_env(
&mut self,
map_env_name: &str
) -> Result<*mut LlmpMsg, Error>
pub fn msg_from_env( &mut self, map_env_name: &str ) -> Result<*mut LlmpMsg, Error>
Retrieve the stored msg from env_name
+ _OFFSET
.
It will restore the stored offset by env_name
and return the message.
sourcepub unsafe fn msg_to_env(
&self,
msg: *const LlmpMsg,
map_env_name: &str
) -> Result<(), Error>
pub unsafe fn msg_to_env( &self, msg: *const LlmpMsg, map_env_name: &str ) -> Result<(), Error>
Store this msg offset to env_name
+ _OFFSET
env variable.
It can be restored using LlmpSharedMap::msg_from_env()
with the same env_name
later.
Safety
This function will dereference the msg ptr, make sure it’s valid.
sourcepub fn msg_from_offset(&mut self, offset: u64) -> Result<*mut LlmpMsg, Error>
pub fn msg_from_offset(&mut self, offset: u64) -> Result<*mut LlmpMsg, Error>
Gets this message from this page, at the indicated offset.
Will return crate::Error::illegal_argument
error if the offset is out of bounds.
Trait Implementations§
source§fn clone(&self) -> LlmpSharedMap<SHM>
fn clone(&self) -> LlmpSharedMap<SHM>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
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.