Documentation ¶
Index ¶
- Constants
- Variables
- func CapturesMetadataDecoder(raw json.RawMessage) (getter.Getter, error)
- func CheckProbeCapabilities(probeType string, capability ProbeCapability) bool
- func IsCaptureAllowed(nodeType string) bool
- func NormalizeBPFFilter(capture *types.Capture) string
- func ProbeTypeForNode(nodeType string, captureType string) (string, error)
- func TableOptsFromCapture(capture *types.Capture) flow.TableOpts
- type CaptureMetadata
- func (obj *CaptureMetadata) GetField(key string) (interface{}, error)
- func (obj *CaptureMetadata) GetFieldBool(key string) (bool, error)
- func (obj *CaptureMetadata) GetFieldInt64(key string) (int64, error)
- func (obj *CaptureMetadata) GetFieldKeys() []string
- func (obj *CaptureMetadata) GetFieldString(key string) (string, error)
- func (v CaptureMetadata) MarshalEasyJSON(w *jwriter.Writer)
- func (v CaptureMetadata) MarshalJSON() ([]byte, error)
- func (obj *CaptureMetadata) MatchBool(key string, predicate getter.BoolPredicate) bool
- func (obj *CaptureMetadata) MatchInt64(key string, predicate getter.Int64Predicate) bool
- func (obj *CaptureMetadata) MatchString(key string, predicate getter.StringPredicate) bool
- func (v *CaptureMetadata) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *CaptureMetadata) UnmarshalJSON(data []byte) error
- type CaptureStats
- func (obj *CaptureStats) GetField(key string) (interface{}, error)
- func (obj *CaptureStats) GetFieldBool(key string) (bool, error)
- func (obj *CaptureStats) GetFieldInt64(key string) (int64, error)
- func (obj *CaptureStats) GetFieldKeys() []string
- func (obj *CaptureStats) GetFieldString(key string) (string, error)
- func (v CaptureStats) MarshalEasyJSON(w *jwriter.Writer)
- func (v CaptureStats) MarshalJSON() ([]byte, error)
- func (obj *CaptureStats) MatchBool(key string, predicate getter.BoolPredicate) bool
- func (obj *CaptureStats) MatchInt64(key string, predicate getter.Int64Predicate) bool
- func (obj *CaptureStats) MatchString(key string, predicate getter.StringPredicate) bool
- func (v *CaptureStats) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *CaptureStats) UnmarshalJSON(data []byte) error
- type CaptureType
- type Captures
- func (obj *Captures) GetField(key string) (interface{}, error)
- func (obj *Captures) GetFieldBool(key string) (bool, error)
- func (obj *Captures) GetFieldInt64(key string) (int64, error)
- func (obj *Captures) GetFieldKeys() []string
- func (obj *Captures) GetFieldString(key string) (string, error)
- func (v Captures) MarshalEasyJSON(w *jwriter.Writer)
- func (v Captures) MarshalJSON() ([]byte, error)
- func (obj *Captures) MatchBool(key string, predicate getter.BoolPredicate) bool
- func (obj *Captures) MatchInt64(key string, predicate getter.Int64Predicate) bool
- func (obj *Captures) MatchString(key string, predicate getter.StringPredicate) bool
- func (v *Captures) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *Captures) UnmarshalJSON(data []byte) error
- type Context
- type FlowProbeHandler
- type Probe
- type ProbeCapability
- type ProbeEventHandler
Constants ¶
const ( // BPFCapability the probe is able to handle bpf filters BPFCapability ProbeCapability = 1 << 0 // RawPacketsCapability the probe can capture raw packets RawPacketsCapability = 1 << 1 // ExtraTCPMetricCapability the probe can report TCP metrics ExtraTCPMetricCapability = 1 << 2 // MultipleOnSameNodeCapability is defined on probes that support multiple captures of the same type on one node MultipleOnSameNodeCapability = 1 << 3 )
Variables ¶
var ( // ProbeTypes returns a list of all the capture probes ProbeTypes = []string{"ovssflow", "pcapsocket", "ovsmirror", "dpdk", "afpacket", "pcap", "ebpf", "sflow", "ovsnetflow"} // CaptureTypes contains all registered capture type and associated probes CaptureTypes = map[string]CaptureType{} // ProbeCapabilities defines capability per probes ProbeCapabilities = map[string]ProbeCapability{} )
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 ¶ added in v0.24.0
func CapturesMetadataDecoder(raw json.RawMessage) (getter.Getter, error)
CapturesMetadataDecoder implements a json message raw decoder
func CheckProbeCapabilities ¶ added in v0.27.0
func CheckProbeCapabilities(probeType string, capability ProbeCapability) bool
CheckProbeCapabilities checks that a probe supports given capabilities
func IsCaptureAllowed ¶ added in v0.4.0
IsCaptureAllowed returns true if the node capture type exist
func NormalizeBPFFilter ¶ added in v0.24.0
NormalizeBPFFilter returns a normalized BPF filter in order to exclude traffic generated by skydive itself
func ProbeTypeForNode ¶ added in v0.27.0
ProbeTypeForNode returns the appropriate probe type for the given node type and capture type.
Types ¶
type CaptureMetadata ¶ added in v0.24.0
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
func (*CaptureMetadata) GetField ¶ added in v0.26.0
func (obj *CaptureMetadata) GetField(key string) (interface{}, error)
func (*CaptureMetadata) GetFieldBool ¶ added in v0.26.0
func (obj *CaptureMetadata) GetFieldBool(key string) (bool, error)
func (*CaptureMetadata) GetFieldInt64 ¶ added in v0.26.0
func (obj *CaptureMetadata) GetFieldInt64(key string) (int64, error)
func (*CaptureMetadata) GetFieldKeys ¶ added in v0.26.0
func (obj *CaptureMetadata) GetFieldKeys() []string
func (*CaptureMetadata) GetFieldString ¶ added in v0.26.0
func (obj *CaptureMetadata) GetFieldString(key string) (string, error)
func (CaptureMetadata) MarshalEasyJSON ¶ added in v0.26.0
func (v CaptureMetadata) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CaptureMetadata) MarshalJSON ¶ added in v0.26.0
func (v CaptureMetadata) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CaptureMetadata) MatchBool ¶ added in v0.26.0
func (obj *CaptureMetadata) MatchBool(key string, predicate getter.BoolPredicate) bool
func (*CaptureMetadata) MatchInt64 ¶ added in v0.26.0
func (obj *CaptureMetadata) MatchInt64(key string, predicate getter.Int64Predicate) bool
func (*CaptureMetadata) MatchString ¶ added in v0.26.0
func (obj *CaptureMetadata) MatchString(key string, predicate getter.StringPredicate) bool
func (*CaptureMetadata) UnmarshalEasyJSON ¶ added in v0.26.0
func (v *CaptureMetadata) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CaptureMetadata) UnmarshalJSON ¶ added in v0.26.0
func (v *CaptureMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CaptureStats ¶ added in v0.24.0
CaptureStats describes the statistics of a running capture easyjson:json gendecoder
func (*CaptureStats) GetField ¶ added in v0.26.0
func (obj *CaptureStats) GetField(key string) (interface{}, error)
func (*CaptureStats) GetFieldBool ¶ added in v0.26.0
func (obj *CaptureStats) GetFieldBool(key string) (bool, error)
func (*CaptureStats) GetFieldInt64 ¶ added in v0.26.0
func (obj *CaptureStats) GetFieldInt64(key string) (int64, error)
func (*CaptureStats) GetFieldKeys ¶ added in v0.26.0
func (obj *CaptureStats) GetFieldKeys() []string
func (*CaptureStats) GetFieldString ¶ added in v0.26.0
func (obj *CaptureStats) GetFieldString(key string) (string, error)
func (CaptureStats) MarshalEasyJSON ¶ added in v0.26.0
func (v CaptureStats) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CaptureStats) MarshalJSON ¶ added in v0.26.0
func (v CaptureStats) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CaptureStats) MatchBool ¶ added in v0.26.0
func (obj *CaptureStats) MatchBool(key string, predicate getter.BoolPredicate) bool
func (*CaptureStats) MatchInt64 ¶ added in v0.26.0
func (obj *CaptureStats) MatchInt64(key string, predicate getter.Int64Predicate) bool
func (*CaptureStats) MatchString ¶ added in v0.26.0
func (obj *CaptureStats) MatchString(key string, predicate getter.StringPredicate) bool
func (*CaptureStats) UnmarshalEasyJSON ¶ added in v0.26.0
func (v *CaptureStats) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CaptureStats) UnmarshalJSON ¶ added in v0.26.0
func (v *CaptureStats) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CaptureType ¶ added in v0.27.0
CaptureType describes a list of allowed and default captures probes
type Captures ¶ added in v0.24.0
type Captures []*CaptureMetadata
Captures holds the captures metadata easyjson:json gendecoder
func (*Captures) GetFieldBool ¶ added in v0.26.0
func (*Captures) GetFieldInt64 ¶ added in v0.26.0
func (*Captures) GetFieldKeys ¶ added in v0.26.0
func (*Captures) GetFieldString ¶ added in v0.26.0
func (Captures) MarshalEasyJSON ¶ added in v0.26.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (Captures) MarshalJSON ¶ added in v0.26.0
MarshalJSON supports json.Marshaler interface
func (*Captures) MatchBool ¶ added in v0.26.0
func (obj *Captures) MatchBool(key string, predicate getter.BoolPredicate) bool
func (*Captures) MatchInt64 ¶ added in v0.26.0
func (obj *Captures) MatchInt64(key string, predicate getter.Int64Predicate) bool
func (*Captures) MatchString ¶ added in v0.26.0
func (obj *Captures) MatchString(key string, predicate getter.StringPredicate) bool
func (*Captures) UnmarshalEasyJSON ¶ added in v0.26.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Captures) UnmarshalJSON ¶ added in v0.26.0
UnmarshalJSON supports json.Unmarshaler interface
type Context ¶ added in v0.25.0
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 FlowProbeHandler ¶ added in v0.24.0
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 }
FlowProbeHandler defines flow probe mechanism
type ProbeCapability ¶ added in v0.27.0
type ProbeCapability int
ProbeCapability defines probe capability
type ProbeEventHandler ¶ added in v0.24.0
type ProbeEventHandler interface { OnStarted(*CaptureMetadata) OnStopped() OnError(err error) }
ProbeEventHandler used by probes to notify state