Commit Graph

59 Commits

Author SHA1 Message Date
Jeremy Lakeman
0d5d878521 Refactor socket name and address length handling 2013-11-27 13:08:37 +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
Jeremy Lakeman
4434b1b65d Create keyring.h and move definitions there 2013-11-13 11:55:12 +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
Jeremy Lakeman
b8ec568711 Send 3-way request to stop routing an identity 2013-10-14 14:40:19 +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
ab31420faf rhizome_bid_t
Consistent type for internal binary representation of Rhizome Bundle ID
(aka Manifest ID)
2013-10-03 23:16:45 +09:30
Jeremy Lakeman
b38b4720cc Add html stats for http connection and mdp transfer counts 2013-09-24 14:34:51 +09:30
Jeremy Lakeman
f2e7391672 Fix format warnings on 64bit machines 2013-08-26 11:54:46 +09:30
gardners
b18a78f6c6 fix byte order for version field in MDP rhizome blocks (used
native instead of consistent byte ordering).
2013-08-25 22:08:40 +09:30
gardners
06bb93c88b add extra debug option to trace MDP Rhizome transfer problems. 2013-08-25 21:16:33 +09:30
Jeremy Lakeman
1468d2deb0 Pre-emptively send small payloads via MDP 2013-08-21 09:21:40 +09:30
Jeremy Lakeman
bf7d0d5b16 Cache rhizome read state when serving content via MDP 2013-08-16 14:57:28 +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
a4bf4edbfc Write out of order packets with MDP transport
- add random order writing to rhizome store API
- remove rhizome flush, force all callers to provide buffer
2013-07-17 16:57:59 +09:30
Jeremy Lakeman
3855ff35c4 Clean up string formatting for 64bit compilation 2013-07-15 09:59:24 +09:30
Jeremy Lakeman
2f32635b87 Minor code cleanup / refactoring 2013-07-12 10:56:24 +09:30
Jeremy Lakeman
adbbed5275 Add new rhizome sync protocol 2013-06-19 12:05:57 +09:30
Jeremy Lakeman
85b885dde2 Add basic link state routing 2013-04-26 16:54:01 +09:30
Jeremy Lakeman
73786bcb5d Refactor all rhizome reading and writing
- The API in rhizome_store.c is used for all reading and writing
- external storage is now usable for all transport options
2013-02-20 16:18:59 +10:30
Jeremy Lakeman
bb8b3d6376 Add new mdp trace command 2013-02-20 16:18:58 +10: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
gardners
641d749ab4 Create files for large rhizome bundles
- configurable size threashold
2013-02-20 15:36:32 +10:30
Jeremy Lakeman
ca5eb7d8bb Reinstate simple slip code, improve debug messages 2013-02-20 15:36:27 +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
78f7a293d1 Don't transfer files via mdp broadcast if the interface prefers unicast 2013-01-29 13:12:34 +11:00
Jeremy Lakeman
88f7fef992 Reduce priority of rhizome on MDP, stop sooner when packet queues fill 2013-01-28 13:35:24 +11:00
Jeremy Lakeman
7be03f15e7 Move link tracking to one c file 2012-12-14 17:07:28 +10:30
Jeremy Lakeman
f41830ebfb Add interface and sequence flags to packet format 2012-12-14 17:07:27 +10:30
Jeremy Lakeman
e5f5256aaa Send up to 10 stun requests, once per second 2012-12-12 10:01:07 +10:30
Andrew Bettison
7d970d8f92 Merge branch 'newconfig' into 'master' 2012-12-11 17:21:56 +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
5798e5acb5 Always send scan packets with full sid 2012-12-11 13:32:02 +10:30
Jeremy Lakeman
c3f573ea7f Add more messages, wait for directory service to start first
And make sure gaps in sockaddr_in are zeroed.
2012-12-10 14:42:57 +10:30
Jeremy Lakeman
2932544eb8 Add IPv4 addresses to dummy interface 2012-12-10 14:06:25 +10:30
Jeremy Lakeman
78aa01ad30 Add stun lookup messages 2012-12-10 14:05:57 +10:30
Jeremy Lakeman
4b73e42bed Merge remote-tracking branch 'origin/master' into rhizomeovermdp
Conflicts:
	rhizome_fetch.c
2012-12-06 13:27:04 +10:30
Jeremy Lakeman
587350e72e Fix alignment issues in probe packets 2012-12-06 10:59:19 +10:30
Jeremy Lakeman
383cc2371d Record packet timing info 2012-12-05 15:36:46 +10:30
Jeremy Lakeman
0ca9612a96 Send redundant probe payloads 2012-12-05 10:20:09 +10:30
gardners
f827c7c1c8 fixed various problems following split of files into fileblobs 2012-12-04 16:47:45 +10:30
Jeremy Lakeman
1dcbb28b61 Send rhizome mdp data unicast if required 2012-12-04 16:38:18 +10:30
gardners
de7ff09930 fixed bug where disabling Rhizome over MDP server also disabled
client functionality.
2012-12-04 16:10:17 +10:30
Jeremy Lakeman
10ce16e1f3 Fix reading port number 2012-12-04 15:53:32 +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
gardners
7ec695c940 feedback from code review by Jeremy.
Some preparation for out-of-order handling.
Consolidated redundantly redundant fields in fetch slot structure.
Probably fixed spurious alarm bug.
2012-12-03 11:50:35 +10:30
gardners
115736f0a4 cleaned out excess debugging messages and upped block size from
200 bytes to 1KB to greatly improve throughput.  Will eventually
want to make block size selection be based on network interface.
2012-12-01 10:52:08 +10:30
gardners
ac734ff00d fixed bugs with rhizome over mdp receive for files >32*200 bytes
long.  also we request next block of data immediately after
receiving all of the previous block.
2012-12-01 07:37:22 +10:30
gardners
41261bf122 gadzooks, rhizome over mdp appears to work. 2012-11-30 22:45:27 +10:30
gardners
dbb1fe8d1e rhizome over mdp now writes content for in-order packets, and
import gets triggered, but file hash currently doesn't match.
2012-11-30 22:42:28 +10:30