2 #include "gnunet-dns-parser.h"
4 unsigned int parse_dns_name(unsigned char* d, const unsigned char* src, unsigned short idx) {/*{{{*/
5 unsigned char* dest = d;
9 if (len & 0xC0) { /* Compressed name, offset in this and the next octet */
10 unsigned short offset = ((len & 0x3F) << 8) | src[idx++];
11 parse_dns_name(dest, src, offset - 12); /* 12 for the Header of the DNS-Packet, idx starts at 0 which is 12 bytes from the start of the packet */
14 memcpy(dest, src+idx, len);