]>
Commit | Line | Data |
---|---|---|
dc4762ed | 1 | /* |
18080541 | 2 | * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. |
dc4762ed 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 | ||
17 | #ifndef OFP_ERRORS_H | |
18 | #define OFP_ERRORS_H 1 | |
19 | ||
90bf1e07 BP |
20 | #include <stdbool.h> |
21 | #include <stddef.h> | |
dc4762ed BP |
22 | #include <stdint.h> |
23 | ||
9b7e2112 SH |
24 | #include "openflow/openflow.h" |
25 | ||
90bf1e07 | 26 | struct ds; |
982697a4 | 27 | struct ofpbuf; |
90bf1e07 BP |
28 | |
29 | /* Error codes. | |
30 | * | |
31 | * We embed system errno values and OpenFlow standard and vendor extension | |
32 | * error codes into the positive range of "int": | |
33 | * | |
34 | * - Errno values are assumed to use the range 1 through 2**30 - 1. | |
35 | * | |
36 | * (C and POSIX say that errno values are positive. We assume that they | |
37 | * are less than 2**29. They are actually less than 65536 on at least | |
38 | * Linux, FreeBSD, OpenBSD, and Windows.) | |
39 | * | |
40 | * - OpenFlow standard and vendor extension error codes use the range | |
41 | * starting at 2**30 (OFPERR_OFS). | |
42 | * | |
43 | * Zero and negative values are not used. | |
44 | */ | |
45 | ||
46 | #define OFPERR_OFS (1 << 30) | |
47 | ||
4ba15221 BP |
48 | /* OpenFlow error codes |
49 | * -------------------- | |
4b83c93f SH |
50 | * |
51 | * The comments below are parsed by the extract-ofp-errors program at build | |
52 | * time and used to determine the mapping between "enum ofperr" constants and | |
53 | * error type/code values used in the OpenFlow protocol: | |
54 | * | |
514887ee BP |
55 | * - The first part of each comment specifies the vendor, OpenFlow versions, |
56 | * type, and sometimes a code for each protocol that supports the error: | |
57 | * | |
58 | * # The vendor is OF for standard OpenFlow error codes. Otherwise it | |
59 | * is one of the *_VENDOR_ID codes defined in openflow-common.h. | |
60 | * | |
61 | * # The version can specify a specific OpenFlow version, a version | |
62 | * range delimited by "-", or an open-ended range with "+". | |
63 | * | |
64 | * # Standard OpenFlow errors have both a type and a code. Extension | |
65 | * errors generally have only a type, no code. There is one | |
66 | * exception: Nicira extension (NX) errors for OpenFlow 1.0 and 1.1 | |
67 | * have both a type and a code. (This means that the version | |
68 | * specification for NX errors may not include version 1.0 or 1.1 (or | |
69 | * both) along with version 1.2 or later, because the requirements | |
70 | * for those versions are different.) | |
4b83c93f SH |
71 | * |
72 | * - Additional text is a human-readable description of the meaning of each | |
73 | * error, used to explain the error to the user. Any text enclosed in | |
74 | * square brackets is omitted; this can be used to explain rationale for | |
4ba15221 BP |
75 | * choice of error codes in the case where this is desirable. |
76 | * | |
77 | * | |
78 | * Expected duplications | |
79 | * --------------------- | |
80 | * | |
81 | * Occasionally, in one version of OpenFlow a single named error can indicate | |
82 | * two or more distinct errors, then a later version of OpenFlow splits those | |
83 | * meanings into different error codes. When that happens, both errors are | |
84 | * assigned the same value in the earlier version. That is ordinarily a | |
85 | * mistake, so the build system reports an error. When that happens, add the | |
86 | * error message to the list of "Expected duplications" below to suppress the | |
87 | * error. In such a case, the named error defined earlier is how OVS | |
88 | * interprets the earlier, merged form of the error. | |
89 | * | |
90 | * For example, OpenFlow 1.1 defined (3,5) as OFPBIC_UNSUP_EXP_INST, then | |
91 | * OpenFlow 1.2 broke this error into OFPBIC_BAD_EXPERIMENTER as (3,5) and | |
92 | * OFPBIC_BAD_EXT_TYPE as (3,6). To allow the OVS code to report just a single | |
93 | * error code, instead of protocol version dependent errors, this list of | |
94 | * errors only lists the latter two errors, giving both of them the same code | |
95 | * (3,5) for OpenFlow 1.1. Then, when OVS serializes either error into | |
96 | * OpenFlow 1.1, it uses the same code (3,5). In the other direction, when OVS | |
97 | * deserializes (3,5) from OpenFlow 1.1, it translates it into | |
98 | * OFPBIC_BAD_EXPERIMENTER (because its definition precedes that of | |
99 | * OFPBIC_BAD_EXT_TYPE below). See the "encoding OFPBIC_* experimenter errors" | |
100 | * and "decoding OFPBIC_* experimenter errors" tests in tests/ofp-errors.at for | |
101 | * full details. | |
102 | */ | |
90bf1e07 | 103 | enum ofperr { |
2e0525bc SH |
104 | /* Expected duplications. */ |
105 | ||
514887ee | 106 | /* Expected: 0x0,3,5 in OF1.1 means both OFPBIC_BAD_EXPERIMENTER and |
2e0525bc SH |
107 | * OFPBIC_BAD_EXP_TYPE. */ |
108 | ||
20e4ec1a BP |
109 | /* Expected: 0x0,1,5 in OF1.0 means both OFPBRC_EPERM and |
110 | * OFPBRC_IS_SLAVE. */ | |
111 | ||
112 | /* Expected: 0x0,1,5 in OF1.1 means both OFPBRC_EPERM and | |
113 | * OFPBRC_IS_SLAVE. */ | |
114 | ||
90bf1e07 BP |
115 | /* ## ------------------ ## */ |
116 | /* ## OFPET_HELLO_FAILED ## */ | |
117 | /* ## ------------------ ## */ | |
118 | ||
4000658b | 119 | /* OF1.0+(0,0). No compatible version. */ |
df30f9b1 | 120 | OFPERR_OFPHFC_INCOMPATIBLE = OFPERR_OFS, |
90bf1e07 | 121 | |
4000658b | 122 | /* OF1.0+(0,1). Permissions error. */ |
90bf1e07 BP |
123 | OFPERR_OFPHFC_EPERM, |
124 | ||
125 | /* ## ----------------- ## */ | |
126 | /* ## OFPET_BAD_REQUEST ## */ | |
127 | /* ## ----------------- ## */ | |
128 | ||
4000658b | 129 | /* OF1.0+(1,0). ofp_header.version not supported. */ |
90bf1e07 BP |
130 | OFPERR_OFPBRC_BAD_VERSION, |
131 | ||
4000658b | 132 | /* OF1.0+(1,1). ofp_header.type not supported. */ |
90bf1e07 BP |
133 | OFPERR_OFPBRC_BAD_TYPE, |
134 | ||
4000658b | 135 | /* OF1.0+(1,2). ofp_stats_msg.type not supported. */ |
90bf1e07 BP |
136 | OFPERR_OFPBRC_BAD_STAT, |
137 | ||
4000658b | 138 | /* OF1.0+(1,3). Vendor not supported (in ofp_vendor_header or |
90bf1e07 BP |
139 | * ofp_stats_msg). */ |
140 | OFPERR_OFPBRC_BAD_VENDOR, | |
141 | ||
4000658b | 142 | /* OF1.0+(1,4). Vendor subtype not supported. */ |
90bf1e07 BP |
143 | OFPERR_OFPBRC_BAD_SUBTYPE, |
144 | ||
4000658b | 145 | /* OF1.0+(1,5). Permissions error. */ |
90bf1e07 BP |
146 | OFPERR_OFPBRC_EPERM, |
147 | ||
4000658b | 148 | /* OF1.0+(1,6). Wrong request length for type. */ |
90bf1e07 BP |
149 | OFPERR_OFPBRC_BAD_LEN, |
150 | ||
4000658b | 151 | /* OF1.0+(1,7). Specified buffer has already been used. */ |
90bf1e07 BP |
152 | OFPERR_OFPBRC_BUFFER_EMPTY, |
153 | ||
4000658b | 154 | /* OF1.0+(1,8). Specified buffer does not exist. */ |
90bf1e07 BP |
155 | OFPERR_OFPBRC_BUFFER_UNKNOWN, |
156 | ||
c22c56bd SH |
157 | /* NX1.0(1,512), OF1.1+(1,9). Specified table-id invalid or does not exist. |
158 | * [ A non-standard error (1,512), formerly OFPERR_NXBRC_BAD_TABLE_ID, | |
4fff3fac | 159 | * is used for OpenFlow 1.0 as there seems to be no appropriate error |
c22c56bd | 160 | * code defined the specification. ] */ |
90bf1e07 BP |
161 | OFPERR_OFPBRC_BAD_TABLE_ID, |
162 | ||
20e4ec1a | 163 | /* OF1.0-1.1(1,5), OF1.2+(1,10). Denied because controller is slave. */ |
2e0525bc SH |
164 | OFPERR_OFPBRC_IS_SLAVE, |
165 | ||
514887ee BP |
166 | /* NX1.0-1.1(1,514), OF1.2+(1,11). Invalid port. [ A non-standard error |
167 | * (1,514), formerly OFPERR_NXBRC_BAD_IN_PORT is used for OpenFlow 1.0 and | |
168 | * 1.1 as there seems to be no appropriate error code defined the | |
169 | * specifications. ] */ | |
2e0525bc SH |
170 | OFPERR_OFPBRC_BAD_PORT, |
171 | ||
172 | /* OF1.2+(1,12). Invalid packet in packet-out. */ | |
173 | OFPERR_OFPBRC_BAD_PACKET, | |
174 | ||
2e1ae200 JR |
175 | /* OF1.3+(1,13). Multipart request overflowed the assigned buffer. */ |
176 | OFPERR_OFPBRC_MULTIPART_BUFFER_OVERFLOW, | |
177 | ||
514887ee | 178 | /* NX1.0-1.1(1,256), NX1.2+(2). Invalid NXM flow match. */ |
90bf1e07 BP |
179 | OFPERR_NXBRC_NXM_INVALID, |
180 | ||
514887ee BP |
181 | /* NX1.0-1.1(1,257), NX1.2+(3). The nxm_type, or nxm_type taken in |
182 | * combination with nxm_hasmask or nxm_length or both, is invalid or not | |
183 | * implemented. */ | |
90bf1e07 BP |
184 | OFPERR_NXBRC_NXM_BAD_TYPE, |
185 | ||
514887ee | 186 | /* NX1.0-1.1(1,515), NX1.2+(4). Must-be-zero field had nonzero value. */ |
a7349929 BP |
187 | OFPERR_NXBRC_MUST_BE_ZERO, |
188 | ||
514887ee BP |
189 | /* NX1.0-1.1(1,516), NX1.2+(5). The reason in an ofp_port_status message |
190 | * is not valid. */ | |
9e1fd49b BP |
191 | OFPERR_NXBRC_BAD_REASON, |
192 | ||
514887ee BP |
193 | /* NX1.0-1.1(1,520), NX1.2+(9). The 'event' in an NXST_FLOW_MONITOR reply |
194 | * does not specify one of the NXFME_ABBREV, NXFME_ADD, NXFME_DELETE, or | |
15549878 JR |
195 | * NXFME_MODIFY. */ |
196 | OFPERR_NXBRC_FM_BAD_EVENT, | |
197 | ||
514887ee BP |
198 | /* NX1.0-1.1(1,521), NX1.2+(10). The error that occurred cannot be |
199 | * represented in this OpenFlow version. */ | |
07c8ec21 BP |
200 | OFPERR_NXBRC_UNENCODABLE_ERROR, |
201 | ||
90bf1e07 BP |
202 | /* ## ---------------- ## */ |
203 | /* ## OFPET_BAD_ACTION ## */ | |
204 | /* ## ---------------- ## */ | |
205 | ||
4000658b | 206 | /* OF1.0+(2,0). Unknown action type. */ |
90bf1e07 BP |
207 | OFPERR_OFPBAC_BAD_TYPE, |
208 | ||
4000658b | 209 | /* OF1.0+(2,1). Length problem in actions. */ |
90bf1e07 BP |
210 | OFPERR_OFPBAC_BAD_LEN, |
211 | ||
4000658b | 212 | /* OF1.0+(2,2). Unknown experimenter id specified. */ |
90bf1e07 BP |
213 | OFPERR_OFPBAC_BAD_VENDOR, |
214 | ||
4000658b | 215 | /* OF1.0+(2,3). Unknown action type for experimenter id. */ |
90bf1e07 BP |
216 | OFPERR_OFPBAC_BAD_VENDOR_TYPE, |
217 | ||
4000658b | 218 | /* OF1.0+(2,4). Problem validating output port. */ |
90bf1e07 BP |
219 | OFPERR_OFPBAC_BAD_OUT_PORT, |
220 | ||
4000658b | 221 | /* OF1.0+(2,5). Bad action argument. */ |
90bf1e07 BP |
222 | OFPERR_OFPBAC_BAD_ARGUMENT, |
223 | ||
4000658b | 224 | /* OF1.0+(2,6). Permissions error. */ |
90bf1e07 BP |
225 | OFPERR_OFPBAC_EPERM, |
226 | ||
4000658b | 227 | /* OF1.0+(2,7). Can't handle this many actions. */ |
90bf1e07 BP |
228 | OFPERR_OFPBAC_TOO_MANY, |
229 | ||
4000658b | 230 | /* OF1.0+(2,8). Problem validating output queue. */ |
90bf1e07 BP |
231 | OFPERR_OFPBAC_BAD_QUEUE, |
232 | ||
44356551 | 233 | /* OF1.1+(2,9). Invalid group id in forward action. */ |
90bf1e07 BP |
234 | OFPERR_OFPBAC_BAD_OUT_GROUP, |
235 | ||
9e404d1e BP |
236 | /* NX1.0(1,522), OF1.1+(2,10). Action can't apply for this match or a |
237 | * prerequisite for use of this field is unmet. */ | |
90bf1e07 BP |
238 | OFPERR_OFPBAC_MATCH_INCONSISTENT, |
239 | ||
44356551 | 240 | /* OF1.1+(2,11). Action order is unsupported for the action list in an |
90bf1e07 BP |
241 | * Apply-Actions instruction */ |
242 | OFPERR_OFPBAC_UNSUPPORTED_ORDER, | |
243 | ||
44356551 | 244 | /* OF1.1+(2,12). Actions uses an unsupported tag/encap. */ |
90bf1e07 BP |
245 | OFPERR_OFPBAC_BAD_TAG, |
246 | ||
9e404d1e BP |
247 | /* NX1.0-1.1(1,523), OF1.2+(2,13). Action uses unknown or unsupported OXM |
248 | * or NXM field. */ | |
249 | OFPERR_OFPBAC_BAD_SET_TYPE, | |
2e0525bc | 250 | |
9e404d1e BP |
251 | /* NX1.0-1.1(1,524), OF1.2+(2,14). Action references past the end of an |
252 | * OXM or NXM field, or uses a length of zero. */ | |
253 | OFPERR_OFPBAC_BAD_SET_LEN, | |
2e0525bc | 254 | |
9e404d1e BP |
255 | /* NX1.0-1.1(1,525), OF1.2+(2,15). Action sets a field to an invalid or |
256 | * unsupported value, or modifies a read-only field. */ | |
257 | OFPERR_OFPBAC_BAD_SET_ARGUMENT, | |
2e0525bc | 258 | |
ff111801 BP |
259 | /* ONF1.3-1.4(4250), OF1.5+(2,16). Field in Set-Field action has Has-Mask |
260 | * bit set to 1. */ | |
da4425c7 BP |
261 | OFPERR_OFPBAC_BAD_SET_MASK, |
262 | ||
514887ee BP |
263 | /* NX1.0-1.1(2,256), NX1.2+(11). Must-be-zero action argument had nonzero |
264 | * value. */ | |
a7349929 BP |
265 | OFPERR_NXBAC_MUST_BE_ZERO, |
266 | ||
18080541 BP |
267 | /* NX1.0-1.1(2,526), NX1.2+(15). Conjunction action must be only action |
268 | * present. conjunction(id, k/n) must satisfy 1 <= k <= n and 2 <= n <= | |
269 | * 64. */ | |
270 | OFPERR_NXBAC_BAD_CONJUNCTION, | |
271 | ||
90bf1e07 BP |
272 | /* ## --------------------- ## */ |
273 | /* ## OFPET_BAD_INSTRUCTION ## */ | |
274 | /* ## --------------------- ## */ | |
275 | ||
44356551 | 276 | /* OF1.1+(3,0). Unknown instruction. */ |
90bf1e07 BP |
277 | OFPERR_OFPBIC_UNKNOWN_INST, |
278 | ||
8f2cded4 BP |
279 | /* NX1.0(2,257), OF1.1+(3,1). Switch or table does not support the |
280 | * instruction. */ | |
90bf1e07 BP |
281 | OFPERR_OFPBIC_UNSUP_INST, |
282 | ||
44356551 | 283 | /* OF1.1+(3,2). Invalid Table-ID specified. */ |
90bf1e07 BP |
284 | OFPERR_OFPBIC_BAD_TABLE_ID, |
285 | ||
44356551 | 286 | /* OF1.1+(3,3). Metadata value unsupported by datapath. */ |
90bf1e07 BP |
287 | OFPERR_OFPBIC_UNSUP_METADATA, |
288 | ||
44356551 | 289 | /* OF1.1+(3,4). Metadata mask value unsupported by datapath. */ |
90bf1e07 BP |
290 | OFPERR_OFPBIC_UNSUP_METADATA_MASK, |
291 | ||
2e0525bc SH |
292 | /* OF1.1+(3,5). Unknown experimenter id specified. */ |
293 | OFPERR_OFPBIC_BAD_EXPERIMENTER, | |
294 | ||
295 | /* OF1.1(3,5), OF1.2+(3,6). Unknown instruction for experimenter id. */ | |
296 | OFPERR_OFPBIC_BAD_EXP_TYPE, | |
297 | ||
298 | /* OF1.2+(3,7). Length problem in instructions. */ | |
299 | OFPERR_OFPBIC_BAD_LEN, | |
300 | ||
301 | /* OF1.2+(3,8). Permissions error. */ | |
302 | OFPERR_OFPBIC_EPERM, | |
90bf1e07 | 303 | |
d12f128a | 304 | /* NX1.1(3,256), ONF1.2-1.3(2600), OF1.4+(3,9). Duplicate instruction. */ |
0ca30f6f | 305 | OFPERR_OFPBIC_DUP_INST, |
f4104c68 | 306 | |
90bf1e07 BP |
307 | /* ## --------------- ## */ |
308 | /* ## OFPET_BAD_MATCH ## */ | |
309 | /* ## --------------- ## */ | |
310 | ||
44356551 | 311 | /* OF1.1+(4,0). Unsupported match type specified by the match */ |
90bf1e07 BP |
312 | OFPERR_OFPBMC_BAD_TYPE, |
313 | ||
44356551 | 314 | /* OF1.1+(4,1). Length problem in match. */ |
90bf1e07 BP |
315 | OFPERR_OFPBMC_BAD_LEN, |
316 | ||
44356551 | 317 | /* OF1.1+(4,2). Match uses an unsupported tag/encap. */ |
90bf1e07 BP |
318 | OFPERR_OFPBMC_BAD_TAG, |
319 | ||
44356551 | 320 | /* OF1.1+(4,3). Unsupported datalink addr mask - switch does not support |
90bf1e07 BP |
321 | * arbitrary datalink address mask. */ |
322 | OFPERR_OFPBMC_BAD_DL_ADDR_MASK, | |
323 | ||
44356551 | 324 | /* OF1.1+(4,4). Unsupported network addr mask - switch does not support |
90bf1e07 BP |
325 | * arbitrary network address mask. */ |
326 | OFPERR_OFPBMC_BAD_NW_ADDR_MASK, | |
327 | ||
3947cc76 BP |
328 | /* NX1.0(1,262), OF1.1+(4,5). Unsupported wildcard specified in the |
329 | * match. */ | |
90bf1e07 BP |
330 | OFPERR_OFPBMC_BAD_WILDCARDS, |
331 | ||
44356551 | 332 | /* OF1.1+(4,6). Unsupported field in the match. */ |
90bf1e07 BP |
333 | OFPERR_OFPBMC_BAD_FIELD, |
334 | ||
130b77cd | 335 | /* NX1.0(1,258), OF1.1+(4,7). Unsupported value in a match |
2e0525bc | 336 | * field. */ |
90bf1e07 BP |
337 | OFPERR_OFPBMC_BAD_VALUE, |
338 | ||
514887ee BP |
339 | /* NX1.0-1.1(1,259), OF1.2+(4,8). Unsupported mask specified in the match, |
340 | * field is not dl-address or nw-address. */ | |
2e0525bc SH |
341 | OFPERR_OFPBMC_BAD_MASK, |
342 | ||
514887ee | 343 | /* NX1.0-1.1(1,260), OF1.2+(4,9). A prerequisite was not met. */ |
2e0525bc SH |
344 | OFPERR_OFPBMC_BAD_PREREQ, |
345 | ||
514887ee | 346 | /* NX1.0-1.1(1,261), OF1.2+(4,10). A field type was duplicated. */ |
2e0525bc SH |
347 | OFPERR_OFPBMC_DUP_FIELD, |
348 | ||
349 | /* OF1.2+(4,11). Permissions error. */ | |
350 | OFPERR_OFPBMC_EPERM, | |
351 | ||
90bf1e07 BP |
352 | /* ## --------------------- ## */ |
353 | /* ## OFPET_FLOW_MOD_FAILED ## */ | |
354 | /* ## --------------------- ## */ | |
355 | ||
44356551 | 356 | /* OF1.1+(5,0). Unspecified error. */ |
90bf1e07 BP |
357 | OFPERR_OFPFMFC_UNKNOWN, |
358 | ||
be2b69d1 | 359 | /* OF1.0(3,0), OF1.1+(5,1). Flow not added because of full table(s). */ |
90bf1e07 BP |
360 | OFPERR_OFPFMFC_TABLE_FULL, |
361 | ||
44356551 | 362 | /* OF1.1+(5,2). Table does not exist */ |
90bf1e07 BP |
363 | OFPERR_OFPFMFC_BAD_TABLE_ID, |
364 | ||
44356551 | 365 | /* OF1.0(3,1), OF1.1+(5,3). Attempted to add overlapping flow with |
90bf1e07 BP |
366 | * CHECK_OVERLAP flag set. */ |
367 | OFPERR_OFPFMFC_OVERLAP, | |
368 | ||
44356551 | 369 | /* OF1.0(3,2), OF1.1+(5,4). Permissions error. */ |
90bf1e07 BP |
370 | OFPERR_OFPFMFC_EPERM, |
371 | ||
44356551 BP |
372 | /* OF1.1+(5,5). Flow not added because of unsupported idle/hard |
373 | * timeout. */ | |
90bf1e07 BP |
374 | OFPERR_OFPFMFC_BAD_TIMEOUT, |
375 | ||
376 | /* OF1.0(3,3). Flow not added because of non-zero idle/hard timeout. */ | |
377 | OFPERR_OFPFMFC_BAD_EMERG_TIMEOUT, | |
378 | ||
44356551 | 379 | /* OF1.0(3,4), OF1.1+(5,6). Unsupported or unknown command. */ |
90bf1e07 BP |
380 | OFPERR_OFPFMFC_BAD_COMMAND, |
381 | ||
0fb88c18 BP |
382 | /* NX1.0(3,258), NX1.1(5,258), OF1.2+(5,7). Unsupported or unknown |
383 | * flags. */ | |
2e0525bc SH |
384 | OFPERR_OFPFMFC_BAD_FLAGS, |
385 | ||
90bf1e07 BP |
386 | /* OF1.0(3,5). Unsupported action list - cannot process in the order |
387 | * specified. */ | |
388 | OFPERR_OFPFMFC_UNSUPPORTED, | |
389 | ||
514887ee | 390 | /* NX1.0-1.1(5,256), NX1.2+(12). Generic hardware error. */ |
90bf1e07 BP |
391 | OFPERR_NXFMFC_HARDWARE, |
392 | ||
514887ee BP |
393 | /* NX1.0-1.1(5,257), NX1.2+(13). A nonexistent table ID was specified in |
394 | * the "command" field of struct ofp_flow_mod, when the | |
395 | * nxt_flow_mod_table_id extension is enabled. */ | |
90bf1e07 BP |
396 | OFPERR_NXFMFC_BAD_TABLE_ID, |
397 | ||
398 | /* ## ---------------------- ## */ | |
399 | /* ## OFPET_GROUP_MOD_FAILED ## */ | |
400 | /* ## ---------------------- ## */ | |
401 | ||
44356551 BP |
402 | /* OF1.1+(6,0). Group not added because a group ADD attempted to replace |
403 | * an already-present group. */ | |
90bf1e07 BP |
404 | OFPERR_OFPGMFC_GROUP_EXISTS, |
405 | ||
44356551 | 406 | /* OF1.1+(6,1). Group not added because Group specified is invalid. */ |
90bf1e07 BP |
407 | OFPERR_OFPGMFC_INVALID_GROUP, |
408 | ||
44356551 | 409 | /* OF1.1+(6,2). Switch does not support unequal load sharing with select |
90bf1e07 BP |
410 | * groups. */ |
411 | OFPERR_OFPGMFC_WEIGHT_UNSUPPORTED, | |
412 | ||
44356551 | 413 | /* OF1.1+(6,3). The group table is full. */ |
90bf1e07 BP |
414 | OFPERR_OFPGMFC_OUT_OF_GROUPS, |
415 | ||
44356551 | 416 | /* OF1.1+(6,4). The maximum number of action buckets for a group has been |
90bf1e07 BP |
417 | * exceeded. */ |
418 | OFPERR_OFPGMFC_OUT_OF_BUCKETS, | |
419 | ||
44356551 | 420 | /* OF1.1+(6,5). Switch does not support groups that forward to groups. */ |
90bf1e07 BP |
421 | OFPERR_OFPGMFC_CHAINING_UNSUPPORTED, |
422 | ||
44356551 | 423 | /* OF1.1+(6,6). This group cannot watch the watch_port or watch_group |
90bf1e07 BP |
424 | * specified. */ |
425 | OFPERR_OFPGMFC_WATCH_UNSUPPORTED, | |
426 | ||
44356551 | 427 | /* OF1.1+(6,7). Group entry would cause a loop. */ |
90bf1e07 BP |
428 | OFPERR_OFPGMFC_LOOP, |
429 | ||
44356551 | 430 | /* OF1.1+(6,8). Group not modified because a group MODIFY attempted to |
90bf1e07 BP |
431 | * modify a non-existent group. */ |
432 | OFPERR_OFPGMFC_UNKNOWN_GROUP, | |
433 | ||
2e0525bc SH |
434 | /* OF1.2+(6,9). Group not deleted because another |
435 | group is forwarding to it. */ | |
436 | OFPERR_OFPGMFC_CHAINED_GROUP, | |
437 | ||
438 | /* OF1.2+(6,10). Unsupported or unknown group type. */ | |
439 | OFPERR_OFPGMFC_BAD_TYPE, | |
440 | ||
441 | /* OF1.2+(6,11). Unsupported or unknown command. */ | |
442 | OFPERR_OFPGMFC_BAD_COMMAND, | |
443 | ||
444 | /* OF1.2+(6,12). Error in bucket. */ | |
07f265eb | 445 | OFPERR_OFPGMFC_BAD_BUCKET, |
2e0525bc SH |
446 | |
447 | /* OF1.2+(6,13). Error in watch port/group. */ | |
07f265eb | 448 | OFPERR_OFPGMFC_BAD_WATCH, |
2e0525bc SH |
449 | |
450 | /* OF1.2+(6,14). Permissions error. */ | |
07f265eb | 451 | OFPERR_OFPGMFC_EPERM, |
2e0525bc | 452 | |
2cc5abd7 SH |
453 | /* OF1.5+(6,15). Invalid bucket identifier used in |
454 | * INSERT BUCKET or REMOVE BUCKET command. */ | |
455 | OFPERR_OFPGMFC_UNKNOWN_BUCKET, | |
456 | ||
457 | /* OF1.5+(6,16). Can't insert bucket because a bucket | |
458 | * already exist with that bucket-id. */ | |
459 | OFPERR_OFPGMFC_BUCKET_EXISTS, | |
460 | ||
90bf1e07 BP |
461 | /* ## --------------------- ## */ |
462 | /* ## OFPET_PORT_MOD_FAILED ## */ | |
463 | /* ## --------------------- ## */ | |
464 | ||
44356551 | 465 | /* OF1.0(4,0), OF1.1+(7,0). Specified port does not exist. */ |
90bf1e07 BP |
466 | OFPERR_OFPPMFC_BAD_PORT, |
467 | ||
44356551 | 468 | /* OF1.0(4,1), OF1.1+(7,1). Specified hardware address does not match the |
90bf1e07 BP |
469 | * port number. */ |
470 | OFPERR_OFPPMFC_BAD_HW_ADDR, | |
471 | ||
44356551 | 472 | /* OF1.1+(7,2). Specified config is invalid. */ |
90bf1e07 BP |
473 | OFPERR_OFPPMFC_BAD_CONFIG, |
474 | ||
44356551 | 475 | /* OF1.1+(7,3). Specified advertise is invalid. */ |
90bf1e07 BP |
476 | OFPERR_OFPPMFC_BAD_ADVERTISE, |
477 | ||
2e0525bc SH |
478 | /* OF1.2+(7,4). Permissions error. */ |
479 | OFPERR_OFPPMFC_EPERM, | |
480 | ||
90bf1e07 BP |
481 | /* ## ---------------------- ## */ |
482 | /* ## OFPET_TABLE_MOD_FAILED ## */ | |
483 | /* ## ---------------------- ## */ | |
484 | ||
44356551 | 485 | /* OF1.1+(8,0). Specified table does not exist. */ |
90bf1e07 BP |
486 | OFPERR_OFPTMFC_BAD_TABLE, |
487 | ||
44356551 | 488 | /* OF1.1+(8,1). Specified config is invalid. */ |
90bf1e07 BP |
489 | OFPERR_OFPTMFC_BAD_CONFIG, |
490 | ||
2e0525bc SH |
491 | /* OF1.2+(8,2). Permissions error. */ |
492 | OFPERR_OFPTMFC_EPERM, | |
493 | ||
90bf1e07 BP |
494 | /* ## --------------------- ## */ |
495 | /* ## OFPET_QUEUE_OP_FAILED ## */ | |
496 | /* ## --------------------- ## */ | |
497 | ||
44356551 | 498 | /* OF1.0(5,0), OF1.1+(9,0). Invalid port (or port does not exist). */ |
90bf1e07 BP |
499 | OFPERR_OFPQOFC_BAD_PORT, |
500 | ||
44356551 | 501 | /* OF1.0(5,1), OF1.1+(9,1). Queue does not exist. */ |
90bf1e07 BP |
502 | OFPERR_OFPQOFC_BAD_QUEUE, |
503 | ||
44356551 | 504 | /* OF1.0(5,2), OF1.1+(9,2). Permissions error. */ |
90bf1e07 BP |
505 | OFPERR_OFPQOFC_EPERM, |
506 | ||
507 | /* ## -------------------------- ## */ | |
508 | /* ## OFPET_SWITCH_CONFIG_FAILED ## */ | |
509 | /* ## -------------------------- ## */ | |
510 | ||
44356551 | 511 | /* OF1.1+(10,0). Specified flags is invalid. */ |
90bf1e07 BP |
512 | OFPERR_OFPSCFC_BAD_FLAGS, |
513 | ||
44356551 | 514 | /* OF1.1+(10,1). Specified len is invalid. */ |
90bf1e07 | 515 | OFPERR_OFPSCFC_BAD_LEN, |
2e0525bc SH |
516 | |
517 | /* OF1.2+(10,2). Permissions error. */ | |
518 | OFPERR_OFPSCFC_EPERM, | |
519 | ||
520 | /* ## ------------------------- ## */ | |
521 | /* ## OFPET_ROLE_REQUEST_FAILED ## */ | |
522 | /* ## ------------------------- ## */ | |
523 | ||
2e0525bc SH |
524 | /* OF1.2+(11,0). Stale Message: old generation_id. */ |
525 | OFPERR_OFPRRFC_STALE, | |
526 | ||
527 | /* OF1.2+(11,1). Controller role change unsupported. */ | |
528 | OFPERR_OFPRRFC_UNSUP, | |
529 | ||
514887ee | 530 | /* NX1.0-1.1(1,513), OF1.2+(11,2). Invalid role. */ |
2e0525bc SH |
531 | OFPERR_OFPRRFC_BAD_ROLE, |
532 | ||
2e1ae200 JR |
533 | /* ## ---------------------- ## */ |
534 | /* ## OFPET_METER_MOD_FAILED ## */ | |
535 | /* ## ---------------------- ## */ | |
536 | ||
2e1ae200 JR |
537 | /* OF1.3+(12,0). Unspecified error. */ |
538 | OFPERR_OFPMMFC_UNKNOWN, | |
539 | ||
540 | /* OF1.3+(12,1). Meter not added because a Meter ADD attempted to | |
541 | * replace an existing Meter. */ | |
542 | OFPERR_OFPMMFC_METER_EXISTS, | |
543 | ||
544 | /* OF1.3+(12,2). Meter not added because Meter specified is invalid. */ | |
545 | OFPERR_OFPMMFC_INVALID_METER, | |
546 | ||
547 | /* OF1.3+(12,3). Meter not modified because a Meter MODIFY attempted | |
548 | * to modify a non-existent Meter. */ | |
549 | OFPERR_OFPMMFC_UNKNOWN_METER, | |
550 | ||
551 | /* OF1.3+(12,4). Unsupported or unknown command. */ | |
552 | OFPERR_OFPMMFC_BAD_COMMAND, | |
553 | ||
554 | /* OF1.3+(12,5). Flag configuration unsupported. */ | |
555 | OFPERR_OFPMMFC_BAD_FLAGS, | |
556 | ||
557 | /* OF1.3+(12,6). Rate unsupported. */ | |
558 | OFPERR_OFPMMFC_BAD_RATE, | |
559 | ||
560 | /* OF1.3+(12,7). Burst size unsupported. */ | |
561 | OFPERR_OFPMMFC_BAD_BURST, | |
562 | ||
563 | /* OF1.3+(12,8). Band unsupported. */ | |
564 | OFPERR_OFPMMFC_BAD_BAND, | |
565 | ||
566 | /* OF1.3+(12,9). Band value unsupported. */ | |
567 | OFPERR_OFPMMFC_BAD_BAND_VALUE, | |
568 | ||
569 | /* OF1.3+(12,10). No more meters available. */ | |
570 | OFPERR_OFPMMFC_OUT_OF_METERS, | |
571 | ||
572 | /* OF1.3+(12,11). The maximum number of properties for a meter has | |
573 | * been exceeded. */ | |
574 | OFPERR_OFPMMFC_OUT_OF_BANDS, | |
575 | ||
576 | /* ## --------------------------- ## */ | |
577 | /* ## OFPET_TABLE_FEATURES_FAILED ## */ | |
578 | /* ## --------------------------- ## */ | |
579 | ||
2e1ae200 JR |
580 | /* OF1.3+(13,0). Specified table does not exist. */ |
581 | OFPERR_OFPTFFC_BAD_TABLE, | |
582 | ||
583 | /* OF1.3+(13,1). Invalid metadata mask. */ | |
584 | OFPERR_OFPTFFC_BAD_METADATA, | |
585 | ||
9a4eddbb BP |
586 | /* OF1.3+(13,5). Permissions error. */ |
587 | OFPERR_OFPTFFC_EPERM, | |
2e1ae200 | 588 | |
9a4eddbb BP |
589 | /* ## ------------------ ## */ |
590 | /* ## OFPET_BAD_PROPERTY ## */ | |
591 | /* ## ------------------ ## */ | |
2e1ae200 | 592 | |
9a4eddbb BP |
593 | /* OF1.3(13,2), OF1.4+(14,0). Unknown property type. |
594 | * | |
595 | * [Known as OFPTFFC_BAD_TYPE in OF1.3.] */ | |
596 | OFPERR_OFPBPC_BAD_TYPE, | |
2e1ae200 | 597 | |
9a4eddbb BP |
598 | /* OF1.3(13,3), OF1.4+(14,1). Length problem in property. |
599 | * | |
600 | * [Known as OFPTFFC_BAD_LEN in OF1.3.] */ | |
601 | OFPERR_OFPBPC_BAD_LEN, | |
602 | ||
603 | /* OF1.3(13,4), OF1.4+(14,2). Unsupported property value. | |
604 | * | |
605 | * [Known as OFPTFFC_BAD_ARGUMENT in OF1.3.] */ | |
606 | OFPERR_OFPBPC_BAD_VALUE, | |
607 | ||
6b2dfe8e | 608 | /* ONF1.3(4443), OF1.4+(14,3). Can't handle this many properties. */ |
9a4eddbb BP |
609 | OFPERR_OFPBPC_TOO_MANY, |
610 | ||
6b2dfe8e | 611 | /* ONF1.3(4444), OF1.4+(14,4). A property type was duplicated. */ |
9a4eddbb BP |
612 | OFPERR_OFPBPC_DUP_TYPE, |
613 | ||
6b2dfe8e | 614 | /* ONF1.3(4445), OF1.4+(14,5). Unknown experimenter id specified. */ |
9a4eddbb BP |
615 | OFPERR_OFPBPC_BAD_EXPERIMENTER, |
616 | ||
6b2dfe8e | 617 | /* ONF1.3(4446), OF1.4+(14,6). Unknown exp_type for experimenter id. */ |
9a4eddbb BP |
618 | OFPERR_OFPBPC_BAD_EXP_TYPE, |
619 | ||
6b2dfe8e | 620 | /* ONF1.3(4447), OF1.4+(14,7). Unknown value for experimenter id. */ |
9a4eddbb BP |
621 | OFPERR_OFPBPC_BAD_EXP_VALUE, |
622 | ||
6b2dfe8e | 623 | /* ONF1.3(4448), OF1.4+(14,8). Permissions error. */ |
9a4eddbb | 624 | OFPERR_OFPBPC_EPERM, |
2e1ae200 | 625 | |
777af88d AC |
626 | /* ## -------------------- ## */ |
627 | /* ## OFPET_BUNDLE_FAILED ## */ | |
628 | /* ## -------------------- ## */ | |
629 | ||
630 | /* OF1.4+(17,0). Unspecified error. */ | |
631 | OFPERR_OFPBFC_UNKNOWN, | |
632 | ||
633 | /* OF1.4+(17,1). Permissions error. */ | |
634 | OFPERR_OFPBFC_EPERM, | |
635 | ||
636 | /* OF1.4+(17,2). Bundle ID doesn't exist. */ | |
637 | OFPERR_OFPBFC_BAD_ID, | |
638 | ||
639 | /* OF1.4+(17,3). Bundle ID already exists. */ | |
640 | OFPERR_OFPBFC_BUNDLE_EXIST, | |
641 | ||
642 | /* OF1.4+(17,4). Bundle ID is closed. */ | |
643 | OFPERR_OFPBFC_BUNDLE_CLOSED, | |
644 | ||
645 | /* OF1.4+(17,5). Too many bundle IDs. */ | |
646 | OFPERR_OFPBFC_OUT_OF_BUNDLES, | |
647 | ||
648 | /* OF1.4+(17,6). Unsupported of unknown message control type. */ | |
649 | OFPERR_OFPBFC_BAD_TYPE, | |
650 | ||
651 | /* OF1.4+(17,7). Unsupported, unknown, or inconsistent flags. */ | |
652 | OFPERR_OFPBFC_BAD_FLAGS, | |
653 | ||
654 | /* OF1.4+(17,8). Length problem in included message. */ | |
655 | OFPERR_OFPBFC_MSG_BAD_LEN, | |
656 | ||
657 | /* OF1.4+(17,9). Inconsistent or duplicate XID. */ | |
658 | OFPERR_OFPBFC_MSG_BAD_XID, | |
659 | ||
660 | /* OF1.4+(17,10). Unsupported message in this bundle. */ | |
661 | OFPERR_OFPBFC_MSG_UNSUP, | |
662 | ||
663 | /* OF1.4+(17,11). Unsupported message combination in this bundle. */ | |
664 | OFPERR_OFPBFC_MSG_CONFLICT, | |
665 | ||
666 | /* OF1.4+(17,12). Cant handle this many messages in bundle. */ | |
667 | OFPERR_OFPBFC_MSG_TOO_MANY, | |
668 | ||
669 | /* OF1.4+(17,13). One message in bundle failed. */ | |
670 | OFPERR_OFPBFC_MSG_FAILED, | |
671 | ||
672 | /* OF1.4+(17,14). Bundle is taking too long. */ | |
673 | OFPERR_OFPBFC_TIMEOUT, | |
674 | ||
675 | /* OF1.4+(17,15). Bundle is locking the resource. */ | |
676 | OFPERR_OFPBFC_BUNDLE_IN_PROGRESS, | |
677 | ||
04f9f286 SH |
678 | /* ## ------------------------- ## */ |
679 | /* ## OFPET_FLOW_MONITOR_FAILED ## */ | |
680 | /* ## ------------------------- ## */ | |
681 | ||
682 | /* OF1.4+(16,0). Unspecified error. */ | |
683 | OFPERR_OFPMOFC_UNKNOWN, | |
684 | ||
685 | /* NX1.0-1.1(1,517), NX1.2-1.3(6), OF1.4+(16,1). Monitor not added | |
686 | * because a Monitor ADD attempted to replace an existing Monitor. */ | |
687 | OFPERR_OFPMOFC_MONITOR_EXISTS, | |
688 | ||
689 | /* OF1.4+(16,2). Monitor not added because | |
690 | * Monitor specified is invalid. */ | |
691 | OFPERR_OFPMOFC_INVALID_MONITOR, | |
692 | ||
693 | /* NX1.0-1.1(1,519), NX1.2-1.3(8), OF1.4+(16,3). Monitor not modified | |
694 | * because a Monitor MODIFY attempted to modify a non-existent Monitor. */ | |
695 | OFPERR_OFPMOFC_UNKNOWN_MONITOR, | |
696 | ||
697 | /* OF1.4+(16,4). Unsupported or unknown command. */ | |
698 | OFPERR_OFPMOFC_BAD_COMMAND, | |
699 | ||
700 | /* NX1.0-1.1(1,518), NX1.2-1.3(7), OF1.4+(16,5). Flag configuration | |
701 | * unsupported. */ | |
702 | OFPERR_OFPMOFC_BAD_FLAGS, | |
703 | ||
704 | /* OF1.4+(16,6). Specified table does not exist. */ | |
705 | OFPERR_OFPMOFC_BAD_TABLE_ID, | |
706 | ||
707 | /* OF1.4+(16,7). Error in output port/group. */ | |
708 | OFPERR_OFPMOFC_BAD_OUT, | |
709 | ||
2e0525bc SH |
710 | /* ## ------------------ ## */ |
711 | /* ## OFPET_EXPERIMENTER ## */ | |
712 | /* ## ------------------ ## */ | |
90bf1e07 BP |
713 | }; |
714 | ||
688e86e1 | 715 | const char *ofperr_domain_get_name(enum ofp_version); |
90bf1e07 BP |
716 | |
717 | bool ofperr_is_valid(enum ofperr); | |
90bf1e07 | 718 | |
2e0525bc | 719 | enum ofperr ofperr_from_name(const char *); |
90bf1e07 | 720 | |
982697a4 BP |
721 | enum ofperr ofperr_decode_msg(const struct ofp_header *, |
722 | struct ofpbuf *payload); | |
90bf1e07 | 723 | struct ofpbuf *ofperr_encode_reply(enum ofperr, const struct ofp_header *); |
9b7e2112 | 724 | struct ofpbuf *ofperr_encode_hello(enum ofperr, enum ofp_version ofp_version, |
90bf1e07 | 725 | const char *); |
514887ee | 726 | int ofperr_get_vendor(enum ofperr, enum ofp_version); |
688e86e1 SH |
727 | int ofperr_get_type(enum ofperr, enum ofp_version); |
728 | int ofperr_get_code(enum ofperr, enum ofp_version); | |
90bf1e07 BP |
729 | |
730 | const char *ofperr_get_name(enum ofperr); | |
731 | const char *ofperr_get_description(enum ofperr); | |
732 | ||
733 | void ofperr_format(struct ds *, enum ofperr); | |
734 | const char *ofperr_to_string(enum ofperr); | |
dc4762ed BP |
735 | |
736 | #endif /* ofp-errors.h */ |