]>
git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSMacOSX/ApplePlatformFeatures.h
2 * Copyright (c) 2018-2019 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 IPv6 synthesis.
54 // Radar: <rdar://problem/32297396>
55 // Enabled: Yes, but only for iOS and macOS, which support the DNS proxy network extension.
57 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_DNS64)
58 #if (!defined(TARGET_OS_IOS) || !defined(TARGET_OS_OSX))
59 #error "Expected TARGET_OS_IOS and TARGET_OS_OSX to be defined."
61 #if (TARGET_OS_IOS || TARGET_OS_OSX)
62 #define MDNSRESPONDER_SUPPORTS_APPLE_DNS64 1
64 #define MDNSRESPONDER_SUPPORTS_APPLE_DNS64 0
68 // Feature: DNS-SD XPC service
69 // Radar: <rdar://problem/43866363>
72 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_DNSSD_XPC_SERVICE)
73 #define MDNSRESPONDER_SUPPORTS_APPLE_DNSSD_XPC_SERVICE 1
76 // Feature: Ignore /etc/hosts file on customer builds.
77 // Radar: <rdar://problem/34745220>
78 // Enabled: Yes, except for macOS.
80 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_IGNORE_HOSTS_FILE)
81 #if !defined(TARGET_OS_OSX)
82 #error "Expected TARGET_OS_OSX to be defined."
85 #define MDNSRESPONDER_SUPPORTS_APPLE_IGNORE_HOSTS_FILE 1
87 #define MDNSRESPONDER_SUPPORTS_APPLE_IGNORE_HOSTS_FILE 0
91 // Feature: AWD metrics collection
92 // Radar: <rdar://problem/24146300>
93 // Enabled: Yes, but for iOS only.
95 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_METRICS)
96 #if !defined(TARGET_OS_IOS)
97 #error "Expected TARGET_OS_IOS to be defined."
100 #define MDNSRESPONDER_SUPPORTS_APPLE_METRICS 1
102 #define MDNSRESPONDER_SUPPORTS_APPLE_METRICS 0
106 // Feature: No system wake for network access.
107 // Radar: <rdar://problem/28079659&55038229>
108 // Enabled: Yes, but only for iOS and watchOS, which shouldn't act as sleep-proxy clients.
110 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_NO_WAKE_FOR_NET_ACCESS)
111 #if (!defined(TARGET_OS_IOS) || !defined(TARGET_OS_WATCH))
112 #error "Expected TARGET_OS_IOS and TARGET_OS_WATCH to be defined."
114 #if (TARGET_OS_IOS || TARGET_OS_WATCH)
115 #define MDNSRESPONDER_SUPPORTS_APPLE_NO_WAKE_FOR_NET_ACCESS 1
117 #define MDNSRESPONDER_SUPPORTS_APPLE_NO_WAKE_FOR_NET_ACCESS 0
121 // Feature: Support for having finer granularity of log redaction, by using os_log based-log routine.
122 // Radar: <rdar://problem/42814956>
125 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_OS_LOG)
126 #define MDNSRESPONDER_SUPPORTS_APPLE_OS_LOG 1
129 // Feature: Preallocate mDNSResponder's cache memory. For testing purposes only.
130 // Radar: <rdar://problem/29545890>
133 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_PREALLOCATED_CACHE)
134 #define MDNSRESPONDER_SUPPORTS_APPLE_PREALLOCATED_CACHE 0
137 // Feature: Randomized AWDL Hostname
138 // Radar: <rdar://problem/47525004>
141 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_RANDOM_AWDL_HOSTNAME)
142 #define MDNSRESPONDER_SUPPORTS_APPLE_RANDOM_AWDL_HOSTNAME 1
145 // Feature: Reachability trigger
146 // Radar: <rdar://problem/11374446>
149 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_REACHABILITY_TRIGGER)
150 #define MDNSRESPONDER_SUPPORTS_APPLE_REACHABILITY_TRIGGER 1
153 // Feature: "SlowActivation" processing for flapping interfaces.
154 // Disabled to address stale Bonjour record issues during flapping network interface transitions.
155 // Radar: <rdar://problem/44694746>
158 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_SLOW_ACTIVATION)
159 #define MDNSRESPONDER_SUPPORTS_APPLE_SLOW_ACTIVATION 0
162 // Feature: Suspicious Reply Defense
163 // Radar: <rdar://problem/50050767>
166 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_SUSPICIOUS_REPLY_DEFENSE)
167 #define MDNSRESPONDER_SUPPORTS_APPLE_SUSPICIOUS_REPLY_DEFENSE 1
170 // Feature: Symptoms Reporting
171 // Radar: <rdar://problem/20194922>
174 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_SYMPTOMS)
175 #define MDNSRESPONDER_SUPPORTS_APPLE_SYMPTOMS 1
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 #endif // __ApplePlatformFeatures_h