gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r22807 - gnunet/src/gns


From: gnunet
Subject: [GNUnet-SVN] r22807 - gnunet/src/gns
Date: Fri, 20 Jul 2012 19:39:09 +0200

Author: grothoff
Date: 2012-07-20 19:39:09 +0200 (Fri, 20 Jul 2012)
New Revision: 22807

Added:
   gnunet/src/gns/gnunet-dns2gns.c
Modified:
   gnunet/src/gns/Makefile.am
Log:
-skeleton dns2gns

Modified: gnunet/src/gns/Makefile.am
===================================================================
--- gnunet/src/gns/Makefile.am  2012-07-20 17:34:01 UTC (rev 22806)
+++ gnunet/src/gns/Makefile.am  2012-07-20 17:39:09 UTC (rev 22807)
@@ -42,7 +42,8 @@
        $(DO_PROXY) \
   $(DO_W32_HELPER) \
   $(DO_W32_NSPTOOLS) \
-  gnunet-gns
+  gnunet-gns \
+  gnunet-dns2gns
 
 bin_SCRIPTS=gnunet-gns-proxy-setup-ca
 
@@ -286,6 +287,14 @@
 gnunet_gns_DEPENDENCIES = \
   libgnunetgns.la
 
+gnunet_dns2gns_SOURCES = \
+ gnunet-dns2gns.c
+gnunet_dns2gns_LDADD = \
+  $(top_builddir)/src/gns/libgnunetgns.la \
+  $(top_builddir)/src/util/libgnunetutil.la \
+  $(top_builddir)/src/namestore/libgnunetnamestore.la \
+  $(GN_LIBINTL)
+
 gnunet_gns_proxy_SOURCES = \
  gnunet-gns-proxy.c gns_proxy_proto.h 
 gnunet_gns_proxy_LDADD = -lmicrohttpd -lcurl -lgnutls \

Added: gnunet/src/gns/gnunet-dns2gns.c
===================================================================
--- gnunet/src/gns/gnunet-dns2gns.c                             (rev 0)
+++ gnunet/src/gns/gnunet-dns2gns.c     2012-07-20 17:39:09 UTC (rev 22807)
@@ -0,0 +1,104 @@
+/*
+     This file is part of GNUnet.
+     (C) 2012 Christian Grothoff (and other contributing authors)
+
+     GNUnet is free software; you can redistribute it and/or modify
+     it under the terms of the GNU General Public License as published
+     by the Free Software Foundation; either version 3, or (at your
+     option) any later version.
+
+     GNUnet is distributed in the hope that it will be useful, but
+     WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+/**
+ * @file gnunet-dns2gns.c
+ * @brief DNS server that translates DNS requests to GNS
+ * @author Christian Grothoff
+ */
+#include "platform.h"
+#include <gnunet_util_lib.h>
+#include <gnunet_namestore_service.h>
+
+/**
+ * Data kept per request.
+ */
+struct Request
+{
+
+};
+
+
+/**
+ * Listen socket.
+ */
+static struct GNUNET_NETWORK_Handle *listen_socket;
+
+
+/**
+ * Task run on shutdown.  Cleans up everything.
+ *
+ * @param cls unused
+ * @param tc scheduler context
+ */
+static void
+do_shutdown (void *cls,
+            const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+}
+
+
+/**
+ * Main function that will be run.
+ *
+ * @param cls closure
+ * @param args remaining command-line arguments
+ * @param cfgfile name of the configuration file used (for saving, can be 
NULL!)
+ * @param cfg configuration
+ */
+static void
+run (void *cls, char *const *args, const char *cfgfile,
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
+{
+  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
+                               &do_shutdown, NULL);
+}
+
+
+/**
+ * The main function for the fcfs daemon.
+ *
+ * @param argc number of arguments from the command line
+ * @param argv command line arguments
+ * @return 0 ok, 1 on error
+ */
+int
+main (int argc, 
+      char *const *argv)
+{
+  static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+    GNUNET_GETOPT_OPTION_END
+  };
+  int ret;
+
+  if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv,
+                                                &argc, &argv))
+    return 2;
+  GNUNET_log_setup ("gnunet-dns2gns", "WARNING", NULL);
+  ret =
+      (GNUNET_OK ==
+       GNUNET_PROGRAM_run (argc, argv, "gnunet-dns2gns",
+                           _("GNUnet DNS-to-GNS proxy (a DNS server)"), 
+                          options,
+                           &run, NULL)) ? 0 : 1;
+
+  return ret;
+}
+
+/* end of gnunet-dns2gns.c */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]