-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathof.packet
62 lines (54 loc) · 2.01 KB
/
of.packet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Copyright (C) 2013, The Beehive project authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Base openflow packet header.
@bigendian
packet Header {
uint8 version; # P_VERSION.
uint8 type; # One of the PT_ constants.
@size uint16 length; # Length including this ofp_header.
uint32 xid; # Transaction id associated with this packet
# Replies use the same id as was in the request
# to facilitate pairing.
}
enum Versions {
OPENFLOW_1_0 = 0x01, # OpenFlow 1.0.
OPENFLOW_1_1 = 0x02, # OpenFlow 1.1.
OPENFLOW_1_2 = 0x03, # OpenFlow 1.2.
OPENFLOW_1_3 = 0x04 # OpenFlow 1.3.
}
enum Constants {
P_ETH_ALEN = 6, # Bytes in an Ethernet address.
P_IPV4_ALEN = 4,
P_IPV6_ALEN = 16,
P_MAX_PORT_NAME_LEN = 16,
P_MAX_TABLE_NAME_LEN = 32
}
# OpenFlow V1 packet types.
enum Type {
# Immutable messages.
PT_HELLO = 0, # Symmetric message
PT_ERROR = 1, # Symmetric message
PT_ECHO_REQUEST = 2, # Symmetric message
PT_ECHO_REPLY = 3, # Symmetric message
PT_VENDOR = 4, # Symmetric message
# Switch configuration messages.
PT_FEATURES_REQUEST = 5, # Controller/switch message
PT_FEATURES_REPLY = 6, # Controller/switch message
PT_GET_CONFIG_REQUEST = 7, # Controller/switch message
PT_GET_CONFIG_REPLY = 8, # Controller/switch message
PT_SET_CONFIG = 9 # Controller/switch message
}
@type_selector(type = Type.PT_HELLO)
packet Hello(Header) {
}