From: Christian Grothoff Date: Sun, 1 Jan 2012 23:07:37 +0000 (+0000) Subject: -some code cleanup X-Git-Tag: initial-import-from-subversion-38251~15488 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=aaa3fa556962845e925dbe5dabc8987584422734;p=oweals%2Fgnunet.git -some code cleanup --- diff --git a/configure.ac b/configure.ac index c33bdbd63..d2a6939b3 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/src/dns/gnunet-service-dns.c b/src/dns/gnunet-service-dns.c index ee42a7001..065c085c7 100644 --- a/src/dns/gnunet-service-dns.c +++ b/src/dns/gnunet-service-dns.c @@ -41,9 +41,13 @@ #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 diff --git a/src/include/gnunet_dns_service.h b/src/include/gnunet_dns_service.h index 632145ae2..2423009eb 100644 --- a/src/include/gnunet_dns_service.h +++ b/src/include/gnunet_dns_service.h @@ -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" diff --git a/src/include/gnunet_dnsparser_lib.h b/src/include/gnunet_dnsparser_lib.h index a9ed5b3b2..37e31d24f 100644 --- a/src/include/gnunet_dnsparser_lib.h +++ b/src/include/gnunet_dnsparser_lib.h @@ -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; };