conntracker

package
v0.0.0-...-e368295 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Enabled:                      true,
	ProcRoot:                     "/proc",
	ConntrackInitTimeout:         30 * time.Second,
	ConntrackRateLimit:           500,
	ConntrackMaxStateSize:        130000,
	EnableConntrackAllNamespaces: true,
}

Functions

func IPToUInt32

func IPToUInt32(ip net.IP) uint32

func StringToUint32

func StringToUint32(ip string) uint32

Types

type Config

type Config struct {
	Enabled                      bool
	ProcRoot                     string
	ConntrackInitTimeout         time.Duration
	ConntrackRateLimit           int
	ConntrackMaxStateSize        int
	EnableConntrackAllNamespaces bool
}

type Conntracker

type Conntracker interface {
	GetDNATTupleWithString(srcIP string, dstIP string, srcPort uint16, dstPort uint16, isUdp uint32) *IPTranslation
	GetDNATTuple(srcIP uint32, dstIP uint32, srcPort uint16, dstPort uint16, isUdp uint32) *IPTranslation
	GetStats() map[string]int64
}

func NewConntracker

func NewConntracker(config *Config) (Conntracker, error)

type IPTranslation

type IPTranslation struct {
	ReplSrcIP   net.IP
	ReplDstIP   net.IP
	ReplSrcPort uint16
	ReplDstPort uint16
}

type NetlinkConntracker

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

func (*NetlinkConntracker) GetDNATTuple

func (ctr *NetlinkConntracker) GetDNATTuple(srcIP uint32, dstIP uint32, srcPort uint16, dstPort uint16, isUdp uint32) *IPTranslation

func (*NetlinkConntracker) GetDNATTupleWithString

func (ctr *NetlinkConntracker) GetDNATTupleWithString(srcIP string, dstIP string, srcPort uint16, dstPort uint16, isUdp uint32) *IPTranslation

func (*NetlinkConntracker) GetStats

func (ctr *NetlinkConntracker) GetStats() map[string]int64

type NoopConntracker

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

func NewNoopConntracker

func NewNoopConntracker(cfg *Config) *NoopConntracker

func (*NoopConntracker) GetDNATTuple

func (ctr *NoopConntracker) GetDNATTuple(_ uint32, _ uint32, _ uint16, _ uint16, _ uint32) *IPTranslation

func (*NoopConntracker) GetDNATTupleWithString

func (ctr *NoopConntracker) GetDNATTupleWithString(_ string, _ string, _ uint16, _ uint16, _ uint32) *IPTranslation

func (*NoopConntracker) GetStats

func (ctr *NoopConntracker) GetStats() map[string]int64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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