Commit Graph

122 Commits

Author SHA1 Message Date
gardners
b0dca7e03f merged in latest changes from team. 2012-05-26 11:36:18 +02:00
Andrew Bettison
49aec4d331 Improve rhizome manifest debugging
Move rhizome_new_manifest() out of rhizome_read_manifest_file() so that the
out-of-manifest report shows the names of the functions where the manifests
were really allocated.
2012-05-25 15:38:13 +09:30
Andrew Bettison
c0ac693957 Remove old payload when updating a manifest with a new payload 2012-05-25 14:29:55 +09:30
Andrew Bettison
c847478140 Add some helpful debug logging 2012-05-24 18:46:33 +09:30
Andrew Bettison
3b00110c49 Fix bug in rhizome_bundle_import()
Introduced by recent rhizome import path improvements
2012-05-24 13:00:31 +09:30
Andrew Bettison
fa26b53294 Fix SEGV bug
rhizome_write_manifest_file() was not checking for NULL fopen() result
Standardise rhizome "import" directory pathname handling
2012-05-24 11:28:32 +09:30
Andrew Bettison
3f9e20f2f0 Cosmetic edits, no change to function 2012-05-23 18:13:18 +09:30
Andrew Bettison
54d456e540 Fix and reinstate FORM_RHIZOME_DATASTORE_PATH() 2012-05-23 18:11:34 +09:30
Andrew Bettison
1af9125392 All rhizome database keys are uppercase hex
FILES.id, MANIFESTS.id, FILEMANIFESTS.fileid, FILEMANIFESTS.manifestid
Named constants for hex and binary ID sizes
2012-05-23 16:04:00 +09:30
gardners
299cb92952 further output cleanups. 2012-05-22 17:08:12 +09:30
gardners
6a83f2434f cleaned up some debug output, among other things. 2012-05-22 17:04:24 +09:30
gardners
3f1f668e8b found and fixed a bug with chopping signatures from manifests when
importing (really need to clean that code up).
2012-05-22 16:55:59 +09:30
gardners
8e9396419c adding ignored manifest list to let us ignore repeated offerings
of broken manifests without wasting effort.
2012-05-22 14:15:35 +09:30
gardners
29bb86d9e7 first cut at supressing rhizome activity during calls. 2012-05-22 13:05:29 +09:30
gardners
99bbbb0b05 make sure import path exists. 2012-05-22 10:00:26 +09:30
gardners
322806a150 force correct construction of filenames for manifests and data files
(strbuf_* not working for these right now).
2012-05-21 22:31:35 +09:30
gardners
f96ba5be18 added various debugging, including revealing problem forming
file names for rhizome bundles being imported.
2012-05-21 22:19:47 +09:30
Andrew Bettison
c2de68449b Make rhizome_add_manifest() stricter for MeshMS
If author not given, use 'sender' as author
Ensure that author and 'sender' field are identical
2012-05-21 10:37:24 +09:30
Andrew Bettison
ddd17db1c4 Make "rhizome add file" work for MeshMS 2012-05-21 00:09:14 +09:30
Andrew Bettison
e6575cb369 Introduce macro constants for Rhizome service names
Use "MeshMS1" instead of "MeshMS"... version 2 won't be far away
2012-05-20 16:07:22 +09:30
Andrew Bettison
d90508b2ba Fix bugs in rhizome_add_manifest()
Tests for service types were inverted
Fail with error if BK field cannot be added
2012-05-20 13:46:38 +09:30
Andrew Bettison
4b5e179841 Start support for MeshMS manifests 2012-05-19 14:09:50 +09:30
Andrew Bettison
9a51c76dfb Insist on 'service' field in all manifests
The "rhizome file add" command assumes service=file if no manifest supplied
or the manifest lacks a service field.

The "rhizome extract manifest" command includes the service in its CLI output.
2012-05-17 17:00:14 +09:30
Andrew Bettison
2434d51bee Remove "rhizome add authored file" command
Now "rhizome add file" takes SID and PIN args, and if SID is empty, an
unauthored bundle (no BK field) is created

Updated dna_rhizome test cases
2012-05-17 12:01:25 +09:30
gardners
09e0cc5030 removed deprecated first_byte and last_byte manifest fields. 2012-05-16 15:56:39 +09:30
gardners
8980b13bbf fixed BK calculation bug. now calculates BK correctly. 2012-05-16 15:41:41 +09:30
gardners
39be8a0b75 added new command line option for adding rhizome bundle with authorship
so that it includes a BK.
All good, except the BK isn't being added. Yet to find out why.
2012-05-15 22:15:13 +09:30
gardners
0eafc34970 BK encoding and decoding complete, but untested. 2012-05-15 20:04:41 +09:30
gardners
525d3c4154 substantial work towards implementing BK field in rhizome manifests. 2012-05-15 17:24:25 +09:30
Andrew Bettison
b02e9b9ac4 Overhaul rhizome datastore path code
Create datastore directory and all parent dirs if it does not exist
More robust error checking and buffer overflow protection
New mkdirs() and mkdirsn() functions
2012-05-14 18:37:32 +09:30
gardners
0b5a9665b2 first cut code for sending monitor socket announcements when
rhizome bundles are received.
2012-05-12 07:24:52 +09:30
Andrew Bettison
e746557a08 Fix bug in overlay_gettime_ms()
The sequence start time was only getting set in overlay_interface_init(), which
was not always called, or was called after overlay_gettime_ms() had already
been used.

Added FATALF(), FATAL() and FATAL_perror() macros.

Removed a bunch of debug statements no longer needed in monitor.c and server.c.
2012-05-11 10:38:46 +09:30
Andrew Bettison
f31c326871 CLI output from "rhizome add file", with tests 2012-05-04 15:31:03 +09:30
Andrew Bettison
146eb7cdfd Add "rhizome extract manifest" command 2012-05-02 16:03:09 +09:30
Andrew Bettison
866ddea189 Get all rhizome add file test cases passing
- new test cases to cover new payload with different versions
 - exit status of 2 when duplicate is detected
 - tighten up other test cases
 - fix bug in sqlite_exec_int64()
2012-04-16 11:46:58 +09:30
Andrew Bettison
de88d3db21 Make "dna rhizome add" work for more test cases
- adding a bundle using an existing manifest with an incorrect payload should
   fail with an error
 - adding a bundle using an existing manifest to update the payload to a new
   version should succeed
 - improve format of "dna rhizome list" output to one bundle per line
2012-04-13 18:03:19 +09:30
Andrew Bettison
7b53fd6782 Rhizome add does not add duplicate files
- If a bundle has the same payload hash and manifest.name as one already in
   the rhizome store, then the "dna rhizome add" command will not add it
 - Now passes fourth test case in tests/dna_rhizome
2012-04-12 18:33:43 +09:30
Andrew Bettison
a87a78536c Refactor rhizome_add_manifest() 2012-04-11 18:40:10 +09:30
Andrew Bettison
74986a0c30 Implement "rhizome add file" and "rhizome list" 2012-04-02 17:42:40 +09:30
Andrew Bettison
738b70b513 Test and fix ACTION_CREATEHLR idempotency code:
- refactor hlrSid() to not return pointer to static buffer, take 3rd arg instead
 - introduce SID_STRLEN macro constant, use it everywhere
 - reformat some code for readability
2012-03-14 12:00:54 +10: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
c0676fd530 Fixed various bugs and memory leaks in rhizome file fetching.
Now successfully fetches manifests for files we already have in
the database, using the existing database copy of the file.
Also added filter to stop same file being fetched more than once at
same time..
2012-01-27 16:21:48 +10:30
gardners
42b5c08321 Refactored rhizome.c into several smaller files.
Manifests are now gleaned from advertisements, and the ones that
are interesting are scheduled for importing into database.
(actual importing is not yet done -- requires fetching of file).
2012-01-12 14:05:05 +10:30
gardners
670f7c51c7 Reworked Rhizome advertisement frames to include whole manifests
inline where possible.
2012-01-11 14:27:40 +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
23ee957169 Various minor tweaks to debugging and related things.
Fixed major memory handling error in neighbour structure allocation.
2012-01-09 16:28:44 +10:30
gardners
1240c49a92 Added more debugging to no open path messages.
Added hook for reading rhizome advertisements.
2012-01-09 09:17:54 +10:30
gardners
25458d0e2b Fixed packet length fields for Rhizome advertisements. 2012-01-09 09:07:00 +10:30
gardners
e069984c71 Found and fixed evil memory corruption error. 2012-01-09 05:10:58 +10:30
gardners
ba645687f6 Progress towards overlay mode advertising rhizome bundles.
(but some evil memory corruption error if overlay mode and
rhizome are both enabled.)
2012-01-09 04:57:13 +10:30
gardners
4e6ef2e69e Various fixes to Rhizome web server and BAR generation.
Can now present a set of BARs via HTTP.
2012-01-03 16:35:02 +10:30
gardners
16fb3a3f61 Added missing GPL license statements. 2011-12-21 20:25:05 +10:30
gardners
ae22480c23 signature reading and logging of signature verification errors now
in place.
2011-12-21 07:53:45 +10:30
gardners
b7b795d4fc manifest reading now reads and can verify signatures.
Still incomplete. Doesn't yet count verify errors etc.
2011-12-21 07:46:12 +10:30
gardners
a159edf152 updating manifests now correctly removes old files and old
versions of the manifest.
group subscriptions not yet implemented, and reading of signatures
not yet implemented.  Controls on group membership and pushing files
to groups not yet implemented.  Group ciphers not yet implemented.
2011-12-20 22:09:49 +10:30
gardners
745cade469 Further work on getting signatures and signed manifests working.
Some work on updating existing manifests, although some cascading
consequences need addressing (in particular checking if the file
associated with the old version of the manifest still needs to hang
about, and if so, whether its highest priority has changed).
2011-12-20 17:27:24 +10:30
gardners
4719281f03 Added keypair storage and retrieval (still pending encryption of
stored secrets, but the framework is there).
2011-12-20 15:57:25 +10:30
gardners
cc09a0f994 Some database schema tweaks and additional checks on manifests when
importing (we now need to have either the key for the manifest, or to
be creating the manifest).
2011-12-20 15:48:26 +10:30
gardners
8fca64d630 Importing bundles into the rhizome database now works.
Signing and groups are still missing for the moment.
2011-12-20 14:16:17 +10:30
gardners
a50c56ac92 Importing of a bundle into the database now seems to work.
(group membership not currently handled, signing not currently
handled).
2011-12-20 13:24:09 +10:30
gardners
312eaa397b Significant progress on Rhizome.
Manifest reading and writing to disk (not database) seems okay now.
Working on database side of things next.
2011-12-20 11:25:52 +10:30
gardners
34075ce84d Fixed an NaCl macro name issue for Android NDK cross-compile 2011-12-19 09:03:30 +10:30
gardners
b775e48042 further NaCl macro name fix for Android cross-compilation. 2011-12-19 08:28:39 +10:30
gardners
c110e46a08 fixes to previous commit. 2011-12-19 08:10:02 +10:30
gardners
000dd2db55 Moved rhizome prototypes into separate header file.
(needed for android building where undefined functions are
an error, not a warning).
2011-12-19 08:04:31 +10:30
gardners
1628d5cbfb Added command line options to DNA to import a rhizome bundle. 2011-12-19 05:46:34 +10:30
gardners
6ec1d6032f Further work towards sqlite3 backend for rhizome.
Wrote function to store file to db iff it is not stored already,
and update the priority flag on the stored file.
Uses blobio to progressively load large blobs to make it friendly
on small memory systems.
2011-12-17 12:11:32 +10:30
gardners
6a433857e4 Substantial preparatory work towards Rhizome/MeshMS store-and-forward
services in Serval DNA.
2011-12-13 19:34:12 +10:30