class Pcap::Capture

Defined in:

pcap/capture.cr

Constant Summary

DEFAULT_PROMISC = 1
DEFAULT_SNAPLEN = 1500
DEFAULT_TIMEOUT_MS = 1000

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(pcap : LibPcap::PcapT, netmask : UInt32) #

[View source]

Class Method Detail

def self.open_live(device : String, snaplen : Int32 = DEFAULT_SNAPLEN, promisc : Int32 = DEFAULT_PROMISC, timeout_ms : Int32 = DEFAULT_TIMEOUT_MS) #

[View source]
def self.open_offline(file : String) #

[View source]

Instance Method Detail

def callback #

def callback=(callback : Pcap::Packet -> _) #

[View source]
def callback? : Pcap::Packet -> Nil #

def close #

[View source]
def loop(count : Int32 = -1, &callback : Pcap::Packet -> ) #

[View source]
def set_promisc(flag : Bool) #

[View source]
def setfilter(filter : String, optimize : Int32 = 1) #

[View source]