server

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type STPConfig

type STPConfig struct {
	Msgtype STPConfigMsgType
	Msgdata interface{}
}

type STPConfigMsgType

type STPConfigMsgType int8
const (
	STPConfigMsgCreateBridge STPConfigMsgType = iota + 1
	STPConfigMsgDeleteBridge
	STPConfigMsgUpdateBridgeMaxAge
	STPConfigMsgUpdateBridgeHelloTime
	STPConfigMsgUpdateBridgeForwardDelay
	STPConfigMsgUpdateBridgeTxHoldCount
	STPConfigMsgUpdateBridgePriority
	STPConfigMsgUpdateBridgeForceVersion
	STPConfigMsgUpdateBridgeDebugLevel
	STPConfigMsgCreatePort
	STPConfigMsgDeletePort
	STPConfigMsgUpdatePortPriority
	STPConfigMsgUpdatePortEnable
	STPConfigMsgUpdatePortPathCost
	STPConfigMsgUpdatePortProtocolMigration
	STPConfigMsgUpdatePortAdminPointToPoint
	STPConfigMsgUpdatePortAdminEdge
	STPConfigMsgUpdatePortAdminPathCost
	STPConfigMsgUpdatePortBpduGuard
	STPConfigMsgUpdatePortBridgeAssurance
	STPConfigMsgGlobalEnable
	STPConfigMsgGlobalDisable
)

type STPServer

type STPServer struct {
	ConfigCh         chan STPConfig
	AsicdSubSocketCh chan commonDefs.AsicdNotifyMsg
	// contains filtered or unexported fields
}

func NewSTPServer

func NewSTPServer(logger *logging.Writer) *STPServer

func (*STPServer) InitServer

func (server *STPServer) InitServer()

func (*STPServer) StartSTPSConfigNotificationListener

func (server *STPServer) StartSTPSConfigNotificationListener()

TODO

func (server *STPServer) ListenToClientStateChanges() {
	clientStatusListener := keepalive.InitDaemonStatusListener()
	if clientStatusListener != nil {
		go clientStatusListener.StartDaemonStatusListner()
		for {
			select {
			case clientStatus := <-clientStatusListener.DaemonStatusCh:
				mgr.logger.Info(fmt.Sprintln("Received client status: ", clientStatus.Name, clientStatus.Status))
				if mgr.IsReady() {
					switch clientStatus.Status {
					case sysdCommonDefs.STOPPED, sysdCommonDefs.RESTARTING:
						go mgr.DisconnectFromClient(clientStatus.Name)
					case sysdCommonDefs.UP:
						go mgr.ConnectToClient(clientStatus.Name)
					}
				}
			}
		}
	}
}

StartSTPSConfigNotificationListener

Jump to

Keyboard shortcuts

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