counters

package
v1.11.0-cni-plu...-aa3fb74 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0, Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TotalPackets = iota
	AcceptedByFailsafe
	AcceptedByPolicy
	AcceptedByAnotherProgram
	DroppedByPolicy
	DroppedShortPacket
	DroppedFailedCSUM
	DroppedIPOptions
	DroppedIPMalformed
	DroppedFailedEncap
	DroppedFailedDecap
	DroppedUnauthSource
	DroppedUnknownRoute
	DroppedBlackholeRoute
	SourceCollisionHit
	SourceCollisionResolutionFailed
	ConntrackCreateFailed
)

The following values are used as index to counters map, and should be kept in sync with constants defined in bpf-gpl/reasons.h.

View Source
const (
	MaxCounterNumber int = 17
)
View Source
const PolicyMapKeySize = 8
View Source
const PolicyMapValueSize = 8

Variables

View Source
var MapParameters = maps.MapParameters{
	Type:       "percpu_hash",
	KeySize:    counterMapKeySize,
	ValueSize:  counterMapValueSize * MaxCounterNumber,
	MaxEntries: 20000,
	Name:       "cali_counters",
	Version:    3,
}
View Source
var PolicyMapParameters = maps.MapParameters{
	Type:       "percpu_hash",
	KeySize:    PolicyMapKeySize,
	ValueSize:  PolicyMapValueSize,
	MaxEntries: 10000,
	Name:       "cali_rule_ctrs",
	Version:    2,
}

Functions

func EnsureExists

func EnsureExists(m maps.Map, ifindex int, hook hook.Hook) error

func Flush

func Flush(m maps.Map, ifindex int, hook hook.Hook) error

func Map

func Map() maps.Map

func PolicyMap

func PolicyMap() maps.Map

func PolicyMapMemIter

func PolicyMapMemIter(m PolicyMapMem) func(k, v []byte)

PolicyMapMemIter returns maps.MapIter that loads the provided PolicyMapMem

func Read

func Read(m maps.Map, ifindex int, hook hook.Hook) ([]uint64, error)

Types

type DescList

type DescList []Description

func Descriptions

func Descriptions() DescList

func (DescList) Len

func (d DescList) Len() int

func (DescList) Less

func (d DescList) Less(i, j int) bool

func (DescList) Swap

func (d DescList) Swap(i, j int)

type Description

type Description struct {
	Category string
	Caption  string
	Counter  int
}

type Key

type Key [8]byte

func NewKey

func NewKey(ifindex int, hook hook.Hook) Key

func (Key) AsBytes

func (k Key) AsBytes() []byte

func (Key) IfIndex

func (k Key) IfIndex() int

type PolicyMapMem

type PolicyMapMem map[uint64]uint64

func LoadPolicyMap

func LoadPolicyMap(m maps.Map) (PolicyMapMem, error)

Jump to

Keyboard shortcuts

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