Package org.openflow.protocol.statistics

Examples of org.openflow.protocol.statistics.OFFlowStatisticsRequest


        // Statistics request object for getting flows
        OFStatisticsRequest req = new OFStatisticsRequest();
        req.setStatisticType(OFStatisticsType.FLOW);
        int requestLength = req.getLengthU();
        OFFlowStatisticsRequest specificReq = new OFFlowStatisticsRequest();
        specificReq.setMatch(new OFMatch().setWildcards(0xffffffff));
        specificReq.setOutPort(outPort);
        specificReq.setTableId((byte) 0xff);
        req.setStatistics(Collections.singletonList((OFStatistics) specificReq));
        requestLength += specificReq.getLength();
        req.setLengthU(requestLength);

        try {
            // System.out.println(sw.getStatistics(req));
            future = sw.queryStatistics(req);
View Full Code Here


        if (sw != null) {
            OFStatisticsRequest req = new OFStatisticsRequest();
            req.setStatisticType(statType);
            int requestLength = req.getLengthU();
            if (statType == OFStatisticsType.FLOW) {
                OFFlowStatisticsRequest specificReq = new OFFlowStatisticsRequest();
                OFMatch match = new OFMatch();
                match.setWildcards(0xffffffff);
                specificReq.setMatch(match);
                specificReq.setOutPort(OFPort.OFPP_NONE.getValue());
                specificReq.setTableId((byte) 0xff);
                req.setStatistics(Collections.singletonList((OFStatistics)specificReq));
                requestLength += specificReq.getLength();
            } else if (statType == OFStatisticsType.AGGREGATE) {
                OFAggregateStatisticsRequest specificReq = new OFAggregateStatisticsRequest();
                OFMatch match = new OFMatch();
                match.setWildcards(0xffffffff);
                specificReq.setMatch(match);
                specificReq.setOutPort(OFPort.OFPP_NONE.getValue());
                specificReq.setTableId((byte) 0xff);
                req.setStatistics(Collections.singletonList((OFStatistics)specificReq));
                requestLength += specificReq.getLength();
            } else if (statType == OFStatisticsType.PORT) {
                OFPortStatisticsRequest specificReq = new OFPortStatisticsRequest();
                specificReq.setPortNumber(OFPort.OFPP_NONE.getValue());
                req.setStatistics(Collections.singletonList((OFStatistics)specificReq));
                requestLength += specificReq.getLength();
            } else if (statType == OFStatisticsType.QUEUE) {
                OFQueueStatisticsRequest specificReq = new OFQueueStatisticsRequest();
                specificReq.setPortNumber(OFPort.OFPP_ALL.getValue());
                // LOOK! openflowj does not define OFPQ_ALL! pulled this from openflow.h
                // note that I haven't seen this work yet though...
                specificReq.setQueueId(0xffffffff);
                req.setStatistics(Collections.singletonList((OFStatistics)specificReq));
                requestLength += specificReq.getLength();
            } else if (statType == OFStatisticsType.DESC ||
                       statType == OFStatisticsType.TABLE) {
                // pass - nothing todo besides set the type above
            }
            req.setLengthU(requestLength);
View Full Code Here

        // The STATS_REQUEST object used when querying the switches for flows
        OFStatisticsRequest req = new OFStatisticsRequest();
        req.setStatisticType(OFStatisticsType.FLOW);
        int requestLength = req.getLengthU();
        OFFlowStatisticsRequest specificReq = new OFFlowStatisticsRequest();
        specificReq.setMatch(new OFMatch().setWildcards(0xffffffff));
        specificReq.setOutPort((short) 3);
        specificReq.setTableId((byte) 0xff);
        req.setStatistics(Collections.singletonList((OFStatistics) specificReq));
        requestLength += specificReq.getLength();
        req.setLengthU(requestLength);

        // Actions for the STATS_REPLY object
        OFActionOutput action = new OFActionOutput((short) 3, (short) 0xffff);
        List<OFAction> actions = new ArrayList<OFAction>();
View Full Code Here

      throws NoSwitchException, IOException, InterruptedException,
      ExecutionException, TimeoutException {
    IOFSwitch iofSwitch = this.openFlowSwitch;
    Future<List<OFStatistics>> future;
    OFStatisticsRequest req = new OFStatisticsRequest();
    OFFlowStatisticsRequest fsr = new OFFlowStatisticsRequest();
    OFMatch match = new OFMatch();
    match.setWildcards(0xffffffff);
    fsr.setMatch(match);
    fsr.setOutPort(OFPort.OFPP_NONE.getValue());
    fsr.setTableId((byte) 0xff);
    req.setStatisticType(OFStatisticsType.FLOW);
    req.setStatistics(Collections.singletonList((OFStatistics) fsr));
    req.setLengthU(req.getLengthU() + fsr.getLength());

    if (iofSwitch == null) {
      throw new NoSwitchException();

    }
View Full Code Here

    IOFSwitch iofSwitch = this.openFlowSwitch;
    if(iofSwitch == null){
      throw new NoSwitchException(HexString.toHexString(this.datapathId));
    }
    OFStatisticsRequest req = new OFStatisticsRequest();
    OFFlowStatisticsRequest fsr = new OFFlowStatisticsRequest();
    OFMatch match = new OFMatch();
    match.setWildcards(0xffffffff);
    fsr.setMatch(match);
    fsr.setOutPort(OFPort.OFPP_NONE.getValue());
    fsr.setTableId((byte) 0xff);
    req.setStatisticType(OFStatisticsType.FLOW);
    req.setStatistics(Collections.singletonList((OFStatistics) fsr));
    req.setLengthU(req.getLengthU() + fsr.getLength());

 
      future = iofSwitch.getStatistics(req);
      List<OFStatistics> futureValues = null;
View Full Code Here

TOP

Related Classes of org.openflow.protocol.statistics.OFFlowStatisticsRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.