1 #ifndef GN_DNS_SERVICE_P_H
2 #define GN_DNS_SERVICE_P_H
4 #include "gnunet_common.h"
6 GNUNET_NETWORK_STRUCT_BEGIN
10 struct GNUNET_MessageHeader hdr;
13 * The IP-Address this query was originally sent to
17 * The IP-Address this query was originally sent from
21 * The UDP-Portthis query was originally sent from
24 uint16_t src_port GNUNET_PACKED;
26 unsigned char data[1]; /* The DNS-Packet */
29 struct query_packet_list
31 struct query_packet_list *next GNUNET_PACKED;
32 struct query_packet_list *prev GNUNET_PACKED;
33 struct query_packet pkt;
36 enum GNUNET_DNS_ANSWER_Subtype
39 * Answers of this type contain a dns-packet that just has to be transmitted
41 GNUNET_DNS_ANSWER_TYPE_IP,
44 * Answers of this type contain an incomplete dns-packet. The IP-Address
45 * is all 0s. The addroffset points to it.
47 GNUNET_DNS_ANSWER_TYPE_SERVICE,
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.
53 GNUNET_DNS_ANSWER_TYPE_REV,
56 * Answers of this type contains an IP6-Address but traffic to this IP should
57 * be routed through the GNUNet.
59 GNUNET_DNS_ANSWER_TYPE_REMOTE_AAAA,
62 * Answers of this type contains an IP4-Address but traffic to this IP should
63 * be routed through the GNUNet.
65 GNUNET_DNS_ANSWER_TYPE_REMOTE_A
68 struct GNUNET_vpn_service_descriptor
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;
79 struct GNUNET_MessageHeader hdr;
80 enum GNUNET_DNS_ANSWER_Subtype subtype GNUNET_PACKED;
85 unsigned dst_port:16 GNUNET_PACKED;
88 /* Data for GNUNET_DNS_ANSWER_TYPE_SERVICE */
89 struct GNUNET_vpn_service_descriptor service_descr;
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;
98 /* Data for GNUNET_DNS_ANSWER_TYPE_REMOTE */
101 unsigned char addr[16];
104 unsigned char data[1];
107 struct answer_packet_list
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;
114 GNUNET_NETWORK_STRUCT_END