lacp

package
v0.0.0-...-a4e6d7a Latest Latest
Warning

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

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

Documentation

Overview

aggregator.go - holds the information related to the datastore of Aggregator Object as described in 802.1AX-2014 7.3.1.1.

CHURN DETECTION MACHINE 802.1ax-2014 Section 6.4.17

config

debugEventLog this code is meant to serialize the logging States

defs

global

hw.go

init

Copyright [2016] [SnapRoute Inc]

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

	 Unless required by applicable law or agreed to in writing, software
	 distributed under the License is distributed on an "AS IS" BASIS,
	 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	 See the License for the specific language governing permissions and
	 limitations under the License.

_______ __ __________ ___ _______.____ __ ____ __ .___________. ______ __ __ | ____|| | | ____\ \ / / / |\ \ / \ / / | | | | / || | | | | |__ | | | |__ \ V / | (----` \ \/ \/ / | | `---| |----`| ,----'| |__| | | __| | | | __| > < \ \ \ / | | | | | | | __ | | | | `----.| |____ / . \ .----) | \ /\ / | | | | | `----.| | | | |__| |_______||_______/__/ \__\ |_______/ \__/ \__/ |__| |__| \______||__| |__|

callback signature for drcp in order to get event updates

lacpcb.go

markerResponder.go

MUX MACHINE 802.1ax-2014 Section 6.4.15 This implementation will assume that bot State machines in Section 6.4.15 are implemented with an extra flag indicating the capabilities of the port

The Periodic Transmission Machine is described in the 802.1ax-2014 Section 6.4.13

port

rx will take care of parsing a received frame from a linux socket if checks pass then packet will be either passed rx machine or marker responder

rxmachine

selection

System

timers

tx

TX MACHINE, this is not really a State machine but going to create a sort of State machine to processes events TX Machine is described in 802.1ax-2014 6.4.16

Index

Constants

View Source
const (
	LacpAggSelected = iota + 1
	LacpAggStandby
	LacpAggUnSelected
)

Indicates on a port what State the aggSelected is in

View Source
const (
	LacpCdmStateNone = iota + 1
	LacpCdmStateNoActorChurn
	LacpCdmStateActorChurnMonitor
	LacpCdmStateActorChurn
	LacpCdmStateNoPartnerChurn
	LacpCdmStatePartnerChurnMonitor
	LacpCdmStatePartnerChurn
)
View Source
const (
	LacpCdmEventBegin = iota + 1
	LacpCdmEventNotPortEnabled
	LacpCdmEventActorOperPortStateSyncOn
	LacpCdmEventActorOperPortStateSyncOff
	LacpCdmEventActorChurnTimerExpired
	LacpCdmEventPartnerOperPortStateSyncOn
	LacpCdmEventPartnerOperPortStateSyncOff
	LacpCdmEventPartnerChurnTimerExpired
)
View Source
const (
	LaAggTypeLACP = iota + 1
	LaAggTypeSTATIC
)
View Source
const (
	LacpStateActivityBit = 1 << iota
	LacpStateTimeoutBit
	LacpStateAggregationBit
	LacpStateSyncBit
	LacpStateCollectingBit
	LacpStateDistributingBit
	LacpStateDefaultedBit
	LacpStateExpiredBit
)
View Source
const (
	// also known as manual mode
	LacpModeOn = iota + 1
	// lacp State Activity == TRUE
	// considered lacp enabled
	LacpModeActive
	// lacp State Activity == FALSE
	// considered lacp enabled
	LacpModePassive
)
View Source
const (
	LampMarkerResponderNone = iota + 1
	LampMarkerResponderStateWaitForMarker
	LampMarkerResponderStateRespondToMarker
)

Lamp Marker Responder States

View Source
const (
	LampMarkerResponderEventBegin = iota + 1
	LampMarkerResponderEventLampPktRx
	LampMarkerResponderEventIntentionalFallthrough
	LampMarkerResponderEventKillSignal
)

lamp responder events

View Source
const (
	LacpMuxmStateNone = iota
	LacpMuxmStateDetached
	LacpMuxmStateWaiting
	LacpMuxmStateAttached
	LacpMuxmStateCollecting
	LacpMuxmStateDistributing
	// Coupled control - Collecting and Distributing can't be controlled independently
	LacpMuxmStateCNone
	LacpMuxmStateCDetached
	LacpMuxmStateCWaiting
	LacpMuxmStateCAttached
	LacpMuxStateCCollectingDistributing
)
View Source
const (
	LacpMuxmEventBegin = iota + 1
	LacpMuxmEventSelectedEqualSelected
	LacpMuxmEventSelectedEqualStandby
	LacpMuxmEventSelectedEqualUnselected
	LacpMuxmEventSelectedEqualSelectedAndReady
	LacpMuxmEventSelectedEqualSelectedAndPartnerSync
	LacpMuxmEventNotPartnerSync
	LacpMuxmEventNotPartnerCollecting
	LacpMuxmEventSelectedEqualSelectedPartnerSyncCollecting
)
View Source
const (
	LacpPtxmStateNone = iota + 1
	LacpPtxmStateNoPeriodic
	LacpPtxmStateFastPeriodic
	LacpPtxmStateSlowPeriodic
	LacpPtxmStatePeriodicTx
)
View Source
const (
	LacpPtxmEventBegin = iota + 1
	LacpPtxmEventLacpDisabled
	LacpPtxmEventNotPortEnabled
	LacpPtxmEventActorPartnerOperActivityPassiveMode
	LacpPtxmEventUnconditionalFallthrough
	LacpPtxmEventPartnerOperStateTimeoutLong
	LacpPtxmEventPeriodicTimerExpired
	LacpPtxmEventPartnerOperStateTimeoutShort
)
View Source
const (
	LacpRxmStateNone = iota + 1
	LacpRxmStateInitialize
	LacpRxmStatePortDisabled
	LacpRxmStateExpired
	LacpRxmStateLacpDisabled
	LacpRxmStateDefaulted
	LacpRxmStateCurrent
)

rxm States

View Source
const (
	LacpRxmEventBegin = iota + 1
	LacpRxmEventUnconditionalFallthrough
	LacpRxmEventNotPortEnabledAndNotPortMoved
	LacpRxmEventPortMoved
	LacpRxmEventPortEnabledAndLacpEnabled
	LacpRxmEventPortEnabledAndLacpDisabled
	LacpRxmEventCurrentWhileTimerExpired
	LacpRxmEventLacpEnabled
	LacpRxmEventLacpPktRx
	LacpRxmEventKillSignal
)

rxm events

View Source
const (
	LacpTxmStateNone = iota + 1
	LacpTxmStateOn
	LacpTxmStateOff
	LacpTxmStateDelayed
	LacpTxmStateGuardTimerExpire
)
View Source
const (
	LacpTxmEventBegin = iota + 1
	LacpTxmEventNtt
	LacpTxmEventGuardTimer
	LacpTxmEventDelayTx
	LacpTxmEventLacpDisabled
	LacpTxmEventLacpEnabled
)
View Source
const CdMachineModuleStr = "Actor Churn Detection Machine"
View Source
const LacpActorSystemLacpVersion int = 0x01

the version number of the Actor LACP implementation

View Source
const LacpAggregateWaitTime time.Duration = (time.Second * 2)

number of seconds to delay aggregation to allow multiple links to aggregate simultaneously

View Source
const LacpChurnDetectionTime time.Duration = (time.Second * 60)

number of seconds that the Actor and Partner Churn State machines wait for the Actor or Partner Sync State to stabilize

View Source
const LacpFastPeriodicTime time.Duration = (time.Second * 1)

6.4.4 Constants number of seconds between periodic trasmissions using Short Timeouts

View Source
const LacpIsDisabled bool = false
View Source
const LacpIsEnabled bool = true
View Source
const LacpLongTimeoutTime time.Duration = (time.Second * 90)

number of seconds before invalidating received LACPDU info when using Long Timeouts (3 x LacpSlowPeriodicTime) Lacp State Timeout == 0

View Source
const LacpPortDuplexFull int = 1
View Source
const LacpPortDuplexHalf int = 2
View Source
const LacpShortTimeoutTime time.Duration = (time.Second * 3)

number of seconds before invalidating received LACPDU info when using Short Timeouts (3 x LacpFastPeriodicTime) Lacp State Timeout == 1

View Source
const LacpSlowPeriodicTime time.Duration = (time.Second * 30)

number of seconds etween periodic transmissions using Long timeouts

default partner State after lacp pdu's received

default partner

default actor

View Source
const MarkerResponderModuleStr = "LAMP Marker Responder"
View Source
const MuxMachineModuleStr = "Mux Machine"
View Source
const PCdMachineModuleStr = "Partner Churn Detection Machine"
View Source
const PortConfigModuleStr = "Port Config"
View Source
const PtxMachineModuleStr = "Periodic TX Machine"
View Source
const RxMachineModuleStr = "Rx Machine"
View Source
const RxModuleStr = "Rx Module"
View Source
const TxMachineModuleStr = "Tx Machine"

Variables

View Source
var CdmStateStrMap map[fsm.State]string
View Source
var ConfigAggList []*LaAggConfig
View Source
var ConfigAggMap map[string]*LaAggConfig

The following dbs are used to keep track of certain conditions that must exist from a config check perspective. 1) A Port can only be part of one agg group 2) An Agg can only be part of one distributed relay group holds the agg to port list

View Source
var LacpStartTime time.Time
View Source
var LampMarkerResponderStateStrMap map[fsm.State]string
View Source
var MacCaptureSet bool = false
View Source
var ModeStrMap map[uint8]string
View Source
var MuxStateStrMap map[uint8]string
View Source
var MuxmEventStrMap map[int]string
View Source
var MuxmStateStrMap map[fsm.State]string
View Source
var PtxmStateStrMap map[fsm.State]string
View Source
var RxmStateStrMap map[fsm.State]string
View Source
var TxmStateStrMap map[fsm.State]string

Functions

func AddLaAggPortToAgg

func AddLaAggPortToAgg(Key uint16, pId uint16)

func CdMachineStrStateMapCreate

func CdMachineStrStateMapCreate()

func CreateLaAgg

func CreateLaAgg(agg *LaAggConfig)

func CreateLaAggPort

func CreateLaAggPort(port *LaAggPortConfig)

func DeRegisterLaAggCbAll

func DeRegisterLaAggCbAll(owner string)

func DefsStrMapsCreate

func DefsStrMapsCreate()

func DeleteLaAgg

func DeleteLaAgg(Id int)

func DeleteLaAggPort

func DeleteLaAggPort(pId uint16)

func DeleteLaAggPortFromAgg

func DeleteLaAggPortFromAgg(Key uint16, pId uint16)

func DisableLaAgg

func DisableLaAgg(Id int)

func DisableLaAggPort

func DisableLaAggPort(pId uint16)

func EnableLaAgg

func EnableLaAgg(Id int)

func EnableLaAggPort

func EnableLaAggPort(pId uint16)

func GetLaAggPortActorOperState

func GetLaAggPortActorOperState(pId uint16) uint8

func GetLaAggPortPartnerOperState

func GetLaAggPortPartnerOperState(pId uint16) uint8

func IsControlFrame

func IsControlFrame(pId uint16, packet gopacket.Packet) (bool, bool)

func LaAggConfigAggCreateCheck

func LaAggConfigAggCreateCheck(ac *LaAggConfig) error

LaAggConfigAggCreateCheck will check that the aggregator ports are unique

func LaAggConfigAggPortUpdateCheck

func LaAggConfigAggPortUpdateCheck(name string, addPorts []uint16, delPorts []uint16) error

LaAggConfigAggPortUpdateCheck validate that the new ports being added are unique, and update the db

func LaAggConfigDeleteCheck

func LaAggConfigDeleteCheck(intfref string) error

func LaAggConfigDoesIntfRefListMemberExist

func LaAggConfigDoesIntfRefListMemberExist(intfref string, ac **LaAggConfig) bool

func LaAggConfigGetByIndex

func LaAggConfigGetByIndex(index int, ac **LaAggConfig) bool

func LaAggConfigParamCheck

func LaAggConfigParamCheck(ac *LaAggConfig) error

LaAggConfigParamCheck will validate the config from the user after it has been translated to something the Lacp module expects. Thus if translation layer fails it should produce an invalid value. The error returned will be translated to model values

func LaAggPortNumListPortIdExist

func LaAggPortNumListPortIdExist(Key uint16, portId uint16) bool

func LaConvertPortAndPriToPortId

func LaConvertPortAndPriToPortId(pId uint16, prio uint16) int

func LaFindAggById

func LaFindAggById(aggId int, agg **LaAggregator) bool

func LaFindAggByKey

func LaFindAggByKey(Key uint16, agg **LaAggregator) bool

func LaFindAggByName

func LaFindAggByName(AggName string, agg **LaAggregator) bool

func LaFindPortById

func LaFindPortById(pId uint16, port **LaAggPort) bool

find a port from the global map table by PortNum

func LaFindPortByKey

func LaFindPortByKey(Key uint16, index *int, port **LaAggPort) bool

LaFindPortByKey will find a port form the global map table by Key index value should input 0 for the first value

func LaFindPortByPortId

func LaFindPortByPortId(portId int, port **LaAggPort) bool

find a port from the global map table by PortNum

func LaGetAggNext

func LaGetAggNext(agg **LaAggregator) bool

warning for each call the map may change

func LaGetPortNext

func LaGetPortNext(port **LaAggPort) bool

func LaRxMain

func LaRxMain(pId uint16, rxPktChan chan gopacket.Packet)

LaRxMain will process incomming packets from a socket as of 10/22/15 packets recevied from channel

func LacpCopyLacpPortInfo

func LacpCopyLacpPortInfo(fromPortInfoPtr *LacpPortInfo, toPortInfoPtr *LacpPortInfo)

LacpCopyLacpPortInfo: Copy the LacpPortInfo data from->to

func LacpCopyLacpPortInfoFromPkt

func LacpCopyLacpPortInfoFromPkt(fromPortInfoPtr *layers.LACPPortInfo, toPortInfoPtr *LacpPortInfo)

func LacpLacpPktPortInfoIsEqual

func LacpLacpPktPortInfoIsEqual(aPortInfoPtr *layers.LACPPortInfo, bPortInfoPtr *LacpPortInfo, StateBits uint8) bool

func LacpLacpPortInfoIsEqual

func LacpLacpPortInfoIsEqual(aPortInfoPtr *LacpPortInfo, bPortInfoPtr *LacpPortInfo, StateBits uint8) bool

LacpLacpPortInfoIsEqual: Compare the LacpPortInfo data except be selective about the State bits that is being compared against

func LacpModeGet

func LacpModeGet(currState uint8, lacpEnabled bool) int

func LacpStateClear

func LacpStateClear(currState *uint8, StateBits uint8)

func LacpStateIsSet

func LacpStateIsSet(currState uint8, StateBits uint8) bool

func LacpStateSet

func LacpStateSet(currState *uint8, StateBits uint8)

func LacpStateToStr

func LacpStateToStr(state uint8) string

func LacpSysGlobalInfoDestroy

func LacpSysGlobalInfoDestroy(sysId LacpSystem)

func LacpSystemIdGet

func LacpSystemIdGet(s LacpSystem) [8]uint8

6.3.2 System identification The globally unique identifier used to identify a System shall be the concatenation of a globally administered individual MAC address and the System Priority. The MAC address chosen may be the individual MAC address associated with one of the Aggregation Ports of the System. In the case of DRNI (Clause 9), all Portal Systems in a Portal have the same System Identifier, which is provided by the concatenation of the Portal’s administrated MAC address (7.4.1.1.4) and the Portal’s System Priority (7.4.1.1.5).

Where it is necessary to perform numerical comparisons between System Identifiers, each System Identifier is considered to be an eight octet unsigned binary number, constructed as follows:

a) The two most significant octets of the System Identifier comprise the System Priority. The System

Priority value is taken to be an unsigned binary number; the most significant octet of the System
Priority forms the most significant octet of the System Identifier.

b) The third most significant octet of the System Identifier is derived from the initial octet of the MAC

address; the least significant bit of the octet is assigned the value of the first bit of the MAC address,
the next most significant bit of the octet is assigned the value of the next bit of the MAC address,
and so on. The fourth through eighth octets are similarly assigned the second through sixth octets of
the MAC address.

func LampMarkerResponderStrStateMapCreate

func LampMarkerResponderStrStateMapCreate()

func MuxxMachineStrStateMapCreate

func MuxxMachineStrStateMapCreate()

func ProcessLacpFrame

func ProcessLacpFrame(pId uint16, lacp *layers.LACP)

ProcessLacpFrame will lookup the cooresponding port from which the packet arrived and forward the packet to the Rx Machine for processing

func ProcessLampFrame

func ProcessLampFrame(pId uint16, lamp *layers.LAMP)

func PtxMachineStrStateMapCreate

func PtxMachineStrStateMapCreate()

func RegisterLaAggCreateCb

func RegisterLaAggCreateCb(owner string, cb LacpAggEvtCb)

func RegisterLaAggDeleteCb

func RegisterLaAggDeleteCb(owner string, cb LacpAggEvtCb)

func RegisterLaAggOperStateDownCb

func RegisterLaAggOperStateDownCb(owner string, cb LacpAggEvtCb)

func RegisterLaAggOperStateUpCb

func RegisterLaAggOperStateUpCb(owner string, cb LacpAggEvtCb)

func RegisterLaPortCreateCb

func RegisterLaPortCreateCb(owner string, cb LacpPortEvtCb)

func RegisterLaPortDeleteCb

func RegisterLaPortDeleteCb(owner string, cb LacpPortEvtCb)

func RegisterLaPortDownCb

func RegisterLaPortDownCb(owner string, cb LacpPortEvtCb)

func RegisterLaPortUpCb

func RegisterLaPortUpCb(owner string, cb LacpPortEvtCb)

func RxMachineStrStateMapCreate

func RxMachineStrStateMapCreate()

func SaveLaAggConfig

func SaveLaAggConfig(ac *LaAggConfig)

SaveLaAggConfig save off the current configuration data as supplied by the user

func SetLaAggHashMode

func SetLaAggHashMode(aggId int, hashmode uint32)

func SetLaAggPortCheckSelectionDistributedRelayIsSynced

func SetLaAggPortCheckSelectionDistributedRelayIsSynced(pId uint16, sync bool)

SetLaAggPortCheckSelectionDistributedRelayIsSynced is called by DRCP when the Distributed Relay has reached sync state, which should be the trigger to allow the local lag to start sycing with the peer device

func SetLaAggPortLacpMode

func SetLaAggPortLacpMode(pId uint16, mode int)

SetLaAggPortLacpMode will set the various lacp modes - On, Active, Passive

func SetLaAggPortLacpPeriod

func SetLaAggPortLacpPeriod(pId uint16, period time.Duration)

SetLaAggPortLacpPeriod will set the periodic rate at which a packet should be transmitted. What this actually means is at what rate the peer should transmit a packet to us. FAST and SHORT are the periods, the lacp state timeout is encoded such that FAST is 1 and SHORT is 0

func SetLaAggPortSystemInfo

func SetLaAggPortSystemInfo(pId uint16, sysIdMac string, sysPrio uint16)

func SetLaAggPortSystemInfoFromDistributedRelay

func SetLaAggPortSystemInfoFromDistributedRelay(pId uint16, sysIdMac string, sysPrio uint16, operKey uint16, drName string, synced bool)

SetLaAggPortSystemInfoFromDistributedRelay called by DRCP when the Distributed relay is linked with the Aggregator, which means that the Agg will now use the DR params for the Aggregator port.

TODO this function may need to change to include the operkey change as well as change the port Id which is sent on the wire

func TxMachineStrStateMapCreate

func TxMachineStrStateMapCreate()

func TxViaLinuxIf

func TxViaLinuxIf(port uint16, pdu interface{})

func UpdateIntfType

func UpdateIntfType(aggId int, confmode string)

Types

type AggConfig

type AggConfig struct {
	// GET-SET
	AggName string
	// GET-SET
	AggActorSystemID [6]uint8
	// GET-SET
	AggActorSystemPriority uint16
	// GET-SET
	AggActorAdminKey uint16
	// GET-SET   up/down enum
	AggAdminState bool
	// GET-SET  enable/disable enum
	AggLinkUpDownNotificationEnable bool
	// GET-SET 10s of microseconds
	AggCollectorMaxDelay uint16
	// GET-SET
	AggPortAlgorithm [3]uint8
	// GET-SET
	AggPartnerAdminPortAlgorithm [3]uint8
	// GET-SET up to 4096 values conversationids
	AggConversationAdminLink []int
	// GET-SET
	AggPartnerAdminPortConverstaionListDigest [16]uint8
	// GET-SET
	AggAdminDiscardWrongConversation bool
	// GET-SET 4096 values
	AggAdminServiceConversationMap []int
	// GET-SET
	AggPartnerAdminConvServiceMappingDigest [16]uint8
}

802.1.AX-2014 7.3.1.1 Aggregator attributes GET-SET

type AggIdKey

type AggIdKey struct {
	Name string
	Id   int
	Key  uint16
}

type AggInternalData

type AggInternalData struct {
	// Linux Interface Name
	AggNameStr string
}

type AggPortConfig

type AggPortConfig struct {
	// GET-SET
	AggPortActorSystemPriority uint16
	// GET-SET
	AggPortActorAdminKey uint16
	// GET-SET
	AggPortPartnerAdminSystemPriority uint16
	// GET-SET
	AggPortPartnerAdminSystemId [6]uint8
	// GET-SET
	AggPortPartnerAdminKey uint16
	// GET-SET
	AggPortActorPortPriority uint8
	// GET-SET
	AggPortPartnerAdminPort int
	// GET-SET
	AggPortPartnerAdminPortPriority uint8
	// GET-SET
	AggPortActorAdminState uint8
	// GET-SET
	AggPortPartnerAdminState uint8
	// GET-SET
	AggPortLinkNumberID int
	// GET-SET
	AggPortPartnerAdminLInkNumberID int
	// GET-SET
	AggPortWTRTime int
	// GET-SET
	AggPortProtocolDA [6]uint8
}

type AggPortDebugInformationObject

type AggPortDebugInformationObject struct {
	// same as AggregationPort
	AggPortDebugInformationID int
	// enum
	AggPortDebugRxState    int
	AggPortDebugLastRxTime int
	// enum
	AggPortDebugMuxState                   int
	AggPortDebugMuxReason                  string
	AggPortDebugActorChurnState            int
	AggPortDebugPartnerChurnState          int
	AggPortDebugActorChurnPrevCnt          int
	AggPortDebugActorChurnCount            int
	AggPortDebugPartnerChurnPrevCount      int
	AggPortDebugPartnerChurnCount          int
	AggPortDebugActorSyncTransitionCount   int
	AggPortDebugPartnerSyncTransitionCount int
	// TODO
	AggPortDebugActorChangeCount     int
	AggPortDebugPartnerChangeCount   int
	AggPortDebugActorCDSChurnState   int
	AggPortDebugPartnerCDSChurnState int
	AggPortDebugActorCDSChurnCount   int
	AggPortDebugPartnerCDSChurnCount int
}

GET

type AggPortStatsObject

type AggPortStatsObject struct {
	AggPortStatsID                   uint64
	AggPortStatsLACPDUsRx            uint64
	AggPortStatsMarkerPDUsRx         uint64
	AggPortStatsMarkerResponsePDUsRx uint64
	AggPortStatsUnknownRx            uint64
	AggPortStatsIllegalRx            uint64
	AggPortStatsLACPDUsTx            uint64
	AggPortStatsMarkerPDUsTx         uint64
	AggPortStatsMarkerResponsePDUsTx uint64
	AggPortStateMissMatchInfoRx      uint64
}

GET

type AggPortStatus

type AggPortStatus struct {
	// GET
	AggPortId int
	// GET
	AggPortActorSystemId [6]uint8
	// GET
	AggPortActorOperKey uint16
	// GET
	AggPortPartnerOperSystemPriority uint16
	// GET
	AggPortPartnerOperSystemId [6]uint8
	// GET
	AggPortPartnerOperKey uint16
	// GET
	AggPortSelectedAggID int
	// GET
	AggPortAttachedAggID int
	// GET
	AggPortActorPort int
	// GET
	AggPortPartnerOperPort int
	// GET
	AggPortPartnerOperPortPriority uint8
	// GET
	AggPortActorOperState uint8
	// GET
	AggPortPartnerOperState uint8
	// GET
	AggPortAggregateOrIndividual bool
	// GET
	AggPortOperConversationPasses bool
	// GET
	AggPortOperConversationCollected bool
	// GET
	AggPortStats AggPortStatsObject
	// GET
	AggPortDebug AggPortDebugInformationObject
}

type AggregatorObject

type AggregatorObject struct {
	// GET
	AggId int
	// GET
	AggDescription string
	// GET-SET
	AggName string
	// GET-SET
	AggActorSystemID [6]uint8
	// GET-SET
	AggActorSystemPriority uint16
	// GET
	AggAggregateOrIndividual bool
	// GET-SET
	AggActorAdminKey uint16
	// GET
	AggActorOperKey uint16
	// GET
	AggMACAddress [6]uint8
	// GET
	AggPartnerSystemID [6]uint8
	// GET
	AggPartnerSystemPriority uint16
	// GET
	AggPartnerOperKey uint16
	// GET-SET   up/down enum
	AggAdminState bool
	// GET
	AggOperState bool
	// GET
	AggTimeLastOperChange int
	// GET  sum of data rate of each link
	AggDataRate int
	// GET
	AggStats LacpAggregatorStats
	// GET-SET  enable/disable enum
	AggLinkUpDownNotificationEnable bool
	// NOTIFICATION
	AggLinkUpNotification bool
	// NOTIFICATION
	AggLinkDownNotification bool
	// GET  list of AggPortID
	AggPortList []int
	// GET-SET 10s of microseconds
	AggCollectorMaxDelay uint16
	// GET-SET
	AggPortAlgorithm [3]uint8
	// GET-SET
	AggPartnerAdminPortAlgorithm [3]uint8
	// GET-SET up to 4096 values conversationids
	AggConversationAdminLink []int
	// GET-SET
	AggPartnerAdminPortConverstaionListDigest [16]uint8
	// GET-SET
	AggAdminDiscardWrongConversation bool
	// GET-SET 4096 values
	AggAdminServiceConversationMap []int
	// GET-SET
	AggPartnerAdminConvServiceMappingDigest [16]uint8
}

802.1.AX-2014 7.3.1.1 Aggregator attributes GET-SET

type AggregatorPortObject

type AggregatorPortObject struct {
	// GET-SET
	Config AggPortConfig
	// GET
	Status AggPortStatus

	Internal AggInternalData
}

type LaAggConfig

type LaAggConfig struct {
	// Aggregator name
	Name string
	// Aggregator_MAC_address
	Mac [6]uint8
	// Aggregator_Identifier
	Id int
	// Actor_Admin_Aggregator_Key
	Key uint16
	// Aggregator Type, LACP or STATIC
	Type uint32
	// Minimum number of links
	MinLinks uint16
	// Enabled
	Enabled bool
	// LAG_ports
	LagMembers []uint16

	// System to attach this agg to
	Lacp LacpConfigInfo

	// mau properties of each link
	Properties PortProperties

	// hash config
	HashMode uint32
}

type LaAggPort

type LaAggPort struct {

	// string id of port
	IntfNum string

	// Key
	Key uint16

	// used to form portId
	PortNum uint16

	AggId int

	// Once selected reference to agg group will be made
	AggAttached *LaAggregator

	// TRUE - Aggregation port is operable (MAC_Operational == True)
	// FALSE - otherwise
	PortEnabled bool

	// determine whether a port is up or down
	LinkOperStatus bool

	// administrative values for State described in 6.4.2.3
	ActorAdmin LacpPortInfo
	ActorOper  LacpPortInfo

	PartnerOper LacpPortInfo

	// State machines
	RxMachineFsm       *LacpRxMachine
	PtxMachineFsm      *LacpPtxMachine
	TxMachineFsm       *LacpTxMachine
	CdMachineFsm       *LacpActorCdMachine
	PCdMachineFsm      *LacpPartnerCdMachine
	MuxMachineFsm      *LacpMuxMachine
	MarkerResponderFsm *LampMarkerResponderMachine

	// Counters
	LacpCounter AggPortStatsObject

	// GET
	AggPortDebug AggPortDebugInformationObject

	// Distributed Relay reference name
	DrniName   string
	DrniSynced bool
	// contains filtered or unexported fields
}

802.1ax Section 6.4.7 Port attributes associated with aggregator

func NewLaAggPort

func NewLaAggPort(config *LaAggPortConfig) *LaAggPort

NewLaAggPort Allocate a new lag port, creating appropriate timers

func (*LaAggPort) BEGIN

func (p *LaAggPort) BEGIN(restart bool)
BEGIN will initiate all the State machines

and will send an event back to this caller to begin processing.

func (*LaAggPort) CreateRxTx

func (p *LaAggPort) CreateRxTx()

func (*LaAggPort) DeleteRxTx

func (p *LaAggPort) DeleteRxTx()

func (*LaAggPort) DistributeMachineEvents

func (p *LaAggPort) DistributeMachineEvents(mec []chan utils.MachineEvent, e []utils.MachineEvent, waitForResponse bool)

DistributeMachineEvents will distribute the events in parrallel to each machine

func (*LaAggPort) EnableLogging

func (p *LaAggPort) EnableLogging(ena bool)

func (*LaAggPort) IsPortAdminEnabled

func (p *LaAggPort) IsPortAdminEnabled() bool

IsPortAdminEnabled will check if provisioned port enable State is enabled or disabled

func (*LaAggPort) IsPortEnabled

func (p *LaAggPort) IsPortEnabled() bool

IsPortEnabled will check if port is admin enabled and link is operationally up

func (*LaAggPort) IsPortOperStatusUp

func (p *LaAggPort) IsPortOperStatusUp() bool

func (*LaAggPort) LaAggPortActorAdminInfoSet

func (p *LaAggPort) LaAggPortActorAdminInfoSet(sysIdMac [6]uint8, sysPrio uint16)

func (*LaAggPort) LaAggPortActorOperInfoSet

func (p *LaAggPort) LaAggPortActorOperInfoSet(sysIdMac [6]uint8, sysPrio uint16)

func (*LaAggPort) LaAggPortDelete

func (p *LaAggPort) LaAggPortDelete()

func (*LaAggPort) LaAggPortDisable

func (p *LaAggPort) LaAggPortDisable()

LaAggPortDisable will update the status on the port as well as inform the appropriate State machines of the State change

func (*LaAggPort) LaAggPortEnabled

func (p *LaAggPort) LaAggPortEnabled()

LaAggPortEnabled will update the status on the port as well as inform the appropriate State machines of the State change When this is called, it is assumed that all States are in their default State.

func (*LaAggPort) LaAggPortLacpDisable

func (p *LaAggPort) LaAggPortLacpDisable()

LaAggPortLacpDisable will update the status on the port as well as inform the appropriate State machines of the State change

func (*LaAggPort) LaAggPortLacpEnabled

func (p *LaAggPort) LaAggPortLacpEnabled(mode int)

LaAggPortEnabled will update the status on the port as well as inform the appropriate State machines of the State change

func (*LaAggPort) LaPortLog

func (p *LaAggPort) LaPortLog(msg string)

func (*LaAggPort) LacpActorCdMachineMain

func (p *LaAggPort) LacpActorCdMachineMain()

LacpActorCdMachineMain: 802.1ax-2014 Creation of Actor Churn Detection State Machine State transitions and callbacks and create go routine to pend on events

func (*LaAggPort) LacpMuxMachineFSMBuild

func (p *LaAggPort) LacpMuxMachineFSMBuild() *LacpMuxMachine

LacpMuxMachineFSMBuild: 802.1ax-2014 Figure 6-21 && 6-22

func (*LaAggPort) LacpMuxMachineMain

func (p *LaAggPort) LacpMuxMachineMain()

LacpMuxMachineMain: 802.1ax-2014 Figure 6-21 && 6-22 Creation of Rx State Machine State transitions and callbacks and create go routine to pend on events

func (*LaAggPort) LacpPartnerCdMachineMain

func (p *LaAggPort) LacpPartnerCdMachineMain()

LacpActorCdMachineMain: 802.1ax-2014 Creation of Actor Churn Detection State Machine State transitions and callbacks and create go routine to pend on events

func (*LaAggPort) LacpPtxMachineMain

func (p *LaAggPort) LacpPtxMachineMain()

LacpRxMachineMain: 802.1ax-2014 Table 6-18 Creation of Rx State Machine State transitions and callbacks and create go routine to pend on events

func (*LaAggPort) LacpRxMachineMain

func (p *LaAggPort) LacpRxMachineMain()

LacpRxMachineMain: 802.1ax-2014 Table 6-18 Creation of Rx State Machine State transitions and callbacks and create go routine to pend on events

func (*LaAggPort) LacpTxMachineMain

func (p *LaAggPort) LacpTxMachineMain()

LacpRxMachineMain: 802.1ax-2014 Table 6-18 Creation of Rx State Machine State transitions and callbacks and create go routine to pend on events

func (*LaAggPort) LampMarkerResponderMain

func (p *LaAggPort) LampMarkerResponderMain()

LampMarkerResponderMain: 802.1ax-2014 Table 6-28 Creation of Marker Responder State Machine State transitions and callbacks and create go routine to pend on events

func (*LaAggPort) ModeGet

func (p *LaAggPort) ModeGet() int

func (*LaAggPort) PortChannelGet

func (p *LaAggPort) PortChannelGet() chan string

func (*LaAggPort) Stop

func (p *LaAggPort) Stop()

func (*LaAggPort) TimeoutGet

func (p *LaAggPort) TimeoutGet() time.Duration

type LaAggPortConfig

type LaAggPortConfig struct {

	// Actor_Port_Number
	Id uint16
	// Actor_Port_priority
	Prio uint16
	// Actor Admin Key
	Key uint16
	// Actor Oper Key
	//OperKey uint16
	// Actor_Port_Aggregator_Identifier
	AggId int

	// Admin Enable/Disable
	Enable bool

	// lacp mode On/Active/Passive
	Mode int

	// lacp timeout SHORT/LONG
	Timeout time.Duration

	// Port capabilities and attributes
	Properties PortProperties

	// Linux If
	TraceEna bool
	IntfId   string
}

type LaAggregator

type LaAggregator struct {
	// 802.1ax Section 7.3.1.1 && 6.3.2
	// Aggregator_Identifier
	AggId          int    // internal
	HwAggId        int32  // IfIndex
	AggDescription string // 255 max chars
	AggName        string // 255 max chars
	AggType        uint32 // LACP/STATIC
	AggMinLinks    uint16

	// lacp configuration info
	Config LacpConfigInfo

	// Actor_Admin_Aggregator_Key
	ActorAdminKey uint16
	// Actor_Oper_Aggregator_Key
	ActorOperKey uint16
	//Aggregator_MAC_address
	AggMacAddr    [6]uint8 // ADMIN: AggActorSystmID
	AggPriority   uint16   // ADMIN: AggActorSystemPriority
	PortAlgorithm [4]uint8 // AggPortAlgorithm
	PartnerDWC    bool

	// If attached to a DR then this will be set
	DrniName string

	// TODO need to fill in the parameters for DR's use
	// Partner_System
	PartnerSystemId [6]uint8
	// Partner_System_Priority
	PartnerSystemPriority int
	// Partner_Oper_Aggregator_Key
	PartnerOperKey uint16

	// UP/DOWN
	AdminState bool
	OperState  bool

	// Port number from LaAggPort
	// LAG_Ports
	PortNumList []uint16

	// Ports in Distributed State
	DistributedPortNumList []string

	// For now this value assumes the value of the linux modes
	// 0 - L2
	// 1 - L2+L3
	// 2 - L3+L4
	// 3 - ENCAP
	// 4 - ENCAP2
	LagHash uint32

	// Similar to Port attrute L2/l3/Internal
	ConfigMode string
	// contains filtered or unexported fields
}

func NewLaAggregator

func NewLaAggregator(ac *LaAggConfig) *LaAggregator

func (*LaAggregator) DeleteLaAgg

func (a *LaAggregator) DeleteLaAgg()

func (*LaAggregator) LacpAggLog

func (a *LaAggregator) LacpAggLog(msg string)

func (*LaAggregator) LacpMuxCheckSelectionLogic

func (a *LaAggregator) LacpMuxCheckSelectionLogic(p *LaAggPort, sendResponse bool)

LacpMuxCheckSelectionLogic will be called after the wait while timer has expired. If this is the last port to have its wait while timer expire then will transition the mux State from waiting to attached

type LacpActorCdMachine

type LacpActorCdMachine struct {
	LacpCdMachine
}

func LacpActorCdMachineFSMBuild

func LacpActorCdMachineFSMBuild(p *LaAggPort) *LacpActorCdMachine

func NewLacpActorCdMachine

func NewLacpActorCdMachine(port *LaAggPort) *LacpActorCdMachine

NewLacpActorCdMachine will create a new instance of the LacpRxMachine

func (*LacpActorCdMachine) LacpCdMachineActorChurn

func (cdm *LacpActorCdMachine) LacpCdMachineActorChurn(m fsm.Machine, data interface{}) fsm.State

LacpCdMachineActorChurn will set the churn State to true

func (*LacpActorCdMachine) LacpCdMachineActorChurnMonitor

func (cdm *LacpActorCdMachine) LacpCdMachineActorChurnMonitor(m fsm.Machine, data interface{}) fsm.State

LacpCdMachineActorChurnMonitor will set the churn State to true and kick off the churn detection timer

func (*LacpActorCdMachine) LacpCdMachineNoActorChurn

func (cdm *LacpActorCdMachine) LacpCdMachineNoActorChurn(m fsm.Machine, data interface{}) fsm.State

LacpCdMachineNoActorChurn will set the churn State to false

type LacpAggEvtCb

type LacpAggEvtCb func(ifindex int32)

type LacpAggregatorStats

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

type LacpCbDbEntry

type LacpCbDbEntry struct {
	PortCreateDbList  map[string]LacpPortEvtCb
	PortDeleteDbList  map[string]LacpPortEvtCb
	PortUpDbList      map[string]LacpPortEvtCb
	PortDownDbList    map[string]LacpPortEvtCb
	AggCreateDbList   map[string]LacpAggEvtCb
	AggDeleteDbList   map[string]LacpAggEvtCb
	AggOperUpDbList   map[string]LacpAggEvtCb
	AggOperDownDbList map[string]LacpAggEvtCb
}
var LacpCbDb LacpCbDbEntry

type LacpCdMachine

type LacpCdMachine struct {
	// for debugging
	PreviousState fsm.State

	// actor
	Machine *fsm.Machine

	// machine specific events
	CdmEvents         chan utils.MachineEvent
	CdmLogEnableEvent chan bool
	// contains filtered or unexported fields
}

LacpRxMachine holds FSM and current State and event channels for State transitions

func (*LacpCdMachine) Apply

func (cdm *LacpCdMachine) Apply(r *fsm.Ruleset) *fsm.Machine

A helpful function that lets us apply arbitrary rulesets to this instances State machine without reallocating the machine.

func (*LacpCdMachine) ChurnDetectionTimerIntervalSet

func (cdm *LacpCdMachine) ChurnDetectionTimerIntervalSet(interval time.Duration)

func (*LacpCdMachine) ChurnDetectionTimerStart

func (cdm *LacpCdMachine) ChurnDetectionTimerStart()

func (*LacpCdMachine) ChurnDetectionTimerStop

func (cdm *LacpCdMachine) ChurnDetectionTimerStop()

func (*LacpCdMachine) LacpCdmLog

func (cdm *LacpCdMachine) LacpCdmLog(msg string)

func (*LacpCdMachine) PrevState

func (cdm *LacpCdMachine) PrevState() fsm.State

func (*LacpCdMachine) PrevStateSet

func (cdm *LacpCdMachine) PrevStateSet(s fsm.State)

PrevStateSet will set the previous State

func (*LacpCdMachine) Stop

func (cdm *LacpCdMachine) Stop()

type LacpConfigInfo

type LacpConfigInfo struct {
	Interval time.Duration
	Mode     uint32
	// In format AA:BB:CC:DD:EE:FF
	SystemIdMac    string
	SystemPriority uint16
}

type LacpCounters

type LacpCounters struct {
	LacpInPkts        uint64
	LacpOutPkts       uint64
	LacpRxErrors      uint64
	LacpTxErrors      uint64
	LacpUnknownErrors uint64
	LacpErrors        uint64
}

type LacpMuxMachine

type LacpMuxMachine struct {
	// for debugging
	PreviousState fsm.State

	Machine *fsm.Machine

	// machine specific events
	MuxmEvents         chan utils.MachineEvent
	MuxmLogEnableEvent chan bool
	// contains filtered or unexported fields
}

LacpRxMachine holds FSM and current State and event channels for State transitions

func NewLacpMuxMachine

func NewLacpMuxMachine(port *LaAggPort) *LacpMuxMachine

NewLacpRxMachine will create a new instance of the LacpRxMachine

func (*LacpMuxMachine) Apply

func (muxm *LacpMuxMachine) Apply(r *fsm.Ruleset) *fsm.Machine

A helpful function that lets us apply arbitrary rulesets to this instances State machine without reallocating the machine.

func (*LacpMuxMachine) AttachMuxToAggregator

func (muxm *LacpMuxMachine) AttachMuxToAggregator()

AttachMuxToAggregator is a required function defined in 802.1ax-2014 Section 6.4.9 This function causes the Aggregation Port’s Control Parser/Multiplexer to be attached to the Aggregator Parser/Multiplexer of the selected Aggregator, in preparation for collecting and distributing frames.

func (*LacpMuxMachine) DetachMuxFromAggregator

func (muxm *LacpMuxMachine) DetachMuxFromAggregator()

DetachMuxFromAggregator is a required function defined in 802.1ax-2014 Section 6.4.9 This function causes the Aggregation Port’s Control Parser/Multiplexer to be detached from the Aggregator Parser/Multiplexer of the Aggregator to which the Aggregation Port is currently attached.

func (*LacpMuxMachine) DisableCollecting

func (muxm *LacpMuxMachine) DisableCollecting()

DisableCollecting is a required function defined in 802.1ax-2014 Section 6.4.9 This function causes the Aggregator Parser of the Aggregator to which the Aggregation Port is attached to stop collecting frames from the Aggregation Port.

func (*LacpMuxMachine) DisableCollectingDistributing

func (muxm *LacpMuxMachine) DisableCollectingDistributing()

DisableCollectingDistributing is a required function defined in 802.1ax-2014 Section 6.4.9 This function causes the Aggregator Parser of the Aggregator to which the Aggregation Port is attached to stop collecting frames from the Aggregation Port, and the Aggregator Multiplexer to stop distributing frames to the Aggregation Port.

func (*LacpMuxMachine) DisableDistributing

func (muxm *LacpMuxMachine) DisableDistributing()

DisableDistributing is a required function defined in 802.1ax-2014 Section 6.4.9 This function causes the Aggregator Multiplexer of the Aggregator to which the Aggregation Port is attached to stop distributing frames to the Aggregation Port.

func (*LacpMuxMachine) EnableCollecting

func (muxm *LacpMuxMachine) EnableCollecting()

EnableCollecting is a required function defined in 802.1ax-2014 Section 6.4.9 This function causes the Aggregator Parser of the Aggregator to which the Aggregation Port is attached to start collecting frames from the Aggregation Port.

func (*LacpMuxMachine) EnableCollectingDistributing

func (muxm *LacpMuxMachine) EnableCollectingDistributing()

EnableCollectingDistributing is a required function defined in 802.1ax-2014 Section 6.4.9 This function causes the Aggregator Parser of the Aggregator to which the Aggregation Port is attached to start collecting frames from the Aggregation Port, and the Aggregator Multiplexer to start distributing frames to the Aggregation Port.

func (*LacpMuxMachine) EnableDistributing

func (muxm *LacpMuxMachine) EnableDistributing()

EnableDistributing is a required function defined in 802.1ax-2014 Section 6.4.9 This function causes the Aggregator Multiplexer of the Aggregator to which the Aggregation Port is attached to start distributing frames to the Aggregation Port.

func (*LacpMuxMachine) LacpMuxmAttached

func (muxm *LacpMuxMachine) LacpMuxmAttached(m fsm.Machine, data interface{}) fsm.State

LacpMuxmAttached

func (*LacpMuxMachine) LacpMuxmCAttached

func (muxm *LacpMuxMachine) LacpMuxmCAttached(m fsm.Machine, data interface{}) fsm.State

LacpMuxmAttached

func (*LacpMuxMachine) LacpMuxmCCollectingDistributing

func (muxm *LacpMuxMachine) LacpMuxmCCollectingDistributing(m fsm.Machine, data interface{}) fsm.State

LacpMuxmCollecting

func (*LacpMuxMachine) LacpMuxmCDetached

func (muxm *LacpMuxMachine) LacpMuxmCDetached(m fsm.Machine, data interface{}) fsm.State

LacpMuxmCDetached

func (*LacpMuxMachine) LacpMuxmCWaiting

func (muxm *LacpMuxMachine) LacpMuxmCWaiting(m fsm.Machine, data interface{}) fsm.State

LacpMuxmCWaiting

func (*LacpMuxMachine) LacpMuxmCollecting

func (muxm *LacpMuxMachine) LacpMuxmCollecting(m fsm.Machine, data interface{}) fsm.State

LacpMuxmCollecting

func (*LacpMuxMachine) LacpMuxmDetached

func (muxm *LacpMuxMachine) LacpMuxmDetached(m fsm.Machine, data interface{}) fsm.State

LacpMuxmDetached

func (*LacpMuxMachine) LacpMuxmDistributing

func (muxm *LacpMuxMachine) LacpMuxmDistributing(m fsm.Machine, data interface{}) fsm.State

LacpMuxmDistributing

func (*LacpMuxMachine) LacpMuxmLog

func (muxm *LacpMuxMachine) LacpMuxmLog(msg string)

func (*LacpMuxMachine) LacpMuxmWaiting

func (muxm *LacpMuxMachine) LacpMuxmWaiting(m fsm.Machine, data interface{}) fsm.State

LacpMuxmWaiting

func (*LacpMuxMachine) LacpMuxmWaitingEvaluateSelected

func (muxm *LacpMuxMachine) LacpMuxmWaitingEvaluateSelected(sendResponse bool)

LacpMuxmEvaluateSelected 802.1ax-2014 Section 6.4.15 d) If Selected is SELECTED, the wait_while_timer forces a delay to allow for the possibility that other Aggregation Ports may be reconfiguring at the same time. Once the wait_while_timer expires, and once the wait_ while_timers of all other Aggregation Ports that are ready to attach to the same Aggregator have expired, the process of attaching the Aggregation Port to the Aggregator can proceed, and the State machine enters the ATTACHED State. During the waiting time, changes in selection parameters can occur that will result in a re-evaluation of Selected. If Selected becomes UNSELECTED, then the State machine reenters the DETACHED State. If Selected becomes STANDBY, the operation is as described in item e).

NOTE—This waiting period reduces the disturbance that will be visible to higher layers; for example, on start-up events. However, the selection need not wait for the entire waiting period in cases where it is known that no other Aggregation Ports will attach; for example, where all other Aggregation Ports with the same operational Key are already attached to the Aggregator.

e) If Selected is STANDBY, the Aggregation Port is held in the WAITING State until such a time as the selection parameters change, resulting in a re-evaluation of the Selected variable. If Selected becomes UNSELECTED, the State machine reenters the DETACHED State. If SELECTED becomes SELECTED, then the operation is as described in item d). The latter case allows an Aggregation Port to be brought into operation from STANDBY with minimum delay once Selected becomes SELECTED.

func (*LacpMuxMachine) PrevState

func (muxm *LacpMuxMachine) PrevState() fsm.State

func (*LacpMuxMachine) PrevStateSet

func (muxm *LacpMuxMachine) PrevStateSet(s fsm.State)

PrevStateSet will set the previous State

func (*LacpMuxMachine) SendTxMachineNtt

func (muxm *LacpMuxMachine) SendTxMachineNtt()

func (*LacpMuxMachine) Stop

func (muxm *LacpMuxMachine) Stop()

func (*LacpMuxMachine) WaitWhileTimerStart

func (muxm *LacpMuxMachine) WaitWhileTimerStart()

WaitWhileTimerStart Start the timer

func (*LacpMuxMachine) WaitWhileTimerStop

func (muxm *LacpMuxMachine) WaitWhileTimerStop()

WaitWhileTimerStop Stop the timer, which should only happen on creation as well as when the lacp mode is "on"

func (*LacpMuxMachine) WaitWhileTimerTimeoutSet

func (muxm *LacpMuxMachine) WaitWhileTimerTimeoutSet(timeout time.Duration)

type LacpPartnerCdMachine

type LacpPartnerCdMachine struct {
	LacpCdMachine
}

func LacpPartnerCdMachineFSMBuild

func LacpPartnerCdMachineFSMBuild(p *LaAggPort) *LacpPartnerCdMachine

func NewLacpPartnerCdMachine

func NewLacpPartnerCdMachine(port *LaAggPort) *LacpPartnerCdMachine

NewLacpActorCdMachine will create a new instance of the LacpRxMachine

func (*LacpPartnerCdMachine) LacpCdMachineNoPartnerChurn

func (cdm *LacpPartnerCdMachine) LacpCdMachineNoPartnerChurn(m fsm.Machine, data interface{}) fsm.State

LacpCdMachineNoActorChurn will set the churn State to false

func (*LacpPartnerCdMachine) LacpCdMachinePartnerChurn

func (cdm *LacpPartnerCdMachine) LacpCdMachinePartnerChurn(m fsm.Machine, data interface{}) fsm.State

LacpCdMachineActorChurn will set the churn State to true

func (*LacpPartnerCdMachine) LacpCdMachinePartnerChurnMonitor

func (cdm *LacpPartnerCdMachine) LacpCdMachinePartnerChurnMonitor(m fsm.Machine, data interface{}) fsm.State

LacpCdMachineActorChurnMonitor will set the churn State to true and kick off the churn detection timer

func (*LacpPartnerCdMachine) LacpCdmLog

func (cdm *LacpPartnerCdMachine) LacpCdmLog(msg string)

type LacpPortEvtCb

type LacpPortEvtCb func(ifindex int32)

port events

type LacpPortInfo

type LacpPortInfo struct {
	System   LacpSystem
	Key      uint16
	Port_pri uint16

	State uint8
	// contains filtered or unexported fields
}

func LacpSysGlobalDefaultActorSystemGet

func LacpSysGlobalDefaultActorSystemGet(sysId LacpSystem) *LacpPortInfo

func LacpSysGlobalDefaultPartnerInfoGet

func LacpSysGlobalDefaultPartnerInfoGet(sysId LacpSystem) *LacpPortInfo

type LacpPtxMachine

type LacpPtxMachine struct {
	// for debugging
	PreviousState fsm.State

	Machine *fsm.Machine

	// current tx interval LONG/SHORT
	PeriodicTxTimerInterval time.Duration

	// machine specific events
	PtxmEvents chan utils.MachineEvent
	// enable logging
	PtxmLogEnableEvent chan bool
	// contains filtered or unexported fields
}

LacpRxMachine holds FSM and current State and event channels for State transitions

func LacpPtxMachineFSMBuild

func LacpPtxMachineFSMBuild(p *LaAggPort) *LacpPtxMachine

func NewLacpPtxMachine

func NewLacpPtxMachine(port *LaAggPort) *LacpPtxMachine

NewLacpRxMachine will create a new instance of the LacpRxMachine

func (*LacpPtxMachine) Apply

func (ptxm *LacpPtxMachine) Apply(r *fsm.Ruleset) *fsm.Machine

A helpful function that lets us apply arbitrary rulesets to this instances State machine without reallocating the machine.

func (*LacpPtxMachine) LacpPtxIsNoPeriodicExitCondition

func (m *LacpPtxMachine) LacpPtxIsNoPeriodicExitCondition() bool

LacpPtxIsNoPeriodicExitCondition is meant to check if the UTC condition has been met when the State is NO PERIODIC

func (*LacpPtxMachine) LacpPtxMachineFastPeriodic

func (ptxm *LacpPtxMachine) LacpPtxMachineFastPeriodic(m fsm.Machine, data interface{}) fsm.State

LacpPtxMachineFastPeriodic sets the periodic transmission time to fast and starts the timer

func (*LacpPtxMachine) LacpPtxMachineNoPeriodic

func (ptxm *LacpPtxMachine) LacpPtxMachineNoPeriodic(m fsm.Machine, data interface{}) fsm.State

LacpPtxMachineNoPeriodic stops the periodic transmission of packets

func (*LacpPtxMachine) LacpPtxMachinePeriodicTx

func (ptxm *LacpPtxMachine) LacpPtxMachinePeriodicTx(m fsm.Machine, data interface{}) fsm.State

LacpPtxMachinePeriodicTx informs the tx machine that a packet should be transmitted by setting ntt = true

func (*LacpPtxMachine) LacpPtxMachineSlowPeriodic

func (ptxm *LacpPtxMachine) LacpPtxMachineSlowPeriodic(m fsm.Machine, data interface{}) fsm.State

LacpPtxMachineSlowPeriodic sets the periodic transmission time to slow and starts the timer

func (*LacpPtxMachine) LacpPtxmLog

func (ptxm *LacpPtxMachine) LacpPtxmLog(msg string)

func (*LacpPtxMachine) PeriodicTimerIntervalSet

func (ptxm *LacpPtxMachine) PeriodicTimerIntervalSet(interval time.Duration)

func (*LacpPtxMachine) PeriodicTimerStart

func (ptxm *LacpPtxMachine) PeriodicTimerStart()

func (*LacpPtxMachine) PeriodicTimerStop

func (ptxm *LacpPtxMachine) PeriodicTimerStop()

func (*LacpPtxMachine) PrevState

func (ptxm *LacpPtxMachine) PrevState() fsm.State

func (*LacpPtxMachine) PrevStateSet

func (ptxm *LacpPtxMachine) PrevStateSet(s fsm.State)

PrevStateSet will set the previous State

func (*LacpPtxMachine) Stop

func (ptxm *LacpPtxMachine) Stop()

type LacpRxLacpPdu

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

type LacpRxMachine

type LacpRxMachine struct {
	// for debugging
	PreviousState fsm.State

	Machine *fsm.Machine

	// machine specific events
	RxmEvents         chan utils.MachineEvent
	RxmPktRxEvent     chan LacpRxLacpPdu
	RxmLogEnableEvent chan bool
	// contains filtered or unexported fields
}

LacpRxMachine holds FSM and current State and event channels for State transitions

func LacpRxMachineFSMBuild

func LacpRxMachineFSMBuild(p *LaAggPort) *LacpRxMachine

func NewLacpRxMachine

func NewLacpRxMachine(port *LaAggPort) *LacpRxMachine

NewLacpRxMachine will create a new instance of the LacpRxMachine

func (*LacpRxMachine) Apply

func (rxm *LacpRxMachine) Apply(r *fsm.Ruleset) *fsm.Machine

A helpful function that lets us apply arbitrary rulesets to this instances State machine without reallocating the machine.

func (*LacpRxMachine) CheckPortMoved

func (rxm *LacpRxMachine) CheckPortMoved(PartnerOper *LacpPortInfo, pktActor *layers.LACPPortInfo) bool

func (*LacpRxMachine) CurrentWhileTimerStart

func (rxm *LacpRxMachine) CurrentWhileTimerStart()

func (*LacpRxMachine) CurrentWhileTimerStop

func (rxm *LacpRxMachine) CurrentWhileTimerStop()

func (*LacpRxMachine) CurrentWhileTimerTimeoutSet

func (rxm *LacpRxMachine) CurrentWhileTimerTimeoutSet(timeout time.Duration)

func (*LacpRxMachine) CurrentWhileTimerValid

func (rxm *LacpRxMachine) CurrentWhileTimerValid() (time.Duration, bool)

currentWhileTimerValid checks the State against the Actor Port Oper State Timeout

func (*LacpRxMachine) InformMachinesOfStateChanges

func (rxm *LacpRxMachine) InformMachinesOfStateChanges()

InformMachinesOfStateChanges will inform other State machines of the various event changes made when rx machine receives a packet

func (*LacpRxMachine) LacpRxMachineCurrent

func (rxm *LacpRxMachine) LacpRxMachineCurrent(m fsm.Machine, data interface{}) fsm.State

LacpRxMachineCurrent function to be called after State transition to CURRENT

func (*LacpRxMachine) LacpRxMachineDefaulted

func (rxm *LacpRxMachine) LacpRxMachineDefaulted(m fsm.Machine, data interface{}) fsm.State

LacpRxMachineDefaulted function to be called after State transition to DEFAULTED

func (*LacpRxMachine) LacpRxMachineExpired

func (rxm *LacpRxMachine) LacpRxMachineExpired(m fsm.Machine, data interface{}) fsm.State

LacpRxMachineExpired function to be called after State transition to EXPIRED

func (*LacpRxMachine) LacpRxMachineInitialize

func (rxm *LacpRxMachine) LacpRxMachineInitialize(m fsm.Machine, data interface{}) fsm.State

LacpRxMachineInitialize function to be called after State transition to INITIALIZE

func (*LacpRxMachine) LacpRxMachineLacpDisabled

func (rxm *LacpRxMachine) LacpRxMachineLacpDisabled(m fsm.Machine, data interface{}) fsm.State

LacpRxMachineLacpDisabled function to be called after State transition to LACP_DISABLED

func (*LacpRxMachine) LacpRxMachinePortDisabled

func (rxm *LacpRxMachine) LacpRxMachinePortDisabled(m fsm.Machine, data interface{}) fsm.State

LacpRxMachineExpired function to be called after State transition to PORT_DISABLED

func (*LacpRxMachine) LacpRxmLog

func (rxm *LacpRxMachine) LacpRxmLog(msg string)

func (*LacpRxMachine) PrevState

func (rxm *LacpRxMachine) PrevState() fsm.State

func (*LacpRxMachine) PrevStateSet

func (rxm *LacpRxMachine) PrevStateSet(s fsm.State)

PrevStateSet will set the previous State

func (*LacpRxMachine) Stop

func (rxm *LacpRxMachine) Stop()

Stop should clean up all resources

type LacpSysGlobalInfo

type LacpSysGlobalInfo struct {
	LacpEnabled                bool
	PortMap                    map[PortIdKey]*LaAggPort
	PortList                   []*LaAggPort
	AggMap                     map[AggIdKey]*LaAggregator
	AggList                    []*LaAggregator
	SystemDefaultParams        LacpSystem
	PartnerSystemDefaultParams LacpSystem
	ActorStateDefaultParams    LacpPortInfo
	PartnerStateDefaultParams  LacpPortInfo
	SysKey                     LacpSystem

	// list of tx function which should be called for a given port
	TxCallbacks map[string][]TxCallback
	// contains filtered or unexported fields
}

func LacpSysGlobalInfoByIdGet

func LacpSysGlobalInfoByIdGet(sysId LacpSystem) *LacpSysGlobalInfo

func LacpSysGlobalInfoGet

func LacpSysGlobalInfoGet() []*LacpSysGlobalInfo

func LacpSysGlobalInfoInit

func LacpSysGlobalInfoInit(sysId LacpSystem) *LacpSysGlobalInfo

NewLacpSysGlobalInfo will create a port map, agg map as well as set some default parameters to be used to setup each new port.

NOTE: Only one instance should exist on live System

func (*LacpSysGlobalInfo) LaSysGlobalDeRegisterTxCallback

func (g *LacpSysGlobalInfo) LaSysGlobalDeRegisterTxCallback(intf string)

func (*LacpSysGlobalInfo) LaSysGlobalRegisterTxCallback

func (g *LacpSysGlobalInfo) LaSysGlobalRegisterTxCallback(intf string, f TxCallback)

func (*LacpSysGlobalInfo) LacpSysGlobalAggListGet

func (g *LacpSysGlobalInfo) LacpSysGlobalAggListGet() []*LaAggregator

func (*LacpSysGlobalInfo) LacpSysGlobalAggPortListGet

func (g *LacpSysGlobalInfo) LacpSysGlobalAggPortListGet() []*LaAggPort

func (*LacpSysGlobalInfo) String

func (g *LacpSysGlobalInfo) String() (s string)

type LacpSystem

type LacpSystem struct {
	// System Priority
	Actor_System_priority uint16
	// MAC address component of the System Id
	Actor_System [6]uint8
}

6.4.5 Variables associated with the System

var LaSystemIdDefault LacpSystem

func LacpSysGlobalDefaultPartnerSystemGet

func LacpSysGlobalDefaultPartnerSystemGet(sysId LacpSystem) *LacpSystem

func LacpSysGlobalDefaultSystemGet

func LacpSysGlobalDefaultSystemGet(sysId LacpSystem) *LacpSystem

func (*LacpSystem) LacpSystemActorSystemIdSet

func (s *LacpSystem) LacpSystemActorSystemIdSet(Actor_System net.HardwareAddr)

func (*LacpSystem) LacpSystemActorSystemPrioritySet

func (s *LacpSystem) LacpSystemActorSystemPrioritySet(Actor_System_priority uint16)

func (*LacpSystem) LacpSystemConvertSystemIdToString

func (s *LacpSystem) LacpSystemConvertSystemIdToString() string

type LacpTxMachine

type LacpTxMachine struct {
	// for debugging
	PreviousState fsm.State

	Machine *fsm.Machine

	// machine specific events
	TxmEvents         chan utils.MachineEvent
	TxmLogEnableEvent chan bool
	// contains filtered or unexported fields
}

LacpRxMachine holds FSM and current State and event channels for State transitions

func LacpTxMachineFSMBuild

func LacpTxMachineFSMBuild(p *LaAggPort) *LacpTxMachine

LacpTxMachineFSMBuild will build the State machine with callbacks

func NewLacpTxMachine

func NewLacpTxMachine(port *LaAggPort) *LacpTxMachine

NewLacpRxMachine will create a new instance of the LacpRxMachine

func (*LacpTxMachine) Apply

func (txm *LacpTxMachine) Apply(r *fsm.Ruleset) *fsm.Machine

A helpful function that lets us apply arbitrary rulesets to this instances State machine without reallocating the machine.

func (*LacpTxMachine) LacpTxGuardGeneration

func (txm *LacpTxMachine) LacpTxGuardGeneration()

LacpTxGuardGeneration will generate an event to the Tx Machine in order to clear the txPkts count

func (*LacpTxMachine) LacpTxMachineDelayed

func (txm *LacpTxMachine) LacpTxMachineDelayed(m fsm.Machine, data interface{}) fsm.State

LacpTxMachineDelayed is a State in which a packet is forced to transmit regardless of the ntt State

func (*LacpTxMachine) LacpTxMachineGuard

func (txm *LacpTxMachine) LacpTxMachineGuard(m fsm.Machine, data interface{}) fsm.State

LacpTxMachineGuard will clear the current transmited packet count and generate a new event to tx a new packet

func (*LacpTxMachine) LacpTxMachineOff

func (txm *LacpTxMachine) LacpTxMachineOff(m fsm.Machine, data interface{}) fsm.State

LacpTxMachineOff will ensure that no packets are transmitted, typically means that lacp has been disabled

func (*LacpTxMachine) LacpTxMachineOn

func (txm *LacpTxMachine) LacpTxMachineOn(m fsm.Machine, data interface{}) fsm.State

LacpTxMachineOn will either send a packet out or delay transmission of a packet

func (*LacpTxMachine) LacpTxmLog

func (txm *LacpTxMachine) LacpTxmLog(msg string)

func (*LacpTxMachine) PrevState

func (txm *LacpTxMachine) PrevState() fsm.State

PrevState will get the previous State from the State transitions

func (*LacpTxMachine) PrevStateSet

func (txm *LacpTxMachine) PrevStateSet(s fsm.State)

PrevStateSet will set the previous State

func (*LacpTxMachine) Stop

func (txm *LacpTxMachine) Stop()

Stop will stop all timers and close all channels

func (*LacpTxMachine) TxGuardTimerStart

func (txm *LacpTxMachine) TxGuardTimerStart()

TxGuardTimerStart used by Tx Machine as described in 802.1ax-2014 Section 6.4.17 in order to not transmit more than 3 packets in this interval

func (*LacpTxMachine) TxGuardTimerStop

func (txm *LacpTxMachine) TxGuardTimerStop()

TxDelayTimerStop to stop the Delay timer in case a port is deleted or initialized

type LampMarkerResponderMachine

type LampMarkerResponderMachine struct {
	// for debugging
	PreviousState fsm.State

	Machine *fsm.Machine

	// machine specific events
	LampMarkerResponderEvents         chan utils.MachineEvent
	LampMarkerResponderPktRxEvent     chan LampRxLampPdu
	LampMarkerResponderLogEnableEvent chan bool
	// contains filtered or unexported fields
}

LacpRxMachine holds FSM and current State and event channels for State transitions

func LampMarkerResponderFSMBuild

func LampMarkerResponderFSMBuild(p *LaAggPort) *LampMarkerResponderMachine

func NewLampMarkerResponder

func NewLampMarkerResponder(port *LaAggPort) *LampMarkerResponderMachine

NewLacpRxMachine will create a new instance of the LacpRxMachine

func (*LampMarkerResponderMachine) Apply

A helpful function that lets us apply arbitrary rulesets to this instances State machine without reallocating the machine.

func (*LampMarkerResponderMachine) LampMarkerResponderLog

func (mr *LampMarkerResponderMachine) LampMarkerResponderLog(msg string)

func (*LampMarkerResponderMachine) LampMarkerResponderRespondToMarker

func (mr *LampMarkerResponderMachine) LampMarkerResponderRespondToMarker(m fsm.Machine, data interface{}) fsm.State

func (*LampMarkerResponderMachine) LampMarkerResponderWaitForMarker

func (mr *LampMarkerResponderMachine) LampMarkerResponderWaitForMarker(m fsm.Machine, data interface{}) fsm.State

func (*LampMarkerResponderMachine) PrevState

func (mr *LampMarkerResponderMachine) PrevState() fsm.State

func (*LampMarkerResponderMachine) PrevStateSet

func (mr *LampMarkerResponderMachine) PrevStateSet(s fsm.State)

PrevStateSet will set the previous State

func (*LampMarkerResponderMachine) Stop

func (mr *LampMarkerResponderMachine) Stop()

Stop should clean up all resources

type LampRxLampPdu

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

type PortIdKey

type PortIdKey struct {
	Name string
	Id   uint16
}

type PortProperties

type PortProperties struct {
	Mac    net.HardwareAddr
	Speed  int
	Duplex int
	Mtu    int
}

type SimulationBridge

type SimulationBridge struct {
	Port1       uint16
	Port2       uint16
	RxLacpPort1 chan gopacket.Packet
	RxLacpPort2 chan gopacket.Packet
	RxLampPort1 chan gopacket.Packet
	RxLampPort2 chan gopacket.Packet
}

bridge will simulate communication between two channels

func (*SimulationBridge) TxViaGoChannel

func (bridge *SimulationBridge) TxViaGoChannel(port uint16, pdu interface{})

type TxCallback

type TxCallback func(port uint16, data interface{})

func LaSysGlobalTxCallbackListGet

func LaSysGlobalTxCallbackListGet(p *LaAggPort) []TxCallback

Jump to

Keyboard shortcuts

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