Commit Graph

320 Commits

Author SHA1 Message Date
Jeremy Lakeman
231ab257e4 Define internal port bindings with section linking tricks 2016-03-07 15:50:34 +10:30
Jeremy Lakeman
c1947cf774 Add prior hop SID to route print output 2016-03-02 10:51:16 +10:30
Andrew Bettison
c3375d0501 Fix MDP client packet receive bug on OSX
Was failing because recvmsg(2) on OSX does not nul terminate the
pathname of local (AF_UNIX) sockets in the returned sockaddr buffer.
Zerofilling the buffer before calling recvmsg() does the trick.

In the process, improved debug and error logging, replacing
recvwithttl() with recv_message() and recv_message_frag().  The
mdp_net.c source file was retired.
2016-01-19 04:05:46 +10:30
Andrew Bettison
a060642fdb Add strbuf_local_buf() macro 2015-11-02 10:11:41 +10:30
Jeremy Lakeman
298849b25b Add buffer space for MDP MTU & headers for MDP_INTERFACE 2015-07-20 16:48:17 +09:30
Andrew Bettison
7d9a5faa4e Move if(config.debug.xxx) tests into DEBUGF()
Original DEBUG() and DEBUGF() macros renamed to _DEBUG() and _DEBUGF()
New DEBUG() and DEBUGF() macros, first argument is flagname
New DEBUGF2(foo, bar, ...) macro does if(config.debug.foo||config.debug.bar) test
Replace almost all config.debug.xxx references to IF_DEBUG(xxx)
2015-07-13 16:00:05 +09:30
Jeremy Lakeman
e97f7c4e29 Fix vomp stun tests
- Don't trust stun responses about 3rd parties
- Only ack neighbour links via 1hop destinations (not multi-hop routes)
- Don't override network destinations that were manually supplied
2015-06-22 14:50:28 +09:30
Jeremy Lakeman
9658d4527b Don't attempt to retransmit routing link information 2015-06-15 15:35:25 +09:30
Jeremy Lakeman
51ed6162dd Add support for running and stopping servald from a JVM thread
fdpoll will now run a callback when about to sleep / woke up.
A new Java interface to indicate server started / sleeping / waking up.
An android implementation may allow the CPU to sleep.
If there's a java exception the server will try to shutdown.
Calling servald stop is currently undefined.
2015-05-25 11:46:37 +09:30
Jeremy Lakeman
a9b9f51a9f Add support for mdp clients to provide a link layer packet transport 2015-03-02 15:44:34 +10:30
Andrew Bettison
005489ab40 Improve overlay_mdp.c log error messages 2014-11-11 12:57:15 +10:30
Jeremy Lakeman
851144ea0a Refactor keyring identity iteration 2014-10-31 15:19:59 +10:30
Jeremy Lakeman
bcd9575b54 Fix minor compilation issues on CentOS.
- ensure size_t is defined when compiling xprintf.h
- declare overlay_route_record as a union field in overlay_route_record to avoid alignment issues
- set the result of fwrite and fputs
- support slightly older git version
2014-10-20 12:35:21 +10:30
Jeremy Lakeman
7474e8afea Fix mdp support and Java API for binding to all keys in the keyring 2014-09-16 11:22:26 +09:30
Jeremy Lakeman
6aa6aa69eb Immediately register unlocked identities 2014-09-08 11:25:35 +09:30
Jeremy Lakeman
a37db8e958 Move most console commands to other files 2014-08-25 16:03:30 +09:30
Jeremy Lakeman
a9545ea004 Display where packets came from in debug messages 2014-06-26 16:47:23 +09:30
Jeremy Lakeman
afd31fe12c Ensure a race condition while starting servald only starts one process 2014-06-11 09:01:56 +09:30
Jeremy Lakeman
66f266a0c0 Fix OSX specific issues 2014-06-05 14:57:53 +09:30
Jeremy Lakeman
6d4ad0e150 Rework scheduler to allow for lazy but important alarms 2014-06-04 17:13:08 +09:30
Jeremy Lakeman
b6de3fcd34 Only send rhizome sync packets when we have neighbours 2014-05-30 15:03:22 +09:30
Jeremy Lakeman
49e138505a Log mdp errors before replying 2014-05-26 13:57:27 +09:30
Jeremy Lakeman
c361a9cb90 Don't reuse mdp ports that are already bound, release mdp bindings on msp close 2014-05-23 10:38:31 +09:30
Jeremy Lakeman
8db634d2d9 Don't process MDP packets if the local address is invalid 2014-05-12 13:44:50 +09:30
Andrew Bettison
df1814309b Improve MDP filter rules file syntax 2014-05-05 14:45:33 +09:30
Andrew Bettison
ea9de737a2 MDP packet filter rules configuration
Configurable rules file path: mdp.filter_rules_path

Add filter rules parsing code, add filtering to outgoing as well as
incoming packets

New test script: tests/mdp with two test cases

Improve test defs: new execute_servald() function

Widen MDP port number format from 8 to ten chars to accommodate leading
"0x"
2014-04-29 15:31:50 +09:30
Andrew Bettison
8bc746af25 New "config sync" command 2014-04-16 19:28:16 +09:30
Andrew Bettison
53c1b1c04c Filesystem Heirarchy Standard (FHS) paths
If no instance directory specified, then use paths like
/etc/serval/serval.conf
/var/cache/serval
/var/log/serval
/var/run/serval
etc. for files, instead of all in a single directory.

Log all directory creation as INFO messages.

Interpretation of log.file.directory_path has changed slightly.

Updated servald configuration tech doc.
2014-03-26 15:35:43 +10:30
Jeremy Lakeman
a6f408f013 Return mdp inet & http port numbers in servald start & status 2014-02-25 12:42:36 +10:30
Jeremy Lakeman
33cbc98300 Add proc files for http server & mdp udp ports 2014-02-24 17:15:28 +10:30
Jeremy Lakeman
20494a90d5 Add Java MDP Client API
- support mdp clients over loopback UDP
  Note this is using an environment variable to specify the port number
  In future we expect to support environments where this port is already bound
- monitor mdp sockets in a single & separate thread
2014-02-21 16:39:47 +10:30
Jeremy Lakeman
b8971e51f4 Refactor socket helper functions to take socket_address struct 2014-02-20 14:44:38 +10:30
Jeremy Lakeman
b4a48e4cc8 Build filter framework for incoming mdp packets 2014-02-19 16:40:18 +10:30
Jeremy Lakeman
b56f4c27d3 Replace internal usage of overlay_mdp_dispatch 2014-02-19 16:39:42 +10:30
Jeremy Lakeman
2480fb4a08 Migrate keyring sas commands 2014-02-19 16:37:45 +10:30
Jeremy Lakeman
44512280c1 Migrate VoMP & mdp trace 2014-02-19 16:37:09 +10:30
Jeremy Lakeman
6822b58baa Swap to using NOCRYPT / NOSIGN for internal processing 2014-02-19 16:36:34 +10:30
Jeremy Lakeman
63db7b4513 Refactor dna lookup requests to new interface 2014-02-19 16:35:58 +10:30
Jeremy Lakeman
6f75d93460 Shift echo service to new internal api, ensure local services can respond to local clients 2014-02-19 16:34:47 +10:30
Jeremy Lakeman
487df0408d Refactor mdp packet processing to avoid using struct overlay_mdp_frame 2014-02-19 16:34:11 +10:30
Jeremy Lakeman
57b7d74822 Fix comparisons for removing mdp port bindings 2014-01-09 15:06:35 +10:30
Jeremy Lakeman
506518ad06 Allow interfaces to use local unix addresses
- broadcast packets are sent to all sockets in the same folder
- switched most tests to use local sockets
2014-01-09 15:01:38 +10:30
Jeremy Lakeman
5f2c6e364a Refactor interface addresses to use new socket_address struct 2014-01-09 15:01:38 +10:30
Jeremy Lakeman
741442c54c Pipe file contents across msp connection 2014-01-09 15:01:37 +10:30
Jeremy Lakeman
db7f68afd7 Initial msp library implementation with connection state tracking 2014-01-09 15:01:37 +10:30
Jeremy Lakeman
8d80cf55f2 Fix printf formats 2013-12-16 15:19:15 +10:30
Andrew Bettison
6e99a3be47 Fix printf format warning on Android 2013-12-11 14:35:14 +10:30
Andrew Bettison
4428a76379 Use ssize_t for read(2) and write(2) return value
Test for errors using == -1 not < 0, and cast to (size_t) subsequently

Fixes some -Wsign-compare warnings
2013-12-10 17:21:35 +10:30
Andrew Bettison
ebc3133f5c Change overlay_buffer fields from int to size_t
Fixes many -Wsign-compare warnings
2013-12-10 17:03:30 +10:30
Andrew Bettison
476a538ef7 Fix -Wsign-compare warnings in keyring: unsigned cn,in,kp 2013-12-10 16:34:35 +10:30