pub struct TcpdumpRegistry { /* private fields */ }Expand description
Tracks active captures so callers can stop them by id.
Implementations§
Source§impl TcpdumpRegistry
impl TcpdumpRegistry
pub fn new() -> Self
Sourcepub fn global() -> &'static Self
pub fn global() -> &'static Self
Process-wide singleton — the FFI surface uses this so capture ids are unique across the app.
Sourcepub async fn start(
&self,
client: &SshClient,
interface: &str,
filter: &str,
snaplen: Option<u32>,
) -> Result<u64, ToolsError>
pub async fn start( &self, client: &SshClient, interface: &str, filter: &str, snaplen: Option<u32>, ) -> Result<u64, ToolsError>
Start a new capture on client. Returns the capture id; lines
arrive asynchronously via the event bus.
interface is the tcpdump -i value (use any if the user
hasn’t picked one). filter is the bpf expression — the empty
string means “capture everything”. snaplen defaults to 96 if
None (header-only, low bandwidth).
pub fn stop(&self, id: u64) -> Result<(), ToolsError>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TcpdumpRegistry
impl RefUnwindSafe for TcpdumpRegistry
impl Send for TcpdumpRegistry
impl Sync for TcpdumpRegistry
impl Unpin for TcpdumpRegistry
impl UnsafeUnpin for TcpdumpRegistry
impl UnwindSafe for TcpdumpRegistry
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
Mutably borrows from an owned value. Read more