aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-02 04:37:59 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-02 04:37:59 +0000
commit86a020dbabef7e047706f462840bfe66b036093c (patch)
treee19123a84f515ad810ed892811a5c6492b6b971f /src/include
parent1fd2ff9b321277b55444c2a074e6476cc10099c2 (diff)
downloadgnunet-86a020dbabef7e047706f462840bfe66b036093c.tar.gz
gnunet-86a020dbabef7e047706f462840bfe66b036093c.zip
-small steps towards saner DNS API
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_dns_service.h69
1 files changed, 36 insertions, 33 deletions
diff --git a/src/include/gnunet_dns_service.h b/src/include/gnunet_dns_service.h
index a6471d6e9..c42f7787f 100644
--- a/src/include/gnunet_dns_service.h
+++ b/src/include/gnunet_dns_service.h
@@ -36,35 +36,6 @@
36#include "gnunet_common.h" 36#include "gnunet_common.h"
37#include "gnunet_util_lib.h" 37#include "gnunet_util_lib.h"
38 38
39GNUNET_NETWORK_STRUCT_BEGIN
40
41struct query_packet
42{
43 struct GNUNET_MessageHeader hdr;
44
45 /**
46 * The IP-Address this query was originally sent to
47 */
48 char orig_to[16];
49 /**
50 * The IP-Address this query was originally sent from
51 */
52 char orig_from[16];
53 /**
54 * The UDP-Portthis query was originally sent from
55 */
56 char addrlen;
57 uint16_t src_port GNUNET_PACKED;
58
59 unsigned char data[1]; /* The DNS-Packet */
60};
61
62struct query_packet_list
63{
64 struct query_packet_list *next GNUNET_PACKED;
65 struct query_packet_list *prev GNUNET_PACKED;
66 struct query_packet pkt;
67};
68 39
69enum GNUNET_DNS_ANSWER_Subtype 40enum GNUNET_DNS_ANSWER_Subtype
70{ 41{
@@ -106,6 +77,7 @@ struct GNUNET_vpn_service_descriptor
106 uint32_t service_type GNUNET_PACKED; 77 uint32_t service_type GNUNET_PACKED;
107}; 78};
108 79
80GNUNET_NETWORK_STRUCT_BEGIN
109struct answer_packet 81struct answer_packet
110{ 82{
111 /* General data */ 83 /* General data */
@@ -161,12 +133,43 @@ GNUNET_DNS_restart_hijack (struct GNUNET_DNS_Handle *h);
161 133
162 134
163/** 135/**
164 * FIXME: we should not expost our internal structures like this. 136 * Process a DNS request sent to an IPv4 resolver. Pass it
165 * Just a quick initial hack. 137 * to the DNS service for resolution.
138 *
139 * @param h DNS handle
140 * @param dst_ip destination IPv4 address
141 * @param src_ip source IPv4 address (usually local machine)
142 * @param src_port source port (to be used for reply)
143 * @param udp_packet_len length of the UDP payload in bytes
144 * @param udp_packet UDP payload
145 */
146void
147GNUNET_DNS_queue_request_v4 (struct GNUNET_DNS_Handle *h,
148 const struct in_addr *dst_ip,
149 const struct in_addr *src_ip,
150 uint16_t src_port,
151 size_t udp_packet_len,
152 const char *udp_packet);
153
154/**
155 * Process a DNS request sent to an IPv6 resolver. Pass it
156 * to the DNS service for resolution.
157 *
158 * @param h DNS handle
159 * @param dst_ip destination IPv6 address
160 * @param src_ip source IPv6 address (usually local machine)
161 * @param src_port source port (to be used for reply)
162 * @param udp_packet_len length of the UDP payload in bytes
163 * @param udp_packet UDP payload
166 */ 164 */
167void 165void
168GNUNET_DNS_queue_request (struct GNUNET_DNS_Handle *h, 166GNUNET_DNS_queue_request_v6 (struct GNUNET_DNS_Handle *h,
169 struct query_packet_list *q); 167 const struct in6_addr *dst_ip,
168 const struct in6_addr *src_ip,
169 uint16_t src_port,
170 size_t udp_packet_len,
171 const char *udp_packet);
172
170 173
171void 174void
172GNUNET_DNS_disconnect (struct GNUNET_DNS_Handle *h); 175GNUNET_DNS_disconnect (struct GNUNET_DNS_Handle *h);