]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSMacOSX/ApplePlatformFeatures.h
mDNSResponder-1096.60.2.tar.gz
[apple/mdnsresponder.git] / mDNSMacOSX / ApplePlatformFeatures.h
1 /*
2 * Copyright (c) 2018-2019 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 * http://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 __ApplePlatformFeatures_h
18 #define __ApplePlatformFeatures_h
19
20 #include <TargetConditionals.h>
21
22 // Feature: Bonjour-On-Demand
23 // Radar: <rdar://problem/23523784>
24 // Enabled: Yes.
25
26 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_BONJOUR_ON_DEMAND)
27 #define MDNSRESPONDER_SUPPORTS_APPLE_BONJOUR_ON_DEMAND 1
28 #endif
29
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.
33
34 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_CACHE_MEM_LIMIT)
35 #if !defined(TARGET_OS_IPHONE)
36 #error "Expected TARGET_OS_IPHONE to be defined."
37 #endif
38 #if TARGET_OS_IPHONE
39 #define MDNSRESPONDER_SUPPORTS_APPLE_CACHE_MEM_LIMIT 1
40 #else
41 #define MDNSRESPONDER_SUPPORTS_APPLE_CACHE_MEM_LIMIT 0
42 #endif
43 #endif
44
45 // Feature: D2D
46 // Radar: <rdar://problem/28062515>
47 // Enabled: Yes.
48
49 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_D2D)
50 #define MDNSRESPONDER_SUPPORTS_APPLE_D2D 1
51 #endif
52
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.
56
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."
60 #endif
61 #if (TARGET_OS_IOS || TARGET_OS_OSX)
62 #define MDNSRESPONDER_SUPPORTS_APPLE_DNS64 1
63 #else
64 #define MDNSRESPONDER_SUPPORTS_APPLE_DNS64 0
65 #endif
66 #endif
67
68 // Feature: DNS-SD XPC service
69 // Radar: <rdar://problem/43866363>
70 // Enabled: Yes.
71
72 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_DNSSD_XPC_SERVICE)
73 #define MDNSRESPONDER_SUPPORTS_APPLE_DNSSD_XPC_SERVICE 1
74 #endif
75
76 // Feature: Ignore /etc/hosts file on customer builds.
77 // Radar: <rdar://problem/34745220>
78 // Enabled: Yes, except for macOS.
79
80 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_IGNORE_HOSTS_FILE)
81 #if !defined(TARGET_OS_OSX)
82 #error "Expected TARGET_OS_OSX to be defined."
83 #endif
84 #if !TARGET_OS_OSX
85 #define MDNSRESPONDER_SUPPORTS_APPLE_IGNORE_HOSTS_FILE 1
86 #else
87 #define MDNSRESPONDER_SUPPORTS_APPLE_IGNORE_HOSTS_FILE 0
88 #endif
89 #endif
90
91 // Feature: AWD metrics collection
92 // Radar: <rdar://problem/24146300>
93 // Enabled: Yes, but for iOS only.
94
95 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_METRICS)
96 #if !defined(TARGET_OS_IOS)
97 #error "Expected TARGET_OS_IOS to be defined."
98 #endif
99 #if TARGET_OS_IOS
100 #define MDNSRESPONDER_SUPPORTS_APPLE_METRICS 1
101 #else
102 #define MDNSRESPONDER_SUPPORTS_APPLE_METRICS 0
103 #endif
104 #endif
105
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.
109
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."
113 #endif
114 #if (TARGET_OS_IOS || TARGET_OS_WATCH)
115 #define MDNSRESPONDER_SUPPORTS_APPLE_NO_WAKE_FOR_NET_ACCESS 1
116 #else
117 #define MDNSRESPONDER_SUPPORTS_APPLE_NO_WAKE_FOR_NET_ACCESS 0
118 #endif
119 #endif
120
121 // Feature: Support for having finer granularity of log redaction, by using os_log based-log routine.
122 // Radar: <rdar://problem/42814956>
123 // Enabled: Yes.
124
125 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_OS_LOG)
126 #define MDNSRESPONDER_SUPPORTS_APPLE_OS_LOG 1
127 #endif
128
129 // Feature: Preallocate mDNSResponder's cache memory. For testing purposes only.
130 // Radar: <rdar://problem/29545890>
131 // Enabled: No.
132
133 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_PREALLOCATED_CACHE)
134 #define MDNSRESPONDER_SUPPORTS_APPLE_PREALLOCATED_CACHE 0
135 #endif
136
137 // Feature: Randomized AWDL Hostname
138 // Radar: <rdar://problem/47525004>
139 // Enabled: Yes.
140
141 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_RANDOM_AWDL_HOSTNAME)
142 #define MDNSRESPONDER_SUPPORTS_APPLE_RANDOM_AWDL_HOSTNAME 1
143 #endif
144
145 // Feature: Reachability trigger
146 // Radar: <rdar://problem/11374446>
147 // Enabled: Yes.
148
149 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_REACHABILITY_TRIGGER)
150 #define MDNSRESPONDER_SUPPORTS_APPLE_REACHABILITY_TRIGGER 1
151 #endif
152
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>
156 // Enabled: No.
157
158 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_SLOW_ACTIVATION)
159 #define MDNSRESPONDER_SUPPORTS_APPLE_SLOW_ACTIVATION 0
160 #endif
161
162 // Feature: Suspicious Reply Defense
163 // Radar: <rdar://problem/50050767>
164 // Enabled: Yes.
165
166 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_SUSPICIOUS_REPLY_DEFENSE)
167 #define MDNSRESPONDER_SUPPORTS_APPLE_SUSPICIOUS_REPLY_DEFENSE 1
168 #endif
169
170 // Feature: Symptoms Reporting
171 // Radar: <rdar://problem/20194922>
172 // Enabled: Yes.
173
174 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_SYMPTOMS)
175 #define MDNSRESPONDER_SUPPORTS_APPLE_SYMPTOMS 1
176 #endif
177
178 // Feature: Support for performing dot-local queries via mDNS and DNS in parallel.
179 // Radar: <rdar://problem/4786302>
180 // Enabled: Yes.
181
182 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_UNICAST_DOTLOCAL)
183 #define MDNSRESPONDER_SUPPORTS_APPLE_UNICAST_DOTLOCAL 1
184 #endif
185
186 // Feature: Allow browses and registrations over interfaces that aren't ready yet.
187 // Radar: <rdar://problem/20181903>
188 // Enabled: Yes.
189
190 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_UNREADY_INTERFACES)
191 #define MDNSRESPONDER_SUPPORTS_APPLE_UNREADY_INTERFACES 1
192 #endif
193
194 // Feature: Support for Web Content Filter
195 // Radar: <rdar://problem/7409981>
196 // Enabled: Yes, if SDK has <WebFilterDNS/WebFilterDNS.h>.
197
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
201 #else
202 #define MDNSRESPONDER_SUPPORTS_APPLE_WEB_CONTENT_FILTER 0
203 #endif
204 #endif
205
206 #endif // __ApplePlatformFeatures_h