]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
packet defined - fix compile and make access/destroy functions
authorMiek Gieben <miekg@NLnetLabs.nl>
Tue, 7 Dec 2004 13:37:08 +0000 (13:37 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Tue, 7 Dec 2004 13:37:08 +0000 (13:37 +0000)
packet.h [new file with mode: 0644]

diff --git a/packet.h b/packet.h
new file mode 100644 (file)
index 0000000..77473f9
--- /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 <stdint.h>
+#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 */