mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-22 02:06:42 +00:00
starting work on the actual synchronisation code for rhizome direct.
This commit is contained in:
parent
5aa4c8bb82
commit
6d725535f9
@ -1786,6 +1786,12 @@ command_line_option command_line_options[]={
|
|||||||
{app_rhizome_direct_sync,{"rhizome","direct","sync","<ip:port>",NULL},
|
{app_rhizome_direct_sync,{"rhizome","direct","sync","<ip:port>",NULL},
|
||||||
CLIFLAG_STANDALONE,
|
CLIFLAG_STANDALONE,
|
||||||
"Synchronise with the specified Rhizome Direct server. Return when done."},
|
"Synchronise with the specified Rhizome Direct server. Return when done."},
|
||||||
|
{app_rhizome_direct_sync,{"rhizome","direct","push","<ip:port>",NULL},
|
||||||
|
CLIFLAG_STANDALONE,
|
||||||
|
"Deliver all new content to the specified Rhizome Direct server. Return when done."},
|
||||||
|
{app_rhizome_direct_sync,{"rhizome","direct","pull","<ip:port>",NULL},
|
||||||
|
CLIFLAG_STANDALONE,
|
||||||
|
"Fetch all new content from the specified Rhizome Direct server. Return when done."},
|
||||||
{app_keyring_create,{"keyring","create",NULL},0,
|
{app_keyring_create,{"keyring","create",NULL},0,
|
||||||
"Create a new keyring file."},
|
"Create a new keyring file."},
|
||||||
{app_keyring_list,{"keyring","list","[<pin,pin...>]",NULL},CLIFLAG_STANDALONE,
|
{app_keyring_list,{"keyring","list","[<pin,pin...>]",NULL},CLIFLAG_STANDALONE,
|
||||||
|
@ -569,6 +569,12 @@ int app_rhizome_direct_sync(int argc, const char *const *argv,
|
|||||||
{
|
{
|
||||||
/* Attempt to connect with a remote Rhizome Direct instance,
|
/* Attempt to connect with a remote Rhizome Direct instance,
|
||||||
and negotiate which BARs to synchronise. */
|
and negotiate which BARs to synchronise. */
|
||||||
|
char *modeName = (argc >= 3 ? argv[2] : "sync");
|
||||||
|
int mode=3; /* two-way sync */
|
||||||
|
if (!strcasecmp(modeName,"push")) mode=1; /* push only */
|
||||||
|
if (!strcasecmp(modeName,"pull")) mode=2; /* pull only */
|
||||||
|
|
||||||
|
DEBUGF("sync direction = %d",mode);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user