2 * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
4 package org.openflow.protocol.action;
6 import java.nio.ByteBuffer;
9 * Represents an ofp_action_nw_addr
10 * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
12 public abstract class OFActionNetworkLayerAddress extends OFAction {
13 public static int MINIMUM_LENGTH = 8;
15 protected int networkAddress;
18 * @return the networkAddress
20 public int getNetworkAddress() {
21 return networkAddress;
25 * @param networkAddress the networkAddress to set
27 public void setNetworkAddress(int networkAddress) {
28 this.networkAddress = networkAddress;
32 public void readFrom(ByteBuffer data) {
34 this.networkAddress = data.getInt();
38 public void writeTo(ByteBuffer data) {
40 data.putInt(this.networkAddress);
44 public int hashCode() {
45 final int prime = 353;
46 int result = super.hashCode();
47 result = prime * result + networkAddress;
52 public boolean equals(Object obj) {
56 if (!super.equals(obj)) {
59 if (!(obj instanceof OFActionNetworkLayerAddress)) {
62 OFActionNetworkLayerAddress other = (OFActionNetworkLayerAddress) obj;
63 if (networkAddress != other.networkAddress) {