-some code cleanup
authorChristian Grothoff <christian@grothoff.org>
Sun, 1 Jan 2012 23:07:37 +0000 (23:07 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 1 Jan 2012 23:07:37 +0000 (23:07 +0000)
configure.ac
src/dns/gnunet-service-dns.c
src/include/gnunet_dns_service.h
src/include/gnunet_dnsparser_lib.h

index c33bdbd63705857ce258ed6df8473b861c0b3721..d2a6939b33b34d4bf40eb6176d1db0fe76dc9c8e 100644 (file)
@@ -820,6 +820,7 @@ src/core/Makefile
 src/datacache/Makefile
 src/datastore/Makefile
 src/dht/Makefile
+src/dns/Makefile
 src/dv/Makefile
 src/fragmentation/Makefile
 src/fs/Makefile
index ee42a7001597d1528259be7d0229c09da44d3bb0..065c085c7f8e5d162e65b4de2a45267b22d22812 100644 (file)
 #include "gnunet_mesh_service.h"
 #include "gnunet_signatures.h"
 
-struct GNUNET_MESH_Handle *mesh_handle;
 
-struct GNUNET_CONNECTION_TransmitHandle *server_notify;
+
+
+
+static struct GNUNET_MESH_Handle *mesh_handle;
+
+static struct GNUNET_CONNECTION_TransmitHandle *server_notify;
 
 /**
  * The UDP-Socket through which DNS-Resolves will be sent if they are not to be
index 632145ae2fc98dc3bf7c073216c5d41f56ce2868..2423009ebe652ef8cf705bebff1198832813ac35 100644 (file)
@@ -1,5 +1,32 @@
-#ifndef GN_DNS_SERVICE_P_H
-#define GN_DNS_SERVICE_P_H
+/*
+      This file is part of GNUnet
+      (C) 2010, 2011, 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 2, 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 include/gnunet_dns_service.h
+ * @brief API to access the DNS service.  Not finished at all,
+ *        currently only contains the structs for the IPC, which
+ *        don't even belong here (legacy code in transition)
+ * @author Philipp Toelke
+ */
+#ifndef GNUNET_DNS_SERVICE_H
+#define GNUNET_DNS_SERVICE_H
 
 #include "gnunet_common.h"
 
index a9ed5b3b2a986034d218f128e63d108e865992b1..37e31d24f9485a42abc91b011d036e6f8f57cf61 100644 (file)
@@ -1,5 +1,30 @@
-#ifndef _GNVPN_DNSP_H_
-#define _GNVPN_DNSP_H_
+/*
+      This file is part of GNUnet
+      (C) 2010, 2011, 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 2, 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 include/gnunet_dnsparse_lib.h
+ * @brief API for helper library to parse DNS packets. 
+ * @author Philipp Toelke
+ */
+#ifndef GNUNET_DNSPARSER_LIB_H
+#define GNUNET_DNSPARSER_LIB_H
 
 #include "platform.h"
 #include "gnunet_common.h"
@@ -50,24 +75,24 @@ struct dns_pkt_parsed
 
 struct dns_query_line
 {
-  unsigned short type;
-  unsigned short class;
+  uint16_t type;
+  uint16_t class;
 };
 
 struct dns_query
 {
   char *name;
   unsigned char namelen;
-  unsigned short qtype;
-  unsigned short qclass;
+  uint16_t qtype;
+  uint16_t qclass;
 };
 
 struct dns_record_line
 {
-  unsigned short type;
-  unsigned short class;
-  unsigned int ttl;
-  unsigned short data_len;
+  uint16_t type;
+  uint16_t class;
+  uint32_t ttl;
+  uint16_t data_len;
   unsigned char data;
 };
 
@@ -75,10 +100,10 @@ struct dns_record
 {
   char *name;
   unsigned char namelen;
-  unsigned short type;
-  unsigned short class;
-  unsigned int ttl;
-  unsigned short data_len;
+  uint16_t type;
+  uint16_t class;
+  uint32_t ttl;
+  uint16_t data_len;
   unsigned char *data;
 };