1 package org.openflow.protocol;
3 import java.nio.ByteBuffer;
5 import org.openflow.util.U16;
9 * @author David Erickson (daviderickson@cs.stanford.edu)
11 public class OFQueueConfigRequest extends OFMessage implements Cloneable {
12 public static int MINIMUM_LENGTH = 12;
19 public OFQueueConfigRequest() {
21 this.type = OFType.QUEUE_CONFIG_REQUEST;
22 this.length = U16.t(MINIMUM_LENGTH);
28 public short getPort() {
33 * @param port the port to set
35 public void setPort(short port) {
40 public void readFrom(ByteBuffer data) {
42 this.port = data.getShort();
48 public void writeTo(ByteBuffer data) {
50 data.putShort(this.port);
51 data.putShort((short) 0); // pad
55 public int hashCode() {
56 final int prime = 7211;
57 int result = super.hashCode();
58 result = prime * result + port;
63 public boolean equals(Object obj) {
66 if (!super.equals(obj))
68 if (!(obj instanceof OFQueueConfigRequest))
70 OFQueueConfigRequest other = (OFQueueConfigRequest) obj;
71 if (port != other.port)
77 public OFQueueConfigRequest clone() {
79 return (OFQueueConfigRequest) super.clone();
80 } catch (CloneNotSupportedException e) {
81 throw new RuntimeException(e);