Improve thread-safety of finding local Interfaces

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

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
Add Forwarding Path Manager header from Quagga

This adds the version 1 FPM header from the following Quagga commit:
443b993777e3e86fceb988f647d1c5b57661a182. This was included in the
Quagga 0.99.22 release.

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

Forwarding Path Manager (FPM) interface is a new protocol for allowing
routing engines to send RIB updates in a platform independent way. This
is an alternative to NetLink.

This patch adds a new thread to liaise with software that supports
having an external Forwarding Path Manager (FPM). To compile with FPM
support, see the Makefile in rfclient. FPM is disabled by default.
Add experimental FPM NHLFE support

This patch expands the previous FPM support by defining structures for
sharing Next-Hop Label-Forwarding Entries (NHLFE) between FPM entities.
Initially, this supports push, pop, swap operations for MPLS paths.
Matching incoming IP addresses is not supported. Forwarding Equivalence
Class To NHLFE (FTN) support is considered future work, and is stubbed
in this patch.
Log NHLFEs when they are received

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
Set route priority lower than controller traffic

Previously, we had a single base priority which was used for route
priorities (and modified for LPM), and also for controller traffic. This
meant that traffic bound for the default route could match before
controller-bound traffic. This patch fixes the issue by introducing four
priority bands:

PRIORITY_LOWEST: 0
PRIORITY_LOW: 16400 (For routes, adjusted by +10*Prefix length)
PRIORITY_HIGH: 32800 (For controller traffic)
PRIORITY_HIGHEST: 49200 (Unused, but could implement firewall-style rules)

One side effect of this adjustment under the current codebase is that
all controller-type traffic (ALL BGP,ICMP,ARP,LDP,OSPF,etc) will be
routed via the controller. A future patch should adjust this to restrict
such traffic to only controller-type traffic that is destined for the
controller.

This fixes issue https://github.com/joestringer/RouteFlow/issues/2.

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
Add support for different event libraries

Currently, we use threading and time from the main python libraries
for handling IPC events. However, if we wish to work with controllers
that use alternative event libraries such as gevent, this will cause
conflicts.

This patch adds two additional parameters to MongoIPCMessageService's
constructor, allowing clients to specify a thread constructor and sleep
function. By default, this should have no effect on the operation of
RouteFlow.

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
Correct setEthernet() documentation

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
Simplify adding matches to RouteMods

Signed-off-by: Joe Stringer <joestringernz@gmail.com>
Add scripts to fetch dependencies

./build.sh will install RouteFlow's dependencies from debian packages or
source (releases or git), and fetch alternative RFProxy implementations
from remote git repositories. It then bootstraps, configures and builds
all of the RouteFlow components.

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