[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r18986 - gnunet/src/dns
From: |
gnunet |
Subject: |
[GNUnet-SVN] r18986 - gnunet/src/dns |
Date: |
Wed, 4 Jan 2012 16:22:49 +0100 |
Author: grothoff
Date: 2012-01-04 16:22:49 +0100 (Wed, 04 Jan 2012)
New Revision: 18986
Modified:
gnunet/src/dns/gnunet-dns-monitor.c
Log:
-options
Modified: gnunet/src/dns/gnunet-dns-monitor.c
===================================================================
--- gnunet/src/dns/gnunet-dns-monitor.c 2012-01-04 15:17:53 UTC (rev 18985)
+++ gnunet/src/dns/gnunet-dns-monitor.c 2012-01-04 15:22:49 UTC (rev 18986)
@@ -35,11 +35,16 @@
static struct GNUNET_DNS_Handle *handle;
/**
- * Option -s.
+ * Option -i.
*/
-static int benchmark_send;
+static int inbound_only;
/**
+ * Option -o.
+ */
+static int outbound_only;
+
+/**
* Global return value (0 success).
*/
static int ret;
@@ -306,9 +311,18 @@
run (void *cls, char *const *args, const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
+ enum GNUNET_DNS_Flags flags;
+
+ flags = GNUNET_DNS_FLAG_REQUEST_MONITOR | GNUNET_DNS_FLAG_RESPONSE_MONITOR;
+ if (inbound_only | outbound_only)
+ flags = 0;
+ if (inbound_only)
+ flags |= GNUNET_DNS_FLAG_REQUEST_MONITOR;
+ if (outbound_only)
+ flags |= GNUNET_DNS_FLAG_RESPONSE_MONITOR;
handle =
GNUNET_DNS_connect (cfg,
- GNUNET_DNS_FLAG_REQUEST_MONITOR |
GNUNET_DNS_FLAG_RESPONSE_MONITOR,
+ flags,
&display_request,
NULL);
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
@@ -320,9 +334,12 @@
main (int argc, char *const *argv)
{
static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'s', "testoption", NULL,
- gettext_noop ("not useful"),
- 0, &GNUNET_GETOPT_set_one, &benchmark_send},
+ {'i', "inbound-only", NULL,
+ gettext_noop ("only monitor DNS queries"),
+ 0, &GNUNET_GETOPT_set_one, &inbound_only},
+ {'o', "outbound-only", NULL,
+ gettext_noop ("only monitor DNS replies"),
+ 0, &GNUNET_GETOPT_set_one, &outbound_only},
GNUNET_GETOPT_OPTION_VERBOSE (&verbosity),
GNUNET_GETOPT_OPTION_END
};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r18986 - gnunet/src/dns,
gnunet <=