Versions in this module Expand all Collapse all v1 v1.9.0 Sep 17, 2023 Changes in this version + const DSB_SECRETS_TYPE_SSH + const DSB_SECRETS_TYPE_TLS + const DSB_SECRETS_TYPE_WIREGUARD + const DSB_SECRETS_TYPE_ZIGBEE_APS_KEY + const DSB_SECRETS_TYPE_ZIGBEE_NWK_KEY + const NgNoValue64 + const PcapngBlockHeadersize + const PcapngDecryptionSecretsBlockSize + var DefaultNgInterface = NgInterface + var DefaultNgReaderOptions = NgReaderOptions + var DefaultNgWriterOptions = NgWriterOptions + var ErrNgLinkTypeMismatch = errors.New("Link type of current interface is different from first one") + var ErrNgVersionMismatch = errors.New("Unknown pcapng Version in Section Header") + var ErrUnknownSecretsType = errors.New("Unknown Decryption Secrets Block (DSB) type") + type EthernetHandle struct — linux/amd64 + func NewEthernetHandle(ifname string) (*EthernetHandle, error) + func (h *EthernetHandle) Close() (err error) + func (h *EthernetHandle) GetCaptureLength() int + func (h *EthernetHandle) LocalAddr() net.HardwareAddr + func (h *EthernetHandle) ReadPacketData() ([]byte, gopacket.CaptureInfo, error) + func (h *EthernetHandle) SetBPF(filter []bpf.RawInstruction) error + func (h *EthernetHandle) SetCaptureLength(len int) error + func (h *EthernetHandle) SetPromiscuous(b bool) error + func (h *EthernetHandle) Stats() (*unix.TpacketStats, error) + func (h *EthernetHandle) ZeroCopyReadPacketData() ([]byte, gopacket.CaptureInfo, error) + type NgInterface struct + Comment string + Description string + Filter string + LinkType layers.LinkType + Name string + OS string + SnapLength uint32 + Statistics NgInterfaceStatistics + TimestampOffset uint64 + TimestampResolution NgResolution + func (i NgInterface) Resolution() gopacket.TimestampResolution + type NgInterfaceStatistics struct + Comment string + EndTime time.Time + LastUpdate time.Time + PacketsDropped uint64 + PacketsReceived uint64 + StartTime time.Time + type NgReader struct + func NewNgReader(r io.Reader, options NgReaderOptions) (*NgReader, error) + func (r *NgReader) Interface(i int) (NgInterface, error) + func (r *NgReader) LinkType() layers.LinkType + func (r *NgReader) NInterfaces() int + func (r *NgReader) ReadPacketData() (data []byte, ci gopacket.CaptureInfo, err error) + func (r *NgReader) Resolution() gopacket.TimestampResolution + func (r *NgReader) SectionInfo() NgSectionInfo + func (r *NgReader) SkipSection() error + func (r *NgReader) ZeroCopyReadPacketData() (data []byte, ci gopacket.CaptureInfo, err error) + type NgReaderOptions struct + ErrorOnMismatchingLinkType bool + SectionEndCallback func([]NgInterface, NgSectionInfo) + SkipUnknownVersion bool + StatisticsCallback func(int, NgInterfaceStatistics) + WantMixedLinkType bool + type NgResolution uint8 + func (r NgResolution) Binary() bool + func (r NgResolution) Exponent() uint8 + func (r NgResolution) ToTimestampResolution() (ret gopacket.TimestampResolution) + type NgSectionInfo struct + Application string + Comment string + Hardware string + OS string + type NgWriter struct + func NewNgWriter(w io.Writer, linkType layers.LinkType) (*NgWriter, error) + func NewNgWriterInterface(w io.Writer, intf NgInterface, options NgWriterOptions) (*NgWriter, error) + func (w *NgWriter) AddInterface(intf NgInterface) (id int, err error) + func (w *NgWriter) Flush() error + func (w *NgWriter) WriteDecryptionSecretsBlock(secretType uint32, secretPayload []byte) error + func (w *NgWriter) WriteInterfaceStats(intf int, stats NgInterfaceStatistics) error + func (w *NgWriter) WritePacket(ci gopacket.CaptureInfo, data []byte) error + type NgWriterOptions struct + SectionInfo NgSectionInfo + type Reader struct + func NewReader(r io.Reader) (*Reader, error) + func (r *Reader) LinkType() layers.LinkType + func (r *Reader) ReadPacketData() (data []byte, ci gopacket.CaptureInfo, err error) + func (r *Reader) Resolution() gopacket.TimestampResolution + func (r *Reader) SetSnaplen(newSnaplen uint32) + func (r *Reader) Snaplen() uint32 + func (r *Reader) String() string + func (r *Reader) ZeroCopyReadPacketData() (data []byte, ci gopacket.CaptureInfo, err error) + type SnoopReader struct + func NewSnoopReader(r io.Reader) (*SnoopReader, error) + func (r *SnoopReader) LinkType() (*layers.LinkType, error) + func (r *SnoopReader) ReadPacketData() (data []byte, ci gopacket.CaptureInfo, err error) + func (r *SnoopReader) ZeroCopyReadPacketData() (data []byte, ci gopacket.CaptureInfo, err error) + type Writer struct + func NewWriter(w io.Writer) *Writer + func NewWriterNanos(w io.Writer) *Writer + func (w *Writer) WriteFileHeader(snaplen uint32, linktype layers.LinkType) error + func (w *Writer) WritePacket(ci gopacket.CaptureInfo, data []byte) error