cosmetic: trailing whitespace, alignment
capdump: move to function validate_key
capdump: less duplication
capdump: clientlen should be socklen_t
capdump: proper pointer.

while correct in the sense that both yields the same value it is wrong in the sense that the first construct is a pointer to a packet struct and the second is a pointer to a capheader.
capdump: removing unused variables
capdump: need pthread.h
capdump: fix warning with %zd
capdump: initialize variables instead of late assignemnt.
capdump: return a value
capdump: move listen out of switch-case

Two major reasons:

1. makes the code easier to read and maintain.
2. consider the case when running "capdump -LP 4711", user would expect it to listen on port 4711 but instead it would listen on default port 4000 as -L would be processed before -P. This is confusing for users.
capdump: move handling of udp markers to function.

Also uses separate buffers for UDP and TCP as they might corrupt each other.
capdump: use timepico_now
capdump: free packet memory
capdump: remove some unused variables