Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListDeviceNames ¶
ListDevicesNames returns the list of adapters available for sniffing on this computer. If the withDescription parameter is set to true, a human readable version of the adapter name is added. If the withIP parameter is set to true, IP address of the adapter is added.
Types ¶
type Sniffer ¶
type Sniffer struct {
// contains filtered or unexported fields
}
Sniffer provides packet sniffing capabilities, forwarding packets read to a Worker.
func New ¶
func New( testMode bool, filter string, factory WorkerFactory, interfaces config.InterfacesConfig, dropSniffedPacket bool, ) (*Sniffer, error)
New create a new Sniffer instance. Settings are validated in a best effort only, but no device is opened yet. Accessing and configuring the actual device is done by the Run method.
type Worker ¶
type Worker interface { //OnPacket(data []byte, ci *gopacket.CaptureInfo) Do(<-chan *model.PacketWrapper) }
Worker defines the callback interfaces a Sniffer instance will use to forward packets.
Click to show internal directories.
Click to hide internal directories.