diff options
author | Jarno Rajahalme <jarno.rajahalme@nsn.com> | 2012-11-30 14:32:12 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2012-12-04 08:25:56 -0800 |
commit | df30f9b1cde861e157059d225f46e16826fe13c0 (patch) | |
tree | e945ea84211cc75e33be434da2fa2e3af378cf2c /build-aux | |
parent | edd70aa7715800f4b109f879e448c8efa40dadd5 (diff) |
ofp-errors: Remove OFPERR_* values for error categories.
The main use of OFPERR_* is to define specific errors, but OFPERR_* also
existed for each possible category of error, to enable partial decoding of
unknown specific errors within a known category. However, in practice,
it was very easy to misuse the error categories as if they were particular
errors. This commit removes the error category values, to make that error
impossible.
(If partial decoding of unknown specific errors turns out to have been a
valuable feature, then we can reintroduce it some other way.)
Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'build-aux')
-rwxr-xr-x | build-aux/extract-ofp-errors | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/build-aux/extract-ofp-errors b/build-aux/extract-ofp-errors index c3273041..fd53001d 100755 --- a/build-aux/extract-ofp-errors +++ b/build-aux/extract-ofp-errors @@ -294,7 +294,6 @@ struct ofperr_domain { const char *name; uint8_t version; enum ofperr (*decode)(uint16_t type, uint16_t code); - enum ofperr (*decode_type)(uint16_t type); struct pair errors[OFPERR_N_ERRORS]; }; @@ -333,24 +332,6 @@ static enum ofperr } return 0; -} - -static enum ofperr -%s_decode_type(uint16_t type) -{ - switch (type) {""" % name - for enum in names: - if enum not in map: - continue - type_, code = map[enum] - if code is not None: - continue - print " case %d:" % type_ - print " return OFPERR_%s;" % enum - print """\ - } - - return 0; }""" print """ @@ -358,8 +339,7 @@ static const struct ofperr_domain %s = { "%s", %d, %s_decode, - %s_decode_type, - {""" % (name, description, version, name, name) + {""" % (name, description, version, name) for enum in names: if enum in map: type_, code = map[enum] |