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


Java OFStatsReply.getStatsType方法代码示例

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


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

示例1: processOFMultipartReply

import org.projectfloodlight.openflow.protocol.OFStatsReply; //导入方法依赖的package包/类
private void processOFMultipartReply(OFStatsReply stats) {
    log.debug("Received message {} during switch-driver " +
               "subhandshake " + "from switch {} ... " +
               stats,
               getStringId());

     if (stats.getStatsType() == OFStatsType.EXPERIMENTER) {
         try {
           OFExpPortDescReply expPortDescReply =  (OFExpPortDescReply) stats;
           expPortDes.addAll(expPortDescReply.getEntries());
           if (!expPortDescReply.getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
               driverHandshakeComplete.set(true);
               return;
           }
          } catch (ClassCastException e) {
              log.error("Unexspected Experimenter Multipart message type {} ",
                      stats.getClass().getName());
        }
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:OFOpticalSwitch13.java

示例2: processOFStatsReply

import org.projectfloodlight.openflow.protocol.OFStatsReply; //导入方法依赖的package包/类
@Override
/**
 * Accumulate a list of the OFTableFeaturesStatsReply's until there 
 * are no more remaining. Then, pass the list to the switch for 
 * parsing and configuration.
 * 
 * The assumption is that the OFMessage dispatcher will call this each
 * time, which it does. We don't loop and receive here.
 * 
 * @param m, The potential OFTableFeaturesStatsReply message we want to include
 */
void processOFStatsReply(OFStatsReply m) {
	if (m.getStatsType() == OFStatsType.TABLE_FEATURES) {
		replies.add((OFTableFeaturesStatsReply) m);
		if (!((OFTableFeaturesStatsReply)m).getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
			handleTableFeaturesMessage(replies, false);
			nextState();
		} 
	} else {
		/* should only receive TABLE_FEATURES here */
		log.error("Received {} message but expected TABLE_FEATURES.", m.getStatsType().toString());
	}

}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:25,代码来源:OFSwitchHandshakeHandler.java

示例3: processOFStatsReply

import org.projectfloodlight.openflow.protocol.OFStatsReply; //导入方法依赖的package包/类
@Override
/**
 * Accumulate a list of the OFTableFeaturesStatsReply's until there
 * are no more remaining. Then, pass the list to the switch for
 * parsing and configuration.
 *
 * The assumption is that the OFMessage dispatcher will call this each
 * time, which it does. We don't loop and receive here.
 *
 * @param m, The potential OFTableFeaturesStatsReply message we want to include
 */
void processOFStatsReply(OFStatsReply m) {
	if (m.getStatsType() == OFStatsType.TABLE_FEATURES) {
		replies.add((OFTableFeaturesStatsReply) m);
		if (!((OFTableFeaturesStatsReply)m).getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
			handleTableFeaturesMessage(replies, false);
			nextState();
		}
	} else {
		/* should only receive TABLE_FEATURES here */
		log.error("Received {} message but expected TABLE_FEATURES.", m.getStatsType().toString());
	}

}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:25,代码来源:OFSwitchHandshakeHandler.java

示例4: processOFStatisticsReply

import org.projectfloodlight.openflow.protocol.OFStatsReply; //导入方法依赖的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

示例5: processOFStatsReply

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

示例6: processDriverHandshakeMessage

import org.projectfloodlight.openflow.protocol.OFStatsReply; //导入方法依赖的package包/类
@Override
public void processDriverHandshakeMessage(OFMessage m) {

    if (!startDriverHandshakeCalled) {
        throw new SwitchDriverSubHandshakeNotStarted();
    }

    if (driverHandshakeComplete.get()) {
        throw new SwitchDriverSubHandshakeCompleted(m);
    }

    switch (m.getType()) {
        case BARRIER_REPLY:
            log.debug("OPLK ROADM Received barrier response");
            break;
        case ERROR:
            log.error("Switch {} Error {}", getStringId(), m);
            break;
        case FEATURES_REPLY:
            break;
        case FLOW_REMOVED:
            break;
        case GET_ASYNC_REPLY:
            break;
        case PACKET_IN:
            break;
        case PORT_STATUS:
            processOFPortStatus((OFCircuitPortStatus) m);
            break;
        case QUEUE_GET_CONFIG_REPLY:
            break;
        case ROLE_REPLY:
            break;
        case STATS_REPLY:
            OFStatsReply stats = (OFStatsReply) m;
            if (stats.getStatsType() == OFStatsType.EXPERIMENTER) {
                log.warn("OPLK ROADM : Received multipart (port desc) reply message {}", m);
                //OTN Optical extension 1.0 port-desc
                createOpticalPortList((OFCircuitPortsReply) m);
                driverHandshakeComplete.set(true);
            }
            break;
        default:
            log.warn("Received message {} during switch-driver " +
                             "subhandshake " + "from switch {} ... " +
                             "Ignoring message", m,
                     getStringId());

    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:51,代码来源:OplinkRoadmHandshaker.java

示例7: processDriverHandshakeMessage

import org.projectfloodlight.openflow.protocol.OFStatsReply; //导入方法依赖的package包/类
@Override
public void processDriverHandshakeMessage(OFMessage m) {
    if (!startDriverHandshakeCalled) {
        throw new SwitchDriverSubHandshakeNotStarted();
    }
    if (driverHandshakeComplete.get()) {
        throw new SwitchDriverSubHandshakeCompleted(m);
    }

    switch (m.getType()) {
        case BARRIER_REPLY:
            if (m.getXid() == barrierXidToWaitFor) {
                log.debug("LINC-OE Received barrier response");
            }
            break;
        case ERROR:
            log.error("Switch {} Error {}", getStringId(), m);
            break;
        case FEATURES_REPLY:
            break;
        case FLOW_REMOVED:
            break;
        case GET_ASYNC_REPLY:
            break;
        case PACKET_IN:
            break;
        case PORT_STATUS:
            log.warn("****LINC-OE Port Status {} {}", getStringId(), m);
            processOFPortStatus((OFCircuitPortStatus) m);
            break;
        case QUEUE_GET_CONFIG_REPLY:
            break;
        case ROLE_REPLY:
            break;
        case STATS_REPLY:
            OFStatsReply stats = (OFStatsReply) m;
            if (stats.getStatsType() == OFStatsType.EXPERIMENTER) {
                log.warn("LINC-OE : Received stats reply message {}", m);
                createOpticalPortList((OFCircuitPortsReply) m);
                driverHandshakeComplete.set(true);
            }
            break;
        default:
            log.warn("Received message {} during switch-driver " +
                             "subhandshake " + "from switch {} ... " +
                             "Ignoring message", m,
                     getStringId());

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


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