Versions in this module Expand all Collapse all v1 v1.1.21 Sep 9, 2021 v1.1.20 Sep 9, 2021 Changes in this version + func LoadWinPCAP() error — windows/amd64 v1.1.16 Feb 1, 2019 Changes in this version + const DirectionIn + const DirectionInOut + const DirectionOut + const ErrNotActive + const MaxBpfInstructions + var CannotSetRFMon = errors.New("Cannot set rfmon for this handle") + func DatalinkNameToVal(name string) int + func DatalinkValToDescription(dlt int) string + func DatalinkValToName(dlt int) string + type BPF struct + func NewBPF(linkType layers.LinkType, captureLength int, expr string) (*BPF, error) + func (b *BPF) Matches(ci gopacket.CaptureInfo, data []byte) bool + func (b *BPF) String() string + type BPFInstruction struct + Code uint16 + Jf uint8 + Jt uint8 + K uint32 + func CompileBPFFilter(linkType layers.LinkType, captureLength int, expr string) ([]BPFInstruction, error) + type Datalink struct + Description string + Name string + type Direction uint8 type Handle + func OpenOfflineFile(file *os.File) (handle *Handle, err error) + func (p *Handle) CompileBPFFilter(expr string) ([]BPFInstruction, error) + func (p *Handle) ListDataLinks() (datalinks []Datalink, err error) + func (p *Handle) NewBPF(expr string) (*BPF, error) + func (p *Handle) NewBPFInstructionFilter(bpfInstructions []BPFInstruction) (*BPF, error) + func (p *Handle) Resolution() gopacket.TimestampResolution + func (p *Handle) SetBPFInstructionFilter(bpfInstructions []BPFInstruction) (err error) + func (p *Handle) SetDirection(direction Direction) error + func (p *Handle) SnapLen() int + type InactiveHandle struct + func NewInactiveHandle(device string) (*InactiveHandle, error) + func (p *InactiveHandle) Activate() (*Handle, error) + func (p *InactiveHandle) CleanUp() + func (p *InactiveHandle) Error() error + func (p *InactiveHandle) SetBufferSize(bufferSize int) error + func (p *InactiveHandle) SetImmediateMode(mode bool) error + func (p *InactiveHandle) SetPromisc(promisc bool) error + func (p *InactiveHandle) SetRFMon(monitor bool) error + func (p *InactiveHandle) SetSnapLen(snaplen int) error + func (p *InactiveHandle) SetTimeout(timeout time.Duration) error + func (p *InactiveHandle) SetTimestampSource(t TimestampSource) error + func (p *InactiveHandle) SupportedTimestamps() (out []TimestampSource) type Interface + Flags uint32 type InterfaceAddress + Broadaddr net.IP + P2P net.IP type NextError + const NextErrorNotActivated v1.0.11 Apr 25, 2014 v1.0.8 Feb 13, 2014 Changes in this version type Handle + func (p *Handle) SetTimestampSource(t TimestampSource) error + func (p *Handle) SupportedTimestamps() (out []TimestampSource) + type TimestampSource C.int + func TimestampSourceFromString(s string) (TimestampSource, error) + func (t TimestampSource) String() string v1.0.6 Jan 22, 2014 v1.0.5 Jan 21, 2014 v1.0.2 Dec 2, 2013 v1.0.0 Oct 4, 2013 Changes in this version + const BlockForever + func Version() string + type Handle struct + func OpenLive(device string, snaplen int32, promisc bool, timeout time.Duration) (handle *Handle, _ error) + func OpenOffline(file string) (handle *Handle, err error) + func (p *Handle) Close() + func (p *Handle) Error() error + func (p *Handle) LinkType() layers.LinkType + func (p *Handle) ReadPacketData() (data []byte, ci gopacket.CaptureInfo, err error) + func (p *Handle) SetBPFFilter(expr string) (err error) + func (p *Handle) SetLinkType(dlt layers.LinkType) error + func (p *Handle) Stats() (stat *Stats, err error) + func (p *Handle) WritePacketData(data []byte) (err error) + func (p *Handle) ZeroCopyReadPacketData() (data []byte, ci gopacket.CaptureInfo, err error) + type Interface struct + Addresses []InterfaceAddress + Description string + Name string + func FindAllDevs() (ifs []Interface, err error) + type InterfaceAddress struct + IP net.IP + Netmask net.IPMask + type NextError int32 + const NextErrorNoMorePackets + const NextErrorOk + const NextErrorReadError + const NextErrorTimeoutExpired + func (n NextError) Error() string + type Stats struct + PacketsDropped int + PacketsIfDropped int + PacketsReceived int