]>
git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSMacOSX/ApplePlatformFeatures.h
2 * Copyright (c) 2018-2020 Apple Inc. All rights reserved.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __ApplePlatformFeatures_h
18 #define __ApplePlatformFeatures_h
20 #include <TargetConditionals.h>
22 // Feature: Bonjour-On-Demand
23 // Radar: <rdar://problem/23523784>
26 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_BONJOUR_ON_DEMAND)
27 #define MDNSRESPONDER_SUPPORTS_APPLE_BONJOUR_ON_DEMAND 1
30 // Feature: Cache memory limit
31 // Radar: <rdar://problem/15629764>
32 // Enabled: Yes, but only for device OSes, such as iOS, tvOS, and watchOS, i.e., when TARGET_OS_IPHONE is 1.
34 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_CACHE_MEM_LIMIT)
35 #if !defined(TARGET_OS_IPHONE)
36 #error "Expected TARGET_OS_IPHONE to be defined."
39 #define MDNSRESPONDER_SUPPORTS_APPLE_CACHE_MEM_LIMIT 1
41 #define MDNSRESPONDER_SUPPORTS_APPLE_CACHE_MEM_LIMIT 0
46 // Radar: <rdar://problem/28062515>
49 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_D2D)
50 #define MDNSRESPONDER_SUPPORTS_APPLE_D2D 1
53 // Feature: DNS64 support for DNS proxy
54 // Radar: <rdar://problem/56505415>
57 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_DNS_PROXY_DNS64)
58 #define MDNSRESPONDER_SUPPORTS_APPLE_DNS_PROXY_DNS64 1
61 // Feature: DNS64 IPv6 synthesis.
62 // Radar: <rdar://problem/32297396>
63 // Enabled: Yes, but only for iOS and macOS, which support the DNS proxy network extension.
65 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_DNS64)
66 #if (!defined(TARGET_OS_IOS) || !defined(TARGET_OS_OSX))
67 #error "Expected TARGET_OS_IOS and TARGET_OS_OSX to be defined."
69 #if (TARGET_OS_IOS || TARGET_OS_OSX)
70 #define MDNSRESPONDER_SUPPORTS_APPLE_DNS64 1
72 #define MDNSRESPONDER_SUPPORTS_APPLE_DNS64 0
76 // Feature: DNS-SD XPC service
77 // Radar: <rdar://problem/43866363>
80 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_DNSSD_XPC_SERVICE)
81 #define MDNSRESPONDER_SUPPORTS_APPLE_DNSSD_XPC_SERVICE 1
84 // Feature: Ignore /etc/hosts file on customer builds.
85 // Radar: <rdar://problem/34745220>
86 // Enabled: Yes, except for macOS.
88 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_IGNORE_HOSTS_FILE)
89 #if !defined(TARGET_OS_OSX)
90 #error "Expected TARGET_OS_OSX to be defined."
93 #define MDNSRESPONDER_SUPPORTS_APPLE_IGNORE_HOSTS_FILE 1
95 #define MDNSRESPONDER_SUPPORTS_APPLE_IGNORE_HOSTS_FILE 0
99 // Feature: AWD metrics collection
100 // Radar: <rdar://problem/24146300>
101 // Enabled: Yes, but for iOS only.
103 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_METRICS)
104 #if !defined(TARGET_OS_IOS)
105 #error "Expected TARGET_OS_IOS to be defined."
108 #define MDNSRESPONDER_SUPPORTS_APPLE_METRICS 1
110 #define MDNSRESPONDER_SUPPORTS_APPLE_METRICS 0
114 // Feature: No system wake for network access.
115 // Radar: <rdar://problem/28079659&55038229>
116 // Enabled: Yes, but only for iOS and watchOS, which shouldn't act as sleep-proxy clients.
118 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_NO_WAKE_FOR_NET_ACCESS)
119 #if (!defined(TARGET_OS_IOS) || !defined(TARGET_OS_WATCH))
120 #error "Expected TARGET_OS_IOS and TARGET_OS_WATCH to be defined."
122 #if (TARGET_OS_IOS || TARGET_OS_WATCH)
123 #define MDNSRESPONDER_SUPPORTS_APPLE_NO_WAKE_FOR_NET_ACCESS 1
125 #define MDNSRESPONDER_SUPPORTS_APPLE_NO_WAKE_FOR_NET_ACCESS 0
129 // Feature: Support for having finer granularity of log redaction, by using os_log based-log routine.
130 // Radar: <rdar://problem/42814956>
133 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_OS_LOG)
134 #define MDNSRESPONDER_SUPPORTS_APPLE_OS_LOG 1
137 // Feature: Preallocate mDNSResponder's cache memory. For testing purposes only.
138 // Radar: <rdar://problem/29545890>
141 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_PREALLOCATED_CACHE)
142 #define MDNSRESPONDER_SUPPORTS_APPLE_PREALLOCATED_CACHE 0
145 // Feature: Use mdns_querier objects for DNS transports.
146 // Radar: <rdar://problem/55746371>
149 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_QUERIER)
150 #define MDNSRESPONDER_SUPPORTS_APPLE_QUERIER 1
153 // Feature: Randomized AWDL Hostname
154 // Radar: <rdar://problem/47525004>
157 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_RANDOM_AWDL_HOSTNAME)
158 #define MDNSRESPONDER_SUPPORTS_APPLE_RANDOM_AWDL_HOSTNAME 1
161 // Feature: Reachability trigger
162 // Radar: <rdar://problem/11374446>
165 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_REACHABILITY_TRIGGER)
166 #define MDNSRESPONDER_SUPPORTS_APPLE_REACHABILITY_TRIGGER 1
169 // Feature: "SlowActivation" processing for flapping interfaces.
170 // Disabled to address stale Bonjour record issues during flapping network interface transitions.
171 // Radar: <rdar://problem/44694746>
174 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_SLOW_ACTIVATION)
175 #define MDNSRESPONDER_SUPPORTS_APPLE_SLOW_ACTIVATION 0
178 // Feature: Support for performing dot-local queries via mDNS and DNS in parallel.
179 // Radar: <rdar://problem/4786302>
182 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_UNICAST_DOTLOCAL)
183 #define MDNSRESPONDER_SUPPORTS_APPLE_UNICAST_DOTLOCAL 1
186 // Feature: Allow browses and registrations over interfaces that aren't ready yet.
187 // Radar: <rdar://problem/20181903>
190 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_UNREADY_INTERFACES)
191 #define MDNSRESPONDER_SUPPORTS_APPLE_UNREADY_INTERFACES 1
194 // Feature: Support for Web Content Filter
195 // Radar: <rdar://problem/7409981>
196 // Enabled: Yes, if SDK has <WebFilterDNS/WebFilterDNS.h>.
198 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_WEB_CONTENT_FILTER)
199 #if __has_include(<WebFilterDNS/WebFilterDNS.h>)
200 #define MDNSRESPONDER_SUPPORTS_APPLE_WEB_CONTENT_FILTER 1
202 #define MDNSRESPONDER_SUPPORTS_APPLE_WEB_CONTENT_FILTER 0
206 // Feature: Support for Analytics For Cache
207 // Radar: <rdar://problem/52206048>
208 // Enabled: iOS & macOS
210 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_CACHE_ANALYTICS)
211 #if !(defined(TARGET_OS_IOS) && defined(TARGET_OS_OSX))
212 #error "Expected TARGET_OS_IOS && TARGET_OS_OSX to be defined."
214 #if (TARGET_OS_IOS || TARGET_OS_OSX)
215 #define MDNSRESPONDER_SUPPORTS_APPLE_CACHE_ANALYTICS 1
217 #define MDNSRESPONDER_SUPPORTS_APPLE_CACHE_ANALYTICS 0
221 // Feature: Support for Analytics For WAB (Wide Area Bonjour)
222 // Radar: <rdar://problem/52136688>
223 // Enabled: iOS & macOS
225 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_WAB_ANALYTICS)
226 #define MDNSRESPONDER_SUPPORTS_APPLE_WAB_ANALYTICS 0
229 // Feature: Support for Analytics
230 // Enabled: If any analytics are enabled (above)
232 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_ANALYTICS)
233 #if (MDNSRESPONDER_SUPPORTS_APPLE_CACHE_ANALYTICS || MDNSRESPONDER_SUPPORTS_APPLE_WAB_ANALYTICS)
234 #define MDNSRESPONDER_SUPPORTS_APPLE_ANALYTICS 1
236 #define MDNSRESPONDER_SUPPORTS_APPLE_ANALYTICS 0
240 // Feature: Add audit token to questions
241 // Radar: <rdar://problem/59042213>
242 // Enabled: On all Apple platforms
244 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_AUDIT_TOKEN)
245 #define MDNSRESPONDER_SUPPORTS_APPLE_AUDIT_TOKEN 1
248 // Feature: Enforce entitlements prompts
249 // Radar: <rdar://problem/55922132>
250 // Enabled: iOS only (depends on MDNSRESPONDER_SUPPORTS_APPLE_AUDIT_TOKEN)
252 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_TRUST_ENFORCEMENT)
253 #if MDNSRESPONDER_SUPPORTS_APPLE_AUDIT_TOKEN
255 #define MDNSRESPONDER_SUPPORTS_APPLE_TRUST_ENFORCEMENT 1
257 #define MDNSRESPONDER_SUPPORTS_APPLE_TRUST_ENFORCEMENT 0
260 #define MDNSRESPONDER_SUPPORTS_APPLE_TRUST_ENFORCEMENT 0
264 // Feature: Symptoms Reporting
265 // Radar: <rdar://problem/20194922>
266 // Enabled: Yes. (depends on MDNSRESPONDER_SUPPORTS_APPLE_AUDIT_TOKEN)
268 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_SYMPTOMS)
269 #if MDNSRESPONDER_SUPPORTS_APPLE_AUDIT_TOKEN
270 #define MDNSRESPONDER_SUPPORTS_APPLE_SYMPTOMS 1
272 #define MDNSRESPONDER_SUPPORTS_APPLE_SYMPTOMS 0
276 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_IPC_TLV)
277 #define MDNSRESPONDER_SUPPORTS_APPLE_IPC_TLV 1
280 // Feature: DNSSEC support
281 // Radar: <rdar://problem/55275552>
282 // Enabled: On all Apple platforms
284 // MDNSRESPONDER_SUPPORTS(APPLE, QUERIER) should always be true if MDNSRESPONDER_SUPPORTS(APPLE, DNSSECv2)
285 // is true, except for only one case, the Tests target that runs XCTest. In the XCTest,
286 // MDNSRESPONDER_SUPPORTS_APPLE_DNSSECv2 is predefined in the preprocess which does not check what
287 // MDNSRESPONDER_SUPPORTS checks. In order to test DNSSEC functions in XCtest without querier support, we
288 // will wrap all DNSSEC code that calls querier, since the code will never be excuted in XCTest.
289 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_DNSSECv2)
290 #if MDNSRESPONDER_SUPPORTS_APPLE_QUERIER
291 #define MDNSRESPONDER_SUPPORTS_APPLE_DNSSECv2 0
293 #define MDNSRESPONDER_SUPPORTS_APPLE_DNSSECv2 0
297 #endif // __ApplePlatformFeatures_h