1 package org.openflow.codec.protocol;
3 import org.openflow.codec.io.IDataBuffer;
4 import org.openflow.codec.util.U16;
7 * Class representing message structure ofp_table_mod
12 public class OFPTableMod extends OFPMessage {
14 private static final long serialVersionUID = -5972069012765334899L;
16 public static int MINIMUM_LENGTH = 16;
18 // table number as per ofp_table
20 /* Last usable table number. */
32 public short value() {
33 return (short) this.value;
37 // Flags to configure the table as per ofp_table_config
38 public static final int OFPTC_DEPRECATED_MASK = 3;
46 public OFPTableMod() {
48 this.type = OFPType.TABLE_MOD;
49 this.length = U16.t(MINIMUM_LENGTH);
58 public byte getTableId() {
63 * set table id OFPTT_ALL is for all the table OFPTT_MAX is Max table number
68 public void setTableId(byte tableId) {
70 this.tableId = tableId;
77 public int getConfig() {
85 public void setConfig(int config) {
90 public void readFrom(IDataBuffer data) {
92 this.tableId = data.get();
93 data.getShort(); // pad
95 this.config = data.getInt();
99 public void writeTo(IDataBuffer data) {
101 data.put(this.tableId);
102 data.putShort((short) 0); // pad
103 data.put((byte) 0); // pad
104 data.putInt(this.config);
108 public int hashCode() {
109 final int prime = 811;
110 int result = super.hashCode();
111 result = prime * result + tableId;
112 result = prime * result + config;
117 public boolean equals(Object obj) {
121 if (!super.equals(obj)) {
124 if (!(obj instanceof OFPTableMod)) {
127 OFPTableMod other = (OFPTableMod) obj;
128 if (tableId != other.tableId) {
131 if (config != other.config) {