Documentation ¶
Index ¶
- Constants
- func NewStreamFactory(cf ConsumerFactory) *streamFactory
- type Consumer
- type ConsumerFactory
- type Context
- type IPPortTuple
- type Message
- type MessageStream
- type Options
- type Sniffer
- type Stream
- func (s *Stream) Accept(tcp *layers.TCP, ci gopacket.CaptureInfo, dir reassembly.TCPFlowDirection, ...) bool
- func (s *Stream) Next() (Message, bool)
- func (s *Stream) ReassembledSG(sg reassembly.ScatterGather, ac reassembly.AssemblerContext)
- func (s *Stream) ReassemblyComplete(ac reassembly.AssemblerContext) bool
Constants ¶
View Source
const ( PCap = "pcap" Afpacket = "af_packet" Offline = "offline" )
Variables ¶
This section is empty.
Functions ¶
func NewStreamFactory ¶
func NewStreamFactory(cf ConsumerFactory) *streamFactory
Types ¶
type Consumer ¶
type Consumer interface {
On(MessageStream)
}
type ConsumerFactory ¶
type ConsumerFactory interface { New(flow IPPortTuple) Consumer BPFFilter() string }
TODO: this is kind of a messy API
type Context ¶
type Context struct {
CaptureInfo gopacket.CaptureInfo
}
func (*Context) GetCaptureInfo ¶
func (c *Context) GetCaptureInfo() gopacket.CaptureInfo
type IPPortTuple ¶
func NewIPPortTuple ¶
func NewIPPortTuple(net_, transport gopacket.Flow) IPPortTuple
func (IPPortTuple) Reverse ¶
func (t IPPortTuple) Reverse() IPPortTuple
type Message ¶
type Message interface { Timestamp() time.Time Flow() IPPortTuple io.Reader }
A Message represents a concatenated sequence of one or more consecutive TCP segments in one direction.
type MessageStream ¶
type Options ¶
type Options struct { SourceType string `long:"type" default:"pcap" description:"Packet capture mechanism (pcap, af_packet or offline)"` Device string `long:"device" description:"Network interface to listen on"` SnapLen int `long:"snaplen" default:"65535" description:"Capture snapshot length"` BufSizeMb int `long:"bufsize" description:"buffer size in megabytes" default:"32"` FlushTimeout int `long:"flushtimeout" description:"Time in seconds to wait before flushing buffered data for a connection" default:"5"` PcapFile string `long:"pcapfile" description:"For offline packet captures, path to pcap file"` }
type Stream ¶
func (*Stream) Accept ¶
func (s *Stream) Accept(tcp *layers.TCP, ci gopacket.CaptureInfo, dir reassembly.TCPFlowDirection, ackSeq reassembly.Sequence, start *bool, ac reassembly.AssemblerContext) bool
func (*Stream) ReassembledSG ¶
func (s *Stream) ReassembledSG(sg reassembly.ScatterGather, ac reassembly.AssemblerContext)
func (*Stream) ReassemblyComplete ¶
func (s *Stream) ReassemblyComplete(ac reassembly.AssemblerContext) bool
TODO: ensure this fully handles completion
Click to show internal directories.
Click to hide internal directories.