本文整理汇总了Java中org.projectfloodlight.openflow.protocol.OFGetConfigReply类的典型用法代码示例。如果您正苦于以下问题:Java OFGetConfigReply类的具体用法?Java OFGetConfigReply怎么用?Java OFGetConfigReply使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OFGetConfigReply类属于org.projectfloodlight.openflow.protocol包,在下文中一共展示了OFGetConfigReply类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processOFGetConfigReply
import org.projectfloodlight.openflow.protocol.OFGetConfigReply; //导入依赖的package包/类
@Override
void processOFGetConfigReply(OFChannelHandler h, OFGetConfigReply m)
throws IOException {
if (m.getMissSendLen() == 0xffff) {
log.trace("Config Reply from switch {} confirms "
+ "miss length set to 0xffff",
h.getSwitchInfoString());
} else {
// FIXME: we can't really deal with switches that don't send
// full packets. Shouldn't we drop the connection here?
log.warn("Config Reply from switch {} has"
+ "miss length set to {}",
h.getSwitchInfoString(),
m.getMissSendLen());
}
h.sendHandshakeDescriptionStatsRequest();
h.setState(WAIT_DESCRIPTION_STAT_REPLY);
}
示例2: processOFGetConfigReply
import org.projectfloodlight.openflow.protocol.OFGetConfigReply; //导入依赖的package包/类
@Override
void processOFGetConfigReply(OFGetConfigReply m) {
if (m.getMissSendLen() == 0xffff) {
log.trace("Config Reply from switch {} confirms "
+ "miss length set to 0xffff",
getSwitchInfoString());
} else {
// FIXME: we can't really deal with switches that don't send
// full packets. Shouldn't we drop the connection here?
// FIXME: count??
log.warn("Config Reply from switch {} has"
+ "miss length set to {}",
getSwitchInfoString(),
m.getMissSendLen());
}
setState(new WaitDescriptionStatReplyState());
}
示例3: moveToWaitDescriptionStatReply
import org.projectfloodlight.openflow.protocol.OFGetConfigReply; //导入依赖的package包/类
/** Move the channel from scratch to WAIT_DESCRIPTION_STAT_REPLY state
* Builds on moveToWaitConfigReply()
* adds testing for WAIT_CONFIG_REPLY state
*/
@Test
public void moveToWaitDescriptionStatReply() throws Exception {
moveToWaitConfigReply();
connection.clearMessages();
OFGetConfigReply cr = factory.buildGetConfigReply()
.setMissSendLen(0xFFFF)
.build();
switchHandler.processOFMessage(cr);
OFMessage msg = connection.retrieveMessage();
assertEquals(OFType.STATS_REQUEST, msg.getType());
OFStatsRequest<?> sr = (OFStatsRequest<?>)msg;
assertEquals(OFStatsType.DESC, sr.getStatsType());
verifyUniqueXids(msg);
assertThat(switchHandler.getStateForTesting(), CoreMatchers.instanceOf(OFSwitchHandshakeHandler.WaitDescriptionStatReplyState.class));
}
示例4: moveToWaitDescriptionStatReply
import org.projectfloodlight.openflow.protocol.OFGetConfigReply; //导入依赖的package包/类
/** Move the channel from scratch to WAIT_DESCRIPTION_STAT_REPLY state
* Builds on moveToWaitConfigReply()
* adds testing for WAIT_CONFIG_REPLY state
*/
@Test
public void moveToWaitDescriptionStatReply() throws Exception {
moveToWaitConfigReply();
connection.clearMessages();
OFGetConfigReply cr = factory.buildGetConfigReply()
.setMissSendLen(0xFFFF)
.build();
switchHandler.processOFMessage(cr);
OFMessage msg = connection.retrieveMessage();
assertEquals(OFType.STATS_REQUEST, msg.getType());
OFStatsRequest<?> sr = (OFStatsRequest<?>)msg;
assertEquals(OFStatsType.DESC, sr.getStatsType());
verifyUniqueXids(msg);
assertThat(switchHandler.getStateForTesting(), CoreMatchers.instanceOf(OFSwitchHandshakeHandler.WaitDescriptionStatReplyState.class));
}
示例5: moveToWaitDescriptionStatReply
import org.projectfloodlight.openflow.protocol.OFGetConfigReply; //导入依赖的package包/类
/**
* Move the channel from scratch to WAIT_DESCRIPTION_STAT_REPLY state
* Builds on moveToWaitConfigReply()
* adds testing for WAIT_CONFIG_REPLY state
*/
@Test
public void moveToWaitDescriptionStatReply() throws Exception {
moveToWaitConfigReply();
resetChannel();
channel.write(capture(writeCapture));
expectLastCall().andReturn(null).atLeastOnce();
replay(channel);
OFGetConfigReply cr = (OFGetConfigReply)buildOFMessage(OFType.GET_CONFIG_REPLY);
sendMessageToHandlerWithControllerReset(Collections.<OFMessage>singletonList(cr));
List<OFMessage> msgs = getMessagesFromCapture();
assertEquals(1, msgs.size());
assertEquals(OFType.STATS_REQUEST, msgs.get(0).getType());
OFStatsRequest<?> sr = (OFStatsRequest<?>) msgs.get(0);
assertEquals(OFStatsType.DESC, sr.getStatsType());
verifyUniqueXids(msgs);
assertEquals(OFChannelHandler.ChannelState.WAIT_DESCRIPTION_STAT_REPLY,
handler.getStateForTesting());
}
示例6: processOFGetConfigReply
import org.projectfloodlight.openflow.protocol.OFGetConfigReply; //导入依赖的package包/类
@Override
void processOFGetConfigReply(OFChannelHandler h, OFGetConfigReply m)
throws IOException {
if (m.getMissSendLen() == 0xffff) {
log.trace("Config Reply from switch {} confirms "
+ "miss length set to 0xffff",
h.getSwitchInfoString());
} else {
// FIXME: we can't really deal with switches that don't send
// full packets. Shouldn't we drop the connection here?
log.warn("Config Reply from switch {} has "
+ "miss length set to {}",
h.getSwitchInfoString(),
m.getMissSendLen());
}
nextState(h);
}
示例7: processOFMessage
import org.projectfloodlight.openflow.protocol.OFGetConfigReply; //导入依赖的package包/类
/**
* Process an OF message received on the channel and
* update state accordingly.
*
* The main "event" of the state machine. Process the received message,
* send follow up message if required and update state if required.
*
* Switches on the message type and calls more specific event handlers
* for each individual OF message type. If we receive a message that
* is supposed to be sent from a controller to a switch we throw
* a SwitchStateExeption.
*
* The more specific handlers can also throw SwitchStateExceptions
*
* @param h The OFChannelHandler that received the message
* @param m The message we received.
* @throws SwitchStateException
* @throws IOException
*/
void processOFMessage(OFMessage m) {
roleChanger.checkTimeout();
switch(m.getType()) {
case BARRIER_REPLY:
processOFBarrierReply((OFBarrierReply) m);
break;
case ERROR:
processOFError((OFErrorMsg) m);
break;
case FLOW_REMOVED:
processOFFlowRemoved((OFFlowRemoved) m);
break;
case GET_CONFIG_REPLY:
processOFGetConfigReply((OFGetConfigReply) m);
break;
case PACKET_IN:
processOFPacketIn((OFPacketIn) m);
break;
case PORT_STATUS:
processOFPortStatus((OFPortStatus) m);
break;
case QUEUE_GET_CONFIG_REPLY:
processOFQueueGetConfigReply((OFQueueGetConfigReply) m);
break;
case STATS_REPLY:
processOFStatsReply((OFStatsReply) m);
break;
case ROLE_REPLY:
processOFRoleReply((OFRoleReply) m);
break;
case EXPERIMENTER:
processOFExperimenter((OFExperimenter) m);
break;
default:
illegalMessageReceived(m);
break;
}
}
示例8: processOFGetConfigReply
import org.projectfloodlight.openflow.protocol.OFGetConfigReply; //导入依赖的package包/类
@Override
@LogMessageDocs({
@LogMessageDoc(level="WARN",
message="Config Reply from {switch} has " +
"miss length set to {length}",
explanation="The controller requires that the switch " +
"use a miss length of 0xffff for correct " +
"function",
recommendation="Use a different switch to ensure " +
"correct function")
})
void processOFGetConfigReply(OFGetConfigReply m) {
if (m.getMissSendLen() == 0xffff) {
log.trace("Config Reply from switch {} confirms "
+ "miss length set to 0xffff",
getSwitchInfoString());
} else {
// FIXME: we can't really deal with switches that don't send
// full packets. Shouldn't we drop the connection here?
// FIXME: count??
log.warn("Config Reply from switch {} has"
+ "miss length set to {}",
getSwitchInfoString(),
m.getMissSendLen());
}
setState(new WaitDescriptionStatReplyState());
}
示例9: processOFMessage
import org.projectfloodlight.openflow.protocol.OFGetConfigReply; //导入依赖的package包/类
/**
* Process an OF message received on the channel and
* update state accordingly.
* 处理从管道接收的OF报文并更新状态
* The main "event" of the state machine. Process the received message,
* send follow up message if required and update state if required.
* 处理接收报文,如果需要发送跟踪报文和更新状态
* Switches on the message type and calls more specific event handlers
* for each individual OF message type. If we receive a message that
* is supposed to be sent from a controller to a switch we throw
* a SwitchStateExeption.
*
* The more specific handlers can also throw SwitchStateExceptions
*
* @param h The OFChannelHandler that received the message
* @param m The message we received.
* @throws SwitchStateException
* @throws IOException
*/
void processOFMessage(OFMessage m) {
roleChanger.checkTimeout();
switch(m.getType()) {
case BARRIER_REPLY:
processOFBarrierReply((OFBarrierReply) m);
break;
case ERROR:
processOFError((OFErrorMsg) m);
break;
case FLOW_REMOVED:
processOFFlowRemoved((OFFlowRemoved) m);
break;
case GET_CONFIG_REPLY:
processOFGetConfigReply((OFGetConfigReply) m);
break;
case PACKET_IN:
processOFPacketIn((OFPacketIn) m);
break;
case PORT_STATUS:
processOFPortStatus((OFPortStatus) m);
break;
case QUEUE_GET_CONFIG_REPLY:
processOFQueueGetConfigReply((OFQueueGetConfigReply) m);
break;
case STATS_REPLY:
processOFStatsReply((OFStatsReply) m);
break;
case ROLE_REPLY:
processOFRoleReply((OFRoleReply) m);
break;
case EXPERIMENTER:
processOFExperimenter((OFExperimenter) m);
break;
default:
illegalMessageReceived(m);
break;
}
}
示例10: processOFGetConfigReply
import org.projectfloodlight.openflow.protocol.OFGetConfigReply; //导入依赖的package包/类
@Override
@LogMessageDocs({
@LogMessageDoc(level = "WARN",
message = "Config Reply from {switch} has " +
"miss length set to {length}",
explanation = "The controller requires that the switch " +
"use a miss length of 0xffff for correct " +
"function",
recommendation = "Use a different switch to ensure " +
"correct function")
})
void processOFGetConfigReply(OFChannelHandler h, OFGetConfigReply m)
throws IOException {
if (m.getMissSendLen() == 0xffff) {
log.trace("Config Reply from switch {} confirms "
+ "miss length set to 0xffff",
h.getSwitchInfoString());
} else {
// FIXME: we can't really deal with switches that don't send
// full packets. Shouldn't we drop the connection here?
log.warn("Config Reply from switch {} has"
+ "miss length set to {}",
h.getSwitchInfoString(),
m.getMissSendLen());
}
h.sendHandshakeDescriptionStatsRequest();
h.setState(WAIT_DESCRIPTION_STAT_REPLY);
}
示例11: processGetConfigRequest
import org.projectfloodlight.openflow.protocol.OFGetConfigReply; //导入依赖的package包/类
@Override
public void processGetConfigRequest(Channel channel, OFMessage msg) {
OFGetConfigReply ofGetConfigReply = FACTORY.buildGetConfigReply()
.setXid(msg.getXid())
.setMissSendLen(missSendLen)
.build();
log.trace("request {}; reply {}", msg, ofGetConfigReply);
channel.writeAndFlush(Collections.singletonList(ofGetConfigReply));
}