當前位置: 首頁>>代碼示例>>Golang>>正文


Golang ofctrl.OFSwitch類代碼示例

本文整理匯總了Golang中github.com/contiv/ofnet/ofctrl.OFSwitch的典型用法代碼示例。如果您正苦於以下問題:Golang OFSwitch類的具體用法?Golang OFSwitch怎麽用?Golang OFSwitch使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了OFSwitch類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: PacketRcvd

// Receive a packet from the switch.
func (self *OfnetAgent) PacketRcvd(sw *ofctrl.OFSwitch, pkt *ofctrl.PacketIn) {
	log.Infof("Packet received from switch %v. Packet: %+v", sw.DPID(), pkt)
	log.Infof("Input Port: %+v", pkt.Match.Fields[0].Value)

	// Inform the datapath
	self.datapath.PacketRcvd(sw, pkt)
}
開發者ID:balajisiva,項目名稱:netplugin,代碼行數:8,代碼來源:ofnetAgent.go

示例2: PacketRcvd

// Receive a packet from the switch.
func (self *OfnetAgent) PacketRcvd(sw *ofctrl.OFSwitch, pkt *ofctrl.PacketIn) {
	log.Debugf("Packet received from switch %v. Packet: %+v", sw.DPID(), pkt)

	// Inform the datapath
	self.datapath.PacketRcvd(sw, pkt)

	// increment stats
	self.incrStats("PktRcvd")
}
開發者ID:abhinandanpb,項目名稱:ofnet,代碼行數:10,代碼來源:ofnetAgent.go

示例3: SwitchDisconnected

// Handle switch disconnect event
func (self *OfnetAgent) SwitchDisconnected(sw *ofctrl.OFSwitch) {
	log.Infof("Switch %v disconnected", sw.DPID())

	// Inform the datapath
	self.datapath.SwitchDisconnected(sw)

	self.ofSwitch = nil
	self.isConnected = false
}
開發者ID:balajisiva,項目名稱:netplugin,代碼行數:10,代碼來源:ofnetAgent.go

示例4: SwitchConnected

// Handle switch connected event
func (self *HostBridge) SwitchConnected(sw *ofctrl.OFSwitch) {
	log.Infof("Switch %v connected", sw.DPID())

	// store it for future use.
	self.ofSwitch = sw

	self.isConnected = true
	// Init the Fgraph
	self.initFgraph()
}
開發者ID:jojimt,項目名稱:netplugin,代碼行數:11,代碼來源:hostBridge.go

示例5: SwitchConnected

// Handle switch connected event
func (self *OfnetAgent) SwitchConnected(sw *ofctrl.OFSwitch) {
	log.Infof("Switch %v connected", sw.DPID())

	// store it for future use.
	self.ofSwitch = sw

	// Inform the datapath
	self.datapath.SwitchConnected(sw)

	self.isConnected = true
}
開發者ID:balajisiva,項目名稱:netplugin,代碼行數:12,代碼來源:ofnetAgent.go

示例6: SwitchDisconnected

// Handle switch disconnect event
func (self *HostBridge) SwitchDisconnected(sw *ofctrl.OFSwitch) {
	log.Infof("Switch %v disconnected", sw.DPID())

	// Ignore if this error was not for current switch
	if sw.DPID().String() != self.ofSwitch.DPID().String() {
		return
	}

	self.ofSwitch = nil
	self.isConnected = false
}
開發者ID:jojimt,項目名稱:netplugin,代碼行數:12,代碼來源:hostBridge.go

示例7: SwitchDisconnected

// Handle switch disconnect event
func (self *OfnetAgent) SwitchDisconnected(sw *ofctrl.OFSwitch) {
	log.Infof("Switch %v disconnected", sw.DPID())

	// Ignore if this error was not for current switch
	if sw.DPID().String() != self.ofSwitch.DPID().String() {
		return
	}

	// Inform the datapath
	self.datapath.SwitchDisconnected(sw)

	self.mutex.Lock()
	self.ofSwitch = nil
	self.isConnected = false
	self.mutex.Unlock()
}
開發者ID:abhinandanpb,項目名稱:ofnet,代碼行數:17,代碼來源:ofnetAgent.go

示例8: PacketRcvd

// Receive a packet from the switch.
func (self *HostBridge) PacketRcvd(sw *ofctrl.OFSwitch, pkt *ofctrl.PacketIn) {
	log.Debugf("Packet received from switch %v. Packet: %+v", sw.DPID(), pkt)
}
開發者ID:jojimt,項目名稱:netplugin,代碼行數:4,代碼來源:hostBridge.go


注:本文中的github.com/contiv/ofnet/ofctrl.OFSwitch類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。