OpenNetworkingFoundation/libfluid_base — pull request #4 by bertvl-netro (2014-12-10 13:03:37+00:00)
Title: OFClient into libfluid_base, switch vs controller independence

Add OFClient to libfluid_base. …
This initial version is copied directly from the libfluid bundle repository,
from examples/switch/client/ directory. Once it is embedded in
libfluid_base, we can make additional improvements more easily.

Expand OFClient, make controller/switch independent of client/server. …
- Move OFClient into fluid_base namespace
- Move OFClient implementation from .hh to .cc, add some comments in .hh
- Remove dependency on libfluid_msg that was present in OFClient
- In both OFClient and OFServer: send FEATURES_REQUEST after HELLO received if controller, or respond to FEATURES_REQUEST with FEATURES_REPLY if switch
- Add members to represent FEATURES_REPLY items in OFServerSettings class (OFServerSettings class now used by OFClient too, so bit of a misnomer)
- Add struct ofp_switch_features to of.hh to facilitate the FEATURES_REPLY message

Note: the main motivation for making controller/switch independent from client/server is the following paragraph from the OpenFlow specification:
Optionally, the switch may allow the controller to initiate the connection.
In this case, the switch should accept incoming standard TLS or TCP connections
from the controller, using either a user-specified transport port or the default
OpenFlow transport port 6653 . Connections initiated by the switch and the
controller behave the same once the transport connection is established.

The secondary motivation is to allow OFClient to connect as a controller to an Open vSwitch instance which has been configured with a 'ptcp:6653' setting (see manpage for ovs-vsctl, under 'OpenFlow Controller Connectivity' section).