1 #ifndef GN_DNS_SERVICE_P_H
2 #define GN_DNS_SERVICE_P_H
4 #include "gnunet_common.h"
8 struct GNUNET_MessageHeader hdr;
11 * The IP-Address this query was originally sent to
13 unsigned orig_to:32 GNUNET_PACKED;
15 * The IP-Address this query was originally sent from
17 unsigned orig_from:32 GNUNET_PACKED;
19 * The UDP-Portthis query was originally sent from
21 unsigned src_port:16 GNUNET_PACKED;
23 unsigned char data[1]; /* The DNS-Packet */
26 struct query_packet_list
28 struct query_packet_list *next GNUNET_PACKED;
29 struct query_packet_list *prev GNUNET_PACKED;
30 struct query_packet pkt;
33 enum GNUNET_DNS_ANSWER_Subtype
36 * Answers of this type contain a dns-packet that just has to be transmitted
38 GNUNET_DNS_ANSWER_TYPE_IP,
41 * Answers of this type contain an incomplete dns-packet. The IP-Address
42 * is all 0s. The addroffset points to it.
44 GNUNET_DNS_ANSWER_TYPE_SERVICE,
47 * Answers of this type contain an incomplete dns-packet as answer to a
48 * PTR-Query. The resolved name is not allocated. The addroffset points to it.
50 GNUNET_DNS_ANSWER_TYPE_REV,
53 * Answers of this type contains an IP6-Address but traffic to this IP should
54 * be routed through the GNUNet.
56 GNUNET_DNS_ANSWER_TYPE_REMOTE_AAAA,
59 * Answers of this type contains an IP4-Address but traffic to this IP should
60 * be routed through the GNUNet.
62 GNUNET_DNS_ANSWER_TYPE_REMOTE_A
65 struct GNUNET_vpn_service_descriptor
67 GNUNET_HashCode peer GNUNET_PACKED;
68 GNUNET_HashCode service_descriptor GNUNET_PACKED;
69 uint64_t ports GNUNET_PACKED;
70 uint32_t service_type GNUNET_PACKED;
76 struct GNUNET_MessageHeader hdr;
77 enum GNUNET_DNS_ANSWER_Subtype subtype GNUNET_PACKED;
79 unsigned from:32 GNUNET_PACKED;
80 unsigned to:32 GNUNET_PACKED;
81 unsigned dst_port:16 GNUNET_PACKED;
84 /* Data for GNUNET_DNS_ANSWER_TYPE_SERVICE */
85 struct GNUNET_vpn_service_descriptor service_descr;
88 /* Data for GNUNET_DNS_ANSWER_TYPE_REV */
89 /* The offsett in octets from the beginning of the struct to the field
90 * in data where the IP-Address has to go. */
91 uint16_t addroffset GNUNET_PACKED;
94 /* Data for GNUNET_DNS_ANSWER_TYPE_REMOTE */
97 unsigned char addr[16];
100 unsigned char data[1];
103 struct answer_packet_list
105 struct answer_packet_list *next GNUNET_PACKED;
106 struct answer_packet_list *prev GNUNET_PACKED;
107 struct answer_packet pkt;