Commit Graph

1360 Commits

Author SHA1 Message Date
Andrew Bettison
fd1da2df93 Fix bug that failed dnaprotocol multi-lookup test 2012-08-06 16:44:36 +09:30
Andrew Bettison
fa03b7e667 Fix bug in alloca_toprint() that caused SEGV 2012-08-06 15:39:08 +09:30
Andrew Bettison
858c6c3efc Improve logging to diagnose dnaprotocol test failure 2012-08-03 19:08:44 +09:30
Andrew Bettison
03da89225d Add xprintf() extensible stream formatter
Use it to replace open_memstream(3) in logServalPacket() -- not available on
Mac OS X
2012-08-03 16:44:05 +09:30
Andrew Bettison
4f9abdeb86 Refactor serval_packetvisualise(): hex dump 2012-08-03 13:13:47 +09:30
Andrew Bettison
9ede55ab4c Fix DEBUG_packet_visualise() log output 2012-08-03 13:12:54 +09:30
Andrew Bettison
355af1f874 Fix bug in strbuf_ncat(): not appending nul terminator 2012-08-03 13:11:30 +09:30
Andrew Bettison
0022990e72 Add new dnaprotocol test
Dnahelpers on many nodes resolve the same DIDs

Currently fails, suspicious error from overlay_mdp_sanitytest_sourceaddr()
2012-08-02 17:18:04 +09:30
Andrew Bettison
0c7c4e7296 Improve logging to help diagnose dnaprotocol test failure
Replace printf() with DEBUGF() and INFOF()
Improve error message from overlay_mdp_sanitytest_sourceaddr()
2012-08-02 17:16:18 +09:30
Andrew Bettison
29bf23d7ac Add dnahelper test: dna.helper.argv.1 config option 2012-08-02 17:11:36 +09:30
Andrew Bettison
32704bf0e9 Improve 'dnaprotocol' test script
Replace hard-coded identity names and DIDs with shell variables
2012-08-02 15:46:53 +09:30
Andrew Bettison
18424a4f1e Improve test framework: expose shellarg() function 2012-08-02 15:42:18 +09:30
Andrew Bettison
ee6d9d8ea3 Fix logging in vomp.c
Replace DEBUG_SIMULATION with DEBUG_VOMP

Replace all printf(...) and fprintf(stderr,...) with WHYF(...) and DEBUGF(...)

Make all debug logging conditional on DEBUG_VOMP
2012-08-02 11:29:37 +09:30
Andrew Bettison
f37ec5af09 Reduce use of stderr in many places
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.
2012-08-01 17:54:02 +09:30
Andrew Bettison
560e0c6699 Add logString() function 2012-08-01 17:52:38 +09:30
Andrew Bettison
2bd7c38483 Remove unused trans_cache.c 2012-07-31 18:12:20 +09:30
Andrew Bettison
76cfb7beae Fix bug failed dnaprotocol tests non-deterministically
Appending to the dummy interface file was altering the read offset position, so
very many receive packets were being lost.
2012-07-31 17:49:24 +09:30
Andrew Bettison
ac12eac5bc Remove a line of redundant log debug 2012-07-31 17:49:00 +09:30
Andrew Bettison
cd168ac368 Improve dnaprotocol tests: enable logging in commands 2012-07-31 17:47:59 +09:30
Andrew Bettison
91fd0a7801 Improve test framework: always log stderr on some assertions 2012-07-31 17:47:09 +09:30
Andrew Bettison
24b05eaeaa Fix bug in self-announcements
On first tick, do not send s1 = 0, but s1 = s2 - 1 (1 ms window)
2012-07-31 16:21:29 +09:30
Andrew Bettison
813cf94f79 Replace fprintf(stderr,...) with DEBUGF(...) 2012-07-31 16:20:48 +09:30
Andrew Bettison
dbef192513 Improve dump() logging primitive 2012-07-31 16:20:09 +09:30
Andrew Bettison
ddc17434c4 Fix next-hop logic for case of no interfaces up 2012-07-30 18:35:28 +09:30
Andrew Bettison
55f22c8cd5 Convert fprintf(stderr,...) to DEBUGF() 2012-07-30 18:35:06 +09:30
Andrew Bettison
240be25793 Replace overlay_gettime_ms() with gettime_ms() 2012-07-30 17:22:38 +09:30
Andrew Bettison
b9396505f8 Remove some unused declarations 2012-07-30 16:15:42 +09:30
Andrew Bettison
07349c3aea Improve copyright attributions and comments 2012-07-30 16:15:42 +09:30
Andrew Bettison
f002f5b9fd Refactor log.h constants.h serval.h
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
2012-07-30 16:15:42 +09:30
Andrew Bettison
d63318cd2f Mop up executable rename from 'dna' to 'servald' 2012-07-30 16:15:42 +09:30
Daniel O'Connor
9cf4d5529a Refactor out socket name setting code into one place.
This consistently handles abstract vs normal sockets with a single switch.

overlay mdp tries to have both (abstract & normal) but the code paths seem different, I have consolidated them.

Needs more testing.
2012-07-29 22:20:54 +09:30
Daniel O'Connor
09d0fecf28 Remove carnal knowledge of conf.c from serval.h and commandline.c by providing a function to set the instance path override. 2012-07-29 18:58:41 +09:30
Daniel O'Connor
c241d3630c Move debug options to Makefile.dbg so we don't have to re-run configure.
Remove DO_TIMING_CHECK since it's no longer used
2012-07-29 14:55:10 +09:30
Daniel O'Connor
dbbf4bff1c Add file to set emacs variables to match the prevailing style. 2012-07-29 13:52:46 +09:30
Daniel O'Connor
5e43c81214 Sort source files 2012-07-29 13:09:13 +09:30
Daniel O'Connor
3907eb3842 Use variables for source/object files. 2012-07-29 13:04:03 +09:30
Daniel O'Connor
8cc08699ca Fix warning caused by user sourced format string (not a real error) 2012-07-29 13:03:11 +09:30
gardners
72f8b1916d minor fixes to get things building with monitor client library. 2012-07-29 12:44:04 +09:30
gardners
274a77fa46 Refactor serval.h to split out log, config and other bits so that
we can have a standalone ServalD monitor client library and simple
header file.  Create that too.
2012-07-29 12:42:27 +09:30
gardners
93449d380e various fixes for libmonitorclient and commits made by others
inbetween. Hopefully I have captured all the changes.
2012-07-29 12:35:53 +09:30
Andrew Bettison
8db737ee6f Quieten startup logging a bit 2012-07-27 19:59:16 +09:30
Andrew Bettison
ce12258f63 Improve logging in keyring.c
Use DEBUGF() not WHYF() for debug messages, test DEBUG_KEYRING.

Use WHY_perror() in more places.
2012-07-27 18:18:57 +09:30
Andrew Bettison
bb97a80452 Minor improvements to 'dnaproctocol' tests 2012-07-27 18:04:46 +09:30
Andrew Bettison
1da66a87ce Fix bug that non-deterministically broke 'dnaprotocol' tests
If a selfannounce ack was received in millisecond zero, then the peer did not
show up as routable.
2012-07-27 18:04:46 +09:30
Andrew Bettison
15d7bec680 Rewrite fprintf(stderr,...) to DEBUGF() 2012-07-27 18:04:46 +09:30
Andrew Bettison
2152c9267f DEBUG_VERBOSE log messages for all command-line commands 2012-07-27 18:04:46 +09:30
Andrew Bettison
3b1adc3a31 Add DEBUG_argv() and WHY_argv() macros
Implemented usng new logArgv() function.

Refactored logMessage()
2012-07-27 18:04:46 +09:30
Andrew Bettison
bbd28eed45 Add strbuf_toprint(), strbuf_toprint_quoted(), etc. 2012-07-27 18:04:46 +09:30
Daniel O'Connor
6d83fddbe5 Rename strnstr as it already exists in FreeBSD & OSX (with different argument ordering).
Arguably we could detect it but I couldn't be bothered dealing with auto*
2012-07-27 16:47:05 +09:30
Andrew Bettison
0dee99dec2 Remove old command-line support 2012-07-27 11:44:20 +09:30