refactor(lisp/dns): Return dns-answer from query functions

This commit is contained in:
Vincent Ambo 2020-01-27 02:10:39 +00:00
parent ca1217655d
commit 253a166bbc
2 changed files with 10 additions and 2 deletions

View file

@ -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

View file

@ -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))