drcp

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: 18 Imported by: 0

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

View Source
const (
	AmStateNone = iota + 1
	AmStateDRNIPortInitialize
	AmStateDRNIPortUpdate
	AmStatePsPortUpdate
)

drxm States

View Source
const (
	AmEventBegin = iota + 1
	AmEventPortConversationUpdate
	AmEventNotIppAllPortUpdate
)

am events

View Source
const (
	DRNI_PORTAL_SYSTEM_ID_MIN = 1
	DRNI_PORTAL_SYSTEM_ID_MAX = 2 // only support two portal system
)
View Source
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
)
View Source
const (
	GmStateNone = iota + 1
	GmStateDRNIGatewayInitialize
	GmStateDRNIGatewayUpdate
	GmStatePsGatewayUpdate
)

drxm States

View Source
const (
	GmEventBegin = iota + 1
	GmEventGatewayConversationUpdate
	GmEventNotIppAllGatewayUpdate
)

rxm events

View Source
const (
	IAmStateNone = iota + 1
	IAmStateIPPPortInitialize
	IAmStateIPPPortUpdate
)

drxm States

View Source
const (
	IAmEventBegin = iota + 1
	IAmEventIPPPortUpdate
)

am events

View Source
const (
	IGmStateNone = iota + 1
	IGmStateIPPGatewayInitialize
	IGmStateIPPGatewayUpdate
)

igm States

View Source
const (
	IGmEventBegin = iota + 1
	IGmEventGatewayUpdate
)

igm events

View Source
const (
	NetIplSharemStateNone = iota + 1
	NetIplSharemStateNoManipulatedFramesSent
	NetIplSharemStateTimeShareMethod
	NetIplSharemStateManipulatedFramesSent
)
View Source
const (
	NetIplSharemEventBegin = iota + 1
	NetIplSharemEventCCTimeShare
	NetIplSharemEventCCEncTagShared
	NetIplSharemEventNotCCTimeShare
	NetIplSharemEventNotCCEncTagShared
)
View Source
const (
	PtxmStateNone = iota + 1
	PtxmStateNoPeriodic
	PtxmStateFastPeriodic
	PtxmStateSlowPeriodic
	PtxmStatePeriodicTx
)

drxm States

View Source
const (
	PtxmEventBegin = iota + 1
	PtxmEventNotIPPPortEnabled
	PtxmEventUnconditionalFallThrough
	PtxmEventDRFNeighborOPerDRCPStateTimeoutEqualLongTimeout
	PtxmEventDRFNeighborOPerDRCPStateTimeoutEqualShortTimeout
	PtxmEventDRCPPeriodicTimerExpired
)

rxm events

View Source
const (
	PsmStateNone = iota + 1
	PsmStatePortalSystemInitialize
	PsmStatePortalSystemUpdate
)

psm States

View Source
const (
	PsmEventBegin = iota + 1
	PsmEventChangePortal
	PsmEventChangeDRFPorts
)

psm events

View Source
const (
	RxmStateNone = iota + 1
	RxmStateInitialize
	RxmStateExpired
	RxmStatePortalCheck
	RxmStateCompatibilityCheck
	RxmStateDefaulted
	RxmStateDiscard // REPORT_TO_MANAGEMENT state
	RxmStateCurrent
)

drxm States

View Source
const (
	RxmEventBegin = iota + 1
	RxmEventNotIPPPortEnabled
	RxmEventNotDRCPEnabled
	RxmEventIPPPortEnabledAndDRCPEnabled
	RxmEventDRCPDURx
	RxmEventDRCPCurrentWhileTimerExpired
	RxmEventNotDifferPortal
	RxmEventDifferPortal
	RxmEventNotDifferConfPortal
	RxmEventDifferConfPortal
)

rxm events

View Source
const (
	TxmStateNone = iota + 1
	TxmStateOn
	TxmStateOff
)
View Source
const (
	TxmEventBegin = iota + 1
	TxmEventUnconditionalFallThrough
	TxmEventNtt
	TxmEventDrcpDisabled
	TxmEventDrcpEnabled
)
View Source
const AMachineModuleStr = "DRNI Aggregator Machine"
View Source
const DRCPConfigModuleStr = "DRCP Config"
View Source
const GMachineModuleStr = "DRNI Gateway Machine"
View Source
const IAMachineModuleStr = "DRNI Aggregator Machine"
View Source
const IGMachineModuleStr = "IPP Gateway Machine"
View Source
const NetIplShareMachineModuleStr = "NET/IPL Sharing Machine"
View Source
const PsMachineModuleStr = "Portal System Machine"
View Source
const PtxMachineModuleStr = "DRCP PTX Machine"
View Source
const RxMachineModuleStr = "DRCP Rx Machine"
View Source
const RxModuleStr = "Rx Module"
View Source
const TxMachineModuleStr = "DRCP Tx Machine"

Variables

View Source
var AmStateStrMap map[fsm.State]string
View Source
var ConfigDrMap map[string]uint32

holds the dr to agg list

holds the current conversation map values for the system Each DR should be updated based on the information contained in this map

View Source
var DRCPIppDB map[IppDbKey]*DRCPIpp
View Source
var DRCPIppDBList []*DRCPIpp
View Source
var DistributedRelayDB map[string]*DistributedRelay
View Source
var DistributedRelayDBList []*DistributedRelay
View Source
var ENCAP_METHOD_SEPARATE_LINKS [4]uint8 = [4]uint8{0x00, 0x80, 0xC2, 0x00}
View Source
var ENCAP_METHOD_SHARING_BY_BTAG [4]uint8 = [4]uint8{0x00, 0x80, 0xC2, 0x04}
View Source
var ENCAP_METHOD_SHARING_BY_ITAG [4]uint8 = [4]uint8{0x00, 0x80, 0xC2, 0x03}
View Source
var ENCAP_METHOD_SHARING_BY_PSEUDOWIRE [4]uint8 = [4]uint8{0x00, 0x80, 0xC2, 0x05}
View Source
var ENCAP_METHOD_SHARING_BY_TAG [4]uint8 = [4]uint8{0x00, 0x80, 0xC2, 0x02}
View Source
var ENCAP_METHOD_SHARING_BY_TIME [4]uint8 = [4]uint8{0x00, 0x80, 0xC2, 0x01}
View Source
var ENCAP_METHOD_SHARING_NULL [4]uint8 = [4]uint8{0x00, 0x00, 0x00, 0x00}
View Source
var GmStateStrMap map[fsm.State]string
View Source
var IAmStateStrMap map[fsm.State]string
View Source
var IGmStateStrMap map[fsm.State]string
View Source
var MacCaptureCount map[MacCaptureKey]int
View Source
var NetIplSharemStateStrMap map[fsm.State]string
View Source
var PsmStateStrMap 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 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

func DRFindPortByKey(key IppDbKey, p **DRCPIpp) bool

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

func DistributedRelayConfigCreateCheck(drniname string, aggregatorid uint32) error

DistributedRelayConfigCreateCheck

func DistributedRelayConfigDeleteCheck

func DistributedRelayConfigDeleteCheck(drniname string) error

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

func DrRxMain(pId uint16, portaladdr string, rxPktChan chan gopacket.Packet)

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 IsControlFrame

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

func NetIplShareMachineStrStateMapCreate

func NetIplShareMachineStrStateMapCreate()

func ProcessDrcpFrame

func ProcessDrcpFrame(pId uint16, pa string, drcp *layers.DRCP)

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

func (am *AMachine) 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 (*AMachine) DrcpAMachineDRNIPortInitialize

func (am *AMachine) DrcpAMachineDRNIPortInitialize(m fsm.Machine, data interface{}) fsm.State

DrcpAMachineDRNIPortInitialize function to be called after State transition to DRNI_PORT_INITIALIZE

func (*AMachine) DrcpAMachineDRNIPortUpdate

func (am *AMachine) DrcpAMachineDRNIPortUpdate(m fsm.Machine, data interface{}) fsm.State

DrcpAMachineDRNIPortUpdate function to be called after State transition to DRNI_PORT_UPDATE

func (*AMachine) DrcpAMachinePSPortUpdate

func (am *AMachine) DrcpAMachinePSPortUpdate(m fsm.Machine, data interface{}) fsm.State

DrcpAMachinePSPortUpdate function to be called after State transition to PS_PORT_UPDATE

func (*AMachine) DrcpAmLog

func (am *AMachine) DrcpAmLog(msg string)

func (*AMachine) IppAllPortUpdateCheck

func (am *AMachine) IppAllPortUpdateCheck() bool

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) PrevState

func (am *AMachine) PrevState() fsm.State

func (*AMachine) PrevStateSet

func (am *AMachine) PrevStateSet(s fsm.State)

PrevStateSet will set the previous State

func (*AMachine) Stop

func (am *AMachine) Stop()

Stop should clean up all resources

type ConvIdTypeValue

type ConvIdTypeValue struct {
	Valid      bool
	Refcnt     int
	Idtype     GatewayAlgorithm
	Isid       uint32
	Cvlan      uint16
	Svlan      uint16
	Bvid       uint16
	Psuedowire uint32
	PortList   []int32
}

type DRAggregatorPortListConfig

type DRAggregatorPortListConfig struct {
	DrniAggregator uint32
	PortList       []int32
}

type DRCPIntraPortal

type DRCPIntraPortal struct {
	CCTimeShared                 bool
	CCEncTagShared               bool
	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
	EnabledTimeShared                    bool
	EnabledEncTagShared                  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
	NetIplShareMachineFsm *NetIplShareMachine
	IAMachineFsm          *IAMachine
	IGMachineFsm          *IGMachine
	// contains filtered or unexported fields
}

func NewDRCPIpp

func NewDRCPIpp(id uint32, dr *DistributedRelay) *DRCPIpp

func (*DRCPIpp) BEGIN

func (p *DRCPIpp) BEGIN(restart bool)

BEGIN this will send the start event to the start the state machines

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) DrIppLinkUp

func (p *DRCPIpp) DrIppLinkUp()

DrIppLinkUp distribute link up 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) LaIppLog

func (p *DRCPIpp) LaIppLog(msg string)

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

func (p *DRCPIpp) NotifyNTTDRCPUDChange(src string, oldval, newval bool)

NotifyNTTDRCPUDChange

func (*DRCPIpp) SetupDRCPMacCapture

func (p *DRCPIpp) SetupDRCPMacCapture(mac string)

SetupDRCPMacCapture will create an pkt capture rule in the hw

func (*DRCPIpp) Stop

func (p *DRCPIpp) Stop()

Stop the port services and state machines

func (*DRCPIpp) TeardownDRCPMacCapture

func (p *DRCPIpp) TeardownDRCPMacCapture(mac string)

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

func (gm *GMachine) 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 (*GMachine) DrcpGMachineDRNIGatewayInitialize

func (gm *GMachine) DrcpGMachineDRNIGatewayInitialize(m fsm.Machine, data interface{}) fsm.State

DrcpGMachineDRNIGatewayInitialize function to be called after State transition to DRNI_GATEWAY_INITIALIZE

func (*GMachine) DrcpGMachineDRNIGatewayUpdate

func (gm *GMachine) DrcpGMachineDRNIGatewayUpdate(m fsm.Machine, data interface{}) fsm.State

DrcpGMachineDRNIGatewayUpdate function to be called after State transition to DRNI_GATEWAY_UPDATE

func (*GMachine) DrcpGMachinePSGatewayUpdate

func (gm *GMachine) DrcpGMachinePSGatewayUpdate(m fsm.Machine, data interface{}) fsm.State

DrcpGMachinePSGatewayUpdate function to be called after State transition to PS_GATEWAY_UPDATE

func (*GMachine) DrcpGmLog

func (gm *GMachine) DrcpGmLog(msg string)

func (*GMachine) IppAllGatewayUpdateCheck

func (gm *GMachine) IppAllGatewayUpdateCheck() bool

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) PrevState

func (gm *GMachine) PrevState() fsm.State

func (*GMachine) PrevStateSet

func (gm *GMachine) PrevStateSet(s fsm.State)

PrevStateSet will set the previous State

func (*GMachine) Stop

func (gm *GMachine) Stop()

Stop should clean up all resources

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 GatewayVectorEntry struct {
	Sequence uint32
	// MAX_CONVERSATION_IDS
	Vector []bool
}

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 DrcpIAMachineFSMBuild(p *DRCPIpp) *IAMachine

func NewDrcpIAMachine

func NewDrcpIAMachine(p *DRCPIpp) *IAMachine

NewDrcpAMachine will create a new instance of the IAMachine

func (*IAMachine) Apply

func (iam *IAMachine) 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 (*IAMachine) DrcpIAMachineIPPPortInitialize

func (iam *IAMachine) DrcpIAMachineIPPPortInitialize(m fsm.Machine, data interface{}) fsm.State

DrcpIAMachineIPPPortInitialize function to be called after State transition to IPP_PORT_INITIALIZE

func (*IAMachine) DrcpIAMachineIPPPortUpdate

func (iam *IAMachine) DrcpIAMachineIPPPortUpdate(m fsm.Machine, data interface{}) fsm.State

DrcpIAMachineIPPPortUpdate function to be called after State transition to IPP_PORT_UPDATE

func (*IAMachine) DrcpIAmLog

func (iam *IAMachine) DrcpIAmLog(msg string)

func (*IAMachine) PrevState

func (iam *IAMachine) PrevState() fsm.State

func (*IAMachine) PrevStateSet

func (iam *IAMachine) PrevStateSet(s fsm.State)

PrevStateSet will set the previous State

func (*IAMachine) Stop

func (iam *IAMachine) Stop()

Stop should clean up all resources

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 DrcpIGMachineFSMBuild(p *DRCPIpp) *IGMachine

func NewDrcpIGMachine

func NewDrcpIGMachine(p *DRCPIpp) *IGMachine

NewDrcpIGMachine will create a new instance of the IGMachine

func (*IGMachine) Apply

func (igm *IGMachine) 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 (*IGMachine) DrcpIGMachineIPPGatewayInitialize

func (igm *IGMachine) DrcpIGMachineIPPGatewayInitialize(m fsm.Machine, data interface{}) fsm.State

DrcpGMachineIPPGatewayInitialize function to be called after State transition to IPP_GATEWAY_INITIALIZE

func (*IGMachine) DrcpIGMachineIPPGatewayUpdate

func (igm *IGMachine) DrcpIGMachineIPPGatewayUpdate(m fsm.Machine, data interface{}) fsm.State

DrcpIGMachineIPPGatewayUpdate function to be called after State transition to IPP_GATEWAY_UPDATE

func (*IGMachine) DrcpIGmLog

func (igm *IGMachine) DrcpIGmLog(msg string)

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) PrevState

func (igm *IGMachine) PrevState() fsm.State

func (*IGMachine) PrevStateSet

func (igm *IGMachine) PrevStateSet(s fsm.State)

PrevStateSet will set the previous State

func (*IGMachine) Stop

func (igm *IGMachine) Stop()

Stop should clean up all resources

type IppDbKey

type IppDbKey struct {
	Name   string
	DrName string
}

type MacCaptureKey

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

type Md5Digest

type Md5Digest [16]uint8

type NetIplShareMachine

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

	Machine *fsm.Machine

	// machine specific events
	NetIplSharemEvents chan utils.MachineEvent
	// contains filtered or unexported fields
}

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

func (psm *PsMachine) 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 (*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

func (psm *PsMachine) DrcpPsMachinePortalSystemUpdate(m fsm.Machine, data interface{}) fsm.State

DrcpPsMachineFastPeriodic function to be called after State transition to FAST_PERIODIC

func (*PsMachine) DrcpPsmLog

func (psm *PsMachine) DrcpPsmLog(msg string)

func (*PsMachine) PrevState

func (psm *PsMachine) PrevState() fsm.State

PrevState will get the previous State

func (*PsMachine) PrevStateSet

func (psm *PsMachine) PrevStateSet(s fsm.State)

PrevStateSet will set the previous State

func (*PsMachine) Stop

func (psm *PsMachine) Stop()

Stop should clean up all resources

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

func (*PtxMachine) Stop

func (ptxm *PtxMachine) Stop()

Stop should clean up all resources

type RxDrcpPdu

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

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 DrcpRxMachineFSMBuild(p *DRCPIpp) *RxMachine

func NewDrcpRxMachine

func NewDrcpRxMachine(port *DRCPIpp) *RxMachine

NewDrcpRxMachine will create a new instance of the RxMachine

func (*RxMachine) Apply

func (rxm *RxMachine) 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 (*RxMachine) CurrentWhileTimerStart

func (rxm *RxMachine) CurrentWhileTimerStart()

func (*RxMachine) CurrentWhileTimerStop

func (rxm *RxMachine) CurrentWhileTimerStop()

func (*RxMachine) CurrentWhileTimerTimeoutSet

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

func (*RxMachine) DrcpRxMachineCompatibilityCheck

func (rxm *RxMachine) DrcpRxMachineCompatibilityCheck(m fsm.Machine, data interface{}) fsm.State

DrcpRxMachineCompatibilityCheck function to be called after State transition to COMPATIBILITY CHECK

func (*RxMachine) DrcpRxMachineCurrent

func (rxm *RxMachine) DrcpRxMachineCurrent(m fsm.Machine, data interface{}) fsm.State

DrcpRxMachineCurrent function to be called after State transition to CURRENT

func (*RxMachine) DrcpRxMachineDefaulted

func (rxm *RxMachine) DrcpRxMachineDefaulted(m fsm.Machine, data interface{}) fsm.State

DrcpRxMachineDefaulted function to be called after State transition to DEFAULTED

func (*RxMachine) DrcpRxMachineDiscard

func (rxm *RxMachine) DrcpRxMachineDiscard(m fsm.Machine, data interface{}) fsm.State

DrcpRxMachineDiscard function to be called after State transition to DISCARD

func (*RxMachine) DrcpRxMachineExpired

func (rxm *RxMachine) DrcpRxMachineExpired(m fsm.Machine, data interface{}) fsm.State

DrcpRxMachineExpired function to be called after State transition to EXPIRED

func (*RxMachine) DrcpRxMachineInitialize

func (rxm *RxMachine) DrcpRxMachineInitialize(m fsm.Machine, data interface{}) fsm.State

DrcpRxMachineInitialize function to be called after State transition to INITIALIZE

func (*RxMachine) DrcpRxMachinePortalCheck

func (rxm *RxMachine) DrcpRxMachinePortalCheck(m fsm.Machine, data interface{}) fsm.State

DrcpRxMachinePortalCheck function to be called after State transition to PORTAL CHECK

func (*RxMachine) DrcpRxmLog

func (rxm *RxMachine) DrcpRxmLog(msg string)

func (*RxMachine) NotifyChangePortalChanged

func (rxm *RxMachine) NotifyChangePortalChanged(oldval, newval bool)

func (*RxMachine) NotifyDRCPStateTimeoutChange

func (rxm *RxMachine) NotifyDRCPStateTimeoutChange(oldval, newval bool)

NotifyDRCPStateTimeoutChange notify the Periodic Transmit Machine of a neighbor state timeout change

func (*RxMachine) NotifyGatewayConversationUpdate

func (rxm *RxMachine) NotifyGatewayConversationUpdate(oldval, newval bool)

func (*RxMachine) NotifyPortConversationUpdate

func (rxm *RxMachine) NotifyPortConversationUpdate(oldval, newval bool)

func (*RxMachine) PrevState

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

func (*RxMachine) PrevStateSet

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

PrevStateSet will set the previous State

func (*RxMachine) Stop

func (rxm *RxMachine) Stop()

Stop should clean up all resources

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

func DrcpTxMachineFSMBuild(p *DRCPIpp) *TxMachine

DrcpTxMachineFSMBuild will build the State machine with callbacks

func NewDrcpTxMachine

func NewDrcpTxMachine(port *DRCPIpp) *TxMachine

NewDrcpTxMachine will create a new instance of the TxMachine

func (*TxMachine) Apply

func (txm *TxMachine) 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 (*TxMachine) DrcpTxMachineOff

func (txm *TxMachine) DrcpTxMachineOff(m fsm.Machine, data interface{}) fsm.State

DrcpTxMachineOff will ensure that no packets are transmitted, typically means that drcp has been disabled or a packet was just transmitted

func (*TxMachine) DrcpTxMachineOn

func (txm *TxMachine) DrcpTxMachineOn(m fsm.Machine, data interface{}) fsm.State

DrcpTxMachineOn will either send a packet out

func (*TxMachine) DrcpTxmLog

func (txm *TxMachine) DrcpTxmLog(msg string)

func (*TxMachine) PrevState

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

PrevState will get the previous State from the State transitions

func (*TxMachine) PrevStateSet

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

PrevStateSet will set the previous State

func (*TxMachine) Stop

func (txm *TxMachine) Stop()

Stop will stop all timers and close all channels

Jump to

Keyboard shortcuts

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