本文整理汇总了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;未经允许,请勿转载。 |
请发表评论