summaryrefslogtreecommitdiff
path: root/src/libs6dns/s6dns_message_counts_unpack.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs6dns/s6dns_message_counts_unpack.c')
-rw-r--r--src/libs6dns/s6dns_message_counts_unpack.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libs6dns/s6dns_message_counts_unpack.c b/src/libs6dns/s6dns_message_counts_unpack.c
new file mode 100644
index 0000000..968e5eb
--- /dev/null
+++ b/src/libs6dns/s6dns_message_counts_unpack.c
@@ -0,0 +1,12 @@
+/* ISC license. */
+
+#include <skalibs/uint16.h>
+#include <s6-dns/s6dns-message.h>
+
+void s6dns_message_counts_unpack (char const *s, s6dns_message_counts_t *counts)
+{
+ uint16_unpack_big(s, &counts->qd) ;
+ uint16_unpack_big(s+2, &counts->an) ;
+ uint16_unpack_big(s+4, &counts->ns) ;
+ uint16_unpack_big(s+6, &counts->nr) ;
+}