Remove utility class constructor exceptions
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / OFConstants.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.openflowplugin.api;
9
10 import java.util.List;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
14 import org.opendaylight.yangtools.yang.common.Uint16;
15 import org.opendaylight.yangtools.yang.common.Uint32;
16 import org.opendaylight.yangtools.yang.common.Uint64;
17 import org.opendaylight.yangtools.yang.common.Uint8;
18
19 /**
20  * OFP related constants.
21  */
22 public final class OFConstants {
23     /** enum ofp_port_no, reserved port: process with normal L2/L3 switching.  */
24     public static final short OFPP_NORMAL = (short)0xfffa;
25     /** enum ofp_port_no, reserved port: all physical ports except input port.  */
26     public static final short OFPP_ALL  = (short)0xfffc;
27     /** enum ofp_port_no, reserved port: local openflow port.  */
28     public static final short OFPP_LOCAL = (short)0xfffe;
29
30     /** openflow protocol 1.0 - version identifier. */
31     public static final Uint8 OFP_VERSION_1_0 = Uint8.ONE;
32     /** openflow protocol 1.3 - version identifier. */
33     public static final Uint8 OFP_VERSION_1_3 = Uint8.valueOf(0x04);
34
35     public static final String OF_URI_PREFIX = "openflow:";
36
37     /** enum ofp_table: Table numbering, wildcard table used for table config, flow stats and flow deletes. */
38     public static final Uint8 OFPTT_ALL = Uint8.MAX_VALUE;
39     public static final Uint32 ANY = Uint32.MAX_VALUE;
40     /** Wildcard port used only for flow mod (delete) and flow stats requests. Selects
41      *  all flows regardless of output port (including flows with no output port).*/
42     public static final Uint32 OFPP_ANY = ANY;
43     /** enum ofp_group: For OFPFC_DELETE* commands, require matching entries to include this as an
44      *  output group. A value of OFPG_ANY indicates no restriction. */
45     public static final Uint32 OFPG_ANY = ANY;
46     /** enum ofp_group: Represents all groups for group delete commands. */
47     public static final Uint32 OFPG_ALL = Uint32.valueOf(0xfffffffcL).intern();
48     /** Refers to all queues configured at the specified port. */
49     public static final Uint32 OFPQ_ALL = ANY;
50     /** Represents all meters for stat requests commands. */
51     public static final Uint32 OFPM_ALL = ANY;
52     /** Default cookie. */
53     public static final Uint64 DEFAULT_COOKIE = Uint64.ZERO;
54     public static final Uint64 DEFAULT_COOKIE_MASK = Uint64.ZERO;
55     public static final FlowCookie DEFAULT_FLOW_COOKIE = new FlowCookie(DEFAULT_COOKIE);
56     public static final Uint16 DEFAULT_FLOW_PRIORITY = Uint16.valueOf(0x8000).intern();
57     /** Empty flow match. */
58     public static final Match EMPTY_MATCH = new MatchBuilder().build();
59
60     /** indicates that no buffering should be applied and the whole packet is to be
61      *  sent to the controller. */
62     public static final Uint32 OFP_NO_BUFFER = Uint32.valueOf(0xffffffffL).intern();
63     /** enum ofp_controller_max_len: indicates that no buffering should be applied and the whole packet is to be
64      *  sent to the controller. */
65     public static final Uint16 OFPCML_NO_BUFFER = Uint16.MAX_VALUE;
66
67     public static final int MAC_ADDRESS_LENGTH = 6;
68     public static final int SIGNUM_UNSIGNED = 1;
69
70     /** RpcError application tag. */
71     public static final String APPLICATION_TAG = "OPENFLOW_PLUGIN";
72     /** RpcError tag - timeout. */
73     public static final String ERROR_TAG_TIMEOUT = "TIMOUT";
74
75     /** Persistent ID of OpenFlowPlugin configuration file. */
76     public static final String CONFIG_FILE_ID = "org.opendaylight.openflowplugin";
77
78     /** supported version ordered by height (highest version is at the beginning). */
79     public static final List<Uint8> VERSION_ORDER = List.of(OFP_VERSION_1_3, OFP_VERSION_1_0);
80
81     private OFConstants() {
82         // Hidden on purpose
83     }
84 }