bbd881e2a0ddd67f00c6a98f138242c6bc3754d8
[openflowjava.git] / openflow-protocol-api / src / main / java / org / opendaylight / openflowjava / protocol / api / util / EncodeConstants.java
1 /*
2  * Copyright (c) 2013 Pantheon Technologies s.r.o. 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
9 package org.opendaylight.openflowjava.protocol.api.util;
10
11 /**
12  * Stores common constants
13  * @author michal.polkorab
14  */
15 public abstract class EncodeConstants {
16
17     /** Default OF padding (in bytes) */
18     public static final byte PADDING = 8;
19     /** OpenFlow v1.0 wire protocol number */
20     public static final byte OF10_VERSION_ID = 0x01;
21     /** OpenFlow v1.3 wire protocol number */
22     public static final byte OF13_VERSION_ID = 0x04;
23     /** Index of length in Openflow header */
24     public static final int OFHEADER_LENGTH_INDEX = 2;
25     /** Size of Openflow header */
26     public static final int OFHEADER_SIZE = 8;
27     /** Zero length - used when the length is updated later */
28     public static final int EMPTY_LENGTH = 0;
29     
30     /** Length of mac address */
31     public static final byte MAC_ADDRESS_LENGTH = 6;
32     /** Number of groups in ipv4 address */
33     public static final byte GROUPS_IN_IPV4_ADDRESS = 4;
34     /** Number of groups in ipv6 address */
35     public static final byte GROUPS_IN_IPV6_ADDRESS = 8;
36     /** Length of ipv6 address in bytes */
37     public static final byte SIZE_OF_IPV6_ADDRESS_IN_BYTES = (8 * Short.SIZE) / Byte.SIZE;
38
39     /** Length of long in bytes */
40     public static final byte SIZE_OF_LONG_IN_BYTES = Long.SIZE / Byte.SIZE;
41     /** Length of int in bytes */
42     public static final byte SIZE_OF_INT_IN_BYTES = Integer.SIZE / Byte.SIZE;
43     /** Length of short in bytes */
44     public static final byte SIZE_OF_SHORT_IN_BYTES = Short.SIZE / Byte.SIZE;
45     /** Length of byte in bytes */
46     public static final byte SIZE_OF_BYTE_IN_BYTES = Byte.SIZE / Byte.SIZE;
47     /** Length of 3 bytes */
48     public static final byte SIZE_OF_3_BYTES = 3;
49
50     /** Empty (zero) int value */
51     public static final int EMPTY_VALUE = 0;
52     /** Common experimenter value */
53     public static final int EXPERIMENTER_VALUE = 0xFFFF;
54
55
56     /** OF v1.0 maximal port name length */
57     public static final byte MAX_PORT_NAME_LENGTH = 16;
58     /** OF v1.3 lenght of experimenter_ids - see Multipart TableFeatures (properties) message */
59     public static final byte EXPERIMENTER_IDS_LENGTH = 8;
60
61 }