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 {
21 LOOPBACK("loopback", 0, 0),
22 FLOOD("flood", 0, 0), // regular switching flood (obeys to stp port state)
23 FLOOD_ALL("floodAll", 0, 0), // flood to all ports regardless of stp port state
24 CONTROLLER("controller", 0, 0),
25 INTERFACE("interface", 0, 0), // Interface
26 SW_PATH("software path", 0, 0), // OF Local
27 HW_PATH("harware path", 0, 0),
28 OUTPUT("output", 0, 0xffff), // physical port
29 ENQUEUE("enqueue", 0, 0xffff),
30 SET_DL_SRC("setDlSrc", 0, 0),
31 SET_DL_DST("setDlDst", 0, 0),
32 SET_VLAN_ID("setVlan", 1, 0xfff),
33 SET_VLAN_PCP("setVlanPcp", 0, 0x7),
34 SET_VLAN_CFI("setVlanCif", 0, 0x1),
35 POP_VLAN("stripVlan", 0, 0), // Pop
36 PUSH_VLAN("pushVlan", 0, 0xffff), // Push (the max value only takes into account the TCI portion of the 802.1q header)
37 SET_DL_TYPE("setDlType", 0, 0xffff), // Set ethertype/length field
38 SET_NW_SRC("setNwSrc", 0, 0),
39 SET_NW_DST("setNwDst", 0, 0),
40 SET_NW_TOS("setNwTos", 0, 0x3f),
41 SET_TP_SRC("setTpSrc", 1, 0xffff),
42 SET_TP_DST("setTpDst", 1, 0xffff),
43 SET_NEXT_HOP("setNextHop", 0, 0);
49 private ActionType(String id, int minValue, int maxValue) {
51 this.minValue = minValue;
52 this.maxValue = maxValue;
55 public String getId() {
59 public boolean isValidTarget(int value) {
60 return (value >= minValue && value <= maxValue);
63 public String getRange() {
64 return "[0x" + Long.toHexString(minValue) + "-0x"
65 + Long.toHexString(maxValue) + "]";
68 public boolean takesParameter() {