refactor(lisp/dns): Return dns-answer from query functions
This commit is contained in:
parent
ca1217655d
commit
253a166bbc
2 changed files with 10 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue