afpacket

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2022 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

type Source struct {
	// contains filtered or unexported fields
}

func NewPacketSource

func NewPacketSource(iface string, vpnMode bool) (*Source, error)

func (*Source) Close

func (s *Source) Close()

func (*Source) ReadPacketData

func (s *Source) ReadPacketData() ([]byte, *gopacket.CaptureInfo, error)

func (*Source) SetBPFFilter

func (s *Source) SetBPFFilter(bpfFilter string, maxPacketLength int) error

maxPacketLength is the maximum size of packets to capture in bytes. pcap calls it "snaplen" and default value used in tcpdump is 262144 bytes, that is redundant for most scans, see pcap(3) and tcpdump(1) for more info

func (*Source) WritePacketData

func (s *Source) WritePacketData(pkt []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL