1 package org.openflow.protocol.action;
3 import java.nio.ByteBuffer;
7 * @author David Erickson (daviderickson@cs.stanford.edu)
9 public class OFActionVendor extends OFAction {
10 public static int MINIMUM_LENGTH = 8;
14 public enum ActionVendorID {
17 private ActionVendorID(int value) {
20 public int getValue() {
25 public OFActionVendor() {
27 super.setType(OFActionType.VENDOR);
28 super.setLength((short) MINIMUM_LENGTH);
34 public int getVendor() {
39 * @param vendor the vendor to set
41 public void setVendor(int vendor) {
46 public void readFrom(ByteBuffer data) {
48 this.vendor = data.getInt();
49 if (this.vendor == ActionVendorID.AVI_CISCO.getValue()) {
50 ActionVendorOutputNextHop nh = new ActionVendorOutputNextHop();
57 public void writeTo(ByteBuffer data) {
59 data.putInt(this.vendor);
63 public int hashCode() {
64 final int prime = 379;
65 int result = super.hashCode();
66 result = prime * result + vendor;
71 public boolean equals(Object obj) {
75 if (!super.equals(obj)) {
78 if (!(obj instanceof OFActionVendor)) {
81 OFActionVendor other = (OFActionVendor) obj;
82 if (vendor != other.vendor) {