X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=third-party%2Fopenflow-codec%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenflow%2Fcodec%2Fprotocol%2FOFPTableMod.java;fp=third-party%2Fopenflow-codec%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenflow%2Fcodec%2Fprotocol%2FOFPTableMod.java;h=0000000000000000000000000000000000000000;hb=64fe0fbca1a6c2b77ad25f568d73a7eb64236d16;hp=8f2c6cf388e7a0a37b8fb13c6a5f55d95d506b05;hpb=8b9a3ff2bbc83941254b46b818cbbae5cc1a3a5b;p=openflowjava.git diff --git a/third-party/openflow-codec/src/main/java/org/openflow/codec/protocol/OFPTableMod.java b/third-party/openflow-codec/src/main/java/org/openflow/codec/protocol/OFPTableMod.java deleted file mode 100644 index 8f2c6cf3..00000000 --- a/third-party/openflow-codec/src/main/java/org/openflow/codec/protocol/OFPTableMod.java +++ /dev/null @@ -1,136 +0,0 @@ -package org.openflow.codec.protocol; - -import org.openflow.codec.io.IDataBuffer; -import org.openflow.codec.util.U16; - -/** - * Class representing message structure ofp_table_mod - * - * @author AnilGujele - * - */ -public class OFPTableMod extends OFPMessage { - - private static final long serialVersionUID = -5972069012765334899L; - - public static int MINIMUM_LENGTH = 16; - - // table number as per ofp_table - enum OFTable { - /* Last usable table number. */ - OFPTT_MAX(0xfe), - - /* Fake tables. */ - OFPTT_ALL(0xff); - - private int value; - - OFTable(int value) { - this.value = value; - } - - public short value() { - return (short) this.value; - } - } - - // Flags to configure the table as per ofp_table_config - public static final int OFPTC_DEPRECATED_MASK = 3; - - private byte tableId; - private int config; - - /** - * constructor - */ - public OFPTableMod() { - super(); - this.type = OFPType.TABLE_MOD; - this.length = U16.t(MINIMUM_LENGTH); - - } - - /** - * get table id - * - * @return - */ - public byte getTableId() { - return tableId; - } - - /** - * set table id OFPTT_ALL is for all the table OFPTT_MAX is Max table number - * limit - * - * @param tableId - */ - public void setTableId(byte tableId) { - - this.tableId = tableId; - } - - /** - * - * @return - */ - public int getConfig() { - return config; - } - - /** - * - * @param config - */ - public void setConfig(int config) { - this.config = config; - } - - @Override - public void readFrom(IDataBuffer data) { - super.readFrom(data); - this.tableId = data.get(); - data.getShort(); // pad - data.get(); // pad - this.config = data.getInt(); - } - - @Override - public void writeTo(IDataBuffer data) { - super.writeTo(data); - data.put(this.tableId); - data.putShort((short) 0); // pad - data.put((byte) 0); // pad - data.putInt(this.config); - } - - @Override - public int hashCode() { - final int prime = 811; - int result = super.hashCode(); - result = prime * result + tableId; - result = prime * result + config; - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (!(obj instanceof OFPTableMod)) { - return false; - } - OFPTableMod other = (OFPTableMod) obj; - if (tableId != other.tableId) { - return false; - } - if (config != other.config) { - return false; - } - return true; - } -}