Documentation ¶
Index ¶
- func NewConnTrackOvsAppCtl(nodeConfig *config.NodeConfig, serviceCIDR *net.IPNet, ...) *connTrackOvsCtl
- func NewConnTrackSystem(nodeConfig *config.NodeConfig, serviceCIDR *net.IPNet, ...) *connTrackSystem
- func SetupConntrackParameters() error
- type ConnTrackDumper
- type ConnectionStore
- func (cs *ConnectionStore) DeleteConnectionByKey(connKey flowexporter.ConnectionKey) error
- func (cs *ConnectionStore) ForAllConnectionsDo(callback flowexporter.ConnectionMapCallBack) error
- func (cs *ConnectionStore) GetConnByKey(flowTuple flowexporter.ConnectionKey) (*flowexporter.Connection, bool)
- func (cs *ConnectionStore) Poll() (int, error)
- func (cs *ConnectionStore) Run(stopCh <-chan struct{}, pollDone chan struct{})
- type NetFilterConnTrack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConnTrackOvsAppCtl ¶
func NewConnTrackOvsAppCtl(nodeConfig *config.NodeConfig, serviceCIDR *net.IPNet, isAntreaProxyEnabled bool) *connTrackOvsCtl
func NewConnTrackSystem ¶
func NewConnTrackSystem(nodeConfig *config.NodeConfig, serviceCIDR *net.IPNet, isAntreaProxyEnabled bool) *connTrackSystem
func SetupConntrackParameters ¶ added in v0.11.0
func SetupConntrackParameters() error
Types ¶
type ConnTrackDumper ¶
type ConnTrackDumper interface { // DumpFlows returns a list of filtered connections and the number of total connections. DumpFlows(zoneFilter uint16) ([]*flowexporter.Connection, int, error) // GetMaxConnections returns the size of the connection tracking table. GetMaxConnections() (int, error) }
ConnTrackDumper is an interface that is used to dump connections from conntrack module. This supports dumping through netfilter socket (OVS kernel datapath) and ovs-appctl command (OVS userspace datapath). In future, support will be extended to Windows.
func InitializeConnTrackDumper ¶
func InitializeConnTrackDumper(nodeConfig *config.NodeConfig, serviceCIDR *net.IPNet, ovsDatapathType string, isAntreaProxyEnabled bool) ConnTrackDumper
InitializeConnTrackDumper initializes the ConnTrackDumper interface for different OS and datapath types.
type ConnectionStore ¶
type ConnectionStore struct {
// contains filtered or unexported fields
}
func NewConnectionStore ¶
func NewConnectionStore( connTrackDumper ConnTrackDumper, ifaceStore interfacestore.InterfaceStore, proxier proxy.Provider, npQuerier querier.AgentNetworkPolicyInfoQuerier, pollInterval time.Duration, ) *ConnectionStore
func (*ConnectionStore) DeleteConnectionByKey ¶
func (cs *ConnectionStore) DeleteConnectionByKey(connKey flowexporter.ConnectionKey) error
DeleteConnectionByKey deletes the connection in connection map given the connection key
func (*ConnectionStore) ForAllConnectionsDo ¶
func (cs *ConnectionStore) ForAllConnectionsDo(callback flowexporter.ConnectionMapCallBack) error
ForAllConnectionsDo execute the callback for each connection in connection map
func (*ConnectionStore) GetConnByKey ¶
func (cs *ConnectionStore) GetConnByKey(flowTuple flowexporter.ConnectionKey) (*flowexporter.Connection, bool)
GetConnByKey gets the connection in connection map given the connection key
func (*ConnectionStore) Poll ¶
func (cs *ConnectionStore) Poll() (int, error)
Poll calls into conntrackDumper interface to dump conntrack flows TODO: As optimization, only poll invalid/closed connections during every poll, and poll the established connections right before the export.
func (*ConnectionStore) Run ¶
func (cs *ConnectionStore) Run(stopCh <-chan struct{}, pollDone chan struct{})
Run enables the periodical polling of conntrack connections, at the given flowPollInterval
type NetFilterConnTrack ¶
type NetFilterConnTrack interface { Dial() error DumpFlowsInCtZone(zoneFilter uint16) ([]*flowexporter.Connection, error) }
NetFilterConnTrack interface helps for testing the code that contains the third party library functions ("github.com/ti-mo/conntrack")