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


Java OFSetConfig类代码示例

本文整理汇总了Java中org.projectfloodlight.openflow.protocol.OFSetConfig的典型用法代码示例。如果您正苦于以下问题:Java OFSetConfig类的具体用法?Java OFSetConfig怎么用?Java OFSetConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OFSetConfig类属于org.projectfloodlight.openflow.protocol包,在下文中一共展示了OFSetConfig类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sendHandshakeSetConfig

import org.projectfloodlight.openflow.protocol.OFSetConfig; //导入依赖的package包/类
/**
 * Send the configuration requests to tell the switch we want full
 * packets
 * @throws IOException
 */
private void sendHandshakeSetConfig() {
	// Ensure we receive the full packet via PacketIn
	// FIXME: We don't set the reassembly flags.
	OFSetConfig configSet = factory.buildSetConfig()
			.setXid(handshakeTransactionIds--)
			.setMissSendLen(0xffff)
			.build();

	// Barrier
	OFBarrierRequest barrier = factory.buildBarrierRequest()
			.setXid(handshakeTransactionIds--)
			.build();

	// Verify (need barrier?)
	OFGetConfigRequest configReq = factory.buildGetConfigRequest()
			.setXid(handshakeTransactionIds--)
			.build();
	List<OFMessage> msgList = ImmutableList.<OFMessage>of(configSet, barrier, configReq);
	mainConnection.write(msgList);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:26,代码来源:OFSwitchHandshakeHandler.java

示例2: moveToWaitConfigReply

import org.projectfloodlight.openflow.protocol.OFSetConfig; //导入依赖的package包/类
/** Move the channel from scratch to WAIT_CONFIG_REPLY state
 * adds testing for beginHandshake() which moves the state from
 * InitState to WaitConfigReply.
 */
@Test
public void moveToWaitConfigReply() throws Exception {
	moveToPreConfigReply();

	List<OFMessage> msgs = connection.getMessages();
	assertEquals(3, msgs.size());
	assertEquals(OFType.SET_CONFIG, msgs.get(0).getType());
	OFSetConfig sc = (OFSetConfig)msgs.get(0);
	assertEquals(0xffff, sc.getMissSendLen());
	assertEquals(OFType.BARRIER_REQUEST, msgs.get(1).getType());
	assertEquals(OFType.GET_CONFIG_REQUEST, msgs.get(2).getType());
	verifyUniqueXids(msgs);
	msgs.clear();
	assertThat(switchHandler.getStateForTesting(), CoreMatchers.instanceOf(OFSwitchHandshakeHandler.WaitConfigReplyState.class));
	verifyAll();
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:21,代码来源:OFSwitchHandlerTestBase.java

示例3: moveToWaitConfigReply

import org.projectfloodlight.openflow.protocol.OFSetConfig; //导入依赖的package包/类
/** Move the channel from scratch to WAIT_CONFIG_REPLY state
 * adds testing for beginHandshake() which moves the state from
 * InitState to WaitConfigReply.
 */
@Test
public void moveToWaitConfigReply() throws Exception {
    moveToPreConfigReply();

    List<OFMessage> msgs = connection.getMessages();
    assertEquals(3, msgs.size());
    assertEquals(OFType.SET_CONFIG, msgs.get(0).getType());
    OFSetConfig sc = (OFSetConfig)msgs.get(0);
    assertEquals(0xffff, sc.getMissSendLen());
    assertEquals(OFType.BARRIER_REQUEST, msgs.get(1).getType());
    assertEquals(OFType.GET_CONFIG_REQUEST, msgs.get(2).getType());
    verifyUniqueXids(msgs);
    msgs.clear();
    assertThat(switchHandler.getStateForTesting(), CoreMatchers.instanceOf(OFSwitchHandshakeHandler.WaitConfigReplyState.class));
    verifyAll();
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:21,代码来源:OFSwitchHandlerTestBase.java

示例4: moveToWaitConfigReply

import org.projectfloodlight.openflow.protocol.OFSetConfig; //导入依赖的package包/类
/**
 * Move the channel from scratch to WAIT_CONFIG_REPLY state
 * Builds on moveToWaitFeaturesReply
 * adds testing for WAIT_FEATURES_REPLY state
 */
@Test
public void moveToWaitConfigReply() throws Exception {
    moveToWaitFeaturesReply();

    resetChannel();
    channel.write(capture(writeCapture));
    expectLastCall().andReturn(null).atLeastOnce();
    replay(channel);

    sendMessageToHandlerWithControllerReset(Collections.<OFMessage>singletonList(featuresReply));
    List<OFMessage> msgs = getMessagesFromCapture();
    assertEquals(3, msgs.size());
    assertEquals(OFType.SET_CONFIG, msgs.get(0).getType());
    OFSetConfig sc = (OFSetConfig)msgs.get(0);
    assertEquals((short)0xffff, sc.getMissSendLen());
    assertEquals(OFType.BARRIER_REQUEST, msgs.get(1).getType());
    assertEquals(OFType.GET_CONFIG_REQUEST, msgs.get(2).getType());
    verifyUniqueXids(msgs);
    assertEquals(OFChannelHandler.ChannelState.WAIT_CONFIG_REPLY,
            handler.getStateForTesting());
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:27,代码来源:OFChannelHandlerTest.java

示例5: sendHandshakeSetConfig

import org.projectfloodlight.openflow.protocol.OFSetConfig; //导入依赖的package包/类
/**
    * Send the configuration requests to tell the switch we want full
    * packets.
    * @throws IOException
    */
   private void sendHandshakeSetConfig() throws IOException {
       OFFactory factory = (ofVersion == OFVersion.OF_13) ? factory13 : factory10;
       //log.debug("Sending CONFIG_REQUEST to {}", channel.getRemoteAddress());
       List<OFMessage> msglist = new ArrayList<OFMessage>(3);

       // Ensure we receive the full packet via PacketIn
       // FIXME: We don't set the reassembly flags.
// Only send config to switches to send full packets, if they have a buffer.
       // Saves a packet & OFSetConfig can't be handled by certain switches.
       if(this.featuresReply.getNBuffers() > 0) {
           OFSetConfig sc = factory
                   .buildSetConfig()
                   .setMissSendLen((short) 0xffff)
                   .setXid(this.handshakeTransactionIds--)
                   .build();
           msglist.add(sc);
       }

       // Barrier
       OFBarrierRequest br = factory
               .buildBarrierRequest()
               .setXid(this.handshakeTransactionIds--)
               .build();
       msglist.add(br);

       // Verify (need barrier?)
       OFGetConfigRequest gcr = factory
               .buildGetConfigRequest()
               .setXid(this.handshakeTransactionIds--)
               .build();
       msglist.add(gcr);
       channel.write(msglist);
   }
 
开发者ID:shlee89,项目名称:athena,代码行数:39,代码来源:OFChannelHandler.java

示例6: sendHandshakeSetConfig

import org.projectfloodlight.openflow.protocol.OFSetConfig; //导入依赖的package包/类
/**
 * Send the configuration requests to tell the switch we want full
 * packets.
 * @throws IOException
 */
private void sendHandshakeSetConfig() throws IOException {
    OFFactory factory = (ofVersion == OFVersion.OF_13) ? factory13 : factory10;
    //log.debug("Sending CONFIG_REQUEST to {}", channel.getRemoteAddress());
    List<OFMessage> msglist = new ArrayList<OFMessage>(3);

    // Ensure we receive the full packet via PacketIn
    // FIXME: We don't set the reassembly flags.
    OFSetConfig sc = factory
            .buildSetConfig()
            .setMissSendLen((short) 0xffff)
            .setXid(this.handshakeTransactionIds--)
            .build();
    msglist.add(sc);

    // Barrier
    OFBarrierRequest br = factory
            .buildBarrierRequest()
            .setXid(this.handshakeTransactionIds--)
            .build();
    msglist.add(br);

    // Verify (need barrier?)
    OFGetConfigRequest gcr = factory
            .buildGetConfigRequest()
            .setXid(this.handshakeTransactionIds--)
            .build();
    msglist.add(gcr);
    channel.write(msglist);
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:35,代码来源:OFChannelHandler.java

示例7: sendHandshakeSetConfig

import org.projectfloodlight.openflow.protocol.OFSetConfig; //导入依赖的package包/类
/**
 * Send the configuration requests to tell the switch we want full packets
 *
 * @throws IOException
 */
private void sendHandshakeSetConfig() throws IOException {
    OFFactory factory = (ofVersion == OFVersion.OF_13) ? factory13 : factory10;
    // log.debug("Sending CONFIG_REQUEST to {}",
    // channel.getRemoteAddress());
    List<OFMessage> msglist = new ArrayList<OFMessage>(3);

    // Ensure we receive the full packet via PacketIn
    // FIXME: We don't set the reassembly flags.
    OFSetConfig sc = factory
            .buildSetConfig()
            .setMissSendLen((short) 0xffff)
            .setXid(this.handshakeTransactionIds--)
            .build();
    msglist.add(sc);

    // Barrier
    OFBarrierRequest br = factory
            .buildBarrierRequest()
            .setXid(this.handshakeTransactionIds--)
            .build();
    msglist.add(br);

    // Verify (need barrier?)
    OFGetConfigRequest gcr = factory
            .buildGetConfigRequest()
            .setXid(this.handshakeTransactionIds--)
            .build();
    msglist.add(gcr);
    channel.write(msglist);
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:36,代码来源:OFChannelHandler.java

示例8: sendHandshakeSetConfig

import org.projectfloodlight.openflow.protocol.OFSetConfig; //导入依赖的package包/类
/**
 * Send the configuration requests to tell the switch we want full
 * packets.
 * @throws IOException
 */
private void sendHandshakeSetConfig() throws IOException {
    log.debug("Sending CONFIG_REQUEST to {}", channel.remoteAddress());
    List<OFMessage> msglist = new ArrayList<>(3);

    // Ensure we receive the full packet via PacketIn
    // FIXME: We don't set the reassembly flags.
    // Only send config to switches to send full packets, if they have a buffer.
    // Saves a packet & OFSetConfig can't be handled by certain switches.
    if (this.featuresReply.getNBuffers() > 0) {
        OFSetConfig sc = factory
                .buildSetConfig()
                .setMissSendLen((short) 0xffff)
                .setXid(this.handshakeTransactionIds--)
                .build();
        msglist.add(sc);
    }

    // Barrier
    OFBarrierRequest br = factory
            .buildBarrierRequest()
            .setXid(this.handshakeTransactionIds--)
            .build();
    msglist.add(br);

    // Verify (need barrier?)
    OFGetConfigRequest gcr = factory
            .buildGetConfigRequest()
            .setXid(this.handshakeTransactionIds--)
            .build();
    msglist.add(gcr);
    channel.writeAndFlush(msglist);
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:38,代码来源:OFChannelHandler.java

示例9: processSetConfigMessage

import org.projectfloodlight.openflow.protocol.OFSetConfig; //导入依赖的package包/类
@Override
public void processSetConfigMessage(Channel channel, OFMessage msg) {
    OFSetConfig ofSetConfig = (OFSetConfig) msg;
    if (missSendLen != ofSetConfig.getMissSendLen()) {
        log.trace("Changing missSendLen from {} to {}.",
                  missSendLen, ofSetConfig.getMissSendLen());
        missSendLen = ofSetConfig.getMissSendLen();
    }

    // SetConfig message is not acknowledged
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:12,代码来源:DefaultOFSwitch.java


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