Replaces (const char *file, unsigned int line, const char *function) arguments
to all logging functions, simplifies malloc/free tracking code in
overlay_buffer.c and Rhizome manifest alloc/free tracking in rhizome_bundle.c.
Use __HERE__ macro instead of (__FILE__, __LINE__, __FUNCTION__) everywhere.
Special __NOWHERE__ macro is equivalent to (NULL, 0, NULL).
Declare net.c functions in new "net.h" header, so log.c doesn't have to pull
in the entire "serval.h" just to use write_str().
Facilitates progress on issue #2.
Replace DEBUG_SIMULATION with DEBUG_VOMP
Replace all printf(...) and fprintf(stderr,...) with WHYF(...) and DEBUGF(...)
Make all debug logging conditional on DEBUG_VOMP
serval_packetvisualise() is now replaced by DEBUG_packet_visualise() which uses
logging system not stderr (so now it will appear in Android log).
Replaced several fprintf(stderr,...) with DEBUGF(...).
Command line only prints a full help message on "help" command -- a command
parse failure simply informs the user about the "help" command.
Move DEBUG_ and LOG_LEVEL_ macro constants from constants.h into log.h.
Move dumpResponses() out of log.c, so that log.h is almost ready for re-use
(still depends on conf.h).
Remove unused and now obsolete catv() function -- replaced with toprint()
and alloca_toprint().
Add copyright/licence comments, fix up some copyright attributions.
Add #ifndef..#define..#endif __SERVALD_FOO_H to header files: log.h serval.h
constants.h
Use sigaction(2) instead of deprecated signal(2), allowing SEGV et al to be
received in handler and therefore in re-spawned server.
Receive SIGSEGV et al in a separate handler function which kills the server
with the same signal if it does not re-spawn.
Log a GDB backtrace on SEGV et al before exiting or respawning.
Rename config option "serval.respawn_on_signal" to "server.respawn_on_crash".
Servald starts DNA helper, receives startup ACK, sends requests, receives
responses, handles malformed helper responses, echoes dnahelper stderr lines to
log, sends MDP reply packet, waits for dead helper process, all asynchronously.
Shuts down helper process during servald shutdown.
Remaining issues:
- Does not impose a timeout on helper responses.
- Only the first URI is reported by the "dna lookup" command.