Documentation ¶
Overview ¶
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 / | (----` \ \/ \/ / | | `---| |----`| ,----'| |__| | | __| | | | __| > < \ \ \ / | | | | | | | __ | | | | `----.| |____ / . \ .----) | \ /\ / | | | | | `----.| | | | |__| |_______||_______/__/ \__\ |_______/ \__/ \__/ |__| |__| \______||__| |__|
802.1ax-2014 Section 9.4.17 DRNI Gateway and Aggregator machines rxmachine.go
config.go
conversationId.go
debugEventLog this code is meant to serialize the logging States
def.go
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 / | (----` \ \/ \/ / | | `---| |----`| ,----'| |__| | | __| | | | __| > < \ \ \ / | | | | | | | __ | | | | `----.| |____ / . \ .----) | \ /\ / | | | | | `----.| | | | |__| |_______||_______/__/ \__\ |_______/ \__/ \__/ |__| |__| \______||__| |__|
dr.go
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 / | (----` \ \/ \/ / | | `---| |----`| ,----'| |__| | | __| | | | __| > < \ \ \ / | | | | | | | __ | | | | `----.| |____ / . \ .----) | \ /\ / | | | | | `----.| | | | |__| |_______||_______/__/ \__\ |_______/ \__/ \__/ |__| |__| \______||__| |__|
drIpp.go
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 / | (----` \ \/ \/ / | | `---| |----`| ,----'| |__| | | __| | | | __| > < \ \ \ / | | | | | | | __ | | | | `----.| |____ / . \ .----) | \ /\ / | | | | | `----.| | | | |__| |_______||_______/__/ \__\ |_______/ \__/ \__/ |__| |__| \______||__| |__|
802.1ax-2014 Section 9.4.17 DRNI Gateway and Aggregator machine gatewaymachine.go
global.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 / | (----` \ \/ \/ / | | `---| |----`| ,----'| |__| | | __| | | | __| > < \ \ \ / | | | | | | | __ | | | | `----.| |____ / . \ .----) | \ /\ / | | | | | `----.| | | | |__| |_______||_______/__/ \__\ |_______/ \__/ \__/ |__| |__| \______||__| |__|
802.1ax-2014 Section 9.4.18 DRNI IPP machines rxmachine.go
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 / | (----` \ \/ \/ / | | `---| |----`| ,----'| |__| | | __| | | | __| > < \ \ \ / | | | | | | | __ | | | | `----.| |____ / . \ .----) | \ /\ / | | | | | `----.| | | | |__| |_______||_______/__/ \__\ |_______/ \__/ \__/ |__| |__| \______||__| |__|
802.1ax-2014 Section 9.4.18 DRNI IPP machines ippgatewaymachine.go
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
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 / | (----` \ \/ \/ / | | `---| |----`| ,----'| |__| | | __| | | | __| > < \ \ \ / | | | | | | | __ | | | | `----.| |____ / . \ .----) | \ /\ / | | | | | `----.| | | | |__| |_______||_______/__/ \__\ |_______/ \__/ \__/ |__| |__| \______||__| |__|
802.1ax-2014 Section 9.4.15 DRCPDU Periodic Transmission machine rxmachine.go
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 / | (----` \ \/ \/ / | | `---| |----`| ,----'| |__| | | __| | | | __| > < \ \ \ / | | | | | | | __ | | | | `----.| |____ / . \ .----) | \ /\ / | | | | | `----.| | | | |__| |_______||_______/__/ \__\ |_______/ \__/ \__/ |__| |__| \______||__| |__|
802.1ax-2014 Section 9.4.15 DRCPDU Periodic Transmission machine rxmachine.go
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
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 / | (----` \ \/ \/ / | | `---| |----`| ,----'| |__| | | __| | | | __| > < \ \ \ / | | | | | | | __ | | | | `----.| |____ / . \ .----) | \ /\ / | | | | | `----.| | | | |__| |_______||_______/__/ \__\ |_______/ \__/ \__/ |__| |__| \______||__| |__|
802.1ax-2014 Section 9.4.14 DRCPDU Receive machine rxmachine.go
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
- Variables
- func AMachineStrStateMapCreate()
- func CreateConversationId(cfg *DRConversationConfig)
- func CreateDistributedRelay(cfg *DistributedRelayConfig)
- func DRFindPortByKey(key IppDbKey, p **DRCPIpp) bool
- func DeleteConversationId(cfg *DRConversationConfig, force bool)
- func DeleteDistributedRelay(name string)
- func DistributedRelayConfigCreateCheck(drniname string, aggregatorid uint32) error
- func DistributedRelayConfigDeleteCheck(drniname string) error
- func DistributedRelayConfigParamCheck(mlag *DistributedRelayConfig) error
- func DrFindByAggregator(DrniAggregator int32, dr **DistributedRelay) bool
- func DrFindByName(DrniName string, dr **DistributedRelay) bool
- func DrFindByPortalAddr(portaladdr string, dr **DistributedRelay) bool
- func DrGetDrcpNext(dr **DistributedRelay) bool
- func DrRxMain(pId uint16, portaladdr string, rxPktChan chan gopacket.Packet)
- func GMachineStrStateMapCreate()
- func GetAllCVIDConversations()
- func IAMachineStrStateMapCreate()
- func IGMachineStrStateMapCreate()
- func IsControlFrame(pId uint16, packet gopacket.Packet) bool
- func NetIplShareMachineStrStateMapCreate()
- func ProcessDrcpFrame(pId uint16, pa string, drcp *layers.DRCP)
- func PsMachineStrStateMapCreate()
- func PtxMachineStrStateMapCreate()
- func RxMachineStrStateMapCreate()
- func TxMachineStrStateMapCreate()
- func TxViaLinuxIf(key IppDbKey, dmac net.HardwareAddr, pdu interface{})
- func UpdateConversationId(cfg *DRConversationConfig)
- type AMachine
- func (am *AMachine) Apply(r *fsm.Ruleset) *fsm.Machine
- func (am *AMachine) DrcpAMachineDRNIPortInitialize(m fsm.Machine, data interface{}) fsm.State
- func (am *AMachine) DrcpAMachineDRNIPortUpdate(m fsm.Machine, data interface{}) fsm.State
- func (am *AMachine) DrcpAMachinePSPortUpdate(m fsm.Machine, data interface{}) fsm.State
- func (am *AMachine) DrcpAmLog(msg string)
- func (am *AMachine) IppAllPortUpdateCheck() bool
- func (am *AMachine) PrevState() fsm.State
- func (am *AMachine) PrevStateSet(s fsm.State)
- func (am *AMachine) Stop()
- type ConvIdTypeValue
- type DRAggregatorPortListConfig
- type DRCPIntraPortal
- type DRCPIpp
- func (p *DRCPIpp) BEGIN(restart bool)
- func (p *DRCPIpp) CreateRxTx()
- func (p *DRCPIpp) DeleteDRCPIpp()
- func (p *DRCPIpp) DeleteRxTx()
- func (p *DRCPIpp) DistributeMachineEvents(mec []chan utils.MachineEvent, e []utils.MachineEvent, waitForResponse bool)
- func (p *DRCPIpp) DrIppLinkDown()
- func (p *DRCPIpp) DrIppLinkUp()
- func (p *DRCPIpp) DrcpIAMachineMain()
- func (p *DRCPIpp) DrcpIGMachineMain()
- func (p *DRCPIpp) DrcpPtxMachineMain()
- func (p *DRCPIpp) DrcpRxMachineMain()
- func (p *DRCPIpp) LaIppLog(msg string)
- func (p *DRCPIpp) NetIplShareMachineMain()
- func (p *DRCPIpp) NotifyNTTDRCPUDChange(src string, oldval, newval bool)
- func (p *DRCPIpp) SetupDRCPMacCapture(mac string)
- func (p *DRCPIpp) Stop()
- func (p *DRCPIpp) TeardownDRCPMacCapture(mac string)
- func (p *DRCPIpp) TxMachineMain()
- type DRConversationConfig
- type DRSystemInfo
- type DistributedRelay
- func (dr *DistributedRelay) AttachAggregatorToDistributedRelay(aggId int32)
- func (dr *DistributedRelay) BEGIN(restart bool)
- func (dr *DistributedRelay) DeleteDistributedRelay()
- func (dr *DistributedRelay) DetachAggregatorFromDistributedRelay(aggId int32)
- func (dr *DistributedRelay) DistributeMachineEvents(mec []chan utils.MachineEvent, e []utils.MachineEvent, waitForResponse bool)
- func (dr *DistributedRelay) DrcpAMachineMain()
- func (dr *DistributedRelay) DrcpGMachineMain()
- func (dr *DistributedRelay) DrcpPsMachineMain()
- func (dr *DistributedRelay) LaDrLog(msg string)
- func (dr *DistributedRelay) NotifyAggPortCreate(ifindex int32)
- func (dr *DistributedRelay) NotifyAggPortDelete(ifindex int32)
- func (dr *DistributedRelay) NotifyAggPortDown(ifindex int32)
- func (dr *DistributedRelay) NotifyAggPortUp(ifindex int32)
- func (dr *DistributedRelay) RegisterForLacpPortUpdates()
- func (dr *DistributedRelay) SetTimeSharingPortAndGatwewayDigest()
- func (dr *DistributedRelay) Stop()
- type DistributedRelayConfig
- type DistributedRelayFunction
- type DistributedRelayIPP
- type DistributedRelayIPPCounters
- type DistributedRelayIPPDebug
- type EncapMethod
- type GMachine
- func (gm *GMachine) Apply(r *fsm.Ruleset) *fsm.Machine
- func (gm *GMachine) DrcpGMachineDRNIGatewayInitialize(m fsm.Machine, data interface{}) fsm.State
- func (gm *GMachine) DrcpGMachineDRNIGatewayUpdate(m fsm.Machine, data interface{}) fsm.State
- func (gm *GMachine) DrcpGMachinePSGatewayUpdate(m fsm.Machine, data interface{}) fsm.State
- func (gm *GMachine) DrcpGmLog(msg string)
- func (gm *GMachine) IppAllGatewayUpdateCheck() bool
- func (gm *GMachine) PrevState() fsm.State
- func (gm *GMachine) PrevStateSet(s fsm.State)
- func (gm *GMachine) Stop()
- type GatewayAlgorithm
- type GatewayVectorEntry
- type IAMachine
- func (iam *IAMachine) Apply(r *fsm.Ruleset) *fsm.Machine
- func (iam *IAMachine) DrcpIAMachineIPPPortInitialize(m fsm.Machine, data interface{}) fsm.State
- func (iam *IAMachine) DrcpIAMachineIPPPortUpdate(m fsm.Machine, data interface{}) fsm.State
- func (iam *IAMachine) DrcpIAmLog(msg string)
- func (iam *IAMachine) PrevState() fsm.State
- func (iam *IAMachine) PrevStateSet(s fsm.State)
- func (iam *IAMachine) Stop()
- type IGMachine
- func (igm *IGMachine) Apply(r *fsm.Ruleset) *fsm.Machine
- func (igm *IGMachine) DrcpIGMachineIPPGatewayInitialize(m fsm.Machine, data interface{}) fsm.State
- func (igm *IGMachine) DrcpIGMachineIPPGatewayUpdate(m fsm.Machine, data interface{}) fsm.State
- func (igm *IGMachine) DrcpIGmLog(msg string)
- func (igm *IGMachine) NotifyIppAllGatewayUpdate()
- func (igm *IGMachine) PrevState() fsm.State
- func (igm *IGMachine) PrevStateSet(s fsm.State)
- func (igm *IGMachine) Stop()
- type IppDbKey
- type MacCaptureKey
- type Md5Digest
- type NetIplShareMachine
- func (nism *NetIplShareMachine) Apply(r *fsm.Ruleset) *fsm.Machine
- func (nism *NetIplShareMachine) DrcpNetIplShareMachineManipulatedFramesSent(m fsm.Machine, data interface{}) fsm.State
- func (nism *NetIplShareMachine) DrcpNetIplShareMachineNoManipulatedFramesSent(m fsm.Machine, data interface{}) fsm.State
- func (nism *NetIplShareMachine) DrcpNetIplShareMachineTimeSharedMethod(m fsm.Machine, data interface{}) fsm.State
- func (nism *NetIplShareMachine) DrcpNetIplSharemLog(msg string)
- func (nism *NetIplShareMachine) PrevState() fsm.State
- func (nism *NetIplShareMachine) PrevStateSet(s fsm.State)
- func (nism *NetIplShareMachine) Stop()
- type PsMachine
- func (psm *PsMachine) Apply(r *fsm.Ruleset) *fsm.Machine
- func (psm *PsMachine) DrcpPsMachinePortalSystemInitialize(m fsm.Machine, data interface{}) fsm.State
- func (psm *PsMachine) DrcpPsMachinePortalSystemUpdate(m fsm.Machine, data interface{}) fsm.State
- func (psm *PsMachine) DrcpPsmLog(msg string)
- func (psm *PsMachine) PrevState() fsm.State
- func (psm *PsMachine) PrevStateSet(s fsm.State)
- func (psm *PsMachine) Stop()
- type PtxMachine
- func (ptxm *PtxMachine) Apply(r *fsm.Ruleset) *fsm.Machine
- func (ptxm *PtxMachine) DrcpPtxMachineFastPeriodic(m fsm.Machine, data interface{}) fsm.State
- func (ptxm *PtxMachine) DrcpPtxMachineNoPeriodic(m fsm.Machine, data interface{}) fsm.State
- func (ptxm *PtxMachine) DrcpPtxMachinePeriodicTx(m fsm.Machine, data interface{}) fsm.State
- func (ptxm *PtxMachine) DrcpPtxMachineSlowPeriodic(m fsm.Machine, data interface{}) fsm.State
- func (ptxm *PtxMachine) DrcpPtxmLog(msg string)
- func (ptxm *PtxMachine) PeriodicTimerIntervalSet(interval time.Duration)
- func (ptxm *PtxMachine) PeriodicTimerStart()
- func (ptxm *PtxMachine) PeriodicTimerStop()
- func (ptxm *PtxMachine) PrevState() fsm.State
- func (ptxm *PtxMachine) PrevStateSet(s fsm.State)
- func (ptxm *PtxMachine) Stop()
- type RxDrcpPdu
- type RxMachine
- func (rxm *RxMachine) Apply(r *fsm.Ruleset) *fsm.Machine
- func (rxm *RxMachine) CurrentWhileTimerStart()
- func (rxm *RxMachine) CurrentWhileTimerStop()
- func (rxm *RxMachine) CurrentWhileTimerTimeoutSet(timeout time.Duration)
- func (rxm *RxMachine) DrcpRxMachineCompatibilityCheck(m fsm.Machine, data interface{}) fsm.State
- func (rxm *RxMachine) DrcpRxMachineCurrent(m fsm.Machine, data interface{}) fsm.State
- func (rxm *RxMachine) DrcpRxMachineDefaulted(m fsm.Machine, data interface{}) fsm.State
- func (rxm *RxMachine) DrcpRxMachineDiscard(m fsm.Machine, data interface{}) fsm.State
- func (rxm *RxMachine) DrcpRxMachineExpired(m fsm.Machine, data interface{}) fsm.State
- func (rxm *RxMachine) DrcpRxMachineInitialize(m fsm.Machine, data interface{}) fsm.State
- func (rxm *RxMachine) DrcpRxMachinePortalCheck(m fsm.Machine, data interface{}) fsm.State
- func (rxm *RxMachine) DrcpRxmLog(msg string)
- func (rxm *RxMachine) NotifyChangePortalChanged(oldval, newval bool)
- func (rxm *RxMachine) NotifyDRCPStateTimeoutChange(oldval, newval bool)
- func (rxm *RxMachine) NotifyGatewayConversationUpdate(oldval, newval bool)
- func (rxm *RxMachine) NotifyPortConversationUpdate(oldval, newval bool)
- func (rxm *RxMachine) PrevState() fsm.State
- func (rxm *RxMachine) PrevStateSet(s fsm.State)
- func (rxm *RxMachine) Stop()
- type SimulationNeighborBridge
- type StateVectorInfo
- type TxCallback
- type TxMachine
- func (txm *TxMachine) Apply(r *fsm.Ruleset) *fsm.Machine
- func (txm *TxMachine) DrcpTxMachineOff(m fsm.Machine, data interface{}) fsm.State
- func (txm *TxMachine) DrcpTxMachineOn(m fsm.Machine, data interface{}) fsm.State
- func (txm *TxMachine) DrcpTxmLog(msg string)
- func (txm *TxMachine) PrevState() fsm.State
- func (txm *TxMachine) PrevStateSet(s fsm.State)
- func (txm *TxMachine) Stop()
Constants ¶
const ( AmStateNone = iota + 1 AmStateDRNIPortInitialize AmStateDRNIPortUpdate AmStatePsPortUpdate )
drxm States
const ( AmEventBegin = iota + 1 AmEventPortConversationUpdate AmEventNotIppAllPortUpdate )
am events
const ( DRNI_PORTAL_SYSTEM_ID_MIN = 1 DRNI_PORTAL_SYSTEM_ID_MAX = 2 // only support two portal system )
const ( CONVERSATION_ID_TYPE_PORT = 0 CONVERSATION_ID_TYPE_GATEWAY = 1 MAX_IPP_LINKS = 3 MAX_CONVERSATION_IDS = 4096 MAX_PORTAL_SYSTEM_IDS = 3 DrniFastPeriodicTime time.Duration = time.Second * 1 DrniSlowPeriodictime time.Duration = time.Second * 30 DrniShortTimeoutTime time.Duration = 3 * DrniFastPeriodicTime DrniLongTimeoutTime time.Duration = 3 * DrniSlowPeriodictime )
const ( GmStateNone = iota + 1 GmStateDRNIGatewayInitialize GmStateDRNIGatewayUpdate GmStatePsGatewayUpdate )
drxm States
const ( GmEventBegin = iota + 1 GmEventGatewayConversationUpdate GmEventNotIppAllGatewayUpdate )
rxm events
const ( IAmStateNone = iota + 1 IAmStateIPPPortInitialize IAmStateIPPPortUpdate )
drxm States
const ( IAmEventBegin = iota + 1 IAmEventIPPPortUpdate )
am events
const ( IGmStateNone = iota + 1 IGmStateIPPGatewayInitialize IGmStateIPPGatewayUpdate )
igm States
const ( IGmEventBegin = iota + 1 IGmEventGatewayUpdate )
igm events
const ()
const ()
const ( PtxmStateNone = iota + 1 PtxmStateNoPeriodic PtxmStateFastPeriodic PtxmStateSlowPeriodic PtxmStatePeriodicTx )
drxm States
const ( PtxmEventBegin = iota + 1 PtxmEventNotIPPPortEnabled PtxmEventUnconditionalFallThrough PtxmEventDRFNeighborOPerDRCPStateTimeoutEqualLongTimeout PtxmEventDRFNeighborOPerDRCPStateTimeoutEqualShortTimeout PtxmEventDRCPPeriodicTimerExpired )
rxm events
const ( PsmStateNone = iota + 1 PsmStatePortalSystemInitialize PsmStatePortalSystemUpdate )
psm States
const ( PsmEventBegin = iota + 1 PsmEventChangePortal PsmEventChangeDRFPorts )
psm events
const ( RxmStateNone = iota + 1 RxmStateInitialize RxmStateExpired RxmStatePortalCheck RxmStateCompatibilityCheck RxmStateDefaulted RxmStateDiscard // REPORT_TO_MANAGEMENT state RxmStateCurrent )
drxm States
const ( RxmEventBegin = iota + 1 RxmEventNotIPPPortEnabled RxmEventNotDRCPEnabled RxmEventIPPPortEnabledAndDRCPEnabled RxmEventDRCPDURx RxmEventDRCPCurrentWhileTimerExpired RxmEventNotDifferPortal RxmEventDifferPortal RxmEventNotDifferConfPortal RxmEventDifferConfPortal )
rxm events
const ( TxmStateNone = iota + 1 TxmStateOn TxmStateOff )
const ( TxmEventBegin = iota + 1 TxmEventUnconditionalFallThrough TxmEventNtt TxmEventDrcpDisabled TxmEventDrcpEnabled )
const AMachineModuleStr = "DRNI Aggregator Machine"
const DRCPConfigModuleStr = "DRCP Config"
const GMachineModuleStr = "DRNI Gateway Machine"
const IAMachineModuleStr = "DRNI Aggregator Machine"
const IGMachineModuleStr = "IPP Gateway Machine"
const PsMachineModuleStr = "Portal System Machine"
const PtxMachineModuleStr = "DRCP PTX Machine"
const RxMachineModuleStr = "DRCP Rx Machine"
const RxModuleStr = "Rx Module"
const TxMachineModuleStr = "DRCP Tx Machine"
Variables ¶
var AmStateStrMap map[fsm.State]string
var ConfigDrMap map[string]uint32
holds the dr to agg list
var ConversationIdMap [MAX_CONVERSATION_IDS]ConvIdTypeValue
holds the current conversation map values for the system Each DR should be updated based on the information contained in this map
var DRCPIppDB map[IppDbKey]*DRCPIpp
var DRCPIppDBList []*DRCPIpp
var DistributedRelayDB map[string]*DistributedRelay
var DistributedRelayDBList []*DistributedRelay
var ENCAP_METHOD_SEPARATE_LINKS [4]uint8 = [4]uint8{0x00, 0x80, 0xC2, 0x00}
var ENCAP_METHOD_SHARING_BY_BTAG [4]uint8 = [4]uint8{0x00, 0x80, 0xC2, 0x04}
var ENCAP_METHOD_SHARING_BY_ITAG [4]uint8 = [4]uint8{0x00, 0x80, 0xC2, 0x03}
var ENCAP_METHOD_SHARING_BY_PSEUDOWIRE [4]uint8 = [4]uint8{0x00, 0x80, 0xC2, 0x05}
var ENCAP_METHOD_SHARING_BY_TAG [4]uint8 = [4]uint8{0x00, 0x80, 0xC2, 0x02}
var ENCAP_METHOD_SHARING_BY_TIME [4]uint8 = [4]uint8{0x00, 0x80, 0xC2, 0x01}
var ENCAP_METHOD_SHARING_NULL [4]uint8 = [4]uint8{0x00, 0x00, 0x00, 0x00}
var GmStateStrMap map[fsm.State]string
var IAmStateStrMap map[fsm.State]string
var IGmStateStrMap map[fsm.State]string
var MacCaptureCount map[MacCaptureKey]int
var PsmStateStrMap map[fsm.State]string
var PtxmStateStrMap map[fsm.State]string
var RxmStateStrMap map[fsm.State]string
var TxmStateStrMap map[fsm.State]string
Functions ¶
func AMachineStrStateMapCreate ¶
func AMachineStrStateMapCreate()
func CreateConversationId ¶
func CreateConversationId(cfg *DRConversationConfig)
CreateConversationId is a config api to handle conversationId updates
func CreateDistributedRelay ¶
func CreateDistributedRelay(cfg *DistributedRelayConfig)
CreateDistributedRelay will create the distributed relay then attach the Aggregator to the Distributed Relay
func DRFindPortByKey ¶
DRFindPortByKey find ipp port by key
func DeleteConversationId ¶
func DeleteConversationId(cfg *DRConversationConfig, force bool)
CreateConversationId is a config api to handle conversationId updates
func DeleteDistributedRelay ¶
func DeleteDistributedRelay(name string)
DeleteDistributedRelay will detach the distributed relay from the aggregator and delete the distributed relay instance
func DistributedRelayConfigCreateCheck ¶
DistributedRelayConfigCreateCheck
func DistributedRelayConfigDeleteCheck ¶
DistributedRelayConfigDeleteCheck
func DistributedRelayConfigParamCheck ¶
func DistributedRelayConfigParamCheck(mlag *DistributedRelayConfig) error
DistributedRelayConfigParamCheck 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 DrFindByAggregator ¶
func DrFindByAggregator(DrniAggregator int32, dr **DistributedRelay) bool
DrFindByAggregator will find the DR based on the Aggregator that it is associated with
func DrFindByName ¶
func DrFindByName(DrniName string, dr **DistributedRelay) bool
DrFindByName will find the DR based on the DRNI name
func DrFindByPortalAddr ¶
func DrFindByPortalAddr(portaladdr string, dr **DistributedRelay) bool
DrFindByPortalAddr each portal address is unique within the system
func DrGetDrcpNext ¶
func DrGetDrcpNext(dr **DistributedRelay) bool
func DrRxMain ¶
LaRxMain will process incomming packets from a socket as of 10/22/15 packets recevied from channel
func GMachineStrStateMapCreate ¶
func GMachineStrStateMapCreate()
func GetAllCVIDConversations ¶
func GetAllCVIDConversations()
GetAllCVIDConversations: Fill in the mapping of vlan -> conversation id which is 1:1
func IAMachineStrStateMapCreate ¶
func IAMachineStrStateMapCreate()
func IGMachineStrStateMapCreate ¶
func IGMachineStrStateMapCreate()
func NetIplShareMachineStrStateMapCreate ¶
func NetIplShareMachineStrStateMapCreate()
func ProcessDrcpFrame ¶
ProcessDrcpFrame will lookup the cooresponding port from which the packet arrived and forward the packet to the Rx Machine for processing
func PsMachineStrStateMapCreate ¶
func PsMachineStrStateMapCreate()
func PtxMachineStrStateMapCreate ¶
func PtxMachineStrStateMapCreate()
func RxMachineStrStateMapCreate ¶
func RxMachineStrStateMapCreate()
func TxMachineStrStateMapCreate ¶
func TxMachineStrStateMapCreate()
func TxViaLinuxIf ¶
func TxViaLinuxIf(key IppDbKey, dmac net.HardwareAddr, pdu interface{})
func UpdateConversationId ¶
func UpdateConversationId(cfg *DRConversationConfig)
UpdateConversationId is a config api to handle conversationId updates likely port id updates NOTE: portList should always contain the complete valid port list
Types ¶
type AMachine ¶
type AMachine struct { ConversationIdType int // for debugging PreviousState fsm.State Machine *fsm.Machine // machine specific events AmEvents chan utils.MachineEvent // contains filtered or unexported fields }
AMachine holds FSM and current State and event channels for State transitions
func DrcpAMachineFSMBuild ¶
func DrcpAMachineFSMBuild(dr *DistributedRelay) *AMachine
func NewDrcpAMachine ¶
func NewDrcpAMachine(dr *DistributedRelay) *AMachine
NewDrcpAMachine will create a new instance of the AMachine
func (*AMachine) Apply ¶
A helpful function that lets us apply arbitrary rulesets to this instances State machine without reallocating the machine.
func (*AMachine) DrcpAMachineDRNIPortInitialize ¶
DrcpAMachineDRNIPortInitialize function to be called after State transition to DRNI_PORT_INITIALIZE
func (*AMachine) DrcpAMachineDRNIPortUpdate ¶
DrcpAMachineDRNIPortUpdate function to be called after State transition to DRNI_PORT_UPDATE
func (*AMachine) DrcpAMachinePSPortUpdate ¶
DrcpAMachinePSPortUpdate function to be called after State transition to PS_PORT_UPDATE
func (*AMachine) IppAllPortUpdateCheck ¶
IppAllPortUpdateCheck Check is made in order to try and perform the following logic needed for IppAllPortUpdate; This variable is the logical OR of the IppPortUpdate variables for all IPPs in this Portal System.
func (*AMachine) PrevStateSet ¶
PrevStateSet will set the previous State
type ConvIdTypeValue ¶
type DRCPIntraPortal ¶
type DRCPIntraPortal struct { DifferConfPortal bool DifferConfPortalSystemNumber bool DifferGatewayDigest bool DifferPortDigest bool DifferPortal bool // range 1..3 DRFHomeConfNeighborPortalSystemNumber uint8 DRFHomeNetworkIPLIPLEncapDigest Md5Digest DRFHomeNetworkIPLIPLNetEncapDigest Md5Digest DRFHomeNetworkIPLSharingMethod EncapMethod // defines for state can be found in "github.com/google/gopacket/layers" DRFNeighborAdminAggregatorKey uint16 DRFNeighborAggregatorId [6]uint8 DRFNeighborAggregatorPriority uint16 DRFNeighborConversationGatewayListDigest Md5Digest DRFNeighborConversationPortListDigest Md5Digest DRFNeighborGatewayAlgorithm [4]uint8 DRFNeighborGatewayConversationMask [MAX_CONVERSATION_IDS]bool DRFNeighborGatewaySequence uint32 DRFNeighborNetworkIPLIPLEncapDigest Md5Digest DRFNeighborNetworkIPLNetEncapDigest Md5Digest DRFNeighborNetworkIPLSharingMethod EncapMethod DRFNeighborOperAggregatorKey uint16 DRFNeighborOperPartnerAggregatorKey uint16 // defines for state can be found in "github.com/google/gopacket/layers" DRFNeighborOperDRCPState layers.DRCPState // range 1..3 DRFNeighborConfPortalSystemNumber uint8 DRFNeighborPortAlgorithm [4]uint8 // range 1..3 DRFNeighborPortalSystemNumber uint8 DRFNeighborState StateVectorInfo DRFOtherNeighborAdminAggregatorKey uint16 DRFOtherNeighborGatewayConversationMask [MAX_CONVERSATION_IDS]bool DRFOtherNeighborGatewaySequence uint16 DRFOtherNeighborOperPartnerAggregatorKey uint16 DRFOtherNeighborState StateVectorInfo DRFRcvHomeGatewayConversationMask [MAX_CONVERSATION_IDS]bool DRFRcvHomeGatewaySequence uint32 DRFRcvNeighborGatewayConversationMask [MAX_CONVERSATION_IDS]bool DRFRcvNeighborGatewaySequence uint16 DRFRcvOtherGatewayConversationMask [MAX_CONVERSATION_IDS]bool DRFRcvOtherGatewaySequence uint16 DrniNeighborCommonMethods bool DrniNeighborGatewayConversation [1024]uint8 DrniNeighborPortConversation [1024]uint8 DrniNeighborONN bool DrniNeighborPortalAddr [6]uint8 DrniNeighborPortalPriority uint16 DrniNeighborState [4]StateVectorInfo // This should always be false as we will not support 3 portal system initially DrniNeighborThreeSystemPortal bool IppOtherGatewayConversation [MAX_CONVERSATION_IDS]uint8 IppOtherPortConversationPortalSystem [MAX_CONVERSATION_IDS]uint8 IppPortEnabled bool IppPortalSystemState [4]StateVectorInfo MissingRcvGatewayConVector bool MissingRcvPortConVector bool NTTDRCPDU bool ONN bool // 9.4.10 Begin bool DRCPEnabled bool GatewayConversationTransmit bool IppAllUpdate bool IppGatewayUpdate bool IppPortUpdate bool PortConversationTransmit bool // 9.3.4.3 IppGatewayConversationPasses [MAX_CONVERSATION_IDS]bool IppPortconversationPasses [MAX_CONVERSATION_IDS]bool }
802.1ax-2014 9.4.9 Per IPP Intra-Portal Variables
type DRCPIpp ¶
type DRCPIpp struct { DistributedRelayIPP DRCPIntraPortal DistributedRelayIPPCounters DistributedRelayIPPDebug // FSMs RxMachineFsm *RxMachine PtxMachineFsm *PtxMachine TxMachineFsm *TxMachine IAMachineFsm *IAMachine IGMachineFsm *IGMachine // contains filtered or unexported fields }
func NewDRCPIpp ¶
func NewDRCPIpp(id uint32, dr *DistributedRelay) *DRCPIpp
func (*DRCPIpp) CreateRxTx ¶
func (p *DRCPIpp) CreateRxTx()
func (*DRCPIpp) DeleteDRCPIpp ¶
func (p *DRCPIpp) DeleteDRCPIpp()
func (*DRCPIpp) DeleteRxTx ¶
func (p *DRCPIpp) DeleteRxTx()
func (*DRCPIpp) DistributeMachineEvents ¶
func (p *DRCPIpp) DistributeMachineEvents(mec []chan utils.MachineEvent, e []utils.MachineEvent, waitForResponse bool)
DistributeMachineEvents will distribute the events in parrallel to each machine
func (*DRCPIpp) DrIppLinkDown ¶
func (p *DRCPIpp) DrIppLinkDown()
DrIppLinkDown distributelink down event
func (*DRCPIpp) DrcpIAMachineMain ¶
func (p *DRCPIpp) DrcpIAMachineMain()
DrcpIAMachineMain: 802.1ax-2014 Figure 9-27 Creation of DRNI IPP Machines state transitions and callbacks and create go routine to pend on events
func (*DRCPIpp) DrcpIGMachineMain ¶
func (p *DRCPIpp) DrcpIGMachineMain()
DrcpIGMachineMain: 802.1ax-2014 Figure 9-27 Creation of DRNI IPP Gateway State Machine state transitions and callbacks and create go routine to pend on events
func (*DRCPIpp) DrcpPtxMachineMain ¶
func (p *DRCPIpp) DrcpPtxMachineMain()
DrcpPtxMachineMain: 802.1ax-2014 Figure 9-24 Creation of DRCP Periodic Transmit State Machine State transitions and callbacks and create go routine to pend on events
func (*DRCPIpp) DrcpRxMachineMain ¶
func (p *DRCPIpp) DrcpRxMachineMain()
DrcpRxMachineMain: 802.1ax-2014 Figure 9-23 Creation of Rx State Machine State transitions and callbacks and create go routine to pend on events
func (*DRCPIpp) NetIplShareMachineMain ¶
func (p *DRCPIpp) NetIplShareMachineMain()
NetIplShareMachineMain: 802.1ax-2014 Section 9.4.20 Network/IPL sharing machine Creation of Network/IPL sharing State Machine State transitions and callbacks and create go routine to pend on events
func (*DRCPIpp) NotifyNTTDRCPUDChange ¶
NotifyNTTDRCPUDChange
func (*DRCPIpp) SetupDRCPMacCapture ¶
SetupDRCPMacCapture will create an pkt capture rule in the hw
func (*DRCPIpp) TeardownDRCPMacCapture ¶
TeardownDRCPMacCapture will delete a pkt capture rule in the hw
func (*DRCPIpp) TxMachineMain ¶
func (p *DRCPIpp) TxMachineMain()
TxMachineMain: 802.1ax-2014 Section 9.4.19 DRCPDU Transmit machine Creation of Tx State Machine State transitions and callbacks and create go routine to pend on events
type DRConversationConfig ¶
type DRConversationConfig struct { DrniName string Idtype GatewayAlgorithm Isid uint32 Cvlan uint16 Svlan uint16 Bvid uint16 Psuedowire uint32 PortList []int32 }
Conversations are typically related to the various service types to which traffic is associated with. If portList is empty is is assumed to be Gateway Algorithm, otherwise it is a Port Algorithm 802.1 AX-2014 8.1 Therefore, a Conversation Identifier (or Conversation ID) is defined as a value in the range 0 through 4095. By administrative means, every possible conversation is assigned to a single Conversation ID value for each supported Conversation ID type. More than one conversation can be assigned to a Conversation ID. It is not necessary that every Conversation ID value have any conversations assigned to it. In this standard, several types of Conversation ID are specified for different uses.
type DRSystemInfo ¶
type DRSystemInfo struct { // list of tx function which should be called for a given port TxCallbacks map[IppDbKey][]TxCallback }
var DRGlobalSystem DRSystemInfo
func (*DRSystemInfo) DRSystemGlobalDeRegisterTxCallback ¶
func (g *DRSystemInfo) DRSystemGlobalDeRegisterTxCallback(intf IppDbKey)
func (*DRSystemInfo) DRSystemGlobalRegisterTxCallback ¶
func (g *DRSystemInfo) DRSystemGlobalRegisterTxCallback(intf IppDbKey, f TxCallback)
type DistributedRelay ¶
type DistributedRelay struct { DistributedRelayFunction DrniId uint32 DrniDescription string DrniName string // Also defined in 9.4.7 DrniAggregatorId [6]uint8 DrniAggregatorPriority uint16 DrniPortalAddr net.HardwareAddr DrniPortalPriority uint16 DrniThreeSystemPortal bool DrniPortConversation [MAX_CONVERSATION_IDS][4]uint16 DrniGatewayConversation [MAX_CONVERSATION_IDS][]uint8 // save the origional values from the aggregator PrevAggregatorId [6]uint8 PrevAggregatorPriority uint16 DrniPortalSystemNumber uint8 // 1-3 DrniIntraPortalLinkList [MAX_IPP_LINKS]uint32 // ifindex DrniAggregator int32 DrniConvAdminGateway [MAX_CONVERSATION_IDS][]uint8 // conversation id -> gateway DrniNeighborAdminConvGatewayListDigest Md5Digest DrniNeighborAdminConvPortListDigest Md5Digest DrniGatewayAlgorithm GatewayAlgorithm DrniNeighborAdminGatewayAlgorithm GatewayAlgorithm DrniNeighborAdminPortAlgorithm GatewayAlgorithm DrniNeighborAdminDRCPState uint8 DrniEncapMethod EncapMethod DrniIPLEncapMap map[uint32]uint32 DrniNetEncapMap map[uint32]uint32 DrniPSI bool DrniPortConversationControl bool DrniPortalPortProtocolIDA net.HardwareAddr // 9.4.10 PortConversationUpdate bool IppAllPortUpdate bool GatewayConversationUpdate bool IppAllGatewayUpdate bool HomeGatewayVectorTransmit bool OtherGatewayVectorTransmit bool // Local list to keep track of distributed port list // Server will only indicate that a change has occured // updateDRFHomeState will determine what actions // to perform based on the differences between // what DR and Aggregator distributed port list DRAggregatorDistributedList []int32 // state machines PsMachineFsm *PsMachine GMachineFsm *GMachine AMachineFsm *AMachine Ipplinks []*DRCPIpp // contains filtered or unexported fields }
802.1ax-2014 7.4.1.1
func NewDistributedRelay ¶
func NewDistributedRelay(cfg *DistributedRelayConfig) *DistributedRelay
NewDistributedRelay create a new instance of Distributed Relay and the associated objects for the IPP ports
func (*DistributedRelay) AttachAggregatorToDistributedRelay ¶
func (dr *DistributedRelay) AttachAggregatorToDistributedRelay(aggId int32)
AttachAggregatorToDistributedRelay: will attach the aggregator and start the Distributed relay protocol for the given dr if this agg is associated with a DR
func (*DistributedRelay) BEGIN ¶
func (dr *DistributedRelay) BEGIN(restart bool)
BEGIN will start/build all the Distributed Relay State Machines and send the begin event
func (*DistributedRelay) DeleteDistributedRelay ¶
func (dr *DistributedRelay) DeleteDistributedRelay()
DeleteDistriutedRelay will delete the distributed relay along with the associated IPP links and de-associate from the Aggregator
func (*DistributedRelay) DetachAggregatorFromDistributedRelay ¶
func (dr *DistributedRelay) DetachAggregatorFromDistributedRelay(aggId int32)
DetachCreatedAggregatorFromDistributedRelay: will detach the aggregator and stop the Distributed relay protocol for the given dr if since this aggregator is no longer attached
func (*DistributedRelay) DistributeMachineEvents ¶
func (dr *DistributedRelay) DistributeMachineEvents(mec []chan utils.MachineEvent, e []utils.MachineEvent, waitForResponse bool)
DistributeMachineEvents will distribute the events in parrallel to each machine
func (*DistributedRelay) DrcpAMachineMain ¶
func (dr *DistributedRelay) DrcpAMachineMain()
DrcpAMachineMain: 802.1ax-2014 Figure 9-26 Creation of DRNI Aggregator State Machine state transitions and callbacks and create go routine to pend on events
func (*DistributedRelay) DrcpGMachineMain ¶
func (dr *DistributedRelay) DrcpGMachineMain()
DrcpGMachineMain: 802.1ax-2014 Figure 9-26 Creation of DRNI Gateway State Machine state transitions and callbacks and create go routine to pend on events
func (*DistributedRelay) DrcpPsMachineMain ¶
func (dr *DistributedRelay) DrcpPsMachineMain()
DrcpPsMachineMain: 802.1ax-2014 Figure 9-25 Creation of Portal System Machine State transitions and callbacks and create go routine to pend on events
func (*DistributedRelay) LaDrLog ¶
func (dr *DistributedRelay) LaDrLog(msg string)
func (*DistributedRelay) NotifyAggPortCreate ¶
func (dr *DistributedRelay) NotifyAggPortCreate(ifindex int32)
NotifyAggPortCreate called by lacp when Aggregator is created
func (*DistributedRelay) NotifyAggPortDelete ¶
func (dr *DistributedRelay) NotifyAggPortDelete(ifindex int32)
NotifyAggPortDelete called by lacp when Aggregator is deleted
func (*DistributedRelay) NotifyAggPortDown ¶
func (dr *DistributedRelay) NotifyAggPortDown(ifindex int32)
NotifyAggPortUp when aggregator port is down
func (*DistributedRelay) NotifyAggPortUp ¶
func (dr *DistributedRelay) NotifyAggPortUp(ifindex int32)
NotifyAggPortUp when aggregator port is up
func (*DistributedRelay) RegisterForLacpPortUpdates ¶
func (dr *DistributedRelay) RegisterForLacpPortUpdates()
RegisterForLacpPortUpdates: way to bridge between packages of lacp and drcp
func (*DistributedRelay) SetTimeSharingPortAndGatwewayDigest ¶
func (dr *DistributedRelay) SetTimeSharingPortAndGatwewayDigest()
setTimeSharingGatwewayDigest, when the port and gateway algorithm is set to time sharing then it should be noted that the gateway and port algorithm digest currently we only support Vlan based to start each algorithm is as follows: Conversations are not bound to a lag link but rather a portal system, thus all down traffic will either go to the local aggregator ports or IPL if the destination is a remote portal network port (which is not an aggregator port). All up traffic is only destined to another aggregator or other network links either in hte local system or accross the IPL to the neighbor system. If all local aggregator ports are down then the neighbor system must forward frames out the aggregator as well as any network links to which the frame is destined for
func (*DistributedRelay) Stop ¶
func (dr *DistributedRelay) Stop()
type DistributedRelayConfig ¶
type DistributedRelayConfig struct { // GET-SET DrniName string DrniPortalAddress string DrniPortalPriority uint16 DrniThreePortalSystem bool DrniPortalSystemNumber uint8 DrniIntraPortalLinkList [3]uint32 DrniAggregator uint32 DrniConvAdminGateway [4096][3]uint8 DrniNeighborAdminConvGatewayListDigest [16]uint8 DrniNeighborAdminConvPortListDigest [16]uint8 DrniGatewayAlgorithm string DrniNeighborAdminGatewayAlgorithm string DrniNeighborAdminPortAlgorithm string DrniNeighborAdminDRCPState string DrniEncapMethod string DrniIPLEncapMap [16]uint32 DrniNetEncapMap [16]uint32 DrniPortConversationControl bool DrniIntraPortalPortProtocolDA string }
802.1.AX-2014 7.4.1.1 Distributed Relay Attributes GET-SET
func (*DistributedRelayConfig) GetKey ¶
func (d *DistributedRelayConfig) GetKey() string
type DistributedRelayFunction ¶
type DistributedRelayFunction struct { ChangeDRFPorts bool ChangePortal bool DrniCommonMethods bool DrniConversationGatewayList [MAX_CONVERSATION_IDS]uint32 DrniPortalSystemState [4]StateVectorInfo DRFHomeAdminAggregatorKey uint16 DRFHomeConversationGatewayListDigest Md5Digest DRFHomeConversationPortListDigest Md5Digest DRFHomeGatewayAlgorithm [4]uint8 DRFHomeGatewayConversationMask [MAX_CONVERSATION_IDS]bool DRFHomeGatewaySequence uint16 DRFHomePortAlgorithm [4]uint8 DRFHomeOperAggregatorKey uint16 DRFHomeOperPartnerAggregatorKey uint16 DRFHomeState StateVectorInfo DRFNeighborAdminConversationGatewayListDigest Md5Digest DRFNeighborAdminConversationPortListDigest Md5Digest DRFNeighborAdminDRCPState layers.DRCPState DRFNeighborAdminGatewayAlgorithm [4]uint8 DRFNeighborAdminPortAlgorithm [4]uint8 // range 1..3 DRFPortalSystemNumber uint8 DRFHomeOperDRCPState layers.DRCPState // 9.3.3.2 DrniPortalSystemGatewayConversation [MAX_CONVERSATION_IDS]bool DrniPortalSystemPortConversation [MAX_CONVERSATION_IDS]bool }
802.1ax-2014 Section 9.4.8 Per-DR Function variables
type DistributedRelayIPP ¶
type DistributedRelayIPP struct { Name string Id uint32 PortConversationPasses [MAX_CONVERSATION_IDS]bool GatewayConversationDirection [MAX_CONVERSATION_IDS]bool AdminState bool OperState bool TimeOfLstOperChange time.Time }
802.1ax-2014 7.4.2.1.1
type DistributedRelayIPPCounters ¶
type DistributedRelayIPPCounters struct { StatId uint32 DRCPDUsRX uint32 IllegalRX uint32 DRCPDUsTX uint32 }
802.1ax-2014 7.4.3.1.1
type DistributedRelayIPPDebug ¶
type DistributedRelayIPPDebug struct { InfoId uint32 DRCPRXState string LastRXTime time.Time DifferPortalReason string }
802.1ax-2014 7.4.4.1.1
type EncapMethod ¶
type EncapMethod [4]uint8
func (*EncapMethod) String ¶
func (g *EncapMethod) String() string
type GMachine ¶
type GMachine struct { // for debugging PreviousState fsm.State Machine *fsm.Machine // machine specific events GmEvents chan utils.MachineEvent // contains filtered or unexported fields }
GMachine holds FSM and current State and event channels for State transitions
func DrcpGMachineFSMBuild ¶
func DrcpGMachineFSMBuild(dr *DistributedRelay) *GMachine
func NewDrcpGMachine ¶
func NewDrcpGMachine(dr *DistributedRelay) *GMachine
NewDrcpGMachine will create a new instance of the GMachine
func (*GMachine) Apply ¶
A helpful function that lets us apply arbitrary rulesets to this instances State machine without reallocating the machine.
func (*GMachine) DrcpGMachineDRNIGatewayInitialize ¶
DrcpGMachineDRNIGatewayInitialize function to be called after State transition to DRNI_GATEWAY_INITIALIZE
func (*GMachine) DrcpGMachineDRNIGatewayUpdate ¶
DrcpGMachineDRNIGatewayUpdate function to be called after State transition to DRNI_GATEWAY_UPDATE
func (*GMachine) DrcpGMachinePSGatewayUpdate ¶
DrcpGMachinePSGatewayUpdate function to be called after State transition to PS_GATEWAY_UPDATE
func (*GMachine) IppAllGatewayUpdateCheck ¶
IppAllGatewayUpdateCheck Check is made in order to try and perform the following logic needed for IppAllGatewayUpdate; This variable is the logical OR of the IppGatewayUpdate variables for all IPPs in this Portal System.
func (*GMachine) PrevStateSet ¶
PrevStateSet will set the previous State
type GatewayAlgorithm ¶
type GatewayAlgorithm [4]uint8
var GATEWAY_ALGORITHM_CVID GatewayAlgorithm = GatewayAlgorithm{0x00, 0x80, 0xC2, 0x01}
var GATEWAY_ALGORITHM_ECMP_FLOW_HASH GatewayAlgorithm = GatewayAlgorithm{0x00, 0x80, 0xC2, 0x05}
var GATEWAY_ALGORITHM_ISID GatewayAlgorithm = GatewayAlgorithm{0x00, 0x80, 0xC2, 0x03}
var GATEWAY_ALGORITHM_NULL GatewayAlgorithm = GatewayAlgorithm{}
var GATEWAY_ALGORITHM_RESERVED GatewayAlgorithm = GatewayAlgorithm{0x00, 0x80, 0xC2, 0x00}
var GATEWAY_ALGORITHM_SVID GatewayAlgorithm = GatewayAlgorithm{0x00, 0x80, 0xC2, 0x02}
var GATEWAY_ALGORITHM_TE_SID GatewayAlgorithm = GatewayAlgorithm{0x00, 0x80, 0xC2, 0x04}
func (*GatewayAlgorithm) String ¶
func (g *GatewayAlgorithm) String() string
type GatewayVectorEntry ¶
type IAMachine ¶
type IAMachine struct { ConversationIdType int // for debugging PreviousState fsm.State Machine *fsm.Machine // machine specific events IAmEvents chan utils.MachineEvent // contains filtered or unexported fields }
IAMachine holds FSM and current State and event channels for State transitions
func DrcpIAMachineFSMBuild ¶
func NewDrcpIAMachine ¶
NewDrcpAMachine will create a new instance of the IAMachine
func (*IAMachine) Apply ¶
A helpful function that lets us apply arbitrary rulesets to this instances State machine without reallocating the machine.
func (*IAMachine) DrcpIAMachineIPPPortInitialize ¶
DrcpIAMachineIPPPortInitialize function to be called after State transition to IPP_PORT_INITIALIZE
func (*IAMachine) DrcpIAMachineIPPPortUpdate ¶
DrcpIAMachineIPPPortUpdate function to be called after State transition to IPP_PORT_UPDATE
func (*IAMachine) DrcpIAmLog ¶
func (*IAMachine) PrevStateSet ¶
PrevStateSet will set the previous State
type IGMachine ¶
type IGMachine struct { // for debugging PreviousState fsm.State Machine *fsm.Machine // machine specific events IGmEvents chan utils.MachineEvent // contains filtered or unexported fields }
IGMachine holds FSM and current State and event channels for State transitions
func DrcpIGMachineFSMBuild ¶
func NewDrcpIGMachine ¶
NewDrcpIGMachine will create a new instance of the IGMachine
func (*IGMachine) Apply ¶
A helpful function that lets us apply arbitrary rulesets to this instances State machine without reallocating the machine.
func (*IGMachine) DrcpIGMachineIPPGatewayInitialize ¶
DrcpGMachineIPPGatewayInitialize function to be called after State transition to IPP_GATEWAY_INITIALIZE
func (*IGMachine) DrcpIGMachineIPPGatewayUpdate ¶
DrcpIGMachineIPPGatewayUpdate function to be called after State transition to IPP_GATEWAY_UPDATE
func (*IGMachine) DrcpIGmLog ¶
func (*IGMachine) NotifyIppAllGatewayUpdate ¶
func (igm *IGMachine) NotifyIppAllGatewayUpdate()
NotifyIppAllGatewayUpdate this should be called each time IppGatewayUpdate is changed to false so that the gateway machine can be informed
func (*IGMachine) PrevStateSet ¶
PrevStateSet will set the previous State
type MacCaptureKey ¶
type MacCaptureKey struct {
// contains filtered or unexported fields
}
type NetIplShareMachine ¶
type NetIplShareMachine struct { fsm.State NetIplSharemEvents chan utils.MachineEvent // contains filtered or unexported fields }PreviousState
NetIplShareMachine holds FSM and current State and event channels for State transitions
func DrcpNetIplShareMachineFSMBuild ¶
func DrcpNetIplShareMachineFSMBuild(p *DRCPIpp) *NetIplShareMachine
DrcpNetIplShareMachineFSMBuild will build the State machine with callbacks
func NewDrcpNetIplShareMachine ¶
func NewDrcpNetIplShareMachine(port *DRCPIpp) *NetIplShareMachine
NewDrcpTxMachine will create a new instance of the TxMachine
func (*NetIplShareMachine) Apply ¶
func (nism *NetIplShareMachine) 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 (*NetIplShareMachine) DrcpNetIplShareMachineManipulatedFramesSent ¶
func (nism *NetIplShareMachine) DrcpNetIplShareMachineManipulatedFramesSent(m fsm.Machine, data interface{}) fsm.State
DrcpNetIplShareMachineManipulatedFramesSent While in this state, the tag manipulation methods of Network / IPL sharing by tag or Network / IPL sharing by encapsulation, as dictated by the Network / IPL sharing method selected the aDrniEncapsulationMethod (7.4.1.1.17), are enabled
func (*NetIplShareMachine) DrcpNetIplShareMachineNoManipulatedFramesSent ¶
func (nism *NetIplShareMachine) DrcpNetIplShareMachineNoManipulatedFramesSent(m fsm.Machine, data interface{}) fsm.State
DrcpNetIplShareMachineNoManipulatedFramesSent While in this state, the IPL can only be supported by a physical or Aggregation Link
func (*NetIplShareMachine) DrcpNetIplShareMachineTimeSharedMethod ¶
func (nism *NetIplShareMachine) DrcpNetIplShareMachineTimeSharedMethod(m fsm.Machine, data interface{}) fsm.State
DrcpNetIplShareMachineTimeSharedMethod While in this state, the Network / IPL sharing by time methods specified in 9.3.2.1 are enabled.
func (*NetIplShareMachine) DrcpNetIplSharemLog ¶
func (nism *NetIplShareMachine) DrcpNetIplSharemLog(msg string)
func (*NetIplShareMachine) PrevState ¶
func (nism *NetIplShareMachine) PrevState() fsm.State
PrevState will get the previous State from the State transitions
func (*NetIplShareMachine) PrevStateSet ¶
func (nism *NetIplShareMachine) PrevStateSet(s fsm.State)
PrevStateSet will set the previous State
func (*NetIplShareMachine) Stop ¶
func (nism *NetIplShareMachine) Stop()
Stop will stop all timers and close all channels
type PsMachine ¶
type PsMachine struct { // for debugging PreviousState fsm.State Machine *fsm.Machine // machine specific events PsmEvents chan utils.MachineEvent // contains filtered or unexported fields }
PsMachine holds FSM and current State and event channels for State transitions
func DrcpPsMachineFSMBuild ¶
func DrcpPsMachineFSMBuild(dr *DistributedRelay) *PsMachine
func NewDrcpPsMachine ¶
func NewDrcpPsMachine(dr *DistributedRelay) *PsMachine
NewDrcpPsMachine will create a new instance of the PsMachine
func (*PsMachine) Apply ¶
A helpful function that lets us apply arbitrary rulesets to this instances State machine without reallocating the machine.
func (*PsMachine) DrcpPsMachinePortalSystemInitialize ¶
func (psm *PsMachine) DrcpPsMachinePortalSystemInitialize(m fsm.Machine, data interface{}) fsm.State
DrcpPsMachinePortalSystemInitialize function to be called after State transition to PORTAL_SYSTEM_INITIALIZE
func (*PsMachine) DrcpPsMachinePortalSystemUpdate ¶
DrcpPsMachineFastPeriodic function to be called after State transition to FAST_PERIODIC
func (*PsMachine) DrcpPsmLog ¶
func (*PsMachine) PrevStateSet ¶
PrevStateSet will set the previous State
type PtxMachine ¶
type PtxMachine struct { // for debugging PreviousState fsm.State Machine *fsm.Machine // machine specific events PtxmEvents chan utils.MachineEvent // contains filtered or unexported fields }
PtxMachine holds FSM and current State and event channels for State transitions
func DrcpPtxMachineFSMBuild ¶
func DrcpPtxMachineFSMBuild(p *DRCPIpp) *PtxMachine
func NewDrcpPTxMachine ¶
func NewDrcpPTxMachine(port *DRCPIpp) *PtxMachine
NewDrcpPTxMachine will create a new instance of the PtxMachine
func (*PtxMachine) Apply ¶
func (ptxm *PtxMachine) 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 (*PtxMachine) DrcpPtxMachineFastPeriodic ¶
func (ptxm *PtxMachine) DrcpPtxMachineFastPeriodic(m fsm.Machine, data interface{}) fsm.State
DrcpPtxMachineFastPeriodic function to be called after State transition to FAST_PERIODIC
func (*PtxMachine) DrcpPtxMachineNoPeriodic ¶
func (ptxm *PtxMachine) DrcpPtxMachineNoPeriodic(m fsm.Machine, data interface{}) fsm.State
DrcpPtxMachineNoPeriodic function to be called after State transition to NO_PERIODIC
func (*PtxMachine) DrcpPtxMachinePeriodicTx ¶
func (ptxm *PtxMachine) DrcpPtxMachinePeriodicTx(m fsm.Machine, data interface{}) fsm.State
DrcpPtxMachinePeriodicTx function to be called after State transition to PERIODIC_TX
func (*PtxMachine) DrcpPtxMachineSlowPeriodic ¶
func (ptxm *PtxMachine) DrcpPtxMachineSlowPeriodic(m fsm.Machine, data interface{}) fsm.State
DrcpPtxMachineSlowPeriodic function to be called after State transition to SLOW_PERIODIC
func (*PtxMachine) DrcpPtxmLog ¶
func (ptxm *PtxMachine) DrcpPtxmLog(msg string)
func (*PtxMachine) PeriodicTimerIntervalSet ¶
func (ptxm *PtxMachine) PeriodicTimerIntervalSet(interval time.Duration)
func (*PtxMachine) PeriodicTimerStart ¶
func (ptxm *PtxMachine) PeriodicTimerStart()
func (*PtxMachine) PeriodicTimerStop ¶
func (ptxm *PtxMachine) PeriodicTimerStop()
func (*PtxMachine) PrevState ¶
func (ptxm *PtxMachine) PrevState() fsm.State
func (*PtxMachine) PrevStateSet ¶
func (ptxm *PtxMachine) PrevStateSet(s fsm.State)
PrevStateSet will set the previous State
type RxMachine ¶
type RxMachine struct { // for debugging PreviousState fsm.State Machine *fsm.Machine MissConfiguredState bool // machine specific events RxmEvents chan utils.MachineEvent RxmPktRxEvent chan RxDrcpPdu // contains filtered or unexported fields }
DrcpRxMachine holds FSM and current State and event channels for State transitions
func DrcpRxMachineFSMBuild ¶
func NewDrcpRxMachine ¶
NewDrcpRxMachine will create a new instance of the RxMachine
func (*RxMachine) Apply ¶
A helpful function that lets us apply arbitrary rulesets to this instances State machine without reallocating the machine.
func (*RxMachine) CurrentWhileTimerStart ¶
func (rxm *RxMachine) CurrentWhileTimerStart()
func (*RxMachine) CurrentWhileTimerStop ¶
func (rxm *RxMachine) CurrentWhileTimerStop()
func (*RxMachine) CurrentWhileTimerTimeoutSet ¶
func (*RxMachine) DrcpRxMachineCompatibilityCheck ¶
DrcpRxMachineCompatibilityCheck function to be called after State transition to COMPATIBILITY CHECK
func (*RxMachine) DrcpRxMachineCurrent ¶
DrcpRxMachineCurrent function to be called after State transition to CURRENT
func (*RxMachine) DrcpRxMachineDefaulted ¶
DrcpRxMachineDefaulted function to be called after State transition to DEFAULTED
func (*RxMachine) DrcpRxMachineDiscard ¶
DrcpRxMachineDiscard function to be called after State transition to DISCARD
func (*RxMachine) DrcpRxMachineExpired ¶
DrcpRxMachineExpired function to be called after State transition to EXPIRED
func (*RxMachine) DrcpRxMachineInitialize ¶
DrcpRxMachineInitialize function to be called after State transition to INITIALIZE
func (*RxMachine) DrcpRxMachinePortalCheck ¶
DrcpRxMachinePortalCheck function to be called after State transition to PORTAL CHECK
func (*RxMachine) DrcpRxmLog ¶
func (*RxMachine) NotifyChangePortalChanged ¶
func (*RxMachine) NotifyDRCPStateTimeoutChange ¶
NotifyDRCPStateTimeoutChange notify the Periodic Transmit Machine of a neighbor state timeout change
func (*RxMachine) NotifyGatewayConversationUpdate ¶
func (*RxMachine) NotifyPortConversationUpdate ¶
func (*RxMachine) PrevStateSet ¶
PrevStateSet will set the previous State
type SimulationNeighborBridge ¶
type SimulationNeighborBridge struct { Port1 uint32 Port2 uint32 RxIppPort1 chan gopacket.Packet RxIppPort2 chan gopacket.Packet }
bridge will simulate communication between two channels
func (*SimulationNeighborBridge) TxViaGoChannel ¶
func (bridge *SimulationNeighborBridge) TxViaGoChannel(key IppDbKey, dmac net.HardwareAddr, pdu interface{})
type StateVectorInfo ¶
type StateVectorInfo struct { OpState bool // indexed by the received Home_Gateway_Sequence in // increasing sequence number order GatewayVector []GatewayVectorEntry PortIdList []uint32 // contains filtered or unexported fields }
type TxCallback ¶
type TxCallback func(key IppDbKey, dmac net.HardwareAddr, data interface{})
func DRSystemGlobalTxCallbackListGet ¶
func DRSystemGlobalTxCallbackListGet(p *DRCPIpp) []TxCallback
type TxMachine ¶
type TxMachine struct { // for debugging PreviousState fsm.State Machine *fsm.Machine // machine specific events TxmEvents chan utils.MachineEvent // contains filtered or unexported fields }
TxMachine holds FSM and current State and event channels for State transitions
func DrcpTxMachineFSMBuild ¶
DrcpTxMachineFSMBuild will build the State machine with callbacks
func NewDrcpTxMachine ¶
NewDrcpTxMachine will create a new instance of the TxMachine
func (*TxMachine) Apply ¶
A helpful function that lets us apply arbitrary rulesets to this instances State machine without reallocating the machine.
func (*TxMachine) DrcpTxMachineOff ¶
DrcpTxMachineOff will ensure that no packets are transmitted, typically means that drcp has been disabled or a packet was just transmitted
func (*TxMachine) DrcpTxMachineOn ¶
DrcpTxMachineOn will either send a packet out
func (*TxMachine) DrcpTxmLog ¶
func (*TxMachine) PrevStateSet ¶
PrevStateSet will set the previous State