2 This file is part of GNUnet.
3 (C) 2012 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
21 * @file gnunet-dns2gns.c
22 * @brief DNS server that translates DNS requests to GNS
23 * @author Christian Grothoff
26 #include <gnunet_util_lib.h>
27 #include <gnunet_namestore_service.h>
30 * Data kept per request.
41 static struct GNUNET_NETWORK_Handle *listen_socket;
45 * Task run on shutdown. Cleans up everything.
48 * @param tc scheduler context
51 do_shutdown (void *cls,
52 const struct GNUNET_SCHEDULER_TaskContext *tc)
58 * Main function that will be run.
61 * @param args remaining command-line arguments
62 * @param cfgfile name of the configuration file used (for saving, can be NULL!)
63 * @param cfg configuration
66 run (void *cls, char *const *args, const char *cfgfile,
67 const struct GNUNET_CONFIGURATION_Handle *cfg)
69 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
75 * The main function for the fcfs daemon.
77 * @param argc number of arguments from the command line
78 * @param argv command line arguments
79 * @return 0 ok, 1 on error
85 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
86 GNUNET_GETOPT_OPTION_END
90 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv,
93 GNUNET_log_setup ("gnunet-dns2gns", "WARNING", NULL);
96 GNUNET_PROGRAM_run (argc, argv, "gnunet-dns2gns",
97 _("GNUnet DNS-to-GNS proxy (a DNS server)"),
104 /* end of gnunet-dns2gns.c */