aboutsummaryrefslogtreecommitdiff
path: root/src/vpn/gnunet-vpn-packet.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vpn/gnunet-vpn-packet.h')
-rw-r--r--src/vpn/gnunet-vpn-packet.h75
1 files changed, 1 insertions, 74 deletions
diff --git a/src/vpn/gnunet-vpn-packet.h b/src/vpn/gnunet-vpn-packet.h
index 9cbbf1bb2..19b2c8d7b 100644
--- a/src/vpn/gnunet-vpn-packet.h
+++ b/src/vpn/gnunet-vpn-packet.h
@@ -3,6 +3,7 @@
3 3
4#include "platform.h" 4#include "platform.h"
5#include "gnunet_common.h" 5#include "gnunet_common.h"
6#include "gnunet-dns-parser.h"
6 7
7GNUNET_NETWORK_STRUCT_BEGIN 8GNUNET_NETWORK_STRUCT_BEGIN
8 9
@@ -76,82 +77,8 @@ struct icmp_hdr
76 unsigned code:8 GNUNET_PACKED; 77 unsigned code:8 GNUNET_PACKED;
77 unsigned chks:16 GNUNET_PACKED; 78 unsigned chks:16 GNUNET_PACKED;
78}; 79};
79
80// DNS-Stuff
81struct dns_static
82{
83 uint16_t id GNUNET_PACKED;
84
85 unsigned rd:1 GNUNET_PACKED; // recursion desired (client -> server)
86 unsigned tc:1 GNUNET_PACKED; // message is truncated
87 unsigned aa:1 GNUNET_PACKED; // authoritative answer
88 unsigned op:4 GNUNET_PACKED; // query:0, inverse q.:1, status: 2
89 unsigned qr:1 GNUNET_PACKED; // query:0, response:1
90
91 unsigned rcode:4 GNUNET_PACKED; // 0 No error
92 // 1 Format error
93 // 2 Server failure
94 // 3 Name Error
95 // 4 Not Implemented
96 // 5 Refused
97 unsigned z:3 GNUNET_PACKED; // reserved
98 unsigned ra:1 GNUNET_PACKED; // recursion available (server -> client)
99
100 uint16_t qdcount GNUNET_PACKED; // number of questions
101 uint16_t ancount GNUNET_PACKED; // number of answers
102 uint16_t nscount GNUNET_PACKED; // number of authority-records
103 uint16_t arcount GNUNET_PACKED; // number of additional records
104};
105GNUNET_NETWORK_STRUCT_END 80GNUNET_NETWORK_STRUCT_END
106 81
107struct dns_pkt
108{
109 struct dns_static s;
110 unsigned char data[1];
111};
112
113struct dns_pkt_parsed
114{
115 struct dns_static s;
116 struct dns_query **queries;
117 struct dns_record **answers;
118 struct dns_record **nameservers;
119 struct dns_record **additional;
120};
121
122struct dns_query_line
123{
124 unsigned short type;
125 unsigned short class;
126};
127
128struct dns_query
129{
130 char *name;
131 unsigned char namelen;
132 unsigned short qtype;
133 unsigned short qclass;
134};
135
136struct dns_record_line
137{
138 unsigned short type;
139 unsigned short class;
140 unsigned int ttl;
141 unsigned short data_len;
142 unsigned char data;
143};
144
145struct dns_record
146{
147 char *name;
148 unsigned char namelen;
149 unsigned short type;
150 unsigned short class;
151 unsigned int ttl;
152 unsigned short data_len;
153 unsigned char *data;
154};
155 82
156struct udp_dns 83struct udp_dns
157{ 84{