X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fsal%2Fapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Faction%2FActionType.java;h=b491c5fcea2e4b53914102a91e88a76591ac5d22;hb=237237663265bfda9069c66151371ce7697aed59;hp=6ff233b69a6e1a09966c2f922abd0555020906d5;hpb=f69c674bc091ea5f70bde33fc45ca7e181c2f6e0;p=controller.git diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/ActionType.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/ActionType.java index 6ff233b69a..b491c5fcea 100644 --- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/ActionType.java +++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/action/ActionType.java @@ -1,4 +1,3 @@ - /* * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. * @@ -12,25 +11,32 @@ package org.opendaylight.controller.sal.action; /** * The enumeration of actions supported by the controller * Each entry has a unique id and the values range for the action element where applicable - * - * - * */ public enum ActionType { - DROP("drop", 0, 0), LOOPBACK("loopback", 0, 0), FLOOD("flood", 0, 0), // regular switching flood (obeys to stp port state) + DROP("drop", 0, 0), + LOOPBACK("loopback", 0, 0), + FLOOD("flood", 0, 0), // regular switching flood (obeys to stp port state) FLOOD_ALL("floodAll", 0, 0), // flood to all ports regardless of stp port state - CONTROLLER("controller", 0, 0), INTERFACE("interface", 0, 0), // Interface + CONTROLLER("controller", 0, 0), + INTERFACE("interface", 0, 0), // Interface SW_PATH("software path", 0, 0), // OF Local - HW_PATH("harware path", 0, 0), OUTPUT("output", 0, 0xffff), // physical port - ENQUEUE("enqueue", 0, 0xffff), SET_DL_SRC("setDlSrc", 0, 0), SET_DL_DST( - "setDlDst", 0, 0), SET_VLAN_ID("setVlan", 1, 0xfff), SET_VLAN_PCP( - "setVlanPcp", 0, 0x7), SET_VLAN_CFI("setVlanCif", 0, 0x1), POP_VLAN( - "stripVlan", 0, 0), // Pop + HW_PATH("harware path", 0, 0), + OUTPUT("output", 0, 0xffff), // physical port + ENQUEUE("enqueue", 0, 0xffff), + SET_DL_SRC("setDlSrc", 0, 0), + SET_DL_DST("setDlDst", 0, 0), + SET_VLAN_ID("setVlan", 1, 0xfff), + SET_VLAN_PCP("setVlanPcp", 0, 0x7), + SET_VLAN_CFI("setVlanCif", 0, 0x1), + POP_VLAN("stripVlan", 0, 0), // Pop PUSH_VLAN("pushVlan", 0, 0xffff), // Push (the max value only takes into account the TCI portion of the 802.1q header) SET_DL_TYPE("setDlType", 0, 0xffff), // Set ethertype/length field - SET_NW_SRC("setNwSrc", 0, 0), SET_NW_DST("setNwDst", 0, 0), SET_NW_TOS( - "setNwTos", 0, 0xff), SET_TP_SRC("setTpSrc", 1, 0xffff), SET_TP_DST( - "setTpDst", 1, 0xffff), SET_NEXT_HOP("setNextHop", 0, 0); + SET_NW_SRC("setNwSrc", 0, 0), + SET_NW_DST("setNwDst", 0, 0), + SET_NW_TOS("setNwTos", 0, 0x3f), + SET_TP_SRC("setTpSrc", 1, 0xffff), + SET_TP_DST("setTpDst", 1, 0xffff), + SET_NEXT_HOP("setNextHop", 0, 0); private String id; private int minValue; @@ -51,8 +57,7 @@ public enum ActionType { } public String getRange() { - return "[0x" + Long.toHexString(minValue) + "-0x" - + Long.toHexString(maxValue) + "]"; + return "[0x" + Long.toHexString(minValue) + "-0x" + Long.toHexString(maxValue) + "]"; } public boolean takesParameter() { @@ -70,4 +75,12 @@ public enum ActionType { return true; } } -} \ No newline at end of file + + public int calculateConsistentHashCode() { + if (this.id != null) { + return this.id.hashCode(); + } else { + return 0; + } + } +}