recorder

package
v1.13.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Overview

Package recorder provides an agent API for managing datapath pcap recorders.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecorderMaskToModel

func RecorderMaskToModel(rm *RecMask) *models.RecorderMaskSpec

func RecorderToModel

func RecorderToModel(ri *RecInfo) (*models.RecorderSpec, error)

Types

type ID

type ID uint16

type RecInfo

type RecInfo struct {
	ID      ID
	CapLen  uint16
	Filters []RecorderTuple
}

+k8s:deepcopy-gen=true

func ModelToRecorder

func ModelToRecorder(mo *models.RecorderSpec) (*RecInfo, error)

func (*RecInfo) DeepCopy

func (in *RecInfo) DeepCopy() *RecInfo

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecInfo.

func (*RecInfo) DeepCopyInto

func (in *RecInfo) DeepCopyInto(out *RecInfo)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RecMask

type RecMask struct {
	// contains filtered or unexported fields
}

+k8s:deepcopy-gen=true

func (*RecMask) DeepCopy

func (in *RecMask) DeepCopy() *RecMask

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecMask.

func (*RecMask) DeepCopyInto

func (in *RecMask) DeepCopyInto(out *RecMask)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Recorder

type Recorder struct {
	lock.RWMutex
	// contains filtered or unexported fields
}

func NewRecorder

func NewRecorder(ctx context.Context, owner datapath.BaseProgramOwner) (*Recorder, error)

NewRecorder initializes the main recorder infrastructure once upon agent bootstrap for tracking tuple insertions and masks that need to be pushed down into the BPF datapath. Given we currently do not support restore functionality, it also flushes prior existing recorder objects from the BPF maps.

func (*Recorder) DeleteRecorder

func (r *Recorder) DeleteRecorder(id ID) (bool, error)

DeleteRecorder will delete an existing recorder object based on its unique identifier. If needed, it will also update datapath maps to purge the recorder filters from the BPF maps as well as triggering a reinitialization of the XDP datapath if the mask set has changed.

func (*Recorder) RetrieveRecorder

func (r *Recorder) RetrieveRecorder(id ID) (*RecInfo, error)

RetrieveRecorder will return an existing recorder object based on its unique identifier. The returned object is a deep copy of the original one tracked by the recorder infrastructure, so it can be freely changed without affecting the original recorder object.

func (*Recorder) RetrieveRecorderMaskSet

func (r *Recorder) RetrieveRecorderMaskSet() []*RecMask

RetrieveRecorderMaskSet will return a list of all existing recorder masks.

func (*Recorder) RetrieveRecorderSet

func (r *Recorder) RetrieveRecorderSet() []*RecInfo

RetrieveRecorderSet will return a list of all existing recorder objects.

func (*Recorder) UpsertRecorder

func (r *Recorder) UpsertRecorder(recInfoNew *RecInfo) (bool, error)

UpsertRecorder will create a new or update an existing recorder object based on its unique identifier. If needed, it will also update datapath maps to insert new or remove obsolete recorder filters from the BPF maps as well as triggering a reinitialization of the XDP datapath if the mask set has changed.

type RecorderMask

type RecorderMask struct {
	// contains filtered or unexported fields
}

+k8s:deepcopy-gen=true

func (*RecorderMask) DeepCopy

func (in *RecorderMask) DeepCopy() *RecorderMask

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecorderMask.

func (*RecorderMask) DeepCopyInto

func (in *RecorderMask) DeepCopyInto(out *RecorderMask)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RecorderTuple

type RecorderTuple struct {
	SrcPrefix cidr.CIDR
	SrcPort   uint16
	DstPrefix cidr.CIDR
	DstPort   uint16
	Proto     u8proto.U8proto
}

+k8s:deepcopy-gen=true

func (*RecorderTuple) DeepCopy

func (in *RecorderTuple) DeepCopy() *RecorderTuple

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecorderTuple.

func (*RecorderTuple) DeepCopyInto

func (in *RecorderTuple) DeepCopyInto(out *RecorderTuple)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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