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


Java OFPortDescStatsReply类代码示例

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


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

示例1: processOFStatisticsReply

import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply; //导入依赖的package包/类
@Override
void processOFStatisticsReply(OFChannelHandler h, OFStatsReply m)
        throws SwitchStateException {
    // Read port description
    if (m.getStatsType() != OFStatsType.PORT_DESC) {
        log.warn("Expecting port description stats but received stats "
                + "type {} from {}. Ignoring ...", m.getStatsType(),
                h.channel.getRemoteAddress());
        return;
    }
    if (m.getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
        log.warn("Stats reply indicates more stats from sw {} for "
                + "port description - not currently handled",
                h.getSwitchInfoString());
    }
    h.portDescReply = (OFPortDescStatsReply) m; // temp store
    log.info("Received port desc reply for switch at {}",
            h.getSwitchInfoString());
    try {
        h.sendHandshakeSetConfig();
    } catch (IOException e) {
        log.error("Unable to send setConfig after PortDescReply. "
                + "Error: {}", e.getMessage());
    }
    h.setState(WAIT_CONFIG_REPLY);
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:27,代码来源:OFChannelHandler.java

示例2: switchAdded

import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply; //导入依赖的package包/类
@Override
public void switchAdded(Dpid dpid) {
    OpenFlowSwitch sw = controller.getSwitch(dpid);
    OFVersion version = sw.factory().getVersion();
    Integer ofVersion = version.getWireVersion();
    shimController.setSupportedProtocol(ofVersion.byteValue());
    OFFeaturesReply featuresReply = shimController.getFeatureReply(sw);
    controller.setRole(dpid, RoleState.MASTER);
    shimController.sendOpenFlowMessageToCore(featuresReply,featuresReply.getXid(),sw.getId(),0);

    //Create OFPortDescStatsReply for OF_13
    if (sw.factory().getVersion() == OFVersion.OF_13) {
        OFPortDescStatsReply.Builder statsReplyBuilder = sw.factory().buildPortDescStatsReply();
        statsReplyBuilder.setEntries(sw.getPorts())
                .setXid(0);
        OFPortDescStatsReply ofPortStatsReply = statsReplyBuilder.build();
        shimController.sendOpenFlowMessageToCore(ofPortStatsReply,ofPortStatsReply.getXid(),sw.getId(),0);
    }
    log.info("Switch {} connected", dpid);
}
 
开发者ID:fp7-netide,项目名称:Engine,代码行数:21,代码来源:NetIDEDeviceListener.java

示例3: isOChPort

import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply; //导入依赖的package包/类
/**
 * Checks if given port is also part of the regular port desc stats, i.e., is the port a tap port.
 *
 * @param port given port number
 * @return true if the port is a tap (OCh), false otherwise (OMS port)
 */
private boolean isOChPort(long port) {
    for (OFPortDescStatsReply reply : this.ports) {
        for (OFPortDesc p : reply.getEntries()) {
            if (p.getPortNo().getPortNumber() == port) {
                return true;
            }
        }
    }

    return false;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:OfOpticalSwitchImplLinc13.java

示例4: OFChannelHandler

import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply; //导入依赖的package包/类
/**
 * Create a new unconnected OFChannelHandler.
 * @param controller parent controller
 */
OFChannelHandler(Controller controller) {
    this.controller = controller;
    this.state = ChannelState.INIT;
    this.pendingPortStatusMsg = new CopyOnWriteArrayList<OFPortStatus>();
    this.portDescReplies = new ArrayList<OFPortDescStatsReply>();
    factory13 = controller.getOFMessageFactory13();
    factory10 = controller.getOFMessageFactory10();
    duplicateDpidFound = Boolean.FALSE;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:14,代码来源:OFChannelHandler.java

示例5: processOFStatisticsReply

import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply; //导入依赖的package包/类
@Override
void processOFStatisticsReply(OFChannelHandler h, OFStatsReply m)
        throws SwitchStateException {
    // Read port description
    if (m.getStatsType() != OFStatsType.PORT_DESC) {
        log.warn("Expecting port description stats but received stats "
                + "type {} from {}. Ignoring ...", m.getStatsType(),
                h.channel.getRemoteAddress());
        return;
    }
    if (m.getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
        log.debug("Stats reply indicates more stats from sw {} for "
                + "port description",
                h.getSwitchInfoString());
        h.portDescReplies.add((OFPortDescStatsReply)m);
        return;
    }
    else {
        h.portDescReplies.add((OFPortDescStatsReply)m);
    }
    //h.portDescReply = (OFPortDescStatsReply) m; // temp store
    log.info("Received port desc reply for switch at {}",
            h.getSwitchInfoString());
    try {
        h.sendHandshakeSetConfig();
    } catch (IOException e) {
        log.error("Unable to send setConfig after PortDescReply. "
                + "Error: {}", e.getMessage());
    }
    h.setState(WAIT_CONFIG_REPLY);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:32,代码来源:OFChannelHandler.java

示例6: setPortDescStats

import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply; //导入依赖的package包/类
@Override
public void setPortDescStats(OFPortDescStatsReply reply) {
	/* ports are updated via port status message, so we
	 * only fill in ports on initial connection.
	 */
	List<OFPortDesc> OFPortDescs = reply.getEntries();
	portManager.updatePorts(OFPortDescs);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:9,代码来源:OFSwitch.java

示例7: processOFStatsReply

import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply; //导入依赖的package包/类
void processOFStatsReply(OFStatsReply m) {
	switch(m.getStatsType()) {
	case PORT_DESC:
		processPortDescStatsReply((OFPortDescStatsReply) m);
		break;
	default:
		unhandledMessageReceived(m);
	}
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:10,代码来源:OFSwitchHandshakeHandler.java

示例8: getPortDescStatsReply

import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply; //导入依赖的package包/类
OFPortDescStatsReply getPortDescStatsReply() {
    OFPortDesc portDesc = factory.buildPortDesc()
            .setName("Eth1")
            .setPortNo(OFPort.of(1))
            .build();
    return factory.buildPortDescStatsReply()
        .setEntries(ImmutableList.<OFPortDesc>of(portDesc))
        .build();
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:10,代码来源:OFSwitchHandshakeHandlerVer13Test.java

示例9: handleDescStatsAndCreateSwitch

import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply; //导入依赖的package包/类
public void handleDescStatsAndCreateSwitch() throws Exception {
    // build the stats reply
    OFDescStatsReply sr = createDescriptionStatsReply();

    reset(sw);
    SwitchDescription switchDescription = new SwitchDescription(sr);
    setupSwitchForInstantiationWithReset();
    sw.setPortDescStats(anyObject(OFPortDescStatsReply.class));
    expectLastCall().once();
   
    expect(sw.getOFFactory()).andReturn(factory).once();
    replay(sw);

    reset(switchManager);
    expect(switchManager.getHandshakePlugins()).andReturn(plugins).anyTimes();
    expect(
           switchManager.getOFSwitchInstance(anyObject(OFConnection.class),
                                          eq(switchDescription),
                                          anyObject(OFFactory.class),
                                          anyObject(DatapathId.class))).andReturn(sw).once();
    expect(switchManager.getNumRequiredConnections()).andReturn(1).anyTimes(); 
    switchManager.switchAdded(sw);
    expectLastCall().once();
    replay(switchManager);

    // send the description stats reply
    switchHandler.processOFMessage(sr);

    OFMessage msg = connection.retrieveMessage();
    assertThat(msg, CoreMatchers.instanceOf(OFTableFeaturesStatsRequest.class));
    verifyUniqueXids(msg);
    
    verify(sw, switchManager);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:35,代码来源:OFSwitchHandshakeHandlerVer13Test.java

示例10: handleDescStatsAndCreateSwitch

import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply; //导入依赖的package包/类
public void handleDescStatsAndCreateSwitch(boolean switchDriverComplete) throws Exception {
    // build the stats reply
    OFDescStatsReply sr = createDescriptionStatsReply();

    reset(sw);
    SwitchDescription switchDescription = new SwitchDescription(sr);
    setupSwitchForInstantiationWithReset();
    sw.startDriverHandshake();
    expectLastCall().once();
    expect(sw.getOFFactory()).andReturn(factory).once();
    sw.isDriverHandshakeComplete();
    expectLastCall().andReturn(switchDriverComplete).once();

    if(factory.getVersion().compareTo(OFVersion.OF_13) >= 0) {
        sw.setPortDescStats(anyObject(OFPortDescStatsReply.class));
        expectLastCall().once();
    }

    replay(sw);

    reset(switchManager);
    expect(switchManager.getHandshakePlugins()).andReturn(plugins).anyTimes();
    expect(
           switchManager.getOFSwitchInstance(anyObject(OFConnection.class),
                                          eq(switchDescription),
                                          anyObject(OFFactory.class),
                                          anyObject(DatapathId.class))).andReturn(sw).once();
    switchManager.switchAdded(sw);
    expectLastCall().once();
    replay(switchManager);

    // send the description stats reply
    switchHandler.processOFMessage(sr);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:35,代码来源:OFSwitchHandshakeHandlerVer10Test.java

示例11: handleDescStatsAndCreateSwitch

import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply; //导入依赖的package包/类
public void handleDescStatsAndCreateSwitch(boolean subHandShakeComplete) throws Exception {
    // build the stats reply
    OFDescStatsReply sr = createDescriptionStatsReply();

    reset(sw);
    SwitchDescription switchDescription = new SwitchDescription(sr);
    setupSwitchForInstantiationWithReset();
    sw.setPortDescStats(anyObject(OFPortDescStatsReply.class));
    expectLastCall().once();
    sw.startDriverHandshake();
    expectLastCall().once();
    expect(sw.isDriverHandshakeComplete()).andReturn(subHandShakeComplete).once();
    replay(sw);

    reset(switchManager);
    expect(switchManager.getHandshakePlugins()).andReturn(plugins).anyTimes();
    expect(
           switchManager.getOFSwitchInstance(anyObject(OFConnection.class),
                                          eq(switchDescription),
                                          anyObject(OFFactory.class),
                                          anyObject(DatapathId.class))).andReturn(sw).once();
    expect(switchManager.getNumRequiredConnections()).andReturn(1).anyTimes(); 
    switchManager.switchAdded(sw);
    expectLastCall().once();
    replay(switchManager);

    // send the description stats reply
    switchHandler.processOFMessage(sr);

    verify(sw, switchManager);
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:32,代码来源:OFSwitchHandshakeHandlerVer13Test.java

示例12: handleDescStatsAndCreateSwitch

import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply; //导入依赖的package包/类
public void handleDescStatsAndCreateSwitch(boolean switchDriverComplete) throws Exception {
    // build the stats reply
    OFDescStatsReply sr = createDescriptionStatsReply();

    reset(sw);
    SwitchDescription switchDescription = new SwitchDescription(sr);
    setupSwitchForInstantiationWithReset();
    sw.startDriverHandshake();
    expectLastCall().once();
    sw.isDriverHandshakeComplete();
    expectLastCall().andReturn(switchDriverComplete).once();

    if(factory.getVersion().compareTo(OFVersion.OF_13) >= 0) {
        sw.setPortDescStats(anyObject(OFPortDescStatsReply.class));
        expectLastCall().once();
    }

    replay(sw);

    reset(switchManager);
    expect(switchManager.getHandshakePlugins()).andReturn(plugins).anyTimes();
    expect(
           switchManager.getOFSwitchInstance(anyObject(OFConnection.class),
                                          eq(switchDescription),
                                          anyObject(OFFactory.class),
                                          anyObject(DatapathId.class))).andReturn(sw).once();
    switchManager.switchAdded(sw);
    expectLastCall().once();
    replay(switchManager);

    // send the description stats reply
    switchHandler.processOFMessage(sr);
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:34,代码来源:OFSwitchHandshakeHandlerVer10Test.java


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