Documentation
¶
Overview ¶
Package capture turns raw packets into attributed flows. The decoding logic here is pure (no libpcap dependency) so it can be unit tested with crafted or replayed packets; the live/offline pcap plumbing lives in source.go.
Index ¶
- func LocalIPs() []string
- type Decoder
- type Source
- func (s *Source) ListInterfaces() []types.NetIface
- func (s *Source) Name() string
- func (s *Source) Paused() bool
- func (s *Source) PreferredInterface() string
- func (s *Source) Run(ctx context.Context, out chan<- types.Flow) error
- func (s *Source) SetPaused(p bool)
- func (s *Source) SetPreferredInterface(name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder converts gopacket packets into types.Flow, attributing direction against the set of local interface addresses and feeding observed DNS answers into the supplied cache.
func NewDecoder ¶
NewDecoder builds a Decoder. localIPs is the set of addresses belonging to this host (used to decide upload vs download); dns may be nil to skip DNS learning.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source is a non-functional placeholder on unsupported platforms.
func NewLiveSupervisor ¶ added in v0.5.0
NewLiveSupervisor returns a non-functional placeholder on unsupported platforms; its Run reports the unsupported error like the other stubs.
func OpenOffline ¶
func (*Source) ListInterfaces ¶ added in v0.6.0
Capturer stubs so the live source satisfies api.Capturer on all platforms.