portcache

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

portcache maintains the state about all current NodePortLocal port mappings for this Node and takes care of configuring the host accordingly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NodePortProtoFormat added in v1.7.0

func NodePortProtoFormat(nodeport int, protocol string) string

nodePortProtoFormat formats the nodeport, protocol to string port:protocol.

Types

type LocalPortOpener added in v1.7.0

type LocalPortOpener interface {
	OpenLocalPort(port int, protocol string) (io.Closer, error)
}

type NodePortData added in v1.7.0

type NodePortData struct {
	NodePort  int
	PodPort   int
	PodIP     string
	Protocols []ProtocolSocketData
}

func (*NodePortData) FindProtocol added in v1.7.0

func (d *NodePortData) FindProtocol(protocol string) *ProtocolSocketData

func (*NodePortData) ProtocolInUse added in v1.7.0

func (d *NodePortData) ProtocolInUse(protocol string) bool

type PortTable added in v1.7.0

type PortTable struct {
	NodePortTable    map[string]*NodePortData
	PodEndpointTable map[string]*NodePortData
	StartPort        int
	EndPort          int
	PortSearchStart  int
	PodPortRules     rules.PodPortRules
	LocalPortOpener  LocalPortOpener
	// contains filtered or unexported fields
}

func NewPortTable added in v1.7.0

func NewPortTable(start, end int) (*PortTable, error)

func (*PortTable) AddRule added in v1.7.0

func (pt *PortTable) AddRule(podIP string, podPort int, protocol string) (int, error)

func (*PortTable) CleanupAllEntries added in v1.7.0

func (pt *PortTable) CleanupAllEntries()

func (*PortTable) DeleteRule added in v1.7.0

func (pt *PortTable) DeleteRule(podIP string, podPort int, protocol string) error

func (*PortTable) DeleteRulesForPod added in v1.7.0

func (pt *PortTable) DeleteRulesForPod(podIP string) error

func (*PortTable) GetDataForPodIP added in v1.7.0

func (pt *PortTable) GetDataForPodIP(ip string) []NodePortData

func (*PortTable) GetEntry added in v1.7.0

func (pt *PortTable) GetEntry(ip string, port int, protocol string) *NodePortData

func (*PortTable) RestoreRules added in v1.7.0

func (pt *PortTable) RestoreRules(allNPLPorts []rules.PodNodePort, synced chan<- struct{}) error

RestoreRules should be called at Antrea Agent startup to restore a set of NPL rules.

func (*PortTable) RuleExists added in v1.7.0

func (pt *PortTable) RuleExists(podIP string, podPort int, protocol string) bool

type ProtocolSocketData added in v1.7.0

type ProtocolSocketData struct {
	Protocol string
	State    protocolSocketState
	// contains filtered or unexported fields
}

Directories

Path Synopsis
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.

Jump to

Keyboard shortcuts

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