2 * @author Yugandhar Sarraju (ysarraju@in.ibm.com) - July 20, 2013
4 package org.openflow.codec.protocol.action;
6 import org.openflow.codec.io.IDataBuffer;
9 * Represents an action struct ofp_action_nw_ttl
11 public class OFPActionNetworkTimeToLive extends OFPAction {
12 public static int MINIMUM_LENGTH = 8;
14 protected byte networkTimeToLive;
16 public OFPActionNetworkTimeToLive() {
17 super.setType(OFPActionType.SET_NW_TTL);
18 super.setLength((short) MINIMUM_LENGTH);
22 * @return the networkTimeToLive
24 public short getNetworkTimeToLive() {
25 return networkTimeToLive;
29 * @param networkTimeToLive
30 * the networkTimeToLive to set
32 public void setNetworkTimeToLive(byte networkTtl) {
33 this.networkTimeToLive = networkTtl;
37 public void readFrom(IDataBuffer data) {
39 this.networkTimeToLive = data.get();
45 public void writeTo(IDataBuffer data) {
47 data.putShort(this.networkTimeToLive);
48 data.putShort((short) 0);
53 public int hashCode() {
54 final int prime = 373;
55 int result = super.hashCode();
56 result = prime * result + networkTimeToLive;
61 public boolean equals(Object obj) {
65 if (!super.equals(obj)) {
68 if (!(obj instanceof OFPActionNetworkTimeToLive)) {
71 OFPActionNetworkTimeToLive other = (OFPActionNetworkTimeToLive) obj;
72 if (networkTimeToLive != other.networkTimeToLive) {