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