Struct libafl::events::llmp::LlmpEventManager
source · pub struct LlmpEventManager<EMH, S, SP>where
S: State,
SP: ShMemProvider + 'static,{ /* private fields */ }
Expand description
An EventManager
that forwards all events to other attached fuzzers on shared maps or via tcp,
using low-level message passing, libafl_bolts::llmp
.
Implementations§
source§impl<S, SP> LlmpEventManager<(), S, SP>where
S: State,
SP: ShMemProvider + 'static,
impl<S, SP> LlmpEventManager<(), S, SP>where
S: State,
SP: ShMemProvider + 'static,
sourcepub fn new(
llmp: LlmpClient<SP>,
configuration: EventConfig
) -> Result<Self, Error>
pub fn new( llmp: LlmpClient<SP>, configuration: EventConfig ) -> Result<Self, Error>
Create a manager from a raw LLMP client
sourcepub fn on_port(
shmem_provider: SP,
port: u16,
configuration: EventConfig
) -> Result<LlmpEventManager<(), S, SP>, Error>
pub fn on_port( shmem_provider: SP, port: u16, configuration: EventConfig ) -> Result<LlmpEventManager<(), S, SP>, Error>
Create an LLMP event manager on a port
If the port is not yet bound, it will act as a broker; otherwise, it will act as a client.
sourcepub fn existing_client_from_env(
shmem_provider: SP,
env_name: &str,
configuration: EventConfig
) -> Result<LlmpEventManager<(), S, SP>, Error>
pub fn existing_client_from_env( shmem_provider: SP, env_name: &str, configuration: EventConfig ) -> Result<LlmpEventManager<(), S, SP>, Error>
If a client respawns, it may reuse the existing connection, previously
stored by LlmpClient::to_env()
.
sourcepub fn existing_client_from_description(
shmem_provider: SP,
description: &LlmpClientDescription,
configuration: EventConfig
) -> Result<LlmpEventManager<(), S, SP>, Error>
pub fn existing_client_from_description( shmem_provider: SP, description: &LlmpClientDescription, configuration: EventConfig ) -> Result<LlmpEventManager<(), S, SP>, Error>
Create an existing client from description
source§impl<EMH, S, SP> LlmpEventManager<EMH, S, SP>where
S: State,
SP: ShMemProvider + 'static,
impl<EMH, S, SP> LlmpEventManager<EMH, S, SP>where
S: State,
SP: ShMemProvider + 'static,
sourcepub fn detach_from_broker(&self, broker_port: u16) -> Result<(), Error>
pub fn detach_from_broker(&self, broker_port: u16) -> Result<(), Error>
Calling this function will tell the llmp broker that this client is exiting
This should be called from the restarter not from the actual fuzzer client
This function serves the same roll as the LlmpClient.send_exiting()
However, from the the event restarter process it is forbidden to call send_exiting()
(You can call it and it compiles but you should never do so)
send_exiting()
is exclusive to the fuzzer client.
sourcepub fn with_hooks(
llmp: LlmpClient<SP>,
configuration: EventConfig,
hooks: EMH
) -> Result<Self, Error>
pub fn with_hooks( llmp: LlmpClient<SP>, configuration: EventConfig, hooks: EMH ) -> Result<Self, Error>
Create a manager from a raw LLMP client with hooks
sourcepub fn on_port_with_hooks(
shmem_provider: SP,
port: u16,
configuration: EventConfig,
hooks: EMH
) -> Result<Self, Error>
pub fn on_port_with_hooks( shmem_provider: SP, port: u16, configuration: EventConfig, hooks: EMH ) -> Result<Self, Error>
Create an LLMP event manager on a port with hook
If the port is not yet bound, it will act as a broker; otherwise, it
will act as a client.
This will make a new connection to the broker so will return its new ClientId
, too
sourcepub fn existing_client_from_env_with_hooks(
shmem_provider: SP,
env_name: &str,
configuration: EventConfig,
hooks: EMH
) -> Result<Self, Error>
pub fn existing_client_from_env_with_hooks( shmem_provider: SP, env_name: &str, configuration: EventConfig, hooks: EMH ) -> Result<Self, Error>
If a client respawns, it may reuse the existing connection, previously
stored by LlmpClient::to_env()
.
create a event manager from env with hooks
sourcepub fn describe(&self) -> Result<LlmpClientDescription, Error>
pub fn describe(&self) -> Result<LlmpClientDescription, Error>
Describe the client event manager’s LLMP parts in a restorable fashion
sourcepub fn existing_client_from_description_with_hooks(
shmem_provider: SP,
description: &LlmpClientDescription,
configuration: EventConfig,
hooks: EMH
) -> Result<Self, Error>
pub fn existing_client_from_description_with_hooks( shmem_provider: SP, description: &LlmpClientDescription, configuration: EventConfig, hooks: EMH ) -> Result<Self, Error>
Create an existing client from description
sourcepub fn to_env(&self, env_name: &str)
pub fn to_env(&self, env_name: &str)
Write the config for a client EventManager
to env vars, a new
client can reattach using LlmpEventManager::existing_client_from_env()
.
source§impl<EMH, S: State, SP: ShMemProvider> LlmpEventManager<EMH, S, SP>
impl<EMH, S: State, SP: ShMemProvider> LlmpEventManager<EMH, S, SP>
sourcepub fn send_exiting(&mut self) -> Result<(), Error>
pub fn send_exiting(&mut self) -> Result<(), Error>
Send information that this client is exiting. The other side may free up all allocated memory. We are no longer allowed to send anything afterwards.
Trait Implementations§
source§impl<EMH, S, SP> AdaptiveSerializer for LlmpEventManager<EMH, S, SP>where
SP: ShMemProvider + 'static,
S: State,
impl<EMH, S, SP> AdaptiveSerializer for LlmpEventManager<EMH, S, SP>where
SP: ShMemProvider + 'static,
S: State,
source§fn serialization_time(&self) -> Duration
fn serialization_time(&self) -> Duration
source§fn deserialization_time(&self) -> Duration
fn deserialization_time(&self) -> Duration
source§fn serializations_cnt(&self) -> usize
fn serializations_cnt(&self) -> usize
source§fn should_serialize_cnt(&self) -> usize
fn should_serialize_cnt(&self) -> usize
source§fn serialization_time_mut(&mut self) -> &mut Duration
fn serialization_time_mut(&mut self) -> &mut Duration
source§fn deserialization_time_mut(&mut self) -> &mut Duration
fn deserialization_time_mut(&mut self) -> &mut Duration
source§fn serializations_cnt_mut(&mut self) -> &mut usize
fn serializations_cnt_mut(&mut self) -> &mut usize
source§fn should_serialize_cnt_mut(&mut self) -> &mut usize
fn should_serialize_cnt_mut(&mut self) -> &mut usize
source§fn serialize_observers_adaptive<S, OT>(
&mut self,
observers: &OT,
time_factor: u32,
percentage_threshold: usize
) -> Result<Option<Vec<u8>>, Error>
fn serialize_observers_adaptive<S, OT>( &mut self, observers: &OT, time_factor: u32, percentage_threshold: usize ) -> Result<Option<Vec<u8>>, Error>
time_factor
and percentage_threshold
.
These parameters are unique to each of the different types of EventManager
source§impl<EMH, S, SP> Debug for LlmpEventManager<EMH, S, SP>where
SP: ShMemProvider + 'static,
S: State,
impl<EMH, S, SP> Debug for LlmpEventManager<EMH, S, SP>where
SP: ShMemProvider + 'static,
S: State,
source§impl<EMH, S, SP> Drop for LlmpEventManager<EMH, S, SP>where
SP: ShMemProvider + 'static,
S: State,
impl<EMH, S, SP> Drop for LlmpEventManager<EMH, S, SP>where
SP: ShMemProvider + 'static,
S: State,
source§impl<EMH, S, SP> EventFirer for LlmpEventManager<EMH, S, SP>where
S: State,
SP: ShMemProvider,
impl<EMH, S, SP> EventFirer for LlmpEventManager<EMH, S, SP>where
S: State,
SP: ShMemProvider,
source§fn fire(
&mut self,
_state: &mut Self::State,
event: Event<<Self::State as UsesInput>::Input>
) -> Result<(), Error>
fn fire( &mut self, _state: &mut Self::State, event: Event<<Self::State as UsesInput>::Input> ) -> Result<(), Error>
source§fn serialize_observers<OT>(
&mut self,
observers: &OT
) -> Result<Option<Vec<u8>>, Error>
fn serialize_observers<OT>( &mut self, observers: &OT ) -> Result<Option<Vec<u8>>, Error>
source§fn configuration(&self) -> EventConfig
fn configuration(&self) -> EventConfig
source§fn log(
&mut self,
state: &mut Self::State,
severity_level: LogSeverity,
message: String
) -> Result<(), Error>
fn log( &mut self, state: &mut Self::State, severity_level: LogSeverity, message: String ) -> Result<(), Error>
Event::Log
event to the broker.
This is a shortcut for EventFirer::fire
with Event::Log
as argument.source§impl<E, EMH, S, SP, Z> EventProcessor<E, Z> for LlmpEventManager<EMH, S, SP>where
EMH: EventManagerHooksTuple<S>,
S: State + HasExecutions + HasMetadata,
SP: ShMemProvider,
E: HasObservers<State = S> + Executor<Self, Z>,
for<'a> E::Observers: Deserialize<'a>,
Z: EvaluatorObservers<E::Observers, State = S> + ExecutionProcessor<E::Observers, State = S>,
impl<E, EMH, S, SP, Z> EventProcessor<E, Z> for LlmpEventManager<EMH, S, SP>where
EMH: EventManagerHooksTuple<S>,
S: State + HasExecutions + HasMetadata,
SP: ShMemProvider,
E: HasObservers<State = S> + Executor<Self, Z>,
for<'a> E::Observers: Deserialize<'a>,
Z: EvaluatorObservers<E::Observers, State = S> + ExecutionProcessor<E::Observers, State = S>,
source§impl<EMH, S, SP> EventRestarter for LlmpEventManager<EMH, S, SP>where
S: State,
SP: ShMemProvider,
impl<EMH, S, SP> EventRestarter for LlmpEventManager<EMH, S, SP>where
S: State,
SP: ShMemProvider,
source§fn await_restart_safe(&mut self)
fn await_restart_safe(&mut self)
The LLMP client needs to wait until a broker has mapped all pages before shutting down. Otherwise, the OS may already have removed the shared maps.
source§fn on_restart(&mut self, state: &mut Self::State) -> Result<(), Error>
fn on_restart(&mut self, state: &mut Self::State) -> Result<(), Error>
HasCurrentStage::on_restart
will be invoked in this method, by you
or an internal EventRestarter
, before the state is saved for recovery.source§impl<EMH, S, SP> HasCustomBufHandlers for LlmpEventManager<EMH, S, SP>where
S: State,
SP: ShMemProvider,
impl<EMH, S, SP> HasCustomBufHandlers for LlmpEventManager<EMH, S, SP>where
S: State,
SP: ShMemProvider,
source§impl<EMH, S, SP> HasEventManagerId for LlmpEventManager<EMH, S, SP>where
S: State,
SP: ShMemProvider,
impl<EMH, S, SP> HasEventManagerId for LlmpEventManager<EMH, S, SP>where
S: State,
SP: ShMemProvider,
source§fn mgr_id(&self) -> EventManagerId
fn mgr_id(&self) -> EventManagerId
Gets the id assigned to this staterestorer.
source§impl<EMH, S, SP> ProgressReporter for LlmpEventManager<EMH, S, SP>
impl<EMH, S, SP> ProgressReporter for LlmpEventManager<EMH, S, SP>
source§fn maybe_report_progress(
&mut self,
state: &mut Self::State,
monitor_timeout: Duration
) -> Result<(), Error>
fn maybe_report_progress( &mut self, state: &mut Self::State, monitor_timeout: Duration ) -> Result<(), Error>
monitor_timeout
seconds passed, send off an info/monitor/heartbeat message to the broker.
Returns the new last
time (so the old one, unless monitor_timeout
time has passed and monitor have been sent)
Will return an crate::Error
, if the stats could not be sent.source§fn report_progress(&mut self, state: &mut Self::State) -> Result<(), Error>
fn report_progress(&mut self, state: &mut Self::State) -> Result<(), Error>
crate::Error
, if the stats could not be sent.source§impl<EMH, S, SP> UsesState for LlmpEventManager<EMH, S, SP>where
S: State,
SP: ShMemProvider,
impl<EMH, S, SP> UsesState for LlmpEventManager<EMH, S, SP>where
S: State,
SP: ShMemProvider,
impl<E, EMH, S, SP, Z> EventManager<E, Z> for LlmpEventManager<EMH, S, SP>where
E: HasObservers<State = S> + Executor<Self, Z>,
for<'a> E::Observers: Deserialize<'a>,
EMH: EventManagerHooksTuple<S>,
S: State + HasExecutions + HasMetadata + HasLastReportTime,
SP: ShMemProvider,
Z: EvaluatorObservers<E::Observers, State = S> + ExecutionProcessor<E::Observers, State = S>,
Auto Trait Implementations§
impl<EMH, S, SP> Freeze for LlmpEventManager<EMH, S, SP>
impl<EMH, S, SP> !RefUnwindSafe for LlmpEventManager<EMH, S, SP>
impl<EMH, S, SP> !Send for LlmpEventManager<EMH, S, SP>
impl<EMH, S, SP> !Sync for LlmpEventManager<EMH, S, SP>
impl<EMH, S, SP> Unpin for LlmpEventManager<EMH, S, SP>
impl<EMH, S, SP> !UnwindSafe for LlmpEventManager<EMH, S, 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<T> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.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.source§fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)
fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)
source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.