aboutsummaryrefslogtreecommitdiff
path: root/lib/ofp-errors.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2012-07-19 23:23:17 -0700
committerBen Pfaff <blp@nicira.com>2012-07-30 21:09:12 -0700
commit982697a4d24caa0a3bdaf85db67619338b382e50 (patch)
tree028e7fd69f9f836f2785b5096d78eb8046568a80 /lib/ofp-errors.h
parent4b3b8d8fa14bbe4000c6591eef74e0a0d51a3929 (diff)
ofp-msgs: New approach to encoding and decoding OpenFlow headers.
OpenFlow headers are not as uniform as they could be, with size, alignment, and numbering changes from one version to another and across varieties (e.g. ordinary messages vs. "stats" messages). Until now the Open vSwitch internal APIs haven't done a good job of abstracting those differences in header formats. This commit changes that; from this commit forward very little code actually needs to understand the header format or numbering. Instead, it can just encode or decode, or pull or put, the header using a more abstract API using the ofpraw_, ofptype_, and other APIs in the new ofp-msgs module. Signed-off-by: Ben Pfaff <blp@nicira.com> Tested-by: Simon Horman <horms@verge.net.au> Reviewed-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'lib/ofp-errors.h')
-rw-r--r--lib/ofp-errors.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/ofp-errors.h b/lib/ofp-errors.h
index dddf8d04..1af70da9 100644
--- a/lib/ofp-errors.h
+++ b/lib/ofp-errors.h
@@ -23,6 +23,7 @@
struct ds;
struct ofp_header;
+struct ofpbuf;
/* Error codes.
*
@@ -508,7 +509,8 @@ enum ofperr ofperr_decode(const struct ofperr_domain *,
enum ofperr ofperr_decode_type(const struct ofperr_domain *, uint16_t type);
enum ofperr ofperr_from_name(const char *);
-enum ofperr ofperr_decode_msg(const struct ofp_header *, size_t *payload_ofs);
+enum ofperr ofperr_decode_msg(const struct ofp_header *,
+ struct ofpbuf *payload);
struct ofpbuf *ofperr_encode_reply(enum ofperr, const struct ofp_header *);
struct ofpbuf *ofperr_encode_hello(enum ofperr, const struct ofperr_domain *,
const char *);