High-performance raw network packet sniffer. Requires Root (POSIX) or Administrator (Windows) privileges.

Static methods

@:value({ promiscuous : true })staticcreate(interfaceName:String, promiscuous:Bool = true):RawSocket

Creates a raw sniffer bound to an interface.

Parameters:

interfaceName

Name of the interface (e.g. "en0", "eth0") or local IP on Windows.

promiscuous

Whether to capture all traffic on the interface.

Variables

Methods

close():Void

Closes the sniffer.

readPacket(buffer:NativeBuffer):Int

Reads a raw packet into a native buffer.

Returns:

Bytes read, or -1 on error.