3920 Commits

Author SHA1 Message Date
Paul Gardner-Stephen
7c4971a4f8 C is not VHDL 2018-11-14 16:02:29 +10:30
Paul Gardner-Stephen
7a222e3869 add more useful error messages to meshmb failure responses 2018-11-14 15:59:30 +10:30
Paul Gardner-Stephen
2ec4744460 don't setup MDP named socket on iOS 2018-11-14 14:43:53 +10:30
Paul Gardner-Stephen
951cc90bde don't setup monitor socket on ios 2018-11-14 14:38:12 +10:30
Paul Gardner-Stephen
c5c82f822f fix named socket path generation for iOS to keep under BSD socket name length 2018-11-14 14:31:52 +10:30
Paul Gardner-Stephen
08554b2655 containerise symbolic link to servald.log file 2018-11-14 14:17:06 +10:30
Paul Gardner-Stephen
d5fc353bf8 containerise other paths 2018-11-14 14:04:06 +10:30
Paul Gardner-Stephen
2f6f9b26f2 use -f instead of non-portable --fdqn option to hostname 2018-11-14 13:56:28 +10:30
Paul Gardner-Stephen
87303c3436 add /* fall through */ comments for picky C compilers that don't like the FALLTHROUGH; macro 2018-11-14 13:51:44 +10:30
Paul Gardner-Stephen
d20d7911c4 actually use containerised path on iOS 2018-11-14 13:25:45 +10:30
Paul Gardner-Stephen
233421e078 add container path prefix when generating serval etc paths 2018-11-14 13:10:39 +10:30
Andrew Bettison
81d4e696ca Improve Swift API delegate log outputter
Capture whence information in all Serval logging API entry points.

Introduce the LogLevel enum type to avoid exposing internal C API
details in the Swift API.

Rename Swift API methods and types to use camelCase naming style, to
distinguish it from the C API, which uses under_score naming style.
2018-06-01 17:41:32 +09:30
Andrew Bettison
00804e9fc1 Make servald_features() available to iOS app
Add servald_features.o to the libservaldaemon.a static library (was only
in libservaldaemon.so before), and create the "servald_features.h"
public header so that an iOS app's Swift code can simply refer to the
servald_features() function in order to link in all the Serval DNA
daemon features.
2018-06-01 17:41:32 +09:30
Andrew Bettison
33518fd286 Add Swift CliContextArray 2018-06-01 17:41:31 +09:30
Andrew Bettison
b6873c73dd Fix the Apple Xcode 9.3 iOS build
The iOS build now produces two frameworks instead of one:
- 'serval_dna' is the C API
- 'ServalDNA' is the Swift API (daemon)

The top-level modulemap file now produces a C API module called
'serval_dna' (renamed the library to libserval_dna.a) so that the Swift
API code can be identical for iOS and non-iOS targets.
2018-06-01 17:41:31 +09:30
Andrew Bettison
14903ca18d Add log outputter for Apple iOS and macOS
On iOS, the log outputter uses Apple's Unified Logging System, but on
Mac OS, the logger uses the older Syslog API so that it will compile on
platforms older than macOS 10.13 High Sierra.
2018-06-01 17:41:31 +09:30
Andrew Bettison
bb5fc482c7 Fix Swift compile error on ARM 64-bit 2018-06-01 17:41:31 +09:30
Andrew Bettison
7993332fe9 Omit 32-bit architectures when building for iOS 11 and later 2018-06-01 17:41:31 +09:30
Andrew Bettison
20c15e8b94 Pass -isysroot flag to C and Swift XCode compilers
Fixes a bug that appeared in XCode 9.3, that wrapping clang and swiftc
with the xcrun(1) command no longer sets the #include root directory, so
compiling for iOS failed because it was using Mac OS header files.
2018-06-01 17:41:31 +09:30
Andrew Bettison
e6e1a4b0a2 Upgrade to Swift 4.1 (Xcode 9.3) 2018-06-01 17:41:31 +09:30
Andrew Bettison
f91033820b Use explicit serverMode enum values everywhere 2018-06-01 17:40:09 +09:30
Andrew Bettison
bbe7a87904 Add comments and assertions to server.h and server.c 2018-06-01 10:13:01 +09:30
Andrew Bettison
b8ddad6ff2 Move Rhizome function declaration from server.h to rhizome.h and rename 2018-06-01 10:13:01 +09:30
Jeremy Lakeman
659d726687 Correctly encode rhizome list query parameters 2018-05-28 17:18:21 +09:30
Jeremy Lakeman
9522575417 Use predefined constants for comparing out of range integer values 2018-05-28 11:06:35 +09:30
Jeremy Lakeman
b1fdf380f9 Throw a different exception type for unexpected http status codes 2018-05-23 10:50:09 +09:30
Jeremy Lakeman
0c5a84c305 Fallback to streaming bytes when rename() fails due to crossing filesystems 2018-05-22 16:05:27 +09:30
Andrew Bettison
1520b614f2 Specify Apple Mac OS build dependencies in more detail (fixes #127)
Specifically, need to install libtool from Homebrew; the libtool that
comes with Apple Xcode is insufficient.
2018-05-18 14:19:02 +09:30
Andrew Bettison
9e89a6ddcf Fix response of PUT /restful/keyring/SID/lock (fixes #139)
To be consistent with documentation, the response must contain the
details of the locked identity.  Added relevant assertions to the
lock/unlock test case.
2018-05-17 11:39:37 +09:30
Andrew Bettison
1b2147074f Add more assertions to keyring functions 2018-05-17 11:21:41 +09:30
Andrew Bettison
90e338f239 Fix compile error introduced in c2103e3 (fixes #138) 2018-05-17 11:21:28 +09:30
Jeremy Lakeman
d02bf3b7b9 Don't release keyring entries just because a user requested them (Fixes #137) 2018-05-16 11:47:02 +09:30
Jeremy Lakeman
c2103e3b86 Add MDP_INTERFACE_PEER for external unicast peer discovery to trigger a probe 2018-05-15 11:20:15 +09:30
Jeremy Lakeman
0043e20b81 Keep rhizome sync state for up to 5s while routes flap 2018-05-14 16:05:44 +09:30
Andrew Bettison
98fa034c53 Fix use of va_copy() in logging functions 2018-05-07 23:31:15 +09:30
Andrew Bettison
b8b31ed97a Remove duplicate log.h definition in headerfiles.mk 2018-04-30 21:18:15 +09:30
Andrew Bettison
11e7874fff Improve get_self_executable_path() on Mac OS 2018-04-30 21:18:15 +09:30
Andrew Bettison
0dea727b69 Fix calls to deprecated String.substring() method 2018-04-30 21:18:15 +09:30
Andrew Bettison
7ab9bc0a10 Replace netcat6 with OpenBSD netcat
Netcat6 has been discontinued in favour of OpenBSD netcat.
2018-04-27 17:29:02 +09:30
Andrew Bettison
d1203827e1 Move nibble_tree.c into client library
Needed by test_cli.c
2018-04-24 13:03:50 +09:30
Jeremy Lakeman
2f57fe3a47 Fix msp tests to use unused file descriptor 2018-04-24 12:53:56 +09:30
Jeremy Lakeman
abdb6867cd Restore the ability for test verbose logging to write directly to the console 2018-04-23 13:35:31 +09:30
Andrew Bettison
f2e8198dba Fix tests broken by new Rhizome store directory
The recent faa0f39 did not update these tests that look in the "blob"
subdirectory.
2018-04-23 13:26:11 +09:30
Andrew Bettison
199dc55b27 Fix broken link in tech doc 2018-04-23 08:13:49 +09:30
Paul Gardner-Stephen
ffeb25aa67 remove C99-ism 2018-04-18 16:45:51 +09:30
Paul Gardner-Stephen
504302aea1 pass exec_prefix to libsodium recursed make 2018-04-18 16:45:51 +09:30
Andrew Bettison
faa0f392c5 Improve Rhizome DB path configuration
Change the default 'rhizome.datastore_path' to "rhizome", ie, a sub-
directory of the instance directory.

Add a new erename() operation to "os.h".

Clean up the code around the fix 39f582cca (two commits ago) for a bug
introduced in 2014: the 'rhizome.db' file was always being created in
the instance directory, regardless of the setting of the
'rhizome.datastore_path' config option.

Whenever the Rhizome database is opened (by the server or by a CLI
invocation), if the database file does not exist but there is a
'rhizome.db' file in the legacy location, then move that file (and any
accompanying "blob" and "hash" sub-directories) to the configured
location.

Update copyright notices.
2018-04-17 12:01:02 +09:30
Jeremy Lakeman
9ba27b28a0 Possible race condition in command cleanup due to linking order, (Fixes #136) 2018-04-16 09:36:17 +09:30
Jeremy Lakeman
39f582ccab Auto move rhizome store when config is first set 2018-04-10 16:50:09 +09:30
Jeremy Lakeman
5e0e59e8b8 Fix tests/rhizomeall 2018-04-10 10:52:44 +09:30