X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=third-party%2Fopenflowj%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenflow%2Fprotocol%2FOFVendor.java;fp=third-party%2Fopenflowj%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenflow%2Fprotocol%2FOFVendor.java;h=0000000000000000000000000000000000000000;hp=f372650d12f0406753906fb26846ccebde2d7028;hb=e1c04c5af263a9604a765f1ab98be51dfc51d8cb;hpb=a935ffda7f26be29de879a47b426d0db7a28d588 diff --git a/third-party/openflowj/src/main/java/org/openflow/protocol/OFVendor.java b/third-party/openflowj/src/main/java/org/openflow/protocol/OFVendor.java deleted file mode 100644 index f372650d12..0000000000 --- a/third-party/openflowj/src/main/java/org/openflow/protocol/OFVendor.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.openflow.protocol; - -import java.nio.ByteBuffer; -import java.util.Arrays; - -import org.openflow.util.U16; - -/** - * Represents ofp_vendor_header - * @author David Erickson (daviderickson@cs.stanford.edu) - */ -public class OFVendor extends OFMessage { - public static int MINIMUM_LENGTH = 12; - - protected int vendor; - protected byte[] data; - - public OFVendor() { - super(); - this.type = OFType.VENDOR; - this.length = U16.t(MINIMUM_LENGTH); - } - - /** - * @return the vendor - */ - public int getVendor() { - return vendor; - } - - /** - * @param vendor the vendor to set - */ - public void setVendor(int vendor) { - this.vendor = vendor; - } - - @Override - public void readFrom(ByteBuffer data) { - super.readFrom(data); - this.vendor = data.getInt(); - if (this.length > MINIMUM_LENGTH) { - this.data = new byte[this.length - MINIMUM_LENGTH]; - data.get(this.data); - } - } - - @Override - public void writeTo(ByteBuffer data) { - super.writeTo(data); - data.putInt(this.vendor); - if (this.data != null) - data.put(this.data); - } - - /** - * @return the data - */ - public byte[] getData() { - return data; - } - - /** - * @param data the data to set - */ - public void setData(byte[] data) { - this.data = data; - } - - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = 337; - int result = super.hashCode(); - result = prime * result + Arrays.hashCode(data); - result = prime * result + vendor; - return result; - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (!super.equals(obj)) - return false; - if (getClass() != obj.getClass()) - return false; - OFVendor other = (OFVendor) obj; - if (!Arrays.equals(data, other.data)) - return false; - if (vendor != other.vendor) - return false; - return true; - } -}