diff options
author | Vincent Ambo <tazjin@google.com> | 2020-01-27T02·10+0000 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-01-27T02·10+0000 |
commit | 253a166bbc15e316ba99b7a202c3ed501d6d2c58 (patch) | |
tree | 61a5de1bc1bfc6eef83e814ba2b9fc9d742109a1 /lisp | |
parent | ca1217655d5bff611e1d0f6069901d4fbed9d842 (diff) |
refactor(lisp/dns): Return dns-answer from query functions r/466
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/dns/client.lisp | 3 | ||||
-rw-r--r-- | lisp/dns/package.lisp | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lisp/dns/client.lisp b/lisp/dns/client.lisp index 01d403a600dd..cee7bceb54a0 100644 --- a/lisp/dns/client.lisp +++ b/lisp/dns/client.lisp @@ -40,7 +40,8 @@ ("name" . ,name) ("ct" . "application/dns-message"))) (if (= 200 status) - (read-binary 'dns-message (flexi-streams:make-in-memory-input-stream body)) + (dns-message-answer + (read-binary 'dns-message (flexi-streams:make-in-memory-input-stream body))) (restart-case (error 'doh-error :query-name name diff --git a/lisp/dns/package.lisp b/lisp/dns/package.lisp index 639d9994aa4b..2b8bfaa8bcc4 100644 --- a/lisp/dns/package.lisp +++ b/lisp/dns/package.lisp @@ -1,4 +1,11 @@ (defpackage #:dns (:documentation "Simple DNS resolver in Common Lisp") (:use #:cl #:iterate #:lisp-binary) - (:export #:lookup-txt #:lookup-mx)) + (:export + ;; Individual lookup functions + #:lookup-txt #:lookup-mx #:lookup-cname #:lookup-a #:lookup-ns + + ;; Useful accessors + #:dns-message-header #:dns-message-answer #:dns-message-question + #:dns-rr-name #:dns-rr-type #:dns-rr-ttl #:dns-rr-rdata + #:dns-question-qname #:dns-question-qtype)) |