]>
Commit | Line | Data |
---|---|---|
982697a4 | 1 | /* |
afe8a6c8 | 2 | * Copyright (c) 2012, 2013, 2014, 2015, 2016 Nicira, Inc. |
982697a4 BP |
3 | * |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at: | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | ||
d271907f BW |
17 | #ifndef OPENVSWITCH_OFP_MSGS_H |
18 | #define OPENVSWITCH_OFP_MSGS_H 1 | |
982697a4 BP |
19 | |
20 | /* OpenFlow message headers abstraction. | |
21 | * | |
22 | * OpenFlow headers are unnecessarily complicated: | |
23 | * | |
24 | * - Some messages with the same meaning were renumbered between 1.0 and 1.1. | |
25 | * | |
26 | * - "Statistics" (aka multipart) messages have a different format from other | |
27 | * messages. | |
28 | * | |
29 | * - The 1.0 header for statistics messages is an odd number of 32-bit words | |
30 | * long, leaving 64-bit quantities in the body misaligned. The 1.1 header | |
31 | * for statistics added a padding word to fix this misalignment, although | |
32 | * many statistic message bodies did not change. | |
33 | * | |
34 | * - Vendor-defined messages have an additional header but no standard way to | |
35 | * distinguish individual types of message within a given vendor. | |
36 | * | |
37 | * This file attempts to abstract out the differences between the various forms | |
38 | * of headers. | |
39 | */ | |
40 | ||
e03c096d | 41 | #include "openvswitch/ofp-errors.h" |
982697a4 | 42 | #include "openvswitch/types.h" |
982697a4 | 43 | |
ca6ba700 | 44 | struct ovs_list; |
982697a4 BP |
45 | \f |
46 | /* Raw identifiers for OpenFlow messages. | |
47 | * | |
48 | * Some OpenFlow messages with similar meanings have multiple variants across | |
49 | * OpenFlow versions or vendor extensions. Each variant has a different | |
50 | * OFPRAW_* enumeration constant. More specifically, if two messages have | |
51 | * different types, different numbers, or different arguments, then they must | |
52 | * have different OFPRAW_* values. | |
53 | * | |
54 | * The comments here must follow a stylized form because the "extract-ofp-msgs" | |
55 | * program parses them at build time to generate data tables. The syntax of | |
56 | * each comment is: | |
57 | * | |
58 | * type versions (number): arguments. | |
59 | * | |
60 | * where the syntax of each part is: | |
61 | * | |
2123bc8c BP |
62 | * - type: One of the following: |
63 | * | |
64 | * * OFPT: standard OpenFlow message. | |
65 | * * OFPST: standard OpenFlow statistics or multipart message. | |
66 | * * NXT: Nicira extension message. | |
67 | * * NXST: Nicira extension statistics or multipart message. | |
68 | * * ONFT: Open Networking Foundation extension message. | |
69 | * * ONFST: Open Networking Foundation multipart message. | |
982697a4 BP |
70 | * |
71 | * As new vendors implement extensions it will make sense to expand the | |
72 | * dictionary of possible types. | |
73 | * | |
74 | * - versions: The OpenFlow version or versions in which this message is | |
75 | * supported, e.g. "1.0" or "1.1" or "1.0+". | |
76 | * | |
77 | * - number: | |
78 | * For OFPT, the 'type' in struct ofp_header. | |
79 | * For OFPST, the 'type' in struct ofp_stats_msg or ofp11_stats_msg. | |
2123bc8c BP |
80 | * For NXT or ONFT, the 'subtype' in struct ofp_vendor_header. |
81 | * For NXST or ONFST, the 'subtype' in an appropriate vendor stats | |
82 | * struct. | |
982697a4 BP |
83 | * |
84 | * - arguments: The types of data that follow the OpenFlow headers (the | |
85 | * message "body"). This can be "void" if the message has no body. | |
86 | * Otherwise, it should be a comma-separated sequence of C types. The | |
87 | * last type in the sequence can end with [] if the body ends in a | |
88 | * variable-length sequence. | |
89 | * | |
90 | * The arguments are used to validate the lengths of messages when a | |
91 | * header is parsed. Any message whose length isn't valid as a length of | |
92 | * the specified types will be rejected with OFPERR_OFPBRC_BAD_LEN. | |
93 | * | |
94 | * A few OpenFlow messages, such as OFPT_PACKET_IN, intentionally end with | |
95 | * only part of a structure, up to some specified member. The syntax "up | |
96 | * to <member>" indicates this, e.g. "struct ofp11_packet_in up to data". | |
97 | */ | |
98 | enum ofpraw { | |
cf7cf630 BP |
99 | /* Immutable standard messages. |
100 | * | |
101 | * The OpenFlow standard promises to preserve these messages and their numbers | |
102 | * in future versions, so we mark them as <all>, which covers every OpenFlow | |
103 | * version numbered 0x01...0xff, rather than as OF1.0+, which covers only | |
104 | * OpenFlow versions that we otherwise implement. | |
105 | * | |
106 | * Without <all> here, then we would fail to decode "hello" messages that | |
107 | * announce a version higher than we understand, even though there still could | |
108 | * be a version in common with the peer that we do understand. The <all> | |
109 | * keyword is less useful for the other messages, because our OpenFlow channels | |
110 | * accept only OpenFlow messages with a previously negotiated version. | |
111 | */ | |
982697a4 | 112 | |
cf7cf630 | 113 | /* OFPT <all> (0): uint8_t[]. */ |
982697a4 BP |
114 | OFPRAW_OFPT_HELLO, |
115 | ||
cf7cf630 | 116 | /* OFPT <all> (1): struct ofp_error_msg, uint8_t[]. */ |
982697a4 BP |
117 | OFPRAW_OFPT_ERROR, |
118 | ||
cf7cf630 | 119 | /* OFPT <all> (2): uint8_t[]. */ |
982697a4 BP |
120 | OFPRAW_OFPT_ECHO_REQUEST, |
121 | ||
cf7cf630 | 122 | /* OFPT <all> (3): uint8_t[]. */ |
982697a4 BP |
123 | OFPRAW_OFPT_ECHO_REPLY, |
124 | ||
cf7cf630 BP |
125 | /* Other standard messages. |
126 | * | |
127 | * The meanings of these messages can (and often do) change from one version | |
128 | * of OpenFlow to another. */ | |
129 | ||
982697a4 BP |
130 | /* OFPT 1.0+ (5): void. */ |
131 | OFPRAW_OFPT_FEATURES_REQUEST, | |
132 | ||
133 | /* OFPT 1.0 (6): struct ofp_switch_features, struct ofp10_phy_port[]. */ | |
134 | OFPRAW_OFPT10_FEATURES_REPLY, | |
2e1ae200 | 135 | /* OFPT 1.1-1.2 (6): struct ofp_switch_features, struct ofp11_port[]. */ |
982697a4 | 136 | OFPRAW_OFPT11_FEATURES_REPLY, |
2e1ae200 JR |
137 | /* OFPT 1.3+ (6): struct ofp_switch_features. */ |
138 | OFPRAW_OFPT13_FEATURES_REPLY, | |
982697a4 BP |
139 | |
140 | /* OFPT 1.0+ (7): void. */ | |
141 | OFPRAW_OFPT_GET_CONFIG_REQUEST, | |
142 | ||
143 | /* OFPT 1.0+ (8): struct ofp_switch_config. */ | |
144 | OFPRAW_OFPT_GET_CONFIG_REPLY, | |
145 | ||
65367933 | 146 | /* OFPT 1.0+ (9): struct ofp_switch_config. */ |
982697a4 BP |
147 | OFPRAW_OFPT_SET_CONFIG, |
148 | ||
31a9e63f | 149 | /* OFPT 1.0 (10): struct ofp10_packet_in up to data, uint8_t[]. */ |
982697a4 | 150 | OFPRAW_OFPT10_PACKET_IN, |
31a9e63f | 151 | /* OFPT 1.1 (10): struct ofp11_packet_in, uint8_t[]. */ |
982697a4 | 152 | OFPRAW_OFPT11_PACKET_IN, |
d94240ec SH |
153 | /* OFPT 1.2 (10): struct ofp12_packet_in, uint8_t[]. */ |
154 | OFPRAW_OFPT12_PACKET_IN, | |
43948fa5 | 155 | /* OFPT 1.3+ (10): struct ofp12_packet_in, ovs_be64, uint8_t[]. */ |
2e1ae200 | 156 | OFPRAW_OFPT13_PACKET_IN, |
982697a4 BP |
157 | /* NXT 1.0+ (17): struct nx_packet_in, uint8_t[]. */ |
158 | OFPRAW_NXT_PACKET_IN, | |
6409e008 BP |
159 | /* NXT 1.0+ (30): uint8_t[8][]. */ |
160 | OFPRAW_NXT_PACKET_IN2, | |
982697a4 | 161 | |
31a9e63f | 162 | /* OFPT 1.0 (11): struct ofp10_flow_removed. */ |
982697a4 | 163 | OFPRAW_OFPT10_FLOW_REMOVED, |
83974732 SH |
164 | /* OFPT 1.1+ (11): struct ofp11_flow_removed, uint8_t[8][]. */ |
165 | OFPRAW_OFPT11_FLOW_REMOVED, | |
982697a4 BP |
166 | /* NXT 1.0+ (14): struct nx_flow_removed, uint8_t[8][]. */ |
167 | OFPRAW_NXT_FLOW_REMOVED, | |
168 | ||
169 | /* OFPT 1.0 (12): struct ofp_port_status, struct ofp10_phy_port. */ | |
170 | OFPRAW_OFPT10_PORT_STATUS, | |
8c3cc785 | 171 | /* OFPT 1.1-1.3 (12): struct ofp_port_status, struct ofp11_port. */ |
982697a4 | 172 | OFPRAW_OFPT11_PORT_STATUS, |
8c3cc785 BP |
173 | /* OFPT 1.4+ (12): struct ofp_port_status, struct ofp14_port, uint8_t[8][]. */ |
174 | OFPRAW_OFPT14_PORT_STATUS, | |
982697a4 | 175 | |
31a9e63f | 176 | /* OFPT 1.0 (13): struct ofp10_packet_out, uint8_t[]. */ |
982697a4 BP |
177 | OFPRAW_OFPT10_PACKET_OUT, |
178 | /* OFPT 1.1+ (13): struct ofp11_packet_out, uint8_t[]. */ | |
179 | OFPRAW_OFPT11_PACKET_OUT, | |
180 | ||
c2d936a4 | 181 | /* OFPT 1.0 (14): struct ofp10_flow_mod, uint8_t[8][]. */ |
982697a4 BP |
182 | OFPRAW_OFPT10_FLOW_MOD, |
183 | /* OFPT 1.1+ (14): struct ofp11_flow_mod, struct ofp11_instruction[]. */ | |
184 | OFPRAW_OFPT11_FLOW_MOD, | |
185 | /* NXT 1.0+ (13): struct nx_flow_mod, uint8_t[8][]. */ | |
186 | OFPRAW_NXT_FLOW_MOD, | |
187 | ||
18ac06d3 | 188 | /* OFPT 1.1-1.4 (15): struct ofp11_group_mod, uint8_t[8][]. */ |
7395c052 | 189 | OFPRAW_OFPT11_GROUP_MOD, |
18ac06d3 SH |
190 | /* OFPT 1.5+ (15): struct ofp15_group_mod, uint8_t[8][]. */ |
191 | OFPRAW_OFPT15_GROUP_MOD, | |
7395c052 | 192 | |
982697a4 BP |
193 | /* OFPT 1.0 (15): struct ofp10_port_mod. */ |
194 | OFPRAW_OFPT10_PORT_MOD, | |
18cc69d9 | 195 | /* OFPT 1.1-1.3 (16): struct ofp11_port_mod. */ |
982697a4 | 196 | OFPRAW_OFPT11_PORT_MOD, |
18cc69d9 BP |
197 | /* OFPT 1.4+ (16): struct ofp14_port_mod, uint8_t[8][]. */ |
198 | OFPRAW_OFPT14_PORT_MOD, | |
982697a4 | 199 | |
37ab26e8 | 200 | /* OFPT 1.1-1.3 (17): struct ofp11_table_mod. */ |
918f2b82 | 201 | OFPRAW_OFPT11_TABLE_MOD, |
37ab26e8 BP |
202 | /* OFPT 1.4+ (17): struct ofp14_table_mod, uint8_t[8][]. */ |
203 | OFPRAW_OFPT14_TABLE_MOD, | |
918f2b82 | 204 | |
982697a4 BP |
205 | /* OFPT 1.0 (18): void. */ |
206 | OFPRAW_OFPT10_BARRIER_REQUEST, | |
58cf43df | 207 | /* OFPT 1.1+ (20): void. */ |
982697a4 BP |
208 | OFPRAW_OFPT11_BARRIER_REQUEST, |
209 | ||
210 | /* OFPT 1.0 (19): void. */ | |
211 | OFPRAW_OFPT10_BARRIER_REPLY, | |
58cf43df | 212 | /* OFPT 1.1+ (21): void. */ |
982697a4 BP |
213 | OFPRAW_OFPT11_BARRIER_REPLY, |
214 | ||
2ffc8767 | 215 | /* OFPT 1.0 (20): struct ofp10_queue_get_config_request. */ |
e8f9a7bb | 216 | OFPRAW_OFPT10_QUEUE_GET_CONFIG_REQUEST, |
e016fb63 | 217 | /* OFPT 1.1-1.3 (22): struct ofp11_queue_get_config_request. */ |
c545d38d JR |
218 | OFPRAW_OFPT11_QUEUE_GET_CONFIG_REQUEST, |
219 | ||
2ffc8767 | 220 | /* OFPT 1.0 (21): struct ofp10_queue_get_config_reply, uint8_t[8][]. */ |
e8f9a7bb | 221 | OFPRAW_OFPT10_QUEUE_GET_CONFIG_REPLY, |
e016fb63 | 222 | /* OFPT 1.1-1.3 (23): struct ofp11_queue_get_config_reply, uint8_t[8][]. */ |
c545d38d JR |
223 | OFPRAW_OFPT11_QUEUE_GET_CONFIG_REPLY, |
224 | ||
6ea4776b JR |
225 | /* OFPT 1.2+ (24): struct ofp12_role_request. */ |
226 | OFPRAW_OFPT12_ROLE_REQUEST, | |
227 | /* NXT 1.0+ (10): struct nx_role_request. */ | |
228 | OFPRAW_NXT_ROLE_REQUEST, | |
229 | ||
230 | /* OFPT 1.2+ (25): struct ofp12_role_request. */ | |
231 | OFPRAW_OFPT12_ROLE_REPLY, | |
232 | /* NXT 1.0+ (11): struct nx_role_request. */ | |
233 | OFPRAW_NXT_ROLE_REPLY, | |
234 | ||
98090482 | 235 | /* OFPT 1.3 (26): void. */ |
2e1ae200 | 236 | OFPRAW_OFPT13_GET_ASYNC_REQUEST, |
98090482 NR |
237 | /* OFPT 1.4+ (26): void. */ |
238 | OFPRAW_OFPT14_GET_ASYNC_REQUEST, | |
239 | /* OFPT 1.3 (27): struct ofp13_async_config. */ | |
2e1ae200 | 240 | OFPRAW_OFPT13_GET_ASYNC_REPLY, |
afe8a6c8 | 241 | /* OFPT 1.4+ (27): uint8_t[8][]. */ |
98090482 NR |
242 | OFPRAW_OFPT14_GET_ASYNC_REPLY, |
243 | /* OFPT 1.3 (28): struct ofp13_async_config. */ | |
2e1ae200 JR |
244 | OFPRAW_OFPT13_SET_ASYNC, |
245 | /* NXT 1.0+ (19): struct nx_async_config. */ | |
246 | OFPRAW_NXT_SET_ASYNC_CONFIG, | |
af7bc161 BP |
247 | /* NXT 1.0-1.3 (27): uint8_t[8][]. */ |
248 | OFPRAW_NXT_SET_ASYNC_CONFIG2, | |
afe8a6c8 | 249 | /* OFPT 1.4+ (28): uint8_t[8][]. */ |
98090482 | 250 | OFPRAW_OFPT14_SET_ASYNC, |
2e1ae200 | 251 | |
638a19b0 | 252 | /* OFPT 1.3+ (29): struct ofp13_meter_mod, uint8_t[8][]. */ |
2e1ae200 JR |
253 | OFPRAW_OFPT13_METER_MOD, |
254 | ||
252f3411 AC |
255 | /* OFPT 1.4+ (30): struct ofp14_role_status, uint8_t[8][]. */ |
256 | OFPRAW_OFPT14_ROLE_STATUS, | |
257 | ||
6c6eedc5 SJ |
258 | /* OFPT 1.4+ (31): struct ofp14_table_status, uint8_t[8][]. */ |
259 | OFPRAW_OFPT14_TABLE_STATUS, | |
260 | ||
3c35db62 NR |
261 | /* OFPT 1.4+ (32): struct ofp14_requestforward, uint8_t[8][]. */ |
262 | OFPRAW_OFPT14_REQUESTFORWARD, | |
263 | ||
777af88d AC |
264 | /* OFPT 1.4+ (33): struct ofp14_bundle_ctrl_msg, uint8_t[8][]. */ |
265 | OFPRAW_OFPT14_BUNDLE_CONTROL, | |
06d4d4b6 JR |
266 | /* ONFT 1.3 (2300): struct ofp14_bundle_ctrl_msg, uint8_t[8][]. */ |
267 | OFPRAW_ONFT13_BUNDLE_CONTROL, | |
777af88d AC |
268 | |
269 | /* OFPT 1.4+ (34): struct ofp14_bundle_ctrl_msg, uint8_t[]. */ | |
270 | OFPRAW_OFPT14_BUNDLE_ADD_MESSAGE, | |
06d4d4b6 JR |
271 | /* ONFT 1.3 (2301): struct ofp14_bundle_ctrl_msg, uint8_t[]. */ |
272 | OFPRAW_ONFT13_BUNDLE_ADD_MESSAGE, | |
777af88d | 273 | |
982697a4 BP |
274 | /* Standard statistics. */ |
275 | ||
276 | /* OFPST 1.0+ (0): void. */ | |
277 | OFPRAW_OFPST_DESC_REQUEST, | |
278 | ||
279 | /* OFPST 1.0+ (0): struct ofp_desc_stats. */ | |
280 | OFPRAW_OFPST_DESC_REPLY, | |
281 | ||
e2b9ac44 | 282 | /* OFPST 1.0 (1): struct ofp10_flow_stats_request. */ |
cfc23141 SH |
283 | OFPRAW_OFPST10_FLOW_REQUEST, |
284 | /* OFPST 1.1+ (1): struct ofp11_flow_stats_request, uint8_t[8][]. */ | |
285 | OFPRAW_OFPST11_FLOW_REQUEST, | |
982697a4 BP |
286 | /* NXST 1.0 (0): struct nx_flow_stats_request, uint8_t[8][]. */ |
287 | OFPRAW_NXST_FLOW_REQUEST, | |
288 | ||
289 | /* OFPST 1.0 (1): uint8_t[]. */ | |
cfc23141 | 290 | OFPRAW_OFPST10_FLOW_REPLY, |
2e1ae200 | 291 | /* OFPST 1.1-1.2 (1): uint8_t[]. */ |
cfc23141 | 292 | OFPRAW_OFPST11_FLOW_REPLY, |
2e1ae200 JR |
293 | /* OFPST 1.3+ (1): uint8_t[]. */ |
294 | OFPRAW_OFPST13_FLOW_REPLY, | |
982697a4 BP |
295 | /* NXST 1.0 (0): uint8_t[]. */ |
296 | OFPRAW_NXST_FLOW_REPLY, | |
297 | ||
e2b9ac44 | 298 | /* OFPST 1.0 (2): struct ofp10_flow_stats_request. */ |
617da9cd SH |
299 | OFPRAW_OFPST10_AGGREGATE_REQUEST, |
300 | /* OFPST 1.1+ (2): struct ofp11_flow_stats_request, uint8_t[8][]. */ | |
301 | OFPRAW_OFPST11_AGGREGATE_REQUEST, | |
982697a4 BP |
302 | /* NXST 1.0 (1): struct nx_flow_stats_request, uint8_t[8][]. */ |
303 | OFPRAW_NXST_AGGREGATE_REQUEST, | |
304 | ||
617da9cd | 305 | /* OFPST 1.0+ (2): struct ofp_aggregate_stats_reply. */ |
982697a4 | 306 | OFPRAW_OFPST_AGGREGATE_REPLY, |
a814ba0f | 307 | /* NXST 1.0 (1): struct ofp_aggregate_stats_reply. */ |
982697a4 BP |
308 | OFPRAW_NXST_AGGREGATE_REPLY, |
309 | ||
2e1ae200 | 310 | /* OFPST 1.0+ (3): void. */ |
982697a4 BP |
311 | OFPRAW_OFPST_TABLE_REQUEST, |
312 | ||
e2b9ac44 | 313 | /* OFPST 1.0 (3): struct ofp10_table_stats[]. */ |
16fdae54 SH |
314 | OFPRAW_OFPST10_TABLE_REPLY, |
315 | /* OFPST 1.1 (3): struct ofp11_table_stats[]. */ | |
316 | OFPRAW_OFPST11_TABLE_REPLY, | |
317 | /* OFPST 1.2 (3): struct ofp12_table_stats[]. */ | |
318 | OFPRAW_OFPST12_TABLE_REPLY, | |
c37c0382 | 319 | /* OFPST 1.3+ (3): struct ofp13_table_stats[]. */ |
2e1ae200 | 320 | OFPRAW_OFPST13_TABLE_REPLY, |
982697a4 | 321 | |
e2b9ac44 | 322 | /* OFPST 1.0 (4): struct ofp10_port_stats_request. */ |
f8e4867e SH |
323 | OFPRAW_OFPST10_PORT_REQUEST, |
324 | /* OFPST 1.1+ (4): struct ofp11_port_stats_request. */ | |
325 | OFPRAW_OFPST11_PORT_REQUEST, | |
982697a4 | 326 | |
e2b9ac44 | 327 | /* OFPST 1.0 (4): struct ofp10_port_stats[]. */ |
f8e4867e | 328 | OFPRAW_OFPST10_PORT_REPLY, |
2e1ae200 | 329 | /* OFPST 1.1-1.2 (4): struct ofp11_port_stats[]. */ |
f8e4867e | 330 | OFPRAW_OFPST11_PORT_REPLY, |
5469537b | 331 | /* OFPST 1.3 (4): struct ofp13_port_stats[]. */ |
2e1ae200 | 332 | OFPRAW_OFPST13_PORT_REPLY, |
5469537b BP |
333 | /* OFPST 1.4+ (4): uint8_t[8][]. */ |
334 | OFPRAW_OFPST14_PORT_REPLY, | |
982697a4 | 335 | |
e2b9ac44 | 336 | /* OFPST 1.0 (5): struct ofp10_queue_stats_request. */ |
64626975 SH |
337 | OFPRAW_OFPST10_QUEUE_REQUEST, |
338 | /* OFPST 1.1+ (5): struct ofp11_queue_stats_request. */ | |
339 | OFPRAW_OFPST11_QUEUE_REQUEST, | |
982697a4 | 340 | |
e2b9ac44 | 341 | /* OFPST 1.0 (5): struct ofp10_queue_stats[]. */ |
64626975 | 342 | OFPRAW_OFPST10_QUEUE_REPLY, |
2e1ae200 | 343 | /* OFPST 1.1-1.2 (5): struct ofp11_queue_stats[]. */ |
64626975 | 344 | OFPRAW_OFPST11_QUEUE_REPLY, |
1bb2cdbe | 345 | /* OFPST 1.3 (5): struct ofp13_queue_stats[]. */ |
2e1ae200 | 346 | OFPRAW_OFPST13_QUEUE_REPLY, |
1bb2cdbe BP |
347 | /* OFPST 1.4+ (5): uint8_t[8][]. */ |
348 | OFPRAW_OFPST14_QUEUE_REPLY, | |
2e1ae200 JR |
349 | |
350 | /* OFPST 1.1+ (6): struct ofp11_group_stats_request. */ | |
351 | OFPRAW_OFPST11_GROUP_REQUEST, | |
352 | ||
7395c052 | 353 | /* OFPST 1.1-1.2 (6): uint8_t[8][]. */ |
2e1ae200 | 354 | OFPRAW_OFPST11_GROUP_REPLY, |
c37c0382 | 355 | /* OFPST 1.3+ (6): uint8_t[8][]. */ |
2e1ae200 JR |
356 | OFPRAW_OFPST13_GROUP_REPLY, |
357 | ||
19187a71 | 358 | /* OFPST 1.1-1.4 (7): void. */ |
2e1ae200 | 359 | OFPRAW_OFPST11_GROUP_DESC_REQUEST, |
d4d3f33e | 360 | /* OFPST 1.5+ (7): struct ofp15_group_desc_request. */ |
19187a71 | 361 | OFPRAW_OFPST15_GROUP_DESC_REQUEST, |
2e1ae200 | 362 | |
7395c052 | 363 | /* OFPST 1.1+ (7): uint8_t[8][]. */ |
2e1ae200 JR |
364 | OFPRAW_OFPST11_GROUP_DESC_REPLY, |
365 | ||
366 | /* OFPST 1.2+ (8): void. */ | |
367 | OFPRAW_OFPST12_GROUP_FEATURES_REQUEST, | |
368 | ||
369 | /* OFPST 1.2+ (8): struct ofp12_group_features_stats. */ | |
370 | OFPRAW_OFPST12_GROUP_FEATURES_REPLY, | |
371 | ||
372 | /* OFPST 1.3+ (9): struct ofp13_meter_multipart_request. */ | |
373 | OFPRAW_OFPST13_METER_REQUEST, | |
374 | ||
638a19b0 | 375 | /* OFPST 1.3+ (9): uint8_t[8][]. */ |
2e1ae200 JR |
376 | OFPRAW_OFPST13_METER_REPLY, |
377 | ||
378 | /* OFPST 1.3+ (10): struct ofp13_meter_multipart_request. */ | |
379 | OFPRAW_OFPST13_METER_CONFIG_REQUEST, | |
380 | ||
638a19b0 | 381 | /* OFPST 1.3+ (10): uint8_t[8][]. */ |
2e1ae200 JR |
382 | OFPRAW_OFPST13_METER_CONFIG_REPLY, |
383 | ||
384 | /* OFPST 1.3+ (11): void. */ | |
385 | OFPRAW_OFPST13_METER_FEATURES_REQUEST, | |
386 | ||
387 | /* OFPST 1.3+ (11): struct ofp13_meter_features. */ | |
388 | OFPRAW_OFPST13_METER_FEATURES_REPLY, | |
389 | ||
2cd0c475 | 390 | /* OFPST 1.3+ (12): void. */ |
2e1ae200 JR |
391 | OFPRAW_OFPST13_TABLE_FEATURES_REQUEST, |
392 | ||
2cd0c475 | 393 | /* OFPST 1.3+ (12): struct ofp13_table_features, uint8_t[8][]. */ |
2e1ae200 | 394 | OFPRAW_OFPST13_TABLE_FEATURES_REPLY, |
982697a4 | 395 | |
a634c531 | 396 | /* OFPST 1.4+ (14): void. */ |
03c72922 BP |
397 | OFPRAW_OFPST14_TABLE_DESC_REQUEST, |
398 | ||
a634c531 | 399 | /* OFPST 1.4+ (14): struct ofp14_table_desc, uint8_t[8][]. */ |
03c72922 BP |
400 | OFPRAW_OFPST14_TABLE_DESC_REPLY, |
401 | ||
70ae4f93 BP |
402 | /* OFPST 1.0-1.4 (13): void. */ |
403 | OFPRAW_OFPST10_PORT_DESC_REQUEST, | |
7448d548 | 404 | /* OFPST 1.5+ (13): struct ofp15_port_desc_request. */ |
70ae4f93 | 405 | OFPRAW_OFPST15_PORT_DESC_REQUEST, |
982697a4 BP |
406 | |
407 | /* OFPST 1.0 (13): struct ofp10_phy_port[]. */ | |
56de7118 | 408 | OFPRAW_OFPST10_PORT_DESC_REPLY, |
8c3cc785 | 409 | /* OFPST 1.1-1.3 (13): struct ofp11_port[]. */ |
56de7118 | 410 | OFPRAW_OFPST11_PORT_DESC_REPLY, |
8c3cc785 BP |
411 | /* OFPST 1.4+ (13): uint8_t[8][]. */ |
412 | OFPRAW_OFPST14_PORT_DESC_REPLY, | |
982697a4 | 413 | |
e016fb63 BP |
414 | /* OFPST 1.4+ (15): struct ofp14_queue_desc_request. */ |
415 | OFPRAW_OFPST14_QUEUE_DESC_REQUEST, | |
416 | /* OFPST 1.4+ (15): uint8_t[8][]. */ | |
417 | OFPRAW_OFPST14_QUEUE_DESC_REPLY, | |
418 | ||
f4b5d368 SH |
419 | /* OFPST 1.4+ (16): uint8_t[8][]. */ |
420 | OFPRAW_OFPST14_FLOW_MONITOR_REQUEST, | |
421 | /* NXST 1.0 (2): uint8_t[8][]. */ | |
422 | OFPRAW_NXST_FLOW_MONITOR_REQUEST, | |
423 | ||
424 | /* OFPST 1.4+ (16): uint8_t[8][]. */ | |
425 | OFPRAW_OFPST14_FLOW_MONITOR_REPLY, | |
426 | /* NXST 1.0 (2): uint8_t[8][]. */ | |
427 | OFPRAW_NXST_FLOW_MONITOR_REPLY, | |
428 | ||
982697a4 BP |
429 | /* Nicira extension messages. |
430 | * | |
431 | * Nicira extensions that correspond to standard OpenFlow messages are listed | |
432 | * alongside the standard versions above. */ | |
433 | ||
310f3699 | 434 | /* NXT 1.0 (12): struct nx_set_flow_format. */ |
982697a4 BP |
435 | OFPRAW_NXT_SET_FLOW_FORMAT, |
436 | ||
437 | /* NXT 1.0+ (15): struct nx_flow_mod_table_id. */ | |
438 | OFPRAW_NXT_FLOW_MOD_TABLE_ID, | |
439 | ||
440 | /* NXT 1.0+ (16): struct nx_set_packet_in_format. */ | |
441 | OFPRAW_NXT_SET_PACKET_IN_FORMAT, | |
442 | ||
443 | /* NXT 1.0+ (18): void. */ | |
444 | OFPRAW_NXT_FLOW_AGE, | |
445 | ||
982697a4 BP |
446 | /* NXT 1.0+ (20): struct nx_controller_id. */ |
447 | OFPRAW_NXT_SET_CONTROLLER_ID, | |
448 | ||
449 | /* NXT 1.0+ (21): struct nx_flow_monitor_cancel. */ | |
450 | OFPRAW_NXT_FLOW_MONITOR_CANCEL, | |
451 | ||
452 | /* NXT 1.0+ (22): void. */ | |
453 | OFPRAW_NXT_FLOW_MONITOR_PAUSED, | |
454 | ||
455 | /* NXT 1.0+ (23): void. */ | |
456 | OFPRAW_NXT_FLOW_MONITOR_RESUMED, | |
6159c531 | 457 | |
4e548ad9 ML |
458 | /* NXT 1.0+ (24): struct nx_tlv_table_mod, struct nx_tlv_map[]. */ |
459 | OFPRAW_NXT_TLV_TABLE_MOD, | |
6159c531 JG |
460 | |
461 | /* NXT 1.0+ (25): void. */ | |
4e548ad9 | 462 | OFPRAW_NXT_TLV_TABLE_REQUEST, |
6159c531 | 463 | |
4e548ad9 ML |
464 | /* NXT 1.0+ (26): struct nx_tlv_table_reply, struct nx_tlv_map[]. */ |
465 | OFPRAW_NXT_TLV_TABLE_REPLY, | |
77ab5fd2 BP |
466 | |
467 | /* NXT 1.0+ (28): uint8_t[8][]. */ | |
468 | OFPRAW_NXT_RESUME, | |
fb8f22c1 | 469 | |
2a7c4805 JP |
470 | /* NXT 1.0+ (29): struct nx_zone_id. */ |
471 | OFPRAW_NXT_CT_FLUSH_ZONE, | |
472 | ||
fb8f22c1 BY |
473 | /* NXST 1.0+ (3): void. */ |
474 | OFPRAW_NXST_IPFIX_BRIDGE_REQUEST, | |
475 | ||
476 | /* NXST 1.0+ (3): struct nx_ipfix_stats_reply. */ | |
477 | OFPRAW_NXST_IPFIX_BRIDGE_REPLY, | |
478 | ||
479 | /* NXST 1.0+ (4): void. */ | |
480 | OFPRAW_NXST_IPFIX_FLOW_REQUEST, | |
481 | ||
482 | /* NXST 1.0+ (4): struct nx_ipfix_stats_reply[]. */ | |
483 | OFPRAW_NXST_IPFIX_FLOW_REPLY, | |
982697a4 BP |
484 | }; |
485 | ||
486 | /* Decoding messages into OFPRAW_* values. */ | |
487 | enum ofperr ofpraw_decode(enum ofpraw *, const struct ofp_header *); | |
964a5f60 | 488 | enum ofpraw ofpraw_decode_assert(const struct ofp_header *); |
982697a4 BP |
489 | enum ofperr ofpraw_pull(enum ofpraw *, struct ofpbuf *); |
490 | enum ofpraw ofpraw_pull_assert(struct ofpbuf *); | |
491 | ||
492 | enum ofperr ofpraw_decode_partial(enum ofpraw *, | |
493 | const struct ofp_header *, size_t length); | |
494 | ||
495 | /* Encoding messages using OFPRAW_* values. */ | |
496 | struct ofpbuf *ofpraw_alloc(enum ofpraw, uint8_t ofp_version, | |
497 | size_t extra_tailroom); | |
498 | struct ofpbuf *ofpraw_alloc_xid(enum ofpraw, uint8_t ofp_version, | |
499 | ovs_be32 xid, size_t extra_tailroom); | |
500 | struct ofpbuf *ofpraw_alloc_reply(enum ofpraw, | |
501 | const struct ofp_header *request, | |
502 | size_t extra_tailroom); | |
503 | struct ofpbuf *ofpraw_alloc_stats_reply(const struct ofp_header *request, | |
504 | size_t extra_tailroom); | |
505 | ||
506 | void ofpraw_put(enum ofpraw, uint8_t ofp_version, struct ofpbuf *); | |
507 | void ofpraw_put_xid(enum ofpraw, uint8_t ofp_version, ovs_be32 xid, | |
508 | struct ofpbuf *); | |
509 | void ofpraw_put_reply(enum ofpraw, const struct ofp_header *request, | |
510 | struct ofpbuf *); | |
511 | void ofpraw_put_stats_reply(const struct ofp_header *request, struct ofpbuf *); | |
512 | ||
513 | /* Information about OFPRAW_* values. */ | |
514 | const char *ofpraw_get_name(enum ofpraw); | |
515 | enum ofpraw ofpraw_stats_request_to_reply(enum ofpraw, uint8_t version); | |
516 | \f | |
517 | /* Semantic identifiers for OpenFlow messages. | |
518 | * | |
519 | * Each OFPTYPE_* enumeration constant represents one or more concrete format | |
520 | * of OpenFlow message. When two variants of a message have essentially the | |
521 | * same meaning, they are assigned a single OFPTYPE_* value. | |
522 | * | |
523 | * The comments here must follow a stylized form because the "extract-ofp-msgs" | |
524 | * program parses them at build time to generate data tables. The format is | |
525 | * simply to list each OFPRAW_* enumeration constant for a given OFPTYPE_*, | |
526 | * each followed by a period. */ | |
527 | enum ofptype { | |
528 | /* Immutable messages. */ | |
529 | OFPTYPE_HELLO, /* OFPRAW_OFPT_HELLO. */ | |
530 | OFPTYPE_ERROR, /* OFPRAW_OFPT_ERROR. */ | |
531 | OFPTYPE_ECHO_REQUEST, /* OFPRAW_OFPT_ECHO_REQUEST. */ | |
532 | OFPTYPE_ECHO_REPLY, /* OFPRAW_OFPT_ECHO_REPLY. */ | |
533 | ||
534 | /* Switch configuration messages. */ | |
535 | OFPTYPE_FEATURES_REQUEST, /* OFPRAW_OFPT_FEATURES_REQUEST. */ | |
536 | OFPTYPE_FEATURES_REPLY, /* OFPRAW_OFPT10_FEATURES_REPLY. | |
2e1ae200 JR |
537 | * OFPRAW_OFPT11_FEATURES_REPLY. |
538 | * OFPRAW_OFPT13_FEATURES_REPLY. */ | |
982697a4 BP |
539 | OFPTYPE_GET_CONFIG_REQUEST, /* OFPRAW_OFPT_GET_CONFIG_REQUEST. */ |
540 | OFPTYPE_GET_CONFIG_REPLY, /* OFPRAW_OFPT_GET_CONFIG_REPLY. */ | |
541 | OFPTYPE_SET_CONFIG, /* OFPRAW_OFPT_SET_CONFIG. */ | |
542 | ||
543 | /* Asynchronous messages. */ | |
544 | OFPTYPE_PACKET_IN, /* OFPRAW_OFPT10_PACKET_IN. | |
545 | * OFPRAW_OFPT11_PACKET_IN. | |
d94240ec | 546 | * OFPRAW_OFPT12_PACKET_IN. |
2e1ae200 | 547 | * OFPRAW_OFPT13_PACKET_IN. |
6409e008 | 548 | * OFPRAW_NXT_PACKET_IN2. |
982697a4 BP |
549 | * OFPRAW_NXT_PACKET_IN. */ |
550 | OFPTYPE_FLOW_REMOVED, /* OFPRAW_OFPT10_FLOW_REMOVED. | |
83974732 | 551 | * OFPRAW_OFPT11_FLOW_REMOVED. |
982697a4 BP |
552 | * OFPRAW_NXT_FLOW_REMOVED. */ |
553 | OFPTYPE_PORT_STATUS, /* OFPRAW_OFPT10_PORT_STATUS. | |
8c3cc785 BP |
554 | * OFPRAW_OFPT11_PORT_STATUS. |
555 | * OFPRAW_OFPT14_PORT_STATUS. */ | |
982697a4 BP |
556 | |
557 | /* Controller command messages. */ | |
558 | OFPTYPE_PACKET_OUT, /* OFPRAW_OFPT10_PACKET_OUT. | |
559 | * OFPRAW_OFPT11_PACKET_OUT. */ | |
560 | OFPTYPE_FLOW_MOD, /* OFPRAW_OFPT10_FLOW_MOD. | |
561 | * OFPRAW_OFPT11_FLOW_MOD. | |
562 | * OFPRAW_NXT_FLOW_MOD. */ | |
18ac06d3 SH |
563 | OFPTYPE_GROUP_MOD, /* OFPRAW_OFPT11_GROUP_MOD. |
564 | * OFPRAW_OFPT15_GROUP_MOD. */ | |
982697a4 | 565 | OFPTYPE_PORT_MOD, /* OFPRAW_OFPT10_PORT_MOD. |
18cc69d9 BP |
566 | * OFPRAW_OFPT11_PORT_MOD. |
567 | * OFPRAW_OFPT14_PORT_MOD. */ | |
37ab26e8 BP |
568 | OFPTYPE_TABLE_MOD, /* OFPRAW_OFPT11_TABLE_MOD. |
569 | * OFPRAW_OFPT14_TABLE_MOD. */ | |
982697a4 BP |
570 | |
571 | /* Barrier messages. */ | |
572 | OFPTYPE_BARRIER_REQUEST, /* OFPRAW_OFPT10_BARRIER_REQUEST. | |
573 | * OFPRAW_OFPT11_BARRIER_REQUEST. */ | |
574 | OFPTYPE_BARRIER_REPLY, /* OFPRAW_OFPT10_BARRIER_REPLY. | |
575 | * OFPRAW_OFPT11_BARRIER_REPLY. */ | |
576 | ||
c545d38d | 577 | /* Queue Configuration messages. */ |
e8f9a7bb | 578 | OFPTYPE_QUEUE_GET_CONFIG_REQUEST, /* OFPRAW_OFPT10_QUEUE_GET_CONFIG_REQUEST. |
e016fb63 BP |
579 | * OFPRAW_OFPT11_QUEUE_GET_CONFIG_REQUEST. |
580 | * OFPRAW_OFPST14_QUEUE_DESC_REQUEST. */ | |
e8f9a7bb | 581 | OFPTYPE_QUEUE_GET_CONFIG_REPLY, /* OFPRAW_OFPT10_QUEUE_GET_CONFIG_REPLY. |
e016fb63 BP |
582 | * OFPRAW_OFPT11_QUEUE_GET_CONFIG_REPLY. |
583 | * OFPRAW_OFPST14_QUEUE_DESC_REPLY. */ | |
c545d38d | 584 | |
6ea4776b JR |
585 | /* Controller role change request messages. */ |
586 | OFPTYPE_ROLE_REQUEST, /* OFPRAW_OFPT12_ROLE_REQUEST. | |
587 | * OFPRAW_NXT_ROLE_REQUEST. */ | |
588 | OFPTYPE_ROLE_REPLY, /* OFPRAW_OFPT12_ROLE_REPLY. | |
589 | * OFPRAW_NXT_ROLE_REPLY. */ | |
590 | ||
2e1ae200 | 591 | /* Asynchronous message configuration. */ |
98090482 NR |
592 | OFPTYPE_GET_ASYNC_REQUEST, /* OFPRAW_OFPT13_GET_ASYNC_REQUEST. |
593 | * OFPRAW_OFPT14_GET_ASYNC_REQUEST. */ | |
594 | OFPTYPE_GET_ASYNC_REPLY, /* OFPRAW_OFPT13_GET_ASYNC_REPLY. | |
595 | * OFPRAW_OFPT14_GET_ASYNC_REPLY. */ | |
2e1ae200 | 596 | OFPTYPE_SET_ASYNC_CONFIG, /* OFPRAW_NXT_SET_ASYNC_CONFIG. |
af7bc161 | 597 | * OFPRAW_NXT_SET_ASYNC_CONFIG2. |
98090482 NR |
598 | * OFPRAW_OFPT13_SET_ASYNC. |
599 | * OFPRAW_OFPT14_SET_ASYNC. */ | |
2e1ae200 JR |
600 | |
601 | /* Meters and rate limiters configuration messages. */ | |
602 | OFPTYPE_METER_MOD, /* OFPRAW_OFPT13_METER_MOD. */ | |
603 | ||
252f3411 AC |
604 | /* Controller role change event messages. */ |
605 | OFPTYPE_ROLE_STATUS, /* OFPRAW_OFPT14_ROLE_STATUS. */ | |
606 | ||
3c35db62 NR |
607 | /* Request forwarding by the switch. */ |
608 | OFPTYPE_REQUESTFORWARD, /* OFPRAW_OFPT14_REQUESTFORWARD. */ | |
609 | ||
6c6eedc5 SJ |
610 | /* Asynchronous messages. */ |
611 | OFPTYPE_TABLE_STATUS, /* OFPRAW_OFPT14_TABLE_STATUS. */ | |
612 | ||
06d4d4b6 JR |
613 | OFPTYPE_BUNDLE_CONTROL, /* OFPRAW_OFPT14_BUNDLE_CONTROL. |
614 | * OFPRAW_ONFT13_BUNDLE_CONTROL. */ | |
777af88d | 615 | |
06d4d4b6 JR |
616 | OFPTYPE_BUNDLE_ADD_MESSAGE, /* OFPRAW_OFPT14_BUNDLE_ADD_MESSAGE. |
617 | * OFPRAW_ONFT13_BUNDLE_ADD_MESSAGE. */ | |
777af88d | 618 | |
982697a4 BP |
619 | /* Statistics. */ |
620 | OFPTYPE_DESC_STATS_REQUEST, /* OFPRAW_OFPST_DESC_REQUEST. */ | |
621 | OFPTYPE_DESC_STATS_REPLY, /* OFPRAW_OFPST_DESC_REPLY. */ | |
cfc23141 SH |
622 | OFPTYPE_FLOW_STATS_REQUEST, /* OFPRAW_OFPST10_FLOW_REQUEST. |
623 | * OFPRAW_OFPST11_FLOW_REQUEST. | |
982697a4 | 624 | * OFPRAW_NXST_FLOW_REQUEST. */ |
cfc23141 SH |
625 | OFPTYPE_FLOW_STATS_REPLY, /* OFPRAW_OFPST10_FLOW_REPLY. |
626 | * OFPRAW_OFPST11_FLOW_REPLY. | |
2e1ae200 | 627 | * OFPRAW_OFPST13_FLOW_REPLY. |
982697a4 | 628 | * OFPRAW_NXST_FLOW_REPLY. */ |
617da9cd SH |
629 | OFPTYPE_AGGREGATE_STATS_REQUEST, /* OFPRAW_OFPST10_AGGREGATE_REQUEST. |
630 | * OFPRAW_OFPST11_AGGREGATE_REQUEST. | |
982697a4 BP |
631 | * OFPRAW_NXST_AGGREGATE_REQUEST. */ |
632 | OFPTYPE_AGGREGATE_STATS_REPLY, /* OFPRAW_OFPST_AGGREGATE_REPLY. | |
633 | * OFPRAW_NXST_AGGREGATE_REPLY. */ | |
634 | OFPTYPE_TABLE_STATS_REQUEST, /* OFPRAW_OFPST_TABLE_REQUEST. */ | |
16fdae54 SH |
635 | OFPTYPE_TABLE_STATS_REPLY, /* OFPRAW_OFPST10_TABLE_REPLY. |
636 | * OFPRAW_OFPST11_TABLE_REPLY. | |
2e1ae200 JR |
637 | * OFPRAW_OFPST12_TABLE_REPLY. |
638 | * OFPRAW_OFPST13_TABLE_REPLY. */ | |
f8e4867e SH |
639 | OFPTYPE_PORT_STATS_REQUEST, /* OFPRAW_OFPST10_PORT_REQUEST. |
640 | * OFPRAW_OFPST11_PORT_REQUEST. */ | |
641 | OFPTYPE_PORT_STATS_REPLY, /* OFPRAW_OFPST10_PORT_REPLY. | |
2e1ae200 | 642 | * OFPRAW_OFPST11_PORT_REPLY. |
5469537b BP |
643 | * OFPRAW_OFPST13_PORT_REPLY. |
644 | * OFPRAW_OFPST14_PORT_REPLY. */ | |
64626975 SH |
645 | OFPTYPE_QUEUE_STATS_REQUEST, /* OFPRAW_OFPST10_QUEUE_REQUEST. |
646 | * OFPRAW_OFPST11_QUEUE_REQUEST. */ | |
647 | OFPTYPE_QUEUE_STATS_REPLY, /* OFPRAW_OFPST10_QUEUE_REPLY. | |
2e1ae200 | 648 | * OFPRAW_OFPST11_QUEUE_REPLY. |
1bb2cdbe BP |
649 | * OFPRAW_OFPST13_QUEUE_REPLY. |
650 | * OFPRAW_OFPST14_QUEUE_REPLY. */ | |
2e1ae200 | 651 | |
261bd854 | 652 | OFPTYPE_GROUP_STATS_REQUEST, /* OFPRAW_OFPST11_GROUP_REQUEST. */ |
2e1ae200 | 653 | |
261bd854 | 654 | OFPTYPE_GROUP_STATS_REPLY, /* OFPRAW_OFPST11_GROUP_REPLY. |
2e1ae200 JR |
655 | * OFPRAW_OFPST13_GROUP_REPLY. */ |
656 | ||
19187a71 BP |
657 | OFPTYPE_GROUP_DESC_STATS_REQUEST, /* OFPRAW_OFPST11_GROUP_DESC_REQUEST. |
658 | * OFPRAW_OFPST15_GROUP_DESC_REQUEST. */ | |
2e1ae200 | 659 | |
261bd854 | 660 | OFPTYPE_GROUP_DESC_STATS_REPLY, /* OFPRAW_OFPST11_GROUP_DESC_REPLY. */ |
2e1ae200 | 661 | |
261bd854 | 662 | OFPTYPE_GROUP_FEATURES_STATS_REQUEST, /* OFPRAW_OFPST12_GROUP_FEATURES_REQUEST. */ |
2e1ae200 | 663 | |
261bd854 | 664 | OFPTYPE_GROUP_FEATURES_STATS_REPLY, /* OFPRAW_OFPST12_GROUP_FEATURES_REPLY. */ |
2e1ae200 | 665 | |
261bd854 | 666 | OFPTYPE_METER_STATS_REQUEST, /* OFPRAW_OFPST13_METER_REQUEST. */ |
2e1ae200 | 667 | |
261bd854 | 668 | OFPTYPE_METER_STATS_REPLY, /* OFPRAW_OFPST13_METER_REPLY. */ |
2e1ae200 | 669 | |
261bd854 | 670 | OFPTYPE_METER_CONFIG_STATS_REQUEST, /* OFPRAW_OFPST13_METER_CONFIG_REQUEST. */ |
2e1ae200 | 671 | |
261bd854 | 672 | OFPTYPE_METER_CONFIG_STATS_REPLY, /* OFPRAW_OFPST13_METER_CONFIG_REPLY. */ |
2e1ae200 | 673 | |
261bd854 | 674 | OFPTYPE_METER_FEATURES_STATS_REQUEST, /* OFPRAW_OFPST13_METER_FEATURES_REQUEST. */ |
2e1ae200 | 675 | |
261bd854 | 676 | OFPTYPE_METER_FEATURES_STATS_REPLY, /* OFPRAW_OFPST13_METER_FEATURES_REPLY. */ |
2e1ae200 | 677 | |
261bd854 | 678 | OFPTYPE_TABLE_FEATURES_STATS_REQUEST, /* OFPRAW_OFPST13_TABLE_FEATURES_REQUEST. */ |
2e1ae200 | 679 | |
261bd854 | 680 | OFPTYPE_TABLE_FEATURES_STATS_REPLY, /* OFPRAW_OFPST13_TABLE_FEATURES_REPLY. */ |
2e1ae200 | 681 | |
03c72922 BP |
682 | OFPTYPE_TABLE_DESC_REQUEST, /* OFPRAW_OFPST14_TABLE_DESC_REQUEST. */ |
683 | ||
684 | OFPTYPE_TABLE_DESC_REPLY, /* OFPRAW_OFPST14_TABLE_DESC_REPLY. */ | |
685 | ||
70ae4f93 BP |
686 | OFPTYPE_PORT_DESC_STATS_REQUEST, /* OFPRAW_OFPST10_PORT_DESC_REQUEST. |
687 | * OFPRAW_OFPST15_PORT_DESC_REQUEST. */ | |
64626975 | 688 | |
56de7118 | 689 | OFPTYPE_PORT_DESC_STATS_REPLY, /* OFPRAW_OFPST10_PORT_DESC_REPLY. |
8c3cc785 BP |
690 | * OFPRAW_OFPST11_PORT_DESC_REPLY. |
691 | * OFPRAW_OFPST14_PORT_DESC_REPLY. */ | |
982697a4 | 692 | |
f4b5d368 SH |
693 | OFPTYPE_FLOW_MONITOR_STATS_REQUEST, /* OFPRAW_OFPST14_FLOW_MONITOR_REQUEST. |
694 | * OFPRAW_NXST_FLOW_MONITOR_REQUEST. */ | |
695 | OFPTYPE_FLOW_MONITOR_STATS_REPLY, /* OFPRAW_OFPST14_FLOW_MONITOR_REPLY. | |
696 | * OFPRAW_NXST_FLOW_MONITOR_REPLY. */ | |
697 | ||
982697a4 | 698 | /* Nicira extensions. */ |
982697a4 BP |
699 | OFPTYPE_SET_FLOW_FORMAT, /* OFPRAW_NXT_SET_FLOW_FORMAT. */ |
700 | OFPTYPE_FLOW_MOD_TABLE_ID, /* OFPRAW_NXT_FLOW_MOD_TABLE_ID. */ | |
701 | OFPTYPE_SET_PACKET_IN_FORMAT, /* OFPRAW_NXT_SET_PACKET_IN_FORMAT. */ | |
702 | OFPTYPE_FLOW_AGE, /* OFPRAW_NXT_FLOW_AGE. */ | |
982697a4 | 703 | OFPTYPE_SET_CONTROLLER_ID, /* OFPRAW_NXT_SET_CONTROLLER_ID. */ |
4e548ad9 ML |
704 | OFPTYPE_NXT_TLV_TABLE_MOD, /* OFPRAW_NXT_TLV_TABLE_MOD. */ |
705 | OFPTYPE_NXT_TLV_TABLE_REQUEST, /* OFPRAW_NXT_TLV_TABLE_REQUEST. */ | |
706 | OFPTYPE_NXT_TLV_TABLE_REPLY, /* OFPRAW_NXT_TLV_TABLE_REPLY. */ | |
77ab5fd2 | 707 | OFPTYPE_NXT_RESUME, /* OFPRAW_NXT_RESUME. */ |
fb8f22c1 BY |
708 | OFPTYPE_IPFIX_BRIDGE_STATS_REQUEST, /* OFPRAW_NXST_IPFIX_BRIDGE_REQUEST */ |
709 | OFPTYPE_IPFIX_BRIDGE_STATS_REPLY, /* OFPRAW_NXST_IPFIX_BRIDGE_REPLY */ | |
710 | OFPTYPE_IPFIX_FLOW_STATS_REQUEST, /* OFPRAW_NXST_IPFIX_FLOW_REQUEST */ | |
711 | OFPTYPE_IPFIX_FLOW_STATS_REPLY, /* OFPRAW_NXST_IPFIX_FLOW_REPLY */ | |
2a7c4805 | 712 | OFPTYPE_CT_FLUSH_ZONE, /* OFPRAW_NXT_CT_FLUSH_ZONE. */ |
982697a4 BP |
713 | |
714 | /* Flow monitor extension. */ | |
982697a4 BP |
715 | OFPTYPE_FLOW_MONITOR_CANCEL, /* OFPRAW_NXT_FLOW_MONITOR_CANCEL. */ |
716 | OFPTYPE_FLOW_MONITOR_PAUSED, /* OFPRAW_NXT_FLOW_MONITOR_PAUSED. */ | |
717 | OFPTYPE_FLOW_MONITOR_RESUMED, /* OFPRAW_NXT_FLOW_MONITOR_RESUMED. */ | |
718 | }; | |
719 | ||
720 | /* Decoding messages into OFPTYPE_* values. */ | |
721 | enum ofperr ofptype_decode(enum ofptype *, const struct ofp_header *); | |
722 | enum ofperr ofptype_pull(enum ofptype *, struct ofpbuf *); | |
723 | enum ofptype ofptype_from_ofpraw(enum ofpraw); | |
64795a0d BP |
724 | |
725 | /* Information about OFTYPE_* values. */ | |
726 | const char *ofptype_get_name(enum ofptype); | |
982697a4 BP |
727 | \f |
728 | /* OpenFlow message properties. */ | |
729 | void ofpmsg_update_length(struct ofpbuf *); | |
730 | const void *ofpmsg_body(const struct ofp_header *); | |
76ec08e0 | 731 | bool ofpmsg_is_stat_request(const struct ofp_header *); |
982697a4 BP |
732 | \f |
733 | /* Multipart messages (aka "statistics"). | |
734 | * | |
735 | * Individual OpenFlow messages are limited to 64 kB in size, but some messages | |
736 | * need to be longer. Therefore, multipart messages allow a longer message to | |
737 | * be divided into multiple parts at some convenient boundary. For example, | |
738 | * limiting the response to a "flow dump" request to 64 kB would unreasonably | |
739 | * limit the maximum number of flows in an OpenFlow switch, so a "flow dump" is | |
740 | * expressed as a multipart request/reply pair, with the reply broken into | |
741 | * pieces between flows. | |
742 | * | |
743 | * Multipart messages always consist of a request/reply pair. | |
744 | * | |
745 | * In OpenFlow 1.0, 1.1, and 1.2, requests must always fit in a single message, | |
746 | * that is, only a multipart reply may have more than one part. OpenFlow 1.3 | |
747 | * adds one multipart request. This code does not yet support multipart | |
748 | * requests. */ | |
749 | ||
750 | /* Encoding multipart replies. | |
751 | * | |
752 | * These functions are useful for multipart replies that might really require | |
753 | * more than one message. A multipart message that is known in advance to fit | |
754 | * within 64 kB doesn't need any special treatment, so you might as well use | |
755 | * the ofpraw_alloc_*() functions. | |
756 | * | |
ca6ba700 | 757 | * These functions work with a "struct ovs_list" of "struct ofpbuf"s, each of |
982697a4 | 758 | * which represents one part of a multipart message. */ |
ca6ba700 TG |
759 | void ofpmp_init(struct ovs_list *, const struct ofp_header *request); |
760 | struct ofpbuf *ofpmp_reserve(struct ovs_list *, size_t len); | |
761 | void *ofpmp_append(struct ovs_list *, size_t len); | |
762 | void ofpmp_postappend(struct ovs_list *, size_t start_ofs); | |
982697a4 | 763 | |
ca6ba700 TG |
764 | enum ofp_version ofpmp_version(struct ovs_list *); |
765 | enum ofpraw ofpmp_decode_raw(struct ovs_list *); | |
e28ac5cf | 766 | |
982697a4 BP |
767 | /* Decoding multipart replies. */ |
768 | uint16_t ofpmp_flags(const struct ofp_header *); | |
769 | bool ofpmp_more(const struct ofp_header *); | |
770 | ||
771 | #endif /* ofp-msgs.h */ |