1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include
"nsIDNSRecord.idl"
9 #include
"mozilla/Maybe.h"
11 #include
"nsTArrayForwardDeclare.h"
13 #include
"nsStringFwd.h"
17 template
<typename... Ts
> class
Variant;
22 using TypeRecordResultType
=
23 Variant<Nothing
, CopyableTArray
<nsCString
>, CopyableTArray
<SVCB
>>;
29 [ref] native CStringArrayRef
(CopyableTArray
<nsCString
>);
30 native TypeResult
(mozilla
::net
::TypeRecordResultType
);
32 native MaybePort
(mozilla
::Maybe<uint16_t
>);
33 native MaybeAlpnTuple
(mozilla
::Maybe<std
::tuple
<nsCString
, mozilla
::net
::SupportedAlpnRank
>>);
35 [scriptable
, uuid(5d13241b
-9d46
-448a
-90d8
-77c418491026
)]
36 interface nsIDNSByTypeRecord
: nsIDNSRecord
39 * Returns DNS request type that was made for this request.
41 readonly attribute
unsigned long type
;
43 [noscript
] readonly attribute TypeResult results
;
46 [scriptable
, uuid(2a71750d
-cb21
-45f1
-9e1c
-666d18dd7645
)]
47 interface nsIDNSTXTRecord
: nsISupports
49 CStringArrayRef getRecords
();
52 * Return concatenated strings.
54 ACString getRecordsAsOneString
();
57 [scriptable
, uuid(2979ceaa
-9c7e
-49de
-84b8
-ea81c16aebf1
)]
58 interface nsISVCParam
: nsISupports
{
59 readonly attribute uint16_t type
;
62 [scriptable
, uuid(0dc58309
-4d67
-4fc4
-a4e3
-38dbde9d9f4c
)]
63 interface nsISVCParamAlpn
: nsISupports
{
64 readonly attribute Array
<ACString
> alpn
;
67 [scriptable
, uuid(b3ed89c3
-2ae6
-4c92
-8176-b76bc2437fcb
)]
68 interface nsISVCParamNoDefaultAlpn
: nsISupports
{
71 [scriptable
, uuid(a37c7bcb
-bfcd
-4ab4
-b826
-cc583859ba73
)]
72 interface nsISVCParamPort
: nsISupports
{
73 readonly attribute uint16_t port
;
76 [scriptable
, uuid(d3163d2f
-0bbe
-47d4
-bcac
-db3fb1433b39
)]
77 interface nsISVCParamIPv4Hint
: nsISupports
{
78 readonly attribute Array
<nsINetAddr
> ipv4Hint
;
81 [scriptable
, uuid(1f31e41d
-b6d8
-4796-b12a
-82ef8d2b0e43
)]
82 interface nsISVCParamEchConfig
: nsISupports
{
83 readonly attribute ACString echconfig
;
86 [scriptable
, uuid(5100bce4
-9d3b
-42e1
-a3c9
-0f386bbc9dad
)]
87 interface nsISVCParamIPv6Hint
: nsISupports
{
88 readonly attribute Array
<nsINetAddr
> ipv6Hint
;
91 [scriptable
, uuid(bdcef040
-452e-11eb
-b378
-0242ac130002
)]
92 interface nsISVCParamODoHConfig
: nsISupports
{
93 readonly attribute ACString ODoHConfig
;
96 [scriptable
, builtinclass
, uuid(a4da5645
-2160-4439-bd11
-540a2d26c989
)]
97 interface nsISVCBRecord
: nsISupports
{
98 readonly attribute uint16_t priority
;
99 readonly attribute ACString name
;
100 [noscript
, nostdcall
, notxpcom
] readonly attribute MaybePort port
;
101 [noscript
, nostdcall
, notxpcom
] readonly attribute MaybeAlpnTuple alpn
;
102 readonly attribute ACString selectedAlpn
;
103 readonly attribute ACString echConfig
;
104 readonly attribute ACString ODoHConfig
;
105 readonly attribute bool hasIPHintAddress
;
106 readonly attribute Array
<nsISVCParam
> values
;
109 [scriptable
, uuid(5b649e95
-e0d3
-422b
-99a6
-79d70a041387
)]
110 interface nsIDNSHTTPSSVCRecord
: nsISupports
112 readonly attribute Array
<nsISVCBRecord
> records
;
113 nsISVCBRecord GetServiceModeRecord
(in boolean aNoHttp2
, in boolean aNoHttp3
);
115 * Returns true if one of SVCB records has IPv4 or IPv6 hint addresses.
117 readonly attribute
boolean hasIPAddresses
;
120 * Returns true when all names of SVCB records are in exclusion list.
122 readonly attribute
boolean allRecordsExcluded
;
125 * Returns the ttl of this record.
127 readonly attribute uint32_t ttl
;
129 Array
<nsISVCBRecord
> GetAllRecordsWithEchConfig
(in boolean aNoHttp2
,
131 out boolean aAllRecordsHaveEchConfig
,
132 out boolean aAllRecordsInH3ExcludedList
);