};
struct ip_hdr {
- unsigned version:4 GNUNET_PACKED;
unsigned hdr_lngth:4 GNUNET_PACKED;
+ unsigned version:4 GNUNET_PACKED;
+
unsigned diff_serv:8 GNUNET_PACKED;
unsigned tot_lngth:16 GNUNET_PACKED;
};
// DNS-Stuff
-struct dns_pkt {
+struct dns_static {
unsigned short id GNUNET_PACKED;
unsigned rd:1 GNUNET_PACKED; // recursion desired (client -> server)
unsigned short ancount GNUNET_PACKED; // number of answers
unsigned short nscount GNUNET_PACKED; // number of authority-records
unsigned short arcount GNUNET_PACKED; // number of additional records
+};
+
+struct dns_pkt {
+ struct dns_static s;
unsigned char data[1];
};
+struct dns_pkt_parsed {
+ struct dns_static s;
+ struct dns_query** queries;
+ struct dns_record** answers;
+ struct dns_record** nameservers;
+ struct dns_record** additional;
+};
+
struct dns_query {
- unsigned char* name;
+ char* name;
+ unsigned char namelen;
unsigned short qtype;
unsigned short qclass;
};
struct dns_record {
- unsigned char* name;
+ char* name;
+ unsigned char namelen;
unsigned short type;
unsigned short class;
unsigned int ttl;
unsigned char* data;
};
+struct udp_dns {
+ struct udp_pkt udp_hdr;
+ struct dns_pkt data;
+};
+
// Complete Packets
+struct tun_pkt {
+ struct GNUNET_MessageHeader shdr;
+ struct pkt_tun tun;
+};
+
struct ip6_pkt {
struct GNUNET_MessageHeader shdr;
struct pkt_tun tun;
struct GNUNET_MessageHeader shdr;
struct pkt_tun tun;
struct ip6_hdr ip6_hdr;
- struct udp_pkt udp_hdr;
- struct dns_pkt data;
+ struct udp_dns udp_dns;
};
struct ip_pkt {
struct udp_pkt udp_hdr;
unsigned char data[1];
};
-
struct ip_udp_dns {
struct GNUNET_MessageHeader shdr;
struct pkt_tun tun;
struct ip_hdr ip_hdr;
- struct udp_pkt udp_hdr;
- struct dns_pkt data;
+ struct udp_dns udp_dns;
};
+
#endif