Documentation ¶
Index ¶
- Constants
- type Handle
- type PacketCapture
- type PacketSourceManager
- type PacketSourceManagerConfig
- type TcpPacketInfo
- type TcpPacketSource
- func (source *TcpPacketSource) Close()
- func (source *TcpPacketSource) NewPcapHandle() error
- func (source *TcpPacketSource) ReadPackets(packets chan<- TcpPacketInfo, dontClose bool, masterCapture bool)
- func (source *TcpPacketSource) Stats() (packetsReceived uint, packetsDropped uint, err error)
- func (source *TcpPacketSource) String() string
Constants ¶
View Source
const ( ELF_BINARY = "xdp_dump.elf" BPF_MAP = "perfmap" BPF_PROGRAM = "xdp_dump" PERF_BUFFER_SIZE = 4096 MTU_TARGET = 1500 )
View Source
const ( Best = "best" PfRing = "pf_ring" AfXdp = "af_xdp" AfPacket = "af_packet" Libpcap = "libpcap" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handle ¶
type Handle interface { NextPacket() (packet gopacket.Packet, err error) SetDecoder(decoder gopacket.Decoder, lazy bool, noCopy bool) SetBPF(expr string) (err error) LinkType() layers.LinkType Stats() (packetsReceived uint, packetsDropped uint, err error) Close() (err error) FileSize() (size int64, err error) }
type PacketCapture ¶ added in v0.8.33
type PacketCapture string
type PacketSourceManager ¶
type PacketSourceManager struct { Sources map[string]*TcpPacketSource // contains filtered or unexported fields }
func NewPacketSourceManager ¶
func NewPacketSourceManager( procfs string, interfaceName string, mtls bool, pods []v1.Pod, packetCapture PacketCapture, packets chan<- TcpPacketInfo, ) (*PacketSourceManager, error)
func (*PacketSourceManager) Close ¶
func (m *PacketSourceManager) Close()
func (*PacketSourceManager) Stats ¶
func (m *PacketSourceManager) Stats() (packetsReceived int, packetsDropped int, err error)
func (*PacketSourceManager) UpdatePods ¶
func (m *PacketSourceManager) UpdatePods(pods []v1.Pod, packets chan<- TcpPacketInfo)
type PacketSourceManagerConfig ¶
type PacketSourceManagerConfig struct {
// contains filtered or unexported fields
}
type TcpPacketInfo ¶
type TcpPacketInfo struct { Packet gopacket.Packet Source *TcpPacketSource }
type TcpPacketSource ¶ added in v0.2.0
type TcpPacketSource struct { Handle Handle // contains filtered or unexported fields }
func NewHostPacketSource ¶ added in v0.4.0
func NewHostPacketSource(filename string, interfaceName string, packetCapture PacketCapture) (*TcpPacketSource, error)
func NewTcpPacketSource ¶ added in v0.2.0
func NewTcpPacketSource(name, filename string, interfaceName string, packetCapture PacketCapture) (*TcpPacketSource, error)
func (*TcpPacketSource) Close ¶ added in v0.2.0
func (source *TcpPacketSource) Close()
func (*TcpPacketSource) NewPcapHandle ¶ added in v0.8.2
func (source *TcpPacketSource) NewPcapHandle() error
func (*TcpPacketSource) ReadPackets ¶ added in v0.2.0
func (source *TcpPacketSource) ReadPackets( packets chan<- TcpPacketInfo, dontClose bool, masterCapture bool, )
func (*TcpPacketSource) Stats ¶ added in v0.2.0
func (source *TcpPacketSource) Stats() (packetsReceived uint, packetsDropped uint, err error)
func (*TcpPacketSource) String ¶ added in v0.2.0
func (source *TcpPacketSource) String() string
Click to show internal directories.
Click to hide internal directories.