Documentation ¶
Index ¶
- Constants
- Variables
- func CapturesMetadataDecoder(raw json.RawMessage) (common.Getter, error)
- func GoPacketFirstLayerType(n *graph.Node) (gopacket.LayerType, layers.LinkType)
- func NewFlowProbeBundle(tb *probe.Bundle, g *graph.Graph, fta *flow.TableAllocator) *probe.Bundle
- func NormalizeBPFFilter(capture *types.Capture) string
- type AFPacketHandle
- type AfpacketPacketProbe
- type CaptureMetadata
- type CaptureStats
- type Captures
- type Context
- type DPDKProbesHandler
- func (p *DPDKProbesHandler) CaptureTypes() []string
- func (p *DPDKProbesHandler) Init(ctx Context, bundle *probe.Bundle) (FlowProbeHandler, error)
- func (p *DPDKProbesHandler) RegisterProbe(n *graph.Node, capture *types.Capture, e ProbeEventHandler) (Probe, error)
- func (p *DPDKProbesHandler) Start()
- func (p *DPDKProbesHandler) Stop()
- func (p *DPDKProbesHandler) UnregisterProbe(n *graph.Node, e ProbeEventHandler, fp Probe) error
- type EBPFProbesHandler
- func (p *EBPFProbesHandler) CaptureTypes() []string
- func (p *EBPFProbesHandler) Init(ctx Context, bundle *probe.Bundle) (FlowProbeHandler, error)
- func (p *EBPFProbesHandler) RegisterProbe(n *graph.Node, capture *types.Capture, e ProbeEventHandler) (Probe, error)
- func (p *EBPFProbesHandler) Start()
- func (p *EBPFProbesHandler) Stop()
- func (p *EBPFProbesHandler) UnregisterProbe(n *graph.Node, e ProbeEventHandler, fp Probe) error
- type FlowProbeHandler
- type GoPacketProbe
- type GoPacketProbesHandler
- func (p *GoPacketProbesHandler) CaptureTypes() []string
- func (p *GoPacketProbesHandler) Init(ctx Context, bundle *probe.Bundle) (FlowProbeHandler, error)
- func (p *GoPacketProbesHandler) RegisterProbe(n *graph.Node, capture *types.Capture, e ProbeEventHandler) (Probe, error)
- func (p *GoPacketProbesHandler) Start()
- func (p *GoPacketProbesHandler) Stop()
- func (p *GoPacketProbesHandler) UnregisterProbe(n *graph.Node, e ProbeEventHandler, probe Probe) error
- type OvsMirrorProbesHandler
- func (o *OvsMirrorProbesHandler) CaptureTypes() []string
- func (o *OvsMirrorProbesHandler) Init(ctx Context, bundle *probe.Bundle) (FlowProbeHandler, error)
- func (o *OvsMirrorProbesHandler) OnConnected(monitor *ovsdb.OvsMonitor)
- func (o *OvsMirrorProbesHandler) RegisterProbe(n *graph.Node, capture *types.Capture, e ProbeEventHandler) (Probe, error)
- func (o *OvsMirrorProbesHandler) RegisterProbeOnPort(n *graph.Node, portUUID string, capture *types.Capture) (Probe, error)
- func (o *OvsMirrorProbesHandler) Start()
- func (o *OvsMirrorProbesHandler) Stop()
- func (o *OvsMirrorProbesHandler) UnregisterProbe(n *graph.Node, e ProbeEventHandler, fp Probe) error
- type OvsNetFlowProbe
- type OvsNetFlowProbesHandler
- func (o *OvsNetFlowProbesHandler) CaptureTypes() []string
- func (o *OvsNetFlowProbesHandler) Init(ctx Context, bundle *probe.Bundle) (FlowProbeHandler, error)
- func (o *OvsNetFlowProbesHandler) RegisterProbe(n *graph.Node, capture *types.Capture, e ProbeEventHandler) (Probe, error)
- func (o *OvsNetFlowProbesHandler) Start()
- func (o *OvsNetFlowProbesHandler) Stop()
- func (o *OvsNetFlowProbesHandler) UnregisterNetFlowProbeFromBridge(bridgeUUID string) error
- func (o *OvsNetFlowProbesHandler) UnregisterProbe(n *graph.Node, e ProbeEventHandler, p Probe) error
- type OvsSFlowProbe
- type OvsSFlowProbesHandler
- func (o *OvsSFlowProbesHandler) CaptureTypes() []string
- func (o *OvsSFlowProbesHandler) Init(ctx Context, bundle *probe.Bundle) (FlowProbeHandler, error)
- func (o *OvsSFlowProbesHandler) RegisterProbe(n *graph.Node, capture *types.Capture, e ProbeEventHandler) (Probe, error)
- func (o *OvsSFlowProbesHandler) Start()
- func (o *OvsSFlowProbesHandler) Stop()
- func (o *OvsSFlowProbesHandler) UnregisterProbe(n *graph.Node, e ProbeEventHandler, fp Probe) error
- func (o *OvsSFlowProbesHandler) UnregisterSFlowProbeFromBridge(probe *OvsSFlowProbe) error
- type PacketProbe
- type PcapPacketProbe
- type PcapSocketProbe
- type PcapSocketProbeHandler
- func (p *PcapSocketProbeHandler) CaptureTypes() []string
- func (p *PcapSocketProbeHandler) Init(ctx Context, bundle *probe.Bundle) (FlowProbeHandler, error)
- func (p *PcapSocketProbeHandler) RegisterProbe(n *graph.Node, capture *types.Capture, e ProbeEventHandler) (Probe, error)
- func (p *PcapSocketProbeHandler) Start()
- func (p *PcapSocketProbeHandler) Stop()
- func (p *PcapSocketProbeHandler) UnregisterProbe(n *graph.Node, e ProbeEventHandler, fp Probe) error
- type Probe
- type ProbeEventHandler
- type SFlowProbesHandler
- func (d *SFlowProbesHandler) CaptureTypes() []string
- func (d *SFlowProbesHandler) Init(ctx Context, bundle *probe.Bundle) (FlowProbeHandler, error)
- func (d *SFlowProbesHandler) RegisterProbe(n *graph.Node, capture *types.Capture, e ProbeEventHandler) (Probe, error)
- func (d *SFlowProbesHandler) Start()
- func (d *SFlowProbesHandler) Stop()
- func (d *SFlowProbesHandler) UnregisterProbe(n *graph.Node, e ProbeEventHandler, p Probe) error
Constants ¶
const ( // AFPacket probe type AFPacket = "afpacket" // PCAP probe type PCAP = "pcap" )
Variables ¶
var ErrProbeNotCompiled = fmt.Errorf("probe is not compiled within skydive")
ErrProbeNotCompiled is thrown when a flow probe was not compiled within the binary
Functions ¶
func CapturesMetadataDecoder ¶
func CapturesMetadataDecoder(raw json.RawMessage) (common.Getter, error)
CapturesMetadataDecoder implements a json message raw decoder
func GoPacketFirstLayerType ¶
GoPacketFirstLayerType returns the first layer of an interface
func NewFlowProbeBundle ¶
NewFlowProbeBundle returns a new bundle of flow probes
func NormalizeBPFFilter ¶
NormalizeBPFFilter returns a normalized BPF filter in order to exclude traffic generated by skydive itself
Types ¶
type AFPacketHandle ¶
type AFPacketHandle struct {
// contains filtered or unexported fields
}
AFPacketHandle describes a AF network kernel packets
func NewAFPacketHandle ¶
func NewAFPacketHandle(ifName string, snaplen int32) (*AFPacketHandle, error)
NewAFPacketHandle creates a new network AF packet probe
func (*AFPacketHandle) ReadPacketData ¶
func (h *AFPacketHandle) ReadPacketData() ([]byte, gopacket.CaptureInfo, error)
ReadPacketData reads one packet
func (*AFPacketHandle) TPacket ¶
func (h *AFPacketHandle) TPacket() *afpacket.TPacket
TPacket returns the afpacket TPacket instance
type AfpacketPacketProbe ¶
type AfpacketPacketProbe struct {
// contains filtered or unexported fields
}
AfpacketPacketProbe describes an afpacket based packet probe
func NewAfpacketPacketProbe ¶
func NewAfpacketPacketProbe(ifName string, headerSize int, layerType gopacket.LayerType, linkType layers.LinkType) (*AfpacketPacketProbe, error)
NewAfpacketPacketProbe returns a new afpacket capture probe
func (*AfpacketPacketProbe) PacketSource ¶
func (a *AfpacketPacketProbe) PacketSource() *gopacket.PacketSource
PacketSource returns the Gopacket packet source for the probe
func (*AfpacketPacketProbe) SetBPFFilter ¶
func (a *AfpacketPacketProbe) SetBPFFilter(filter string) error
SetBPFFilter applies a BPF filter to the probe
func (*AfpacketPacketProbe) Stats ¶
func (a *AfpacketPacketProbe) Stats() (*CaptureStats, error)
Stats returns statistics about captured packets
type CaptureMetadata ¶
type CaptureMetadata struct { CaptureStats ID string `json:",omitempty"` State string `json:",omitempty"` Name string `json:",omitempty"` Description string `json:",omitempty"` BPFFilter string `json:",omitempty"` Type string `json:",omitempty"` PCAPSocket string `json:",omitempty"` MirrorOf string `json:",omitempty"` SFlowSocket string `json:",omitempty"` Error string `json:",omitempty"` }
CaptureMetadata holds attributes and statistics about a capture easyjson:json gendecoder
type CaptureStats ¶
CaptureStats describes the statistics of a running capture easyjson:json gendecoder
type Captures ¶
type Captures []*CaptureMetadata
Captures holds the captures metadata easyjson:json gendecoder
type Context ¶
type Context struct { Logger logging.Logger Config config.Config Graph *graph.Graph FTA *flow.TableAllocator TB *probe.Bundle }
Context defines a context to be used by constructor of probes
type DPDKProbesHandler ¶
type DPDKProbesHandler struct { }
DPDKProbesHandler describes a flow probe handle in the graph
func (*DPDKProbesHandler) CaptureTypes ¶
func (p *DPDKProbesHandler) CaptureTypes() []string
CaptureTypes supported
func (*DPDKProbesHandler) Init ¶
func (p *DPDKProbesHandler) Init(ctx Context, bundle *probe.Bundle) (FlowProbeHandler, error)
Init initializes a new dpdk probe
func (*DPDKProbesHandler) RegisterProbe ¶
func (p *DPDKProbesHandler) RegisterProbe(n *graph.Node, capture *types.Capture, e ProbeEventHandler) (Probe, error)
RegisterProbe registers a gopacket probe
func (*DPDKProbesHandler) UnregisterProbe ¶
func (p *DPDKProbesHandler) UnregisterProbe(n *graph.Node, e ProbeEventHandler, fp Probe) error
UnregisterProbe unregisters gopacket probe
type EBPFProbesHandler ¶
type EBPFProbesHandler struct { }
EBPFProbesHandler describes a flow probe handle in the graph
func (*EBPFProbesHandler) CaptureTypes ¶
func (p *EBPFProbesHandler) CaptureTypes() []string
CaptureTypes supported
func (*EBPFProbesHandler) Init ¶
func (p *EBPFProbesHandler) Init(ctx Context, bundle *probe.Bundle) (FlowProbeHandler, error)
Init initializes a new eBPF probe
func (*EBPFProbesHandler) RegisterProbe ¶
func (p *EBPFProbesHandler) RegisterProbe(n *graph.Node, capture *types.Capture, e ProbeEventHandler) (Probe, error)
RegisterProbe registers a probe
func (*EBPFProbesHandler) UnregisterProbe ¶
func (p *EBPFProbesHandler) UnregisterProbe(n *graph.Node, e ProbeEventHandler, fp Probe) error
UnregisterProbe unregisters a probe
type FlowProbeHandler ¶
type FlowProbeHandler interface { probe.Handler // inheritance of the probe.Handler interface Start/Stop functions RegisterProbe(n *graph.Node, capture *types.Capture, e ProbeEventHandler) (Probe, error) UnregisterProbe(n *graph.Node, e ProbeEventHandler, p Probe) error CaptureTypes() []string Init(ctx Context, bundle *probe.Bundle) (FlowProbeHandler, error) }
FlowProbeHandler defines flow probe mechanism
type GoPacketProbe ¶
type GoPacketProbe struct { Ctx Context // contains filtered or unexported fields }
GoPacketProbe describes a new probe that store packets from gopacket pcap library in a flowtable
func NewGoPacketProbe ¶
func NewGoPacketProbe(ctx Context, n *graph.Node, captureType, bpfFilter string, headerSize uint32) (*GoPacketProbe, error)
NewGoPacketProbe returns a new Gopacket flow probe. It can use either `pcap` or `afpacket`
func (*GoPacketProbe) Run ¶
func (p *GoPacketProbe) Run(packetCallback func(gopacket.Packet), e ProbeEventHandler) error
Run starts capturing packet, calling the passed callback for every packet and notifying the flow probe handler when the capture has started
type GoPacketProbesHandler ¶
type GoPacketProbesHandler struct { Ctx Context // contains filtered or unexported fields }
GoPacketProbesHandler describes a flow probe handle in the graph
func (*GoPacketProbesHandler) CaptureTypes ¶
func (p *GoPacketProbesHandler) CaptureTypes() []string
CaptureTypes supported
func (*GoPacketProbesHandler) Init ¶
func (p *GoPacketProbesHandler) Init(ctx Context, bundle *probe.Bundle) (FlowProbeHandler, error)
Init initializes a new GoPacket probe
func (*GoPacketProbesHandler) RegisterProbe ¶
func (p *GoPacketProbesHandler) RegisterProbe(n *graph.Node, capture *types.Capture, e ProbeEventHandler) (Probe, error)
RegisterProbe registers a gopacket probe
func (*GoPacketProbesHandler) UnregisterProbe ¶
func (p *GoPacketProbesHandler) UnregisterProbe(n *graph.Node, e ProbeEventHandler, probe Probe) error
UnregisterProbe unregisters gopacket probe
type OvsMirrorProbesHandler ¶
type OvsMirrorProbesHandler struct { ovsdb.DefaultOvsMonitorHandler Ctx Context // contains filtered or unexported fields }
OvsMirrorProbesHandler describes a flow probe in running in the graph
func (*OvsMirrorProbesHandler) CaptureTypes ¶
func (o *OvsMirrorProbesHandler) CaptureTypes() []string
CaptureTypes supported
func (*OvsMirrorProbesHandler) Init ¶
func (o *OvsMirrorProbesHandler) Init(ctx Context, bundle *probe.Bundle) (FlowProbeHandler, error)
Init initializes a new OVS Mirror probe
func (*OvsMirrorProbesHandler) OnConnected ¶
func (o *OvsMirrorProbesHandler) OnConnected(monitor *ovsdb.OvsMonitor)
OnConnected ovsdb event
func (*OvsMirrorProbesHandler) RegisterProbe ¶
func (o *OvsMirrorProbesHandler) RegisterProbe(n *graph.Node, capture *types.Capture, e ProbeEventHandler) (Probe, error)
RegisterProbe registers a probe on a graph node
func (*OvsMirrorProbesHandler) RegisterProbeOnPort ¶
func (o *OvsMirrorProbesHandler) RegisterProbeOnPort(n *graph.Node, portUUID string, capture *types.Capture) (Probe, error)
RegisterProbeOnPort registers a new probe on the OVS bridge
func (*OvsMirrorProbesHandler) UnregisterProbe ¶
func (o *OvsMirrorProbesHandler) UnregisterProbe(n *graph.Node, e ProbeEventHandler, fp Probe) error
UnregisterProbe at the graph node
type OvsNetFlowProbe ¶
type OvsNetFlowProbe struct { ID string Target string EngineID int // contains filtered or unexported fields }
OvsNetFlowProbe describes a NetFlow probe from OVS switch
type OvsNetFlowProbesHandler ¶
type OvsNetFlowProbesHandler struct { Ctx Context Node *graph.Node // contains filtered or unexported fields }
OvsNetFlowProbesHandler describes a flow probe in running in the graph
func (*OvsNetFlowProbesHandler) CaptureTypes ¶
func (o *OvsNetFlowProbesHandler) CaptureTypes() []string
CaptureTypes supported
func (*OvsNetFlowProbesHandler) Init ¶
func (o *OvsNetFlowProbesHandler) Init(ctx Context, bundle *probe.Bundle) (FlowProbeHandler, error)
Init initializes a new ovsnetflow probe
func (*OvsNetFlowProbesHandler) RegisterProbe ¶
func (o *OvsNetFlowProbesHandler) RegisterProbe(n *graph.Node, capture *types.Capture, e ProbeEventHandler) (Probe, error)
RegisterProbe registers a probe on a graph node
func (*OvsNetFlowProbesHandler) UnregisterNetFlowProbeFromBridge ¶
func (o *OvsNetFlowProbesHandler) UnregisterNetFlowProbeFromBridge(bridgeUUID string) error
UnregisterNetFlowProbeFromBridge unregisters a flow probe from the bridge selected by UUID
func (*OvsNetFlowProbesHandler) UnregisterProbe ¶
func (o *OvsNetFlowProbesHandler) UnregisterProbe(n *graph.Node, e ProbeEventHandler, p Probe) error
UnregisterProbe at the graph node
type OvsSFlowProbe ¶
type OvsSFlowProbe struct { ID string Interface string Target string HeaderSize uint32 Sampling uint32 Polling uint32 // contains filtered or unexported fields }
OvsSFlowProbe describes a SFlow probe from OVS switch
type OvsSFlowProbesHandler ¶
type OvsSFlowProbesHandler struct { Ctx Context // contains filtered or unexported fields }
OvsSFlowProbesHandler describes a flow probe in running in the graph
func (*OvsSFlowProbesHandler) CaptureTypes ¶
func (o *OvsSFlowProbesHandler) CaptureTypes() []string
CaptureTypes supported
func (*OvsSFlowProbesHandler) Init ¶
func (o *OvsSFlowProbesHandler) Init(ctx Context, bundle *probe.Bundle) (FlowProbeHandler, error)
Init initializes a new OVS sFlow probe
func (*OvsSFlowProbesHandler) RegisterProbe ¶
func (o *OvsSFlowProbesHandler) RegisterProbe(n *graph.Node, capture *types.Capture, e ProbeEventHandler) (Probe, error)
RegisterProbe registers a probe on a graph node
func (*OvsSFlowProbesHandler) UnregisterProbe ¶
func (o *OvsSFlowProbesHandler) UnregisterProbe(n *graph.Node, e ProbeEventHandler, fp Probe) error
UnregisterProbe at the graph node
func (*OvsSFlowProbesHandler) UnregisterSFlowProbeFromBridge ¶
func (o *OvsSFlowProbesHandler) UnregisterSFlowProbeFromBridge(probe *OvsSFlowProbe) error
UnregisterSFlowProbeFromBridge unregisters a flow probe from the bridge selected by UUID
type PacketProbe ¶
type PacketProbe interface { Stats() (*CaptureStats, error) SetBPFFilter(bpf string) error PacketSource() *gopacket.PacketSource Close() }
PacketProbe describes a probe responsible for capturing packets
type PcapPacketProbe ¶
type PcapPacketProbe struct {
// contains filtered or unexported fields
}
PcapPacketProbe describes a libpcap based packet probe
func NewPcapPacketProbe ¶
func NewPcapPacketProbe(ifName string, headerSize int) (*PcapPacketProbe, error)
NewPcapPacketProbe returns a new libpcap capture probe
func (*PcapPacketProbe) PacketSource ¶
func (p *PcapPacketProbe) PacketSource() *gopacket.PacketSource
PacketSource returns the Gopacket packet source for the probe
func (*PcapPacketProbe) SetBPFFilter ¶
func (p *PcapPacketProbe) SetBPFFilter(bpf string) error
SetBPFFilter applies a BPF filter to the probe
func (*PcapPacketProbe) Stats ¶
func (p *PcapPacketProbe) Stats() (*CaptureStats, error)
Stats returns statistics about captured packets
type PcapSocketProbe ¶
type PcapSocketProbe struct { Ctx Context // contains filtered or unexported fields }
PcapSocketProbe describes a TCP packet listener that inject packets in a flowtable
type PcapSocketProbeHandler ¶
type PcapSocketProbeHandler struct { Ctx Context // contains filtered or unexported fields }
PcapSocketProbeHandler describes a Pcap socket probe in the graph
func (*PcapSocketProbeHandler) CaptureTypes ¶
func (p *PcapSocketProbeHandler) CaptureTypes() []string
CaptureTypes supported
func (*PcapSocketProbeHandler) Init ¶
func (p *PcapSocketProbeHandler) Init(ctx Context, bundle *probe.Bundle) (FlowProbeHandler, error)
Init initializes a new pcap socket probe
func (*PcapSocketProbeHandler) RegisterProbe ¶
func (p *PcapSocketProbeHandler) RegisterProbe(n *graph.Node, capture *types.Capture, e ProbeEventHandler) (Probe, error)
RegisterProbe registers a new probe in the graph
func (*PcapSocketProbeHandler) UnregisterProbe ¶
func (p *PcapSocketProbeHandler) UnregisterProbe(n *graph.Node, e ProbeEventHandler, fp Probe) error
UnregisterProbe a probe
type ProbeEventHandler ¶
type ProbeEventHandler interface { OnStarted(*CaptureMetadata) OnStopped() OnError(err error) }
ProbeEventHandler used by probes to notify state
type SFlowProbesHandler ¶
type SFlowProbesHandler struct { Ctx Context // contains filtered or unexported fields }
SFlowProbesHandler describes a sFlow probe in the graph
func (*SFlowProbesHandler) CaptureTypes ¶
func (d *SFlowProbesHandler) CaptureTypes() []string
CaptureTypes supported
func (*SFlowProbesHandler) Init ¶
func (d *SFlowProbesHandler) Init(ctx Context, bundle *probe.Bundle) (FlowProbeHandler, error)
Init initializes a new sFlow probe
func (*SFlowProbesHandler) RegisterProbe ¶
func (d *SFlowProbesHandler) RegisterProbe(n *graph.Node, capture *types.Capture, e ProbeEventHandler) (Probe, error)
RegisterProbe registers a probe in the graph
func (*SFlowProbesHandler) UnregisterProbe ¶
func (d *SFlowProbesHandler) UnregisterProbe(n *graph.Node, e ProbeEventHandler, p Probe) error
UnregisterProbe unregisters a probe from the graph