当前位置: 首页>>代码示例>>Java>>正文


Java OFGetConfigReply类代码示例

本文整理汇总了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);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:19,代码来源:OFChannelHandler.java

示例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());
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:18,代码来源:OFSwitchHandshakeHandler.java

示例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));
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:23,代码来源:OFSwitchHandlerTestBase.java

示例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));
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:23,代码来源:OFSwitchHandlerTestBase.java

示例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());
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:27,代码来源:OFChannelHandlerTest.java

示例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);
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:19,代码来源:OFChannelHandler.java

示例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;
	}
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:58,代码来源:OFSwitchHandshakeHandler.java

示例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());
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:28,代码来源:OFSwitchHandshakeHandler.java

示例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;
	}
}
 
开发者ID:DaiDongLiang,项目名称:DSC,代码行数:58,代码来源:OFSwitchHandshakeHandler.java

示例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);
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:29,代码来源:OFChannelHandler.java

示例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));
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:10,代码来源:DefaultOFSwitch.java


注:本文中的org.projectfloodlight.openflow.protocol.OFGetConfigReply类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。