Commit Graph

142 Commits

Author SHA1 Message Date
Jeremy Lakeman
b35c1aca43 Specify that unicast traffic should use unicast UDP packets 2013-01-29 11:57:13 +11:00
Jeremy Lakeman
82db15db5b Use any packet as a self-announce
Stop sending OF_TYPE_SELFANNOUNCE
Deprecate OF_TYPE_DATA_VOICE
Tweak payload priorities
Don't allow client applications to send high priority payloads
2012-12-16 10:09:29 +10:30
Jeremy Lakeman
f41830ebfb Add interface and sequence flags to packet format 2012-12-14 17:07:27 +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
25ed16178b Probe unicast links created from incoming packets 2012-12-10 14:05:56 +10:30
Jeremy Lakeman
ce48ca97b0 Validate abbreviation length 2012-12-06 12:21:40 +10:30
Jeremy Lakeman
383cc2371d Record packet timing info 2012-12-05 15:36:46 +10:30
Jeremy Lakeman
5c7eb4a594 Add unicast probe packets
Probe directory service instead of assuming that it is always reachable
Fix directory service and routing tests
2012-12-04 14:47:57 +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
a978e9ae22 Add place holder for packet sequence numbers 2012-11-28 15:45:14 +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
54f9d9b0e0 Rely on please explain, don't send too many full sids 2012-11-28 15:44:39 +10:30
Jeremy Lakeman
aeaeac8a79 No broadcast id required for single hop 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
a358d924d7 Remove type flag bits 2012-11-28 15:43:57 +10:30
Jeremy Lakeman
46158fea7e Remove obsolete constants 2012-11-28 15:43:57 +10:30
Jeremy Lakeman
a84022bc24 Change header to include sender id 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
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
Jeremy Lakeman
3ab474be16 Always update unicast addresses 2012-10-19 10:40:02 +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
Jeremy Lakeman
275aa49903 Change route announcement format, add please explain support 2012-10-09 12:57:11 +10:30
Andrew Bettison
89343c69cd Merge branch 'rhizomedirect' into 'master' 2012-10-05 17:45:30 +09:30
Andrew Bettison
ca6d8f487d Fix broken 'rhizomeprotocol' tests on Solaris 2012-09-27 15:14:43 +09:30
Jeremy Lakeman
b7c088f2fd Reduce latency of dummy interface, improve some debug messages 2012-09-20 10:28:02 +09:30
Jeremy Lakeman
ac00c06a18 Improve reliability of tests with dummy interface 2012-09-20 10:28:01 +09:30
Jeremy Lakeman
dc8a453b7f Add please explain message
- non-tick packets now include a poorly formed SELF_ANNOUNCE to correctly identify every packet sender
2012-09-20 10:28:01 +09:30
Jeremy Lakeman
ee4e05109f Improvements to dummy interfaces
- separate folder configuration
- allow for tickless dummy interface
- allow for "unicast" peer discovery (though there's no packet filtering)
2012-09-19 09:52:14 +09:30
Jeremy Lakeman
a73b9ee7f7 Update unicast addresses if they change 2012-09-14 11:42:58 +09:30
Jeremy Lakeman
3dba4633b7 Fix port endian order 2012-09-07 13:38:06 +09:30
Jeremy Lakeman
3b55643b08 Send my full sid periodically for any outgoing payload header 2012-09-07 10:01:34 +09:30
Jeremy Lakeman
f9287149dd Setup unicast return address when receiving unicast packet 2012-09-06 15:21:31 +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
Andrew Bettison
12d8bc0c12 Use new typedef time_ms_t everywhere 2012-08-09 12:14:32 +09:30
Andrew Bettison
ac12eac5bc Remove a line of redundant log debug 2012-07-31 17:49:00 +09:30
Andrew Bettison
24b05eaeaa Fix bug in self-announcements
On first tick, do not send s1 = 0, but s1 = s2 - 1 (1 ms window)
2012-07-31 16:21:29 +09:30
Andrew Bettison
240be25793 Replace overlay_gettime_ms() with gettime_ms() 2012-07-30 17:22:38 +09:30
Jeremy Lakeman
7678ce8915 Read packed payloads directly from the received buffer 2012-07-18 14:54:23 +09:30
Jeremy Lakeman
ddba8033e4 Refactor packet envelope and sid abbreviation reading and writing 2012-07-17 15:30:50 +09:30
Jeremy Lakeman
d36ba78afe Refactor packet construction and sending 2012-07-13 12:18:50 +09:30
Jeremy Lakeman
e9566de0af Fix payload length fields 2012-07-13 12:18:49 +09:30
Jeremy Lakeman
35b4ba8594 Schedule interface ticks per interface 2012-07-13 12:13:46 +09:30
Andrew Bettison
2c87039307 Replace overlay_render_sid() with alloca_tohex_sid()
To eliminate timebomb bugs caused by rotor wraparound
2012-07-03 17:59:30 +09:30
Andrew Bettison
78a8aaca16 Code improvements while debugging 'dnaprotocol' tests
Use ssize_t and size_t where required by system calls
More stringent checking of errors from system calls
Log the offset when writing to dummy interface file
Clean up many WHY/INFO/DEBUG statements
Convert many fprintf(stderr,...) to DEBUGF()
2012-07-03 15:36:51 +09:30
Andrew Bettison
8020ea3b74 Merge branch 'eventscheduler' into master
Conflicts:
	commandline.c
	monitor.c
	overlay.c
	overlay_interface.c
	overlay_packetformats.c
	rhizome_fetch.c
	rhizome_http.c
	rhizome_packetformats.c
	serval.h
	server.c
	testdefs.sh
	testframework.sh
	tests/dnaprotocol
	tests/server
2012-07-03 10:26:22 +09:30
Andrew Bettison
0a667a374e Fix bug in self-announce full/prefix logic 2012-07-02 16:06:38 +09:30
Jeremy Lakeman
89566e4d3d Refactor how functions are scheduled or file handes are watched 2012-07-02 13:19:54 +09:30
Andrew Bettison
7307c991a2 Add mdp.selfannounce.ticks_per_full_address config option 2012-06-28 18:20:38 +09:30
Andrew Bettison
4764cf2ace Get rid of fprintf(stderr,...) in overlay_packetformats.c 2012-06-25 17:04:03 +09:30
gardners
9565f0885f adjust debug output. 2012-06-25 15:46:54 +09:30
Andrew Bettison
881576212c Fix all trivial compiler warnings 2012-05-10 18:08:59 +09:30
gardners
cdb8c702bd fix nasty overlay_abbreviation error when sending self-announcements. 2012-04-30 05:57:30 +09:30
gardners
d726183808 cleaned up debug output. 2012-04-29 12:01:56 +09:30
gardners
c9863fe11e lots of fixes to get overlay mesh routing working on linux with
real network interfaces and no dummy interfaces.  neighbour discovery
now seems to work.
2012-04-29 11:56:47 +09:30
gardners
e7e8b2d630 fixed bug in RFS size patching.
A lot of debug output tweaks to track the problem down.
2012-04-16 06:06:43 +09:30
gardners
cad00beb5b Fix for identity enquiry frame type. 2012-04-03 09:22:58 +09:30
gardners
1eb4c34015 Renamed mphlr.h to serval.h
(also some temporary debugging has been added in some places)
2012-02-23 12:45:42 +10:30
gardners
5cc6079c0f Move from recvfrom() to recvmsg() so that we can get packet TTLs on
reception.  Other changes associated with overlay mesh.
2012-02-05 16:15:19 +10:30
gardners
bf9f8559f1 Various debug fiddles and conversion from select() to poll()
(although poll() still doesn't let us monitor ordinary files
which is silly.)
2012-01-12 16:47:24 +10:30
gardners
0b73df19c8 Fixed bug with handling of OA_CODE_SELF intepretation. 2012-01-11 07:16:22 +10:30
gardners
f8eea651b5 Changed broadcast address to include a 64bit BPI to allow filtering
of duplicate broadcast announcements.
2012-01-10 21:56:07 +10:30
gardners
44c0765981 Various debugging code cleanups.
Fixed some address resolution bugs (for when sender address is not
fully known).
There is still a bug in dequeuing packets though it seems.
2012-01-10 17:21:26 +10:30
gardners
800f8d41eb Revamped debug/verbosity control to use flags for functions of interest
instead of general verbosity ramp.
2012-01-10 15:56:40 +10:30
gardners
9156a68c7f Added 2nd implementation of serval packet decoder for aiding debugging
of packet formation and decoding.
Fixed time calculation bug (duplicate time functions based off different
epochs).
Various debugging fiddles and tweaks.
2012-01-10 14:05:26 +10:30
gardners
0868e30caa Fixed issues with recognition of valid packet formats. 2012-01-09 04:30:23 +10:30
gardners
16fb3a3f61 Added missing GPL license statements. 2011-12-21 20:25:05 +10:30
gardners
abf626a5c5 Fixed return code of packetOkOverlay(). 2011-09-13 05:52:53 +09:30
gardners
8aa57edee3 Added code to add node advertisements to interface tick packets.
Looks like it works.  No code to decode it yet.
2011-09-13 04:52:52 +09:30
gardners
144f3ee4b1 Thinned out debug messages and fixed SID generation bug to make sure
that it always generates a valid SID, i.e., not beginning with 0.
2011-09-07 21:50:20 +09:30
gardners
78e3bfc4a3 Finally looks like selfacknowledgement acks get sent and can be
decoded.  Now to actually use them ...
2011-09-07 13:09:54 +09:30
gardners
b6ce25ab24 Believe I have found and stemmed the memory corruption bug, although
the trigger (poor packet header decoding/address extraction) remains.
2011-09-07 11:26:26 +09:30
gardners
cbb1939241 Fixed various compiler warnings.
Change overlay_frame payload to use an overlay_buffer structure for
consistency and ease of payload construction.
Added some sanity checking to peer score calculation.
Getting closer to being able to TX acks to selfannouncements.
Other little things to accomplish these.
2011-09-05 12:19:53 +09:30
gardners
1d6d744067 More work towards overlay mesh.
Added single byte append to overlay_buffer type.
Added source interface to self-announce packets.
Probably other stuff, too.
2011-09-04 06:36:39 +09:30
gardners
6cec2207e1 Implemented secure address hashing function.
Fixed some bugs.
Added code to record observations.
2011-08-20 21:28:25 +09:30
gardners
857bf9c11e All interfaces now use a common synchronised tick-clock so that we can
more easily keep track of node reachability.
2011-08-20 19:06:15 +09:30
gardners
b075b51c43 Merged overlay_payload and overlay_frame structures to just overlay_frame
which is now used for both encapsulation and decapsulation.
Improved payload length encoding scheme to be shorter for most payload
lengths.
selfannouncement frames now get directed to stub functions for
implementation.
2011-08-17 10:52:17 +09:30
gardners
62a7a65fd6 More work on parsing overlay frames. Now has bare bones to think about
forwarding frames. routing is still not implemented, so it doesn't do anything yet,
but it does try.
2011-08-15 16:22:29 +02:00
gardners
bd16fbbf5b Address lookup from cache works :)
This gets us a functional system once we add the code to send PLEASEEXPLAIN
messages to request resolutions.
2011-08-15 13:50:30 +02:00
gardners
02bf80246e Fixed bugs with overlay frame parsing. 2011-08-15 13:10:37 +02:00
gardners
cf778e1efd Various further work on overlay mesh.
Now resolves some kinds of abbreviated address, and queues up
the need to remind peers of abbreviation schemes it does not support.
2011-08-15 12:51:00 +02:00
gardners
229850c8d7 Overlay mode with address summarisation closer to working.
Self-announcements now abbreviate addresses, and in theory they
get expanded on reception -- but more testing and coding required.
2011-08-15 09:27:29 +02:00