Commit Graph

76 Commits

Author SHA1 Message Date
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
851dbb4d64 Add 'debug.subscriber' config option
Add debug logging to find_subscriber() function
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
29fab6dcb7 Add 'rhizome.api.restful.newsince_poll_ms' config option 2013-11-20 14:50:57 +10:30
Andrew Bettison
fce0893173 Implement HTTP /restful/rhizome/newsince/.../bundlelist.json
Now functions as per requirements, blocks for 60 seconds sending
new bundles as they appear, sends new token with each new bundle.
Tested manually.
2013-11-19 15:43:51 +10:30
Andrew Bettison
bacba19dc1 Refactor manifest: specific setter functions
Replace generic rhizome_manifest_set() and rhizome_manifest_set_ll()
with per-field setter functions, eg, rhizome_manifest_set_filesize().
Struct rhizome_manifest elements for all known fields, to replace the
use of rhizome_manifest_get() and rhizome_manifest_get_ll() everywhere:
sender, recipient, service, name, date, bundle_key.

Add boolean validity flags for binary blob types, to avoid having to compare
with many bytes of all-zero to detect presence, eg, has_sender, has_recipient,
has_author, has_bundle_key.  These maintained by the setter functions.

Rename existing manifest struct elements to be the same as their field
names: fileLength -> filesize, journalTail -> tail.

More use of unsigned int, size_t and uint64_t for payload sizes, offsets, byte
counts, etc. especially in rhizome_store.c and meshms.c.  More uniform use of
size_t to dimension memory buffers.  Fix some printf(3) style format strings
for 64-bit correctness on 32-bit systems.  Use new constant RHIZOME_SIZE_UNSET
instead of -1 to indicate unknown dimension, and explicitly assert its absence
before comparisons and arithmetic, for safety.

Replace some 'int' loop variables with 'unsigned' where appropriate.

Fix bugs discovered in MeshMS bundle private/public key generation and
bundle secret key handling for export/extract commands.

Instrument the first MeshMS test case to aid debugging.

New debug config flag: debug.manifest logs all modifications to all manifest
fields by setter functions.

Rename debug config flag: debug.rhizome_bind -> debug.rhizome_sql_bind.
2013-11-04 19:17:49 +10:30
Andrew Bettison
6488f7ad65 Fix basic bugs in new HTTP server code
All 'rhizomeprotocol' HTTP tests still fail
2013-10-25 17:38:51 +10:30
Andrew Bettison
640a61cbe5 Add 'debug.rhizome_httpd' config option 2013-10-16 11:23:45 +10:30
Andrew Bettison
3d3e900e72 First HTTP RESTful interface tests 2013-10-14 17:46:09 +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
e3f64516d5 Add config option 'debug.rhizome_bind' 2013-10-04 03:46:52 +09:30
Andrew Bettison
c0aa4796a1 Remove MDP and Monitor socket names from config
Now they are fixed names under the instance path: "mdp.socket" and
"monitor.socket".
2013-09-25 16:56:06 +09:30
Jeremy Lakeman
ed21200289 Improve config description 2013-09-20 14:41:35 +09:30
gardners
fa157500b3 Add debug output for mavlink sent and received frames.
debug.interactive_io can be used to pause after sending or receiving a packet.
2013-09-10 15:14:23 +09:30
gardners
33ad9ae0bc Split debugging info related to ACK's and packet retransmissions 2013-09-10 14:53:12 +09:30
gardners
f02e55c443 add 32bit crc to mavlink frames, and reject those that fail. 2013-09-10 14:53:12 +09:30
gardners
7248e01567 Implement flow of mavlink packets over serial connections
Replaces upper-7 bit slip encoding
Solves reliability of reading radio status messages
2013-09-10 13:07:52 +09:30
gardners
0cbebedc77 Add tx throttling for packet radios
avoids missing data due to lack of flow control.
2013-09-10 11:53:38 +09:30
Jeremy Lakeman
44ab51e2ab Don't clean the database for every command line operation by default 2013-08-27 13:44:05 +09:30
gardners
06bb93c88b add extra debug option to trace MDP Rhizome transfer problems. 2013-08-25 21:16:33 +09:30
gardners
9b09021605 add test for falling over to MDP when HTTP rhizome fetching fails. 2013-08-25 16:37:44 +09:30
Jeremy Lakeman
1468d2deb0 Pre-emptively send small payloads via MDP 2013-08-21 09:21:40 +09:30
Jeremy Lakeman
a516af616e Improve reliability
- don't drop packets that haven't been resolved yet on incoming acks
- statistically drop unicast packets during tests
2013-08-12 16:38:37 +09:30
Jeremy Lakeman
ddfb7d9417 First cut of new meshms API, unfinished 2013-07-22 17:55:02 +09:30
Jeremy Lakeman
49e0286b43 Reduce packet header size for point-to-point links
- new interface.x.point_to_point config
- disable local echo for point to point dummy interfaces
- add ME and YOU sid abbreviation codes after learning other sid
2013-07-16 15:38:00 +09:30
Jeremy Lakeman
aa87168d7d Add per-interace dump of sent and received bytes 2013-07-15 15:27:41 +09:30
Jeremy Lakeman
c0b31a2774 Report packet acks, make routing decisions based on dropped packets 2013-05-08 11:37:02 +09:30
gardners
109fe77df9 add new debug option to show packet radio byte stream.
make uartbps default to 57600.
2013-05-07 17:29:11 +09:30
Jeremy Lakeman
85b885dde2 Add basic link state routing 2013-04-26 16:54:01 +09:30
gardners
3e7de24bdf added uartpbs and ctsrts config options to packet radio serial
interface configuration options.
2013-04-26 15:16:51 +09:30
Andrew Bettison
a8b88a462f Fix clang compiler warnings (revealed some bugs) 2013-04-12 17:16:50 +09:30
Andrew Bettison
b826ac1f1b Improve logging: add HINT level, NOWHENCE() macro 2013-04-09 17:23:19 +09:30
Andrew Bettison
ec481e5f0f Rename config option 'log.stderr' to 'log.console'
Because Android <stdio.h> defines 'stderr' as a macro...
2013-04-05 16:55:14 +10:30
Andrew Bettison
f7fc63c452 Improve logging tests, fix failures, add 'log.file.path' config option 2013-04-05 16:23:20 +10:30
Andrew Bettison
a822dca2fa Improve config schema macros and log options
Add STRUCT_ASSIGN macro to config schema

Document STRUCT_DEFAULT and STRUCT_ASSIGN in block comments

Move 'log.file_xxx' options to 'log.file.xxx'
2013-04-05 15:00:54 +10:30
Andrew Bettison
60551df890 Implement configurable log file rotation 2013-04-04 17:52:54 +10:30
Andrew Bettison
2d09ec545e Improve configuration dump to log
Refactor much of the new code in log.c

Add new functions: cf_load_strict() and cf_reload_strict() for use by the
server, which does not want to overwrite its in-memory config at all if there
is any defect in the config file.  However, commands always want to overwrite
the default in-memory config, even with a defective config file, so that
logging has a chance to succeed.

Added `log_format.dump_config` boolean config option
2013-03-29 00:22:08 +10:30
Andrew Bettison
95b0c028f2 Log to file, Android and stderr simultaneously
Indepent configuration of show_pid, show_time and log level for each
destination

Update test scripts for new config options

Include xprintf.c in MDP client source files (now used by log.c)
2013-03-27 16:17:38 +10:30
Andrew Bettison
d3d6fa4547 Add log format config options for file and stderr
Upgrade configuration schema macros to allow optional "default label"
argument to SUB_STRUCT and VALUE_SUB_STRUCT elements.

New STRUCT_DEFAULT section declares alternative STRUCT default values
with a label.
2013-03-26 16:11:31 +10:30
Andrew Bettison
c9f9ef5ed4 New config type: bool_t (char)
Replace 'int_boolean' and 'char_boolean' representations with 'boolean'.

Clean up spacing and column alignment in conf_schema.h
2013-03-05 12:35:30 +10:30
Jeremy Lakeman
4cdd3da77f Add config option to disable fetching via rhizome 2013-03-05 10:56:20 +10:30
Andrew Bettison
54ce857cff Improve config schema declaration
Remove array key SORTED flag; all arrays are now sorted by key

Use representation's comparison function for sorting arrays, not
a schema-supplied comparison function.
2013-03-01 15:27:28 +10:30
Andrew Bettison
5939aa9edc Add config cf_cmp_ functions 2013-02-27 18:11:18 +10:30
Andrew Bettison
4648f5096a Fix some config schema declarations
Replace 'int' representation with 'uint32_nonneg', so that default value
of -1 is out of reach of parser.
2013-02-27 16:30:23 +10:30
Andrew Bettison
6eb08ae805 Add new "config dump" command - not working yet
Add cf_fmt_xxx() functions for converting configuration structs into a
config object model tree.
2013-02-26 18:09:08 +10:30
Andrew Bettison
14ce5af688 Refactor configuration schema code
Replace 'parsefunc' (cf_opt_foo) function arguments in schema
declarations with 'repr' (foo) names, which are used to declare
cf_opt_foo and cf_fmt_foo.
2013-02-25 17:23:44 +10:30
Jeremy Lakeman
90386ce1b1 Merge remote-tracking branch 'origin/development' into serial
Conflicts:
	rhizome.h
	rhizome_database.c
	rhizome_fetch.c
	rhizome_store.c
2013-02-20 17:23:03 +10:30
gardners
944486c048 simplify external/internal blob storage to a boolean flag instead
of a threshold.
2013-02-20 16:18:59 +10:30
gardners
9e9f93b079 make external blob output conditional on debug flag. 2013-02-20 16:18:58 +10:30
gardners
5a3dec28d9 make rhizome over mdp idle timeout configurable at runtime. 2013-02-20 16:18:57 +10:30