rflib: Introduce TLV, Action, Match types

TLV is a type/length/value structure that supports converting to/from
BSON. It has constructors based on a pointer or a 32-bit value.

Match,Action are subtypes of TLV that restrict the values to be stored
inside the TLV to specific types and values. They also provide functions
to handle converting vectors of Matches,Actions to/from BSON.

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
---
v4:
- Fix segfaults when translating Match,Actions to BSON
- Fix bugs where multi-byte values were not serialised correctly
- Fix RouteMod allocation/deallocation of Match,Actions
v3:
- Fix bugs where MongoIPC throws exceptions in from_BSON() code
- Use boost smart pointers
- Place 32-bit values in network byte-order when storing.
- Move TLV::from_BSON to the subclasses Match,Action.
v2:
- Add Match(TLV), Action(TLV) constructors
- Add static TLV::from_BSON() factory
- Add TLV::getLength()
- Move TLVList to ActionList,MatchList
- Make TLV::toString() use virtual type_to_string() functions
- Remove redundant constructors
- Fixed segfault on Match,Action construction
- Do basic sanity checking on BSON input
- Set output action length correctly
- Serialised TLVs now always have "value" (can be 0-length)
- Comment the TLV class
- Rename "data" to "value"

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
rflib: Introduce RouteMod structure

The previous RouteInfo/FlowMod structures had several static fields to
define the values that the datapath should match on, and what it should
do in response.

This patch introduces a replacement structure called RouteMod that has
a simpler structure as follows:

uint8_t mod        (= Add,Remove,Modify)
uint64_t id        (of a datapath or VM)
Match[] matches    (Values to match on, such as IPv4 address)
Action[] actions   (Actions to carry out, such as forward)

Signed-off-by: Joe Stringer <joestringernz@gmail.com>

---
v4:
- Base against newer TLV/Match/Action classes
v3:
- Pass correct types to bson->vector converters
v2: rflib/defs.py: Fix RFMT_* defines
    Rename "RMT_REMOVE" to "RMT_DELETE"
    Rebase against v2 TLVs
    Serialise uint8_t as int
nox/rfproxy: Add new OpenFlow interface

This patch adds rfproxy/OFInterface.{cc,hh} to construct OpenFlow
FlowMod structures using the controller's API. Currently this means
interfacing with rfofmsg.

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
---
v2:
- Base against newer TLV/Match/Action classes
- Fixes initialisation of ofp_flow_mods
nox/rfproxy: Add support for RouteMod structure

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
rflib: Introduce TLV, Match, Action Types for Python

New TLV, Match and Action structures can be used to manipulate
the binary values of matches and actions in human readable forms.
rfserver: Add support for RouteMod structure

When RFClient sends a RouteMod, RFServer will replace the DPID/Port and
forward to RFProxy. Behaviour of RouteInfo->FlowMod messages remains
the same.

---
v2:
- Fix runtime crashes with unrecognised VM ids in RouteMods
- Write debug output including vm_id and vm_port when dropping RouteMods
rfclient: Replaces RouteInfo with RouteMod

---
v2:
- Base against newer TLV/Match/Action classes
- Fix bug with Matches running out of scope before being serialised