Commit Graph

98 Commits

Author SHA1 Message Date
Jeremy Lakeman
b94378ae97 Remove unused debug flags 2014-05-26 14:01:34 +09: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
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
a95ef79139 Use sid_t everywhere
Remove stowSid() at last

Change API of tohex() and strbuf_tohex(), to pass string length instead of
binary byte count.  This allows odd numbers of hex digits to be produced.

Remove alloca_tohex_sid(); replace with alloca_tohex_sid_t()

New alloca_tohex_sid_t_trunc() macro
2013-10-09 18:54:21 +10:30
Andrew Bettison
8970c4ece7 Improved debug to help diagnose MDP failures on Android 2013-10-07 04:47:13 +10:30
Jeremy Lakeman
8935db4184 Only ack soon if we have been asked to 2013-08-30 17:38:29 +09:30
Jeremy Lakeman
81afc42d8b Major refactor to packet queuing and delivery in preparation for unicast link tracking.
Unicast tests broken
2013-08-09 09:37:08 +09:30
Jeremy Lakeman
d47d1b1684 Split network destination structure from interface structure 2013-08-05 14:35:49 +09:30
Jeremy Lakeman
a73814571d Only send one packet per alarm with single encapsulation 2013-07-15 15:29:14 +09:30
Jeremy Lakeman
d3a13f8d2c Fix stupid bug, test was backwards 2013-06-03 16:04:08 +09:30
Jeremy Lakeman
8ab5073869 Adjust packet format for better duplicate detection 2013-05-29 11:58:05 +09:30
Jeremy Lakeman
0966840f4e Log decision when duplicates are processed 2013-05-29 11:58:05 +09:30
Jeremy Lakeman
02be4c2979 Add support for retransmitting broadcast mdp packets 2013-05-29 11:58:05 +09:30
Jeremy Lakeman
5b4e4919cf Mark resent packets so they can be dropped 2013-05-29 11:58:05 +09:30
Jeremy Lakeman
f405ba5337 Send sequence number on all broadcast frames 2013-05-03 16:23:23 +09:30
Andrew Bettison
8771a50b14 Fix TTL out-of-range bug
Was causing two routing tests to fail since the TTL decrement
logic was fixed in a8b88a46

The default TTL of 64 overflowed the 5-bit unsigned int in the MDP
packet header
2013-04-23 16:02:39 +09:30
Jeremy Lakeman
6d9bbe2e2c Refactor interface handling to separate encapsulation from stream type 2013-02-20 15:36:23 +10:30
Jeremy Lakeman
c7caec488a Don't aggregate packets together on radio links 2013-02-20 15:36:23 +10:30
Jeremy Lakeman
9a78e16625 Use payload queue for periodic route advertisements 2012-12-19 12:36:28 +10:30
Andrew Bettison
5985df751d Overhaul debug flags
Replace debugflags_t and DEBUG_XXX bit masks with config schema "debug.xxx"
entries.

No more support for "debug.all".
2012-12-11 15:59:46 +10:30
Jeremy Lakeman
a67e4114a8 Allow for payloads with a pre-determined destination 2012-12-03 13:44:31 +10:30
Jeremy Lakeman
d5f78bcffe Rework reachable link flags for simpler bitmask tests 2012-11-30 14:38:09 +10:30
Jeremy Lakeman
dee3367308 Reduce byte count for mdp payloads by excluding overlay type 2012-11-28 15:44:40 +10:30
Jeremy Lakeman
24a3ed1469 Simplify address abbreviation format and interface 2012-11-28 15:44:39 +10:30
Jeremy Lakeman
f13db5405e New payload header format 2012-11-28 15:43:59 +10:30
Jeremy Lakeman
627e86fb73 Shift all payload header writing to one place 2012-11-28 15:43:58 +10:30
Jeremy Lakeman
f159e15901 Simplify payload length storage 2012-11-28 15:43:57 +10:30
Jeremy Lakeman
ce63e96db2 Use decode structure for tracking previous sid 2012-11-28 15:43:57 +10:30
Jeremy Lakeman
3d14e2f3db Hide more information about packet headers 2012-11-28 15:43:56 +10:30
Jeremy Lakeman
4ca6db34d6 Encapsulate payload header details 2012-11-28 15:40:39 +10:30
Jeremy Lakeman
36cee7e9bc Move payload queueing functions to separate .c file 2012-11-21 11:02:00 +10:30
Andrew Bettison
4450116472 Refactor string functions, add str_fromprint()
Move lots of non-Serval-specific string functions from "serval.h"/dataformats.c
to "str.h"/str.c.

Add str_fromprint() function that reverses the effect of toprint(): interprets
escape sequences in the source string "\n\t\r\0\xHH\\" and replaces them with a
single char in the destination string.
2012-11-07 16:42:45 +10:30
Paul Gardner-Stephen
dd3a5ae62d Fix compile errors and some warnings on solaris. 2012-10-15 15:36:36 +10:30
Jeremy Lakeman
b22e3f1964 Add hop count to mdp ping
- Allow mdp client to specify ttl
- Copy ttl into and out of overlay frame
2012-10-10 16:22:31 +10:30
Jeremy Lakeman
1f379ea209 Add and preserve QOS bit flags in packet header 2012-10-09 16:17:07 +10:30
Jeremy Lakeman
e28deeb6d5 Move requested payload queue into frame structure 2012-10-09 15:44:37 +10:30
Andrew Bettison
89343c69cd Merge branch 'rhizomedirect' into 'master' 2012-10-05 17:45:30 +09:30
Jeremy Lakeman
66e0711d6b Only send one audio block per packet, but request that it be sent multiple times
If we receive a large buffer of audio, we want to stuff the packet with multiple frames and send them together.
And we want to send redundant copies of the audio to help recover from packet loss.
But if all our redundant copies end up in the same packet, we're screwed anyway.

This is a temporary hack until the network layer implements NACK / retry for resilient multi-hop delivery
2012-09-28 15:23:49 +09:30
Jeremy Lakeman
2a7bd28e51 Extend packet queue to allow sending multiple copies of the same payload for reliability 2012-09-28 11:28:01 +09:30
Jeremy Lakeman
b7c088f2fd Reduce latency of dummy interface, improve some debug messages 2012-09-20 10:28:02 +09:30
Jeremy Lakeman
5914bc92ce Use a directory service as a default route 2012-09-19 09:50:29 +09:30
Jeremy Lakeman
6b64f0cded Fix segfault with debug.tx 2012-09-07 12:10:48 +09:30
Jeremy Lakeman
3b55643b08 Send my full sid periodically for any outgoing payload header 2012-09-07 10:01:34 +09:30
Paul Gardner-Stephen
bba6839656 Initial stab at porting to Solaris.
It compiles without warning (with CC=gcc) but doesn't link
because NaCL doesn't build yet.
2012-09-05 20:42:50 +09:30
Jeremy Lakeman
545c05fddb Relay broadcast payloads via olsr plugin 2012-09-01 12:41:50 +09:30
Jeremy Lakeman
1b91724da2 Allow for interfaces that don't tick, pack rhizome manifests into all packets 2012-09-01 12:18:39 +09:30
Jeremy Lakeman
e05806f25e Separate routing calculation from resulting rules, refactor more code to use subscriber structure 2012-08-31 15:11:18 +09:30
Jeremy Lakeman
f6c899e107 Refactor overlay buffer interface to support simple parsing 2012-08-31 15:03:07 +09:30
Jeremy Lakeman
22c6b530ed Rework broadcast address handling, working towards a unified address struct 2012-08-31 15:03:07 +09:30
Jeremy Lakeman
aa5706f9d7 Refactor routing node information to use new subscriber tree 2012-08-31 15:03:07 +09:30