diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-01-02 10:38:00 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-01-02 10:38:00 +0000 |
commit | 67ec95738fc930f5411f879df18ca1dcc8ce2bdd (patch) | |
tree | 9a2edb662e30a9e075a9f2902a0fc6c79f83b54d /src/dns | |
parent | b36b0e9f8ee778f309f202e55b408522023625fa (diff) | |
download | gnunet-67ec95738fc930f5411f879df18ca1dcc8ce2bdd.tar.gz gnunet-67ec95738fc930f5411f879df18ca1dcc8ce2bdd.zip |
-minor cleanup
Diffstat (limited to 'src/dns')
-rw-r--r-- | src/dns/gnunet-service-dns.c | 118 |
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 | |||
48 | struct 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 | |||
58 | static struct GNUNET_MESH_Handle *mesh_handle; | ||
59 | |||
60 | static 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 | */ | ||
66 | static struct GNUNET_NETWORK_Handle *dnsout; | ||
67 | static struct GNUNET_NETWORK_Handle *dnsout6; | ||
68 | |||
69 | /** | ||
70 | * The port bound to the socket dnsout | ||
71 | */ | ||
72 | static unsigned short dnsoutport; | ||
73 | |||
74 | /** | ||
75 | * A handle to the DHT-Service | ||
76 | */ | ||
77 | static struct GNUNET_DHT_Handle *dht; | ||
78 | |||
79 | /** | ||
80 | * The configuration to use | ||
81 | */ | ||
82 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | ||
83 | |||
84 | /** | ||
85 | * A list of DNS-Responses that have to be sent to the requesting client | ||
86 | */ | ||
87 | static struct answer_packet_list *head; | ||
88 | |||
89 | /** | ||
90 | * The tail of the list of DNS-responses | ||
91 | */ | ||
92 | static 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 | |||
95 | struct 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 | |||
103 | GNUNET_NETWORK_STRUCT_BEGIN | ||
104 | struct tunnel_cls | ||
105 | { | ||
106 | struct GNUNET_MESH_Tunnel *tunnel; | ||
107 | struct GNUNET_MessageHeader hdr; | ||
108 | struct dns_pkt dns; | ||
109 | }; | ||
110 | GNUNET_NETWORK_STRUCT_END | ||
111 | |||
112 | struct tunnel_cls *remote_pending[UINT16_MAX]; | ||
113 | |||
114 | |||
115 | static struct GNUNET_MESH_Handle *mesh_handle; | ||
116 | |||
117 | static 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 | */ | ||
123 | static struct GNUNET_NETWORK_Handle *dnsout; | ||
124 | |||
125 | static struct GNUNET_NETWORK_Handle *dnsout6; | ||
126 | |||
127 | /** | ||
128 | * The port bound to the socket dnsout | ||
129 | */ | ||
130 | static unsigned short dnsoutport; | ||
131 | |||
132 | /** | ||
133 | * A handle to the DHT-Service | ||
134 | */ | ||
135 | static struct GNUNET_DHT_Handle *dht; | ||
136 | |||
137 | /** | ||
138 | * The configuration to use | ||
139 | */ | ||
140 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | ||
141 | |||
142 | /** | ||
143 | * A list of DNS-Responses that have to be sent to the requesting client | ||
144 | */ | ||
145 | static struct answer_packet_list *head; | ||
146 | |||
147 | /** | ||
148 | * The tail of the list of DNS-responses | ||
149 | */ | ||
150 | static struct answer_packet_list *tail; | ||
151 | |||
152 | |||
142 | static size_t | 153 | static size_t |
143 | send_answer (void *cls, size_t size, void *buf); | 154 | send_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 | ||
303 | GNUNET_NETWORK_STRUCT_BEGIN | ||
304 | |||
305 | struct tunnel_cls | ||
306 | { | ||
307 | struct GNUNET_MESH_Tunnel *tunnel GNUNET_PACKED; | ||
308 | struct GNUNET_MessageHeader hdr; | ||
309 | struct dns_pkt dns; | ||
310 | }; | ||
311 | GNUNET_NETWORK_STRUCT_END | ||
312 | |||
313 | struct tunnel_cls *remote_pending[UINT16_MAX]; | ||
314 | 314 | ||
315 | static size_t | 315 | static size_t |
316 | mesh_send_response (void *cls, size_t size, void *buf) | 316 | mesh_send_response (void *cls, size_t size, void *buf) |