Documentation ¶
Overview ¶
Traffic capture using libpcap
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetActiveInterfaces ¶
Gets all the active network interfaces (only their names).
Types ¶
type CaptureContext ¶
type CaptureContext struct {
// contains filtered or unexported fields
}
Capture the trafic using libpcap
func New ¶
func New(device string) (*CaptureContext, error)
Creates a capture context using libpcap implementation and opens the device to capture. Ensure that the process has permission con capture traffic through the device.
func (*CaptureContext) GetMAC ¶
func (c *CaptureContext) GetMAC() net.HardwareAddr
Gets the MAC Address of the device being captured.
func (*CaptureContext) Packets ¶
func (c *CaptureContext) Packets() chan *capture.Packet
Returns the packets channel where all the packets will be passed through.
func (*CaptureContext) StartCapturing ¶
func (c *CaptureContext) StartCapturing()
Starts the capture session. Use Packets() to grab the packets channel.
Click to show internal directories.
Click to hide internal directories.