X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=third-party%2Fopenflowj%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenflow%2Fprotocol%2Fstatistics%2FOFQueueStatisticsRequest.java;fp=third-party%2Fopenflowj%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenflow%2Fprotocol%2Fstatistics%2FOFQueueStatisticsRequest.java;h=4317f3f7ecbad453e3a4295242101486338fa25c;hb=42210c03b0a4c54706320ba9f55794c0abd4d201;hp=0000000000000000000000000000000000000000;hpb=7576b38152b393793b1c9ec3df0ff86685f95236;p=controller.git diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFQueueStatisticsRequest.java b/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFQueueStatisticsRequest.java new file mode 100644 index 0000000000..4317f3f7ec --- /dev/null +++ b/third-party/openflowj/src/main/java/org/openflow/protocol/statistics/OFQueueStatisticsRequest.java @@ -0,0 +1,89 @@ +package org.openflow.protocol.statistics; + +import java.nio.ByteBuffer; + +/** + * Represents an ofp_queue_stats_request structure + * @author David Erickson (daviderickson@cs.stanford.edu) + */ +public class OFQueueStatisticsRequest implements OFStatistics { + protected short portNumber; + protected int queueId; + + /** + * @return the portNumber + */ + public short getPortNumber() { + return portNumber; + } + + /** + * @param portNumber the portNumber to set + */ + public void setPortNumber(short portNumber) { + this.portNumber = portNumber; + } + + /** + * @return the queueId + */ + public int getQueueId() { + return queueId; + } + + /** + * @param queueId the queueId to set + */ + public void setQueueId(int queueId) { + this.queueId = queueId; + } + + @Override + public int getLength() { + return 8; + } + + @Override + public void readFrom(ByteBuffer data) { + this.portNumber = data.getShort(); + data.getShort(); // pad + this.queueId = data.getInt(); + } + + @Override + public void writeTo(ByteBuffer data) { + data.putShort(this.portNumber); + data.putShort((short) 0); // pad + data.putInt(this.queueId); + } + + @Override + public int hashCode() { + final int prime = 443; + int result = 1; + result = prime * result + portNumber; + result = prime * result + queueId; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (!(obj instanceof OFQueueStatisticsRequest)) { + return false; + } + OFQueueStatisticsRequest other = (OFQueueStatisticsRequest) obj; + if (portNumber != other.portNumber) { + return false; + } + if (queueId != other.queueId) { + return false; + } + return true; + } +}