Packetz::Capture
Inherits Reference / Object
The Capture class is responsible for all of the supported capturing operations provided
by LibPcap in a clean, friendly API.
Simply start a new capture object called cap, with all the defaults:
cap = Packetz::Capture.new
If you want to start customizing the capture object during initialization, you have a few
ways to do that to change the interface, snapshot_length, promiscuous_mode and timeout_ms values
of a capture.
Listen specifically on the en0 network interface:
cap = Packetz::Capture.new("en0")
Listen with alll the default options, but in promiscuous mode:
cap = Packetz::Capture.new(promiscuous_mode = true)
Change the default snapshot length from 65535 to half that size.
cap = Packetz::Capture.new(snapshot_length: 65535/2)
Constructors
Instance methods
each
Sourceenable_monitor_mode!
Sourceimmediate_mode!
Sourceimmediate_mode=(value : Int32)
Sourceimmediate_mode=(value : Bool)
Sourceimmediate_mode?
Sourcemicrosecond_timestamp_precision!
Sourcemicrosecond_timestamp_precision?
Sourcemonitor_mode
Sourcemonitor_mode=(value : Bool)
Sourcemonitor_mode?
Sourcenanosecond_timestamp_precision!
Sourcenanosecond_timestamp_precision?
Sourcenext
Sourcenon_blocking_mode!
Sourcenon_blocking_mode=(value : Int32)
Sourcenon_blocking_mode=(value : Bool)
Sourcenon_blocking_mode?
Sourcepromiscuous_mode
Sourcepromiscuous_mode!
Sourcepromiscuous_mode=(value : Bool)
Sourcepromiscuous_mode=(value : Int32)
Sourcepromiscuous_mode?
Sourcereset!
Sourcesnapshot_length
Sourcesnapshot_length=(value : Int32)
Sourcestarted?
Sourcestop!
Sourcestopped?
Sourcesupports_monitor_mode?
Sourcetimeout_ms
Sourcetimeout_ms=(value : Int32)
Sourcetimestamp_precision
Source