本文整理汇总了Java中org.openflow.protocol.OFMessage.setXid方法的典型用法代码示例。如果您正苦于以下问题:Java OFMessage.setXid方法的具体用法?Java OFMessage.setXid怎么用?Java OFMessage.setXid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openflow.protocol.OFMessage
的用法示例。
在下文中一共展示了OFMessage.setXid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clearAllFlowMods
import org.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@LogMessageDoc(level="INFO",
message="Switch {switch} flow cleared",
explanation="The switch flow table has been cleared, " +
"this normally happens on switch connection")
@Override
public void clearAllFlowMods() {
if (channel == null || !isConnected())
return;
// Delete all pre-existing flows
log.info("Clearing all flows on switch {}", this);
OFMatch match = new OFMatch().setWildcards(OFMatch.OFPFW_ALL);
OFMessage fm = ((OFFlowMod) floodlightProvider.getOFMessageFactory()
.getMessage(OFType.FLOW_MOD))
.setMatch(match)
.setCommand(OFFlowMod.OFPFC_DELETE)
.setOutPort(OFPort.OFPP_NONE)
.setLength(U16.t(OFFlowMod.MINIMUM_LENGTH));
fm.setXid(getNextTransactionId());
OFMessage barrierMsg = floodlightProvider.getOFMessageFactory().getMessage(
OFType.BARRIER_REQUEST);
barrierMsg.setXid(getNextTransactionId());
List<OFMessage> msglist = new ArrayList<OFMessage>(2);
msglist.add(fm);
msglist.add(barrierMsg);
channel.write(msglist);
}
示例2: querySwitchFeaturesReply
import org.openflow.protocol.OFMessage; //导入方法依赖的package包/类
@Override
public Future<OFFeaturesReply> querySwitchFeaturesReply()
throws IOException {
OFMessage request =
floodlightProvider.getOFMessageFactory().
getMessage(OFType.FEATURES_REQUEST);
request.setXid(getNextTransactionId());
OFFeaturesReplyFuture future =
new OFFeaturesReplyFuture(threadPool, this, request.getXid());
this.featuresFutureMap.put(request.getXid(), future);
List<OFMessage> msglist = new ArrayList<OFMessage>(1);
msglist.add(request);
this.write(msglist);
return future;
}
示例3: sendHandShakeMessage
import org.openflow.protocol.OFMessage; //导入方法依赖的package包/类
/**
* Send a message to the switch using the handshake transactions ids.
* @throws IOException
*/
private void sendHandShakeMessage(OFType type) throws IOException {
// Send initial Features Request
OFMessage m = BasicFactory.getInstance().getMessage(type);
m.setXid(handshakeTransactionIds--);
channel.write(Collections.singletonList(m));
}