Commit Graph

1631 Commits

Author SHA1 Message Date
Jeremy Lakeman
a4b392d693 Don't include rhizome adverts in packets with voice frames 2012-10-29 13:10:20 +10:30
Jeremy Lakeman
8dd7a81c71 Remove unused variables 2012-10-29 13:05:03 +10:30
Jeremy Lakeman
de95bb3971 Gracefully disable rhizome if the database cannot be opened
- close database after every command line operation
- don't cache rhizome enabled configuration
- don't send advertisements unless the database is open and the web server is running
- don't provess advertisements unless the database is open
2012-10-29 13:05:03 +10:30
gardners
f7ee962df3 Updated build files for openwrt (now all live in openwrt/). #26
This apparently works for building on openwrt, but servald
segfaults when activating an interface.
2012-10-29 07:38:16 +10:30
gardners
be3b529504 refactored Makefile.in and Anrdoid.mk so that source file lists are
included into each from separate .mk files. #32
2012-10-25 04:30:14 +10:30
Andrew Bettison
d503c8da75 Fix Android compile error 2012-10-24 15:36:52 +10:30
Andrew Bettison
6516d6bb11 Merge branch 'rhizomeslots' into 'master'
Fixes #30.
2012-10-24 15:22:30 +10:30
Andrew Bettison
39fc4ce6de Issue #30, remove periodic Rhizome fetch alarm
Replace the main-loop scheduled periodic alarm with an "activate" alarm that is
scheduled whenever a fetch candidate is added to any queue, unless the alarm is
already scheduled.

Replace the "rhizome.fetch_interval_ms" config item with
"rhizome.fetch_delay_ms" [default 50], which is the number of milliseconds
between adding a fetch candidate and firing the "activate" alarm.  This allows
time for a few more Rhizome advertisment packets to arrive after the first one,
before deciding which fetches to start first.

Add new `is_scheduled()` alarm primitive.
2012-10-24 15:13:50 +10:30
Andrew Bettison
935a545ac7 Issue #30, fix Rhizome fetch slot allocation logic
Also improve the block comment documentation of many functions.
2012-10-24 12:08:41 +10:30
Andrew Bettison
9ee9b63aad Issue #30, fox SEGV bug in new Rhizome fetch queue code
The rhizomestress test now passes, also all rhizomeprotocol tests.
2012-10-24 09:59:36 +10:30
Andrew Bettison
a9d3a1387c Issue #30, rewrite Rhizome fetch queues and slots
Causes SEGV in rhizomestress test.
2012-10-23 18:10:20 +10:30
Andrew Bettison
5d62be7b0f Issue #30, easy logging of struct sockaddr 2012-10-23 18:07:56 +10:30
Jeremy Lakeman
001bbe5c6c If a call is not found, answer with a hangup command. Fixes issue #31 2012-10-23 13:26:45 +10:30
Jeremy Lakeman
760bd04189 Estimate required jitter buffering 2012-10-22 14:05:15 +10:30
Andrew Bettison
21125bc9bc Improve monitor CLI client error handling 2012-10-19 19:38:59 +10:30
Andrew Bettison
cfc16e8e87 Improve monitor client logging
To assist diagnosis of latest Solaris port bug, issue #16.
2012-10-19 19:38:59 +10:30
Jeremy Lakeman
f93216f369 Remove dead code 2012-10-19 15:02:22 +10:30
Jeremy Lakeman
f1b0374b97 Extract crypto signing primitives from mdp processing 2012-10-19 14:54:41 +10:30
Jeremy Lakeman
bb973e764e Don't send duplicate payloads over unicast 2012-10-19 10:40:35 +10:30
Jeremy Lakeman
95843e1f20 Pass overlay frame into mdp processing 2012-10-19 10:40:03 +10:30
Jeremy Lakeman
01bcd07d6f Only unschedule when we know it may already be scheduled 2012-10-19 10:40:03 +10:30
Jeremy Lakeman
3ab474be16 Always update unicast addresses 2012-10-19 10:40:02 +10:30
Andrew Bettison
839de7557c Merge branch 'rhizomestress' into 'master' 2012-10-18 17:57:10 +10:30
Andrew Bettison
af1a6c4297 Split Rhizome stress test into separate file 2012-10-18 17:46:17 +10:30
Andrew Bettison
65ea612e27 Fix bugs revealed by Rhizome stress test
Overhauled the file fetch queue logic in rhizome_fetch.c.

Now the 'rhizomeprotocol' stress test passes in approximately 5 minutes on my
2009-vintage Dell laptop.

Added a call to rhizome_enqueue_suggestions() in rhizome_fetch_close() so that
a new Rhizome GET request is sent as soon as a fetch slot becomes free, instead
of waiting for the (default 5 second) timer to trigger the next GET.
2012-10-18 17:30:22 +10:30
Andrew Bettison
877f76557a Fix 'rhizomeprotocol' stress test 2012-10-18 17:29:58 +10:30
gardners
a40fcfec66 cleaned up NaCl build to just compile using make. #17 2012-10-18 17:26:52 +10:30
gardners
55c9cff8cd added code to replace old-format SAS with new crypto_sign implementation
type on next use (so that people upgrading automatically get a new valid
SAS instead of continuing to try to use an invalid one -- this is only
a reasonable course of action since we have made no formal releases of
the code). #17
2012-10-18 17:26:49 +10:30
gardners
499c4018bf Imported ref10/ implementation of crypto_sign from supercop-20120525
as recommended a while back by Dan Bernstein as offering the fastest
implementation of the crypto_sign() primitives for ARM.
Indeed this implementation IS faster. See comparison below for a
Rock 500 handset (800MHz(?) ARM6, no NEON):

Original ref/ implementation on an R500 stock rom (non-rooted)::
mean signature generation time = 96.80ms
mean signature verification time = 272.20ms

ref10/ implementations on an R500 stock rom (non-rooted):
mean signature generation time = 4.00ms
mean signature verification time = 13.00ms

Approximately 20x speed up, just like that :)
2012-10-18 17:26:48 +10:30
Andrew Bettison
ff7a61c5bc Fix mkstemp() error in log_backtrace()
The template only had five XXXXX but needed six.
2012-10-18 17:20:50 +10:30
gardners
7b8c1337dd call stack errors made fatal and better explained. 2012-10-18 16:12:34 +10:30
gardners
b67ee5d4c5 made non-xpf wrapper for serval_packetvisualise, and added
missing header.
2012-10-18 16:11:25 +10:30
gardners
b758366cc3 fixed bug with mkstemp() on Linux (format must be 6x X, not 5x X). 2012-10-18 16:11:24 +10:30
Andrew Bettison
5ee82689d2 Start fixing Rhizome stress bugs
This commit does not compile.
2012-10-18 11:56:02 +10:30
Andrew Bettison
1eeb040602 Improve new Rhizome stress test
Now it fails for the right reasons, and does not produce ERROR.
2012-10-18 11:51:10 +10:30
Andrew Bettison
381fc7cad8 Use finally() function in test suites
Mainly to call stop_all_servald_servers(), which asserts that the server is
still running and responding to orderly shutdown.
2012-10-18 11:46:32 +10:30
Andrew Bettison
ed44dfe720 Improve test framework: finally() function
If supplied, the finally_TestCaseName() function, otherwise the finally()
function, is called after the test_TestCaseName() function terminates (with any
result).  An assertion failure in the finally() function causes the test to
FAIL, but execution continues.  So it is like teardown() but produces FAIL not
ERROR.  Useful for clean-up that must be performed as part of the system under
test.
2012-10-18 11:38:44 +10:30
Andrew Bettison
7317f9b56c Add a new 'rhizomeprotocol' test case: stress test
Refactored some testdefs.sh and testdefs_rhizome.sh, not yet complete.
2012-10-17 18:10:39 +10:30
Andrew Bettison
8ab7cc79b5 Improve debug logging from watch(), schedule() etc.
Use new '__whence' mechanism.
2012-10-16 17:00:03 +10:30
Andrew Bettison
259b9a9d24 Logging/debug improvements: __WHENCE__, __whence
Introduce __WHENCE__ macro and a block comment in log.h explaining it.

In "primitive" kinds of functions, rename 'whence' arguments to '__whence' and
use WHYF(), WARNF(), DEBUGF() macros instead of calling logMessage() directly.
2012-10-16 17:00:03 +10:30
Jeremy Lakeman
2bef619723 Fix - make sure we don't lose track of scheduled alarms 2012-10-16 14:54:28 +10:30
gardners
a82c8f2f41 Imported Jonathan Lahav's updates to openwrt-makefile.
Replaced "dna" everywhere with "servald". #26
2012-10-15 22:28:37 +10:30
Andrew Bettison
52ccd07020 Issue #17, improve speed of "rhizome extract manifest"
In the case that the MANIFESTS 'author' column is not NULL, do not perform a
full bundle secret verification in order to clear the '.readonly' flag, just
check whether the author's SID is present in the keyring with a proper-size
rhizome secret.
2012-10-15 18:33:44 +10:30
Andrew Bettison
f6d9e6cb0e Issue #17, improve "rhizome extract manifest" logic
Do not store negatives in the MANIFESTS 'author' column, just positives, so
that newly-unlocked identities are still checked.

Comment in rhizome_database.c about the semantics of the MANIFESTS.author
column.
2012-10-15 18:08:31 +10:30
Andrew Bettison
c43a7ba8e6 Issue #17, improve "rhizome extract manifest" command
Add ".readonly" output field, add logic to detect bundle author and update
MANIFESTS table 'author' column accordingly.

Add two 'rhizomeops' test cases to deal with authorless logic.

Rename some 'rhizomeops' test cases for consistency and to help filtering.
2012-10-15 16:48:04 +10:30
Paul Gardner-Stephen
37495e4794 fix interface detection on solaris. 2012-10-15 15:58:42 +10:30
Paul Gardner-Stephen
dd3a5ae62d Fix compile errors and some warnings on solaris. 2012-10-15 15:36:36 +10:30
Andrew Bettison
eff3e9ec8f Issue #17, fix new 'rhizomeops' test
Was incorrectly supplying bundle secret to "rhizome add" command.
2012-10-15 14:01:48 +10:30
Jeremy Lakeman
b7201a75b2 Ensure paths decay and eventually expire 2012-10-12 14:22:26 +10:30
Andrew Bettison
3f1f495d68 Issue #17, overhaul manifest author crypto logic
Add test case for new feature of the "rhizome add" command: if the author SID
is not specified (empty arg) then it searches the keyring for the author.

Removed "authorSid" argument from several functions that also take a struct
rhizome_manifest * arg, since the author, if known, is now supplied in the
struct.

Improve return value handling and refactored some rhizome crypto code.
2012-10-11 17:58:24 +10:30