--- /dev/null
+//
+// TestUtils.h
+// mDNSResponder
+//
+// Copyright (c) 2019 Apple Inc. All rights reserved.
+//
+
+#ifndef __TestUtils_h
+#define __TestUtils_h
+
+#include <TargetConditionals.h>
+#include <MacTypes.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define DNSSDUTIL_XCTEST "DNSSDUTIL_XCTEST"
+
+Boolean TestUtilsRunXCTestNamed(const char * classname);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __TestUtils_h
--- /dev/null
+//
+// TestUtils.m
+// mDNSResponder
+//
+// Copyright (c) 2019 Apple Inc. All rights reserved.
+//
+
+#import "TestUtils.h"
+
+#import <Foundation/Foundation.h>
+#import <CoreUtils/CoreUtils.h>
+#import <XCTest/XCTest.h>
+
+#if TARGET_OS_OSX
+#define XCTest_Framework_Runtime_Path "/AppleInternal/Developer/Library/Frameworks/XCTest.framework"
+#else
+#define XCTest_Framework_Runtime_Path "/Developer/Library/Frameworks/XCTest.framework"
+#endif
+
+//===========================================================================================================================
+// XCTest Utils
+//===========================================================================================================================
+static NSBundle * LoadXCTestFramework()
+{
+ NSBundle * result = nil;
+ Boolean loaded = (NSClassFromString(@"XCTestSuite") != nil);
+
+ if(!result) {
+ result = [NSBundle bundleWithPath: @ XCTest_Framework_Runtime_Path];
+ [result load];
+ loaded = (NSClassFromString(@"XCTestSuite") != nil);
+ if( !loaded ) {
+ FPrintF( stdout, "Failed to load XCTest framework from: %s\n", XCTest_Framework_Runtime_Path );
+ }
+ }
+
+ return( result );
+}
+
+//===========================================================================================================================
+// Main Test Running
+//===========================================================================================================================
+
+Boolean TestUtilsRunXCTestNamed(const char * classname)
+{
+ Boolean result = false;
+ NSBundle * xctestFramework = LoadXCTestFramework();
+
+ if(xctestFramework) {
+ NSString * name = [NSString stringWithUTF8String: classname];
+ NSBundle * testBundle = [NSBundle bundleWithPath: @"/AppleInternal/XCTests/com.apple.mDNSResponder/Tests.xctest"];
+ [testBundle load];
+
+ XCTestSuite * compiledSuite = [NSClassFromString(@"XCTestSuite") testSuiteForTestCaseWithName: name];
+ if(compiledSuite.tests.count) {
+ [compiledSuite runTest];
+ XCTestRun *testRun = compiledSuite.testRun;
+ result = (testRun.hasSucceeded != NO);
+ } else {
+ FPrintF( stdout, "Test class %s not found\n", classname );
+ }
+ }
+
+ return( result );
+}
<array>
<string>preferences.plist</string>
</array>
+ <key>com.apple.private.nehelper.privileged</key>
+ <true/>
+ <key>com.apple.networkd_privileged</key>
+ <true/>
</dict>
</plist>
#if( MDNSRESPONDER_PROJECT )
#include <dns_services.h>
#include "mdns_private.h"
+ #include "TestUtils.h"
#endif
//===========================================================================================================================
CLI_OPTION_END()
};
+#if( MDNSRESPONDER_PROJECT )
+static void XCTestCmd( void );
+
+static const char * gXCTest_Classname = NULL;
+
+static CLIOption kXCTestOpts[] =
+{
+ StringOption( 'c', "class", &gXCTest_Classname, "classname", "The classname of the XCTest to run (from /AppleInternal/XCTests/com.apple.mDNSResponder/Tests.xctest)", true ),
+ CLI_OPTION_END()
+};
+#endif
+
static CLIOption kTestOpts[] =
{
Command( "gaiperf", GAIPerfCmd, kGAIPerfOpts, "Runs DNSServiceGetAddrInfo() performance tests.", false ),
Command( "probeconflicts", ProbeConflictTestCmd, kProbeConflictTestOpts, "Tests various probing conflict scenarios.", false ),
Command( "registration", RegistrationTestCmd, kRegistrationTestOpts, "Tests service registrations.", false ),
Command( "expensive_constrained_updates", ExpensiveConstrainedTestCmd, kExpensiveConstrainedTestOpts, "Tests if the mDNSResponder can handle expensive and constrained property change correctly", false),
- CLI_OPTION_END()
+#if( MDNSRESPONDER_PROJECT )
+ Command( "xctest", XCTestCmd, kXCTestOpts, "Run a XCTest from /AppleInternal/XCTests/com.apple.mDNSResponder/Tests.xctest.", true ),
+#endif
+ CLI_OPTION_END()
};
//===========================================================================================================================
exit( 0 );
}
+//===========================================================================================================================
+// XCTestCmd
+//===========================================================================================================================
+
+static void XCTestCmd( void )
+{
+ int result = 0;
+ setenv(DNSSDUTIL_XCTEST, DNSSDUTIL_XCTEST, 0);
+ if(!TestUtilsRunXCTestNamed(gXCTest_Classname)) {
+ result = 1;
+ }
+ unsetenv(DNSSDUTIL_XCTEST);
+ exit( result );
+}
+
#endif // MDNSRESPONDER_PROJECT
//===========================================================================================================================
include $(MAKEFILEPATH)/pb_makefiles/platform.make
-MVERS = "mDNSResponder-1096.40.7"
+MVERS = "mDNSResponder-1096.60.2"
VER =
ifneq ($(strip $(GCC_VERSION)),)
const u_char * valuePtr = TXTRecordGetValuePtr( txtLen, txtRecord, "path", &valueLen );
urlComponents.path = (__bridge_transfer NSString *)CFStringCreateWithBytes( kCFAllocatorDefault, valuePtr, valueLen, kCFStringEncodingUTF8, false );
}
- if( port ) urlComponents.port = [NSNumber numberWithShort: NTOHS( port )];
+ if( port ) urlComponents.port = [NSNumber numberWithUnsignedShort: ntohs( port )];
record[_CNInstanceKey_resolveUrl] = urlComponents.URL;
}
}
--- /dev/null
+/*
+ * Copyright (c) 2019 Apple Inc. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "unittest_common.h"
+#import <XCTest/XCTest.h>
+
+#import <NetworkExtension/NEPolicySession.h>
+
+@interface PathEvaluationTest : XCTestCase
+{
+}
+@end
+
+@implementation PathEvaluationTest
+
+- (void)setUp
+{
+ mDNSPlatformMemZero(&mDNSStorage, sizeof(mDNS));
+ init_mdns_environment(mDNStrue);
+}
+
+- (void)tearDown
+{
+}
+
+- (void)testPathDeny
+{
+ if(!getenv("DNSSDUTIL_XCTEST")) return; // Don't run without this environment variable
+ mDNSBool isBlocked;
+ DNSQuestion q;
+ mDNSInterfaceID routableIndex;
+
+ mDNSPlatformMemZero(&q, sizeof(DNSQuestion));
+ q.TargetQID.NotAnInteger = 1;
+ q.pid = getpid();
+ q.InterfaceID = if_nametoindex( "pdp_ip0" );
+ fprintf(stdout, "%s %s with cellular index %d named pdp_ip0\n", q.InterfaceID ? "Starting" : "Exiting (no cellular interface)", __FUNCTION__, q.InterfaceID);
+ if (!q.InterfaceID) return;
+
+ routableIndex = IndexForInterfaceByName_ut( "pdp_ip0" );
+ fprintf(stdout, "Testing blocked by (%s)\n", routableIndex ? "policy" : "no route");
+
+ mDNSPlatformGetDNSRoutePolicy(&q, &isBlocked);
+ XCTAssertFalse(isBlocked);
+
+ // Now block it
+ NSMutableArray *routeRules = [NSMutableArray array];
+ NEPolicyRouteRule *routeRule = [NEPolicyRouteRule routeRuleWithAction:NEPolicyRouteRuleActionDeny forType:NEPolicyRouteRuleTypeCellular];
+ [routeRules addObject:routeRule];
+ routeRule = [NEPolicyRouteRule routeRuleWithAction:NEPolicyRouteRuleActionDeny forType:NEPolicyRouteRuleTypeWiFi];
+ [routeRules addObject:routeRule];
+ routeRule = [NEPolicyRouteRule routeRuleWithAction:NEPolicyRouteRuleActionDeny forType:NEPolicyRouteRuleTypeWired];
+ [routeRules addObject:routeRule];
+
+ NEPolicyResult *result = [NEPolicyResult routeRules:routeRules];
+ NEPolicy *policy = [[NEPolicy alloc] initWithOrder:1 result:result conditions:@[ [NEPolicyCondition effectivePID:q.pid], [NEPolicyCondition allInterfaces] ]];
+
+ NEPolicySession *policySession = [[NEPolicySession alloc] init];
+ XCTAssertNotNil(policySession, "Check entitlemnts");
+ [policySession addPolicy:policy];
+ [policySession apply];
+
+ mDNSPlatformGetDNSRoutePolicy(&q, &isBlocked);
+ // Either if these asserts indicate a regression in mDNSPlatformGetDNSRoutePolicy
+ if (routableIndex) XCTAssertTrue(isBlocked, "blocked by (policy) test failure");
+ else XCTAssertFalse(isBlocked, "blocked by (no route) test failure");
+
+ [policySession removeAllPolicies];
+ [policySession apply];
+ fprintf(stdout, "Completed %s\n", __FUNCTION__);
+}
+
+@end
<string>mDNSResponder</string>
</array>
</dict>
- <dict>
- <key>TestName</key>
- <string>XCTests</string>
- <key>Description</key>
- <string>mDNSResponder XCTests</string>
- <key>WorkingDirectory</key>
- <string>/AppleInternal/XCTests/com.apple.mDNSResponder/</string>
- <key>AsRoot</key>
- <false/>
- <key>RequiresWiFi</key>
- <true/>
- <key>Timeout</key>
- <integer>20</integer>
- <key>ShowSubtestResults</key>
- <true/>
- <key>Command</key>
- <array>
- <string>BATS_XCTEST_CMD</string>
- <string>-NSTreatUnknownArgumentsAsOpen</string>
- <string>NO</string>
- <string>-ApplePersistenceIgnoreState</string>
- <string>YES</string>
- <string>-XCTest</string>
- <string>Self</string>
- <string>Tests.xctest</string>
- </array>
- </dict>
<dict>
<key>TestName</key>
<string>Fix Verification #1</string>
<string>mDNSResponder</string>
</array>
</dict>
+ <dict>
+ <key>TestName</key>
+ <string>XCTests</string>
+ <key>Description</key>
+ <string>mDNSResponder XCTests</string>
+ <key>WorkingDirectory</key>
+ <string>/AppleInternal/XCTests/com.apple.mDNSResponder/</string>
+ <key>AsRoot</key>
+ <false/>
+ <key>RequiresWiFi</key>
+ <true/>
+ <key>Timeout</key>
+ <integer>20</integer>
+ <key>ShowSubtestResults</key>
+ <true/>
+ <key>Command</key>
+ <array>
+ <string>BATS_XCTEST_CMD</string>
+ <string>-NSTreatUnknownArgumentsAsOpen</string>
+ <string>NO</string>
+ <string>-ApplePersistenceIgnoreState</string>
+ <string>YES</string>
+ <string>-XCTest</string>
+ <string>Self</string>
+ <string>Tests.xctest</string>
+ </array>
+ </dict>
+ <dict>
+ <key>TestName</key>
+ <string>PathEvaluationTest</string>
+ <key>Description</key>
+ <string>PathEvaluationTest from Tests.xctest</string>
+ <key>AsRoot</key>
+ <false/>
+ <key>RequiresWiFi</key>
+ <false/>
+ <key>Timeout</key>
+ <integer>5</integer>
+ <key>IgnoreOutput</key>
+ <false/>
+ <key>Command</key>
+ <array>
+ <string>/usr/local/bin/dnssdutil</string>
+ <string>test</string>
+ <string>xctest</string>
+ <string>-c</string>
+ <string>PathEvaluationTest</string>
+ </array>
+ </dict>
</array>
</dict>
</plist>
B7706AAF1DBA9C1800593FD5 /* CNDomainBrowserPathUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = B799209E1DA6BA8E00C6E02B /* CNDomainBrowserPathUtils.m */; };
B778EE4D1D51113800C814A2 /* HostnameController.m in Sources */ = {isa = PBXBuildFile; fileRef = B778EE4B1D51113800C814A2 /* HostnameController.m */; };
B778EE501D51287100C814A2 /* BonjourSettingsController.m in Sources */ = {isa = PBXBuildFile; fileRef = B778EE4F1D51287100C814A2 /* BonjourSettingsController.m */; };
+ B77CAFCE234EADE5006706B4 /* PathEvaluationTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B77CAFCD234EADE5006706B4 /* PathEvaluationTest.m */; };
+ B77CAFD0234EAE72006706B4 /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B77CAFCF234EAE72006706B4 /* NetworkExtension.framework */; };
B78A9C30223941A900BFB0C6 /* DNSServiceDiscoveryPref.xib in Resources */ = {isa = PBXBuildFile; fileRef = B78A9C2E223941A900BFB0C6 /* DNSServiceDiscoveryPref.xib */; };
B79568351D53F693005E3BED /* DomainBrowser.h in Headers */ = {isa = PBXBuildFile; fileRef = B74EC12B1D494C7200A1D155 /* DomainBrowser.h */; settings = {ATTRIBUTES = (Public, ); }; };
B79568361D53F69B005E3BED /* CNDomainBrowserView.h in Headers */ = {isa = PBXBuildFile; fileRef = B7D6CA681D1076C6005E24CF /* CNDomainBrowserView.h */; settings = {ATTRIBUTES = (Public, ); }; };
B7EEF7EA212613260093828F /* uds_daemon.c in Sources */ = {isa = PBXBuildFile; fileRef = F525E72804AA167501F1CF4D /* uds_daemon.c */; };
B7EEF7EC212613D10093828F /* dnsproxy.c in Sources */ = {isa = PBXBuildFile; fileRef = 218E8E4F156D8C0300720DA0 /* dnsproxy.c */; };
B7EEF7ED212613D50093828F /* DNSProxySupport.c in Sources */ = {isa = PBXBuildFile; fileRef = 21DED43415702C0F0060B6B9 /* DNSProxySupport.c */; };
+ B7F1FEDE234F89C50081159C /* TestUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = B7F1FEDC234F89C50081159C /* TestUtils.h */; };
+ B7F1FEDF234F89C50081159C /* TestUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = B7F1FEDD234F89C50081159C /* TestUtils.m */; };
BD03E88D1AD31278005E8A81 /* SymptomReporter.c in Sources */ = {isa = PBXBuildFile; fileRef = BD03E88C1AD31278005E8A81 /* SymptomReporter.c */; };
BD11267121DB1B25006115E6 /* dnssd_server.h in Headers */ = {isa = PBXBuildFile; fileRef = BD11267021DB1AFE006115E6 /* dnssd_server.h */; };
BD11267221DB1B29006115E6 /* dnssd_xpc.h in Headers */ = {isa = PBXBuildFile; fileRef = BD11266D21DB1AFE006115E6 /* dnssd_xpc.h */; };
B778EE4B1D51113800C814A2 /* HostnameController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HostnameController.m; path = ../SettingsBundle/HostnameController.m; sourceTree = "<group>"; };
B778EE4E1D51287100C814A2 /* BonjourSettingsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BonjourSettingsController.h; path = ../SettingsBundle/BonjourSettingsController.h; sourceTree = "<group>"; };
B778EE4F1D51287100C814A2 /* BonjourSettingsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BonjourSettingsController.m; path = ../SettingsBundle/BonjourSettingsController.m; sourceTree = "<group>"; };
+ B77CAFCD234EADE5006706B4 /* PathEvaluationTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PathEvaluationTest.m; sourceTree = "<group>"; };
+ B77CAFCF234EAE72006706B4 /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; };
B78A9C2F223941A900BFB0C6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/DNSServiceDiscoveryPref.xib; sourceTree = "<group>"; };
B78A9C322239485E00BFB0C6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
B799209D1DA6BA8E00C6E02B /* CNDomainBrowserPathUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNDomainBrowserPathUtils.h; sourceTree = "<group>"; };
B7D6CA691D1076C6005E24CF /* CNDomainBrowserView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNDomainBrowserView.m; sourceTree = "<group>"; };
B7D6CA701D1076F3005E24CF /* DomainBrowser.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DomainBrowser.framework; sourceTree = BUILT_PRODUCTS_DIR; };
B7E06CDF2329AA7B0021401F /* LocalOnlyWithInterfacesTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LocalOnlyWithInterfacesTest.m; sourceTree = "<group>"; };
+ B7F1FEDC234F89C50081159C /* TestUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestUtils.h; sourceTree = "<group>"; };
+ B7F1FEDD234F89C50081159C /* TestUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestUtils.m; sourceTree = "<group>"; };
+ B7F1FEEA234FAF0F0081159C /* dnssdutil-entitlements.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "dnssdutil-entitlements.plist"; sourceTree = "<group>"; };
BD03E88C1AD31278005E8A81 /* SymptomReporter.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SymptomReporter.c; sourceTree = "<group>"; };
BD11266D21DB1AFE006115E6 /* dnssd_xpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dnssd_xpc.h; sourceTree = "<group>"; };
BD11266E21DB1AFE006115E6 /* dnssd_xpc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dnssd_xpc.c; sourceTree = "<group>"; };
B7A861A2212B408D00E81CC3 /* Security.framework in Frameworks */,
B7EEF7C4212603B20093828F /* SystemConfiguration.framework in Frameworks */,
B7A861A9212B411600E81CC3 /* Network.framework in Frameworks */,
+ B77CAFD0234EAE72006706B4 /* NetworkExtension.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
B74BF92D2322E97400E35354 /* SuspiciousReplyTest.m */,
B74BF930232701F600E35354 /* CacheOrderTest.m */,
B7E06CDF2329AA7B0021401F /* LocalOnlyWithInterfacesTest.m */,
+ B77CAFCD234EADE5006706B4 /* PathEvaluationTest.m */,
);
path = "Unit Tests";
sourceTree = "<group>";
BD97754A221D643500F68FFC /* dnssdutil */ = {
isa = PBXGroup;
children = (
+ B7F1FEEA234FAF0F0081159C /* dnssdutil-entitlements.plist */,
BD97754D221D64BF00F68FFC /* DNSMessage.c */,
BD97754E221D64BF00F68FFC /* DNSMessage.h */,
+ B7F1FEDC234F89C50081159C /* TestUtils.h */,
+ B7F1FEDD234F89C50081159C /* TestUtils.m */,
BD97754B221D643500F68FFC /* dnssdutil.c */,
);
name = dnssdutil;
BD9BA7561EAF929C00658CCF /* Frameworks */ = {
isa = PBXGroup;
children = (
+ B77CAFCF234EAE72006706B4 /* NetworkExtension.framework */,
BDA82B8922BF8A7000A31CBE /* libdns_services.tbd */,
D448F7AD222DCC0A0069E1D2 /* CoreFoundation.framework */,
D448F7AB222DCB5B0069E1D2 /* libarchive.tbd */,
files = (
BD977550221D64BF00F68FFC /* DNSMessage.h in Headers */,
D4A9F60521FA797F0079D0C6 /* dns_sd_private.h in Headers */,
+ B7F1FEDE234F89C50081159C /* TestUtils.h in Headers */,
BD2A15B9225ED30C00BEA50A /* mdns_private.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
D40123922272B7A7006C9BBE /* mdns.c in Sources */,
B7EEF7CA2126046A0093828F /* uDNS.c in Sources */,
D4F2BB2822CD21CB00234A38 /* posix_utilities.c in Sources */,
+ B77CAFCE234EADE5006706B4 /* PathEvaluationTest.m in Sources */,
B7EEF7D82126076F0093828F /* dnssec.c in Sources */,
B7EEF7E021260A1F0093828F /* helper-stubs.c in Sources */,
B79FA14B211CE8CA00B7861E /* DNSCommon.c in Sources */,
BD97754F221D64BF00F68FFC /* DNSMessage.c in Sources */,
BD2A15BA225ED31C00BEA50A /* mdns.c in Sources */,
BD2A15BB225ED33C00BEA50A /* mdns_object.m in Sources */,
+ B7F1FEDF234F89C50081159C /* TestUtils.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
);
INFOPLIST_FILE = "Tests/Unit Tests/Info.plist";
INSTALL_PATH = /AppleInternal/XCTests/com.apple.mDNSResponder/;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks /AppleInternal/Developer/Library/Frameworks";
MTL_FAST_MATH = YES;
OTHER_CFLAGS = (
"-DUSE_SYSTEMCONFIGURATION_PRIVATE_HEADERS",
WebFilterDNS,
"-weak_framework",
DeviceToDeviceManager,
+ "-weak_framework",
+ XCTest,
);
"OTHER_LDFLAGS[sdk=iphoneos*]" = (
"-weak_framework",
);
INFOPLIST_FILE = "Tests/Unit Tests/Info.plist";
INSTALL_PATH = /AppleInternal/XCTests/com.apple.mDNSResponder/;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks /AppleInternal/Developer/Library/Frameworks";
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
WebFilterDNS,
"-weak_framework",
DeviceToDeviceManager,
+ "-weak_framework",
+ XCTest,
);
"OTHER_LDFLAGS[sdk=iphoneos*]" = (
"-weak_framework",
HEADER_SEARCH_PATHS = "$(SDKROOT)${SYSTEM_LIBRARY_DIR}/Frameworks/System.framework/PrivateHeaders";
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = "$(TARGET_NAME)";
+ SYSTEM_FRAMEWORK_SEARCH_PATHS = "$(inherited) $(SDKROOT)/System/Library/PrivateFrameworks $(PLATFORM_DIR)/Developer/Library/Frameworks $(PLATFORM_DIR)/Developer/AppleInternal/Library/Frameworks";
WARNING_CFLAGS = (
"-Wall",
"-Warc-repeated-use-of-weak",
HEADER_SEARCH_PATHS = "$(SDKROOT)${SYSTEM_LIBRARY_DIR}/Frameworks/System.framework/PrivateHeaders";
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = "$(TARGET_NAME)";
+ SYSTEM_FRAMEWORK_SEARCH_PATHS = "$(inherited) $(SDKROOT)/System/Library/PrivateFrameworks $(PLATFORM_DIR)/Developer/Library/Frameworks $(PLATFORM_DIR)/Developer/AppleInternal/Library/Frameworks";
WARNING_CFLAGS = (
"-Wall",
"-Warc-repeated-use-of-weak",
}
}
- if (isUUIDSet && path && (nw_path_get_status(path) == nw_path_status_unsatisfied) && (nw_path_get_reason(path) == nw_path_reason_policy_drop))
+ if (isUUIDSet && path && (nw_path_get_status(path) == nw_path_status_unsatisfied) && (nw_path_get_reason(path) != nw_path_reason_no_route))
*isBlocked = mDNStrue;
else
*isBlocked = mDNSfalse;
*/
#ifndef _DNS_SD_H
-#define _DNS_SD_H 10964007
+#define _DNS_SD_H 10966002
#ifdef __cplusplus
extern "C" {
#include "DNSCommon.h" // Defines general DNS utility routines
#include "unittest_common.h"
+#include "mDNSMacOSX.h"
// To match *either* a v4 or v6 instance of this interface
mDNSlocal mDNSInterfaceID SearchForInterfaceByAddr(mDNSAddr* addr)
{
mDNSDomainLabelFromCFString(cfs, namelabel);
}
+
+mDNSexport mDNSu32 IndexForInterfaceByName_ut(const char *ifname)
+{
+ NetworkInterfaceInfoOSX * i = SearchForInterfaceByName(ifname, AF_UNSPEC);
+ return (i ? i->scope_id : 0);
+}
// HelperFunctionTest
extern void mDNSDomainLabelFromCFString_ut(CFStringRef cfs, domainlabel *const namelabel);
+mDNSexport mDNSu32 IndexForInterfaceByName_ut(const char *ifname);
#endif /* UNITTEST_COMMON_H */