unsigned char dadr[16];
};
+struct ip_hdr {
+ unsigned hdr_lngth:4 GNUNET_PACKED;
+ unsigned version:4 GNUNET_PACKED;
+
+ unsigned diff_serv:8 GNUNET_PACKED;
+ unsigned tot_lngth:16 GNUNET_PACKED;
+
+ unsigned ident:16 GNUNET_PACKED;
+ unsigned flags:3 GNUNET_PACKED;
+ unsigned frag_off:13 GNUNET_PACKED;
+
+ unsigned ttl:8 GNUNET_PACKED;
+ unsigned proto:8 GNUNET_PACKED;
+ unsigned chks:16 GNUNET_PACKED;
+
+ unsigned sadr:32 GNUNET_PACKED;
+ unsigned dadr:32 GNUNET_PACKED;
+};
+
struct tcp_pkt {
unsigned spt:16 GNUNET_PACKED;
unsigned dpt: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_dns udp_dns;
+};
+
+struct ip_pkt {
+ struct GNUNET_MessageHeader shdr;
+ struct pkt_tun tun;
+ struct ip_hdr ip_hdr;
+ unsigned char data[1];
+};
+
+struct ip_udp {
+ struct GNUNET_MessageHeader shdr;
+ struct pkt_tun tun;
+ struct ip_hdr ip_hdr;
struct udp_pkt udp_hdr;
- struct dns_pkt data;
+ unsigned char data[1];
+};
+struct ip_udp_dns {
+ struct GNUNET_MessageHeader shdr;
+ struct pkt_tun tun;
+ struct ip_hdr ip_hdr;
+ struct udp_dns udp_dns;
};
#endif