Commit Graph

10 Commits

Author SHA1 Message Date
Andrew Bettison
1930c51da4 Minor clean-ups 2018-04-04 12:22:26 +09:30
Jeremy Lakeman
4809d7d585 Link java api into shared library by specifying features 2018-04-03 16:41:10 +09:30
Jeremy Lakeman
d844b0f6bd Reduce coupling with console, dna_helper, monitor & directory_client features 2018-04-03 14:32:06 +09:30
Andrew Bettison
8345d896a6 Add Route REST API (fixes #96)
Consists of a single, one-shot request, GET /restful/route/all.json, for
the time being.  A "newsince" request can be added later.

Add a Markdown tech doc that specifies the new Route REST API and update
the MDP tech doc a little.

Add the 'routerestful' test script, which uses some test utility
fuctions that have been factored out of the 'routing' test script into
the new testdefs_routing.sh.

Add the new 'allrestful' test script.
2018-03-29 15:31:03 +10:30
Jeremy Lakeman
3726fe2f73 Move vomp console feature to test binary 2016-11-21 11:09:27 +10:30
Andrew Bettison
6d2eb268ed Add 'cmd_cleanup' trigger
The new 'cmd_cleanup' trigger replaces the old command_cleanup()
function, which was causing linking problems on OS X and inverted strict
dependency.  The keyring cmd_cleanup calls keyring_free(global_keyring),
instead of merely asserting keyring == NULL, so the error exit cases of
many CLI functions have been simplified.
2016-11-14 11:28:03 +10:30
Jeremy Lakeman
c2956568d6 Send a meshmb message via restful api 2016-10-26 13:08:13 +10:30
Jeremy Lakeman
5fbd6a79ef Add feature for meshmb cli to force linking into deamon 2016-10-20 09:28:08 -04:00
Andrew Bettison
8325aacc5d Fix broken Batphone build
Recent changes such as the Makefile.in overhaul and the introduction of
feature-driven linking broke the Android build.  This commit fixes the
breakage:
- detects the presence of gettid() in configure.ac and only defines
  gettid() in serval.c if HAVE_GETTID is not defined
- builds libserval.so not libservald.so on Android, to avoid a conflict
  on the module name "servald" in Android.mk
- renames cli_cleanup() to command_cleanup(), defines it in
  commandline.h instead of cli.h, and supplies it in android.c
- supplies the 'keyring' global in android.c
- removes log_stderr.c from the Android build, since it conflicted with
  log.c
2016-10-19 09:52:07 +10:30
Andrew Bettison
71cbe86566 Switch to feature-driven linking
This introduces a new way of linking Serval executables and dynamic
libraries from static libraries like libservald.a -- called
"feature-driven" linking.

The Makefile now links servald and serval-tests from libservald.a,
rather than from an explicit list of object (.o) files.  Thanks to the
section-based method for registering functions such as HTTP handlers,
CLI commands and MDP handlers, these object files had become
"stand-alone" and hence were no longer included in the link because
there was no unresolved reference that required them to be linked in.

The new "feature.h" provides the DECLARE_FEATURE(name) macro that each
stand-alone source file uses to declare the named feature(s) it
provides.  Each executable can call the USE_FEATURE(name) macro in any
of its explicitly-linked source files to cause the corresponding
object(s) to be included in the link, eg, servald_features.c.

The DEFINE_BINDING() macro has been extended so that every individual
MDP binding is given a feature name based on its port number macro, eg,
"mdp_binding_MDP_PORT_ECHO".

Some features have been factored into their own separate source files so
they can be omitted or included in a build independently of each other:
- the MDP bindings for MDP_PORT_DNALOOKUP, MDP_PORT_ECHO,
  MDP_PORT_TRACE, MDP_PORT_KEYMAPREQUEST, MDP_PORT_RHIZOME_xxx,
  MDP_PORT_PROBE, MDP_PORT_STUN, MDP_PORT_STUNREQ
- the CLI "log" and "echo" commands
- the CLI "rhizome direct" command

The JNI source files are only compiled if the <jni.h> header is present,
otherwise they are omitted from libservald.so.
2016-10-19 09:33:01 +10:30