Documentation ¶
Index ¶
- Constants
- Variables
- func MapMemIter(m MapMem) maps.IterCallback
- type EntryData
- type Key
- type Leg
- type MapMem
- type Value
- func NewValueNATForward(created, lastSeen time.Duration, flags uint16, revKey Key) Value
- func NewValueNATReverse(created, lastSeen time.Duration, flags uint16, legA, legB Leg, ...) Value
- func NewValueNATReverseSNAT(created, lastSeen time.Duration, flags uint16, legA, legB Leg, ...) Value
- func NewValueNormal(created, lastSeen time.Duration, flags uint16, legA, legB Leg) Value
- func (e Value) AsBytes() []byte
- func (e Value) Created() int64
- func (e Value) Data() EntryData
- func (e Value) Flags() uint16
- func (e Value) IsForwardDSR() bool
- func (e Value) LastSeen() int64
- func (e Value) NATSPort() uint16
- func (e Value) OrigIP() net.IP
- func (e Value) OrigPort() uint16
- func (e Value) OrigSPort() uint16
- func (e Value) OrigSrcIP() net.IP
- func (e Value) ReverseNATKey() Key
- func (e *Value) SetLegA2B(leg Leg)
- func (e *Value) SetLegB2A(leg Leg)
- func (e *Value) SetNATSport(sport uint16)
- func (e *Value) SetOrigSport(sport uint16)
- func (e Value) String() string
- func (e Value) Type() uint8
- func (e Value) Upgrade() maps.Upgradable
Constants ¶
const ( TypeNormal uint8 = iota TypeNATForward TypeNATReverse FlagNATOut uint16 = (1 << 0) FlagNATFwdDsr uint16 = (1 << 1) FlagNATNPFwd uint16 = (1 << 2) FlagSkipFIB uint16 = (1 << 3) FlagReserved4 uint16 = (1 << 4) FlagReserved5 uint16 = (1 << 5) FlagExtLocal uint16 = (1 << 6) FlagViaNATIf uint16 = (1 << 7) FlagSrcDstBA uint16 = (1 << 8) )
const KeySize = 16
struct calico_ct_key { uint32_t protocol; __be32 addr_a, addr_b; // NBO uint16_t port_a, port_b; // HBO };
const MaxEntries = 512000
const ValueSize = 64
Variables ¶
var MapParams = maps.MapParameters{ Type: "hash", KeySize: KeySize, ValueSize: ValueSize, MaxEntries: MaxEntries, Name: "cali_v4_ct", Flags: unix.BPF_F_NO_PREALLOC, Version: 2, UpdatedByBPF: true, }
Functions ¶
func MapMemIter ¶
func MapMemIter(m MapMem) maps.IterCallback
MapMemIter returns maps.MapIter that loads the provided MapMem
Types ¶
type EntryData ¶
type EntryData struct { A2B Leg B2A Leg OrigDst net.IP OrigSrc net.IP OrigPort uint16 OrigSPort uint16 TunIP net.IP }
func (EntryData) Established ¶
func (EntryData) FINsSeenDSR ¶
type Leg ¶
type Leg struct { Seqno uint32 SynSeen bool AckSeen bool FinSeen bool RstSeen bool Approved bool Opener bool Ifindex uint32 }
type Value ¶
func NewValueNATForward ¶
NewValueNATForward creates a new Value of type TypeNATForward for the given arguments and the reverse key
func NewValueNATReverse ¶
func NewValueNATReverse(created, lastSeen time.Duration, flags uint16, legA, legB Leg, tunnelIP, origIP net.IP, origPort uint16) Value
NewValueNATReverse creates a new Value of type TypeNATReverse for the given arguments and reverse parameters
func NewValueNATReverseSNAT ¶
func NewValueNormal ¶
NewValueNormal creates a new Value of type TypeNormal based on the given parameters
func (Value) IsForwardDSR ¶
func (Value) NATSPort ¶
NATSPort returns the port to SNAT to, valid only if Type() is TypeNATForward.
func (Value) OrigIP ¶
OrigIP returns the original destination IP, valid only if Type() is TypeNormal or TypeNATReverse
func (Value) OrigPort ¶
OrigPort returns the original destination port, valid only if Type() is TypeNormal or TypeNATReverse
func (Value) OrigSPort ¶
OrigSPort returns the original source port, valid only if Type() is TypeNATReverse and if the value returned is non-zero.
func (Value) ReverseNATKey ¶
func (*Value) SetNATSport ¶
func (*Value) SetOrigSport ¶
func (Value) Upgrade ¶
func (e Value) Upgrade() maps.Upgradable