aboutsummaryrefslogtreecommitdiff
path: root/src/dns
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-02 10:38:00 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-02 10:38:00 +0000
commit67ec95738fc930f5411f879df18ca1dcc8ce2bdd (patch)
tree9a2edb662e30a9e075a9f2902a0fc6c79f83b54d /src/dns
parentb36b0e9f8ee778f309f202e55b408522023625fa (diff)
downloadgnunet-67ec95738fc930f5411f879df18ca1dcc8ce2bdd.tar.gz
gnunet-67ec95738fc930f5411f879df18ca1dcc8ce2bdd.zip
-minor cleanup
Diffstat (limited to 'src/dns')
-rw-r--r--src/dns/gnunet-service-dns.c118
1 files changed, 59 insertions, 59 deletions
diff --git a/src/dns/gnunet-service-dns.c b/src/dns/gnunet-service-dns.c
index 15f0ea492..c0e7e56ff 100644
--- a/src/dns/gnunet-service-dns.c
+++ b/src/dns/gnunet-service-dns.c
@@ -43,54 +43,6 @@
43 43
44#include "dns.h" 44#include "dns.h"
45 45
46
47
48struct answer_packet_list
49{
50 struct answer_packet_list *next GNUNET_PACKED;
51 struct answer_packet_list *prev GNUNET_PACKED;
52 struct GNUNET_SERVER_Client *client;
53 struct answer_packet pkt;
54};
55
56
57
58static struct GNUNET_MESH_Handle *mesh_handle;
59
60static struct GNUNET_CONNECTION_TransmitHandle *server_notify;
61
62/**
63 * The UDP-Socket through which DNS-Resolves will be sent if they are not to be
64 * sent through gnunet. The port of this socket will not be hijacked.
65 */
66static struct GNUNET_NETWORK_Handle *dnsout;
67static struct GNUNET_NETWORK_Handle *dnsout6;
68
69/**
70 * The port bound to the socket dnsout
71 */
72static unsigned short dnsoutport;
73
74/**
75 * A handle to the DHT-Service
76 */
77static struct GNUNET_DHT_Handle *dht;
78
79/**
80 * The configuration to use
81 */
82static const struct GNUNET_CONFIGURATION_Handle *cfg;
83
84/**
85 * A list of DNS-Responses that have to be sent to the requesting client
86 */
87static struct answer_packet_list *head;
88
89/**
90 * The tail of the list of DNS-responses
91 */
92static struct answer_packet_list *tail;
93
94/** 46/**
95 * A structure containing a mapping from network-byte-ordered DNS-id (16 bit) to 47 * A structure containing a mapping from network-byte-ordered DNS-id (16 bit) to
96 * some information needed to handle this query 48 * some information needed to handle this query
@@ -139,6 +91,65 @@ struct tunnel_state
139 struct GNUNET_MESH_TransmitHandle *th; 91 struct GNUNET_MESH_TransmitHandle *th;
140}; 92};
141 93
94
95struct answer_packet_list
96{
97 struct answer_packet_list *next;
98 struct answer_packet_list *prev;
99 struct GNUNET_SERVER_Client *client;
100 struct answer_packet pkt;
101};
102
103GNUNET_NETWORK_STRUCT_BEGIN
104struct tunnel_cls
105{
106 struct GNUNET_MESH_Tunnel *tunnel;
107 struct GNUNET_MessageHeader hdr;
108 struct dns_pkt dns;
109};
110GNUNET_NETWORK_STRUCT_END
111
112struct tunnel_cls *remote_pending[UINT16_MAX];
113
114
115static struct GNUNET_MESH_Handle *mesh_handle;
116
117static struct GNUNET_CONNECTION_TransmitHandle *server_notify;
118
119/**
120 * The UDP-Socket through which DNS-Resolves will be sent if they are not to be
121 * sent through gnunet. The port of this socket will not be hijacked.
122 */
123static struct GNUNET_NETWORK_Handle *dnsout;
124
125static struct GNUNET_NETWORK_Handle *dnsout6;
126
127/**
128 * The port bound to the socket dnsout
129 */
130static unsigned short dnsoutport;
131
132/**
133 * A handle to the DHT-Service
134 */
135static struct GNUNET_DHT_Handle *dht;
136
137/**
138 * The configuration to use
139 */
140static const struct GNUNET_CONFIGURATION_Handle *cfg;
141
142/**
143 * A list of DNS-Responses that have to be sent to the requesting client
144 */
145static struct answer_packet_list *head;
146
147/**
148 * The tail of the list of DNS-responses
149 */
150static struct answer_packet_list *tail;
151
152
142static size_t 153static size_t
143send_answer (void *cls, size_t size, void *buf); 154send_answer (void *cls, size_t size, void *buf);
144 155
@@ -300,17 +311,6 @@ send_answer (void *cls, size_t size, void *buf)
300 return len; 311 return len;
301} 312}
302 313
303GNUNET_NETWORK_STRUCT_BEGIN
304
305struct tunnel_cls
306{
307 struct GNUNET_MESH_Tunnel *tunnel GNUNET_PACKED;
308 struct GNUNET_MessageHeader hdr;
309 struct dns_pkt dns;
310};
311GNUNET_NETWORK_STRUCT_END
312
313struct tunnel_cls *remote_pending[UINT16_MAX];
314 314
315static size_t 315static size_t
316mesh_send_response (void *cls, size_t size, void *buf) 316mesh_send_response (void *cls, size_t size, void *buf)