* 2008/02/09 Guy Martin <gmsoft@tuxicoman.be>
Fix target_pcap TSHOOT output.
Added resize function to helpers.
Added helper_docsis for resizing only.
Added fill_gaps parameter to helper_tcp.
Fix bug in rules.c that prevented some packets to be processed.
Update default log format in target_http.

* 2008/01/28 Guy Martin <gmsoft@tuxicoman.be>
Use printf() instead of pom_log() in signal_handler().
Use time of the response if time of the request is unknown for %t in target_http.
Removed duplicate %h in target_http log_format.

* 2009/01/17 Guy Martin <gmsoft@tuxicoman.be>
Make description of CLI function more consistent.
Added logging support for target_http.
Better handling of % sign in the CLI.
Allow spaces in target parameters.
Added definition of timeradd() and timersub() in common.h.

* 2008/12/05 Guy Martin <gmsoft@tuxicoman.be>
Changed parameter 'path' in 'prefix' to allow prefixing http files.
Added debug if mime type database cannot be open in target_http.

* 2008/12/04 Guy Martin <gmsoft@tuxicoman.be>
Added overwrite parameter to target_pcap to avoid overwriting existing files.
Make sure no expectation will be matched when closing all the conntracks.

* 2008/12/02 Guy Martin <gmsoft@tuxicoman.be>
Fix configure script to keep LDFLAGS after checking for pthread.
Added mode directory to input_pcap.
Fix typo in input_docsis.
Fix invalid write when parsing description in config file.
Fix target_pcap packet number calculation and some other cosmetic bug.
Remove \r\n from debug message in helper_ipv4.
Fix mime type checking in target_http.
Move timercmp() from timers.c to common.c.
Fix file name when log level is 5.

* 2008/11/30 Guy Martin <gmsoft@tuxicoman.be>
Moved core parameters handling in a separate file.
Define DATAROOT instead of WWWROOT for more generic usage.
Increase input serial when it stops on EOF.
Moved built-in mime-type db from target_http to a config file.

* 2008/11/24 Guy Martin <gmsoft@tuxicoman.be>
Fixed invalid packet warning message in helper_ipv4.

* 2008/11/24 Guy Martin <gmsoft@tuxicoman.be>
Add some more length checking when buffering in target_http.
Fix pcap file size calculation and splitting.
Make sure expectations are removed when parent conntrack entry is removed.
Fix segfault when module list is empty and trying to do completion.

* 2008/11/22 Guy Martin <gmsoft@tuxicoman.be>
Added unregister pointer function for targets.
Removed unnecessary strlen(token) when using strtok_r().
Fix segfault in target_msn when a buddy talk and the account isn't known yet.
Fix segfault with the completion of the start target command.
Remove ;{uid} in msn account names.
Recoded http to handle transfer type chunked and content type gzip + deflate.
Avoid to malloc() when log level is 5 when handling a log entry.
Fix helper_tcp when first packet after syn/ack is out of order.
Fix helper_tcp when received packet doesn't entirely contain the needed payload.

* 2008/11/13 Guy Martin <gmsoft@tuxicoman.be>
Fix compilation warning on 64bit arch in datatore_postgres and sqlite.
Fix completion bug when given word is longer than expected one.
Fix conntrack bug that corrupted the linked list of target and helper priv when closing them.
Fix small memory leak in target_rtp.
Some more hardening of match_rtp.

* 2008/11/12 Guy Martin <gmsoft@tuxicoman.be>
New command matching and completion code.

* 2008/11/11 Guy Martin <gmsoft@tuxicoman.be>
Added datastore_sqlite.
Zero-out the new struct dataset when reading them from DB.
Fix uint8 ptype handling in datastore_postgres.
Make match more robust when identifying packets.
Make sure ptype_print_val() always behaves like snprintf().
Improved datastore_postgres memory usage.
Fix deadlock when using "show datastore" without any configured.
Use incremental default interface name for target_tap.
Added support for Ctrl-L in the management console.
Improve completion handling.

* 2008/11/10 Guy Martin <gmsoft@tuxicoman.be>
Added datastore support.
Fix input locking while parsing its config.
Fix segfault in target_msn when LSG command is not complete.
Added bswap64(), htonll() and ntohll().
Fix rule list serial when removing a stopped target.
Fix type mask in target_http.

* 2008/09/12 Guy Martin <gmsoft@tuxicoman.be>
Fixed possible crash in target_msn.
Updated README.

* 2008/09/11 Guy Martin <gmsoft@tuxicoman.be>
Fix mgmt command sorting at registration time.
Fix up and down arrow displaying in mgmt console.
Don't ignore destination address in target_msn expectation.

* 2008/09/08 Guy Martin <gmsoft@tuxicoman.be>
Added target_msn.
Move align_offset from input_caps to struct frame.
Use localtime_r() in favor of localtime().
Fix small memory leak in conf.c
Added bi-directional support to expectations.
Added base64_decode().
Move layer_find_start() to common.c.
Fix retransmit not being discarded by helper_tcp.
Fix deadlock when trying to set an invalid mode for an input.
Allow empty parameters for input via mgmt interface.

* 2008/08/23 Guy Martin <gmsoft@tuxicoman.be>
Added split_interval parameter to target_pcap.
Updated README file.
Dropped libnet dependency. Replaced it with pcap.

* 2008/08/21 Guy Martin <gmsoft@tuxicoman.be>
Improved target_tftp.
Zero out errbuff before using it in mgmsrv and xmlrpcsrv.

* 2008/08/16 Guy Martin <gmsoft@tuxicoman.be>
Fix compilation on OpenBSD.
Get rid of ip_var.h include.
Fix building of svnversion.h.
Added "show version" and main.getVersion.
Fix snversion.h with buggy sed on solaris.

* 2008/08/15 Guy Martin <gmsoft@tuxicoman.be>
Improved handling of pcap files with input_pcap.

* 2008/08/14 Guy Martin <gmsoft@tuxicoman.be>
Added support for version information.
Hardcode xmlrpc-c flags to workaround CentOS bug.
Don't force startfreq when eurodocsis = no.
Compile fix for glibc-2.8.

* 2008/08/12 Guy Martin <gmsoft@tuxicoman.be>
Fix parsing of ptype_uint64.
Add support for power of 1024 to ptype uint32 and uint64.
Added mode split to target_pcap.

* 2008/08/08 Guy Martin <gmsoft@tuxicoman.be>
Added descriptions on targets.
Fix small memory leak when saving rules.
Fix small memory leak when unseting rule description via XML-RPC.
Make abyss webserver from xmlrpc-c serv the web interface.
Renamed command "set description rule" to"set rule description".
Added web interface thanks to Mitch Capper.
Fix function main.getSerial to provide logs serial.

* 2008/08/05 Guy Martin <gmsoft@tuxicoman.be>
Fix seq and ack calculation in target_tcpkill.c.
Fix crash in list_modules when LD_LIBRARY_PATH is not set.
Make sure rbuf->i is set when config is loaded.

* 2008/07/31 Guy Martin <gmsoft@tuxicoman.be>
Fix input.get signature and return value in case input is not yet configured.
Move helpers_serial in helper_(un)register() functions.
Added conntrack serial and XML-RPC conntrack functions.

* 2008/07/27 Guy Martin <gmsoft@tuxicoman.be>
Add global target_serial on the main config.
Fix rules.setDescription which was enabling the rule.
Functions target_open and target_close now update the serials.
Fix duplicate entries returned by list_modules.
Function main.getSerial returns the global target_serial.

* 2008/07/26 Guy Martin <gmsoft@tuxicoman.be>
Added helpers parameters in the configuration file.
Add locks on conntracks.

* 2008/07/23 Guy Martin <gmsoft@tuxicoman.be>
Added descriptions to rules.
Rewrite config_write() to use libxml2 API.
Save correct input state at autosave time.

* 2008/07/16 Guy Martin <gmsoft@tuxicoman.be>
Save if input should be started in the config file.

* 2008/07/15 Guy Martin <gmsoft@tuxicoman.be>
Added support for OSX.
Moved global variable decl in corresponding .c and made extisting ones extern.
Fix input_docsis when reaching end of frequency range while scanning.
Fix target instance lock initialization.

* 2008/07/08 Guy Martin <gmsoft@tuxicoman.be>
Fix command matching the proper way.
Throw an error when trying to tune to a EuroDOCSIS stream with an ATSC card.

* 2008/07/03 Guy Martin <gmsoft@tuxicoman.be>
Fix command matching when word is longer than expected.

* 2008/07/01 Guy Martin <gmsoft@tuxicoman.be>
Function rules.remove now returns the removed uid.
Don't save troubleshooting level logs in the log buffer.
Function main.getSerial now returns log buffer serial.
Added function main.getLogs.

* 2008/06/27 Guy Martin <gmsoft@tuxicoman.be>
Added a buffer for debug output.
Debug level is not independant for every CLI session.
Get rid of enable/disable debug functions for CLI.
Full line of debug must be provided to pom_log instead of multiple calls.
Added "set console debug" CLI function.

* 2008/06/23 Guy Martin <gmsoft@tuxicoman.be>
Fix memory leak when rule fail to parse in XML-RPC interface.
Return targets refcount with target.listLoaded.
Added functions main.halt and main.setPassword to XML-RPC.
Fix error display with rule parsing.

* 2008/06/19 Guy Martin <gmsoft@tuxicoman.be>
Added function get_uid() to generate new random unique id.
Added serial on each rule and uid stays unchanged while rules are update.
Added serial for the input helpers and core parameters.
Removed rules.getSerial from XML-RPC interface.
Added some target functions to the XML-RPC interface.
Function match.get returns also the reference count.
Function input.listLoaded returns also the parameter types.
Added serial on each target.
Added uid and locks on targets.
Added XML-RPC function main.getSerial which returns serial of all components.

* 2008/06/09 Guy Martin <gmsoft@tuxicoman.be>
Added match locks when registering them.
Avoid returning nil values in XML-RPC interface.
Added match functions the for XML-RPC interface.
Added abort() if a locking operation is failing.
Added XML-RPC function listAvail to input, match and helper.

* 2008/06/06 Guy Martin <gmsoft@tuxicoman.be>
Added XML-RPC functions to handle the rules.
Moved rule parsing/printing from mgmtcmd_rules.c to rules.c.
Moved the rules serial to struct conf.
Added unbuffered parameter to target_pcap.
Call rule_update when enabling/disabling a rule.
Added locks on target instances.
Fix initialization of random seed for rules UID.

* 2008/06/03 Guy Martin <gmsoft@tuxicoman.be>
Make rule_update() check for possible duplicated uid.
Provide unit as well when providing a parameter via XML-RPC.

* 2008/06/02 Guy Martin <gmsoft@tuxicoman.be>
Fix compilation on some Unix systems.
Fix xmlrpc-c detection.
Added rw lock on the config rules.
Improved locking on the ring buffer.
Added some more static keywords.
Added rw locks on ptypes.

* 2008/06/01 Guy Martin <gmsoft@tuxicoman.be>
Added static keyword at relevant places in modules.
Added status report at the end of the configure script.
Moved shared includes into the include directory.
Added reference count on the inputs.
Added rwlocks on helpers and inputs.
Added XML-RPC functions for helpers.

* 2008/05/31 Guy Martin <gmsoft@tuxicoman.be>
Added partial XML-RPC interface.
Fix unintialized value in helper_unregister_all().
Added function ptype_get_name().
Added and fixed error message when starting/stopping and input.
Fix typo in match.c.
Report error in mgmtcmd_register_all().
Improved error logging in mgmtsrv_init().
Added support for ATSC cards in input_docsis thanks to Mitch Capper.
Make input_open() only return POM_OK or POM_ERR. 
Send a signal to interrupt the input system call when stopping it. 
Added interrupt() function to inputs if some more work needs to be done. 

* 2008/05/22 Guy Martin <gmsoft@tuxicoman.be>
Added completion for "set core parameter".
Fix completion of "load conntrack".

* 2008/05/20 Guy Martin <gmsoft@tuxicoman.be>
Make input_docsis release the input lock while scanning.
Fix memory leak when doing completion on modules names.

* 2008/05/19 Guy Martin <gmsoft@tuxicoman.be>
Added completion on commands arguments.
Reduced maximum command words to 128.

* 2008/05/12 Guy Martin <gmsoft@tuxicoman.be>
Suppress bind() error msg if we already have a socket in mgmtsrv.

* 2008/05/04 Guy Martin <gmsoft@tuxicoman.be>
Make input_open_docsis() return POM_OK instead of a selectable fd.

* 2008/05/03 Guy Martin <gmsoft@tuxicoman.be>
Use select() on the input to avoid hangs when stopping input.
Added debug code to check validate conntrack creation.
Fix typo in input.h documentation.
Close all connections when the input stops.

* 2008/05/02 Guy Martin <gmsoft@tuxicoman.be>
Rewrote node_match more efficiently.
Remove ! operation for or/and branches.
Make conntrack_create_entry fail if no match_priv is created.
Fix warning on x86_64.
Fix match reference count when destroying a rule.

* 2008/04/23 Guy Martin <gmsoft@tuxicoman.be>
Added conntrack and helper documentation.

* 2008/04/21 Guy Martin <gmsoft@tuxicoman.be>
Added helper, match and target documentation.
Small fixes in input and ptype documentation.

* 2008/04/20 Guy Martin <gmsoft@tuxicoman.be>
Updated input and ptype documentation.
Fix error checking with rule parsing in the CLI.

* 2008/04/19 Guy Martin <gmsoft@tuxicoman.be>
Check if all pcap headers are present at configure time.
Fixed includes to allow compilation on OpenBSD.
Make input_pcap returns POM_OK if no fd can be selected.
Rename PTYPE_OP_EQUALS in PTYPE_OP_EQ.
Added PTYPE_OP_NEQ.
Fix rule matching with or/and in specific scenario.
Initialize the variable result in input_unregister_all.

* 2008/04/18 Guy Martin <gmsoft@tuxicoman.be>
Improved input documentation.
Added ptype documentation.
Updated Doxyfile.

* 2008/04/17 Guy Martin <gmsoft@tuxicoman.be>
Correctly parse LD_LIBRARY_PATH if it contains ':' when printing help.
Fix logic bug in target_irc when analysing if token is null.
Correct description for target_tftp mode ande parameter.
Update Makefile.am to use correct linking process with libtool.

* 2008/04/15 Guy Martin <gmsoft@tuxicoman.be>
Renamed ptype_cleanup_module() in ptype_cleanup().
Pass RTLD_GROUP to dlopen() when avaiable.
Use libpom.so to store API and make it directly accessible to the modules.
Moved frame_alloc_aligned_buff() into common.c.

* 2008/04/13 Guy Martin <gmsoft@tuxicoman.be>
Added support for solaris.
Added filter parameter in input_pcap.
Autodetect useable iface in input_pcap.
Get rid of bzero() in favor of memset() and index() in favor of strchr().
Use our own header for ethernet frames and ipv6 extended headers.
Update sll.h to use uintX_t instead of u_intX_t.

* 2008/04/12 Guy Martin <gmsoft@tuxicoman.be>
Added expectation interface that allow targets to expect new connections.
Added target_tftp.

* 2008/04/07 Guy Martin <gmsoft@tuxicoman.be>
Fix logic when matching rules with ! sign.

* 2008/04/05 Guy Martin <gmsoft@tuxicoman.be>
Added option -b to go into daemon mode.
Improved packet stat calculation in input_docsis.
Use the correct ptype for quit_on_input_error parameter.
Added message when issuing the halt command.

* 2008/04/04 Guy Martin <gmsoft@tuxicoman.be>
Added support for non x86 architectures.
Added display of current conntrack usage with show conntracks.
Fixed bug that makes pom hangs when reaching maximum history usage.

* 2008/04/03 Guy Martin <gmsoft@tuxicoman.be>
Fixed match reference count when using rules with fields.

* 2008/04/02 Guy Martin <gmsoft@tuxicoman.be>
Added ptype_copy function to all ptypes.
More checks on parameters into input_docsis.
Make input_docsis change mode when scanning is over.

* 2008/03/29 Guy Martin <gmsoft@tuxicoman.be>
Improved history handling and completion in CLI.
Added load function for all modules in CLI.

* 2008/03/28 Guy Martin <gmsoft@tuxicoman.be>
Added dynamic match dependencies support.
Changed match_register() into add_dependency() for match sublayer dependencies.
Add match_priv in natural direction for faster analysis.
Split mgmtcmd.c in several files.
Fix command order sorting in mgmtsrv_register_command().
Added support for various keys in some terminals.
Splitted mgmtcmd.c into multiple files.
Improved command completion.
Improved help command output on small terminals.

* 2008/03/21 Guy Martin <gmsoft@tuxicoman.be>
Added reference count on modules.
Changed target_name into name in struct target.
Added unload command in CLI for remaining modules.

* 2008/03/08 Guy Martin <gmsoft@tuxicoman.be>
Improved detection of non-RETR command in target_pop.
Updated README.

* 2008/03/05 Guy Martin <gmsoft@tuxicoman.be>
Updated copyright text when loging into CLI.
Fixed typo in conf.c and target.c that pervented a debug message to be displayed.
Added CE_DIR_UNK to provide a safe value if direction is unknown.
Fixed last compilation warning for ptype uint64.
Prevent target counters from increasing when target is stopped.
Modified do_rules to avoid reading freed target_priv.
Added target_pop.
Various minor fix in target http for filename handling.
Fixed small memory leak in main.c.

* 2008/02/26 Guy Martin <gmsoft@tuxicoman.be>
Fix compilation warnings in ptype_uint64.c.
Add stats to inputs.
Moved target counters incrementation in target_process().

* 2008/02/25 Guy Martin <gmsoft@tuxicoman.be>
Added ptype uint64.
Added print_mode to ptypes, serialize() and unserialize() funcs.
Added match counters for rules and targets.

* 2008/02/20 Guy Martin <gmsoft@tuxicoman.be>
New values for direction in conntrack_entry.
Fixed hanging when deleting first char in CLI.
Added support for some more escape sequence in CLI.
Function layer_field_parse() now available for targets.
Made function target_file_open() accept NULL layer.
Fix regression in conntrack that prevented reverse direction to be processed in specific scenario.
Added bi directional stream support for target_rtp.
Space cleanup in match_ethernet and match_vlan.
Fixed output of target_display in CLI wrt new lines.
Targets are now stopped if target_process gets an error back.
Added extra checking in match_rtp.

* 2008/02/10 Guy Martin <gmsoft@tuxicoman.be>
Added match_vlan.
Added support for vlan in match_ethernet.
Renamed target_wave to target_rtp.
Added some debug msgs in lib_get_register_func().

* 2008/01/27 Guy Martin <gmsoft@tuxicoman.be>
Added core parameter quit_on_input_error.

* 2008/01/24 Guy Martin <gmsoft@tuxicoman.be>
Added helper rtp.
Change return value to appropriate constant in helper_tcp.
Fix bug in rules.c that made packet processed twice under certain conditions.
Make sure the clock is intialized for the first packet when input is not live.
Fix segfault in mgmtcmd.c when passing invalid operation to rule parser.
Updated README.

* 2007/12/22 Guy Martin <gmsoft@tuxicoman.be>
Added parameter persistent to target_tap.

* 2007/12/12 Guy Martin <gmsoft@tuxicoman.be>
Fixed possible infinite loop in mgmtsrv_init().
Added message to point user to set LD_LIBRARY_PATH if ptypes are not found.
Made function argument syntax more consistent in ptypes.
Added target_irc by Thomas Gouverneur <wildcat@espix.org>.

* 2007/12/06 Guy Martin <gmsoft@tuxicoman.be>
Use preallocated table for conntrack functions. This fix illegal acces issue.

* 2007/12/04 Guy Martin <gmsoft@tuxicoman.be>
Fix segfault when stopping pom while input is stopped.
Change fields order in match_eval() to make comparison like > or < actually work.

* 2007/12/02 Guy Martin <gmsoft@tuxicoman.be>
Imported sll.h from libpcap and updated match_linux_docsis.
Added ptype_bytes to handle random number of bytes.
Avoid to stop the program when reading a non live input.

* 2007/11/30 Guy Martin <gmsoft@tuxicoman.be>
Fix segfault when running packet-o-matic -h.

* 2007/11/24 Guy Martin <gmsoft@tuxicoman.be>
Added support for conntrack parameters in the config file handling.
Removed CFLAGS -Werror.

* 2007/11/22 Guy Martin <gmsoft@tuxicoman.be>
Added unregister function and dynamic parameters to conntracks.
Added cli commands "show conntracks" and "set conntrack parameter".

* 2007/11/20 Guy Martin <gmsoft@tuxicoman.be>
Filter out non printable characters when processing keys in the cli.
Added target_file_open() that will create directories when opening a file.
Fixed description of parameter fc_parm for match_docsis.
Added layer_field_parse() to parse ${match.field} and replace it by layer fields value.
Changed target dump_payload, http and wave to use the new target_file_open function.

* 2007/11/14 Guy Martin <gmsoft@tuxicoman.be>
Changed default input file of input_pcap in mode file to dump.cap
Help now display the default of each input and target.

* 2007/11/13 Guy Martin <gmsoft@tuxicoman.be>
Fixed segfault when stopping and then restarting a target_pcap.
Fix memory leak and segfault when displaying help.
Fix compilation warning with gcc-4.2.
Don't stop the target if they are already stopped.
Added core parameter autosave_config_on_exit.
When saving configuration, target stopped will stay stopped on next startup.

* 2007/11/12 Guy Martin <gmsoft@tuxicoman.be>
Added support for core parameters in mgmt command and config.
Added core parameter match_autoload_helper and ringbuffer_size.
Fix possible segfault when registering commands in mgmtsrv.c.
Fix typo in target.c and input.c.
Fix logic error when input read error occurs and application is being stopped.
Store the password in the config when writing it.

* 2007/11/10 Guy Martin <gmsoft@tuxicoman.be>
Added confirmation message for commands remove rule and target.
Changed default snaplen of target_pcap to 1522.

* 2007/11/08 Guy Martin <gmsoft@tuxicoman.be>
Use an array instead of linked list for the layer and match fields.
Added -e parameter to start from an empty config.
Removed unused FILE in struct mgmt_connection.
Added message in mgmt consoles when apps shutdown.
Updated README and removed useless example config file.

* 2007/11/06 Guy Martin <gmsoft@tuxicoman.be>
Get rid of layer_info and replace it by match_field for match params and info.
Make match_register() automatically load the corresponding conntrack.
Added mode connection to target_display and replaced mode hex and ascii by parameters.

* 2007/11/05 Guy Martin <gmsoft@tuxicoman.be>
Get rid of useless mask_compare function.
Give correct permission if writing config to a new file.
Fix ptype_bool.h #ifndef.
Make match_ethernet actually provide the macs.
Fix bug when saving target's parameter.
Fix possible race when stopping the program.
Added status message when writing the config.

* 2007/11/04 Guy Martin <gmsoft@tuxicoman.be>
Switch payload_start and payload_size to signed int.
Fix the way conntrack handles connection with packets in the helper buffer.
Fix target_display when skip = 0 and fix possible segfault.
Avoid processing the target if it's stopped.
Change logic when handling input read error.
Added management command "halt".
Fix bug in target_dump_payload that causes segfault or random memory corruption.
Use the -pthread CFLAGS for all the modules now.

* 2007/11/02 Guy Martin <gmsoft@tuxicoman.be>
All the targets now keep track of their own conntrack.
Added conntrack_remove_target_priv() so targets can remove their conntrack.
Fix bug that prevented the last command in the cli to be used.
Fix segfault when trying to complete a command with args.
Added commands "add rule", "start target", "stop target", "add target",
"remove target", "remove rule", "set target parameter" "set target mode".

* 2007/10/31 Guy Martin <gmsoft@tuxicoman.be>
Added command completion support in management command.
Fixed input_pcap when capturing from lo.
Added key 0x7F for backspace.

* 2007/10/27 Guy Martin <gmsoft@tuxicoman.be>
Fixed typo in default value of input_docsis modulation parameter.
Fix bug that prevent input to be restarted if it fails to be opened.
Fix input_docsis keeping frontend open if it fails to open.
Fix small mem leak when parsing config.
Added debug message when unregistering a match.
Improved input thread handling when stopping the application or input.

* 2007/10/26 Guy Martin <gmsoft@tuxicoman.be>
Use POM_OK and POM_ERR in conntracks and for find_layer_start().
Commented the "Found conntrack ..." debug.
Added management command "add rule <rule>".

* 2007/10/25 Guy Martin <gmsoft@tuxicoman.be>
Added the command "write config" in the management console.
Added function ptype_get_op_sign() to get the operation sign.
Function ptype_get_op_name() now returns the operation name.
Fixed syntax in pom.xml.conf.example.
Added commands to change input type, mode and parameter.

* 2007/10/24 Guy Martin <gmsoft@tuxicoman.be>
Fix bug when input_docsis doesn't find a docsis stream.
Improve tuning timeout handling in input_docsis.
Fixed displaying debug when issuing commands.
Added checks when starting and stoping input.

* 2007/10/23 Guy Martin <gmsoft@tuxicoman.be>
Improved debug output in mgmt console to allow debug when issuing commands.
Added struct ringbuffer to ease its handling.
Added functions "start input" and "stop input" in mgmt console.

* 2007/10/16 Guy Martin <gmsoft@tuxicoman.be>
Some compilation fix on OS X and FreeBSD and for gcc 4.2 as well.

* 2007/10/14 Guy Martin <gmsoft@tuxicoman.be>
Sort management console commands when registering them.

* 2007/10/13 Guy Martin <gmsoft@tuxicoman.be>
Fixed rule display in management console.
Fixed the behaviour of inv="yes" for a match with a field.

* 2007/10/10 Guy Martin <gmsoft@tuxicoman.be>
Added -d option to choose debug level at startup.
Commented or removed useless debug lines.
Fixed handling of va_list in pom_log() and mgmtsrv_send().

* 2007/10/09 Guy Martin <gmsoft@tuxicoman.be>
Get rid of dprint() in favor of pom_log().
Added commands "enable/disable debug" and "set debug level" in management console.
Fixed compilation warnings on amd64.

* 2007/10/07 Guy Martin <gmsoft@tuxicoman.be>
Added commands "set password" and "unset password" in management console.

* 2007/10/05 Guy Martin <gmsot@tuxicoman.be>
Added -w option to specify a password for the management console.

* 2007/10/01 Guy Martin <gmsoft@tuxicoman.be>
Fixed a unlikely segfault in config parsing.
Added options to disable CLI and specify it's port.
Don't pass the 4 bytes of ethernet checksum to upper layer anymore.

* 2007/09/30 Guy Martin <gmsoft@tuxicoman.be>
Now use POM_OK and POM_ERR everywhere.
Fixed a bug in target_dump_payload that made it dump rubish.
Fixed a bug in rule processing that was not processing the right target for the corresponding conntrack.
Added the possibility to enable or disable a rule in the management console.

* 2007/09/27 Guy Martin <gmsoft@tuxicoman.be>
Added support for history, up and down arrow in management console.

* 2007/09/23 Guy Martin <gmsoft@tuxicoman.be>
Removed unused field tv in struct input_priv_pcap.
Modified targets to use struct ptypes for their parameters.
Updated config syntax according to new way of handling parameters for targets.
Get rid of copy_params() and clean_params().
Fixed possible segfaults while parsing the config file.
Fix unloading of libs when unregistering ptypes.
Added "show targets" command in the management console.

* 2007/09/18 Guy Martin <gmsoft@tuxicoman.be>
Inputs now use ptypes to save the parameters.
Added the notion of input mode and reflected changes in the config accordingly.
Added ptype bool and ptype string.
Added the "show input" command in the management console.
Fixed invalid read in node_destroy.
Fixed match_linux_cooked to return the right value on register.
Removed last remains of struct match.

* 2007/09/16 Guy Martin <gmsoft@tuxicoman.be>
Allow 2048 words when issuing a command in the management console.
Added command "set rule" to change a rule definition.

* 2007/09/14 Guy Martin <gmsoft@tuxicoman.be>
Added suport for some more bindings in the management console.

* 2007/09/13 Guy Martin <gmsoft@tuxicoman.be>
Added support for masks in ptype_ipv4 and ptype_ipv6.
The command "help" now shows the full usage.
Added the option to see the rules in a "flat" way with "show rules".

* 2007/09/12 Guy Martin <gmsoft@tuxicoman.be>
Added RULE_OP_TAIL to find easily when two branch of 'or' or 'and' merge.
Added ptype_get_op_name() to return a string representation of the comparison operation.
Added command "help" and "show rules" in the management interface.
Fixed example config.

* 2007/09/10 Guy Martin <gmsoft@tuxicoman.be>
Changed the match to use ptypes.
Configuration of the match changed. See updated pom.xml.conf.example.
Added node operation 'op', 'and' and inversion.
Added comparison to ptypes.
Added ptypes uint16, uint8, mac, ipv4 and ipv6.
Now using POM_OK and POM_ERR for match.

* 2007/08/30 Guy Martin <gmsoft@tuxicoman.be>
Helper can now remove their priv stuff from conntrack.
Modified helper_tcp to allow unloading on the fly.
Added the possibility to unregister one helper at a time.
Fixed small memory leak in helper ipv4.
Added a mutex to the reader thread to allow unloading of modules or else.
Added management function "unload helper".

* 2007/08/28 Guy Martin <gmsoft@tuxicoman.be>
Added "set helper parameter" and "load helper" command in management console.
Management commands can now receive arguments.
Make use of the usage field of the commands.
Added helper_get_param() to quickly get a parameter.

* 2007/08/27 Guy Martin <gmsoft@tuxicoman.be>
Moved VTY handling code into mgmtvty.{ch}.

* 2007/08/25 Guy Martin <gmsoft@tuxicoman.be>
Added support for left and right arrow in the management console.
Improved input_read_docsis() and fix possible memory corruption.

* 2007/08/16 Guy Martin <gmsoft@tuxicoman.be>
Use ptypes to store helper parameters.
Use H_OK and H_ERR for helpers return value.
Fixed typo in target_tcpkill ST->RST.
Fixed potential deadlock when using non live capture and input buffer gets full.
The command "show helpers" now shows the parameters and their value.
Moved some include around.

* 2007/08/15 Guy Martin <gmsoft@tuxicoman.be>
Changed strerror() into strerror_r() in the whole code.
Management commands can be registered.
Added support for Ctrl-D in the management console.
Removed useless inline keywords.
Added command "show license" and "show helpers".

* 2007/07/30 Guy Martin <gmsoft@tuxicoman.be>
Fixed small bug in input_docsis when handling invalid packet and improved error messages.
Improved handling of telnet options in the management console.
Added error checking when unloading modules with dlclose().
More verbose and understandable error message when invalid packets are discarded.

* 2007/06/27 Guy Martin <gmsoft@tuxicoman.be>
Fixed bug in helper_ipv4 when the second packet of a 2 fragments arrived first.
Introduction of a management interface. No command supported yet besides 'quit'.

* 2007/06/21 Guy Martin <gmsoft@tuxicoman.be>
Fixed bug in algo when input_docsis tunes to a frequency.
Fixed compilation error with NDEBUG defined in helper_ipv4.
Moved reading from the input in a separate thread and added a ring buffer.
Added some more mime types to target_http and control on what needs to be captured.
Input are now queried via the input_getcaps functions to find out about what we are reading from.

* 2007/06/12 Guy Martin <gmsoft@tuxicoman.be>
Improved target_http. Save in directory named after the ip source and configure what type of file to save.

* 2007/06/02 Guy Martin <gmsoft@tuxicoman.be>
Updated copyright information.

* 2007/06/01 Guy Martin <gmsoft@tuxicoman.be>
Fixed possible segfault in target_display.c reported by <briaeros007@gmail.com>.

* 2007/05/30 Guy Martin <gmsoft@tuxicoman.be>
Made clock source from input_pcap always growing when using pcap file.
Some more bug fixing on helper_tcp.
Timers don't need to be dequeued before being cleaned up anymore.
Make sure len is initialized in target_display.c.
Modified conntrack_tcp to better handle TIME_WAIT state and LAST_ACK.
Fixed missing conntrack modification in targets.

* 2007/05/27 Guy Martin <gmsoft@tuxicoman.be>
Use struct frame to describe the current frame instead of passing each param as a separate argument.
A timestamp is associated to each frame and saved in the struct frame.
Added timestamp support in input_pcap, input_docsis, timers and target_pcap, http, wave and dump_payload.
Made struct conntrack_entry part of the struct frame and modified code accordingly.
A lot of bugs fixed in helper_tcp.c.
Fixed conntrack_tcp to handle the LAST_ACK state.
Provide the input when allocating timer in order to query the correct clock source.

* 2007/05/17 Guy Martin <gmsoft@tuxicoman.be>
Print tcp sequence as decimal number instead of hex numbers and added window information.
Added conntrack_del_priv to remove private struct from conntrack.
Set total conntrack entries to 1048576.
Modified conntrack to make it work with helpers.
Fixed bug in target_tap when ethernet isn't the first layer.
Show length in taget_display.
Fixed match_icmp payload start and size calculation.
Added helper_tcp.
Fixed bug in timer handling with conntrack_tcp when received a FIN and then ACK.
Make timer works continuously instead of every two seconds.
Make match_icmp[v6] not advertise next layer if present.

* 2007/04/27 Guy Martin <gmsoft@tuxicoman.be>
Changed the name of some structure fields and defines.
Changed some paremeters of the conntrack to optimize the fonction usage.

* 2007/04/27 Thomas Gouverneur <wildcat@espix.org>
Ported injection and tcpkill to FreeBSD
Ported match_icmp & match_icmpv6 to FreeBSD
Minor fix for rules.c

* 2007/04/17 Guy Martin <gmsoft@tuxicoman.be>
Added documentation support using doxygen.
Already documented the inputs.
Modify those to use I_OK and I_ERR as return value.

* 2007/04/16 Thomas Gouverneur <wildcat@espix.org>
Patched target_inject.c to use libnet to inject packets.
Patched target_tcpkill.c to use both linux' raw socket and libnet.

* 2007/03/30 Guy Martin <gmsoft@tuxicoman.be>
Added target_http.c. Fixed typo in target_pcap.c.
Fix segfaults in conntrack.c.
Added another safety check for the calculated payload_size.

* 2007/03/26 Guy Martin <gmsoft@tuxicoman.be>
Added sequence info and some type translation for echo.

* 2007/03/23 Guy Martin <gmsoft@tuxicoman.be>
Added output layer ipv4 to target_pcap.
Fixed cosmetic bug when calculating % of packet dropped in target_pcap.
Use input_docsis_read_mpeg_frame in input_docsis_check_downstream.
Changed max size claculation algo in rules.c.

* 2007/03/22 Guy Martin <gmsoft@tuxicoman.be>
Rewrote input_docsis to fix bug in docsis parsing algorithm.
Target pcap no longuer auto detect the right layer.
Added support for docsis layer to target_pcap.
Inputs now use struct input_functions.
Fixed length calculation of rtp payload in match_rtp.
Added match_docsis.

* 2007/03/19 Guy Martin <gmsoft@tuxicoman.be>
Fix fd_set initialisation in main.c.
Fix segfault if one match can't be loaded.

* 2007/03/18 Guy Martin <gmsoft@tuxicoman.be>
Fix segfault with malformed ipv4 fragment in helper_ipv4.
Improved error message in helper_ipv4.
Attach layer_info to layer sooner.
Fix error output of input_pcap.

* 2007/03/16 Guy Martin <gmsoft@tuxicoman.be>
input_open now returns a fd we can select() on.
Cleaned up match_linux_cooked.
Timers now use gettimeofday() instead of SIGALARM.
We now use select() before doing a read on the input.
Fix tricky size comparison bug in match_ipv6.c.
Added match_icmp by BoWRiS <bowris@mouh.be>.

* 2007/03/14 Guy Martin <gmsoft@tuxicoman.be>
Process the targets in the order that they are added.
Some more display fix in target_display.
Added custom snprintf function to match_icmpv6.

* 2007/03/09 Guy Martin <gmsoft@tuxicoman.be>
Some formating fix for target_display.
Avoid mem leak when input or config cannot be opened.
Fix recursive match registration.
Added match_icmpv6.
Better calulation of payload length in target_display.

* 2007/03/08 Guy Martin <gmsoft@tuxicoman.be>
FreeBSD fixes.
Fix segmentation fault with -h switch.
Added parameter to skip headers and change display mode for target_display.

* 2007/03/07 Guy Martin <gmsoft@tuxicoman.be>
Added support for the tcp flags in match_tcp.c.
Changed a bit the output of target_display to make it a bit clearer.
Fix stupid segfault when trying to display the help.
Some more code cleanup.

* 2007/03/04 Guy Martin <gmsoft@tuxicoman.be>
Changed the types of layer_info values.
Support custom snprintf functions for layer_info.
Added support for match_unregister function.
Make target_display work with non displaying info.

* 2007/03/03 Guy Martin <gmsoft@tuxicoman.be>
Changed layer_info value types.
Fixed a wrong cleanup algo in rules.c.
Don't forget to bzero the struct target in target.c.

* 2007/02/27 Guy Martin <gmsoft@tuxicoman.be>
Layer info are now registered at the same time than each match.
Added info to match_rtp, linux_cooked and some others.
Added match_type to the match_reg struct so match can have their number when registering.	

* 2007/02/17 Guy Martin <gmsoft@tuxicoman.be>
Updated README.
Updated copyright information.

* 2007/02/16 Guy Martin <gmsoft@tuxicoman.be>
Changed versio number to 'svn'.
Added parameter snaplen and removed first_layer from target_pcap. It automaticaly detect the first layer now.
Updated README.
Fixed setting of info in match_ipv6.
Rules now support more than one target.

* 2007/02/12 Guy Martin <gmsoft@tuxicoman.be>
Changed matches to to use struct match_functions.
Moved layer stuff out of match stuff.
Layers are now taken from a poll.
Added layer_info functions to allow match to parse the packet in a comprehensive way.
Cleanup of match_*.h files.
Fix typo in target_null.h.
Renamed match_cleanup in match_cleanup_module and add the first to clean the match general stuff.

* 2007/02/08 Guy Martin <gmsoft@tuxicoman.be>
Added match_linux_cooked and subsequent support in input_pcap.
Added first_layer parameter to target_pcap and added linux_cooked support.

* 2007/02/07 Guy Martin <gmsoft@tuxicoman.be>
Made example file and README be copied into docdir when doing make install.

* 2007/02/05 Guy Martin <gmsoft@tuxicoman.be>
Fixed compilation warnings on amd64.
Updated README with info on running the code.
Removed obsolete code in conntrack_udp.c and timers.c.
Removed and operation since it was useless and made a <or> tag.
Updated and documented example config.

* 2007/02/04 Guy Martin <gmsoft@tuxicoman.be>
Added missing r->flags to conntrack_udp and conntrack_tcp.
Fixed various copy/paste errors introduced while porting on BSD.
Make target_dump_payload allocate conntrack even if there is no payload to
catch reverse data.
Improved search of libraries.
Removed some cruft from debug output.

* 2007/02/02 Guy Martin <gmsoft@tuxicoman.be>
Fixed bug in target_tcpkill which was zeroing dest ipv4 addr in routed mode.
Improved input_docsis scanning and added parameters.
Make timers being initialized after input is open.
Get rid of pselect since SIGALARM will occure after input_open.

* 2007/02/01 Guy Martin <gmsoft@tuxicoman.be>
Check for pselect in configure.ac.
Fix syntax errors in helper_ipv4.c and main.c when debug is enabled.
Enable debug by default in Makefile.
Fix building of input_docsis.so.
Updated README file.
Merged autotools branch to trunk.

* 2007/01/28 Guy Martin <gmsoft@tuxicoman.be>
Changed static value of 255 to NAME_MAX for modules names.
Removed heading ./ for modules name to be able to use LD_LIBRARY_PATH.

* 2007/01/27 Guy Martin <gmsoft@tuxicoman.be>
Fixed includes for match_ethernet and timers on FreeBSD.
Fixed other remaining include problems on FreeBSD.
Various other build fix for FreeBSD.
Made target_{tcpkill,inject,tap} conditionnaly built.

* 2007/01/26 Guy Martin <gmsoft@tuxicoman.be>
Created new branch to include autotools support.
Made source code more portable thanks to Thomas Gouverneur <wildcat@espix.org>
for initial patch.

* 2007/01/15 Guy Martin <gmsoft@tuxicoman.be>
Fix typo in tcp_kill.c.
Add dependencies in the README.

* 2007/01/07 Guy Martin <gmsoft@tuxicoman.be>
Fix segfault in rules.c.

* 2007/01/06 Guy Martin <gmsoft@tuxicoman.be>
Changed name of struct layer* in all match_identify() to l.
Improved conf.c and rules.c to support multiple <node> in anyways.
Fixed conntrack_ipv6.
Fixed matching of conditional matches.
Added a \n for in the direction marks of target_dump_payload.

* 2007/01/03 Guy Martin <gmsoft@tuxicoman.be>
Some more in the README.

* 2007/01/02 Guy Martin <gmsoft@tuxicoman.be>
Added README file.
Added #ifdef DLT_DOCSIS in input_pcap tu support older version of pcap.
Fixed compilation warning of target_tcpkill.

* 2007/01/01 Guy Martin <gmsoft@tuxicoman.be>
Added a direction field to conntrack to reflect the direction of the packet.
Fixed length comparison in match_rtp.c.
Added a markdir param to target_dump_payload to show packet direction.

* 2006/12/31 Guy Martin <gmsoft@tuxicoman.be>
Fix payload size calculation in match_tcp, match_rtp and target_dump_payload.
Fix typo in rules.c.
Changed __uX to corresponding uintX_t.
Local copy of jhash.h from linux include.

* 2006/12/30 Guy Martin <gmsoft@tuxicoman.be>
Fix memory leak in rules.c.
Avoid deadlock with timer handling.

* 2006/12/29 Guy Martin <gmsoft@tuxicoman.be>
Changed main algo to first identify all the layers and then match.
Conntrack are now bidirectional. Support will improve soon.
Conntrack store target privs per target object instead of target_type.
Improved Makefile with targets clean_modules and modules.

* 2006/12/13 Guy Martin <gmsoft@tuxicoman.be>
Some more work to support bidir conntrack.
Don't forget to init the rules in main.c.
Fix bug when receiving IPv4 packets of invalid size.

* 2006/12/05 Guy Martin <gmsoft@tuxicoman.be>
Make conntrack use a conntrack_entry to reference a connection.
Fix target_wave for duplicate rtp packets.

* 2006/12/03 Arnaud Ligot <spyroux@spyroux.be>
Fixed ipv6 netmask support.
Added Flow label support.

* 2006/12/03 Guy Martin <gmsoft@tuxicoman.be>
Compute the ipv6 netmasks when parsing param.
Change the way that target passes functions to modules.
Don't make conntrack and helper init timers.

* 2006/11/25 Guy Martin <gmsoft@tuxicoman.be>
Make match_udp inclusive when looking for ports.
Initial helper implementation and helper IPv4.

* 2006/11/07 Guy Martin <gmsoft@tuxicoman.be>
Move the timer code out of conntrack for future helper use.

* 2006/11/05 Guy Martin <gmsoft@tuxicoman.be>
Make target tcpkill have ACK set into RST packet to kill new connections.
Fix sequence handling in target tcpkill.
Make the max conntrack be the same as the max matchs.

* 2006/10/18 Guy Martin <gmsoft@tuxicoman.be>
Make target tcpkill works as well for IPv6 tunneled in IPv4 connections in
normal and routed mode.
Fix typo in input pcap, load match undefined instead of undefined_id.

* 2006/10/17 Guy Martin <gmsoft@tuxicoman.be>
Changed snaplen of input pcap to 1522 to include ethernet with vlan.
Added conntrack ipv6.
Improve input pcap open error.
Improved target tcpkill to support two modes and IPv6.

* 2006/10/16 Guy Martin <gmsoft@tuxicoman.be>
Added target tcpkill.
Added match ipv6.
Fixed input_pcap.
Moved pom.xml.conf to pom.xml.conf.example.

* 2006/10/15 Guy Martin <gmsoft@tuxicoman.be>
Added get_first_layer() to all inputs.
Make do_rule() check the first match with the first layer.

* 2006/10/14 Guy Martin <gmsoft@tuxicoman.be>
Fix parameter parsing in target_dump_payload.
Use node_find_payload_size in target_dump_payload.
Added timers to conntrack_tcp.
Changed select into pselect in input_docsis to void interupted system call.

* 2006/10/11 Guy Martin <gmsoft@tuxicoman.be>
Fix compilation errors with newer kernel headers.
Fix variable endianess warnings.

* 2006/10/09 Guy Martin <gmsoft@tuxicoman.be>
Added useable text parameters to all modules.
Added xml config file support.
Added example config.
Removed unused config.c and config.h files.
Added options -c to specify the config file.
Added option -h to see inputs, targets and matchs parameters.

* 2006/10/01 Guy Martin <gmsoft@tuxicoman.be>
Do not abort but drop the packet if the buffer is too small in input_docsis.
Fix double rule processing in main.c.
Try to avoid to fail on initial locking in input_docis.

* 2006/09/29 Guy Martin <gmsoft@tuxicoman.be>
Fixed memory leak in target_wave.
Added missing match_rtp and conntrack_rtp in svn.
Entirely moved timer management to conntrack core.
Add header size checking for match_rtp.
Add some more len checking in when processing rules.
Fix bug in match_tcp for payload size calculation.

* 2006/09/27 Guy Martin <gmsoft@tuxicoman.be>
Added support for G.711U and G.722 in target_wave.

* 2006/09/26 Guy Martin <gmsoft@tuxicoman.be>
Added target_wave to save rtp payload.
Remove obsolete target_rtp.
Added node_find_payload_size() to get the exact payload size.
Fixed some debugging.
Fixed a bug when the next layer was undefined, it was not possible to have the
size of the next header.

* 2006/09/22 Guy Martin <gmsoft@tuxicoman.be>
Compute the size of each header's payload in next_size.
Remove the last printf for dprint.
Implement a timer for periodic timeout checking.
Added preliminary timeout support to conntack_udp and conntrack.c.
Fixed memory leaks.

* 2006/09/20 Guy Martin <gmsoft@tuxicoman.be>
More detailed drop statistics from input_docsis.
Fixed error detection in input_docsis.
Fixed setup of the demux buffer size.

* 2006/09/15 Guy Martin <gmsoft@tuxicoman.be>
Added target_dump_payload.
Continue to work on conntrack.
Fix next_start in match_tcp and match_udp.

* 2006/09/14 Guy Martin <gmsoft@tuxicoman.be>
Fixed conntrack_udp and added conntrack_tcp.

* 2006/09/13 Guy Martin <gmsoft@tuxicoman.be>
Added input_pcap.
Some more work on conntrack. Now compiles and conntrak_ipv4 is done.

* 2006/09/07 Guy Martin <gmsoft@tuxicoman.be>
Some work on conntrack.
