ipsets

package
v1.11.0-cni-plu...-7acfd45 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPSetsDataplane

type IPSetsDataplane interface {
	AddOrReplaceIPSet(setMetadata ipsets.IPSetMetadata, members []string)
	AddMembers(setID string, newMembers []string)
	RemoveMembers(setID string, removedMembers []string)
	RemoveIPSet(setID string)
	GetIPFamily() ipsets.IPFamily
	GetTypeOf(setID string) (ipsets.IPSetType, error)
	GetDesiredMembers(setID string) (set.Set[string], error)
	QueueResync()
	ApplyUpdates()
	ApplyDeletions() (reschedule bool)
	SetFilter(neededIPSets set.Set[string])
}

type IPSetsManager

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

Except for domain IP sets, IPSetsManager simply passes through IP set updates from the datastore to the ipsets.IPSets dataplane layer. For domain IP sets - which hereafter we'll just call "domain sets" - IPSetsManager handles the resolution from domain names to expiring IPs.

func NewIPSetsManager

func NewIPSetsManager(name string, ipsets_ IPSetsDataplane, maxIPSetSize int) *IPSetsManager

func (*IPSetsManager) AddDataplane

func (m *IPSetsManager) AddDataplane(dp IPSetsDataplane)

func (*IPSetsManager) CompleteDeferredWork

func (m *IPSetsManager) CompleteDeferredWork() error

func (*IPSetsManager) GetIPSetMembers

func (m *IPSetsManager) GetIPSetMembers(setID string) (members set.Set[string], err error)

func (*IPSetsManager) GetIPSetType

func (m *IPSetsManager) GetIPSetType(setID string) (typ ipsets.IPSetType, err error)

func (*IPSetsManager) OnUpdate

func (m *IPSetsManager) OnUpdate(msg interface{})

type MockIPSets

type MockIPSets struct {
	Members            map[string]set.Set[string]
	Metadata           map[string]ipsets.IPSetMetadata
	AddOrReplaceCalled bool
}

func NewMockIPSets

func NewMockIPSets() *MockIPSets

func (*MockIPSets) AddMembers

func (s *MockIPSets) AddMembers(setID string, newMembers []string)

func (*MockIPSets) AddOrReplaceIPSet

func (s *MockIPSets) AddOrReplaceIPSet(setMetadata ipsets.IPSetMetadata, newMembers []string)

func (*MockIPSets) ApplyDeletions

func (s *MockIPSets) ApplyDeletions() bool

func (*MockIPSets) ApplyUpdates

func (s *MockIPSets) ApplyUpdates()

func (*MockIPSets) GetDesiredMembers

func (s *MockIPSets) GetDesiredMembers(setID string) (set.Set[string], error)

func (*MockIPSets) GetIPFamily

func (s *MockIPSets) GetIPFamily() ipsets.IPFamily

func (*MockIPSets) GetTypeOf

func (s *MockIPSets) GetTypeOf(setID string) (ipsets.IPSetType, error)

func (*MockIPSets) QueueResync

func (s *MockIPSets) QueueResync()

func (*MockIPSets) RemoveIPSet

func (s *MockIPSets) RemoveIPSet(setID string)

func (*MockIPSets) RemoveMembers

func (s *MockIPSets) RemoveMembers(setID string, removedMembers []string)

func (*MockIPSets) SetFilter

func (s *MockIPSets) SetFilter(ipSetNames set.Set[string])

Jump to

Keyboard shortcuts

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