Copyright update
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / 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.impl.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 = EncodeConstants.SIZE_OF_LONG_IN_BYTES;
19     /** OpenFlow v1.0 wire protocol number */
20     public static final byte OF10_VERSION_ID = 0x01;
21     /** OpenFlow v1.0 wire protocol number */
22     public static final byte OF13_VERSION_ID = 0x04;
23     
24     /** Length of mac address */
25     public static final byte MAC_ADDRESS_LENGTH = 6;
26     /** Number of groups in ipv4 address */
27     public static final byte GROUPS_IN_IPV4_ADDRESS = 4;
28     /** Number of groups in ipv6 address */
29     public static final byte GROUPS_IN_IPV6_ADDRESS = 8;
30     /** Length of ipv6 address in bytes */
31     public static final byte SIZE_OF_IPV6_ADDRESS_IN_BYTES = (8 * Short.SIZE) / Byte.SIZE;
32     
33     /** Length of long in bytes */
34     public static final byte SIZE_OF_LONG_IN_BYTES = Long.SIZE / Byte.SIZE;
35     /** Length of int in bytes */
36     public static final byte SIZE_OF_INT_IN_BYTES = Integer.SIZE / Byte.SIZE;
37     /** Length of short in bytes */
38     public static final byte SIZE_OF_SHORT_IN_BYTES = Short.SIZE / Byte.SIZE;
39     /** Length of byte in bytes */
40     public static final byte SIZE_OF_BYTE_IN_BYTES = Byte.SIZE / Byte.SIZE;
41
42     
43     /** OF v1.0 maximal port name length */
44     public static final byte MAX_PORT_NAME_LENGTH = 16;
45 }