Remove EncodeConstants.SIZE_OF_{BYTE,SHORT,INT,LONG}_IN_BYTES
[openflowplugin.git] / openflowjava / 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 package org.opendaylight.openflowjava.protocol.api.util;
9
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.yangtools.yang.common.Uint32;
12 import org.opendaylight.yangtools.yang.common.Uint8;
13
14 /**
15  * Stores common constants.
16  *
17  * @author michal.polkorab
18  */
19 public interface EncodeConstants {
20
21     /** Default OF padding (in bytes). */
22     byte PADDING = 8;
23
24     /** OpenFlow v1.0 wire protocol number. */
25     byte OF10_VERSION_ID = 0x01;
26
27     /** OpenFlow v1.0 wire protocol number as Uint8. */
28     @NonNull Uint8 OF_VERSION_1_0 = Uint8.valueOf(OF10_VERSION_ID);
29
30     /** OpenFlow v1.3 wire protocol number. */
31     byte OF13_VERSION_ID = 0x04;
32
33     /** OpenFlow v1.3 wire protocol number as Uint8. */
34     @NonNull Uint8 OF_VERSION_1_3 = Uint8.valueOf(OF13_VERSION_ID);
35
36     /** OpenFlow v1.4 wire protocol number. */
37     byte OF14_VERSION_ID = 0x05;
38
39     /** OpenFlow v1.4 wire protocol number as Uint8. */
40     @NonNull Uint8 OF_VERSION_1_4 = Uint8.valueOf(OF14_VERSION_ID);
41
42     /** OpenFlow v1.5 wire protocol number. */
43     byte OF15_VERSION_ID = 0x06;
44
45     /** OpenFlow v1.5 wire protocol number as Uint8. */
46     @NonNull Uint8 OF_VERSION_1_5 = Uint8.valueOf(OF15_VERSION_ID);
47
48     /** OpenFlow Hello message type value. */
49     byte OF_HELLO_MESSAGE_TYPE_VALUE = 0;
50
51     /** OpenFlow PacketIn message type value. */
52     byte OF_PACKETIN_MESSAGE_TYPE_VALUE = 10;
53
54     /** Index of length in Openflow header. */
55     int OFHEADER_LENGTH_INDEX = 2;
56
57     /** Size of Openflow header. */
58     int OFHEADER_SIZE = 8;
59
60     /** Zero length - used when the length is updated later. */
61     int EMPTY_LENGTH = 0;
62
63     /** Length of mac address. */
64     byte MAC_ADDRESS_LENGTH = 6;
65
66     /** Number of groups in ipv4 address. */
67     byte GROUPS_IN_IPV4_ADDRESS = 4;
68
69     /** Number of groups in ipv6 address. */
70     byte GROUPS_IN_IPV6_ADDRESS = 8;
71
72     /** Length of ipv6 address in bytes. */
73     byte SIZE_OF_IPV6_ADDRESS_IN_BYTES = 8 * Short.SIZE / Byte.SIZE;
74
75     /** Length of 3 bytes. */
76     byte SIZE_OF_3_BYTES = 3;
77
78     /** Empty (zero) int value. */
79     int EMPTY_VALUE = 0;
80
81     /** Common experimenter value. */
82     int EXPERIMENTER_VALUE = 0xFFFF;
83
84     /** OF v1.0 maximal port name length. */
85     byte MAX_PORT_NAME_LENGTH = 16;
86
87     // ONF Approved Extensions Constants.
88
89     /** Experimenter ID of ONF approved extensions. */
90     Uint32 ONF_EXPERIMENTER_ID = Uint32.valueOf(0x4F4E4600).intern();
91
92     /** ONFOXM_ET_TCP_FLAGS value. */
93     int ONFOXM_ET_TCP_FLAGS = 42;
94 }