本文整理汇总了Java中org.projectfloodlight.openflow.protocol.OFQueueGetConfigReply类的典型用法代码示例。如果您正苦于以下问题:Java OFQueueGetConfigReply类的具体用法?Java OFQueueGetConfigReply怎么用?Java OFQueueGetConfigReply使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OFQueueGetConfigReply类属于org.projectfloodlight.openflow.protocol包,在下文中一共展示了OFQueueGetConfigReply类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processOFMessage
import org.projectfloodlight.openflow.protocol.OFQueueGetConfigReply; //导入依赖的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;
}
}
示例2: createQueueMap
import org.projectfloodlight.openflow.protocol.OFQueueGetConfigReply; //导入依赖的package包/类
/**
* Create a map of queues to switches, with each queue grouped by port number.
* @param queueBandwidthMap
* @param switchMap
* @param switchPortMap
* @return HashMap<IOFSwitch, HashMap<Integer, ArrayList<FlowQueue>>>, ArrayList<FlowQueue> per port number per switch
*/
public HashMap<IOFSwitch, HashMap<Integer, ArrayList<FlowQueue>>> createQueueMap(HashMap<Long, Long> queueBandwidthMap,
Map<DatapathId, IOFSwitch> switchMap, HashMap<IOFSwitch,
ArrayList<OFPortDesc>> switchPortMap){
HashMap<IOFSwitch, HashMap<Integer, ArrayList<FlowQueue>>> queueMap = new HashMap<IOFSwitch, HashMap<Integer, ArrayList<FlowQueue>>>();
for(IOFSwitch thisSwitch : switchMap.values()){
HashMap<Integer, ArrayList<FlowQueue>> portQueueMap = new HashMap<Integer, ArrayList<FlowQueue>>();
for(OFPortDesc portDesc : switchPortMap.get(thisSwitch)){
ArrayList<FlowQueue> queuesThisPort = new ArrayList<FlowQueue>();
OFQueueGetConfigRequest cr = arscheduler.of13Factory.buildQueueGetConfigRequest().setPort(portDesc.getPortNo()).build(); // Get all queues on all ports
ListenableFuture<OFQueueGetConfigReply> future = thisSwitch.writeRequest(cr); // Send request to switch 1
try {
// Wait up to 10s for a reply; return when received; else exception thrown
OFQueueGetConfigReply reply = future.get(10, TimeUnit.SECONDS);
// Iterate over all queues
for (OFPacketQueue q : reply.getQueues()) {
///queues.add(q);
if(q.getQueueId() == 0)
continue;
FlowQueue newQueue = new FlowQueue(portDesc.getPortNo().getPortNumber(), q.getQueueId(),
queueBandwidthMap.get(Long.valueOf(q.getQueueId())));
queuesThisPort.add(newQueue);
}
int portNum = portDesc.getPortNo().getPortNumber();
portQueueMap.put(Integer.valueOf(portNum), queuesThisPort);
} catch (InterruptedException | ExecutionException | TimeoutException e) {
e.printStackTrace();
}
}
queueMap.put(thisSwitch, portQueueMap);
}
return queueMap;
}
示例3: processOFMessage
import org.projectfloodlight.openflow.protocol.OFQueueGetConfigReply; //导入依赖的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;
}
}
示例4: processOFQueueGetConfigReply
import org.projectfloodlight.openflow.protocol.OFQueueGetConfigReply; //导入依赖的package包/类
void processOFQueueGetConfigReply(OFChannelHandler h,
OFQueueGetConfigReply m)
throws IOException {
unhandledMessageReceived(h, m);
}
示例5: processOFQueueGetConfigReply
import org.projectfloodlight.openflow.protocol.OFQueueGetConfigReply; //导入依赖的package包/类
void processOFQueueGetConfigReply(OFQueueGetConfigReply m) {
unhandledMessageReceived(m);
}
示例6: testMessageDispatchComplete
import org.projectfloodlight.openflow.protocol.OFQueueGetConfigReply; //导入依赖的package包/类
/**
* Test dispatch of messages while in Complete state
*/
@Test
public void testMessageDispatchComplete() throws Exception {
moveToComplete();
newConnection.getValue().setListener(connectionListener);
resetChannel();
expect(channel.writeAndFlush(capture(writeCapture))).andReturn(null).once();
replay(channel);
// Send echo request. expect reply
OFMessage echoRequest = factory.buildEchoRequest().build();
sendMessageToHandlerWithControllerReset(ImmutableList.<OFMessage>of(echoRequest));
List<OFMessage> msgs = getMessagesFromCapture();
assertEquals(1, msgs.size());
assertEquals(OFType.ECHO_REPLY, msgs.get(0).getType());
// Send barrier reply. expect dispatch
OFBarrierReply barrierReply = factory.buildBarrierReply()
.build();
resetAndExpectConnectionListener(barrierReply);
// Send packet in. expect dispatch
OFFlowRemoved flowRemoved = factory.buildFlowRemoved()
.build();
resetAndExpectConnectionListener(flowRemoved);
// Send get config reply. expect dispatch
OFGetConfigReply getConfigReply = factory.buildGetConfigReply()
.build();
resetAndExpectConnectionListener(getConfigReply);
// Send packet in. expect dispatch
OFPacketIn pi = factory.buildPacketIn()
.setReason(OFPacketInReason.NO_MATCH)
.build();
resetAndExpectConnectionListener(pi);
// Send port status. expect dispatch
OFPortStatus portStatus = factory.buildPortStatus()
.setReason(OFPortReason.DELETE)
.setDesc(portDesc)
.build();
resetAndExpectConnectionListener(portStatus);
// Send queue reply. expect dispatch
OFQueueGetConfigReply queueReply = factory.buildQueueGetConfigReply()
.build();
resetAndExpectConnectionListener(queueReply);
// Send stat reply. expect dispatch
OFFlowStatsReply statReply = factory.buildFlowStatsReply()
.build();
resetAndExpectConnectionListener(statReply);
// Send role reply. expect dispatch
OFRoleReply roleReply = factory.buildRoleReply()
.setRole(OFControllerRole.ROLE_MASTER)
.build();
resetAndExpectConnectionListener(roleReply);
// Send experimenter. expect dispatch
OFBsnSetAuxCxnsReply auxReply = factory.buildBsnSetAuxCxnsReply()
.build();
resetAndExpectConnectionListener(auxReply);
}
示例7: testMessageDispatchComplete
import org.projectfloodlight.openflow.protocol.OFQueueGetConfigReply; //导入依赖的package包/类
/**
* Test dispatch of messages while in Complete state
*/
@Test
public void testMessageDispatchComplete() throws Exception {
moveToComplete();
newConnection.getValue().setListener(connectionListener);
resetChannel();
expect(channel.writeAndFlush(capture(writeCapture))).andReturn(null).atLeastOnce();
replay(channel);
// Send echo request. expect reply
OFMessage echoRequest = factory.buildEchoRequest().build();
sendMessageToHandlerWithControllerReset(ImmutableList.<OFMessage>of(echoRequest));
List<OFMessage> msgs = getMessagesFromCapture();
assertEquals(1, msgs.size());
assertEquals(OFType.ECHO_REPLY, msgs.get(0).getType());
// Send barrier reply. expect dispatch
OFBarrierReply barrierReply = factory.buildBarrierReply()
.build();
resetAndExpectConnectionListener(barrierReply);
// Send packet in. expect dispatch
OFFlowRemoved flowRemoved = factory.buildFlowRemoved()
.build();
resetAndExpectConnectionListener(flowRemoved);
// Send get config reply. expect dispatch
OFGetConfigReply getConfigReply = factory.buildGetConfigReply()
.build();
resetAndExpectConnectionListener(getConfigReply);
// Send packet in. expect dispatch
OFPacketIn pi = factory.buildPacketIn()
.setReason(OFPacketInReason.NO_MATCH)
.build();
resetAndExpectConnectionListener(pi);
// Send port status. expect dispatch
OFPortStatus portStatus = factory.buildPortStatus()
.setReason(OFPortReason.DELETE)
.setDesc(portDesc)
.build();
resetAndExpectConnectionListener(portStatus);
// Send queue reply. expect dispatch
OFQueueGetConfigReply queueReply = factory.buildQueueGetConfigReply()
.build();
resetAndExpectConnectionListener(queueReply);
// Send stat reply. expect dispatch
OFFlowStatsReply statReply = factory.buildFlowStatsReply()
.build();
resetAndExpectConnectionListener(statReply);
// Send role reply. expect dispatch
OFNiciraControllerRoleReply roleReply = factory.buildNiciraControllerRoleReply()
.setRole(OFNiciraControllerRole.ROLE_MASTER)
.build();
resetAndExpectConnectionListener(roleReply);
}
示例8: testMessageDispatchComplete
import org.projectfloodlight.openflow.protocol.OFQueueGetConfigReply; //导入依赖的package包/类
/**
* Test dispatch of messages while in Complete state
*/
@Test
public void testMessageDispatchComplete() throws Exception {
moveToComplete();
newConnection.getValue().setListener(connectionListener);
resetChannel();
channel.write(capture(writeCapture));
expectLastCall().andReturn(null).atLeastOnce();
replay(channel);
// Send echo request. expect reply
OFMessage echoRequest = factory.buildEchoRequest().build();
sendMessageToHandlerWithControllerReset(ImmutableList.<OFMessage>of(echoRequest));
List<OFMessage> msgs = getMessagesFromCapture();
assertEquals(1, msgs.size());
assertEquals(OFType.ECHO_REPLY, msgs.get(0).getType());
// Send barrier reply. expect dispatch
OFBarrierReply barrierReply = factory.buildBarrierReply()
.build();
resetAndExpectConnectionListener(barrierReply);
// Send packet in. expect dispatch
OFFlowRemoved flowRemoved = factory.buildFlowRemoved()
.build();
resetAndExpectConnectionListener(flowRemoved);
// Send get config reply. expect dispatch
OFGetConfigReply getConfigReply = factory.buildGetConfigReply()
.build();
resetAndExpectConnectionListener(getConfigReply);
// Send packet in. expect dispatch
OFPacketIn pi = factory.buildPacketIn()
.setReason(OFPacketInReason.NO_MATCH)
.build();
resetAndExpectConnectionListener(pi);
// Send port status. expect dispatch
OFPortStatus portStatus = factory.buildPortStatus()
.setReason(OFPortReason.DELETE)
.setDesc(portDesc)
.build();
resetAndExpectConnectionListener(portStatus);
// Send queue reply. expect dispatch
OFQueueGetConfigReply queueReply = factory.buildQueueGetConfigReply()
.build();
resetAndExpectConnectionListener(queueReply);
// Send stat reply. expect dispatch
OFFlowStatsReply statReply = factory.buildFlowStatsReply()
.build();
resetAndExpectConnectionListener(statReply);
// Send role reply. expect dispatch
OFNiciraControllerRoleReply roleReply = factory.buildNiciraControllerRoleReply()
.setRole(OFNiciraControllerRole.ROLE_MASTER)
.build();
resetAndExpectConnectionListener(roleReply);
}
示例9: processOFMessage
import org.projectfloodlight.openflow.protocol.OFQueueGetConfigReply; //导入依赖的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;
case ROLE_STATUS:
processOFRoleStatus((OFRoleStatus) m);
break;
default:
illegalMessageReceived(m);
break;
}
}