class

Filament::Capture::LiveCapture

Inherits Enumerable < Reference < Object

Real-time packet capture handle managing an active live interface

Constructors

new(device : String, snap_len : Int32 = 65535, promiscuous : Bool = true, timeout_ms : Int32 = 1000, filter : String | Nil = nil)

Opens an interface for live promiscuous packet capture

Source

Class methods

available_interfaces

Discovers all capture-capable network interfaces present on the system

Source

Instance methods

active?
Source
close

Closes the libpcap descriptor and frees resources

Source
device
Source
each

Iterates over packets continuously until stopped or broken

Source
finalize
Source
next_packet

Fetches the next packet from the live buffer. Returns nil if timeout expired without packets.

Source
promiscuous?
Source
set_filter(expression : String) : Nil

Compiles and attaches an in-kernel BPF filter expression

Source
snap_len
Source
statistics

Queries current kernel and driver drop statistics

Source
stop

Stops capture and breaks active read loops

Source
timeout_ms
Source