f405a9dcd19a17289a83d32778bb6f5df65180b6
[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.math.BigInteger;
11
12 /**
13  * OFP related constants
14  */
15 public final class OFConstants {
16
17     private OFConstants() {
18         throw new UnsupportedOperationException("OF plugin Constants holder class");
19     }
20
21     /** enum ofp_port_no, reserved port: process with normal L2/L3 switching  */
22     public static final short OFPP_NORMAL = ((short)0xfffa);
23     /** enum ofp_port_no, reserved port: all physical ports except input port  */
24     public static final short OFPP_ALL  = ((short)0xfffc);
25     /** enum ofp_port_no, reserved port: local openflow port  */
26     public static final short OFPP_LOCAL = ((short)0xfffe);
27
28
29     /** openflow protocol 1.0 - version identifier */
30     public static final short OFP_VERSION_1_0 = 0x01;
31     /** openflow protocol 1.3 - version identifier */
32     public static final short OFP_VERSION_1_3 = 0x04;
33
34     public final static String OF_URI_PREFIX = "openflow:";
35
36     /** enum ofp_table: Table numbering, wildcard table used for table config, flow stats and flow deletes. */
37     public static final Short OFPTT_ALL = 0xff;
38     public static final Long ANY = 0xffffffffL;
39     /** Wildcard port used only for flow mod (delete) and flow stats requests. Selects
40      *  all flows regardless of output port (including flows with no output port).*/
41     public static final Long OFPP_ANY = ANY;
42     /** enum ofp_group: For OFPFC_DELETE* commands, require matching entries to include this as an
43      *  output group. A value of OFPG_ANY indicates no restriction. */
44     public static final Long OFPG_ANY = ANY;
45     /** Refers to all queues configured at the specified port. */
46     public static final Long OFPQ_ALL = ANY;
47     public static final BigInteger DEFAULT_COOKIE = BigInteger.ZERO;
48     public static final BigInteger DEFAULT_COOKIE_MASK = BigInteger.ZERO;
49     /** indicates that no buffering should be applied and the whole packet is to be
50      *  sent to the controller. */
51     public static final Long OFP_NO_BUFFER = 0xffffffffL;
52     /** enum ofp_controller_max_len: indicates that no buffering should be applied and the whole packet is to be
53      *  sent to the controller. */
54     public static final Integer OFPCML_NO_BUFFER = 0xffff;
55
56
57     public static final int MAC_ADDRESS_LENGTH = 6;
58     public static final int SIZE_OF_LONG_IN_BYTES = 8;
59     public static final int SIGNUM_UNSIGNED = 1;
60
61     /** RpcError application tag */
62     public static final String APPLICATION_TAG = "OPENFLOW_PLUGIN";
63     /** RpcError tag - timeout */
64     public static final String ERROR_TAG_TIMEOUT = "TIMOUT";
65 }