Commit Graph

302 Commits

Author SHA1 Message Date
Jeremy Lakeman
b048e8874f Reschedule alarm when tick_ms config changed 2015-03-23 13:35:22 +10:30
Jeremy Lakeman
f7dbe06836 Rearrange interface config to support unicast settings 2015-03-23 13:35:22 +10: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
7248d660e3 Fix non-deterministic assertion failure under load 2014-11-12 23:09:00 +10:30
gardners
6dca9fe6bf ensure netmask is set when initialising an interface. 2014-10-31 15:01:22 +10:30
gardners
6536953703 add debug output to diagnose interface selection based on
received address of packet.
2014-10-31 12:26:58 +10:30
Jeremy Lakeman
a37db8e958 Move most console commands to other files 2014-08-25 16:03:30 +09:30
Jeremy Lakeman
537a09812c Ignore some types of sendto errors 2014-06-27 12:45:53 +09:30
Jeremy Lakeman
f4e6841ed7 Ensure directory service tests aren't creating a global routing table 2014-06-16 17:22:46 +09:30
Jeremy Lakeman
dabd482ad8 Only send broadcast ticks every 5 seconds when we have no neighbours 2014-06-13 15:34:47 +09:30
Jeremy Lakeman
628a52ca87 Add monitor message for interface up/down events 2014-06-13 13:34:10 +09:30
Jeremy Lakeman
e5e848e838 Ensure interface and routing alarms stop when network interfaces are all down 2014-06-12 16:04:15 +09:30
Jeremy Lakeman
f93fba11af Stop polling interfaces if no phsical interfaces are enabled 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
7420f46653 Create new AF_UNIX based network simulator 2014-05-23 10:47:22 +09:30
Andrew Bettison
6371203703 Finish removing SLIP code and test case
More simplification of "serval.h"
2014-04-07 16:22:31 +09:30
Andrew Bettison
1f49ee47ae Add missing copyright messages 2014-04-07 14:39:21 +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
2e4835d7d6 Ensure tests with packet filtering are using the dummy network interface 2014-03-12 14:32:59 +10:30
Jeremy Lakeman
7081e7044f Ensure AF_UNIX DGRAM sockets don't block during tests 2014-03-03 14:06:31 -08:00
Jeremy Lakeman
880117f6db Reduce peak bandwidth usage (though we really need a dynamic limit) 2014-03-01 05:28:54 +10:30
Jeremy Lakeman
b8971e51f4 Refactor socket helper functions to take socket_address struct 2014-02-20 14:44:38 +10:30
Jeremy Lakeman
04955f1ddd Fix interface name comparison for detecting real interfaces 2014-01-20 16:01:29 +10:30
Jeremy Lakeman
4bb3336b33 Generalise method for defining multiple interfaces 2014-01-09 15:01:38 +10:30
Jeremy Lakeman
60a2aaa547 Ensure only interfaces that are UP are closed 2014-01-09 15:01:38 +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
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
5d741361ea Fix -Wsign-compare warnings: make loop counters unsigned 2013-12-10 16:21:23 +10:30
Andrew Bettison
f79e6f703a Fix WHYF_perror() format string error 2013-12-10 10:38:03 +10:30
Andrew Bettison
30b2059608 Fix -Wunused-parameter warnings
New UNUSED(param) macro suppresses the warning for a specific parameter

In some cases, removed the unused parameters.  In others, used the
parameter in a DEBUGF() or assert() statement to document the intent.
2013-12-09 18:22:18 +10:30
Andrew Bettison
8db5f9c14a Merge branch 'anyservice' into 'development'
Allows any valid "service" manifest field in the "rhizome add file"
command

Many improvements in Rhizome manifest parsing; stricter manifest syntax
rules (no comment or blank lines, field names must be alphanumeric
identifiers), faster preliminary manifest inspection when receiving
manifest advertisements or syncing manifests

The 'development' branch introduces "struct socket_address" which
coincidentally fixed the recently encountered Linux kernel 3.12
recvmsg(2) EINVAL problem, so that 'rhizomeprotocol' tests which fail on
the 'anyservice' branch will pass after this merge
2013-12-01 05:44:01 +10:30
Andrew Bettison
72482b3427 Better error logging for recvwithttl() 2013-12-01 05:13:33 +10:30
Andrew Bettison
dafa1fc186 Improve struct socket_address
Add struct sockaddr_in 'inet' union field, rename 'addr_un' union field
to 'local'

Replace recvwithttl()'s (struct sockaddr *) and socklen_t pair of args
with single (struct socket_address *) arg
2013-11-29 12:56:59 +10:30
Jeremy Lakeman
d45470ce81 Refactor radio link for better encapsulation 2013-11-27 13:13:08 +10:30
Jeremy Lakeman
cd639ba3b6 Use constants instead of magic numbers 2013-11-27 13:12:25 +10:30
Jeremy Lakeman
ad33264834 Rename mavlink to radio_link
- split link state from slip structures and encapsulate it completely
- allocate interface specific buffers on demand
2013-11-27 13:09:26 +10:30
Andrew Bettison
fb39dd84ef Improve dummy file Read/Write debug logging 2013-11-26 15:33:54 +10:30
Andrew Bettison
45450386db Improve sendto(2) failure diagnostics
In MDP client and server MDP overlay code
2013-11-22 13:12:29 +10:30
Andrew Bettison
3805650736 Use ssize_t for sendto(2) return value, not int
Also improve error checking on ssize_t values (use ==-1 not <0) test
and cast ssize_t to size_t for comparisons
2013-11-22 11:55:09 +10:30
Andrew Bettison
e92e7cb65e Improve sendto(2) error log messages 2013-11-22 11:55:09 +10:30
Andrew Bettison
ba0ab14c69 Clean up inclusion of <netinet/in.h>
Make all #include <netinet/in.h> conditional upon HAVE_NETINET_IN_H

Remove unnecessary #include <netinet/in.h> from source files

Reformat include block in "serval.h" for readability
2013-11-12 11:39:06 +10:30
Jeremy Lakeman
60e3f5a3fc Fix printf formats for 64bit compilation 2013-10-09 10:31:52 +10:30
Andrew Bettison
c9f9025581 Fix intermittent 'routing' test failures
Caused by tests running so slowly that nodes become unreachable due to
timeout before the assertion of reachability is made.  The timeout was
hard coded at five times the tick interval (2.5 seconds).

Introduced new config options: mdp.iftype.*.reachable_timeout_ms and
interface.*.mdp.reachable_timeout_ms to allow the timeout to be
configured.  Configure the timeout to 60 seconds in 'routing' tests.

Changed the config schema to move options interfaces.*.mdp_tick_ms and
interfaces.*.packet_interval into interfaces.*.mdp.tick_ms and
interfaces.*.mdp.packet_interval (introduced new sub-struct 'mdp').
2013-10-08 16:36:07 +10:30
Andrew Bettison
9ba08e465f Issue #11: use socklen_t instead of int where appropriate
Also check for valid recvaddrlen before processing a received MDP packet.
2013-10-08 14:11:00 +10:30
Andrew Bettison
ffafae86b1 Issue #11: replace long long with int64_t 2013-10-07 05:54:46 +10:30
Jeremy Lakeman
08b44e96ed Improve html debug statistics
- shift radio rssi onto interace structure
- track packets sent received
- create html output for interface stats
- create html output for link state routing stats
2013-09-23 11:31:38 +09:30
Jeremy Lakeman
e3a5e8c353 Use heartbeat packets to control serial buffering
- Improve simulation of fakeradio
- Backtrack on partial RS errors in case of truncation / heartbeat insertion
2013-09-20 14:41:50 +09:30
Jeremy Lakeman
4b9817218d Improve mavlink packet synchronisation
- backtrack when decoding fails
- assume locally built heartbeats may split a valid remote packet
2013-09-20 14:41:50 +09:30
Jeremy Lakeman
f7bffbfabe Simplify packet debug logging 2013-09-20 14:41:50 +09:30