TODO
	Results from when database is unavilable are not getting written
	Results from when database are down won't have correct timestamp with current setup.

General
	Shutdown process
		Unregister probe
		Wait for "read prefs interval" or no received packets for X seconds
	SNMP AgentX
		Provide integration as a Net-SNMP subagent
		http://www.net-snmp.org/tutorial/tutorial-5/toolkit/
	Use libdbi for database connectivity

Web GUI
	Support both JpGraph 1.x (PHP4) and 2.x (PHP5).

Structures
	probes
		IP and version of probe so we can send/receive/reflect compatible packets
	packet
		Source/dest,data 
		Packet includes version of protocol
	prefs
		Contains preferences to use, primary source being the database
	args
		Command line arguments
	
Transmit Thread
	Starts up and never exits
	Will transmit each cycle based on contents of probe list
	Will transmit a packet that is compatible with remote probe
	Will require probe list mutex to allow modification without flipping
	Behaviour peer test loop modified by prefs without restart
	Does not care about connection to database

Receive Thread
	Starts up and never exits
	Reflects received packets
		Recieved packets should be verified against probe list to prevent misuse.
	Terminates packets we originated
	Calculates data
	Places results into data queue
	Behaviour peer test loop modified by prefs without restart
	Does not care about connection to database

Data Thread
	Starts and never exits
	Removes packets from data queue
	Maintains connection to database
	Registers probe with database, including version number
	Reads preferences from database and modifies internal structures to handle changes
	If connection to the database is lost, will continue to try and reconnect
	Can receive shutdown message from database configuration
	Random probe provides roll up of database
		Configurable priority value for roll up work
		0 is highest priority. Implement by adding priority to nextUpdate time in database, giving lower numbers a better chance of winning.
	Will trim queue down X minutes if unable to write to database - tail drop
	Will write results to flatfile to provide results to Net-SNMP
		Provide total tx pps
		Provide total rx pps
		Provide per probe data - loss, rtt, ott, etc

#
# Local Variables:
# c-basic-offset: 3
# tab-width: 3
# End:
# vim: noet ts=3 sw=3
#
