3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
5 * This program and the accompanying materials are made available under the
6 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 * and is available at http://www.eclipse.org/legal/epl-v10.html
10 package org.opendaylight.controller.sal.action;
13 * The enumeration of actions supported by the controller
14 * Each entry has a unique id and the values range for the action element where applicable
19 public enum ActionType {
20 DROP("drop", 0, 0), LOOPBACK("loopback", 0, 0), FLOOD("flood", 0, 0), // regular switching flood (obeys to stp port state)
21 FLOOD_ALL("floodAll", 0, 0), // flood to all ports regardless of stp port state
22 CONTROLLER("controller", 0, 0), INTERFACE("interface", 0, 0), // Interface
23 SW_PATH("software path", 0, 0), // OF Local
24 HW_PATH("harware path", 0, 0), OUTPUT("output", 0, 0xffff), // physical port
25 ENQUEUE("enqueue", 0, 0xffff), SET_DL_SRC("setDlSrc", 0, 0), SET_DL_DST(
26 "setDlDst", 0, 0), SET_VLAN_ID("setVlan", 2, 0xfff), SET_VLAN_PCP(
27 "setVlanPcp", 0, 0x7), SET_VLAN_CFI("setVlanCif", 0, 0x1), POP_VLAN(
28 "stripVlan", 0, 0), // Pop
29 PUSH_VLAN("pushVlan", 0, 0xffff), // Push (the max value only takes into account the TCI portion of the 802.1q header)
30 SET_DL_TYPE("setDlType", 0, 0xffff), // Set ethertype/length field
31 SET_NW_SRC("setNwSrc", 0, 0), SET_NW_DST("setNwDst", 0, 0), SET_NW_TOS(
32 "setNwTos", 0, 0xff), SET_TP_SRC("setTpSrc", 0, 0xffff), SET_TP_DST(
33 "setTpDst", 0, 0xffff), SET_NEXT_HOP("setNextHop", 0, 0);
39 private ActionType(String id, int minValue, int maxValue) {
41 this.minValue = minValue;
42 this.maxValue = maxValue;
45 public String getId() {
49 public boolean isValidTarget(int value) {
50 return (value >= minValue && value <= maxValue);
53 public String getRange() {
54 return "[0x" + Long.toHexString(minValue) + "-0x"
55 + Long.toHexString(maxValue) + "]";
58 public boolean takesParameter() {