1f7ea69ba1fe51416d67868fcb64caa9f2a61b38
[sliver-openvswitch.git] / lib / ofp-errors.h
1 /*
2  * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
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
20 #include <stdbool.h>
21 #include <stddef.h>
22 #include <stdint.h>
23
24 #include "openflow/openflow.h"
25
26 struct ds;
27 struct ofpbuf;
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
48 /* OpenFlow error codes.
49  *
50  * The comments below are parsed by the extract-ofp-errors program at build
51  * time and used to determine the mapping between "enum ofperr" constants and
52  * error type/code values used in the OpenFlow protocol:
53  *
54  *   - The first part of each comment specifies OpenFlow type/code for each
55  *     protocol that supports the error.
56  *
57  *   - Additional text is a human-readable description of the meaning of each
58  *     error, used to explain the error to the user.  Any text enclosed in
59  *     square brackets is omitted; this can be used to explain rationale for
60  *     choice of error codes in the case where this is desirable. */
61 enum ofperr {
62 /* Expected duplications. */
63
64     /* Expected: 3,5 in OF1.1 means both OFPBIC_BAD_EXPERIMENTER and
65      * OFPBIC_BAD_EXP_TYPE. */
66
67 /* ## ------------------ ## */
68 /* ## OFPET_HELLO_FAILED ## */
69 /* ## ------------------ ## */
70
71     /* OF1.0+(0,0).  No compatible version. */
72     OFPERR_OFPHFC_INCOMPATIBLE = OFPERR_OFS,
73
74     /* OF1.0+(0,1).  Permissions error. */
75     OFPERR_OFPHFC_EPERM,
76
77 /* ## ----------------- ## */
78 /* ## OFPET_BAD_REQUEST ## */
79 /* ## ----------------- ## */
80
81     /* OF1.0+(1,0).  ofp_header.version not supported. */
82     OFPERR_OFPBRC_BAD_VERSION,
83
84     /* OF1.0+(1,1).  ofp_header.type not supported. */
85     OFPERR_OFPBRC_BAD_TYPE,
86
87     /* OF1.0+(1,2).  ofp_stats_msg.type not supported. */
88     OFPERR_OFPBRC_BAD_STAT,
89
90     /* OF1.0+(1,3).  Vendor not supported (in ofp_vendor_header or
91      * ofp_stats_msg). */
92     OFPERR_OFPBRC_BAD_VENDOR,
93
94     /* OF1.0+(1,4).  Vendor subtype not supported. */
95     OFPERR_OFPBRC_BAD_SUBTYPE,
96
97     /* OF1.0+(1,5).  Permissions error. */
98     OFPERR_OFPBRC_EPERM,
99
100     /* OF1.0+(1,6).  Wrong request length for type. */
101     OFPERR_OFPBRC_BAD_LEN,
102
103     /* OF1.0+(1,7).  Specified buffer has already been used. */
104     OFPERR_OFPBRC_BUFFER_EMPTY,
105
106     /* OF1.0+(1,8).  Specified buffer does not exist. */
107     OFPERR_OFPBRC_BUFFER_UNKNOWN,
108
109     /* NX1.0(1,512), OF1.1+(1,9).  Specified table-id invalid or does not exist.
110      * [ A non-standard error (1,512), formerly OFPERR_NXBRC_BAD_TABLE_ID,
111      *   is used for OpenFlow 1.0 as there seems to be no appropriate error
112      *   code defined the specification. ] */
113     OFPERR_OFPBRC_BAD_TABLE_ID,
114
115     /* OF1.2+(1,10).  Denied because controller is slave. */
116     OFPERR_OFPBRC_IS_SLAVE,
117
118     /* NX1.0(1,514), NX1.1(1,514), OF1.2+(1,11).  Invalid port.
119      * [ A non-standard error (1,514), formerly
120      *   OFPERR_NXBRC_BAD_IN_PORT is used for OpenFlow 1.0 and 1.1 as there
121      *   seems to be no appropriate error code defined the specifications. ] */
122     OFPERR_OFPBRC_BAD_PORT,
123
124     /* OF1.2+(1,12).  Invalid packet in packet-out. */
125     OFPERR_OFPBRC_BAD_PACKET,
126
127     /* OF1.3+(1,13).  Multipart request overflowed the assigned buffer. */
128     OFPERR_OFPBRC_MULTIPART_BUFFER_OVERFLOW,
129
130     /* NX1.0+(1,256).  Invalid NXM flow match. */
131     OFPERR_NXBRC_NXM_INVALID,
132
133     /* NX1.0+(1,257).  The nxm_type, or nxm_type taken in combination with
134      * nxm_hasmask or nxm_length or both, is invalid or not implemented. */
135     OFPERR_NXBRC_NXM_BAD_TYPE,
136
137     /* NX1.0+(1,515).  Must-be-zero field had nonzero value. */
138     OFPERR_NXBRC_MUST_BE_ZERO,
139
140     /* NX1.0+(1,516).  The reason in an ofp_port_status message is not
141      * valid. */
142     OFPERR_NXBRC_BAD_REASON,
143
144     /* NX1.0+(1,517).  The 'id' in an NXST_FLOW_MONITOR request is the same as
145      * an existing monitor id (or two monitors in the same NXST_FLOW_MONITOR
146      * request have the same 'id').  */
147     OFPERR_NXBRC_FM_DUPLICATE_ID,
148
149     /* NX1.0+(1,518).  The 'flags' in an NXST_FLOW_MONITOR request either does
150      * not specify at least one of the NXFMF_ADD, NXFMF_DELETE, or NXFMF_MODIFY
151      * flags, or specifies a flag bit that is not defined. */
152     OFPERR_NXBRC_FM_BAD_FLAGS,
153
154     /* NX1.0+(1,519).  The 'id' in an NXT_FLOW_MONITOR_CANCEL request is not
155      * the id of any existing monitor. */
156     OFPERR_NXBRC_FM_BAD_ID,
157
158     /* NX1.0+(1,520).  The 'event' in an NXST_FLOW_MONITOR reply does not
159      * specify one of the NXFME_ABBREV, NXFME_ADD, NXFME_DELETE, or
160      * NXFME_MODIFY. */
161     OFPERR_NXBRC_FM_BAD_EVENT,
162
163     /* NX1.0+(1,521).  The error that occurred cannot be represented in this
164      * OpenFlow version. */
165     OFPERR_NXBRC_UNENCODABLE_ERROR,
166
167 /* ## ---------------- ## */
168 /* ## OFPET_BAD_ACTION ## */
169 /* ## ---------------- ## */
170
171     /* OF1.0+(2,0).  Unknown action type. */
172     OFPERR_OFPBAC_BAD_TYPE,
173
174     /* OF1.0+(2,1).  Length problem in actions. */
175     OFPERR_OFPBAC_BAD_LEN,
176
177     /* OF1.0+(2,2).  Unknown experimenter id specified. */
178     OFPERR_OFPBAC_BAD_VENDOR,
179
180     /* OF1.0+(2,3).  Unknown action type for experimenter id. */
181     OFPERR_OFPBAC_BAD_VENDOR_TYPE,
182
183     /* OF1.0+(2,4).  Problem validating output port. */
184     OFPERR_OFPBAC_BAD_OUT_PORT,
185
186     /* OF1.0+(2,5).  Bad action argument. */
187     OFPERR_OFPBAC_BAD_ARGUMENT,
188
189     /* OF1.0+(2,6).  Permissions error. */
190     OFPERR_OFPBAC_EPERM,
191
192     /* OF1.0+(2,7).  Can't handle this many actions. */
193     OFPERR_OFPBAC_TOO_MANY,
194
195     /* OF1.0+(2,8).  Problem validating output queue. */
196     OFPERR_OFPBAC_BAD_QUEUE,
197
198     /* OF1.1+(2,9).  Invalid group id in forward action. */
199     OFPERR_OFPBAC_BAD_OUT_GROUP,
200
201     /* OF1.1+(2,10).  Action can't apply for this match. */
202     OFPERR_OFPBAC_MATCH_INCONSISTENT,
203
204     /* OF1.1+(2,11).  Action order is unsupported for the action list in an
205      * Apply-Actions instruction */
206     OFPERR_OFPBAC_UNSUPPORTED_ORDER,
207
208     /* OF1.1+(2,12).  Actions uses an unsupported tag/encap. */
209     OFPERR_OFPBAC_BAD_TAG,
210
211     /* OF1.2+(2,13).  Unsupported type in SET_FIELD action. */
212     OFPERR_OFPBAC_SET_TYPE,
213
214     /* OF1.2+(2,14).  Length problem in SET_FIELD action. */
215     OFPERR_OFPBAC_SET_LEN,
216
217     /* OF1.2+(2,15).  Bad argument in SET_FIELD action. */
218     OFPERR_OFPBAC_ARGUMENT,
219
220     /* NX1.0+(2,256).  Must-be-zero action argument had nonzero value. */
221     OFPERR_NXBAC_MUST_BE_ZERO,
222
223 /* ## --------------------- ## */
224 /* ## OFPET_BAD_INSTRUCTION ## */
225 /* ## --------------------- ## */
226
227     /* OF1.1+(3,0).  Unknown instruction. */
228     OFPERR_OFPBIC_UNKNOWN_INST,
229
230     /* OF1.1+(3,1).  Switch or table does not support the instruction. */
231     OFPERR_OFPBIC_UNSUP_INST,
232
233     /* OF1.1+(3,2).  Invalid Table-ID specified. */
234     OFPERR_OFPBIC_BAD_TABLE_ID,
235
236     /* OF1.1+(3,3).  Metadata value unsupported by datapath. */
237     OFPERR_OFPBIC_UNSUP_METADATA,
238
239     /* OF1.1+(3,4).  Metadata mask value unsupported by datapath. */
240     OFPERR_OFPBIC_UNSUP_METADATA_MASK,
241
242     /* OF1.1+(3,5).  Unknown experimenter id specified. */
243     OFPERR_OFPBIC_BAD_EXPERIMENTER,
244
245     /* OF1.1(3,5), OF1.2+(3,6).  Unknown instruction for experimenter id. */
246     OFPERR_OFPBIC_BAD_EXP_TYPE,
247
248     /* OF1.2+(3,7).  Length problem in instructions. */
249     OFPERR_OFPBIC_BAD_LEN,
250
251     /* OF1.2+(3,8).  Permissions error. */
252     OFPERR_OFPBIC_EPERM,
253
254 /* ## --------------- ## */
255 /* ## OFPET_BAD_MATCH ## */
256 /* ## --------------- ## */
257
258     /* OF1.1+(4,0).  Unsupported match type specified by the match */
259     OFPERR_OFPBMC_BAD_TYPE,
260
261     /* OF1.1+(4,1).  Length problem in match. */
262     OFPERR_OFPBMC_BAD_LEN,
263
264     /* OF1.1+(4,2).  Match uses an unsupported tag/encap. */
265     OFPERR_OFPBMC_BAD_TAG,
266
267     /* OF1.1+(4,3).  Unsupported datalink addr mask - switch does not support
268      * arbitrary datalink address mask. */
269     OFPERR_OFPBMC_BAD_DL_ADDR_MASK,
270
271     /* OF1.1+(4,4).  Unsupported network addr mask - switch does not support
272      * arbitrary network address mask. */
273     OFPERR_OFPBMC_BAD_NW_ADDR_MASK,
274
275     /* OF1.1+(4,5).  Unsupported wildcard specified in the match. */
276     OFPERR_OFPBMC_BAD_WILDCARDS,
277
278     /* OF1.1+(4,6).  Unsupported field in the match. */
279     OFPERR_OFPBMC_BAD_FIELD,
280
281     /* NX1.0(1,258), OF1.1+(4,7).  Unsupported value in a match
282      * field. */
283     OFPERR_OFPBMC_BAD_VALUE,
284
285     /* NX1.0(1,259), NX1.1(1,259), OF1.2+(4,8).  Unsupported mask specified in
286      * the match, field is not dl-address or nw-address. */
287     OFPERR_OFPBMC_BAD_MASK,
288
289     /* NX1.0(1,260), NX1.1(1,260), OF1.2+(4,9).  A prerequisite was not met. */
290     OFPERR_OFPBMC_BAD_PREREQ,
291
292     /* NX1.0(1,261), NX1.1(1,261), OF1.2+(4,10).  A field type was
293      * duplicated. */
294     OFPERR_OFPBMC_DUP_FIELD,
295
296     /* OF1.2+(4,11).  Permissions error. */
297     OFPERR_OFPBMC_EPERM,
298
299 /* ## --------------------- ## */
300 /* ## OFPET_FLOW_MOD_FAILED ## */
301 /* ## --------------------- ## */
302
303     /* OF1.1+(5,0).  Unspecified error. */
304     OFPERR_OFPFMFC_UNKNOWN,
305
306     /* OF1.0(3,0), OF1.1+(5,1).  Flow not added because of full table(s). */
307     OFPERR_OFPFMFC_TABLE_FULL,
308
309     /* OF1.1+(5,2).  Table does not exist */
310     OFPERR_OFPFMFC_BAD_TABLE_ID,
311
312     /* OF1.0(3,1), OF1.1+(5,3).  Attempted to add overlapping flow with
313      * CHECK_OVERLAP flag set. */
314     OFPERR_OFPFMFC_OVERLAP,
315
316     /* OF1.0(3,2), OF1.1+(5,4).  Permissions error. */
317     OFPERR_OFPFMFC_EPERM,
318
319     /* OF1.1+(5,5).  Flow not added because of unsupported idle/hard
320      * timeout. */
321     OFPERR_OFPFMFC_BAD_TIMEOUT,
322
323     /* OF1.0(3,3).  Flow not added because of non-zero idle/hard timeout. */
324     OFPERR_OFPFMFC_BAD_EMERG_TIMEOUT,
325
326     /* OF1.0(3,4), OF1.1+(5,6).  Unsupported or unknown command. */
327     OFPERR_OFPFMFC_BAD_COMMAND,
328
329     /* OF1.2+(5,7).  Unsupported or unknown flags. */
330     OFPERR_OFPFMFC_BAD_FLAGS,
331
332     /* OF1.0(3,5).  Unsupported action list - cannot process in the order
333      * specified. */
334     OFPERR_OFPFMFC_UNSUPPORTED,
335
336     /* NX1.0(3,256), NX1.1(5,256).  Generic hardware error. */
337     OFPERR_NXFMFC_HARDWARE,
338
339     /* NX1.0(3,257), NX1.1(5,257).  A nonexistent table ID was specified in the
340      * "command" field of struct ofp_flow_mod, when the nxt_flow_mod_table_id
341      * extension is enabled. */
342     OFPERR_NXFMFC_BAD_TABLE_ID,
343
344 /* ## ---------------------- ## */
345 /* ## OFPET_GROUP_MOD_FAILED ## */
346 /* ## ---------------------- ## */
347
348     /* OF1.1+(6,0).  Group not added because a group ADD attempted to replace
349      * an already-present group. */
350     OFPERR_OFPGMFC_GROUP_EXISTS,
351
352     /* OF1.1+(6,1).  Group not added because Group specified is invalid. */
353     OFPERR_OFPGMFC_INVALID_GROUP,
354
355     /* OF1.1+(6,2).  Switch does not support unequal load sharing with select
356      * groups. */
357     OFPERR_OFPGMFC_WEIGHT_UNSUPPORTED,
358
359     /* OF1.1+(6,3).  The group table is full. */
360     OFPERR_OFPGMFC_OUT_OF_GROUPS,
361
362     /* OF1.1+(6,4).  The maximum number of action buckets for a group has been
363      * exceeded. */
364     OFPERR_OFPGMFC_OUT_OF_BUCKETS,
365
366     /* OF1.1+(6,5).  Switch does not support groups that forward to groups. */
367     OFPERR_OFPGMFC_CHAINING_UNSUPPORTED,
368
369     /* OF1.1+(6,6).  This group cannot watch the watch_port or watch_group
370      * specified. */
371     OFPERR_OFPGMFC_WATCH_UNSUPPORTED,
372
373     /* OF1.1+(6,7).  Group entry would cause a loop. */
374     OFPERR_OFPGMFC_LOOP,
375
376     /* OF1.1+(6,8).  Group not modified because a group MODIFY attempted to
377      * modify a non-existent group. */
378     OFPERR_OFPGMFC_UNKNOWN_GROUP,
379
380     /* OF1.2+(6,9).  Group not deleted because another
381                     group is forwarding to it. */
382     OFPERR_OFPGMFC_CHAINED_GROUP,
383
384     /* OF1.2+(6,10).  Unsupported or unknown group type. */
385     OFPERR_OFPGMFC_BAD_TYPE,
386
387     /* OF1.2+(6,11).  Unsupported or unknown command. */
388     OFPERR_OFPGMFC_BAD_COMMAND,
389
390     /* OF1.2+(6,12).  Error in bucket. */
391     OFPERR_OFPGMFC_OFPGMFC_BAD_BUCKET,
392
393     /* OF1.2+(6,13).  Error in watch port/group. */
394     OFPERR_OFPGMFC_OFPGMFC_BAD_WATCH,
395
396     /* OF1.2+(6,14).  Permissions error. */
397     OFPERR_OFPGMFC_OFPGMFC_EPERM,
398
399 /* ## --------------------- ## */
400 /* ## OFPET_PORT_MOD_FAILED ## */
401 /* ## --------------------- ## */
402
403     /* OF1.0(4,0), OF1.1+(7,0).  Specified port does not exist. */
404     OFPERR_OFPPMFC_BAD_PORT,
405
406     /* OF1.0(4,1), OF1.1+(7,1).  Specified hardware address does not match the
407      * port number. */
408     OFPERR_OFPPMFC_BAD_HW_ADDR,
409
410     /* OF1.1+(7,2).  Specified config is invalid. */
411     OFPERR_OFPPMFC_BAD_CONFIG,
412
413     /* OF1.1+(7,3).  Specified advertise is invalid. */
414     OFPERR_OFPPMFC_BAD_ADVERTISE,
415
416     /* OF1.2+(7,4).  Permissions error. */
417     OFPERR_OFPPMFC_EPERM,
418
419 /* ## ---------------------- ## */
420 /* ## OFPET_TABLE_MOD_FAILED ## */
421 /* ## ---------------------- ## */
422
423     /* OF1.1+(8,0).  Specified table does not exist. */
424     OFPERR_OFPTMFC_BAD_TABLE,
425
426     /* OF1.1+(8,1).  Specified config is invalid. */
427     OFPERR_OFPTMFC_BAD_CONFIG,
428
429     /* OF1.2+(8,2).  Permissions error. */
430     OFPERR_OFPTMFC_EPERM,
431
432 /* ## --------------------- ## */
433 /* ## OFPET_QUEUE_OP_FAILED ## */
434 /* ## --------------------- ## */
435
436     /* OF1.0(5,0), OF1.1+(9,0).  Invalid port (or port does not exist). */
437     OFPERR_OFPQOFC_BAD_PORT,
438
439     /* OF1.0(5,1), OF1.1+(9,1).  Queue does not exist. */
440     OFPERR_OFPQOFC_BAD_QUEUE,
441
442     /* OF1.0(5,2), OF1.1+(9,2).  Permissions error. */
443     OFPERR_OFPQOFC_EPERM,
444
445 /* ## -------------------------- ## */
446 /* ## OFPET_SWITCH_CONFIG_FAILED ## */
447 /* ## -------------------------- ## */
448
449     /* OF1.1+(10,0).  Specified flags is invalid. */
450     OFPERR_OFPSCFC_BAD_FLAGS,
451
452     /* OF1.1+(10,1).  Specified len is invalid. */
453     OFPERR_OFPSCFC_BAD_LEN,
454
455     /* OF1.2+(10,2).  Permissions error. */
456     OFPERR_OFPSCFC_EPERM,
457
458 /* ## ------------------------- ## */
459 /* ## OFPET_ROLE_REQUEST_FAILED ## */
460 /* ## ------------------------- ## */
461
462     /* OF1.2+(11,0).  Stale Message: old generation_id. */
463     OFPERR_OFPRRFC_STALE,
464
465     /* OF1.2+(11,1).  Controller role change unsupported. */
466     OFPERR_OFPRRFC_UNSUP,
467
468     /* NX1.0(1,513), NX1.1(1,513), OF1.2+(11,2).  Invalid role. */
469     OFPERR_OFPRRFC_BAD_ROLE,
470
471 /* ## ---------------------- ## */
472 /* ## OFPET_METER_MOD_FAILED ## */
473 /* ## ---------------------- ## */
474
475     /* OF1.3+(12,0).  Unspecified error. */
476     OFPERR_OFPMMFC_UNKNOWN,
477
478     /* OF1.3+(12,1).  Meter not added because a Meter ADD attempted to
479      * replace an existing Meter. */
480     OFPERR_OFPMMFC_METER_EXISTS,
481
482     /* OF1.3+(12,2).  Meter not added because Meter specified is invalid. */
483     OFPERR_OFPMMFC_INVALID_METER,
484
485     /* OF1.3+(12,3).  Meter not modified because a Meter MODIFY attempted
486      * to modify a non-existent Meter. */
487     OFPERR_OFPMMFC_UNKNOWN_METER,
488
489     /* OF1.3+(12,4).  Unsupported or unknown command. */
490     OFPERR_OFPMMFC_BAD_COMMAND,
491
492     /* OF1.3+(12,5).  Flag configuration unsupported. */
493     OFPERR_OFPMMFC_BAD_FLAGS,
494
495     /* OF1.3+(12,6).  Rate unsupported. */
496     OFPERR_OFPMMFC_BAD_RATE,
497
498     /* OF1.3+(12,7).  Burst size unsupported. */
499     OFPERR_OFPMMFC_BAD_BURST,
500
501     /* OF1.3+(12,8).  Band unsupported. */
502     OFPERR_OFPMMFC_BAD_BAND,
503
504     /* OF1.3+(12,9).  Band value unsupported. */
505     OFPERR_OFPMMFC_BAD_BAND_VALUE,
506
507     /* OF1.3+(12,10).  No more meters available. */
508     OFPERR_OFPMMFC_OUT_OF_METERS,
509
510     /* OF1.3+(12,11).  The maximum number of properties for a meter has
511      * been exceeded. */
512     OFPERR_OFPMMFC_OUT_OF_BANDS,
513
514 /* ## --------------------------- ## */
515 /* ## OFPET_TABLE_FEATURES_FAILED ## */
516 /* ## --------------------------- ## */
517
518     /* OF1.3+(13,0).  Specified table does not exist. */
519     OFPERR_OFPTFFC_BAD_TABLE,
520
521     /* OF1.3+(13,1).  Invalid metadata mask. */
522     OFPERR_OFPTFFC_BAD_METADATA,
523
524     /* OF1.3+(13,2).  Unknown property type. */
525     OFPERR_OFPTFFC_BAD_TYPE,
526
527     /* OF1.3+(13,3).  Length problem in properties. */
528     OFPERR_OFPTFFC_BAD_LEN,
529
530     /* OF1.3+(13,4).  Unsupported property value. */
531     OFPERR_OFPTFFC_BAD_ARGUMENT,
532
533     /* OF1.3+(13,5).  Permissions error. */
534     OFPERR_OFPTFFC_EPERM,
535
536 /* ## ------------------ ## */
537 /* ## OFPET_EXPERIMENTER ## */
538 /* ## ------------------ ## */
539 };
540
541 const char *ofperr_domain_get_name(enum ofp_version);
542
543 bool ofperr_is_valid(enum ofperr);
544
545 enum ofperr ofperr_from_name(const char *);
546
547 enum ofperr ofperr_decode_msg(const struct ofp_header *,
548                               struct ofpbuf *payload);
549 struct ofpbuf *ofperr_encode_reply(enum ofperr, const struct ofp_header *);
550 struct ofpbuf *ofperr_encode_hello(enum ofperr, enum ofp_version ofp_version,
551                                    const char *);
552 int ofperr_get_type(enum ofperr, enum ofp_version);
553 int ofperr_get_code(enum ofperr, enum ofp_version);
554
555 const char *ofperr_get_name(enum ofperr);
556 const char *ofperr_get_description(enum ofperr);
557
558 void ofperr_format(struct ds *, enum ofperr);
559 const char *ofperr_to_string(enum ofperr);
560
561 #endif /* ofp-errors.h */