Commit Graph

334 Commits

Author SHA1 Message Date
Andrew Bettison
81af4460f3 Fix broken "ping" command arg parsing 2013-04-12 17:18:25 +09:30
Andrew Bettison
a8b88a462f Fix clang compiler warnings (revealed some bugs) 2013-04-12 17:16:50 +09:30
Andrew Bettison
a9a1ffecde Simplify "start" commands
Remove all "in <instancepath>" variants

Make "foreground" and "exec <path>" variants mutually exclusive, using
new CLI alternatives syntax

Fix some log levels to assist newbies
2013-04-11 17:54:18 +09:30
Andrew Bettison
58ff69c1d3 Fix #59: "-h" and "--help" synonyms for "help" 2013-04-09 17:26:38 +09:30
Andrew Bettison
5bbdef5587 Improve command-line parsing (issue #59)
Emit HINT log message about using "help" command

Support alternatives syntax "word|word|..." in CLI schema

Better return values from cli_parse()
2013-04-09 17:23:20 +09:30
Andrew Bettison
2c379fadb1 Merge branch 'naf2-logging' into 'development'
Conflicts:
	commandline.c
	tests/rhizomeprotocol
2013-04-05 17:39:23 +10:30
Andrew Bettison
4be43b76d5 Remove CLIFLAG_NONOVERLAY and CLIFLAG_STANDALONE
Not used for anything
2013-04-02 17:49:56 +10:30
Andrew Bettison
21991726ae Add logging tests, add "log" command
Refactor log.c ready for log file rotation
2013-04-02 17:01:48 +10:30
Andrew Bettison
0f83b9a5fc Fix #60 - "rhizome direct" command line URL
Add test case for "rhizome push <url>" command
2013-04-02 14:54:46 +10:30
Andrew Bettison
2d09ec545e Improve configuration dump to log
Refactor much of the new code in log.c

Add new functions: cf_load_strict() and cf_reload_strict() for use by the
server, which does not want to overwrite its in-memory config at all if there
is any defect in the config file.  However, commands always want to overwrite
the default in-memory config, even with a defective config file, so that
logging has a chance to succeed.

Added `log_format.dump_config` boolean config option
2013-03-29 00:22:08 +10:30
Andrew Bettison
95b0c028f2 Log to file, Android and stderr simultaneously
Indepent configuration of show_pid, show_time and log level for each
destination

Update test scripts for new config options

Include xprintf.c in MDP client source files (now used by log.c)
2013-03-27 16:17:38 +10:30
Andrew Bettison
a88234ce9d Add optional filter args to 'help' command 2013-03-25 12:05:26 +10:30
Andrew Bettison
300ec986f1 Fix warnings from gcc 4.6.3 2013-03-18 16:48:15 +10:30
Andrew Bettison
b17f5a6f63 Servald version string from git describe 2013-03-12 14:03:33 +10:30
Andrew Bettison
1d1f7a37a4 Fix Solaris SIGBUS bug in MDP ping
Also fixed non-portable (endian dependent) code
2013-03-07 14:54:40 +10:30
Andrew Bettison
8771d6181b Merge branch 'naf2-logging' into 'development' 2013-03-01 17:32:57 +10:30
Andrew Bettison
ae787339ec Improve "config dump" command
All STRUCT cf_fmt_config_xxx() functions omit invalid values, silently
if the invalid value is the default, otherwise with a non-CFOK return
value.

The "config dump --full" option includes all options with valid values,
otherwise omits options having default values.
2013-02-28 15:18:48 +10:30
Andrew Bettison
46eeacb823 Improve new "config dump" command
No more SEGV.  Omits invalid (default) values.  Logs unconditional DEBUG
output, to be removed before merging into development.  Still missing
cf_cmp_ functions to prune out default values.

Improved config Object Model iterator logic to barf on internal NULL
nodes.
2013-02-27 16:26:07 +10:30
Jeremy Lakeman
ee95e47d1f Add rhizome export commands that don't try to decrypt file contents
export [bundle/manifest/file]
extract [bundle/file]

"dump file" has been replaced with "export file".
2013-02-27 11:39:23 +10:30
Andrew Bettison
6eb08ae805 Add new "config dump" command - not working yet
Add cf_fmt_xxx() functions for converting configuration structs into a
config object model tree.
2013-02-26 18:09:08 +10:30
Andrew Bettison
5ac6bd8834 Fix compile error on Linux 2013-02-22 12:06:21 +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
Jeremy Lakeman
e5fa357f07 Add slip test to automated testing 2013-02-20 16:18:59 +10:30
Jeremy Lakeman
bb8b3d6376 Add new mdp trace command 2013-02-20 16:18:58 +10:30
Jeremy Lakeman
10234018b0 Add interface name to route print output 2013-02-20 16:18:58 +10:30
gardners
f52214e229 make return codes of "servald stop" discriminate between different
failure modes (makes it easier to debug some test failures)
2013-02-20 16:18:57 +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
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
f465f3a9ee Add lots of profiling to assist in debugging
- made some debug output conditional.
- make it possible to debug slip decoding without getting swamped by other output.
- Improve reporting of unnamed schedule() calls.
- always collect performance statistics, and report on any excess
  use (>1sec in every 3), even if debug.timing is not enabled.
- include file size information in Rhizome transfer messages.
- reduce output when debug.rhizome_rx is set.
2013-02-20 15:36:30 +10:30
gardners
042cfc3fa1 add debug.rejecteddata option for reporting bad packets/manifests
etc.
2013-02-20 15:36:26 +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
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
788b3e37b2 Fix JNI argv parsing: throw exception on NULL
Add new 'jni' test case to ensure this works
2013-02-15 19:33:12 +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
Andrew Bettison
e86a129d49 Refactor: rename some cli.h structs
Now all symbols defined in cli.h start with or contain "cli_"
2013-02-13 17:43:24 +10:30
Andrew Bettison
f66a894a63 Improve keyring PIN handling
Replace explicit [<pin,pin...>] command-line arguments with --entry-pin=<pin>
options.  Update test scripts accordlingly.

Add --keyring-pin=<pin> option (with one test case).
2013-02-13 16:49:52 +10:30
Andrew Bettison
fcb6600cd6 Rewrite command-line parser
Now supports optional args followed by non-optional.
2013-02-12 18:00:37 +10:30
Jeremy Lakeman
3a93fee8a5 New JNI interface to better support cursor result sets 2013-01-23 14:43:50 +10:30
Jeremy Lakeman
ad01836d0e Use database query to respond to rhizome list, add name argument 2013-01-17 11:45:45 +10:30
Jeremy Lakeman
b25ff45438 Importing the same bundle twice returns duplicate flag 2013-01-15 10:32:48 +10:30
Jeremy Lakeman
2d66a150b8 Output manifest version for consistency 2013-01-14 09:23:29 +10:30
Jeremy Lakeman
5a82bfcf31 Add support for importing and exporting a file with an appended manifest 2013-01-11 14:30:52 +10:30
Jeremy Lakeman
7825f9dbd2 Combine manifest and file extraction into one method that can also do both 2013-01-11 14:30:51 +10:30
Jeremy Lakeman
9d6b1ae660 Treat empty bsk the same as null 2013-01-11 14:29:40 +10:30
Jeremy Lakeman
2b480c1d1a Reinstate filesize and hash file extract output 2013-01-04 12:01:40 +10:30
Jeremy Lakeman
fd96c5bd76 Add bsk to correct command 2013-01-04 12:01:39 +10:30
Jeremy Lakeman
28a05baa54 Enable encryption of rhizome payloads 2013-01-03 16:12:24 +10:30
Jeremy Lakeman
dc43b83c80 Tidy up rhizome secret handling to improve reusability 2013-01-03 12:14:13 +10:30
Jeremy Lakeman
8b045dd1a6 Extract files based on the manifest id
Renamed rhizome extract file to rhizome dump file
Added rhizome extract file [manifest] [filepath] [pins]
Modified tests to use the appropriate command, assuming that MeshMS payloads will be encrypted
2013-01-02 12:58:05 +10:30
Jeremy Lakeman
6c7ba438a3 Refactor rhizome extract manifest into more useful methods 2013-01-02 11:15:03 +10:30