failsafes

package
v0.0.0-...-d216c5d Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PrefixLen (4) + Port (2) + Proto (1) + Flags (1) + IP (4)
	KeySize   = 12
	ValueSize = 4

	FlagOutbound = 1

	// sizeof(port) + sizeof(proto) + sizeof(flags)
	ZeroCIDRPrefixLen = 32
)
View Source
const (
	// PrefixLen (4) + Port (2) + Proto (1) + Flags (1) + IP (16)
	KeyV6Size   = 24
	ValueV6Size = 4
)

Variables

View Source
var MapParams = maps.MapParameters{
	Type:       "lpm_trie",
	KeySize:    KeySize,
	ValueSize:  ValueSize,
	MaxEntries: 65536,
	Name:       "cali_v4_fsafes",
	Flags:      unix.BPF_F_NO_PREALLOC,
	Version:    2,
}
View Source
var MapV6Params = maps.MapParameters{
	Type:       "lpm_trie",
	KeySize:    KeyV6Size,
	ValueSize:  ValueV6Size,
	MaxEntries: 65536,
	Name:       "cali_v6_fsafes",
	Flags:      unix.BPF_F_NO_PREALLOC,
	Version:    2,
}

Functions

func Map

func Map() maps.Map

func MapV6

func MapV6() maps.Map

func Value

func Value() []byte

func ValueV6

func ValueV6() []byte

Types

type Key

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

func (Key) String

func (k Key) String() string

func (Key) ToSlice

func (k Key) ToSlice() []byte

type KeyInterface

type KeyInterface interface {
	String() string
	ToSlice() []byte
}

func KeyFromSlice

func KeyFromSlice(data []byte) KeyInterface

func KeyV6FromSlice

func KeyV6FromSlice(data []byte) KeyInterface

func MakeKey

func MakeKey(ipProto uint8, port uint16, outbound bool, ip string, mask int) KeyInterface

func MakeKeyV6

func MakeKeyV6(ipProto uint8, port uint16, outbound bool, ip string, mask int) KeyInterface

type KeyV6

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

func (KeyV6) String

func (k KeyV6) String() string

func (KeyV6) ToSlice

func (k KeyV6) ToSlice() []byte

type Manager

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

func NewManager

func NewManager(
	failsafesMap maps.Map,
	failsafesIn, failsafesOut []config.ProtoPort,
	opReporter logutils.OpRecorder,
	ipFamily proto.IPVersion,
	keyFromSlice func([]byte) KeyInterface,
	makeKey func(ipProto uint8, port uint16, outbound bool, ip string, mask int) KeyInterface,
) *Manager

func (*Manager) CompleteDeferredWork

func (m *Manager) CompleteDeferredWork() error

func (*Manager) OnUpdate

func (m *Manager) OnUpdate(_ interface{})

func (*Manager) ResyncFailsafes

func (m *Manager) ResyncFailsafes() error

Jump to

Keyboard shortcuts

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