2 * Copyright 2012, Andrew Ferguson, Brown University
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may
5 * not use this file except in compliance with the License. You may obtain
6 * a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations
17 package org.openflow.protocol;
19 import org.jboss.netty.buffer.ChannelBuffer;
20 import org.openflow.util.U16;
23 * Represents an ofp_queue_get_config_request message
24 * @author Andrew Ferguson (adf@cs.brown.edu)
26 public class OFQueueGetConfigRequest extends OFMessage {
27 public static int MINIMUM_LENGTH = 12;
29 protected short portNumber;
31 public OFQueueGetConfigRequest(short portNumber) {
33 this.type = OFType.QUEUE_GET_CONFIG_REQUEST;
34 this.length = U16.t(MINIMUM_LENGTH);
35 this.portNumber = portNumber;
38 public OFQueueGetConfigRequest() {
43 * @return the portNumber
45 public short getPortNumber() {
50 * @param portNumber the portNumber to set
52 public void setPortNumber(short portNumber) {
53 this.portNumber = portNumber;
57 public void readFrom(ChannelBuffer data) {
59 this.portNumber = data.readShort();
60 data.readShort(); // pad
64 public void writeTo(ChannelBuffer data) {
66 data.writeShort(this.portNumber);
67 data.writeShort(0); // pad
71 public int hashCode() {
72 final int prime = 347;
73 int result = super.hashCode();
74 result = prime * result + portNumber;
79 public boolean equals(Object obj) {
83 if (!super.equals(obj)) {
86 if (!(obj instanceof OFQueueGetConfigRequest)) {
89 OFQueueGetConfigRequest other = (OFQueueGetConfigRequest) obj;
90 if (portNumber != other.portNumber) {