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