ofp-util: Make ofputil_encode_set_protocol() able to return failure.
authorBen Pfaff <blp@nicira.com>
Fri, 16 Nov 2012 06:09:07 +0000 (22:09 -0800)
committerBen Pfaff <blp@nicira.com>
Fri, 16 Nov 2012 17:20:21 +0000 (09:20 -0800)
commite43928f2862b83a3c13e8662490a22fa25405be5
tree60da2c09411816082da3d2c039c57700635628e3
parent7cd903564fa4f64a815af311232213f0e770d012
ofp-util: Make ofputil_encode_set_protocol() able to return failure.

Soon, it's not going to be possible to switch between every possible
protocol on an established OpenFlow connection, yet
ofputil_encode_set_protocol() didn't have a documented way to report such
a problem.  This commit adds a means for reporting and makes its callers
able to handle the problem.

Also, initially make ofputil_encode_set_protocol() fail when the current
and requested protocols are for different OpenFlow versions.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
lib/learning-switch.c
lib/ofp-util.c
utilities/ovs-ofctl.c