1 #ifndef GN_DNS_SERVICE_P_H
2 #define GN_DNS_SERVICE_P_H
4 #include "gnunet_common.h"
7 struct GNUNET_MessageHeader hdr;
10 * The IP-Address this query was originally sent to
12 unsigned orig_to:32 GNUNET_PACKED;
14 * The IP-Address this query was originally sent from
16 unsigned orig_from:32 GNUNET_PACKED;
18 * The UDP-Portthis query was originally sent from
20 unsigned src_port:16 GNUNET_PACKED;
22 unsigned char data[1]; /* The DNS-Packet */
25 struct query_packet_list {
26 struct query_packet_list* next GNUNET_PACKED;
27 struct query_packet_list* prev GNUNET_PACKED;
28 struct query_packet pkt;
31 enum GNUNET_DNS_ANSWER_Subtype {
33 * Answers of this type contain a dns-packet that just has to be transmitted
35 GNUNET_DNS_ANSWER_TYPE_IP,
38 * Answers of this type contain an incomplete dns-packet. The IP-Address
39 * is all 0s. The addroffset points to it.
41 GNUNET_DNS_ANSWER_TYPE_SERVICE,
44 * Answers of this type contain an incomplete dns-packet as answer to a
45 * PTR-Query. The resolved name is not allocated. The addroffset points to it.
47 GNUNET_DNS_ANSWER_TYPE_REV,
50 * Answers of this type contains an IP-Address but traffic to this IP should
51 * be routed through the GNUNet.
53 GNUNET_DNS_ANSWER_TYPE_REMOTE
56 struct GNUNET_vpn_service_descriptor {
57 GNUNET_HashCode peer GNUNET_PACKED;
58 GNUNET_HashCode service_descriptor GNUNET_PACKED;
59 uint64_t ports GNUNET_PACKED;
60 uint32_t service_type GNUNET_PACKED;
63 struct answer_packet {
65 struct GNUNET_MessageHeader hdr;
66 enum GNUNET_DNS_ANSWER_Subtype subtype GNUNET_PACKED;
68 unsigned from:32 GNUNET_PACKED;
69 unsigned to:32 GNUNET_PACKED;
70 unsigned dst_port:16 GNUNET_PACKED;
73 /* Data for GNUNET_DNS_ANSWER_TYPE_SERVICE */
74 struct GNUNET_vpn_service_descriptor service_descr;
77 /* Data for GNUNET_DNS_ANSWER_TYPE_REV */
78 /* The offsett in octets from the beginning of the struct to the field
79 * in data where the IP-Address has to go. */
80 uint16_t addroffset GNUNET_PACKED;
83 /* Data for GNUNET_DNS_ANSWER_TYPE_REMOTE */
86 unsigned char addr[16];
89 unsigned char data[1];
92 struct answer_packet_list {
93 struct answer_packet_list* next GNUNET_PACKED;
94 struct answer_packet_list* prev GNUNET_PACKED;
95 struct answer_packet pkt;