loxinet

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CIErrBase = iota - 90000
	CIModErr
	CIStateErr
)

error codes for cluster module

View Source
const (
	KAConfigFile = "/etc/keepalived/keepalived.conf"
	KAPidFile1   = "/var/run/keepalived.pid"
	KAPidFile2   = "/var/run/vrrp.pid"
)

Config related constants

View Source
const (
	MapNameCt4  = "CT4"
	MapNameCt6  = "CT6"
	MapNameNat4 = "NAT4"
	MapNameBD   = "BD"
	MapNameRxBD = "RXBD"
	MapNameTxBD = "TXBD"
	MapNameRt4  = "RT4"
	MapNameULCL = "ULCL"
	MapNameIpol = "IPOL"
	MapNameFw4  = "FW4"
)

man names constants

View Source
const (
	DpErrBase = iota - 103000
	DpWqUnkErr
)

error codes

View Source
const (
	DpWorkQLen = 1024
	XSyncPort  = 22222
	DpTiVal    = 20
)

maximum dp work queue lengths

View Source
const (
	RPCTypeNetRPC = iota
	RPCTypeGRPC
)
View Source
const (
	EbpfErrBase = iota - 50000
	EbpfErrPortPropAdd
	EbpfErrPortPropDel
	EbpfErrEbpfLoad
	EbpfErrEbpfUnload
	EbpfErrL2AddrAdd
	EbpfErrL2AddrDel
	EbpfErrTmacAdd
	EbpfErrTmacDel
	EbpfErrNhAdd
	EbpfErrNhDel
	EbpfErrRt4Add
	EbpfErrRt4Del
	EbpfErrNat4Add
	EbpfErrNat4Del
	EbpfErrSess4Add
	EbpfErrSess4Del
	EbpfErrPolAdd
	EbpfErrPolDel
	EbpfErrMirrAdd
	EbpfErrMirrDel
	EbpfErrFwAdd
	EbpfErrFwDel
	EbpfErrCtAdd
	EbpfErrCtDel
	EbpfErrWqUnk
)

error codes

View Source
const (
	BGPConnected goBgpState = iota
	BGPDisconnected
)

goBGP connected status

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

error codes

View Source
const (
	L3ErrBase = iota - 8000
	L3AddrErr
	L3ObjErr
)

constants

View Source
const (
	LoxinetTiVal   = 10
	GoBGPInitTiVal = 5
	KAInitTiVal    = 35
)

constants

View Source
const (
	MkfsScript     = "/usr/local/sbin/mkllb_bpffs"
	BpfFsCheckFile = "/opt/loxilb/dp/bpf/intf_map"
	ARPAcceptAll   = "sysctl net.ipv4.conf.all.arp_accept=1"
	ARPAcceptDfl   = "sysctl net.ipv4.conf.default.arp_accept=1"
)

utility variables

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
	NeighRslvdAts  = 40
	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 - 7000
	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 loxilb constants

View Source
const (
	SessErrBase = iota - 102000
	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 - 6000
	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 = 4094
)

constant to declare maximum number of vlans

View Source
const (
	MaximumZones = 256
)

constant to define maximum number of zones

View Source
const (
	RootZone = "root"
)

string constant representing root security zone

Variables

View Source
var File_loxinet_xsync_proto protoreflect.FileDescriptor
View Source
var XSync_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "XSync",
	HandlerType: (*XSyncServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "DpWorkOnCtGetGRPC",
			Handler:    _XSync_DpWorkOnCtGetGRPC_Handler,
		},
		{
			MethodName: "DpWorkOnCtModGRPC",
			Handler:    _XSync_DpWorkOnCtModGRPC_Handler,
		},
		{
			MethodName: "DpWorkOnBlockCtModGRPC",
			Handler:    _XSync_DpWorkOnBlockCtModGRPC_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "loxinet/xsync.proto",
}

XSync_ServiceDesc is the grpc.ServiceDesc for XSync service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func DpEbpfDPLogLevel added in v0.8.7

func DpEbpfDPLogLevel(cfg *C.struct_ebpfcfg, debug tk.LogLevelT)

DpEbpfDPLogLevel - Routine to set log level for DP

func DpEbpfSetLogLevel added in v0.8.7

func DpEbpfSetLogLevel(logLevel tk.LogLevelT)

DpEbpfSetLogLevel - Set log level for ebpf subsystem

func DpL2AddrMod

func DpL2AddrMod(w *L2AddrDpWorkQ) int

DpL2AddrMod - routine to work on a ebpf l2 addr request

func DpNatLbRuleMod

func DpNatLbRuleMod(w *NatDpWorkQ) int

DpNatLbRuleMod - routine to work on a ebpf nat-lb change request

func DpNextHopMod

func DpNextHopMod(w *NextHopDpWorkQ) int

DpNextHopMod - routine to work on a ebpf next-hop change request

func DpRouteMod

func DpRouteMod(w *RouteDpWorkQ) int

DpRouteMod - routine to work on a ebpf route change request

func DpRouterMacMod

func DpRouterMacMod(w *RouterMacDpWorkQ) int

DpRouterMacMod - routine to work on a ebpf rt-mac change request

func DpWorker

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

DpWorker - DP worker routine listening on a channel

func FileCreate added in v0.8.0

func FileCreate(fname string) int

FileCreate - Create a file

func FileExists added in v0.8.0

func FileExists(fname string) bool

FileExists - Check if file exists

func FormatTimedelta added in v0.9.1

func FormatTimedelta(t time.Time) string

func GetFlagToString added in v0.8.0

func GetFlagToString(flag int) string

GetFlagToString - Stringify route flags

func GratArpReq added in v0.9.0

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

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

func GratArpReqWithCtx added in v0.9.0

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 added in v0.8.3

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 added in v0.9.0

func IsIPHostAddr(ipString string) bool

IsIPHostAddr - Check if provided address is a local address

func IsIPHostNetAddr added in v0.9.0

func IsIPHostNetAddr(ip net.IP) bool

IsIPHostNetAddr - Check if provided address is a local subnet

func IsLoxiAPIActive added in v0.8.0

func IsLoxiAPIActive(url string) bool

IsLoxiAPIActive - Check if API url is active

func KAString2Mode added in v0.8.0

func KAString2Mode(kaStr string) (bool, bool)

KAString2Mode - Convert ka mode in string opts to spawn/KAMode

func LogString2Level added in v0.8.0

func LogString2Level(logStr string) tk.LogLevelT

LogString2Level - Convert log level in string to LogLevelT

func LoxiXsyncMain added in v0.8.8

func LoxiXsyncMain(mode string)

LoxiXsyncMain - State Sync subsystem init

func Main added in v0.8.0

func Main()

Main - main routine of loxinet

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 added in v0.8.0

func ReadPIDFile(pf string) int

ReadPIDFile - Read a PID file

func RegisterXSyncServer added in v0.9.0

func RegisterXSyncServer(s grpc.ServiceRegistrar, srv XSyncServer)

func Rt2String

func Rt2String(rt *Rt) string

Rt2String - stringify the rt entry

func RunCommand added in v0.8.0

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

RunCommand - Run a bash command

func TestLoxinet

func TestLoxinet(t *testing.T)

TestLoxinet - Go unit test entry point

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 BlockCtInfoMod added in v0.9.0

type BlockCtInfoMod struct {
	Add bool      `protobuf:"varint,1,opt,name=add,proto3" json:"add,omitempty"`
	Ct  []*CtInfo `protobuf:"bytes,2,rep,name=ct,proto3" json:"ct,omitempty"`
	// contains filtered or unexported fields
}

func (*BlockCtInfoMod) Descriptor deprecated added in v0.9.0

func (*BlockCtInfoMod) Descriptor() ([]byte, []int)

Deprecated: Use BlockCtInfoMod.ProtoReflect.Descriptor instead.

func (*BlockCtInfoMod) GetAdd added in v0.9.0

func (x *BlockCtInfoMod) GetAdd() bool

func (*BlockCtInfoMod) GetCt added in v0.9.0

func (x *BlockCtInfoMod) GetCt() []*CtInfo

func (*BlockCtInfoMod) ProtoMessage added in v0.9.0

func (*BlockCtInfoMod) ProtoMessage()

func (*BlockCtInfoMod) ProtoReflect added in v0.9.0

func (x *BlockCtInfoMod) ProtoReflect() protoreflect.Message

func (*BlockCtInfoMod) Reset added in v0.9.0

func (x *BlockCtInfoMod) Reset()

func (*BlockCtInfoMod) String added in v0.9.0

func (x *BlockCtInfoMod) String() string

type CIStateH added in v0.8.0

type CIStateH struct {
	SpawnKa bool

	ClusterMap map[string]*ClusterInstance
	StateMap   map[string]int
	NodeMap    map[string]*ClusterNode
	// contains filtered or unexported fields
}

CIStateH - Cluster context handler

func CIInit added in v0.8.0

func CIInit(spawnKa bool, kaMode bool) *CIStateH

CIInit - routine to initialize Cluster context

func (*CIStateH) CISpawn added in v0.8.0

func (h *CIStateH) CISpawn()

CISpawn - Spawn CI application

func (*CIStateH) CIStateGet added in v0.8.0

func (h *CIStateH) CIStateGet() ([]cmn.HASMod, error)

CIStateGet - routine to get HA state

func (*CIStateH) CIStateGetInst added in v0.8.0

func (h *CIStateH) CIStateGetInst(inst string) (string, error)

CIStateGetInst - routine to get HA state

func (*CIStateH) CIStateUpdate added in v0.8.0

func (h *CIStateH) CIStateUpdate(cm cmn.HASMod) (int, error)

CIStateUpdate - routine to update cluster state

func (*CIStateH) CISync added in v0.8.0

func (h *CIStateH) CISync()

func (*CIStateH) CITicker added in v0.8.0

func (h *CIStateH) CITicker()

CITicker - Periodic ticker for Cluster module

func (*CIStateH) CIVipGet added in v0.8.0

func (h *CIStateH) CIVipGet(inst string) (net.IP, error)

CIVipGet - routine to get HA state

func (*CIStateH) ClusterNodeAdd added in v0.8.0

func (h *CIStateH) ClusterNodeAdd(node cmn.ClusterNodeMod) (int, error)

ClusterNodeAdd - routine to update cluster nodes

func (*CIStateH) ClusterNodeDelete added in v0.8.0

func (h *CIStateH) ClusterNodeDelete(node cmn.ClusterNodeMod) (int, error)

ClusterNodeDelete - routine to delete cluster node

func (*CIStateH) IsCIKAMode added in v0.8.0

func (h *CIStateH) IsCIKAMode() bool

IsCIKAMode - routine to get HA state

type ClusterInstance added in v0.8.0

type ClusterInstance struct {
	State    int
	StateStr string
	Vip      net.IP
}

ClusterInstance - Struct for Cluster Instance information

type ClusterNode added in v0.8.0

type ClusterNode struct {
	Addr   net.IP
	Status DpStatusT
}

ClusterNode - Struct for Cluster Node Information

func (*ClusterNode) DP added in v0.8.0

func (cn *ClusterNode) DP(work DpWorkT) int

DP - sync state of cluster-node entity to data-path

type ConnGet added in v0.9.0

type ConnGet struct {
	Async int32 `protobuf:"varint,1,opt,name=async,proto3" json:"async,omitempty"`
	// contains filtered or unexported fields
}

func (*ConnGet) Descriptor deprecated added in v0.9.0

func (*ConnGet) Descriptor() ([]byte, []int)

Deprecated: Use ConnGet.ProtoReflect.Descriptor instead.

func (*ConnGet) GetAsync added in v0.9.0

func (x *ConnGet) GetAsync() int32

func (*ConnGet) ProtoMessage added in v0.9.0

func (*ConnGet) ProtoMessage()

func (*ConnGet) ProtoReflect added in v0.9.0

func (x *ConnGet) ProtoReflect() protoreflect.Message

func (*ConnGet) Reset added in v0.9.0

func (x *ConnGet) Reset()

func (*ConnGet) String added in v0.9.0

func (x *ConnGet) String() string

type CtInfo added in v0.9.0

type CtInfo struct {
	Dip        []byte `protobuf:"bytes,1,opt,name=dip,proto3" json:"dip,omitempty"`
	Sip        []byte `protobuf:"bytes,2,opt,name=sip,proto3" json:"sip,omitempty"`
	Dport      int32  `protobuf:"varint,3,opt,name=dport,proto3" json:"dport,omitempty"`
	Sport      int32  `protobuf:"varint,4,opt,name=sport,proto3" json:"sport,omitempty"`
	Proto      string `protobuf:"bytes,5,opt,name=proto,proto3" json:"proto,omitempty"`
	Cstate     string `protobuf:"bytes,6,opt,name=cstate,proto3" json:"cstate,omitempty"`
	Cact       string `protobuf:"bytes,7,opt,name=cact,proto3" json:"cact,omitempty"`
	Ci         string `protobuf:"bytes,8,opt,name=ci,proto3" json:"ci,omitempty"`
	Packets    int64  `protobuf:"varint,9,opt,name=packets,proto3" json:"packets,omitempty"`
	Bytes      int64  `protobuf:"varint,10,opt,name=bytes,proto3" json:"bytes,omitempty"`
	Deleted    int32  `protobuf:"varint,11,opt,name=deleted,proto3" json:"deleted,omitempty"`
	Pkey       []byte `protobuf:"bytes,12,opt,name=pkey,proto3" json:"pkey,omitempty"`
	Pval       []byte `protobuf:"bytes,13,opt,name=pval,proto3" json:"pval,omitempty"`
	Xsync      bool   `protobuf:"varint,14,opt,name=xsync,proto3" json:"xsync,omitempty"`
	Serviceip  []byte `protobuf:"bytes,15,opt,name=serviceip,proto3" json:"serviceip,omitempty"`
	Servproto  string `protobuf:"bytes,16,opt,name=servproto,proto3" json:"servproto,omitempty"`
	L4Servport int32  `protobuf:"varint,17,opt,name=l4servport,proto3" json:"l4servport,omitempty"`
	Blocknum   int32  `protobuf:"varint,18,opt,name=blocknum,proto3" json:"blocknum,omitempty"`
	// contains filtered or unexported fields
}

func (*CtInfo) ConvertToDpCtInfo added in v0.9.0

func (ci *CtInfo) ConvertToDpCtInfo() DpCtInfo

func (*CtInfo) Descriptor deprecated added in v0.9.0

func (*CtInfo) Descriptor() ([]byte, []int)

Deprecated: Use CtInfo.ProtoReflect.Descriptor instead.

func (*CtInfo) GetBlocknum added in v0.9.0

func (x *CtInfo) GetBlocknum() int32

func (*CtInfo) GetBytes added in v0.9.0

func (x *CtInfo) GetBytes() int64

func (*CtInfo) GetCact added in v0.9.0

func (x *CtInfo) GetCact() string

func (*CtInfo) GetCi added in v0.9.0

func (x *CtInfo) GetCi() string

func (*CtInfo) GetCstate added in v0.9.0

func (x *CtInfo) GetCstate() string

func (*CtInfo) GetDeleted added in v0.9.0

func (x *CtInfo) GetDeleted() int32

func (*CtInfo) GetDip added in v0.9.0

func (x *CtInfo) GetDip() []byte

func (*CtInfo) GetDport added in v0.9.0

func (x *CtInfo) GetDport() int32

func (*CtInfo) GetL4Servport added in v0.9.0

func (x *CtInfo) GetL4Servport() int32

func (*CtInfo) GetPackets added in v0.9.0

func (x *CtInfo) GetPackets() int64

func (*CtInfo) GetPkey added in v0.9.0

func (x *CtInfo) GetPkey() []byte

func (*CtInfo) GetProto added in v0.9.0

func (x *CtInfo) GetProto() string

func (*CtInfo) GetPval added in v0.9.0

func (x *CtInfo) GetPval() []byte

func (*CtInfo) GetServiceip added in v0.9.0

func (x *CtInfo) GetServiceip() []byte

func (*CtInfo) GetServproto added in v0.9.0

func (x *CtInfo) GetServproto() string

func (*CtInfo) GetSip added in v0.9.0

func (x *CtInfo) GetSip() []byte

func (*CtInfo) GetSport added in v0.9.0

func (x *CtInfo) GetSport() int32

func (*CtInfo) GetXsync added in v0.9.0

func (x *CtInfo) GetXsync() bool

func (*CtInfo) ProtoMessage added in v0.9.0

func (*CtInfo) ProtoMessage()

func (*CtInfo) ProtoReflect added in v0.9.0

func (x *CtInfo) ProtoReflect() protoreflect.Message

func (*CtInfo) Reset added in v0.9.0

func (x *CtInfo) Reset()

func (*CtInfo) String added in v0.9.0

func (x *CtInfo) String() string

type CtInfoMod added in v0.9.0

type CtInfoMod struct {
	Add bool    `protobuf:"varint,1,opt,name=add,proto3" json:"add,omitempty"`
	Ct  *CtInfo `protobuf:"bytes,2,opt,name=ct,proto3" json:"ct,omitempty"`
	// contains filtered or unexported fields
}

func (*CtInfoMod) Descriptor deprecated added in v0.9.0

func (*CtInfoMod) Descriptor() ([]byte, []int)

Deprecated: Use CtInfoMod.ProtoReflect.Descriptor instead.

func (*CtInfoMod) GetAdd added in v0.9.0

func (x *CtInfoMod) GetAdd() bool

func (*CtInfoMod) GetCt added in v0.9.0

func (x *CtInfoMod) GetCt() *CtInfo

func (*CtInfoMod) ProtoMessage added in v0.9.0

func (*CtInfoMod) ProtoMessage()

func (*CtInfoMod) ProtoReflect added in v0.9.0

func (x *CtInfoMod) ProtoReflect() protoreflect.Message

func (*CtInfoMod) Reset added in v0.9.0

func (x *CtInfoMod) Reset()

func (*CtInfoMod) String added in v0.9.0

func (x *CtInfoMod) String() string

type DpCtInfo

type DpCtInfo struct {
	DIP     net.IP    `json:"dip"`
	SIP     net.IP    `json:"sip"`
	Dport   uint16    `json:"dport"`
	Sport   uint16    `json:"sport"`
	Proto   string    `json:"proto"`
	CState  string    `json:"cstate"`
	CAct    string    `json:"cact"`
	CI      string    `json:"ci"`
	Packets uint64    `json:"packets"`
	Bytes   uint64    `json:"bytes"`
	Deleted int       `json:"deleted"`
	PKey    []byte    `json:"pkey"`
	PVal    []byte    `json:"pval"`
	LTs     time.Time `json:"lts"`
	NTs     time.Time `json:"nts"`
	XSync   bool      `json:"xsync"`

	// LB Association Data
	ServiceIP  net.IP `json:"serviceip"`
	ServProto  string `json:"servproto"`
	L4ServPort uint16 `json:"l4servproto"`
	BlockNum   uint16 `json:"blocknum"`
	RuleID     uint32 `json:"ruleid"`
}

DpCtInfo - representation of a datapath conntrack information

func (*DpCtInfo) ConvertToCtInfo added in v0.9.0

func (ci *DpCtInfo) ConvertToCtInfo(c *CtInfo)

func (*DpCtInfo) Key

func (ct *DpCtInfo) Key() string

Key - outputs a key string for given DpCtInfo pointer

func (*DpCtInfo) String added in v0.8.0

func (ct *DpCtInfo) String() string

String - stringify the given DpCtInfo

type DpEbpfH

type DpEbpfH struct {
	CtSync  bool
	RssEn   bool
	ToMapCh chan interface{}
	ToFinCh [mapNotifierWorkers]chan int
	// contains filtered or unexported fields
}

DpEbpfH - context container

func DpEbpfInit

func DpEbpfInit(clusterEn bool, nodeNum int, rssEn bool, egrHooks bool, logLevel tk.LogLevelT) *DpEbpfH

DpEbpfInit - initialize the ebpf dp subsystem

func (*DpEbpfH) DpCtAdd added in v0.8.0

func (e *DpEbpfH) DpCtAdd(w *DpCtInfo) int

DpCtAdd - routine to work on a ebpf ct add request

func (*DpEbpfH) DpCtDel added in v0.8.0

func (e *DpEbpfH) DpCtDel(w *DpCtInfo) int

DpCtDel - routine to work on a ebpf ct delete request

func (*DpEbpfH) DpCtGetAsync added in v0.8.0

func (e *DpEbpfH) DpCtGetAsync()

DpCtGetAsync - routine to work on a ebpf ct get async request

func (*DpEbpfH) DpEbpfUnInit added in v0.9.0

func (e *DpEbpfH) DpEbpfUnInit()

DpEbpfUnInit - uninitialize the ebpf dp subsystem

func (*DpEbpfH) DpFwRuleAdd added in v0.8.0

func (e *DpEbpfH) DpFwRuleAdd(w *FwDpWorkQ) int

DpFwRuleAdd - routine to work on a ebpf fw add request

func (*DpEbpfH) DpFwRuleDel added in v0.8.0

func (e *DpEbpfH) DpFwRuleDel(w *FwDpWorkQ) int

DpFwRuleDel - routine to work on a ebpf fw delete request

func (*DpEbpfH) DpFwRuleMod added in v0.8.0

func (e *DpEbpfH) DpFwRuleMod(w *FwDpWorkQ) int

DpFwRuleMod - routine to work on a ebpf fw mod request

func (*DpEbpfH) DpGetLock added in v0.9.0

func (e *DpEbpfH) DpGetLock()

DpTakeLock - routine to take underlying DP lock

func (*DpEbpfH) DpL2AddrAdd

func (e *DpEbpfH) DpL2AddrAdd(w *L2AddrDpWorkQ) int

DpL2AddrAdd - routine to work on a ebpf l2 addr add

func (*DpEbpfH) DpL2AddrDel

func (e *DpEbpfH) DpL2AddrDel(w *L2AddrDpWorkQ) int

DpL2AddrDel - routine to work on a ebpf l2 addr delete

func (*DpEbpfH) DpMirrAdd

func (e *DpEbpfH) DpMirrAdd(w *MirrDpWorkQ) int

DpMirrAdd - routine to work on a ebpf mirror add request

func (*DpEbpfH) DpMirrDel

func (e *DpEbpfH) DpMirrDel(w *MirrDpWorkQ) int

DpMirrDel - routine to work on a ebpf mirror delete request

func (*DpEbpfH) DpMirrMod

func (e *DpEbpfH) DpMirrMod(w *MirrDpWorkQ) int

DpMirrMod - routine to work on a ebpf mirror modify request

func (*DpEbpfH) DpNatLbRuleAdd

func (e *DpEbpfH) DpNatLbRuleAdd(w *NatDpWorkQ) int

DpNatLbRuleAdd - routine to work on a ebpf nat-lb add request

func (*DpEbpfH) DpNatLbRuleDel

func (e *DpEbpfH) DpNatLbRuleDel(w *NatDpWorkQ) int

DpNatLbRuleDel - routine to work on a ebpf nat-lb delete request

func (*DpEbpfH) DpNextHopAdd

func (e *DpEbpfH) DpNextHopAdd(w *NextHopDpWorkQ) int

DpNextHopAdd - routine to work on a ebpf next-hop add request

func (*DpEbpfH) DpNextHopDel

func (e *DpEbpfH) DpNextHopDel(w *NextHopDpWorkQ) int

DpNextHopDel - routine to work on a ebpf next-hop delete request

func (*DpEbpfH) DpPolAdd

func (e *DpEbpfH) DpPolAdd(w *PolDpWorkQ) int

DpPolAdd - routine to work on a ebpf policer add request

func (*DpEbpfH) DpPolDel

func (e *DpEbpfH) DpPolDel(w *PolDpWorkQ) int

DpPolDel - routine to work on a ebpf policer delete request

func (*DpEbpfH) DpPolMod

func (e *DpEbpfH) DpPolMod(w *PolDpWorkQ) int

DpPolMod - routine to work on a ebpf policer change request

func (*DpEbpfH) DpPortPropAdd

func (e *DpEbpfH) DpPortPropAdd(w *PortDpWorkQ) int

DpPortPropAdd - routine to work on a ebpf port property add

func (*DpEbpfH) DpPortPropDel

func (e *DpEbpfH) DpPortPropDel(w *PortDpWorkQ) int

DpPortPropDel - routine to work on a ebpf port property delete

func (*DpEbpfH) DpPortPropMod added in v0.8.8

func (e *DpEbpfH) DpPortPropMod(w *PortDpWorkQ) int

DpPortPropMod - routine to work on a ebpf port property request

func (*DpEbpfH) DpRelLock added in v0.9.0

func (e *DpEbpfH) DpRelLock()

DpRelLock - routine to release underlying DP lock

func (*DpEbpfH) DpRouteAdd

func (e *DpEbpfH) DpRouteAdd(w *RouteDpWorkQ) int

DpRouteAdd - routine to work on a ebpf route add request

func (*DpEbpfH) DpRouteDel

func (e *DpEbpfH) DpRouteDel(w *RouteDpWorkQ) int

DpRouteDel - routine to work on a ebpf route delete request

func (*DpEbpfH) DpRouterMacAdd

func (e *DpEbpfH) DpRouterMacAdd(w *RouterMacDpWorkQ) int

DpRouterMacAdd - routine to work on a ebpf rt-mac add request

func (*DpEbpfH) DpRouterMacDel

func (e *DpEbpfH) DpRouterMacDel(w *RouterMacDpWorkQ) int

DpRouterMacDel - routine to work on a ebpf rt-mac delete request

func (*DpEbpfH) DpStat

func (e *DpEbpfH) DpStat(w *StatDpWorkQ) int

DpStat - routine to work on a ebpf map statistics request

func (*DpEbpfH) DpTableGC added in v0.9.1

func (e *DpEbpfH) DpTableGC()

DpTableGC - Work on table garbage collection

func (*DpEbpfH) DpTableGet

func (e *DpEbpfH) DpTableGet(w *TableDpWorkQ) (DpRetT, error)

DpTableGet - routine to work on a ebpf map get request

func (*DpEbpfH) DpUlClAdd

func (e *DpEbpfH) DpUlClAdd(w *UlClDpWorkQ) int

DpUlClAdd - routine to work on a ebpf ul-cl filter add request

func (*DpEbpfH) DpUlClDel

func (e *DpEbpfH) DpUlClDel(w *UlClDpWorkQ) int

DpUlClDel - routine to work on a ebpf ul-cl filter delete request

func (*DpEbpfH) DpUlClMod

func (e *DpEbpfH) DpUlClMod(w *UlClDpWorkQ) int

DpUlClMod - routine to work on a ebpf ul-cl filter change request

type DpH

type DpH struct {
	ToDpCh   chan interface{}
	FromDpCh chan interface{}
	ToFinCh  chan int
	DpHooks  DpHookInterface
	SyncMtx  sync.RWMutex
	Peers    []DpPeer
	RPC      *XSync
	Remotes  []XSync
}

DpH - datapath context container

func DpBrokerInit

func DpBrokerInit(dph DpHookInterface, rpcMode int) *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 added in v0.8.0

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) DpWorkOnPeerOp added in v0.8.0

func (dp *DpH) DpWorkOnPeerOp(pWq *PeerDpWorkQ) DpRetT

DpWorkOnPeerOp - routine to work on a peer request for clustering

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

func (*DpH) DpXsyncInSync added in v0.8.0

func (dp *DpH) DpXsyncInSync() bool

DpXsyncInSync - Routine to check if remote peer is in sync

func (*DpH) DpXsyncRPC added in v0.9.0

func (dp *DpH) DpXsyncRPC(op DpSyncOpT, arg interface{}) int

DpXsyncRPC - Routine for syncing connection information with peers

func (*DpH) DpXsyncRPCReset added in v0.9.0

func (dp *DpH) DpXsyncRPCReset() int

DpXsyncRPCReset - Routine to reset Sunc RPC Client connections

func (*DpH) WaitXsyncReady added in v0.8.0

func (dp *DpH) WaitXsyncReady(who string)

WaitXsyncReady - Routine to wait till it ready for syncing the peer entity

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
	DpTableGC()
	DpCtGetAsync()
	DpGetLock()
	DpRelLock()
	DpEbpfUnInit()
}

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

type DpPeer added in v0.8.0

type DpPeer struct {
	Peer net.IP
	//Client *rpc.Client
	Client interface{}
}

DpPeer - Remote DP Peer information

type DpRetT

type DpRetT interface {
}

DpRetT - an empty interface to represent immediate operation result

func DpWorkSingle

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

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

type DpStatusT

type DpStatusT uint8

DpStatusT - status of a dp work

const (
	DpCreateErr DpStatusT = iota + 1
	DpRemoveErr
	DpChangeErr
	DpUknownErr
	DpInProgressErr
)

dp work status codes

type DpSyncOpT added in v0.8.0

type DpSyncOpT uint8

DpSyncOpT - Sync Operation type

const (
	DpSyncAdd DpSyncOpT = iota + 1
	DpSyncDelete
	DpSyncGet
	DpSyncBcast
)

Sync Operation type codes

type DpTunT

type DpTunT uint8

DpTunT - type of a dp tunnel

const (
	DpTunVxlan DpTunT = iota + 1
	DpTunGre
	DpTunGtp
	DpTunStt
	DpTunIPIP
)

tunnel type constants

type DpWorkT

type DpWorkT uint8

DpWorkT - type of requested work

const (
	DpCreate DpWorkT = iota + 1
	DpRemove
	DpChange
	DpStatsGet
	DpStatsClr
	DpMapGet
	DpStatsGetImm
)

dp work codes

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 FwDpWorkQ added in v0.8.0

type FwDpWorkQ struct {
	Work     DpWorkT
	Status   *DpStatusT
	ZoneNum  int
	SrcIP    net.IPNet
	DstIP    net.IPNet
	L4SrcMin uint16
	L4SrcMax uint16
	L4DstMin uint16
	L4DstMax uint16
	Port     uint16
	Pref     uint16
	Proto    uint8
	Mark     int
	FwType   FwOpT
	FwVal1   uint16
	FwVal2   uint32
	FwRecord bool
}

FwDpWorkQ - work queue entry for fw related operation

type FwOpT added in v0.8.0

type FwOpT uint8

FwOpT - type of firewall operation

const (
	DpFwDrop FwOpT = iota + 1
	DpFwFwd
	DpFwRdr
	DpFwTrap
)

Fw type constants

type GoBgpH

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

GoBgpH - context container

func GoBgpInit

func GoBgpInit(bgpPeerMode bool) *GoBgpH

GoBgpInit - initialize goBGP client subsystem

func (*GoBgpH) AddBGPRule

func (gbh *GoBgpH) AddBGPRule(instance string, IP []string)

AddBGPRule - add a bgp rule in goBGP

func (*GoBgpH) AddCurrBgpRoutesToIPRoute added in v0.9.0

func (gbh *GoBgpH) AddCurrBgpRoutesToIPRoute() error

AddCurrBgpRoutesToIPRoute - add bgp routes to OS

func (*GoBgpH) AdvertiseRoute

func (gbh *GoBgpH) AdvertiseRoute(rtPrefix string, pLen int, nh string, pref uint32, med uint32, ipv4 bool) int

AdvertiseRoute - advertise a new route using goBGP

func (*GoBgpH) BGPGlobalConfigAdd added in v0.9.0

func (gbh *GoBgpH) BGPGlobalConfigAdd(config cmn.GoBGPGlobalConfig) (int, error)

BGPGlobalConfigAdd - Routine to add global config in goBGP server

func (*GoBgpH) BGPNeighGet added in v0.9.1

func (gbh *GoBgpH) BGPNeighGet(address string, enableAdv bool) ([]cmn.GoBGPNeighGetMod, error)

BGPNeighGet - Routine to get BGP neigh from goBGP server

func (*GoBgpH) BGPNeighMod added in v0.9.0

func (gbh *GoBgpH) BGPNeighMod(add bool, neigh net.IP, ras uint32, rPort uint32, mhop bool) (int, error)

BGPNeighMod - Routine to add BGP neigh to goBGP server

func (*GoBgpH) DelAdvertiseRoute

func (gbh *GoBgpH) DelAdvertiseRoute(rtPrefix string, pLen int, nh string, pref uint32, med uint32) int

DelAdvertiseRoute - delete previously advertised route in goBGP

func (*GoBgpH) DelBGPRule

func (gbh *GoBgpH) DelBGPRule(instance string, IP []string)

DelBGPRule - delete a bgp rule in goBGP

func (*GoBgpH) GetgoBGPRoutesEvents added in v0.9.0

func (gbh *GoBgpH) GetgoBGPRoutesEvents(client api.GobgpApiClient) int

GetgoBGPRoutesEvents - get routes in goBGP

func (*GoBgpH) UpdateCIState added in v0.8.0

func (gbh *GoBgpH) UpdateCIState(instance string, state int, vip net.IP)

UpdateCIState - Routine to update CI state for this module and re-advertise with appropriate priority

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 loxinet subsystems entitities

type L2AddrDpWorkQ

type L2AddrDpWorkQ struct {
	Work    DpWorkT
	Status  *DpStatusT
	L2Addr  [6]uint8
	Tun     DpTunT
	NhNum   int
	PortNum int
	BD      int
	Tagged  int
}

L2AddrDpWorkQ - work queue entry for l2 address operation

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 added in v0.8.3

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 added in v0.9.0

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 added in v0.9.0

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 added in v0.8.0

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 added in v0.8.0

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 MirrDpWorkQ

type MirrDpWorkQ struct {
	Work      DpWorkT
	Name      string
	Mark      int
	MiPortNum int
	MiBD      int
	Status    *DpStatusT
}

MirrDpWorkQ - work queue entry for mirror operation

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 loxinet

func (*MirrH) MirrDelete

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

MirrDelete - Delete a mirror from loxinet

func (*MirrH) MirrDestructAll

func (M *MirrH) MirrDestructAll()

MirrDestructAll - destroy all mirrors

func (*MirrH) MirrGet added in v0.8.0

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

MirrGet - Get mirrors in loxinet

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 NatDpWorkQ

type NatDpWorkQ struct {
	Work      DpWorkT
	Status    *DpStatusT
	ZoneNum   int
	ServiceIP net.IP
	L4Port    uint16
	BlockNum  uint16
	DsrMode   bool
	CsumDis   bool
	Proto     uint8
	Mark      int
	NatType   NatT
	EpSel     NatSel
	InActTo   uint64
	// contains filtered or unexported fields
}

NatDpWorkQ - work queue entry for nat related operation

type NatEP

type NatEP struct {
	XIP      net.IP
	RIP      net.IP
	XPort    uint16
	Weight   uint8
	InActive bool
}

NatEP - a nat end-point

type NatSel

type NatSel uint8

NatSel - type of nat end-point selection algorithm

const (
	EpRR NatSel = iota + 1
	EpHash
	EpPrio
	EpRRPersist
)

nat selection algorithm constants

type NatT

type NatT uint8

NatT - type of NAT

const (
	DpSnat NatT = iota + 1
	DpDnat
	DpHsnat
	DpHdnat
	DpFullNat
)

nat type constants

type Neigh

type Neigh struct {
	Key      NeighKey
	Addr     net.IP
	Attr     NeighAttr
	Dummy    bool
	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 added in v0.8.3

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 added in v0.8.0

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 added in v0.8.0

type NetAPIStruct struct {
	BgpPeerMode bool
}

NetAPIStruct - empty struct for anchoring client routines

func NetAPIInit added in v0.8.0

func NetAPIInit(bgpPeerMode bool) *NetAPIStruct

NetAPIInit - Initialize a new instance of NetAPI

func (*NetAPIStruct) NetAddrAdd added in v0.8.0

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

NetAddrAdd - Add an ipv4 address in loxinet

func (*NetAPIStruct) NetAddrDel added in v0.8.0

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

NetAddrDel - Delete an ipv4 address in loxinet

func (*NetAPIStruct) NetAddrGet added in v0.8.0

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

NetAddrGet - Get an IPv4 Address info from loxinet

func (*NetAPIStruct) NetCIStateGet added in v0.8.0

func (na *NetAPIStruct) NetCIStateGet() ([]cmn.HASMod, error)

NetCIStateGet - Get current node cluster state

func (*NetAPIStruct) NetCIStateMod added in v0.8.0

func (na *NetAPIStruct) NetCIStateMod(hm *cmn.HASMod) (int, error)

NetCIStateMod - Modify cluster state

func (*NetAPIStruct) NetCtInfoGet added in v0.8.0

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

NetCtInfoGet - Get connection track info from loxinet

func (*NetAPIStruct) NetEpHostAdd added in v0.8.0

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

NetEpHostAdd - Add a LB end-point in loxinet

func (*NetAPIStruct) NetEpHostDel added in v0.8.0

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

NetEpHostDel - Delete a LB end-point in loxinet

func (*NetAPIStruct) NetEpHostGet added in v0.8.0

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

NetEpHostGet - Get LB end-points from loxinet

func (*NetAPIStruct) NetFdbAdd added in v0.8.0

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

NetFdbAdd - Add a forwarding database entry in loxinet

func (*NetAPIStruct) NetFdbDel added in v0.8.0

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

NetFdbDel - Delete a forwarding database entry in loxinet

func (*NetAPIStruct) NetFwRuleAdd added in v0.8.0

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

NetFwRuleAdd - Add a firewall rule in loxinet

func (*NetAPIStruct) NetFwRuleDel added in v0.8.0

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

NetFwRuleDel - Delete a firewall rule in loxinet

func (*NetAPIStruct) NetFwRuleGet added in v0.8.0

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

NetFwRuleGet - Get a firewall rule from loxinet

func (*NetAPIStruct) NetGoBGPGCAdd added in v0.9.0

func (na *NetAPIStruct) NetGoBGPGCAdd(param *cmn.GoBGPGlobalConfig) (int, error)

NetGoBGPGCAdd - Add bgp global config

func (*NetAPIStruct) NetGoBGPNeighAdd added in v0.9.0

func (na *NetAPIStruct) NetGoBGPNeighAdd(param *cmn.GoBGPNeighMod) (int, error)

NetGoBGPNeighAdd - Add bgp neigh to gobgp

func (*NetAPIStruct) NetGoBGPNeighDel added in v0.9.0

func (na *NetAPIStruct) NetGoBGPNeighDel(param *cmn.GoBGPNeighMod) (int, error)

NetGoBGPNeighDel - Del bgp neigh from gobgp

func (*NetAPIStruct) NetGoBGPNeighGet added in v0.9.1

func (na *NetAPIStruct) NetGoBGPNeighGet() ([]cmn.GoBGPNeighGetMod, error)

NetGoBGPNeighGet - Get bgp neigh to gobgp

func (*NetAPIStruct) NetHandlePanic added in v0.9.1

func (na *NetAPIStruct) NetHandlePanic()

NetHandlePanic - Handle panics

func (*NetAPIStruct) NetLbRuleAdd added in v0.8.0

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

NetLbRuleAdd - Add a load-balancer rule in loxinet

func (*NetAPIStruct) NetLbRuleDel added in v0.8.0

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

NetLbRuleDel - Delete a load-balancer rule in loxinet

func (*NetAPIStruct) NetLbRuleGet added in v0.8.0

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

NetLbRuleGet - Get a load-balancer rule from loxinet

func (*NetAPIStruct) NetMirrorAdd added in v0.8.0

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

NetMirrorAdd - Add a mirror in loxinet

func (*NetAPIStruct) NetMirrorDel added in v0.8.0

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

NetMirrorDel - Delete a mirror in loxinet

func (*NetAPIStruct) NetMirrorGet added in v0.8.0

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

NetMirrorGet - Get a mirror in loxinet

func (*NetAPIStruct) NetNeighAdd added in v0.8.0

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

NetNeighAdd - Add a neighbor in loxinet

func (*NetAPIStruct) NetNeighDel added in v0.8.0

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

NetNeighDel - Delete a neighbor in loxinet

func (*NetAPIStruct) NetNeighGet added in v0.8.0

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

NetNeighGet - Get a neighbor in loxinet

func (*NetAPIStruct) NetParamGet added in v0.8.0

func (na *NetAPIStruct) NetParamGet(param *cmn.ParamMod) (int, error)

NetParamGet - Get operational params of loxinet

func (*NetAPIStruct) NetParamSet added in v0.8.0

func (na *NetAPIStruct) NetParamSet(param cmn.ParamMod) (int, error)

NetParamSet - Set operational params of loxinet

func (*NetAPIStruct) NetPolicerAdd added in v0.8.0

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

NetPolicerAdd - Add a policer in loxinet

func (*NetAPIStruct) NetPolicerDel added in v0.8.0

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

NetPolicerDel - Delete a policer in loxinet

func (*NetAPIStruct) NetPolicerGet added in v0.8.0

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

NetPolicerGet - Get a policer in loxinet

func (*NetAPIStruct) NetPortAdd added in v0.8.0

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

NetPortAdd - Add a port in loxinet

func (*NetAPIStruct) NetPortDel added in v0.8.0

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

NetPortDel - Delete port from loxinet

func (*NetAPIStruct) NetPortGet added in v0.8.0

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

NetPortGet - Get Port Information of loxinet

func (*NetAPIStruct) NetRouteAdd added in v0.8.0

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

NetRouteAdd - Add a route in loxinet

func (*NetAPIStruct) NetRouteDel added in v0.8.0

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

NetRouteDel - Delete a route in loxinet

func (*NetAPIStruct) NetRouteGet added in v0.8.0

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

NetRouteGet - Get Route info from loxinet

func (*NetAPIStruct) NetSessionAdd added in v0.8.0

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

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

func (*NetAPIStruct) NetSessionDel added in v0.8.0

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

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

func (*NetAPIStruct) NetSessionGet added in v0.8.0

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

NetSessionGet - Get 3gpp user-session info in loxinet

func (*NetAPIStruct) NetSessionUlClAdd added in v0.8.0

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

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

func (*NetAPIStruct) NetSessionUlClDel added in v0.8.0

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

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

func (*NetAPIStruct) NetSessionUlClGet added in v0.8.0

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

NetSessionUlClGet - Get 3gpp ulcl filter info from loxinet

func (*NetAPIStruct) NetVlanAdd added in v0.8.0

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

NetVlanAdd - Add vlan info to loxinet

func (*NetAPIStruct) NetVlanDel added in v0.8.0

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

NetVlanDel - Delete vlan info from loxinet

func (*NetAPIStruct) NetVlanGet added in v0.8.0

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

NetVlanGet - Get Vlan Information of loxinet

func (*NetAPIStruct) NetVlanPortAdd added in v0.8.0

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

NetVlanPortAdd - Add a port to vlan in loxinet

func (*NetAPIStruct) NetVlanPortDel added in v0.8.0

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

NetVlanPortDel - Delete a port from vlan in loxinet

type NextHopDpWorkQ

type NextHopDpWorkQ struct {
	Work        DpWorkT
	Status      *DpStatusT
	TunNh       bool
	TunID       uint32
	TunType     DpTunT
	RIP         net.IP
	SIP         net.IP
	NNextHopNum int
	NextHopNum  int
	Resolved    bool
	DstAddr     [6]uint8
	SrcAddr     [6]uint8
	BD          int
}

NextHopDpWorkQ - work queue entry for nexthop operation

type NhType

type NhType uint8

NhType - type of neighbor

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

supported neighbor types

type PeerDpWorkQ added in v0.8.0

type PeerDpWorkQ struct {
	Work   DpWorkT
	PeerIP net.IP
	Status *DpStatusT
}

PeerDpWorkQ - work queue entry for peer association

type PolAttachObjT

type PolAttachObjT interface {
}

PolAttachObjT - empty interface to hold policer attachments

type PolDpWorkQ

type PolDpWorkQ struct {
	Work   DpWorkT
	Name   string
	Mark   int
	Cir    uint64
	Pir    uint64
	Cbs    uint64
	Ebs    uint64
	Color  bool
	Srt    bool
	Status *DpStatusT
}

PolDpWorkQ - work queue entry for policer related operation

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 policer in loxinet

func (*PolH) PolDelete

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

PolDelete - Delete a policer from loxinet

func (*PolH) PolDestructAll

func (P *PolH) PolDestructAll()

PolDestructAll - destroy all policers

func (*PolH) PolGetAll added in v0.8.0

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

PolGetAll - Get all of the policer in loxinet

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 loxinet realm to data-path

func (*Port) IsIPinIPTunPort added in v0.9.1

func (p *Port) IsIPinIPTunPort() bool

IsIPinIPTunPort - check if the port is of IPinIPTun type

func (*Port) IsL3TunPort added in v0.8.3

func (p *Port) IsL3TunPort() bool

IsL3TunPort - check if the port is of L3Tun type

func (*Port) IsLeafPort added in v0.8.0

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 added in v0.8.0

func (p *Port) IsSlavePort() bool

IsSlavePort - check if the port is slave of another port

type PortDpWorkQ

type PortDpWorkQ struct {
	Work       DpWorkT
	Status     *DpStatusT
	OsPortNum  int
	PortNum    int
	IngVlan    int
	SetBD      int
	SetZoneNum int
	Prop       cmn.PortProp
	SetMirr    int
	SetPol     int
	LoadEbpf   string
}

PortDpWorkQ - work queue entry for port operation

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 loxinet realm

func (*PortsH) PortDel

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

PortDel - delete a port from loxinet realm

func (*PortsH) PortDestructAll

func (P *PortsH) PortDestructAll()

PortDestructAll - destroy all ports in loxinet realm

func (*PortsH) PortFindByName

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

PortFindByName - find a port in loxinet realm given port name

func (*PortsH) PortFindByOSID added in v0.8.0

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

PortFindByOSID - find a port in loxinet 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 loxinet realm to json format

func (*PortsH) Ports2String

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

Ports2String - dump ports in loxinet realm to string format

func (*PortsH) PortsToGet

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

PortsToGet - dump ports in loxinet realm to api format

type RPCHookInterface added in v0.9.0

type RPCHookInterface interface {
	RPCConnect(*DpPeer) int
	RPCClose(*DpPeer) int
	RPCReset(*DpPeer) int
	RPCSend(*DpPeer, string, any) (int, error)
}

type RouteDpWorkQ

type RouteDpWorkQ struct {
	Work    DpWorkT
	Status  *DpStatusT
	ZoneNum int
	Dst     net.IPNet
	RtType  int
	RtMark  int
	NMark   int
}

RouteDpWorkQ - work queue entry for rt operation

type RouterMacDpWorkQ

type RouterMacDpWorkQ struct {
	Work    DpWorkT
	Status  *DpStatusT
	L2Addr  [6]uint8
	PortNum int
	BD      int
	TunID   uint32
	TunType DpTunT
	NhNum   int
}

RouterMacDpWorkQ - work queue entry for rt-mac operation

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 added in v0.8.4

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 added in v0.8.0

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 added in v0.8.3

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 added in v0.8.6

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 added in v0.8.0

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 added in v0.9.0

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

func (*RuleH) DeleteEPHost added in v0.8.6

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 added in v0.8.0

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) FoldRecursiveEPs added in v0.9.1

func (R *RuleH) FoldRecursiveEPs(r *ruleEnt)

FoldRecursiveEPs - Check if this rule's key matches endpoint of another rule. If so, replace that rule's endpoints to this rule's endpoints

func (*RuleH) GetEpHosts added in v0.8.0

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

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

func (*RuleH) GetFwRule added in v0.8.0

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 added in v0.8.0

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

GetNatLbRuleByID - Get a NAT rule by its identifier

func (*RuleH) GetNatLbRuleByServArgs added in v0.8.0

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

GetNatLbRuleByServArgs - Get a NAT rule by its service args

func (*RuleH) GetNatLbRuleSecIPs added in v0.8.7

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

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

func (*RuleH) IsEPHostActive added in v0.8.6

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

func (*RuleH) UnFoldRecursiveEPs added in v0.9.1

func (R *RuleH) UnFoldRecursiveEPs(r *ruleEnt)

UnFoldRecursiveEPs - Check if this rule's key matches endpoint of another rule. If so, replace that rule's original endpoint

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 StatDpWorkQ

type StatDpWorkQ struct {
	Work        DpWorkT
	Name        string
	Mark        uint32
	Packets     *uint64
	Bytes       *uint64
	DropPackets *uint64
}

StatDpWorkQ - work queue entry for stat operation

type TableDpWorkQ

type TableDpWorkQ struct {
	Work DpWorkT
	Name string
}

TableDpWorkQ - work queue entry for map related operation

type UlClDpWorkQ

type UlClDpWorkQ struct {
	Work   DpWorkT
	Status *DpStatusT
	MDip   net.IP
	MSip   net.IP

	Zone  int
	Qfi   uint8
	Mark  int
	TDip  net.IP
	TSip  net.IP
	TTeID uint32
	Type  DpTunT
	// contains filtered or unexported fields
}

UlClDpWorkQ - work queue entry for ul-cl filter related operation

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 UnimplementedXSyncServer added in v0.9.0

type UnimplementedXSyncServer struct {
}

UnimplementedXSyncServer must be embedded to have forward compatible implementations.

func (UnimplementedXSyncServer) DpWorkOnBlockCtModGRPC added in v0.9.0

func (UnimplementedXSyncServer) DpWorkOnCtGetGRPC added in v0.9.0

func (UnimplementedXSyncServer) DpWorkOnCtModGRPC added in v0.9.0

type UnsafeXSyncServer added in v0.9.0

type UnsafeXSyncServer interface {
	// contains filtered or unexported methods
}

UnsafeXSyncServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to XSyncServer will result in compilation errors.

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 added in v0.8.0

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 XSync added in v0.8.0

type XSync struct {
	RemoteID int
	RPCState bool
	// For peer to peer RPC
	RPCType  int
	RPCHooks RPCHookInterface
}

XSync - Remote sync peer information

func (*XSync) DpWorkOnBlockCtAdd added in v0.9.0

func (xs *XSync) DpWorkOnBlockCtAdd(blockCtis []DpCtInfo, ret *int) error

DpWorkOnBlockCtAdd - Add block CT entries from remote goRPC client

func (*XSync) DpWorkOnBlockCtDelete added in v0.9.0

func (xs *XSync) DpWorkOnBlockCtDelete(blockCtis []DpCtInfo, ret *int) error

DpWorkOnBlockCtDelete - Add block CT entries from remote

func (*XSync) DpWorkOnBlockCtModGRPC added in v0.9.0

func (xs *XSync) DpWorkOnBlockCtModGRPC(ctx context.Context, m *BlockCtInfoMod) (*XSyncReply, error)

func (*XSync) DpWorkOnCtAdd added in v0.8.0

func (xs *XSync) DpWorkOnCtAdd(cti DpCtInfo, ret *int) error

DpWorkOnCtAdd - Add a CT entry from remote goRPC client

func (*XSync) DpWorkOnCtDelete added in v0.8.0

func (xs *XSync) DpWorkOnCtDelete(cti DpCtInfo, ret *int) error

DpWorkOnCtDelete - Delete a CT entry from remote goRPC client

func (*XSync) DpWorkOnCtGet added in v0.8.0

func (xs *XSync) DpWorkOnCtGet(async int, ret *int) error

DpWorkOnCtGet - Get all CT entries asynchronously goRPC client

func (*XSync) DpWorkOnCtGetGRPC added in v0.9.0

func (xs *XSync) DpWorkOnCtGetGRPC(ctx context.Context, m *ConnGet) (*XSyncReply, error)

func (*XSync) DpWorkOnCtModGRPC added in v0.9.0

func (xs *XSync) DpWorkOnCtModGRPC(ctx context.Context, m *CtInfoMod) (*XSyncReply, error)

type XSyncClient added in v0.9.0

type XSyncClient interface {
	DpWorkOnCtGetGRPC(ctx context.Context, in *ConnGet, opts ...grpc.CallOption) (*XSyncReply, error)
	DpWorkOnCtModGRPC(ctx context.Context, in *CtInfoMod, opts ...grpc.CallOption) (*XSyncReply, error)
	DpWorkOnBlockCtModGRPC(ctx context.Context, in *BlockCtInfoMod, opts ...grpc.CallOption) (*XSyncReply, error)
}

XSyncClient is the client API for XSync service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewXSyncClient added in v0.9.0

func NewXSyncClient(cc grpc.ClientConnInterface) XSyncClient

type XSyncReply added in v0.9.0

type XSyncReply struct {
	Response int32 `protobuf:"varint,1,opt,name=response,proto3" json:"response,omitempty"`
	// contains filtered or unexported fields
}

func (*XSyncReply) Descriptor deprecated added in v0.9.0

func (*XSyncReply) Descriptor() ([]byte, []int)

Deprecated: Use XSyncReply.ProtoReflect.Descriptor instead.

func (*XSyncReply) GetResponse added in v0.9.0

func (x *XSyncReply) GetResponse() int32

func (*XSyncReply) ProtoMessage added in v0.9.0

func (*XSyncReply) ProtoMessage()

func (*XSyncReply) ProtoReflect added in v0.9.0

func (x *XSyncReply) ProtoReflect() protoreflect.Message

func (*XSyncReply) Reset added in v0.9.0

func (x *XSyncReply) Reset()

func (*XSyncReply) String added in v0.9.0

func (x *XSyncReply) String() string

type XSyncServer added in v0.9.0

type XSyncServer interface {
	DpWorkOnCtGetGRPC(context.Context, *ConnGet) (*XSyncReply, error)
	DpWorkOnCtModGRPC(context.Context, *CtInfoMod) (*XSyncReply, error)
	DpWorkOnBlockCtModGRPC(context.Context, *BlockCtInfoMod) (*XSyncReply, error)
	// contains filtered or unexported methods
}

XSyncServer is the server API for XSync service. All implementations must embed UnimplementedXSyncServer for forward compatibility

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 loxiNetTicker

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