Commit Graph

135 Commits

Author SHA1 Message Date
Jeremy Lakeman
b8971e51f4 Refactor socket helper functions to take socket_address struct 2014-02-20 14:44: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
Jeremy Lakeman
8d80cf55f2 Fix printf formats 2013-12-16 15:19:15 +10:30
Andrew Bettison
3f0008bb39 Eliminate unused variable 2013-12-10 17:22:50 +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
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
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
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
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
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
f7bffbfabe Simplify packet debug logging 2013-09-20 14:41:50 +09:30
Jeremy Lakeman
8935db4184 Only ack soon if we have been asked to 2013-08-30 17:38:29 +09:30
Jeremy Lakeman
6ecfc952ed Schedule ack packets in response to neighbour broadcasts 2013-08-30 17:38:29 +09:30
Jeremy Lakeman
9a50d8a9ef Route mulit-hop via unicast links 2013-08-09 16:37:54 +09:30
Jeremy Lakeman
55657623aa Detect unicast links 2013-08-09 12:18:14 +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
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
9f9893095b Add small delays to route announcements to reduce packet spam 2013-07-10 13:16:22 +09:30
Jeremy Lakeman
d3a13f8d2c Fix stupid bug, test was backwards 2013-06-03 16:04:08 +09:30
Jeremy Lakeman
96daa47b95 Dump mdp header if we fail to parse length field 2013-05-30 13:24:37 +09:30
Jeremy Lakeman
bc50d3e184 Establish a unicast link to nodes who are filtering broadcasts 2013-05-29 11:58:06 +09:30
Jeremy Lakeman
50bcd3883b Don't forward broadcasts unless we are vital to their delivery 2013-05-29 11:58:06 +09:30
Jeremy Lakeman
f1391355e4 Reduce log noise with debug.overlayframes 2013-05-29 11:58:06 +09:30
Jeremy Lakeman
8ab5073869 Adjust packet format for better duplicate detection 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
e519633f7a Resend last ACK if it is explicitly NACKed 2013-05-29 11:58:05 +09:30
Jeremy Lakeman
e5856225cf Add packet retransmissions due to missed ack's 2013-05-29 11:58:05 +09:30
Jeremy Lakeman
ef1e93bf52 Establish neighbour links with nodes running our legacy routing engine 2013-05-09 16:57:33 +09:30
Jeremy Lakeman
f405ba5337 Send sequence number on all broadcast frames 2013-05-03 16:23:23 +09:30
Jeremy Lakeman
9ee09e36a0 Replace old routing engine with new link state engine 2013-05-02 14:29:28 +09:30
Jeremy Lakeman
559b270966 Only compare routes that have all links via the same neighbour 2013-04-29 17:07:36 +09:30
Jeremy Lakeman
85b885dde2 Add basic link state routing 2013-04-26 16:54:01 +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
Andrew Bettison
a8b88a462f Fix clang compiler warnings (revealed some bugs) 2013-04-12 17:16:50 +09:30
gardners
2252fdcaa7 created tool for automatically finding IN()s without matching
OUT()s or where return() is used instead of RETURN().
Added OUT() to end of all functions using IN() that lacked it to
make it easier to statically analyse this invariant.
Fixed several return instead of RETURNs detected through use of
this tool. #49
2013-02-20 16:18:56 +10: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
gardners
69ae7e1706 prune some debugging.
avoid some segfaults due to lack of IP addresses in packet radio
native MDP payloads.
problems remain with SLIP encapsulation/extraction, but some packets
are already getting through.
2013-02-20 15:36:22 +10:30
gardners
e20cfdb59d closer to working.
POLLOUT seems to get stuck once triggered.
2013-02-20 15:36:21 +10:30
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