aboutsummaryrefslogtreecommitdiff
path: root/src/ats-tool
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-11-19 13:54:14 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-11-19 13:54:14 +0000
commitf22ba8fd7e5e514ad29277016ba8759d664cbe6c (patch)
treefdfb73915589823a116733e188c52e713d4205f2 /src/ats-tool
parentf5ab7c6bf4eab568af18db84fe5d37fe43eb2144 (diff)
downloadgnunet-f22ba8fd7e5e514ad29277016ba8759d664cbe6c.tar.gz
gnunet-f22ba8fd7e5e514ad29277016ba8759d664cbe6c.zip
- preparation for list addresses changes
Diffstat (limited to 'src/ats-tool')
-rw-r--r--src/ats-tool/gnunet-ats.c39
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
46static char *type_str; 46static char *type_str;
47static unsigned int value; 47static unsigned int value;
48
49/**
50 * Print verbose ATS information
51 */
48static int verbose; 52static int verbose;
49 53
54/**
55 * List only addresses currently used (active)
56 */
57static int list_used;
58
59/**
60 * List all addresses
61 */
62static int list_all;
63
64
50static struct GNUNET_ATS_PerformanceHandle *ph; 65static struct GNUNET_ATS_PerformanceHandle *ph;
51 66
52static struct GNUNET_CONFIGURATION_Handle *cfg; 67static 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},