failsafes

package
v0.0.0-...-21cfbab Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: Apache-2.0, Apache-2.0 Imports: 12 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
)

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,
}

Functions

func Map

func Map() maps.Map

func Value

func Value() []byte

Types

type Key

type Key struct {
	Port    uint16
	IPProto uint8
	Flags   uint8
	IP      string
	IPMask  int
}

func KeyFromSlice

func KeyFromSlice(data []byte) Key

func MakeKey

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

func (Key) String

func (k Key) String() string

func (Key) ToSlice

func (k Key) 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,
) *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