2 * Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may
6 * not use this file except in compliance with the License. You may obtain
7 * a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations
19 * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
21 package org.openflow.protocol.action;
24 import org.jboss.netty.buffer.ChannelBuffer;
27 * Represents an ofp_action_enqueue
28 * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
30 public class OFActionEnqueue extends OFAction {
31 public static int MINIMUM_LENGTH = 16;
34 protected int queueId;
36 public OFActionEnqueue() {
37 super.setType(OFActionType.OPAQUE_ENQUEUE);
38 super.setLength((short) MINIMUM_LENGTH);
41 public OFActionEnqueue(short port, int queueId) {
44 this.queueId = queueId;
51 public short getPort() {
59 public void setPort(short port) {
66 public int getQueueId() {
71 * @param queueId the queueId to set
73 public void setQueueId(int queueId) {
74 this.queueId = queueId;
78 public void readFrom(ChannelBuffer data) {
80 this.port = data.readShort();
83 this.queueId = data.readInt();
87 public void writeTo(ChannelBuffer data) {
89 data.writeShort(this.port);
90 data.writeShort((short) 0);
92 data.writeInt(this.queueId);
96 public int hashCode() {
97 final int prime = 349;
98 int result = super.hashCode();
99 result = prime * result + port;
100 result = prime * result + queueId;
105 public boolean equals(Object obj) {
109 if (!super.equals(obj)) {
112 if (!(obj instanceof OFActionEnqueue)) {
115 OFActionEnqueue other = (OFActionEnqueue) obj;
116 if (port != other.port) {
119 if (queueId != other.queueId) {