Commit Graph

2966 Commits

Author SHA1 Message Date
Andrew Bettison
9b64bb87e0 Uniform copyright notices
Added some missing copyright/license block comments
2013-12-04 17:15:36 +10:30
Andrew Bettison
67b79d0390 Add full text of GPL version 2.0 2013-12-04 02:52:31 +10:30
Andrew Bettison
56309886f3 Merge branch 'naf4' into 'development'
Copyright notices added to most source files and headers

New 'config_test' make target

Add RHIZOME_BUNDLE_ID_xxx, deprecate RHIZOME_MANIFEST_ID_xxx

Consolidate Rhizome string functions
2013-12-04 02:09:30 +10:30
Andrew Bettison
a0392878d8 Remove alternative links from README.md
GitHub have fixed the README Markdown rendering on the
repository home page, so alternative links are no longer
needed
2013-12-03 15:18:48 +10:30
Andrew Bettison
41dcafb4f5 Add CONTRIBUTORS.md file, fix alternative links in README.md 2013-12-03 15:05:05 +10:30
Andrew Bettison
bf84c5815f Fix 'make install' target, add 'make uninstall'
Define $(sbindir) and $(exec_prefix)

Define $(INSTALL), $(INSTALL_PROGRAM) and $(INSTALL_DATA)

Use $(RM) instead of rm -f
2013-12-03 14:29:13 +10:30
Andrew Bettison
7aa291802a Merge branch 'install-target' of github.com:petterreinholdtsen/serval-dna into install-target 2013-12-03 11:56:39 +10:30
Andrew Bettison
42ab9aec4c Merge branch 'development' into 'naf4'
Remove two redundant calls to rhizome_retrieve_manifest() in meshms.c,
revealed by an assert() in the stricter manifest parsing code

Fix header files included by socket.h
2013-12-02 17:17:47 +10:30
Andrew Bettison
4f0aa3a41c Improve test framework: include %label in fork log 2013-12-02 16:07:37 +10:30
Andrew Bettison
9953949c6e Improve test framework: forked commands inherit stdin
Remove the subshell parentheses around the command invoked using fork(),
so that the forked command inherits the file descriptors.  This allows
it to be used like "fork some command < input".
2013-12-02 15:56:32 +10:30
Andrew Bettison
2bb0d2047a Enforce valid Rhizome 'service' and 'name' strings 2013-12-02 11:12:31 +10:30
Petter Reinholdtsen
36a2eed016 Merge latest version. Clean up merge conflict. 2013-12-01 00:06:36 +01:00
Petter Reinholdtsen
7c9a964e47 Merge branch 'development' into install-target 2013-12-01 00:00:04 +01:00
Andrew Bettison
6bff87f7e5 Increase 'rhizomeprotocol' test case timeout
The 50% MDP packet loss test case is now likely to take more than 60
seconds to transfer the bundles, probably because of stricter manifest
syntax
2013-12-01 05:49:50 +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
0dd1b302b5 Rewrite Rhizome manifest parsing
Move validation checks into new function rhizome_manifest_validate()

Remove rhizome_manifest 'errors' field

Replace rhizome_manifest 'warnings' with 'malformed'

Replace rhizome_manifest 'manifest_bytes' with 'manifest_body_bytes' and
refactor to use 'manifest_all_bytes' in all manifest i/o

Refactor rhizome_manifest_verify() and reverse sense of return value to
match rhizome_manifest_validate()

New function rhizome_manifest_inspect() -- lightweight manifest parser
used when receiving Rhizome advertisements

New 'rhizomeops' test case for invalid manifest "service" field values,
now passes
2013-12-01 05:13:34 +10:30
Andrew Bettison
5e5e097d7f Accept any well formed Rhizome service field
Do not limit service field to only recognised supported values 'file',
'MeshMS1' and 'MeshMS2'

New test case checks for malformed service field, fails
2013-12-01 05:13:33 +10:30
Andrew Bettison
72482b3427 Better error logging for recvwithttl() 2013-12-01 05:13:33 +10:30
Andrew Bettison
16995f1041 Minor refactor in strn_edup() 2013-12-01 05:13:33 +10:30
Andrew Bettison
1d14f43050 Improve test framework: --timeout option in usage message 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
99d5d9fa1f Refactor dataformats into separate header 2013-11-27 13:11:42 +10:30
Jeremy Lakeman
6dbc623643 Increase mdp timeout based on file size 2013-11-27 13:11:40 +10:30
Jeremy Lakeman
0e6a3cd7cc Use interval parameter correctly even for unlimited pings 2013-11-27 13:11:37 +10:30
Jeremy Lakeman
28fc1da2d2 Encapsulate rhizome fetch logging 2013-11-27 13:10:55 +10:30
Jeremy Lakeman
1681abd620 Increase default mdp timeout & make it configurable 2013-11-27 13:10:11 +10:30
Jeremy Lakeman
62cd8c7555 Log any alarm we call more than 10,000 times a second (probably indicates a bug) 2013-11-27 13:10:10 +10:30
Jeremy Lakeman
844afcff0e Calculate golay parity regardless of CPU endian 2013-11-27 13:10:10 +10:30
Jeremy Lakeman
1b34c2dc13 Improve test reliability 2013-11-27 13:10:09 +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
Jeremy Lakeman
a77642fc9e Support for binding internal handlers to mdp ports 2013-11-27 13:08:43 +10:30
Jeremy Lakeman
0d5d878521 Refactor socket name and address length handling 2013-11-27 13:08:37 +10:30
Jeremy Lakeman
5ea19ab538 Better approximation of TDMA timing 2013-11-27 13:00:02 +10:30
Jeremy Lakeman
bea9d36411 Drop radio packets based on the probability of receiving the header 2013-11-27 13:00:01 +10:30
Jeremy Lakeman
6ec6a6c966 Fix printf formats 2013-11-27 12:59:52 +10:30
Andrew Bettison
46363db257 Format MDP port numbers as 0xXXXXXXXX 2013-11-26 17:44:49 +10:30
Andrew Bettison
e97e3db444 Silence unconditional DEBUG log message 2013-11-26 17:44:25 +10:30
Andrew Bettison
56349b962e Remove bogus ERROR messages from Batphone log
Improve overlay buffer primitives to eliminate bugus logged ERRORs
"ob_makespace() failed" and "could not append payload of N bytes" and
also add buffer overflow checks to more packet construction code.

Fix link state timing logic to eliminate logged ERROR "Alarm `link_send`
tried to schedule a deadline 1343871867115ms ago"

Improve debug logging of some MDP and dummy interface read/write code

Add 'debug.overlaybuffer' and 'debug.subscriber' config options
2013-11-26 15:44:16 +10:30
Andrew Bettison
fb39dd84ef Improve dummy file Read/Write debug logging 2013-11-26 15:33:54 +10:30
Andrew Bettison
39d6c4fc3a strbuf_append_sockaddr_in() 2013-11-26 15:33:54 +10:30
Andrew Bettison
851dbb4d64 Add 'debug.subscriber' config option
Add debug logging to find_subscriber() function
2013-11-26 15:33:54 +10:30
Andrew Bettison
59a6ded10c Update 'dnaprotocol' debug flags 2013-11-26 15:33:54 +10:30
Andrew Bettison
97ce07b76c Improve MDP debug logging 2013-11-26 15:33:54 +10:30
Andrew Bettison
1bb60fd8bc Add 'debug.overlaybuffer' logging
Instrument all ob_xxx() primitives with __whence
2013-11-26 15:33:54 +10:30
Andrew Bettison
e3ceedddf8 Fix link state routing timing logic
Avoid calling schedule() with zero alarm time
2013-11-26 15:33:54 +10:30
Andrew Bettison
a9ccd38adc Improve overlay buffer ob_xxx() primitives
All ob_append_xxx(b,...) functions return void

ob_makespace() returns 1 if successful, 0 if not

Add ob_overrun(b) predicate to check for overrun after any number of
appends
2013-11-26 15:33:54 +10:30
Andrew Bettison
9cdf053320 Fix RETURN macros
Remove trailing semicolon

Fix RETURNNULL(X) -- was not executing X at all
2013-11-25 13:22:40 +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