2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.openflowplugin.api;
10 import java.math.BigInteger;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
14 * OFP related constants
16 public final class OFConstants {
18 private OFConstants() {
19 throw new UnsupportedOperationException("OF plugin Constants holder class");
22 /** enum ofp_port_no, reserved port: process with normal L2/L3 switching */
23 public static final short OFPP_NORMAL = ((short)0xfffa);
24 /** enum ofp_port_no, reserved port: all physical ports except input port */
25 public static final short OFPP_ALL = ((short)0xfffc);
26 /** enum ofp_port_no, reserved port: local openflow port */
27 public static final short OFPP_LOCAL = ((short)0xfffe);
30 /** openflow protocol 1.0 - version identifier */
31 public static final short OFP_VERSION_1_0 = 0x01;
32 /** openflow protocol 1.3 - version identifier */
33 public static final short OFP_VERSION_1_3 = 0x04;
35 public final static String OF_URI_PREFIX = "openflow:";
37 /** enum ofp_table: Table numbering, wildcard table used for table config, flow stats and flow deletes. */
38 public static final Short OFPTT_ALL = 0xff;
39 public static final Long ANY = 0xffffffffL;
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 Long 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 Long OFPG_ANY = ANY;
46 /** enum ofp_group: Represents all groups for group delete commands. */
47 public static final Long OFPG_ALL = 0xfffffffcL;
48 /** Refers to all queues configured at the specified port. */
49 public static final Long OFPQ_ALL = ANY;
50 /** Represents all meters for stat requests commands. */
51 public static final Long OFPM_ALL = ANY;
53 public static final BigInteger DEFAULT_COOKIE = BigInteger.ZERO;
54 public static final BigInteger DEFAULT_COOKIE_MASK = BigInteger.ZERO;
55 public static final FlowCookie DEFAULT_FLOW_COOKIE = new FlowCookie(DEFAULT_COOKIE);
56 public static final Integer DEFAULT_FLOW_PRIORITY = 0x8000;
58 /** indicates that no buffering should be applied and the whole packet is to be
59 * sent to the controller. */
60 public static final Long OFP_NO_BUFFER = 0xffffffffL;
61 /** enum ofp_controller_max_len: indicates that no buffering should be applied and the whole packet is to be
62 * sent to the controller. */
63 public static final Integer OFPCML_NO_BUFFER = 0xffff;
66 public static final int MAC_ADDRESS_LENGTH = 6;
67 public static final int SIZE_OF_LONG_IN_BYTES = 8;
68 public static final int SIGNUM_UNSIGNED = 1;
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";