#:prefab -> #:transparent
This commit is contained in:
parent
d19c82d152
commit
67b4b6b011
38
api.rkt
38
api.rkt
|
@ -96,7 +96,7 @@
|
|||
(struct: (TName TType TClass TContext)
|
||||
question-repr
|
||||
([name : TName] [type : TType] [class : TClass] [context : TContext])
|
||||
#:prefab)
|
||||
#:transparent)
|
||||
(pseudo-substruct: (question-repr DomainName QueryType QueryClass QuestionContext)
|
||||
Question question question?)
|
||||
(pseudo-substruct: (question-repr (U Wild DomainName)
|
||||
|
@ -116,14 +116,14 @@
|
|||
;; excessively-glueless subquestion not represented here, and should
|
||||
;; *not* in turn be considered for gluelessness-restarting: this is
|
||||
;; needed to avoid a different kind of infinite loop.
|
||||
(struct: subquestion ([parent : Question]) #:prefab)
|
||||
(struct: cname-subq subquestion () #:prefab)
|
||||
(struct: ns-subq subquestion () #:prefab)
|
||||
(struct: subquestion ([parent : Question]) #:transparent)
|
||||
(struct: cname-subq subquestion () #:transparent)
|
||||
(struct: ns-subq subquestion () #:transparent)
|
||||
(define-type QuestionContext (U subquestion cname-subq ns-subq False 'restart))
|
||||
|
||||
;; An AnsweredQuestion is an (answered-question Question
|
||||
;; Maybe<CompleteAnswer>).
|
||||
(struct: (TQ TA) answered-question-repr ([q : TQ] [a : TA]) #:prefab)
|
||||
(struct: (TQ TA) answered-question-repr ([q : TQ] [a : TA]) #:transparent)
|
||||
(pseudo-substruct: (answered-question-repr Question (Option CompleteAnswer))
|
||||
AnsweredQuestion answered-question answered-question?)
|
||||
(pseudo-substruct: (answered-question-repr (U Wild Question) (U Wild (Option CompleteAnswer)))
|
||||
|
@ -132,7 +132,7 @@
|
|||
;; A CompleteAnswer is a (complete-answer Set<RR> Set<RR> Set<RR>)
|
||||
(struct: complete-answer
|
||||
([rrs : (Setof RR)] [authorities : (Setof RR)] [additional : (Setof RR)])
|
||||
#:prefab)
|
||||
#:transparent)
|
||||
(define-type CompleteAnswer complete-answer)
|
||||
|
||||
;; An RR is a (rr DomainName RRType RRClass Uint32 RData),
|
||||
|
@ -141,7 +141,7 @@
|
|||
[class : RRClass]
|
||||
[ttl : Nonnegative-Integer]
|
||||
[rdata : RData])
|
||||
#:prefab)
|
||||
#:transparent)
|
||||
(define-type RR rr)
|
||||
|
||||
;; An RData is one of
|
||||
|
@ -163,27 +163,27 @@
|
|||
;;
|
||||
;; Many of these variants are obsolete in today's DNS database (marked
|
||||
;; [O] above).
|
||||
(struct: rdata ([type : RRType]) #:prefab)
|
||||
(struct: rdata-domain rdata ([name : DomainName]) #:prefab)
|
||||
(struct: rdata-ipv4 rdata ([address : IPv4]) #:prefab)
|
||||
(struct: rdata-ipv6 rdata ([address : IPv6]) #:prefab)
|
||||
(struct: rdata-hinfo rdata ([cpu : Bytes] [os : Bytes]) #:prefab)
|
||||
(struct: rdata-minfo rdata ([rmailbx : DomainName] [emailbx : DomainName]) #:prefab)
|
||||
(struct: rdata-mx rdata ([preference : Nonnegative-Integer] [exchange : DomainName]) #:prefab)
|
||||
(struct: rdata ([type : RRType]) #:transparent)
|
||||
(struct: rdata-domain rdata ([name : DomainName]) #:transparent)
|
||||
(struct: rdata-ipv4 rdata ([address : IPv4]) #:transparent)
|
||||
(struct: rdata-ipv6 rdata ([address : IPv6]) #:transparent)
|
||||
(struct: rdata-hinfo rdata ([cpu : Bytes] [os : Bytes]) #:transparent)
|
||||
(struct: rdata-minfo rdata ([rmailbx : DomainName] [emailbx : DomainName]) #:transparent)
|
||||
(struct: rdata-mx rdata ([preference : Nonnegative-Integer] [exchange : DomainName]) #:transparent)
|
||||
(struct: rdata-soa rdata ([mname : DomainName]
|
||||
[rname : DomainName]
|
||||
[serial : Nonnegative-Integer]
|
||||
[refresh : Nonnegative-Integer]
|
||||
[retry : Nonnegative-Integer]
|
||||
[expire : Nonnegative-Integer]
|
||||
[minimum : Nonnegative-Integer]) #:prefab)
|
||||
(struct: rdata-wks rdata ([address : IPv4] [protocol : Byte] [bitmap : Bytes]) #:prefab)
|
||||
[minimum : Nonnegative-Integer]) #:transparent)
|
||||
(struct: rdata-wks rdata ([address : IPv4] [protocol : Byte] [bitmap : Bytes]) #:transparent)
|
||||
(struct: rdata-srv rdata ([priority : Nonnegative-Integer]
|
||||
[weight : Nonnegative-Integer]
|
||||
[port : Nonnegative-Integer]
|
||||
[target : DomainName]) #:prefab)
|
||||
(struct: rdata-txt rdata ([strings : (Listof Bytes)]) #:prefab)
|
||||
(struct: rdata-raw rdata ([body : Bytes]) #:prefab)
|
||||
[target : DomainName]) #:transparent)
|
||||
(struct: rdata-txt rdata ([strings : (Listof Bytes)]) #:transparent)
|
||||
(struct: rdata-raw rdata ([body : Bytes]) #:transparent)
|
||||
(define-type RData rdata)
|
||||
|
||||
(: rdata-type-pred : RRType -> (RData -> Boolean))
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
[answers : (Listof RR)]
|
||||
[authorities : (Listof RR)]
|
||||
[additional : (Listof RR)])
|
||||
#:prefab)
|
||||
#:transparent)
|
||||
(define-type DNSMessage dns-message)
|
||||
(define-type Direction (U 'request 'response))
|
||||
(define-type Authoritativeness (U 'non-authoritative 'authoritative))
|
||||
|
|
|
@ -117,14 +117,14 @@
|
|||
[zone-origin : DomainName]
|
||||
[server-names : (Listof DomainName)]
|
||||
[unique-id : Any])
|
||||
#:prefab)
|
||||
#:transparent)
|
||||
(define-type NetworkRequest network-request)
|
||||
|
||||
;; A NetworkReply is a (network-reply UniqueID Maybe<CompleteAnswer>)
|
||||
;; representing the final result of a network query.
|
||||
(struct: (TId TAnswer)
|
||||
network-reply-repr
|
||||
([unique-id : TId] [answer : TAnswer]) #:prefab)
|
||||
([unique-id : TId] [answer : TAnswer]) #:transparent)
|
||||
(pseudo-substruct: (network-reply-repr Any (Option CompleteAnswer))
|
||||
NetworkReply network-reply network-reply?)
|
||||
(pseudo-substruct: (network-reply-repr (U Wild Any) (U Wild (Option CompleteAnswer)))
|
||||
|
@ -140,7 +140,7 @@
|
|||
[remaining-addresses : (Listof UdpAddress)]
|
||||
[current-name : (Option DomainName)]
|
||||
[remaining-names : (Listof DomainName)])
|
||||
#:prefab)
|
||||
#:transparent)
|
||||
(define-type NetworkQueryState network-query-state)
|
||||
|
||||
(: next-timeout : Natural -> (Option Natural))
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
;; searches from. Performs recursive queries.
|
||||
|
||||
;; For discarding retransmitted requests that we're still working on.
|
||||
(struct: active-request ([source : UdpAddress] [id : Natural]) #:prefab)
|
||||
(struct: active-request ([source : UdpAddress] [id : Natural]) #:transparent)
|
||||
(define-type ActiveRequest active-request)
|
||||
|
||||
(: start-proxy : Natural CompiledZone CompiledZone -> Void)
|
||||
|
@ -247,12 +247,12 @@
|
|||
[q : Question]
|
||||
[client-sock : UdpAddress]
|
||||
[nameservers-tried : (Setof DomainName)]
|
||||
[retry-count : Natural]) #:prefab)
|
||||
[retry-count : Natural]) #:transparent)
|
||||
(define-type QuestionState question-state)
|
||||
|
||||
(struct: expanding-cnames ([q : Question]
|
||||
[accumulator : CompleteAnswer]
|
||||
[remaining-count : Integer]) #:prefab)
|
||||
[remaining-count : Integer]) #:transparent)
|
||||
(define-type ExpandingCNAMEs expanding-cnames)
|
||||
|
||||
(define-type QHState (U QuestionState ExpandingCNAMEs))
|
||||
|
|
|
@ -53,13 +53,13 @@
|
|||
|
||||
;; A PartialAnswer is a (partial-answer CompleteAnswer ListOf<DomainName>)
|
||||
;; A collection of relevant RRs together with some CNAMEs that need expanding.
|
||||
(struct: partial-answer ([base : CompleteAnswer] [cnames : (Listof DomainName)]) #:prefab)
|
||||
(struct: partial-answer ([base : CompleteAnswer] [cnames : (Listof DomainName)]) #:transparent)
|
||||
(define-type PartialAnswer partial-answer)
|
||||
|
||||
;; A Referral is a (referral DomainName Set<RR> Set<RR>)
|
||||
(struct: referral ([zone-origin : DomainName]
|
||||
[nameserver-rrs : (Setof RR)]
|
||||
[additional : (Setof RR)]) #:prefab)
|
||||
[additional : (Setof RR)]) #:transparent)
|
||||
(define-type Referral referral)
|
||||
|
||||
(: answer-from-zone : Question CompiledZone (Option RR) -> Answer)
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
(struct: (TDetail TSource TSink TReason)
|
||||
bad-dns-packet-repr
|
||||
([detail : TDetail] [source : TSource] [sink : TSink] [reason : TReason]) #:prefab)
|
||||
([detail : TDetail] [source : TSource] [sink : TSink] [reason : TReason]) #:transparent)
|
||||
(pseudo-substruct: (bad-dns-packet-repr Any UdpAddress UdpAddress Symbol)
|
||||
BadDnsPacket bad-dns-packet bad-dns-packet?)
|
||||
(pseudo-substruct: (bad-dns-packet-repr Any
|
||||
|
@ -37,7 +37,7 @@
|
|||
|
||||
(struct: (TMessage TSource TSink)
|
||||
dns-request-repr
|
||||
([message : TMessage] [source : TSource] [sink : TSink]) #:prefab)
|
||||
([message : TMessage] [source : TSource] [sink : TSink]) #:transparent)
|
||||
(pseudo-substruct: (dns-request-repr DNSMessage UdpAddress UdpAddress)
|
||||
DNSRequest dns-request dns-request?)
|
||||
(pseudo-substruct: (dns-request-repr (U Wild DNSMessage)
|
||||
|
@ -47,7 +47,7 @@
|
|||
|
||||
(struct: (TMessage TSource TSink)
|
||||
dns-reply-repr
|
||||
([message : TMessage] [source : TSource] [sink : TSink]) #:prefab)
|
||||
([message : TMessage] [source : TSource] [sink : TSink]) #:transparent)
|
||||
(pseudo-substruct: (dns-reply-repr DNSMessage UdpAddress UdpAddress)
|
||||
DNSReply dns-reply dns-reply?)
|
||||
(pseudo-substruct: (dns-reply-repr (U Wild DNSMessage)
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
;; An InfiniteLifetime is an (infinite-lifetime RelativeSeconds), a
|
||||
;; specification of the TTL to use when sending a non-expiring RR to a
|
||||
;; peer.
|
||||
(struct: infinite-lifetime ([ttl : RelativeSeconds]) #:prefab)
|
||||
(struct: infinite-lifetime ([ttl : RelativeSeconds]) #:transparent)
|
||||
(define-type InfiniteLifetime infinite-lifetime)
|
||||
|
||||
;; An Expiry is either an AbsoluteSeconds or an InfiniteLifetime.
|
||||
|
|
Loading…
Reference in New Issue