|
@ -80,6 +80,8 @@ static void help (int level) { |
|
|
"[-f] " |
|
|
"[-f] " |
|
|
#endif |
|
|
#endif |
|
|
"[-t <management port>] " |
|
|
"[-t <management port>] " |
|
|
|
|
|
"\n " |
|
|
|
|
|
"[--management-password <pw>] " |
|
|
"[-v] " |
|
|
"[-v] " |
|
|
#ifndef WIN32 |
|
|
#ifndef WIN32 |
|
|
"\n " |
|
|
"\n " |
|
@ -138,6 +140,8 @@ static void help (int level) { |
|
|
#endif |
|
|
#endif |
|
|
printf(" -t <port> | management UDP port, for multiple supernodes on a machine,\n" |
|
|
printf(" -t <port> | management UDP port, for multiple supernodes on a machine,\n" |
|
|
" | defaults to %u\n", N2N_SN_MGMT_PORT); |
|
|
" | defaults to %u\n", N2N_SN_MGMT_PORT); |
|
|
|
|
|
printf(" --management_... | management port password, defaults to '%s'\n" |
|
|
|
|
|
" ...password <pw> | \n", N2N_MGMT_PASSWORD); |
|
|
printf(" -v | make more verbose, repeat as required\n"); |
|
|
printf(" -v | make more verbose, repeat as required\n"); |
|
|
#ifndef WIN32 |
|
|
#ifndef WIN32 |
|
|
printf(" -u <UID> | numeric user ID to use when privileges are dropped\n"); |
|
|
printf(" -u <UID> | numeric user ID to use when privileges are dropped\n"); |
|
@ -303,6 +307,12 @@ static int setOption (int optkey, char *_optarg, n2n_sn_t *sss) { |
|
|
if(sss->community_file) |
|
|
if(sss->community_file) |
|
|
strcpy(sss->community_file, _optarg); |
|
|
strcpy(sss->community_file, _optarg); |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case ']': /* password for management port */ { |
|
|
|
|
|
sss->mgmt_password_hash = pearson_hash_64((uint8_t*)_optarg, strlen(_optarg)); |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
#if defined(N2N_HAVE_DAEMON) |
|
|
#if defined(N2N_HAVE_DAEMON) |
|
|
case 'f': /* foreground */ |
|
|
case 'f': /* foreground */ |
|
|
sss->daemon = 0; |
|
|
sss->daemon = 0; |
|
@ -337,8 +347,9 @@ static const struct option long_options[] = { |
|
|
{"local-port", required_argument, NULL, 'p'}, |
|
|
{"local-port", required_argument, NULL, 'p'}, |
|
|
{"mgmt-port", required_argument, NULL, 't'}, |
|
|
{"mgmt-port", required_argument, NULL, 't'}, |
|
|
{"autoip", required_argument, NULL, 'a'}, |
|
|
{"autoip", required_argument, NULL, 'a'}, |
|
|
{"help", no_argument, NULL, '@'}, /* special character '@' to identify long help case */ |
|
|
|
|
|
{"verbose", no_argument, NULL, 'v'}, |
|
|
{"verbose", no_argument, NULL, 'v'}, |
|
|
|
|
|
{"help", no_argument, NULL, '@'}, /* special character '@' to identify long help case */ |
|
|
|
|
|
{"management-password", required_argument, NULL, ']' }, /* ']' management port password */ |
|
|
{NULL, 0, NULL, 0} |
|
|
{NULL, 0, NULL, 0} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|