Examples of OFStatisticsReply


Examples of org.openflow.protocol.OFStatisticsReply

        this.result = new CopyOnWriteArrayList<OFStatistics>();
    }

    @Override
    protected void handleReply(IOFSwitch sw, OFMessage msg) {
        OFStatisticsReply sr = (OFStatisticsReply) msg;
        synchronized (this.result) {
            this.result.addAll(sr.getStatistics());
            if ((sr.getFlags() & 0x1) == 0) {
                this.finished = true;
            }
        }
    }
View Full Code Here

Examples of org.openflow.protocol.OFStatisticsReply

        tp = new MockThreadPoolService();
    }

    private OFStatisticsReply getStatisticsReply(int transactionId,
                                                   int count, boolean moreReplies) {
        OFStatisticsReply sr = new OFStatisticsReply();
        sr.setXid(transactionId);
        sr.setStatisticType(OFStatisticsType.FLOW);
        List<OFStatistics> statistics = new ArrayList<OFStatistics>();
        for (int i = 0; i < count; ++i) {
            statistics.add(new OFFlowStatisticsReply());
        }
        sr.setStatistics(statistics);
        if (moreReplies)
            sr.setFlags((short) 1);
        return sr;
    }
View Full Code Here

Examples of org.openflow.protocol.OFStatisticsReply

        verify(storageSource);
        verify(storageResultSet);
    }

    private static OFStatisticsReply createDescriptionStatsReply() {
        OFStatisticsReply sr = (OFStatisticsReply)BasicFactory.getInstance()
                .getMessage(OFType.STATS_REPLY);
        sr.setStatisticType(OFStatisticsType.DESC);
        OFDescriptionStatistics desc = new OFDescriptionStatistics();
        desc.setDatapathDescription("Datapath Description");
        desc.setHardwareDescription("Hardware Description");
        desc.setManufacturerDescription("Manufacturer Description");
        desc.setSerialNumber("Serial Number");
        desc.setSoftwareDescription("Software Description");
        sr.setStatistics(Collections.singletonList(desc));
        return sr;
    }
View Full Code Here

Examples of org.openflow.protocol.OFStatisticsReply

        // won't see any calls on the channel.
        resetChannel();
        replay(channel);

        // build the stats reply
        OFStatisticsReply sr = createDescriptionStatsReply();
        OFDescriptionStatistics desc =
                (OFDescriptionStatistics) sr.getFirstStatistics();

        setupMessageEvent(Collections.<OFMessage>singletonList(sr));
        setupMockStorageSource(cfg);

        setupSwitchForInstantiationWithReset(cfg.dpid);
View Full Code Here

Examples of org.openflow.protocol.OFStatisticsReply

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

        // build the stats reply
        OFStatisticsReply sr = createDescriptionStatsReply();
        OFDescriptionStatistics desc =
                (OFDescriptionStatistics) sr.getFirstStatistics();

        setupMessageEvent(Collections.<OFMessage>singletonList(sr));
        setupMockStorageSource(cfg);

        // Start the sub-handshake. Switch will indicate that it's not
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.