1 #ifndef _GNTUN_PACKET_H_
2 #define _GNTUN_PACKET_H_
5 #include "gnunet_common.h"
7 GNUNET_NETWORK_STRUCT_BEGIN
12 unsigned flags:16 GNUNET_PACKED;
13 unsigned type:16 GNUNET_PACKED;
18 unsigned tclass_h:4 GNUNET_PACKED;
19 unsigned version:4 GNUNET_PACKED;
20 unsigned tclass_l:4 GNUNET_PACKED;
21 unsigned flowlbl:20 GNUNET_PACKED;
22 unsigned paylgth:16 GNUNET_PACKED;
23 unsigned nxthdr:8 GNUNET_PACKED;
24 unsigned hoplmt:8 GNUNET_PACKED;
25 unsigned char sadr[16];
26 unsigned char dadr[16];
31 unsigned hdr_lngth:4 GNUNET_PACKED;
32 unsigned version:4 GNUNET_PACKED;
34 unsigned diff_serv:8 GNUNET_PACKED;
35 unsigned tot_lngth:16 GNUNET_PACKED;
37 unsigned ident:16 GNUNET_PACKED;
38 unsigned flags:3 GNUNET_PACKED;
39 unsigned frag_off:13 GNUNET_PACKED;
41 unsigned ttl:8 GNUNET_PACKED;
42 unsigned proto:8 GNUNET_PACKED;
43 unsigned chks:16 GNUNET_PACKED;
45 uint32_t sadr GNUNET_PACKED;
46 uint32_t dadr GNUNET_PACKED;
49 #define TCP_FLAG_SYN 2
53 unsigned spt:16 GNUNET_PACKED;
54 unsigned dpt:16 GNUNET_PACKED;
55 unsigned seq:32 GNUNET_PACKED;
56 unsigned ack:32 GNUNET_PACKED;
57 unsigned off:4 GNUNET_PACKED;
58 unsigned rsv:4 GNUNET_PACKED;
59 unsigned flg:8 GNUNET_PACKED;
60 unsigned wsz:16 GNUNET_PACKED;
61 unsigned crc:16 GNUNET_PACKED;
62 unsigned urg:16 GNUNET_PACKED;
67 unsigned spt:16 GNUNET_PACKED;
68 unsigned dpt:16 GNUNET_PACKED;
69 unsigned len:16 GNUNET_PACKED;
70 unsigned crc:16 GNUNET_PACKED;
75 unsigned type:8 GNUNET_PACKED;
76 unsigned code:8 GNUNET_PACKED;
77 unsigned chks:16 GNUNET_PACKED;
83 uint16_t id GNUNET_PACKED;
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
91 unsigned rcode:4 GNUNET_PACKED; // 0 No error
97 unsigned z:3 GNUNET_PACKED; // reserved
98 unsigned ra:1 GNUNET_PACKED; // recursion available (server -> client)
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
105 GNUNET_NETWORK_STRUCT_END
110 unsigned char data[1];
113 struct dns_pkt_parsed
116 struct dns_query **queries;
117 struct dns_record **answers;
118 struct dns_record **nameservers;
119 struct dns_record **additional;
122 struct dns_query_line
125 unsigned short class;
131 unsigned char namelen;
132 unsigned short qtype;
133 unsigned short qclass;
136 struct dns_record_line
139 unsigned short class;
141 unsigned short data_len;
148 unsigned char namelen;
150 unsigned short class;
152 unsigned short data_len;
158 struct udp_pkt udp_hdr;
162 GNUNET_NETWORK_STRUCT_BEGIN
167 struct GNUNET_MessageHeader shdr;
173 struct GNUNET_MessageHeader shdr;
175 struct ip6_hdr ip6_hdr;
176 unsigned char data[1];
181 struct GNUNET_MessageHeader shdr;
183 struct ip6_hdr ip6_hdr;
184 struct tcp_pkt tcp_hdr;
185 unsigned char data[1];
190 struct GNUNET_MessageHeader shdr;
192 struct ip6_hdr ip6_hdr;
193 struct icmp_hdr icmp_hdr;
198 struct GNUNET_MessageHeader shdr;
200 struct ip6_hdr ip6_hdr;
201 struct udp_pkt udp_hdr;
202 unsigned char data[1];
207 struct GNUNET_MessageHeader shdr;
209 struct ip6_hdr ip6_hdr;
210 struct udp_dns udp_dns;
215 struct GNUNET_MessageHeader shdr;
217 struct ip_hdr ip_hdr;
218 unsigned char data[1];
223 struct GNUNET_MessageHeader shdr;
225 struct ip_hdr ip_hdr;
226 struct udp_pkt udp_hdr;
227 unsigned char data[1];
232 struct GNUNET_MessageHeader shdr;
234 struct ip_hdr ip_hdr;
235 struct udp_dns udp_dns;
240 struct GNUNET_MessageHeader shdr;
242 struct ip_hdr ip_hdr;
243 struct tcp_pkt tcp_hdr;
244 unsigned char data[1];
249 struct GNUNET_MessageHeader shdr;
251 struct ip_hdr ip_hdr;
252 struct icmp_hdr icmp_hdr;
254 GNUNET_NETWORK_STRUCT_END