Remove CLIFLAG_NONOVERLAY and CLIFLAG_STANDALONE

Not used for anything
This commit is contained in:
Andrew Bettison 2013-04-02 17:49:56 +10:30
parent 21991726ae
commit 4be43b76d5
2 changed files with 50 additions and 67 deletions

4
cli.h
View File

@ -31,9 +31,7 @@ struct cli_schema {
int (*function)(const struct cli_parsed *parsed, void *context);
const char *words[COMMAND_LINE_MAX_LABELS];
unsigned long long flags;
#define CLIFLAG_NONOVERLAY (1<<0) /* Uses a legacy IPv4 DNA call instead of overlay mnetwork */
#define CLIFLAG_STANDALONE (1<<1) /* Cannot be issued to a running instance */
#define CLIFLAG_PERMISSIVE_CONFIG (1<<2) /* No error on bad configuration file */
#define CLIFLAG_PERMISSIVE_CONFIG (1<<0) /* Accept defective configuration file */
const char *description; // describe this invocation
};

View File

@ -2351,22 +2351,7 @@ int app_network_scan(const struct cli_parsed *parsed, void *context)
return mdp.error.error;
}
/* NULL marks ends of command structure.
"<anystring>" marks an arg that can take any value.
"[<anystring>]" marks an optional arg that can take any value.
All args following the first optional arg are optional, whether marked or not.
Only exactly matching prototypes will be used.
Together with the description, this makes it easy for us to auto-generate the
list of valid command line formats for display to the user if they try an
invalid one. It also means we can do away with getopt() etc.
The CLIFLAG_STANDALONE means that they cannot be used with a running servald
instance, but act as an instance. In other words, don't call these from the
serval frontend, e.g, Java application on Android. There are various reasons,
such as some will try to fork() and exec() (bad for a Java thread to do), while
others manipulate files that the running instance may be using.
Keep this list alphabetically sorted for user convenience.
/* See cli_parse() for details of command specification syntax.
*/
#define KEYRING_PIN_OPTIONS ,"[--keyring-pin=<pin>]","[--entry-pin=<pin>]..."
struct cli_schema command_line_options[]={
@ -2382,17 +2367,17 @@ struct cli_schema command_line_options[]={
"Log the supplied message at WARN level."},
{app_log,{"log","error","<message>",NULL},CLIFLAG_PERMISSIVE_CONFIG,
"Log the supplied message at ERROR level."},
{app_server_start,{"start",NULL},CLIFLAG_STANDALONE,
{app_server_start,{"start",NULL}, 0,
"Start Serval Mesh node process with instance path taken from SERVALINSTANCE_PATH environment variable."},
{app_server_start,{"start","in","<instance path>",NULL},CLIFLAG_STANDALONE,
{app_server_start,{"start","in","<instance path>",NULL}, 0,
"Start Serval Mesh node process with given instance path."},
{app_server_start,{"start","exec","<exec path>",NULL},CLIFLAG_STANDALONE,
{app_server_start,{"start","exec","<exec path>",NULL}, 0,
"Start Serval Mesh node process with instance path taken from SERVALINSTANCE_PATH environment variable."},
{app_server_start,{"start","exec","<exec path>","in","<instance path>",NULL},CLIFLAG_STANDALONE,
{app_server_start,{"start","exec","<exec path>","in","<instance path>",NULL}, 0,
"Start Serval Mesh node process with given instance path."},
{app_server_start,{"start","foreground",NULL},CLIFLAG_STANDALONE,
{app_server_start,{"start","foreground",NULL}, 0,
"Start Serval Mesh node process without detatching from foreground."},
{app_server_start,{"start","foreground","in","<instance path>",NULL},CLIFLAG_STANDALONE,
{app_server_start,{"start","foreground","in","<instance path>",NULL}, 0,
"Start Serval Mesh node process with given instance path, without detatching from foreground."},
{app_server_stop,{"stop",NULL},CLIFLAG_PERMISSIVE_CONFIG,
"Stop a running Serval Mesh node process with instance path taken from SERVALINSTANCE_PATH environment variable."},
@ -2400,101 +2385,101 @@ struct cli_schema command_line_options[]={
"Stop a running Serval Mesh node process with given instance path."},
{app_server_status,{"status",NULL},CLIFLAG_PERMISSIVE_CONFIG,
"Display information about any running Serval Mesh node."},
{app_mdp_ping,{"mdp","ping","<SID|broadcast>","[<count>]",NULL},0,
{app_mdp_ping,{"mdp","ping","<SID|broadcast>","[<count>]",NULL}, 0,
"Attempts to ping specified node via Mesh Datagram Protocol (MDP)."},
{app_trace,{"mdp","trace","<SID>",NULL},0,
{app_trace,{"mdp","trace","<SID>",NULL}, 0,
"Trace through the network to the specified node via MDP."},
{app_config_schema,{"config","schema",NULL},CLIFLAG_STANDALONE|CLIFLAG_PERMISSIVE_CONFIG,
{app_config_schema,{"config","schema",NULL},CLIFLAG_PERMISSIVE_CONFIG,
"Display configuration schema."},
{app_config_dump,{"config","dump","[--full]",NULL},CLIFLAG_STANDALONE|CLIFLAG_PERMISSIVE_CONFIG,
{app_config_dump,{"config","dump","[--full]",NULL},CLIFLAG_PERMISSIVE_CONFIG,
"Dump configuration settings."},
{app_config_set,{"config","set","<variable>","<value>","...",NULL},CLIFLAG_STANDALONE|CLIFLAG_PERMISSIVE_CONFIG,
{app_config_set,{"config","set","<variable>","<value>","...",NULL},CLIFLAG_PERMISSIVE_CONFIG,
"Set and del specified configuration variables."},
{app_config_set,{"config","del","<variable>","...",NULL},CLIFLAG_STANDALONE|CLIFLAG_PERMISSIVE_CONFIG,
{app_config_set,{"config","del","<variable>","...",NULL},CLIFLAG_PERMISSIVE_CONFIG,
"Del and set specified configuration variables."},
{app_config_get,{"config","get","[<variable>]",NULL},CLIFLAG_STANDALONE|CLIFLAG_PERMISSIVE_CONFIG,
{app_config_get,{"config","get","[<variable>]",NULL},CLIFLAG_PERMISSIVE_CONFIG,
"Get specified configuration variable."},
{app_vomp_console,{"console",NULL},0,
{app_vomp_console,{"console",NULL}, 0,
"Test phone call life-cycle from the console"},
{app_rhizome_append_manifest, {"rhizome", "append", "manifest", "<filepath>", "<manifestpath>", NULL}, CLIFLAG_STANDALONE,
{app_rhizome_append_manifest, {"rhizome", "append", "manifest", "<filepath>", "<manifestpath>", NULL}, 0,
"Append a manifest to the end of the file it belongs to."},
{app_rhizome_hash_file,{"rhizome","hash","file","<filepath>",NULL},CLIFLAG_STANDALONE,
{app_rhizome_hash_file,{"rhizome","hash","file","<filepath>",NULL}, 0,
"Compute the Rhizome hash of a file"},
{app_rhizome_add_file,{"rhizome","add","file" KEYRING_PIN_OPTIONS,"<author_sid>","<filepath>","[<manifestpath>]","[<bsk>]",NULL},CLIFLAG_STANDALONE,
{app_rhizome_add_file,{"rhizome","add","file" KEYRING_PIN_OPTIONS,"<author_sid>","<filepath>","[<manifestpath>]","[<bsk>]",NULL}, 0,
"Add a file to Rhizome and optionally write its manifest to the given path"},
{app_rhizome_import_bundle,{"rhizome","import","bundle","<filepath>","<manifestpath>",NULL},CLIFLAG_STANDALONE,
{app_rhizome_import_bundle,{"rhizome","import","bundle","<filepath>","<manifestpath>",NULL}, 0,
"Import a payload/manifest pair into Rhizome"},
{app_rhizome_list,{"rhizome","list" KEYRING_PIN_OPTIONS,
"[<service>]","[<name>]","[<sender_sid>]","[<recipient_sid>]","[<offset>]","[<limit>]",NULL},CLIFLAG_STANDALONE,
"[<service>]","[<name>]","[<sender_sid>]","[<recipient_sid>]","[<offset>]","[<limit>]",NULL}, 0,
"List all manifests and files in Rhizome"},
{app_rhizome_extract,{"rhizome","export","bundle" KEYRING_PIN_OPTIONS,
"<manifestid>","[<manifestpath>]","[<filepath>]",NULL},CLIFLAG_STANDALONE,
"<manifestid>","[<manifestpath>]","[<filepath>]",NULL}, 0,
"Export a manifest and payload file to the given paths, without decrypting."},
{app_rhizome_extract,{"rhizome","export","manifest" KEYRING_PIN_OPTIONS,
"<manifestid>","[<manifestpath>]",NULL},CLIFLAG_STANDALONE,
"<manifestid>","[<manifestpath>]",NULL}, 0,
"Export a manifest from Rhizome and write it to the given path"},
{app_rhizome_export_file,{"rhizome","export","file","<fileid>","[<filepath>]",NULL},CLIFLAG_STANDALONE,
{app_rhizome_export_file,{"rhizome","export","file","<fileid>","[<filepath>]",NULL}, 0,
"Export a file from Rhizome and write it to the given path without attempting decryption"},
{app_rhizome_extract,{"rhizome","extract","bundle" KEYRING_PIN_OPTIONS,
"<manifestid>","[<manifestpath>]","[<filepath>]","[<bsk>]",NULL},CLIFLAG_STANDALONE,
"<manifestid>","[<manifestpath>]","[<filepath>]","[<bsk>]",NULL}, 0,
"Extract and decrypt a manifest and file to the given paths."},
{app_rhizome_extract,{"rhizome","extract","file" KEYRING_PIN_OPTIONS,
"<manifestid>","[<filepath>]","[<bsk>]",NULL},CLIFLAG_STANDALONE,
"<manifestid>","[<filepath>]","[<bsk>]",NULL}, 0,
"Extract and decrypt a file from Rhizome and write it to the given path"},
{app_rhizome_delete,{"rhizome","delete","\\manifest",
"<manifestid>",NULL},CLIFLAG_STANDALONE,
"<manifestid>",NULL}, 0,
"Remove the manifest for the given bundle from the Rhizome store"},
{app_rhizome_delete,{"rhizome","delete","\\payload",
"<manifestid>",NULL},CLIFLAG_STANDALONE,
"<manifestid>",NULL}, 0,
"Remove the payload for the given bundle from the Rhizome store"},
{app_rhizome_delete,{"rhizome","delete","\\bundle",
"<manifestid>",NULL},CLIFLAG_STANDALONE,
"<manifestid>",NULL}, 0,
"Remove the manifest and payload for the given bundle from the Rhizome store"},
{app_rhizome_delete,{"rhizome","delete","\\file",
"<fileid>",NULL},CLIFLAG_STANDALONE,
"<fileid>",NULL}, 0,
"Remove the file with the given hash from the Rhizome store"},
{app_rhizome_direct_sync,{"rhizome","direct","sync","[peer url]",NULL}, CLIFLAG_STANDALONE,
{app_rhizome_direct_sync,{"rhizome","direct","sync","[peer url]",NULL}, 0,
"Synchronise with the specified Rhizome Direct server. Return when done."},
{app_rhizome_direct_sync,{"rhizome","direct","push","[peer url]",NULL}, CLIFLAG_STANDALONE,
{app_rhizome_direct_sync,{"rhizome","direct","push","[peer url]",NULL}, 0,
"Deliver all new content to the specified Rhizome Direct server. Return when done."},
{app_rhizome_direct_sync,{"rhizome","direct","pull","[peer url]",NULL}, CLIFLAG_STANDALONE,
{app_rhizome_direct_sync,{"rhizome","direct","pull","[peer url]",NULL}, 0,
"Fetch all new content from the specified Rhizome Direct server. Return when done."},
{app_rhizome_clean,{"rhizome","clean",NULL},CLIFLAG_STANDALONE,
{app_rhizome_clean,{"rhizome","clean",NULL}, 0,
"Remove stale and orphaned content from the Rhizome store"},
{app_keyring_create,{"keyring","create",NULL},0,
{app_keyring_create,{"keyring","create",NULL}, 0,
"Create a new keyring file."},
{app_keyring_list,{"keyring","list" KEYRING_PIN_OPTIONS,NULL},CLIFLAG_STANDALONE,
{app_keyring_list,{"keyring","list" KEYRING_PIN_OPTIONS,NULL}, 0,
"List identites in specified key ring that can be accessed using the specified PINs"},
{app_keyring_add,{"keyring","add" KEYRING_PIN_OPTIONS,"[<pin>]",NULL},CLIFLAG_STANDALONE,
{app_keyring_add,{"keyring","add" KEYRING_PIN_OPTIONS,"[<pin>]",NULL}, 0,
"Create a new identity in the keyring protected by the provided PIN"},
{app_keyring_set_did,{"keyring", "set","did" KEYRING_PIN_OPTIONS,"<sid>","<did>","<name>",NULL},CLIFLAG_STANDALONE,
{app_keyring_set_did,{"keyring", "set","did" KEYRING_PIN_OPTIONS,"<sid>","<did>","<name>",NULL}, 0,
"Set the DID for the specified SID. Optionally supply PIN to unlock the SID record in the keyring."},
{app_id_self,{"id","self",NULL},0,
{app_id_self,{"id","self",NULL}, 0,
"Return my own identity(s) as URIs"},
{app_id_self,{"id","peers",NULL},0,
{app_id_self,{"id","peers",NULL}, 0,
"Return identity of known routable peers as URIs"},
{app_id_self,{"id","allpeers",NULL},0,
{app_id_self,{"id","allpeers",NULL}, 0,
"Return identity of all known peers as URIs"},
{app_route_print, {"route","print",NULL},0,
{app_route_print, {"route","print",NULL}, 0,
"Print the routing table"},
{app_network_scan, {"scan","[<address>]",NULL},0,
{app_network_scan, {"scan","[<address>]",NULL}, 0,
"Scan the network for serval peers. If no argument is supplied, all local addresses will be scanned."},
{app_node_info,{"node","info","<sid>",NULL},0,
{app_node_info,{"node","info","<sid>",NULL}, 0,
"Return routing information about a SID"},
{app_count_peers,{"peer","count",NULL},0,
{app_count_peers,{"peer","count",NULL}, 0,
"Return a count of routable peers on the network"},
{app_dna_lookup,{"dna","lookup","<did>","[<timeout>]",NULL},0,
{app_dna_lookup,{"dna","lookup","<did>","[<timeout>]",NULL}, 0,
"Lookup the subscribers (SID) with the supplied telephone number (DID)."},
{app_reverse_lookup, {"reverse", "lookup", "<sid>", "[<timeout>]", NULL}, 0,
"Lookup the phone number (DID) and name of a given subscriber (SID)"},
{app_monitor_cli,{"monitor",NULL},0,
{app_monitor_cli,{"monitor",NULL}, 0,
"Interactive servald monitor interface."},
{app_crypt_test,{"test","crypt",NULL},0,
{app_crypt_test,{"test","crypt",NULL}, 0,
"Run cryptography speed test"},
{app_slip_test,{"test","slip",NULL},0,
{app_slip_test,{"test","slip",NULL}, 0,
"Run serial encapsulation test"},
#ifdef HAVE_VOIPTEST
{app_pa_phone,{"phone",NULL},0,
{app_pa_phone,{"phone",NULL}, 0,
"Run phone test application"},
#endif
{NULL,{NULL}}