utils

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: 12 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 / | (----` \ \/ \/ / | | `---| |----`| ,----'| |__| | | __| | | | __| > < \ \ \ / | | | | | | | __ | | | | `----.| |____ / . \ .----) | \ /\ / | | | | | `----.| | | | |__| |_______||_______/__/ \__\ |_______/ \__/ \__/ |__| |__| \______||__| |__|

defs

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 / | (----` \ \/ \/ / | | `---| |----`| ,----'| |__| | | __| | | | __| > < \ \ \ / | | | | | | | __ | | | | `----.| |____ / . \ .----) | \ /\ / | | | | | `----.| | | | |__| |_______||_______/__/ \__\ |_______/ \__/ \__/ |__| |__| \______||__| |__|

global.go

init

loggger

portmap

Index

Constants

View Source
const (
	// init
	LACP_GLOBAL_INIT = iota + 1
	// allow all config
	LACP_GLOBAL_ENABLE
	// disallow all config
	LACP_GLOBAL_DISABLE
	// transition state to to allow deleting on
	// when global state changes to disable
	LACP_GLOBAL_DISABLE_PENDING
)

Variables

View Source
var AggConfigMap map[int32]string
View Source
var EventMap map[ifindex_event]bool

events will hold negitive events and will be cleared

View Source
var GlobalLogger *logging.Writer
View Source
var LaSwitchMac [6]uint8
View Source
var LacpGlobalState int = LACP_GLOBAL_INIT
View Source
var PortConfigMap map[int32]PortConfig

Functions

func AddAggConfigMap

func AddAggConfigMap(ifindex int32, intfref string)

func ConstructPortConfigMap

func ConstructPortConfigMap()

func CreateEventMap

func CreateEventMap(ifindex int32)

func DelAggConfigMap

func DelAggConfigMap(ifindex int32, intfref string)

func DeleteAllAsicDPlugins

func DeleteAllAsicDPlugins()

func DeleteEventMap

func DeleteEventMap(ifindex int32)

func GetAggIfIndexFromName

func GetAggIfIndexFromName(name string) int32

func GetAggNameFromIfIndex

func GetAggNameFromIfIndex(ifindex int32) string

func GetAsicDPluginList

func GetAsicDPluginList() []asicdClient.AsicdClientIntf

func GetIfIndexFromName

func GetIfIndexFromName(name string) int32

func GetLaLogger

func GetLaLogger() *logging.Writer

func GetNameFromIfIndex

func GetNameFromIfIndex(ifindex int32) string

func GetSwitchMac

func GetSwitchMac() [6]uint8

func LacpGlobalStateGet

func LacpGlobalStateGet() int

func LacpGlobalStateSet

func LacpGlobalStateSet(state int)

func ProcessLacpGroupOperStateDown

func ProcessLacpGroupOperStateDown(ifindex int32)

func ProcessLacpGroupOperStateUp

func ProcessLacpGroupOperStateUp(ifindex int32)

func ProcessLacpPortOperStateDown

func ProcessLacpPortOperStateDown(ifindex int32)

func ProcessLacpPortOperStateUp

func ProcessLacpPortOperStateUp(ifindex int32)

func ProcessLacpPortPartnerInfoMismatch

func ProcessLacpPortPartnerInfoMismatch(ifindex int32)

func ProcessLacpPortPartnerInfoSync

func ProcessLacpPortPartnerInfoSync(ifindex int32)

func SaveSwitchMac

func SaveSwitchMac(switchMac string)

func SendResponse

func SendResponse(msg string, responseChan chan string)

func SetAsicDPlugin

func SetAsicDPlugin(clientif asicdClient.AsicdClientIntf)

func SetLaLogger

func SetLaLogger(logger *logging.Writer)

function to overwrite logger

Types

type MachineEvent

type MachineEvent struct {
	E            fsm.Event
	Src          string
	ResponseChan chan string
}

MachineEvent machine events will be sent with this struct and will provide extra data in order to provide async communication between sender and receiver

type PortConfig

type PortConfig struct {
	Name         string
	HardwareAddr net.HardwareAddr
	Speed        int32
	IfIndex      int32
	Mtu          int32
	Duplex       string
}

type StateEvent

type StateEvent struct {
	Owner       string
	StrStateMap map[fsm.State]string
	LogEna      bool
	Logger      func(string)
	// contains filtered or unexported fields
}

func (*StateEvent) CurrentEvent

func (se *StateEvent) CurrentEvent() fsm.Event

func (*StateEvent) CurrentState

func (se *StateEvent) CurrentState() fsm.State

func (*StateEvent) EnableLogging

func (se *StateEvent) EnableLogging(ena bool)

func (*StateEvent) IsLoggerEna

func (se *StateEvent) IsLoggerEna() bool

func (*StateEvent) LoggerSet

func (se *StateEvent) LoggerSet(log func(string))

func (*StateEvent) PreviousEvent

func (se *StateEvent) PreviousEvent() fsm.Event

func (*StateEvent) PreviousState

func (se *StateEvent) PreviousState() fsm.State

func (*StateEvent) SetEvent

func (se *StateEvent) SetEvent(es string, e fsm.Event)

func (*StateEvent) SetState

func (se *StateEvent) SetState(s fsm.State)

func (*StateEvent) StateStrMapSet

func (se *StateEvent) StateStrMapSet(strMap map[fsm.State]string)

Jump to

Keyboard shortcuts

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