summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2024-08-05 13:13:45 +0000
committerLaurent Bercot <ska@appnovation.com>2024-08-05 13:13:45 +0000
commite25c41578e710aed96939e5c7e503fc1db5dab3a (patch)
tree881c72e134920538d153575ca8ccdf1b61ec664a /src
parent56f0665c3f60d5728b1b2b6f4ec991a500443e31 (diff)
downloads6-dns-e25c41578e710aed96939e5c7e503fc1db5dab3a.tar.xz
Prepare for 2.3.8.0; add s6dns_engine_query
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/s6-dns/s6dns-engine.h2
-rw-r--r--src/libs6dns/deps-lib/s6dns1
-rw-r--r--src/libs6dns/s6dns_engine_query.c14
3 files changed, 17 insertions, 0 deletions
diff --git a/src/include/s6-dns/s6dns-engine.h b/src/include/s6-dns/s6dns-engine.h
index 4884fd9..6224ba4 100644
--- a/src/include/s6-dns/s6dns-engine.h
+++ b/src/include/s6-dns/s6dns-engine.h
@@ -102,7 +102,9 @@ extern int s6dns_engine_timeout (s6dns_engine_t *, tain const *) ;
extern int s6dns_engine_event (s6dns_engine_t *, tain const *) ;
#define s6dns_engine_event_g(dt) s6dns_engine_event((dt), &STAMP)
+extern void s6dns_engine_query (s6dns_engine_t const *, char **, uint16_t *, uint16_t *) ;
#define s6dns_engine_packet(dt) ((dt)->sa.s + (dt)->querylen)
#define s6dns_engine_packetlen(dt) ((unsigned int)((dt)->sa.len - (dt)->querylen))
+
#endif
diff --git a/src/libs6dns/deps-lib/s6dns b/src/libs6dns/deps-lib/s6dns
index 266b574..459dbcf 100644
--- a/src/libs6dns/deps-lib/s6dns
+++ b/src/libs6dns/deps-lib/s6dns
@@ -36,6 +36,7 @@ s6dns_engine_free.o
s6dns_engine_freen.o
s6dns_engine_here.o
s6dns_engine_nextdeadline.o
+s6dns_engine_query.o
s6dns_engine_zero.o
s6dns_finish.o
s6dns_fmt_caa.o
diff --git a/src/libs6dns/s6dns_engine_query.c b/src/libs6dns/s6dns_engine_query.c
new file mode 100644
index 0000000..f672b44
--- /dev/null
+++ b/src/libs6dns/s6dns_engine_query.c
@@ -0,0 +1,14 @@
+/* ISC license. */
+
+#include <skalibs/uint16.h>
+
+#include <s6-dns/s6dns-engine.h>
+
+void s6dns_engine_query (s6dns_engine_t const *dt, char **q, uint16_t *qlen, uint16_t *qtype)
+{
+ uint16_t len ;
+ uint16_unpack_big(dt->sa.s, &len) ;
+ *q = dt->sa.s + 14 ;
+ *qlen = len - 16 ;
+ uint16_unpack_big(dt->sa.s + len - 2, qtype) ;
+}