recorder

package
v1.15.0-pre.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 9 Imported by: 5

Documentation

Overview

Package recorder represents the BPF map used to (wildcard-)filter traffic that is subject to the pcap recorder. +groupName=maps

Index

Constants

View Source
const (
	// MapNameWcard4 represents IPv4 capture wildcard table.
	MapNameWcard4 = "cilium_capture4_rules"
	// MapNameWcard6 represents IPv6 capture wildcard table.
	MapNameWcard6 = "cilium_capture6_rules"
	// MapSize is the default size of the v4 and v6 maps
	MapSize = 16384
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CaptureMap

type CaptureMap interface {
	Open() error
	Close() error
	Path() (string, error)
	DumpEntries() (string, error)
	DumpWithCallback(bpf.DumpCallback) error
}

type CaptureRule

type CaptureRule struct {
	RuleId   uint16 `align:"rule_id"`
	Reserved uint16 `align:"reserved"`
	CapLen   uint32 `align:"cap_len"`
}

type CaptureRule4

type CaptureRule4 CaptureRule

func (*CaptureRule4) Dump

func (v *CaptureRule4) Dump(sb *strings.Builder)

func (*CaptureRule4) New

func (v *CaptureRule4) New() bpf.MapValue

func (*CaptureRule4) String

func (v *CaptureRule4) String() string

type CaptureRule6

type CaptureRule6 CaptureRule

func (*CaptureRule6) Dump

func (v *CaptureRule6) Dump(sb *strings.Builder)

func (*CaptureRule6) New

func (v *CaptureRule6) New() bpf.MapValue

func (*CaptureRule6) String

func (v *CaptureRule6) String() string

type CaptureWcard4

type CaptureWcard4 struct {
	SrcAddr  types.IPv4 `align:"saddr"`
	DestAddr types.IPv4 `align:"daddr"`
	SrcPort  uint16     `align:"sport"`
	DestPort uint16     `align:"dport"`
	NextHdr  uint8      `align:"nexthdr"`
	SrcMask  uint8      `align:"smask"`
	DestMask uint8      `align:"dmask"`
	Flags    uint8      `align:"flags"`
}

func (*CaptureWcard4) Dump

func (k *CaptureWcard4) Dump(sb *strings.Builder)

func (*CaptureWcard4) Map

func (k *CaptureWcard4) Map() *bpf.Map

func (*CaptureWcard4) New

func (k *CaptureWcard4) New() bpf.MapKey

func (*CaptureWcard4) String

func (k *CaptureWcard4) String() string

func (*CaptureWcard4) ToHost

func (k *CaptureWcard4) ToHost() RecorderKey

type CaptureWcard6

type CaptureWcard6 struct {
	SrcAddr  types.IPv6 `align:"saddr"`
	DestAddr types.IPv6 `align:"daddr"`
	SrcPort  uint16     `align:"sport"`
	DestPort uint16     `align:"dport"`
	NextHdr  uint8      `align:"nexthdr"`
	SrcMask  uint8      `align:"smask"`
	DestMask uint8      `align:"dmask"`
	Flags    uint8      `align:"flags"`
}

func (*CaptureWcard6) Dump

func (k *CaptureWcard6) Dump(sb *strings.Builder)

func (*CaptureWcard6) Map

func (k *CaptureWcard6) Map() *bpf.Map

func (*CaptureWcard6) New

func (k *CaptureWcard6) New() bpf.MapKey

func (*CaptureWcard6) String

func (k *CaptureWcard6) String() string

func (*CaptureWcard6) ToHost

func (k *CaptureWcard6) ToHost() RecorderKey

type Map

type Map struct {
	bpf.Map
	// contains filtered or unexported fields
}

func CaptureMap4

func CaptureMap4() *Map

func CaptureMap6

func CaptureMap6() *Map

func (*Map) DumpEntries

func (m *Map) DumpEntries() (string, error)

type MapRecord

type MapRecord struct {
	Key   RecorderKey
	Value RecorderEntry
}

type RecorderEntry

type RecorderEntry interface {
	bpf.MapValue
	Dump(sb *strings.Builder)
}

type RecorderKey

type RecorderKey interface {
	bpf.MapKey
	ToHost() RecorderKey
	Dump(sb *strings.Builder)
	Map() *bpf.Map
}

Jump to

Keyboard shortcuts

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