1 /*
2  * Copyright (c) 2015-2024 Apple Inc. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef _DNS_SD_PRIVATE_H
18 #define _DNS_SD_PRIVATE_H
19 
20 #include <dns_sd.h>
21 
22 
23     #define DNS_SD_ENUM_SPI_AVAILABLE(...)
24 
25 #define DNS_SD_ENUM_SPI_AVAILABLE_FALL_2021 DNS_SD_ENUM_SPI_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), watchos(8.0))
26 #define DNS_SD_ENUM_SPI_AVAILABLE_FALL_2022 DNS_SD_ENUM_SPI_AVAILABLE(macos(13.0), ios(16.0), tvos(16.0), watchos(9.0))
27 
28 __BEGIN_DECLS
29 
30 // Private flags (kDNSServiceFlagsPrivateOne, kDNSServiceFlagsPrivateTwo, kDNSServiceFlagsPrivateThree, kDNSServiceFlagsPrivateFour, kDNSServiceFlagsPrivateFive) from dns_sd.h
31 enum
32 {
33     kDNSServiceFlagsDenyConstrained        = 0x2000,
34     /*
35      * This flag is meaningful only for Unicast DNS queries. When set, the daemon will restrict
36      * DNS resolutions on interfaces defined as constrained for that request.
37      */
38 
39     kDNSServiceFlagsDenyCellular           = 0x8000000,
40     /*
41      * This flag is meaningful only for Unicast DNS queries. When set, the daemon will restrict
42      * DNS resolutions on the cellular interface for that request.
43      */
44     kDNSServiceFlagsServiceIndex           = 0x10000000,
45     /*
46      * This flag is meaningful only for DNSServiceGetAddrInfo() for Unicast DNS queries.
47      * When set, DNSServiceGetAddrInfo() will interpret the "interfaceIndex" argument of the call
48      * as the "serviceIndex".
49      */
50 
51     kDNSServiceFlagsDenyExpensive          = 0x20000000,
52     /*
53      * This flag is meaningful only for Unicast DNS queries. When set, the daemon will restrict
54      * DNS resolutions on interfaces defined as expensive for that request.
55      */
56 
57     kDNSServiceFlagsPathEvaluationDone     = 0x40000000
58     /*
59      * This flag is meaningful for only Unicast DNS queries.
60      * When set, it indicates that Network PathEvaluation has already been performed.
61      */
62 };
63 
64 typedef enum
65 {
66     kDNSServiceFailoverPolicyNone  DNS_SD_ENUM_SPI_AVAILABLE_FALL_2021 = 0,
67     kDNSServiceFailoverPolicyAllow DNS_SD_ENUM_SPI_AVAILABLE_FALL_2021 = 1
68 } DNSServiceFailoverPolicy;
69 
70 typedef enum
71 {
72     kDNSServiceValidationPolicyNone     DNS_SD_ENUM_SPI_AVAILABLE_FALL_2022 = 0,
73     kDNSServiceValidationPolicyRequired DNS_SD_ENUM_SPI_AVAILABLE_FALL_2022 = 1
74 } DNSServiceValidationPolicy;
75 
76 
77 #define kDNSServiceCompPrivateDNS   "PrivateDNS"
78 #define kDNSServiceCompMulticastDNS "MulticastDNS"
79 
80 __END_DECLS
81 
82 #endif  // _DNS_SD_PRIVATE_H
83