本文整理汇总了Java中org.projectfloodlight.openflow.protocol.OFMessage.getType方法的典型用法代码示例。如果您正苦于以下问题:Java OFMessage.getType方法的具体用法?Java OFMessage.getType怎么用?Java OFMessage.getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.projectfloodlight.openflow.protocol.OFMessage
的用法示例。
在下文中一共展示了OFMessage.getType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processDriverHandshakeMessage
import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public void processDriverHandshakeMessage(OFMessage m) {
if (!startDriverHandshakeCalled) {
throw new SwitchDriverSubHandshakeNotStarted();
}
if (driverHandshakeComplete.get()) {
throw new SwitchDriverSubHandshakeCompleted(m);
}
log.debug("processDriverHandshakeMessage for sw {}", getStringId());
switch (m.getType()) {
case STATS_REPLY: // multipart message is reported as STAT
processOFMultipartReply((OFStatsReply) m);
break;
default:
log.warn("Received message {} during switch-driver " +
"subhandshake " + "from switch {} ... " +
"Ignoring message", m,
getStringId());
}
}
示例2: receive
import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
if (!this.enabled) {
return Command.CONTINUE;
}
switch (msg.getType()) {
case PACKET_IN:
IRoutingDecision decision = null;
if (cntx != null) {
decision = IRoutingDecision.rtStore.get(cntx, IRoutingDecision.CONTEXT_DECISION);
return this.processPacketInMessage(sw, (OFPacketIn) msg, decision, cntx);
}
break;
default:
break;
}
return Command.CONTINUE;
}
示例3: write
import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public void write(OFMessage m) {
if (!isConnected()) {
if (logger.isDebugEnabled())
logger.debug("{}: not connected - dropping message {}", this, m);
return;
}
if (logger.isDebugEnabled())
logger.debug("{}: send {}", this, m);
List<OFMessage> msgBuffer = localMsgBuffer.get();
if (msgBuffer == null) {
msgBuffer = new ArrayList<OFMessage>();
localMsgBuffer.set(msgBuffer);
}
counters.updateWriteStats(m);
msgBuffer.add(m);
if ((msgBuffer.size() >= Controller.BATCH_MAX_SIZE) || ((m.getType() != OFType.PACKET_OUT) && (m.getType() != OFType.FLOW_MOD))) {
this.write(msgBuffer);
localMsgBuffer.set(null);
}
}
示例4: receive
import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public net.floodlightcontroller.core.IListener.Command receive(
IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
System.out.println("flow expired: "+sw.toString() + msg.toString());
//OFFlowRemoved flowRemoved = (OFFlowRemoved) msg;
if (!switchStates.containsKey(sw))
switchStates.put(sw, new ObfuscationSwitchState(sw));
if (msg.getType() == OFType.FLOW_REMOVED) {
OFFlowRemoved flowRemoved = (OFFlowRemoved) msg;
System.out.println("flow expired: "+sw.toString() + "dst: " + flowRemoved.getCookie());
long dst = flowRemoved.getCookie().getValue();
ObfuscationHeader oHeader = new ObfuscationHeader();
Match match = flowRemoved.getMatch();
switchStates.get(sw).removeDestinationID(dst);
}
return Command.CONTINUE;
}
示例5: receive
import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext context) {
switch (msg.getType()) {
case PACKET_IN:
return handlePacketIn(sw, (OFPacketIn) msg, context);
default:
break;
}
return Command.CONTINUE;
}
示例6: processWrittenOFMessage
import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
void processWrittenOFMessage(OFMessage m) {
switch(m.getType()) {
case ROLE_REQUEST:
processOFRoleRequest((OFRoleRequest) m);
break;
case EXPERIMENTER:
if (m instanceof OFNiciraControllerRoleRequest) {
processOFNiciraControllerRoleRequest((OFNiciraControllerRoleRequest) m);
}
break;
default:
break;
}
}
示例7: receive
import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
switch (msg.getType()) {
case PACKET_IN:
ctrIncoming.increment();
return this.processPacketInMessage(sw, (OFPacketIn) msg, cntx);
default:
break;
}
return Command.CONTINUE;
}
示例8: receive
import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
switch (msg.getType()) {
case FLOW_REMOVED:
return handleFlowRemoved(sw, (OFFlowRemoved) msg, cntx);
default:
return Command.CONTINUE;
}
}
示例9: sendMsg
import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public final void sendMsg(OFMessage m) {
OFMessage newMsg = m;
if (m.getType() == OFType.STATS_REQUEST) {
OFStatsRequest sr = (OFStatsRequest) m;
log.debug("Rebuilding stats request type {}", sr.getStatsType());
switch (sr.getStatsType()) {
case FLOW:
OFCalientFlowStatsRequest request = this.factory().buildCalientFlowStatsRequest()
.setCookie(((OFFlowStatsRequest) sr).getCookie())
.setCookieMask(((OFFlowStatsRequest) sr).getCookieMask())
.setMatch(this.factory().matchWildcardAll())
.setOutGroup(((OFFlowStatsRequest) sr).getOutGroup().getGroupNumber())
.setOutPort(OFPort.ANY)
.setTableId(TableId.ALL)
.setXid(sr.getXid())
.setFlags(sr.getFlags())
.build();
newMsg = request;
break;
case PORT:
// TODO
break;
default:
break;
}
}
super.sendMsg(newMsg);
}
示例10: receive
import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
switch (msg.getType()) {
case PACKET_IN:
IRoutingDecision decision = null;
if (cntx != null) {
decision = RoutingDecision.rtStore.get(cntx, IRoutingDecision.CONTEXT_DECISION);
}
return this.processPacketInMessage(sw, (OFPacketIn) msg, decision, cntx);
default:
break;
}
return Command.CONTINUE;
}
示例11: handleOutgoingMessage
import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public void handleOutgoingMessage(Dpid dpid, List<OFMessage> msgs) {
for (OFMessage msg : msgs) {
if (msg.getType() == OFType.PACKET_OUT ||
msg.getType() == OFType.FLOW_MOD ||
msg.getType() == OFType.STATS_REQUEST) {
aggregators.computeIfPresent(dpid, (k, v) -> {
v.increment(msg);
return v;
});
}
}
}
示例12: receive
import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
@LogMessageDoc(level="ERROR",
message="Got a FlowRemove message for a infinite " +
"timeout flow: {flow} from switch {switch}",
explanation="Flows with infinite timeouts should not expire. " +
"The switch has expired the flow anyway.",
recommendation=LogMessageDoc.REPORT_SWITCH_BUG)
public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
switch (msg.getType()) {
case FLOW_REMOVED:
return handleFlowRemoved(sw, (OFFlowRemoved) msg, cntx);
default:
return Command.CONTINUE;
}
}
示例13: receive
import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public Command receive(IOFSwitch sw, OFMessage msg,
FloodlightContext cntx) {
switch (msg.getType()) {
case PACKET_IN:
cntIncoming.increment();
return this.processPacketInMessage(sw, (OFPacketIn) msg, cntx);
default:
break;
}
return Command.CONTINUE;
}
示例14: receive
import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
switch (msg.getType()) {
case PACKET_IN:
return this.processPacketInMessage(sw, (OFPacketIn) msg, cntx);
case FLOW_REMOVED:
return this.processFlowRemovedMessage(sw, (OFFlowRemoved) msg);
case ERROR:
log.info("received an error {} from switch {}", msg, sw);
return Command.CONTINUE;
default:
log.error("received an unexpected message {} from switch {}", msg, sw);
return Command.CONTINUE;
}
}
示例15: receive
import org.projectfloodlight.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public net.floodlightcontroller.core.IListener.Command
receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx) {
switch (msg.getType()) {
case PACKET_IN:
return processPacketIn(sw, (OFPacketIn)msg, cntx);
default:
break;
}
log.warn("Received unexpected message {}", msg);
return Command.CONTINUE;
}