probes

package
v0.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 15 Imported by: 10

Documentation

Index

Constants

View Source
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

View Source
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{}
)
View Source
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

func IsCaptureAllowed(nodeType string) bool

IsCaptureAllowed returns true if the node capture type exist

func NormalizeBPFFilter added in v0.24.0

func NormalizeBPFFilter(capture *types.Capture) string

NormalizeBPFFilter returns a normalized BPF filter in order to exclude traffic generated by skydive itself

func ProbeTypeForNode added in v0.27.0

func ProbeTypeForNode(nodeType string, captureType string) (string, error)

ProbeTypeForNode returns the appropriate probe type for the given node type and capture type.

func TableOptsFromCapture added in v0.26.0

func TableOptsFromCapture(capture *types.Capture) flow.TableOpts

TableOptsFromCapture is a helper that returns the flow options for a capture

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

type CaptureStats struct {
	PacketsReceived  int64
	PacketsDropped   int64
	PacketsIfDropped int64
}

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

type CaptureType struct {
	Allowed []string
	Default string
}

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) GetField added in v0.26.0

func (obj *Captures) GetField(key string) (interface{}, error)

func (*Captures) GetFieldBool added in v0.26.0

func (obj *Captures) GetFieldBool(key string) (bool, error)

func (*Captures) GetFieldInt64 added in v0.26.0

func (obj *Captures) GetFieldInt64(key string) (int64, error)

func (*Captures) GetFieldKeys added in v0.26.0

func (obj *Captures) GetFieldKeys() []string

func (*Captures) GetFieldString added in v0.26.0

func (obj *Captures) GetFieldString(key string) (string, error)

func (Captures) MarshalEasyJSON added in v0.26.0

func (v Captures) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Captures) MarshalJSON added in v0.26.0

func (v Captures) MarshalJSON() ([]byte, error)

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

func (v *Captures) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Captures) UnmarshalJSON added in v0.26.0

func (v *Captures) UnmarshalJSON(data []byte) error

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 Probe

type Probe = ondemand.Task

Probe defines an active flow probe

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL