Commit Graph

2448 Commits

Author SHA1 Message Date
Andrew Bettison
ae61a4f35c Issue #20: Make abstract sockets work
Finish the work started by Daniel in 2012, by using abstract local
AF_UNIX sockets on platforms that support them (Linux, Android).

Fix all sorts of bugs and issues that prevented the existing MDP and
Monitor client and server code from working with abstract socket names.
2013-09-19 17:26:06 +09:30
Andrew Bettison
4937757d36 Improve Serval instance path operations
Replace form_serval_instance_path(), which takes a single 'path'
argument, with formf_serval_instance_path() and
vformf_serval_instance_path(), which take printf(3)-like arguments.
This supports more flexible instance path file names.

FORM_SERVAL_INSTANCE_PATH() macro works as before, but reimplemented
2013-09-19 17:19:37 +09:30
Andrew Bettison
f3cd0d8718 Improve socket function prototypes and macros
Remove '__whence' argument name from all struct __sourceloc prototype
arguments

Parentheses around macro arguments

Use __WHENCE__ instead of __HERE__ in macros
2013-09-19 16:37:34 +09:30
Andrew Bettison
a4704dfd3c Add strbuf_va_vprintf() convenience macro 2013-09-19 16:34:02 +09:30
Andrew Bettison
5c84b2ffd5 Fix Rom's socket cleanup-on-start code
Fix buffer overflow bug: replace call to sprintf(3) with call to
FORM_SERVAL_INSTANCE_PATH()

Fix file descriptor leak bug: add missing closedir(3) call

Use lstat() instead of stat() to avoid warnings on broken sym links

Use WARNF_perror() where appropriate in preference to WARNF()

Remove redundant one-line comments
2013-09-19 04:30:40 +09:30
Andrew Bettison
d64d9487c1 Issue #20: improve socket set-up logging 2013-09-19 04:30:40 +09:30
Andrew Bettison
259834a4c1 Issue #20: fix bug in new esocket() function 2013-09-19 04:30:40 +09:30
Andrew Bettison
7453e82a27 Issue #20: improve new socket function logging
__whence argument and function macros
2013-09-19 04:30:40 +09:30
Andrew Bettison
498eba2051 Improve fdqueue.c debug logging 2013-09-19 04:30:40 +09:30
Andrew Bettison
2b3119b49b Issue #20: merge branch 'sockets' into 'development'
Daniel's improvements to the local file/abstract socket code, with many
improvements to bring it up to date.
2013-09-19 04:30:14 +09:30
Andrew Bettison
db7e9004b3 Fix bug in version_string.sh
git describe --dirty does not accept HEAD (committish) arg
2013-09-17 10:51:50 +09:30
Andrew Bettison
987875969c Improve version_string.sh script
Full --help usage message
Better error handling and reporting
Only considers tags that look like version numbers
Does not create and delete local "START" tag
Lots of options, including --ignore-untracked and --unmodified
Suitable for use in Batphone repository
2013-09-12 17:50:54 +09:30
Andrew Bettison
e8ab8477be Get rid of worse-than-useless keyring debug 2013-09-10 13:28:27 +09:30
Andrew Bettison
7add45214c Add [keyring-pin] arg to keyring load command 2013-09-10 11:28:55 +09:30
Andrew Bettison
e74aec9354 Tests for starting daemon with keyring entry PINs 2013-09-09 14:47:02 +09:30
Andrew Bettison
d177512746 Add test for server start with --keyring-pin option 2013-09-09 14:47:02 +09:30
Jeremy Lakeman
d1234cb0f9 Use consistent integer types and formats 2013-09-09 12:09:40 +09:30
Andrew Bettison
f0a74e6cf2 Merge "keyring load" command and other keyring improvements into 'development' 2013-09-07 04:22:55 +09:30
Andrew Bettison
18e2916cec Add more keyring load tests, fix duplicate identity bugs 2013-09-07 04:03:28 +09:30
Andrew Bettison
befb658958 All keyring commands now close (free) the keyring 2013-09-05 16:34:52 +09:30
Andrew Bettison
8a300c2520 Get new keyring dump command and test working 2013-09-05 16:34:01 +09:30
Andrew Bettison
4b0550afd1 Fix new keyring load test 2013-09-05 09:19:45 +09:30
Andrew Bettison
55efc73b7e Improve test framework: assertGrep --fixed-strings option 2013-09-05 09:19:14 +09:30
Andrew Bettison
f95e41374b Implement keyring load command, not working yet
Write new keyring test, fails with ERROR because assertGrep -F option is
not supported.
2013-09-04 23:47:17 +09:30
Andrew Bettison
08c02e0e20 More progress towards keyring load command 2013-09-03 17:31:10 +09:30
Andrew Bettison
34bbfb9b30 Add strn_fromhex(), improve hexvalue()
Implement fromhex() and fromhexstr() using strn_fromhex()
2013-09-03 17:29:41 +09:30
Andrew Bettison
9d1c3e0cba Fix test case doc comment 2013-09-03 17:05:50 +09:30
Andrew Bettison
425aa1005c Start work on "keyring load" command 2013-09-02 17:33:52 +09:30
Andrew Bettison
080ccd957a Replace str_fromprint() with strn_fromprint() 2013-09-02 17:31:13 +09:30
Jeremy Lakeman
3be2ed615d Resurrect packet visualisation 2013-09-02 14:55:02 +09:30
Jeremy Lakeman
8d0e056f81 Count number of BARs we have seen 2013-08-30 17:38:29 +09:30
Jeremy Lakeman
8935db4184 Only ack soon if we have been asked to 2013-08-30 17:38:29 +09:30
Jeremy Lakeman
e3b616421f Remember outgoing links 2013-08-30 17:38:29 +09:30
Jeremy Lakeman
6ecfc952ed Schedule ack packets in response to neighbour broadcasts 2013-08-30 17:38:29 +09:30
Jeremy Lakeman
abdd3e12c9 Prevent crash if dumping buffer contents 2013-08-30 17:38:29 +09:30
Andrew Bettison
572d7c2b5d Add tests for new keyring environment vars 2013-08-30 11:20:19 +09:30
Andrew Bettison
aa20fd1a9b Improve keyring environment variables
Rename to SERVALD_...

Interpret SERVALD_KEYRING_PATH relative to instance dir unless absolute.

Explicitly unset them in setup_servald() test defs function
2013-08-30 11:20:19 +09:30
Andrew Bettison
3164172c08 Work around broken Vim syntax highlighting 2013-08-30 11:20:19 +09:30
Andrew Bettison
3b1ae5cbb0 Env vars SERVAL_KEYRING_PATH and SERVAL_KEYRING_READONLY
To support release signing operations without having to copy the release
keyring from its USB stick (into an instance directory), and reducing
the risk of corrupting the release keyring file while using it in-place.
2013-08-30 11:20:19 +09:30
Andrew Bettison
7d30b3cce7 Pass command-line args to server() function
So that the daemon can open the keyring file with --keyring-pin and --entry-pin
options.

Also remove some unused code.
2013-08-30 11:20:19 +09:30
Jeremy Lakeman
842915f70c Fix, using wrong loop variable in interface detection 2013-08-29 17:22:59 +09:30
Jeremy Lakeman
f06c203488 Send successful, in-order ACK's based on link RTT 2013-08-29 16:51:50 +09:30
Jeremy Lakeman
bf4269e98e Adjust retransmission delay based on measured RTT 2013-08-29 15:28:20 +09:30
Jeremy Lakeman
95831a51aa Don't schedule another poll if the interface is down 2013-08-28 17:06:42 +09:30
Jeremy Lakeman
7a4b1c3f19 Don't destroy the interface destination when bringing it down 2013-08-28 16:48:55 +09:30
Jeremy Lakeman
d2a88b8b2d Bring the interface down if sending broadcast packets fails for any reason 2013-08-28 16:25:05 +09:30
Jeremy Lakeman
b916363b40 Treat empty filehash the same as NULL 2013-08-28 16:15:28 +09:30
Jeremy Lakeman
8accabfcac Always store payloads with a temporary id 2013-08-27 16:15:51 +09:30
Jeremy Lakeman
8fea1523b1 More consistent use of sleep_ms 2013-08-27 15:14:17 +09:30
Jeremy Lakeman
e98592a7c1 Don't update the database author if we already know it 2013-08-27 15:11:56 +09:30