pub struct LlmpEventManager<I, OT, S, SP>where
I: Input,
OT: ObserversTuple<I, S>,
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, crate::bolts::llmp
.
Implementations
sourceimpl<I, OT, S, SP> LlmpEventManager<I, OT, S, SP>where
I: Input,
OT: ObserversTuple<I, S>,
SP: ShMemProvider + 'static,
impl<I, OT, S, SP> LlmpEventManager<I, OT, S, SP>where
I: Input,
OT: ObserversTuple<I, S>,
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 new_on_port(
shmem_provider: SP,
port: u16,
configuration: EventConfig
) -> Result<Self, Error>
pub fn new_on_port(
shmem_provider: SP,
port: u16,
configuration: EventConfig
) -> Result<Self, Error>
Create llmp on a port If the port is not yet bound, it will act as broker Else, it will act as client.
sourcepub fn existing_client_from_env(
shmem_provider: SP,
env_name: &str,
configuration: EventConfig
) -> Result<Self, Error>
pub fn existing_client_from_env(
shmem_provider: SP,
env_name: &str,
configuration: EventConfig
) -> Result<Self, Error>
If a client respawns, it may reuse the existing connection, previously stored by LlmpClient::to_env()
.
sourcepub fn describe(&self) -> Result<LlmpClientDescription, Error>
pub fn describe(&self) -> Result<LlmpClientDescription, Error>
Describe the client event mgr’s llmp parts in a restorable fashion
sourcepub fn existing_client_from_description(
shmem_provider: SP,
description: &LlmpClientDescription,
configuration: EventConfig
) -> Result<Self, Error>
pub fn existing_client_from_description(
shmem_provider: SP,
description: &LlmpClientDescription,
configuration: EventConfig
) -> 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()
.
Trait Implementations
sourceimpl<I, OT, S, SP> Debug for LlmpEventManager<I, OT, S, SP>where
I: Input,
OT: ObserversTuple<I, S>,
SP: ShMemProvider + 'static,
impl<I, OT, S, SP> Debug for LlmpEventManager<I, OT, S, SP>where
I: Input,
OT: ObserversTuple<I, S>,
SP: ShMemProvider + 'static,
sourceimpl<I, OT, S, SP> Drop for LlmpEventManager<I, OT, S, SP>where
I: Input,
OT: ObserversTuple<I, S>,
SP: ShMemProvider + 'static,
impl<I, OT, S, SP> Drop for LlmpEventManager<I, OT, S, SP>where
I: Input,
OT: ObserversTuple<I, S>,
SP: ShMemProvider + 'static,
sourceimpl<I, OT, S, SP> EventFirer<I> for LlmpEventManager<I, OT, S, SP>where
I: Input,
OT: ObserversTuple<I, S>,
SP: ShMemProvider,
impl<I, OT, S, SP> EventFirer<I> for LlmpEventManager<I, OT, S, SP>where
I: Input,
OT: ObserversTuple<I, S>,
SP: ShMemProvider,
sourcefn configuration(&self) -> EventConfig
fn configuration(&self) -> EventConfig
sourcefn log<S>(
&mut self,
state: &mut S,
severity_level: LogSeverity,
message: String
) -> Result<(), Error>
fn log<S>(
&mut self,
state: &mut S,
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. Read moresourcefn serialize_observers<OT, S>(
&mut self,
observers: &OT
) -> Result<Vec<u8>, Error>where
OT: ObserversTuple<I, S> + Serialize,
fn serialize_observers<OT, S>(
&mut self,
observers: &OT
) -> Result<Vec<u8>, Error>where
OT: ObserversTuple<I, S> + Serialize,
sourceimpl<E, I, OT, S, SP, Z> EventProcessor<E, I, S, Z> for LlmpEventManager<I, OT, S, SP>where
SP: ShMemProvider,
E: Executor<Self, I, S, Z> + HasObservers<I, OT, S>,
I: Input,
OT: ObserversTuple<I, S> + DeserializeOwned,
Z: ExecutionProcessor<I, OT, S> + EvaluatorObservers<I, OT, S>,
impl<E, I, OT, S, SP, Z> EventProcessor<E, I, S, Z> for LlmpEventManager<I, OT, S, SP>where
SP: ShMemProvider,
E: Executor<Self, I, S, Z> + HasObservers<I, OT, S>,
I: Input,
OT: ObserversTuple<I, S> + DeserializeOwned,
Z: ExecutionProcessor<I, OT, S> + EvaluatorObservers<I, OT, S>,
sourcefn process(
&mut self,
fuzzer: &mut Z,
state: &mut S,
executor: &mut E
) -> Result<usize, Error>
fn process(
&mut self,
fuzzer: &mut Z,
state: &mut S,
executor: &mut E
) -> Result<usize, Error>
sourcefn deserialize_observers<OT>(
&mut self,
observers_buf: &[u8]
) -> Result<OT, Error>where
OT: ObserversTuple<I, S> + DeserializeOwned,
fn deserialize_observers<OT>(
&mut self,
observers_buf: &[u8]
) -> Result<OT, Error>where
OT: ObserversTuple<I, S> + DeserializeOwned,
sourceimpl<I, OT, S, SP> EventRestarter<S> for LlmpEventManager<I, OT, S, SP>where
I: Input,
OT: ObserversTuple<I, S>,
SP: ShMemProvider,
impl<I, OT, S, SP> EventRestarter<S> for LlmpEventManager<I, OT, S, SP>where
I: Input,
OT: ObserversTuple<I, S>,
SP: ShMemProvider,
sourcefn await_restart_safe(&mut self)
fn await_restart_safe(&mut self)
The llmp client needs to wait until a broker mapped all pages, before shutting down. Otherwise, the OS may already have removed the shared maps,
sourceimpl<I, OT, S, SP> HasCustomBufHandlers<S> for LlmpEventManager<I, OT, S, SP>where
I: Input,
OT: ObserversTuple<I, S>,
SP: ShMemProvider,
impl<I, OT, S, SP> HasCustomBufHandlers<S> for LlmpEventManager<I, OT, S, SP>where
I: Input,
OT: ObserversTuple<I, S>,
SP: ShMemProvider,
sourcefn add_custom_buf_handler(
&mut self,
handler: Box<dyn FnMut(&mut S, &String, &[u8]) -> Result<CustomBufEventResult, Error>>
)
fn add_custom_buf_handler(
&mut self,
handler: Box<dyn FnMut(&mut S, &String, &[u8]) -> Result<CustomBufEventResult, Error>>
)
CustomBuf
event.sourceimpl<I, OT, S, SP> HasEventManagerId for LlmpEventManager<I, OT, S, SP>where
I: Input,
OT: ObserversTuple<I, S> + DeserializeOwned,
SP: ShMemProvider,
impl<I, OT, S, SP> HasEventManagerId for LlmpEventManager<I, OT, S, SP>where
I: Input,
OT: ObserversTuple<I, S> + DeserializeOwned,
SP: ShMemProvider,
sourcefn mgr_id(&self) -> EventManagerId
fn mgr_id(&self) -> EventManagerId
Gets the id assigned to this staterestorer.
sourceimpl<I, OT, S, SP> ProgressReporter<I> for LlmpEventManager<I, OT, S, SP>where
I: Input,
OT: ObserversTuple<I, S> + DeserializeOwned,
SP: ShMemProvider,
impl<I, OT, S, SP> ProgressReporter<I> for LlmpEventManager<I, OT, S, SP>where
I: Input,
OT: ObserversTuple<I, S> + DeserializeOwned,
SP: ShMemProvider,
sourcefn maybe_report_progress<S>(
&mut self,
state: &mut S,
last_report_time: Duration,
monitor_timeout: Duration
) -> Result<Duration, Error>where
S: HasExecutions + HasClientPerfMonitor + HasMetadata,
fn maybe_report_progress<S>(
&mut self,
state: &mut S,
last_report_time: Duration,
monitor_timeout: Duration
) -> Result<Duration, Error>where
S: HasExecutions + HasClientPerfMonitor + HasMetadata,
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. Read more