aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-01 23:07:37 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-01 23:07:37 +0000
commitaaa3fa556962845e925dbe5dabc8987584422734 (patch)
tree9b3060b03863822a9ecf91862224392d62c3e348
parent83530e3ab60f3035185c1f32333ed7b8b62e58be (diff)
downloadgnunet-aaa3fa556962845e925dbe5dabc8987584422734.tar.gz
gnunet-aaa3fa556962845e925dbe5dabc8987584422734.zip
-some code cleanup
-rw-r--r--configure.ac1
-rw-r--r--src/dns/gnunet-service-dns.c8
-rw-r--r--src/include/gnunet_dns_service.h31
-rw-r--r--src/include/gnunet_dnsparser_lib.h53
4 files changed, 75 insertions, 18 deletions
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
820src/datacache/Makefile 820src/datacache/Makefile
821src/datastore/Makefile 821src/datastore/Makefile
822src/dht/Makefile 822src/dht/Makefile
823src/dns/Makefile
823src/dv/Makefile 824src/dv/Makefile
824src/fragmentation/Makefile 825src/fragmentation/Makefile
825src/fs/Makefile 826src/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 @@
41#include "gnunet_mesh_service.h" 41#include "gnunet_mesh_service.h"
42#include "gnunet_signatures.h" 42#include "gnunet_signatures.h"
43 43
44struct GNUNET_MESH_Handle *mesh_handle;
45 44
46struct GNUNET_CONNECTION_TransmitHandle *server_notify; 45
46
47
48static struct GNUNET_MESH_Handle *mesh_handle;
49
50static struct GNUNET_CONNECTION_TransmitHandle *server_notify;
47 51
48/** 52/**
49 * The UDP-Socket through which DNS-Resolves will be sent if they are not to be 53 * 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 @@
1#ifndef GN_DNS_SERVICE_P_H 1/*
2#define GN_DNS_SERVICE_P_H 2 This file is part of GNUnet
3 (C) 2010, 2011, 2012 Christian Grothoff (and other contributing authors)
4
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 2, or (at your
8 option) any later version.
9
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.
14
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.
19 */
20
21/**
22 * @file include/gnunet_dns_service.h
23 * @brief API to access the DNS service. Not finished at all,
24 * currently only contains the structs for the IPC, which
25 * don't even belong here (legacy code in transition)
26 * @author Philipp Toelke
27 */
28#ifndef GNUNET_DNS_SERVICE_H
29#define GNUNET_DNS_SERVICE_H
3 30
4#include "gnunet_common.h" 31#include "gnunet_common.h"
5 32
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 @@
1#ifndef _GNVPN_DNSP_H_ 1/*
2#define _GNVPN_DNSP_H_ 2 This file is part of GNUnet
3 (C) 2010, 2011, 2012 Christian Grothoff (and other contributing authors)
4
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 2, or (at your
8 option) any later version.
9
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.
14
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.
19 */
20
21/**
22 * @file include/gnunet_dnsparse_lib.h
23 * @brief API for helper library to parse DNS packets.
24 * @author Philipp Toelke
25 */
26#ifndef GNUNET_DNSPARSER_LIB_H
27#define GNUNET_DNSPARSER_LIB_H
3 28
4#include "platform.h" 29#include "platform.h"
5#include "gnunet_common.h" 30#include "gnunet_common.h"
@@ -50,24 +75,24 @@ struct dns_pkt_parsed
50 75
51struct dns_query_line 76struct dns_query_line
52{ 77{
53 unsigned short type; 78 uint16_t type;
54 unsigned short class; 79 uint16_t class;
55}; 80};
56 81
57struct dns_query 82struct dns_query
58{ 83{
59 char *name; 84 char *name;
60 unsigned char namelen; 85 unsigned char namelen;
61 unsigned short qtype; 86 uint16_t qtype;
62 unsigned short qclass; 87 uint16_t qclass;
63}; 88};
64 89
65struct dns_record_line 90struct dns_record_line
66{ 91{
67 unsigned short type; 92 uint16_t type;
68 unsigned short class; 93 uint16_t class;
69 unsigned int ttl; 94 uint32_t ttl;
70 unsigned short data_len; 95 uint16_t data_len;
71 unsigned char data; 96 unsigned char data;
72}; 97};
73 98
@@ -75,10 +100,10 @@ struct dns_record
75{ 100{
76 char *name; 101 char *name;
77 unsigned char namelen; 102 unsigned char namelen;
78 unsigned short type; 103 uint16_t type;
79 unsigned short class; 104 uint16_t class;
80 unsigned int ttl; 105 uint32_t ttl;
81 unsigned short data_len; 106 uint16_t data_len;
82 unsigned char *data; 107 unsigned char *data;
83}; 108};
84 109