Documentation
¶
Index ¶
- func DumpProto(pb proto.Message)
- func IsPcap(file string) (bool, error)
- type AtomicPcapGoWriter
- type BatchInfo
- type Collector
- func (c *Collector) CollectBPF(path string, bpf string)
- func (c *Collector) CollectLive(i string, bpf string)
- func (c *Collector) CollectPcap(path string)
- func (c *Collector) CollectPcapNG(path string)
- func (c *Collector) Init()
- func (c *Collector) InitBatching(maxSize int, bpf string, in string) ([]BatchInfo, *pcap.Handle)
- func (c *Collector) Stats()
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AtomicPcapGoWriter ¶
AtomicPcapGoWriter is a symchronized PCAP writer that counts the number of packets written
func NewAtomicPcapGoWriter ¶
func NewAtomicPcapGoWriter(w *pcapgo.Writer) *AtomicPcapGoWriter
NewAtomicPcapGoWriter takes a pcapgo.Writer and returns an atomic version
func (*AtomicPcapGoWriter) WritePacket ¶
func (a *AtomicPcapGoWriter) WritePacket(ci gopacket.CaptureInfo, data []byte) error
WritePacket writes a packet into the writer
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector provides an interface to collect data from PCAP or a network interface
func (*Collector) CollectBPF ¶
CollectBPF open the named PCAP file and sets the specified BPF filter
func (*Collector) CollectLive ¶
CollectLive starts collection of data from the given interface optionally a BPF can be supplied this is the linux version that uses the pure go version from pcapgo to fetch packets live
func (*Collector) CollectPcap ¶
CollectPcap implements parallel decoding of incoming packets
func (*Collector) CollectPcapNG ¶
CollectPcapNG implements parallel decoding of incoming packets
func (*Collector) Init ¶
func (c *Collector) Init()
Init sets up the collector and starts the configured number of workers must be called prior to usage of the collector instance
func (*Collector) InitBatching ¶
InitBatching initializes batching mode and returns an array of Batchinfos and the pcap handle closing the handle must be done by the caller