Generic order book support

Signed-off-by: Marat Stanichenko <mstanichenko@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
FAST: Level 2 market data support

This patch implements the core logic of FIX over FAST
market data receiving process. Its main purpose is to
let users follow an arbitrary number of order books
in real time i.e. order books of various instruments
and different depths.

To complete the goal, this patch introduces a few
data structures to be used by an external user.
'struct fast_book' represents a particular order
book which state is managed via FIX over FAST data
flow. 'struct fast_book_set' represents a collection
of order books which are updated through snapshot and
incremental data feeds.

The patch assumes that an order book's levels are updated
with help of two types of FIX messages: Snapshot Full
Refresh and Incremental Refresh. Whenever a user subscribes
to a particular order book we first reconstruct its state
by following snapshot messages. Once we are able to catch
order book's snapshot, we start following incremental
messages and apply them one by one.

It could happen that incremental messages disrupt the
incoming order i.e. incoming gaps are detected. In such
a case we assume that all order books' states are invalid.
We apply recovery procedure for each order book separately.

Signed-off-by: Marat Stanichenko <mstanichenko@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
FAST: Limit orderbook vizualization

The patch implements a sample application which is
intended to follow and display orderbook dynamics.
The application demonstrates how libtrading can be
used to achieve such a goal.

Here a few notes regarding the application structure:

* template file is an input parameter provided by the
FAST market data disseminator

* configuration file is an input parameter which defines
necessary market data feeds and orderbooks to follow.

The snippet below defines two incremental and one snapshot
UDP multicast data feeds. 'ip' is a multicast group ip address,
'port' port number to be used, 'lip' ip address of local interface
(see IP_ADD_MEMBERSHIP socket option for details)

	<feeds>
		<feed type="increment">
			<ip value="239.1.1.5" />
			<lip value="0.0.0.0" />
			<port value="15005" />
		</feed>
		<feed type="increment">
			<ip value="239.1.2.5" />
			<lip value="0.0.0.0" />
			<port value="16005" />
		</feed>
		<feed type="snapshot">
			<ip value="239.1.1.6" />
			<lip value="0.0.0.0" />
			<port value="15006" />
		</feed>
	</feeds>

The snippet below defines a single order book to follow

	<books>
		<book symbol="RIM3">
			<depth value="5" />
			<tick_exp value="0" />
			<tick_mnt value="10" />
			<id value="45166150" />
		</book>
	</books>

'symbol' - security symbol; 'depth' - order book depth;
'tick_exp', 'tick_mnt' - exponent and mantissa respectively
(this parameters will be obtained via Securities' Definitions
data feeds in the future); 'id' - security id

* To use libtrading functionality one has to follow a few steps:
	- book_set = calloc(1, sizeof(struct fast_book_set));
	book_set is a data structure which contains of all orderbooks
	- fast_books_init(book_set);
	book_set initialization
	- fast_books_subscribe(book_set, book);
	subscribe to the books we are interested in
	- fast_books_update(book_set);
	update books collection periodically

Signed-off-by: Marat Stanichenko <mstanichenko@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Clean up Makefile

Split long PROGRAMS line to multiple lines.

Signed-off-by: Pekka Enberg <penberg@kernel.org>