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_tp_port
28 * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
30 public abstract class OFActionTransportLayer extends OFAction {
31 public static int MINIMUM_LENGTH = 8;
33 protected short transportPort;
36 * @return the transportPort
38 public short getTransportPort() {
43 * @param transportPort the transportPort to set
45 public void setTransportPort(short transportPort) {
46 this.transportPort = transportPort;
50 public void readFrom(ChannelBuffer data) {
52 this.transportPort = data.readShort();
57 public void writeTo(ChannelBuffer data) {
59 data.writeShort(this.transportPort);
60 data.writeShort((short) 0);
64 public int hashCode() {
65 final int prime = 373;
66 int result = super.hashCode();
67 result = prime * result + transportPort;
72 public boolean equals(Object obj) {
76 if (!super.equals(obj)) {
79 if (!(obj instanceof OFActionTransportLayer)) {
82 OFActionTransportLayer other = (OFActionTransportLayer) obj;
83 if (transportPort != other.transportPort) {