1 package org.openflow.codec.protocol;
3 import org.openflow.codec.io.IDataBuffer;
6 * Base class representing ofp_switch_config based messages
8 * @author David Erickson (daviderickson@cs.stanford.edu)
10 public abstract class OFPSwitchConfig extends OFPMessage {
11 public static int MINIMUM_LENGTH = 12;
13 public enum OFConfigFlags {
14 OFPC_FRAG_NORMAL, OFPC_FRAG_DROP, OFPC_FRAG_REASM, OFPC_FRAG_MASK
17 protected short flags;
18 protected short missSendLength;
20 public OFPSwitchConfig() {
22 super.setLengthU(MINIMUM_LENGTH);
28 public short getFlags() {
36 public OFPSwitchConfig setFlags(short flags) {
42 * @return the missSendLength
44 public short getMissSendLength() {
45 return missSendLength;
49 * @param missSendLength
50 * the missSendLength to set
52 public OFPSwitchConfig setMissSendLength(short missSendLength) {
53 this.missSendLength = missSendLength;
58 public void readFrom(IDataBuffer data) {
60 this.flags = data.getShort();
61 this.missSendLength = data.getShort();
65 public void writeTo(IDataBuffer data) {
67 data.putShort(this.flags);
68 data.putShort(this.missSendLength);
72 public int hashCode() {
73 final int prime = 331;
74 int result = super.hashCode();
75 result = prime * result + flags;
76 result = prime * result + missSendLength;
81 public boolean equals(Object obj) {
85 if (!super.equals(obj)) {
88 if (!(obj instanceof OFPSwitchConfig)) {
91 OFPSwitchConfig other = (OFPSwitchConfig) obj;
92 if (flags != other.flags) {
95 if (missSendLength != other.missSendLength) {