Examples of OFPortStatisticsReply


Examples of org.openflow.protocol.statistics.OFPortStatisticsReply

  public static JSONArray toPortStat(List<OFStatistics> ofs){
    JSONArray jsonArray = new JSONArray();
   
    for (OFStatistics ofst : ofs) {

      OFPortStatisticsReply st = (OFPortStatisticsReply) ofst;
     
     
     

      JSONObject jsonObject = new JSONObject();
      if (st.getPortNumber() < -2) {
        continue;
      }
      jsonObject.put("port_id", st.getPortNumber());
      jsonObject.put("receive_packets", st.getreceivePackets());
      jsonObject.put("transmit_packets", st.getTransmitPackets());
      jsonObject.put("receive_bytes", st.getReceiveBytes());
      jsonObject.put("transmit_bytes", st.getTransmitBytes());

      jsonArray.add(jsonObject);

    }
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.