From: Miek Gieben Date: Tue, 7 Dec 2004 13:37:08 +0000 (+0000) Subject: packet defined - fix compile and make access/destroy functions X-Git-Tag: release-0.50~748 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=55175ba10398e4e3cab98ecc8538c0ee4fb091eb;p=thirdparty%2Fldns.git packet defined - fix compile and make access/destroy functions --- diff --git a/packet.h b/packet.h new file mode 100644 index 00000000..77473f9d --- /dev/null +++ b/packet.h @@ -0,0 +1,48 @@ +/* + * packet.h + * + * DNS packet definitions + * + * a Net::DNS like library for C + * + * (c) NLnet Labs, 2004 + * + * See the file LICENSE for the license + */ +#ifndef _PACKET_H +#define _PACKET_H +#else + +#include +#include "prototype.h" + +struct struct_packet_type +{ + header_t *header /* header section */ + rrset_t *question; /* question section */ + rrset_t *answer; /* answer section */ + rrset_t *authority; /* auth section */ + rrset_t *additional; /* add section */ +}; +typedef struct struct_packet_type packet_t; + +struct struct_header_type +{ + uint16_t id; /* id of a packet */ + uint8_t qr; + uint8_t opcode; + uint8_t aa; + uint8_t tc; + uint8_t rd; + uint8_t cd; + uint8_t ra; + uint8_t ad; + uint8_t rcode; + uint8_t qdcount; /* question sec */ + uint8_t ancount; /* answer sec */ + uint8_t nscount; /* auth sec */ + uint8_t acount; /* add sec */ +}; +typedef struct struct_header_type header_t; + +#endif /* _PACKET_H */