Add missing includes
Fix printf length modifier and conversation specifier
Move mixed ANSI + K&R function definitions to ANSI-only
Unify indentation/line length styles
Mark locally-only used functions as static
Remove unused function record_flow_name
Remove unused variables in functions
Avoid clash with predefined preprocessor macro __VERSION__
Don't mix typedef and non-typdef version of pcap_dumper_t
Don't store casted udph pointer as udphdr pointer
Don't implicitly cast integer pointer to char pointer for hashf
Enable compiler warnings
Use enumeration type to store the dump_file status
Set src and dst port to 0 for non-TCP/UDP packets

The source and destination ports are used to find the right bucket in the hash.
Currently they are only set when a TCP or UDP packet was detected and otherwise
the old (from previous packet) value is used. This is problematic when in the
future non-UDP/TCP traffic should be dumped because it will end up in different
pcap files.
Store allowed flow types in a common structure dump_allowed

It is easier to spot the right place which must be modified to add more flow
types when the configuration for them is stored the same way in a common
variable/structure.
Add option to enable dumping of non-UDP/TCP IP flows
Use C99 sized integer types to store ip/port
Use GNU TCP/UDP header definitions to have access to _GNU_SOURCE functions

The code currently assumes to have path names with limited length. This seems
to cause crashes and thus these static allocations will be replaced with
asprintf to avoid buffer overflows by str* functions. Unfortunately, the change
to _GNU_SOURCE also changes the definiton of the struct tcphdr and udphdr.
Use asprintf to dynamically allocate filenames/paths

The current routines to create filenames/paths use static created buffers. This
creates buffer overflows for longer names and causes avoidable crashes. Instead
asprintf can be used to dynamically allocate the buffers and always be on the
safe side regarding the buffer lengths.
Free hashtable on normal exits to make spotting memleaks easier