aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_dns_service.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-01 23:00:59 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-01 23:00:59 +0000
commit66ffc809472f27d69b9ad7361f8ba29c2674f716 (patch)
tree609623cb79291939f9cb81a8858853a202dae2ca /src/include/gnunet_dns_service.h
parent131c43b2b18b12e52ff045e51025706802cbd2e2 (diff)
downloadgnunet-66ffc809472f27d69b9ad7361f8ba29c2674f716.tar.gz
gnunet-66ffc809472f27d69b9ad7361f8ba29c2674f716.zip
-moving DNS code into its own directory
Diffstat (limited to 'src/include/gnunet_dns_service.h')
-rw-r--r--src/include/gnunet_dns_service.h116
1 files changed, 116 insertions, 0 deletions
diff --git a/src/include/gnunet_dns_service.h b/src/include/gnunet_dns_service.h
new file mode 100644
index 000000000..632145ae2
--- /dev/null
+++ b/src/include/gnunet_dns_service.h
@@ -0,0 +1,116 @@
1#ifndef GN_DNS_SERVICE_P_H
2#define GN_DNS_SERVICE_P_H
3
4#include "gnunet_common.h"
5
6GNUNET_NETWORK_STRUCT_BEGIN
7
8struct query_packet
9{
10 struct GNUNET_MessageHeader hdr;
11
12 /**
13 * The IP-Address this query was originally sent to
14 */
15 char orig_to[16];
16 /**
17 * The IP-Address this query was originally sent from
18 */
19 char orig_from[16];
20 /**
21 * The UDP-Portthis query was originally sent from
22 */
23 char addrlen;
24 uint16_t src_port GNUNET_PACKED;
25
26 unsigned char data[1]; /* The DNS-Packet */
27};
28
29struct query_packet_list
30{
31 struct query_packet_list *next GNUNET_PACKED;
32 struct query_packet_list *prev GNUNET_PACKED;
33 struct query_packet pkt;
34};
35
36enum GNUNET_DNS_ANSWER_Subtype
37{
38 /**
39 * Answers of this type contain a dns-packet that just has to be transmitted
40 */
41 GNUNET_DNS_ANSWER_TYPE_IP,
42
43 /**
44 * Answers of this type contain an incomplete dns-packet. The IP-Address
45 * is all 0s. The addroffset points to it.
46 */
47 GNUNET_DNS_ANSWER_TYPE_SERVICE,
48
49 /**
50 * Answers of this type contain an incomplete dns-packet as answer to a
51 * PTR-Query. The resolved name is not allocated. The addroffset points to it.
52 */
53 GNUNET_DNS_ANSWER_TYPE_REV,
54
55 /**
56 * Answers of this type contains an IP6-Address but traffic to this IP should
57 * be routed through the GNUNet.
58 */
59 GNUNET_DNS_ANSWER_TYPE_REMOTE_AAAA,
60
61 /**
62 * Answers of this type contains an IP4-Address but traffic to this IP should
63 * be routed through the GNUNet.
64 */
65 GNUNET_DNS_ANSWER_TYPE_REMOTE_A
66};
67
68struct GNUNET_vpn_service_descriptor
69{
70 GNUNET_HashCode peer GNUNET_PACKED;
71 GNUNET_HashCode service_descriptor GNUNET_PACKED;
72 uint64_t ports GNUNET_PACKED;
73 uint32_t service_type GNUNET_PACKED;
74};
75
76struct answer_packet
77{
78 /* General data */
79 struct GNUNET_MessageHeader hdr;
80 enum GNUNET_DNS_ANSWER_Subtype subtype GNUNET_PACKED;
81
82 char from[16];
83 char to[16];
84 char addrlen;
85 unsigned dst_port:16 GNUNET_PACKED;
86 /* -- */
87
88 /* Data for GNUNET_DNS_ANSWER_TYPE_SERVICE */
89 struct GNUNET_vpn_service_descriptor service_descr;
90 /* -- */
91
92 /* Data for GNUNET_DNS_ANSWER_TYPE_REV */
93 /* The offsett in octets from the beginning of the struct to the field
94 * in data where the IP-Address has to go. */
95 uint16_t addroffset GNUNET_PACKED;
96 /* -- */
97
98 /* Data for GNUNET_DNS_ANSWER_TYPE_REMOTE */
99 /* either 4 or 16 */
100 char addrsize;
101 unsigned char addr[16];
102 /* -- */
103
104 unsigned char data[1];
105};
106
107struct answer_packet_list
108{
109 struct answer_packet_list *next GNUNET_PACKED;
110 struct answer_packet_list *prev GNUNET_PACKED;
111 struct GNUNET_SERVER_Client *client;
112 struct answer_packet pkt;
113};
114GNUNET_NETWORK_STRUCT_END
115
116#endif