]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSMacOSX/ApplePlatformFeatures.h
mDNSResponder-1096.0.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: Support for having finer granularity of log redaction, by using os_log based-log routine.
107 // Radar: <rdar://problem/42814956>
108 // Enabled: Yes.
109
110 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_OS_LOG)
111 #define MDNSRESPONDER_SUPPORTS_APPLE_OS_LOG 1
112 #endif
113
114 // Feature: Preallocate mDNSResponder's cache memory. For testing purposes only.
115 // Radar: <rdar://problem/29545890>
116 // Enabled: No.
117
118 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_PREALLOCATED_CACHE)
119 #define MDNSRESPONDER_SUPPORTS_APPLE_PREALLOCATED_CACHE 0
120 #endif
121
122 // Feature: Randomized AWDL Hostname
123 // Radar: <rdar://problem/47525004>
124 // Enabled: Yes.
125
126 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_RANDOM_AWDL_HOSTNAME)
127 #define MDNSRESPONDER_SUPPORTS_APPLE_RANDOM_AWDL_HOSTNAME 1
128 #endif
129
130 // Feature: Reachability trigger
131 // Radar: <rdar://problem/11374446>
132 // Enabled: Yes.
133
134 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_REACHABILITY_TRIGGER)
135 #define MDNSRESPONDER_SUPPORTS_APPLE_REACHABILITY_TRIGGER 1
136 #endif
137
138 // Feature: "SlowActivation" processing for flapping interfaces.
139 // Disabled to address stale Bonjour record issues during flapping network interface transitions.
140 // Radar: <rdar://problem/44694746>
141 // Enabled: No.
142
143 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_SLOW_ACTIVATION)
144 #define MDNSRESPONDER_SUPPORTS_APPLE_SLOW_ACTIVATION 0
145 #endif
146
147 // Feature: Suspicious Reply Defense
148 // Radar: <rdar://problem/50050767>
149 // Enabled: Yes.
150
151 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_SUSPICIOUS_REPLY_DEFENSE)
152 #define MDNSRESPONDER_SUPPORTS_APPLE_SUSPICIOUS_REPLY_DEFENSE 1
153 #endif
154
155 // Feature: Symptoms Reporting
156 // Radar: <rdar://problem/20194922>
157 // Enabled: Yes.
158
159 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_SYMPTOMS)
160 #define MDNSRESPONDER_SUPPORTS_APPLE_SYMPTOMS 1
161 #endif
162
163 // Feature: Support for performing dot-local queries via mDNS and DNS in parallel.
164 // Radar: <rdar://problem/4786302>
165 // Enabled: Yes.
166
167 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_UNICAST_DOTLOCAL)
168 #define MDNSRESPONDER_SUPPORTS_APPLE_UNICAST_DOTLOCAL 1
169 #endif
170
171 // Feature: Allow browses and registrations over interfaces that aren't ready yet.
172 // Radar: <rdar://problem/20181903>
173 // Enabled: Yes.
174
175 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_UNREADY_INTERFACES)
176 #define MDNSRESPONDER_SUPPORTS_APPLE_UNREADY_INTERFACES 1
177 #endif
178
179 // Feature: Support for Web Content Filter
180 // Radar: <rdar://problem/7409981>
181 // Enabled: Yes, if SDK has <WebFilterDNS/WebFilterDNS.h>.
182
183 #if !defined(MDNSRESPONDER_SUPPORTS_APPLE_WEB_CONTENT_FILTER)
184 #if __has_include(<WebFilterDNS/WebFilterDNS.h>)
185 #define MDNSRESPONDER_SUPPORTS_APPLE_WEB_CONTENT_FILTER 1
186 #else
187 #define MDNSRESPONDER_SUPPORTS_APPLE_WEB_CONTENT_FILTER 0
188 #endif
189 #endif
190
191 #endif // __ApplePlatformFeatures_h