diff options
Diffstat (limited to 'src/ats-tool')
-rw-r--r-- | src/ats-tool/gnunet-ats.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/ats-tool/gnunet-ats.c b/src/ats-tool/gnunet-ats.c index b79ae9b32..902dc4a20 100644 --- a/src/ats-tool/gnunet-ats.c +++ b/src/ats-tool/gnunet-ats.c | |||
@@ -45,8 +45,23 @@ static char *pid_str; | |||
45 | 45 | ||
46 | static char *type_str; | 46 | static char *type_str; |
47 | static unsigned int value; | 47 | static unsigned int value; |
48 | |||
49 | /** | ||
50 | * Print verbose ATS information | ||
51 | */ | ||
48 | static int verbose; | 52 | static int verbose; |
49 | 53 | ||
54 | /** | ||
55 | * List only addresses currently used (active) | ||
56 | */ | ||
57 | static int list_used; | ||
58 | |||
59 | /** | ||
60 | * List all addresses | ||
61 | */ | ||
62 | static int list_all; | ||
63 | |||
64 | |||
50 | static struct GNUNET_ATS_PerformanceHandle *ph; | 65 | static struct GNUNET_ATS_PerformanceHandle *ph; |
51 | 66 | ||
52 | static struct GNUNET_CONFIGURATION_Handle *cfg; | 67 | static struct GNUNET_CONFIGURATION_Handle *cfg; |
@@ -210,6 +225,22 @@ void testservice_ats (void *cls, | |||
210 | return; | 225 | return; |
211 | } | 226 | } |
212 | 227 | ||
228 | if ((GNUNET_YES == list_all) && (GNUNET_YES ==list_used)) | ||
229 | { | ||
230 | FPRINTF (stderr, _("Please select one operation : %s or %s \n"),"--used", "--all"); | ||
231 | return; | ||
232 | } | ||
233 | |||
234 | if ((GNUNET_NO == list_all) && (GNUNET_NO == list_used)) | ||
235 | list_used = GNUNET_YES; /* set default */ | ||
236 | |||
237 | |||
238 | if (GNUNET_YES == list_all) | ||
239 | { | ||
240 | FPRINTF (stderr, _("NOT YET IMPLEMENTED\n")); | ||
241 | return; | ||
242 | } | ||
243 | |||
213 | results = 0; | 244 | results = 0; |
214 | if (NULL != pid_str) | 245 | if (NULL != pid_str) |
215 | { | 246 | { |
@@ -297,8 +328,16 @@ main (int argc, char *const *argv) | |||
297 | int res; | 328 | int res; |
298 | resolve_addresses_numeric = GNUNET_NO; | 329 | resolve_addresses_numeric = GNUNET_NO; |
299 | monitor = GNUNET_NO; | 330 | monitor = GNUNET_NO; |
331 | list_all = GNUNET_NO; | ||
332 | list_used = GNUNET_NO; | ||
300 | 333 | ||
301 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 334 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { |
335 | {'u', "used", NULL, | ||
336 | gettext_noop ("get list of active addresses currently used"), | ||
337 | 0, &GNUNET_GETOPT_set_one, &list_used}, | ||
338 | {'a', "all", NULL, | ||
339 | gettext_noop ("get list of all active addresses"), | ||
340 | 0, &GNUNET_GETOPT_set_one, &list_all}, | ||
302 | {'n', "numeric", NULL, | 341 | {'n', "numeric", NULL, |
303 | gettext_noop ("do not resolve IP addresses to hostnames"), | 342 | gettext_noop ("do not resolve IP addresses to hostnames"), |
304 | 0, &GNUNET_GETOPT_set_one, &resolve_addresses_numeric}, | 343 | 0, &GNUNET_GETOPT_set_one, &resolve_addresses_numeric}, |