Documentation ¶
Index ¶
- Constants
- type BufferedCloser
- type CmdIface
- type IPFamily
- type IPSetMember
- type IPSetMetadata
- type IPSetType
- type IPSets
- func (s *IPSets) AddMembers(setID string, newMembers []string)
- func (s *IPSets) AddOrReplaceIPSet(setMetadata IPSetMetadata, members []string)
- func (s *IPSets) ApplyDeletions()
- func (s *IPSets) ApplyUpdates()
- func (s *IPSets) GetIPFamily() IPFamily
- func (s *IPSets) GetMembers(setID string) (set.Set[string], error)
- func (s *IPSets) GetTypeOf(setID string) (IPSetType, error)
- func (s *IPSets) QueueResync()
- func (s *IPSets) RemoveIPSet(setID string)
- func (s *IPSets) RemoveMembers(setID string, removedMembers []string)
- func (s *IPSets) SetFilter(ipSetNames set.Set[string])
- type IPVersionConfig
- type V4IPPort
- type V6IPPort
- type WriteCloserFlusher
- type WriteFlusher
Constants ¶
const ( IPFamilyV4 = IPFamily("inet") IPFamilyV6 = IPFamily("inet6") )
const MaxIPSetNameLength = 31
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferedCloser ¶
type BufferedCloser struct { BufWriter WriteFlusher Closer io.Closer }
func (*BufferedCloser) Close ¶
func (b *BufferedCloser) Close() error
func (*BufferedCloser) Flush ¶
func (b *BufferedCloser) Flush() error
type IPFamily ¶
type IPFamily string
IPSetType constants for the names that the ipset command uses for the IP versions.
type IPSetMember ¶
type IPSetMember interface {
String() string
}
type IPSetMetadata ¶
IPSetMetadata contains the metadata for a particular IP set, such as its name, type and size.
type IPSetType ¶
type IPSetType string
IPSetType constants for the different kinds of IP set.
func (IPSetType) CanonicaliseMember ¶
func (t IPSetType) CanonicaliseMember(member string) IPSetMember
CanonicaliseMember converts the string representation of an IP set member to a canonical object of some kind. The object is required to by hashable.
func (IPSetType) IsMemberIPV6 ¶
type IPSets ¶
type IPSets struct { IPVersionConfig *IPVersionConfig // contains filtered or unexported fields }
IPSets manages a whole "plane" of IP sets, i.e. all the IPv4 sets, or all the IPv6 IP sets.
func NewIPSets ¶
func NewIPSets(ipVersionConfig *IPVersionConfig, recorder logutils.OpRecorder) *IPSets
func NewIPSetsWithShims ¶
func NewIPSetsWithShims( ipVersionConfig *IPVersionConfig, recorder logutils.OpRecorder, cmdFactory cmdFactory, sleep func(time.Duration), ) *IPSets
NewIPSetsWithShims is an internal test constructor.
func (*IPSets) AddMembers ¶
AddMembers adds the given members to the IP set. Filters out members that are of the incorrect IP version.
func (*IPSets) AddOrReplaceIPSet ¶
func (s *IPSets) AddOrReplaceIPSet(setMetadata IPSetMetadata, members []string)
AddOrReplaceIPSet queues up the creation (or replacement) of an IP set. After the next call to ApplyUpdates(), the IP sets will be replaced with the new contents and the set's metadata will be updated as appropriate.
func (*IPSets) ApplyDeletions ¶
func (s *IPSets) ApplyDeletions()
ApplyDeletions tries to delete any IP sets that are no longer needed. Failures are ignored, deletions will be retried the next time we do a resync.
func (*IPSets) ApplyUpdates ¶
func (s *IPSets) ApplyUpdates()
func (*IPSets) GetIPFamily ¶
func (*IPSets) QueueResync ¶
func (s *IPSets) QueueResync()
QueueResync forces a resync with the dataplane on the next ApplyUpdates() call.
func (*IPSets) RemoveIPSet ¶
RemoveIPSet queues up the removal of an IP set, it need not be empty. The IP sets will be removed on the next call to ApplyDeletions().
func (*IPSets) RemoveMembers ¶
RemoveMembers queues up removal of the given members from an IP set. Members of the wrong IP version are ignored.
type IPVersionConfig ¶
type IPVersionConfig struct { Family IPFamily // contains filtered or unexported fields }
IPVersionConfig wraps up the metadata for a particular IP version. It can be used by this and other components to calculate IP set names from IP set IDs, for example.
func NewIPVersionConfig ¶
func NewIPVersionConfig( family IPFamily, namePrefix string, allHistoricPrefixes []string, extraUnversionedIPSets []string, ) *IPVersionConfig
func (IPVersionConfig) IsTempIPSetName ¶
func (c IPVersionConfig) IsTempIPSetName(setName string) bool
func (IPVersionConfig) NameForMainIPSet ¶
func (c IPVersionConfig) NameForMainIPSet(setID string) string
NameForMainIPSet converts the given IP set ID (example: "qMt7iLlGDhvLnCjM0l9nzxbabcd"), to a name for use in the dataplane. The return value will have the configured prefix and is guaranteed to be short enough to use as an ipset name (example: "cali60s:qMt7iLlGDhvLnCjM0l9nzxb").
func (IPVersionConfig) NameForTempIPSet ¶
func (c IPVersionConfig) NameForTempIPSet(n uint) string
func (IPVersionConfig) OwnsIPSet ¶
func (c IPVersionConfig) OwnsIPSet(setName string) bool
OwnsIPSet returns true if the given IP set name appears to belong to Felix. i.e. whether it starts with an expected prefix.
type V4IPPort ¶
type V4IPPort struct { IP ip.V4Addr Port uint16 Protocol labelindex.IPSetPortProtocol }
type V6IPPort ¶
type V6IPPort struct { IP ip.V6Addr Port uint16 Protocol labelindex.IPSetPortProtocol }
type WriteCloserFlusher ¶
type WriteCloserFlusher interface { io.WriteCloser Flush() error }