ofp-errors: Remove OFPERR_* values for error categories.
[sliver-openvswitch.git] / lib / ofp-errors.h
1 /*
2  * Copyright (c) 2008, 2009, 2010, 2011, 2012 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 appropriste 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 appropriste 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 /* ## ---------------- ## */
164 /* ## OFPET_BAD_ACTION ## */
165 /* ## ---------------- ## */
166
167     /* OF1.0+(2,0).  Unknown action type. */
168     OFPERR_OFPBAC_BAD_TYPE,
169
170     /* OF1.0+(2,1).  Length problem in actions. */
171     OFPERR_OFPBAC_BAD_LEN,
172
173     /* OF1.0+(2,2).  Unknown experimenter id specified. */
174     OFPERR_OFPBAC_BAD_VENDOR,
175
176     /* OF1.0+(2,3).  Unknown action type for experimenter id. */
177     OFPERR_OFPBAC_BAD_VENDOR_TYPE,
178
179     /* OF1.0+(2,4).  Problem validating output port. */
180     OFPERR_OFPBAC_BAD_OUT_PORT,
181
182     /* OF1.0+(2,5).  Bad action argument. */
183     OFPERR_OFPBAC_BAD_ARGUMENT,
184
185     /* OF1.0+(2,6).  Permissions error. */
186     OFPERR_OFPBAC_EPERM,
187
188     /* OF1.0+(2,7).  Can't handle this many actions. */
189     OFPERR_OFPBAC_TOO_MANY,
190
191     /* OF1.0+(2,8).  Problem validating output queue. */
192     OFPERR_OFPBAC_BAD_QUEUE,
193
194     /* OF1.1+(2,9).  Invalid group id in forward action. */
195     OFPERR_OFPBAC_BAD_OUT_GROUP,
196
197     /* OF1.1+(2,10).  Action can't apply for this match. */
198     OFPERR_OFPBAC_MATCH_INCONSISTENT,
199
200     /* OF1.1+(2,11).  Action order is unsupported for the action list in an
201      * Apply-Actions instruction */
202     OFPERR_OFPBAC_UNSUPPORTED_ORDER,
203
204     /* OF1.1+(2,12).  Actions uses an unsupported tag/encap. */
205     OFPERR_OFPBAC_BAD_TAG,
206
207     /* OF1.2+(2,13).  Unsupported type in SET_FIELD action. */
208     OFPERR_OFPBAC_SET_TYPE,
209
210     /* OF1.2+(2,14).  Length problem in SET_FIELD action. */
211     OFPERR_OFPBAC_SET_LEN,
212
213     /* OF1.2+(2,15).  Bad argument in SET_FIELD action. */
214     OFPERR_OFPBAC_ARGUMENT,
215
216     /* NX1.0+(2,256).  Must-be-zero action argument had nonzero value. */
217     OFPERR_NXBAC_MUST_BE_ZERO,
218
219 /* ## --------------------- ## */
220 /* ## OFPET_BAD_INSTRUCTION ## */
221 /* ## --------------------- ## */
222
223     /* OF1.1+(3,0).  Unknown instruction. */
224     OFPERR_OFPBIC_UNKNOWN_INST,
225
226     /* OF1.1+(3,1).  Switch or table does not support the instruction. */
227     OFPERR_OFPBIC_UNSUP_INST,
228
229     /* OF1.1+(3,2).  Invalid Table-ID specified. */
230     OFPERR_OFPBIC_BAD_TABLE_ID,
231
232     /* OF1.1+(3,3).  Metadata value unsupported by datapath. */
233     OFPERR_OFPBIC_UNSUP_METADATA,
234
235     /* OF1.1+(3,4).  Metadata mask value unsupported by datapath. */
236     OFPERR_OFPBIC_UNSUP_METADATA_MASK,
237
238     /* OF1.1+(3,5).  Unknown experimenter id specified. */
239     OFPERR_OFPBIC_BAD_EXPERIMENTER,
240
241     /* OF1.1(3,5), OF1.2+(3,6).  Unknown instruction for experimenter id. */
242     OFPERR_OFPBIC_BAD_EXP_TYPE,
243
244     /* OF1.2+(3,7).  Length problem in instructions. */
245     OFPERR_OFPBIC_BAD_LEN,
246
247     /* OF1.2+(3,8).  Permissions error. */
248     OFPERR_OFPBIC_EPERM,
249
250 /* ## --------------- ## */
251 /* ## OFPET_BAD_MATCH ## */
252 /* ## --------------- ## */
253
254     /* OF1.1+(4,0).  Unsupported match type specified by the match */
255     OFPERR_OFPBMC_BAD_TYPE,
256
257     /* OF1.1+(4,1).  Length problem in match. */
258     OFPERR_OFPBMC_BAD_LEN,
259
260     /* OF1.1+(4,2).  Match uses an unsupported tag/encap. */
261     OFPERR_OFPBMC_BAD_TAG,
262
263     /* OF1.1+(4,3).  Unsupported datalink addr mask - switch does not support
264      * arbitrary datalink address mask. */
265     OFPERR_OFPBMC_BAD_DL_ADDR_MASK,
266
267     /* OF1.1+(4,4).  Unsupported network addr mask - switch does not support
268      * arbitrary network address mask. */
269     OFPERR_OFPBMC_BAD_NW_ADDR_MASK,
270
271     /* OF1.1+(4,5).  Unsupported wildcard specified in the match. */
272     OFPERR_OFPBMC_BAD_WILDCARDS,
273
274     /* OF1.1+(4,6).  Unsupported field in the match. */
275     OFPERR_OFPBMC_BAD_FIELD,
276
277     /* NX1.0(1,258), OF1.1+(4,7).  Unsupported value in a match
278      * field. */
279     OFPERR_OFPBMC_BAD_VALUE,
280
281     /* NX1.0(1,259), NX1.1(1,259), OF1.2+(4,8).  Unsupported mask specified in
282      * the match, field is not dl-address or nw-address. */
283     OFPERR_OFPBMC_BAD_MASK,
284
285     /* NX1.0(1,260), NX1.1(1,260), OF1.2+(4,9).  A prerequisite was not met. */
286     OFPERR_OFPBMC_BAD_PREREQ,
287
288     /* NX1.0(1,261), NX1.1(1,261), OF1.2+(4,10).  A field type was
289      * duplicated. */
290     OFPERR_OFPBMC_DUP_FIELD,
291
292     /* OF1.2+(4,11).  Permissions error. */
293     OFPERR_OFPBMC_EPERM,
294
295 /* ## --------------------- ## */
296 /* ## OFPET_FLOW_MOD_FAILED ## */
297 /* ## --------------------- ## */
298
299     /* OF1.1+(5,0).  Unspecified error. */
300     OFPERR_OFPFMFC_UNKNOWN,
301
302     /* OF1.0(3,0), OF1.1+(5,1).  Flow not added because of full table(s). */
303     OFPERR_OFPFMFC_TABLE_FULL,
304
305     /* OF1.1+(5,2).  Table does not exist */
306     OFPERR_OFPFMFC_BAD_TABLE_ID,
307
308     /* OF1.0(3,1), OF1.1+(5,3).  Attempted to add overlapping flow with
309      * CHECK_OVERLAP flag set. */
310     OFPERR_OFPFMFC_OVERLAP,
311
312     /* OF1.0(3,2), OF1.1+(5,4).  Permissions error. */
313     OFPERR_OFPFMFC_EPERM,
314
315     /* OF1.1+(5,5).  Flow not added because of unsupported idle/hard
316      * timeout. */
317     OFPERR_OFPFMFC_BAD_TIMEOUT,
318
319     /* OF1.0(3,3).  Flow not added because of non-zero idle/hard timeout. */
320     OFPERR_OFPFMFC_BAD_EMERG_TIMEOUT,
321
322     /* OF1.0(3,4), OF1.1+(5,6).  Unsupported or unknown command. */
323     OFPERR_OFPFMFC_BAD_COMMAND,
324
325     /* OF1.2+(5,7).  Unsupported or unknown flags. */
326     OFPERR_OFPFMFC_BAD_FLAGS,
327
328     /* OF1.0(3,5).  Unsupported action list - cannot process in the order
329      * specified. */
330     OFPERR_OFPFMFC_UNSUPPORTED,
331
332     /* NX1.0(3,256), NX1.1(5,256).  Generic hardware error. */
333     OFPERR_NXFMFC_HARDWARE,
334
335     /* NX1.0(3,257), NX1.1(5,257).  A nonexistent table ID was specified in the
336      * "command" field of struct ofp_flow_mod, when the nxt_flow_mod_table_id
337      * extension is enabled. */
338     OFPERR_NXFMFC_BAD_TABLE_ID,
339
340 /* ## ---------------------- ## */
341 /* ## OFPET_GROUP_MOD_FAILED ## */
342 /* ## ---------------------- ## */
343
344     /* OF1.1+(6,0).  Group not added because a group ADD attempted to replace
345      * an already-present group. */
346     OFPERR_OFPGMFC_GROUP_EXISTS,
347
348     /* OF1.1+(6,1).  Group not added because Group specified is invalid. */
349     OFPERR_OFPGMFC_INVALID_GROUP,
350
351     /* OF1.1+(6,2).  Switch does not support unequal load sharing with select
352      * groups. */
353     OFPERR_OFPGMFC_WEIGHT_UNSUPPORTED,
354
355     /* OF1.1+(6,3).  The group table is full. */
356     OFPERR_OFPGMFC_OUT_OF_GROUPS,
357
358     /* OF1.1+(6,4).  The maximum number of action buckets for a group has been
359      * exceeded. */
360     OFPERR_OFPGMFC_OUT_OF_BUCKETS,
361
362     /* OF1.1+(6,5).  Switch does not support groups that forward to groups. */
363     OFPERR_OFPGMFC_CHAINING_UNSUPPORTED,
364
365     /* OF1.1+(6,6).  This group cannot watch the watch_port or watch_group
366      * specified. */
367     OFPERR_OFPGMFC_WATCH_UNSUPPORTED,
368
369     /* OF1.1+(6,7).  Group entry would cause a loop. */
370     OFPERR_OFPGMFC_LOOP,
371
372     /* OF1.1+(6,8).  Group not modified because a group MODIFY attempted to
373      * modify a non-existent group. */
374     OFPERR_OFPGMFC_UNKNOWN_GROUP,
375
376     /* OF1.2+(6,9).  Group not deleted because another
377                     group is forwarding to it. */
378     OFPERR_OFPGMFC_CHAINED_GROUP,
379
380     /* OF1.2+(6,10).  Unsupported or unknown group type. */
381     OFPERR_OFPGMFC_BAD_TYPE,
382
383     /* OF1.2+(6,11).  Unsupported or unknown command. */
384     OFPERR_OFPGMFC_BAD_COMMAND,
385
386     /* OF1.2+(6,12).  Error in bucket. */
387     OFPERR_OFPGMFC_OFPGMFC_BAD_BUCKET,
388
389     /* OF1.2+(6,13).  Error in watch port/group. */
390     OFPERR_OFPGMFC_OFPGMFC_BAD_WATCH,
391
392     /* OF1.2+(6,14).  Permissions error. */
393     OFPERR_OFPGMFC_OFPGMFC_EPERM,
394
395 /* ## --------------------- ## */
396 /* ## OFPET_PORT_MOD_FAILED ## */
397 /* ## --------------------- ## */
398
399     /* OF1.0(4,0), OF1.1+(7,0).  Specified port does not exist. */
400     OFPERR_OFPPMFC_BAD_PORT,
401
402     /* OF1.0(4,1), OF1.1+(7,1).  Specified hardware address does not match the
403      * port number. */
404     OFPERR_OFPPMFC_BAD_HW_ADDR,
405
406     /* OF1.1+(7,2).  Specified config is invalid. */
407     OFPERR_OFPPMFC_BAD_CONFIG,
408
409     /* OF1.1+(7,3).  Specified advertise is invalid. */
410     OFPERR_OFPPMFC_BAD_ADVERTISE,
411
412     /* OF1.2+(7,4).  Permissions error. */
413     OFPERR_OFPPMFC_EPERM,
414
415 /* ## ---------------------- ## */
416 /* ## OFPET_TABLE_MOD_FAILED ## */
417 /* ## ---------------------- ## */
418
419     /* OF1.1+(8,0).  Specified table does not exist. */
420     OFPERR_OFPTMFC_BAD_TABLE,
421
422     /* OF1.1+(8,1).  Specified config is invalid. */
423     OFPERR_OFPTMFC_BAD_CONFIG,
424
425     /* OF1.2+(8,2).  Permissions error. */
426     OFPERR_OFPTMFC_EPERM,
427
428 /* ## --------------------- ## */
429 /* ## OFPET_QUEUE_OP_FAILED ## */
430 /* ## --------------------- ## */
431
432     /* OF1.0(5,0), OF1.1+(9,0).  Invalid port (or port does not exist). */
433     OFPERR_OFPQOFC_BAD_PORT,
434
435     /* OF1.0(5,1), OF1.1+(9,1).  Queue does not exist. */
436     OFPERR_OFPQOFC_BAD_QUEUE,
437
438     /* OF1.0(5,2), OF1.1+(9,2).  Permissions error. */
439     OFPERR_OFPQOFC_EPERM,
440
441 /* ## -------------------------- ## */
442 /* ## OFPET_SWITCH_CONFIG_FAILED ## */
443 /* ## -------------------------- ## */
444
445     /* OF1.1+(10,0).  Specified flags is invalid. */
446     OFPERR_OFPSCFC_BAD_FLAGS,
447
448     /* OF1.1+(10,1).  Specified len is invalid. */
449     OFPERR_OFPSCFC_BAD_LEN,
450
451     /* OF1.2+(10,2).  Permissions error. */
452     OFPERR_OFPSCFC_EPERM,
453
454 /* ## ------------------------- ## */
455 /* ## OFPET_ROLE_REQUEST_FAILED ## */
456 /* ## ------------------------- ## */
457
458     /* OF1.2+(11,0).  Stale Message: old generation_id. */
459     OFPERR_OFPRRFC_STALE,
460
461     /* OF1.2+(11,1).  Controller role change unsupported. */
462     OFPERR_OFPRRFC_UNSUP,
463
464     /* NX1.0(1,513), NX1.1(1,513), OF1.2+(11,2).  Invalid role. */
465     OFPERR_OFPRRFC_BAD_ROLE,
466
467 /* ## ---------------------- ## */
468 /* ## OFPET_METER_MOD_FAILED ## */
469 /* ## ---------------------- ## */
470
471     /* OF1.3+(12,0).  Unspecified error. */
472     OFPERR_OFPMMFC_UNKNOWN,
473
474     /* OF1.3+(12,1).  Meter not added because a Meter ADD attempted to
475      * replace an existing Meter. */
476     OFPERR_OFPMMFC_METER_EXISTS,
477
478     /* OF1.3+(12,2).  Meter not added because Meter specified is invalid. */
479     OFPERR_OFPMMFC_INVALID_METER,
480
481     /* OF1.3+(12,3).  Meter not modified because a Meter MODIFY attempted
482      * to modify a non-existent Meter. */
483     OFPERR_OFPMMFC_UNKNOWN_METER,
484
485     /* OF1.3+(12,4).  Unsupported or unknown command. */
486     OFPERR_OFPMMFC_BAD_COMMAND,
487
488     /* OF1.3+(12,5).  Flag configuration unsupported. */
489     OFPERR_OFPMMFC_BAD_FLAGS,
490
491     /* OF1.3+(12,6).  Rate unsupported. */
492     OFPERR_OFPMMFC_BAD_RATE,
493
494     /* OF1.3+(12,7).  Burst size unsupported. */
495     OFPERR_OFPMMFC_BAD_BURST,
496
497     /* OF1.3+(12,8).  Band unsupported. */
498     OFPERR_OFPMMFC_BAD_BAND,
499
500     /* OF1.3+(12,9).  Band value unsupported. */
501     OFPERR_OFPMMFC_BAD_BAND_VALUE,
502
503     /* OF1.3+(12,10).  No more meters available. */
504     OFPERR_OFPMMFC_OUT_OF_METERS,
505
506     /* OF1.3+(12,11).  The maximum number of properties for a meter has
507      * been exceeded. */
508     OFPERR_OFPMMFC_OUT_OF_BANDS,
509
510 /* ## --------------------------- ## */
511 /* ## OFPET_TABLE_FEATURES_FAILED ## */
512 /* ## --------------------------- ## */
513
514     /* OF1.3+(13,0).  Specified table does not exist. */
515     OFPERR_OFPTFFC_BAD_TABLE,
516
517     /* OF1.3+(13,1).  Invalid metadata mask. */
518     OFPERR_OFPTFFC_BAD_METADATA,
519
520     /* OF1.3+(13,2).  Unknown property type. */
521     OFPERR_OFPTFFC_BAD_TYPE,
522
523     /* OF1.3+(13,3).  Length problem in properties. */
524     OFPERR_OFPTFFC_BAD_LEN,
525
526     /* OF1.3+(13,4).  Unsupported property value. */
527     OFPERR_OFPTFFC_BAD_ARGUMENT,
528
529     /* OF1.3+(13,5).  Permissions error. */
530     OFPERR_OFPTFFC_EPERM,
531
532 /* ## ------------------ ## */
533 /* ## OFPET_EXPERIMENTER ## */
534 /* ## ------------------ ## */
535 };
536
537 const char *ofperr_domain_get_name(enum ofp_version);
538
539 bool ofperr_is_valid(enum ofperr);
540 bool ofperr_is_encodable(enum ofperr, enum ofp_version);
541
542 enum ofperr ofperr_decode(enum ofp_version, uint16_t type, uint16_t code);
543 enum ofperr ofperr_from_name(const char *);
544
545 enum ofperr ofperr_decode_msg(const struct ofp_header *,
546                               struct ofpbuf *payload);
547 struct ofpbuf *ofperr_encode_reply(enum ofperr, const struct ofp_header *);
548 struct ofpbuf *ofperr_encode_hello(enum ofperr, enum ofp_version ofp_version,
549                                    const char *);
550 int ofperr_get_type(enum ofperr, enum ofp_version);
551 int ofperr_get_code(enum ofperr, enum ofp_version);
552
553 const char *ofperr_get_name(enum ofperr);
554 const char *ofperr_get_description(enum ofperr);
555
556 void ofperr_format(struct ds *, enum ofperr);
557 const char *ofperr_to_string(enum ofperr);
558
559 #endif /* ofp-errors.h */