rfofmsg.cc: Simplify ofm_set_action()

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
rfofmsg.cc: Refactor ofp_mask conversion

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
rfofmsg.cc: Refactor set_command

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
rflib: Make IPAddress::toCIDRMask() const

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
rflib: Add byte-order converters for 64-bit values

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

TLV is a type/length/value structure that supports converting to/from
BSON. It has constructors based on a pointer or different sized integer
values.

Match,Action,Option 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 those types to/from BSON.

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
rflib: Introduce TLV types for Python

New TLV, Match, Action and Option structures can be used to manipulate the
binary values of matches and actions in human-friendy forms.
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)
Option[] options   (Options to apply to the mod, such as priority)

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
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>
nox/rfproxy: Add support for RouteMod

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
pox/rfproxy: Add support for RouteMod

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
rfserver: Add support for RouteMod

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

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
rflib: Add IPAddress constructors

- Constructing from in_addr or in6_addr will automatically detect the IP
  version based on the given structure

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
rflib: Add DatapathConfig-specific Match Types

- Added support for ETHERTYPE, NW_PROTO, TP_SRC, TP_DST Match Types
- Added Action.CONTROLLER() action-constructor in python

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
rflib: Move rfofmsg.{h,cc} into NOX source

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
rfclient: FlowTable whitespace cleanups

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
rfclient: Include missing headers

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
rfclient: Print errors when dropping flows

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
rfclient: Remove obsolete syscalls

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
rfclient: Fix build warnings

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