lbnet

package
v0.0.0-...-015fee6 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DpErrBase = iota - L3ErrBase - 1000
	DpWqUnkErr
)

error codes

View Source
const (
	DpWorkQLen = 1024
	DpTiVal    = 20
)

maximum dp work queue lengths

View Source
const (
	// RootZone string constant representing root security zone
	RootZone = "root"

	LbnetTiVal = 10
)
View Source
const (
	L2ErrBase = iota - 3000
	L2SameFdbErr
	L2OifErr
	L2NoFdbErr
	L2VxattrErr
)

error codes

View Source
const (
	L3ErrBase = iota - RtErrBase - 1000
	L3AddrErr
	L3ObjErr
)

constants

View Source
const (
	MirrErrBase = iota - 101000
	MirrModErr
	MirrInfoErr
	MirrAttachErr
	MirrNoExistErr
	MirrExistsErr
	MirrAllocErr
)

error codes

View Source
const (
	NeighErrBase = iota - 4000
	NeighExistsErr
	NeighOifErr
	NeighNoEntErr
	NeighRangeErr
	NeighHostRtErr
	NeighMacErr
	NeighTunErr
)

error codes

View Source
const (
	NeighAts       = 10
	MaxSysNeigh    = 3 * 1024
	MaxTunnelNeigh = 1024
)

constants

View Source
const (
	PortBaseErr = iota - 1000
	PortExistsErr
	PortNotExistErr
	PortNoMasterErr
	PortCounterErr
	PortMapErr
	PortZoneErr
	PortNoRealDevErr
	PortPropExistsErr
	PortPropNotExistsErr
)

error codes

View Source
const (
	MaxBondInterfaces = 8
	MaxRealInterfaces = 128
	MaxInterfaces     = 512
	MaxWgInterfaces   = 8
	MaxVtiInterfaces  = 8
	RealPortIDB       = 3800
	BondIDB           = 4000
	WgIDB             = 4010
	VtIDB             = 4020
)

constants

View Source
const (
	PolErrBase = iota - 100000
	PolModErr
	PolInfoErr
	PolAttachErr
	PolNoExistErr
	PolExistsErr
	PolAllocErr
)

error codes

View Source
const (
	MinPolRate  = 8
	MaxPols     = 8 * 1024
	DflPolBlkSz = 6 * 5000 * 1000
)

constants

View Source
const (
	RtErrBase = iota - 5000
	RtExistsErr
	RtNhErr
	RtNoEntErr
	RtRangeErr
	RtModErr
	RtTrieAddErr
	RtTrieDelErr
)

error codes

View Source
const (
	RtTypeInd  = 0x1
	RtTypeDyn  = 0x2
	RtTypeSelf = 0x4
	RtTypeHost = 0x8
)

rt type constants

View Source
const (
	RuleErrBase = iota - ZoneBaseErr - 1000
	RuleUnknownServiceErr
	RuleUnknownEpErr
	RuleExistsErr
	RuleAllocErr
	RuleNotExistsErr
	RuleEpCountErr
	RuleTupleErr
	RuleArgsErr
	RuleEpNotExistErr
)

error codes

View Source
const (
	RmPort ruleTMatch = 1 << iota
	RmL2Src
	RmL2Dst
	RmVlanID
	RmL3Src
	RmL3Dst
	RmL4Src
	RmL4Dst
	RmL4Prot
	RmInL2Src
	RmInL2Dst
	RmInL3Src
	RmInL3Dst
	RmInL4Src
	RmInL4Dst
	RmInL4Port
	RmMax
)

rm tuples

View Source
const (
	MaxNatEndPoints          = 16
	DflLbaInactiveTries      = 2         // Default number of inactive tries before LB arm is turned off
	MaxDflLbaInactiveTries   = 100       // Max number of inactive tries before LB arm is turned off
	DflLbaCheckTimeout       = 10        // Default timeout for checking LB arms
	DflHostProbeTimeout      = 60        // Default probe timeout for end-point host
	InitHostProbeTimeout     = 15        // Initial probe timeout for end-point host
	MaxHostProbeTime         = 24 * 3600 // Max possible host health check duration
	LbDefaultInactiveTimeout = 4 * 60    // Default inactive timeout for established sessions
	LbMaxInactiveTimeout     = 24 * 3600 // Maximum inactive timeout for established sessions
	MaxEndPointCheckers      = 4         // Maximum helpers to check endpoint health
	EndPointCheckerDuration  = 2         // Duration at which ep-helpers will run
	MaxEndPointSweeps        = 20        // Maximum end-point sweeps per round
)

constants

View Source
const (
	RtEm ruleTType = iota + 1
	RtMf
)

rt types

View Source
const (
	RtActDrop ruleTActType = iota + 1
	RtActFwd
	RtActTrap
	RtActRedirect
	RtActDnat
	RtActSnat
	RtActFullNat
)

possible actions for a rt-entry

View Source
const (
	HostProbePing        = "ping"
	HostProbeConnectTCP  = "tcp"
	HostProbeConnectUDP  = "udp"
	HostProbeConnectSCTP = "sctp"
	HostProbeHTTP        = "http"
	HostProbeHTTPS       = "https"
	HostProbeNone        = "none"
)

possible types of end-point probe

View Source
const (
	RtFw ruleTableType = iota + 1
	RtLB
	RtMax
)

rt types

View Source
const (
	RtMaximumFw4s = (8 * 1024)
	RtMaximumLbs  = (2 * 1024)
)

rule specific flb constants

View Source
const (
	SessErrBase = iota - 90000
	SessModErr
	SessNoExistErr
	SessExistsErr
	SessUlClExistErr
	SessUlClNumErr
	SessUlClNoExistErr
)

error codes for session api

View Source
const (
	VlanBaseErr = iota - 2000
	VlanExistsErr
	VlaNotExistErr
	VlanRangeErr
	VlanAddBrpErr
	VlanMpExistErr
	VlanPortPhyErr
	VlanPortExistErr
	VlanPortTaggedErr
	VlanNoPortErr
	VlanPortCreateErr
	VlanZoneErr
)

error codes for vlan mod api

View Source
const (
	ZoneBaseErr = iota - RtErrBase - 1000
	ZoneExistsErr
	ZoneNotExistErr
	ZoneNumberErr
)

error codes for zone

View Source
const (
	FdbGts = 10
)

constants

View Source
const (
	MaxMirrors = 32
)

constants

View Source
const (
	MaxSysRoutes = (32 + 8) * 1024 //32k Ipv4 + 8k Ipv6
)

constants

View Source
const (
	MaximumUlCls = 20000
)

constant to declare maximum number of Uplink Classifiers

View Source
const (
	// MaximumVlans constant to declare maximum number of vlans
	MaximumVlans = 4094
)
View Source
const (
	// MaximumZones constant to define maximum number of zones
	MaximumZones = 256
)

Variables

This section is empty.

Functions

func DpWorkSingle

func DpWorkSingle(dp *DpH, m interface{}) DpRetT

DpWorkSingle - routine to work on a single dp work queue request

func DpWorker

func DpWorker(dp *DpH, f chan int, ch chan interface{})

DpWorker - DP worker routine listening on a channel

func FLBInit

func FLBInit(dpHook DpHookInterface, sigCh chan os.Signal, shutdown func()) bool

func FLBRun

func FLBRun()

FLBRun - This routine will not return

func FileCreate

func FileCreate(fname string) int

FileCreate - Create a file

func FileExists

func FileExists(fname string) bool

FileExists - Check if file exists

func GetFlagToString

func GetFlagToString(flag int) string

GetFlagToString - Stringify route flags

func GratArpReq

func GratArpReq(AdvIP net.IP, ifName string) (int, error)

GratArpReq - sends a gratuitious arp reply given the DIP, SIP and interface name

func GratArpReqWithCtx

func GratArpReqWithCtx(ctx context.Context, rCh chan<- int, AdvIP net.IP, ifName string) (int, error)

GratArpReq - sends a gratuitious arp reply given the DIP, SIP and interface name

func HTTPSProber

func HTTPSProber(urls string, cert tls.Certificate, certPool *x509.CertPool, resp string) bool

HTTPSProber - Do a https probe for given url returns true/false depending on whether probing was successful

func Ifa2String

func Ifa2String(ifa *Ifa, it IterIntf)

Ifa2String - Format an ifa to a string

func IfaMkString

func IfaMkString(ifa *Ifa, v4 bool) string

IfaMkString - Given an ifa return its string representation

func IsIPHostAddr

func IsIPHostAddr(ipString string) bool

IsIPHostAddr - Check if provided address is a local address

func LogString2Level

func LogString2Level(logStr string) tk.LogLevelT

LogString2Level - Convert log level in string to LogLevelT

func MirrInfoCmp

func MirrInfoCmp(mInfo1, mInfo2 *cmn.MirrInfo) bool

MirrInfoCmp - compare mirror information in two MirrInfo variables returns false if there is no match, else returns true

func MirrInfoValidate

func MirrInfoValidate(mInfo *cmn.MirrInfo) bool

MirrInfoValidate - validate mirror information

func MirrObjValidate

func MirrObjValidate(mObj *cmn.MirrObj) bool

MirrObjValidate - validate object to be attached

func Neigh2String

func Neigh2String(ne *Neigh, it IterIntf)

Neigh2String - stringify a neighbor

func PolInfoXlateValidate

func PolInfoXlateValidate(pInfo *cmn.PolInfo) bool

PolInfoXlateValidate - validates info passed in pInfo and translates it to internally used units

func PolObjValidate

func PolObjValidate(pObj *cmn.PolObj) bool

PolObjValidate - validate object to be attached

func ReadPIDFile

func ReadPIDFile(pf string) int

ReadPIDFile - Read a PID file

func Rt2String

func Rt2String(rt *Rt) string

Rt2String - stringify the rt entry

func RunCommand

func RunCommand(command string, isFatal bool) (int, error)

RunCommand - Run a bash command

func Us2String

func Us2String(us *UserSess) string

Us2String - converts single user session information to string format

func VlanValid

func VlanValid(vlanID int) bool

VlanValid - routine to validate vlanId

Types

type DpH

type DpH struct {
	ToDpCh  chan interface{}
	ToFinCh chan int
	DpHooks DpHookInterface
	SyncMtx sync.RWMutex
}

DpH - datapath context container

func DpBrokerInit

func DpBrokerInit(dpHook DpHookInterface) *DpH

DpBrokerInit - initialize the DP broker subsystem

func (*DpH) DpMapGetCt4

func (dp *DpH) DpMapGetCt4() []cmn.CtInfo

DpMapGetCt4 - get DP conntrack information as a map

func (*DpH) DpWorkOnFw

func (dp *DpH) DpWorkOnFw(fWq *FwDpWorkQ) DpRetT

DpWorkOnFw - routine to work on a firewall work queue request

func (*DpH) DpWorkOnL2Addr

func (dp *DpH) DpWorkOnL2Addr(pWq *L2AddrDpWorkQ) DpRetT

DpWorkOnL2Addr - routine to work on a l2 addr work queue request

func (*DpH) DpWorkOnMirr

func (dp *DpH) DpWorkOnMirr(mWq *MirrDpWorkQ) DpRetT

DpWorkOnMirr - routine to work on a mirror work queue request

func (*DpH) DpWorkOnNatLb

func (dp *DpH) DpWorkOnNatLb(nWq *NatDpWorkQ) DpRetT

DpWorkOnNatLb - routine to work on a NAT lb work queue request

func (*DpH) DpWorkOnNextHop

func (dp *DpH) DpWorkOnNextHop(nhWq *NextHopDpWorkQ) DpRetT

DpWorkOnNextHop - routine to work on a nexthop work queue request

func (*DpH) DpWorkOnPol

func (dp *DpH) DpWorkOnPol(pWq *PolDpWorkQ) DpRetT

DpWorkOnPol - routine to work on a policer work queue request

func (*DpH) DpWorkOnPort

func (dp *DpH) DpWorkOnPort(pWq *PortDpWorkQ) DpRetT

DpWorkOnPort - routine to work on a port work queue request

func (*DpH) DpWorkOnRoute

func (dp *DpH) DpWorkOnRoute(rtWq *RouteDpWorkQ) DpRetT

DpWorkOnRoute - routine to work on a route work queue request

func (*DpH) DpWorkOnRtMac

func (dp *DpH) DpWorkOnRtMac(rmWq *RouterMacDpWorkQ) DpRetT

DpWorkOnRtMac - routine to work on a rt-mac work queue request

func (*DpH) DpWorkOnStat

func (dp *DpH) DpWorkOnStat(nWq *StatDpWorkQ) DpRetT

DpWorkOnStat - routine to work on a stat work queue request

func (*DpH) DpWorkOnTableOp

func (dp *DpH) DpWorkOnTableOp(nWq *TableDpWorkQ) (DpRetT, error)

DpWorkOnTableOp - routine to work on a table work queue request

func (*DpH) DpWorkOnUlCl

func (dp *DpH) DpWorkOnUlCl(nWq *UlClDpWorkQ) DpRetT

DpWorkOnUlCl - routine to work on a ulcl work queue request

type DpHookInterface

type DpHookInterface interface {
	DpMirrAdd(*MirrDpWorkQ) int
	DpMirrDel(*MirrDpWorkQ) int
	DpPolAdd(*PolDpWorkQ) int
	DpPolDel(*PolDpWorkQ) int
	DpPortPropAdd(*PortDpWorkQ) int
	DpPortPropDel(*PortDpWorkQ) int
	DpL2AddrAdd(*L2AddrDpWorkQ) int
	DpL2AddrDel(*L2AddrDpWorkQ) int
	DpRouterMacAdd(*RouterMacDpWorkQ) int
	DpRouterMacDel(*RouterMacDpWorkQ) int
	DpNextHopAdd(*NextHopDpWorkQ) int
	DpNextHopDel(*NextHopDpWorkQ) int
	DpRouteAdd(*RouteDpWorkQ) int
	DpRouteDel(*RouteDpWorkQ) int
	DpNatLbRuleAdd(*NatDpWorkQ) int
	DpNatLbRuleDel(*NatDpWorkQ) int
	DpFwRuleAdd(w *FwDpWorkQ) int
	DpFwRuleDel(w *FwDpWorkQ) int
	DpStat(*StatDpWorkQ) int
	DpUlClAdd(w *UlClDpWorkQ) int
	DpUlClDel(w *UlClDpWorkQ) int
	DpTableGet(w *TableDpWorkQ) (DpRetT, error)
	DpCtAdd(w *DpCtInfo) int
	DpCtDel(w *DpCtInfo) int
	DpCtGetAsync()
	DpGetLock()
	DpRelLock()
}

DpHookInterface - represents a go interface which should be implemented to integrate with flbnet realm

type FdbAttr

type FdbAttr struct {
	Oif     string
	Dst     net.IP
	FdbType int
}

FdbAttr - extra attribs for a fwd entry

type FdbEnt

type FdbEnt struct {
	FdbKey  FdbKey
	FdbAttr FdbAttr
	FdbTun  FdbTunAttr
	Port    *Port

	Sync DpStatusT
	// contains filtered or unexported fields
}

FdbEnt - a forwarding database entry

func (*FdbEnt) DP

func (f *FdbEnt) DP(work DpWorkT) int

DP - Sync state of L2 entities to data-path

func (*FdbEnt) L2FdbResolveNh

func (f *FdbEnt) L2FdbResolveNh() (bool, int, error)

L2FdbResolveNh - For TunFDB, try to associate with appropriate neighbor

type FdbKey

type FdbKey struct {
	MacAddr  [6]byte
	BridgeID int
}

FdbKey - key to find a fwd entry

type FdbStat

type FdbStat struct {
	Packets uint64
	Bytes   uint64
}

FdbStat - statistics for fwd entry

type FdbTunAttr

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

FdbTunAttr - attribs for a tun fwd entry

type Ifa

type Ifa struct {
	Key  IfaKey
	Zone *Zone
	Sync DpStatusT
	Ifas []*IfaEnt
}

Ifa - a singe ifa can contain multiple ifas

func (*Ifa) DP

func (ifa *Ifa) DP(work DpWorkT) int

DP - Sync state of L3 entities to data-path

type IfaEnt

type IfaEnt struct {
	IfaAddr   net.IP
	IfaNet    net.IPNet
	Secondary bool
}

IfaEnt - the ifa-entry

type IfaKey

type IfaKey struct {
	Obj string
}

IfaKey - key to find a ifa entry

type IterIntf

type IterIntf interface {
	NodeWalker(b string)
}

IterIntf - interface implementation to iterate various flbnet subsystems entitities

type L2H

type L2H struct {
	FdbMap map[FdbKey]*FdbEnt
	Zone   *Zone
}

L2H - context container

func L2Init

func L2Init(z *Zone) *L2H

L2Init - Initialize the layer2 subsystem

func (*L2H) FdbTicker

func (l2 *L2H) FdbTicker(f *FdbEnt)

FdbTicker - Ticker routine for a fwd entry

func (*L2H) Fdbs2String

func (l2 *L2H) Fdbs2String(it IterIntf) error

Fdbs2String - Format all fwd entries to string

func (*L2H) FdbsTicker

func (l2 *L2H) FdbsTicker()

FdbsTicker - Ticker for Fdbs

func (*L2H) L2DestructAll

func (l2 *L2H) L2DestructAll()

L2DestructAll - Destructor for all layer2 fwd entries

func (*L2H) L2FdbAdd

func (l2 *L2H) L2FdbAdd(key FdbKey, attr FdbAttr) (int, error)

L2FdbAdd - Add a l2 forwarding entry

func (*L2H) L2FdbDel

func (l2 *L2H) L2FdbDel(key FdbKey) (int, error)

L2FdbDel - Delete a l2 forwarding entry

func (*L2H) L2FdbFind

func (l2 *L2H) L2FdbFind(key FdbKey) *FdbEnt

L2FdbFind - Find a fwd entry given the key

func (*L2H) PortNotifier

func (l2 *L2H) PortNotifier(name string, osID int, evType PortEvent)

PortNotifier - Implementation of PortEventIntf interface

type L3H

type L3H struct {
	IfaMap map[IfaKey]*Ifa
	Zone   *Zone
}

L3H - context container

func L3Init

func L3Init(zone *Zone) *L3H

L3Init - Initialize the layer3 subsystem

func (*L3H) IfObjMkString

func (l3 *L3H) IfObjMkString(obj string, v4 bool) string

IfObjMkString - given an ifa object, get all its member ifa's string rep

func (*L3H) IfaAdd

func (l3 *L3H) IfaAdd(Obj string, Cidr string) (int, error)

IfaAdd - Adds an interface IP address (primary or secondary) and associate it with Obj Obj can be anything but usually it is the name of a valid interface

func (*L3H) IfaDelete

func (l3 *L3H) IfaDelete(Obj string, Cidr string) (int, error)

IfaDelete - Deletes an interface IP address (primary or secondary) and de-associate from Obj Obj can be anything but usually it is the name of a valid interface

func (*L3H) IfaDeleteAll

func (l3 *L3H) IfaDeleteAll(Obj string) (int, error)

IfaDeleteAll - Deletes all interface IP address (primary or secondary) and de-associate from Obj Obj can be anything but usually it is the name of a valid interface

func (*L3H) IfaFind

func (l3 *L3H) IfaFind(Obj string, addr net.IP) (int, net.IP)

IfaFind - Given any ip address, check if it matches ip address from Obj's ifa list This is useful to determine if ip address is already assigned to some interface

func (*L3H) IfaFindAny

func (l3 *L3H) IfaFindAny(addr net.IP) (int, net.IP)

IfaFindAny - Given any ip address, check if it matches ip address in any ifa list This is useful to determine if ip address is already assigned to some interface

func (*L3H) IfaGet

func (l3 *L3H) IfaGet() []cmn.IPAddrGet

IfaGet - Get All of the IPv4Address in the Ifa

func (*L3H) IfaSelect

func (l3 *L3H) IfaSelect(Obj string, addr net.IP, findAny bool) (int, net.IP, string)

IfaSelect - Given any ip address, select optimal ip address from Obj's ifa list This is useful to determine source ip address when sending traffic to the given ip address

func (*L3H) IfaSelectAny

func (l3 *L3H) IfaSelectAny(addr net.IP, findAny bool) (int, net.IP, string)

IfaSelectAny - Given any dest ip address, select optimal interface source ip address This is useful to determine source ip address when sending traffic to the given ip address

func (*L3H) Ifas2String

func (l3 *L3H) Ifas2String(it IterIntf) error

Ifas2String - Format all ifas to string

type MirrAttachObjT

type MirrAttachObjT interface {
}

MirrAttachObjT - empty interface to hold mirror attachments

type MirrEntry

type MirrEntry struct {
	Key   MirrKey
	Info  cmn.MirrInfo
	Zone  *Zone
	HwNum uint64
	Stats PolStats
	Sync  DpStatusT
	MObjs []MirrObjInfo
}

MirrEntry - a mirror entry

func (*MirrEntry) DP

func (m *MirrEntry) DP(work DpWorkT) int

DP - Sync state of mirror with data-path

type MirrH

type MirrH struct {
	MirrMap map[MirrKey]*MirrEntry
	Zone    *Zone
	Mark    *tk.Counter
}

MirrH - context container

func MirrInit

func MirrInit(zone *Zone) *MirrH

MirrInit - Initialize the mirror subsytem

func (*MirrH) MirrAdd

func (M *MirrH) MirrAdd(name string, mInfo cmn.MirrInfo, mObjArgs cmn.MirrObj) (int, error)

MirrAdd - Add a mirror in flbnet

func (*MirrH) MirrDelete

func (M *MirrH) MirrDelete(name string) (int, error)

MirrDelete - Delete a mirror from flbnet

func (*MirrH) MirrDestructAll

func (M *MirrH) MirrDestructAll()

MirrDestructAll - destroy all mirrors

func (*MirrH) MirrGet

func (M *MirrH) MirrGet() ([]cmn.MirrGetMod, error)

MirrGet - Get mirrors in flbnet

func (*MirrH) MirrPortDelete

func (M *MirrH) MirrPortDelete(name string)

MirrPortDelete - if port related to any mirror is deleted, we need to make sure that mirror is resynced

func (*MirrH) MirrTicker

func (M *MirrH) MirrTicker()

MirrTicker - a ticker routine for mirrors

type MirrKey

type MirrKey struct {
	Name string
}

MirrKey - key for a mirror entry

type MirrObjInfo

type MirrObjInfo struct {
	Args      cmn.MirrObj
	AttachObj MirrAttachObjT
	Parent    *MirrEntry
	Sync      DpStatusT
}

MirrObjInfo - an object which is attached to a mirror

func (*MirrObjInfo) MirrObj2DP

func (mObjInfo *MirrObjInfo) MirrObj2DP(work DpWorkT) int

MirrObj2DP - Sync state of mirror's attachment point with data-path

type MirrStats

type MirrStats struct {
	PacketsOk uint64
	Bytes     uint64
}

MirrStats - stats related to a mirror

type Neigh

type Neigh struct {
	Key      NeighKey
	Addr     net.IP
	Attr     NeighAttr
	Inactive bool
	Resolved bool
	Mark     uint64
	RMark    uint64
	RecNh    *Neigh

	TunEps  []*NeighTunEp
	Type    NhType
	Sync    DpStatusT
	OifPort *Port
	Ats     time.Time
	NhRtm   map[RtKey]*Rt
	// contains filtered or unexported fields
}

Neigh - a neighbor entry

func (*Neigh) DP

func (ne *Neigh) DP(work DpWorkT) int

DP - sync state of neighbor entity to data-path

func (*Neigh) NeighRemoveTunEP

func (ne *Neigh) NeighRemoveTunEP(i int) []*NeighTunEp

NeighRemoveTunEP - remove tun-ep from a neighbor

type NeighAttr

type NeighAttr struct {
	OSLinkIndex  int
	OSState      int
	HardwareAddr net.HardwareAddr
}

NeighAttr - attributes of a neighbor

type NeighH

type NeighH struct {
	NeighMap map[NeighKey]*Neigh
	NeighID  *tk.Counter
	NeighTID *tk.Counter
	Zone     *Zone
}

NeighH - the context container

func NeighInit

func NeighInit(zone *Zone) *NeighH

NeighInit - Initialize the neighbor subsystem

func (*NeighH) Activate

func (n *NeighH) Activate(ne *Neigh)

Activate - Try to activate a neighbor

func (*NeighH) NeighAdd

func (n *NeighH) NeighAdd(Addr net.IP, Zone string, Attr NeighAttr) (int, error)

NeighAdd - add a neigh entry

func (*NeighH) NeighAddTunEP

func (n *NeighH) NeighAddTunEP(ne *Neigh, rIP net.IP, sIP net.IP, tunID uint32, tunType DpTunT, sync bool) (int, *NeighTunEp)

NeighAddTunEP - Add tun-ep to a neighbor

func (*NeighH) NeighDelAllTunEP

func (n *NeighH) NeighDelAllTunEP(ne *Neigh) int

NeighDelAllTunEP - delete all tun-eps from a neighbor

func (*NeighH) NeighDelete

func (n *NeighH) NeighDelete(Addr net.IP, Zone string) (int, error)

NeighDelete - delete a neigh entry

func (*NeighH) NeighDeleteByPort

func (n *NeighH) NeighDeleteByPort(port string)

NeighDeleteByPort - Routine to delete all the neigh on this port

func (*NeighH) NeighDestructAll

func (n *NeighH) NeighDestructAll()

NeighDestructAll - destroy all neighbors

func (*NeighH) NeighFind

func (n *NeighH) NeighFind(Addr net.IP, Zone string) (*Neigh, int)

NeighFind - Find a neighbor entry

func (*NeighH) NeighGet

func (n *NeighH) NeighGet() ([]cmn.NeighMod, error)

NeighGet - Get neigh entries in Neighv4Mod slice

func (*NeighH) NeighPairRt

func (n *NeighH) NeighPairRt(ne *Neigh, rt *Rt) int

NeighPairRt - Associate a route with the given neighbor

func (*NeighH) NeighRecursiveResolve

func (n *NeighH) NeighRecursiveResolve(ne *Neigh) bool

NeighRecursiveResolve - try to resolve recursive neighbors Recursive neighbors are the ones which have the following association : nh -> tunfdb -> rt -> tun-nh (Wow)

func (*NeighH) NeighTicker

func (n *NeighH) NeighTicker(ne *Neigh)

NeighTicker - a per neighbor ticker sub-routine

func (*NeighH) NeighUnPairRt

func (n *NeighH) NeighUnPairRt(ne *Neigh, rt *Rt) int

NeighUnPairRt - De-Associate a route from the given neighbor

func (*NeighH) Neighs2String

func (n *NeighH) Neighs2String(it IterIntf) error

Neighs2String - stringify all neighbors

func (*NeighH) NeighsTicker

func (n *NeighH) NeighsTicker()

NeighsTicker - neighbor subsystem ticker sub-routine

func (*NeighH) PortNotifier

func (n *NeighH) PortNotifier(name string, osID int, evType PortEvent)

PortNotifier - implementation of PortEventIntf interface

type NeighKey

type NeighKey struct {
	NhString string
	Zone     string
}

NeighKey - key of a neighbor entry

type NeighTunEp

type NeighTunEp struct {
	Mark     uint64
	Parent   *Neigh
	Inactive bool
	Sync     DpStatusT
	// contains filtered or unexported fields
}

NeighTunEp - tun-ep related to neighbor

func (*NeighTunEp) DP

func (tep *NeighTunEp) DP(work DpWorkT) int

DP - sync state of neighbor tunnel endpoint entity to data-path

type NetAPIStruct

type NetAPIStruct struct {
}

NetAPIStruct - empty struct for anchoring client routines

func NetAPIInit

func NetAPIInit() *NetAPIStruct

NetAPIInit - Initialize a new instance of NetAPI

func (*NetAPIStruct) NetAddrAdd

func (na *NetAPIStruct) NetAddrAdd(am *cmn.IPAddrMod) (int, error)

NetAddrAdd - Add an ipv4 address in lbnet

func (*NetAPIStruct) NetAddrDel

func (na *NetAPIStruct) NetAddrDel(am *cmn.IPAddrMod) (int, error)

NetAddrDel - Delete an ipv4 address in lbnet

func (*NetAPIStruct) NetAddrGet

func (na *NetAPIStruct) NetAddrGet() ([]cmn.IPAddrGet, error)

NetAddrGet - Get an IPv4 Address info from lbnet

func (*NetAPIStruct) NetCtInfoGet

func (na *NetAPIStruct) NetCtInfoGet() ([]cmn.CtInfo, error)

NetCtInfoGet - Get connection track info from lbnet

func (*NetAPIStruct) NetEpHostAdd

func (na *NetAPIStruct) NetEpHostAdd(em *cmn.EndPointMod) (int, error)

NetEpHostAdd - Add a LB end-point in lbnet

func (*NetAPIStruct) NetEpHostDel

func (na *NetAPIStruct) NetEpHostDel(em *cmn.EndPointMod) (int, error)

NetEpHostDel - Delete a LB end-point in lbnet

func (*NetAPIStruct) NetEpHostGet

func (na *NetAPIStruct) NetEpHostGet() ([]cmn.EndPointMod, error)

NetEpHostGet - Get LB end-points from lbnet

func (*NetAPIStruct) NetFdbAdd

func (na *NetAPIStruct) NetFdbAdd(fm *cmn.FdbMod) (int, error)

NetFdbAdd - Add a forwarding database entry in lbnet

func (*NetAPIStruct) NetFdbDel

func (na *NetAPIStruct) NetFdbDel(fm *cmn.FdbMod) (int, error)

NetFdbDel - Delete a forwarding database entry in lbnet

func (*NetAPIStruct) NetFwRuleAdd

func (na *NetAPIStruct) NetFwRuleAdd(fm *cmn.FwRuleMod) (int, error)

NetFwRuleAdd - Add a firewall rule in lbnet

func (*NetAPIStruct) NetFwRuleDel

func (na *NetAPIStruct) NetFwRuleDel(fm *cmn.FwRuleMod) (int, error)

NetFwRuleDel - Delete a firewall rule in lbnet

func (*NetAPIStruct) NetFwRuleGet

func (na *NetAPIStruct) NetFwRuleGet() ([]cmn.FwRuleMod, error)

NetFwRuleGet - Get a firewall rule from lbnet

func (*NetAPIStruct) NetLbRuleAdd

func (na *NetAPIStruct) NetLbRuleAdd(lm *cmn.LbRuleMod) (int, error)

NetLbRuleAdd - Add a load-balancer rule in lbnet

func (*NetAPIStruct) NetLbRuleDel

func (na *NetAPIStruct) NetLbRuleDel(lm *cmn.LbRuleMod) (int, error)

NetLbRuleDel - Delete a load-balancer rule in lbnet

func (*NetAPIStruct) NetLbRuleGet

func (na *NetAPIStruct) NetLbRuleGet() ([]cmn.LbRuleMod, error)

NetLbRuleGet - Get a load-balancer rule from lbnet

func (*NetAPIStruct) NetMirrorAdd

func (*NetAPIStruct) NetMirrorAdd(mm *cmn.MirrMod) (int, error)

NetMirrorAdd - Add a mirror in lbnet

func (*NetAPIStruct) NetMirrorDel

func (*NetAPIStruct) NetMirrorDel(mm *cmn.MirrMod) (int, error)

NetMirrorDel - Delete a mirror in lbnet

func (*NetAPIStruct) NetMirrorGet

func (*NetAPIStruct) NetMirrorGet() ([]cmn.MirrGetMod, error)

NetMirrorGet - Get a mirror in lbnet

func (*NetAPIStruct) NetNeighAdd

func (na *NetAPIStruct) NetNeighAdd(nm *cmn.NeighMod) (int, error)

NetNeighAdd - Add a neighbor in lbnet

func (*NetAPIStruct) NetNeighDel

func (na *NetAPIStruct) NetNeighDel(nm *cmn.NeighMod) (int, error)

NetNeighDel - Delete a neighbor in lbnet

func (*NetAPIStruct) NetNeighGet

func (na *NetAPIStruct) NetNeighGet() ([]cmn.NeighMod, error)

NetNeighGet - Get a neighbor in lbnet

func (*NetAPIStruct) NetPolicerAdd

func (na *NetAPIStruct) NetPolicerAdd(pm *cmn.PolMod) (int, error)

NetPolicerAdd - Add a policer in lbnet

func (*NetAPIStruct) NetPolicerDel

func (na *NetAPIStruct) NetPolicerDel(pm *cmn.PolMod) (int, error)

NetPolicerDel - Delete a policer in lbnet

func (*NetAPIStruct) NetPolicerGet

func (na *NetAPIStruct) NetPolicerGet() ([]cmn.PolMod, error)

NetPolicerGet - Get a policer in lbnet

func (*NetAPIStruct) NetPortAdd

func (na *NetAPIStruct) NetPortAdd(pm *cmn.PortMod) (int, error)

NetPortAdd - Add a port in lbnet

func (*NetAPIStruct) NetPortDel

func (na *NetAPIStruct) NetPortDel(pm *cmn.PortMod) (int, error)

NetPortDel - Delete port from lbnet

func (*NetAPIStruct) NetPortGet

func (*NetAPIStruct) NetPortGet() ([]cmn.PortDump, error)

NetPortGet - Get Port Information of lbnet

func (*NetAPIStruct) NetRouteAdd

func (na *NetAPIStruct) NetRouteAdd(rm *cmn.RouteMod) (int, error)

NetRouteAdd - Add a route in lbnet

func (*NetAPIStruct) NetRouteDel

func (na *NetAPIStruct) NetRouteDel(rm *cmn.RouteMod) (int, error)

NetRouteDel - Delete a route in lbnet

func (*NetAPIStruct) NetRouteGet

func (na *NetAPIStruct) NetRouteGet() ([]cmn.RouteGet, error)

NetRouteGet - Get Route info from lbnet

func (*NetAPIStruct) NetSessionAdd

func (na *NetAPIStruct) NetSessionAdd(sm *cmn.SessionMod) (int, error)

NetSessionAdd - Add a 3gpp user-session info in lbnet

func (*NetAPIStruct) NetSessionDel

func (na *NetAPIStruct) NetSessionDel(sm *cmn.SessionMod) (int, error)

NetSessionDel - Delete a 3gpp user-session info in lbnet

func (*NetAPIStruct) NetSessionGet

func (na *NetAPIStruct) NetSessionGet() ([]cmn.SessionMod, error)

NetSessionGet - Get 3gpp user-session info in lbnet

func (*NetAPIStruct) NetSessionUlClAdd

func (na *NetAPIStruct) NetSessionUlClAdd(sr *cmn.SessionUlClMod) (int, error)

NetSessionUlClAdd - Add a 3gpp ulcl-filter info in lbnet

func (*NetAPIStruct) NetSessionUlClDel

func (na *NetAPIStruct) NetSessionUlClDel(sr *cmn.SessionUlClMod) (int, error)

NetSessionUlClDel - Delete a 3gpp ulcl-filter info in lbnet

func (*NetAPIStruct) NetSessionUlClGet

func (na *NetAPIStruct) NetSessionUlClGet() ([]cmn.SessionUlClMod, error)

NetSessionUlClGet - Get 3gpp ulcl filter info from lbnet

func (*NetAPIStruct) NetVlanAdd

func (na *NetAPIStruct) NetVlanAdd(vm *cmn.VlanMod) (int, error)

NetVlanAdd - Add vlan info to lbnet

func (*NetAPIStruct) NetVlanDel

func (na *NetAPIStruct) NetVlanDel(vm *cmn.VlanMod) (int, error)

NetVlanDel - Delete vlan info from lbnet

func (*NetAPIStruct) NetVlanGet

func (na *NetAPIStruct) NetVlanGet() ([]cmn.VlanGet, error)

NetVlanGet - Get Vlan Information of lbnet

func (*NetAPIStruct) NetVlanPortAdd

func (na *NetAPIStruct) NetVlanPortAdd(vm *cmn.VlanPortMod) (int, error)

NetVlanPortAdd - Add a port to vlan in lbnet

func (*NetAPIStruct) NetVlanPortDel

func (na *NetAPIStruct) NetVlanPortDel(vm *cmn.VlanPortMod) (int, error)

NetVlanPortDel - Delete a port from vlan in lbnet

type NhType

type NhType uint8

NhType - type of neighbor

const (
	NhNormal NhType = 1 << iota
	NhTun
	NhRecursive
)

supported neighbor types

type PolAttachObjT

type PolAttachObjT interface {
}

PolAttachObjT - empty interface to hold policer attachments

type PolEntry

type PolEntry struct {
	Key   PolKey
	Info  cmn.PolInfo
	Zone  *Zone
	HwNum uint64
	Stats PolStats
	Sync  DpStatusT
	PObjs []PolObjInfo
}

PolEntry - a policer entry

func (*PolEntry) DP

func (p *PolEntry) DP(work DpWorkT) int

DP - Sync state of policer with data-path

type PolH

type PolH struct {
	PolMap map[PolKey]*PolEntry
	Zone   *Zone
	Mark   *tk.Counter
}

PolH - context container

func PolInit

func PolInit(zone *Zone) *PolH

PolInit - initialize the policer subsystem

func (*PolH) PolAdd

func (P *PolH) PolAdd(pName string, pInfo cmn.PolInfo, pObjArgs cmn.PolObj) (int, error)

PolAdd - Add a police in flbnet

func (*PolH) PolDelete

func (P *PolH) PolDelete(pName string) (int, error)

PolDelete - Delete a police from flbnet

func (*PolH) PolDestructAll

func (P *PolH) PolDestructAll()

PolDestructAll - destroy all policers

func (*PolH) PolGetAll

func (P *PolH) PolGetAll() ([]cmn.PolMod, error)

PolGetAll - Get all the polices in flbnet

func (*PolH) PolPortDelete

func (P *PolH) PolPortDelete(name string)

PolPortDelete - if port related to any policer is deleted, we need to make sure that policer is resynced

func (*PolH) PolTicker

func (P *PolH) PolTicker()

PolTicker - a ticker routine for policers

type PolKey

type PolKey struct {
	PolName string
}

PolKey - key for a policer entry

type PolObjInfo

type PolObjInfo struct {
	Args      cmn.PolObj
	AttachObj PolAttachObjT
	Parent    *PolEntry
	Sync      DpStatusT
}

PolObjInfo - an object which is attached to a policer

func (*PolObjInfo) PolObj2DP

func (pObjInfo *PolObjInfo) PolObj2DP(work DpWorkT) int

PolObj2DP - Sync state of policer's attachment point with data-path

type PolStats

type PolStats struct {
	PacketsOk  uint64
	PacketsNok uint64
	Bytes      uint64
}

PolStats - stats related to policer

type Port

type Port struct {
	Name   string
	PortNo int
	Zone   string
	SInfo  PortSwInfo
	HInfo  PortHwInfo
	Stats  PortStatsInfo
	L3     PortLayer3Info
	L2     PortLayer2Info
	Sync   DpStatusT
}

Port - holds all information related to an interface

func (*Port) DP

func (p *Port) DP(work DpWorkT) int

DP - sync state of port entities in flbnet realm to data-path

func (*Port) IsL3TunPort

func (p *Port) IsL3TunPort() bool

IsL3TunPort - check if the port is of L3Tun type

func (*Port) IsLeafPort

func (p *Port) IsLeafPort() bool

IsLeafPort - check if the port is a leaf port (eBPF hooks need to attached to such ports)

func (*Port) IsSlavePort

func (p *Port) IsSlavePort() bool

IsSlavePort - check if the port is slave of another port

type PortEvent

type PortEvent uint

PortEvent - port event type

const (
	PortEvDown PortEvent = 1 << iota
	PortEvLowerDown
	PortEvDelete
)

port events bitmask

type PortEventIntf

type PortEventIntf interface {
	PortNotifier(name string, osID int, evType PortEvent)
}

PortEventIntf - interface for getting notifications

type PortHwInfo

type PortHwInfo struct {
	MacAddr [6]byte
	Link    bool
	State   bool
	Mtu     int
	Master  string
	Real    string
	TunID   uint32
	TunSrc  net.IP
	TunDst  net.IP
}

PortHwInfo - hardware specific information of an interface

type PortLayer2Info

type PortLayer2Info struct {
	IsPvid bool
	Vid    int
}

PortLayer2Info - layer2 information related to an interface

type PortLayer3Info

type PortLayer3Info struct {
	Routed    bool
	Ipv4Addrs []string
	Ipv6Addrs []string
}

PortLayer3Info - layer3 information related to an interface

type PortStatsInfo

type PortStatsInfo struct {
	RxBytes   uint64
	TxBytes   uint64
	RxPackets uint64
	TxPackets uint64
	RxError   uint64
	TxError   uint64
}

PortStatsInfo - per interface statistics information Note that this is not snmp compliant stats

type PortSwInfo

type PortSwInfo struct {
	OsID       int
	PortType   int
	PortProp   cmn.PortProp
	PortPolNum int
	PortMirNum int
	PortActive bool
	PortReal   *Port
	PortOvl    *Port
	SessMark   uint64
	BpfLoaded  bool
}

PortSwInfo - software specific information for interface maintenance

type PortsH

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

PortsH - the port context container

func PortInit

func PortInit() *PortsH

PortInit - Initialize the port subsystem

func (*PortsH) PortAdd

func (P *PortsH) PortAdd(name string, osid int, ptype int, zone string,
	hwi PortHwInfo, l2i PortLayer2Info) (int, error)

PortAdd - add a port to flbnet realm

func (*PortsH) PortDel

func (P *PortsH) PortDel(name string, ptype int) (int, error)

PortDel - delete a port from flbnet realm

func (*PortsH) PortDestructAll

func (P *PortsH) PortDestructAll()

PortDestructAll - destroy all ports in flbnet realm

func (*PortsH) PortFindByName

func (P *PortsH) PortFindByName(name string) (p *Port)

PortFindByName - find a port in flbnet realm given port name

func (*PortsH) PortFindByOSID

func (P *PortsH) PortFindByOSID(osID int) (p *Port)

PortFindByOSID - find a port in flbnet realm given os identifier

func (*PortsH) PortGetSlaves

func (P *PortsH) PortGetSlaves(master string) (int, []*Port)

PortGetSlaves - get any slaves related to the given master interface

func (*PortsH) PortHasTunSlaves

func (P *PortsH) PortHasTunSlaves(master string, ptype int) (bool, []*Port)

PortHasTunSlaves - get any tunnel slaves related to the given master interface

func (*PortsH) PortL2AddrMatch

func (P *PortsH) PortL2AddrMatch(name string, mp *Port) bool

PortL2AddrMatch - check if port of given name has the same hw-mac address as the port contained in the given pointer

func (*PortsH) PortNotifierRegister

func (P *PortsH) PortNotifierRegister(notifier PortEventIntf)

PortNotifierRegister - register an interface implementation of type PortEventIntf

func (*PortsH) PortTicker

func (P *PortsH) PortTicker()

PortTicker - a ticker routine for ports

func (*PortsH) PortUpdateProp

func (P *PortsH) PortUpdateProp(name string, prop cmn.PortProp, zone string, updt bool, propVal int) (int, error)

PortUpdateProp - update port properties given an existing port

func (*PortsH) Ports2Json

func (P *PortsH) Ports2Json(w io.Writer) error

Ports2Json - dump ports in flbnet realm to json format

func (*PortsH) Ports2String

func (P *PortsH) Ports2String(it IterIntf) error

Ports2String - dump ports in flbnet realm to string format

func (*PortsH) PortsToGet

func (P *PortsH) PortsToGet() ([]cmn.PortDump, error)

PortsToGet - dump ports in flbnet realm to api format

type Rt

type Rt struct {
	Key       RtKey
	Addr      net.IP
	Attr      RtAttr
	TFlags    int
	Dead      bool
	Sync      DpStatusT
	ZoneNum   int
	Mark      uint64
	Stat      RtStat
	NhAttr    []RtNhAttr
	NextHops  []*Neigh
	RtDepObjs []RtDepObj
}

Rt - the rt entry

func (*Rt) DP

func (rt *Rt) DP(work DpWorkT) int

DP - Sync state of route entities to data-path

func (*Rt) RtGetNhMark

func (rt *Rt) RtGetNhMark() uint64

RtGetNhMark - get the rt-entry's neighbor identifier

type RtAttr

type RtAttr struct {
	Protocol  int
	OSFlags   int
	HostRoute bool
	Ifi       int
}

RtAttr - extra attribs for a rt entry

type RtDepObj

type RtDepObj interface {
}

RtDepObj - an empty interface to hold any object dependent on rt entry

type RtH

type RtH struct {
	RtMap map[RtKey]*Rt
	Trie4 *tk.TrieRoot
	Trie6 *tk.TrieRoot
	Zone  *Zone
	Mark  *tk.Counter
}

RtH - context container

func RtInit

func RtInit(zone *Zone) *RtH

RtInit - Initialize the route subsystem

func (*RtH) RouteGet

func (r *RtH) RouteGet() ([]cmn.RouteGet, error)

RouteGet - tlpm package interface implementation

func (*RtH) RoutesSync

func (r *RtH) RoutesSync()

RoutesSync - grab statistics for a rt entry

func (*RtH) RoutesTicker

func (r *RtH) RoutesTicker()

RoutesTicker - a ticker for this subsystem

func (*RtH) RtAdd

func (r *RtH) RtAdd(Dst net.IPNet, Zone string, Ra RtAttr, Na []RtNhAttr) (int, error)

RtAdd - Add a route

func (*RtH) RtDelete

func (r *RtH) RtDelete(Dst net.IPNet, Zone string) (int, error)

RtDelete - Delete a route

func (*RtH) RtDeleteByPort

func (r *RtH) RtDeleteByPort(port string) (int, error)

RtDeleteByPort - Delete a route which has specified port association

func (*RtH) RtDestructAll

func (r *RtH) RtDestructAll()

RtDestructAll - Destroy all rt entries

func (*RtH) RtFind

func (r *RtH) RtFind(Dst net.IPNet, Zone string) *Rt

RtFind - Find a route matching given IPNet in a zone

func (*RtH) Rts2String

func (r *RtH) Rts2String(it IterIntf) error

Rts2String - Format rt entries to a string

func (*RtH) TrieData2String

func (r *RtH) TrieData2String(d tk.TrieData) string

TrieData2String - tlpm package interface implementation

func (*RtH) TrieNodeWalker

func (r *RtH) TrieNodeWalker(b string)

TrieNodeWalker - tlpm package interface implementation

type RtKey

type RtKey struct {
	RtCidr string
	Zone   string
}

RtKey - key for a rt entry

type RtNhAttr

type RtNhAttr struct {
	NhAddr    net.IP
	LinkIndex int
}

RtNhAttr - neighbor attribs for a rt entry

type RtStat

type RtStat struct {
	Packets uint64
	Bytes   uint64
}

RtStat - statistics of a rt entry

type RuleCfg

type RuleCfg struct {
	RuleInactTries   int
	RuleInactChkTime int
}

RuleCfg - tunable parameters related to inactive rules

type RuleH

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

RuleH - context container

func RulesInit

func RulesInit(zone *Zone) *RuleH

RulesInit - initialize the Rules subsystem

func (*RuleH) AddEPHost

func (R *RuleH) AddEPHost(apiCall bool, hostName string, name string, args epHostOpts) (int, error)

AddEPHost - Add an end-point host name, if present will be used as endpoint key It will return 0 and nil error, else appropriate return code and error string will be set

func (*RuleH) AddFwRule

func (R *RuleH) AddFwRule(fwRule cmn.FwRuleArg, fwOptArgs cmn.FwOptArg) (int, error)

AddFwRule - Add a firewall rule. The rule details are passed in fwRule argument it will return 0 and nil error, else appropriate return code and error string will be set

func (*RuleH) AddNatLbRule

func (R *RuleH) AddNatLbRule(serv cmn.LbServiceArg, servSecIPs []cmn.LbSecIPArg, servEndPoints []cmn.LbEndPointArg) (int, error)

AddNatLbRule - Add a service LB nat rule. The service details are passed in serv argument, and end-point information is passed in the slice servEndPoints. On success, it will return 0 and nil error, else appropriate return code and error string will be set

func (*RuleH) AdvRuleVIPIfL2

func (R *RuleH) AdvRuleVIPIfL2(IP net.IP) error

func (*RuleH) DeleteEPHost

func (R *RuleH) DeleteEPHost(apiCall bool, name string, hostName string, probeType string, probePort uint16) (int, error)

DeleteEPHost - Delete an end-point host It will return 0 and nil error, else appropriate return code and error string will be set

func (*RuleH) DeleteFwRule

func (R *RuleH) DeleteFwRule(fwRule cmn.FwRuleArg) (int, error)

DeleteFwRule - Delete a firewall rule, On success, it will return 0 and nil error, else appropriate return code and error string will be set

func (*RuleH) DeleteNatLbRule

func (R *RuleH) DeleteNatLbRule(serv cmn.LbServiceArg) (int, error)

DeleteNatLbRule - Delete a service LB nat rule. The service details are passed in serv argument. On success, it will return 0 and nil error, else appropriate return code and error string will be set

func (*RuleH) GetEpHosts

func (R *RuleH) GetEpHosts() ([]cmn.EndPointMod, error)

GetEpHosts - get all end-points and pack them into a cmn.EndPointMod slice

func (*RuleH) GetFwRule

func (R *RuleH) GetFwRule() ([]cmn.FwRuleMod, error)

GetFwRule - get all Fwrules and pack them into a cmn.FwRuleMod slice

func (*RuleH) GetNatLbRule

func (R *RuleH) GetNatLbRule() ([]cmn.LbRuleMod, error)

GetNatLbRule - get all rules and pack them into a cmn.LbRuleMod slice

func (*RuleH) GetNatLbRuleByID

func (R *RuleH) GetNatLbRuleByID(ruleID uint32) *ruleEnt

GetNatLbRuleByID - Get a NAT rule by its identifier

func (*RuleH) GetNatLbRuleByServArgs

func (R *RuleH) GetNatLbRuleByServArgs(serv cmn.LbServiceArg) *ruleEnt

GetNatLbRuleByServArgs - Get a NAT rule by its service args

func (*RuleH) GetNatLbRuleSecIPs

func (R *RuleH) GetNatLbRuleSecIPs(serv cmn.LbServiceArg) []string

GetNatLbRuleSecIPs - Get secondary IPs for SCTP NAT rule by its service args

func (*RuleH) IsEPHostActive

func (R *RuleH) IsEPHostActive(epKey string) bool

IsEPHostActive - Check if end-point is active

func (*RuleH) RuleDestructAll

func (R *RuleH) RuleDestructAll()

RuleDestructAll - Destructor routine for all rules

func (*RuleH) Rules2Json

func (R *RuleH) Rules2Json() ([]byte, error)

Rules2Json - output all rules into json and write to the byte array

func (*RuleH) RulesSync

func (R *RuleH) RulesSync()

RulesSync - This is periodic ticker routine which does two main things : 1. Syncs rule statistics counts 2. Check health of lb-rule end-points

func (*RuleH) RulesTicker

func (R *RuleH) RulesTicker()

RulesTicker - Ticker for all rules

type SessH

type SessH struct {
	UserMap map[UserKey]*UserSess
	Zone    *Zone
	Mark    *tk.Counter
}

SessH - session context handler

func SessInit

func SessInit(zone *Zone) *SessH

SessInit - routine to initialize session context

func (*SessH) SessAdd

func (s *SessH) SessAdd(user string, IP net.IP, anTun cmn.SessTun, cnTun cmn.SessTun) (int, error)

SessAdd - routine to add a user session

func (*SessH) SessDelete

func (s *SessH) SessDelete(user string) (int, error)

SessDelete - routine to delete a user session

func (*SessH) SessGet

func (s *SessH) SessGet() ([]cmn.SessionMod, error)

SessGet - routine to get session list

func (*SessH) SessUlclGet

func (s *SessH) SessUlclGet() ([]cmn.SessionUlClMod, error)

SessUlclGet - routine to get uplink classifier list

func (*SessH) SessionTicker

func (s *SessH) SessionTicker()

SessionTicker - ticker routine to sync session information with DP

func (*SessH) SessionsSync

func (s *SessH) SessionsSync()

SessionsSync - routine to sync session information with DP

func (*SessH) USess2String

func (s *SessH) USess2String(it IterIntf) error

USess2String - converts all user session information to string format

func (*SessH) UlClAddCls

func (s *SessH) UlClAddCls(user string, cls cmn.UlClArg) (int, error)

UlClAddCls - routine to add an uplink classifier to user session

func (*SessH) UlClDeleteCls

func (s *SessH) UlClDeleteCls(user string, cls cmn.UlClArg) (int, error)

UlClDeleteCls - routine to delete an uplink classifier from user session

type UlClInf

type UlClInf struct {
	Addr   net.IP
	Qfi    uint8
	NumUl  uint64
	NumDl  uint64
	Status DpStatusT
	Stats  UlClStats
	// contains filtered or unexported fields
}

UlClInf - uplink classifier info

func (*UlClInf) DP

func (ulcl *UlClInf) DP(work DpWorkT) int

DP - Sync state of session and ulcl filter entities to data-path

type UlClStats

type UlClStats struct {
	UlPackets uint64
	UlBytes   uint64
	DlPackets uint64
	DlBytes   uint64
}

UlClStats - uplink classifier statistics

type UserKey

type UserKey struct {
	UserID string
}

UserKey - key to identify user

type UserSess

type UserSess struct {
	Key   UserKey
	Addr  net.IP
	Zone  int
	AnTun cmn.SessTun
	CnTun cmn.SessTun
	UlCl  map[string]*UlClInf
}

UserSess - user session info

type UserTun

type UserTun struct {
	TeID uint32
	Addr net.IP
}

UserTun - user tunnel information

type Vlan

type Vlan struct {
	VlanID        int
	Created       bool
	Name          string
	Zone          string
	NumTagPorts   int
	TaggedPorts   [MaxInterfaces]*Port
	NumUnTagPorts int
	UnTaggedPorts [MaxInterfaces]*Port
	Stat          vlanStat
}

Vlan - vlan interface info

func (*Vlan) DP

func (v *Vlan) DP(work DpWorkT) int

DP - routine to sync vlan information with datapath

type VlansH

type VlansH struct {
	VlanMap [MaximumVlans]Vlan
	Zone    *Zone
}

VlansH - vlan context handler

func VlanInit

func VlanInit(zone *Zone) *VlansH

VlanInit - routine to initialize vlan context handler

func (*VlansH) VlanAdd

func (V *VlansH) VlanAdd(vlanID int, name string, zone string, osid int, hwi PortHwInfo) (int, error)

VlanAdd - routine to add vlan interface

func (*VlansH) VlanDelete

func (V *VlansH) VlanDelete(vlanID int) (int, error)

VlanDelete - routine to delete vlan interface

func (*VlansH) VlanDestructAll

func (V *VlansH) VlanDestructAll()

VlanDestructAll - routine to delete all vlan interfaces

func (*VlansH) VlanGet

func (V *VlansH) VlanGet() ([]cmn.VlanGet, error)

VlanGet - Routine to get vlan bridge details

func (*VlansH) VlanPortAdd

func (V *VlansH) VlanPortAdd(vlanID int, portName string, tagged bool) (int, error)

VlanPortAdd - routine to add a port membership to vlan

func (*VlansH) VlanPortDelete

func (V *VlansH) VlanPortDelete(vlanID int, portName string, tagged bool) (int, error)

VlanPortDelete - routine to delete a port membership from vlan

func (*VlansH) Vlans2String

func (V *VlansH) Vlans2String(it IterIntf) error

Vlans2String - routine to convert vlan information to string

func (*VlansH) VlansSync

func (V *VlansH) VlansSync()

VlansSync - routine to sync vlan information with DP

func (*VlansH) VlansTicker

func (V *VlansH) VlansTicker()

VlansTicker - ticker routine to sync all vlan information with datapath

type Zone

type Zone struct {
	Name    string
	ZoneNum int
	Ports   *PortsH
	Vlans   *VlansH
	L2      *L2H
	Nh      *NeighH
	Rt      *RtH
	L3      *L3H
	Rules   *RuleH
	Sess    *SessH
	Pols    *PolH
	Mirrs   *MirrH
	Mtx     sync.RWMutex
}

Zone - zone info

type ZoneH

type ZoneH struct {
	ZoneMap   map[string]*Zone
	ZoneBrs   map[string]*Zone
	ZonePorts map[string]*Zone
	ZoneMark  *tk.Counter
}

ZoneH - Zone context handler

func ZoneInit

func ZoneInit() *ZoneH

ZoneInit - routine to initialize zone context handler

func (*ZoneH) GetPortZone

func (z *ZoneH) GetPortZone(port string) *Zone

GetPortZone - routine to identify the zone of a port

func (*ZoneH) ZoneAdd

func (z *ZoneH) ZoneAdd(name string) (int, error)

ZoneAdd - routine to add a zone

func (*ZoneH) ZoneBrAdd

func (z *ZoneH) ZoneBrAdd(name string, zns string) (int, error)

ZoneBrAdd - Routine to add a bridge in a zone

func (*ZoneH) ZoneBrDelete

func (z *ZoneH) ZoneBrDelete(name string) (int, error)

ZoneBrDelete - routine to delete a bridge from the zone

func (*ZoneH) ZoneDelete

func (z *ZoneH) ZoneDelete(name string) (int, error)

ZoneDelete - routine to delete a zone

func (*ZoneH) ZonePortAdd

func (z *ZoneH) ZonePortAdd(name string, zns string) (int, error)

ZonePortAdd - routine to add a port to a zone

func (*ZoneH) ZonePortDelete

func (z *ZoneH) ZonePortDelete(name string) (int, error)

ZonePortDelete - routine to delete a port from a zone

func (*ZoneH) ZonePortIsValid

func (z *ZoneH) ZonePortIsValid(name string, zns string) (int, error)

ZonePortIsValid - routine to check if the port belongs to a zone

func (*ZoneH) ZoneTicker

func (z *ZoneH) ZoneTicker()

ZoneTicker - This ticker routine takes care of all house-keeping operations for all instances of security zones. This is called from lbnetTicker

func (*ZoneH) Zonefind

func (z *ZoneH) Zonefind(name string) (*Zone, int)

Zonefind - routine to find a zone

Jump to

Keyboard shortcuts

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