Struct libafl::bolts::llmp::LlmpBroker [−][src]
pub struct LlmpBroker<SP> where
SP: ShMemProvider + 'static, { pub llmp_out: LlmpSender<SP>, pub llmp_clients: Vec<LlmpReceiver<SP>>, // some fields omitted }
The broker (node 0)
Fields
llmp_out: LlmpSender<SP>
Broadcast map from broker to all clients
llmp_clients: Vec<LlmpReceiver<SP>>
Users of Llmp can add message handlers in the broker. This allows us to intercept messages right in the broker This keeps the out map clean.
Implementations
impl<SP> LlmpBroker<SP> where
SP: ShMemProvider + 'static,
[src]
impl<SP> LlmpBroker<SP> where
SP: ShMemProvider + 'static,
[src]The broker forwards all messages to its own bus-like broadcast map. It may intercept messages passing through.
pub fn new(shmem_provider: SP) -> Result<Self, Error>
[src]
pub fn new(shmem_provider: SP) -> Result<Self, Error>
[src]Create and initialize a new LlmpBroker
pub fn register_client(&mut self, client_page: LlmpSharedMap<SP::Mem>)
[src]
pub fn register_client(&mut self, client_page: LlmpSharedMap<SP::Mem>)
[src]Registers a new client for the given sharedmap str and size.
Returns the id of the new client in [broker.client_map
]
pub fn connect_b2b<A>(&mut self, addr: A) -> Result<(), Error> where
A: ToSocketAddrs,
[src]
pub fn connect_b2b<A>(&mut self, addr: A) -> Result<(), Error> where
A: ToSocketAddrs,
[src]Connects to a broker running on another machine. This will spawn a new background thread, registered as client, that proxies all messages to a remote machine. Returns the description of the new page that still needs to be announced/added to the broker afterwards.
pub fn once<F>(&mut self, on_new_msg: &mut F) -> Result<(), Error> where
F: FnMut(ClientId, Tag, Flags, &[u8]) -> Result<LlmpMsgHookResult, Error>,
[src]
pub fn once<F>(&mut self, on_new_msg: &mut F) -> Result<(), Error> where
F: FnMut(ClientId, Tag, Flags, &[u8]) -> Result<LlmpMsgHookResult, Error>,
[src]The broker walks all pages and looks for changes, then broadcasts them on its own shared page, once.
pub fn loop_forever<F>(
&mut self,
on_new_msg: &mut F,
sleep_time: Option<Duration>
) where
F: FnMut(ClientId, Tag, Flags, &[u8]) -> Result<LlmpMsgHookResult, Error>,
[src]
pub fn loop_forever<F>(
&mut self,
on_new_msg: &mut F,
sleep_time: Option<Duration>
) where
F: FnMut(ClientId, Tag, Flags, &[u8]) -> Result<LlmpMsgHookResult, Error>,
[src]Loops infinitely, forwarding and handling all incoming messages from clients. Never returns. Panics on error. 5 millis of sleep can’t hurt to keep busywait not at 100%
pub fn send_buf(&mut self, tag: Tag, buf: &[u8]) -> Result<(), Error>
[src]
pub fn send_buf(&mut self, tag: Tag, buf: &[u8]) -> Result<(), Error>
[src]Broadcasts the given buf to all lients
pub fn send_buf_with_flags(
&mut self,
tag: Tag,
flags: Flags,
buf: &[u8]
) -> Result<(), Error>
[src]
pub fn send_buf_with_flags(
&mut self,
tag: Tag,
flags: Flags,
buf: &[u8]
) -> Result<(), Error>
[src]Sends a buf
with the given flags
.
pub fn launch_tcp_listener_on(
&mut self,
port: u16
) -> Result<JoinHandle<()>, Error>
[src]
pub fn launch_tcp_listener_on(
&mut self,
port: u16
) -> Result<JoinHandle<()>, Error>
[src]Launches a thread using a tcp listener socket, on which new clients may connect to this broker Does so on the given port.
pub fn launch_listener(
&mut self,
listener: Listener
) -> Result<JoinHandle<()>, Error>
[src]
pub fn launch_listener(
&mut self,
listener: Listener
) -> Result<JoinHandle<()>, Error>
[src]Launches a thread using a listener socket, on which new clients may connect to this broker
Trait Implementations
impl<SP: Debug> Debug for LlmpBroker<SP> where
SP: ShMemProvider + 'static,
[src]
impl<SP: Debug> Debug for LlmpBroker<SP> where
SP: ShMemProvider + 'static,
[src]Auto Trait Implementations
impl<SP> RefUnwindSafe for LlmpBroker<SP> where
SP: RefUnwindSafe,
<SP as ShMemProvider>::Mem: RefUnwindSafe,
SP: RefUnwindSafe,
<SP as ShMemProvider>::Mem: RefUnwindSafe,
impl<SP> !Send for LlmpBroker<SP>
impl<SP> !Sync for LlmpBroker<SP>
impl<SP> Unpin for LlmpBroker<SP> where
SP: Unpin,
<SP as ShMemProvider>::Mem: Unpin,
SP: Unpin,
<SP as ShMemProvider>::Mem: Unpin,
impl<SP> UnwindSafe for LlmpBroker<SP> where
SP: UnwindSafe,
<SP as ShMemProvider>::Mem: UnwindSafe,
SP: UnwindSafe,
<SP as ShMemProvider>::Mem: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self