Commit Graph

149 Commits

Author SHA1 Message Date
Andrew Bettison
a6ac6a4246 Improve servald logging
Use 'logfile' config entry, fall back to stderr if absent or can't be opened
Replace fprintf(stderr,...) with DEBUGF() in dump() and dumpResponses()
2012-06-22 17:19:14 +09:30
Andrew Bettison
274e5c007c Merge branch 'master' into andrew
Conflicts:
	log.c
2012-06-22 11:18:48 +09:30
gardners
48a1d7e20f MDP socket name can now be changed by config option mdp.socket.
DNA tests now passing again.
2012-06-21 16:36:37 +09:30
gardners
01712ab67e monitor.socket config option added to allow multiple servald
instances on the same machine without conflicting abstract namespace
unix domain sockets for monitor interface.
2012-06-21 16:36:37 +09:30
gardners
374e4676a7 various simplifications of DNA reply generation and related code. 2012-06-21 16:36:37 +09:30
gardners
dceeed8d35 more work on dna helper interface.
Also added missing dna_helper.c file from previous changes.
moved sigpipe/sigio detection code to own file.
2012-06-21 16:35:28 +09:30
gardners
e5394dd143 added stubs for DNA lookup helper app (not yet complete).
cleaned up some unused variables.
2012-06-21 16:35:28 +09:30
gardners
6023cd4da2 moved timing check definitions to serval.h 2012-06-21 11:33:42 +09:30
Andrew Bettison
56cb12f507 Refactor rhizome db creation and execution functions 2012-06-12 18:12:36 +09:30
Andrew Bettison
b2ffc6e72c Merge branch 'master' into andrew 2012-06-12 11:56:50 +09:30
Andrew Bettison
7be0d9d00d Pass author SID parameters in binary, not hex 2012-06-08 18:32:14 +09:30
Andrew Bettison
637ef02f30 Add _selfsigned column to "rhizome list" output
Add <pin,pin...> arg1 to "rhizome list" command, so it can open the keyring

Some tests in tests/rhizome fail
2012-06-08 18:25:43 +09:30
Daniel O'Connor
86c5e6945f Don't force signedness for name in overlay_interface_register().
I can't see any point to forcing the signedness, it causes warnings on platforms with a signed-char by default.
2012-06-08 17:01:50 +09:30
Daniel O'Connor
ea9993dc91 Fix detection on OSX and make detection smarter.
- Fix lsif() on OSX.
- Make lsif() smarter and avoid non-broadcast and no AF_INET addresses.
- Don't run multiple interface detectors, run one at a time until one works.
- Factor out HAVE_IFADDRS_H code into a separate function into lsif.c with the other interface detection routines.
- Prefer HAVE_IFADDRS_H (random bias..)
2012-06-08 16:36:33 +09:30
Andrew Bettison
7a71a521f8 Pass author SID parameters in binary, not hex 2012-06-08 15:27:15 +09:30
Daniel O'Connor
8882515d03 Fix compilation on OSX.
- /proc/net/route is Linux only.
- lsif() will work anywhere SIOCGIFCONF is defined.
- Abstract namespace UNIX domain sockets are Linux only.
- Rework code to reduce indent levels.
2012-05-28 15:00:54 +09:30
Andrew Bettison
bea9188cd5 Fix another manifest leak
Add manifest alloc/free debug logging to help, 'debug.manifests' option
2012-05-25 17:01:56 +09:30
Andrew Bettison
0ec3feaa29 Expunge setReason()
Replace with WHY() or WHYF() everywhere

Improve logMessage() to handle file/line/function printing internally

Mainly so that log messages from manifest alloc/free in rhizome_bundle.c
can make it into the Android log
2012-05-24 17:11:55 +09:30
Andrew Bettison
2f6f642a02 Improve log pathname trimming 2012-05-23 18:04:10 +09:30
Andrew Bettison
1af9125392 All rhizome database keys are uppercase hex
FILES.id, MANIFESTS.id, FILEMANIFESTS.fileid, FILEMANIFESTS.manifestid
Named constants for hex and binary ID sizes
2012-05-23 16:04:00 +09:30
gardners
29bb86d9e7 first cut at supressing rhizome activity during calls. 2012-05-22 13:05:29 +09:30
gardners
e3a61f7614 improved WHY() macros to not show build path in messages. 2012-05-22 09:54:10 +09:30
gardners
e44294ea66 implemented server_probe(int *pid) that used monitor interface
to probe server status.  Also returns PID if running (Linux only).
2012-05-21 20:45:07 +09:30
Jeremy Lakeman
9adaf0bd8f Only repeat an audio payload once 2012-05-21 14:14:24 +09:30
gardners
27daf02f81 added peer announcment to monitor interface. 2012-05-21 12:47:54 +09:30
gardners
3ea6d4f324 monitor interface announces new peers. 2012-05-21 12:47:53 +09:30
Daniel O'Connor
990a8f3057 Add support for srtuct ucred on BSD.
This requires building with _GNU_SOURCE to get access to struct ucred on Linux. Previously the test failed on every platform except glibc <2.8 or so.

Building with _GNU_SOURCE causes TRUE to be defined so we can't use this as a variable anymore, and MIN/MAX so don't define our own.
2012-05-21 12:22:50 +09:30
Daniel O'Connor
354258c395 Rename timeout to dnatimeout as it conflicts with ncurses (which is dumb but we can't change ncurses) 2012-05-21 12:20:05 +09:30
Andrew Bettison
b739bfd572 Add catv() function 2012-05-21 00:08:31 +09:30
Andrew Bettison
189ecee4b9 Clean up over-use of WHY() in overlay_mdp.c 2012-05-20 16:06:32 +09:30
gardners
e870c35422 Added very crude multi-hop route determination. 2012-05-17 17:08:59 +09:30
gardners
d2949f1b05 Made VoMP audio packet stuffing limit configurable and larger
so that we can test preemptive audio retransmission before we
implement any codecs.
2012-05-16 11:52:22 +09:30
gardners
0eafc34970 BK encoding and decoding complete, but untested. 2012-05-15 20:04:41 +09:30
Andrew Bettison
f90b21ec78 Implement rhizome config options
rhizome.datastore_path - if not set, reverts to serval instance path
rhizome.enable - if not set, defaults to true
2012-05-15 12:56:10 +09:30
Andrew Bettison
7087afc404 Refactor main() into main.c
Now dna.c only contains code for the old command line
2012-05-15 11:09:21 +09:30
Andrew Bettison
d11258cefc Overhaul debug flags
Config debug flags are now represented as individual items, eg:
   servald config set debug.verbose yes
   servald config set debug.rhizome yes
instead of aggregated, eg:
   servald config set debug verbose,rhizome  <-- no longer works

Added a debug flag "debug.all" that can be set and cleared, over which
individual flag sets/clears take priority.

Slimmed down dna.c by moving some globals and functions to the files where they
are used.

Default command line (help message) is now the new style, not the deprecated
style.
2012-05-14 18:37:32 +09:30
Andrew Bettison
b02e9b9ac4 Overhaul rhizome datastore path code
Create datastore directory and all parent dirs if it does not exist
More robust error checking and buffer overflow protection
New mkdirs() and mkdirsn() functions
2012-05-14 18:37:32 +09:30
gardners
67e6c7ae2a fixed 10 pounds of potatoes in 5 pound sack (FUBAR) bug. 2012-05-14 16:24:58 +09:30
gardners
f0b72955d1 preparation for nacks for retransmission. 2012-05-14 15:44:36 +09:30
Andrew Bettison
e746557a08 Fix bug in overlay_gettime_ms()
The sequence start time was only getting set in overlay_interface_init(), which
was not always called, or was called after overlay_gettime_ms() had already
been used.

Added FATALF(), FATAL() and FATAL_perror() macros.

Removed a bunch of debug statements no longer needed in monitor.c and server.c.
2012-05-11 10:38:46 +09:30
gardners
7b82ccbd7b work on bypass-audio.
CALLSTATUS monitor message has gained a field, thus changing
API for java side.
2012-05-11 08:14:00 +09:30
Andrew Bettison
022e3289dd Quieten new compile warnings 2012-05-10 18:29:00 +09:30
Andrew Bettison
881576212c Fix all trivial compiler warnings 2012-05-10 18:08:59 +09:30
gardners
850d7b42d7 reworked shortcircuit audio code. 2012-05-10 16:58:57 +09:30
Andrew Bettison
b15e5cfee7 Improve debugging/logging macros
Replace 'WHYRETNULL();' statements with 'return WHYNULL();'
Introduce DEBUG(), DEBUGF(), DEBUG_perror() and D macros
Add logMessage() and vlogMessage() functions
Implement setReason() using vlogMessage()
2012-05-10 12:53:57 +09:30
gardners
8d2792ce74 substantial work towards playing audio on IDEOS/G1 type MSM chipset
android phones directly from C to dramatically reduce latency.
2012-05-10 03:47:18 +09:30
Andrew Bettison
d96d8ff8d6 Move signal handling to server.c
Improve diagnostic messages from signal handler

For some reason, signal handler was not being set in server process when called
from main()
2012-05-09 19:06:44 +09:30
Andrew Bettison
68cfa6218c Minor fix to WHY_perror() macro 2012-05-08 17:48:16 +09:30
Andrew Bettison
836f8332e8 Replace perror() with WHY_perror()
Puts more diagnostics to Android log
2012-05-08 14:53:34 +09:30
gardners
596b20b5e8 interactive servald monitor cli command implemented. 2012-05-08 14:41:21 +09:30