Commit Graph

383 Commits

Author SHA1 Message Date
Jeremy Lakeman
8ac359e550 Use consistent integer types for 64bit compilation 2013-07-13 14:47:06 +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
88d88e685c Improve backward compatibility for broadcasts & packet retries 2013-07-08 16:01:58 +09:30
Jeremy Lakeman
53f3920b90 Move cli global state into a structure and pass it around 2013-07-03 16:51:27 +09:30
Jeremy Lakeman
61a958fd34 Avoid setting alarms with deadlines that have already elapsed 2013-06-19 15:36:18 +09:30
Jeremy Lakeman
adbbed5275 Add new rhizome sync protocol 2013-06-19 12:05:57 +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
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
e5856225cf Add packet retransmissions due to missed ack's 2013-05-29 11:58:05 +09:30
Jeremy Lakeman
b10746b3a5 Add stub functions for retransmission / throttling 2013-05-29 11:58:04 +09:30
Jeremy Lakeman
a71c3f3c1f Don't send broadcast payloads on interfaces with no neighbours 2013-05-22 11:57:38 +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
dcdb8fcdd4 Announce all links on connection to monitor interface 2013-05-08 13:42:11 +09:30
Jeremy Lakeman
c0b31a2774 Report packet acks, make routing decisions based on dropped packets 2013-05-08 11:37:02 +09:30
gardners
3f77702ee6 add nonce generation function to remove strain on /dev/urandom on
slow embedded devices. Wrote test to make sure that nonces are
indeed unique.
2013-05-07 14:41:59 +09:30
Jeremy Lakeman
79f4a78278 Add link state monitor commands 2013-05-02 16:19:59 +09:30
Jeremy Lakeman
dd03014b44 Choose the best link from a neighbour 2013-05-02 14:29:31 +09:30
Jeremy Lakeman
9ee09e36a0 Replace old routing engine with new link state engine 2013-05-02 14:29:28 +09:30
Andrew Bettison
4e48725c93 Merge branch 'new-keyring' into 'development' 2013-04-30 17:57:59 +09:30
Andrew Bettison
1f10f05302 Add "keyring dump" command 2013-04-30 17:29:06 +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
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
a5d3c16928 Move 'serverMode' flag from server.c to log.c
Because log.c and conf.c now depend on serverMode
2013-03-18 15:34:33 +10:30
Andrew Bettison
b17f5a6f63 Servald version string from git describe 2013-03-12 14:03:33 +10:30
Andrew Bettison
b7185a294f Fix keyring SEGV bug
Sometimes, when adding a PIN to a keyring (eg, when opening a keyring
file), a SEGV would be caused while trying to validate the MAC for an
entry which apparently had zero keypair entries.

Changed some keyring struct 'int' fields to 'unsigned int', to ensure
that comparison logic behaves as expected.

Refactored some keyring code for more clarity and code maintenance
safety.

Added TODO comment about keyring file format non-back-compatibility.
2013-03-07 14:27:33 +10:30
Andrew Bettison
705f414a4d Fix SEGV bug in keyring_enter_pin()
The public and private key length fields were stored as 'int' not
'unsigned', so arithmetic for checking buffer overrun was not correct.
2013-03-06 14:02:33 +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
Andrew Bettison
390655580d Add 'rhizome delete' and 'rhizome clean' commands
sqlite_void_exec() and its ilk now return the count of changed rows, not
just zero, on success

sqlite_exec_prepared() and its ilk now return the count of rows (number
of step results SQLITE_ROW), instead of just zero, on success

rhizome_clean() function now produces an optional report of its changes

rhizome_fail_write() and rhizome_finish_write() now log WARNings not
ERRORs if the SQL DELETE FROM FILES or DELETE FROM FILEBLOBS statements
fail

Refactor rhizome_open_read() to use sqlite_exec_int64()

Ensure that 'rhizome extract' and 'rhizome dump' commands return exit
status of 1 in "not found" conditions, not 255, which is reserved for
errors

Test cases for four new commands: 'rhizome delete bundle', 'rhizome
delete manifest', 'rhizome delete payload' and 'rhizome delete file'
(no test case for 'rhizome clean' yet)
2013-02-20 15:37:09 +10:30
gardners
7cc4324ac6 added facility to log a clue for crash handler to hint where things
got stuck/caused a crash.
2013-02-20 15:36:31 +10:30
gardners
f114e6d19e add progress data for each rhizome transfer. 2013-02-20 15:36:28 +10:30
gardners
d49649ed96 add stored bundle count to /rssi web page display. 2013-02-20 15:36:28 +10:30
gardners
3bd4c49af5 add more info to /rssi http page. 2013-02-20 15:36:27 +10:30
gardners
66956d84ce add /rssi page to rhizome web server to allow easy querying of
radio link budget.
2013-02-20 15:36:27 +10:30
gardners
6a620fe221 added command line test for serial encapsulation.
renamed "crypt test" to "test crypt" for consistency.
2013-02-20 15:36:26 +10:30
Jeremy Lakeman
ed7912295a Use correct variable size for crc's 2013-02-20 15:36:26 +10:30
gardners
fea06932e5 added new slip.c with 7-bit-high packet encapsulation, packet length
and CRC32.
Also added in-line RSSI report reception for RFD900 radios.
2013-02-20 15:36:24 +10:30
Jeremy Lakeman
6d9bbe2e2c Refactor interface handling to separate encapsulation from stream type 2013-02-20 15:36:23 +10:30
Jeremy Lakeman
ba1800012e Only advertise BAR's on an alarm
- we no longer hit the database for every outgoing packet, attempting to announce bundles
- we no longer advertise manifests periodically
- when an interesting bar arrives, we ask for the manifest to be announced, which uses the existing packet format
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
84ad4debfa Throttle serial radio devices when tx buffer is in use 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
gardners
7287a2d599 add hook for transmitting packet via packet radio interface.
make serial port non-blocking (which for some reason has also
killed our ability to read from it :/).
2013-02-20 15:36:20 +10:30
gardners
0268ccd21a setup serial port mode when opening packet radio interface.
(now reads bytes over serial line)
2013-02-20 15:36:20 +10:30
gardners
190a5e693f refactored packet radio code mostly into separate file.
began writing stateful packet decoder.
2013-02-20 15:36:20 +10:30
gardners
70af7fae0d initial work on implementing packet radio interface.
can open and read from TTY.
doesn't do anything with the data yet.
doesn't write proper packets to the interface yet.
doesn't use bitrate config option yet.
2013-02-20 15:36:19 +10:30
Andrew Bettison
c176d23726 Add 'sid:' field to output of "reverse lookup"
Use sid_t in more places
2013-02-15 19:34:24 +10:30
Andrew Bettison
c42260f5f9 Replace "add did" command with improved "keyring add did"
Output is same format as "keyring add" command

Fixed minor bug in rolling a random DID -- last byte was not random

Some code improvements, including better support for sid_t
2013-02-14 16:06:01 +10:30