ofp-msgs: New approach to encoding and decoding OpenFlow headers.
authorBen Pfaff <blp@nicira.com>
Fri, 20 Jul 2012 06:23:17 +0000 (23:23 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 25 Jul 2012 05:24:30 +0000 (22:24 -0700)
commit8b97ad35e5a36375a357b0c0830ecba3ab0a1b1a
tree9f680567b8fce52f14645018f7c712b0329b0f73
parent5921e99ab1d0b6e0964b79a29107c65b5fb24f80
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>
---
v3: New commit.  This isn't complete yet: in particular the program for
extracting the numbers from the ofp-msgs.h header file isn't written,
although there's a skeleton.  That means that nothing has been tested or
carefully looked over, either.

v3->v4: Almost ready.  The ofp-msgs.c functions need some comments
and careful review.

v4->v5: Ready for review.
26 files changed:
build-aux/extract-ofp-msgs [new file with mode: 0755]
include/openflow/nicira-ext.h
include/openflow/openflow-1.0.h
include/openflow/openflow-1.1.h
include/openflow/openflow-1.2.h
include/openflow/openflow-common.h
lib/.gitignore
lib/automake.mk
lib/learning-switch.c
lib/ofp-errors.c
lib/ofp-errors.h
lib/ofp-msgs.c [new file with mode: 0644]
lib/ofp-msgs.h [new file with mode: 0644]
lib/ofp-print.c
lib/ofp-util.c
lib/ofp-util.h
lib/rconn.c
lib/stream.c
lib/vconn.c
ofproto/connmgr.c
ofproto/ofproto.c
tests/ofp-print.at
tests/ofproto-dpif.at
tests/ofproto-macros.at
tests/test-vconn.c
utilities/ovs-ofctl.c