~james-page/ubuntu/saucy/openvswitch/1.12-snapshot

« back to all changes in this revision

Viewing changes to lib/ofp-errors.h

  • Committer: James Page
  • Date: 2013-08-21 10:16:57 UTC
  • mfrom: (1.1.20)
  • Revision ID: james.page@canonical.com-20130821101657-3o0z0qeiv5zkwlzi
New upstream snapshot

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
 
2
 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
3
3
 *
4
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
5
 * you may not use this file except in compliance with the License.
51
51
 * time and used to determine the mapping between "enum ofperr" constants and
52
52
 * error type/code values used in the OpenFlow protocol:
53
53
 *
54
 
 *   - The first part of each comment specifies OpenFlow type/code for each
55
 
 *     protocol that supports the error.
 
54
 *   - The first part of each comment specifies the vendor, OpenFlow versions,
 
55
 *     type, and sometimes a code for each protocol that supports the error:
 
56
 *
 
57
 *         # The vendor is OF for standard OpenFlow error codes.  Otherwise it
 
58
 *           is one of the *_VENDOR_ID codes defined in openflow-common.h.
 
59
 *
 
60
 *         # The version can specify a specific OpenFlow version, a version
 
61
 *           range delimited by "-", or an open-ended range with "+".
 
62
 *
 
63
 *         # Standard OpenFlow errors have both a type and a code.  Extension
 
64
 *           errors generally have only a type, no code.  There is one
 
65
 *           exception: Nicira extension (NX) errors for OpenFlow 1.0 and 1.1
 
66
 *           have both a type and a code.  (This means that the version
 
67
 *           specification for NX errors may not include version 1.0 or 1.1 (or
 
68
 *           both) along with version 1.2 or later, because the requirements
 
69
 *           for those versions are different.)
56
70
 *
57
71
 *   - Additional text is a human-readable description of the meaning of each
58
72
 *     error, used to explain the error to the user.  Any text enclosed in
61
75
enum ofperr {
62
76
/* Expected duplications. */
63
77
 
64
 
    /* Expected: 3,5 in OF1.1 means both OFPBIC_BAD_EXPERIMENTER and
 
78
    /* Expected: 0x0,3,5 in OF1.1 means both OFPBIC_BAD_EXPERIMENTER and
65
79
     * OFPBIC_BAD_EXP_TYPE. */
66
80
 
67
81
/* ## ------------------ ## */
108
122
 
109
123
    /* NX1.0(1,512), OF1.1+(1,9).  Specified table-id invalid or does not exist.
110
124
     * [ 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
 
125
     *   is used for OpenFlow 1.0 as there seems to be no appropriate error
112
126
     *   code defined the specification. ] */
113
127
    OFPERR_OFPBRC_BAD_TABLE_ID,
114
128
 
115
129
    /* OF1.2+(1,10).  Denied because controller is slave. */
116
130
    OFPERR_OFPBRC_IS_SLAVE,
117
131
 
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. ] */
 
132
    /* NX1.0-1.1(1,514), OF1.2+(1,11).  Invalid port.  [ A non-standard error
 
133
     * (1,514), formerly OFPERR_NXBRC_BAD_IN_PORT is used for OpenFlow 1.0 and
 
134
     * 1.1 as there seems to be no appropriate error code defined the
 
135
     * specifications. ] */
122
136
    OFPERR_OFPBRC_BAD_PORT,
123
137
 
124
138
    /* OF1.2+(1,12).  Invalid packet in packet-out. */
127
141
    /* OF1.3+(1,13).  Multipart request overflowed the assigned buffer. */
128
142
    OFPERR_OFPBRC_MULTIPART_BUFFER_OVERFLOW,
129
143
 
130
 
    /* NX1.0+(1,256).  Invalid NXM flow match. */
 
144
    /* NX1.0-1.1(1,256), NX1.2+(2).  Invalid NXM flow match. */
131
145
    OFPERR_NXBRC_NXM_INVALID,
132
146
 
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. */
 
147
    /* NX1.0-1.1(1,257), NX1.2+(3).  The nxm_type, or nxm_type taken in
 
148
     * combination with nxm_hasmask or nxm_length or both, is invalid or not
 
149
     * implemented. */
135
150
    OFPERR_NXBRC_NXM_BAD_TYPE,
136
151
 
137
 
    /* NX1.0+(1,515).  Must-be-zero field had nonzero value. */
 
152
    /* NX1.0-1.1(1,515), NX1.2+(4).  Must-be-zero field had nonzero value. */
138
153
    OFPERR_NXBRC_MUST_BE_ZERO,
139
154
 
140
 
    /* NX1.0+(1,516).  The reason in an ofp_port_status message is not
141
 
     * valid. */
 
155
    /* NX1.0-1.1(1,516), NX1.2+(5).  The reason in an ofp_port_status message
 
156
     * is not valid. */
142
157
    OFPERR_NXBRC_BAD_REASON,
143
158
 
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').  */
 
159
    /* NX1.0-1.1(1,517), NX1.2+(6).  The 'id' in an NXST_FLOW_MONITOR request
 
160
     * is the same as an existing monitor id (or two monitors in the same
 
161
     * NXST_FLOW_MONITOR request have the same 'id').  */
147
162
    OFPERR_NXBRC_FM_DUPLICATE_ID,
148
163
 
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. */
 
164
    /* NX1.0-1.1(1,518), NX1.2+(7).  The 'flags' in an NXST_FLOW_MONITOR
 
165
     * request either does not specify at least one of the NXFMF_ADD,
 
166
     * NXFMF_DELETE, or NXFMF_MODIFY flags, or specifies a flag bit that is not
 
167
     * defined. */
152
168
    OFPERR_NXBRC_FM_BAD_FLAGS,
153
169
 
154
 
    /* NX1.0+(1,519).  The 'id' in an NXT_FLOW_MONITOR_CANCEL request is not
155
 
     * the id of any existing monitor. */
 
170
    /* NX1.0-1.1(1,519), NX1.2+(8).  The 'id' in an NXT_FLOW_MONITOR_CANCEL
 
171
     * request is not the id of any existing monitor. */
156
172
    OFPERR_NXBRC_FM_BAD_ID,
157
173
 
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
 
174
    /* NX1.0-1.1(1,520), NX1.2+(9).  The 'event' in an NXST_FLOW_MONITOR reply
 
175
     * does not specify one of the NXFME_ABBREV, NXFME_ADD, NXFME_DELETE, or
160
176
     * NXFME_MODIFY. */
161
177
    OFPERR_NXBRC_FM_BAD_EVENT,
162
178
 
163
 
    /* NX1.0+(1,521).  The error that occurred cannot be represented in this
164
 
     * OpenFlow version. */
 
179
    /* NX1.0-1.1(1,521), NX1.2+(10).  The error that occurred cannot be
 
180
     * represented in this OpenFlow version. */
165
181
    OFPERR_NXBRC_UNENCODABLE_ERROR,
166
182
 
167
183
/* ## ---------------- ## */
217
233
    /* OF1.2+(2,15).  Bad argument in SET_FIELD action. */
218
234
    OFPERR_OFPBAC_ARGUMENT,
219
235
 
220
 
    /* NX1.0+(2,256).  Must-be-zero action argument had nonzero value. */
 
236
    /* NX1.0-1.1(2,256), NX1.2+(11).  Must-be-zero action argument had nonzero
 
237
     * value. */
221
238
    OFPERR_NXBAC_MUST_BE_ZERO,
222
239
 
223
240
/* ## --------------------- ## */
251
268
    /* OF1.2+(3,8).  Permissions error. */
252
269
    OFPERR_OFPBIC_EPERM,
253
270
 
 
271
    /* ONF1.1+(2600).  Duplicate instruction. */
 
272
    OFPERR_ONFBIC_DUP_INSTRUCTION,
 
273
 
254
274
/* ## --------------- ## */
255
275
/* ## OFPET_BAD_MATCH ## */
256
276
/* ## --------------- ## */
282
302
     * field. */
283
303
    OFPERR_OFPBMC_BAD_VALUE,
284
304
 
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. */
 
305
    /* NX1.0-1.1(1,259), OF1.2+(4,8).  Unsupported mask specified in the match,
 
306
     * field is not dl-address or nw-address. */
287
307
    OFPERR_OFPBMC_BAD_MASK,
288
308
 
289
 
    /* NX1.0(1,260), NX1.1(1,260), OF1.2+(4,9).  A prerequisite was not met. */
 
309
    /* NX1.0-1.1(1,260), OF1.2+(4,9).  A prerequisite was not met. */
290
310
    OFPERR_OFPBMC_BAD_PREREQ,
291
311
 
292
 
    /* NX1.0(1,261), NX1.1(1,261), OF1.2+(4,10).  A field type was
293
 
     * duplicated. */
 
312
    /* NX1.0-1.1(1,261), OF1.2+(4,10).  A field type was duplicated. */
294
313
    OFPERR_OFPBMC_DUP_FIELD,
295
314
 
296
315
    /* OF1.2+(4,11).  Permissions error. */
333
352
     * specified. */
334
353
    OFPERR_OFPFMFC_UNSUPPORTED,
335
354
 
336
 
    /* NX1.0(3,256), NX1.1(5,256).  Generic hardware error. */
 
355
    /* NX1.0-1.1(5,256), NX1.2+(12).  Generic hardware error. */
337
356
    OFPERR_NXFMFC_HARDWARE,
338
357
 
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. */
 
358
    /* NX1.0-1.1(5,257), NX1.2+(13).  A nonexistent table ID was specified in
 
359
     * the "command" field of struct ofp_flow_mod, when the
 
360
     * nxt_flow_mod_table_id extension is enabled. */
342
361
    OFPERR_NXFMFC_BAD_TABLE_ID,
343
362
 
344
363
/* ## ---------------------- ## */
388
407
    OFPERR_OFPGMFC_BAD_COMMAND,
389
408
 
390
409
    /* OF1.2+(6,12).  Error in bucket. */
391
 
    OFPERR_OFPGMFC_OFPGMFC_BAD_BUCKET,
 
410
    OFPERR_OFPGMFC_BAD_BUCKET,
392
411
 
393
412
    /* OF1.2+(6,13).  Error in watch port/group. */
394
 
    OFPERR_OFPGMFC_OFPGMFC_BAD_WATCH,
 
413
    OFPERR_OFPGMFC_BAD_WATCH,
395
414
 
396
415
    /* OF1.2+(6,14).  Permissions error. */
397
 
    OFPERR_OFPGMFC_OFPGMFC_EPERM,
 
416
    OFPERR_OFPGMFC_EPERM,
398
417
 
399
418
/* ## --------------------- ## */
400
419
/* ## OFPET_PORT_MOD_FAILED ## */
465
484
    /* OF1.2+(11,1).  Controller role change unsupported. */
466
485
    OFPERR_OFPRRFC_UNSUP,
467
486
 
468
 
    /* NX1.0(1,513), NX1.1(1,513), OF1.2+(11,2).  Invalid role. */
 
487
    /* NX1.0-1.1(1,513), OF1.2+(11,2).  Invalid role. */
469
488
    OFPERR_OFPRRFC_BAD_ROLE,
470
489
 
471
490
/* ## ---------------------- ## */
542
561
 
543
562
bool ofperr_is_valid(enum ofperr);
544
563
 
545
 
enum ofperr ofperr_decode(enum ofp_version, uint16_t type, uint16_t code);
546
564
enum ofperr ofperr_from_name(const char *);
547
565
 
548
566
enum ofperr ofperr_decode_msg(const struct ofp_header *,
550
568
struct ofpbuf *ofperr_encode_reply(enum ofperr, const struct ofp_header *);
551
569
struct ofpbuf *ofperr_encode_hello(enum ofperr, enum ofp_version ofp_version,
552
570
                                   const char *);
 
571
int ofperr_get_vendor(enum ofperr, enum ofp_version);
553
572
int ofperr_get_type(enum ofperr, enum ofp_version);
554
573
int ofperr_get_code(enum ofperr, enum ofp_version);
555
574