aboutsummaryrefslogtreecommitdiff
path: root/src/dns
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-04 15:22:49 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-04 15:22:49 +0000
commit3fe560c0a435d823c5afbafabb6de4734c1d4c50 (patch)
treeff455e1d477e1348f5c4ae06221d746dc6c4b73d /src/dns
parentc217aa8750bebf75b4a4a0d020cc516e8efad7be (diff)
downloadgnunet-3fe560c0a435d823c5afbafabb6de4734c1d4c50.tar.gz
gnunet-3fe560c0a435d823c5afbafabb6de4734c1d4c50.zip
-options
Diffstat (limited to 'src/dns')
-rw-r--r--src/dns/gnunet-dns-monitor.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/dns/gnunet-dns-monitor.c b/src/dns/gnunet-dns-monitor.c
index 96d2a4959..18d08d4fc 100644
--- a/src/dns/gnunet-dns-monitor.c
+++ b/src/dns/gnunet-dns-monitor.c
@@ -35,9 +35,14 @@
35static struct GNUNET_DNS_Handle *handle; 35static struct GNUNET_DNS_Handle *handle;
36 36
37/** 37/**
38 * Option -s. 38 * Option -i.
39 */ 39 */
40static int benchmark_send; 40static int inbound_only;
41
42/**
43 * Option -o.
44 */
45static int outbound_only;
41 46
42/** 47/**
43 * Global return value (0 success). 48 * Global return value (0 success).
@@ -306,9 +311,18 @@ static void
306run (void *cls, char *const *args, const char *cfgfile, 311run (void *cls, char *const *args, const char *cfgfile,
307 const struct GNUNET_CONFIGURATION_Handle *cfg) 312 const struct GNUNET_CONFIGURATION_Handle *cfg)
308{ 313{
314 enum GNUNET_DNS_Flags flags;
315
316 flags = GNUNET_DNS_FLAG_REQUEST_MONITOR | GNUNET_DNS_FLAG_RESPONSE_MONITOR;
317 if (inbound_only | outbound_only)
318 flags = 0;
319 if (inbound_only)
320 flags |= GNUNET_DNS_FLAG_REQUEST_MONITOR;
321 if (outbound_only)
322 flags |= GNUNET_DNS_FLAG_RESPONSE_MONITOR;
309 handle = 323 handle =
310 GNUNET_DNS_connect (cfg, 324 GNUNET_DNS_connect (cfg,
311 GNUNET_DNS_FLAG_REQUEST_MONITOR | GNUNET_DNS_FLAG_RESPONSE_MONITOR, 325 flags,
312 &display_request, 326 &display_request,
313 NULL); 327 NULL);
314 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, 328 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
@@ -320,9 +334,12 @@ int
320main (int argc, char *const *argv) 334main (int argc, char *const *argv)
321{ 335{
322 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 336 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
323 {'s', "testoption", NULL, 337 {'i', "inbound-only", NULL,
324 gettext_noop ("not useful"), 338 gettext_noop ("only monitor DNS queries"),
325 0, &GNUNET_GETOPT_set_one, &benchmark_send}, 339 0, &GNUNET_GETOPT_set_one, &inbound_only},
340 {'o', "outbound-only", NULL,
341 gettext_noop ("only monitor DNS replies"),
342 0, &GNUNET_GETOPT_set_one, &outbound_only},
326 GNUNET_GETOPT_OPTION_VERBOSE (&verbosity), 343 GNUNET_GETOPT_OPTION_VERBOSE (&verbosity),
327 GNUNET_GETOPT_OPTION_END 344 GNUNET_GETOPT_OPTION_END
328 }; 345 };