seaspidering
[oweals/gnunet.git] / src / vpn / gnunet-service-dns-p.h
1 #ifndef GN_DNS_SERVICE_P_H
2 #define GN_DNS_SERVICE_P_H
3
4 #include "gnunet_common.h"
5
6 struct query_packet {
7         struct GNUNET_MessageHeader hdr;
8         
9         unsigned orig_to:32 GNUNET_PACKED; /* The IP-Address, this query was originally sent to */
10         unsigned orig_from:32 GNUNET_PACKED;
11         unsigned src_port:16 GNUNET_PACKED;
12
13         unsigned char data[1]; /* The DNS-Packet */
14 };
15
16 struct query_packet_list {
17         struct query_packet_list* next GNUNET_PACKED;
18         struct query_packet_list* prev GNUNET_PACKED;
19         struct query_packet pkt;
20 };
21
22 enum GNUNET_DNS_ANSWER_Subtype {
23     /**
24      * Answers of this type contain a dns-packet that just has to be transmitted
25      */
26     GNUNET_DNS_ANSWER_TYPE_IP,
27
28     /**
29      * Answers of this type contain an struct GNUNET_DNS_Record
30      */
31     GNUNET_DNS_ANSWER_TYPE_SERVICE
32 };
33
34 struct answer_packet {
35     struct GNUNET_MessageHeader hdr;
36     enum GNUNET_DNS_ANSWER_Subtype subtype GNUNET_PACKED;
37
38     unsigned from:32 GNUNET_PACKED;
39     unsigned to:32 GNUNET_PACKED;
40     unsigned dst_port:16 GNUNET_PACKED;
41
42     GNUNET_HashCode peer;
43     GNUNET_HashCode service_descriptor;
44     uint64_t ports;
45     uint32_t service_type;
46
47     unsigned addroffset:16 GNUNET_PACKED;
48
49     unsigned char data[1];
50 };
51
52 struct answer_packet_list {
53         struct answer_packet_list* next GNUNET_PACKED;
54         struct answer_packet_list* prev GNUNET_PACKED;
55         struct answer_packet pkt;
56 };
57
58 #endif