ddn.net.pcap.device

High-level device discovery and configuration API.

Authors

Dejan Lekić

License

BSD-3-Clause

Types 3

Represents a network device address.

Address data is deep-copied from libpcap's internal storage so that it remains valid after device enumeration returns.

Methods
const(SocketAddress) * addr() const pure nothrow @nogcReturns the address.
const(SocketAddress) * netmask() const pure nothrow @nogcReturns the netmask.
const(SocketAddress) * broadaddr() const pure nothrow @nogcReturns the broadcast address.
const(SocketAddress) * dstaddr() const pure nothrow @nogcReturns the destination address.
structDevice

Represents a network device.

Fields
string name
string description
uint flags
DeviceAddress[] addresses

Builder for configuring and opening a live capture.

Methods
LiveCaptureBuilder snaplen(int val) ref return
LiveCaptureBuilder promiscuous(bool val) ref return
LiveCaptureBuilder timeout(int ms) ref return
LiveCaptureBuilder immediateMode(bool val) ref return
LiveCaptureBuilder bufferSize(int bytes) ref return
Pcap open()Opens the live capture with the current configuration.
Constructors
this(string deviceName)

Functions 1

fnDevice[] enumerateDevices()Returns a list of all available network devices.