Remove bundle extension (de)serializers
[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     /** OpenFlow v1.4 wire protocol number */
24     public static final byte OF14_VERSION_ID = 0x05;
25     /** OpenFlow v1.5 wire protocol number */
26     public static final byte OF15_VERSION_ID = 0x06;
27     /** OpenFlow Hello message type value */
28     public static final byte OF_HELLO_MESSAGE_TYPE_VALUE = 0;
29     /** OpenFlow PacketIn message type value */
30     public static final byte OF_PACKETIN_MESSAGE_TYPE_VALUE = 10;
31     /** Index of length in Openflow header */
32     public static final int OFHEADER_LENGTH_INDEX = 2;
33     /** Size of Openflow header */
34     public static final int OFHEADER_SIZE = 8;
35     /** Zero length - used when the length is updated later */
36     public static final int EMPTY_LENGTH = 0;
37
38     /** Length of mac address */
39     public static final byte MAC_ADDRESS_LENGTH = 6;
40     /** Number of groups in ipv4 address */
41     public static final byte GROUPS_IN_IPV4_ADDRESS = 4;
42     /** Number of groups in ipv6 address */
43     public static final byte GROUPS_IN_IPV6_ADDRESS = 8;
44     /** Length of ipv6 address in bytes */
45     public static final byte SIZE_OF_IPV6_ADDRESS_IN_BYTES = (8 * Short.SIZE) / Byte.SIZE;
46
47     /** Length of long in bytes */
48     public static final byte SIZE_OF_LONG_IN_BYTES = Long.SIZE / Byte.SIZE;
49     /** Length of int in bytes */
50     public static final byte SIZE_OF_INT_IN_BYTES = Integer.SIZE / Byte.SIZE;
51     /** Length of short in bytes */
52     public static final byte SIZE_OF_SHORT_IN_BYTES = Short.SIZE / Byte.SIZE;
53     /** Length of byte in bytes */
54     public static final byte SIZE_OF_BYTE_IN_BYTES = Byte.SIZE / Byte.SIZE;
55     /** Length of 3 bytes */
56     public static final byte SIZE_OF_3_BYTES = 3;
57
58     /** Empty (zero) int value */
59     public static final int EMPTY_VALUE = 0;
60     /** Common experimenter value */
61     public static final int EXPERIMENTER_VALUE = 0xFFFF;
62
63     /** OF v1.0 maximal port name length */
64     public static final byte MAX_PORT_NAME_LENGTH = 16;
65
66     /** ONF Approved Extensions Constants */
67     /** Experimenter ID of ONF approved extensions */
68     public static final long ONF_EXPERIMENTER_ID = 0x4F4E4600;
69     /** ONFOXM_ET_TCP_FLAGS value */
70     public static final int ONFOXM_ET_TCP_FLAGS = 42;
71
72     private EncodeConstants() {
73         //not called
74     }
75 }