<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
- <string>SystemConfiguration</string>
+ <string>com.apple.SystemConfiguration.ATconfig</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
- <string>1.9.2</string>
+ <string>1.10</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>1.9.2</string>
+ <string>1.10</string>
<key>Builtin</key>
<true/>
<key>Requires</key>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
- <string>SystemConfiguration</string>
+ <string>com.apple.SystemConfiguration.IPMonitor</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
- <string>1.9.2</string>
+ <string>1.10</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>1.9.2</string>
+ <string>1.10</string>
<key>Requires</key>
<array>
<string>com.apple.SystemConfiguration.IPConfiguration</string>
</array>
<key>Builtin</key>
<true/>
+ <key>mdns_timeout</key>
+ <integer>2</integer>
<key>pdns_timeout</key>
<integer>5</integer>
+ <key>AppendStateArrayToSetupArray</key>
+ <false/>
</dict>
</plist>
--- /dev/null
+test_dns: Makefile dns-configuration.h dns-configuration.c
+ cc -Wall -g -o test_dns -DMAIN dns-configuration.c -framework SystemConfiguration -framework CoreFoundation -ldnsinfo
+
+test_smb: Makefile smb-configuration.h smb-configuration.c
+ cc -Wall -g -o test_smb -DMAIN -DDEBUG smb-configuration.c -framework SystemConfiguration -framework CoreFoundation
+
+test_ipv4_routelist: ip_plugin.c
+ cc -Wall -g -o test_ipv4_routelist -DTEST_IPV4_ROUTELIST smb-configuration.c ip_plugin.c -framework SystemConfiguration -framework CoreFoundation -ldnsinfo
+
+IPMonitor: ip_plugin.c
+ cc -Wall -g -o IPMonitor -DTEST_IPMONITOR smb-configuration.c ip_plugin.c -framework SystemConfiguration -framework CoreFoundation -ldnsinfo
+
+test_ipv4_routelist_reference.txt: test_ipv4_routelist
+ sh test_reference.sh create test_ipv4_routelist test_ipv4_routelist_reference.txt test_ipv4_routelist_filter.sh
+
+test_ipv4_routelist_test: test_ipv4_routelist
+ sh test_reference.sh test test_ipv4_routelist test_ipv4_routelist_reference.txt test_ipv4_routelist_filter.sh
+
+
+clean:
+ rm -rf test_dns test_dns.dSYM \
+ test_smb test_smb.dSYM \
+ test_ipv4_routelist test_ipv4_routelist.dSYM \
+ IPMonitor IPMonitor.dSYM
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<array>
- <dict>
- <key>Options</key>
- <string>mdns</string>
- <key>ServerTimeout</key>
- <integer>2</integer>
- <key>SupplementalMatchDomains</key>
- <array>
- <string>local</string>
- <string>254.169.in-addr.arpa</string>
- <string>8.e.f.ip6.arpa</string>
- <string>9.e.f.ip6.arpa</string>
- <string>a.e.f.ip6.arpa</string>
- <string>b.e.f.ip6.arpa</string>
- </array>
- </dict>
-</array>
-</plist>
/*
- * Copyright (c) 2004-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2004-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* - initial revision
*/
+#include <TargetConditionals.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
#include <resolv.h>
+#if !TARGET_OS_IPHONE
+#include <notify.h>
+extern uint32_t notify_monitor_file(int token, const char *name, int flags);
+#endif // !TARGET_OS_IPHONE
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SystemConfiguration.h>
#include <dnsinfo_create.h>
#include <dns_sd.h>
+#ifndef kDNSServiceCompMulticastDNS
+#define kDNSServiceCompMulticastDNS "MulticastDNS"
+#endif
#ifndef kDNSServiceCompPrivateDNS
#define kDNSServiceCompPrivateDNS "PrivateDNS"
#endif
-/* pre-defined (supplemental) resolver configurations */
-static CFArrayRef S_predefined = NULL;
+/* multicast DNS resolver configurations */
+static CFNumberRef S_mdns_timeout = NULL;
/* private DNS resolver configurations */
static CFNumberRef S_pdns_timeout = NULL;
}
-static void
-add_predefined_resolvers(CFMutableArrayRef supplemental)
-{
- CFIndex i;
- CFIndex n;
-
- if (S_predefined == NULL) {
- return;
- }
-
- n = CFArrayGetCount(S_predefined);
- for (i = 0; i < n; i++) {
- uint32_t defaultOrder;
- CFDictionaryRef dns;
-
- dns = CFArrayGetValueAtIndex(S_predefined, i);
- if (!isA_CFDictionary(dns)) {
- continue;
- }
-
- defaultOrder = DEFAULT_SEARCH_ORDER
- + (DEFAULT_SEARCH_ORDER / 2)
- + ((DEFAULT_SEARCH_ORDER / 1000) * i);
- add_supplemental(supplemental, dns, defaultOrder);
- }
-
- return;
-}
-
-
#define N_QUICK 32
}
+static void
+add_multicast_resolvers(CFMutableArrayRef supplemental, CFArrayRef multicastResolvers)
+{
+ CFIndex i;
+ CFIndex n;
+
+ n = isA_CFArray(multicastResolvers) ? CFArrayGetCount(multicastResolvers) : 0;
+ for (i = 0; i < n; i++) {
+ uint32_t defaultOrder;
+ CFStringRef domain;
+ CFNumberRef num;
+ CFMutableDictionaryRef resolver;
+
+ domain = CFArrayGetValueAtIndex(multicastResolvers, i);
+ if (!isA_CFString(domain) || (CFStringGetLength(domain) == 0)) {
+ continue;
+ }
+
+ defaultOrder = DEFAULT_SEARCH_ORDER
+ + (DEFAULT_SEARCH_ORDER / 2)
+ + ((DEFAULT_SEARCH_ORDER / 1000) * i);
+
+ resolver = CFDictionaryCreateMutable(NULL,
+ 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ CFDictionarySetValue(resolver, kSCPropNetDNSDomainName, domain);
+ CFDictionarySetValue(resolver, kSCPropNetDNSOptions, CFSTR("mdns"));
+ num = CFNumberCreate(NULL, kCFNumberIntType, &defaultOrder);
+ CFDictionarySetValue(resolver, kSCPropNetDNSSearchOrder, num);
+ CFRelease(num);
+ if (S_mdns_timeout != NULL) {
+ CFDictionarySetValue(resolver, kSCPropNetDNSServerTimeout, S_mdns_timeout);
+ }
+ add_resolver(supplemental, resolver);
+ CFRelease(resolver);
+ }
+
+ return;
+}
+
+
static void
add_private_resolvers(CFMutableArrayRef supplemental, CFArrayRef privateResolvers)
{
CFIndex defaultSearchIndex = 0;
CFIndex i;
CFMutableArrayRef mySearchDomains;
- CFMutableArrayRef mySupplemental = (CFMutableArrayRef)supplemental;
+ CFMutableArrayRef mySupplemental = NULL;
CFIndex n_supplemental;
Boolean searchDomainAdded = FALSE;
CFRangeMake(0, n_supplemental),
compareBySearchOrder,
NULL);
+ supplemental = mySupplemental;
}
for (i = 0; i < n_supplemental; i++) {
CFStringRef supplementalDomain;
uint32_t supplementalOrder;
- dns = CFArrayGetValueAtIndex(mySupplemental, i);
+ dns = CFArrayGetValueAtIndex(supplemental, i);
options = CFDictionaryGetValue(dns, kSCPropNetDNSOptions);
- if (isA_CFString(options) && CFEqual(options, CFSTR("pdns"))) {
- // don't add private resolver domains to the search list
- continue;
+ if (isA_CFString(options)) {
+ CFRange range;
+
+ if (CFEqual(options, CFSTR("pdns"))) {
+ // don't add private resolver domains to the search list
+ continue;
+ }
+
+ range = CFStringFind(options, CFSTR("interface="), 0);
+ if (range.location != kCFNotFound) {
+ // don't add scoped resolver domains to the search list
+ continue;
+ }
}
supplementalDomain = CFDictionaryGetValue(dns, kSCPropNetDNSDomainName);
}
CFRelease(mySearchDomains);
- if (mySupplemental != supplemental) CFRelease(mySupplemental);
+ if (mySupplemental != NULL) CFRelease(mySupplemental);
return;
}
}
}
+ // process sortlist
+ list = CFDictionaryGetValue(dns, kSCPropNetDNSSortList);
+ if (isA_CFArray(list)) {
+ CFIndex i;
+ CFIndex n = CFArrayGetCount(list);
+
+ for (i = 0; i < n; i++) {
+ char buf[128];
+ char *slash;
+ dns_sortaddr_t sortaddr;
+
+ str = CFArrayGetValueAtIndex(list, i);
+ if (!isA_CFString(str)) {
+ continue;
+ }
+
+ if (_SC_cfstring_to_cstring(str, buf, sizeof(buf), kCFStringEncodingASCII) == NULL) {
+ continue;
+ }
+
+ slash = strchr(buf, '/');
+ if (slash != NULL) {
+ *slash = '\0';
+ }
+
+ bzero(&sortaddr, sizeof(sortaddr));
+ if (inet_aton(buf, &sortaddr.address) != 1) {
+ /* if address not valid */
+ continue;
+ }
+
+ if (slash != NULL) {
+ if (inet_aton(slash + 1, &sortaddr.mask) != 1) {
+ /* if subnet mask not valid */
+ continue;
+ }
+ } else {
+ in_addr_t a;
+ in_addr_t m;
+
+ a = ntohl(sortaddr.address.s_addr);
+ if (IN_CLASSA(a)) {
+ m = IN_CLASSA_NET;
+ } else if (IN_CLASSB(a)) {
+ m = IN_CLASSB_NET;
+ } else if (IN_CLASSC(a)) {
+ m = IN_CLASSC_NET;
+ } else {
+ continue;
+ }
+
+ sortaddr.mask.s_addr = htonl(m);
+ }
+
+ _dns_resolver_add_sortaddr(&_resolver, &sortaddr);
+ }
+ }
+
// process port
num = CFDictionaryGetValue(dns, kSCPropNetDNSServerPort);
if (isA_CFNumber(num)) {
dns_configuration_set(CFDictionaryRef defaultResolver,
CFDictionaryRef services,
CFArrayRef serviceOrder,
+ CFArrayRef multicastResolvers,
CFArrayRef privateResolvers)
{
CFIndex i;
CFMutableDictionaryRef myDefault;
- CFStringRef myDomain = NULL;
uint32_t myOrder = DEFAULT_SEARCH_ORDER;
Boolean myOrderAdded = FALSE;
CFIndex n_supplemental;
CFNumberRef order;
dns_create_resolver_t resolver;
- CFArrayRef search;
CFMutableArrayRef supplemental;
+#ifdef SPECIAL_HANDLING_FOR_DEFAULT_DOMAIN
+ CFStringRef myDomain = NULL;
+ CFArrayRef search;
+#endif // SPECIAL_HANDLING_FOR_DEFAULT_DOMAIN
+
if (defaultResolver == NULL) {
myDefault = CFDictionaryCreateMutable(NULL,
0,
// identify search[] list and/or domain name
+#ifdef SPECIAL_HANDLING_FOR_DEFAULT_DOMAIN
search = CFDictionaryGetValue(myDefault, kSCPropNetDNSSearchDomains);
if (isA_CFArray(search) && (CFArrayGetCount(search) > 0)) {
myDomain = CFArrayGetValueAtIndex(search, 0);
add_resolver(supplemental, mySupplemental);
CFRelease(mySupplemental);
}
+#endif // SPECIAL_HANDLING_FOR_DEFAULT_DOMAIN
// collect (and add) any supplemental resolver configurations
update_search_domains(&myDefault, supplemental);
- // add any pre-defined resolver configurations
+ // collect (and add) any "multicast" resolver configurations
- add_predefined_resolvers(supplemental);
+ add_multicast_resolvers(supplemental, multicastResolvers);
// check if the "match for default domain" (above) is really needed
+#ifdef SPECIAL_HANDLING_FOR_DEFAULT_DOMAIN
if (myDomain != NULL) {
Boolean sharedDomain = FALSE;
CFArrayRemoveValueAtIndex(supplemental, 0);
}
}
+#endif // SPECIAL_HANDLING_FOR_DEFAULT_DOMAIN
// establish resolver configuration
_dns_resolver_free(&resolver);
}
+#if !TARGET_OS_IPHONE
+ // add flatfile resolvers
+
+ _dnsinfo_flatfile_add_resolvers(&_config);
+#endif // !TARGET_OS_IPHONE
+
// save configuration
if (!_dns_configuration_store(&_config)) {
}
+#if !TARGET_OS_IPHONE
+static SCDynamicStoreRef dns_configuration_store;
+static SCDynamicStoreCallBack dns_configuration_callout;
+
static void
-load_predefined_resolvers(CFBundleRef bundle)
+dns_configuration_changed(CFMachPortRef port, void *msg, CFIndex size, void *info)
{
- Boolean ok;
- CFURLRef url;
- CFStringRef xmlError = NULL;
- CFDataRef xmlResolvers = NULL;
+ CFStringRef key = CFSTR(_PATH_RESOLVER_DIR);
+ CFArrayRef keys;
+ Boolean resolvers_now;
+ static Boolean resolvers_save = FALSE;
+ struct stat statbuf;
+
+ resolvers_now = (stat(_PATH_RESOLVER_DIR, &statbuf) == 0);
+ if (!resolvers_save && (resolvers_save == resolvers_now)) {
+ // if we did not (and still do not) have an "/etc/resolvers"
+ // directory than this notification is the result of a change
+ // to the "/etc" directory.
+ return;
+ }
+ resolvers_save = resolvers_now;
+
+ SCLog(TRUE, LOG_DEBUG, CFSTR(_PATH_RESOLVER_DIR " changed"));
- url = CFBundleCopyResourceURL(bundle, CFSTR("Resolvers"), CFSTR("plist"), NULL);
- if (url == NULL) {
+ // fake a "DNS" change
+ keys = CFArrayCreate(NULL, (const void **)&key, 1, &kCFTypeArrayCallBacks);
+ (*dns_configuration_callout)(dns_configuration_store, keys, NULL);
+ CFRelease(keys);
+ return;
+}
+
+
+__private_extern__
+void
+dns_configuration_monitor(SCDynamicStoreRef store, SCDynamicStoreCallBack callout)
+{
+ CFMachPortRef mp;
+ mach_port_t notify_port;
+ int notify_token;
+ CFRunLoopSourceRef rls;
+ uint32_t status;
+
+ dns_configuration_store = store;
+ dns_configuration_callout = callout;
+
+ status = notify_register_mach_port(_PATH_RESOLVER_DIR, ¬ify_port, 0, ¬ify_token);
+ if (status != NOTIFY_STATUS_OK) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("notify_register_mach_port() failed"));
return;
}
- ok = CFURLCreateDataAndPropertiesFromResource(NULL, url, &xmlResolvers, NULL, NULL, NULL);
- CFRelease(url);
- if (!ok || (xmlResolvers == NULL)) {
+ status = notify_monitor_file(notify_token, "/private" _PATH_RESOLVER_DIR, 0);
+ if (status != NOTIFY_STATUS_OK) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("notify_monitor_file() failed"));
+ (void)notify_cancel(notify_token);
return;
}
- /* convert the XML data into a property list */
- S_predefined = CFPropertyListCreateFromXMLData(NULL, xmlResolvers, kCFPropertyListImmutable, &xmlError);
- CFRelease(xmlResolvers);
- if (S_predefined == NULL) {
- if (xmlError != NULL) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("add_predefined_resolvers: %@"), xmlError);
- CFRelease(xmlError);
- }
+ mp = CFMachPortCreateWithPort(NULL, notify_port, dns_configuration_changed, NULL, NULL);
+ if (mp == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("CFMachPortCreateWithPort() failed"));
+ (void)notify_cancel(notify_token);
return;
}
- if (!isA_CFArray(S_predefined)) {
- CFRelease(S_predefined);
- S_predefined = NULL;
+ rls = CFMachPortCreateRunLoopSource(NULL, mp, -1);
+ if (rls == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreCreateRunLoopSource() failed"));
+ CFRelease(mp);
+ (void)notify_cancel(notify_token);
return;
}
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);
+ CFRelease(rls);
+ CFRelease(mp);
return;
}
+#endif // !TARGET_OS_IPHONE
__private_extern__
dict = CFBundleGetInfoDictionary(bundle);
if (isA_CFDictionary(dict)) {
+ S_mdns_timeout = CFDictionaryGetValue(dict, CFSTR("mdns_timeout"));
+ S_mdns_timeout = isA_CFNumber(S_mdns_timeout);
+
S_pdns_timeout = CFDictionaryGetValue(dict, CFSTR("pdns_timeout"));
S_pdns_timeout = isA_CFNumber(S_pdns_timeout);
}
- load_predefined_resolvers(bundle);
return;
}
{
CFDictionaryRef entities;
CFStringRef key;
+ CFArrayRef multicast_resolvers;
CFStringRef pattern;
CFMutableArrayRef patterns;
CFStringRef primary = NULL;
service_order = CFDictionaryGetValue(setup_global_ipv4, kSCPropNetServiceOrder);
}
+ // get multicast resolvers
+ key = SCDynamicStoreKeyCreate(NULL, CFSTR("%@/%@/%@"),
+ kSCDynamicStoreDomainState,
+ kSCCompNetwork,
+ CFSTR(kDNSServiceCompMulticastDNS));
+ multicast_resolvers = SCDynamicStoreCopyValue(store, key);
+ CFRelease(key);
+
// get private resolvers
key = SCDynamicStoreKeyCreate(NULL, CFSTR("%@/%@/%@"),
kSCDynamicStoreDomainState,
// update DNS configuration
dns_configuration_init(CFBundleGetMainBundle());
- dns_configuration_set(primaryDNS, service_state_dict, service_order, private_resolvers);
+ dns_configuration_set(primaryDNS,
+ service_state_dict,
+ service_order,
+ multicast_resolvers,
+ private_resolvers);
// cleanup
if (setup_global_ipv4 != NULL) CFRelease(setup_global_ipv4);
if (state_global_ipv4 != NULL) CFRelease(state_global_ipv4);
+ if (multicast_resolvers != NULL) CFRelease(multicast_resolvers);
if (private_resolvers != NULL) CFRelease(private_resolvers);
CFRelease(service_state_dict);
CFRelease(store);
/*
- * Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2006, 2008, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#ifndef _DNS_CONFIGURATION_H
#define _DNS_CONFIGURATION_H
+#include <TargetConditionals.h>
#include <sys/cdefs.h>
#include <CoreFoundation/CoreFoundation.h>
void dns_configuration_init (CFBundleRef bundle);
+
+#if !TARGET_OS_IPHONE
+void dns_configuration_monitor (SCDynamicStoreRef store,
+ SCDynamicStoreCallBack callout);
+#endif // !TARGET_OS_IPHONE
+
void dns_configuration_set (CFDictionaryRef defaultResolver,
CFDictionaryRef services,
CFArrayRef serviceOrder,
+ CFArrayRef multicastResolvers,
CFArrayRef privateResolvers);
__END_DECLS
/*
- * Copyright (c) 2000-2007 Apple Inc. All Rights Reserved.
+ * Copyright (c) 2000-2009 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*
* June 20, 2006 Allan Nathanson (ajn@apple.com)
* - add SMB configuration
+ *
+ * December 5, 2007 Dieter Siegmund (dieter@apple.com)
+ * - added support for multiple scoped routes
*/
#include <stdlib.h>
#include <notify.h>
#include <SystemConfiguration/SystemConfiguration.h>
+#include <SystemConfiguration/SCDynamicStoreCopyDHCPInfo.h>
#include <SystemConfiguration/SCValidation.h>
#include <SystemConfiguration/SCPrivate.h> /* for SCLog() */
#include <dnsinfo.h>
+#if !TARGET_OS_IPHONE
+#include <dnsinfo_create.h>
+#endif /* !TARGET_OS_IPHONE */
#include <dns_sd.h>
+#ifndef kDNSServiceCompMulticastDNS
+#define kDNSServiceCompMulticastDNS "MulticastDNS"
+#endif
#ifndef kDNSServiceCompPrivateDNS
#define kDNSServiceCompPrivateDNS "PrivateDNS"
#endif
+enum {
+ kProtocolFlagsNone = 0x0,
+ kProtocolFlagsIPv4 = 0x1,
+ kProtocolFlagsIPv6 = 0x2
+};
+typedef uint8_t ProtocolFlags;
+
+enum {
+ kDebugFlag1 = 0x00000001,
+ kDebugFlag2 = 0x00000002,
+ kDebugFlag4 = 0x00000004,
+ kDebugFlag8 = 0x00000008,
+ kDebugFlagDefault = kDebugFlag1,
+ kDebugFlagAll = 0xffffffff
+};
+
+#ifdef TEST_IPV4_ROUTELIST
+#define ROUTELIST_DEBUG(a, f) { if ((S_IPMonitor_debug & (f)) != 0) printf a ;}
+#else
+#define ROUTELIST_DEBUG(a, f)
+#endif
+
#include "set-hostname.h"
#include "dns-configuration.h"
+#if !TARGET_OS_IPHONE
#include "smb-configuration.h"
+#endif /* !TARGET_OS_IPHONE */
+
+#define PPP_PREFIX "ppp"
#define IP_FORMAT "%d.%d.%d.%d"
#define IP_CH(ip) ((u_char *)(ip))
#define IP_LIST(ip) IP_CH(ip)[0],IP_CH(ip)[1],IP_CH(ip)[2],IP_CH(ip)[3]
-/* debug output on/off */
-static boolean_t S_IPMonitor_debug = FALSE;
+typedef uint32_t Rank;
+
+enum {
+ kRankFirst = 0,
+ kRankLast = UINT_MAX
+};
+
+/*
+ * IPv4 Route management
+ */
+
+typedef uint32_t RouteFlags;
+
+enum {
+ kRouteIsDirectToInterfaceFlag = 0x00000001,
+ kRouteIsNotSubnetLocalFlag = 0x00000002,
+ kRouteChooseFirstFlag = 0x00000004,
+ kRouteChooseLastFlag = 0x00000008,
+ kRouteChooseNeverFlag = 0x00000010,
+ kRouteIsScopedFlag = 0x00000020,
+ kRouteWantScopedFlag = (kRouteChooseNeverFlag|kRouteIsScopedFlag),
+};
+
+typedef struct {
+ struct in_addr dest;
+ struct in_addr mask;
+ struct in_addr gateway;
+ char ifname[IFNAMSIZ];
+ unsigned int ifindex;
+ struct in_addr ifa;
+ Rank rank;
+ RouteFlags flags;
+} IPv4Route, *IPv4RouteRef;
+
+typedef struct {
+ int count;
+ int size;
+ IPv4Route list[1]; /* variable length */
+} IPv4RouteList, *IPv4RouteListRef;
+
+enum {
+ kIPv4RouteListAddRouteCommand,
+ kIPv4RouteListRemoveRouteCommand
+};
+
+typedef uint32_t IPv4RouteListApplyCommand;
+
+typedef void IPv4RouteListApplyCallBackFunc(IPv4RouteListApplyCommand cmd,
+ IPv4RouteRef route, void * arg);
+typedef IPv4RouteListApplyCallBackFunc * IPv4RouteListApplyCallBackFuncPtr;
+
+/* SCDynamicStore session */
+static SCDynamicStoreRef S_session = NULL;
+
+/* debug output flags */
+static uint32_t S_IPMonitor_debug = 0;
/* are we netbooted? If so, don't touch the default route */
static boolean_t S_netboot = FALSE;
+/* is scoped routing enabled? */
+#ifdef RTF_IFSCOPE
+static boolean_t S_scopedroute = FALSE;
+#endif /* RTF_IFSCOPE */
+
/* dictionary to hold per-service state: key is the serviceID */
static CFMutableDictionaryRef S_service_state_dict = NULL;
+static CFMutableDictionaryRef S_ipv4_service_rank_dict = NULL;
+static CFMutableDictionaryRef S_ipv6_service_rank_dict = NULL;
/* if set, a PPP interface overrides the primary */
static boolean_t S_ppp_override_primary = FALSE;
static CFStringRef S_primary_ipv6 = NULL;
static CFStringRef S_primary_dns = NULL;
static CFStringRef S_primary_proxies = NULL;
-static CFStringRef S_primary_smb = NULL;
static CFStringRef S_state_global_ipv4 = NULL;
static CFStringRef S_state_global_ipv6 = NULL;
static CFStringRef S_state_global_dns = NULL;
static CFStringRef S_state_global_proxies = NULL;
-static CFStringRef S_state_global_smb = NULL;
static CFStringRef S_state_service_prefix = NULL;
static CFStringRef S_setup_global_ipv4 = NULL;
static CFStringRef S_setup_global_proxies = NULL;
-static CFStringRef S_setup_global_smb = NULL;
static CFStringRef S_setup_service_prefix = NULL;
+static CFStringRef S_multicast_resolvers = NULL;
static CFStringRef S_private_resolvers = NULL;
-static struct in_addr S_router_subnet = { 0 };
-static struct in_addr S_router_subnet_mask = { 0 };
+static IPv4RouteListRef S_ipv4_routelist = NULL;
static const struct in_addr S_ip_zeros = { 0 };
static const struct in6_addr S_ip6_zeros = IN6ADDR_ANY_INIT;
+static boolean_t S_append_state = FALSE;
-#define kRouterNeedsLocalIP CFSTR("com.apple.IPMonitor.RouterNeedsLocalIP")
-#define kRouterIsDirect CFSTR("com.apple.IPMonitor.IsDirect")
+#if !TARGET_OS_IPHONE
+static CFStringRef S_primary_smb = NULL;
+static CFStringRef S_state_global_smb = NULL;
+static CFStringRef S_setup_global_smb = NULL;
+#endif /* !TARGET_OS_IPHONE */
+#if !TARGET_OS_IPHONE
#define VAR_RUN_RESOLV_CONF "/var/run/resolv.conf"
+#endif /* !TARGET_OS_IPHONE */
#ifndef KERN_NETBOOT
#define KERN_NETBOOT 40 /* int: are we netbooted? 1=yes,0=no */
** entityType*, GetEntityChanges*
** - definitions for the entity types we handle
**/
-#define ENTITY_TYPES_COUNT 5
enum {
kEntityTypeIPv4 = 0,
- kEntityTypeIPv6 = 1,
- kEntityTypeDNS = 2,
- kEntityTypeProxies = 3,
- kEntityTypeSMB = 4,
+ kEntityTypeIPv6,
+ kEntityTypeDNS,
+ kEntityTypeProxies,
+#if !TARGET_OS_IPHONE
+ kEntityTypeSMB,
+#endif /* !TARGET_OS_IPHONE */
+ ENTITY_TYPES_COUNT,
+ kEntityTypeServiceOptions = 31
};
typedef uint32_t EntityType;
-static CFStringRef entityTypeNames[ENTITY_TYPES_COUNT];
+static const CFStringRef *entityTypeNames[ENTITY_TYPES_COUNT] = {
+ &kSCEntNetIPv4, /* 0 */
+ &kSCEntNetIPv6, /* 1 */
+ &kSCEntNetDNS, /* 2 */
+ &kSCEntNetProxies, /* 3 */
+#if !TARGET_OS_IPHONE
+ &kSCEntNetSMB, /* 4 */
+#endif /* !TARGET_OS_IPHONE */
+};
-typedef boolean_t (GetEntityChangesFunc)(CFStringRef serviceID,
- CFDictionaryRef state_dict,
- CFDictionaryRef setup_dict,
- CFDictionaryRef info);
+typedef boolean_t GetEntityChangesFunc(CFStringRef serviceID,
+ CFDictionaryRef state_dict,
+ CFDictionaryRef setup_dict,
+ CFDictionaryRef info);
typedef GetEntityChangesFunc * GetEntityChangesFuncRef;
static GetEntityChangesFunc get_ipv4_changes;
static GetEntityChangesFunc get_ipv6_changes;
static GetEntityChangesFunc get_dns_changes;
static GetEntityChangesFunc get_proxies_changes;
+#if !TARGET_OS_IPHONE
static GetEntityChangesFunc get_smb_changes;
+#endif /* !TARGET_OS_IPHONE */
static void
my_CFRelease(void * t);
get_ipv6_changes, /* 1 */
get_dns_changes, /* 2 */
get_proxies_changes,/* 3 */
+#if !TARGET_OS_IPHONE
get_smb_changes, /* 4 */
+#endif /* !TARGET_OS_IPHONE */
};
/**
if (set == NULL && remove == NULL && notify == NULL) {
return;
}
- if (S_IPMonitor_debug) {
+ if (S_IPMonitor_debug & kDebugFlag1) {
if (set != NULL) {
- SCLog(TRUE, LOG_INFO, CFSTR("IPMonitor: Setting:\n%@\n"), set);
+ SCLog(TRUE, LOG_NOTICE, CFSTR("IPMonitor: Setting:\n%@"),
+ set);
}
if (remove != NULL) {
- SCLog(TRUE, LOG_INFO, CFSTR("IPMonitor: Removing:\n%@\n"), remove);
+ SCLog(TRUE, LOG_NOTICE, CFSTR("IPMonitor: Removing:\n%@"),
+ remove);
}
if (notify != NULL) {
- SCLog(TRUE, LOG_INFO, CFSTR("IPMonitor: Notifying:\n%@\n"), notify);
+ SCLog(TRUE, LOG_NOTICE, CFSTR("IPMonitor: Notifying:\n%@"),
+ notify);
}
}
(void)SCDynamicStoreSetMultiple(session, set, remove, notify);
status = notify_post("com.apple.system.config.network_change");
if (status == NOTIFY_STATUS_OK) {
- SCLog(TRUE, LOG_INFO, CFSTR("network configuration changed."));
+ SCLog(TRUE, LOG_NOTICE, CFSTR("network configuration changed."));
} else {
- SCLog(TRUE, LOG_INFO,
+ SCLog(TRUE, LOG_NOTICE,
CFSTR("IPMonitor: notify_post() failed: error=%ld"), status);
}
}
static boolean_t
-S_netboot_root()
+S_is_network_boot()
{
int mib[2];
size_t len;
return (netboot);
}
+#ifdef RTF_IFSCOPE
+static boolean_t
+S_is_scoped_routing_enabled()
+{
+ int scopedroute = 0;
+ size_t len = sizeof(scopedroute);
+
+ if ((sysctlbyname("net.inet.ip.scopedroute",
+ &scopedroute, &len,
+ NULL, 0) == -1)
+ && (errno != ENOENT)) {
+ SCLog(TRUE, LOG_ERR, CFSTR("sysctlbyname() failed: %s"), strerror(errno));
+ }
+ return (scopedroute);
+}
+#endif /* RTF_IFSCOPE */
+
static void
my_CFArrayAppendUniqueValue(CFMutableArrayRef arr, CFTypeRef new)
{
return (isA_CFDictionary(CFDictionaryGetValue(dict, key)));
}
+static CFArrayRef
+my_CFDictionaryGetArray(CFDictionaryRef dict, CFStringRef key)
+{
+ if (isA_CFDictionary(dict) == NULL) {
+ return (NULL);
+ }
+ return (isA_CFArray(CFDictionaryGetValue(dict, key)));
+}
+
static boolean_t
cfstring_to_ipvx(int family, CFStringRef str, void * addr, int addr_size)
{
return (cfstring_to_ipvx(AF_INET6, str, ip6_p, sizeof(*ip6_p)));
}
-/*
- * Function: parse_component
- * Purpose:
- * Given a string 'key' and a string prefix 'prefix',
- * return the next component in the slash '/' separated
- * key.
- *
- * Examples:
- * 1. key = "a/b/c" prefix = "a/"
- * returns "b"
- * 2. key = "a/b/c" prefix = "a/b/"
- * returns "c"
- */
static CFStringRef
-parse_component(CFStringRef key, CFStringRef prefix)
+setup_service_key(CFStringRef serviceID, CFStringRef entity)
{
- CFMutableStringRef comp;
- CFRange range;
+ return (SCDynamicStoreKeyCreateNetworkServiceEntity(NULL,
+ kSCDynamicStoreDomainSetup,
+ serviceID,
+ entity));
+}
- if (CFStringHasPrefix(key, prefix) == FALSE) {
- return (NULL);
- }
- comp = CFStringCreateMutableCopy(NULL, 0, key);
- if (comp == NULL) {
- return (NULL);
- }
- CFStringDelete(comp, CFRangeMake(0, CFStringGetLength(prefix)));
- range = CFStringFind(comp, CFSTR("/"), 0);
- if (range.location == kCFNotFound) {
- return (comp);
- }
- range.length = CFStringGetLength(comp) - range.location;
- CFStringDelete(comp, range);
- return (comp);
+static CFStringRef
+state_service_key(CFStringRef serviceID, CFStringRef entity)
+{
+ return (SCDynamicStoreKeyCreateNetworkServiceEntity(NULL,
+ kSCDynamicStoreDomainState,
+ serviceID,
+ entity));
}
-static CFMutableDictionaryRef
-service_dict_copy(CFStringRef serviceID)
+static CFDictionaryRef
+get_service_setup_entity(CFDictionaryRef service_info, CFStringRef serviceID,
+ CFStringRef entity)
{
- CFDictionaryRef d = NULL;
- CFMutableDictionaryRef service_dict;
+ CFStringRef setup_key;
+ CFDictionaryRef setup_dict;
- /* create a modifyable dictionary, a copy or a new one */
- d = CFDictionaryGetValue(S_service_state_dict, serviceID);
- if (d == NULL) {
- service_dict
- = CFDictionaryCreateMutable(NULL, 0,
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
- }
- else {
- service_dict = CFDictionaryCreateMutableCopy(NULL, 0, d);
+ setup_key = setup_service_key(serviceID, entity);
+ setup_dict = my_CFDictionaryGetDictionary(service_info, setup_key);
+ my_CFRelease(&setup_key);
+ return (setup_dict);
+}
+
+static CFDictionaryRef
+get_service_state_entity(CFDictionaryRef service_info, CFStringRef serviceID,
+ CFStringRef entity)
+{
+ CFStringRef state_key;
+ CFDictionaryRef state_dict;
+
+ state_key = state_service_key(serviceID, entity);
+ state_dict = my_CFDictionaryGetDictionary(service_info, state_key);
+ my_CFRelease(&state_key);
+ return (state_dict);
+}
+
+static boolean_t
+dict_get_first_ip(CFDictionaryRef dict, CFStringRef prop, struct in_addr * ip_p)
+{
+ CFArrayRef ip_list;
+
+ ip_list = CFDictionaryGetValue(dict, prop);
+ if (isA_CFArray(ip_list) != NULL
+ && CFArrayGetCount(ip_list) > 0
+ && cfstring_to_ip(CFArrayGetValueAtIndex(ip_list, 0), ip_p)) {
+ return (TRUE);
}
- return (service_dict);
+ return (FALSE);
}
static boolean_t
-service_dict_set(CFStringRef serviceID, CFStringRef entity,
- CFDictionaryRef new_dict)
+get_override_primary(CFDictionaryRef dict)
{
- boolean_t changed = FALSE;
- CFDictionaryRef old;
- CFMutableDictionaryRef service_dict;
+ CFTypeRef override;
- service_dict = service_dict_copy(serviceID);
- old = CFDictionaryGetValue(service_dict, entity);
- if (new_dict == NULL) {
- if (old != NULL) {
- SCLog(S_IPMonitor_debug, LOG_INFO,
- CFSTR("IPMonitor: serviceID %@ removed %@ dictionary = %@"),
- serviceID, entity, old);
- CFDictionaryRemoveValue(service_dict, entity);
- changed = TRUE;
+ override = CFDictionaryGetValue(dict, kSCPropNetOverridePrimary);
+ if (isA_CFNumber(override) != NULL) {
+ int val = 0;
+
+ CFNumberGetValue((CFNumberRef)override, kCFNumberIntType, &val);
+ if (val != 0) {
+ return (TRUE);
}
}
- else {
- if (old == NULL || CFEqual(new_dict, old) == FALSE) {
- SCLog(S_IPMonitor_debug, LOG_INFO,
- CFSTR("IPMonitor: serviceID %@ changed %@"
- " dictionary\nold %@\nnew %@"), serviceID, entity,
- (old != NULL) ? (CFTypeRef)old : (CFTypeRef)CFSTR("<none>"),
- new_dict);
- CFDictionarySetValue(service_dict, entity, new_dict);
- changed = TRUE;
+ else if (isA_CFBoolean(override) != NULL) {
+ if (CFBooleanGetValue(override)) {
+ return (TRUE);
}
}
- if (CFDictionaryGetCount(service_dict) == 0) {
- CFDictionaryRemoveValue(S_service_state_dict, serviceID);
- }
- else {
- CFDictionarySetValue(S_service_state_dict, serviceID, service_dict);
- }
- my_CFRelease(&service_dict);
- return (changed);
+ return (FALSE);
}
-static CFDictionaryRef
-service_dict_get(CFStringRef serviceID, CFStringRef entity)
+/**
+ ** IPv4Route*
+ **/
+
+static __inline__ struct in_addr
+subnet_addr(struct in_addr addr, struct in_addr mask)
{
- CFDictionaryRef service_dict;
+ struct in_addr net;
- service_dict = CFDictionaryGetValue(S_service_state_dict, serviceID);
- if (service_dict == NULL) {
- return (NULL);
- }
- return (CFDictionaryGetValue(service_dict, entity));
+ net.s_addr = addr.s_addr & mask.s_addr;
+ return (net);
}
-#define ALLOW_EMTPY_STRING 1<<0
-
-static CFTypeRef
-sanitize_prop(CFTypeRef val, uint32_t flags)
+static __inline__ int
+uint32_cmp(uint32_t a, uint32_t b)
{
- if (val != NULL) {
- if (isA_CFString(val)) {
- CFMutableStringRef str;
+ int ret;
- str = CFStringCreateMutableCopy(NULL, 0, (CFStringRef)val);
- CFStringTrimWhitespace(str);
- if (!(flags & ALLOW_EMTPY_STRING) && (CFStringGetLength(str) == 0)) {
- CFRelease(str);
- str = NULL;
- }
- val = str;
- } else {
- CFRetain(val);
- }
+ if (a == b) {
+ ret = 0;
+ }
+ else if (a < b) {
+ ret = -1;
+ }
+ else {
+ ret = 1;
}
+ return (ret);
+}
- return val;
+static __inline__ int
+in_addr_cmp(struct in_addr a, struct in_addr b)
+{
+ return (uint32_cmp(ntohl(a.s_addr), ntohl(b.s_addr)));
}
-static void
-merge_array_prop(CFMutableDictionaryRef dict,
- CFStringRef key,
- CFDictionaryRef state_dict,
- CFDictionaryRef setup_dict,
- uint32_t flags,
- Boolean append)
+static __inline__ int
+RankCompare(Rank a, Rank b)
{
- CFMutableArrayRef merge_prop;
- CFArrayRef setup_prop = NULL;
- CFArrayRef state_prop = NULL;
+ return (uint32_cmp(a, b));
+}
- if (setup_dict != NULL) {
- setup_prop = isA_CFArray(CFDictionaryGetValue(setup_dict, key));
+static __inline__ int
+RouteFlagsCompare(RouteFlags a, RouteFlags b)
+{
+ return (uint32_cmp(a, b));
+}
+
+static void
+IPv4RouteCopyDescriptionWithString(IPv4RouteRef r, CFMutableStringRef str)
+{
+ CFStringAppendFormat(str, NULL,
+ CFSTR("Dest " IP_FORMAT
+ " Mask " IP_FORMAT
+ " Gate " IP_FORMAT
+ " Ifp %s Ifa " IP_FORMAT),
+ IP_LIST(&r->dest),
+ IP_LIST(&r->mask),
+ IP_LIST(&r->gateway),
+ (r->ifname[0] != '\0') ? r->ifname : "<none>",
+ IP_LIST(&r->ifa));
+ if ((r->flags & kRouteIsNotSubnetLocalFlag) != 0) {
+ CFStringAppend(str, CFSTR(" [non-local]"));
}
- if (state_dict != NULL) {
- state_prop = isA_CFArray(CFDictionaryGetValue(state_dict, key));
+ else if ((r->flags & kRouteIsDirectToInterfaceFlag) != 0) {
+ CFStringAppend(str, CFSTR(" [direct]"));
}
-
- if ((setup_prop == NULL) && (state_prop == NULL)) {
- return;
+ if ((r->flags & kRouteChooseFirstFlag) != 0) {
+ CFStringAppend(str, CFSTR(" [first]"));
}
+ if ((r->flags & kRouteChooseLastFlag) != 0) {
+ CFStringAppend(str, CFSTR(" [last]"));
+ }
+ if ((r->flags & kRouteChooseNeverFlag) != 0) {
+ CFStringAppend(str, CFSTR(" [never]"));
+ }
+ if ((r->flags & kRouteIsScopedFlag) != 0) {
+ CFStringAppend(str, CFSTR(" [SCOPED]"));
+ }
+ else if ((r->flags & kRouteWantScopedFlag) != 0) {
+ CFStringAppend(str, CFSTR(" [SCOPED*]"));
+ }
+ return;
+}
- merge_prop = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
- if (setup_prop != NULL) {
- CFIndex i;
- CFIndex n;
-
- n = CFArrayGetCount(setup_prop);
- for (i = 0; i < n; i++) {
- CFTypeRef val;
+static CFStringRef
+IPv4RouteCopyDescription(IPv4RouteRef r)
+{
+ CFMutableStringRef str;
- val = CFArrayGetValueAtIndex(setup_prop, i);
- val = sanitize_prop(val, flags);
- if (val != NULL) {
- CFArrayAppendValue(merge_prop, val);
- CFRelease(val);
- }
- }
- }
- if (state_prop != NULL) {
- CFIndex i;
- CFIndex n;
- CFRange setup_range = CFRangeMake(0, CFArrayGetCount(merge_prop));
+ str = CFStringCreateMutable(NULL, 0);
+ IPv4RouteCopyDescriptionWithString(r, str);
+ return (str);
+}
- n = CFArrayGetCount(state_prop);
- for (i = 0; i < n; i++) {
- CFTypeRef val;
+static __inline__ void
+IPv4RoutePrint(IPv4RouteRef route)
+{
+ CFStringRef str = IPv4RouteCopyDescription(route);
+
+ SCPrint(TRUE, stdout, CFSTR("%@"), str);
+ CFRelease(str);
+ return;
+}
+
+static __inline__ void
+IPv4RouteLog(IPv4RouteRef route)
+{
+ CFStringRef str = IPv4RouteCopyDescription(route);
+
+ SCLog(TRUE, LOG_NOTICE, CFSTR("%@"), str);
+ CFRelease(str);
+ return;
+}
+
+static int
+IPv4RouteCompare(IPv4RouteRef a, Rank a_rank,
+ IPv4RouteRef b, Rank b_rank, boolean_t * same_dest)
+{
+ int cmp;
+
+ *same_dest = FALSE;
+ cmp = in_addr_cmp(a->dest, b->dest);
+ if (cmp == 0) {
+ cmp = in_addr_cmp(a->mask, b->mask);
+ if (cmp == 0) {
+ int name_cmp = strcmp(a->ifname, b->ifname);
+
+ if (name_cmp == 0) {
+ cmp = 0;
+ }
+ else {
+ boolean_t a_never = (a->flags & kRouteChooseNeverFlag) != 0;
+ boolean_t b_never = (b->flags & kRouteChooseNeverFlag) != 0;
+ *same_dest = TRUE;
+
+ if (a_never != b_never) {
+ if (a_never) {
+ cmp = 1;
+ }
+ else {
+ cmp = -1;
+ }
+ }
+ else {
+ boolean_t a_last = (a->flags & kRouteChooseLastFlag) != 0;
+ boolean_t b_last = (b->flags & kRouteChooseLastFlag) != 0;
+
+ if (a_last != b_last) {
+ if (a_last) {
+ cmp = 1;
+ }
+ else {
+ cmp = -1;
+ }
+ }
+ else {
+ boolean_t a_first = (a->flags & kRouteChooseFirstFlag) != 0;
+ boolean_t b_first = (b->flags & kRouteChooseFirstFlag) != 0;
+
+ if (a_first != b_first) {
+ if (a_first) {
+ cmp = -1;
+ }
+ else {
+ cmp = 1;
+ }
+ }
+ else {
+ cmp = RankCompare(a_rank, b_rank);
+ if (cmp == 0) {
+ cmp = name_cmp;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ if ((S_IPMonitor_debug & kDebugFlag8) != 0) {
+ CFStringRef a_str;
+ CFStringRef b_str;
+ char ch;
+
+ if (cmp < 0) {
+ ch = '<';
+ }
+ else if (cmp == 0) {
+ ch = '=';
+ }
+ else {
+ ch = '>';
+ }
+ a_str = IPv4RouteCopyDescription(a);
+ b_str = IPv4RouteCopyDescription(b);
+ SCLog(TRUE, LOG_NOTICE, CFSTR("%@ rank %u %c %@ rank %u"),
+ a_str, a_rank, ch, b_str, b_rank);
+ CFRelease(a_str);
+ CFRelease(b_str);
+ }
+ return (cmp);
+}
+
+static CFStringRef
+IPv4RouteListCopyDescription(IPv4RouteListRef routes)
+{
+ int i;
+ IPv4RouteRef r;
+ CFMutableStringRef str;
+
+ str = CFStringCreateMutable(NULL, 0);
+ CFStringAppendFormat(str, NULL, CFSTR("<IPv4RouteList[%d]> = {"),
+ routes->count);
+ for (i = 0, r = routes->list; i < routes->count; i++, r++) {
+ CFStringAppendFormat(str, NULL, CFSTR("\n%2d. "), i);
+ IPv4RouteCopyDescriptionWithString(r, str);
+ }
+ CFStringAppend(str, CFSTR("\n}\n"));
+ return (str);
+}
+
+static __inline__ void
+IPv4RouteListPrint(IPv4RouteListRef routes)
+{
+ CFStringRef str = IPv4RouteListCopyDescription(routes);
+
+ SCPrint(TRUE, stdout, CFSTR("%@"), str);
+ CFRelease(str);
+ return;
+}
+
+static __inline__ void
+IPv4RouteListLog(IPv4RouteListRef routes)
+{
+ CFStringRef str = IPv4RouteListCopyDescription(routes);
+
+ SCLog(TRUE, LOG_NOTICE, CFSTR("%@"), str);
+ CFRelease(str);
+ return;
+}
+
+static __inline__ unsigned int
+IPv4RouteListComputeSize(unsigned int n)
+{
+ return (offsetof(IPv4RouteList, list[n]));
+}
+
+static IPv4RouteRef
+IPv4RouteListFindRoute(IPv4RouteListRef routes, IPv4RouteRef route)
+{
+ int i;
+ IPv4RouteRef scan_result = NULL;
+ IPv4RouteRef scan;
+
+ for (i = 0, scan = routes->list; i < routes->count; i++, scan++) {
+ if ((scan->dest.s_addr == route->dest.s_addr)
+ && (scan->mask.s_addr == route->mask.s_addr)
+ && (strcmp(scan->ifname, route->ifname) == 0)
+ && (scan->ifa.s_addr == route->ifa.s_addr)
+ && (scan->gateway.s_addr == route->gateway.s_addr)) {
+ /*
+ * So far, the routes look the same. If the flags
+ * are also equiv than we've found a match.
+ */
+ RouteFlags r_flags;
+ RouteFlags s_flags;
+
+ s_flags = scan->flags;
+ if ((s_flags & kRouteWantScopedFlag) != 0) {
+ s_flags |= kRouteWantScopedFlag;
+ }
+ r_flags = route->flags;
+ if ((r_flags & kRouteWantScopedFlag) != 0) {
+ r_flags |= kRouteWantScopedFlag;
+ }
+ if (s_flags == r_flags) {
+ scan_result = scan;
+ break;
+ }
+ }
+ }
+ return (scan_result);
+}
+
+static void
+IPv4RouteListApply(IPv4RouteListRef old_routes, IPv4RouteListRef new_routes,
+ IPv4RouteListApplyCallBackFuncPtr func, void * arg)
+{
+ int i;
+ IPv4RouteRef scan;
+
+ if (old_routes == new_routes && old_routes == NULL) {
+ /* both old and new are NULL, so there's nothing to do */
+ return;
+ }
+ if (old_routes != NULL) {
+ for (i = 0, scan = old_routes->list;
+ i < old_routes->count;
+ i++, scan++) {
+ IPv4RouteRef new_route = NULL;
+
+ if (new_routes != NULL) {
+ new_route = IPv4RouteListFindRoute(new_routes, scan);
+ }
+ if (new_route == NULL) {
+ if (func != NULL) {
+ (*func)(kIPv4RouteListRemoveRouteCommand, scan, arg);
+ }
+ }
+ }
+ }
+ if (new_routes != NULL) {
+ for (i = 0, scan = new_routes->list;
+ i < new_routes->count;
+ i++, scan++) {
+ IPv4RouteRef old_route = NULL;
+
+ if (old_routes != NULL) {
+ old_route = IPv4RouteListFindRoute(old_routes, scan);
+ }
+ if (old_route == NULL) {
+ if (func != NULL) {
+ (*func)(kIPv4RouteListAddRouteCommand, scan, arg);
+ }
+ }
+ }
+ }
+ return;
+}
+
+/*
+ * Function: IPv4RouteListAddRoute
+ *
+ * Purpose:
+ * Add the given IPv4Route to the list of routes, eliminating lower-ranked
+ * duplicates on the same interface, and marking any lower ranked duplicates
+ * on other interfaces with kRouteIsScopedFlag.
+ *
+ * This routine assumes that if routes is not NULL, it is malloc'd memory.
+ *
+ * Returns:
+ * Route list updated with the given route, possibly a different pointer,
+ * due to using realloc'd memory.
+ */
+
+enum {
+ kScopeNone = 0,
+ kScopeThis = 1,
+ kScopeNext = 2
+};
+
+static IPv4RouteListRef
+IPv4RouteListAddRoute(IPv4RouteListRef routes, int init_size,
+ IPv4RouteRef this_route, Rank this_rank)
+{
+ int i;
+ int scope_which = kScopeNone;
+ IPv4RouteRef scan;
+ int where = -1;
+
+ if (routes == NULL) {
+ routes = (IPv4RouteListRef)malloc(IPv4RouteListComputeSize(init_size));
+ routes->size = init_size;
+ routes->count = 0;
+ }
+ for (i = 0, scan = routes->list; i < routes->count;
+ i++, scan++) {
+ int cmp;
+ boolean_t same_dest;
+
+ cmp = IPv4RouteCompare(this_route, this_rank, scan, scan->rank, &same_dest);
+ if (cmp < 0) {
+ if (where == -1) {
+ if (same_dest == TRUE) {
+ if ((scan->flags & kRouteIsScopedFlag) != 0) {
+ ROUTELIST_DEBUG(("Hit 1: set scope on self\n"),
+ kDebugFlag8);
+ scope_which = kScopeThis;
+ }
+ else {
+ ROUTELIST_DEBUG(("Hit 2: set scope on next\n"),
+ kDebugFlag8);
+ scope_which = kScopeNext;
+ }
+ }
+ /* remember our insertion point, but keep going to find a dup */
+ where = i;
+ }
+ }
+ else if (cmp == 0) {
+ /* exact match */
+ if (where != -1) {
+ /* this route is a duplicate */
+ ROUTELIST_DEBUG(("Hit 3: removing [%d]\n", i), kDebugFlag8);
+ routes->count--;
+ if (i == routes->count) {
+ /* last slot, decrementing gets rid of it */
+ }
+ else {
+ bcopy(routes->list + i + 1,
+ routes->list + i,
+ sizeof(routes->list[0]) * (routes->count - i));
+ }
+ break;
+ }
+ /* resolve conflict using rank */
+ if (this_rank < scan->rank) {
+ boolean_t is_scoped = FALSE;
+
+ if (scan->flags & kRouteIsScopedFlag) {
+ is_scoped = TRUE;
+ }
+ ROUTELIST_DEBUG(("Hit 4:replacing [%d] rank %u < %u\n", i,
+ this_rank,
+ scan->rank), kDebugFlag8);
+ *scan = *this_route;
+ scan->rank = this_rank;
+ if (is_scoped) {
+ /* preserve whether route was scoped */
+ ROUTELIST_DEBUG(("Hit 5: preserved scope\n"), kDebugFlag8);
+ scan->flags |= kRouteIsScopedFlag;
+ }
+ }
+ /* we're done */
+ goto done;
+ }
+ else {
+ if (same_dest == TRUE) {
+ if (scope_which == kScopeNone) {
+ ROUTELIST_DEBUG(("Hit 10: set scope on self\n"),
+ kDebugFlag8);
+ scope_which = kScopeThis;
+ }
+ }
+#ifdef TEST_IPV4_ROUTELIST
+ else if (where != -1) {
+ /* not possible because we maintain a sorted list */
+ ROUTELIST_DEBUG(("Hit 11: moved past routes - can't happen\n"),
+ kDebugFlag8);
+ break;
+ }
+#endif /* TEST_IPV4_ROUTELIST */
+ }
+ }
+ if (routes->size == routes->count) {
+ int how_many;
+ IPv4RouteListRef new_routes;
+ int old_size;
+
+ /* double the size */
+ old_size = routes->size;
+ how_many = old_size * 2;
+ new_routes = (IPv4RouteListRef)
+ realloc(routes, IPv4RouteListComputeSize(how_many));
+ if (new_routes == NULL) {
+ /* no memory */
+ goto done;
+ }
+ ROUTELIST_DEBUG(("increasing size from %d to %d\n", old_size,
+ how_many), kDebugFlag8);
+ new_routes->size = how_many;
+ routes = new_routes;
+ }
+ if (where == -1) {
+ /* add it to the end */
+ where = routes->count;
+ }
+ else {
+ /* insert it at [where] */
+ bcopy(routes->list + where,
+ routes->list + where + 1,
+ sizeof(routes->list[0]) * (routes->count - where));
+ }
+ /* copy the route */
+ routes->list[where] = *this_route;
+ routes->list[where].rank = this_rank;
+
+ /* set the scope */
+ switch (scope_which) {
+ case kScopeThis:
+ routes->list[where].flags |= kRouteIsScopedFlag;
+ break;
+ case kScopeNext:
+ routes->list[where + 1].flags |= kRouteIsScopedFlag;
+ break;
+ default:
+ case kScopeNone:
+ break;
+ }
+ routes->count++;
+ done:
+ return (routes);
+}
+
+/*
+ * Function: IPv4RouteListAddRouteList
+ *
+ * Purpose:
+ * Invoke IPv4RouteListAddRoute for each route in the given list.
+ *
+ * Returns:
+ * See IPv4RouteListAddRoute for more information.
+ */
+static IPv4RouteListRef
+IPv4RouteListAddRouteList(IPv4RouteListRef routes, int init_size,
+ IPv4RouteListRef service_routes, Rank rank)
+{
+ int i;
+ IPv4RouteRef scan;
+
+ for (i = 0, scan = service_routes->list;
+ i < service_routes->count; i++, scan++) {
+ routes = IPv4RouteListAddRoute(routes, init_size, scan, rank);
+ }
+ return (routes);
+}
+
+static boolean_t
+plist_get_cstring(CFDictionaryRef dict, CFStringRef prop_name,
+ char * buf, int buf_size)
+{
+ CFStringRef val;
+
+ val = CFDictionaryGetValue(dict, prop_name);
+ if (isA_CFString(val) == NULL) {
+ return (FALSE);
+ }
+ if (CFStringGetCString(val, buf, buf_size, kCFStringEncodingASCII)
+ == FALSE) {
+ return (FALSE);
+ }
+ return (TRUE);
+}
+
+/*
+ * Function: IPv4RouteListCreateWithDictionary
+ *
+ * Purpose:
+ * Given the service ipv4 entity dictionary, generate the list of routes.
+ * Currently, this includes just the default route and subnet route,
+ * if the service has a subnet mask.
+ *
+ * Returns:
+ * If the passed in route_list is NULL or too small, this routine
+ * allocates malloc'd memory to hold the routes.
+ */
+static IPv4RouteListRef
+IPv4RouteListCreateWithDictionary(IPv4RouteListRef routes,
+ CFDictionaryRef dict,
+ CFStringRef primaryRank)
+{
+ struct in_addr addr = { 0 };
+ RouteFlags flags = 0;
+ unsigned int ifindex;
+ char ifn[IFNAMSIZ];
+ struct in_addr mask = { 0 };
+ int n;
+ IPv4RouteRef r;
+ struct in_addr subnet = { 0 };
+ struct in_addr router = { 0 };
+
+ if (dict == NULL) {
+ return (NULL);
+ }
+ if (plist_get_cstring(dict, kSCPropInterfaceName, ifn, sizeof(ifn))
+ == FALSE) {
+ return (NULL);
+ }
+#ifdef TEST_IPV4_ROUTELIST
+ ifindex = 0;
+#else /* TEST_IPV4_ROUTELIST */
+ ifindex = if_nametoindex(ifn);
+ if (ifindex == 0) {
+ /* interface doesn't exist */
+ return (NULL);
+ }
+#endif /* TEST_IPV4_ROUTELIST */
+ if (cfstring_to_ip(CFDictionaryGetValue(dict, kSCPropNetIPv4Router),
+ &router) == 0) {
+ (void)dict_get_first_ip(dict, kSCPropNetIPv4DestAddresses, &router);
+ }
+ n = 1;
+ if (dict_get_first_ip(dict, kSCPropNetIPv4Addresses, &addr)
+ && dict_get_first_ip(dict, kSCPropNetIPv4SubnetMasks, &mask)) {
+ /* subnet route */
+ subnet = subnet_addr(addr, mask);
+ /* ignore link-local subnets, let IPConfiguration handle them for now */
+ if (ntohl(subnet.s_addr) != IN_LINKLOCALNETNUM) {
+ n++;
+ }
+ }
+ if (addr.s_addr == 0) {
+ /* thanks for playing */
+ return (NULL);
+ }
+ if (router.s_addr == 0) {
+ flags |= kRouteIsDirectToInterfaceFlag | kRouteChooseLastFlag;
+ }
+ else {
+ /*
+ * If the router address is our address and the subnet mask is
+ * not 255.255.255.255, assume all routes are local to the interface.
+ */
+ if (addr.s_addr == router.s_addr
+ && ifn[0] != '\0' && mask.s_addr != INADDR_BROADCAST) {
+ flags |= kRouteIsDirectToInterfaceFlag;
+ }
+ if (primaryRank != NULL) {
+ if (CFEqual(primaryRank, kSCValNetServicePrimaryRankNever)) {
+ flags |= kRouteChooseNeverFlag;
+ } else if (CFEqual(primaryRank, kSCValNetServicePrimaryRankFirst)) {
+ flags |= kRouteChooseFirstFlag;
+ } else if (CFEqual(primaryRank, kSCValNetServicePrimaryRankLast)) {
+ flags |= kRouteChooseLastFlag;
+ }
+ } else if (get_override_primary(dict)) {
+ flags |= kRouteChooseFirstFlag;
+ }
+ }
+ if (n > 1 && (flags & kRouteIsDirectToInterfaceFlag) == 0
+ && subnet.s_addr != subnet_addr(router, mask).s_addr) {
+ flags |= kRouteIsNotSubnetLocalFlag;
+ }
+
+ if (routes == NULL || routes->size < n) {
+ routes = (IPv4RouteListRef)malloc(IPv4RouteListComputeSize(n));
+ routes->size = n;
+ }
+ bzero(routes, IPv4RouteListComputeSize(n));
+ routes->count = n;
+
+ /* start at the beginning */
+ r = routes->list;
+
+ /* add the default route */
+ r->ifindex = ifindex;
+ strlcpy(r->ifname, ifn, sizeof(r->ifname));
+ r->ifa = addr;
+ r->flags = flags;
+ if ((flags & kRouteIsDirectToInterfaceFlag) == 0) {
+ r->gateway = router;
+ }
+ else {
+ r->gateway = addr;
+ }
+ r++;
+ n--;
+
+ /* add the subnet route */
+ if (n > 0) {
+ r->ifindex = ifindex;
+ r->gateway = addr;
+ r->dest = subnet;
+ r->mask = mask;
+ strlcpy(r->ifname, ifn, sizeof(r->ifname));
+ r->ifa = addr;
+ r->flags = flags & (kRouteChooseFirstFlag|kRouteChooseLastFlag|kRouteChooseNeverFlag);
+ }
+
+ return (routes);
+}
+
+/*
+ * Function: parse_component
+ * Purpose:
+ * Given a string 'key' and a string prefix 'prefix',
+ * return the next component in the slash '/' separated
+ * key.
+ *
+ * Examples:
+ * 1. key = "a/b/c" prefix = "a/"
+ * returns "b"
+ * 2. key = "a/b/c" prefix = "a/b/"
+ * returns "c"
+ */
+static CFStringRef
+parse_component(CFStringRef key, CFStringRef prefix)
+{
+ CFMutableStringRef comp;
+ CFRange range;
+
+ if (CFStringHasPrefix(key, prefix) == FALSE) {
+ return (NULL);
+ }
+ comp = CFStringCreateMutableCopy(NULL, 0, key);
+ if (comp == NULL) {
+ return (NULL);
+ }
+ CFStringDelete(comp, CFRangeMake(0, CFStringGetLength(prefix)));
+ range = CFStringFind(comp, CFSTR("/"), 0);
+ if (range.location == kCFNotFound) {
+ return (comp);
+ }
+ range.length = CFStringGetLength(comp) - range.location;
+ CFStringDelete(comp, range);
+ return (comp);
+}
+
+static CFMutableDictionaryRef
+service_dict_copy(CFStringRef serviceID)
+{
+ CFDictionaryRef d = NULL;
+ CFMutableDictionaryRef service_dict;
+
+ /* create a modifyable dictionary, a copy or a new one */
+ d = CFDictionaryGetValue(S_service_state_dict, serviceID);
+ if (d == NULL) {
+ service_dict
+ = CFDictionaryCreateMutable(NULL, 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ }
+ else {
+ service_dict = CFDictionaryCreateMutableCopy(NULL, 0, d);
+ }
+ return (service_dict);
+}
+
+static void
+dump_service_entity(CFStringRef serviceID, CFStringRef entity,
+ CFStringRef operation, CFTypeRef val)
+{
+ CFStringRef this_val = NULL;
+
+ if (isA_CFData(val) && CFEqual(entity, kSCEntNetIPv4)) {
+ this_val = IPv4RouteListCopyDescription((IPv4RouteListRef)
+ CFDataGetBytePtr(val));
+ if (this_val != NULL) {
+ val = this_val;
+ }
+ }
+ if (val == NULL) {
+ val = CFSTR("<none>");
+ }
+ SCLog(TRUE, LOG_NOTICE, CFSTR("IPMonitor: serviceID %@ %@ %@ value = %@"),
+ serviceID, operation, entity, val);
+ my_CFRelease(&this_val);
+ return;
+}
+
+static boolean_t
+service_dict_set(CFStringRef serviceID, CFStringRef entity,
+ CFTypeRef new_val)
+{
+ boolean_t changed = FALSE;
+ CFTypeRef old_val;
+ CFMutableDictionaryRef service_dict;
+
+ service_dict = service_dict_copy(serviceID);
+ old_val = CFDictionaryGetValue(service_dict, entity);
+ if (new_val == NULL) {
+ if (old_val != NULL) {
+ if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
+ dump_service_entity(serviceID, entity, CFSTR("Removed:"),
+ old_val);
+ }
+ CFDictionaryRemoveValue(service_dict, entity);
+ changed = TRUE;
+ }
+ }
+ else {
+ if (old_val == NULL || CFEqual(new_val, old_val) == FALSE) {
+ if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
+ dump_service_entity(serviceID, entity,
+ CFSTR("Changed: old"), old_val);
+ dump_service_entity(serviceID, entity,
+ CFSTR("Changed: new"), new_val);
+ }
+ CFDictionarySetValue(service_dict, entity, new_val);
+ changed = TRUE;
+ }
+ }
+ if (CFDictionaryGetCount(service_dict) == 0) {
+ CFDictionaryRemoveValue(S_service_state_dict, serviceID);
+ }
+ else {
+ CFDictionarySetValue(S_service_state_dict, serviceID, service_dict);
+ }
+ my_CFRelease(&service_dict);
+ return (changed);
+}
+
+static CFDictionaryRef
+service_dict_get(CFStringRef serviceID, CFStringRef entity)
+{
+ CFDictionaryRef service_dict;
+
+ service_dict = CFDictionaryGetValue(S_service_state_dict, serviceID);
+ if (service_dict == NULL) {
+ return (NULL);
+ }
+ return (CFDictionaryGetValue(service_dict, entity));
+}
+
+#define ALLOW_EMPTY_STRING 0x1
+
+static CFTypeRef
+sanitize_prop(CFTypeRef val, uint32_t flags)
+{
+ if (val != NULL) {
+ if (isA_CFString(val)) {
+ CFMutableStringRef str;
+
+ str = CFStringCreateMutableCopy(NULL, 0, (CFStringRef)val);
+ CFStringTrimWhitespace(str);
+ if (!(flags & ALLOW_EMPTY_STRING) && (CFStringGetLength(str) == 0)) {
+ CFRelease(str);
+ str = NULL;
+ }
+ val = str;
+ } else {
+ CFRetain(val);
+ }
+ }
+
+ return val;
+}
+
+static void
+merge_array_prop(CFMutableDictionaryRef dict,
+ CFStringRef key,
+ CFDictionaryRef state_dict,
+ CFDictionaryRef setup_dict,
+ uint32_t flags,
+ Boolean append)
+{
+ CFMutableArrayRef merge_prop;
+ CFArrayRef setup_prop = NULL;
+ CFArrayRef state_prop = NULL;
+
+ if (setup_dict != NULL) {
+ setup_prop = isA_CFArray(CFDictionaryGetValue(setup_dict, key));
+ }
+ if (state_dict != NULL) {
+ state_prop = isA_CFArray(CFDictionaryGetValue(state_dict, key));
+ }
+
+ if ((setup_prop == NULL) && (state_prop == NULL)) {
+ return;
+ }
+
+ merge_prop = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+ if (setup_prop != NULL) {
+ CFIndex i;
+ CFIndex n;
+
+ n = CFArrayGetCount(setup_prop);
+ for (i = 0; i < n; i++) {
+ CFTypeRef val;
+
+ val = CFArrayGetValueAtIndex(setup_prop, i);
+ val = sanitize_prop(val, flags);
+ if (val != NULL) {
+ CFArrayAppendValue(merge_prop, val);
+ CFRelease(val);
+ }
+ }
+ }
+ if (state_prop != NULL
+ && (setup_prop == NULL || S_append_state)) {
+ CFIndex i;
+ CFIndex n;
+ CFRange setup_range = CFRangeMake(0, CFArrayGetCount(merge_prop));
+
+ n = CFArrayGetCount(state_prop);
+ for (i = 0; i < n; i++) {
+ CFTypeRef val;
val = CFArrayGetValueAtIndex(state_prop, i);
val = sanitize_prop(val, flags);
CFRelease(val);
}
- return;
-}
-
-/**
- ** GetEntityChangesFunc functions
- **/
-static __inline__ struct in_addr
-subnet_addr(struct in_addr addr, struct in_addr mask)
-{
- struct in_addr net;
-
- net.s_addr = htonl((uint32_t)ntohl(addr.s_addr)
- & (uint32_t)ntohl(mask.s_addr));
- return (net);
+ return;
}
+/**
+ ** GetEntityChangesFunc functions
+ **/
static boolean_t
get_ipv4_changes(CFStringRef serviceID, CFDictionaryRef state_dict,
CFDictionaryRef setup_dict, CFDictionaryRef info)
{
- struct in_addr addr = { 0 };
- CFArrayRef addrs;
- boolean_t changed = FALSE;
- CFMutableDictionaryRef dict = NULL;
- struct in_addr mask = { 0 };
- CFArrayRef masks;
- CFDictionaryRef new_dict = NULL;
- CFStringRef router = NULL;
- boolean_t valid_ip = FALSE;
- boolean_t valid_mask = FALSE;
+ boolean_t changed = FALSE;
+ CFMutableDictionaryRef dict = NULL;
+ CFStringRef primaryRank = NULL;
+ IPv4RouteListRef r;
+#define R_STATIC 3
+ IPv4RouteListRef routes;
+ char routes_buf[IPv4RouteListComputeSize(R_STATIC)];
+ CFDataRef routes_data = NULL;
+ CFDictionaryRef service_options;
if (state_dict == NULL) {
goto done;
}
- addrs = isA_CFArray(CFDictionaryGetValue(state_dict,
- kSCPropNetIPv4Addresses));
- if (addrs != NULL && CFArrayGetCount(addrs) > 0) {
- valid_ip = cfstring_to_ip(CFArrayGetValueAtIndex(addrs, 0), &addr);
- }
- masks = isA_CFArray(CFDictionaryGetValue(state_dict,
- kSCPropNetIPv4SubnetMasks));
- if (masks != NULL && CFArrayGetCount(masks) > 0) {
- valid_mask = cfstring_to_ip(CFArrayGetValueAtIndex(masks, 0), &mask);
- }
- if (valid_ip == FALSE) {
- SCLog(S_IPMonitor_debug, LOG_INFO,
- CFSTR("IPMonitor: %@ has no valid IP address, ignoring"),
- serviceID);
- goto done;
+ service_options = service_dict_get(serviceID, kSCEntNetService);
+ if (service_options != NULL) {
+ primaryRank = CFDictionaryGetValue(service_options, kSCPropNetServicePrimaryRank);
}
dict = CFDictionaryCreateMutableCopy(NULL, 0, state_dict);
if (setup_dict != NULL) {
+ CFStringRef router;
+ struct in_addr router_ip;
+
router = CFDictionaryGetValue(setup_dict,
kSCPropNetIPv4Router);
- if (router != NULL) {
+ if (router != NULL
+ && cfstring_to_ip(router, &router_ip)) {
CFDictionarySetValue(dict,
kSCPropNetIPv4Router,
router);
}
}
-
- /* check whether the router is direct, or non-local */
- router = CFDictionaryGetValue(dict, kSCPropNetIPv4Router);
- if (router != NULL) {
- struct in_addr router_ip;
-
- if (cfstring_to_ip(router, &router_ip)) {
- if (router_ip.s_addr == addr.s_addr) {
- /* default route routes directly to the interface */
- CFDictionarySetValue(dict, kRouterIsDirect, kCFBooleanTrue);
- }
- else if (valid_mask
- && subnet_addr(addr, mask).s_addr
- != subnet_addr(router_ip, mask).s_addr) {
- /* router is not on the same subnet */
- CFDictionarySetValue(dict, kRouterNeedsLocalIP,
- kCFBooleanTrue);
- }
+ routes = (IPv4RouteListRef)routes_buf;
+ routes->size = R_STATIC;
+ routes->count = 0;
+ r = IPv4RouteListCreateWithDictionary(routes, dict, primaryRank);
+ if (r != NULL) {
+ routes_data = CFDataCreate(NULL,
+ (const void *)r,
+ IPv4RouteListComputeSize(r->count));
+ if (r != routes) {
+ free(r);
}
}
- new_dict = dict;
-
- done:
- changed = service_dict_set(serviceID, kSCEntNetIPv4, new_dict);
- my_CFRelease(&new_dict);
+ else {
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("IPMonitor: %@ invalid IPv4 dictionary = %@"),
+ serviceID,
+ dict);
+ }
+ done:
+ changed = service_dict_set(serviceID, kSCEntNetIPv4, routes_data);
+ if (routes_data == NULL) {
+ /* clean up the rank too */
+ CFDictionaryRemoveValue(S_ipv4_service_rank_dict, serviceID);
+ }
+ my_CFRelease(&dict);
+ my_CFRelease(&routes_data);
return (changed);
}
CFMutableDictionaryRef dict = NULL;
CFDictionaryRef new_dict = NULL;
CFStringRef router = NULL;
+ struct in6_addr router_ip;
boolean_t valid_ip = FALSE;
if (state_dict == NULL) {
valid_ip = cfstring_to_ip6(CFArrayGetValueAtIndex(addrs, 0), &addr);
}
if (valid_ip == FALSE) {
- SCLog(S_IPMonitor_debug, LOG_INFO,
- CFSTR("IPMonitor: %@ has no valid IPv6 address, ignoring"),
- serviceID);
+ if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("IPMonitor: %@ has no valid IPv6 address, ignoring"),
+ serviceID);
+ }
goto done;
}
dict = CFDictionaryCreateMutableCopy(NULL, 0, state_dict);
if (setup_dict != NULL) {
router = CFDictionaryGetValue(setup_dict,
kSCPropNetIPv6Router);
- if (router != NULL) {
+ if (router != NULL && cfstring_to_ip6(router, &router_ip)) {
CFDictionarySetValue(dict,
kSCPropNetIPv6Router,
router);
}
}
+ else {
+ router = CFDictionaryGetValue(dict,
+ kSCPropNetIPv6Router);
+ if (router != NULL
+ && cfstring_to_ip6(router, &router_ip) == FALSE) {
+ CFDictionaryRemoveValue(dict, kSCPropNetIPv6Router);
+ }
+ }
new_dict = dict;
done:
changed = service_dict_set(serviceID, kSCEntNetIPv6, new_dict);
+ if (new_dict == NULL) {
+ /* clean up the rank too */
+ CFDictionaryRemoveValue(S_ipv6_service_rank_dict, serviceID);
+ }
my_CFRelease(&new_dict);
return (changed);
}
return CFDictionaryContainsKey(dns_dict, kSCPropNetDNSSupplementalMatchDomains);
}
+static void
+accumulate_dns_servers(CFArrayRef in_servers, ProtocolFlags active_protos,
+ CFMutableArrayRef out_servers)
+{
+ int count;
+ int i;
+
+ count = CFArrayGetCount(in_servers);
+ for (i = 0; i < count; i++) {
+ CFStringRef addr = CFArrayGetValueAtIndex(in_servers, i);
+ struct in6_addr ipv6_addr;
+ struct in_addr ip_addr;
+
+ if (cfstring_to_ip(addr, &ip_addr)) {
+ /* IPv4 address */
+ if ((active_protos & kProtocolFlagsIPv4) == 0
+ && ntohl(ip_addr.s_addr) != INADDR_LOOPBACK) {
+ if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
+ syslog(LOG_NOTICE,
+ "IPMonitor: no IPv4 connectivity, "
+ "ignoring DNS server address " IP_FORMAT,
+ IP_LIST(&ip_addr));
+ }
+ continue;
+ }
+ }
+ else if (cfstring_to_ip6(addr, &ipv6_addr)) {
+ /* IPv6 address */
+ if ((active_protos & kProtocolFlagsIPv6) == 0
+ && !IN6_IS_ADDR_LOOPBACK(&ipv6_addr)) {
+ if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
+ char str[128];
+
+ str[0] = '\0';
+ inet_ntop(AF_INET6, &ipv6_addr, str, sizeof(str));
+ syslog(LOG_NOTICE,
+ "IPMonitor: no IPv6 connectivity, "
+ "ignoring DNS server address %s",
+ str);
+ }
+ continue;
+ }
+ }
+ else {
+ /* bad IP address */
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("IPMonitor: ignoring bad DNS server address '%@'"),
+ addr);
+ continue;
+ }
+ /* DNS server is valid and one we want */
+ CFArrayAppendValue(out_servers, addr);
+ }
+ return;
+}
+
+static void
+merge_dns_servers(CFMutableDictionaryRef new_dict,
+ CFArrayRef state_servers,
+ CFArrayRef setup_servers,
+ ProtocolFlags active_protos)
+{
+ CFMutableArrayRef dns_servers;
+
+ if (state_servers == NULL && setup_servers == NULL) {
+ /* no DNS servers */
+ return;
+ }
+ dns_servers = CFArrayCreateMutable(NULL, 0,
+ &kCFTypeArrayCallBacks);
+ if (setup_servers != NULL) {
+ accumulate_dns_servers(setup_servers, active_protos,
+ dns_servers);
+ }
+ if ((CFArrayGetCount(dns_servers) == 0 || S_append_state)
+ && state_servers != NULL) {
+ accumulate_dns_servers(state_servers, active_protos,
+ dns_servers);
+ }
+ if (CFArrayGetCount(dns_servers) != 0) {
+ CFDictionarySetValue(new_dict,
+ kSCPropNetDNSServerAddresses, dns_servers);
+ }
+ my_CFRelease(&dns_servers);
+ return;
+}
+
+
static boolean_t
get_dns_changes(CFStringRef serviceID, CFDictionaryRef state_dict,
CFDictionaryRef setup_dict, CFDictionaryRef info)
{
+ ProtocolFlags active_protos = kProtocolFlagsNone;
boolean_t changed = FALSE;
CFStringRef domain;
int i;
Boolean append;
} merge_list[] = {
{ kSCPropNetDNSSearchDomains, 0, FALSE },
- { kSCPropNetDNSServerAddresses, 0, FALSE },
{ kSCPropNetDNSSortList, 0, FALSE },
- { kSCPropNetDNSSupplementalMatchDomains, ALLOW_EMTPY_STRING, TRUE },
+ { kSCPropNetDNSSupplementalMatchDomains, ALLOW_EMPTY_STRING, TRUE },
{ kSCPropNetDNSSupplementalMatchOrders, 0, TRUE },
};
CFMutableDictionaryRef new_dict = NULL;
goto done;
}
- if ((service_dict_get(serviceID, kSCEntNetIPv4) == NULL) &&
- (service_dict_get(serviceID, kSCEntNetIPv6) == NULL)) {
- /* there is no IPv4 nor IPv6 */
- goto done;
+ if (service_dict_get(serviceID, kSCEntNetIPv4) != NULL) {
+ active_protos |= kProtocolFlagsIPv4;
}
-
- // merge DNS configuration
+ if (service_dict_get(serviceID, kSCEntNetIPv6) != NULL) {
+ active_protos |= kProtocolFlagsIPv6;
+ }
+ /* merge DNS configuration */
new_dict = CFDictionaryCreateMutable(NULL, 0,
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
+ if (active_protos == kProtocolFlagsNone) {
+ /* there is no IPv4 nor IPv6 */
+ if (state_dict == NULL) {
+ /* no DNS information at all */
+ goto done;
+ }
+ merge_dns_servers(new_dict,
+ my_CFDictionaryGetArray(state_dict,
+ kSCPropNetDNSServerAddresses),
+ NULL,
+ kProtocolFlagsIPv4 | kProtocolFlagsIPv6);
+ setup_dict = NULL;
+ }
+ else {
+ merge_dns_servers(new_dict,
+ my_CFDictionaryGetArray(state_dict,
+ kSCPropNetDNSServerAddresses),
+ my_CFDictionaryGetArray(setup_dict,
+ kSCPropNetDNSServerAddresses),
+ active_protos);
+ }
for (i = 0; i < sizeof(merge_list)/sizeof(merge_list[0]); i++) {
merge_array_prop(new_dict,
0);
}
+ if (active_protos == kProtocolFlagsNone) {
+ /* there is no IPv4 nor IPv6, only supplemental DNS */
+ if (CFDictionaryContainsKey(new_dict,
+ kSCPropNetDNSSupplementalMatchDomains)) {
+ /* only keep State: supplemental */
+ CFDictionaryRemoveValue(new_dict, kSCPropNetDNSDomainName);
+ CFDictionaryRemoveValue(new_dict, kSCPropNetDNSSearchDomains);
+ CFDictionaryRemoveValue(new_dict, kSCPropNetDNSSearchOrder);
+ CFDictionaryRemoveValue(new_dict, kSCPropNetDNSSortList);
+ } else {
+ goto done;
+ }
+ }
if (CFDictionaryGetCount(new_dict) == 0) {
my_CFRelease(&new_dict);
goto done;
}
- /*
- * ensure any specified domain name (e.g. the domain returned by
- * a DHCP server) is in the search list.
- */
- domain = CFDictionaryGetValue(new_dict, kSCPropNetDNSDomainName);
- if (isA_CFString(domain)) {
- CFArrayRef search;
-
- search = CFDictionaryGetValue(new_dict, kSCPropNetDNSSearchDomains);
- if (isA_CFArray(search) &&
- !CFArrayContainsValue(search, CFRangeMake(0, CFArrayGetCount(search)), domain)) {
- CFMutableArrayRef new_search;
-
- new_search = CFArrayCreateMutableCopy(NULL, 0, search);
- CFArrayAppendValue(new_search, domain);
- CFDictionarySetValue(new_dict, kSCPropNetDNSSearchDomains, new_search);
- my_CFRelease(&new_search);
+ if (S_append_state) {
+ /*
+ * ensure any specified domain name (e.g. the domain returned by
+ * a DHCP server) is in the search list.
+ */
+ domain = CFDictionaryGetValue(new_dict, kSCPropNetDNSDomainName);
+ if (isA_CFString(domain)) {
+ CFArrayRef search;
+
+ search = CFDictionaryGetValue(new_dict, kSCPropNetDNSSearchDomains);
+ if (isA_CFArray(search) &&
+ !CFArrayContainsValue(search, CFRangeMake(0, CFArrayGetCount(search)), domain)) {
+ CFMutableArrayRef new_search;
+
+ new_search = CFArrayCreateMutableCopy(NULL, 0, search);
+ CFArrayAppendValue(new_search, domain);
+ CFDictionarySetValue(new_dict, kSCPropNetDNSSearchDomains, new_search);
+ my_CFRelease(&new_search);
+ }
}
}
return (changed);
}
+static void
+merge_dict(const void *key, const void *value, void *context)
+{
+ CFMutableDictionaryRef dict = (CFMutableDictionaryRef)context;
+
+ CFDictionarySetValue(dict, key, value);
+ return;
+}
+
+#define PROXY_AUTO_DISCOVERY_URL 252
+
+static CFStringRef
+wpadURL_dhcp(CFDictionaryRef dhcp_options)
+{
+ CFStringRef urlString = NULL;
+
+ if (isA_CFDictionary(dhcp_options)) {
+ CFDataRef data;
+
+ data = DHCPInfoGetOptionData(dhcp_options, PROXY_AUTO_DISCOVERY_URL);
+ if (data != NULL) {
+ CFURLRef url;
+
+ url = CFURLCreateWithBytes(NULL,
+ CFDataGetBytePtr(data),
+ CFDataGetLength(data),
+ kCFStringEncodingUTF8,
+ NULL);
+ if (url != NULL) {
+ urlString = CFURLGetString(url);
+ if (urlString != NULL) {
+ CFRetain(urlString);
+ }
+ CFRelease(url);
+ }
+ }
+ }
+
+ return urlString;
+}
+
+static CFStringRef
+wpadURL_dns(void)
+{
+ CFURLRef url;
+ CFStringRef urlString = NULL;
+
+ url = CFURLCreateWithString(NULL, CFSTR("http://wpad/wpad.dat"), NULL);
+ if (url != NULL) {
+ urlString = CFURLGetString(url);
+ if (urlString != NULL) {
+ CFRetain(urlString);
+ }
+ CFRelease(url);
+ }
+
+ return urlString;
+}
+
static boolean_t
get_proxies_changes(CFStringRef serviceID, CFDictionaryRef state_dict,
CFDictionaryRef setup_dict, CFDictionaryRef info)
{
boolean_t changed = FALSE;
- CFDictionaryRef new_dict = NULL;
+ CFMutableDictionaryRef new_dict = NULL;
+ struct {
+ CFStringRef key1; /* an "enable" key */
+ CFStringRef key2;
+ CFStringRef key3;
+ } pick_list[] = {
+ { kSCPropNetProxiesFTPEnable, kSCPropNetProxiesFTPProxy, kSCPropNetProxiesFTPPort },
+ { kSCPropNetProxiesGopherEnable, kSCPropNetProxiesGopherProxy, kSCPropNetProxiesGopherPort },
+ { kSCPropNetProxiesHTTPEnable, kSCPropNetProxiesHTTPProxy, kSCPropNetProxiesHTTPPort },
+ { kSCPropNetProxiesHTTPSEnable, kSCPropNetProxiesHTTPSProxy, kSCPropNetProxiesHTTPSPort },
+ { kSCPropNetProxiesRTSPEnable, kSCPropNetProxiesRTSPProxy, kSCPropNetProxiesRTSPPort },
+ { kSCPropNetProxiesSOCKSEnable, kSCPropNetProxiesSOCKSProxy, kSCPropNetProxiesSOCKSPort },
+ { kSCPropNetProxiesProxyAutoConfigEnable,
+ kSCPropNetProxiesProxyAutoConfigURLString,
+ NULL, },
+ { kSCPropNetProxiesProxyAutoDiscoveryEnable,
+ NULL,
+ NULL, }
+ };
if ((service_dict_get(serviceID, kSCEntNetIPv4) == NULL) &&
(service_dict_get(serviceID, kSCEntNetIPv6) == NULL)) {
/* there is no IPv4 nor IPv6 */
goto done;
}
- if (setup_dict != NULL) {
- new_dict = setup_dict;
+
+ if ((setup_dict != NULL) && (state_dict != NULL)) {
+ CFIndex i;
+ CFMutableDictionaryRef setup_copy;
+
+ /*
+ * Merge the per-service "Setup:" and "State:" proxy information with
+ * the "Setup:" information always taking precedence. Additionally,
+ * ensure that if any group of "Setup:" values (e.g. Enabled, Proxy,
+ * Port) is defined than all of the values for that group will be
+ * used. That is, we don't allow mixing some of the values from
+ * the "Setup:" keys and others from the "State:" keys.
+ */
+ new_dict = CFDictionaryCreateMutableCopy(NULL, 0, state_dict);
+ setup_copy = CFDictionaryCreateMutableCopy(NULL, 0, setup_dict);
+ for (i = 0; i < sizeof(pick_list)/sizeof(pick_list[0]); i++) {
+ if (CFDictionaryContainsKey(setup_copy, pick_list[i].key1)) {
+ /*
+ * if a "Setup:" enabled key has been provided than we want to
+ * ignore all of the "State:" keys
+ */
+ CFDictionaryRemoveValue(new_dict, pick_list[i].key1);
+ if (pick_list[i].key2 != NULL) {
+ CFDictionaryRemoveValue(new_dict, pick_list[i].key2);
+ }
+ if (pick_list[i].key3 != NULL) {
+ CFDictionaryRemoveValue(new_dict, pick_list[i].key3);
+ }
+ } else if (CFDictionaryContainsKey(state_dict, pick_list[i].key1) ||
+ ((pick_list[i].key2 != NULL) && CFDictionaryContainsKey(state_dict, pick_list[i].key2)) ||
+ ((pick_list[i].key3 != NULL) && CFDictionaryContainsKey(state_dict, pick_list[i].key3))) {
+ /*
+ * if a "Setup:" enabled key has not been provided and we have
+ * some" "State:" keys than we remove all of of "Setup:" keys
+ */
+ CFDictionaryRemoveValue(setup_copy, pick_list[i].key1);
+ if (pick_list[i].key2 != NULL) {
+ CFDictionaryRemoveValue(setup_copy, pick_list[i].key2);
+ }
+ if (pick_list[i].key3 != NULL) {
+ CFDictionaryRemoveValue(setup_copy, pick_list[i].key3);
+ }
+ }
+ }
+
+ /* merge the "Setup:" keys */
+ CFDictionaryApplyFunction(setup_copy, merge_dict, new_dict);
+ CFRelease(setup_copy);
+
+ if (CFDictionaryGetCount(new_dict) == 0) {
+ CFRelease(new_dict);
+ new_dict = NULL;
+ }
}
- else {
- new_dict = state_dict;
+ else if (setup_dict != NULL) {
+ new_dict = CFDictionaryCreateMutableCopy(NULL, 0, setup_dict);
+ }
+ else if (state_dict != NULL) {
+ new_dict = CFDictionaryCreateMutableCopy(NULL, 0, state_dict);
+ }
+
+ /* process WPAD */
+ if (new_dict != NULL) {
+ CFDictionaryRef dhcp_options;
+ CFNumberRef num;
+ CFNumberRef wpad = NULL;
+ int wpadEnabled = 0;
+ CFStringRef wpadURL = NULL;
+
+ if (CFDictionaryGetValueIfPresent(new_dict,
+ kSCPropNetProxiesProxyAutoDiscoveryEnable,
+ (const void **)&num) &&
+ isA_CFNumber(num)) {
+ /* if we have a WPAD key */
+ wpad = num;
+ if (!CFNumberGetValue(num, kCFNumberIntType, &wpadEnabled)) {
+ /* if we don't like the enabled key/value */
+ wpadEnabled = 0;
+ }
+ }
+
+ if (wpadEnabled) {
+ int pacEnabled = 0;
+
+ num = CFDictionaryGetValue(new_dict, kSCPropNetProxiesProxyAutoConfigEnable);
+ if (!isA_CFNumber(num) ||
+ !CFNumberGetValue(num, kCFNumberIntType, &pacEnabled)) {
+ /* if we don't like the enabled key/value */
+ pacEnabled = 0;
+ }
+
+ if (pacEnabled) {
+ CFStringRef pacURL;
+
+ pacURL = CFDictionaryGetValue(new_dict, kSCPropNetProxiesProxyAutoConfigURLString);
+ if (!isA_CFString(pacURL)) {
+ /* if we don't like the PAC URL */
+ pacEnabled = 0;
+ }
+ }
+
+ if (pacEnabled) {
+ /*
+ * we already have a PAC URL so disable WPAD.
+ */
+ wpadEnabled = 0;
+ goto setWPAD;
+ }
+
+ /*
+ * if WPAD is enabled and we don't already have a PAC URL then
+ * we check for a DHCP provided URL. If not available, we use
+ * a PAC URL pointing to a well-known file (wpad.dat) on a
+ * well-known host (wpad.<domain>).
+ */
+ dhcp_options = get_service_state_entity(info, serviceID, kSCEntNetDHCP);
+ wpadURL = wpadURL_dhcp(dhcp_options);
+ if (wpadURL == NULL) {
+ wpadURL = wpadURL_dns();
+ }
+ if (wpadURL == NULL) {
+ wpadEnabled = 0; /* if we don't have a WPAD URL */
+ goto setWPAD;
+ }
+
+ pacEnabled = 1;
+ num = CFNumberCreate(NULL, kCFNumberIntType, &pacEnabled);
+ CFDictionarySetValue(new_dict,
+ kSCPropNetProxiesProxyAutoConfigEnable,
+ num);
+ CFRelease(num);
+ CFDictionarySetValue(new_dict,
+ kSCPropNetProxiesProxyAutoConfigURLString,
+ wpadURL);
+ CFRelease(wpadURL);
+ }
+
+ setWPAD:
+ if (wpad != NULL) {
+ num = CFNumberCreate(NULL, kCFNumberIntType, &wpadEnabled);
+ CFDictionarySetValue(new_dict,
+ kSCPropNetProxiesProxyAutoDiscoveryEnable,
+ num);
+ CFRelease(num);
+ }
}
+
done:
changed = service_dict_set(serviceID, kSCEntNetProxies, new_dict);
+ if (new_dict != NULL) CFRelease(new_dict);
return (changed);
}
+#if !TARGET_OS_IPHONE
static boolean_t
get_smb_changes(CFStringRef serviceID, CFDictionaryRef state_dict,
CFDictionaryRef setup_dict, CFDictionaryRef info)
goto done;
}
- // merge SMB configuration
+ /* merge SMB configuration */
new_dict = CFDictionaryCreateMutable(NULL, 0,
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
my_CFRelease(&new_dict);
return (changed);
}
+#endif /* !TARGET_OS_IPHONE */
-static CFStringRef
-state_service_key(CFStringRef serviceID, CFStringRef entity)
+static boolean_t
+get_rank_changes(CFStringRef serviceID, CFDictionaryRef state_options,
+ CFDictionaryRef setup_options, CFDictionaryRef info)
{
- return (SCDynamicStoreKeyCreateNetworkServiceEntity(NULL,
- kSCDynamicStoreDomainState,
- serviceID,
- entity));
+ boolean_t changed = FALSE;
+ CFMutableDictionaryRef new_dict = NULL;
+ CFStringRef new_rank = NULL;
+ CFStringRef setup_rank = NULL;
+ CFStringRef state_rank = NULL;
+
+
+ /*
+ * Check "PrimaryRank" setting
+ *
+ * Note: Rank Never > Rank Last > Rank First > Rank None
+ */
+ if (isA_CFDictionary(setup_options)) {
+ setup_rank = CFDictionaryGetValue(setup_options, kSCPropNetServicePrimaryRank);
+ setup_rank = isA_CFString(setup_rank);
+ }
+ if (isA_CFDictionary(state_options)) {
+ state_rank = CFDictionaryGetValue(state_options, kSCPropNetServicePrimaryRank);
+ state_rank = isA_CFString(state_rank);
+ }
+
+ if (((setup_rank != NULL) && CFEqual(setup_rank, kSCValNetServicePrimaryRankNever)) ||
+ ((state_rank != NULL) && CFEqual(state_rank, kSCValNetServicePrimaryRankNever))) {
+ new_rank = kSCValNetServicePrimaryRankNever;
+ }
+ else if (((setup_rank != NULL) && CFEqual(setup_rank, kSCValNetServicePrimaryRankLast)) ||
+ ((state_rank != NULL) && CFEqual(state_rank, kSCValNetServicePrimaryRankLast))) {
+ new_rank = kSCValNetServicePrimaryRankLast;
+ }
+ else if (((setup_rank != NULL) && CFEqual(setup_rank, kSCValNetServicePrimaryRankFirst)) ||
+ ((state_rank != NULL) && CFEqual(state_rank, kSCValNetServicePrimaryRankFirst))) {
+ new_rank = kSCValNetServicePrimaryRankFirst;
+ }
+
+ if (new_rank != NULL) {
+ new_dict = CFDictionaryCreateMutable(NULL, 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ CFDictionarySetValue(new_dict, kSCPropNetServicePrimaryRank, new_rank);
+ }
+
+ changed = service_dict_set(serviceID, kSCEntNetService, new_dict);
+ my_CFRelease(&new_dict);
+ return (changed);
}
-static CFStringRef
-setup_service_key(CFStringRef serviceID, CFStringRef entity)
+static void
+add_service_keys(CFStringRef serviceID, CFMutableArrayRef keys, CFMutableArrayRef patterns)
{
- return (SCDynamicStoreKeyCreateNetworkServiceEntity(NULL,
- kSCDynamicStoreDomainSetup,
- serviceID,
- entity));
+ int i;
+ CFStringRef key;
+
+ if (CFEqual(serviceID, kSCCompAnyRegex)) {
+ keys = patterns;
+ }
+
+ for (i = 0; i < ENTITY_TYPES_COUNT; i++) {
+ key = setup_service_key(serviceID, *entityTypeNames[i]);
+ CFArrayAppendValue(keys, key);
+ CFRelease(key);
+ key = state_service_key(serviceID, *entityTypeNames[i]);
+ CFArrayAppendValue(keys, key);
+ CFRelease(key);
+ }
+
+ key = state_service_key(serviceID, kSCEntNetDHCP);
+ CFArrayAppendValue(patterns, key);
+ CFRelease(key);
+
+ key = setup_service_key(serviceID, NULL);
+ CFArrayAppendValue(patterns, key);
+ CFRelease(key);
+ key = state_service_key(serviceID, NULL);
+ CFArrayAppendValue(patterns, key);
+ CFRelease(key);
+
+
+ return;
}
static CFDictionaryRef
{
int count;
CFMutableArrayRef get_keys;
- int i;
- int s;
+ CFMutableArrayRef get_patterns;
CFDictionaryRef info;
+ int s;
count = CFArrayGetCount(service_list);
get_keys = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+ get_patterns = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
CFArrayAppendValue(get_keys, S_setup_global_ipv4);
CFArrayAppendValue(get_keys, S_setup_global_proxies);
+#if !TARGET_OS_IPHONE
CFArrayAppendValue(get_keys, S_setup_global_smb);
+#endif /* !TARGET_OS_IPHONE */
+ CFArrayAppendValue(get_keys, S_multicast_resolvers);
CFArrayAppendValue(get_keys, S_private_resolvers);
for (s = 0; s < count; s++) {
CFStringRef serviceID = CFArrayGetValueAtIndex(service_list, s);
- for (i = 0; i < ENTITY_TYPES_COUNT; i++) {
- CFStringRef setup_key;
- CFStringRef state_key;
-
- setup_key = setup_service_key(serviceID, entityTypeNames[i]);
- state_key = state_service_key(serviceID, entityTypeNames[i]);
- CFArrayAppendValue(get_keys, setup_key);
- CFArrayAppendValue(get_keys, state_key);
- my_CFRelease(&setup_key);
- my_CFRelease(&state_key);
- }
+ add_service_keys(serviceID, get_keys, get_patterns);
}
- info = SCDynamicStoreCopyMultiple(session, get_keys, NULL);
+ info = SCDynamicStoreCopyMultiple(session, get_keys, get_patterns);
my_CFRelease(&get_keys);
+ my_CFRelease(&get_patterns);
return (info);
}
-static CFDictionaryRef
-get_service_setup_entity(CFDictionaryRef service_info, CFStringRef serviceID,
- CFStringRef entity)
-{
- CFStringRef setup_key;
- CFDictionaryRef setup_dict;
-
- setup_key = setup_service_key(serviceID, entity);
- setup_dict = my_CFDictionaryGetDictionary(service_info, setup_key);
- my_CFRelease(&setup_key);
- return (setup_dict);
-}
-
-static CFDictionaryRef
-get_service_state_entity(CFDictionaryRef service_info, CFStringRef serviceID,
- CFStringRef entity)
-{
- CFStringRef state_key;
- CFDictionaryRef state_dict;
-
- state_key = state_service_key(serviceID, entity);
- state_dict = my_CFDictionaryGetDictionary(service_info, state_key);
- my_CFRelease(&state_key);
- return (state_dict);
-}
-
static int rtm_seq = 0;
-static boolean_t
-ipv4_route(int cmd, struct in_addr gateway, struct in_addr netaddr,
- struct in_addr netmask, char * ifname, struct in_addr ifa,
- boolean_t is_direct)
+static int
+ipv4_route_open_socket(void)
{
- boolean_t default_route = (netaddr.s_addr == 0);
- int len;
- boolean_t ret = TRUE;
- struct {
- struct rt_msghdr hdr;
- struct sockaddr_in dst;
- struct sockaddr_in gway;
- struct sockaddr_in mask;
- struct sockaddr_dl ifp;
- struct sockaddr_in ifa;
- } rtmsg;
- int sockfd = -1;
-
- if (default_route && S_netboot) {
- return (TRUE);
- }
+ int sockfd;
if ((sockfd = socket(PF_ROUTE, SOCK_RAW, AF_INET)) == -1) {
- SCLog(TRUE, LOG_INFO,
- CFSTR("IPMonitor: ipv4_route: open routing socket failed, %s"),
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("IPMonitor: ipv4_route_open_socket: socket failed, %s"),
strerror(errno));
- return (FALSE);
}
+ return (sockfd);
+}
- memset(&rtmsg, 0, sizeof(rtmsg));
- rtmsg.hdr.rtm_type = cmd;
- if (default_route) {
- if (is_direct) {
- /* if router is directly reachable, don't set the gateway flag */
- rtmsg.hdr.rtm_flags = RTF_UP | RTF_STATIC;
- }
- else {
- rtmsg.hdr.rtm_flags = RTF_UP | RTF_GATEWAY | RTF_STATIC;
- }
+/*
+ * Define: ROUTE_MSG_ADDRS_SPACE
+ * Purpose:
+ * Since sizeof(sockaddr_dl) > sizeof(sockaddr_in), we need space for
+ * 3 sockaddr_in's and 2 sockaddr_dl's, but pad it just in case
+ * someone changes the code and doesn't think to modify this.
+ */
+#define ROUTE_MSG_ADDRS_SPACE (3 * sizeof(struct sockaddr_in) \
+ + 2 * sizeof(struct sockaddr_dl) \
+ + 128)
+typedef struct {
+ struct rt_msghdr hdr;
+ char addrs[ROUTE_MSG_ADDRS_SPACE];
+} route_msg;
+
+static int
+ipv4_route(int sockfd,
+ int cmd, struct in_addr gateway, struct in_addr netaddr,
+ struct in_addr netmask, char * ifname, unsigned int ifindex,
+ struct in_addr ifa, RouteFlags flags)
+{
+ boolean_t default_route = (netaddr.s_addr == 0);
+ int len;
+ int ret = 0;
+ route_msg rtmsg;
+ union {
+ struct sockaddr_in * in_p;
+ struct sockaddr_dl * dl_p;
+ void * ptr;
+ } rtaddr;
+
+ if (default_route && S_netboot) {
+ return (0);
}
- else {
- rtmsg.hdr.rtm_flags = RTF_UP | RTF_CLONING | RTF_STATIC;
+
+ if (ifname == NULL) {
+ /* this should not happen, but rather than crash, return an error */
+ syslog(LOG_NOTICE,
+ "IPMonitor: ipv4_route ifname is NULL on network address %s",
+ inet_ntoa(netaddr));
+ return (EBADF);
}
+ memset(&rtmsg, 0, sizeof(rtmsg));
+ rtmsg.hdr.rtm_type = cmd;
rtmsg.hdr.rtm_version = RTM_VERSION;
rtmsg.hdr.rtm_seq = ++rtm_seq;
- rtmsg.hdr.rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK;
- rtmsg.dst.sin_len = sizeof(rtmsg.dst);
- rtmsg.dst.sin_family = AF_INET;
- rtmsg.dst.sin_addr = netaddr;
- rtmsg.gway.sin_len = sizeof(rtmsg.gway);
- rtmsg.gway.sin_family = AF_INET;
- rtmsg.gway.sin_addr = gateway;
- rtmsg.mask.sin_len = sizeof(rtmsg.mask);
- rtmsg.mask.sin_family = AF_INET;
- rtmsg.mask.sin_addr = netmask;
-
- len = sizeof(rtmsg);
- if (ifname) {
- rtmsg.hdr.rtm_addrs |= RTA_IFP | RTA_IFA;
- /* copy the interface name */
- rtmsg.ifp.sdl_len = sizeof(rtmsg.ifp);
- rtmsg.ifp.sdl_family = AF_LINK;
- rtmsg.ifp.sdl_nlen = strlen(ifname);
- bcopy(ifname, rtmsg.ifp.sdl_data, rtmsg.ifp.sdl_nlen);
- /* and the interface address */
- rtmsg.ifa.sin_len = sizeof(rtmsg.ifa);
- rtmsg.ifa.sin_family = AF_INET;
- rtmsg.ifa.sin_addr = ifa;
+ rtmsg.hdr.rtm_addrs
+ = RTA_DST | RTA_GATEWAY | RTA_NETMASK | RTA_IFP | RTA_IFA;
+ if (default_route
+ && (flags & kRouteIsDirectToInterfaceFlag) == 0) {
+ rtmsg.hdr.rtm_flags = RTF_UP | RTF_GATEWAY | RTF_STATIC;
}
else {
- /* no ifp/ifa information */
- len -= sizeof(rtmsg.ifp) + sizeof(rtmsg.ifa);
+ rtmsg.hdr.rtm_flags = RTF_UP | RTF_CLONING | RTF_STATIC;
}
- rtmsg.hdr.rtm_msglen = len;
- if (write(sockfd, &rtmsg, len) == -1) {
- if ((cmd == RTM_ADD) && (errno == EEXIST)) {
- /* no sense complaining about a route that already exists */
- }
- else if ((cmd == RTM_DELETE) && (errno == ESRCH)) {
- /* no sense complaining about a route that isn't there */
+ if ((flags & kRouteWantScopedFlag) != 0) {
+#ifdef RTF_IFSCOPE
+ if (!S_scopedroute) {
+ return (0);
}
- else {
- SCLog(S_IPMonitor_debug, LOG_INFO,
- CFSTR("IPMonitor ipv4_route: "
- "write routing socket failed, %s"), strerror(errno));
- ret = FALSE;
+ if (ifindex == 0) {
+ /* specifically asked for a scoped route, yet no index supplied */
+ syslog(LOG_NOTICE,
+ "IPMonitor: ipv4_route index is 0 on %s-scoped route %s",
+ ifname, inet_ntoa(netaddr));
+ return (EBADF);
}
+ rtmsg.hdr.rtm_index = ifindex;
+ rtmsg.hdr.rtm_flags |= RTF_IFSCOPE;
+#else /* RTF_IFSCOPE */
+ return (0);
+#endif /* RTF_IFSCOPE */
}
- close(sockfd);
+ rtaddr.ptr = rtmsg.addrs;
+
+ /* dest */
+ rtaddr.in_p->sin_len = sizeof(*rtaddr.in_p);
+ rtaddr.in_p->sin_family = AF_INET;
+ rtaddr.in_p->sin_addr = netaddr;
+ rtaddr.ptr += sizeof(*rtaddr.in_p);
+
+ /* gateway */
+ if ((rtmsg.hdr.rtm_flags & RTF_GATEWAY) != 0) {
+ /* gateway is an IP address */
+ rtaddr.in_p->sin_len = sizeof(*rtaddr.in_p);
+ rtaddr.in_p->sin_family = AF_INET;
+ rtaddr.in_p->sin_addr = gateway;
+ rtaddr.ptr += sizeof(*rtaddr.in_p);
+ }
+ else {
+ /* gateway is the interface itself */
+ rtaddr.dl_p->sdl_len = sizeof(*rtaddr.dl_p);
+ rtaddr.dl_p->sdl_family = AF_LINK;
+ rtaddr.dl_p->sdl_nlen = strlen(ifname);
+ bcopy(ifname, rtaddr.dl_p->sdl_data, rtaddr.dl_p->sdl_nlen);
+ rtaddr.ptr += sizeof(*rtaddr.dl_p);
+ }
+
+ /* mask */
+ rtaddr.in_p->sin_len = sizeof(*rtaddr.in_p);
+ rtaddr.in_p->sin_family = AF_INET;
+ rtaddr.in_p->sin_addr = netmask;
+ rtaddr.ptr += sizeof(*rtaddr.in_p);
+
+ /* interface name */
+ rtaddr.dl_p->sdl_len = sizeof(*rtaddr.dl_p);
+ rtaddr.dl_p->sdl_family = AF_LINK;
+ rtaddr.dl_p->sdl_nlen = strlen(ifname);
+ bcopy(ifname, rtaddr.dl_p->sdl_data, rtaddr.dl_p->sdl_nlen);
+ rtaddr.ptr += sizeof(*rtaddr.dl_p);
+
+ /* interface address */
+ rtaddr.in_p->sin_len = sizeof(*rtaddr.in_p);
+ rtaddr.in_p->sin_family = AF_INET;
+ rtaddr.in_p->sin_addr = ifa;
+ rtaddr.ptr += sizeof(*rtaddr.in_p);
+
+ len = sizeof(rtmsg.hdr) + (rtaddr.ptr - (void *)rtmsg.addrs);
+ rtmsg.hdr.rtm_msglen = len;
+ if (write(sockfd, &rtmsg, len) == -1) {
+ ret = errno;
+ }
return (ret);
}
gateway.__u6_addr.__u6_addr16[1] = (uint16_t)htons(index);
}
if ((sockfd = socket(PF_ROUTE, SOCK_RAW, AF_INET)) == -1) {
- SCLog(TRUE, LOG_INFO,
+ SCLog(TRUE, LOG_NOTICE,
CFSTR("IPMonitor ipv6_route: open routing socket failed, %s"),
strerror(errno));
return (FALSE);
/* no sense complaining about a route that isn't there */
}
else {
- SCLog(S_IPMonitor_debug, LOG_INFO,
- CFSTR("IPMonitor ipv6_route: write routing"
- " socket failed, %s"), strerror(errno));
+ if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("IPMonitor ipv6_route: write routing"
+ " socket failed, %s"), strerror(errno));
+ }
ret = FALSE;
}
}
return (ret);
}
-static boolean_t
-ipv4_subnet_route_add(struct in_addr local_ip,
- struct in_addr subnet, struct in_addr mask, char * ifname)
-{
- if (S_IPMonitor_debug) {
- SCLog(TRUE, LOG_INFO,
- CFSTR("IPMonitor: IPv4 route add -net "
- IP_FORMAT " -netmask %s interface %s"),
- IP_LIST(&subnet), inet_ntoa(mask), ifname);
- }
- return (ipv4_route(RTM_ADD, local_ip, subnet, mask, ifname, local_ip,
- FALSE));
-}
-
-static boolean_t
-ipv4_subnet_route_delete(struct in_addr subnet, struct in_addr mask)
-{
- if (S_IPMonitor_debug) {
- SCLog(TRUE, LOG_INFO,
- CFSTR("IPMonitor: IPv4 route delete -net "
- IP_FORMAT " %s"),
- IP_LIST(&subnet), inet_ntoa(mask));
- }
- return (ipv4_route(RTM_DELETE, S_ip_zeros, subnet, mask, NULL,
- S_ip_zeros, FALSE));
-}
-
-
-static boolean_t
-ipv4_default_route_delete(void)
-{
- if (S_IPMonitor_debug) {
- SCLog(TRUE, LOG_INFO, CFSTR("IPMonitor: IPv4 route delete default"));
- }
- return (ipv4_route(RTM_DELETE, S_ip_zeros, S_ip_zeros, S_ip_zeros, NULL,
- S_ip_zeros, FALSE));
-}
-
-static boolean_t
-ipv4_default_route_add(struct in_addr router, char * ifname,
- struct in_addr local_ip, boolean_t is_direct)
-{
- if (S_IPMonitor_debug) {
- SCLog(TRUE, LOG_INFO,
- CFSTR("IPMonitor: IPv4 route add default"
- " %s interface %s direct %d"),
- inet_ntoa(router), ifname, is_direct);
- }
- return (ipv4_route(RTM_ADD, router, S_ip_zeros, S_ip_zeros, ifname,
- local_ip, is_direct));
-}
-
-static boolean_t
-ipv4_default_route_change(struct in_addr router, char * ifname,
- struct in_addr local_ip, boolean_t is_direct)
-{
- if (S_IPMonitor_debug) {
- SCLog(TRUE, LOG_INFO,
- CFSTR("IPMonitor: IPv4 route change default"
- " %s interface %s direct %d"),
- inet_ntoa(router), ifname, is_direct);
- }
- return (ipv4_route(RTM_CHANGE, router, S_ip_zeros, S_ip_zeros, ifname,
- local_ip, is_direct));
-}
-
static boolean_t
ipv6_default_route_delete(void)
{
- if (S_IPMonitor_debug) {
- SCLog(TRUE, LOG_INFO, CFSTR("IPMonitor: IPv6 route delete default"));
+ if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
+ SCLog(TRUE, LOG_NOTICE, CFSTR("IPMonitor: IPv6 route delete default"));
}
- return (ipv6_route(RTM_DELETE, S_ip6_zeros, S_ip6_zeros, S_ip6_zeros, NULL, FALSE));
+ return (ipv6_route(RTM_DELETE, S_ip6_zeros, S_ip6_zeros, S_ip6_zeros,
+ NULL, FALSE));
}
static boolean_t
ipv6_default_route_add(struct in6_addr router, char * ifname,
boolean_t is_direct)
{
- if (S_IPMonitor_debug) {
+ if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
char str[128];
str[0] = '\0';
inet_ntop(AF_INET6, &router, str, sizeof(str));
- SCLog(TRUE,LOG_INFO,
+ SCLog(TRUE, LOG_NOTICE,
CFSTR("IPMonitor: IPv6 route add default"
" %s interface %s direct %d"),
str, ifname, is_direct);
}
- return (ipv6_route(RTM_ADD, router, S_ip6_zeros, S_ip6_zeros, ifname, is_direct));
+ return (ipv6_route(RTM_ADD, router, S_ip6_zeros, S_ip6_zeros,
+ ifname, is_direct));
}
-static boolean_t
-multicast_route_delete()
+static int
+multicast_route_delete(int sockfd)
{
struct in_addr gateway = { htonl(INADDR_LOOPBACK) };
struct in_addr netaddr = { htonl(INADDR_UNSPEC_GROUP) };
struct in_addr netmask = { htonl(IN_CLASSD_NET) };
- return (ipv4_route(RTM_DELETE, gateway, netaddr, netmask, "lo0",
- gateway, FALSE));
+ return (ipv4_route(sockfd, RTM_DELETE, gateway, netaddr, netmask, "lo0", 0,
+ gateway, 0));
}
-static boolean_t
-multicast_route_add()
+static int
+multicast_route_add(int sockfd)
{
struct in_addr gateway = { htonl(INADDR_LOOPBACK) };
struct in_addr netaddr = { htonl(INADDR_UNSPEC_GROUP) };
struct in_addr netmask = { htonl(IN_CLASSD_NET) };
- return (ipv4_route(RTM_ADD, gateway, netaddr, netmask, "lo0",
- gateway, FALSE));
-}
-
-static void
-set_ipv4_router(struct in_addr * router, char * ifname,
- struct in_addr * local_ip, boolean_t is_direct)
-{
- if (S_router_subnet.s_addr != 0) {
- ipv4_subnet_route_delete(S_router_subnet, S_router_subnet_mask);
- S_router_subnet.s_addr = S_router_subnet_mask.s_addr = 0;
- }
- /* assign the new default route, ensure local multicast route available */
- (void)ipv4_default_route_delete();
- if (router != NULL) {
- (void)ipv4_default_route_add(*router, ifname,
- (local_ip != NULL)
- ? *local_ip : S_ip_zeros,
- is_direct);
- (void)multicast_route_delete();
- }
- else {
- (void)multicast_route_add();
- }
-
- return;
+ return (ipv4_route(sockfd, RTM_ADD, gateway, netaddr, netmask, "lo0", 0,
+ gateway, 0));
}
static void
return;
}
+#if !TARGET_OS_IPHONE
static __inline__ void
empty_dns()
{
CFIndex i;
CFIndex n;
+ SCPrint(TRUE, f, CFSTR("#\n"));
+ SCPrint(TRUE, f, CFSTR("# Mac OS X Notice\n"));
+ SCPrint(TRUE, f, CFSTR("#\n"));
+ SCPrint(TRUE, f, CFSTR("# This file is not used by the host name and address resolution\n"));
+ SCPrint(TRUE, f, CFSTR("# or the DNS query routing mechanisms used by most processes on\n"));
+ SCPrint(TRUE, f, CFSTR("# this Mac OS X system.\n"));
+ SCPrint(TRUE, f, CFSTR("#\n"));
+ SCPrint(TRUE, f, CFSTR("# This file is automatically generated.\n"));
+ SCPrint(TRUE, f, CFSTR("#\n"));
+
if (isA_CFString(val_domain_name)) {
SCPrint(TRUE, f, CFSTR("domain %@\n"), val_domain_name);
}
}
return;
}
+#endif /* !TARGET_OS_IPHONE */
static boolean_t
router_is_our_ipv6_address(CFStringRef router, CFArrayRef addr_list)
return (FALSE);
}
-static void
-update_ipv4(CFDictionaryRef service_info,
- CFStringRef primary,
- keyChangeListRef keys)
+static IPv4RouteListRef
+service_dict_get_ipv4_routelist(CFDictionaryRef service_dict)
{
- CFDictionaryRef ipv4_dict = NULL;
+ CFDataRef data;
+ IPv4RouteListRef routes = NULL;
- if (primary != NULL) {
- CFDictionaryRef service_dict;
+ data = (CFDataRef)CFDictionaryGetValue(service_dict, kSCEntNetIPv4);
+ if (data != NULL) {
+ routes = (IPv4RouteListRef)CFDataGetBytePtr(data);
+ }
+ return (routes);
+}
- service_dict = CFDictionaryGetValue(S_service_state_dict, primary);
- if (service_dict != NULL) {
- ipv4_dict = CFDictionaryGetValue(service_dict, kSCEntNetIPv4);
+typedef struct apply_ipv4_route_context {
+ IPv4RouteListRef old;
+ IPv4RouteListRef new;
+ int sockfd;
+} apply_ipv4_route_context_t;
+
+/* add/remove a router/32 subnet */
+static int
+ipv4_route_gateway(int sockfd, int cmd, char * ifn_p,
+ IPv4RouteRef def_route)
+{
+ struct in_addr mask;
+
+ mask.s_addr = htonl(INADDR_BROADCAST);
+ return (ipv4_route(sockfd, cmd, def_route->ifa,
+ def_route->gateway, mask, ifn_p, def_route->ifindex,
+ def_route->ifa,
+ (def_route->flags & kRouteWantScopedFlag)));
+}
+
+/*
+ * Function: apply_ipv4_route
+ * Purpose:
+ * Callback function that adds/removes the specified route.
+ */
+static void
+apply_ipv4_route(IPv4RouteListApplyCommand cmd, IPv4RouteRef route, void * arg)
+{
+ apply_ipv4_route_context_t *context = (apply_ipv4_route_context_t *)arg;
+ char * ifn_p;
+ int retval;
+
+ ifn_p = route->ifname;
+ switch (cmd) {
+ case kIPv4RouteListAddRouteCommand:
+ if ((route->flags & kRouteIsNotSubnetLocalFlag) != 0) {
+ retval = ipv4_route_gateway(context->sockfd, RTM_ADD,
+ ifn_p, route);
+ if (retval == EEXIST) {
+ /* delete and add again */
+ (void)ipv4_route_gateway(context->sockfd, RTM_DELETE,
+ ifn_p, route);
+ retval = ipv4_route_gateway(context->sockfd, RTM_ADD,
+ ifn_p, route);
+ }
+ if (retval != 0) {
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("IPMonitor apply_ipv4_route failed to add"
+ " %s/32 route, %s"),
+ inet_ntoa(route->gateway), strerror(retval));
+ }
+ else if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
+ SCLog(TRUE, LOG_NOTICE, CFSTR("Added IPv4 Route %s/32"),
+ inet_ntoa(route->gateway));
+ }
+ }
+ retval = ipv4_route(context->sockfd,
+ RTM_ADD, route->gateway,
+ route->dest, route->mask, ifn_p, route->ifindex,
+ route->ifa, route->flags);
+ if (retval == EEXIST) {
+ /* delete and add again */
+ (void)ipv4_route(context->sockfd,
+ RTM_DELETE, route->gateway,
+ route->dest, route->mask, ifn_p, route->ifindex,
+ route->ifa, route->flags);
+ retval = ipv4_route(context->sockfd,
+ RTM_ADD, route->gateway,
+ route->dest, route->mask,
+ ifn_p, route->ifindex,
+ route->ifa, route->flags);
+ }
+ if (retval != 0) {
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("IPMonitor apply_ipv4_route failed to add"
+ " route, %s:"), strerror(retval));
+ IPv4RouteLog(route);
+ }
+ else if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("Added IPv4 route new[%d] = "),
+ route - context->new->list);
+ IPv4RouteLog(route);
}
+ break;
+ case kIPv4RouteListRemoveRouteCommand:
+ retval = ipv4_route(context->sockfd,
+ RTM_DELETE, route->gateway,
+ route->dest, route->mask, ifn_p, route->ifindex,
+ route->ifa, route->flags);
+ if (retval != 0) {
+ if (retval != ESRCH) {
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("IPMonitor apply_ipv4_route failed to remove"
+ " route, %s: "), strerror(retval));
+ IPv4RouteLog(route);
+ }
+ }
+ else if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("Removed IPv4 route old[%d] = "),
+ route - context->old->list);
+ IPv4RouteLog(route);
+ }
+ if ((route->flags & kRouteIsNotSubnetLocalFlag) != 0) {
+ retval = ipv4_route_gateway(context->sockfd, RTM_DELETE,
+ ifn_p, route);
+ if (retval != 0) {
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("IPMonitor apply_ipv4_route failed to remove"
+ " %s/32 route, %s: "),
+ inet_ntoa(route->gateway), strerror(retval));
+ }
+ else if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
+ SCLog(TRUE, LOG_NOTICE, CFSTR("Removed IPv4 Route %s/32"),
+ inet_ntoa(route->gateway));
+ }
+ }
+ break;
+ default:
+ break;
}
- if (ipv4_dict != NULL) {
- CFMutableDictionaryRef dict = NULL;
- CFStringRef if_name = NULL;
- char ifn[IFNAMSIZ + 1] = { '\0' };
- char * ifn_p = NULL;
- boolean_t is_direct = FALSE;
- struct in_addr local_ip = { 0 };
- CFStringRef local_ip_cf;
- CFArrayRef local_ip_list;
- boolean_t needs_local_ip = FALSE;
- struct in_addr router = { 0 };
- CFStringRef val_router = NULL;
+ return;
+}
- dict = CFDictionaryCreateMutable(NULL, 0,
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
- local_ip_list = CFDictionaryGetValue(ipv4_dict,
- kSCPropNetIPv4Addresses);
- local_ip_cf = CFArrayGetValueAtIndex(local_ip_list, 0);
- cfstring_to_ip(local_ip_cf, &local_ip);
- val_router = CFDictionaryGetValue(ipv4_dict, kSCPropNetIPv4Router);
- if (val_router != NULL) {
- cfstring_to_ip(val_router, &router);
- CFDictionarySetValue(dict, kSCPropNetIPv4Router, val_router);
- if (CFDictionaryContainsKey(ipv4_dict, kRouterIsDirect)) {
- is_direct = TRUE;
+/*
+ * Function: update_ipv4
+ *
+ * Purpose:
+ * Update the IPv4 configuration based on the latest information.
+ * Publish the State:/Network/Global/IPv4 information, and update the
+ * IPv4 routing table. IPv4RouteListApply() invokes our callback,
+ * apply_ipv4_route(), to install/remove the routes.
+ */
+static void
+update_ipv4(CFStringRef primary,
+ IPv4RouteListRef new_routelist,
+ keyChangeListRef keys)
+{
+ apply_ipv4_route_context_t context;
+
+ if (keys != NULL) {
+ if (new_routelist != NULL && primary != NULL) {
+ char * ifn_p = NULL;
+ IPv4RouteRef r;
+ CFMutableDictionaryRef dict = NULL;
+
+ dict = CFDictionaryCreateMutable(NULL, 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ /* the first entry is the default route */
+ r = new_routelist->list;
+ if (r->gateway.s_addr != 0) {
+ CFStringRef router;
+
+ router = CFStringCreateWithCString(NULL,
+ inet_ntoa(r->gateway),
+ kCFStringEncodingASCII);
+ if (router != NULL) {
+ CFDictionarySetValue(dict, kSCPropNetIPv4Router, router);
+ CFRelease(router);
+ }
}
- else if (CFDictionaryContainsKey(ipv4_dict, kRouterNeedsLocalIP)) {
- needs_local_ip = TRUE;
+ if (r->ifname[0] != '\0') {
+ ifn_p = r->ifname;
+ }
+ if (ifn_p != NULL) {
+ CFStringRef ifname_cf;
+
+ ifname_cf = CFStringCreateWithCString(NULL,
+ ifn_p,
+ kCFStringEncodingASCII);
+ if (ifname_cf != NULL) {
+ CFDictionarySetValue(dict,
+ kSCDynamicStorePropNetPrimaryInterface,
+ ifname_cf);
+ CFRelease(ifname_cf);
+ }
}
+ CFDictionarySetValue(dict, kSCDynamicStorePropNetPrimaryService,
+ primary);
+ keyChangeListSetValue(keys, S_state_global_ipv4, dict);
+ CFRelease(dict);
}
else {
- is_direct = TRUE;
- router = local_ip;
+ keyChangeListRemoveValue(keys, S_state_global_ipv4);
}
- if_name = CFDictionaryGetValue(ipv4_dict, kSCPropInterfaceName);
- if (if_name) {
- CFDictionarySetValue(dict,
- kSCDynamicStorePropNetPrimaryInterface,
- if_name);
- if (CFStringGetCString(if_name, ifn, sizeof(ifn),
- kCFStringEncodingASCII)) {
- ifn_p = ifn;
+ }
+
+ bzero(&context, sizeof(context));
+ context.sockfd = ipv4_route_open_socket();
+ if (context.sockfd != -1) {
+ if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
+ if (S_ipv4_routelist == NULL) {
+ SCLog(TRUE, LOG_NOTICE, CFSTR("Old Routes = <none>"));
+ }
+ else {
+ SCLog(TRUE, LOG_NOTICE, CFSTR("Old Routes = "));
+ IPv4RouteListLog(S_ipv4_routelist);
+ }
+ if (new_routelist == NULL) {
+ SCLog(TRUE, LOG_NOTICE, CFSTR("New Routes = <none>"));
+ }
+ else {
+ SCLog(TRUE, LOG_NOTICE, CFSTR("New Routes = "));
+ IPv4RouteListLog(new_routelist);
}
}
- CFDictionarySetValue(dict, kSCDynamicStorePropNetPrimaryService,
- primary);
- keyChangeListSetValue(keys, S_state_global_ipv4, dict);
- CFRelease(dict);
-
- /* route add default ... */
- if (needs_local_ip) {
- struct in_addr m;
-
- m.s_addr = htonl(INADDR_BROADCAST);
- ipv4_subnet_route_add(local_ip, router, m, ifn_p);
- set_ipv4_router(&local_ip, ifn_p, &local_ip, FALSE);
- ipv4_default_route_change(router, ifn_p, local_ip, FALSE);
- S_router_subnet = router;
- S_router_subnet_mask = m;
+ context.old = S_ipv4_routelist;
+ context.new = new_routelist;
+ IPv4RouteListApply(S_ipv4_routelist, new_routelist,
+ &apply_ipv4_route, (void *)&context);
+ if (new_routelist != NULL) {
+ (void)multicast_route_delete(context.sockfd);
}
else {
- set_ipv4_router(&router, ifn_p, &local_ip, is_direct);
+ (void)multicast_route_add(context.sockfd);
}
+ close(context.sockfd);
}
- else {
- keyChangeListRemoveValue(keys, S_state_global_ipv4);
- set_ipv4_router(NULL, NULL, NULL, FALSE);
+ if (S_ipv4_routelist != NULL) {
+ free(S_ipv4_routelist);
}
+ S_ipv4_routelist = new_routelist;
return;
}
CFArrayRef addrs;
CFMutableDictionaryRef dict = NULL;
CFStringRef if_name = NULL;
- char ifn[IFNAMSIZ + 1] = { '\0' };
+ char ifn[IFNAMSIZ] = { '\0' };
char * ifn_p = NULL;
boolean_t is_direct = FALSE;
CFStringRef val_router = NULL;
}
}
if (dict == NULL) {
+#if !TARGET_OS_IPHONE
empty_dns();
+#endif /* !TARGET_OS_IPHONE */
keyChangeListRemoveValue(keys, S_state_global_dns);
}
else {
+#if !TARGET_OS_IPHONE
set_dns(CFDictionaryGetValue(dict, kSCPropNetDNSSearchDomains),
CFDictionaryGetValue(dict, kSCPropNetDNSDomainName),
CFDictionaryGetValue(dict, kSCPropNetDNSServerAddresses),
CFDictionaryGetValue(dict, kSCPropNetDNSSortList));
+#endif /* !TARGET_OS_IPHONE */
keyChangeListSetValue(keys, S_state_global_dns, dict);
}
return;
keyChangeListRef keys,
CFArrayRef service_order)
{
- CFArrayRef privateResolvers;
+ CFDictionaryRef dict = NULL;
+ CFArrayRef multicastResolvers;
+ CFArrayRef privateResolvers;
- privateResolvers = CFDictionaryGetValue(service_info, S_private_resolvers);
+ multicastResolvers = CFDictionaryGetValue(service_info, S_multicast_resolvers);
+ privateResolvers = CFDictionaryGetValue(service_info, S_private_resolvers);
- if (primary == NULL) {
- dns_configuration_set(NULL, NULL, NULL, privateResolvers);
- } else {
- CFDictionaryRef dict = NULL;
+ if (primary != NULL) {
CFDictionaryRef service_dict;
service_dict = CFDictionaryGetValue(S_service_state_dict, primary);
if (service_dict != NULL) {
dict = CFDictionaryGetValue(service_dict, kSCEntNetDNS);
}
-
- dns_configuration_set(dict, S_service_state_dict, service_order, privateResolvers);
}
+
+ dns_configuration_set(dict,
+ S_service_state_dict,
+ service_order,
+ multicastResolvers,
+ privateResolvers);
keyChangeListNotifyKey(keys, S_state_global_dns);
return;
}
CFStringRef primary,
keyChangeListRef keys)
{
- CFDictionaryRef dict = NULL;
+ CFDictionaryRef dict = NULL;
if (primary != NULL) {
CFDictionaryRef service_dict;
return;
}
+#if !TARGET_OS_IPHONE
static void
update_smb(CFDictionaryRef service_info,
CFStringRef primary,
return;
}
+#endif /* !TARGET_OS_IPHONE */
-static unsigned int
-get_service_rank(CFStringRef proto_key, CFArrayRef order, CFStringRef serviceID)
+static Rank
+get_service_rank(CFArrayRef order, int n_order, CFStringRef serviceID)
{
- CFDictionaryRef d;
CFIndex i;
- CFDictionaryRef proto_dict;
-
- if (serviceID == NULL) {
- goto done;
- }
- d = CFDictionaryGetValue(S_service_state_dict, serviceID);
- if (d == NULL) {
- goto done;
- }
-
- proto_dict = CFDictionaryGetValue(d, proto_key);
- if (proto_dict) {
- CFStringRef if_name;
- CFNumberRef override = NULL;
-
- if_name = CFDictionaryGetValue(proto_dict, kSCPropInterfaceName);
- if (S_ppp_override_primary == TRUE
- && if_name != NULL
- && CFStringHasPrefix(if_name, CFSTR("ppp"))) {
- /* PPP override: make ppp* look the best */
- /* Hack: should use interface type, not interface name */
- return (0);
- }
- /* check for the "OverridePrimary" property */
- override = CFDictionaryGetValue(proto_dict, kSCPropNetOverridePrimary);
- if (isA_CFNumber(override) != NULL) {
- int val = 0;
-
- CFNumberGetValue(override, kCFNumberIntType, &val);
- if (val != 0) {
- return (0);
- }
- }
- }
-
- if (serviceID != NULL && order != NULL) {
- CFIndex n = CFArrayGetCount(order);
+ Rank rank = kRankLast;
- for (i = 0; i < n; i++) {
+ if (serviceID != NULL && order != NULL && n_order > 0) {
+ for (i = 0; i < n_order; i++) {
CFStringRef s = isA_CFString(CFArrayGetValueAtIndex(order, i));
if (s == NULL) {
continue;
}
if (CFEqual(serviceID, s)) {
- return (i + 1);
+ rank = i + 1;
+ break;
}
}
}
-
- done:
- return (UINT_MAX);
+ return (rank);
}
/**
** Service election:
**/
-typedef boolean_t (*routerCheckFunc)(CFStringRef str);
+/*
+ * Function: rank_dict_get_service_rank
+ * Purpose:
+ * Retrieve the service rank in the given dictionary.
+ */
+static Rank
+rank_dict_get_service_rank(CFDictionaryRef rank_dict, CFStringRef serviceID)
+{
+ CFNumberRef rank;
+ Rank rank_val = kRankLast;
-static boolean_t
-check_ipv4_router(CFStringRef router)
+ rank = CFDictionaryGetValue(rank_dict, serviceID);
+ if (rank != NULL) {
+ CFNumberGetValue(rank, kCFNumberSInt32Type, &rank_val);
+ }
+ return (rank_val);
+}
+
+/*
+ * Function: rank_dict_set_service_rank
+ * Purpose:
+ * Save the results of ranking the service so we can look it up later without
+ * repeating all of the ranking code.
+ */
+static void
+rank_dict_set_service_rank(CFMutableDictionaryRef rank_dict,
+ CFStringRef serviceID, Rank rank_val)
{
- struct in_addr ip;
+ CFNumberRef rank;
- return (cfstring_to_ip(router, &ip));
+ rank = CFNumberCreate(NULL, kCFNumberSInt32Type, (const void *)&rank_val);
+ if (rank != NULL) {
+ CFDictionarySetValue(rank_dict, serviceID, rank);
+ CFRelease(rank);
+ }
+ return;
}
+typedef struct election_info {
+ int n_services;
+ CFArrayRef order;
+ int n_order;
+ CFStringRef serviceID;
+ CFDictionaryRef service_dict;
+ Rank service_rank;
+ boolean_t choose_last;
+} election_info_t;
+
+typedef boolean_t election_func_t(void * context, election_info_t * info);
+
+/*
+ * Function: elect_ipv4
+ * Purpose:
+ * This function builds the list of IPv4 routes that should be active.
+ * As elect_new_primary() invokes us with each service, we build up the
+ * result in the passed in context, a pointer to an IPv4RouteListRef.
+ */
static boolean_t
-check_ipv6_router(CFStringRef router)
+elect_ipv4(void * context, election_info_t * info)
{
- struct in6_addr ip6;
+ IPv4RouteListRef * routes_p = (IPv4RouteListRef *)context;
+ IPv4RouteListRef service_routes;
- return (cfstring_to_ip6(router, &ip6));
+ service_routes = service_dict_get_ipv4_routelist(info->service_dict);
+ if (service_routes == NULL) {
+ return (FALSE);
+ }
+ if ((service_routes->list->flags & kRouteChooseFirstFlag) != 0) {
+ info->service_rank = kRankFirst;
+ }
+ else if (S_ppp_override_primary
+ && (strncmp(PPP_PREFIX, service_routes->list->ifname,
+ sizeof(PPP_PREFIX) - 1) == 0)) {
+ /* PPP override: make ppp* look the best */
+ /* Hack: should use interface type, not interface name */
+ info->service_rank = kRankFirst;
+ }
+ else {
+ info->service_rank = get_service_rank(info->order, info->n_order,
+ info->serviceID);
+ if ((service_routes->list->flags & kRouteChooseLastFlag) != 0) {
+ info->choose_last = TRUE;
+ }
+ }
+ if (routes_p != NULL) {
+ *routes_p = IPv4RouteListAddRouteList(*routes_p,
+ info->n_services * 3,
+ service_routes,
+ info->service_rank);
+ }
+ if ((service_routes->list->flags & kRouteChooseNeverFlag) != 0) {
+ /* never elect as primary */
+ return (FALSE);
+ }
+ rank_dict_set_service_rank(S_ipv4_service_rank_dict,
+ info->serviceID, info->service_rank);
+ return (TRUE);
}
-struct election_state {
- routerCheckFunc router_check;
- CFStringRef proto_key; /* e.g. kSCEntNetIPv4 */
- CFStringRef router_key;/* e.g. kSCPropNetIPv4Router */
- CFArrayRef order;
- CFStringRef new_primary;
- boolean_t new_has_router;
- unsigned int new_primary_index;
-};
-
-static void
-elect_protocol(const void * key, const void * value, void * context)
+static boolean_t
+elect_ipv6(void * context, election_info_t * info)
{
- struct election_state * elect_p = (struct election_state *)context;
- CFDictionaryRef proto_dict = NULL;
- CFStringRef router;
- boolean_t router_valid = FALSE;
- CFStringRef serviceID = (CFStringRef)key;
- CFDictionaryRef service_dict = (CFDictionaryRef)value;
- unsigned int service_index;
+ CFStringRef if_name;
+ CFStringRef primaryRank = NULL;
+ CFDictionaryRef proto_dict;
+ CFStringRef router;
+ CFDictionaryRef service_options;
- proto_dict = CFDictionaryGetValue(service_dict, elect_p->proto_key);
+ proto_dict = CFDictionaryGetValue(info->service_dict, kSCEntNetIPv6);
if (proto_dict == NULL) {
- return;
+ return (FALSE);
}
- router = CFDictionaryGetValue(proto_dict, elect_p->router_key);
- router_valid = (*elect_p->router_check)(router);
- if (router_valid == FALSE && elect_p->new_has_router == TRUE) {
- /* skip it */
- return;
+ service_options = service_dict_get(info->serviceID, kSCEntNetService);
+ if (service_options != NULL) {
+ primaryRank = CFDictionaryGetValue(service_options, kSCPropNetServicePrimaryRank);
+ if ((primaryRank != NULL)
+ && CFEqual(primaryRank, kSCValNetServicePrimaryRankNever)) {
+ return (FALSE);
+ }
}
- service_index
- = get_service_rank(elect_p->proto_key, elect_p->order, serviceID);
- if (elect_p->new_primary == NULL
- || service_index < elect_p->new_primary_index
- || (router_valid && elect_p->new_has_router == FALSE)) {
- my_CFRelease(&elect_p->new_primary);
- elect_p->new_primary = CFRetain(serviceID);
- elect_p->new_primary_index = service_index;
- elect_p->new_has_router = router_valid;
+ router = CFDictionaryGetValue(proto_dict,
+ kSCPropNetIPv6Router);
+ if (router == NULL) {
+ info->choose_last = TRUE;
+ info->service_rank = kRankLast;
}
- return;
+ else if ((primaryRank != NULL)
+ && CFEqual(primaryRank, kSCValNetServicePrimaryRankFirst)) {
+ info->service_rank = kRankFirst;
+ }
+ else if (get_override_primary(proto_dict)) {
+ info->service_rank = kRankFirst;
+ }
+ else if (S_ppp_override_primary
+ && CFDictionaryGetValueIfPresent(proto_dict,
+ kSCPropInterfaceName,
+ (const void **)&if_name)
+ && CFStringHasPrefix(if_name, CFSTR(PPP_PREFIX))) {
+ /* PPP override: make ppp* look the best */
+ /* Hack: should use interface type, not interface name */
+ info->service_rank = kRankFirst;
+ }
+ else {
+ info->service_rank = get_service_rank(info->order, info->n_order,
+ info->serviceID);
+ }
+ rank_dict_set_service_rank(S_ipv6_service_rank_dict,
+ info->serviceID, info->service_rank);
+ return (TRUE);
}
+/*
+ * Function: elect_new_primary
+ * Purpose:
+ * Walk the list of services, passing each service dictionary to "elect_func".
+ * "elect_func" returns rank information about the service that let us
+ * determine the new primary.
+ */
static CFStringRef
-elect_new_primary(CFArrayRef order, CFStringRef proto_key,
- CFStringRef router_key)
+elect_new_primary(election_func_t * elect_func, void * context,
+ CFArrayRef order, int n_order)
{
- struct election_state elect;
+ int count;
+ int i;
+ election_info_t info;
+ void * * keys;
+#define N_KEYS_VALUES_STATIC 10
+ void * keys_values_buf[N_KEYS_VALUES_STATIC * 2];
+ CFStringRef new_primary = NULL;
+ Rank new_primary_rank = kRankLast;
+ boolean_t new_primary_choose_last = FALSE;
+ void * * values;
+
+ count = CFDictionaryGetCount(S_service_state_dict);
+ if (count <= N_KEYS_VALUES_STATIC) {
+ keys = keys_values_buf;
+ }
+ else {
+ keys = (void * *)malloc(sizeof(*keys) * count * 2);
+ }
+ values = keys + count;
+ CFDictionaryGetKeysAndValues(S_service_state_dict,
+ (const void * *)keys,
+ (const void * *)values);
- if (CFEqual(proto_key, kSCEntNetIPv4)) {
- elect.router_check = check_ipv4_router;
+ info.n_services = count;
+ info.order = order;
+ info.n_order = n_order;
+ for (i = 0; i < count; i++) {
+ boolean_t found_new_primary = FALSE;
+
+ info.serviceID = (CFStringRef)keys[i];
+ info.service_dict = (CFDictionaryRef)values[i];
+ info.service_rank = kRankLast;
+ info.choose_last = FALSE;
+
+ if ((*elect_func)(context, &info) == FALSE) {
+ continue;
+ }
+ if (new_primary == NULL) {
+ found_new_primary = TRUE;
+ }
+ else if (info.choose_last == new_primary_choose_last) {
+ found_new_primary = (info.service_rank < new_primary_rank);
+ }
+ else if (new_primary_choose_last) {
+ found_new_primary = TRUE;
+ }
+ if (found_new_primary) {
+ new_primary = info.serviceID;
+ new_primary_rank = info.service_rank;
+ new_primary_choose_last = info.choose_last;
+ }
}
- else if (CFEqual(proto_key, kSCEntNetIPv6)) {
- elect.router_check = check_ipv6_router;
+ if (new_primary != NULL) {
+ CFRetain(new_primary);
}
- else {
- return (NULL);
+ if (keys != keys_values_buf) {
+ free(keys);
}
- elect.order = order;
- elect.new_primary = NULL;
- elect.new_primary_index = 0;
- elect.new_has_router = FALSE;
- elect.proto_key = proto_key;
- elect.router_key = router_key;
- CFDictionaryApplyFunction(S_service_state_dict, elect_protocol, &elect);
- return (elect.new_primary);
+ return (new_primary);
}
static uint32_t
uint32_t changed = 0;
int i;
+ /* update service options first (e.g. rank) */
+ if (get_rank_changes(serviceID,
+ get_service_state_entity(services_info, serviceID,
+ NULL),
+ get_service_setup_entity(services_info, serviceID,
+ NULL),
+ services_info)) {
+ changed |= (1 << kEntityTypeServiceOptions);
+ }
+ /* update IPv4, IPv6, DNS, Proxies, SMB, ... */
for (i = 0; i < ENTITY_TYPES_COUNT; i++) {
GetEntityChangesFuncRef func = entityChangeFunc[i];
if ((*func)(serviceID,
get_service_state_entity(services_info, serviceID,
- entityTypeNames[i]),
+ *entityTypeNames[i]),
get_service_setup_entity(services_info, serviceID,
- entityTypeNames[i]),
+ *entityTypeNames[i]),
services_info)) {
changed |= (1 << i);
}
if (new_primary != NULL) {
if (primary != NULL && CFEqual(new_primary, primary)) {
- SCLog(S_IPMonitor_debug, LOG_INFO,
- CFSTR("IPMonitor: %@ is still primary %s"),
- new_primary, entity);
+ if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("IPMonitor: %@ is still primary %s"),
+ new_primary, entity);
+ }
}
else {
my_CFRelease(primary_p);
*primary_p = CFRetain(new_primary);
- SCLog(S_IPMonitor_debug, LOG_INFO,
- CFSTR("IPMonitor: %@ is the new primary %s"),
- new_primary, entity);
+ if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("IPMonitor: %@ is the new primary %s"),
+ new_primary, entity);
+ }
changed = TRUE;
}
}
else if (primary != NULL) {
- SCLog(S_IPMonitor_debug, LOG_INFO,
- CFSTR("IPMonitor: %@ is no longer primary %s"), primary, entity);
+ if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("IPMonitor: %@ is no longer primary %s"),
+ primary, entity);
+ }
my_CFRelease(primary_p);
changed = TRUE;
}
return (changed);
}
-static unsigned int
-rank_service_entity(CFArrayRef order, CFStringRef primary,
- CFStringRef proto_key, CFStringRef entity)
+static Rank
+rank_service_entity(CFDictionaryRef rank_dict, CFStringRef serviceID,
+ CFStringRef entity)
{
- CFDictionaryRef dict;
- dict = service_dict_get(primary, entity);
- if (dict == NULL) {
- return (UINT_MAX);
+ if (service_dict_get(serviceID, entity) == NULL) {
+ return (kRankLast);
}
- return (get_service_rank(proto_key, order, primary));
+ return (rank_dict_get_service_rank(rank_dict, serviceID));
}
static void
boolean_t dnsinfo_changed = FALSE;
boolean_t global_ipv4_changed = FALSE;
boolean_t global_ipv6_changed = FALSE;
- keyChangeList keys;
int i;
+ keyChangeList keys;
CFIndex n;
+ int n_service_order = 0;
CFArrayRef service_order;
CFMutableArrayRef service_changes = NULL;
CFDictionaryRef services_info = NULL;
return;
}
- SCLog(S_IPMonitor_debug, LOG_INFO,
- CFSTR("IPMonitor: changes %@ (%d)"), changed_keys, count);
+ if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("IPMonitor: changes %@ (%d)"), changed_keys, count);
+ }
keyChangeListInit(&keys);
service_changes = CFArrayCreateMutable(NULL, 0,
my_CFArrayAppendUniqueValue(service_changes, S_primary_proxies);
}
}
+#if !TARGET_OS_IPHONE
else if (CFEqual(change, S_setup_global_smb)) {
if (S_primary_smb != NULL) {
my_CFArrayAppendUniqueValue(service_changes, S_primary_smb);
}
}
+#endif /* !TARGET_OS_IPHONE */
+ else if (CFEqual(change, S_multicast_resolvers)) {
+ dnsinfo_changed = TRUE;
+ }
else if (CFEqual(change, S_private_resolvers)) {
dnsinfo_changed = TRUE;
}
+#if !TARGET_OS_IPHONE
+ else if (CFEqual(change, CFSTR(_PATH_RESOLVER_DIR))) {
+ dnsinfo_changed = TRUE;
+ }
+#endif /* !TARGET_OS_IPHONE */
else if (CFStringHasPrefix(change, S_state_service_prefix)) {
CFStringRef serviceID = parse_component(change,
S_state_service_prefix);
services_info = services_info_copy(session, service_changes);
service_order = service_order_get(services_info);
if (service_order != NULL) {
- SCLog(S_IPMonitor_debug, LOG_INFO,
- CFSTR("IPMonitor: service_order %@ "), service_order);
+ n_service_order = CFArrayGetCount(service_order);
+ if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("IPMonitor: service_order %@ "), service_order);
+ }
}
n = CFArrayGetCount(service_changes);
for (i = 0; i < n; i++) {
serviceID = CFArrayGetValueAtIndex(service_changes, i);
wasSupplemental = dns_has_supplemental(serviceID);
changes = service_changed(services_info, serviceID);
-
- if (S_primary_ipv4 != NULL && CFEqual(S_primary_ipv4, serviceID)) {
+ if ((changes & (1 << kEntityTypeServiceOptions)) != 0) {
+ /* if __Service__ (e.g. PrimaryRank) changed */
+ global_ipv4_changed = TRUE;
+ }
+ else if (S_primary_ipv4 != NULL && CFEqual(S_primary_ipv4, serviceID)) {
+ // if we are looking at the primary [IPv4] service
if ((changes & (1 << kEntityTypeIPv4)) != 0) {
- update_ipv4(services_info, serviceID, &keys);
+ // and something changed for THIS service
global_ipv4_changed = TRUE;
}
}
global_ipv4_changed = TRUE;
}
if ((changes & (1 << kEntityTypeIPv6)) != 0) {
+ // if we are looking at the primary [IPv6] service
if (S_primary_ipv6 != NULL && CFEqual(S_primary_ipv6, serviceID)) {
update_ipv6(services_info, serviceID, &keys);
}
+ // and something changed for THIS service
global_ipv6_changed = TRUE;
}
if ((changes & (1 << kEntityTypeDNS)) != 0) {
update_proxies(services_info, serviceID, &keys);
}
}
+#if !TARGET_OS_IPHONE
if ((changes & (1 << kEntityTypeSMB)) != 0) {
if (S_primary_smb != NULL && CFEqual(S_primary_smb, serviceID)) {
update_smb(services_info, serviceID, &keys);
}
}
+#endif /* !TARGET_OS_IPHONE */
}
if (global_ipv4_changed) {
- CFStringRef new_primary;
+ IPv4RouteListRef new_routelist = NULL;
+ CFStringRef new_primary;
- SCLog(S_IPMonitor_debug, LOG_INFO,
- CFSTR("IPMonitor: IPv4 service election"));
- new_primary = elect_new_primary(service_order,
- kSCEntNetIPv4, kSCPropNetIPv4Router);
- if (set_new_primary(&S_primary_ipv4, new_primary, "IPv4")) {
- update_ipv4(services_info, S_primary_ipv4, &keys);
+ if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("IPMonitor: IPv4 service election"));
}
+ new_primary = elect_new_primary(&elect_ipv4, &new_routelist,
+ service_order, n_service_order);
+ (void)set_new_primary(&S_primary_ipv4, new_primary, "IPv4");
+ update_ipv4(S_primary_ipv4, new_routelist, &keys);
my_CFRelease(&new_primary);
}
if (global_ipv6_changed) {
CFStringRef new_primary;
- SCLog(S_IPMonitor_debug, LOG_INFO,
- CFSTR("IPMonitor: IPv6 service election"));
- new_primary = elect_new_primary(service_order,
- kSCEntNetIPv6, kSCPropNetIPv6Router);
+ if ((S_IPMonitor_debug & kDebugFlag1) != 0) {
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("IPMonitor: IPv6 service election"));
+ }
+ new_primary = elect_new_primary(&elect_ipv6, NULL,
+ service_order, n_service_order);
if (set_new_primary(&S_primary_ipv6, new_primary, "IPv6")) {
update_ipv6(services_info, S_primary_ipv6, &keys);
}
my_CFRelease(&new_primary);
}
if (global_ipv4_changed || global_ipv6_changed) {
- CFStringRef new_primary_dns;
- CFStringRef new_primary_proxies;
- CFStringRef new_primary_smb;
+ CFStringRef new_primary_dns = NULL;
+ CFStringRef new_primary_proxies = NULL;
+#if !TARGET_OS_IPHONE
+ CFStringRef new_primary_smb = NULL;
+#endif /* !TARGET_OS_IPHONE */
if (S_primary_ipv4 != NULL && S_primary_ipv6 != NULL) {
/* decide between IPv4 and IPv6 */
- if (rank_service_entity(service_order, S_primary_ipv4,
- kSCEntNetIPv4, kSCEntNetDNS)
- <= rank_service_entity(service_order, S_primary_ipv6,
- kSCEntNetIPv6, kSCEntNetDNS)) {
+ if (rank_service_entity(S_ipv4_service_rank_dict,
+ S_primary_ipv4, kSCEntNetDNS)
+ <= rank_service_entity(S_ipv6_service_rank_dict,
+ S_primary_ipv6, kSCEntNetDNS)) {
new_primary_dns = S_primary_ipv4;
}
else {
new_primary_dns = S_primary_ipv6;
}
- if (rank_service_entity(service_order, S_primary_ipv4,
- kSCEntNetIPv4, kSCEntNetProxies)
- <= rank_service_entity(service_order, S_primary_ipv6,
- kSCEntNetIPv6, kSCEntNetProxies)) {
+ if (rank_service_entity(S_ipv4_service_rank_dict,
+ S_primary_ipv4, kSCEntNetProxies)
+ <= rank_service_entity(S_ipv6_service_rank_dict,
+ S_primary_ipv6, kSCEntNetProxies)) {
new_primary_proxies = S_primary_ipv4;
}
else {
new_primary_proxies = S_primary_ipv6;
}
- if (rank_service_entity(service_order, S_primary_ipv4,
- kSCEntNetIPv4, kSCEntNetSMB)
- <= rank_service_entity(service_order, S_primary_ipv6,
- kSCEntNetIPv6, kSCEntNetSMB)) {
+#if !TARGET_OS_IPHONE
+ if (rank_service_entity(S_ipv4_service_rank_dict,
+ S_primary_ipv4, kSCEntNetSMB)
+ <= rank_service_entity(S_ipv6_service_rank_dict,
+ S_primary_ipv6, kSCEntNetSMB)) {
new_primary_smb = S_primary_ipv4;
}
else {
new_primary_smb = S_primary_ipv6;
}
+#endif /* !TARGET_OS_IPHONE */
}
else if (S_primary_ipv6 != NULL) {
new_primary_dns = S_primary_ipv6;
new_primary_proxies = S_primary_ipv6;
+#if !TARGET_OS_IPHONE
new_primary_smb = S_primary_ipv6;
+#endif /* !TARGET_OS_IPHONE */
}
else if (S_primary_ipv4 != NULL) {
new_primary_dns = S_primary_ipv4;
new_primary_proxies = S_primary_ipv4;
+#if !TARGET_OS_IPHONE
new_primary_smb = S_primary_ipv4;
- }
- else {
- new_primary_dns = NULL;
- new_primary_proxies = NULL;
- new_primary_smb = NULL;
+#endif /* !TARGET_OS_IPHONE */
}
if (set_new_primary(&S_primary_dns, new_primary_dns, "DNS")) {
if (set_new_primary(&S_primary_proxies, new_primary_proxies, "Proxies")) {
update_proxies(services_info, S_primary_proxies, &keys);
}
+#if !TARGET_OS_IPHONE
if (set_new_primary(&S_primary_smb, new_primary_smb, "SMB")) {
update_smb(services_info, S_primary_smb, &keys);
}
+#endif /* !TARGET_OS_IPHONE */
}
if (dnsinfo_changed) {
update_dnsinfo(services_info, S_primary_dns, &keys, service_order);
return;
}
-static void
-initEntityNames(void)
-{
- entityTypeNames[0] = kSCEntNetIPv4; /* 0 */
- entityTypeNames[1] = kSCEntNetIPv6; /* 1 */
- entityTypeNames[2] = kSCEntNetDNS; /* 2 */
- entityTypeNames[3] = kSCEntNetProxies; /* 3 */
- entityTypeNames[4] = kSCEntNetSMB; /* 4 */
- return;
-}
-
static void
ip_plugin_init()
{
- int i;
- CFStringRef key;
CFMutableArrayRef keys = NULL;
CFMutableArrayRef patterns = NULL;
CFRunLoopSourceRef rls = NULL;
- SCDynamicStoreRef session = NULL;
- initEntityNames();
- if (S_netboot_root() != 0) {
+ if (S_is_network_boot() != 0) {
S_netboot = TRUE;
}
- session = SCDynamicStoreCreate(NULL, CFSTR("IPMonitor"),
+
+#ifdef RTF_IFSCOPE
+ if (S_is_scoped_routing_enabled() != 0) {
+ S_scopedroute = TRUE;
+ }
+#endif /* RTF_IFSCOPE */
+
+ S_session = SCDynamicStoreCreate(NULL, CFSTR("IPMonitor"),
IPMonitorNotify, NULL);
- if (session == NULL) {
+ if (S_session == NULL) {
SCLog(TRUE, LOG_ERR,
CFSTR("IPMonitor ip_plugin_init SCDynamicStoreCreate failed: %s"),
SCErrorString(SCError()));
= SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL,
kSCDynamicStoreDomainState,
kSCEntNetProxies);
+#if !TARGET_OS_IPHONE
S_state_global_smb
= SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL,
kSCDynamicStoreDomainState,
kSCEntNetSMB);
+#endif /* !TARGET_OS_IPHONE */
S_setup_global_ipv4
= SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL,
kSCDynamicStoreDomainSetup,
= SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL,
kSCDynamicStoreDomainSetup,
kSCEntNetProxies);
+#if !TARGET_OS_IPHONE
S_setup_global_smb
= SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL,
kSCDynamicStoreDomainSetup,
kSCEntNetSMB);
+#endif /* !TARGET_OS_IPHONE */
S_state_service_prefix
= SCDynamicStoreKeyCreate(NULL, CFSTR("%@/%@/%@/"),
kSCDynamicStoreDomainState,
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
+ S_ipv4_service_rank_dict
+ = CFDictionaryCreateMutable(NULL, 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+
+ S_ipv6_service_rank_dict
+ = CFDictionaryCreateMutable(NULL, 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+
keys = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
patterns = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
/* register for State: and Setup: per-service notifications */
- for (i = 0; i < ENTITY_TYPES_COUNT; i++) {
- key = state_service_key(kSCCompAnyRegex, entityTypeNames[i]);
- CFArrayAppendValue(patterns, key);
- CFRelease(key);
- key = setup_service_key(kSCCompAnyRegex, entityTypeNames[i]);
- CFArrayAppendValue(patterns, key);
- CFRelease(key);
- }
+ add_service_keys(kSCCompAnyRegex, keys, patterns);
/* add notifier for ServiceOrder/PPPOverridePrimary changes for IPv4 */
- key = SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL,
- kSCDynamicStoreDomainSetup,
- kSCEntNetIPv4);
- CFArrayAppendValue(keys, key);
- CFRelease(key);
+ CFArrayAppendValue(keys, S_setup_global_ipv4);
- /* add notifier for Private DNS configuration */
+ /* add notifier for multicast DNS configuration (Bonjour/.local) */
+ S_multicast_resolvers = SCDynamicStoreKeyCreate(NULL, CFSTR("%@/%@/%@"),
+ kSCDynamicStoreDomainState,
+ kSCCompNetwork,
+ CFSTR(kDNSServiceCompMulticastDNS));
+ CFArrayAppendValue(keys, S_multicast_resolvers);
+
+ /* add notifier for private DNS configuration (Back to My Mac) */
S_private_resolvers = SCDynamicStoreKeyCreate(NULL, CFSTR("%@/%@/%@"),
kSCDynamicStoreDomainState,
kSCCompNetwork,
CFSTR(kDNSServiceCompPrivateDNS));
CFArrayAppendValue(keys, S_private_resolvers);
- if (!SCDynamicStoreSetNotificationKeys(session, keys, patterns)) {
+ if (!SCDynamicStoreSetNotificationKeys(S_session, keys, patterns)) {
SCLog(TRUE, LOG_ERR,
CFSTR("IPMonitor ip_plugin_init "
"SCDynamicStoreSetNotificationKeys failed: %s"),
goto done;
}
- rls = SCDynamicStoreCreateRunLoopSource(NULL, session, 0);
+ rls = SCDynamicStoreCreateRunLoopSource(NULL, S_session, 0);
if (rls == NULL) {
SCLog(TRUE, LOG_ERR,
CFSTR("IPMonitor ip_plugin_init "
CFRelease(rls);
/* initialize dns configuration */
- dns_configuration_set(NULL, NULL, NULL, NULL);
+ dns_configuration_set(NULL, NULL, NULL, NULL, NULL);
+#if !TARGET_OS_IPHONE
empty_dns();
- (void)SCDynamicStoreRemoveValue(session, S_state_global_dns);
+#endif /* !TARGET_OS_IPHONE */
+ (void)SCDynamicStoreRemoveValue(S_session, S_state_global_dns);
+#if !TARGET_OS_IPHONE
/* initialize SMB configuration */
- (void)SCDynamicStoreRemoveValue(session, S_state_global_smb);
+ (void)SCDynamicStoreRemoveValue(S_session, S_state_global_smb);
+#endif /* !TARGET_OS_IPHONE */
done:
my_CFRelease(&keys);
my_CFRelease(&patterns);
- my_CFRelease(&session);
return;
}
prime_IPMonitor()
{
/* initialize multicast route */
- set_ipv4_router(NULL, NULL, NULL, FALSE);
+ update_ipv4(NULL, NULL, NULL);
+ return;
+}
+
+static boolean_t
+S_get_plist_boolean(CFDictionaryRef plist, CFStringRef key,
+ boolean_t def)
+{
+ CFBooleanRef b;
+ boolean_t ret = def;
+
+ b = isA_CFBoolean(CFDictionaryGetValue(plist, key));
+ if (b != NULL) {
+ ret = CFBooleanGetValue(b);
+ }
+ return (ret);
}
__private_extern__
void
load_IPMonitor(CFBundleRef bundle, Boolean bundleVerbose)
{
+ CFDictionaryRef info_dict;
+
+ info_dict = CFBundleGetInfoDictionary(bundle);
+ if (info_dict != NULL) {
+ S_append_state
+ = S_get_plist_boolean(info_dict,
+ CFSTR("AppendStateArrayToSetupArray"),
+ FALSE);
+ }
if (bundleVerbose) {
- S_IPMonitor_debug = 1;
+ S_IPMonitor_debug = kDebugFlagDefault;
}
dns_configuration_init(bundle);
ip_plugin_init();
- load_hostname(S_IPMonitor_debug);
- load_smb_configuration(S_IPMonitor_debug);
+#if !TARGET_OS_IPHONE
+ if (S_session != NULL) {
+ dns_configuration_monitor(S_session, IPMonitorNotify);
+ }
+#endif /* !TARGET_OS_IPHONE */
+
+ load_hostname((S_IPMonitor_debug & kDebugFlag1) != 0);
+#if !TARGET_OS_IPHONE
+ load_smb_configuration((S_IPMonitor_debug & kDebugFlag1) != 0);
+#endif /* !TARGET_OS_IPHONE */
return;
}
-#ifdef MAIN
-#undef MAIN
+#ifdef TEST_IPMONITOR
#include "dns-configuration.c"
#include "set-hostname.c"
main(int argc, char **argv)
{
_sc_log = FALSE;
- _sc_verbose = (argc > 1) ? TRUE : FALSE;
- load_IPMonitor(CFBundleGetMainBundle(), (argc > 1) ? TRUE : FALSE);
+ S_IPMonitor_debug = kDebugFlag1;
+ if (argc > 1) {
+ S_IPMonitor_debug = strtoul(argv[1], NULL, 0);
+ }
+
+ load_IPMonitor(CFBundleGetMainBundle(), FALSE);
prime_IPMonitor();
CFRunLoopRun();
/* not reached */
exit(0);
return 0;
}
-#endif
+#endif /* TEST_IPMONITOR */
+
+#ifdef TEST_IPV4_ROUTELIST
+#include "dns-configuration.c"
+#include "set-hostname.c"
+
+struct ipv4_service_contents {
+ const char * addr;
+ const char * mask;
+ const char * dest;
+ const char * router;
+ const char * ifname;
+ Rank rank;
+ const CFStringRef *primaryRank;
+};
+
+/*
+ * addr mask dest router ifname pri primaryRank
+ */
+struct ipv4_service_contents en0_10 = {
+ "10.0.0.10", "255.255.255.0", NULL, "10.0.0.1", "en0", 10, NULL
+};
+
+struct ipv4_service_contents en0_15 = {
+ "10.0.0.19", "255.255.255.0", NULL, "10.0.0.1", "en0", 15, NULL
+};
+
+struct ipv4_service_contents en0_30 = {
+ "10.0.0.11", "255.255.255.0", NULL, "10.0.0.1", "en0", 30, NULL
+};
+
+struct ipv4_service_contents en0_40 = {
+ "10.0.0.12", "255.255.255.0", NULL, "10.0.0.1", "en0", 40, NULL
+};
+
+struct ipv4_service_contents en0_50 = {
+ "10.0.0.13", "255.255.255.0", NULL, "10.0.0.1", "en0", 50, NULL
+};
+
+struct ipv4_service_contents en0_110 = {
+ "192.168.2.10", "255.255.255.0", NULL, "192.168.2.1", "en0", 110, NULL
+};
+
+struct ipv4_service_contents en0_1 = {
+ "17.202.40.191", "255.255.252.0", NULL, "17.202.20.1", "en0", 1, NULL
+};
+
+struct ipv4_service_contents en1_20 = {
+ "10.0.0.20", "255.255.255.0", NULL, "10.0.0.1", "en1", 20, NULL
+};
+
+struct ipv4_service_contents en1_2 = {
+ "17.202.42.24", "255.255.252.0", NULL, "17.202.20.1", "en1", 2, NULL
+};
+
+struct ipv4_service_contents en1_125 = {
+ "192.168.2.20", "255.255.255.0", NULL, "192.168.2.1", "en1", 125, NULL
+};
+
+struct ipv4_service_contents fw0_25 = {
+ "192.168.2.30", "255.255.255.0", NULL, "192.168.2.1", "fw0", 25, NULL
+};
+
+struct ipv4_service_contents fw0_21 = {
+ "192.168.3.30", "255.255.255.0", NULL, "192.168.3.1", "fw0", 21, NULL
+};
+
+struct ipv4_service_contents ppp0_0_1 = {
+ "17.219.156.22", NULL, "17.219.156.1", "17.219.156.1", "ppp0", 0, NULL
+};
+
+struct ipv4_service_contents en0_test6 = {
+ "17.202.42.113", "255.255.252.0", NULL, "17.202.40.1", "en0", 2, NULL
+};
+struct ipv4_service_contents en1_test6 = {
+ "17.202.42.111", "255.255.252.0", NULL, "17.202.40.1", "en1", 3, NULL
+};
+struct ipv4_service_contents en2_test6 = {
+ "17.255.98.164", "255.255.240.0", NULL, "17.255.96.1", "en2", 1, NULL
+};
+
+struct ipv4_service_contents en0_test7 = {
+ "17.202.42.113", "255.255.252.0", NULL, "17.202.40.1", "en0", 3, NULL
+};
+struct ipv4_service_contents en1_test7 = {
+ "17.202.42.111", "255.255.252.0", NULL, "17.202.40.1", "en1", 2, NULL
+};
+struct ipv4_service_contents en2_test7 = {
+ "17.255.98.164", "255.255.240.0", NULL, "17.255.96.1", "en2", 1, NULL
+};
+struct ipv4_service_contents fw0_test6_and_7 = {
+ "169.254.11.33", "255.255.0.0", NULL, NULL, "fw0", UINT_MAX, NULL
+};
+
+struct ipv4_service_contents en0_10_last = {
+ "10.0.0.10", "255.255.255.0", NULL, "10.0.0.1", "en0", 10, &kSCValNetServicePrimaryRankLast
+};
+
+struct ipv4_service_contents en0_10_never = {
+ "10.0.0.10", "255.255.255.0", NULL, "10.0.0.1", "en0", 10, &kSCValNetServicePrimaryRankNever
+};
+
+struct ipv4_service_contents en1_20_first = {
+ "10.0.0.20", "255.255.255.0", NULL, "10.0.0.1", "en1", 20, &kSCValNetServicePrimaryRankFirst
+};
+
+struct ipv4_service_contents en1_20_never = {
+ "10.0.0.20", "255.255.255.0", NULL, "10.0.0.1", "en1", 20, &kSCValNetServicePrimaryRankNever
+};
+
+struct ipv4_service_contents * test1[] = {
+ &en0_40,
+ &en0_15,
+ &fw0_25,
+ &en0_30,
+ &en1_20,
+ &en0_50,
+ &en0_10,
+ NULL
+};
+
+struct ipv4_service_contents * test2[] = {
+ &en0_40,
+ &fw0_25,
+ &en0_30,
+ &en1_20,
+ &en0_50,
+ &en0_10,
+ NULL
+};
+
+struct ipv4_service_contents * test3[] = {
+ &en0_40,
+ &en1_20,
+ &en0_50,
+ &en0_10,
+ &en0_110,
+ &en1_125,
+ &fw0_25,
+ &fw0_21,
+ &en0_40,
+ &en0_30,
+ NULL
+};
+
+struct ipv4_service_contents * test4[] = {
+ &en0_1,
+ &en0_40,
+ &en0_30,
+ &en1_20,
+ &en1_2,
+ NULL
+};
+
+struct ipv4_service_contents * test5[] = {
+ &ppp0_0_1,
+ &en0_1,
+ &en0_40,
+ &en0_30,
+ &en1_20,
+ &en1_2,
+ NULL
+};
+
+struct ipv4_service_contents * test6[] = {
+ &en0_test6,
+ &en1_test6,
+ &en2_test6,
+ &fw0_test6_and_7,
+ NULL
+};
+
+struct ipv4_service_contents * test7[] = {
+ &en0_test7,
+ &en1_test7,
+ &en2_test7,
+ &fw0_test6_and_7,
+ NULL
+};
+
+struct ipv4_service_contents * test8[] = {
+ &en0_10,
+ &en1_20,
+ NULL
+};
+
+struct ipv4_service_contents * test9[] = {
+ &en0_10,
+ &en1_20_first,
+ &fw0_25,
+ NULL
+};
+
+struct ipv4_service_contents * test10[] = {
+ &en0_10_last,
+ &en1_20,
+ &fw0_25,
+ NULL
+};
+
+struct ipv4_service_contents * test11[] = {
+ &en0_10_never,
+ &en1_20,
+ &fw0_25,
+ NULL
+};
+
+struct ipv4_service_contents * test12[] = {
+ &en0_10,
+ &en1_20,
+ NULL
+};
+
+struct ipv4_service_contents * test13[] = {
+ &en0_10,
+ &en1_20_never,
+ NULL
+};
+
+struct ipv4_service_contents * test14[] = {
+ &en1_20_never,
+ NULL
+};
+
+static void
+dict_add_string(CFMutableDictionaryRef dict, CFStringRef prop_name,
+ const char * str)
+{
+ CFStringRef prop_val;
+
+ if (str == NULL) {
+ return;
+ }
+ prop_val = CFStringCreateWithCString(NULL,
+ str,
+ kCFStringEncodingASCII);
+ CFDictionarySetValue(dict, prop_name, prop_val);
+ CFRelease(prop_val);
+ return;
+}
+
+static void
+dict_add_string_as_array(CFMutableDictionaryRef dict, CFStringRef prop_name,
+ const char * str)
+{
+ CFArrayRef array;
+ CFStringRef prop_val;
+
+ if (str == NULL) {
+ return;
+ }
+ prop_val = CFStringCreateWithCString(NULL,
+ str,
+ kCFStringEncodingASCII);
+ array = CFArrayCreate(NULL,
+ (const void **)&prop_val, 1,
+ &kCFTypeArrayCallBacks);
+ CFRelease(prop_val);
+ CFDictionarySetValue(dict, prop_name, array);
+ CFRelease(array);
+ return;
+}
+
+static CFDictionaryRef
+make_IPv4_dict(struct ipv4_service_contents * t)
+{
+ CFMutableDictionaryRef dict;
+
+ dict = CFDictionaryCreateMutable(NULL, 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ dict_add_string_as_array(dict, kSCPropNetIPv4Addresses, t->addr);
+ dict_add_string_as_array(dict, kSCPropNetIPv4SubnetMasks, t->mask);
+ dict_add_string_as_array(dict, kSCPropNetIPv4DestAddresses, t->dest);
+ dict_add_string(dict, kSCPropNetIPv4Router, t->router);
+ dict_add_string(dict, kSCPropInterfaceName, t->ifname);
+ return (dict);
+}
+
+static IPv4RouteListRef
+make_IPv4RouteList(struct ipv4_service_contents * * this_test)
+{
+ IPv4RouteListRef r;
+ IPv4RouteListRef routes;
+ char routes_buf[IPv4RouteListComputeSize(R_STATIC)];
+ IPv4RouteListRef ret = NULL;
+ struct ipv4_service_contents * * scan_test;
+
+ for (scan_test = this_test; *scan_test != NULL; scan_test++) {
+ CFDictionaryRef dict;
+
+ dict = make_IPv4_dict(*scan_test);
+ if (dict == NULL) {
+ fprintf(stderr, "make_IPv4_dict failed\n");
+ exit(1);
+ }
+ routes = (IPv4RouteListRef)routes_buf;
+ routes->size = R_STATIC;
+ routes->count = 0;
+ r = IPv4RouteListCreateWithDictionary(routes, dict,
+ (*scan_test)->primaryRank ? *(*scan_test)->primaryRank : NULL);
+ if (r == NULL) {
+ fprintf(stderr, "IPv4RouteListCreateWithDictionary failed\n");
+ exit(1);
+ }
+ ret = IPv4RouteListAddRouteList(ret, 1, r, (*scan_test)->rank);
+ if (r != routes) {
+ free(r);
+ }
+ CFRelease(dict);
+ }
+ return (ret);
+}
+
+/*
+ * Function: run_test
+ * Purpose:
+ * Runs through the given set of routes first in the forward direction,
+ * then again backwards. We should end up with exactly the same set of
+ * routes at the end.
+ */
+static boolean_t
+run_test(const char * name, struct ipv4_service_contents * * this_test)
+{
+ CFStringRef descr;
+ boolean_t ret = FALSE;
+ IPv4RouteListRef r;
+ IPv4RouteListRef routes;
+ char routes_buf[IPv4RouteListComputeSize(R_STATIC)];
+ IPv4RouteListRef routes1 = NULL, routes2 = NULL;
+ struct ipv4_service_contents * * scan_test;
+
+ printf("\nStarting test %s\n", name);
+ for (scan_test = this_test; *scan_test != NULL; scan_test++) {
+ CFDictionaryRef dict;
+
+ dict = make_IPv4_dict(*scan_test);
+ if (dict == NULL) {
+ fprintf(stderr, "make_IPv4_dict failed\n");
+ exit(1);
+ }
+ routes = (IPv4RouteListRef)routes_buf;
+ routes->size = R_STATIC;
+ routes->count = 0;
+ r = IPv4RouteListCreateWithDictionary(routes, dict,
+ (*scan_test)->primaryRank ? *(*scan_test)->primaryRank : NULL);
+ if (r == NULL) {
+ fprintf(stderr, "IPv4RouteListCreateWithDictionary failed\n");
+ exit(1);
+ }
+ if ((S_IPMonitor_debug & kDebugFlag4) != 0) {
+ descr = IPv4RouteListCopyDescription(r);
+ SCLog(TRUE, LOG_NOTICE, CFSTR("test: Adding %@"), descr);
+ CFRelease(descr);
+ }
+
+ routes1 = IPv4RouteListAddRouteList(routes1, 1, r, (*scan_test)->rank);
+ if (r != routes) {
+ free(r);
+ }
+ CFRelease(dict);
+ }
+ if ((S_IPMonitor_debug & kDebugFlag4) != 0) {
+ if (routes1 != NULL) {
+ descr = IPv4RouteListCopyDescription(routes1);
+ SCLog(TRUE, LOG_NOTICE, CFSTR("Routes are %@"), descr);
+ CFRelease(descr);
+ }
+ }
+ for (scan_test--; scan_test >= this_test; scan_test--) {
+ CFDictionaryRef dict;
+
+ dict = make_IPv4_dict(*scan_test);
+ if (dict == NULL) {
+ fprintf(stderr, "make_IPv4_dict failed\n");
+ exit(1);
+ }
+ routes = (IPv4RouteListRef)routes_buf;
+ routes->size = R_STATIC;
+ routes->count = 0;
+ r = IPv4RouteListCreateWithDictionary(routes, dict,
+ (*scan_test)->primaryRank ? *(*scan_test)->primaryRank : NULL);
+ if (r == NULL) {
+ fprintf(stderr, "IPv4RouteListCreateWithDictionary failed\n");
+ exit(1);
+ }
+ if ((S_IPMonitor_debug & kDebugFlag4) != 0) {
+ descr = IPv4RouteListCopyDescription(r);
+ SCLog(TRUE, LOG_NOTICE, CFSTR("test: Adding %@"), descr);
+ CFRelease(descr);
+ }
+ routes2 = IPv4RouteListAddRouteList(routes2, 1, r, (*scan_test)->rank);
+ if (r != routes) {
+ free(r);
+ }
+ CFRelease(dict);
+ }
+ if ((S_IPMonitor_debug & kDebugFlag4) != 0) {
+ if (routes2 != NULL) {
+ descr = IPv4RouteListCopyDescription(routes2);
+ SCLog(TRUE, LOG_NOTICE, CFSTR("Routes are %@"), descr);
+ CFRelease(descr);
+ }
+ }
+ if ((routes1 != NULL && routes2 == NULL)
+ || (routes1 == NULL && routes2 != NULL)) {
+ fprintf(stderr, "routes1 is %sNULL but routes2 is %sNULL\n",
+ (routes1 != NULL) ? "not " : "",
+ (routes2 != NULL) ? "not " : "");
+ }
+ else if (routes1 != NULL && routes2 != NULL) {
+ /* check if they are different */
+ if (routes1->count != routes2->count) {
+ fprintf(stderr, "routes1 count %d != routes 2 count %d\n",
+ routes1->count, routes2->count);
+ }
+ else if (bcmp(routes1, routes2,
+ IPv4RouteListComputeSize(routes1->count)) != 0) {
+ fprintf(stderr, "routes1 and routes2 are different\n");
+ }
+ else {
+ printf("routes1 and routes2 are the same\n");
+ ret = TRUE;
+ }
+ }
+ if (routes1 != NULL) {
+ free(routes1);
+ }
+ if (routes2 != NULL) {
+ free(routes2);
+ }
+ return (ret);
+}
+
+typedef struct compare_context {
+ IPv4RouteListRef old;
+ IPv4RouteListRef new;
+} compare_context_t;
+
+static void
+compare_callback(IPv4RouteListApplyCommand cmd, IPv4RouteRef route, void * arg)
+{
+ compare_context_t * context = (compare_context_t *)arg;
+
+ switch (cmd) {
+ case kIPv4RouteListAddRouteCommand:
+ printf("Add new[%d] = ", route - context->new->list);
+ IPv4RoutePrint(route);
+ printf("\n");
+ break;
+ case kIPv4RouteListRemoveRouteCommand:
+ printf("Remove old[%d] = ", route - context->old->list);
+ IPv4RoutePrint(route);
+ printf("\n");
+ break;
+ default:
+ break;
+ }
+ return;
+}
+
+static void
+compare_tests(struct ipv4_service_contents * * old_test,
+ struct ipv4_service_contents * * new_test)
+{
+ IPv4RouteListRef new_routes;
+ IPv4RouteListRef old_routes;
+ compare_context_t context;
+
+ old_routes = make_IPv4RouteList(old_test);
+ new_routes = make_IPv4RouteList(new_test);
+
+ if (old_routes == NULL) {
+ printf("No Old Routes\n");
+ }
+ else {
+ printf("Old Routes = ");
+ IPv4RouteListPrint(old_routes);
+ }
+ if (new_routes == NULL) {
+ printf("No New Routes\n");
+ }
+ else {
+ printf("New Routes = ");
+ IPv4RouteListPrint(new_routes);
+ }
+ context.old = old_routes;
+ context.new = new_routes;
+ IPv4RouteListApply(old_routes, new_routes, compare_callback, &context);
+ if (old_routes != NULL) {
+ free(old_routes);
+ }
+ if (new_routes != NULL) {
+ free(new_routes);
+ }
+
+ return;
+}
+
+int
+main(int argc, char **argv)
+{
+ _sc_log = FALSE;
+ _sc_verbose = (argc > 1) ? TRUE : FALSE;
+
+ S_IPMonitor_debug = kDebugFlag1 | kDebugFlag2 | kDebugFlag4;
+ if (argc > 1) {
+ S_IPMonitor_debug = strtoul(argv[1], NULL, 0);
+ }
+
+ if (run_test("test1", test1) == FALSE) {
+ fprintf(stderr, "test1 failed\n");
+ exit(1);
+ }
+ if (run_test("test2", test2) == FALSE) {
+ fprintf(stderr, "test2 failed\n");
+ exit(1);
+ }
+ if (run_test("test3", test4) == FALSE) {
+ fprintf(stderr, "test3 failed\n");
+ exit(1);
+ }
+ if (run_test("test4", test4) == FALSE) {
+ fprintf(stderr, "test4 failed\n");
+ exit(1);
+ }
+ if (run_test("test5", test5) == FALSE) {
+ fprintf(stderr, "test5 failed\n");
+ exit(1);
+ }
+
+ printf("\nCompare 1 to 2:\n");
+ compare_tests(test1, test2);
+
+ printf("\nCompare 2 to 1:\n");
+ compare_tests(test2, test1);
+
+ printf("\nCompare 1 to 1:\n");
+ compare_tests(test1, test1);
+
+ printf("\nCompare 1 to 3:\n");
+ compare_tests(test1, test3);
+
+ printf("\nCompare 3 to 1:\n");
+ compare_tests(test3, test1);
+
+ printf("\nCompare 2 to 3:\n");
+ compare_tests(test2, test3);
+
+ printf("\nCompare 3 to 2:\n");
+ compare_tests(test3, test2);
+
+ printf("\nCompare 3 to 4:\n");
+ compare_tests(test3, test4);
+
+ printf("\nCompare 5 to 4:\n");
+ compare_tests(test5, test4);
+
+ printf("\nCompare 6 to 7:\n");
+ compare_tests(test6, test7);
+
+ printf("\nCompare 7 to 6:\n");
+ compare_tests(test7, test6);
+
+ printf("\nCompare 8 to 9:\n");
+ compare_tests(test8, test9);
+
+ printf("\nCompare 8 to 10:\n");
+ compare_tests(test8, test10);
+
+ printf("\nCompare 8 to 11:\n");
+ compare_tests(test8, test11);
+
+ printf("\nCompare 12 to 13:\n");
+ compare_tests(test12, test13);
+
+ printf("\nCompare 13 to 14:\n");
+ compare_tests(test13, test14);
+
+ printf("\nChecking for leaks\n");
+ char cmd[128];
+ sprintf(cmd, "leaks %d 2>&1", getpid());
+ fflush(stdout);
+ (void)system(cmd);
+
+ exit(0);
+ return (0);
+}
+
+#endif /* TEST_IPV4_ROUTELIST */
/*
- * Copyright (c) 2004-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2004-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include <notify.h>
-
static SCDynamicStoreRef store = NULL;
static CFRunLoopSourceRef rls = NULL;
static Boolean dnsActive = FALSE;
static CFMachPortRef dnsPort = NULL;
-static CFRunLoopSourceRef dnsRLS = NULL;
static struct timeval dnsQueryStart;
static Boolean _verbose = FALSE;
-/* SPI (from SCNetworkReachability.c) */
-Boolean
-_SC_checkResolverReachabilityByAddress(SCDynamicStoreRef *storeP,
- SCNetworkConnectionFlags *flags,
- Boolean *haveDNS,
- struct sockaddr *sa);
-
-
#define HOSTNAME_NOTIFY_KEY "com.apple.system.hostname"
}
-static void
-getnameinfo_async_handleCFReply(CFMachPortRef port, void *msg, CFIndex size, void *info)
-{
- int32_t status;
-
- status = getnameinfo_async_handle_reply(msg);
- if ((status == 0) && dnsActive) {
- // if request has been re-queued
- return;
- }
-
- if (port == dnsPort) {
- CFRunLoopSourceInvalidate(dnsRLS);
- CFRelease(dnsRLS);
- dnsRLS = NULL;
- CFRelease(dnsPort);
- dnsPort = NULL;
- }
-
- return;
-}
-
-
static CFStringRef
replyMPCopyDescription(const void *info)
{
}
+static void
+getnameinfo_async_handleCFReply(CFMachPortRef port, void *msg, CFIndex size, void *info)
+{
+ mach_port_t mp = MACH_PORT_NULL;
+ int32_t status;
+
+ if (port != dnsPort) {
+ // we've received a callback on the async DNS port but since the
+ // associated CFMachPort doesn't match than the request must have
+ // already been cancelled.
+ SCLog(TRUE, LOG_ERR, CFSTR("getnameinfo_async_handleCFReply(): port != dnsPort"));
+ return;
+ }
+
+ mp = CFMachPortGetPort(port);
+ CFMachPortInvalidate(dnsPort);
+ CFRelease(dnsPort);
+ dnsPort = NULL;
+ __MACH_PORT_DEBUG(mp != NULL, "*** set-hostname (after unscheduling)", mp);
+
+ status = getnameinfo_async_handle_reply(msg);
+ __MACH_PORT_DEBUG(mp != NULL, "*** set-hostname (after getnameinfo_async_handle_reply)", mp);
+ if ((status == 0) && dnsActive && (mp != MACH_PORT_NULL)) {
+ CFMachPortContext context = { 0
+ , (void *)store
+ , CFRetain
+ , CFRelease
+ , replyMPCopyDescription
+ };
+ CFRunLoopSourceRef rls;
+
+ // if request has been re-queued
+ dnsPort = CFMachPortCreateWithPort(NULL,
+ mp,
+ getnameinfo_async_handleCFReply,
+ &context,
+ NULL);
+ rls = CFMachPortCreateRunLoopSource(NULL, dnsPort, 0);
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);
+ CFRelease(rls);
+ __MACH_PORT_DEBUG(mp != NULL, "*** set-hostname (after rescheduling)", mp);
+ }
+
+ return;
+}
+
+
static void
start_dns_query(SCDynamicStoreRef store, CFStringRef address)
{
char addr[64];
- SCNetworkConnectionFlags flags;
+ SCNetworkReachabilityFlags flags;
Boolean haveDNS;
Boolean ok;
struct sockaddr *sa;
ok = _SC_checkResolverReachabilityByAddress(&store, &flags, &haveDNS, sa);
if (ok) {
- if (!(flags & kSCNetworkFlagsReachable) ||
- (flags & kSCNetworkFlagsConnectionRequired)) {
+ if (!(flags & kSCNetworkReachabilityFlagsReachable) ||
+ (flags & kSCNetworkReachabilityFlagsConnectionRequired)) {
// if not reachable *OR* connection required
ok = FALSE;
}
, CFRelease
, replyMPCopyDescription
};
- mach_port_t port;
int32_t error;
+ mach_port_t mp;
+ CFRunLoopSourceRef rls;
(void) gettimeofday(&dnsQueryStart, NULL);
- error = getnameinfo_async_start(&port,
+ error = getnameinfo_async_start(&mp,
sa,
sa->sa_len,
NI_NAMEREQD, // flags
if (error != 0) {
goto done;
}
+ __MACH_PORT_DEBUG(TRUE, "*** set-hostname (after getnameinfo_async_start)", mp);
dnsActive = TRUE;
dnsPort = CFMachPortCreateWithPort(NULL,
- port,
+ mp,
getnameinfo_async_handleCFReply,
&context,
NULL);
- dnsRLS = CFMachPortCreateRunLoopSource(NULL, dnsPort, 0);
- CFRunLoopAddSource(CFRunLoopGetCurrent(), dnsRLS, kCFRunLoopDefaultMode);
+ rls = CFMachPortCreateRunLoopSource(NULL, dnsPort, 0);
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);
+ CFRelease(rls);
+ __MACH_PORT_DEBUG(TRUE, "*** set-hostname (after scheduling)", mp);
}
done :
// if active, cancel any in-progress attempt to resolve the primary IP address
if (dnsPort != NULL) {
+ mach_port_t mp = CFMachPortGetPort(dnsPort);
+
/* cancel the outstanding DNS query */
- getnameinfo_async_cancel(CFMachPortGetPort(dnsPort));
- CFRunLoopSourceInvalidate(dnsRLS);
- CFRelease(dnsRLS);
- dnsRLS = NULL;
+ CFMachPortInvalidate(dnsPort);
CFRelease(dnsPort);
dnsPort = NULL;
+
+ getnameinfo_async_cancel(mp);
}
// get static hostname, if available
/*
- * Copyright (c) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2006-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
+#include <sys/stat.h>
#include <sys/sysctl.h>
#include <sys/time.h>
#include <net/if.h>
#include <SystemConfiguration/SCValidation.h>
#include <SystemConfiguration/SCPrivate.h> // for SCLog(), SCPrint()
-#define SMB_STARTUP_DELAY 60.0
-#define SMB_DEBOUNCE_DELAY 5.0
+#define HW_MODEL_LEN 64 // Note: must be >= NETBIOS_NAME_LEN (below)
-/* SPI (from SCNetworkReachability.c) */
-Boolean
-_SC_checkResolverReachabilityByAddress(SCDynamicStoreRef *storeP,
- SCNetworkConnectionFlags *flags,
- Boolean *haveDNS,
- struct sockaddr *sa);
+#define NETBIOS_NAME_LEN 16
+#define SMB_STARTUP_DELAY 60.0
+#define SMB_DEBOUNCE_DELAY 5.0
static SCDynamicStoreRef store = NULL;
static CFRunLoopSourceRef rls = NULL;
static Boolean dnsActive = FALSE;
static CFMachPortRef dnsPort = NULL;
-static CFRunLoopSourceRef dnsRLS = NULL;
static struct timeval dnsQueryStart;
static CFRunLoopTimerRef timer = NULL;
static Boolean _verbose = FALSE;
+static Boolean
+isMacOSXServer()
+{
+ static enum { Unknown, Client, Server } isServer = Unknown;
+
+ if (isServer == Unknown) {
+ int ret;
+ struct stat statbuf;
+
+ ret = stat("/System/Library/CoreServices/ServerVersion.plist", &statbuf);
+ isServer = (ret == 0) ? Server : Client;
+ }
+
+ return (isServer == Server) ? TRUE : FALSE;
+}
+
+
static CFAbsoluteTime
boottime(void)
{
static CFStringRef
copy_default_name(void)
{
- CFStringRef address;
- SCNetworkInterfaceRef interface;
- CFMutableStringRef name = NULL;
+ char *cp;
+ char hwModel[HW_MODEL_LEN];
+ int mib[] = { CTL_HW, HW_MODEL };
+ size_t n = sizeof(hwModel);
+ int ret;
+ CFMutableStringRef str;
+
+ // get HW model name
+ bzero(&hwModel, sizeof(hwModel));
+ ret = sysctl(mib, sizeof(mib) / sizeof(mib[0]), &hwModel, &n, NULL, 0);
+ if (ret != 0) {
+ SCLog(TRUE, LOG_ERR, CFSTR("sysctl() CTL_HW/HW_MODEL failed: %s"), strerror(errno));
+ return NULL;
+ }
- interface = _SCNetworkInterfaceCreateWithBSDName(NULL, CFSTR("en0"),
- kIncludeNoVirtualInterfaces);
- if (interface == NULL) {
- goto done;
+ // truncate name
+ hwModel[NETBIOS_NAME_LEN - 1] = '\0';
+
+ // trim everything after (and including) a comma
+ cp = index(hwModel, ',');
+ if (cp != NULL) {
+ *cp = '\0';
}
- address = SCNetworkInterfaceGetHardwareAddressString(interface);
- if (address == NULL) {
- goto done;
+ // trim any trailing digits
+ n = strlen(hwModel);
+ while (n > 0) {
+ if (!isdigit(hwModel[n - 1])) {
+ break;
+ }
+ hwModel[--n] = '\0';
}
- name = CFStringCreateMutableCopy(NULL, 0, address);
- CFStringFindAndReplace(name,
- CFSTR(":"),
- CFSTR(""),
- CFRangeMake(0, CFStringGetLength(name)),
- 0);
- CFStringInsert(name, 0, CFSTR("MAC"));
- CFStringUppercase(name, NULL);
+ // start off with the [trunated] HW model
+ str = CFStringCreateMutable(NULL, 0);
+ CFStringAppendFormat(str, NULL, CFSTR("%s"), hwModel);
+
+ //
+ // if there is room for at least one byte (two hex characters)
+ // of the MAC address than append that to the NetBIOS name.
+ //
+ // NETBIOS_NAME_LEN max length
+ // -1 the last byte is reserved
+ // -3 "-XX"
+ //
+ if (n < (NETBIOS_NAME_LEN - 1 - 3)) {
+ SCNetworkInterfaceRef interface;
+
+ interface = _SCNetworkInterfaceCreateWithBSDName(NULL, CFSTR("en0"),
+ kIncludeNoVirtualInterfaces);
+ if (interface != NULL) {
+ CFMutableStringRef en0_MAC;
+
+ en0_MAC = (CFMutableStringRef)SCNetworkInterfaceGetHardwareAddressString(interface);
+ if (en0_MAC != NULL) {
+ CFIndex en0_MAC_len;
+
+ // remove ":" characters from MAC address string
+ en0_MAC = CFStringCreateMutableCopy(NULL, 0, en0_MAC);
+ CFStringFindAndReplace(en0_MAC,
+ CFSTR(":"),
+ CFSTR(""),
+ CFRangeMake(0, CFStringGetLength(en0_MAC)),
+ 0);
+
+ //
+ // compute how may bytes (characters) to append
+ // ... and limit that number to 6
+ //
+ // NETBIOS_NAME_LEN max length
+ // -1 the last byte is reserved
+ // -n "iMac"
+ // -1 "-"
+ //
+ n = ((NETBIOS_NAME_LEN - 1 - n - 1) / 2) * 2;
+ if (n > 6) {
+ n = 6;
+ }
- done :
+ // remove what we don't want
+ en0_MAC_len = CFStringGetLength(en0_MAC);
+ if (en0_MAC_len > n) {
+ CFStringDelete(en0_MAC, CFRangeMake(0, en0_MAC_len - n));
+ }
+
+ // append
+ CFStringAppendFormat(str, NULL, CFSTR("-%@"), en0_MAC);
+ CFRelease(en0_MAC);
+ }
- if (interface != NULL) CFRelease(interface);
- return name;
+ CFRelease(interface);
+ }
+ }
+
+ CFStringUppercase(str, NULL);
+ return str;
}
goto done;
}
- // Server description
- str = SCDynamicStoreCopyComputerName(store, &macEncoding);
- update_pref(prefs, CFSTR(kSMBPrefServerDescription), str, &changed);
-
- // DOS code page
- if (str != NULL) {
- if (macEncoding == kCFStringEncodingMacRoman) {
- CFStringRef key;
- CFDictionaryRef dict;
-
- // get region
- key = SCDynamicStoreKeyCreateComputerName(NULL);
- dict = SCDynamicStoreCopyValue(store, key);
- CFRelease(key);
- if (dict != NULL) {
- if (isA_CFDictionary(dict)) {
- CFNumberRef num;
- SInt32 val;
-
- num = CFDictionaryGetValue(dict, kSCPropSystemComputerNameRegion);
- if (isA_CFNumber(num) &&
- CFNumberGetValue(num, kCFNumberSInt32Type, &val)) {
- macRegion = (uint32_t)val;
+ if (!isMacOSXServer()) {
+ // Server description
+ str = SCDynamicStoreCopyComputerName(store, &macEncoding);
+ update_pref(prefs, CFSTR(kSMBPrefServerDescription), str, &changed);
+
+ // DOS code page
+ if (str != NULL) {
+ if (macEncoding == kCFStringEncodingMacRoman) {
+ CFStringRef key;
+ CFDictionaryRef dict;
+
+ // get region
+ key = SCDynamicStoreKeyCreateComputerName(NULL);
+ dict = SCDynamicStoreCopyValue(store, key);
+ CFRelease(key);
+ if (dict != NULL) {
+ if (isA_CFDictionary(dict)) {
+ CFNumberRef num;
+ SInt32 val;
+
+ num = CFDictionaryGetValue(dict, kSCPropSystemComputerNameRegion);
+ if (isA_CFNumber(num) &&
+ CFNumberGetValue(num, kCFNumberSInt32Type, &val)) {
+ macRegion = (uint32_t)val;
+ }
}
- }
- CFRelease(dict);
+ CFRelease(dict);
+ }
}
- }
+ CFRelease(str);
+ } else {
+ // Important: must have root acccess (eUID==0) to access the config file!
+ __CFStringGetInstallationEncodingAndRegion((uint32_t *)&macEncoding, &macRegion);
+ }
+ _SC_dos_encoding_and_codepage(macEncoding, macRegion, &dosEncoding, &dosCodepage);
+ str = CFStringCreateWithFormat(NULL, NULL, CFSTR("%d"), dosCodepage);
+ update_pref(prefs, CFSTR(kSMBPrefDOSCodePage), str, &changed);
CFRelease(str);
- } else {
- // Important: must have root acccess (eUID==0) to access the config file!
- __CFStringGetInstallationEncodingAndRegion((uint32_t *)&macEncoding, &macRegion);
}
- _SC_dos_encoding_and_codepage(macEncoding, macRegion, &dosEncoding, &dosCodepage);
- str = CFStringCreateWithFormat(NULL, NULL, CFSTR("%d"), dosCodepage);
- update_pref(prefs, CFSTR(kSMBPrefDOSCodePage), str, &changed);
- CFRelease(str);
// NetBIOS name
str = CFDictionaryGetValue(dict, kSCPropNetSMBNetBIOSName);
}
-static void
-getnameinfo_async_handleCFReply(CFMachPortRef port, void *msg, CFIndex size, void *info)
-{
- int32_t status;
-
- status = getnameinfo_async_handle_reply(msg);
- if ((status == 0) && dnsActive) {
- // if request has been re-queued
- return;
- }
-
- if (port == dnsPort) {
- CFRunLoopSourceInvalidate(dnsRLS);
- CFRelease(dnsRLS);
- dnsRLS = NULL;
- CFRelease(dnsPort);
- dnsPort = NULL;
- }
-
- return;
-}
-
-
static CFStringRef
replyMPCopyDescription(const void *info)
{
}
+static void
+getnameinfo_async_handleCFReply(CFMachPortRef port, void *msg, CFIndex size, void *info)
+{
+ mach_port_t mp = MACH_PORT_NULL;
+ int32_t status;
+
+ if (port != dnsPort) {
+ // we've received a callback on the async DNS port but since the
+ // associated CFMachPort doesn't match than the request must have
+ // already been cancelled.
+ SCLog(TRUE, LOG_ERR, CFSTR("getnameinfo_async_handleCFReply(): port != dnsPort"));
+ return;
+ }
+
+ mp = CFMachPortGetPort(port);
+ CFMachPortInvalidate(dnsPort);
+ CFRelease(dnsPort);
+ dnsPort = NULL;
+
+ status = getnameinfo_async_handle_reply(msg);
+ if ((status == 0) && dnsActive && (mp != MACH_PORT_NULL)) {
+ CFMachPortContext context = { 0
+ , (void *)store
+ , CFRetain
+ , CFRelease
+ , replyMPCopyDescription
+ };
+ CFRunLoopSourceRef rls;
+
+ // if request has been re-queued
+ dnsPort = CFMachPortCreateWithPort(NULL,
+ mp,
+ getnameinfo_async_handleCFReply,
+ &context,
+ NULL);
+ rls = CFMachPortCreateRunLoopSource(NULL, dnsPort, 0);
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);
+ CFRelease(rls);
+ }
+
+ return;
+}
+
+
static Boolean
start_dns_query(SCDynamicStoreRef store, CFStringRef address)
{
char addr[64];
- SCNetworkConnectionFlags flags;
+ SCNetworkReachabilityFlags flags;
Boolean haveDNS;
Boolean ok = FALSE;
struct sockaddr *sa;
ok = _SC_checkResolverReachabilityByAddress(&store, &flags, &haveDNS, sa);
if (ok) {
- if (!(flags & kSCNetworkFlagsReachable) ||
- (flags & kSCNetworkFlagsConnectionRequired)) {
+ if (!(flags & kSCNetworkReachabilityFlagsReachable) ||
+ (flags & kSCNetworkReachabilityFlagsConnectionRequired)) {
// if not reachable *OR* connection required
ok = FALSE;
}
, CFRelease
, replyMPCopyDescription
};
- mach_port_t port;
int32_t error;
+ mach_port_t mp;
+ CFRunLoopSourceRef rls;
(void) gettimeofday(&dnsQueryStart, NULL);
- error = getnameinfo_async_start(&port,
+ error = getnameinfo_async_start(&mp,
sa,
sa->sa_len,
NI_NAMEREQD, // flags
dnsActive = TRUE;
dnsPort = CFMachPortCreateWithPort(NULL,
- port,
+ mp,
getnameinfo_async_handleCFReply,
&context,
NULL);
- dnsRLS = CFMachPortCreateRunLoopSource(NULL, dnsPort, 0);
- CFRunLoopAddSource(CFRunLoopGetCurrent(), dnsRLS, kCFRunLoopDefaultMode);
+ rls = CFMachPortCreateRunLoopSource(NULL, dnsPort, 0);
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);
+ CFRelease(rls);
}
done :
// if active, cancel any in-progress attempt to resolve the primary IP address
if (dnsPort != NULL) {
+ mach_port_t mp = CFMachPortGetPort(dnsPort);
+
/* cancel the outstanding DNS query */
- getnameinfo_async_cancel(CFMachPortGetPort(dnsPort));
- CFRunLoopSourceInvalidate(dnsRLS);
- CFRelease(dnsRLS);
- dnsRLS = NULL;
+ CFMachPortInvalidate(dnsPort);
CFRelease(dnsPort);
dnsPort = NULL;
+
+ getnameinfo_async_cancel(mp);
}
// if active, cancel any queued configuration change
done :
- smb_update_configuration(NULL, store);
+ smb_update_configuration(NULL, (void *)store);
CFRelease(store);
--- /dev/null
+#!/bin/sh
+sed '/Process [0-9][0-9]*: [0-9][0-9]* nodes malloced/d; s/^\(Process \)[0-9][0-9]*:\(.*\)/\1XXXX\2/'
--- /dev/null
+
+Starting test test1
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.12
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.12 Ifp en0 Ifa 10.0.0.12
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.19
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.19 Ifp en0 Ifa 10.0.0.19
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30
+ 1. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.11
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.13
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.13 Ifp en0 Ifa 10.0.0.13
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+}
+
+Routes are <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.13
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.13 Ifp en0 Ifa 10.0.0.13
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.11
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30
+ 1. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.19
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.19 Ifp en0 Ifa 10.0.0.19
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.12
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.12 Ifp en0 Ifa 10.0.0.12
+}
+
+Routes are <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+
+routes1 and routes2 are the same
+
+Starting test test2
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.12
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.12 Ifp en0 Ifa 10.0.0.12
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30
+ 1. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.11
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.13
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.13 Ifp en0 Ifa 10.0.0.13
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+}
+
+Routes are <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.13
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.13 Ifp en0 Ifa 10.0.0.13
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.11
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30
+ 1. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.12
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.12 Ifp en0 Ifa 10.0.0.12
+}
+
+Routes are <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+
+routes1 and routes2 are the same
+
+Starting test test3
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en0 Ifa 17.202.40.191 [non-local]
+ 1. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.40.191 Ifp en0 Ifa 17.202.40.191
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.12
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.12 Ifp en0 Ifa 10.0.0.12
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.11
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en1 Ifa 17.202.42.24 [non-local]
+ 1. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.24 Ifp en1 Ifa 17.202.42.24
+}
+
+Routes are <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en0 Ifa 17.202.40.191 [non-local]
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en1 Ifa 17.202.42.24 [non-local] [SCOPED]
+ 2. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11 [SCOPED]
+ 4. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.40.191 Ifp en0 Ifa 17.202.40.191
+ 5. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.24 Ifp en1 Ifa 17.202.42.24 [SCOPED]
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en1 Ifa 17.202.42.24 [non-local]
+ 1. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.24 Ifp en1 Ifa 17.202.42.24
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.11
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.12
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.12 Ifp en0 Ifa 10.0.0.12
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en0 Ifa 17.202.40.191 [non-local]
+ 1. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.40.191 Ifp en0 Ifa 17.202.40.191
+}
+
+Routes are <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en0 Ifa 17.202.40.191 [non-local]
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en1 Ifa 17.202.42.24 [non-local] [SCOPED]
+ 2. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11 [SCOPED]
+ 4. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.40.191 Ifp en0 Ifa 17.202.40.191
+ 5. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.24 Ifp en1 Ifa 17.202.42.24 [SCOPED]
+}
+
+routes1 and routes2 are the same
+
+Starting test test4
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en0 Ifa 17.202.40.191 [non-local]
+ 1. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.40.191 Ifp en0 Ifa 17.202.40.191
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.12
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.12 Ifp en0 Ifa 10.0.0.12
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.11
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en1 Ifa 17.202.42.24 [non-local]
+ 1. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.24 Ifp en1 Ifa 17.202.42.24
+}
+
+Routes are <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en0 Ifa 17.202.40.191 [non-local]
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en1 Ifa 17.202.42.24 [non-local] [SCOPED]
+ 2. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11 [SCOPED]
+ 4. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.40.191 Ifp en0 Ifa 17.202.40.191
+ 5. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.24 Ifp en1 Ifa 17.202.42.24 [SCOPED]
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en1 Ifa 17.202.42.24 [non-local]
+ 1. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.24 Ifp en1 Ifa 17.202.42.24
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.11
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.12
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.12 Ifp en0 Ifa 10.0.0.12
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en0 Ifa 17.202.40.191 [non-local]
+ 1. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.40.191 Ifp en0 Ifa 17.202.40.191
+}
+
+Routes are <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en0 Ifa 17.202.40.191 [non-local]
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en1 Ifa 17.202.42.24 [non-local] [SCOPED]
+ 2. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11 [SCOPED]
+ 4. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.40.191 Ifp en0 Ifa 17.202.40.191
+ 5. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.24 Ifp en1 Ifa 17.202.42.24 [SCOPED]
+}
+
+routes1 and routes2 are the same
+
+Starting test test5
+test: Adding <IPv4RouteList[1]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.219.156.1 Ifp ppp0 Ifa 17.219.156.22
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en0 Ifa 17.202.40.191 [non-local]
+ 1. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.40.191 Ifp en0 Ifa 17.202.40.191
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.12
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.12 Ifp en0 Ifa 10.0.0.12
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.11
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en1 Ifa 17.202.42.24 [non-local]
+ 1. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.24 Ifp en1 Ifa 17.202.42.24
+}
+
+Routes are <IPv4RouteList[7]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.219.156.1 Ifp ppp0 Ifa 17.219.156.22
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en0 Ifa 17.202.40.191 [non-local] [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en1 Ifa 17.202.42.24 [non-local] [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11 [SCOPED]
+ 5. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.40.191 Ifp en0 Ifa 17.202.40.191
+ 6. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.24 Ifp en1 Ifa 17.202.42.24 [SCOPED]
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en1 Ifa 17.202.42.24 [non-local]
+ 1. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.24 Ifp en1 Ifa 17.202.42.24
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.11
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.12
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.12 Ifp en0 Ifa 10.0.0.12
+}
+
+test: Adding <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en0 Ifa 17.202.40.191 [non-local]
+ 1. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.40.191 Ifp en0 Ifa 17.202.40.191
+}
+
+test: Adding <IPv4RouteList[1]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.219.156.1 Ifp ppp0 Ifa 17.219.156.22
+}
+
+Routes are <IPv4RouteList[7]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.219.156.1 Ifp ppp0 Ifa 17.219.156.22
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en0 Ifa 17.202.40.191 [non-local] [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en1 Ifa 17.202.42.24 [non-local] [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11 [SCOPED]
+ 5. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.40.191 Ifp en0 Ifa 17.202.40.191
+ 6. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.24 Ifp en1 Ifa 17.202.42.24 [SCOPED]
+}
+
+routes1 and routes2 are the same
+
+Compare 1 to 2:
+Old Routes = <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+New Routes = <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+
+Compare 2 to 1:
+Old Routes = <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+New Routes = <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+
+Compare 1 to 1:
+Old Routes = <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+New Routes = <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+
+Compare 1 to 3:
+Old Routes = <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+New Routes = <IPv4RouteList[9]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.3.1 Ifp fw0 Ifa 192.168.3.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+ 6. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.10 Ifp en0 Ifa 192.168.2.10 [SCOPED]
+ 7. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.20 Ifp en1 Ifa 192.168.2.20 [SCOPED]
+ 8. Dest 192.168.3.0 Mask 255.255.255.0 Gate 192.168.3.30 Ifp fw0 Ifa 192.168.3.30
+}
+Remove old[2] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+Add new[2] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.3.1 Ifp fw0 Ifa 192.168.3.30 [SCOPED]
+Add new[6] = Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.10 Ifp en0 Ifa 192.168.2.10 [SCOPED]
+Add new[7] = Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.20 Ifp en1 Ifa 192.168.2.20 [SCOPED]
+Add new[8] = Dest 192.168.3.0 Mask 255.255.255.0 Gate 192.168.3.30 Ifp fw0 Ifa 192.168.3.30
+
+Compare 3 to 1:
+Old Routes = <IPv4RouteList[9]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.3.1 Ifp fw0 Ifa 192.168.3.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+ 6. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.10 Ifp en0 Ifa 192.168.2.10 [SCOPED]
+ 7. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.20 Ifp en1 Ifa 192.168.2.20 [SCOPED]
+ 8. Dest 192.168.3.0 Mask 255.255.255.0 Gate 192.168.3.30 Ifp fw0 Ifa 192.168.3.30
+}
+New Routes = <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+Remove old[2] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.3.1 Ifp fw0 Ifa 192.168.3.30 [SCOPED]
+Remove old[6] = Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.10 Ifp en0 Ifa 192.168.2.10 [SCOPED]
+Remove old[7] = Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.20 Ifp en1 Ifa 192.168.2.20 [SCOPED]
+Remove old[8] = Dest 192.168.3.0 Mask 255.255.255.0 Gate 192.168.3.30 Ifp fw0 Ifa 192.168.3.30
+Add new[2] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+
+Compare 2 to 3:
+Old Routes = <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+New Routes = <IPv4RouteList[9]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.3.1 Ifp fw0 Ifa 192.168.3.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+ 6. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.10 Ifp en0 Ifa 192.168.2.10 [SCOPED]
+ 7. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.20 Ifp en1 Ifa 192.168.2.20 [SCOPED]
+ 8. Dest 192.168.3.0 Mask 255.255.255.0 Gate 192.168.3.30 Ifp fw0 Ifa 192.168.3.30
+}
+Remove old[2] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+Add new[2] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.3.1 Ifp fw0 Ifa 192.168.3.30 [SCOPED]
+Add new[6] = Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.10 Ifp en0 Ifa 192.168.2.10 [SCOPED]
+Add new[7] = Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.20 Ifp en1 Ifa 192.168.2.20 [SCOPED]
+Add new[8] = Dest 192.168.3.0 Mask 255.255.255.0 Gate 192.168.3.30 Ifp fw0 Ifa 192.168.3.30
+
+Compare 3 to 2:
+Old Routes = <IPv4RouteList[9]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.3.1 Ifp fw0 Ifa 192.168.3.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+ 6. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.10 Ifp en0 Ifa 192.168.2.10 [SCOPED]
+ 7. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.20 Ifp en1 Ifa 192.168.2.20 [SCOPED]
+ 8. Dest 192.168.3.0 Mask 255.255.255.0 Gate 192.168.3.30 Ifp fw0 Ifa 192.168.3.30
+}
+New Routes = <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+Remove old[2] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.3.1 Ifp fw0 Ifa 192.168.3.30 [SCOPED]
+Remove old[6] = Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.10 Ifp en0 Ifa 192.168.2.10 [SCOPED]
+Remove old[7] = Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.20 Ifp en1 Ifa 192.168.2.20 [SCOPED]
+Remove old[8] = Dest 192.168.3.0 Mask 255.255.255.0 Gate 192.168.3.30 Ifp fw0 Ifa 192.168.3.30
+Add new[2] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+
+Compare 3 to 4:
+Old Routes = <IPv4RouteList[9]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.3.1 Ifp fw0 Ifa 192.168.3.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+ 6. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.10 Ifp en0 Ifa 192.168.2.10 [SCOPED]
+ 7. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.20 Ifp en1 Ifa 192.168.2.20 [SCOPED]
+ 8. Dest 192.168.3.0 Mask 255.255.255.0 Gate 192.168.3.30 Ifp fw0 Ifa 192.168.3.30
+}
+New Routes = <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en0 Ifa 17.202.40.191 [non-local]
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en1 Ifa 17.202.42.24 [non-local] [SCOPED]
+ 2. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11 [SCOPED]
+ 4. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.40.191 Ifp en0 Ifa 17.202.40.191
+ 5. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.24 Ifp en1 Ifa 17.202.42.24 [SCOPED]
+}
+Remove old[0] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+Remove old[1] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+Remove old[2] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.3.1 Ifp fw0 Ifa 192.168.3.30 [SCOPED]
+Remove old[3] = Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+Remove old[4] = Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+Remove old[5] = Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+Remove old[6] = Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.10 Ifp en0 Ifa 192.168.2.10 [SCOPED]
+Remove old[7] = Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.20 Ifp en1 Ifa 192.168.2.20 [SCOPED]
+Remove old[8] = Dest 192.168.3.0 Mask 255.255.255.0 Gate 192.168.3.30 Ifp fw0 Ifa 192.168.3.30
+Add new[0] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en0 Ifa 17.202.40.191 [non-local]
+Add new[1] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en1 Ifa 17.202.42.24 [non-local] [SCOPED]
+Add new[2] = Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+Add new[3] = Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11 [SCOPED]
+Add new[4] = Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.40.191 Ifp en0 Ifa 17.202.40.191
+Add new[5] = Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.24 Ifp en1 Ifa 17.202.42.24 [SCOPED]
+
+Compare 5 to 4:
+Old Routes = <IPv4RouteList[7]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.219.156.1 Ifp ppp0 Ifa 17.219.156.22
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en0 Ifa 17.202.40.191 [non-local] [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en1 Ifa 17.202.42.24 [non-local] [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11 [SCOPED]
+ 5. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.40.191 Ifp en0 Ifa 17.202.40.191
+ 6. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.24 Ifp en1 Ifa 17.202.42.24 [SCOPED]
+}
+New Routes = <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en0 Ifa 17.202.40.191 [non-local]
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en1 Ifa 17.202.42.24 [non-local] [SCOPED]
+ 2. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.11 Ifp en0 Ifa 10.0.0.11 [SCOPED]
+ 4. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.40.191 Ifp en0 Ifa 17.202.40.191
+ 5. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.24 Ifp en1 Ifa 17.202.42.24 [SCOPED]
+}
+Remove old[0] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.219.156.1 Ifp ppp0 Ifa 17.219.156.22
+Remove old[1] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en0 Ifa 17.202.40.191 [non-local] [SCOPED]
+Add new[0] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.20.1 Ifp en0 Ifa 17.202.40.191 [non-local]
+
+Compare 6 to 7:
+Old Routes = <IPv4RouteList[7]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.255.96.1 Ifp en2 Ifa 17.255.98.164
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.40.1 Ifp en0 Ifa 17.202.42.113 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.40.1 Ifp en1 Ifa 17.202.42.111 [SCOPED]
+ 3. Dest 0.0.0.0 Mask 0.0.0.0 Gate 169.254.11.33 Ifp fw0 Ifa 169.254.11.33 [direct] [last] [SCOPED]
+ 4. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.113 Ifp en0 Ifa 17.202.42.113
+ 5. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.111 Ifp en1 Ifa 17.202.42.111 [SCOPED]
+ 6. Dest 17.255.96.0 Mask 255.255.240.0 Gate 17.255.98.164 Ifp en2 Ifa 17.255.98.164
+}
+New Routes = <IPv4RouteList[7]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.255.96.1 Ifp en2 Ifa 17.255.98.164
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.40.1 Ifp en1 Ifa 17.202.42.111 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.40.1 Ifp en0 Ifa 17.202.42.113 [SCOPED]
+ 3. Dest 0.0.0.0 Mask 0.0.0.0 Gate 169.254.11.33 Ifp fw0 Ifa 169.254.11.33 [direct] [last] [SCOPED]
+ 4. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.111 Ifp en1 Ifa 17.202.42.111
+ 5. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.113 Ifp en0 Ifa 17.202.42.113 [SCOPED]
+ 6. Dest 17.255.96.0 Mask 255.255.240.0 Gate 17.255.98.164 Ifp en2 Ifa 17.255.98.164
+}
+Remove old[4] = Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.113 Ifp en0 Ifa 17.202.42.113
+Remove old[5] = Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.111 Ifp en1 Ifa 17.202.42.111 [SCOPED]
+Add new[4] = Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.111 Ifp en1 Ifa 17.202.42.111
+Add new[5] = Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.113 Ifp en0 Ifa 17.202.42.113 [SCOPED]
+
+Compare 7 to 6:
+Old Routes = <IPv4RouteList[7]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.255.96.1 Ifp en2 Ifa 17.255.98.164
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.40.1 Ifp en1 Ifa 17.202.42.111 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.40.1 Ifp en0 Ifa 17.202.42.113 [SCOPED]
+ 3. Dest 0.0.0.0 Mask 0.0.0.0 Gate 169.254.11.33 Ifp fw0 Ifa 169.254.11.33 [direct] [last] [SCOPED]
+ 4. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.111 Ifp en1 Ifa 17.202.42.111
+ 5. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.113 Ifp en0 Ifa 17.202.42.113 [SCOPED]
+ 6. Dest 17.255.96.0 Mask 255.255.240.0 Gate 17.255.98.164 Ifp en2 Ifa 17.255.98.164
+}
+New Routes = <IPv4RouteList[7]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.255.96.1 Ifp en2 Ifa 17.255.98.164
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.40.1 Ifp en0 Ifa 17.202.42.113 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 17.202.40.1 Ifp en1 Ifa 17.202.42.111 [SCOPED]
+ 3. Dest 0.0.0.0 Mask 0.0.0.0 Gate 169.254.11.33 Ifp fw0 Ifa 169.254.11.33 [direct] [last] [SCOPED]
+ 4. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.113 Ifp en0 Ifa 17.202.42.113
+ 5. Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.111 Ifp en1 Ifa 17.202.42.111 [SCOPED]
+ 6. Dest 17.255.96.0 Mask 255.255.240.0 Gate 17.255.98.164 Ifp en2 Ifa 17.255.98.164
+}
+Remove old[4] = Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.111 Ifp en1 Ifa 17.202.42.111
+Remove old[5] = Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.113 Ifp en0 Ifa 17.202.42.113 [SCOPED]
+Add new[4] = Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.113 Ifp en0 Ifa 17.202.42.113
+Add new[5] = Dest 17.202.40.0 Mask 255.255.252.0 Gate 17.202.42.111 Ifp en1 Ifa 17.202.42.111 [SCOPED]
+
+Compare 8 to 9:
+Old Routes = <IPv4RouteList[4]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+}
+New Routes = <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [first]
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [first]
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10 [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+Remove old[0] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+Remove old[1] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+Remove old[2] = Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+Remove old[3] = Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+Add new[0] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [first]
+Add new[1] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10 [SCOPED]
+Add new[2] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+Add new[3] = Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [first]
+Add new[4] = Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10 [SCOPED]
+Add new[5] = Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+
+Compare 8 to 10:
+Old Routes = <IPv4RouteList[4]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+}
+New Routes = <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10 [last] [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10 [last] [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+Remove old[0] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+Remove old[1] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+Remove old[2] = Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+Remove old[3] = Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+Add new[0] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20
+Add new[1] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+Add new[2] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10 [last] [SCOPED]
+Add new[3] = Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+Add new[4] = Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10 [last] [SCOPED]
+Add new[5] = Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+
+Compare 8 to 11:
+Old Routes = <IPv4RouteList[4]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+}
+New Routes = <IPv4RouteList[6]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+ 2. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10 [never] [SCOPED]
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+ 4. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10 [never] [SCOPED]
+ 5. Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+}
+Remove old[0] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+Remove old[1] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+Remove old[2] = Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+Remove old[3] = Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+Add new[0] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20
+Add new[1] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 192.168.2.1 Ifp fw0 Ifa 192.168.2.30 [SCOPED]
+Add new[2] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10 [never] [SCOPED]
+Add new[3] = Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20
+Add new[4] = Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10 [never] [SCOPED]
+Add new[5] = Dest 192.168.2.0 Mask 255.255.255.0 Gate 192.168.2.30 Ifp fw0 Ifa 192.168.2.30
+
+Compare 12 to 13:
+Old Routes = <IPv4RouteList[4]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+ 2. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [SCOPED]
+}
+New Routes = <IPv4RouteList[4]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [never] [SCOPED]
+ 2. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [never] [SCOPED]
+}
+
+Compare 13 to 14:
+Old Routes = <IPv4RouteList[4]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+ 1. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [never] [SCOPED]
+ 2. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+ 3. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [never] [SCOPED]
+}
+New Routes = <IPv4RouteList[2]> = {
+ 0. Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en1 Ifa 10.0.0.20 [never] [SCOPED*]
+ 1. Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.20 Ifp en1 Ifa 10.0.0.20 [never] [SCOPED*]
+}
+Remove old[0] = Dest 0.0.0.0 Mask 0.0.0.0 Gate 10.0.0.1 Ifp en0 Ifa 10.0.0.10
+Remove old[2] = Dest 10.0.0.0 Mask 255.255.255.0 Gate 10.0.0.10 Ifp en0 Ifa 10.0.0.10
+
+Checking for leaks
+Process XXXX 0 leaks for 0 total leaked bytes.
--- /dev/null
+#!/bin/sh
+
+tmpfile=/tmp/test_reference_output$$.txt
+
+cleanup()
+{
+ if [ -f "${tmpfile}" ]; then
+ echo removing "${tmpfile}"
+ rm -f "${tmpfile}"
+ fi
+ exit 1
+}
+
+trap cleanup 1 2 3 15
+
+run_program()
+{
+ program="${1}"
+ filter="${2}"
+ if [ "${filter}" = "" ]; then
+ ${program}
+ else
+ ${program} | ${filter}
+ fi
+}
+
+usage()
+{
+ echo "usage: $0 ( create | test ) <program> <reference_file> [ <filter> ]"
+ exit 1
+}
+
+command="${1}"
+program="${2}"
+ref_file="${3}"
+filter="${4}"
+
+if [ "${ref_file}" = "" ]; then
+ usage "${0}"
+fi
+
+if [ "${program}" = "" ]; then
+ usage "${0}"
+fi
+
+if [ ! -f "${program}" ]; then
+ echo "program '${program}' doesn't exit"
+ exit 1
+fi
+if [ ! -x "${program}" ]; then
+ program="sh ${program}"
+fi
+# echo "The program is ${program}"
+
+if [ ! "${filter}" = "" ]; then
+ if [ ! -f "${filter}" ]; then
+ echo "filter '${filter}' doesn't exit"
+ exit 1
+ fi
+ if [ ! -x "${filter}" ]; then
+ filter="sh ${filter}"
+ fi
+# echo "The filter is ${filter}"
+else
+ echo no filter
+fi
+
+if [ "${command}" = "create" ]; then
+ run_program "${program}" "${filter}" > "${ref_file}"
+elif [ "${command}" = "test" ]; then
+ if [ ! -f "${ref_file}" ]; then
+ echo "reference file '${ref_file}' doesn't exist"
+ exit 1
+ fi
+ run_program "${program}" "${filter}" > "${tmpfile}"
+ cmp "${tmpfile}" "${ref_file}"
+ if [ ! $? -eq 0 ]; then
+ echo FAILURE
+ diff "${tmpfile}" "${ref_file}"
+ exit 1
+ fi
+ echo SUCCESS
+else
+ usage "${0}"
+fi
+
+exit 0
\ No newline at end of file
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key>Builtin</key>
+ <true/>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
- <string>SystemConfiguration</string>
+ <string>com.apple.SystemConfiguration.InterfaceNamer</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
- <string>1.9.2</string>
+ <string>1.10</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>1.9.2</string>
- <key>Builtin</key>
- <true/>
+ <string>1.10</string>
</dict>
</plist>
/*
- * Copyright (c) 2001-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2001-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*/
static CFRunLoopTimerRef S_timer = NULL;
+#if !TARGET_OS_IPHONE
/*
* Virtual network interface configuration
* S_prefs : SCPreferences to configuration
static SCPreferencesRef S_prefs = NULL;
static CFArrayRef S_bonds = NULL;
static CFArrayRef S_vlans = NULL;
+#endif /* !TARGET_OS_IPHONE */
static void
addTimestamp(CFMutableDictionaryRef dict, CFStringRef key)
return;
}
+#if !TARGET_OS_IPHONE
static void
updateVirtualNetworkInterfaceConfiguration(SCPreferencesRef prefs,
SCPreferencesNotification notificationType,
SCPreferencesSynchronize(prefs);
return;
}
+#endif /* !TARGET_OS_IPHONE */
static CFDictionaryRef
createInterfaceDict(SCNetworkInterfaceRef interface)
dict = CFArrayGetValueAtIndex(db_list, i);
if_type = CFDictionaryGetValue(dict, CFSTR(kSCNetworkInterfaceType));
- if ((if_type != NULL) &&
- CFEqual(if_type, kSCNetworkInterfaceTypeIEEE80211)) {
- if (where)
- *where = i;
- return (dict);
+ if (if_type != NULL) {
+ if (CFEqual(if_type, kSCNetworkInterfaceTypeIEEE80211)) {
+ if (where)
+ *where = i;
+ return (dict);
+ }
+ } else {
+ CFStringRef path;
+
+ path = CFDictionaryGetValue(dict, CFSTR(kIOPathMatchKey));
+ if ((CFStringFind(path, CFSTR("IO80211Interface") , 0).location != kCFNotFound) ||
+ (CFStringFind(path, CFSTR("AirPort") , 0).location != kCFNotFound) ||
+ (CFStringFind(path, CFSTR("AppleWireless80211"), 0).location != kCFNotFound)) {
+ if (where)
+ *where = i;
+ return (dict);
+ }
}
}
return (NULL);
* in the HW config (or have yet to show up).
*/
writeInterfaceList(S_dblist);
+#if !TARGET_OS_IPHONE
updateVirtualNetworkInterfaceConfiguration(NULL, kSCPreferencesNotificationApply, NULL);
+#endif /* !TARGET_OS_IPHONE */
updateStore();
if (S_iflist != NULL) {
return res;
}
+#ifndef kIOPlatformUUIDKey
+#define kIOPlatformUUIDKey "IOPlatformUUID"
+#endif
static void
updatePlatformUUID()
{
SCLog(TRUE, LOG_ERR,
CFSTR(MY_PLUGIN_NAME ": reportBusy IORegistryEntryGetLocationInPlane returned 0x%x"),
kr);
+ CFRelease(str);
goto next;
- break;
}
CFArrayAppendValue(newNodes, str);
quietCallback((void *)S_notify,
MACH_PORT_NULL,
kIOMessageServiceBusyStateChange,
- (void *)busy);
+ (void *)(uintptr_t)busy);
CFRunLoopAddSource(CFRunLoopGetCurrent(),
IONotificationPortGetRunLoopSource(S_notify),
return ok;
}
+#if !TARGET_OS_IPHONE
static Boolean
setup_Virtual(CFBundleRef bundle)
{
// schedule
if (!SCPreferencesScheduleWithRunLoop(S_prefs, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)) {
- SCLog(TRUE, LOG_ERR,
- CFSTR(MY_PLUGIN_NAME ": SCPreferencesScheduleWithRunLoop() failed: %s"),
- SCErrorString(SCError()));
- CFRelease(S_prefs);
- return FALSE;
+ if (SCError() != kSCStatusNoStoreServer) {
+ SCLog(TRUE, LOG_ERR,
+ CFSTR(MY_PLUGIN_NAME ": SCPreferencesScheduleWithRunLoop() failed: %s"),
+ SCErrorString(SCError()));
+ CFRelease(S_prefs);
+ return FALSE;
+ }
}
return TRUE;
}
+#endif /* !TARGET_OS_IPHONE */
__private_extern__
void
S_debug = TRUE;
}
+#if !TARGET_OS_IPHONE
// setup virtual network interface monitoring
if (!setup_Virtual(bundle)) {
goto error;
}
+#endif /* !TARGET_OS_IPHONE */
// setup [IOKit] network interface monitoring
if (!setup_IOKit(bundle)) {
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
- <string>SystemConfiguration</string>
+ <string>com.apple.SystemConfiguration.KernelEventMonitor</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
- <string>1.9.2</string>
+ <string>1.10</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>1.9.2</string>
+ <string>1.10</string>
<key>Requires</key>
<array>
<string>com.apple.SystemConfiguration.InterfaceNamer</string>
/*
- * Copyright (c) 2002-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2002-2006, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
{
CFStringRef key = NULL;
CFMutableDictionaryRef newDict = NULL;
- CFBooleanRef state = NULL;
key = create_interface_key(if_name);
newDict = copy_entity(key);
- state = isA_CFBoolean(CFDictionaryGetValue(newDict,
- kSCPropNetLinkActive));
/* if new status available, update cache */
if (active == NULL) {
CFDictionaryRemoveValue(newDict, kSCPropNetLinkActive);
/*
- * Copyright (c) 2002-2005, 2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2002-2005, 2007, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include "cache.h"
#include "ev_ipv4.h"
-#ifndef kSCEntNetIPv4ARPCollision
-#define kSCEntNetIPv4ARPCollision CFSTR("IPv4ARPCollision")
-#endif /* kSCEntNetIPv4ARPCollision */
+#ifndef kSCEntNetIPv4ARPCollision
+#define kSCEntNetIPv4ARPCollision CFSTR("IPv4ARPCollision")
+#endif /* kSCEntNetIPv4ARPCollision */
-#ifndef kSCEntNetIPv4PortInUse
-#define kSCEntNetIPv4PortInUse CFSTR("PortInUse")
-#endif /* kSCEntNetIPv4PortInUse */
+#if !TARGET_OS_IPHONE
+#ifndef kSCEntNetIPv4PortInUse
+#define kSCEntNetIPv4PortInUse CFSTR("PortInUse")
+#endif /* kSCEntNetIPv4PortInUse */
+#endif /* !TARGET_OS_IPHONE */
#define IP_FORMAT "%d.%d.%d.%d"
#define IP_CH(ip, i) (((u_char *)(ip))[i])
return;
}
+#if !TARGET_OS_IPHONE
__private_extern__
void
port_in_use_ipv4(uint16_t port, pid_t req_pid)
CFRelease(key);
return;
}
+#endif /* !TARGET_OS_IPHONE */
/*
- * Copyright (c) 2002-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2002-2005, 2007, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#ifndef _EV_IPV4_H
#define _EV_IPV4_H
+#include <TargetConditionals.h>
#include <netinet/in_var.h>
__BEGIN_DECLS
void interface_collision_ipv4(const char *if_name,
struct in_addr ip_addr,
int hw_len, const void * hw_addr);
+#if !TARGET_OS_IPHONE
void port_in_use_ipv4(uint16_t port, pid_t req_pid);
+#endif /* !TARGET_OS_IPHONE */
+
__END_DECLS
#endif /* _EV_IPV4_H */
/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include "ev_dlil.h"
#include "ev_ipv4.h"
#include "ev_ipv6.h"
-#include "ev_appletalk.h"
-
#include <notify.h>
+#if !TARGET_OS_IPHONE && INCLUDE_APPLETALK
+#include "ev_appletalk.h"
+#endif /* !TARGET_OS_IPHONE && INCLUDE_APPLETALK */
+
static const char *inetEventName[] = {
"",
"INET address added",
"KEV_DL_PROTO_DETACHED",
};
+#if !TARGET_OS_IPHONE && INCLUDE_APPLETALK
static const char *atalkEventName[] = {
"",
"KEV_ATALK_ENABLED",
"KEV_ATALK_ROUTERDOWN",
"KEV_ATALK_ZONELISTCHANGED"
};
+#endif /* !TARGET_OS_IPHONE && INCLUDE_APPLETALK */
static const char *inet6EventName[] = {
"",
"KEV_INET6_DEFROUTER"
};
-
__private_extern__ Boolean network_changed = FALSE;
__private_extern__ SCDynamicStoreRef store = NULL;
__private_extern__ Boolean _verbose = FALSE;
-
__private_extern__
int
dgram_socket(int domain)
return ("New Apple network DL subcode");
}
+#if !TARGET_OS_IPHONE && INCLUDE_APPLETALK
static const char *
atalkEventNameString(uint32_t event_code)
{
}
return ("New Apple network AppleTalk subcode");
}
-
+#endif /* !TARGET_OS_IPHONE && INCLUDE_APPLETALK */
static void
copy_if_name(struct net_event_data * ev, char * ifr_name, int ifr_len)
ev->hw_addr);
break;
}
+#if !TARGET_OS_IPHONE
case KEV_INET_PORTINUSE : {
struct kev_in_portinuse * ev;
ev = (struct kev_in_portinuse *)event_data;
port_in_use_ipv4(ev->port, ev->req_pid);
break;
}
+#endif /* !TARGET_OS_IPHONE */
default :
handled = FALSE;
break;
}
break;
}
+#if !TARGET_OS_IPHONE && INCLUDE_APPLETALK
case KEV_ATALK_SUBCLASS: {
struct kev_atalk_data * ev;
}
break;
}
+#endif /* !TARGET_OS_IPHONE && INCLUDE_APPLETALK */
default :
handled = FALSE;
break;
return;
}
-
static void
processEvent_Apple_IOKit(struct kern_event_msg *ev_msg)
{
return;
}
+static void
+processEvent_Apple_System(struct kern_event_msg *ev_msg)
+{
+ switch (ev_msg->kev_subclass) {
+ default :
+ logEvent(CFSTR("New Apple System subclass"), ev_msg);
+ break;
+ }
+
+ return;
+}
static void
eventCallback(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void *data, void *info)
case KEV_IOKIT_CLASS :
processEvent_Apple_IOKit(ev_msg);
break;
+ case KEV_SYSTEM_CLASS :
+ processEvent_Apple_System(ev_msg);
+ break;
default :
/* unrecognized (Apple) event class */
logEvent(CFSTR("New (Apple) class"), ev_msg);
}
-
__private_extern__
void
prime_KernelEventMonitor()
*/
interface_update_ipv6(ifap, NULL);
+#if !TARGET_OS_IPHONE && INCLUDE_APPLETALK
/*
* update AppleTalk network addresses already assigned
* to the interfaces.
*/
interface_update_appletalk(ifap, NULL);
+#endif /* !TARGET_OS_IPHONE && INCLUDE_APPLETALK */
freeifaddrs(ifap);
return;
}
-
static CFStringRef
kevSocketCopyDescription(const void *info)
{
return CFStringCreateWithFormat(NULL, NULL, CFSTR("<kernel event socket>"));
}
-
__private_extern__
void
load_KernelEventMonitor(CFBundleRef bundle, Boolean bundleVerbose)
{
- int so;
- int status;
- struct kev_request kev_req;
- CFSocketRef es;
CFSocketContext context = { 0
, (void *)1
, NULL
, NULL
, kevSocketCopyDescription
};
+ CFSocketRef es;
+ struct kev_request kev_req;
CFRunLoopSourceRef rls;
+ int so;
+ int status;
if (bundleVerbose) {
_verbose = TRUE;
}
/* Create a CFSocketRef for the PF_SYSTEM kernel event socket */
- es = CFSocketCreateWithNative(NULL,
- so,
- kCFSocketReadCallBack,
- eventCallback,
- &context);
+ es = CFSocketCreateWithNative(NULL,
+ so,
+ kCFSocketReadCallBack,
+ eventCallback,
+ &context);
/* Create and add a run loop source for the event socket */
rls = CFSocketCreateRunLoopSource(NULL, es, 0);
#undef getIF
#undef updateStore
+#if !TARGET_OS_IPHONE && INCLUDE_APPLETALK
#define getIF getIF_at
#define updateStore updateStore_at
#include "ev_appletalk.c"
#undef getIF
#undef updateStore
+#endif /* !TARGET_OS_IPHONE && INCLUDE_APPLETALK */
int
main(int argc, char **argv)
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
- <string>SystemConfiguration</string>
+ <string>com.apple.SystemConfiguration.Kicker</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
- <string>1.9.2</string>
+ <string>1.10</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>1.9.2</string>
+ <string>1.10</string>
<key>Requires</key>
<array>
<string>com.apple.SystemConfiguration.ATconfig</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
- <string>SystemConfiguration</string>
+ <string>com.apple.SystemConfiguration.LinkConfiguration</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
- <string>1.9.2</string>
+ <string>1.10</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>1.9.2</string>
+ <string>1.10</string>
<key>Requires</key>
<array>
<string>com.apple.SystemConfiguration.InterfaceNamer</string>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>Logger</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.SystemConfiguration.Logger</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>com.apple.SystemConfiguration.Logger</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.10</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.10</string>
+ <key>Enabled</key>
+ <true/>
+ <key>Verbose</key>
+ <false/>
+ <key>LOG_ALL</key>
+ <false/>
+ <key>LOG_IO_SYSTEMPOWER_EVENTS</key>
+ <true/>
+ <key>LOG_NETWORK_KERNEL_EVENTS</key>
+ <false/>
+ <key>LOG_NOTIFY_DNS_CONFIGURATION</key>
+ <true/>
+ <key>LOG_NOTIFY_NETWORK_CHANGE</key>
+ <false/>
+ <key>LOG_SC_NETWORKCHANGE</key>
+ <true/>
+ <key>LOG_SC_PRIMARYSERVICE</key>
+ <true/>
+ <key>LOG_SC_REACHABILITY</key>
+ <false/>
+ <key>LOG_SC_REACHABILITY_HOSTS</key>
+ <array>
+ <string>mail.me.com</string>
+ </array>
+</dict>
+</plist>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>Logger</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.SystemConfiguration.Logger</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>com.apple.SystemConfiguration.Logger</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.10</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.10</string>
+ <key>Enabled</key>
+ <false/>
+ <key>Verbose</key>
+ <false/>
+ <key>LOG_ALL</key>
+ <false/>
+ <key>LOG_IO_SYSTEMPOWER_EVENTS</key>
+ <true/>
+ <key>LOG_IO_WAKEUUID_EVENTS</key>
+ <false/>
+ <key>LOG_NETWORK_KERNEL_EVENTS</key>
+ <true/>
+ <key>LOG_NOTIFY_DNS_CONFIGURATION</key>
+ <true/>
+ <key>LOG_NOTIFY_NETWORK_CHANGE</key>
+ <true/>
+ <key>LOG_NOTIFY_SMB_CONFIGURATION</key>
+ <true/>
+ <key>LOG_NOTIFY_UTMPX_CHANGE</key>
+ <false/>
+ <key>LOG_SC_BTMM_CONFIGURATION</key>
+ <true/>
+ <key>LOG_SC_CONSOLEUSER</key>
+ <true/>
+ <key>LOG_SC_DIRECTORYSERVICES_SEARCHPOLICY</key>
+ <true/>
+ <key>LOG_SC_NETWORKCHANGE</key>
+ <false/>
+ <key>LOG_SC_PRIMARYSERVICE</key>
+ <true/>
+ <key>LOG_SC_REACHABILITY</key>
+ <false/>
+ <key>LOG_SC_REACHABILITY_HOSTS</key>
+ <array>
+ <string>mail.me.com</string>
+ </array>
+</dict>
+</plist>
--- /dev/null
+logger: logger.c
+ cc -Wall -g -DMAIN -o logger logger.c -framework CoreFoundation -framework SystemConfiguration -framework IOKit -ldnsinfo
+
+clean:
+ rm -rf logger logger.dSYM
+
--- /dev/null
+/*
+ * Copyright (c) 2005-2009 Apple Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+
+/*
+ * Modification History
+ *
+ * January 15, 2005 Allan Nathanson <ajn@apple.com>
+ * - initial revision
+ */
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/filio.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_media.h>
+#include <net/if_types.h>
+#include <net/if_var.h>
+#include <sys/kern_event.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet6/in6_var.h>
+#include <ifaddrs.h>
+#include <arpa/inet.h>
+
+#include <TargetConditionals.h>
+#include <CoreFoundation/CoreFoundation.h>
+#include <SystemConfiguration/SystemConfiguration.h>
+#include <SystemConfiguration/SCPrivate.h>
+#include <IOKit/IOKitLib.h>
+#include <IOKit/IOMessage.h>
+#include <IOKit/pwr_mgt/IOPM.h>
+#include <IOKit/pwr_mgt/IOPMLib.h>
+
+#include <dnsinfo.h>
+#include <notify.h>
+#include <utmpx.h>
+
+
+/* generic MessageTracer keys */
+#define MSGTRACER_KEY_DOMAIN "com.apple.message.domain"
+#define MSGTRACER_KEY_SIG "com.apple.message.signature"
+#define MSGTRACER_KEY_UUID "com.apple.message.uuid"
+#define MSGTRACER_KEY_VALUE1 "com.apple.message.value"
+
+
+#define MY_ASL_FACILITY "com.apple.SystemConfiguration.Logger"
+#define MY_MSGTRACER_DOMAIN "com.apple.network.log"
+
+
+static aslmsg log_msg = NULL;
+static io_connect_t power = MACH_PORT_NULL;
+static Boolean verbose = FALSE;
+
+
+static char *
+elapsed()
+{
+ static char str[128];
+ struct tm tm_diff;
+ struct tm tm_now;
+ struct timeval tv_diff;
+ struct timeval tv_now;
+ static struct timeval tv_then = { 0, 0 };
+
+ (void)gettimeofday(&tv_now, NULL);
+
+ (void)localtime_r(&tv_now.tv_sec, &tm_now);
+
+ timersub(&tv_now, &tv_then, &tv_diff);
+ (void)localtime_r(&tv_diff.tv_sec, &tm_diff);
+#ifdef MAIN
+ sprintf(str, "%2d:%02d:%02d.%03d (+%ld.%03d)",
+ tm_now.tm_hour,
+ tm_now.tm_min,
+ tm_now.tm_sec,
+ tv_now.tv_usec / 1000,
+ tv_diff.tv_sec,
+ tv_diff.tv_usec / 1000);
+#else
+ sprintf(str, ".%03d (+%ld.%03d)",
+ tv_now.tv_usec / 1000,
+ tv_diff.tv_sec,
+ tv_diff.tv_usec / 1000);
+#endif
+
+ tv_then = tv_now;
+ return str;
+}
+
+
+#pragma mark -
+#pragma mark [Network] Kernel Events
+
+
+static CFStringRef
+copyInterfaceFlags(const char *if_name)
+{
+ const char * iff_up = "? ";
+ struct ifreq ifr;
+ const char *ifm_active = "? ";
+ int sock;
+ CFStringRef str = NULL;
+
+ sock = socket(AF_INET, SOCK_DGRAM, 0);
+ if (sock == -1) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("socket() failed"));
+ return NULL;
+ }
+
+ bzero((char *)&ifr, sizeof(ifr));
+ (void) strncpy(ifr.ifr_name, if_name, sizeof(ifr.ifr_name));
+ if (ioctl(sock, SIOCGIFFLAGS, (caddr_t)&ifr) == 0) {
+ struct ifmediareq ifm;
+
+ iff_up = (ifr.ifr_flags & IFF_UP) ? "yes" : "no ";
+
+ bzero((char *)&ifm, sizeof(ifm));
+ (void) strncpy(ifm.ifm_name, if_name, sizeof(ifm.ifm_name));
+ if ((ioctl(sock, SIOCGIFMEDIA, (caddr_t)&ifm) == 0) &&
+ (ifm.ifm_count > 0) &&
+ (ifm.ifm_status & IFM_AVALID)) {
+ ifm_active = (ifm.ifm_status & IFM_ACTIVE) ? "yes" : "no ";
+ }
+
+ str = CFStringCreateWithFormat(NULL,
+ NULL,
+ CFSTR("\n%-5s: IFF_UP = %s IFM_ACTIVE = %s"),
+ if_name,
+ iff_up,
+ ifm_active);
+ }
+
+ (void)close(sock);
+
+ return str;
+}
+
+
+static int
+prefixLength(struct sockaddr_in6 *sin6)
+{
+ register u_int8_t *name = &sin6->sin6_addr.s6_addr[0];
+ register int byte;
+ register int bit;
+ int plen = 0;
+
+ for (byte = 0; byte < sizeof(struct in6_addr); byte++, plen += 8) {
+ if (name[byte] != 0xff) {
+ break;
+ }
+ }
+
+ if (byte == sizeof(struct in6_addr)) {
+ return plen;
+ }
+
+ for (bit = 7; bit != 0; bit--, plen++) {
+ if (!(name[byte] & (1 << bit))) {
+ break;
+ }
+ }
+
+ for (; bit != 0; bit--) {
+ if (name[byte] & (1 << bit)) {
+ return 0;
+ }
+ }
+
+ byte++;
+ for (; byte < sizeof(struct in6_addr); byte++) {
+ if (name[byte]) {
+ return 0;
+ }
+ }
+
+ return plen;
+}
+
+
+static void
+KernelEvent_notification(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void *data, void *info)
+{
+ int so = CFSocketGetNative(s);
+ int status;
+ char buf[1024];
+ struct kern_event_msg *ev_msg = (struct kern_event_msg *)&buf[0];
+ int offset = 0;
+
+ status = recv(so, &buf, sizeof(buf), 0);
+ if (status == -1) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("recv() failed: %s"), strerror(errno));
+ CFSocketInvalidate(s);
+ return;
+ }
+
+ while (offset < status) {
+ if ((offset + ev_msg->total_size) > status) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("missed SYSPROTO_EVENT event, buffer not big enough"));
+ break;
+ }
+
+ switch (ev_msg->vendor_code) {
+ case KEV_VENDOR_APPLE :
+ switch (ev_msg->kev_class) {
+ case KEV_NETWORK_CLASS : {
+ void *event_data = &ev_msg->event_data[0];
+
+ switch (ev_msg->kev_subclass) {
+ case KEV_DL_SUBCLASS : {
+ struct net_event_data *ev;
+ char if_name[IFNAMSIZ+1];
+
+ ev = (struct net_event_data *)event_data;
+
+ bzero(&if_name, sizeof(if_name));
+ snprintf(if_name, IFNAMSIZ, "%s%d",
+ ev->if_name,
+ ev->if_unit);
+
+ switch (ev_msg->event_code) {
+ case KEV_DL_IF_ATTACHED : {
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s kernel event: %s: attached"),
+ elapsed(),
+ if_name);
+ break;
+ }
+ case KEV_DL_IF_DETACHING : {
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s kernel event: %s: detaching"),
+ elapsed(),
+ if_name);
+ break;
+ }
+ case KEV_DL_IF_DETACHED : {
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s kernel event: %s: detached"),
+ elapsed(),
+ if_name);
+ break;
+ }
+ case KEV_DL_LINK_OFF : {
+ CFStringRef str;
+
+ str = verbose ? copyInterfaceFlags(if_name) : NULL;
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s kernel event: %s: link down%@"),
+ elapsed(),
+ if_name,
+ str != NULL ? str : CFSTR(""));
+ if (str != NULL) CFRelease(str);
+ break;
+ }
+ case KEV_DL_LINK_ON : {
+ CFStringRef str;
+
+ str = verbose ? copyInterfaceFlags(if_name) : NULL;
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s kernel event: %s: link up%@"),
+ elapsed(),
+ if_name,
+ str != NULL ? str : CFSTR(""));
+ if (str != NULL) CFRelease(str);
+ break;
+ }
+ default :
+ break;
+ }
+ break;
+ }
+ case KEV_INET_SUBCLASS : {
+ char addr[128];
+ struct kev_in_data *ev;
+ char if_name[IFNAMSIZ+1];
+ char mask[128];
+
+ ev = (struct kev_in_data *)event_data;
+
+ bzero(&if_name, sizeof(if_name));
+ snprintf(if_name, IFNAMSIZ, "%s%d",
+ ev->link_data.if_name,
+ ev->link_data.if_unit);
+
+ switch (ev_msg->event_code) {
+ case KEV_INET_NEW_ADDR :
+ case KEV_INET_CHANGED_ADDR :
+ case KEV_INET_ADDR_DELETED : {
+ struct sockaddr_in sin;
+
+ bzero(&sin, sizeof(sin));
+ sin.sin_len = sizeof(sin);
+ sin.sin_family = AF_INET;
+ sin.sin_addr = ev->ia_addr;
+ _SC_sockaddr_to_string((struct sockaddr *)&sin, addr, sizeof(addr));
+
+ bzero(&sin, sizeof(sin));
+ sin.sin_len = sizeof(sin);
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = ntohl(ev->ia_subnetmask);
+ _SC_sockaddr_to_string((struct sockaddr *)&sin, mask, sizeof(mask));
+ break;
+ }
+ default :
+ break;
+ }
+
+ switch (ev_msg->event_code) {
+ case KEV_INET_NEW_ADDR : {
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s kernel event: %s: IPv4 address added (%s/%s)"),
+ elapsed(),
+ if_name,
+ addr,
+ mask);
+ break;
+ }
+ case KEV_INET_CHANGED_ADDR : {
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s kernel event: %s: IPv4 address changed (%s/%s)"),
+ elapsed(),
+ if_name,
+ addr,
+ mask);
+ break;
+ }
+ case KEV_INET_ADDR_DELETED : {
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s kernel event: %s: IPv4 address removed (%s/%s)"),
+ elapsed(),
+ if_name,
+ addr,
+ mask);
+ break;
+ }
+ default :
+ break;
+ }
+ break;
+ }
+ case KEV_INET6_SUBCLASS : {
+ char addr[128];
+ struct kev_in6_data *ev;
+ char if_name[IFNAMSIZ+1];
+ int plen = 0;
+
+ ev = (struct kev_in6_data *)event_data;
+
+ bzero(&if_name, sizeof(if_name));
+ snprintf(if_name, IFNAMSIZ, "%s%d",
+ ev->link_data.if_name,
+ ev->link_data.if_unit);
+
+ switch (ev_msg->event_code) {
+ case KEV_INET6_NEW_USER_ADDR :
+ case KEV_INET6_NEW_LL_ADDR :
+ case KEV_INET6_CHANGED_ADDR :
+ case KEV_INET6_ADDR_DELETED : {
+ _SC_sockaddr_to_string((struct sockaddr *)&ev->ia_addr, addr, sizeof(addr));
+ plen = prefixLength(&ev->ia_prefixmask);
+ break;
+ }
+ default :
+ break;
+ }
+
+ switch (ev_msg->event_code) {
+ case KEV_INET6_NEW_USER_ADDR :
+ case KEV_INET6_NEW_LL_ADDR : {
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s kernel event: %s: IPv6 address added (%s/%d)"),
+ elapsed(),
+ if_name,
+ addr,
+ plen);
+ break;
+ }
+ case KEV_INET6_CHANGED_ADDR : {
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s kernel event: %s: IPv6 address changed (%s/%d)"),
+ elapsed(),
+ if_name,
+ addr,
+ plen);
+ break;
+ }
+ case KEV_INET6_ADDR_DELETED : {
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s kernel event: %s: IPv6 address removed"),
+ elapsed(),
+ if_name);
+ break;
+ }
+ default :
+ break;
+ }
+ break;
+ }
+ default :
+ break;
+ }
+ break;
+ }
+ default :
+ break;
+ }
+ break;
+ default :
+ /* unrecognized vendor code */
+ break;
+ }
+ offset += ev_msg->total_size;
+ ev_msg = (struct kern_event_msg *)&buf[offset];
+ }
+
+ return;
+}
+
+
+static void
+add_KernelEvent_notification()
+{
+ CFSocketRef es;
+ CFSocketContext es_context = { 0, NULL, NULL, NULL, NULL };
+ struct kev_request kev_req;
+ CFRunLoopSourceRef rls;
+ int so;
+ int yes = 1;
+
+ /* Open an event socket */
+ so = socket(PF_SYSTEM, SOCK_RAW, SYSPROTO_EVENT);
+ if (so == -1) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("socket() failed"));
+ return;
+ }
+
+ /* establish filter to return all events */
+ kev_req.vendor_code = 0;
+ kev_req.kev_class = 0; /* Not used if vendor_code is 0 */
+ kev_req.kev_subclass = 0; /* Not used if either kev_class OR vendor_code are 0 */
+ if (ioctl(so, SIOCSKEVFILT, &kev_req) == -1) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("ioctl(, SIOCSKEVFILT, ) failed"));
+ (void)close(so);
+ return;
+ }
+
+ if (ioctl(so, FIONBIO, &yes) == -1) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("ioctl(, FIONBIO, ) failed"));
+ (void)close(so);
+ return;
+ }
+
+ /* Create a CFSocketRef for the PF_SYSTEM kernel event socket */
+ es = CFSocketCreateWithNative(NULL,
+ so,
+ kCFSocketReadCallBack,
+ KernelEvent_notification,
+ &es_context);
+
+ /* Create and add a run loop source for the event socket */
+ rls = CFSocketCreateRunLoopSource(NULL, es, -1);
+ CFRelease(es);
+
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);
+ CFRelease(rls);
+
+ return;
+}
+
+
+#pragma mark -
+#pragma mark Power Management Events
+
+
+static void
+power_notification(void *refcon, io_service_t service, natural_t messageType, void *messageArgument)
+{
+ switch (messageType) {
+ case kIOMessageCanDevicePowerOff :
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s IORegisterForSystemPower: can device power off?"),
+ elapsed());
+ break;
+ case kIOMessageDeviceWillPowerOff :
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s IORegisterForSystemPower: device will power off"),
+ elapsed());
+ break;
+ case kIOMessageDeviceWillNotPowerOff :
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s IORegisterForSystemPower: device will not power off"),
+ elapsed());
+ break;
+ case kIOMessageDeviceHasPoweredOn :
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s IORegisterForSystemPower: device has powered on"),
+ elapsed());
+ break;
+ case kIOMessageCanSystemPowerOff :
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s IORegisterForSystemPower: can system power off?"),
+ elapsed());
+ break;
+ case kIOMessageSystemWillPowerOff :
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s IORegisterForSystemPower: system will power off"),
+ elapsed());
+ break;
+ case kIOMessageSystemWillNotPowerOff :
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s IORegisterForSystemPower: system will not power off"),
+ elapsed());
+ break;
+ case kIOMessageCanSystemSleep :
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s IORegisterForSystemPower: can system sleep?"),
+ elapsed());
+ /*
+ * Idle sleep is about to kick in, but applications have
+ * a chance to allow sleep (by calling IOAllowPowerChange)
+ * or to prevent sleep (by calling IOCancelPowerChange).
+ */
+ IOAllowPowerChange(power, (long)messageArgument);
+ break;
+ case kIOMessageSystemWillSleep :
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s IORegisterForSystemPower: system will sleep"),
+ elapsed());
+ IOAllowPowerChange(power, (long)messageArgument);
+ break;
+ case kIOMessageSystemWillNotSleep :
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s IORegisterForSystemPower: system will not sleep"),
+ elapsed());
+ break;
+ case kIOMessageSystemHasPoweredOn :
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s IORegisterForSystemPower: system has powered on"),
+ elapsed());
+ break;
+ case kIOMessageSystemWillRestart :
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s IORegisterForSystemPower: system will restart"),
+ elapsed());
+ break;
+ case kIOMessageSystemWillPowerOn :
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s IORegisterForSystemPower: system will power on"),
+ elapsed());
+ break;
+ default :
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s IORegisterForSystemPower: message=%08lx"),
+ elapsed(),
+ (long unsigned int)messageType);
+ break;
+ }
+
+ return;
+}
+
+
+static void
+add_power_notification()
+{
+ io_object_t iterator;
+ IONotificationPortRef notify;
+
+ power = IORegisterForSystemPower(0, ¬ify, power_notification, &iterator);
+ if (power == MACH_PORT_NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("IORegisterForSystemPower() failed"));
+ return;
+ }
+
+ CFRunLoopAddSource(CFRunLoopGetCurrent(),
+ IONotificationPortGetRunLoopSource(notify),
+ kCFRunLoopCommonModes);
+
+ return;
+}
+
+
+#ifdef kIOPMMessageSleepWakeUUIDChange
+static void
+wake_uuid_notification(void *refcon, io_service_t service, natural_t messageType, void *messageArgument)
+{
+ CFStringRef wake_uuid = NULL;
+
+ if (messageType == kIOPMMessageSleepWakeUUIDChange) {
+ if (messageArgument == kIOPMMessageSleepWakeUUIDSet) {
+ wake_uuid = IORegistryEntryCreateCFProperty(service, CFSTR(kIOPMSleepWakeUUIDKey), NULL, 0);
+ }
+
+ if (wake_uuid != NULL) {
+ char uuid[256];
+
+ _SC_cfstring_to_cstring(wake_uuid, uuid, sizeof(uuid), kCFStringEncodingUTF8);
+ asl_set(log_msg, MSGTRACER_KEY_DOMAIN, MY_MSGTRACER_DOMAIN);
+ asl_set(log_msg, MSGTRACER_KEY_UUID , uuid);
+
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s wake UUID notification: UUID set (%@)"),
+ elapsed(),
+ wake_uuid);
+
+ CFRelease(wake_uuid);
+ } else {
+ asl_unset(log_msg, MSGTRACER_KEY_DOMAIN);
+ asl_unset(log_msg, MSGTRACER_KEY_UUID);
+
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s wake UUID notification: UUID not set"),
+ elapsed());
+ }
+ }
+
+ return;
+}
+
+
+static void
+add_wake_uuid_notification()
+{
+ kern_return_t kr;
+ io_object_t notification = IO_OBJECT_NULL;
+ IONotificationPortRef notifyPort;
+ io_service_t service;
+
+ notifyPort = IONotificationPortCreate(kIOMasterPortDefault);
+ service = IORegistryEntryFromPath(kIOMasterPortDefault,
+ kIOPowerPlane ":/IOPowerConnection/IOPMrootDomain");
+ kr = IOServiceAddInterestNotification(notifyPort,
+ service,
+ kIOGeneralInterest,
+ wake_uuid_notification,
+ NULL, // refCon
+ ¬ification);
+ if (kr != KERN_SUCCESS) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR,
+ CFSTR("IOServiceAddInterestNotification() failed, kr=0x%x"),
+ kr);
+ return;
+ }
+
+ CFRunLoopAddSource(CFRunLoopGetCurrent(),
+ IONotificationPortGetRunLoopSource(notifyPort),
+ kCFRunLoopDefaultMode);
+
+ wake_uuid_notification(NULL,
+ service,
+ kIOPMMessageSleepWakeUUIDChange,
+ kIOPMMessageSleepWakeUUIDSet);
+
+ return;
+}
+#endif // kIOPMMessageSleepWakeUUIDChange
+
+
+#pragma mark -
+#pragma mark SCDynamicStore "network" Events
+
+
+static void
+NetworkChange_notification(SCDynamicStoreRef store, CFArrayRef changedKeys, void *context)
+{
+ CFIndex i;
+ CFIndex n;
+ CFMutableStringRef str = CFStringCreateMutable(NULL, 0);
+
+ CFStringAppendFormat(str,
+ NULL,
+ CFSTR("%s SCDynamicStore \"network\" notification"),
+ elapsed());
+
+ n = CFArrayGetCount(changedKeys);
+ for (i = 0; i < n; i++) {
+ CFStringRef key;
+
+ key = CFArrayGetValueAtIndex(changedKeys, i);
+ if (CFStringHasSuffix(key, kSCEntNetLink)) {
+ CFDictionaryRef dict;
+ const char *val = "?";
+
+ dict = SCDynamicStoreCopyValue(store, key);
+ if (dict != NULL) {
+ CFBooleanRef link;
+
+ link = CFDictionaryGetValue(dict, kSCPropNetLinkActive);
+ if (link != NULL) {
+ val = CFBooleanGetValue(link) ? "up" : "down";
+ }
+
+ CFRelease(dict);
+ }
+ CFStringAppendFormat(str, NULL, CFSTR("\n%@ (%s)"), key, val);
+ } else if (CFStringHasSuffix(key, kSCEntNetIPv4) ||
+ CFStringHasSuffix(key, kSCEntNetIPv6)) {
+ CFDictionaryRef dict;
+
+ dict = SCDynamicStoreCopyValue(store, key);
+ if (dict != NULL) {
+ CFStringRef val;
+
+ val = _SCCopyDescription(dict, NULL);
+ CFStringAppendFormat(str, NULL, CFSTR("\n%@ : %@"), key, val);
+ CFRelease(val);
+ CFRelease(dict);
+ } else {
+ CFStringAppendFormat(str, NULL, CFSTR("\n%@ : removed"), key);
+ }
+ } else {
+ CFStringAppendFormat(str, NULL, CFSTR("\n%@"), key);
+ }
+ }
+
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO, CFSTR("%@"), str);
+ CFRelease(str);
+ return;
+}
+
+
+static void
+add_NetworkChange_notification()
+{
+ CFStringRef dns_key;
+ CFStringRef key;
+ CFMutableArrayRef keys;
+ Boolean ok;
+ CFStringRef pattern;
+ CFMutableArrayRef patterns;
+ SCDynamicStoreRef store;
+ CFRunLoopSourceRef rls;
+
+ store = SCDynamicStoreCreate(NULL, CFSTR("Logger.bundle-NetworkChange"), NetworkChange_notification, NULL);
+ if (store == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreCreate() failed"));
+ return;
+ }
+
+ keys = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+ patterns = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+
+ // Interface list
+
+ key = SCDynamicStoreKeyCreateNetworkInterface(NULL, kSCDynamicStoreDomainState);
+ CFArrayAppendValue(keys, key);
+ CFRelease(key);
+
+ // IPv4
+
+ key = SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL, kSCDynamicStoreDomainState, kSCEntNetIPv4);
+ CFArrayAppendValue(keys, key);
+ CFRelease(key);
+
+ pattern = SCDynamicStoreKeyCreateNetworkServiceEntity(NULL, kSCDynamicStoreDomainState, kSCCompAnyRegex, kSCEntNetIPv4);
+ CFArrayAppendValue(patterns, pattern);
+ CFRelease(pattern);
+
+ pattern = SCDynamicStoreKeyCreateNetworkInterfaceEntity(NULL, kSCDynamicStoreDomainState, kSCCompAnyRegex, kSCEntNetIPv4);
+ CFArrayAppendValue(patterns, pattern);
+ CFRelease(pattern);
+
+ // IPv6
+
+ key = SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL, kSCDynamicStoreDomainState, kSCEntNetIPv6);
+ CFArrayAppendValue(keys, key);
+ CFRelease(key);
+
+ pattern = SCDynamicStoreKeyCreateNetworkServiceEntity(NULL, kSCDynamicStoreDomainState, kSCCompAnyRegex, kSCEntNetIPv6);
+ CFArrayAppendValue(patterns, pattern);
+ CFRelease(pattern);
+
+ pattern = SCDynamicStoreKeyCreateNetworkInterfaceEntity(NULL, kSCDynamicStoreDomainState, kSCCompAnyRegex, kSCEntNetIPv6);
+ CFArrayAppendValue(patterns, pattern);
+ CFRelease(pattern);
+
+ // Link
+
+ pattern = SCDynamicStoreKeyCreateNetworkInterfaceEntity(NULL, kSCDynamicStoreDomainState, kSCCompAnyRegex, kSCEntNetLink);
+ CFArrayAppendValue(patterns, pattern);
+ CFRelease(pattern);
+
+ // AirPort (e.g. BSSID)
+
+ pattern = SCDynamicStoreKeyCreateNetworkInterfaceEntity(NULL, kSCDynamicStoreDomainState, kSCCompAnyRegex, kSCEntNetAirPort);
+ CFArrayAppendValue(patterns, pattern);
+ CFRelease(pattern);
+
+ // DNS
+
+ key = SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL, kSCDynamicStoreDomainState, kSCEntNetDNS);
+ CFArrayAppendValue(keys, key);
+ CFRelease(key);
+
+ dns_key = CFStringCreateWithCString(NULL,
+ dns_configuration_notify_key(),
+ kCFStringEncodingASCII);
+ key = CFStringCreateWithFormat(NULL, NULL, CFSTR("Notify:%@"), dns_key);
+ CFRelease(dns_key);
+ CFArrayAppendValue(keys, key);
+ CFRelease(key);
+
+ // Proxies
+
+ key = SCDynamicStoreKeyCreateProxies(NULL);
+ CFArrayAppendValue(keys, key);
+ CFRelease(key);
+
+ // ComputerName, LocalHostName
+
+ key = SCDynamicStoreKeyCreateComputerName(NULL);
+ CFArrayAppendValue(keys, key);
+ CFRelease(key);
+
+ key = SCDynamicStoreKeyCreateHostNames(NULL);
+ CFArrayAppendValue(keys, key);
+ CFRelease(key);
+
+ ok = SCDynamicStoreSetNotificationKeys(store, keys, patterns);
+ CFRelease(keys);
+ CFRelease(patterns);
+ if (!ok) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreSetNotificationKeys() failed"));
+ CFRelease(store);
+ return;
+ }
+
+ rls = SCDynamicStoreCreateRunLoopSource(NULL, store, -1);
+ if (rls == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreCreateRunLoopSource() failed"));
+ CFRelease(store);
+ return;
+ }
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);
+ CFRelease(rls);
+
+ CFRelease(store);
+ return;
+}
+
+
+static void
+PrimaryService_notification(SCDynamicStoreRef store, CFArrayRef changedKeys, void *context)
+{
+ CFDictionaryRef entity;
+ CFStringRef key;
+ static CFStringRef oldPrimary = NULL;
+ CFStringRef newPrimary = NULL;
+
+ key = SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL, kSCDynamicStoreDomainState, kSCEntNetIPv4);
+ entity = SCDynamicStoreCopyValue(store, key);
+ CFRelease(key);
+ if (isA_CFDictionary(entity) &&
+ CFDictionaryGetValueIfPresent(entity,
+ kSCDynamicStorePropNetPrimaryService,
+ (const void **)&newPrimary) &&
+ isA_CFString(newPrimary)) {
+ CFRetain(newPrimary);
+ } else {
+ newPrimary = NULL;
+ }
+
+ if (!_SC_CFEqual(oldPrimary, newPrimary)) {
+ if (newPrimary != NULL) {
+ CFStringRef newInterface;
+
+ newInterface = CFDictionaryGetValue(entity, kSCDynamicStorePropNetPrimaryInterface);
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s Primary service: %@ (%@)"),
+ elapsed(),
+ newPrimary,
+ newInterface != NULL ? newInterface : CFSTR("?"));
+ } else {
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s Primary service: removed"),
+ elapsed());
+ }
+ }
+
+ if (oldPrimary != NULL) CFRelease(oldPrimary);
+ oldPrimary = newPrimary;
+
+ if (entity != NULL) CFRelease(entity);
+ return;
+}
+
+
+static void
+add_PrimaryService_notification()
+{
+ CFStringRef key;
+ CFMutableArrayRef keys;
+ Boolean ok;
+ SCDynamicStoreRef store;
+ CFRunLoopSourceRef rls;
+
+ store = SCDynamicStoreCreate(NULL, CFSTR("Logger.bundle-PrimaryService"), PrimaryService_notification, NULL);
+ if (store == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreCreate() failed"));
+ return;
+ }
+
+ keys = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+ key = SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL, kSCDynamicStoreDomainState, kSCEntNetIPv4);
+ CFArrayAppendValue(keys, key);
+ CFRelease(key);
+
+ ok = SCDynamicStoreSetNotificationKeys(store, keys, NULL);
+ CFRelease(keys);
+ if (!ok) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreSetNotificationKeys() failed"));
+ CFRelease(store);
+ return;
+ }
+
+ rls = SCDynamicStoreCreateRunLoopSource(NULL, store, -1);
+ if (rls == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreCreateRunLoopSource() failed"));
+ CFRelease(store);
+ return;
+ }
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);
+ CFRelease(rls);
+
+ CFRelease(store);
+ return;
+}
+
+
+#pragma mark -
+#pragma mark Reachability Events
+
+
+static void
+reachability_notification(SCNetworkReachabilityRef ref, SCNetworkReachabilityFlags flags, void *info)
+{
+ CFStringRef hostname = (CFStringRef)info;
+
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s reachability changed: %@: flags=0x%08x"),
+ elapsed(),
+ hostname,
+ flags);
+ return;
+}
+
+
+static void
+add_reachability_notification(CFArrayRef hosts)
+{
+ SCNetworkReachabilityContext context = { 0, NULL, CFRetain, CFRelease, CFCopyDescription };
+ CFIndex i;
+ CFIndex n;
+ SCNetworkReachabilityRef target;
+
+ struct watch {
+ in_addr_t addr;
+ CFStringRef name;
+ } watchAddresses[] = { { 0, CFSTR("0.0.0.0") },
+ { IN_LINKLOCALNETNUM, CFSTR("169.254.0.0") },
+ { (u_int32_t)0xe00000fb, CFSTR("224.0.0.251") },
+ };
+
+ for (i = 0; i < sizeof(watchAddresses)/sizeof(watchAddresses[0]); i++) {
+ struct sockaddr_in sin;
+
+ bzero(&sin, sizeof(sin));
+ sin.sin_len = sizeof(sin);
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = htonl(watchAddresses[i].addr);
+
+ target = SCNetworkReachabilityCreateWithAddress(NULL, (struct sockaddr *)&sin);
+ if (target == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCNetworkReachabilityCreateWithAddress() failed"));
+ return;
+ }
+
+ context.info = (void *)watchAddresses[i].name;
+ if (!SCNetworkReachabilitySetCallback(target, reachability_notification, &context)) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCNetworkReachabilitySetCallback() failed"));
+ CFRelease(target);
+ return;
+ }
+
+ if (!SCNetworkReachabilityScheduleWithRunLoop(target, CFRunLoopGetCurrent(), kCFRunLoopCommonModes)) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCNetworkReachabilityScheduleWithRunLoop() failed"));
+ CFRelease(target);
+ return;
+ }
+
+ CFRelease(target);
+ }
+
+ n = (hosts != NULL) ? CFArrayGetCount(hosts) : 0;
+ for (i = 0; i < n; i++) {
+ CFStringRef host;
+ char *nodename;
+
+ host = CFArrayGetValueAtIndex(hosts, i);
+ if (!isA_CFString(host) || (CFStringGetLength(host) == 0)) {
+ continue;
+ }
+
+ nodename = _SC_cfstring_to_cstring(host, NULL, 0, kCFStringEncodingUTF8);
+ target = SCNetworkReachabilityCreateWithName(NULL, nodename);
+ CFAllocatorDeallocate(NULL, nodename);
+ if (target == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCNetworkReachabilityCreateWithName() failed"));
+ return;
+ }
+
+ context.info = (void *)host;
+ if (!SCNetworkReachabilitySetCallback(target, reachability_notification, &context)) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCNetworkReachabilitySetCallback() failed"));
+ CFRelease(target);
+ return;
+ }
+
+ if (!SCNetworkReachabilityScheduleWithRunLoop(target, CFRunLoopGetCurrent(), kCFRunLoopCommonModes)) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCNetworkReachabilityScheduleWithRunLoop() failed"));
+ CFRelease(target);
+ return;
+ }
+
+ CFRelease(target);
+ }
+
+ return;
+}
+
+
+#pragma mark -
+#pragma mark Console User/Information Events
+
+
+#if !TARGET_OS_EMBEDDED
+static void
+console_notification(SCDynamicStoreRef store, CFArrayRef changedKeys, void *context)
+{
+ gid_t gid;
+ CFArrayRef info;
+ CFMutableStringRef str = CFStringCreateMutable(NULL, 0);
+ uid_t uid;
+ CFStringRef user;
+
+ CFStringAppendFormat(str,
+ NULL,
+ CFSTR("%s SCDynamicStore console notification"),
+ elapsed());
+
+ user = SCDynamicStoreCopyConsoleUser(store, &uid, &gid);
+ if (user != NULL) {
+ CFStringAppendFormat(str, NULL, CFSTR("\nconsole user = %@"), user);
+ CFRelease(user);
+ } else {
+ CFStringAppendFormat(str, NULL, CFSTR("\nno console user"));
+ }
+
+ info = SCDynamicStoreCopyConsoleInformation(store);
+ if (info != NULL) {
+ CFIndex i;
+ CFIndex n;
+
+ n = CFArrayGetCount(info);
+ for (i = 0; i < n; i++) {
+ CFDictionaryRef session;
+ CFNumberRef sessionID;
+ CFStringRef sessionUserName;
+ CFBooleanRef sessionOnConsole;
+
+ session = CFArrayGetValueAtIndex(info, i);
+ sessionID = CFDictionaryGetValue(session, kSCConsoleSessionID);
+ sessionUserName = CFDictionaryGetValue(session, kSCConsoleSessionUserName);
+ sessionOnConsole = CFDictionaryGetValue(session, kSCConsoleSessionOnConsole);
+
+ CFStringAppendFormat(str, NULL, CFSTR("\n%d : id=%@, user=%@, console=%s"),
+ i,
+ sessionID,
+ sessionUserName != NULL ? sessionUserName : CFSTR("?"),
+ sessionOnConsole != NULL ? CFBooleanGetValue(sessionOnConsole) ? "yes" : "no" : "?");
+ }
+
+ CFRelease(info);
+ }
+
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO, CFSTR("%@"), str);
+ CFRelease(str);
+ return;
+}
+
+
+static void
+add_console_notification()
+{
+ CFStringRef key;
+ CFMutableArrayRef keys;
+ Boolean ok;
+ SCDynamicStoreRef store;
+ CFRunLoopSourceRef rls;
+
+ store = SCDynamicStoreCreate(NULL, CFSTR("Logger.bundle-console"), console_notification, NULL);
+ if (store == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreCreate() failed"));
+ return;
+ }
+
+ keys = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+
+ key = SCDynamicStoreKeyCreateConsoleUser(NULL);
+ CFArrayAppendValue(keys, key);
+ CFRelease(key);
+
+ ok = SCDynamicStoreSetNotificationKeys(store, keys, NULL);
+ CFRelease(keys);
+ if (!ok) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreSetNotificationKeys() failed"));
+ CFRelease(store);
+ return;
+ }
+
+ rls = SCDynamicStoreCreateRunLoopSource(NULL, store, -1);
+ if (rls == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreCreateRunLoopSource() failed"));
+ CFRelease(store);
+ return;
+ }
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);
+ CFRelease(rls);
+
+ CFRelease(store);
+ return;
+}
+#endif // !TARGET_OS_EMBEDDED
+
+
+#pragma mark -
+#pragma mark Directory Services Events
+
+
+//#include <DirectoryServices/DirServicesPriv.h>
+#ifndef kDSStdNotifySearchPolicyChanged
+#define kDSStdNotifySearchPolicyChanged "com.apple.DirectoryService.NotifyTypeStandard:SearchPolicyChanged"
+#endif
+
+
+#if !TARGET_OS_EMBEDDED
+static void
+directoryServices_notification(SCDynamicStoreRef store, CFArrayRef changedKeys, void *context)
+{
+ CFIndex i;
+ CFIndex n;
+ CFMutableStringRef str = CFStringCreateMutable(NULL, 0);
+
+ CFStringAppendFormat(str,
+ NULL,
+ CFSTR("%s SCDynamicStore DirectoryServices notification"),
+ elapsed());
+
+ n = CFArrayGetCount(changedKeys);
+ for (i = 0; i < n; i++) {
+ CFStringRef key;
+
+ key = CFArrayGetValueAtIndex(changedKeys, i);
+ CFStringAppendFormat(str, NULL, CFSTR("\n%@"), key);
+ }
+
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO, CFSTR("%@"), str);
+ CFRelease(str);
+ return;
+}
+
+
+static void
+add_DirectoryServices_notification()
+{
+ CFStringRef key;
+ CFMutableArrayRef keys;
+ Boolean ok;
+ SCDynamicStoreRef store;
+ CFRunLoopSourceRef rls;
+
+ store = SCDynamicStoreCreate(NULL, CFSTR("Logger.bundle-directoryServices"), directoryServices_notification, NULL);
+ if (store == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreCreate() failed"));
+ return;
+ }
+
+ keys = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+
+ key = CFSTR(kDSStdNotifySearchPolicyChanged);
+ CFArrayAppendValue(keys, key);
+// CFRelease(key);
+
+ ok = SCDynamicStoreSetNotificationKeys(store, keys, NULL);
+ CFRelease(keys);
+ if (!ok) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreSetNotificationKeys() failed"));
+ CFRelease(store);
+ return;
+ }
+
+ rls = SCDynamicStoreCreateRunLoopSource(NULL, store, -1);
+ if (rls == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreCreateRunLoopSource() failed"));
+ CFRelease(store);
+ return;
+ }
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);
+ CFRelease(rls);
+
+ CFRelease(store);
+ return;
+}
+#endif // !TARGET_OS_EMBEDDED
+
+
+#pragma mark -
+#pragma mark DNS Configuration Events
+
+
+static void
+dnsinfo_notification(CFMachPortRef port, void *msg, CFIndex size, void *info)
+{
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s dnsinfo notification"),
+ elapsed());
+
+ return;
+}
+
+
+static void
+add_dnsinfo_notification()
+{
+ const char *key;
+ CFMachPortRef mp;
+ mach_port_t notify_port;
+ int notify_token;
+ CFRunLoopSourceRef rls;
+ uint32_t status;
+
+ key = dns_configuration_notify_key();
+ status = notify_register_mach_port(key, ¬ify_port, 0, ¬ify_token);
+ if (status != NOTIFY_STATUS_OK) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("notify_register_mach_port() failed"));
+ return;
+ }
+
+ mp = CFMachPortCreateWithPort(NULL, notify_port, dnsinfo_notification, NULL, NULL);
+ if (mp == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("CFMachPortCreateWithPort() failed"));
+ (void)notify_cancel(notify_token);
+ return;
+ }
+
+ rls = CFMachPortCreateRunLoopSource(NULL, mp, -1);
+ if (rls == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreCreateRunLoopSource() failed"));
+ CFRelease(mp);
+ (void)notify_cancel(notify_token);
+ return;
+ }
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);
+ CFRelease(rls);
+
+ CFRelease(mp);
+ return;
+}
+
+
+#pragma mark -
+#pragma mark Network Configuration Change Events
+
+
+#define NETWORKCHANGED_NOTIFY_KEY "com.apple.system.config.network_change"
+
+static void
+network_notification(CFMachPortRef port, void *msg, CFIndex size, void *info)
+{
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s network_change notification"),
+ elapsed());
+
+ return;
+}
+
+
+static void
+add_network_notification()
+{
+ CFMachPortRef mp;
+ mach_port_t notify_port;
+ int notify_token;
+ CFRunLoopSourceRef rls;
+ uint32_t status;
+
+ status = notify_register_mach_port(NETWORKCHANGED_NOTIFY_KEY,
+ ¬ify_port,
+ 0,
+ ¬ify_token);
+ if (status != NOTIFY_STATUS_OK) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("notify_register_mach_port() failed"));
+ return;
+ }
+
+ mp = CFMachPortCreateWithPort(NULL, notify_port, network_notification, NULL, NULL);
+ if (mp == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("CFMachPortCreateWithPort() failed"));
+ (void)notify_cancel(notify_token);
+ return;
+ }
+
+ rls = CFMachPortCreateRunLoopSource(NULL, mp, -1);
+ if (rls == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreCreateRunLoopSource() failed"));
+ CFRelease(mp);
+ (void)notify_cancel(notify_token);
+ return;
+ }
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);
+ CFRelease(rls);
+
+ CFRelease(mp);
+ return;
+}
+
+
+#pragma mark -
+#pragma mark SMB Configuration Events
+
+
+#define SMBCONFIGURATION_NOTIFY_KEY "com.apple.system.SystemConfiguration.smb_configuration"
+
+
+#if !TARGET_OS_EMBEDDED
+static void
+smbconf_notification(CFMachPortRef port, void *msg, CFIndex size, void *info)
+{
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO,
+ CFSTR("%s smb.conf notification"),
+ elapsed());
+
+ return;
+}
+
+
+static void
+add_smbconf_notification()
+{
+ CFMachPortRef mp;
+ mach_port_t notify_port;
+ int notify_token;
+ CFRunLoopSourceRef rls;
+ uint32_t status;
+
+ status = notify_register_mach_port(SMBCONFIGURATION_NOTIFY_KEY,
+ ¬ify_port,
+ 0,
+ ¬ify_token);
+ if (status != NOTIFY_STATUS_OK) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("notify_register_mach_port() failed"));
+ return;
+ }
+
+ mp = CFMachPortCreateWithPort(NULL, notify_port, smbconf_notification, NULL, NULL);
+ if (mp == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("CFMachPortCreateWithPort() failed"));
+ (void)notify_cancel(notify_token);
+ return;
+ }
+
+ rls = CFMachPortCreateRunLoopSource(NULL, mp, -1);
+ if (rls == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreCreateRunLoopSource() failed"));
+ CFRelease(mp);
+ (void)notify_cancel(notify_token);
+ return;
+ }
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);
+ CFRelease(rls);
+
+ CFRelease(mp);
+ return;
+}
+#endif // !TARGET_OS_EMBEDDED
+
+
+#pragma mark -
+#pragma mark pututxline Events
+
+
+#if !TARGET_OS_EMBEDDED
+static const char *
+ut_time(struct utmpx *utmpx)
+{
+ static char str[16];
+ struct tm tm;
+
+ (void)localtime_r(&utmpx->ut_tv.tv_sec, &tm);
+ snprintf(str, sizeof(str), "%2d:%02d:%02d.%03d",
+ tm.tm_hour,
+ tm.tm_min,
+ tm.tm_sec,
+ utmpx->ut_tv.tv_usec / 1000);
+
+ return str;
+}
+
+
+static const char *
+ut_id(struct utmpx *utmpx)
+{
+ char *cp;
+ static char str[16];
+
+ cp = utmpx->ut_id + sizeof(utmpx->ut_id);
+ while(--cp >= utmpx->ut_id && isprint(*cp)) {}
+ if(cp < utmpx->ut_id) {
+ snprintf(str, sizeof(str), "%-4.4s", utmpx->ut_id);
+ } else {
+ snprintf(str, sizeof(str),
+ "0x%2.2x%2.2x%2.2x%2.2x",
+ utmpx->ut_id[0],
+ utmpx->ut_id[1],
+ utmpx->ut_id[2],
+ utmpx->ut_id[3]);
+ }
+
+ return str;
+}
+
+
+static const char *
+ut_pid(struct utmpx *utmpx)
+{
+ static char pid[16];
+
+ snprintf(pid, sizeof(pid), "%d", utmpx->ut_pid);
+
+ return pid;
+}
+
+
+static void
+pututxline_notification(CFMachPortRef port, void *msg, CFIndex size, void *info)
+{
+ CFMutableStringRef str = CFStringCreateMutable(NULL, 0);
+ struct utmpx *utmpx;
+
+ CFStringAppendFormat(str,
+ NULL,
+ CFSTR("%s pututxline notification"),
+ elapsed());
+
+ setutxent();
+ while ((utmpx = getutxent()) != NULL) {
+ const char * entry_id = NULL;
+ const char * entry_line = NULL;
+ const char * entry_pid = NULL;
+ const char * entry_tv = NULL;
+ const char * entry_type;
+ const char * entry_user = NULL;
+ char line[128];
+ int n;
+
+ switch (utmpx->ut_type) {
+ case BOOT_TIME : // Time of a system boot.
+ entry_type = "Boot";
+ entry_tv = ut_time(utmpx);
+ break;
+ case DEAD_PROCESS : // A session leader exited.
+ entry_type = "Dead process";
+ entry_id = ut_id (utmpx);
+ entry_pid = ut_pid (utmpx);
+ entry_tv = ut_time(utmpx);
+ break;
+ case EMPTY : // No valid user accounting information.
+ continue;
+ case INIT_PROCESS : // A process spawned by init(8).
+ entry_type = "Init process";
+ entry_id = ut_id (utmpx);
+ entry_pid = ut_pid (utmpx);
+ entry_tv = ut_time(utmpx);
+ break;
+ case LOGIN_PROCESS : // The session leader of a logged-in user.
+ entry_type = "Login";
+ entry_id = ut_id (utmpx);
+ entry_user = utmpx->ut_user;
+ entry_pid = ut_pid (utmpx);
+ entry_tv = ut_time(utmpx);
+ break;
+ case NEW_TIME : // Time after system clock change.
+ entry_type = "New time";
+ entry_tv = ut_time(utmpx);
+ break;
+ case OLD_TIME : // Time before system clock change.
+ entry_type = "Old time";
+ entry_tv = ut_time(utmpx);
+ break;
+ case RUN_LVL : // Run level. Provided for compatibility, not used.
+ entry_type = "Run level";
+ break;
+ case USER_PROCESS : // A user process.
+ entry_type = "User Process";
+ entry_id = ut_id (utmpx);
+ entry_user = utmpx->ut_user;
+ entry_line = utmpx->ut_line;
+ entry_pid = ut_pid (utmpx);
+ entry_tv = ut_time(utmpx);
+ break;
+ case SHUTDOWN_TIME : // Time of system shutdown
+ entry_type = "Shutdown time";
+ entry_tv = ut_time(utmpx);
+ break;
+ default :
+ entry_type = "Unknown";
+ break;
+ }
+
+ snprintf(line, sizeof(line),
+ // type time id=0x12345678 pid=12345 user=abcdefgh line
+ "\n%-13s %2s%12s %3s%-10s %4s%-5s %5s%-8s %5s%s",
+ entry_type,
+ entry_tv != NULL ? "@ " : "",
+ entry_tv != NULL ? entry_tv : "", // hh:mm:ss.ddd
+ entry_id != NULL ? "id=" : "",
+ entry_id != NULL ? entry_id : "", // 0x12345678
+ entry_pid != NULL ? "pid=" : "",
+ entry_pid != NULL ? entry_pid : "", // #####
+ entry_user != NULL ? "user=" : "",
+ entry_user != NULL ? entry_user : "", // <=256 chars
+ entry_line != NULL ? "line=" : "",
+ entry_line != NULL ? entry_line : "" // <= 32 chars
+ );
+
+ n = strlen(line) - 1;
+ while ((n > 0) && (line[n] == ' ')) {
+ line[n] = '\0';
+ --n;
+ }
+
+ CFStringAppendFormat(str, NULL, CFSTR("%s"), line);
+ }
+ endutxent();
+
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO, CFSTR("%@"), str);
+ CFRelease(str);
+ return;
+}
+
+
+static void
+add_pututxline_notification()
+{
+ CFMachPortRef mp;
+ mach_port_t notify_port;
+ int notify_token;
+ CFRunLoopSourceRef rls;
+ uint32_t status;
+
+ status = notify_register_mach_port(UTMPX_CHANGE_NOTIFICATION, ¬ify_port, 0, ¬ify_token);
+ if (status != NOTIFY_STATUS_OK) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("notify_register_mach_port() failed"));
+ return;
+ }
+
+ mp = CFMachPortCreateWithPort(NULL, notify_port, pututxline_notification, NULL, NULL);
+ if (mp == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("CFMachPortCreateWithPort() failed"));
+ (void)notify_cancel(notify_token);
+ return;
+ }
+
+ rls = CFMachPortCreateRunLoopSource(NULL, mp, -1);
+ if (rls == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreCreateRunLoopSource() failed"));
+ CFRelease(mp);
+ (void)notify_cancel(notify_token);
+ return;
+ }
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);
+ CFRelease(rls);
+
+ CFRelease(mp);
+ return;
+}
+#endif // !TARGET_OS_EMBEDDED
+
+
+#pragma mark -
+#pragma mark BackToMyMac Status Events
+
+
+#ifndef kDSStdNotifyBTMMStatusChanged
+#define kDSStdNotifyBTMMStatusChanged "State:/Network/BackToMyMac"
+#endif
+
+
+#if !TARGET_OS_EMBEDDED
+static void
+BTMM_notification(SCDynamicStoreRef store, CFArrayRef changedKeys, void *context)
+{
+ CFIndex i;
+ CFIndex n;
+ CFMutableStringRef str = CFStringCreateMutable(NULL, 0);
+
+ CFStringAppendFormat(str,
+ NULL,
+ CFSTR("%s SCDynamicStore Back to My Mac notification"),
+ elapsed());
+
+ n = CFArrayGetCount(changedKeys);
+ for (i = 0; i < n; i++) {
+ CFStringRef key;
+ CFDictionaryRef dict;
+
+ key = CFArrayGetValueAtIndex(changedKeys, i);
+ dict = SCDynamicStoreCopyValue(store, key);
+ if (dict != NULL) {
+ CFStringRef val;
+
+ val = _SCCopyDescription(dict, NULL);
+ CFStringAppendFormat(str, NULL, CFSTR("\n%@ : %@"), key, val);
+ CFRelease(val);
+ CFRelease(dict);
+ } else {
+ CFStringAppendFormat(str, NULL, CFSTR("\n%@ : removed"), key);
+ }
+ }
+
+ SCLOG(NULL, log_msg, ~ASL_LEVEL_INFO, CFSTR("%@"), str);
+ CFRelease(str);
+ return;
+}
+
+
+static void
+add_BTMM_notification()
+{
+ CFStringRef key;
+ CFMutableArrayRef keys;
+ Boolean ok;
+ SCDynamicStoreRef store;
+ CFRunLoopSourceRef rls;
+
+ store = SCDynamicStoreCreate(NULL, CFSTR("Logger.bundle-BackToMyMac"), BTMM_notification, NULL);
+ if (store == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreCreate() failed"));
+ return;
+ }
+
+ keys = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+
+ key = CFSTR(kDSStdNotifyBTMMStatusChanged);
+ CFArrayAppendValue(keys, key);
+
+ ok = SCDynamicStoreSetNotificationKeys(store, keys, NULL);
+ CFRelease(keys);
+ if (!ok) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreSetNotificationKeys() failed"));
+ CFRelease(store);
+ return;
+ }
+
+ rls = SCDynamicStoreCreateRunLoopSource(NULL, store, -1);
+ if (rls == NULL) {
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCDynamicStoreCreateRunLoopSource() failed"));
+ CFRelease(store);
+ return;
+ }
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);
+ CFRelease(rls);
+
+ CFRelease(store);
+ return;
+}
+#endif // !TARGET_OS_EMBEDDED
+
+
+#pragma mark -
+
+
+static inline Boolean
+bValFromDictionary(CFDictionaryRef dict, CFStringRef key)
+{
+ CFBooleanRef bVal;
+ Boolean result = FALSE;
+
+ if ((dict != NULL) &&
+ CFDictionaryGetValueIfPresent(dict, key, (const void **)&bVal) &&
+ isA_CFBoolean(bVal)) {
+ result = CFBooleanGetValue(bVal);
+ }
+
+ return result;
+}
+
+
+void
+load(CFBundleRef bundle, Boolean bundleVerbose)
+{
+ CFDictionaryRef config;
+ Boolean log_all;
+
+ verbose = bundleVerbose;
+
+ log_msg = asl_new(ASL_TYPE_MSG);
+ asl_set(log_msg, ASL_KEY_FACILITY, MY_ASL_FACILITY);
+
+ elapsed();
+
+ config = CFBundleGetInfoDictionary(bundle);
+ config = isA_CFDictionary(config);
+ log_all = bValFromDictionary(config, CFSTR("LOG_ALL"));
+
+#ifdef kIOPMMessageSleepWakeUUIDChange
+ if (log_all || bValFromDictionary(config, CFSTR("LOG_IO_WAKEUUID_EVENTS"))) {
+ add_wake_uuid_notification();
+ }
+#endif // kIOPMMessageSleepWakeUUIDChange
+
+ if (log_all || bValFromDictionary(config, CFSTR("LOG_IO_SYSTEMPOWER_EVENTS"))) {
+ add_power_notification();
+ }
+
+ if (log_all || bValFromDictionary(config, CFSTR("LOG_NETWORK_KERNEL_EVENTS"))) {
+ add_KernelEvent_notification();
+ }
+
+ if (log_all || bValFromDictionary(config, CFSTR("LOG_NOTIFY_DNS_CONFIGURATION"))) {
+ add_dnsinfo_notification();
+ }
+
+ if (log_all || bValFromDictionary(config, CFSTR("LOG_NOTIFY_NETWORK_CHANGE"))) {
+ add_network_notification();
+ }
+
+#if !TARGET_OS_EMBEDDED
+ if (log_all || bValFromDictionary(config, CFSTR("LOG_NOTIFY_SMB_CONFIGURATION"))) {
+ add_smbconf_notification();
+ }
+#endif // !TARGET_OS_EMBEDDED
+
+#if !TARGET_OS_EMBEDDED
+ if (log_all || bValFromDictionary(config, CFSTR("LOG_NOTIFY_UTMPX_CHANGE"))) {
+ add_pututxline_notification();
+ }
+#endif // !TARGET_OS_EMBEDDED
+
+#if !TARGET_OS_EMBEDDED
+ if (log_all || bValFromDictionary(config, CFSTR("LOG_SC_BTMM_CONFIGURATION"))) {
+ add_BTMM_notification();
+ }
+#endif // !TARGET_OS_EMBEDDED
+
+#if !TARGET_OS_EMBEDDED
+ if (log_all || bValFromDictionary(config, CFSTR("LOG_SC_CONSOLEUSER"))) {
+ add_console_notification();
+ }
+#endif // !TARGET_OS_EMBEDDED
+
+#if !TARGET_OS_EMBEDDED
+ if (log_all || bValFromDictionary(config, CFSTR("LOG_SC_DIRECTORYSERVICES_SEARCHPOLICY"))) {
+ add_DirectoryServices_notification();
+ }
+#endif // !TARGET_OS_EMBEDDED
+
+ if (log_all || bValFromDictionary(config, CFSTR("LOG_SC_NETWORKCHANGE"))) {
+ add_NetworkChange_notification();
+ }
+
+ if (log_all || bValFromDictionary(config, CFSTR("LOG_SC_PRIMARYSERVICE"))) {
+ add_PrimaryService_notification();
+ }
+
+ if (log_all || bValFromDictionary(config, CFSTR("LOG_SC_REACHABILITY"))) {
+ CFArrayRef hosts = NULL;
+
+ if ((config == NULL) ||
+ !CFDictionaryGetValueIfPresent(config, CFSTR("LOG_SC_REACHABILITY_HOSTS"), (const void **)&hosts) ||
+ !isA_CFArray(hosts) ||
+ (CFArrayGetCount(hosts) == 0)) {
+ hosts = NULL;
+ }
+
+ add_reachability_notification(hosts);
+ }
+
+ return;
+}
+
+#ifdef MAIN
+
+int
+main(int argc, char **argv)
+{
+ _sc_log = FALSE;
+ _sc_verbose = (argc > 1) ? TRUE : FALSE;
+ _sc_debug = TRUE;
+
+ load(CFBundleGetMainBundle(), (argc > 1) ? TRUE : FALSE);
+ CFRunLoopRun();
+ /* not reached */
+ exit(0);
+ return 0;
+}
+
+#endif /* MAIN */
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
- <string>SystemConfiguration</string>
+ <string>com.apple.SystemConfiguration.NetworkIdentification</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
- <string>1.9.2</string>
+ <string>1.10</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>1.9.2</string>
+ <string>1.10</string>
<key>Builtin</key>
<true/>
</dict>
/*
- * Copyright (c) 2005-2007 Apple Inc. All Rights Reserved.
+ * Copyright (c) 2005-2007, 2009 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
CFArrayInsertValueAtIndex(watcher->signatures, 0,
new_sig_dict);
CFRelease(new_sig_dict);
- sig_dict = new_sig_dict;
save_signatures = TRUE;
}
active_dict
return;
}
-__private_extern__
-void
-stop_NetworkIdentification(CFRunLoopSourceRef stopRls)
-{
- if (S_watcher != NULL) {
- ServiceWatcherSaveSignatures(S_watcher);
- }
- CFRunLoopSourceSignal(stopRls);
-}
-
-
#ifdef TEST_NETWORKIDENTIFICATION
#undef TEST_NETWORKIDENTIFICATION
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
- <string>SystemConfiguration</string>
+ <string>com.apple.SystemConfiguration.PreferencesMonitor</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
- <string>1.9.2</string>
+ <string>1.10</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>1.9.2</string>
+ <string>1.10</string>
<key>Builtin</key>
<true/>
<key>Requires</key>
/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*/
+#include <TargetConditionals.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
static Boolean _verbose = FALSE;
-static void
+static Boolean
establishNewPreferences()
{
CFBundleRef bundle;
+ SCNetworkSetRef current = NULL;
Boolean ok = FALSE;
int sc_status = kSCStatusFailed;
SCNetworkSetRef set = NULL;
CFStringRef setName = NULL;
+ Boolean updated = FALSE;
while (TRUE) {
ok = SCPreferencesLock(prefs, TRUE);
sc_status = SCError();
if (sc_status == kSCStatusStale) {
- (void) SCPreferencesSynchronize(prefs);
+ SCPreferencesSynchronize(prefs);
} else {
SCLog(TRUE, LOG_ERR,
CFSTR("Could not acquire network configuration lock: %s"),
SCErrorString(sc_status));
- return;
+ return FALSE;
}
}
- set = SCNetworkSetCreate(prefs);
- if (set == NULL) {
- ok = FALSE;
- sc_status = SCError();
- goto done;
+ current = SCNetworkSetCopyCurrent(prefs);
+ if (current != NULL) {
+ set = current;
}
- bundle = _SC_CFBundleGet();
- if (bundle != NULL) {
- setName = CFBundleCopyLocalizedString(bundle,
- CFSTR("DEFAULT_SET_NAME"),
- CFSTR("Automatic"),
- NULL);
- }
+ if (set == NULL) {
+ set = SCNetworkSetCreate(prefs);
+ if (set == NULL) {
+ ok = FALSE;
+ sc_status = SCError();
+ goto done;
+ }
- ok = SCNetworkSetSetName(set, (setName != NULL) ? setName : CFSTR("Automatic"));
- if (!ok) {
- sc_status = SCError();
- goto done;
- }
+ bundle = _SC_CFBundleGet();
+ if (bundle != NULL) {
+ setName = CFBundleCopyLocalizedString(bundle,
+ CFSTR("DEFAULT_SET_NAME"),
+ CFSTR("Automatic"),
+ NULL);
+ }
- ok = SCNetworkSetSetCurrent(set);
- if (!ok) {
- sc_status = SCError();
- goto done;
+ ok = SCNetworkSetSetName(set, (setName != NULL) ? setName : CFSTR("Automatic"));
+ if (!ok) {
+ sc_status = SCError();
+ goto done;
+ }
+
+ ok = SCNetworkSetSetCurrent(set);
+ if (!ok) {
+ sc_status = SCError();
+ goto done;
+ }
}
ok = SCNetworkSetEstablishDefaultConfiguration(set);
ok = SCPreferencesCommitChanges(prefs);
if (ok) {
SCLog(TRUE, LOG_NOTICE, CFSTR("New network configuration saved"));
+ updated = TRUE;
} else {
sc_status = SCError();
if (sc_status == EROFS) {
/* apply (committed or temporary/read-only) changes */
(void) SCPreferencesApplyChanges(prefs);
- } else if (set != NULL) {
+ } else if ((current == NULL) && (set != NULL)) {
(void) SCNetworkSetRemove(set);
}
(void)SCPreferencesUnlock(prefs);
if (setName != NULL) CFRelease(setName);
if (set != NULL) CFRelease(set);
- return;
+ return updated;
}
static Boolean
-quiet()
+quiet(Boolean *timeout)
{
CFDictionaryRef dict;
- Boolean quiet = FALSE;
+ Boolean _quiet = FALSE;
+ Boolean _timeout = FALSE;
// check if quiet
dict = SCDynamicStoreCopyValue(store, initKey);
if (dict != NULL) {
- if (isA_CFDictionary(dict) &&
- (CFDictionaryContainsKey(dict, CFSTR("*QUIET*")) ||
- CFDictionaryContainsKey(dict, CFSTR("*TIMEOUT*")))) {
- quiet = TRUE;
+ if (isA_CFDictionary(dict)) {
+ if (CFDictionaryContainsKey(dict, CFSTR("*QUIET*"))) {
+ _quiet = TRUE;
+ }
+ if (CFDictionaryContainsKey(dict, CFSTR("*TIMEOUT*"))) {
+ _timeout = TRUE;
+ }
}
CFRelease(dict);
}
- return quiet;
+ if (timeout != NULL) {
+ *timeout = _timeout;
+ }
+ return _quiet;
}
ok = SCDynamicStoreSetNotificationKeys(store, keys, NULL);
CFRelease(keys);
if (!ok) {
- SCPrint(TRUE, stderr,
- CFSTR("SCDynamicStoreSetNotificationKeys() failed: %s\n"), SCErrorString(SCError()));
+ SCLog(TRUE, LOG_ERR,
+ CFSTR("SCDynamicStoreSetNotificationKeys() failed: %s\n"), SCErrorString(SCError()));
watchQuietDisable();
}
static void
watchQuietCallback(SCDynamicStoreRef store, CFArrayRef changedKeys, void *info)
{
- if (quiet()) {
+ Boolean _quiet;
+ Boolean _timeout = FALSE;
+
+ _quiet = quiet(&_timeout);
+ if (_quiet
+#if !TARGET_OS_IPHONE
+ || _timeout
+#endif /* !TARGET_OS_IPHONE */
+ ) {
watchQuietDisable();
- establishNewPreferences();
+ }
+
+ if (_quiet || _timeout) {
+ static int logged = 0;
+
+ (void) establishNewPreferences();
+ if (_timeout && (logged++ == 0)) {
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("Network configuration creation timed out waiting for IORegistry"));
+ }
}
return;
{
+#if !TARGET_OS_IPHONE
if ((notificationType & kSCPreferencesNotificationCommit) == kSCPreferencesNotificationCommit) {
SCNetworkSetRef current;
CFRelease(current);
}
}
+#endif /* !TARGET_OS_IPHONE */
if ((notificationType & kSCPreferencesNotificationApply) != kSCPreferencesNotificationApply) {
return;
}
-__private_extern__
-void
-stop_PreferencesMonitor(CFRunLoopSourceRef stopRls)
-{
- // cleanup
-
- watchQuietDisable();
-
- if (prefs != NULL) {
- if (!SCPreferencesUnscheduleFromRunLoop(prefs,
- CFRunLoopGetCurrent(),
- kCFRunLoopDefaultMode)) {
- SCLog(TRUE, LOG_ERR,
- CFSTR("SCPreferencesUnscheduleFromRunLoop() failed: %s"),
- SCErrorString(SCError()));
- }
- CFRelease(prefs);
- prefs = NULL;
- }
-
- if (store != NULL) {
- CFRelease(store);
- store = NULL;
- }
-
- CFRunLoopSourceSignal(stopRls);
- return;
-}
-
-
__private_extern__
void
prime_PreferencesMonitor()
<string>${EXECUTABLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.10</string>
<key>CFBundleSignature</key>
<string>????</string>
- <key>CFBundleShortVersionString</key>
- <string>1.9.2</string>
<key>CFBundleVersion</key>
- <string>1.9.2</string>
+ <string>1.10</string>
<key>CFPlugInDynamicRegistration</key>
<string>NO</string>
<key>CFPlugInFactories</key>
</dict>
<key>CFPlugInUnloadFunction</key>
<string></string>
+ <key>LimitLoadToSessionType</key>
+ <string>Aqua</string>
</dict>
</plist>
/*
- * Copyright (c) 2007 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2007-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include <asl.h>
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SystemConfiguration.h>
#include <SystemConfiguration/SCPrivate.h>
+#include <IOKit/IOKitLib.h>
+#include <IOKit/IOMessage.h>
#include <ApplicationServices/ApplicationServices.h>
#include "UserEventAgentInterface.h"
-#define MY_BUNDLE_ID CFSTR("com.apple.SystemConfiguration.SCMonitor")
+#define MY_BUNDLE_ID "com.apple.SystemConfiguration.SCMonitor"
#define MY_ICON_PATH "/System/Library/PreferencePanes/Network.prefPane/Contents/Resources/Network.icns"
#define NETWORK_PREF_APP "/System/Library/PreferencePanes/Network.prefPane"
#define NETWORK_PREF_CMD "New Interface"
+/*
+ * The following keys/values control the actions taken when a new interface
+ * has been detected and whether we interact with the user.
+ *
+ * The keys/values can be provided globally (in SCMonitor.plugin's Info.plist
+ * file) or per-inteface in the IORegistry.
+ *
+ * For the "New Interface Detected Action" key we define the following [CFString]
+ * values :
+ *
+ * "None" No action, ignore this interface.
+ * "Prompt" Post a "new interface detected" notification to the user.
+ * "Configure" Automatically configure this interface without any
+ * intervention.
+ *
+ * Note: automatic configuration may require authorization if the logged
+ * in user is NOT "root" (eUID==0) or if the "system.preferences"
+ * administrator right is not currently available.
+ *
+ * An [older] "User Intervention" key is also supported. That CFBoolean
+ * key, if present and TRUE, implies "Configure" configuration of the
+ * interface without intervention.
+ */
+
typedef struct {
UserEventAgentInterfaceStruct *_UserEventAgentInterface;
CFUUIDRef _factoryID;
UInt32 _refCount;
- Boolean no_user_intervention;
+ aslmsg log_msg;
+
+ CFStringRef configuration_action;
CFRunLoopSourceRef monitorRls;
- CFMutableSetRef knownInterfaces;
+ IONotificationPortRef notifyPort;
+ io_iterator_t notifyIterator;
+ CFMutableArrayRef notifyNodes;
+
+ // interfaces that we already know about
+ CFMutableSetRef interfaces_known;
+
+ // interfaces that should be auto-configured (no user notification)
+ CFMutableArrayRef interfaces_configure;
+
+ // interfaces that require user notification
+ CFMutableArrayRef interfaces_prompt;
- CFMutableArrayRef userInterfaces;
CFUserNotificationRef userNotification;
CFRunLoopSourceRef userRls;
} MyType;
#pragma mark -
-#pragma mark Watch for new [network] interfaces
+#pragma mark New interface notification / configuration
static void
-open_NetworkPrefPane(void)
+open_NetworkPrefPane(MyType *myInstance)
{
AEDesc aeDesc = { typeNull, NULL };
CFArrayRef prefArray;
strlen(NETWORK_PREF_CMD),
&aeDesc);
if (status != noErr) {
- SCLog(TRUE, LOG_ERR, CFSTR("SCMonitor: AECreateDesc() failed: %d"), status);
+ SCLOG(NULL, myInstance->log_msg, ASL_LEVEL_ERR, CFSTR("SCMonitor: AECreateDesc() failed: %d"), status);
}
prefSpec.appURL = NULL;
status = LSOpenFromURLSpec(&prefSpec, NULL);
if (status != noErr) {
- SCLog(TRUE, LOG_ERR, CFSTR("SCMonitor: LSOpenFromURLSpec() failed: %d"), status);
+ SCLOG(NULL, myInstance->log_msg, ASL_LEVEL_ERR, CFSTR("SCMonitor: LSOpenFromURLSpec() failed: %d"), status);
}
CFRelease(prefArray);
static void
notify_remove(MyType *myInstance, Boolean cancel)
{
- if (myInstance->userInterfaces != NULL) {
- CFRelease(myInstance->userInterfaces);
- myInstance->userInterfaces = NULL;
+ if (myInstance->interfaces_configure != NULL) {
+ CFRelease(myInstance->interfaces_configure);
+ myInstance->interfaces_configure = NULL;
+ }
+
+ if (myInstance->interfaces_prompt != NULL) {
+ CFRelease(myInstance->interfaces_prompt);
+ myInstance->interfaces_prompt = NULL;
}
if (myInstance->userRls != NULL) {
status = CFUserNotificationCancel(myInstance->userNotification);
if (status != 0) {
- SCLog(TRUE, LOG_ERR,
+ SCLOG(NULL, myInstance->log_msg, ASL_LEVEL_ERR,
CFSTR("SCMonitor: CFUserNotificationCancel() failed, status=%d"),
status);
}
}
}
if (myInstance == NULL) {
- SCLog(TRUE, LOG_ERR, CFSTR("SCMonitor: can't find user notification"));
+ SCLOG(NULL, NULL, ASL_LEVEL_ERR, CFSTR("SCMonitor: can't find user notification"));
return;
}
switch (response_flags & 0x3) {
case kCFUserNotificationDefaultResponse:
// user asked to configure interface
- open_NetworkPrefPane();
+ open_NetworkPrefPane(myInstance);
break;
default:
// user cancelled
CFMutableDictionaryRef dict = NULL;
SInt32 error = 0;
CFIndex i;
- CFMutableArrayRef message;
- CFIndex n = CFArrayGetCount(myInstance->userInterfaces);
+ CFIndex n = CFArrayGetCount(myInstance->interfaces_prompt);
CFURLRef url = NULL;
if (myInstance->userNotification != NULL) {
CFMutableArrayRef save = NULL;
if (n > 0) {
- CFRetain(myInstance->userInterfaces);
- save = myInstance->userInterfaces;
+ CFRetain(myInstance->interfaces_prompt);
+ save = myInstance->interfaces_prompt;
}
notify_remove(myInstance, TRUE);
- myInstance->userInterfaces = save;
+ myInstance->interfaces_prompt = save;
if (n == 0) {
return;
}
&kCFTypeDictionaryValueCallBacks);
// set localization URL
- bundle = CFBundleGetBundleWithIdentifier(MY_BUNDLE_ID);
+ bundle = CFBundleGetBundleWithIdentifier(CFSTR(MY_BUNDLE_ID));
if (bundle != NULL) {
url = CFBundleCopyBundleURL(bundle);
}
+#ifdef MAIN
+ if (url == NULL) {
+ url = CFURLCreateFromFileSystemRepresentation(NULL,
+ (const UInt8 *)"/System/Library/UserEventPlugins/SCMonitor.plugin",
+ strlen("/System/Library/UserEventPlugins/SCMonitor.plugin"),
+ FALSE);
+ if (bundle == NULL) {
+ bundle = CFBundleCreate(NULL, url);
+ }
+ }
+#endif // MAIN
if (url != NULL) {
// set URL
CFDictionarySetValue(dict, kCFUserNotificationLocalizationURLKey, url);
CFRelease(url);
} else {
- SCLog(TRUE, LOG_NOTICE, CFSTR("SCMonitor: can't find bundle"));
+ SCLOG(NULL, myInstance->log_msg, ASL_LEVEL_ERR, CFSTR("SCMonitor: can't find bundle"));
goto done;
}
(n == 1) ? CFSTR("HEADER_1") : CFSTR("HEADER_N"));
// message
- message = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
- CFArrayAppendValue(message,
- (n == 1) ? CFSTR("MESSAGE_S1") : CFSTR("MESSAGE_SN"));
- for (i = 0; i < n; i++) {
+ if (n == 1) {
+ CFStringRef format;
SCNetworkInterfaceRef interface;
+ CFStringRef message;
CFStringRef name;
- interface = CFArrayGetValueAtIndex(myInstance->userInterfaces, i);
+#define MESSAGE_1 "The \"%@\" network interface has not been set up. To set up this interface, use Network Preferences."
+
+ format = CFBundleCopyLocalizedString(bundle,
+ CFSTR("MESSAGE_1"),
+ CFSTR(MESSAGE_1),
+ NULL);
+ interface = CFArrayGetValueAtIndex(myInstance->interfaces_prompt, 0);
name = SCNetworkInterfaceGetLocalizedDisplayName(interface);
- if (n == 1) {
- CFArrayAppendValue(message, name);
- } else {
- CFStringRef str;
+ message = CFStringCreateWithFormat(NULL, NULL, format, name);
+ CFDictionarySetValue(dict, kCFUserNotificationAlertMessageKey, message);
+ CFRelease(message);
+ CFRelease(format);
+ } else {
+ CFMutableArrayRef message;
+ message = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+ CFArrayAppendValue(message, CFSTR("MESSAGE_SN"));
+ for (i = 0; i < n; i++) {
+ SCNetworkInterfaceRef interface;
+ CFStringRef name;
+ CFStringRef str;
+
+ interface = CFArrayGetValueAtIndex(myInstance->interfaces_prompt, i);
+ name = SCNetworkInterfaceGetLocalizedDisplayName(interface);
str = CFStringCreateWithFormat(NULL, NULL, CFSTR("\r\t%@"), name);
CFArrayAppendValue(message, str);
CFRelease(str);
}
+ CFArrayAppendValue(message, CFSTR("MESSAGE_EN"));
+ CFDictionarySetValue(dict, kCFUserNotificationAlertMessageKey, message);
+ CFRelease(message);
}
- CFArrayAppendValue(message,
- (n == 1) ? CFSTR("MESSAGE_E1") : CFSTR("MESSAGE_EN"));
- CFDictionarySetValue(dict, kCFUserNotificationAlertMessageKey, message);
- CFRelease(message);
// button titles
CFDictionaryAddValue(dict, kCFUserNotificationDefaultButtonTitleKey, CFSTR("OPEN_NP"));
&error,
dict);
if (myInstance->userNotification == NULL) {
- SCLog(TRUE, LOG_ERR, CFSTR("SCMonitor: CFUserNotificationCreate() failed, %d"), error);
+ SCLOG(NULL, myInstance->log_msg, ASL_LEVEL_ERR, CFSTR("SCMonitor: CFUserNotificationCreate() failed, %d"), error);
goto done;
}
notify_reply,
0);
if (myInstance->userRls == NULL) {
- SCLog(TRUE, LOG_ERR, CFSTR("SCMonitor: CFUserNotificationCreateRunLoopSource() failed"));
+ SCLOG(NULL, myInstance->log_msg, ASL_LEVEL_ERR, CFSTR("SCMonitor: CFUserNotificationCreateRunLoopSource() failed"));
CFRelease(myInstance->userNotification);
myInstance->userNotification = NULL;
goto done;
{
AuthorizationRef authorization = NULL;
CFIndex i;
- CFIndex n;
+ CFIndex n = CFArrayGetCount(myInstance->interfaces_configure);
Boolean ok;
SCPreferencesRef prefs = NULL;
SCNetworkSetRef set = NULL;
flags,
&authorization);
if (status != errAuthorizationSuccess) {
- SCLog(TRUE, LOG_ERR,
- CFSTR("AuthorizationCreate() failed: status = %d\n"),
+ SCLOG(NULL, myInstance->log_msg, ASL_LEVEL_ERR,
+ CFSTR("AuthorizationCreate() failed: status = %d"),
status);
return;
}
}
}
- n = CFArrayGetCount(myInstance->userInterfaces);
for (i = 0; i < n; i++) {
SCNetworkInterfaceRef interface;
-
- interface = CFArrayGetValueAtIndex(myInstance->userInterfaces, i);
+
+ interface = CFArrayGetValueAtIndex(myInstance->interfaces_configure, i);
ok = SCNetworkSetEstablishDefaultInterfaceConfiguration(set, interface);
if (ok) {
CFStringRef name;
name = SCNetworkInterfaceGetLocalizedDisplayName(interface);
- SCLog(TRUE, LOG_NOTICE, CFSTR("add service for %@"), name);
+ SCLOG(NULL, myInstance->log_msg, ASL_LEVEL_NOTICE, CFSTR("add service for %@"), name);
}
}
-
+
ok = SCPreferencesCommitChanges(prefs);
if (!ok) {
- SCLog(TRUE, LOG_ERR,
- CFSTR("SCPreferencesCommitChanges() failed: %s\n"),
+ SCLOG(NULL, myInstance->log_msg, ASL_LEVEL_ERR,
+ CFSTR("SCPreferencesCommitChanges() failed: %s"),
SCErrorString(SCError()));
- goto done;
- }
-
- ok = SCPreferencesApplyChanges(prefs);
+ goto done;
+ }
+
+ ok = SCPreferencesApplyChanges(prefs);
if (!ok) {
- SCLog(TRUE, LOG_ERR,
- CFSTR("SCPreferencesApplyChanges() failed: %s\n"),
+ SCLOG(NULL, myInstance->log_msg, ASL_LEVEL_ERR,
+ CFSTR("SCPreferencesApplyChanges() failed: %s"),
SCErrorString(SCError()));
- goto done;
- }
+ goto done;
+ }
done :
-
+
if (set != NULL) {
CFRelease(set);
set = NULL;
CFRelease(prefs);
prefs = NULL;
}
-
- if (authorization != NULL) {
- AuthorizationFree(authorization, kAuthorizationFlagDefaults);
- // AuthorizationFree(authorization, kAuthorizationFlagDestroyRights);
- authorization = NULL;
- }
-
- CFRelease(myInstance->userInterfaces);
- myInstance->userInterfaces = NULL;
-
+
+ if (authorization != NULL) {
+ AuthorizationFree(authorization, kAuthorizationFlagDefaults);
+// AuthorizationFree(authorization, kAuthorizationFlagDestroyRights);
+ authorization = NULL;
+ }
+
+ CFRelease(myInstance->interfaces_configure);
+ myInstance->interfaces_configure = NULL;
+
return;
}
+#pragma mark -
+
+
static void
-updateInterfaceList(SCDynamicStoreRef store, CFArrayRef changes, void * arg)
+updateInterfaceList(MyType *myInstance)
{
+ Boolean changed = FALSE;
CFIndex i;
CFArrayRef interfaces;
- MyType *myInstance = (MyType *)arg;
+ CFMutableSetRef interfaces_old = NULL;
CFIndex n;
SCPreferencesRef prefs;
- CFMutableSetRef previouslyKnown = NULL;
SCNetworkSetRef set = NULL;
prefs = SCPreferencesCreate(NULL, CFSTR("SCMonitor"), NULL);
}
}
- previouslyKnown = CFSetCreateMutableCopy(NULL, 0, myInstance->knownInterfaces);
+ interfaces_old = CFSetCreateMutableCopy(NULL, 0, myInstance->interfaces_known);
interfaces = SCNetworkInterfaceCopyAll();
if (interfaces != NULL) {
-
n = CFArrayGetCount(interfaces);
for (i = 0; i < n; i++) {
- CFStringRef bsdName;
SCNetworkInterfaceRef interface;
Boolean ok;
interface = CFArrayGetValueAtIndex(interfaces, i);
- bsdName = SCNetworkInterfaceGetBSDName(interface);
- if (bsdName == NULL) {
- // if no BSD name
+
+ if (_SCNetworkInterfaceIsBuiltin(interface)) {
+ // skip built-in interfaces
continue;
}
- CFSetRemoveValue(previouslyKnown, bsdName);
-
- if (CFSetContainsValue(myInstance->knownInterfaces, bsdName)) {
- // if known interface
+ // track new vs. old (removed) interfaces
+ CFSetRemoveValue(interfaces_old, interface);
+ if (CFSetContainsValue(myInstance->interfaces_known, interface)) {
+ // if we already know about this interface
continue;
}
-
- CFSetAddValue(myInstance->knownInterfaces, bsdName);
+ CFSetAddValue(myInstance->interfaces_known, interface);
+ changed = TRUE;
ok = SCNetworkSetEstablishDefaultInterfaceConfiguration(set, interface);
if (ok) {
+ CFStringRef action;
+
// this is a *new* interface
- if (myInstance->userInterfaces == NULL) {
- myInstance->userInterfaces = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+
+ action = _SCNetworkInterfaceGetConfigurationAction(interface);
+ if (action == NULL) {
+ // if no per-interface action, use [global] default
+ action = myInstance->configuration_action;
+ }
+ if ((action == NULL) ||
+ (!CFEqual(action, kSCNetworkInterfaceConfigurationActionValueNone) &&
+ !CFEqual(action, kSCNetworkInterfaceConfigurationActionValueConfigure))) {
+ action = kSCNetworkInterfaceConfigurationActionValuePrompt;
+ }
+
+ if (CFEqual(action, kSCNetworkInterfaceConfigurationActionValueNone)) {
+ continue;
+ } else if (CFEqual(action, kSCNetworkInterfaceConfigurationActionValueConfigure)) {
+ // configure automatically (without user intervention)
+ if (myInstance->interfaces_configure == NULL) {
+ myInstance->interfaces_configure = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+ }
+ CFArrayAppendValue(myInstance->interfaces_configure, interface);
+ } else {
+ // notify user
+ if (myInstance->interfaces_prompt == NULL) {
+ myInstance->interfaces_prompt = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+ }
+ CFArrayAppendValue(myInstance->interfaces_prompt, interface);
}
- CFArrayAppendValue(myInstance->userInterfaces, interface);
}
}
CFRelease(interfaces);
}
- n = CFSetGetCount(previouslyKnown);
+ // remove any posted notifications for network interfaces that have been removed
+ n = CFSetGetCount(interfaces_old);
if (n > 0) {
- const void * names_q[32];
- const void ** names = names_q;
+ const void * paths_q[32];
+ const void ** paths = paths_q;
- if (n > (CFIndex)(sizeof(names_q) / sizeof(CFTypeRef)))
- names = CFAllocatorAllocate(NULL, n * sizeof(CFTypeRef), 0);
- CFSetGetValues(previouslyKnown, names);
+ if (n > (CFIndex)(sizeof(paths_q) / sizeof(CFTypeRef)))
+ paths = CFAllocatorAllocate(NULL, n * sizeof(CFTypeRef), 0);
+ CFSetGetValues(interfaces_old, paths);
for (i = 0; i < n; i++) {
- if (myInstance->userInterfaces != NULL) {
+ if (myInstance->interfaces_prompt != NULL) {
CFIndex j;
- j = CFArrayGetCount(myInstance->userInterfaces);
- while (--j >= 0) {
- CFStringRef bsdName;
+ j = CFArrayGetCount(myInstance->interfaces_prompt);
+ while (j > 0) {
SCNetworkInterfaceRef interface;
- interface = CFArrayGetValueAtIndex(myInstance->userInterfaces, j);
- bsdName = SCNetworkInterfaceGetBSDName(interface);
- if (CFEqual(bsdName, names[i])) {
+ j--;
+ interface = CFArrayGetValueAtIndex(myInstance->interfaces_prompt, j);
+ if (CFEqual(interface, paths[i])) {
// if we have previously posted a notification
// for this no-longer-present interface
- CFArrayRemoveValueAtIndex(myInstance->userInterfaces, j);
+ CFArrayRemoveValueAtIndex(myInstance->interfaces_prompt, j);
+ changed = TRUE;
}
}
}
- CFSetRemoveValue(myInstance->knownInterfaces, names[i]);
+ CFSetRemoveValue(myInstance->interfaces_known, paths[i]);
}
- if (names != names_q) CFAllocatorDeallocate(NULL, names);
+ if (paths != paths_q) CFAllocatorDeallocate(NULL, paths);
}
done :
- if (myInstance->userInterfaces != NULL) {
- if (myInstance->no_user_intervention) {
- // add network services for new interfaces
+ if (changed) {
+ if (myInstance->interfaces_configure != NULL) {
+ // if we have network services to configure automatically
notify_configure(myInstance);
- } else {
- // post notification
+ }
+
+ if (myInstance->interfaces_prompt != NULL) {
+ // if we have network services that require user intervention
+ // post notification for new interfaces
notify_add(myInstance);
}
}
+ if (interfaces_old != NULL) CFRelease(interfaces_old);
if (set != NULL) CFRelease(set);
CFRelease(prefs);
return;
}
+#pragma mark -
+#pragma mark Watch for new [network] interfaces
+
+
static void
-watcher_remove(MyType *myInstance)
+update_lan(SCDynamicStoreRef store, CFArrayRef changes, void * arg)
{
- if (myInstance->monitorRls != NULL) {
- CFRunLoopSourceInvalidate(myInstance->monitorRls);
- CFRelease(myInstance->monitorRls);
- myInstance->monitorRls = NULL;
- }
-
- if (myInstance->knownInterfaces != NULL) {
- CFRelease(myInstance->knownInterfaces);
- myInstance->knownInterfaces = NULL;
- }
+ MyType *myInstance = (MyType *)arg;
+ updateInterfaceList(myInstance);
return;
}
static void
-watcher_add(MyType *myInstance)
+watcher_add_lan(MyType *myInstance)
{
- CFBundleRef bundle;
SCDynamicStoreContext context = { 0, (void *)myInstance, NULL, NULL, NULL };
CFDictionaryRef dict;
CFStringRef key;
CFArrayRef keys;
SCDynamicStoreRef store;
- bundle = CFBundleGetBundleWithIdentifier(MY_BUNDLE_ID);
- if (bundle != NULL) {
- CFDictionaryRef info;
- CFBooleanRef user_intervention;
-
- info = CFBundleGetInfoDictionary(bundle);
- user_intervention = CFDictionaryGetValue(info, CFSTR("User Intervention"));
- if (isA_CFBoolean(user_intervention)) {
- myInstance->no_user_intervention = !CFBooleanGetValue(user_intervention);
- }
- }
-
- store = SCDynamicStoreCreate(NULL, CFSTR("SCMonitor"), updateInterfaceList, &context);
+ store = SCDynamicStoreCreate(NULL, CFSTR("SCMonitor"), update_lan, &context);
if (store == NULL) {
- SCLog(TRUE, LOG_ERR,
+ SCLOG(NULL, myInstance->log_msg, ASL_LEVEL_ERR,
CFSTR("SCMonitor: SCDynamicStoreCreate() failed: %s"),
SCErrorString(SCError()));
return;
kCFRunLoopDefaultMode);
// initialize the list of known interfaces
- myInstance->knownInterfaces = CFSetCreateMutable(NULL, 0, &kCFTypeSetCallBacks);
+ myInstance->interfaces_known = CFSetCreateMutable(NULL, 0, &kCFTypeSetCallBacks);
dict = SCDynamicStoreCopyValue(store, key);
if (dict != NULL) {
if (isA_CFDictionary(dict)) {
bsdName = CFArrayGetValueAtIndex(interfaces, i);
if (isA_CFString(bsdName)) {
- CFSetAddValue(myInstance->knownInterfaces, bsdName);
+ SCNetworkInterfaceRef interface;
+
+ interface = _SCNetworkInterfaceCreateWithBSDName(NULL, bsdName, kIncludeNoVirtualInterfaces);
+ if (interface != NULL) {
+ CFSetAddValue(myInstance->interfaces_known, interface);
+ CFRelease(interface);
+ }
}
}
}
}
+static void
+watcher_remove_lan(MyType *myInstance)
+{
+ if (myInstance->monitorRls != NULL) {
+ CFRunLoopSourceInvalidate(myInstance->monitorRls);
+ CFRelease(myInstance->monitorRls);
+ myInstance->monitorRls = NULL;
+ }
+
+ if (myInstance->interfaces_known != NULL) {
+ CFRelease(myInstance->interfaces_known);
+ myInstance->interfaces_known = NULL;
+ }
+
+ return;
+}
+
+
+#pragma mark -
+
+
+typedef struct {
+ io_registry_entry_t interface;
+ MyType *myInstance;
+ io_object_t notification;
+} MyNode;
+
+
+static void
+add_node_watcher(MyType *myInstance, io_registry_entry_t node, io_registry_entry_t interface);
+
+
+static void
+update_node(void *refCon, io_service_t service, natural_t messageType, void *messageArgument)
+{
+ CFIndex i;
+ CFDataRef myData = (CFDataRef)refCon;
+ MyType *myInstance;
+ MyNode *myNode;
+
+ myNode = (MyNode *)CFDataGetBytePtr(myData);
+ myInstance = myNode->myInstance;
+
+ switch (messageType) {
+ case kIOMessageServicePropertyChange : {
+ Boolean initializing = FALSE;
+ SCNetworkInterfaceRef interface;
+ CFTypeRef val;
+
+ if (myNode->interface == MACH_PORT_NULL) {
+ // if we are not watching the "Initializing" property
+ return;
+ }
+
+ val = IORegistryEntryCreateCFProperty(service, CFSTR("Initializing"), NULL, 0);
+ if (val != NULL) {
+ initializing = (isA_CFBoolean(val) && CFBooleanGetValue(val));
+ CFRelease(val);
+ if (initializing) {
+ // if initialization not complete, keep watching
+ return;
+ }
+ }
+
+ // node is ready
+ interface = _SCNetworkInterfaceCreateWithIONetworkInterfaceObject(myNode->interface);
+ if (interface != NULL) {
+ CFRelease(interface);
+
+ // watch interface (to see when/if it's removed)
+ add_node_watcher(myInstance, myNode->interface, MACH_PORT_NULL);
+ }
+ break;
+ }
+
+ case kIOMessageServiceIsTerminated :
+ break;
+
+ default :
+ return;
+ }
+
+ // remove no-longer-needed notification
+ if (myNode->interface != MACH_PORT_NULL) {
+ IOObjectRelease(myNode->interface);
+ myNode->interface = MACH_PORT_NULL;
+ }
+ IOObjectRelease(myNode->notification);
+ i = CFArrayGetFirstIndexOfValue(myInstance->notifyNodes,
+ CFRangeMake(0, CFArrayGetCount(myInstance->notifyNodes)),
+ myData);
+ if (i != kCFNotFound) {
+ CFArrayRemoveValueAtIndex(myInstance->notifyNodes, i);
+ if (CFArrayGetCount(myInstance->notifyNodes) == 0) {
+ CFRelease(myInstance->notifyNodes);
+ myInstance->notifyNodes = NULL;
+ }
+ }
+
+ updateInterfaceList(myInstance);
+ return;
+}
+
+
+static void
+add_node_watcher(MyType *myInstance, io_registry_entry_t node, io_registry_entry_t interface)
+{
+ kern_return_t kr;
+ CFMutableDataRef myData;
+ MyNode *myNode;
+
+ // wait for initialization to complete
+ myData = CFDataCreateMutable(NULL, sizeof(MyNode));
+ CFDataSetLength(myData, sizeof(MyNode));
+ myNode = (MyNode *)CFDataGetBytePtr(myData);
+ bzero(myNode, sizeof(MyNode));
+ if (interface != MACH_PORT_NULL) {
+ IOObjectRetain(interface);
+ }
+ myNode->interface = interface;
+ myNode->myInstance = myInstance;
+ myNode->notification = MACH_PORT_NULL;
+
+ kr = IOServiceAddInterestNotification(myInstance->notifyPort, // IONotificationPortRef
+ node, // io_service_t
+ kIOGeneralInterest, // interestType
+ update_node, // IOServiceInterestCallback
+ (void *)myData, // refCon
+ &myNode->notification); // notification
+ if (kr == KERN_SUCCESS) {
+ if (myInstance->notifyNodes == NULL) {
+ myInstance->notifyNodes = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+ }
+ CFArrayAppendValue(myInstance->notifyNodes, myData);
+ } else {
+ SCLOG(NULL, myInstance->log_msg, ASL_LEVEL_ERR,
+ CFSTR("add_init_watcher IOServiceAddInterestNotification() failed, kr = 0x%x"), kr);
+ }
+ CFRelease(myData);
+}
+
+
+static void
+add_init_watcher(MyType *myInstance, io_registry_entry_t interface)
+{
+ kern_return_t kr;
+ io_registry_entry_t node = interface;
+ CFTypeRef val = NULL;
+
+ while (node != MACH_PORT_NULL) {
+ io_registry_entry_t parent;
+
+ val = IORegistryEntryCreateCFProperty(node, CFSTR("HiddenPort"), NULL, 0);
+ if (val != NULL) {
+ CFRelease(val);
+ val = NULL;
+ break;
+ }
+
+ val = IORegistryEntryCreateCFProperty(node, CFSTR("Initializing"), NULL, 0);
+ if (val != NULL) {
+ break;
+ }
+
+ parent = MACH_PORT_NULL;
+ kr = IORegistryEntryGetParentEntry(node, kIOServicePlane, &parent);
+ switch (kr) {
+ case kIOReturnSuccess : // if we have a parent node
+ case kIOReturnNoDevice : // if we have hit the root node
+ break;
+ default :
+ SCLOG(NULL, myInstance->log_msg, ASL_LEVEL_ERR, CFSTR("add_init_watcher IORegistryEntryGetParentEntry() failed, kr = 0x%x"), kr);
+ break;
+ }
+ if (node != interface) {
+ IOObjectRelease(node);
+ }
+ node = parent;
+ }
+
+ if (val != NULL) {
+ if (isA_CFBoolean(val) && CFBooleanGetValue(val)) {
+ // watch the "Initializing" node
+ add_node_watcher(myInstance, node, interface);
+ }
+
+ CFRelease(val);
+ }
+
+ if ((node != MACH_PORT_NULL) && (node != interface)) {
+ IOObjectRelease(node);
+ }
+
+ return;
+}
+
+
+static void
+update_serial(void *refcon, io_iterator_t iter)
+{
+ MyType *myInstance = (MyType *)refcon;
+ io_registry_entry_t obj;
+
+ while ((obj = IOIteratorNext(iter)) != MACH_PORT_NULL) {
+ SCNetworkInterfaceRef interface;
+
+ interface = _SCNetworkInterfaceCreateWithIONetworkInterfaceObject(obj);
+ if (interface != NULL) {
+ CFRelease(interface);
+
+ // watch interface (to see when/if it's removed)
+ add_node_watcher(myInstance, obj, MACH_PORT_NULL);
+ } else {
+ // check interface, watch if initializing
+ add_init_watcher(myInstance, obj);
+ }
+
+ IOObjectRelease(obj);
+ }
+
+ updateInterfaceList(myInstance);
+ return;
+}
+
+
+static void
+watcher_add_serial(MyType *myInstance)
+{
+ kern_return_t kr;
+
+ myInstance->notifyPort = IONotificationPortCreate(kIOMasterPortDefault);
+ if (myInstance->notifyPort == NULL) {
+ SCLOG(NULL, myInstance->log_msg, ASL_LEVEL_ERR,
+ CFSTR("SCMonitor: IONotificationPortCreate failed"));
+ return;
+ }
+
+ // watch for the introduction of new network serial devices
+ kr = IOServiceAddMatchingNotification(myInstance->notifyPort,
+ kIOFirstMatchNotification,
+ IOServiceMatching("IOSerialBSDClient"),
+ &update_serial,
+ (void *)myInstance, // refCon
+ &myInstance->notifyIterator); // notification
+ if (kr != KERN_SUCCESS) {
+ SCLOG(NULL, myInstance->log_msg, ASL_LEVEL_ERR,
+ CFSTR("SCMonitor : IOServiceAddMatchingNotification returned 0x%x"),
+ kr);
+ return;
+ }
+
+ myInstance->notifyNodes = NULL;
+
+ // Get the current list of matches and arm the notification for
+ // future interface arrivals.
+ update_serial((void *)myInstance, myInstance->notifyIterator);
+
+ // and keep watching
+ CFRunLoopAddSource(CFRunLoopGetCurrent(),
+ IONotificationPortGetRunLoopSource(myInstance->notifyPort),
+ kCFRunLoopDefaultMode);
+ return;
+}
+
+
+static void
+watcher_remove_serial(MyType *myInstance)
+{
+ if (myInstance->notifyNodes != NULL) {
+ CFIndex i;
+ CFIndex n = CFArrayGetCount(myInstance->notifyNodes);
+
+ for (i = 0; i < n; i++) {
+ CFDataRef myData;
+ MyNode *myNode;
+
+ myData = CFArrayGetValueAtIndex(myInstance->notifyNodes, i);
+ myNode = (MyNode *)CFDataGetBytePtr(myData);
+ if (myNode->interface != MACH_PORT_NULL) {
+ IOObjectRelease(myNode->interface);
+ }
+ IOObjectRelease(myNode->notification);
+ }
+
+ CFRelease(myInstance->notifyNodes);
+ myInstance->notifyNodes = NULL;
+ }
+
+ if (myInstance->notifyIterator != MACH_PORT_NULL) {
+ IOObjectRelease(myInstance->notifyIterator);
+ myInstance->notifyIterator = MACH_PORT_NULL;
+ }
+
+ if (myInstance->notifyPort != MACH_PORT_NULL) {
+ IONotificationPortDestroy(myInstance->notifyPort);
+ myInstance->notifyPort = NULL;
+ }
+
+ return;
+}
+
+
+#pragma mark -
+
+
+static void
+watcher_add(MyType *myInstance)
+{
+ CFBundleRef bundle;
+
+ if (myInstance->log_msg == NULL) {
+ myInstance->log_msg = asl_new(ASL_TYPE_MSG);
+ asl_set(myInstance->log_msg, ASL_KEY_FACILITY, MY_BUNDLE_ID);
+ }
+
+ bundle = CFBundleGetBundleWithIdentifier(CFSTR(MY_BUNDLE_ID));
+ if (bundle != NULL) {
+ CFStringRef action;
+ CFDictionaryRef info;
+
+ info = CFBundleGetInfoDictionary(bundle);
+ action = CFDictionaryGetValue(info, kSCNetworkInterfaceConfigurationActionKey);
+ action = isA_CFString(action);
+
+ if (action != NULL) {
+ myInstance->configuration_action = action;
+ } else {
+ CFBooleanRef user_intervention;
+
+ user_intervention = CFDictionaryGetValue(info, CFSTR("User Intervention"));
+ if (isA_CFBoolean(user_intervention) && !CFBooleanGetValue(user_intervention)) {
+ myInstance->configuration_action = kSCNetworkInterfaceConfigurationActionValueConfigure;
+ }
+ }
+ }
+
+ watcher_add_lan(myInstance);
+ watcher_add_serial(myInstance);
+ return;
+}
+
+
+static void
+watcher_remove(MyType *myInstance)
+{
+ watcher_remove_lan(myInstance);
+ watcher_remove_serial(myInstance);
+
+ asl_free(myInstance->log_msg);
+ myInstance->log_msg = NULL;
+ return;
+}
+
+
#pragma mark -
#pragma mark UserEventAgent stubs
/*
- * Copyright (c) 2004-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2004-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include <SystemConfiguration/SCValidation.h>
#include <SystemConfiguration/SCPrivate.h>
-#include <SystemConfiguration/BondConfiguration.h>
-
#include <ifaddrs.h>
#include <pthread.h>
#include <unistd.h>
static Boolean
_SCBondInterfaceSetMemberInterfaces(SCBondInterfaceRef bond, CFArrayRef members)
{
+ CFIndex i;
SCNetworkInterfacePrivateRef interfacePrivate = (SCNetworkInterfacePrivateRef)bond;
+ CFIndex n;
+ CFMutableArrayRef newMembers;
Boolean ok = TRUE;
+ n = (members != NULL) ? CFArrayGetCount(members) : 0;
+
// set member interfaces in the stored preferences
if (interfacePrivate->prefs != NULL) {
CFDictionaryRef dict;
- CFIndex i;
- CFIndex n;
CFMutableDictionaryRef newDict;
- CFMutableArrayRef newMembers;
CFStringRef path;
path = CFStringCreateWithFormat(NULL,
}
newMembers = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
- n = (members != NULL) ? CFArrayGetCount(members) : 0;
for (i = 0; i < n; i++) {
SCNetworkInterfaceRef interface;
CFStringRef memberName;
}
if (ok) {
- CFRelease(interfacePrivate->bond.interfaces);
- if (members == NULL) {
- interfacePrivate->bond.interfaces = CFArrayCreate(NULL, NULL, 0, &kCFTypeArrayCallBacks);
- } else {
- interfacePrivate->bond.interfaces = CFArrayCreateCopy(NULL, members);
+ newMembers = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+ for (i = 0; i < n; i++) {
+ SCNetworkInterfaceRef member;
+ SCNetworkInterfacePrivateRef newMember;
+
+ member = CFArrayGetValueAtIndex(members, i);
+ newMember = __SCNetworkInterfaceCreateCopy(NULL,
+ member,
+ interfacePrivate->prefs,
+ interfacePrivate->serviceID);
+ CFArrayAppendValue(newMembers, newMember);
+ CFRelease(newMember);
}
+ CFRelease(interfacePrivate->bond.interfaces);
+ interfacePrivate->bond.interfaces = newMembers;
}
return ok;
return ok;
}
-
-
-#pragma mark -
-#pragma mark Deprecated SPIs (remove when no longer referenced)
-
-
-/* ---------- Bond "device" ---------- */
-
-Boolean
-IsBondSupported(CFStringRef device)
-{
- SCNetworkInterfaceRef interface;
- SCNetworkInterfacePrivateRef interfacePrivate;
- Boolean isBond = FALSE;
-
- interface = _SCNetworkInterfaceCreateWithBSDName(NULL, device,
- kIncludeNoVirtualInterfaces);
- interfacePrivate = (SCNetworkInterfacePrivateRef)interface;
- isBond = interfacePrivate->supportsBond;
- CFRelease(interface);
-
- return isBond;
-}
-
-/* ---------- BondInterface ---------- */
-
-typedef struct {
-
- /* base CFType information */
- CFRuntimeBase cfBase;
-
- /* bond interface configuration */
- CFStringRef ifname; // e.g. bond0, bond1, ...
- CFArrayRef devices; // e.g. en0, en1, ...
- CFDictionaryRef options; // e.g. UserDefinedName
-
-} BondInterfacePrivate, * BondInterfacePrivateRef;
-
-
-static CFStringRef __BondInterfaceCopyDescription (CFTypeRef cf);
-static void __BondInterfaceDeallocate (CFTypeRef cf);
-static Boolean __BondInterfaceEqual (CFTypeRef cf1, CFTypeRef cf2);
-
-
-static const CFRuntimeClass __BondInterfaceClass = {
- 0, // version
- "BondInterface", // className
- NULL, // init
- NULL, // copy
- __BondInterfaceDeallocate, // dealloc
- __BondInterfaceEqual, // equal
- NULL, // hash
- NULL, // copyFormattingDesc
- __BondInterfaceCopyDescription // copyDebugDesc
-};
-
-
-static CFTypeID __kBondInterfaceTypeID = _kCFRuntimeNotATypeID;
-
-
-static pthread_once_t bondInterface_init = PTHREAD_ONCE_INIT;
-
-
-static CFStringRef
-__BondInterfaceCopyDescription(CFTypeRef cf)
-{
- CFAllocatorRef allocator = CFGetAllocator(cf);
- CFMutableStringRef result;
- BondInterfacePrivateRef bondPrivate = (BondInterfacePrivateRef)cf;
-
- result = CFStringCreateMutable(allocator, 0);
- CFStringAppendFormat(result, NULL, CFSTR("<BondInterface %p [%p]> {"), cf, allocator);
- CFStringAppendFormat(result, NULL, CFSTR("if = %@"), bondPrivate->ifname);
- if (bondPrivate->devices != NULL) {
- CFIndex i;
- CFIndex n;
-
- CFStringAppendFormat(result, NULL, CFSTR(", devices ="));
-
- n = CFArrayGetCount(bondPrivate->devices);
- for (i = 0; i < n; i++) {
- CFStringAppendFormat(result,
- NULL,
- CFSTR(" %@"),
- CFArrayGetValueAtIndex(bondPrivate->devices, i));
- }
- }
- if (bondPrivate->options != NULL) {
- CFStringAppendFormat(result, NULL, CFSTR(", options = %@"), bondPrivate->options);
- }
- CFStringAppendFormat(result, NULL, CFSTR("}"));
-
- return result;
-}
-
-
-static void
-__BondInterfaceDeallocate(CFTypeRef cf)
-{
- BondInterfacePrivateRef bondPrivate = (BondInterfacePrivateRef)cf;
-
- /* release resources */
-
- CFRelease(bondPrivate->ifname);
- if (bondPrivate->devices) CFRelease(bondPrivate->devices);
- if (bondPrivate->options) CFRelease(bondPrivate->options);
-
- return;
-}
-
-
-static Boolean
-__BondInterfaceEquiv(CFTypeRef cf1, CFTypeRef cf2)
-{
- BondInterfacePrivateRef bond1 = (BondInterfacePrivateRef)cf1;
- BondInterfacePrivateRef bond2 = (BondInterfacePrivateRef)cf2;
-
- if (bond1 == bond2)
- return TRUE;
-
- if (!CFEqual(bond1->ifname, bond2->ifname))
- return FALSE; // if not the same interface
-
- if (!CFEqual(bond1->devices, bond2->devices))
- return FALSE; // if not the same device
-
- return TRUE;
-}
-
-
-static Boolean
-__BondInterfaceEqual(CFTypeRef cf1, CFTypeRef cf2)
-{
- BondInterfacePrivateRef bond1 = (BondInterfacePrivateRef)cf1;
- BondInterfacePrivateRef bond2 = (BondInterfacePrivateRef)cf2;
-
- if (!__BondInterfaceEquiv(bond1, bond2))
- return FALSE; // if not the same Bond interface/devices
-
- if (bond1->options != bond2->options) {
- // if the options may differ
- if ((bond1->options != NULL) && (bond2->options != NULL)) {
- // if both Bonds have options
- if (!CFEqual(bond1->options, bond2->options)) {
- // if the options are not equal
- return FALSE;
- }
- } else {
- // if only one Bond has options
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-
-static void
-__BondInterfaceInitialize(void)
-{
- __kBondInterfaceTypeID = _CFRuntimeRegisterClass(&__BondInterfaceClass);
- return;
-}
-
-
-static __inline__ CFTypeRef
-isA_BondInterface(CFTypeRef obj)
-{
- return (isA_CFType(obj, BondInterfaceGetTypeID()));
-}
-
-
-CFTypeID
-BondInterfaceGetTypeID(void)
-{
- pthread_once(&bondInterface_init, __BondInterfaceInitialize); /* initialize runtime */
- return __kBondInterfaceTypeID;
-}
-
-
-static BondInterfaceRef
-__BondInterfaceCreatePrivate(CFAllocatorRef allocator,
- CFStringRef ifname)
-{
- BondInterfacePrivateRef bondPrivate;
- uint32_t size;
-
- /* initialize runtime */
- pthread_once(&bondInterface_init, __BondInterfaceInitialize);
-
- /* allocate bond */
- size = sizeof(BondInterfacePrivate) - sizeof(CFRuntimeBase);
- bondPrivate = (BondInterfacePrivateRef)_CFRuntimeCreateInstance(allocator,
- __kBondInterfaceTypeID,
- size,
- NULL);
- if (bondPrivate == NULL) {
- return NULL;
- }
-
- /* establish the bond */
-
- bondPrivate->ifname = CFStringCreateCopy(allocator, ifname);
- bondPrivate->devices = NULL;
- bondPrivate->options = NULL;
-
- return (BondInterfaceRef)bondPrivate;
-}
-
-
-CFStringRef
-BondInterfaceGetInterface(BondInterfaceRef bond)
-{
- BondInterfacePrivateRef bondPrivate = (BondInterfacePrivateRef)bond;
- CFStringRef bond_if = NULL;
-
- if (isA_BondInterface(bond)) {
- bond_if = bondPrivate->ifname;
- }
-
- return bond_if;
-}
-
-
-CFArrayRef
-BondInterfaceGetDevices(BondInterfaceRef bond)
-{
- BondInterfacePrivateRef bondPrivate = (BondInterfacePrivateRef)bond;
- CFArrayRef bond_devices = NULL;
-
- if (isA_BondInterface(bond)) {
- bond_devices = bondPrivate->devices;
- }
-
- return bond_devices;
-}
-
-
-CFDictionaryRef
-BondInterfaceGetOptions(BondInterfaceRef bond)
-{
- BondInterfacePrivateRef bondPrivate = (BondInterfacePrivateRef)bond;
- CFDictionaryRef bond_options = NULL;
-
- if (isA_BondInterface(bond)) {
- bond_options = bondPrivate->options;
- }
-
- return bond_options;
-}
-
-
-static void
-BondInterfaceSetDevices(BondInterfaceRef bond, CFArrayRef newDevices)
-{
- BondInterfacePrivateRef bondPrivate = (BondInterfacePrivateRef)bond;
-
- if (isA_BondInterface(bond)) {
- CFAllocatorRef allocator = CFGetAllocator(bond);
-
- if (bondPrivate->devices != NULL) CFRelease(bondPrivate->devices);
- if ((newDevices != NULL) && (CFArrayGetCount(newDevices) > 0)) {
- bondPrivate->devices = CFArrayCreateCopy(allocator, newDevices);
- } else {
- bondPrivate->devices = NULL;
- }
- }
-
- return;
-}
-
-
-static void
-BondInterfaceSetOptions(BondInterfaceRef bond, CFDictionaryRef newOptions)
-{
- BondInterfacePrivateRef bondPrivate = (BondInterfacePrivateRef)bond;
-
- if (isA_BondInterface(bond)) {
- CFAllocatorRef allocator = CFGetAllocator(bond);
-
- if (bondPrivate->options) CFRelease(bondPrivate->options);
- if (newOptions != NULL) {
- bondPrivate->options = CFDictionaryCreateCopy(allocator, newOptions);
- } else {
- bondPrivate->options = NULL;
- }
- }
-
- return;
-}
-
-
-/* ---------- BondPreferences ---------- */
-
-typedef struct {
-
- /* base CFType information */
- CFRuntimeBase cfBase;
-
- /* lock */
- pthread_mutex_t lock;
-
- /* underlying preferences */
- SCPreferencesRef prefs;
-
- /* base Bonds (before any commits) */
- CFArrayRef bBase;
-
-} BondPreferencesPrivate, * BondPreferencesPrivateRef;
-
-
-static CFStringRef __BondPreferencesCopyDescription (CFTypeRef cf);
-static void __BondPreferencesDeallocate (CFTypeRef cf);
-
-
-static const CFRuntimeClass __BondPreferencesClass = {
- 0, // version
- "BondPreferences", // className
- NULL, // init
- NULL, // copy
- __BondPreferencesDeallocate, // dealloc
- NULL, // equal
- NULL, // hash
- NULL, // copyFormattingDesc
- __BondPreferencesCopyDescription // copyDebugDesc
-};
-
-
-static CFTypeID __kBondPreferencesTypeID = _kCFRuntimeNotATypeID;
-
-
-static pthread_once_t bondPreferences_init = PTHREAD_ONCE_INIT;
-
-
-static CFStringRef
-__BondPreferencesCopyDescription(CFTypeRef cf)
-{
- CFAllocatorRef allocator = CFGetAllocator(cf);
- CFIndex i;
- CFArrayRef keys;
- CFIndex n;
- BondPreferencesPrivateRef prefsPrivate = (BondPreferencesPrivateRef)cf;
- CFMutableStringRef result;
-
- result = CFStringCreateMutable(allocator, 0);
- CFStringAppendFormat(result, NULL, CFSTR("<BondPreferences %p [%p]> {"), cf, allocator);
-
- keys = SCPreferencesCopyKeyList(prefsPrivate->prefs);
- n = CFArrayGetCount(keys);
- for (i = 0; i < n; i++) {
- CFStringRef key;
- CFPropertyListRef val;
-
- key = CFArrayGetValueAtIndex(keys, i);
- val = SCPreferencesGetValue(prefsPrivate->prefs, key);
-
- CFStringAppendFormat(result, NULL, CFSTR("%@ : %@"), key, val);
- }
- CFRelease(keys);
-
- CFStringAppendFormat(result, NULL, CFSTR(" }"));
-
- return result;
-}
-
-
-static void
-__BondPreferencesDeallocate(CFTypeRef cf)
-{
- BondPreferencesPrivateRef prefsPrivate = (BondPreferencesPrivateRef)cf;
-
- /* release resources */
-
- pthread_mutex_destroy(&prefsPrivate->lock);
-
- if (prefsPrivate->prefs) CFRelease(prefsPrivate->prefs);
- if (prefsPrivate->bBase) CFRelease(prefsPrivate->bBase);
-
- return;
-}
-
-
-static void
-__BondPreferencesInitialize(void)
-{
- __kBondPreferencesTypeID = _CFRuntimeRegisterClass(&__BondPreferencesClass);
- return;
-}
-
-
-static __inline__ CFTypeRef
-isA_BondPreferences(CFTypeRef obj)
-{
- return (isA_CFType(obj, BondPreferencesGetTypeID()));
-}
-
-
-CFArrayRef
-_BondPreferencesCopyActiveInterfaces()
-{
- CFArrayCallBacks callbacks;
- struct ifaddrs *ifap;
- struct ifaddrs *ifp;
- int s;
- CFMutableArrayRef bonds = NULL;
-
- if (getifaddrs(&ifap) == -1) {
- _SCErrorSet(errno);
- SCLog(TRUE, LOG_ERR, CFSTR("getifaddrs() failed: %s"), strerror(errno));
- return NULL;
- }
-
- s = inet_dgram_socket();
- if (s == -1) {
- _SCErrorSet(errno);
- goto done;
- }
-
- callbacks = kCFTypeArrayCallBacks;
- callbacks.equal = __BondInterfaceEquiv;
- bonds = CFArrayCreateMutable(NULL, 0, &callbacks);
-
- for (ifp = ifap; ifp != NULL; ifp = ifp->ifa_next) {
- BondInterfaceRef bond;
- CFStringRef bond_if;
- CFMutableArrayRef devices = NULL;
- struct if_bond_status_req *ibsr_p;
- struct if_data *if_data;
-
- if_data = (struct if_data *)ifp->ifa_data;
- if (if_data == NULL
- || ifp->ifa_addr->sa_family != AF_LINK
- || if_data->ifi_type != IFT_IEEE8023ADLAG) {
- continue;
- }
- ibsr_p = if_bond_status_req_copy(s, ifp->ifa_name);
- if (ibsr_p == NULL) {
- if (errno == EBUSY) {
- continue;
- }
-
- _SCErrorSet(errno);
- SCLog(TRUE, LOG_ERR,
- CFSTR("if_bond_status_req_copy(%s) failed: %s"),
- ifp->ifa_name,
- strerror(errno));
- CFRelease(bonds);
- bonds = NULL;
- goto done;
- }
- if (ibsr_p->ibsr_total > 0) {
- int i;
- struct if_bond_status * ibs_p;
- devices = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
-
- // iterate over each member device
- ibs_p = (struct if_bond_status *)ibsr_p->ibsr_buffer;
- for (i = 0; i < ibsr_p->ibsr_total; i++) {
- CFStringRef device;
- char if_name[IFNAMSIZ + 1];
-
- bzero(&if_name, sizeof(if_name));
- bcopy(ibs_p[i].ibs_if_name, if_name, IFNAMSIZ);
- device = CFStringCreateWithCString(NULL, if_name, kCFStringEncodingASCII);
- CFArrayAppendValue(devices, device);
- CFRelease(device);
- }
- }
- free(ibsr_p);
- bond_if = CFStringCreateWithCString(NULL, ifp->ifa_name, kCFStringEncodingASCII);
- bond = __BondInterfaceCreatePrivate(NULL, bond_if);
- CFRelease(bond_if);
-
- if (devices != NULL) {
- BondInterfaceSetDevices(bond, devices);
- CFRelease(devices);
- }
- CFArrayAppendValue(bonds, bond);
- CFRelease(bond);
- }
-
- done :
-
- (void) close(s);
- freeifaddrs(ifap);
- return bonds;
-}
-
-
-static CFIndex
-findBond(CFArrayRef bonds, CFStringRef interface)
-{
- CFIndex found = kCFNotFound;
- CFIndex i;
- CFIndex n;
-
- n = isA_CFArray(bonds) ? CFArrayGetCount(bonds) : 0;
- for (i = 0; i < n; i++) {
- CFDictionaryRef bond_dict;
- CFStringRef bond_if;
-
- bond_dict = CFArrayGetValueAtIndex(bonds, i);
- if (!isA_CFDictionary(bond_dict)) {
- break; // if the prefs are confused
- }
-
- bond_if = CFDictionaryGetValue(bond_dict, __kBondInterface_interface);
- if (!isA_CFString(bond_if)) {
- break; // if the prefs are confused
- }
-
- if (!CFEqual(bond_if, interface)) {
- continue; // if not a match
- }
-
- // if we have found a match
- found = i;
- break;
- }
-
- return found;
-}
-
-
-static void
-setConfigurationChanged(BondPreferencesRef prefs)
-{
- BondPreferencesPrivateRef prefsPrivate = (BondPreferencesPrivateRef)prefs;
-
- /*
- * to facilitate device configuration we will take
- * a snapshot of the Bond preferences before any
- * changes are made. Then, when the changes are
- * applied we can compare what we had to what we
- * want and configured the system accordingly.
- */
- if (prefsPrivate->bBase == NULL) {
- prefsPrivate->bBase = BondPreferencesCopyInterfaces(prefs);
- }
-
- return;
-}
-
-
-CFTypeID
-BondPreferencesGetTypeID(void)
-{
- pthread_once(&bondPreferences_init, __BondPreferencesInitialize); /* initialize runtime */
- return __kBondPreferencesTypeID;
-}
-
-
-BondPreferencesRef
-BondPreferencesCreate(CFAllocatorRef allocator)
-{
- CFBundleRef bundle;
- CFStringRef bundleID = NULL;
- CFStringRef name = CFSTR("BondConfiguration");
- BondPreferencesPrivateRef prefsPrivate;
- uint32_t size;
-
- /* initialize runtime */
- pthread_once(&bondPreferences_init, __BondPreferencesInitialize);
-
- /* allocate preferences */
- size = sizeof(BondPreferencesPrivate) - sizeof(CFRuntimeBase);
- prefsPrivate = (BondPreferencesPrivateRef)_CFRuntimeCreateInstance(allocator,
- __kBondPreferencesTypeID,
- size,
- NULL);
- if (prefsPrivate == NULL) {
- return NULL;
- }
-
- /* establish the prefs */
-
- pthread_mutex_init(&prefsPrivate->lock, NULL);
-
- bundle = CFBundleGetMainBundle();
- if (bundle) {
- bundleID = CFBundleGetIdentifier(bundle);
- if (bundleID) {
- CFRetain(bundleID);
- } else {
- CFURLRef url;
-
- url = CFBundleCopyExecutableURL(bundle);
- if (url) {
- bundleID = CFURLCopyPath(url);
- CFRelease(url);
- }
- }
- }
-
- if (bundleID) {
- CFStringRef fullName;
-
- if (CFEqual(bundleID, CFSTR("/"))) {
- CFRelease(bundleID);
- bundleID = CFStringCreateWithFormat(allocator, NULL, CFSTR("(%d)"), getpid());
- }
-
- fullName = CFStringCreateWithFormat(allocator, NULL, CFSTR("%@:%@"), bundleID, name);
- name = fullName;
- CFRelease(bundleID);
- } else {
- CFRetain(name);
- }
-
- prefsPrivate->prefs = SCPreferencesCreate(allocator, name, BOND_PREFERENCES_ID);
- CFRelease(name);
-
- prefsPrivate->bBase = NULL;
-
- return (BondPreferencesRef)prefsPrivate;
-}
-
-
-CFArrayRef
-BondPreferencesCopyInterfaces(BondPreferencesRef prefs)
-{
- CFAllocatorRef allocator;
- CFArrayCallBacks callbacks;
- CFIndex i;
- CFIndex n;
- BondPreferencesPrivateRef prefsPrivate = (BondPreferencesPrivateRef)prefs;
- CFMutableArrayRef result;
- CFArrayRef bonds;
-
- if (!isA_BondPreferences(prefs)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return NULL;
- }
-
- allocator = CFGetAllocator(prefs);
- callbacks = kCFTypeArrayCallBacks;
- callbacks.equal = __BondInterfaceEquiv;
- result = CFArrayCreateMutable(allocator, 0, &callbacks);
-
- bonds = SCPreferencesGetValue(prefsPrivate->prefs, BOND_PREFERENCES_BONDS);
- if ((bonds != NULL) && !isA_CFArray(bonds)) {
- goto error; // if the prefs are confused
- }
-
- n = (bonds != NULL) ? CFArrayGetCount(bonds) : 0;
- for (i = 0; i < n; i++) {
- BondInterfaceRef bond;
- CFDictionaryRef bond_dict;
- CFStringRef bond_if;
- CFArrayRef devices;
- CFDictionaryRef options;
-
- bond_dict = CFArrayGetValueAtIndex(bonds, i);
- if (!isA_CFDictionary(bond_dict)) {
- goto error; // if the prefs are confused
- }
-
- bond_if = CFDictionaryGetValue(bond_dict, __kBondInterface_interface);
- if (!isA_CFString(bond_if)) {
- goto error; // if the prefs are confused
- }
-
-
- devices = CFDictionaryGetValue(bond_dict, __kBondInterface_devices);
- if ((devices != NULL) && !isA_CFArray(devices)) {
- goto error; // if the prefs are confused
- }
-
- options = CFDictionaryGetValue(bond_dict, __kBondInterface_options);
- if ((options != NULL) && !isA_CFDictionary(options)) {
- goto error; // if the prefs are confused
- }
-
- bond = __BondInterfaceCreatePrivate(allocator, bond_if);
- BondInterfaceSetDevices(bond, devices);
- BondInterfaceSetOptions(bond, options);
- CFArrayAppendValue(result, bond);
- CFRelease(bond);
- }
-
- return result;
-
- error :
-
- _SCErrorSet(kSCStatusFailed);
- CFRelease(result);
- return NULL;
-}
-
-
-BondInterfaceRef
-BondPreferencesCreateInterface(BondPreferencesRef prefs)
-{
- CFArrayRef active_bonds = NULL;
- CFAllocatorRef allocator;
- CFArrayRef config_bonds;
- CFIndex i;
- CFIndex nActive;
- CFIndex nConfig;
- BondInterfaceRef newBond = NULL;
- BondPreferencesPrivateRef prefsPrivate = (BondPreferencesPrivateRef)prefs;
-
- if (!isA_BondPreferences(prefs)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return NULL;
- }
-
- pthread_mutex_lock(&prefsPrivate->lock);
-
- /* get "configured" Bonds (and check to ensure the device is available) */
- config_bonds = SCPreferencesGetValue(prefsPrivate->prefs, BOND_PREFERENCES_BONDS);
- if ((config_bonds != NULL) && !isA_CFArray(config_bonds)) {
- // if the prefs are confused
- _SCErrorSet(kSCStatusFailed);
- goto done;
- }
-
- nConfig = (config_bonds != NULL) ? CFArrayGetCount(config_bonds) : 0;
-
- /* get "active" Bonds */
- active_bonds = _BondPreferencesCopyActiveInterfaces();
- nActive = isA_CFArray(active_bonds) ? CFArrayGetCount(active_bonds) : 0;
-
- /* create a new bond using an unused interface name */
- allocator = CFGetAllocator(prefs);
-
- for (i = 0; newBond == NULL; i++) {
- CFIndex j;
- CFMutableDictionaryRef newDict;
- CFMutableArrayRef newBonds;
- CFStringRef bond_if;
-
- bond_if = CFStringCreateWithFormat(allocator, NULL, CFSTR("bond%d"), i);
-
- for (j = 0; j < nActive; j++) {
- CFStringRef active_if;
- BondInterfaceRef active_bond;
-
- active_bond = CFArrayGetValueAtIndex(active_bonds, j);
- active_if = BondInterfaceGetInterface(active_bond);
-
- if (CFEqual(bond_if, active_if)) {
- goto next_if; // if bond interface name not available
- }
- }
-
- for (j = 0; j < nConfig; j++) {
- CFDictionaryRef config;
- CFStringRef config_if;
-
- config = CFArrayGetValueAtIndex(config_bonds, j);
- if (!isA_CFDictionary(config)) {
- // if the prefs are confused
- _SCErrorSet(kSCStatusFailed);
- CFRelease(bond_if);
- goto done;
- }
-
- config_if = CFDictionaryGetValue(config, __kBondInterface_interface);
- if (!isA_CFString(config_if)) {
- // if the prefs are confused
- _SCErrorSet(kSCStatusFailed);
- CFRelease(bond_if);
- goto done;
- }
-
- if (CFEqual(bond_if, config_if)) {
- goto next_if; // if bond interface name not available
- }
- }
-
- /* create the bond */
-
- newDict = CFDictionaryCreateMutable(allocator,
- 0,
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
- CFDictionaryAddValue(newDict, __kBondInterface_interface, bond_if);
-
- /* create the accessor handle to be returned */
-
- newBond = __BondInterfaceCreatePrivate(allocator, bond_if);
-
- /* save in the prefs */
-
- if (nConfig > 0) {
- newBonds = CFArrayCreateMutableCopy(allocator, 0, config_bonds);
- } else {
- newBonds = CFArrayCreateMutable(allocator, 0, &kCFTypeArrayCallBacks);
- }
- CFArrayAppendValue(newBonds, newDict);
- CFRelease(newDict);
-
- /* yes, we're going to be changing the configuration */
- setConfigurationChanged(prefs);
-
- (void) SCPreferencesSetValue(prefsPrivate->prefs, BOND_PREFERENCES_BONDS, newBonds);
- CFRelease(newBonds);
-
- next_if :
- CFRelease(bond_if);
- }
-
- done :
-
- if (active_bonds != NULL) CFRelease(active_bonds);
-
- pthread_mutex_unlock(&prefsPrivate->lock);
-
- return (BondInterfaceRef) newBond;
-}
-
-
-static Boolean
-_BondPreferencesUpdate(BondPreferencesRef prefs, BondInterfaceRef bond)
-{
- CFAllocatorRef allocator;
- CFIndex bond_index;
- CFArrayRef devices;
- CFStringRef interface;
- CFMutableDictionaryRef newDict;
- CFMutableArrayRef newBonds;
- CFDictionaryRef options;
- BondPreferencesPrivateRef prefsPrivate = (BondPreferencesPrivateRef)prefs;
- CFArrayRef bonds;
-
- bonds = SCPreferencesGetValue(prefsPrivate->prefs, BOND_PREFERENCES_BONDS);
- if ((bonds != NULL) && !isA_CFArray(bonds)) {
- // if the prefs are confused
- _SCErrorSet(kSCStatusFailed);
- return FALSE;
- }
-
- interface = BondInterfaceGetInterface(bond);
- bond_index = findBond(bonds, interface);
- if (bond_index == kCFNotFound) {
- _SCErrorSet(kSCStatusNoKey);
- return FALSE;
- }
-
- /* create the bond dictionary */
-
- allocator = CFGetAllocator(prefs);
- newDict = CFDictionaryCreateMutable(allocator,
- 0,
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
- CFDictionaryAddValue(newDict, __kBondInterface_interface, interface);
-
- devices = BondInterfaceGetDevices(bond);
- if (devices != NULL) {
- CFDictionaryAddValue(newDict, __kBondInterface_devices, devices);
- }
-
- options = BondInterfaceGetOptions(bond);
- if (options != NULL) {
- CFDictionaryAddValue(newDict, __kBondInterface_options, options);
- }
-
- /* yes, we're going to be changing the configuration */
- setConfigurationChanged(prefs);
-
- /* update the prefs */
-
- newBonds = CFArrayCreateMutableCopy(allocator, 0, bonds);
- CFArraySetValueAtIndex(newBonds, bond_index, newDict);
- CFRelease(newDict);
- (void) SCPreferencesSetValue(prefsPrivate->prefs, BOND_PREFERENCES_BONDS, newBonds);
- CFRelease(newBonds);
-
- return TRUE;
-}
-
-
-Boolean
-BondPreferencesAddDevice(BondPreferencesRef prefs,
- BondInterfaceRef bond,
- CFStringRef device)
-{
- CFArrayRef config_bonds;
- CFIndex i;
- CFIndex nConfig;
- Boolean ok = TRUE;
- BondPreferencesPrivateRef prefsPrivate = (BondPreferencesPrivateRef)prefs;
-
- if (!isA_BondPreferences(prefs)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- if (!isA_BondInterface(bond)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- if (!isA_CFString(device)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- if (!IsBondSupported(device)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- pthread_mutex_lock(&prefsPrivate->lock);
-
- /* get "configured" bonds */
- config_bonds = SCPreferencesGetValue(prefsPrivate->prefs, BOND_PREFERENCES_BONDS);
- if ((config_bonds != NULL) && !isA_CFArray(config_bonds)) {
- _SCErrorSet(kSCStatusFailed);
- ok = FALSE;
- goto done;
- }
-
- nConfig = (config_bonds != NULL) ? CFArrayGetCount(config_bonds) : 0;
-
- /* check to ensure the requested device is available */
- for (i = 0; ok && (i < nConfig); i++) {
- CFDictionaryRef config_bond;
- CFArrayRef devices;
-
- config_bond = CFArrayGetValueAtIndex(config_bonds, i);
- if (!isA_CFDictionary(config_bond)) {
- ok = FALSE; // if the prefs are confused
- break;
- }
-
- devices = CFDictionaryGetValue(config_bond, __kBondInterface_devices);
- if ((devices != NULL) && !isA_CFArray(devices)) {
- ok = FALSE; // if the prefs are confused
- break;
- }
-
- if (devices == NULL) {
- continue; // if no devices
- }
-
- ok = !CFArrayContainsValue(devices,
- CFRangeMake(0, CFArrayGetCount(devices)),
- device);
- }
-
- if (ok) {
- CFArrayRef devices;
- CFMutableArrayRef newDevices;
-
- devices = BondInterfaceGetDevices(bond);
- if (devices != NULL) {
- devices = CFArrayCreateCopy(NULL, devices);
- newDevices = CFArrayCreateMutableCopy(NULL, 0, devices);
- } else {
- newDevices = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
- }
- CFArrayAppendValue(newDevices, device);
- BondInterfaceSetDevices(bond, newDevices);
- CFRelease(newDevices);
-
- ok = _BondPreferencesUpdate(prefs, bond);
- if (!ok) {
- BondInterfaceSetDevices(bond, devices);
- }
-
- if (devices != NULL) {
- CFRelease(devices);
- }
- } else {
- _SCErrorSet(kSCStatusKeyExists);
- }
-
- done :
-
- pthread_mutex_unlock(&prefsPrivate->lock);
-
- return ok;
-}
-
-
-Boolean
-BondPreferencesRemoveDevice(BondPreferencesRef prefs,
- BondInterfaceRef bond,
- CFStringRef device)
-{
- CFIndex bond_index;
- CFArrayRef devices;
- Boolean ok = FALSE;
- BondPreferencesPrivateRef prefsPrivate = (BondPreferencesPrivateRef)prefs;
-
- if (!isA_BondPreferences(prefs)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- if (!isA_BondInterface(bond)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- if (!isA_CFString(device)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- pthread_mutex_lock(&prefsPrivate->lock);
-
- devices = BondInterfaceGetDevices(bond);
- if (devices != NULL) {
- bond_index = CFArrayGetFirstIndexOfValue(devices,
- CFRangeMake(0, CFArrayGetCount(devices)),
- device);
- if (bond_index != kCFNotFound) {
- CFMutableArrayRef newDevices;
-
- devices = CFArrayCreateCopy(NULL, devices);
- newDevices = CFArrayCreateMutableCopy(NULL, 0, devices);
- CFArrayRemoveValueAtIndex(newDevices, bond_index);
- BondInterfaceSetDevices(bond, newDevices);
- CFRelease(newDevices);
-
- ok = _BondPreferencesUpdate(prefs, bond);
- if (!ok) {
- BondInterfaceSetDevices(bond, devices);
- }
-
- CFRelease(devices);
- } else {
- _SCErrorSet(kSCStatusNoKey);
- }
- }
-
- pthread_mutex_unlock(&prefsPrivate->lock);
-
- return ok;
-}
-
-
-Boolean
-BondPreferencesSetOptions(BondPreferencesRef prefs, BondInterfaceRef bond, CFDictionaryRef newOptions)
-{
- Boolean ok = FALSE;
- CFDictionaryRef options;
- BondPreferencesPrivateRef prefsPrivate = (BondPreferencesPrivateRef)prefs;
-
- if (!isA_BondPreferences(prefs)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- if (!isA_BondInterface(bond)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- pthread_mutex_lock(&prefsPrivate->lock);
-
- options = BondInterfaceGetOptions(bond);
- if (options != NULL) {
- options = CFDictionaryCreateCopy(NULL, options);
- }
-
- BondInterfaceSetOptions(bond, newOptions);
- ok = _BondPreferencesUpdate(prefs, bond);
- if (!ok) {
- BondInterfaceSetOptions(bond, options);
- }
-
- if (options != NULL) {
- CFRelease(options);
- }
-
- pthread_mutex_unlock(&prefsPrivate->lock);
-
- return ok;
-}
-
-
-Boolean
-BondPreferencesRemoveInterface(BondPreferencesRef prefs,
- BondInterfaceRef bond)
-{
- CFIndex bond_index;
- Boolean ok = FALSE;
- BondPreferencesPrivateRef prefsPrivate = (BondPreferencesPrivateRef)prefs;
- CFArrayRef bonds;
-
- if (!isA_BondPreferences(prefs)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- if (!isA_BondInterface(bond)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- pthread_mutex_lock(&prefsPrivate->lock);
-
- bonds = SCPreferencesGetValue(prefsPrivate->prefs, BOND_PREFERENCES_BONDS);
- if (!isA_CFArray(bonds)) {
- // if the prefs are confused
- _SCErrorSet(kSCStatusFailed);
- goto done;
- }
-
- bond_index = findBond(bonds, BondInterfaceGetInterface(bond));
- if (bond_index == kCFNotFound) {
- _SCErrorSet(kSCStatusNoKey);
- goto done;
- }
-
- /* yes, we're going to be changing the configuration */
- setConfigurationChanged(prefs);
-
- /* remove the bond */
-
- if (CFArrayGetCount(bonds) > 1) {
- CFAllocatorRef allocator;
- CFMutableArrayRef newBonds;
-
- allocator = CFGetAllocator(prefs);
- newBonds = CFArrayCreateMutableCopy(allocator, 0, bonds);
- CFArrayRemoveValueAtIndex(newBonds, bond_index);
- (void) SCPreferencesSetValue(prefsPrivate->prefs, BOND_PREFERENCES_BONDS, newBonds);
- CFRelease(newBonds);
- } else {
- (void) SCPreferencesRemoveValue(prefsPrivate->prefs, BOND_PREFERENCES_BONDS);
- }
-
- ok = TRUE;
-
- done :
-
- pthread_mutex_unlock(&prefsPrivate->lock);
-
- return ok;
-}
-
-
-Boolean
-BondPreferencesCommitChanges(BondPreferencesRef prefs)
-{
- Boolean ok = FALSE;
- BondPreferencesPrivateRef prefsPrivate = (BondPreferencesPrivateRef)prefs;
-
- if (!isA_BondPreferences(prefs)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- ok = SCPreferencesCommitChanges(prefsPrivate->prefs);
- if (!ok) {
- return ok;
- }
-
- if (prefsPrivate->bBase != NULL) {
- CFRelease(prefsPrivate->bBase);
- prefsPrivate->bBase = NULL;
- }
-
- return TRUE;
-}
-
-
-Boolean
-_BondPreferencesUpdateConfiguration(BondPreferencesRef prefs)
-{
- return TRUE;
-}
-
-
-Boolean
-BondPreferencesApplyChanges(BondPreferencesRef prefs)
-{
- SCPreferencesRef defaultPrefs;
- Boolean ok = FALSE;
- BondPreferencesPrivateRef prefsPrivate = (BondPreferencesPrivateRef)prefs;
-
- if (!isA_BondPreferences(prefs)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- pthread_mutex_lock(&prefsPrivate->lock);
-
- /* apply the preferences */
- ok = SCPreferencesApplyChanges(prefsPrivate->prefs);
- if (!ok) {
- goto done;
- }
-
- /* apply the Bond configuration */
- defaultPrefs = SCPreferencesCreate(NULL, CFSTR("BondPreferencesApplyChanges"), NULL);
- {
- /*
- * Note: In an ideal world, we'd simply call SCPreferencesApplyChanges()
- * Unfortunately, it's possible that the caller (e.g NetworkCfgTool)
- * is holding the lock on the default prefs and since "Apply" attempts
- * to grab the lock we could end up in a deadlock situation.
- */
-#include "SCPreferencesInternal.h"
- SCPreferencesPrivateRef defaultPrefsPrivate;
-
- defaultPrefsPrivate = (SCPreferencesPrivateRef)defaultPrefs;
-
- pthread_mutex_lock(&defaultPrefsPrivate->lock);
- if (defaultPrefsPrivate->session == NULL) {
- __SCPreferencesAddSession(defaultPrefs);
- }
- pthread_mutex_unlock(&defaultPrefsPrivate->lock);
-
- ok = SCDynamicStoreNotifyValue(defaultPrefsPrivate->session, defaultPrefsPrivate->sessionKeyApply);
- }
- CFRelease(defaultPrefs);
- if (!ok) {
- goto done;
- }
-
- done :
-
- pthread_mutex_unlock(&prefsPrivate->lock);
-
- return ok;
-}
-
-
-/* ---------- BondStatus ---------- */
-
-typedef struct {
-
- /* base CFType information */
- CFRuntimeBase cfBase;
-
- /* bond interface */
- BondInterfaceRef bond;
-
- /* bond status */
- CFDictionaryRef status_interface; // interface status
- CFArrayRef devices; // per-device status
- CFDictionaryRef status_devices;
-
-} BondStatusPrivate, * BondStatusPrivateRef;
-
-
-static CFStringRef __BondStatusCopyDescription (CFTypeRef cf);
-static void __BondStatusDeallocate (CFTypeRef cf);
-static Boolean __BondStatusEqual (CFTypeRef cf1, CFTypeRef cf2);
-
-
-static const CFRuntimeClass __BondStatusClass = {
- 0, // version
- "BondStatus", // className
- NULL, // init
- NULL, // copy
- __BondStatusDeallocate, // dealloc
- __BondStatusEqual, // equal
- NULL, // hash
- NULL, // copyFormattingDesc
- __BondStatusCopyDescription // copyDebugDesc
-};
-
-
-static CFTypeID __kBondStatusTypeID = _kCFRuntimeNotATypeID;
-
-
-static pthread_once_t bondStatus_init_X = PTHREAD_ONCE_INIT;
-
-
-static CFStringRef
-__BondStatusCopyDescription(CFTypeRef cf)
-{
- CFAllocatorRef allocator = CFGetAllocator(cf);
- CFMutableStringRef result;
- BondStatusPrivateRef statusPrivate = (BondStatusPrivateRef)cf;
-
- result = CFStringCreateMutable(allocator, 0);
- CFStringAppendFormat(result, NULL, CFSTR("<BondStatus %p [%p]> {"), cf, allocator);
- CFStringAppendFormat(result, NULL, CFSTR(" bond = %@"), statusPrivate->bond);
- CFStringAppendFormat(result, NULL, CFSTR(" interface = %@"), statusPrivate->status_interface);
- CFStringAppendFormat(result, NULL, CFSTR(" devices = %@"), statusPrivate->status_devices);
- CFStringAppendFormat(result, NULL, CFSTR(" }"));
-
- return result;
-}
-
-
-static void
-__BondStatusDeallocate(CFTypeRef cf)
-{
- BondStatusPrivateRef statusPrivate = (BondStatusPrivateRef)cf;
-
- /* release resources */
-
- CFRelease(statusPrivate->bond);
- CFRelease(statusPrivate->status_interface);
- if (statusPrivate->devices != NULL) CFRelease(statusPrivate->devices);
- CFRelease(statusPrivate->status_devices);
- return;
-}
-
-
-static Boolean
-__BondStatusEqual(CFTypeRef cf1, CFTypeRef cf2)
-{
- BondStatusPrivateRef status1 = (BondStatusPrivateRef)cf1;
- BondStatusPrivateRef status2 = (BondStatusPrivateRef)cf2;
-
- if (status1 == status2)
- return TRUE;
-
- if (!CFEqual(status1->bond, status2->bond))
- return FALSE; // if not the same bond
-
- if (!CFEqual(status1->status_interface, status2->status_interface))
- return FALSE; // if not the same interface status
-
- if (!CFEqual(status1->status_devices, status2->status_devices))
- return FALSE; // if not the same device status
-
- return TRUE;
-}
-
-
-static void
-__BondStatusInitialize(void)
-{
- __kBondStatusTypeID = _CFRuntimeRegisterClass(&__BondStatusClass);
- return;
-}
-
-
-static __inline__ CFTypeRef
-isA_BondStatus(CFTypeRef obj)
-{
- return (isA_CFType(obj, BondStatusGetTypeID()));
-}
-
-
-CFTypeID
-BondStatusGetTypeID(void)
-{
- pthread_once(&bondStatus_init_X, __BondStatusInitialize); /* initialize runtime */
- return __kBondStatusTypeID;
-}
-
-
-static BondStatusRef
-__BondStatusCreatePrivate(CFAllocatorRef allocator,
- BondInterfaceRef bond,
- CFDictionaryRef status_interface,
- CFDictionaryRef status_devices)
-{
- BondStatusPrivateRef statusPrivate;
- uint32_t size;
-
- /* initialize runtime */
- pthread_once(&bondStatus_init_X, __BondStatusInitialize);
-
- /* allocate bond */
- size = sizeof(BondStatusPrivate) - sizeof(CFRuntimeBase);
- statusPrivate = (BondStatusPrivateRef)_CFRuntimeCreateInstance(allocator,
- __kBondStatusTypeID,
- size,
- NULL);
- if (statusPrivate == NULL) {
- return NULL;
- }
-
- /* establish the bond status */
-
- statusPrivate->bond = CFRetain(bond);
- statusPrivate->status_interface = CFDictionaryCreateCopy(allocator, status_interface);
- statusPrivate->devices = NULL;
- statusPrivate->status_devices = CFDictionaryCreateCopy(allocator, status_devices);
-
- return (BondStatusRef)statusPrivate;
-}
-
-
-BondStatusRef
-BondInterfaceCopyStatus(BondInterfaceRef bond)
-{
- BondInterfacePrivateRef bondPrivate = (BondInterfacePrivateRef)bond;
- int bond_if_active;
- int bond_if_status;
- CFIndex i;
- struct if_bond_status_req *ibsr_p = NULL;
- char if_name[IFNAMSIZ + 1];
- CFIndex n;
- CFNumberRef num;
- int s;
- struct if_bond_status * scan_p;
- BondStatusRef status = NULL;
- CFMutableDictionaryRef status_devices;
- CFMutableDictionaryRef status_interface;
-
- if (!isA_BondInterface(bond)) {
- return NULL;
- }
-
- s = inet_dgram_socket();
- if (s == -1) {
- _SCErrorSet(errno);
- goto done;
- }
- _SC_cfstring_to_cstring(bondPrivate->ifname, if_name,
- sizeof(if_name), kCFStringEncodingASCII);
- (void)siocgifmedia(s, if_name, &bond_if_status, &bond_if_active);
- ibsr_p = if_bond_status_req_copy(s, if_name);
- if (ibsr_p == NULL) {
- _SCErrorSet(errno);
- goto done;
- }
- status_interface = CFDictionaryCreateMutable(NULL,
- 0,
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
-
- status_devices = CFDictionaryCreateMutable(NULL,
- 0,
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
- n = ibsr_p->ibsr_total;
- for (i = 0, scan_p = (struct if_bond_status *)ibsr_p->ibsr_buffer; i < n; i++, scan_p++) {
- CFStringRef bond_if;
- int collecting = 0;
- int distributing = 0;
- struct if_bond_partner_state * ps;
- CFMutableDictionaryRef status_device;
- int status_val;
-
- ps = &scan_p->ibs_partner_state;
-
- status_device = CFDictionaryCreateMutable(NULL,
- 0,
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
- if (lacp_actor_partner_state_in_sync(scan_p->ibs_state)) {
- /* we're in-sync */
- status_val = kSCBondStatusOK;
- if (lacp_actor_partner_state_in_sync(ps->ibps_state)) {
- /* partner is also in-sync */
- if (lacp_actor_partner_state_collecting(scan_p->ibs_state)
- && lacp_actor_partner_state_distributing(ps->ibps_state)) {
- /* we're able to collect (receive) frames */
- collecting = 1;
- }
- if (lacp_actor_partner_state_distributing(scan_p->ibs_state)
- && lacp_actor_partner_state_collecting(ps->ibps_state)) {
- /* we're able to distribute (transmit) frames */
- distributing = 1;
- }
- }
- }
- else {
- int active = 0;
- int status = 0;
- static lacp_system zeroes = {{0,0,0,0,0,0}};
-
- (void)siocgifmedia(s, scan_p->ibs_if_name, &status, &active);
- if ((status & IFM_AVALID) == 0 || (status & IFM_ACTIVE) == 0
- || (active & IFM_FDX) == 0) {
- /* link down or not full-duplex */
- status_val = kSCBondStatusLinkInvalid;
- }
- else if (ps->ibps_system_priority == 0
- && bcmp(&zeroes, &ps->ibps_system, sizeof(zeroes)) == 0) {
- /* no one on the other end of the link */
- status_val = kSCBondStatusNoPartner;
- }
- else if (active != bond_if_active) {
- /* the link speed was different */
- status_val = kSCBondStatusLinkInvalid;
- }
- else {
- /* partner is not in the active group */
- status_val = kSCBondStatusNotInActiveGroup;
- }
- }
- num = CFNumberCreate(NULL, kCFNumberIntType, &status_val);
- CFDictionarySetValue(status_device, kSCBondStatusDeviceAggregationStatus, num);
- CFRelease(num);
- num = CFNumberCreate(NULL, kCFNumberIntType, &collecting);
- CFDictionarySetValue(status_device, kSCBondStatusDeviceCollecting, num);
- CFRelease(num);
- num = CFNumberCreate(NULL, kCFNumberIntType, &distributing);
- CFDictionarySetValue(status_device, kSCBondStatusDeviceDistributing, num);
- CFRelease(num);
- bond_if = CFArrayGetValueAtIndex(bondPrivate->devices, i);
- CFDictionarySetValue(status_devices, bond_if, status_device);
- CFRelease(status_device);
- }
-
- status = __BondStatusCreatePrivate(NULL, bond, status_interface, status_devices);
-
- CFRelease(status_interface);
- CFRelease(status_devices);
- done:
- if (s != -1) {
- close(s);
- }
- if (ibsr_p != NULL) {
- free(ibsr_p);
- }
- return status;
-}
-
-
-CFArrayRef
-BondStatusGetDevices(BondStatusRef bondStatus)
-{
- BondStatusPrivateRef statusPrivate = (BondStatusPrivateRef)bondStatus;
-
- if (!isA_BondStatus(bondStatus)) {
- return NULL;
- }
-
- if (statusPrivate->devices == NULL) {
- const void * keys_q[N_QUICK];
- const void ** keys = keys_q;
- CFIndex n;
-
- n = CFDictionaryGetCount(statusPrivate->status_devices);
- if (n > (CFIndex)(sizeof(keys_q) / sizeof(CFTypeRef))) {
- keys = CFAllocatorAllocate(NULL, n * sizeof(CFTypeRef), 0);
- }
- CFDictionaryGetKeysAndValues(statusPrivate->status_devices, keys, NULL);
- statusPrivate->devices = CFArrayCreate(NULL, keys, n, &kCFTypeArrayCallBacks);
- if (keys != keys_q) {
- CFAllocatorDeallocate(NULL, keys);
- }
- }
-
- return statusPrivate->devices;
-}
-
-
-CFDictionaryRef
-BondStatusGetInterfaceStatus(BondStatusRef bondStatus)
-{
- BondStatusPrivateRef statusPrivate = (BondStatusPrivateRef)bondStatus;
-
- if (!isA_BondStatus(bondStatus)) {
- return NULL;
- }
-
- return statusPrivate->status_interface;
-}
-
-
-CFDictionaryRef
-BondStatusGetDeviceStatus(BondStatusRef bondStatus, CFStringRef device)
-{
- BondStatusPrivateRef statusPrivate = (BondStatusPrivateRef)bondStatus;
-
- if (!isA_BondStatus(bondStatus)) {
- return NULL;
- }
-
- return CFDictionaryGetValue(statusPrivate->status_devices, device);
-}
+++ /dev/null
-/*
- * Copyright (c) 2004-2006 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-
-#ifndef _BONDCONFIGURATION_H
-#define _BONDCONFIGURATION_H
-
-/*!
- @header BONDCONFIGURATION
-*/
-
-#include <AvailabilityMacros.h>
-#include <sys/cdefs.h>
-#include <CoreFoundation/CoreFoundation.h>
-#include <SystemConfiguration/SCNetworkConfiguration.h>
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
-
-typedef const struct __BondInterface * BondInterfaceRef;
-
-typedef const struct __BondPreferences * BondPreferencesRef;
-
-typedef const struct __BondStatus * BondStatusRef;
-
-
-__BEGIN_DECLS
-
-// ----------
-
-Boolean
-IsBondSupported (CFStringRef device) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; // e.g. "en0", "en1", ...
-
-// ----------
-
-CFTypeID
-BondInterfaceGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-CFStringRef
-BondInterfaceGetInterface (BondInterfaceRef bond) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; // returns "bond0", "bond1", ...
-
-CFArrayRef /* of CFStringRef's */
-BondInterfaceGetDevices (BondInterfaceRef bond) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-CFDictionaryRef
-BondInterfaceGetOptions (BondInterfaceRef bond) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; // e.g. UserDefinedName, ...
-
-// ----------
-
-CFTypeID
-BondPreferencesGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-BondPreferencesRef
-BondPreferencesCreate (CFAllocatorRef allocator) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-CFArrayRef /* of BondInterfaceRef's */
-BondPreferencesCopyInterfaces (BondPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-BondInterfaceRef
-BondPreferencesCreateInterface (BondPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-Boolean
-BondPreferencesRemoveInterface (BondPreferencesRef prefs,
- BondInterfaceRef bond) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-Boolean
-BondPreferencesAddDevice (BondPreferencesRef prefs,
- BondInterfaceRef bond,
- CFStringRef device) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; // e.g. "en0", "en1", ...
-
-Boolean
-BondPreferencesRemoveDevice (BondPreferencesRef prefs,
- BondInterfaceRef bond,
- CFStringRef device) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; // e.g. "en0", "en1", ...
-
-Boolean
-BondPreferencesSetOptions (BondPreferencesRef prefs,
- BondInterfaceRef bond,
- CFDictionaryRef newOptions) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-Boolean
-BondPreferencesCommitChanges (BondPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-Boolean
-BondPreferencesApplyChanges (BondPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-// ----------
-
-CFTypeID
-BondStatusGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-BondStatusRef
-BondInterfaceCopyStatus (BondInterfaceRef bond) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-CFArrayRef
-BondStatusGetDevices (BondStatusRef bondStatus) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-CFDictionaryRef
-BondStatusGetInterfaceStatus (BondStatusRef bondStatus) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-CFDictionaryRef
-BondStatusGetDeviceStatus (BondStatusRef bondStatus,
- CFStringRef device) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-__END_DECLS
-
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 */
-
-#endif /* _BONDCONFIGURATION_H */
+++ /dev/null
-/*
- * Copyright (c) 2004-2006 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-
-#ifndef _BONDCONFIGURATIONPRIVATE_H
-#define _BONDCONFIGURATIONPRIVATE_H
-
-#include <AvailabilityMacros.h>
-#include <sys/cdefs.h>
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
-
-/*!
- @header BONDConfigurationPrivate
- */
-
-__BEGIN_DECLS
-
-__END_DECLS
-
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 */
-
-#endif /* _BONDCONFIGURATIONPRIVATE_H */
/*
- * Copyright (c) 2001, 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2001, 2004, 2005, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*/
#ifndef _DHCPCLIENTPREFERENCES_H
+#ifdef USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS
+#include <SystemConfiguration/_DHCPClientPreferences.h>
+#else /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
#define _DHCPCLIENTPREFERENCES_H
+#include <Availability.h>
#include <sys/cdefs.h>
#include <CoreFoundation/CFString.h>
*/
Boolean
-DHCPClientPreferencesSetApplicationOptions(CFStringRef applicationID,
- UInt8 * options,
- CFIndex count);
+DHCPClientPreferencesSetApplicationOptions (CFStringRef applicationID,
+ UInt8 *options,
+ CFIndex count) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function DHCPClientPreferencesCopyApplicationOptions
*/
UInt8 *
-DHCPClientPreferencesCopyApplicationOptions(CFStringRef applicationID,
- CFIndex * count);
+DHCPClientPreferencesCopyApplicationOptions (CFStringRef applicationID,
+ CFIndex *count) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
__END_DECLS
-#endif /* _DHCPCLIENTPREFERENCES_H */
+#endif /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
+#endif /* _DHCPCLIENTPREFERENCES_H */
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>SystemConfiguration</string>
+ <key>CFBundleGetInfoString</key>
+ <string>1.10</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.SystemConfiguration</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>SystemConfiguration</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.10</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.10</string>
+</dict>
+</plist>
<key>CFBundleExecutable</key>
<string>SystemConfiguration</string>
<key>CFBundleGetInfoString</key>
- <string>1.9.2</string>
+ <string>1.10</string>
<key>CFBundleIdentifier</key>
<string>com.apple.SystemConfiguration</string>
<key>CFBundleInfoDictionaryVersion</key>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
- <string>1.9.2</string>
+ <string>1.10</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>1.9.2</string>
+ <string>1.10</string>
</dict>
</plist>
/*
- * Copyright (c) 2002, 2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2002, 2004, 2006, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#ifndef _LINKCONFIGURATION_H
#define _LINKCONFIGURATION_H
+#include <Availability.h>
#include <sys/cdefs.h>
#include <CoreFoundation/CoreFoundation.h>
CFDictionaryRef *active,
CFArrayRef *available,
Boolean filter
- ) AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
+ ) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
/*!
@function NetworkInterfaceCopyMediaSubTypes
CFArrayRef
NetworkInterfaceCopyMediaSubTypes(
CFArrayRef available
- ) AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
+ ) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
/*!
@function NetworkInterfaceCopyMediaSubTypeOptions
NetworkInterfaceCopyMediaSubTypeOptions(
CFArrayRef available,
CFStringRef subType
- ) AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
+ ) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
/*!
@function NetworkInterfaceCopyMTU
int *mtu_cur,
int *mtu_min,
int *mtu_max
- ) AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
+ ) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
__END_DECLS
<key>Bluetooth</key>
<dict>
<key>ConnectionPersonality</key>
- <string>v.34 Personality</string>
+ <string>Default Personality</string>
<key>ConnectionScript</key>
- <string>/Library/Modem Scripts/Apple Modems.ccl</string>
+ <string>/Library/Modem Scripts/Generic Dialup.ccl</string>
<key>DataCompression</key>
<integer>1</integer>
<key>DeviceModel</key>
- <string>Apple Modem (v.34)</string>
+ <string>Dialup Device</string>
<key>DeviceVendor</key>
- <string>Apple</string>
+ <string>Generic</string>
<key>DialMode</key>
<string>WaitForDialTone</string>
<key>ErrorCorrection</key>
<key>JoinMode</key>
<string>Automatic</string>
</dict>
+ <key>IPSec-IPv4</key>
+ <dict/>
<key>IrDA</key>
<dict/>
<key>L2TP-IPv4</key>
<key>Modem</key>
<dict>
<key>ConnectionPersonality</key>
- <string>v.34 Personality</string>
+ <string>Default Personality</string>
<key>ConnectionScript</key>
- <string>/Library/Modem Scripts/Apple Modems.ccl</string>
+ <string>/Library/Modem Scripts/Generic Dialup.ccl</string>
<key>DataCompression</key>
<integer>1</integer>
<key>DeviceModel</key>
- <string>Apple Modem (v.34)</string>
+ <string>Dialup Device</string>
<key>DeviceVendor</key>
- <string>Apple</string>
+ <string>Generic</string>
<key>DialMode</key>
<string>WaitForDialTone</string>
<key>ErrorCorrection</key>
<key>WWAN</key>
<dict>
<key>ConnectionScript</key>
- <string>/Library/Modem Scripts/WWAN Support</string>
+ <string>/Library/Modem Scripts/WWAN.ccl</string>
<key>DataCompression</key>
<integer>1</integer>
<key>DialMode</key>
</dict>
<key>Ethernet</key>
<dict>
- <key>AppleTalk</key>
- <dict>
- <key>ConfigMethod</key>
- <string>Node</string>
- <key>__INACTIVE__</key>
- <true/>
- </dict>
<key>DNS</key>
<dict/>
<key>IPv4</key>
</dict>
<key>IEEE80211</key>
<dict>
- <key>AppleTalk</key>
- <dict>
- <key>ConfigMethod</key>
- <string>Node</string>
- <key>__INACTIVE__</key>
- <true/>
- </dict>
<key>DNS</key>
<dict/>
<key>IPv4</key>
<integer>1</integer>
</dict>
</dict>
+ <key>IPSec-IPv4</key>
+ <dict>
+ <key>DNS</key>
+ <dict/>
+ <key>IPv4</key>
+ <dict>
+ <key>ConfigMethod</key>
+ <string>Automatic</string>
+ </dict>
+ <key>Proxies</key>
+ <dict>
+ <key>ExceptionList</key>
+ <array>
+ <string>*.local</string>
+ <string>169.254/16</string>
+ </array>
+ <key>FTPPassive</key>
+ <integer>1</integer>
+ </dict>
+ </dict>
+ <key>L2TP-IPv4</key>
+ <dict/>
<key>PPP-Bluetooth</key>
<dict>
<key>DNS</key>
</dict>
<key>PPTP-IPv4</key>
<dict/>
- <key>PPTP-L2TP</key>
- <dict/>
<key>VLAN</key>
<dict>
<key>DNS</key>
/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include "SCDynamicStoreInternal.h"
#include "config.h" /* MiG generated file */
+
/* framework variables */
-Boolean _sc_debug = FALSE; /* TRUE if debugging enabled */
-Boolean _sc_verbose = FALSE; /* TRUE if verbose logging enabled */
-Boolean _sc_log = TRUE; /* TRUE if SCLog() output goes to syslog */
+int _sc_debug = FALSE; /* non-zero if debugging enabled */
+int _sc_verbose = FALSE; /* non-zero if verbose logging enabled */
+int _sc_log = TRUE; /* 0 if SC messages should be written to stdout/stderr,
+ 1 if SC messages should be logged w/asl(3),
+ 2 if SC messages should be written to stdout/stderr AND logged */
-static const struct sc_errmsg {
- int status;
- char *message;
-} sc_errmsgs[] = {
- { kSCStatusAccessError, "Permission denied" },
- { kSCStatusFailed, "Failed!" },
- { kSCStatusInvalidArgument, "Invalid argument" },
- { kSCStatusKeyExists, "Key already defined" },
- { kSCStatusLocked, "Lock already held" },
- { kSCStatusMaxLink, "Maximum link count exceeded" },
- { kSCStatusNeedLock, "Lock required for this operation" },
- { kSCStatusNoStoreServer, "Configuration daemon not (no longer) available" },
- { kSCStatusNoStoreSession, "Configuration daemon session not active" },
- { kSCStatusNoConfigFile, "Configuration file not found" },
- { kSCStatusNoKey, "No such key" },
- { kSCStatusNoLink, "No such link" },
- { kSCStatusNoPrefsSession, "Preference session not active" },
- { kSCStatusNotifierActive, "Notifier is currently active" },
- { kSCStatusOK, "Success!" },
- { kSCStatusPrefsBusy, "Preferences update currently in progress" },
- { kSCStatusReachabilityUnknown, "Network reachability cannot be determined" },
- { kSCStatusStale, "Write attempted on stale version of object" },
-};
-#define nSC_ERRMSGS (sizeof(sc_errmsgs)/sizeof(struct sc_errmsg))
+#pragma mark -
+#pragma mark Thread specific data
-#define USE_SCCOPYDESCRIPTION
-#ifdef USE_SCCOPYDESCRIPTION
-// from <CoreFoundation/CFVeryPrivate.h>
-extern CFStringRef _CFStringCreateWithFormatAndArgumentsAux(CFAllocatorRef alloc, CFStringRef (*copyDescFunc)(void *, CFDictionaryRef), CFDictionaryRef formatOptions, CFStringRef format, va_list arguments);
+typedef struct {
+ aslclient _asl;
+ int _sc_error;
+} __SCThreadSpecificData, *__SCThreadSpecificDataRef;
+
+
+static pthread_once_t tsKeyInitialized = PTHREAD_ONCE_INIT;
+static pthread_key_t tsDataKey;
-#define N_QUICK 32
-static CFStringRef
-_SCCopyDescription(void *info, CFDictionaryRef formatOptions)
+static void
+__SCThreadSpecificDataFinalize(void *arg)
{
+ __SCThreadSpecificDataRef tsd = (__SCThreadSpecificDataRef)arg;
+
+ if (tsd != NULL) {
+ if (tsd->_asl != NULL) asl_close(tsd->_asl);
+ CFAllocatorDeallocate(kCFAllocatorSystemDefault, tsd);
+ }
+ return;
+}
+
+
+static void
+__SCThreadSpecificKeyInitialize()
+{
+ pthread_key_create(&tsDataKey, __SCThreadSpecificDataFinalize);
+ return;
+}
+
+
+static __SCThreadSpecificDataRef
+__SCGetThreadSpecificData()
+{
+ __SCThreadSpecificDataRef tsd;
+
+ pthread_once(&tsKeyInitialized, __SCThreadSpecificKeyInitialize);
+
+ tsd = pthread_getspecific(tsDataKey);
+ if (tsd == NULL) {
+ tsd = CFAllocatorAllocate(kCFAllocatorSystemDefault, sizeof(__SCThreadSpecificData), 0);
+ tsd->_asl = asl_open(NULL, NULL, 0);
+ asl_set_filter(tsd->_asl, ASL_FILTER_MASK_UPTO(ASL_LEVEL_DEBUG));
+ tsd->_sc_error = kSCStatusOK;
+ pthread_setspecific(tsDataKey, tsd);
+ }
+
+ return tsd;
+}
+
+
+#pragma mark -
+#pragma mark Logging
+
+
+#define ENABLE_SC_FORMATTING
+#ifdef ENABLE_SC_FORMATTING
+// from <CoreFoundation/ForFoundationOnly.h>
+extern CFStringRef _CFStringCreateWithFormatAndArgumentsAux(CFAllocatorRef alloc, CFStringRef (*copyDescFunc)(CFTypeRef, CFDictionaryRef), CFDictionaryRef formatOptions, CFStringRef format, va_list arguments);
+#endif /* ENABLE_SC_FORMATTING */
+
+
+CFStringRef
+_SCCopyDescription(CFTypeRef cf, CFDictionaryRef formatOptions)
+{
+#ifdef ENABLE_SC_FORMATTING
CFMutableDictionaryRef nFormatOptions;
CFStringRef prefix1;
CFStringRef prefix2;
- CFTypeID type = CFGetTypeID(info);
+ CFTypeID type = CFGetTypeID(cf);
if (!formatOptions ||
!CFDictionaryGetValueIfPresent(formatOptions, CFSTR("PREFIX1"), (const void **)&prefix1)) {
formatOptions,
CFSTR("%@%@"),
prefix1,
- info);
+ cf);
}
if (type == CFBooleanGetTypeID()) {
formatOptions,
CFSTR("%@%s"),
prefix1,
- CFBooleanGetValue(info) ? "TRUE" : "FALSE");
+ CFBooleanGetValue(cf) ? "TRUE" : "FALSE");
}
if (type == CFDataGetTypeID()) {
str = CFStringCreateMutable(NULL, 0);
CFStringAppendFormat(str, formatOptions, CFSTR("%@<data> 0x"), prefix1);
- data = CFDataGetBytePtr(info);
- dataLen = CFDataGetLength(info);
+ data = CFDataGetBytePtr(cf);
+ dataLen = CFDataGetLength(cf);
for (i = 0; i < dataLen; i++) {
CFStringAppendFormat(str, NULL, CFSTR("%02x"), data[i]);
}
formatOptions,
CFSTR("%@%@"),
prefix1,
- info);
+ cf);
}
if (type == CFDateGetTypeID()) {
CFTimeZoneRef tZone;
tZone = CFTimeZoneCopySystem();
- gDate = CFAbsoluteTimeGetGregorianDate(CFDateGetAbsoluteTime(info), tZone);
+ gDate = CFAbsoluteTimeGetGregorianDate(CFDateGetAbsoluteTime(cf), tZone);
str = CFStringCreateWithFormat(NULL,
formatOptions,
CFSTR("%@%02d/%02d/%04d %02d:%02d:%02.0f %@"),
if (!formatOptions ||
!CFDictionaryGetValueIfPresent(formatOptions, CFSTR("PREFIX2"), (const void **)&prefix2)) {
- prefix2 = CFStringCreateCopy(NULL, prefix1);
+ prefix2 = prefix1;
}
if (formatOptions) {
&kCFTypeDictionaryValueCallBacks);
}
+#define N_QUICK 32
+
if (type == CFArrayGetTypeID()) {
- const void * elements_q[32];
+ const void * elements_q[N_QUICK];
const void ** elements = elements_q;
CFIndex i;
CFIndex nElements;
str = CFStringCreateMutable(NULL, 0);
CFStringAppendFormat(str, formatOptions, CFSTR("%@<array> {"), prefix1);
- nElements = CFArrayGetCount(info);
+ nElements = CFArrayGetCount(cf);
if (nElements > 0) {
if (nElements > (CFIndex)(sizeof(elements_q)/sizeof(CFTypeRef)))
elements = CFAllocatorAllocate(NULL, nElements * sizeof(CFTypeRef), 0);
- CFArrayGetValues(info, CFRangeMake(0, nElements), elements);
+ CFArrayGetValues(cf, CFRangeMake(0, nElements), elements);
for (i = 0; i < nElements; i++) {
CFMutableStringRef nPrefix1;
CFMutableStringRef nPrefix2;
CFRelease(nPrefix2);
CFRelease(nStr);
- vStr = _SCCopyDescription((void *)elements[i], nFormatOptions);
+ vStr = _SCCopyDescription((CFTypeRef)elements[i], nFormatOptions);
CFStringAppendFormat(str,
formatOptions,
CFSTR("\n%@"),
str = CFStringCreateMutable(NULL, 0);
CFStringAppendFormat(str, formatOptions, CFSTR("%@<dictionary> {"), prefix1);
- nElements = CFDictionaryGetCount(info);
+ nElements = CFDictionaryGetCount(cf);
if (nElements > 0) {
if (nElements > (CFIndex)(sizeof(keys_q) / sizeof(CFTypeRef))) {
keys = CFAllocatorAllocate(NULL, nElements * sizeof(CFTypeRef), 0);
values = CFAllocatorAllocate(NULL, nElements * sizeof(CFTypeRef), 0);
}
- CFDictionaryGetKeysAndValues(info, keys, values);
+ CFDictionaryGetKeysAndValues(cf, keys, values);
for (i = 0; i < nElements; i++) {
CFStringRef kStr;
CFStringRef vStr;
- kStr = _SCCopyDescription((void *)keys[i], NULL);
+ kStr = _SCCopyDescription((CFTypeRef)keys[i], NULL);
nPrefix1 = CFStringCreateMutable(NULL, 0);
CFStringAppendFormat(nPrefix1,
CFRelease(nPrefix2);
CFRelease(kStr);
- vStr = _SCCopyDescription((void *)values[i], nFormatOptions);
+ vStr = _SCCopyDescription((CFTypeRef)values[i], nFormatOptions);
CFStringAppendFormat(str,
formatOptions,
CFSTR("\n%@"),
}
CFRelease(nFormatOptions);
+#endif /* ENABLE_SC_FORMATTING */
- {
- CFStringRef cfStr;
- CFStringRef str;
-
- cfStr = CFCopyDescription(info);
- str = CFStringCreateWithFormat(NULL,
- formatOptions,
- CFSTR("%@%@"),
- prefix1,
- cfStr);
- CFRelease(cfStr);
- return str;
- }
+ return CFStringCreateWithFormat(NULL,
+ formatOptions,
+ CFSTR("%@%@"),
+ prefix1,
+ cf);
}
-#endif /* USE_SCCOPYDESCRIPTION */
-
static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
static void
-__SCLog(int level, CFStringRef formatString, va_list formatArguments)
+__SCLog(aslclient asl, aslmsg msg, int level, CFStringRef formatString, va_list formatArguments)
{
+ CFDataRef line;
CFArrayRef lines;
CFStringRef str;
-#ifdef USE_SCCOPYDESCRIPTION
+ if (asl == NULL) {
+ __SCThreadSpecificDataRef tsd;
+
+ tsd = __SCGetThreadSpecificData();
+ asl = tsd->_asl;
+ }
+
+#ifdef ENABLE_SC_FORMATTING
str = _CFStringCreateWithFormatAndArgumentsAux(NULL,
_SCCopyDescription,
NULL,
formatString,
formatArguments);
-#else /* USE_SCCOPYDESCRIPTION */
+#else /* ENABLE_SC_FORMATTING */
str = CFStringCreateWithFormatAndArguments (NULL,
NULL,
formatString,
formatArguments);
-#endif /* !USE_SCCOPYDESCRIPTION */
-
- lines = CFStringCreateArrayBySeparatingStrings(NULL, str, CFSTR("\n"));
- CFRelease(str);
-
- if (lines) {
- int i;
- int n = CFArrayGetCount(lines);
-
- pthread_mutex_lock(&lock);
- for (i = 0; i < n; i++) {
- CFDataRef line;
-
- line = CFStringCreateExternalRepresentation(NULL,
- CFArrayGetValueAtIndex(lines, i),
- kCFStringEncodingUTF8,
- (UInt8)'?');
- if (line) {
- syslog (level, "%.*s", (int)CFDataGetLength(line), CFDataGetBytePtr(line));
- CFRelease(line);
+#endif /* !ENABLE_SC_FORMATTING */
+
+ if (level >= 0) {
+ lines = CFStringCreateArrayBySeparatingStrings(NULL, str, CFSTR("\n"));
+ if (lines != NULL) {
+ int i;
+ int n = CFArrayGetCount(lines);
+
+ for (i = 0; i < n; i++) {
+ line = CFStringCreateExternalRepresentation(NULL,
+ CFArrayGetValueAtIndex(lines, i),
+ kCFStringEncodingUTF8,
+ (UInt8)'?');
+ if (line) {
+ asl_log(asl, msg, level, "%.*s", (int)CFDataGetLength(line), CFDataGetBytePtr(line));
+ CFRelease(line);
+ }
}
+ CFRelease(lines);
+ }
+ } else {
+ line = CFStringCreateExternalRepresentation(NULL,
+ str,
+ kCFStringEncodingUTF8,
+ (UInt8)'?');
+ if (line) {
+ asl_log(asl, msg, ~level, "%.*s", (int)CFDataGetLength(line), CFDataGetBytePtr(line));
+ CFRelease(line);
}
- pthread_mutex_unlock(&lock);
- CFRelease(lines);
}
+ CFRelease(str);
return;
}
CFDataRef line;
CFStringRef str;
-#ifdef USE_SCCOPYDESCRIPTION
+#ifdef ENABLE_SC_FORMATTING
str = _CFStringCreateWithFormatAndArgumentsAux(NULL,
_SCCopyDescription,
NULL,
formatString,
formatArguments);
-#else /* USE_SCCOPYDESCRIPTION */
+#else /* ENABLE_SC_FORMATTING */
str = CFStringCreateWithFormatAndArguments (NULL,
NULL,
formatString,
formatArguments);
-#endif /* !USE_SCCOPYDESCRIPTION */
+#endif /* !ENABLE_SC_FORMATTING */
line = CFStringCreateExternalRepresentation(NULL,
str,
va_start(formatArguments, formatString);
if (_sc_log > 0) {
- __SCLog(level, formatString, formatArguments);
+ __SCLog(NULL, NULL, level, formatString, formatArguments);
}
if (_sc_log != 1) {
__SCPrint((LOG_PRI(level) > LOG_NOTICE) ? stderr : stdout,
}
+void
+SCLOG(aslclient asl, aslmsg msg, int level, CFStringRef formatString, ...)
+{
+ va_list formatArguments;
+
+ va_start(formatArguments, formatString);
+ if (_sc_log > 0) {
+ __SCLog(asl, msg, level, formatString, formatArguments);
+ }
+ if (_sc_log != 1) {
+ if (level < 0) {
+ level = ~level;
+ }
+ __SCPrint((level > ASL_LEVEL_NOTICE) ? stderr : stdout,
+ formatString,
+ formatArguments,
+ (_sc_log > 0), // trace
+ TRUE); // add newline
+ }
+ va_end(formatArguments);
+
+ return;
+}
+
+
void
SCPrint(Boolean condition, FILE *stream, CFStringRef formatString, ...)
{
}
-typedef struct {
- int _sc_error;
-} __SCThreadSpecificData, *__SCThreadSpecificDataRef;
-
-
-static pthread_once_t tsKeyInitialized = PTHREAD_ONCE_INIT;
-static pthread_key_t tsDataKey;
+#pragma mark -
+#pragma mark SC error handling / logging
-static void
-__SCThreadSpecificDataFinalize(void *arg)
-{
- __SCThreadSpecificDataRef tsd = (__SCThreadSpecificDataRef)arg;
-
- if (!tsd) return;
-
- CFAllocatorDeallocate(kCFAllocatorSystemDefault, tsd);
- return;
-}
-
-
-static void
-__SCThreadSpecificKeyInitialize()
-{
- pthread_key_create(&tsDataKey, __SCThreadSpecificDataFinalize);
- return;
-}
+const CFStringRef kCFErrorDomainSystemConfiguration = CFSTR("com.apple.SystemConfiguration");
-const CFStringRef kCFErrorDomainSystemConfiguration = CFSTR("com.apple.SystemConfiguration");
+static const struct sc_errmsg {
+ int status;
+ char *message;
+} sc_errmsgs[] = {
+ { kSCStatusAccessError, "Permission denied" },
+ { kSCStatusConnectionNoService, "Network service for connection not available" },
+ { kSCStatusFailed, "Failed!" },
+ { kSCStatusInvalidArgument, "Invalid argument" },
+ { kSCStatusKeyExists, "Key already defined" },
+ { kSCStatusLocked, "Lock already held" },
+ { kSCStatusMaxLink, "Maximum link count exceeded" },
+ { kSCStatusNeedLock, "Lock required for this operation" },
+ { kSCStatusNoStoreServer, "Configuration daemon not (no longer) available" },
+ { kSCStatusNoStoreSession, "Configuration daemon session not active" },
+ { kSCStatusNoConfigFile, "Configuration file not found" },
+ { kSCStatusNoKey, "No such key" },
+ { kSCStatusNoLink, "No such link" },
+ { kSCStatusNoPrefsSession, "Preference session not active" },
+ { kSCStatusNotifierActive, "Notifier is currently active" },
+ { kSCStatusOK, "Success!" },
+ { kSCStatusPrefsBusy, "Preferences update currently in progress" },
+ { kSCStatusReachabilityUnknown, "Network reachability cannot be determined" },
+ { kSCStatusStale, "Write attempted on stale version of object" },
+};
+#define nSC_ERRMSGS (sizeof(sc_errmsgs)/sizeof(struct sc_errmsg))
void
{
__SCThreadSpecificDataRef tsd;
- pthread_once(&tsKeyInitialized, __SCThreadSpecificKeyInitialize);
-
- tsd = pthread_getspecific(tsDataKey);
- if (!tsd) {
- tsd = CFAllocatorAllocate(kCFAllocatorSystemDefault, sizeof(__SCThreadSpecificData), 0);
- bzero(tsd, sizeof(__SCThreadSpecificData));
- pthread_setspecific(tsDataKey, tsd);
- }
-
+ tsd = __SCGetThreadSpecificData();
tsd->_sc_error = error;
return;
}
__SCThreadSpecificDataRef tsd;
CFMutableDictionaryRef userInfo = NULL;
- pthread_once(&tsKeyInitialized, __SCThreadSpecificKeyInitialize);
-
- tsd = pthread_getspecific(tsDataKey);
- code = tsd ? tsd->_sc_error : kSCStatusOK;
+ tsd = __SCGetThreadSpecificData();
+ code =tsd->_sc_error;
for (i = 0; i < (int)nSC_ERRMSGS; i++) {
if (sc_errmsgs[i].status == code) {
domain = kCFErrorDomainMach;
done :
-
+
error = CFErrorCreate(NULL, domain, code, userInfo);
if (userInfo != NULL) CFRelease(userInfo);
return error;
{
__SCThreadSpecificDataRef tsd;
- pthread_once(&tsKeyInitialized, __SCThreadSpecificKeyInitialize);
-
- tsd = pthread_getspecific(tsDataKey);
- return tsd ? tsd->_sc_error : kSCStatusOK;
+ tsd = __SCGetThreadSpecificData();
+ return tsd->_sc_error;
}
/*
- * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2005, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
if (store == NULL) {
/* sorry, you must provide a session */
_SCErrorSet(kSCStatusNoStoreSession);
+ return FALSE;
}
if (storePrivate->server == MACH_PORT_NULL) {
CFRelease(xmlData);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreAddTemporaryValue configadd_s(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreAddTemporaryValue configadd_s(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return FALSE;
CFRelease(xmlData);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreAddValue configadd(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreAddValue configadd(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return FALSE;
/*
- * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2005, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
CFStringRef consoleUser;
CFMutableDictionaryRef dict = NULL;
CFStringRef key = SCDynamicStoreKeyCreateConsoleUser(NULL);
- Boolean ok = TRUE;
+ Boolean ok = FALSE;
Boolean tempSession = FALSE;
if (store == NULL) {
NULL,
NULL);
if (store == NULL) {
- return FALSE;
+ goto done;
}
tempSession = TRUE;
}
if ((user == NULL) && (sessions == NULL)) {
- (void) SCDynamicStoreRemoveValue(store, key);
+ ok = SCDynamicStoreRemoveValue(store, key);
goto done;
}
CFMutableDictionaryRef dict = NULL;
CFStringRef key = SCDynamicStoreKeyCreateConsoleUser(NULL);
CFNumberRef num;
- Boolean ok = TRUE;
+ Boolean ok = FALSE;
Boolean tempSession = FALSE;
if (store == NULL) {
NULL,
NULL);
if (store == NULL) {
- return FALSE;
+ goto done;
}
tempSession = TRUE;
}
if (user == NULL) {
- (void) SCDynamicStoreRemoveValue(store, key);
+ ok = SCDynamicStoreRemoveValue(store, key);
goto done;
}
/*
- * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2005, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
if (xmlPatterns) CFRelease(xmlPatterns);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreCopyMultiple configget_m(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreCopyMultiple configget_m(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return NULL;
}
if (sc_status != kSCStatusOK) {
- status = vm_deallocate(mach_task_self(), (vm_address_t)xmlDictRef, xmlDictLen);
-#ifdef DEBUG
- if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("SCDynamicStoreCopyMultiple vm_deallocate(): %s"), mach_error_string(status));
- /* non-fatal???, proceed */
- }
-#endif /* DEBUG */
+ (void) vm_deallocate(mach_task_self(), (vm_address_t)xmlDictRef, xmlDictLen);
_SCErrorSet(sc_status);
return NULL;
}
CFRelease(utfKey);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreCopyValue configget(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreCopyValue configget(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return NULL;
}
if (sc_status != kSCStatusOK) {
- status = vm_deallocate(mach_task_self(), (vm_address_t)xmlDataRef, xmlDataLen);
-#ifdef DEBUG
- if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("SCDynamicStoreCopyValue vm_deallocate(): %s"), mach_error_string(status));
- /* non-fatal???, proceed */
- }
-#endif /* DEBUG */
+ (void) vm_deallocate(mach_task_self(), (vm_address_t)xmlDataRef, xmlDataLen);
_SCErrorSet(sc_status);
return NULL;
}
} else if (isalnum(ch) == 0) {
switch (ch) {
case '.':
- case '-':
- if (prev == '.' || prev == '-') {
- /* a label cannot begin or end with a hyphen */
+ if (prev == '.') {
+ /* no empty labels */
return FALSE;
}
break;
+ case '-':
+ /* hyphens are OK within a label */
+ break;
default:
/* an invalid character */
return FALSE;
/*
- * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2005, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
CFRelease(utfPattern);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreCopyKeyList configlist(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreCopyKeyList configlist(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return NULL;
}
if (sc_status != kSCStatusOK) {
- status = vm_deallocate(mach_task_self(), (vm_address_t)xmlDataRef, xmlDataLen);
-#ifdef DEBUG
- if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("SCDynamicStoreCopyKeyList vm_deallocate(): %s"), mach_error_string(status));
- /* non-fatal???, proceed */
- }
-#endif /* DEBUG */
+ (void) vm_deallocate(mach_task_self(), (vm_address_t)xmlDataRef, xmlDataLen);
_SCErrorSet(sc_status);
return NULL;
}
/*
- * Copyright (c) 2000, 2001, 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2004, 2005, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
status = configlock(storePrivate->server, (int *)&sc_status);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreLock configlock(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreLock configlock(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return FALSE;
/*
- * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2005, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
CFRelease(utfKey);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreAddWatchedKey notifyadd(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreAddWatchedKey notifyadd(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return FALSE;
/*
- * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2005, 2008, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
return TRUE;
case Using_NotifierInformViaCallback :
/* invalidate and release the run loop source */
- CFRunLoopSourceInvalidate(storePrivate->callbackRLS);
- CFRelease(storePrivate->callbackRLS);
- storePrivate->callbackRLS = NULL;
+ if (storePrivate->callbackRLS != NULL) {
+ CFRunLoopSourceInvalidate(storePrivate->callbackRLS);
+ CFRelease(storePrivate->callbackRLS);
+ storePrivate->callbackRLS = NULL;
+ }
/* invalidate and release the callback mach port */
- CFMachPortInvalidate(storePrivate->callbackPort);
- CFRelease(storePrivate->callbackPort);
- storePrivate->callbackPort = NULL;
+ if (storePrivate->callbackPort != NULL) {
+ __MACH_PORT_DEBUG(TRUE, "*** SCDynamicStoreNotifyCancel", CFMachPortGetPort(storePrivate->callbackPort));
+ CFMachPortInvalidate(storePrivate->callbackPort);
+ CFRelease(storePrivate->callbackPort);
+ storePrivate->callbackPort = NULL;
+ }
- storePrivate->callbackArgument = NULL;
- storePrivate->callbackFunction = NULL;
+ storePrivate->callbackArgument = NULL;
+ storePrivate->callbackFunction = NULL;
break;
default :
break;
storePrivate->notifyStatus = NotifierNotRegistered;
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreNotifyCancel notifycancel(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyCancel notifycancel(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return FALSE;
/*
- * Copyright (c) 2000, 2001, 2003-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003-2005, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
(int *)&sc_status);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreCopyNotifiedKeys notifychanges(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreCopyNotifiedKeys notifychanges(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return NULL;
}
if (sc_status != kSCStatusOK) {
- status = vm_deallocate(mach_task_self(), (vm_address_t)xmlDataRef, xmlDataLen);
-#ifdef DEBUG
- if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("SCDynamicStoreCopyNotifiedKeys vm_deallocate(): %s"), mach_error_string(status));
- /* non-fatal???, proceed */
- }
-#endif /* DEBUG */
+ (void) vm_deallocate(mach_task_self(), (vm_address_t)xmlDataRef, xmlDataLen);
_SCErrorSet(sc_status);
return NULL;
}
/*
- * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2005, 2008, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* - initial revision
*/
+#include <Availability.h>
+#include <TargetConditionals.h>
+#include <sys/cdefs.h>
+#if !TARGET_OS_IPHONE
+#include <dispatch/dispatch.h>
+#endif // !TARGET_OS_IPHONE
#include <mach/mach.h>
#include <mach/mach_error.h>
#include "SCDynamicStoreInternal.h"
#include "config.h" /* MiG generated file */
+
static void
informCallback(CFMachPortRef port, void *msg, CFIndex size, void *info)
{
#endif /* DEBUG */
/* invalidate the run loop source */
- CFRunLoopSourceInvalidate(storePrivate->callbackRLS);
- CFRelease(storePrivate->callbackRLS);
- storePrivate->callbackRLS = NULL;
+ if (storePrivate->callbackRLS != NULL) {
+ CFRunLoopSourceInvalidate(storePrivate->callbackRLS);
+ CFRelease(storePrivate->callbackRLS);
+ storePrivate->callbackRLS = NULL;
+ }
/* invalidate port */
- CFMachPortInvalidate(storePrivate->callbackPort);
- CFRelease(storePrivate->callbackPort);
- storePrivate->callbackPort = NULL;
+ if (storePrivate->callbackPort != NULL) {
+ __MACH_PORT_DEBUG(TRUE, "*** informCallback", CFMachPortGetPort(storePrivate->callbackPort));
+ CFMachPortInvalidate(storePrivate->callbackPort);
+ CFRelease(storePrivate->callbackPort);
+ storePrivate->callbackPort = NULL;
+ }
/* disable notifier */
- storePrivate->notifyStatus = NotifierNotRegistered;
- storePrivate->callbackArgument = NULL;
- storePrivate->callbackFunction = NULL;
+ storePrivate->notifyStatus = NotifierNotRegistered;
+ storePrivate->callbackArgument = NULL;
+ storePrivate->callbackFunction = NULL;
return;
}
}
/* Allocating port (for server response) */
- storePrivate->callbackPort = CFMachPortCreate(NULL,
- informCallback,
- &context,
- NULL);
+ status = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &port);
+ if (status != KERN_SUCCESS) {
+ SCLog(TRUE, LOG_ERR, CFSTR("mach_port_allocate(): %s"), mach_error_string(status));
+ _SCErrorSet(status);
+ return FALSE;
+ }
+
+ status = mach_port_insert_right(mach_task_self(),
+ port,
+ port,
+ MACH_MSG_TYPE_MAKE_SEND);
+ if (status != KERN_SUCCESS) {
+ /*
+ * We can't insert a send right into our own port! This should
+ * only happen if someone stomped on OUR port (so let's leave
+ * the port alone).
+ */
+ SCLog(TRUE, LOG_ERR, CFSTR("mach_port_insert_right(): %s"), mach_error_string(status));
+ _SCErrorSet(status);
+ return FALSE;
+ }
/* Request a notification when/if the server dies */
- port = CFMachPortGetPort(storePrivate->callbackPort);
status = mach_port_request_notification(mach_task_self(),
port,
MACH_NOTIFY_NO_SENDERS,
MACH_MSG_TYPE_MAKE_SEND_ONCE,
&oldNotify);
if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("SCDynamicStoreNotifyCallback mach_port_request_notification(): %s"), mach_error_string(status));
- CFMachPortInvalidate(storePrivate->callbackPort);
- CFRelease(storePrivate->callbackPort);
+ /*
+ * We can't request a notification for our own port! This should
+ * only happen if someone stomped on OUR port (so let's leave
+ * the port alone).
+ */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyCallback mach_port_request_notification(): %s"), mach_error_string(status));
_SCErrorSet(status);
return FALSE;
}
-#ifdef DEBUG
if (oldNotify != MACH_PORT_NULL) {
- SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyCallback(): why is oldNotify != MACH_PORT_NULL?"));
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyCallback(): oldNotify != MACH_PORT_NULL"));
}
-#endif /* DEBUG */
/* Requesting notification via mach port */
status = notifyviaport(storePrivate->server,
(int *)&sc_status);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreNotifyCallback notifyviaport(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- CFMachPortInvalidate(storePrivate->callbackPort);
- CFRelease(storePrivate->callbackPort);
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyCallback notifyviaport(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
+
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* remove the send right that we tried (but failed) to pass to the server */
+ (void) mach_port_deallocate(mach_task_self(), port);
+ }
+
+ /* remove our receive right */
+ (void) mach_port_mod_refs(mach_task_self(), port, MACH_PORT_RIGHT_RECEIVE, -1);
_SCErrorSet(status);
return FALSE;
}
}
/* set notifier active */
- storePrivate->notifyStatus = Using_NotifierInformViaCallback;
+ storePrivate->notifyStatus = Using_NotifierInformViaCallback;
/* Creating/adding a run loop source for the port */
+ __MACH_PORT_DEBUG(TRUE, "*** SCDynamicStoreNotifyCallback", port);
storePrivate->callbackArgument = arg;
storePrivate->callbackFunction = func;
+ storePrivate->callbackPort = CFMachPortCreateWithPort(NULL, port, informCallback, &context, NULL);
storePrivate->callbackRLS = CFMachPortCreateRunLoopSource(NULL, storePrivate->callbackPort, 0);
CFRunLoopAddSource(runLoop, storePrivate->callbackRLS, kCFRunLoopDefaultMode);
#endif /* DEBUG */
/* invalidate the run loop source(s) */
- CFRunLoopSourceInvalidate(storePrivate->callbackRLS);
- CFRelease(storePrivate->callbackRLS);
- storePrivate->callbackRLS = NULL;
+ if (storePrivate->callbackRLS != NULL) {
+ CFRunLoopSourceInvalidate(storePrivate->callbackRLS);
+ CFRelease(storePrivate->callbackRLS);
+ storePrivate->callbackRLS = NULL;
+ }
/* invalidate port */
- CFMachPortInvalidate(storePrivate->callbackPort);
- CFRelease(storePrivate->callbackPort);
- storePrivate->callbackPort = NULL;
+ if (storePrivate->callbackPort != NULL) {
+ __MACH_PORT_DEBUG(TRUE, "*** rlsCallback w/MACH_NOTIFY_NO_SENDERS", CFMachPortGetPort(storePrivate->callbackPort));
+ CFMachPortInvalidate(storePrivate->callbackPort);
+ CFRelease(storePrivate->callbackPort);
+ storePrivate->callbackPort = NULL;
+ }
return;
}
/* signal the real runloop source */
- CFRunLoopSourceSignal(storePrivate->rls);
+ if (storePrivate->rls != NULL) {
+ CFRunLoopSourceSignal(storePrivate->rls);
+ }
return;
}
static void
-rlsPortInvalidate(CFMachPortRef mp, void *info) {
- mach_port_t port = CFMachPortGetPort(mp);
+portInvalidate(CFMachPortRef port, void *info) {
+ mach_port_t mp = CFMachPortGetPort(port);
- // A simple deallocate won't get rid of all the references we've accumulated
-#ifdef DEBUG
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR(" invalidate = %d"), port);
-#endif /* DEBUG */
- (void)mach_port_mod_refs(mach_task_self(), port, MACH_PORT_RIGHT_RECEIVE, -1);
+ __MACH_PORT_DEBUG(TRUE, "*** portInvalidate", mp);
+ /* remove our receive right */
+ (void)mach_port_mod_refs(mach_task_self(), mp, MACH_PORT_RIGHT_RECEIVE, -1);
}
SCDynamicStorePrivateRef storePrivate = (SCDynamicStorePrivateRef)store;
#ifdef DEBUG
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("schedule notifications for mode %@"), mode);
+ SCLog(_sc_verbose, LOG_DEBUG,
+ CFSTR("schedule notifications for mode %@"),
+ (rl != NULL) ? mode : CFSTR("libdispatch"));
#endif /* DEBUG */
if (storePrivate->rlsRefs++ == 0) {
/* Allocating port (for server response) */
status = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &port);
if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("mach_port_allocate(): %s"), mach_error_string(status));
+ SCLog(TRUE, LOG_ERR, CFSTR("rlsSchedule mach_port_allocate(): %s"), mach_error_string(status));
return;
}
port,
MACH_MSG_TYPE_MAKE_SEND);
if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("mach_port_insert_right(): %s"), mach_error_string(status));
- (void) mach_port_destroy(mach_task_self(), port);
+ /*
+ * We can't insert a send right into our own port! This should
+ * only happen if someone stomped on OUR port (so let's leave
+ * the port alone).
+ */
+ SCLog(TRUE, LOG_ERR, CFSTR("rlsSchedule mach_port_insert_right(): %s"), mach_error_string(status));
return;
}
MACH_MSG_TYPE_MAKE_SEND_ONCE,
&oldNotify);
if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("mach_port_request_notification(): %s"), mach_error_string(status));
- (void) mach_port_destroy(mach_task_self(), port);
+ /*
+ * We can't request a notification for our own port! This should
+ * only happen if someone stomped on OUR port (so let's leave
+ * the port alone).
+ */
+ SCLog(TRUE, LOG_ERR, CFSTR("rlsSchedule mach_port_request_notification(): %s"), mach_error_string(status));
return;
}
-#ifdef DEBUG
if (oldNotify != MACH_PORT_NULL) {
- SCLog(TRUE, LOG_ERR, CFSTR("rlsSchedule(): why is oldNotify != MACH_PORT_NULL?"));
+ SCLog(TRUE, LOG_ERR, CFSTR("rlsSchedule(): oldNotify != MACH_PORT_NULL"));
}
-#endif /* DEBUG */
+ __MACH_PORT_DEBUG(TRUE, "*** rlsSchedule", port);
status = notifyviaport(storePrivate->server, port, 0, (int *)&sc_status);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("notifyviaport(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), port);
- port = MACH_PORT_NULL;
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("rlsSchedule notifyviaport(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
+
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* remove the send right that we tried (but failed) to pass to the server */
+ (void) mach_port_deallocate(mach_task_self(), port);
+ }
+
+ /* remove our receive right */
+ (void) mach_port_mod_refs(mach_task_self(), port, MACH_PORT_RIGHT_RECEIVE, -1);
return;
}
+ __MACH_PORT_DEBUG(TRUE, "*** rlsSchedule (after notifyviaport)", port);
storePrivate->callbackPort = CFMachPortCreateWithPort(NULL, port, rlsCallback, &context, NULL);
- CFMachPortSetInvalidationCallBack(storePrivate->callbackPort, rlsPortInvalidate);
+ if (storePrivate->callbackPort == NULL) {
+ SCLog(TRUE, LOG_ERR, CFSTR("*** CFMachPortCreateWithPort returned NULL while attempting to schedule"));
+ SCLog(TRUE, LOG_ERR, CFSTR("*** a SCDynamicStore notification. Did this process call \"fork\" without"));
+ SCLog(TRUE, LOG_ERR, CFSTR("*** calling \"exec\""));
+
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ storePrivate->server = MACH_PORT_NULL;
+
+ /* remove our receive right */
+ (void) mach_port_mod_refs(mach_task_self(), port, MACH_PORT_RIGHT_RECEIVE, -1);
+ return;
+ }
+ CFMachPortSetInvalidationCallBack(storePrivate->callbackPort, portInvalidate);
storePrivate->callbackRLS = CFMachPortCreateRunLoopSource(NULL, storePrivate->callbackPort, 0);
}
- if (storePrivate->callbackRLS != NULL) {
+ if ((rl != NULL) && (storePrivate->callbackRLS != NULL)) {
CFRunLoopAddSource(rl, storePrivate->callbackRLS, mode);
+ __MACH_PORT_DEBUG(TRUE, "*** rlsSchedule (after CFRunLoopAddSource)", CFMachPortGetPort(storePrivate->callbackPort));
}
return;
SCDynamicStorePrivateRef storePrivate = (SCDynamicStorePrivateRef)store;
#ifdef DEBUG
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("cancel notifications for mode %@"), mode);
+ SCLog(_sc_verbose, LOG_DEBUG,
+ CFSTR("cancel notifications for mode %@"),
+ (rl != NULL) ? mode : CFSTR("libdispatch"));
#endif /* DEBUG */
- if (storePrivate->callbackRLS != NULL) {
+ if ((rl != NULL) && (storePrivate->callbackRLS != NULL)) {
CFRunLoopRemoveSource(rl, storePrivate->callbackRLS, mode);
}
#ifdef DEBUG
SCLog(_sc_verbose, LOG_DEBUG, CFSTR(" cancel callback runloop source"));
#endif /* DEBUG */
+ __MACH_PORT_DEBUG((storePrivate->callbackPort != NULL),
+ "*** rlsCancel",
+ CFMachPortGetPort(storePrivate->callbackPort));
if (storePrivate->callbackRLS != NULL) {
/* invalidate & remove the run loop source */
if (storePrivate->callbackPort != NULL) {
/* invalidate port */
+ __MACH_PORT_DEBUG((storePrivate->callbackPort != NULL),
+ "*** rlsCancel (before invalidating CFMachPort)",
+ CFMachPortGetPort(storePrivate->callbackPort));
CFMachPortInvalidate(storePrivate->callbackPort);
CFRelease(storePrivate->callbackPort);
storePrivate->callbackPort = NULL;
if (storePrivate->server != MACH_PORT_NULL) {
status = notifycancel(storePrivate->server, (int *)&sc_status);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_INFO, CFSTR("notifycancel(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("rlsCancel notifycancel(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
return;
}
}
}
+
return;
}
rlsFunction = storePrivate->rlsFunction;
- if (NULL != storePrivate->rlsContext.retain) {
+ if (storePrivate->rlsContext.retain != NULL) {
context_info = (void *)storePrivate->rlsContext.retain(storePrivate->rlsContext.info);
context_release = storePrivate->rlsContext.release;
} else {
static CFStringRef
rlsCopyDescription(const void *info)
{
- CFMutableStringRef result;
- SCDynamicStoreRef store = (SCDynamicStoreRef)info;
+ CFMutableStringRef result;
+ SCDynamicStoreRef store = (SCDynamicStoreRef)info;
SCDynamicStorePrivateRef storePrivate = (SCDynamicStorePrivateRef)store;
result = CFStringCreateMutable(NULL, 0);
};
storePrivate->rls = CFRunLoopSourceCreate(allocator, order, &context);
+ if (storePrivate->rls == NULL) {
+ _SCErrorSet(kSCStatusFailed);
+ }
}
- if (storePrivate->rls == NULL) {
- _SCErrorSet(kSCStatusFailed);
- return NULL;
+ return storePrivate->rls;
+}
+
+
+#if !TARGET_OS_IPHONE
+static boolean_t
+SCDynamicStoreNotifyMIGCallback(mach_msg_header_t *message, mach_msg_header_t *reply)
+{
+ SCDynamicStorePrivateRef storePrivate;
+
+ storePrivate = dispatch_get_context(dispatch_get_current_queue());
+ if (storePrivate != NULL) {
+ CFRetain(storePrivate);
+ dispatch_async(storePrivate->dispatchQueue, ^{
+ rlsPerform(storePrivate);
+ CFRelease(storePrivate);
+ });
}
+ reply->msgh_remote_port = MACH_PORT_NULL;
+ return false;
+}
- return storePrivate->rls;
+
+Boolean
+SCDynamicStoreSetDispatchQueue(SCDynamicStoreRef store, dispatch_queue_t queue)
+{
+ Boolean ok = FALSE;
+ SCDynamicStorePrivateRef storePrivate = (SCDynamicStorePrivateRef)store;
+
+ if (store == NULL) {
+ /* sorry, you must provide a session */
+ _SCErrorSet(kSCStatusNoStoreSession);
+ return FALSE;
+ }
+
+ if (storePrivate->server == MACH_PORT_NULL) {
+ /* sorry, you must have an open session to play */
+ _SCErrorSet(kSCStatusNoStoreServer);
+ return FALSE;
+ }
+
+ if (queue != NULL) {
+ dispatch_queue_attr_t attr;
+ mach_port_t mp;
+ long res;
+
+ if ((storePrivate->dispatchQueue != NULL) || (storePrivate->rls != NULL)) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return FALSE;
+ }
+
+ if (storePrivate->notifyStatus != NotifierNotRegistered) {
+ /* sorry, you can only have one notification registered at once... */
+ _SCErrorSet(kSCStatusNotifierActive);
+ return FALSE;
+ }
+
+ /*
+ * mark our using of the SCDynamicStore notifications, create and schedule
+ * the notification port (storePrivate->callbackPort), and a bunch of other
+ * "setup"
+ */
+ storePrivate->notifyStatus = Using_NotifierInformViaDispatch;
+ rlsSchedule((void*)store, NULL, NULL);
+ storePrivate->dispatchQueue = queue;
+ dispatch_retain(storePrivate->dispatchQueue);
+
+ /*
+ * create a queue for the mig source, we'll use this queue's context
+ * to carry the store pointer for the callback code.
+ */
+ attr = dispatch_queue_attr_create();
+ res = dispatch_queue_attr_set_finalizer(attr,
+ ^(dispatch_queue_t dq) {
+ SCDynamicStoreRef store;
+
+ store = (SCDynamicStoreRef)dispatch_get_context(dq);
+ CFRelease(store);
+ });
+ if (res != 0) {
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStore dispatch_queue_attr_set_finalizer() failed"));
+ dispatch_release(attr);
+ _SCErrorSet(kSCStatusFailed);
+ goto cleanup;
+ }
+ storePrivate->callbackQueue = dispatch_queue_create("com.apple.SCDynamicStore.notifications", attr);
+ dispatch_release(attr);
+ if (storePrivate->callbackQueue == NULL){
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStore dispatch_queue_create() failed"));
+ _SCErrorSet(kSCStatusFailed);
+ goto cleanup;
+ }
+ CFRetain(store); // Note: will be released when the dispatch queue is released
+ dispatch_set_context(storePrivate->callbackQueue, (void *)store);
+
+ dispatch_suspend(storePrivate->callbackQueue);
+ mp = CFMachPortGetPort(storePrivate->callbackPort);
+ storePrivate->callbackSource = dispatch_source_mig_create(mp, sizeof(mach_msg_header_t), NULL, storePrivate->callbackQueue, SCDynamicStoreNotifyMIGCallback);
+ if (storePrivate->callbackSource == NULL) {
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStore dispatch_source_mig_create() failed"));
+ _SCErrorSet(kSCStatusFailed);
+ goto cleanup;
+ }
+ dispatch_resume(storePrivate->callbackQueue);
+
+ ok = TRUE;
+ goto done;
+ } else {
+ if (storePrivate->dispatchQueue == NULL) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return FALSE;
+ }
+
+ ok = TRUE;
+ }
+
+ cleanup :
+
+ if (storePrivate->callbackSource != NULL) {
+ dispatch_cancel(storePrivate->callbackSource);
+ dispatch_release(storePrivate->callbackSource);
+ storePrivate->callbackSource = NULL;
+ }
+ if (storePrivate->callbackQueue != NULL) {
+ dispatch_release(storePrivate->callbackQueue);
+ storePrivate->callbackQueue = NULL;
+ }
+ dispatch_release(storePrivate->dispatchQueue);
+ storePrivate->dispatchQueue = NULL;
+ rlsCancel((void*)store, NULL, NULL);
+ storePrivate->notifyStatus = NotifierNotRegistered;
+
+ done :
+
+ return ok;
}
+#endif // !TARGET_OS_IPHONE
/*
- * Copyright (c) 2000, 2001, 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2004, 2005, 2008, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
int32_t identifier,
int *fd)
{
+ size_t n;
+ int sc_status;
+ int sock;
SCDynamicStorePrivateRef storePrivate = (SCDynamicStorePrivateRef)store;
kern_return_t status;
- int sc_status;
+ char tmpdir[PATH_MAX];
struct sockaddr_un un;
- int sock;
if (store == NULL) {
/* sorry, you must provide a session */
}
/* establish a UNIX domain socket for server->client notification */
+
+ n = confstr(_CS_DARWIN_USER_TEMP_DIR, tmpdir, sizeof(tmpdir));
+ if ((n <= 0) || (n >= sizeof(tmpdir))) {
+ (void) strlcpy(tmpdir, _PATH_TMP, sizeof(tmpdir));
+ }
+
bzero(&un, sizeof(un));
un.sun_family = AF_UNIX;
snprintf(un.sun_path,
sizeof(un.sun_path)-1,
- "%s%s-%d",
- _PATH_VARTMP,
+ "%s%s-%d-%d",
+ tmpdir,
"SCDynamicStoreNotifyFileDescriptor",
+ getpid(),
storePrivate->server);
+ /* ensure that the path does not already exist */
+ (void) unlink(un.sun_path);
+
if (bind(sock, (struct sockaddr *)&un, sizeof(un)) == -1) {
_SCErrorSet(errno);
SCLog(TRUE, LOG_NOTICE, CFSTR("SCDynamicStoreNotifyFileDescriptor bind(): %s"), strerror(errno));
+ (void) unlink(un.sun_path);
(void) close(sock);
return FALSE;
}
if (listen(sock, 0) == -1) {
_SCErrorSet(errno);
SCLog(TRUE, LOG_NOTICE, CFSTR("SCDynamicStoreNotifyFileDescriptor listen(): %s"), strerror(errno));
+ (void) unlink(un.sun_path);
(void) close(sock);
return FALSE;
}
(int *)&sc_status);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreNotifyFileDescriptor notifyviafd(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyFileDescriptor notifyviafd(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return FALSE;
}
+ (void) unlink(un.sun_path);
+
+ if (sc_status != kSCStatusOK) {
+ _SCErrorSet(sc_status);
+ SCLog(TRUE, LOG_NOTICE,
+ CFSTR("SCDynamicStoreNotifyFileDescriptor server error: %s"),
+ SCErrorString(sc_status));
+ (void) close(sock);
+ return FALSE;
+ }
+
*fd = accept(sock, 0, 0);
if (*fd == -1) {
_SCErrorSet(errno);
/*
- * Copyright (c) 2000, 2001, 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2004, 2005, 2009 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
/* Allocating port (for server response) */
status = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, port);
if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("SCDynamicStoreNotifyMachPort mach_port_allocate(): %s"), mach_error_string(status));
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyMachPort mach_port_allocate(): %s"), mach_error_string(status));
_SCErrorSet(status);
return FALSE;
}
*port,
MACH_MSG_TYPE_MAKE_SEND);
if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("SCDynamicStoreNotifyMachPort mach_port_insert_right(): %s"), mach_error_string(status));
- (void) mach_port_destroy(mach_task_self(), *port);
+ /*
+ * We can't insert a send right into our own port! This should
+ * only happen if someone stomped on OUR port (so let's leave
+ * the port alone).
+ */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyMachPort mach_port_insert_right(): %s"), mach_error_string(status));
*port = MACH_PORT_NULL;
_SCErrorSet(status);
return FALSE;
MACH_MSG_TYPE_MAKE_SEND_ONCE,
&oldNotify);
if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("SCDynamicStoreNotifyMachPort mach_port_request_notification(): %s"), mach_error_string(status));
- (void) mach_port_destroy(mach_task_self(), *port);
+ /*
+ * We can't request a notification for our own port! This should
+ * only happen if someone stomped on OUR port (so let's leave
+ * the port alone).
+ */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyMachPort mach_port_request_notification(): %s"), mach_error_string(status));
*port = MACH_PORT_NULL;
_SCErrorSet(status);
return FALSE;
}
-#ifdef DEBUG
if (oldNotify != MACH_PORT_NULL) {
- SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyMachPort(): why is oldNotify != MACH_PORT_NULL?"));
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyMachPort(): oldNotify != MACH_PORT_NULL"));
}
-#endif /* DEBUG */
status = notifyviaport(storePrivate->server,
*port,
(int *)&sc_status);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreNotifyMachPort notifyviaport(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), *port);
- *port = MACH_PORT_NULL;
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyMachPort notifyviaport(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
+
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* remove the send right that we tried (but failed) to pass to the server */
+ (void) mach_port_deallocate(mach_task_self(), *port);
+ }
+
+ /* remove our receive right */
+ (void) mach_port_mod_refs(mach_task_self(), *port, MACH_PORT_RIGHT_RECEIVE, -1);
+ *port = MACH_PORT_NULL;
_SCErrorSet(status);
return FALSE;
}
/* set notifier active */
+ __MACH_PORT_DEBUG(TRUE, "*** SCDynamicStoreNotifyMachPort", *port);
storePrivate->notifyStatus = Using_NotifierInformViaMachPort;
return TRUE;
/*
- * Copyright (c) 2000, 2001, 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2004, 2005, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
status = notifyviasignal(storePrivate->server, task, sig, (int *)&sc_status);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreNotifySignal notifyviasignal(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifySignal notifyviasignal(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return FALSE;
/*
- * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2005, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
CFRelease(utfKey);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreRemoveWatchedKey notifyremove(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreRemoveWatchedKey notifyremove(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return FALSE;
/*
- * Copyright (c) 2000, 2001, 2003-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003-2005, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
if (xmlPatterns) CFRelease(xmlPatterns);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreSetNotificationKeys notifyset(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreSetNotificationKeys notifyset(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return FALSE;
/*
- * Copyright (c) 2000, 2001, 2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2004, 2006, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
/* Allocating port (for server response) */
status = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &port);
if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("SCDynamicStoreNotifyWait mach_port_allocate(): %s"), mach_error_string(status));
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyWait mach_port_allocate(): %s"), mach_error_string(status));
_SCErrorSet(status);
return FALSE;
}
port,
MACH_MSG_TYPE_MAKE_SEND);
if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("SCDynamicStoreNotifyWait mach_port_insert_right(): %s"), mach_error_string(status));
- (void) mach_port_destroy(mach_task_self(), port);
+ /*
+ * We can't insert a send right into our own port! This should
+ * only happen if someone stomped on OUR port (so let's leave
+ * the port alone).
+ */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyWait mach_port_insert_right(): %s"), mach_error_string(status));
_SCErrorSet(status);
return FALSE;
}
MACH_MSG_TYPE_MAKE_SEND_ONCE,
&oldNotify);
if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("SCDynamicStoreNotifyWait mach_port_request_notification(): %s"), mach_error_string(status));
- (void) mach_port_destroy(mach_task_self(), port);
+ /*
+ * We can't request a notification for our own port! This should
+ * only happen if someone stomped on OUR port (so let's leave
+ * the port alone).
+ */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyWait mach_port_request_notification(): %s"), mach_error_string(status));
_SCErrorSet(status);
return FALSE;
}
-#ifdef DEBUG
if (oldNotify != MACH_PORT_NULL) {
- SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyWait(): why is oldNotify != MACH_PORT_NULL?"));
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyWait(): oldNotify != MACH_PORT_NULL"));
}
-#endif /* DEBUG */
status = notifyviaport(storePrivate->server,
port,
(int *)&sc_status);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(TRUE, LOG_DEBUG, CFSTR("SCDynamicStoreNotifyWait notifyviaport(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyWait notifyviaport(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
+
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* remove the send right that we tried (but failed) to pass to the server */
+ (void) mach_port_deallocate(mach_task_self(), port);
+ }
+
+ /* remove our receive right */
+ (void) mach_port_mod_refs(mach_task_self(), port, MACH_PORT_RIGHT_RECEIVE, -1);
_SCErrorSet(status);
return FALSE;
}
#ifdef DEBUG
SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreNotifyWait communication with server failed, destroying port %d"), port);
#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), port);
+ (void) mach_port_mod_refs(mach_task_self(), port, MACH_PORT_RIGHT_RECEIVE , -1);
_SCErrorSet(kSCStatusNoStoreServer);
return FALSE;
}
(int *)&sc_status);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreNotifyWait notifycancel(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyWait notifycancel(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
+
+ /* remove our receive right */
+ (void) mach_port_mod_refs(mach_task_self(), port, MACH_PORT_RIGHT_RECEIVE , -1);
_SCErrorSet(status);
return FALSE;
}
- (void) mach_port_destroy(mach_task_self(), port);
+ (void) mach_port_mod_refs(mach_task_self(), port, MACH_PORT_RIGHT_RECEIVE , -1);
return TRUE;
}
/*
- * Copyright (c) 2000, 2001, 2003-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003-2005, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
CFRelease(utfKey);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreNotifyValue confignotify(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreNotifyValue confignotify(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return FALSE;
/*
- * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2006, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include "config.h" /* MiG generated file */
-static int _sc_active = 0;
static CFStringRef _sc_bundleID = NULL;
static pthread_mutex_t _sc_lock = PTHREAD_MUTEX_INITIALIZER;
static mach_port_t _sc_server = MACH_PORT_NULL;
{
int oldThreadState;
int sc_status;
- kern_return_t status;
SCDynamicStoreRef store = (SCDynamicStoreRef)cf;
SCDynamicStorePrivateRef storePrivate = (SCDynamicStorePrivateRef)store;
}
if (storePrivate->server != MACH_PORT_NULL) {
- status = configclose(storePrivate->server, (int *)&sc_status);
-#ifdef DEBUG
- if (status != KERN_SUCCESS) {
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("__SCDynamicStoreDeallocate configclose(): %s"), mach_error_string(status));
- }
-#endif /* DEBUG */
-
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ __MACH_PORT_DEBUG(TRUE, "*** __SCDynamicStoreDeallocate", storePrivate->server);
+ (void) configclose(storePrivate->server, (int *)&sc_status);
+ __MACH_PORT_DEBUG(TRUE, "*** __SCDynamicStoreDeallocate (after configclose)", storePrivate->server);
+
+ /*
+ * the above call to configclose() should result in the SCDynamicStore
+ * server code deallocating it's receive right. That, in turn, should
+ * result in our send becoming a dead name. We could explicitly remove
+ * the dead name right with a call to mach_port_mod_refs() but, to be
+ * sure, we use mach_port_deallocate() since that will get rid of a
+ * send, send_once, or dead name right.
+ */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
storePrivate->server = MACH_PORT_NULL;
}
CFRelease(storePrivate->keys);
CFRelease(storePrivate->patterns);
- /* cleanup */
- pthread_mutex_lock(&_sc_lock);
- _sc_active--; /* drop the number of active dynamic store sessions */
- if ((_sc_active == 0) && (_sc_server != MACH_PORT_NULL)) {
- /* release the [last] reference to the server */
- (void)mach_port_deallocate(mach_task_self(), _sc_server);
- _sc_server = MACH_PORT_NULL;
- }
- pthread_mutex_unlock(&_sc_lock);
-
return;
}
{
/* the process has forked (and we are the child process) */
- _sc_active = 0;
_sc_server = MACH_PORT_NULL;
-
return;
}
static pthread_once_t initialized = PTHREAD_ONCE_INIT;
static void
-__SCDynamicStoreInitialize(void) {
+__SCDynamicStoreInitialize(void)
+{
CFBundleRef bundle;
/* register with CoreFoundation */
}
+static mach_port_t
+__SCDynamicStoreServerPort(kern_return_t *status)
+{
+ mach_port_t server = MACH_PORT_NULL;
+ char *server_name;
+
+ server_name = getenv("SCD_SERVER");
+ if (!server_name) {
+ server_name = SCD_SERVER;
+ }
+
+ *status = bootstrap_look_up(bootstrap_port, server_name, &server);
+ switch (*status) {
+ case BOOTSTRAP_SUCCESS :
+ /* service currently registered, "a good thing" (tm) */
+ return server;
+ case BOOTSTRAP_UNKNOWN_SERVICE :
+ /* service not currently registered, try again later */
+ break;
+ default :
+#ifdef DEBUG
+ SCLog(_sc_verbose, LOG_DEBUG,
+ CFSTR("SCDynamicStoreCreate[WithOptions] bootstrap_look_up() failed: status=%s"),
+ bootstrap_strerror(*status));
+#endif /* DEBUG */
+ break;
+ }
+
+ return MACH_PORT_NULL;
+}
+
+
SCDynamicStorePrivateRef
__SCDynamicStoreCreatePrivate(CFAllocatorRef allocator,
const CFStringRef name,
storePrivate->notifySignal = 0;
storePrivate->notifySignalTask = TASK_NULL;
- /* initialize global state */
-
- pthread_mutex_lock(&_sc_lock);
-
- /* get the server port */
- if (_sc_server == MACH_PORT_NULL) {
- char *server_name;
- kern_return_t status;
-
- server_name = getenv("SCD_SERVER");
- if (!server_name) {
- server_name = SCD_SERVER;
- }
-
- status = bootstrap_look_up(bootstrap_port, server_name, &_sc_server);
- switch (status) {
- case BOOTSTRAP_SUCCESS :
- /* service currently registered, "a good thing" (tm) */
- break;
- case BOOTSTRAP_UNKNOWN_SERVICE :
- /* service not currently registered, try again later */
- sc_status = status;
- goto done;
- default :
-#ifdef DEBUG
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreCreate[WithOptions] bootstrap_look_up() failed: status=%d"), status);
-#endif /* DEBUG */
- sc_status = status;
- goto done;
- }
- }
-
- /* bump the number of active dynamic store sessions */
- _sc_active++;
-
- done :
-
- pthread_mutex_unlock(&_sc_lock);
-
if (sc_status != kSCStatusOK) {
_SCErrorSet(sc_status);
CFRelease(storePrivate);
SCDynamicStoreCallBack callout,
SCDynamicStoreContext *context)
{
+ int sc_status = kSCStatusFailed;
+ mach_port_t server;
+ kern_return_t status = KERN_SUCCESS;
SCDynamicStorePrivateRef storePrivate;
- kern_return_t status;
CFDataRef utfName; /* serialized name */
xmlData_t myNameRef;
CFIndex myNameLen;
CFDataRef xmlOptions = NULL; /* serialized options */
xmlData_t myOptionsRef = NULL;
CFIndex myOptionsLen = 0;
- int sc_status = kSCStatusFailed;
/*
* allocate and initialize a new session
}
/* open a new session with the server */
- status = configopen(_sc_server,
- myNameRef,
- myNameLen,
- myOptionsRef,
- myOptionsLen,
- &storePrivate->server,
- (int *)&sc_status);
+ server = _sc_server;
+ while (TRUE) {
+ if (server != MACH_PORT_NULL) {
+ status = configopen(server,
+ myNameRef,
+ myNameLen,
+ myOptionsRef,
+ myOptionsLen,
+ &storePrivate->server,
+ (int *)&sc_status);
+ if (status == KERN_SUCCESS) {
+ break;
+ }
+
+ // our [cached] server port is not valid
+ if (status != MACH_SEND_INVALID_DEST) {
+ // if we got an unexpected error, don't retry
+ sc_status = status;
+ break;
+ }
+ }
+
+ pthread_mutex_lock(&_sc_lock);
+ if (_sc_server != MACH_PORT_NULL) {
+ if (server == _sc_server) {
+ // if the server we tried returned the error
+ (void)mach_port_deallocate(mach_task_self(), _sc_server);
+ _sc_server = __SCDynamicStoreServerPort(&sc_status);
+ } else {
+ // another thread has refreshed the SCDynamicStore server port
+ }
+ } else {
+ _sc_server = __SCDynamicStoreServerPort(&sc_status);
+ }
+ server = _sc_server;
+ pthread_mutex_unlock(&_sc_lock);
+
+ if (server == MACH_PORT_NULL) {
+ // if SCDynamicStore server not available
+ break;
+ }
+ }
+ __MACH_PORT_DEBUG(TRUE, "*** SCDynamicStoreCreate[WithOptions]", storePrivate->server);
/* clean up */
CFRelease(utfName);
if (xmlOptions) CFRelease(xmlOptions);
- if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreCreate[WithOptions] configopen(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- sc_status = status;
- goto done;
- }
-
done :
if (sc_status != kSCStatusOK) {
+ SCLog(TRUE,
+ (status == KERN_SUCCESS) ? LOG_DEBUG : LOG_ERR,
+ CFSTR("SCDynamicStoreCreate[WithOptions] configopen(): %s"),
+ SCErrorString(sc_status));
_SCErrorSet(sc_status);
CFRelease(storePrivate);
storePrivate = NULL;
/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include <mach/mach_error.h>
#include <pthread.h>
+#include <execinfo.h>
+#include <libproc.h>
+#include <unistd.h>
+
#define N_QUICK 32
{
CFIndex converted;
CFIndex last = 0;
- CFIndex len = CFStringGetLength(cfstr);
+ CFIndex len;
+
+ if (cfstr == NULL) {
+ cfstr = CFSTR("");
+ }
+ len = CFStringGetLength(cfstr);
/* how much buffer space will we really need? */
converted = CFStringGetBytes(cfstr,
*dataLen = CFDataGetLength(myData);
status = vm_read(mach_task_self(),
(vm_address_t)CFDataGetBytePtr(myData), // address
- (vm_size_t) CFDataGetLength(myData), // size
+ *dataLen, // size
(void *)dataRef,
&len);
if (status != KERN_SUCCESS) {
*dataLen = CFDataGetLength(data);
status = vm_read(mach_task_self(),
(vm_address_t)CFDataGetBytePtr(data), // address
- CFDataGetLength(data), // size
+ *dataLen, // size
(void *)dataRef,
&len);
if (status != KERN_SUCCESS) {
#pragma mark DOS encoding/codepage
+#if !TARGET_OS_IPHONE
void
_SC_dos_encoding_and_codepage(CFStringEncoding macEncoding,
UInt32 macRegion,
*dosCodepage = CFStringConvertEncodingToWindowsCodepage(*dosEncoding);
return;
}
-
-
-#include <unicode/uset.h>
-#include <unicode/ucnv.h>
-
-
-CFDataRef
-_SC_dos_copy_string(CFStringRef str, CFStringEncoding dosEncoding, UInt32 dosCodepage)
-{
- USet *charSet = NULL;
- UConverter *conv = NULL;
- UErrorCode ec = U_ZERO_ERROR;
- char ianaName[16];
- CFDataRef line = NULL;
- CFMutableStringRef newStr = NULL;
- CFStringRef set = NULL;
- int32_t setSize;
- UChar *setChars;
- CFStringRef transform;
-
- /*
- * using ICU, convert the target character set into the
- * set of Unicode characters that can be converted to
- * that character set.
- *
- * Note: a full list of character set identifiers accepted
- * by ICU can be found at :
- *
- * http://dev.icu-project.org/cgi-bin/viewcvs.cgi/icu/source/data/mappings/convrtrs.txt?view=co
- */
- snprintf(ianaName, sizeof(ianaName), "cp%d", (int)dosCodepage);
- charSet = uset_open(0, 0);
- //ec = U_ZERO_ERROR;
- conv = ucnv_open(ianaName, &ec);
- if (U_FAILURE(ec)) {
- SCPrint(TRUE, stderr, CFSTR("ucnv_open() failed, ec = %s\n"), u_errorName(ec));
- goto done;
- }
- //ec = U_ZERO_ERROR;
- ucnv_getUnicodeSet(conv, charSet, UCNV_ROUNDTRIP_SET, &ec);
- if (U_FAILURE(ec)) {
- SCPrint(TRUE, stderr, CFSTR("ucnv_getUnicodeSet() failed, ec = %s\n"), u_errorName(ec));
- goto done;
- }
-
- /*
- * Next, we create a transform pattern that will transform *only*
- * the characters that are not in the target charset.
- */
- //ec = U_ZERO_ERROR;
- setSize = uset_toPattern(charSet, NULL, 0, FALSE, &ec);
- if (U_FAILURE(ec) && (ec != U_BUFFER_OVERFLOW_ERROR)) {
- SCPrint(TRUE, stderr, CFSTR("uset_toPattern() failed, ec = %s\n"), u_errorName(ec));
- goto done;
- }
- setChars = (UChar *)calloc(setSize, sizeof(UChar));
- ec = U_ZERO_ERROR;
- (void)uset_toPattern(charSet, setChars, setSize, FALSE, &ec);
- set = CFStringCreateWithCharacters(NULL, setChars, setSize);
- free(setChars);
-
- /*
- * Now make a transform pattern that will:
- * 1. Only affect characters *not* in the target character set
- * 2. Convert curly quotes, etc. to ASCII equivalents
- * 3. Convert any non-Latin characters to Latin
- * 4. Decompose any combining marks if possible
- * 5. Remove anything that's not ASCII
- *
- * ... and transform the string
- */
- transform = CFStringCreateWithFormat(NULL, NULL,
- CFSTR("[^%@]; Publishing-Any; Any-Latin; NFKD; [:^ASCII:] Remove"),
- set);
- newStr = CFStringCreateMutableCopy(NULL, 0, str);
- CFStringNormalize(newStr, kCFStringNormalizationFormC);
- if (!CFStringTransform(newStr, NULL, transform, FALSE)) {
- CFRelease(newStr);
- newStr = NULL;
- }
- CFRelease(transform);
-
- done :
-
- if (newStr != NULL) {
- line = CFStringCreateExternalRepresentation(NULL, newStr, dosEncoding, 0);
- CFRelease(newStr);
- }
-
- if (charSet != NULL) uset_close(charSet);
- if (conv != NULL) ucnv_close(conv);
- if (set != NULL) CFRelease(set);
-
- return line;
-}
+#endif // !TARGET_OS_IPHONE
#pragma mark -
#pragma mark Debugging
+/*
+ * print status of in-use mach ports
+ */
void
-__showMachPortStatus(void)
+_SC_logMachPortStatus(void)
{
-#ifdef DEBUG
- /* print status of in-use mach ports */
- if (_sc_debug) {
- kern_return_t status;
- mach_port_name_array_t ports;
- mach_port_type_array_t types;
- int pi, pn, tn;
- CFMutableStringRef str;
-
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("----------"));
-
- /* report on ALL mach ports associated with this task */
- status = mach_port_names(mach_task_self(), &ports, &pn, &types, &tn);
- if (status == MACH_MSG_SUCCESS) {
- str = CFStringCreateMutable(NULL, 0);
- for (pi = 0; pi < pn; pi++) {
- char rights[16], *rp = &rights[0];
-
- if (types[pi] != MACH_PORT_TYPE_NONE) {
- *rp++ = ' ';
- *rp++ = '(';
- if (types[pi] & MACH_PORT_TYPE_SEND)
- *rp++ = 'S';
- if (types[pi] & MACH_PORT_TYPE_RECEIVE)
- *rp++ = 'R';
- if (types[pi] & MACH_PORT_TYPE_SEND_ONCE)
- *rp++ = 'O';
- if (types[pi] & MACH_PORT_TYPE_PORT_SET)
- *rp++ = 'P';
- if (types[pi] & MACH_PORT_TYPE_DEAD_NAME)
- *rp++ = 'D';
- *rp++ = ')';
- }
- *rp = '\0';
- CFStringAppendFormat(str, NULL, CFSTR(" %d%s"), ports[pi], rights);
+ kern_return_t status;
+ mach_port_name_array_t ports;
+ mach_port_type_array_t types;
+ mach_msg_type_number_t pi, pn, tn;
+ CFMutableStringRef str;
+
+ SCLog(TRUE, LOG_DEBUG, CFSTR("----------"));
+
+ /* report on ALL mach ports associated with this task */
+ status = mach_port_names(mach_task_self(), &ports, &pn, &types, &tn);
+ if (status == MACH_MSG_SUCCESS) {
+ str = CFStringCreateMutable(NULL, 0);
+ for (pi = 0; pi < pn; pi++) {
+ char rights[16], *rp = &rights[0];
+
+ if (types[pi] != MACH_PORT_TYPE_NONE) {
+ *rp++ = ' ';
+ *rp++ = '(';
+ if (types[pi] & MACH_PORT_TYPE_SEND)
+ *rp++ = 'S';
+ if (types[pi] & MACH_PORT_TYPE_RECEIVE)
+ *rp++ = 'R';
+ if (types[pi] & MACH_PORT_TYPE_SEND_ONCE)
+ *rp++ = 'O';
+ if (types[pi] & MACH_PORT_TYPE_PORT_SET)
+ *rp++ = 'P';
+ if (types[pi] & MACH_PORT_TYPE_DEAD_NAME)
+ *rp++ = 'D';
+ *rp++ = ')';
}
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("Task ports (n=%d):%@"), pn, str);
- CFRelease(str);
- } else {
- /* log (but ignore) errors */
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("mach_port_names(): %s"), mach_error_string(status));
+ *rp = '\0';
+ CFStringAppendFormat(str, NULL, CFSTR(" %d%s"), ports[pi], rights);
}
+ SCLog(TRUE, LOG_DEBUG, CFSTR("Task ports (n=%d):%@"), pn, str);
+ CFRelease(str);
}
-#endif /* DEBUG */
+
return;
}
void
-__showMachPortReferences(mach_port_t port)
+_SC_logMachPortReferences(const char *str, mach_port_t port)
{
-#ifdef DEBUG
- kern_return_t status;
+ const char *blanks = " ";
+ char buf[60];
+ mach_port_type_t pt;
+ mach_port_status_t recv_status = { 0 };
mach_port_urefs_t refs_send = 0;
mach_port_urefs_t refs_recv = 0;
mach_port_urefs_t refs_once = 0;
mach_port_urefs_t refs_pset = 0;
mach_port_urefs_t refs_dead = 0;
+ kern_return_t status;
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("user references for mach port %d"), port);
+ buf[0] = '\0';
+ if (str != NULL) {
+ static int is_configd = -1;
- status = mach_port_get_refs(mach_task_self(), port, MACH_PORT_RIGHT_SEND, &refs_send);
- if (status != KERN_SUCCESS) {
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR(" mach_port_get_refs(MACH_PORT_RIGHT_SEND): %s"), mach_error_string(status));
- return;
+ if (is_configd == -1) {
+ char name[64] = "";
+
+ (void) proc_name(getpid(), name, sizeof(name));
+ is_configd = (strncmp(name, "configd", sizeof(name)) == 0);
+ }
+ if (is_configd == 1) {
+ // if "configd", add indication if this is the M[ain] or [P]lugin thread
+ strlcpy(buf,
+ (CFRunLoopGetMain() == CFRunLoopGetCurrent()) ? "M " : "P ",
+ sizeof(buf));
+ }
+
+ // add provided string
+ strlcat(buf, str, sizeof(buf));
+
+ // fill
+ strlcat(buf, blanks, sizeof(buf));
+ if (strcmp(&buf[sizeof(buf) - 3], " ") == 0) {
+ buf[sizeof(buf) - 3] = ':';
+ }
}
- status = mach_port_get_refs(mach_task_self(), port, MACH_PORT_RIGHT_RECEIVE, &refs_recv);
+ status = mach_port_type(mach_task_self(), port, &pt);
if (status != KERN_SUCCESS) {
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR(" mach_port_get_refs(MACH_PORT_RIGHT_RECEIVE): %s"), mach_error_string(status));
- return;
+ SCLog(TRUE, LOG_DEBUG,
+ CFSTR("%smach_port_get_refs(..., %d, MACH_PORT_RIGHT_SEND): %s"),
+ buf,
+ port,
+ mach_error_string(status));
}
- status = mach_port_get_refs(mach_task_self(), port, MACH_PORT_RIGHT_SEND_ONCE, &refs_once);
- if (status != KERN_SUCCESS) {
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR(" mach_port_get_refs(MACH_PORT_RIGHT_SEND_ONCE): %s"), mach_error_string(status));
- return;
+ if ((pt & MACH_PORT_TYPE_SEND) != 0) {
+ status = mach_port_get_refs(mach_task_self(), port, MACH_PORT_RIGHT_SEND, &refs_send);
+ if (status != KERN_SUCCESS) {
+ SCLog(TRUE, LOG_DEBUG,
+ CFSTR("%smach_port_get_refs(..., %d, MACH_PORT_RIGHT_SEND): %s"),
+ buf,
+ port,
+ mach_error_string(status));
+ }
}
- status = mach_port_get_refs(mach_task_self(), port, MACH_PORT_RIGHT_PORT_SET, &refs_pset);
- if (status != KERN_SUCCESS) {
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR(" mach_port_get_refs(MACH_PORT_RIGHT_PORT_SET): %s"), mach_error_string(status));
- return;
+ if ((pt & MACH_PORT_TYPE_RECEIVE) != 0) {
+ mach_msg_type_number_t count;
+
+ status = mach_port_get_refs(mach_task_self(), port, MACH_PORT_RIGHT_RECEIVE, &refs_recv);
+ if (status != KERN_SUCCESS) {
+ SCLog(TRUE, LOG_DEBUG,
+ CFSTR("%smach_port_get_refs(..., %d, MACH_PORT_RIGHT_RECEIVE): %s"),
+ buf,
+ port,
+ mach_error_string(status));
+ }
+
+ count = MACH_PORT_RECEIVE_STATUS_COUNT;
+ status = mach_port_get_attributes(mach_task_self(),
+ port,
+ MACH_PORT_RECEIVE_STATUS,
+ (mach_port_info_t)&recv_status,
+ &count);
+ if (status != KERN_SUCCESS) {
+ SCLog(TRUE, LOG_DEBUG,
+ CFSTR("%mach_port_get_attributes(..., %d, MACH_PORT_RECEIVE_STATUS): %s"),
+ buf,
+ port,
+ mach_error_string(status));
+ }
}
- status = mach_port_get_refs(mach_task_self(), port, MACH_PORT_RIGHT_DEAD_NAME, &refs_dead);
- if (status != KERN_SUCCESS) {
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR(" mach_port_get_refs(MACH_PORT_RIGHT_DEAD_NAME): %s"), mach_error_string(status));
- return;
+ if ((pt & MACH_PORT_TYPE_SEND_ONCE) != 0) {
+ status = mach_port_get_refs(mach_task_self(), port, MACH_PORT_RIGHT_SEND_ONCE, &refs_once);
+ if (status != KERN_SUCCESS) {
+ SCLog(TRUE, LOG_DEBUG,
+ CFSTR("%smach_port_get_refs(..., %d, MACH_PORT_RIGHT_SEND_ONCE): %s"),
+ buf,
+ port,
+ mach_error_string(status));
+ }
}
- SCLog(_sc_verbose, LOG_DEBUG,
- CFSTR(" send = %d, receive = %d, send once = %d, port set = %d, dead name = %d"),
- refs_send,
- refs_recv,
- refs_once,
- refs_pset,
- refs_dead);
+ if ((pt & MACH_PORT_TYPE_PORT_SET) != 0) {
+ status = mach_port_get_refs(mach_task_self(), port, MACH_PORT_RIGHT_PORT_SET, &refs_pset);
+ if (status != KERN_SUCCESS) {
+ SCLog(TRUE, LOG_DEBUG,
+ CFSTR("%smach_port_get_refs(..., %d, MACH_PORT_RIGHT_PORT_SET): %s"),
+ buf,
+ port,
+ mach_error_string(status));
+ }
+ }
+
+ if ((pt & MACH_PORT_TYPE_DEAD_NAME) != 0) {
+ status = mach_port_get_refs(mach_task_self(), port, MACH_PORT_RIGHT_DEAD_NAME, &refs_dead);
+ if (status != KERN_SUCCESS) {
+ SCLog(TRUE, LOG_DEBUG,
+ CFSTR("%smach_port_get_refs(..., %d, MACH_PORT_RIGHT_DEAD_NAME): %s"),
+ buf,
+ port,
+ mach_error_string(status));
+ }
+ }
+
+ SCLog(TRUE, LOG_DEBUG,
+ CFSTR("%smach port 0x%x (%d): send=%d, receive=%d, send once=%d, port set=%d, dead name=%d%s%s"),
+ buf,
+ port,
+ port,
+ refs_send,
+ refs_recv,
+ refs_once,
+ refs_pset,
+ refs_dead,
+ recv_status.mps_nsrequest ? ", no more senders" : "",
+ ((pt & MACH_PORT_TYPE_DEAD_NAME) != 0) ? ", dead name request" : "");
-#endif /* DEBUG */
return;
}
+
+
+CFStringRef
+_SC_copyBacktrace()
+{
+ int n;
+ void *stack[64];
+ char **symbols;
+ CFMutableStringRef trace;
+
+ n = backtrace(stack, sizeof(stack)/sizeof(stack[0]));
+ if (n == -1) {
+ SCLog(TRUE, LOG_ERR, CFSTR("backtrace() failed: %s"), strerror(errno));
+ return NULL;
+ }
+
+ trace = CFStringCreateMutable(NULL, 0);
+
+ symbols = backtrace_symbols(stack, n);
+ if (symbols != NULL) {
+ int i;
+
+ for (i = 0; i < n; i++) {
+ CFStringAppendFormat(trace, NULL, CFSTR("%s\n"), symbols[i]);
+ }
+
+ free(symbols);
+ }
+
+ return trace;
+}
/*
- * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2005, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
CFRelease(utfKey);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreRemoveValue configremove(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreRemoveValue configremove(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return FALSE;
/*
- * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2006, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
if (xmlNotify != NULL) CFRelease(xmlNotify);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreSetMultiple configset_m(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreSetMultiple configset_m(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return FALSE;
CFRelease(xmlData);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreSetValue configset(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreSetValue configset(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return FALSE;
/*
- * Copyright (c) 2000, 2001, 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2004, 2005, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
status = snapshot(storePrivate->server, (int *)&sc_status);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreSnapshot snapshot(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreSnapshot snapshot(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return FALSE;
/*
- * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2005, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
CFRelease(utfKey);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreTouchValue configtouch(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreTouchValue configtouch(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return FALSE;
/*
- * Copyright (c) 2000, 2001, 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2004, 2005, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
/* (attempt to) release the servers lock */
status = configunlock(storePrivate->server, (int *)&sc_status);
if (status != KERN_SUCCESS) {
-#ifdef DEBUG
- if (status != MACH_SEND_INVALID_DEST)
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("SCDynamicStoreUnlock configunlock(): %s"), mach_error_string(status));
-#endif /* DEBUG */
- (void) mach_port_destroy(mach_task_self(), storePrivate->server);
+ if (status == MACH_SEND_INVALID_DEST) {
+ /* the server's gone and our session port's dead, remove the dead name right */
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->server);
+ } else {
+ /* we got an unexpected error, leave the [session] port alone */
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreUnlock configunlock(): %s"), mach_error_string(status));
+ }
storePrivate->server = MACH_PORT_NULL;
_SCErrorSet(status);
return FALSE;
/*
- * Copyright (c) 2000, 2001, 2003-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003-2005, 2008, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*/
#ifndef _SCDYNAMICSTORE_H
+#ifdef USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS
+#include <SystemConfiguration/_SCDynamicStore.h>
+#else /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
#define _SCDYNAMICSTORE_H
-#include <AvailabilityMacros.h>
+#include <Availability.h>
+#include <TargetConditionals.h>
#include <sys/cdefs.h>
+#if !TARGET_OS_IPHONE
+#include <dispatch/dispatch.h>
+#endif // !TARGET_OS_IPHONE
#include <CoreFoundation/CoreFoundation.h>
+
/*!
@header SCDynamicStore
@discussion The SCDynamicStore API provides access to the key-value
@discussion Returns the type identifier of all SCDynamicStore instances.
*/
CFTypeID
-SCDynamicStoreGetTypeID (void);
+SCDynamicStoreGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
CFStringRef name,
SCDynamicStoreCallBack callout,
SCDynamicStoreContext *context
- );
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreCreateWithOptions
CFDictionaryRef storeOptions,
SCDynamicStoreCallBack callout,
SCDynamicStoreContext *context
- ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
-extern const CFStringRef kSCDynamicStoreUseSessionKeys AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; /* CFBoolean */
-
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 */
+extern const CFStringRef kSCDynamicStoreUseSessionKeys __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/); /* CFBoolean */
/*!
@function SCDynamicStoreCreateRunLoopSource
CFAllocatorRef allocator,
SCDynamicStoreRef store,
CFIndex order
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
+
+#if !TARGET_OS_IPHONE
+/*!
+ @function SCDynamicStoreSetDispatchQueue
+ @discussion Initiates notifications for the Notification
+ Keys in store to the callback contained in store.
+ @param store A reference to the dynamic store session.
+ @param queue The dispatch queue to run the callback function on.
+ Pass NULL to disable notifications, and release the queue.
+ @result Returns TRUE on success, FALSE on failure.
+
+ */
+Boolean
+SCDynamicStoreSetDispatchQueue (
+ SCDynamicStoreRef store,
+ dispatch_queue_t queue
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA);
+#endif // !TARGET_OS_IPHONE
/*!
@function SCDynamicStoreCopyKeyList
SCDynamicStoreCopyKeyList (
SCDynamicStoreRef store,
CFStringRef pattern
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreAddValue
SCDynamicStoreRef store,
CFStringRef key,
CFPropertyListRef value
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreAddTemporaryValue
SCDynamicStoreRef store,
CFStringRef key,
CFPropertyListRef value
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreCopyValue
SCDynamicStoreCopyValue (
SCDynamicStoreRef store,
CFStringRef key
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreCopyMultiple
SCDynamicStoreRef store,
CFArrayRef keys,
CFArrayRef patterns
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreSetValue
SCDynamicStoreRef store,
CFStringRef key,
CFPropertyListRef value
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreSetMultiple
CFDictionaryRef keysToSet,
CFArrayRef keysToRemove,
CFArrayRef keysToNotify
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreRemoveValue
SCDynamicStoreRemoveValue (
SCDynamicStoreRef store,
CFStringRef key
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreNotifyValue
SCDynamicStoreNotifyValue (
SCDynamicStoreRef store,
CFStringRef key
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreSetNotificationKeys
SCDynamicStoreRef store,
CFArrayRef keys,
CFArrayRef patterns
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreCopyNotifiedKeys
CFArrayRef
SCDynamicStoreCopyNotifiedKeys (
SCDynamicStoreRef store
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
__END_DECLS
-#endif /* _SCDYNAMICSTORE_H */
+#endif /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
+#endif /* _SCDYNAMICSTORE_H */
/*
- * Copyright (c) 2001, 2002, 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2001, 2002, 2004, 2005, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*/
#ifndef _SCDYNAMICSTORECOPYDHCPINFO_H
+#ifdef USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS
+#include <SystemConfiguration/_SCDynamicStoreCopyDHCPInfo.h>
+#else /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
#define _SCDYNAMICSTORECOPYDHCPINFO_H
+#include <Availability.h>
#include <sys/cdefs.h>
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SCDynamicStore.h>
A non-NULL return value must be released using CFRelease().
*/
CFDictionaryRef
-SCDynamicStoreCopyDHCPInfo(SCDynamicStoreRef store, CFStringRef serviceID);
+SCDynamicStoreCopyDHCPInfo (SCDynamicStoreRef store,
+ CFStringRef serviceID) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function DHCPInfoGetOptionData
The return value must NOT be released.
*/
CFDataRef
-DHCPInfoGetOptionData(CFDictionaryRef info, UInt8 code);
+DHCPInfoGetOptionData (CFDictionaryRef info,
+ UInt8 code) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function DHCPInfoGetLeaseStartTime
The return value must NOT be released.
*/
CFDateRef
-DHCPInfoGetLeaseStartTime(CFDictionaryRef info);
+DHCPInfoGetLeaseStartTime (CFDictionaryRef info) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
__END_DECLS
-#endif /* _SCDYNAMICSTORECOPYDHCPINFO_H */
+#endif /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
+#endif /* _SCDYNAMICSTORECOPYDHCPINFO_H */
/*
- * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2005, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*/
#ifndef _SCDYNAMICSTORECOPYSPECIFIC_H
+#ifdef USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS
+#include <SystemConfiguration/_SCDynamicStoreCopySpecific.h>
+#else /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
#define _SCDYNAMICSTORECOPYSPECIFIC_H
+#include <Availability.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <CoreFoundation/CoreFoundation.h>
SCDynamicStoreCopyComputerName (
SCDynamicStoreRef store,
CFStringEncoding *nameEncoding
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreCopyConsoleUser
SCDynamicStoreRef store,
uid_t *uid,
gid_t *gid
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_NA);
/*!
@function SCDynamicStoreCopyLocalHostName
CFStringRef
SCDynamicStoreCopyLocalHostName (
SCDynamicStoreRef store
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreCopyLocation
CFStringRef
SCDynamicStoreCopyLocation (
SCDynamicStoreRef store
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_NA);
/*!
@function SCDynamicStoreCopyProxies
CFDictionaryRef
SCDynamicStoreCopyProxies (
SCDynamicStoreRef store
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
__END_DECLS
-#endif /* _SCDYNAMICSTORECOPYSPECIFIC_H */
+#endif /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
+#endif /* _SCDYNAMICSTORECOPYSPECIFIC_H */
/*
- * Copyright (c) 2003-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2003-2005, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#ifndef _SCDYNAMICSTORECOPYSPECIFICPRIVATE_H
#define _SCDYNAMICSTORECOPYSPECIFICPRIVATE_H
+#include <Availability.h>
#include <sys/cdefs.h>
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SCDynamicStore.h>
/*
* Predefined keys for the console session dictionaries
*/
-extern const CFStringRef kSCConsoleSessionID; /* value is CFNumber */
-extern const CFStringRef kSCConsoleSessionUserName; /* value is CFString */
-extern const CFStringRef kSCConsoleSessionUID; /* value is CFNumber (a uid_t) */
-extern const CFStringRef kSCConsoleSessionConsoleSet; /* value is CFNumber */
-extern const CFStringRef kSCConsoleSessionOnConsole; /* value is CFBoolean */
-extern const CFStringRef kSCConsoleSessionLoginDone; /* value is CFBoolean */
-extern const CFStringRef kSCConsoleSessionSystemSafeBoot; /* value is CFBoolean */
-extern const CFStringRef kSCConsoleSessionLoginwindowSafeLogin; /* value is CFBoolean */
+extern const CFStringRef kSCConsoleSessionID /* value is CFNumber */
+ __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_NA);
+extern const CFStringRef kSCConsoleSessionUserName /* value is CFString */
+ __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_NA);
+extern const CFStringRef kSCConsoleSessionUID /* value is CFNumber (a uid_t) */
+ __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_NA);
+extern const CFStringRef kSCConsoleSessionConsoleSet /* value is CFNumber */
+ __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_NA);
+extern const CFStringRef kSCConsoleSessionOnConsole /* value is CFBoolean */
+ __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_NA);
+extern const CFStringRef kSCConsoleSessionLoginDone /* value is CFBoolean */
+ __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_NA);
+extern const CFStringRef kSCConsoleSessionSystemSafeBoot /* value is CFBoolean */
+ __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_NA);
+extern const CFStringRef kSCConsoleSessionLoginwindowSafeLogin /* value is CFBoolean */
+ __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_NA);
/*!
@function SCDynamicStoreCopyConsoleInformation
CFArrayRef
SCDynamicStoreCopyConsoleInformation (
SCDynamicStoreRef store
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_NA);
__END_DECLS
/*
- * Copyright (c) 2000-2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2004, 2006, 2009 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#ifndef _SCDYNAMICSTOREINTERNAL_H
#define _SCDYNAMICSTOREINTERNAL_H
+#include <Availability.h>
+#include <TargetConditionals.h>
#include <sys/cdefs.h>
+#if !TARGET_OS_IPHONE
+#include <dispatch/dispatch.h>
+#endif // !TARGET_OS_IPHONE
#include <sys/types.h>
#include <mach/mach.h>
#include <pthread.h>
Using_NotifierInformViaMachPort,
Using_NotifierInformViaFD,
Using_NotifierInformViaSignal,
- Using_NotifierInformViaRunLoop
+ Using_NotifierInformViaRunLoop,
+ Using_NotifierInformViaDispatch
} __SCDynamicStoreNotificationStatus;
CFMachPortRef callbackPort;
CFRunLoopSourceRef callbackRLS;
+#if !TARGET_OS_IPHONE
+ /* "client" information associated with SCDynamicStoreSetDispatchQueue() */
+ dispatch_queue_t dispatchQueue;
+ dispatch_source_t callbackSource;
+ dispatch_queue_t callbackQueue;
+#endif // !TARGET_OS_IPHONE
+
/* "server" SCDynamicStoreKeys being watched */
CFMutableSetRef keys;
CFMutableSetRef patterns;
SCDynamicStoreCallBack callout,
SCDynamicStoreContext *context);
-void
-__showMachPortStatus (void);
-
-void
-__showMachPortReferences (mach_port_t port);
-
__END_DECLS
#endif /* _SCDYNAMICSTOREINTERNAL_H */
/*
- * Copyright (c) 2000-2002, 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2002, 2004, 2005, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*/
#ifndef _SCDYNAMICSTOREKEY_H
+#ifdef USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS
+#include <SystemConfiguration/_SCDynamicStoreKey.h>
+#else /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
#define _SCDYNAMICSTOREKEY_H
+#include <Availability.h>
#include <sys/cdefs.h>
#include <CoreFoundation/CoreFoundation.h>
CFAllocatorRef allocator,
CFStringRef fmt,
...
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreKeyCreateNetworkGlobalEntity
CFAllocatorRef allocator,
CFStringRef domain,
CFStringRef entity
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreKeyCreateNetworkInterface
SCDynamicStoreKeyCreateNetworkInterface (
CFAllocatorRef allocator,
CFStringRef domain
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreKeyCreateNetworkInterfaceEntity
CFStringRef domain,
CFStringRef ifname,
CFStringRef entity
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreKeyCreateNetworkServiceEntity
CFStringRef domain,
CFStringRef serviceID,
CFStringRef entity
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreKeyCreateComputerName
CFStringRef
SCDynamicStoreKeyCreateComputerName (
CFAllocatorRef allocator
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreKeyCreateConsoleUser
CFStringRef
SCDynamicStoreKeyCreateConsoleUser (
CFAllocatorRef allocator
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_NA);
/*!
@function SCDynamicStoreKeyCreateHostNames
CFStringRef
SCDynamicStoreKeyCreateHostNames (
CFAllocatorRef allocator
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreKeyCreateLocation
CFStringRef
SCDynamicStoreKeyCreateLocation (
CFAllocatorRef allocator
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/);
/*!
@function SCDynamicStoreKeyCreateProxies
CFStringRef
SCDynamicStoreKeyCreateProxies (
CFAllocatorRef allocator
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
__END_DECLS
-#endif /* _SCDYNAMICSTOREKEY_H */
+#endif /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
+#endif /* _SCDYNAMICSTOREKEY_H */
/*
- * Copyright (c) 2001, 2003-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2001, 2003-2005, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#ifndef _SCDYNAMICSTORESETSPECIFICPRIVATE_H
#define _SCDYNAMICSTORESETSPECIFICPRIVATE_H
+#include <Availability.h>
#include <sys/cdefs.h>
#include <SystemConfiguration/SCDynamicStore.h>
uid_t uid,
gid_t gid,
CFArrayRef sessions
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_NA);
/*!
@function SCDynamicStoreSetConsoleUser
const char *user,
uid_t uid,
gid_t gid
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_NA);
__END_DECLS
/*
- * Copyright (c) 2000, 2001, 2003-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#ifndef _SCNETWORK_H
#define _SCNETWORK_H
+#include <Availability.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/socket.h>
nodename or address is reachable, whether a connection is
required, and whether some user intervention may be required
when establishing a connection.
+
+ Note: the SCNetworkConnection flags have been deprecated
+ in favor of the newer SCNetworkReachability flags defined
+ in SCNetworkReachability.h.
@constant kSCNetworkFlagsTransientConnection
This flag indicates that the specified nodename or address can
be reached via a transient connection, such as PPP.
kSCNetworkFlagsConnectionAutomatic = 1<<3,
kSCNetworkFlagsInterventionRequired = 1<<4,
kSCNetworkFlagsIsLocalAddress = 1<<16,
- kSCNetworkFlagsIsDirect = 1<<17
+ kSCNetworkFlagsIsDirect = 1<<17,
};
typedef uint32_t SCNetworkConnectionFlags;
@function SCNetworkCheckReachabilityByAddress
@discussion Determines if the given network address is
reachable using the current network configuration.
+
+ Note: this API has been deprecated but you can
+ get equivalent results with :
+<pre>
+ SCNetworkReachabiltyRef target;
+ SCNetworkReachabiltyFlags flags = 0;
+ Boolean ok;
+
+ target = SCNetworkReachabilityCreateWithAddress(NULL, address);
+ ok = SCNetworkReachabilityGetFlags(target, &flags);
+ CFRelease(target);
+</pre>
@param address The network address of the desired host.
@param addrlen The length, in bytes, of the address.
@param flags A pointer to memory that will be filled with a
const struct sockaddr *address,
socklen_t addrlen,
SCNetworkConnectionFlags *flags
- );
+ ) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_6,__IPHONE_NA,__IPHONE_NA);
/*!
@function SCNetworkCheckReachabilityByName
@discussion Determines if the given network host or node name is
reachable using the current network configuration.
+
+ Note: this API has been deprecated but you can
+ get equivalent results with :
+<pre>
+ SCNetworkReachabiltyRef target;
+ SCNetworkReachabiltyFlags flags = 0;
+ Boolean ok;
+
+ target = SCNetworkReachabilityCreateWithName(NULL, name);
+ ok = SCNetworkReachabilityGetFlags(target, &flags);
+ CFRelease(target);
+</pre>
@param nodename The node name of the desired host. This name would
be the same as that passed to the gethostbyname(3) or
getaddrinfo(3) functions.
SCNetworkCheckReachabilityByName (
const char *nodename,
SCNetworkConnectionFlags *flags
- );
+ ) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_6,__IPHONE_NA,__IPHONE_NA);
/*!
@function SCNetworkInterfaceRefreshConfiguration
*/
Boolean
SCNetworkInterfaceRefreshConfiguration (
- CFStringRef ifName
- ) DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER;
+ CFStringRef ifName
+ ) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
__END_DECLS
/*
- * Copyright (c) 2004-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2004-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*/
#ifndef _SCNETWORKCONFIGURATION_H
+#ifdef USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS
+#include <SystemConfiguration/_SCNetworkConfiguration.h>
+#else /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
#define _SCNETWORKCONFIGURATION_H
-#include <AvailabilityMacros.h>
+#include <Availability.h>
+#include <TargetConditionals.h>
#include <sys/cdefs.h>
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SystemConfiguration.h>
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
-
/*!
@header SCNetworkConfiguration
@discussion The SCNetworkConfiguration API provides access to the
/*!
@const kSCNetworkInterfaceType6to4
*/
-extern const CFStringRef kSCNetworkInterfaceType6to4 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern const CFStringRef kSCNetworkInterfaceType6to4 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@const kSCNetworkInterfaceTypeBluetooth
*/
-extern const CFStringRef kSCNetworkInterfaceTypeBluetooth AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern const CFStringRef kSCNetworkInterfaceTypeBluetooth __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@const kSCNetworkInterfaceTypeBond
*/
-extern const CFStringRef kSCNetworkInterfaceTypeBond AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern const CFStringRef kSCNetworkInterfaceTypeBond __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_NA);
/*!
@const kSCNetworkInterfaceTypeEthernet
*/
-extern const CFStringRef kSCNetworkInterfaceTypeEthernet AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern const CFStringRef kSCNetworkInterfaceTypeEthernet __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@const kSCNetworkInterfaceTypeFireWire
*/
-extern const CFStringRef kSCNetworkInterfaceTypeFireWire AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern const CFStringRef kSCNetworkInterfaceTypeFireWire __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@const kSCNetworkInterfaceTypeIEEE80211
*/
-extern const CFStringRef kSCNetworkInterfaceTypeIEEE80211 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // IEEE 802.11, AirPort
+extern const CFStringRef kSCNetworkInterfaceTypeIEEE80211 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/); // IEEE 802.11, AirPort
+
+/*!
+ @const kSCNetworkInterfaceTypeIPSec
+ */
+extern const CFStringRef kSCNetworkInterfaceTypeIPSec __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
/*!
@const kSCNetworkInterfaceTypeIrDA
*/
-extern const CFStringRef kSCNetworkInterfaceTypeIrDA AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern const CFStringRef kSCNetworkInterfaceTypeIrDA __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@const kSCNetworkInterfaceTypeL2TP
*/
-extern const CFStringRef kSCNetworkInterfaceTypeL2TP AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern const CFStringRef kSCNetworkInterfaceTypeL2TP __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@const kSCNetworkInterfaceTypeModem
*/
-extern const CFStringRef kSCNetworkInterfaceTypeModem AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern const CFStringRef kSCNetworkInterfaceTypeModem __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@const kSCNetworkInterfaceTypePPP
*/
-extern const CFStringRef kSCNetworkInterfaceTypePPP AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern const CFStringRef kSCNetworkInterfaceTypePPP __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@const kSCNetworkInterfaceTypePPTP
*/
-extern const CFStringRef kSCNetworkInterfaceTypePPTP AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern const CFStringRef kSCNetworkInterfaceTypePPTP __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@const kSCNetworkInterfaceTypeSerial
*/
-extern const CFStringRef kSCNetworkInterfaceTypeSerial AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern const CFStringRef kSCNetworkInterfaceTypeSerial __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@const kSCNetworkInterfaceTypeVLAN
*/
-extern const CFStringRef kSCNetworkInterfaceTypeVLAN AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern const CFStringRef kSCNetworkInterfaceTypeVLAN __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_NA);
/*!
@const kSCNetworkInterfaceTypeWWAN
*/
-extern const CFStringRef kSCNetworkInterfaceTypeWWAN AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+extern const CFStringRef kSCNetworkInterfaceTypeWWAN __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
/* special network interfaces (and types) */
/*!
@const kSCNetworkInterfaceTypeIPv4
*/
-extern const CFStringRef kSCNetworkInterfaceTypeIPv4 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern const CFStringRef kSCNetworkInterfaceTypeIPv4 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@const kSCNetworkInterfaceIPv4
@discussion A network interface that can used for layering other
- interfaces (e.g. 6to4, PPTP, L2TP) over an existing
+ interfaces (e.g. 6to4, IPSec, PPTP, L2TP) over an existing
IPv4 network.
*/
-extern const SCNetworkInterfaceRef kSCNetworkInterfaceIPv4 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
+extern const SCNetworkInterfaceRef kSCNetworkInterfaceIPv4 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@group Interface configuration (Bond)
*/
typedef const struct __SCBondStatus * SCBondStatusRef;
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 */
-
+#if !TARGET_OS_IPHONE
/*!
@enum Ethernet Bond Aggregation Status (kSCBondStatusDeviceAggregationStatus) codes
@discussion Returned status codes.
kSCBondStatusNotInActiveGroup = 3, /* We're talking to a partner, but the link aggregation group is different from the one that's active */
kSCBondStatusUnknown = 999 /* Non-specific failure */
};
+#endif // !TARGET_OS_IPHONE
/*!
@const kSCBondStatusDeviceAggregationStatus
*/
-extern const CFStringRef kSCBondStatusDeviceAggregationStatus /* CFNumber */ AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern const CFStringRef kSCBondStatusDeviceAggregationStatus /* CFNumber */ __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_NA);
/*!
@const kSCBondStatusDeviceCollecting
*/
-extern const CFStringRef kSCBondStatusDeviceCollecting /* CFNumber (0 or 1) */ AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern const CFStringRef kSCBondStatusDeviceCollecting /* CFNumber (0 or 1) */ __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_NA);
/*!
@const kSCBondStatusDeviceDistributing
*/
-extern const CFStringRef kSCBondStatusDeviceDistributing /* CFNumber (0 or 1) */ AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
+extern const CFStringRef kSCBondStatusDeviceDistributing /* CFNumber (0 or 1) */ __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_NA);
/*!
@group Interface configuration (VLAN)
*/
typedef SCNetworkInterfaceRef SCVLANInterfaceRef;
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 */
-
/*!
@group Protocol configuration
/*!
@const kSCNetworkProtocolTypeAppleTalk
*/
-extern const CFStringRef kSCNetworkProtocolTypeAppleTalk AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern const CFStringRef kSCNetworkProtocolTypeAppleTalk __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4,__MAC_10_6,__IPHONE_NA,__IPHONE_NA);
/*!
@const kSCNetworkProtocolTypeDNS
*/
-extern const CFStringRef kSCNetworkProtocolTypeDNS AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern const CFStringRef kSCNetworkProtocolTypeDNS __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@const kSCNetworkProtocolTypeIPv4
*/
-extern const CFStringRef kSCNetworkProtocolTypeIPv4 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern const CFStringRef kSCNetworkProtocolTypeIPv4 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@const kSCNetworkProtocolTypeIPv6
*/
-extern const CFStringRef kSCNetworkProtocolTypeIPv6 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+extern const CFStringRef kSCNetworkProtocolTypeIPv6 __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@const kSCNetworkProtocolTypeProxies
*/
-extern const CFStringRef kSCNetworkProtocolTypeProxies AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
+extern const CFStringRef kSCNetworkProtocolTypeProxies __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@const kSCNetworkProtocolTypeSMB
*/
-extern const CFStringRef kSCNetworkProtocolTypeSMB AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
-
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 */
-
+extern const CFStringRef kSCNetworkProtocolTypeSMB __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@group Service configuration
@discussion Returns the type identifier of all SCNetworkInterface instances.
*/
CFTypeID
-SCNetworkInterfaceGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkInterfaceGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkInterfaceCopyAll
You must release the returned value.
*/
CFArrayRef /* of SCNetworkInterfaceRef's */
-SCNetworkInterfaceCopyAll (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkInterfaceCopyAll (void) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkInterfaceGetSupportedInterfaceTypes
NULL if no interface types are supported.
*/
CFArrayRef /* of kSCNetworkInterfaceTypeXXX CFStringRef's */
-SCNetworkInterfaceGetSupportedInterfaceTypes (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkInterfaceGetSupportedInterfaceTypes (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkInterfaceGetSupportedProtocolTypes
NULL if no protocol types are supported.
*/
CFArrayRef /* of kSCNetworkProtocolTypeXXX CFStringRef's */
-SCNetworkInterfaceGetSupportedProtocolTypes (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkInterfaceGetSupportedProtocolTypes (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkInterfaceCreateWithInterface
*/
SCNetworkInterfaceRef
SCNetworkInterfaceCreateWithInterface (SCNetworkInterfaceRef interface,
- CFStringRef interfaceType) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ CFStringRef interfaceType) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkInterfaceGetBSDName
NULL if no BSD name is available.
*/
CFStringRef
-SCNetworkInterfaceGetBSDName (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkInterfaceGetBSDName (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkInterfaceGetConfiguration
or an error was encountered.
*/
CFDictionaryRef
-SCNetworkInterfaceGetConfiguration (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
+SCNetworkInterfaceGetConfiguration (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkInterfaceGetExtendedConfiguration
*/
CFDictionaryRef
SCNetworkInterfaceGetExtendedConfiguration (SCNetworkInterfaceRef interface,
- CFStringRef extendedType) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
-
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 */
+ CFStringRef extendedType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkInterfaceGetHardwareAddressString
@result A string representing the hardware (MAC) address for the interface.
*/
CFStringRef
-SCNetworkInterfaceGetHardwareAddressString (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkInterfaceGetHardwareAddressString (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkInterfaceGetInterface
NULL if this is a leaf interface.
*/
SCNetworkInterfaceRef
-SCNetworkInterfaceGetInterface (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkInterfaceGetInterface (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkInterfaceGetInterfaceType
@result The interface type.
*/
CFStringRef
-SCNetworkInterfaceGetInterfaceType (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkInterfaceGetInterfaceType (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkInterfaceGetLocalizedDisplayName
NULL if no name is available.
*/
CFStringRef
-SCNetworkInterfaceGetLocalizedDisplayName (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkInterfaceGetLocalizedDisplayName (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkInterfaceSetConfiguration
*/
Boolean
SCNetworkInterfaceSetConfiguration (SCNetworkInterfaceRef interface,
- CFDictionaryRef config) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
+ CFDictionaryRef config) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkInterfaceSetExtendedConfiguration
Boolean
SCNetworkInterfaceSetExtendedConfiguration (SCNetworkInterfaceRef interface,
CFStringRef extendedType,
- CFDictionaryRef config) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
-
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 */
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
+ CFDictionaryRef config) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
#pragma mark -
CFDictionaryRef *current,
CFDictionaryRef *active,
CFArrayRef *available,
- Boolean filter) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ Boolean filter) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkInterfaceCopyMediaSubTypes
100baseTX, etc). NULL if no subtypes are available.
*/
CFArrayRef
-SCNetworkInterfaceCopyMediaSubTypes (CFArrayRef available) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCNetworkInterfaceCopyMediaSubTypes (CFArrayRef available) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkInterfaceCopyMediaSubTypeOptions
*/
CFArrayRef
SCNetworkInterfaceCopyMediaSubTypeOptions (CFArrayRef available,
- CFStringRef subType) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ CFStringRef subType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkInterfaceCopyMTU
SCNetworkInterfaceCopyMTU (SCNetworkInterfaceRef interface,
int *mtu_cur,
int *mtu_min,
- int *mtu_max) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ int *mtu_max) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkInterfaceSetMediaOptions
Boolean
SCNetworkInterfaceSetMediaOptions (SCNetworkInterfaceRef interface,
CFStringRef subtype,
- CFArrayRef options) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ CFArrayRef options) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkInterfaceSetMTU
*/
Boolean
SCNetworkInterfaceSetMTU (SCNetworkInterfaceRef interface,
- int mtu) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ int mtu) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkInterfaceForceConfigurationRefresh
allow the caller to give a hint to the system that the
network infrastructure or configuration has changed.
-
Note: This function requires root (euid==0) privilege or,
alternatively, you may pass an SCNetworkInterface which
is derived from a sequence of calls to :
@result Returns TRUE if the notification was sent; FALSE otherwise.
*/
Boolean
-SCNetworkInterfaceForceConfigurationRefresh (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
-
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 */
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
+SCNetworkInterfaceForceConfigurationRefresh (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
/*!
@group Interface configuration (Bond)
You must release the returned value.
*/
CFArrayRef /* of SCBondInterfaceRef's */
-SCBondInterfaceCopyAll (SCPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCBondInterfaceCopyAll (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCBondInterfaceCopyAvailableMemberInterfaces
You must release the returned value.
*/
CFArrayRef /* of SCNetworkInterfaceRef's */
-SCBondInterfaceCopyAvailableMemberInterfaces (SCPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCBondInterfaceCopyAvailableMemberInterfaces (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCBondInterfaceCreate
You must release the returned value.
*/
SCBondInterfaceRef
-SCBondInterfaceCreate (SCPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCBondInterfaceCreate (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCBondInterfaceRemove
@result TRUE if the interface was removed; FALSE if an error was encountered.
*/
Boolean
-SCBondInterfaceRemove (SCBondInterfaceRef bond) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCBondInterfaceRemove (SCBondInterfaceRef bond) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCBondInterfaceGetMemberInterfaces
@result The list of interfaces.
*/
CFArrayRef /* of SCNetworkInterfaceRef's */
-SCBondInterfaceGetMemberInterfaces (SCBondInterfaceRef bond) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCBondInterfaceGetMemberInterfaces (SCBondInterfaceRef bond) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCBondInterfaceGetOptions
NULL if no changes to the default configuration have been saved.
*/
CFDictionaryRef
-SCBondInterfaceGetOptions (SCBondInterfaceRef bond) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCBondInterfaceGetOptions (SCBondInterfaceRef bond) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCBondInterfaceSetMemberInterfaces
Boolean
SCBondInterfaceSetMemberInterfaces (SCBondInterfaceRef bond,
CFArrayRef members) /* of SCNetworkInterfaceRef's */
- AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCBondInterfaceSetLocalizedDisplayName
*/
Boolean
SCBondInterfaceSetLocalizedDisplayName (SCBondInterfaceRef bond,
- CFStringRef newName) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ CFStringRef newName) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCBondInterfaceSetOptions
*/
Boolean
SCBondInterfaceSetOptions (SCBondInterfaceRef bond,
- CFDictionaryRef newOptions) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ CFDictionaryRef newOptions) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
#pragma mark -
You must release the returned value.
*/
SCBondStatusRef
-SCBondInterfaceCopyStatus (SCBondInterfaceRef bond) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCBondInterfaceCopyStatus (SCBondInterfaceRef bond) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCBondStatusGetTypeID
@discussion Returns the type identifier of all SCBondStatus instances.
*/
CFTypeID
-SCBondStatusGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCBondStatusGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCBondStatusGetMemberInterfaces
@result The list of interfaces.
*/
CFArrayRef /* of SCNetworkInterfaceRef's */
-SCBondStatusGetMemberInterfaces (SCBondStatusRef bondStatus) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCBondStatusGetMemberInterfaces (SCBondStatusRef bondStatus) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCBondStatusGetInterfaceStatus
@param interface The specific member interface; NULL if you want the
status of the Ethernet Bond.
@result The interface status.
+
+ Note: at present, no information about the status of the Ethernet
+ Bond is returned. As long as one member interface is active
+ then the bond should be operational.
*/
CFDictionaryRef
SCBondStatusGetInterfaceStatus (SCBondStatusRef bondStatus,
- SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@group Interface configuration (VLAN)
You must release the returned value.
*/
CFArrayRef /* of SCVLANInterfaceRef's */
-SCVLANInterfaceCopyAll (SCPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCVLANInterfaceCopyAll (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCVLANInterfaceCopyAvailablePhysicalInterfaces
You must release the returned value.
*/
CFArrayRef /* of SCNetworkInterfaceRef's */
-SCVLANInterfaceCopyAvailablePhysicalInterfaces (void) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCVLANInterfaceCopyAvailablePhysicalInterfaces (void) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCVLANInterfaceCreate
SCVLANInterfaceRef
SCVLANInterfaceCreate (SCPreferencesRef prefs,
SCNetworkInterfaceRef physical,
- CFNumberRef tag) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ CFNumberRef tag) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCVLANInterfaceRemove
@result TRUE if the interface was removed; FALSE if an error was encountered.
*/
Boolean
-SCVLANInterfaceRemove (SCVLANInterfaceRef vlan) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCVLANInterfaceRemove (SCVLANInterfaceRef vlan) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCVLANInterfaceGetPhysicalInterface
@result The list of interfaces.
*/
SCNetworkInterfaceRef
-SCVLANInterfaceGetPhysicalInterface (SCVLANInterfaceRef vlan) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCVLANInterfaceGetPhysicalInterface (SCVLANInterfaceRef vlan) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCVLANInterfaceGetTag
@result The tag.
*/
CFNumberRef
-SCVLANInterfaceGetTag (SCVLANInterfaceRef vlan) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCVLANInterfaceGetTag (SCVLANInterfaceRef vlan) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCVLANInterfaceGetOptions
NULL if no changes to the default configuration have been saved.
*/
CFDictionaryRef
-SCVLANInterfaceGetOptions (SCVLANInterfaceRef vlan) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCVLANInterfaceGetOptions (SCVLANInterfaceRef vlan) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCVLANInterfaceSetPhysicalInterfaceAndTag
Boolean
SCVLANInterfaceSetPhysicalInterfaceAndTag (SCVLANInterfaceRef vlan,
SCNetworkInterfaceRef physical,
- CFNumberRef tag) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ CFNumberRef tag) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCVLANInterfaceSetLocalizedDisplayName
*/
Boolean
SCVLANInterfaceSetLocalizedDisplayName (SCVLANInterfaceRef vlan,
- CFStringRef newName) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ CFStringRef newName) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCVLANInterfaceSetOptions
*/
Boolean
SCVLANInterfaceSetOptions (SCVLANInterfaceRef vlan,
- CFDictionaryRef newOptions) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ CFDictionaryRef newOptions) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 */
/* --------------------------------------------------------------------------------
* PROTOCOLS
@discussion Returns the type identifier of all SCNetworkProtocol instances.
*/
CFTypeID
-SCNetworkProtocolGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkProtocolGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkProtocolGetConfiguration
or an error was encountered.
*/
CFDictionaryRef
-SCNetworkProtocolGetConfiguration (SCNetworkProtocolRef protocol) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkProtocolGetConfiguration (SCNetworkProtocolRef protocol) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkProtocolGetEnabled
@result TRUE if the protocol is enabled.
*/
Boolean
-SCNetworkProtocolGetEnabled (SCNetworkProtocolRef protocol) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkProtocolGetEnabled (SCNetworkProtocolRef protocol) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkProtocolGetProtocolType
@result The protocol type.
*/
CFStringRef
-SCNetworkProtocolGetProtocolType (SCNetworkProtocolRef protocol) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkProtocolGetProtocolType (SCNetworkProtocolRef protocol) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkProtocolSetConfiguration
*/
Boolean
SCNetworkProtocolSetConfiguration (SCNetworkProtocolRef protocol,
- CFDictionaryRef config) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ CFDictionaryRef config) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkProtocolSetEnabled
*/
Boolean
SCNetworkProtocolSetEnabled (SCNetworkProtocolRef protocol,
- Boolean enabled) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ Boolean enabled) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/* --------------------------------------------------------------------------------
* SERVICES
@discussion Returns the type identifier of all SCNetworkService instances.
*/
CFTypeID
-SCNetworkServiceGetTypeID (void);
+SCNetworkServiceGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkServiceAddProtocolType
*/
Boolean
SCNetworkServiceAddProtocolType (SCNetworkServiceRef service,
- CFStringRef protocolType) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ CFStringRef protocolType) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkServiceCopyAll
You must release the returned value.
*/
CFArrayRef /* of SCNetworkServiceRef's */
-SCNetworkServiceCopyAll (SCPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkServiceCopyAll (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkServiceCopyProtocols
You must release the returned value.
*/
CFArrayRef /* of SCNetworkProtocolRef's */
-SCNetworkServiceCopyProtocols (SCNetworkServiceRef service) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkServiceCopyProtocols (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkServiceCreate
*/
SCNetworkServiceRef
SCNetworkServiceCreate (SCPreferencesRef prefs,
- SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkServiceCopy
*/
SCNetworkServiceRef
SCNetworkServiceCopy (SCPreferencesRef prefs,
- CFStringRef serviceID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
+ CFStringRef serviceID) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkServiceEstablishDefaultConfiguration
@result TRUE if the configuration was updated; FALSE if an error was encountered.
*/
Boolean
-SCNetworkServiceEstablishDefaultConfiguration (SCNetworkServiceRef service) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
-
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 */
+SCNetworkServiceEstablishDefaultConfiguration (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkServiceGetEnabled
@result TRUE if the service is enabled.
*/
Boolean
-SCNetworkServiceGetEnabled (SCNetworkServiceRef service) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkServiceGetEnabled (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkServiceGetInterface
NULL if an error was encountered.
*/
SCNetworkInterfaceRef
-SCNetworkServiceGetInterface (SCNetworkServiceRef service) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkServiceGetInterface (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkServiceGetName
@result The [user specified] name.
*/
CFStringRef
-SCNetworkServiceGetName (SCNetworkServiceRef service) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkServiceGetName (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkServiceCopyProtocol
*/
SCNetworkProtocolRef
SCNetworkServiceCopyProtocol (SCNetworkServiceRef service,
- CFStringRef protocolType) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ CFStringRef protocolType) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkServiceGetServiceID
@result The service identifier.
*/
CFStringRef
-SCNetworkServiceGetServiceID (SCNetworkServiceRef service) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkServiceGetServiceID (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkServiceRemove
@result TRUE if the service was removed; FALSE if an error was encountered.
*/
Boolean
-SCNetworkServiceRemove (SCNetworkServiceRef service) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkServiceRemove (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkServiceRemoveProtocolType
*/
Boolean
SCNetworkServiceRemoveProtocolType (SCNetworkServiceRef service,
- CFStringRef protocolType) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ CFStringRef protocolType) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkServiceSetEnabled
*/
Boolean
SCNetworkServiceSetEnabled (SCNetworkServiceRef service,
- Boolean enabled) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ Boolean enabled) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkServiceSetName
*/
Boolean
SCNetworkServiceSetName (SCNetworkServiceRef service,
- CFStringRef name) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ CFStringRef name) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/* --------------------------------------------------------------------------------
@discussion Returns the type identifier of all SCNetworkSet instances.
*/
CFTypeID
-SCNetworkSetGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkSetGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkSetAddService
*/
Boolean
SCNetworkSetAddService (SCNetworkSetRef set,
- SCNetworkServiceRef service) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
+ SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkSetContainsInterface
*/
Boolean
SCNetworkSetContainsInterface (SCNetworkSetRef set,
- SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
-
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 */
+ SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkSetCopyAll
You must release the returned value.
*/
CFArrayRef /* of SCNetworkSetRef's */
-SCNetworkSetCopyAll (SCPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkSetCopyAll (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkSetCopyCurrent
@result The current set; NULL if no current set has been defined.
*/
SCNetworkSetRef
-SCNetworkSetCopyCurrent (SCPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkSetCopyCurrent (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkSetCopyServices
You must release the returned value.
*/
CFArrayRef /* of SCNetworkServiceRef's */
-SCNetworkSetCopyServices (SCNetworkSetRef set) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkSetCopyServices (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkSetCreate
You must release the returned value.
*/
SCNetworkSetRef
-SCNetworkSetCreate (SCPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkSetCreate (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkSetCopy
*/
SCNetworkSetRef
SCNetworkSetCopy (SCPreferencesRef prefs,
- CFStringRef setID) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ CFStringRef setID) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkSetGetName
@result The [user specified] name.
*/
CFStringRef
-SCNetworkSetGetName (SCNetworkSetRef set) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkSetGetName (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkSetGetSetID
@result The set identifier.
*/
CFStringRef
-SCNetworkSetGetSetID (SCNetworkSetRef set) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkSetGetSetID (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkSetGetServiceOrder
was encountered.
*/
CFArrayRef /* of serviceID CFStringRef's */
-SCNetworkSetGetServiceOrder (SCNetworkSetRef set) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkSetGetServiceOrder (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkSetRemove
@result TRUE if the set was removed; FALSE if an error was encountered.
*/
Boolean
-SCNetworkSetRemove (SCNetworkSetRef set) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkSetRemove (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkSetRemoveService
*/
Boolean
SCNetworkSetRemoveService (SCNetworkSetRef set,
- SCNetworkServiceRef service) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkSetSetCurrent
FALSE if an error was encountered.
*/
Boolean
-SCNetworkSetSetCurrent (SCNetworkSetRef set) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+SCNetworkSetSetCurrent (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkSetSetName
*/
Boolean
SCNetworkSetSetName (SCNetworkSetRef set,
- CFStringRef name) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ CFStringRef name) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkSetSetServiceOrder
*/
Boolean
SCNetworkSetSetServiceOrder (SCNetworkSetRef set,
- CFArrayRef newOrder) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; /* serviceID CFStringRef's */
+ CFArrayRef newOrder) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/); /* serviceID CFStringRef's */
__END_DECLS
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 */
-
+#endif /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
#endif /* _SCNETWORKCONFIGURATION_H */
/*
- * Copyright (c) 2004-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2004-2007, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
return exists;
}
+
+__private_extern__
+Boolean
+__remove_password(SCPreferencesRef prefs,
+ CFDictionaryRef config,
+ CFStringRef passwordKey,
+ CFStringRef encryptionKey,
+ CFStringRef encryptionKeyChainValue,
+ CFStringRef unique_id,
+ CFDictionaryRef *newConfig)
+{
+ CFStringRef encryption = NULL;
+ Boolean ok = FALSE;
+
+ // check for keychain password
+ if (config != NULL) {
+ encryption = CFDictionaryGetValue(config, encryptionKey);
+ }
+ if ((encryption == NULL) ||
+ (isA_CFString(encryption) &&
+ CFEqual(encryption, encryptionKeyChainValue))) {
+ // remove keychain password
+ if (prefs != NULL) {
+ ok = _SCPreferencesSystemKeychainPasswordItemRemove(prefs, unique_id);
+ } else {
+ ok = _SCSecKeychainPasswordItemRemove(NULL, unique_id);
+ }
+ }
+
+ // as needed, check if we have an in-line password that we can remove
+ if (!ok && (encryption == NULL) && (config != NULL)) {
+ CFDataRef inline_password;
+
+ inline_password = CFDictionaryGetValue(config, passwordKey);
+ inline_password = __copy_legacy_password(inline_password);
+ if (inline_password != NULL) {
+ CFRelease(inline_password);
+ ok = TRUE;
+ }
+ }
+
+ if (newConfig != NULL) {
+ if (ok && (config != NULL)) {
+ CFMutableDictionaryRef temp;
+
+ temp = CFDictionaryCreateMutableCopy(NULL, 0, config);
+ CFDictionaryRemoveValue(temp, passwordKey);
+ CFDictionaryRemoveValue(temp, encryptionKey);
+ *newConfig = (CFDictionaryRef)temp;
+ } else {
+ *newConfig = NULL;
+ }
+ }
+
+ return ok;
+}
/*
- * Copyright (c) 2004-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2004-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#define _SCNETWORKCONFIGURATIONINTERNAL_H
-#include <sys/cdefs.h>
#include <CoreFoundation/CoreFoundation.h>
#include <CoreFoundation/CFRuntime.h>
#include <SystemConfiguration/SystemConfiguration.h>
// name
CFStringRef name;
+ // misc
+ Boolean established;
+
} SCNetworkSetPrivate, *SCNetworkSetPrivateRef;
// prefs
SCPreferencesRef prefs;
+ // store (for live SCNetworkService)
+ SCDynamicStoreRef store;
+
// name
CFStringRef name;
// [SCPreferences] interface entity information
CFStringRef entity_device; // interface device
+ CFStringRef entity_device_unique; // ... UniqueIdentifier
CFStringRef entity_type; // interface type
CFStringRef entity_subtype; // interface subtype
CFDataRef address;
CFStringRef addressString;
Boolean builtin;
+ CFStringRef configurationAction;
CFStringRef location;
CFStringRef path;
CFMutableDictionaryRef overrides;
Boolean modemIsV92;
- Boolean supportsBond;
- Boolean supportsVLAN;
CFNumberRef type;
CFNumberRef unit;
// misc
int sort_order; // sort order for this interface
+#if !TARGET_OS_IPHONE
// for BOND interfaces
+ Boolean supportsBond;
struct {
CFArrayRef interfaces;
CFDictionaryRef options;
} bond;
// for VLAN interfaces
+ Boolean supportsVLAN;
struct {
SCNetworkInterfaceRef interface;
CFNumberRef tag; // e.g. 1 <= tag <= 4094
CFDictionaryRef options;
} vlan;
+#endif // !TARGET_OS_IPHONE
} SCNetworkInterfacePrivate, *SCNetworkInterfacePrivateRef;
CFStringRef serviceID,
io_string_t path);
+#if !TARGET_OS_IPHONE
SCNetworkInterfacePrivateRef
_SCBondInterfaceCreatePrivate (CFAllocatorRef allocator,
CFStringRef bond_if);
SCNetworkInterfacePrivateRef
_SCVLANInterfaceCreatePrivate (CFAllocatorRef allocator,
CFStringRef vlan_if);
+#endif // !TARGET_OS_IPHONE
CFDictionaryRef
__SCNetworkInterfaceCopyInterfaceEntity (SCNetworkInterfaceRef interface);
CFArrayRef
-__SCNetworkInterfaceCopyDeepConfiguration (SCNetworkInterfaceRef interface);
+__SCNetworkInterfaceCopyDeepConfiguration (SCNetworkSetRef set,
+ SCNetworkInterfaceRef interface);
+
+CFStringRef
+__SCNetworkInterfaceCopyXLocalizedDisplayName (SCNetworkInterfaceRef interface);
+
+CFStringRef
+__SCNetworkInterfaceCopyXNonLocalizedDisplayName(SCNetworkInterfaceRef interface);
CFStringRef
__SCNetworkInterfaceGetDefaultConfigurationType (SCNetworkInterfaceRef interface);
Boolean okToHold);
void
-__SCNetworkInterfaceSetDeepConfiguration (SCNetworkInterfaceRef interface,
+__SCNetworkInterfaceSetDeepConfiguration (SCNetworkSetRef set,
+ SCNetworkInterfaceRef interface,
CFArrayRef configs);
+#if !TARGET_OS_IPHONE
Boolean
__SCNetworkInterfaceSupportsVLAN (CFStringRef bsd_if);
void
__SCBondInterfaceListCopyMembers (CFArrayRef interfaces,
CFMutableSetRef set);
+#endif // !TARGET_OS_IPHONE
#pragma mark -
#pragma mark SCNetworkProtocol configuration (internal)
CFStringRef unique_id,
CFDataRef *password);
+Boolean
+__remove_password (SCPreferencesRef prefs,
+ CFDictionaryRef config,
+ CFStringRef passwordKey,
+ CFStringRef encryptionKey,
+ CFStringRef encryptionKeyChainValue,
+ CFStringRef unique_id,
+ CFDictionaryRef *newConfig);
+
__END_DECLS
#endif /* _SCNETWORKCONFIGURATIONINTERNAL_H */
/*
- * Copyright (c) 2005-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2005-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#ifndef _SCNETWORKCONFIGURATIONPRIVATE_H
#define _SCNETWORKCONFIGURATIONPRIVATE_H
-#include <AvailabilityMacros.h>
+#include <Availability.h>
+#include <TargetConditionals.h>
#include <sys/cdefs.h>
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SystemConfiguration.h>
#include <SystemConfiguration/SCValidation.h>
#include <IOKit/IOKitLib.h>
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
-
/*!
@header SCNetworkConfigurationPrivate
*/
return (isA_CFType(obj, SCNetworkInterfaceGetTypeID()));
}
+#if !TARGET_OS_IPHONE
static __inline__ CFTypeRef
isA_SCBondInterface(CFTypeRef obj)
{
return obj;
}
+#endif // !TARGET_OS_IPHONE
/*!
@function _SCNetworkInterfaceCompare
CFComparisonResult
_SCNetworkInterfaceCompare (const void *val1,
const void *val2,
- void *context) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ void *context) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
+
+/*!
+ @function _SCNetworkInterfaceCopySlashDevPath
+ @discussion Returns the /dev pathname for the interface.
+ @param interface The network interface.
+ @result The /dev pathname associated with the interface (e.g. "/dev/modem");
+ NULL if no path is available.
+ */
+CFStringRef
+_SCNetworkInterfaceCopySlashDevPath (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0);
#define kIncludeNoVirtualInterfaces 0x0
#define kIncludeVLANInterfaces 0x1
SCNetworkInterfaceRef
_SCNetworkInterfaceCreateWithBSDName (CFAllocatorRef allocator,
CFStringRef bsdName,
- UInt32 flags) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ UInt32 flags) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
/*!
@function _SCNetworkInterfaceCreateWithEntity
SCNetworkInterfaceRef
_SCNetworkInterfaceCreateWithEntity (CFAllocatorRef allocator,
CFDictionaryRef interface_entity,
- SCNetworkServiceRef service) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
/*!
@function _SCNetworkInterfaceCreateWithIONetworkInterfaceObject
You must release the returned value.
*/
SCNetworkInterfaceRef
-_SCNetworkInterfaceCreateWithIONetworkInterfaceObject (io_object_t if_obj) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+_SCNetworkInterfaceCreateWithIONetworkInterfaceObject (io_object_t if_obj) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
+
+#define kSCNetworkInterfaceConfigurationActionKey CFSTR("New Interface Detected Action")
+#define kSCNetworkInterfaceConfigurationActionValueNone CFSTR("None")
+#define kSCNetworkInterfaceConfigurationActionValuePrompt CFSTR("Prompt")
+#define kSCNetworkInterfaceConfigurationActionValueConfigure CFSTR("Configure")
+
+/*!
+ @function _SCNetworkInterfaceGetConfigurationAction
+ @discussion Returns a user-notification / auto-configuration action for the interface.
+ @param interface The network interface.
+ @result The user-notification / auto-configuration action;
+ NULL if the default action should be used.
+ */
+CFStringRef
+_SCNetworkInterfaceGetConfigurationAction (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0);
/*!
@function _SCNetworkInterfaceGetHardwareAddress
NULL if no hardware address is available.
*/
CFDataRef
-_SCNetworkInterfaceGetHardwareAddress (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+_SCNetworkInterfaceGetHardwareAddress (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
/*!
@function _SCNetworkInterfaceGetIOInterfaceType
@result The IOInterfaceType associated with the interface
*/
CFNumberRef
-_SCNetworkInterfaceGetIOInterfaceType (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+_SCNetworkInterfaceGetIOInterfaceType (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
/*!
@function _SCNetworkInterfaceGetIOInterfaceUnit
NULL if no IOLocation is available.
*/
CFNumberRef
-_SCNetworkInterfaceGetIOInterfaceUnit (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+_SCNetworkInterfaceGetIOInterfaceUnit (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
/*!
@function _SCNetworkInterfaceGetIOPath
NULL if no IOPath is available.
*/
CFStringRef
-_SCNetworkInterfaceGetIOPath (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+_SCNetworkInterfaceGetIOPath (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
+
+/*!
+ @function _SCNetworkInterfaceIsBluetoothPAN
+ @discussion Identifies if a network interface is a Bluetooth PAN device.
+ @param interface The network interface.
+ @result TRUE if the interface is a Bluetooth PAN device.
+ */
+Boolean
+_SCNetworkInterfaceIsBluetoothPAN (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0);
/*!
@function _SCNetworkInterfaceIsBuiltin
@result TRUE if the interface is "built-in".
*/
Boolean
-_SCNetworkInterfaceIsBuiltin (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+_SCNetworkInterfaceIsBuiltin (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
+
+/*!
+ @function _SCNetworkInterfaceIsTethered
+ @discussion Identifies if a network interface is an Apple tethered device (e.g. an iPhone).
+ @param interface The network interface.
+ @result TRUE if the interface is a tethered device.
+ */
+Boolean
+_SCNetworkInterfaceIsTethered (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0);
/*!
@function _SCNetworkInterfaceIsModemV92
@result TRUE if the interface is "v.92" modem.
*/
Boolean
-_SCNetworkInterfaceIsModemV92 (SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+_SCNetworkInterfaceIsModemV92 (SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
/*!
@function _SCNetworkInterfaceForceConfigurationRefresh
@result TRUE if the refresh was successfully posted.
*/
Boolean
-_SCNetworkInterfaceForceConfigurationRefresh (CFStringRef ifName) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+_SCNetworkInterfaceForceConfigurationRefresh (CFStringRef ifName) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
/*!
@function _SCBondInterfaceCopyActive
You must release the returned value.
*/
CFArrayRef
-_SCBondInterfaceCopyActive (void) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+_SCBondInterfaceCopyActive (void) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function _SCBondInterfaceUpdateConfiguration
an error was encountered.
*/
Boolean
-_SCBondInterfaceUpdateConfiguration (SCPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+_SCBondInterfaceUpdateConfiguration (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCBondInterfaceSetMode
*/
Boolean
SCBondInterfaceSetMode (SCBondInterfaceRef bond,
- CFNumberRef mode) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ CFNumberRef mode) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function SCBondInterfaceSetMode
@result A CFNumberRef containing the mode (IF_BOND_MODE_{LACP,STATIC}).
*/
CFNumberRef
-SCBondInterfaceGetMode (SCBondInterfaceRef bond) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCBondInterfaceGetMode (SCBondInterfaceRef bond) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function _SCVLANInterfaceCopyActive
You must release the returned value.
*/
CFArrayRef
-_SCVLANInterfaceCopyActive (void) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+_SCVLANInterfaceCopyActive (void) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
/*!
@function _SCVLANInterfaceUpdateConfiguration
an error was encountered.
*/
Boolean
-_SCVLANInterfaceUpdateConfiguration (SCPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+_SCVLANInterfaceUpdateConfiguration (SCPreferencesRef prefs) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
#pragma mark -
kSCNetworkInterfacePasswordTypePPP = 1,
kSCNetworkInterfacePasswordTypeIPSecSharedSecret,
kSCNetworkInterfacePasswordTypeEAPOL,
+ kSCNetworkInterfacePasswordTypeIPSecXAuth,
};
typedef uint32_t SCNetworkInterfacePasswordType;
Boolean
SCNetworkInterfaceCheckPassword (SCNetworkInterfaceRef interface,
- SCNetworkInterfacePasswordType passwordType) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
CFDataRef
SCNetworkInterfaceCopyPassword (SCNetworkInterfaceRef interface,
- SCNetworkInterfacePasswordType passwordType) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
Boolean
SCNetworkInterfaceRemovePassword (SCNetworkInterfaceRef interface,
- SCNetworkInterfacePasswordType passwordType) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
Boolean
SCNetworkInterfaceSetPassword (SCNetworkInterfaceRef interface,
SCNetworkInterfacePasswordType passwordType,
CFDataRef password,
- CFDictionaryRef options) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ CFDictionaryRef options) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
#pragma mark -
return (isA_CFType(obj, SCNetworkServiceGetTypeID()));
}
+enum {
+ kSCNetworkServicePrimaryRankDefault = 0,
+ kSCNetworkServicePrimaryRankFirst = 1,
+ kSCNetworkServicePrimaryRankLast = 2,
+ kSCNetworkServicePrimaryRankNever = 3
+};
+typedef uint32_t SCNetworkServicePrimaryRank;
+
+/*!
+ @function _SCNetworkServiceCopyActive
+ @discussion Returns the network service with the specified identifier.
+
+ Note: The service returned by this SPI differs from the SCNetworkServiceCopy
+ API in that queries and operations interact with the "active" service
+ represented in the SCDynamicStore. Only a limited subset of the
+ SCNetworkService APIs are supported.
+ @param prefs The dynamic store session.
+ @param serviceID The unique identifier for the service.
+ @result A reference to the SCNetworkService represented in the SCDynamicStore;
+ NULL if the serviceID does not exist in the SCDynamicStore or if an
+ error was encountered.
+ You must release the returned value.
+ */
+SCNetworkServiceRef
+_SCNetworkServiceCopyActive (SCDynamicStoreRef store,
+ CFStringRef serviceID) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_1);
+
+/*!
+ @function SCNetworkServiceGetPrimaryRank
+ @discussion Returns the primary service rank associated with a service.
+ @param service The network service.
+ @result The primary service rank associated with the specified application;
+ kSCNetworkServicePrimaryRankDefault if no rank is associated with the
+ application or an error was encountered.
+ */
+SCNetworkServicePrimaryRank
+SCNetworkServiceGetPrimaryRank (SCNetworkServiceRef service) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0);
+
+/*!
+ @function SCNetworkServiceSetPrimaryRank
+ @discussion Updates the the primary service rank associated with a service.
+ @param service The network service.
+ @param newRank The new primary service rank; kSCNetworkServicePrimaryRankDefault
+ if the default service rank should be used.
+ @result TRUE if the rank was stored; FALSE if an error was encountered.
+
+ Notes : The kSCNetworkServicePrimaryRankFirst and kSCNetworkServicePrimaryRankLast
+ values can only valid as a transient setting.
+ */
+Boolean
+SCNetworkServiceSetPrimaryRank (SCNetworkServiceRef service,
+ SCNetworkServicePrimaryRank newRank) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0);
+
#pragma mark -
#pragma mark SCNetworkSet configuration (SPI)
changes were required or if an error was encountered.
*/
Boolean
-SCNetworkSetEstablishDefaultConfiguration (SCNetworkSetRef set);
+SCNetworkSetEstablishDefaultConfiguration (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
/*!
@function SCNetworkSetEstablishDefaultInterfaceConfiguration
*/
Boolean
SCNetworkSetEstablishDefaultInterfaceConfiguration (SCNetworkSetRef set,
- SCNetworkInterfaceRef interface);
+ SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
__END_DECLS
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 */
-
#endif /* _SCNETWORKCONFIGURATIONPRIVATE_H */
/*
- * Copyright (c) 2003-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2003-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*/
+#include <Availability.h>
+#include <TargetConditionals.h>
+#include <sys/cdefs.h>
+#if !TARGET_OS_IPHONE
+#include <dispatch/dispatch.h>
+#endif // !TARGET_OS_IPHONE
#include <CoreFoundation/CoreFoundation.h>
#include <CoreFoundation/CFRuntime.h>
-
-#include <Security/Security.h>
-#include "dy_framework.h"
-
#include <SystemConfiguration/SystemConfiguration.h>
#include <SystemConfiguration/SCPrivate.h>
#include <SystemConfiguration/SCValidation.h>
+#if !TARGET_OS_IPHONE
+#include <Security/Security.h>
+#include "dy_framework.h"
+#endif // !TARGET_OS_IPHONE
+
#include <servers/bootstrap.h>
#include <pthread.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
+#include <mach/mach.h>
#include <ppp/ppp_msg.h>
-#include <ppp/PPPControllerPriv.h>
#include "pppcontroller.h"
#include <ppp/pppcontroller_types.h>
+static int debug = 0;
+static pthread_once_t initialized = PTHREAD_ONCE_INIT;
+
+
typedef struct {
/* base CFType information */
CFMachPortRef notify_port;
/* run loop source, callout, context, rl scheduling info */
+ Boolean scheduled;
CFRunLoopSourceRef rls;
SCNetworkConnectionCallBack rlsFunction;
SCNetworkConnectionContext rlsContext;
CFMutableArrayRef rlList;
- /* misc info */
- int debug;
+#if !TARGET_OS_IPHONE
+ dispatch_queue_t dispatchQueue; // SCNetworkConnectionSetDispatchQueue
+ dispatch_queue_t callbackQueue;
+ dispatch_source_t callbackSource;
+#endif // !TARGET_OS_IPHONE
} SCNetworkConnectionPrivate, *SCNetworkConnectionPrivateRef;
{
SCNetworkConnectionPrivateRef connectionPrivate = (SCNetworkConnectionPrivateRef)cf;
- if (connectionPrivate->debug) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("SCNetworkConnectionDeallocate (0x%x)"), connectionPrivate);
- }
-
/* release resources */
pthread_mutex_destroy(&connectionPrivate->lock);
- if (connectionPrivate->rlList != NULL) {
+ if (connectionPrivate->rls != NULL) {
CFRunLoopSourceInvalidate(connectionPrivate->rls);
CFRelease(connectionPrivate->rls);
+ }
+
+ if (connectionPrivate->rlList != NULL) {
CFRelease(connectionPrivate->rlList);
}
if (connectionPrivate->notify_port != NULL) {
+ mach_port_t mp = CFMachPortGetPort(connectionPrivate->notify_port);
+
+ __MACH_PORT_DEBUG(TRUE, "*** __SCNetworkConnectionDeallocate notify_port", mp);
CFMachPortInvalidate(connectionPrivate->notify_port);
CFRelease(connectionPrivate->notify_port);
+ mach_port_mod_refs(mach_task_self(), mp, MACH_PORT_RIGHT_RECEIVE, -1);
}
- if (connectionPrivate->session_port != MACH_PORT_NULL)
- mach_port_destroy(mach_task_self(), connectionPrivate->session_port);
+ if (connectionPrivate->session_port != MACH_PORT_NULL) {
+ __MACH_PORT_DEBUG(TRUE, "*** __SCNetworkConnectionDeallocate session_port", connectionPrivate->session_port);
+ (void) mach_port_deallocate(mach_task_self(), connectionPrivate->session_port);
+ }
if (connectionPrivate->rlsContext.release != NULL)
(*connectionPrivate->rlsContext.release)(connectionPrivate->rlsContext.info);
}
-static pthread_once_t initialized = PTHREAD_ONCE_INIT;
-
static CFTypeID __kSCNetworkConnectionTypeID = _kCFRuntimeNotATypeID;
static const CFRuntimeClass __SCNetworkConnectionClass = {
static void
__SCNetworkConnectionInitialize(void)
{
- __kSCNetworkConnectionTypeID = _CFRuntimeRegisterClass(&__SCNetworkConnectionClass);
- return;
-}
+ char *env;
-
-static SCNetworkConnectionStatus
-__SCNetworkConnectionConvertStatus(int state)
-{
- SCNetworkConnectionStatus status = kSCNetworkConnectionDisconnected;
-
- switch (state) {
- case PPP_INITIALIZE:
- case PPP_CONNECTLINK:
- case PPP_ESTABLISH:
- case PPP_AUTHENTICATE:
- case PPP_CALLBACK:
- case PPP_NETWORK:
- case PPP_WAITONBUSY:
- status = kSCNetworkConnectionConnecting;
- break;
- case PPP_TERMINATE:
- case PPP_DISCONNECTLINK:
- status = kSCNetworkConnectionDisconnecting;
- break;
- case PPP_RUNNING:
- case PPP_ONHOLD:
- status = kSCNetworkConnectionConnected;
- break;
- case PPP_IDLE:
- case PPP_DORMANT:
- case PPP_HOLDOFF:
- default:
- status = kSCNetworkConnectionDisconnected;
+ /* get the debug environment variable */
+ env = getenv("PPPDebug");
+ if (env != NULL) {
+ if (sscanf(env, "%d", &debug) != 1) {
+ /* PPPDebug value is not valid (or non-numeric), set debug to 1 */
+ debug = 1;
+ }
}
- return status;
+
+ __kSCNetworkConnectionTypeID = _CFRuntimeRegisterClass(&__SCNetworkConnectionClass);
+ return;
}
void (*context_release)(const void *);
int error = kSCStatusFailed;
mach_msg_id_t msgid = buf->header.msgh_id;
- int phase = PPP_IDLE;
SCNetworkConnectionCallBack rlsFunction;
- kern_return_t status;
- SCNetworkConnectionStatus scstatus;
+ SCNetworkConnectionStatus scstatus = kSCNetworkConnectionInvalid;
if (msgid == MACH_NOTIFY_NO_SENDERS) {
SCLog(_sc_verbose, LOG_DEBUG, CFSTR("__SCNetworkConnectionCallBack: PPPController server died"));
} else {
- status = pppcontroller_getstatus(connectionPrivate->session_port, &phase, &error);
+ (void) pppcontroller_getstatus(connectionPrivate->session_port, &scstatus, &error);
}
- if (connectionPrivate->rls == NULL) {
+ if (!connectionPrivate->scheduled) {
+ // if not currently scheduled
return;
}
context_release = NULL;
}
- scstatus = __SCNetworkConnectionConvertStatus(phase);
-
(*rlsFunction)(connection, scstatus, context_info);
if ((context_release != NULL) && (context_info != NULL)) {
(*context_release)(context_info);
SCNetworkConnectionContext *context)
{
SCNetworkConnectionPrivateRef connectionPrivate = NULL;
- char *envdebug;
uint32_t size;
/* save the service */
connectionPrivate->service = CFRetain(service);
- /* get the debug environment variable */
- envdebug = getenv("PPPDebug");
- if (envdebug) {
- if (sscanf(envdebug, "%d", &connectionPrivate->debug) != 1)
- connectionPrivate->debug = 1; /* PPPDebug value is invalid, set debug to 1 */
- }
-
connectionPrivate->rlsFunction = callout;
if (context) {
}
}
- if (connectionPrivate->debug) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("SCNetworkConnectionCreate (0x%x) succeeded for service : %@"), connectionPrivate, service);
- }
-
/* success, return the connection reference */
return connectionPrivate;
fail:
- if (connectionPrivate->debug)
- SCLog(TRUE, LOG_DEBUG, CFSTR("SCNetworkConnectionCreate (0x%x) failed for service : %@"), connectionPrivate, service);
-
/* failure, clean up and leave */
if (connectionPrivate != NULL) {
CFRelease(connectionPrivate);
CFDataRef dataRef = NULL;
int error = kSCStatusFailed;
mach_port_t notify_port = MACH_PORT_NULL;
- mach_port_t port_old = MACH_PORT_NULL;
+ mach_port_t oldNotify = MACH_PORT_NULL;
mach_port_t server = MACH_PORT_NULL;
kern_return_t status;
mach_port_t unpriv_bootstrap_port = MACH_PORT_NULL;
pthread_mutex_lock(&connectionPrivate->lock);
if (bootstrap_look_up(bootstrap_port, PPPCONTROLLER_SERVER, &server) != BOOTSTRAP_SUCCESS) {
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("PPP Controller server not found"));
+ SCLog(_sc_verbose, LOG_ERR, CFSTR("PPP Controller not found"));
goto done;
}
}
if (connectionPrivate->rlsFunction != NULL) {
- CFMachPortContext context = { 0
- , (void *)connectionPrivate
- , NULL
- , NULL
- , pppMPCopyDescription
- };
-
/* allocate port (for server response) */
- connectionPrivate->notify_port = CFMachPortCreate(NULL, __SCNetworkConnectionCallBack, &context, NULL);
+ status = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, ¬ify_port);
+ if (status != KERN_SUCCESS) {
+ goto done;
+ }
+
+ status = mach_port_insert_right(mach_task_self(),
+ notify_port,
+ notify_port,
+ MACH_MSG_TYPE_MAKE_SEND);
+ if (status != KERN_SUCCESS) {
+ /*
+ * We can't insert a send right into our own port! This should
+ * only happen if someone stomped on OUR port (so let's leave
+ * the port alone).
+ */
+ SCLog(TRUE, LOG_ERR, CFSTR("__SCNetworkConnectionSessionPort mach_port_insert_right(): %s"), mach_error_string(status));
+ goto done;
+ }
/* request a notification when/if the server dies */
- notify_port = CFMachPortGetPort(connectionPrivate->notify_port);
status = mach_port_request_notification(mach_task_self(),
notify_port,
MACH_NOTIFY_NO_SENDERS,
1,
notify_port,
MACH_MSG_TYPE_MAKE_SEND_ONCE,
- &port_old);
+ &oldNotify);
if (status != KERN_SUCCESS) {
goto done;
}
+
+ if (oldNotify != MACH_PORT_NULL) {
+ SCLog(TRUE, LOG_ERR, CFSTR("__SCNetworkConnectionSessionPort(): oldNotify != MACH_PORT_NULL"));
+ }
+
+ __MACH_PORT_DEBUG(TRUE, "*** __SCNetworkConnectionSessionPort notify_port (before)", notify_port);
}
status = pppcontroller_attach(server, data, dataLen, unpriv_bootstrap_port, notify_port,
&connectionPrivate->session_port, &error);
if (status != KERN_SUCCESS) {
+ SCLog(TRUE, LOG_DEBUG, CFSTR("__SCNetworkConnectionSessionPort : pppcontroller_attach failed (status=0x%x)"), status);
+ if ((notify_port != MACH_PORT_NULL) && (status == MACH_SEND_INVALID_DEST)) {
+ (void) mach_port_destroy(mach_task_self(), notify_port);
+ notify_port = MACH_PORT_NULL;
+ }
error = kSCStatusFailed;
+ goto done;
+ }
+
+ __MACH_PORT_DEBUG(connectionPrivate->session_port != MACH_PORT_NULL,
+ "*** __SCNetworkConnectionSessionPort session_port",
+ connectionPrivate->session_port);
+ __MACH_PORT_DEBUG(notify_port != MACH_PORT_NULL,
+ "*** __SCNetworkConnectionSessionPort notify_port",
+ notify_port);
+
+ if (notify_port != MACH_PORT_NULL) {
+ CFMachPortContext context = { 0
+ , (void *)connectionPrivate
+ , NULL
+ , NULL
+ , pppMPCopyDescription
+ };
+
+ connectionPrivate->notify_port = CFMachPortCreateWithPort(NULL, notify_port, __SCNetworkConnectionCallBack, &context, NULL);
}
done :
if (error != kSCStatusOK) {
if (connectionPrivate->session_port != MACH_PORT_NULL) {
- mach_port_destroy(mach_task_self(), connectionPrivate->session_port);
+ __MACH_PORT_DEBUG(TRUE,
+ "*** __SCNetworkConnectionSessionPort attach failed: session_port",
+ connectionPrivate->session_port);
+ mach_port_deallocate(mach_task_self(), connectionPrivate->session_port);
connectionPrivate->session_port = MACH_PORT_NULL;
}
if (connectionPrivate->notify_port != NULL) {
+ mach_port_t port = CFMachPortGetPort(connectionPrivate->notify_port);
+
CFMachPortInvalidate(connectionPrivate->notify_port);
CFRelease(connectionPrivate->notify_port);
connectionPrivate->notify_port = NULL;
+ __MACH_PORT_DEBUG(TRUE, "*** __SCNetworkConnectionSessionPort attach failed: notify_port", port);
+ mach_port_mod_refs(mach_task_self(), port, MACH_PORT_RIGHT_RECEIVE, -1);
}
_SCErrorSet(error);
}
service = CFArrayGetValueAtIndex(services, i);
interface = SCNetworkServiceGetInterface(service);
interfaceType = SCNetworkInterfaceGetInterfaceType(interface);
- if (CFEqual(interfaceType, kSCNetworkInterfaceTypePPP)) {
+ if (CFEqual(interfaceType, kSCNetworkInterfaceTypePPP) ||
+ CFEqual(interfaceType, kSCNetworkInterfaceTypeIPSec)) {
CFArrayAppendValue(available, service);
}
}
}
}
- if (tempSet) CFRelease(set);
+ if (tempSet && (set != NULL)) {
+ CFRelease(set);
+ }
return available;
}
SCNetworkConnectionContext *context)
{
SCNetworkConnectionRef connection;
- SCPreferencesRef prefs;
SCNetworkServiceRef service;
if (!isA_CFString(serviceID)) {
return NULL;
}
- prefs = SCPreferencesCreate(NULL, CFSTR("SCNetworkConnectionCreateWithServiceID"), NULL);
- if (prefs == NULL) {
- return NULL;
- }
-
- service = SCNetworkServiceCopy(prefs, serviceID);
- CFRelease(prefs);
+ service = _SCNetworkServiceCopyActive(NULL, serviceID);
if (service == NULL) {
return NULL;
}
{
SCNetworkConnectionPrivateRef connectionPrivate = (SCNetworkConnectionPrivateRef)connection;
int error = kSCStatusFailed;
- int phase;
SCNetworkConnectionStatus scstatus;
mach_port_t session_port;
kern_return_t status;
return kSCNetworkConnectionInvalid;
}
- status = pppcontroller_getstatus(session_port, &phase, &error);
- if ((status != KERN_SUCCESS) || (error != kSCStatusOK)) {
- return kSCNetworkConnectionDisconnected;
+ status = pppcontroller_getstatus(session_port, &scstatus, &error);
+ if (status != KERN_SUCCESS) {
+ _SCErrorSet(kSCStatusFailed);
+ return kSCNetworkConnectionInvalid;
+ }
+
+ if (error != kSCStatusOK) {
+ _SCErrorSet(error);
+ return kSCNetworkConnectionInvalid;
}
- scstatus = __SCNetworkConnectionConvertStatus(phase);
return scstatus;
}
return FALSE;
}
- if (connectionPrivate->debug) {
+ if (debug > 0) {
CFMutableDictionaryRef mdict = NULL;
SCLog(TRUE, LOG_DEBUG, CFSTR("SCNetworkConnectionStart (0x%x)"), connectionPrivate);
dataref = NULL;
}
- if (connectionPrivate->debug)
+ if (debug > 0) {
SCLog(TRUE, LOG_DEBUG, CFSTR("SCNetworkConnectionStart (0x%x), return: %d"), connectionPrivate, error);
+ }
if (error != kSCStatusOK) {
goto fail;
return FALSE;
}
- if (connectionPrivate->debug)
+ if (debug > 0) {
SCLog(TRUE, LOG_DEBUG, CFSTR("SCNetworkConnectionStop (0x%x)"), connectionPrivate);
+ }
status = pppcontroller_stop(session_port, forceDisconnect, &error);
if (status != KERN_SUCCESS) {
goto fail;
}
- if (connectionPrivate->debug)
+ if (debug > 0) {
SCLog(TRUE, LOG_DEBUG, CFSTR("SCNetworkConnectionStop (0x%x), return: %d"), connectionPrivate, error);
+ }
if (error != kSCStatusOK) {
goto fail;
return FALSE;
}
- if (connectionPrivate->debug)
+ if (debug > 0) {
SCLog(TRUE, LOG_DEBUG, CFSTR("SCNetworkConnectionSuspend (0x%x)"), connectionPrivate);
+ }
status = pppcontroller_suspend(session_port, &error);
if (status != KERN_SUCCESS) {
goto fail;
}
- if (connectionPrivate->debug)
+ if (debug > 0) {
SCLog(TRUE, LOG_DEBUG, CFSTR("SCNetworkConnectionSuspend (0x%x), return: %d"), connectionPrivate, error);
+ }
if (error != kSCStatusOK) {
goto fail;
return FALSE;
}
- if (connectionPrivate->debug)
+ if (debug > 0) {
SCLog(TRUE, LOG_DEBUG, CFSTR("SCNetworkConnectionResume (0x%x)"), connectionPrivate);
+ }
status = pppcontroller_resume(session_port, &error);
if (status != KERN_SUCCESS) {
goto fail;
}
- if (connectionPrivate->debug)
+ if (debug > 0) {
SCLog(TRUE, LOG_DEBUG, CFSTR("SCNetworkConnectionResume (0x%x), return: %d"), connectionPrivate, error);
+ }
if (error != kSCStatusOK) {
goto fail;
}
-Boolean
-SCNetworkConnectionScheduleWithRunLoop(SCNetworkConnectionRef connection,
- CFRunLoopRef runLoop,
- CFStringRef runLoopMode)
+#if !TARGET_OS_IPHONE
+static boolean_t
+SCNetworkConnectionNotifyMIGCallback(mach_msg_header_t *message, mach_msg_header_t *reply)
+{
+ SCNetworkConnectionPrivateRef connectionPrivate = dispatch_get_context(dispatch_get_current_queue());
+
+ if (connectionPrivate != NULL) {
+ CFRetain(connectionPrivate);
+ dispatch_async(connectionPrivate->dispatchQueue, ^{
+ __SCNetworkConnectionCallBack(connectionPrivate->notify_port, message, 4096, connectionPrivate);
+ CFRelease(connectionPrivate);
+ });
+ }
+ reply->msgh_remote_port = MACH_PORT_NULL;
+ return false;
+}
+#endif // !TARGET_OS_IPHONE
+
+
+static Boolean
+__SCNetworkConnectionScheduleWithRunLoop(SCNetworkConnectionRef connection,
+ CFRunLoopRef runLoop,
+ CFStringRef runLoopMode,
+#if !TARGET_OS_IPHONE
+ dispatch_queue_t queue
+#else // !TARGET_OS_IPHONE
+ void *queue
+#endif // !TARGET_OS_IPHONE
+ )
{
SCNetworkConnectionPrivateRef connectionPrivate = (SCNetworkConnectionPrivateRef)connection;
int error = kSCStatusFailed;
mach_port_t session_port;
kern_return_t status;
- if (!isA_SCNetworkConnection(connection) || runLoop == NULL || runLoopMode == NULL) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
if (connectionPrivate->rlsFunction == NULL) {
_SCErrorSet(kSCStatusInvalidArgument);
return FALSE;
}
- if ((connectionPrivate->rlList != NULL) &&
- _SC_isScheduled(NULL, runLoop, runLoopMode, connectionPrivate->rlList)) {
- /* already scheduled */
- _SCErrorSet(kSCStatusFailed);
+#if !TARGET_OS_IPHONE
+ if ((connectionPrivate->dispatchQueue != NULL) || // if we are already scheduled on a dispatch queue
+ ((queue != NULL) && connectionPrivate->scheduled)) { // if we are already scheduled on a CFRunLoop
+ _SCErrorSet(kSCStatusInvalidArgument);
return FALSE;
}
+#endif // !TARGET_OS_IPHONE
session_port = __SCNetworkConnectionSessionPort(connectionPrivate);
if (session_port == MACH_PORT_NULL) {
return FALSE;
}
- if (connectionPrivate->rlList == NULL) {
+ if (!connectionPrivate->scheduled) {
status = pppcontroller_notification(session_port, 1, &error);
if ((status != KERN_SUCCESS) || (error != kSCStatusOK)) {
_SCErrorSet(error);
return FALSE;
}
- connectionPrivate->rls = CFMachPortCreateRunLoopSource(NULL, connectionPrivate->notify_port, 0);
- connectionPrivate->rlList = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+ if (runLoop != NULL) {
+ connectionPrivate->rls = CFMachPortCreateRunLoopSource(NULL, connectionPrivate->notify_port, 0);
+ connectionPrivate->rlList = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+ }
+
+ connectionPrivate->scheduled = TRUE;
}
- CFRunLoopAddSource(runLoop, connectionPrivate->rls, runLoopMode);
- _SC_schedule(connectionPrivate, runLoop, runLoopMode, connectionPrivate->rlList);
+#if !TARGET_OS_IPHONE
+ if (queue != NULL) {
+ dispatch_queue_attr_t attr;
+ mach_port_t mp;
+ long res;
+
+ connectionPrivate->dispatchQueue = queue;
+ dispatch_retain(connectionPrivate->dispatchQueue);
+
+ attr = dispatch_queue_attr_create();
+ res = dispatch_queue_attr_set_finalizer(attr,
+ ^(dispatch_queue_t dq) {
+ SCNetworkConnectionRef connection;
+
+ connection = (SCNetworkConnectionRef)dispatch_get_context(dq);
+ CFRelease(connection);
+ });
+ if (res != 0) {
+ SCLog(TRUE, LOG_ERR, CFSTR("SCNetworkConnection dispatch_queue_attr_set_finalizer() failed"));
+ dispatch_release(attr);
+ goto fail;
+ }
+ connectionPrivate->callbackQueue = dispatch_queue_create("com.apple.SCNetworkConnection.notifications", attr);
+ dispatch_release(attr);
+ if (connectionPrivate->callbackQueue == NULL){
+ SCLog(TRUE, LOG_ERR, CFSTR("SCNetworkConnection dispatch_queue_create() failed"));
+ goto fail;
+ }
+ CFRetain(connection); // Note: will be released when the dispatch queue is released
+ dispatch_set_context(connectionPrivate->callbackQueue, connectionPrivate);
+
+ mp = CFMachPortGetPort(connectionPrivate->notify_port);
+ connectionPrivate->callbackSource = dispatch_source_mig_create(mp, sizeof(mach_msg_header_t), NULL, connectionPrivate->callbackQueue, SCNetworkConnectionNotifyMIGCallback);
+ if (connectionPrivate->callbackSource == NULL) {
+ SCLog(TRUE, LOG_ERR, CFSTR("SCNetworkConnection dispatch_source_mig_create() failed"));
+ goto fail;
+ }
+ } else
+#endif // !TARGET_OS_IPHONE
+ {
+ if (!_SC_isScheduled(NULL, runLoop, runLoopMode, connectionPrivate->rlList)) {
+ /*
+ * if we do not already have notifications scheduled with
+ * this runLoop / runLoopMode
+ */
+ CFRunLoopAddSource(runLoop, connectionPrivate->rls, runLoopMode);
+ }
+
+ _SC_schedule(connection, runLoop, runLoopMode, connectionPrivate->rlList);
+ }
return TRUE;
+
+#if !TARGET_OS_IPHONE
+ fail :
+
+ if (connectionPrivate->callbackSource != NULL) {
+ dispatch_cancel(connectionPrivate->callbackSource);
+ dispatch_release(connectionPrivate->callbackSource);
+ connectionPrivate->callbackSource = NULL;
+ }
+ if (connectionPrivate->callbackQueue != NULL) {
+ dispatch_release(connectionPrivate->callbackQueue);
+ connectionPrivate->callbackQueue = NULL;
+ }
+ if (connectionPrivate->dispatchQueue != NULL) {
+ dispatch_release(connectionPrivate->dispatchQueue);
+ connectionPrivate->dispatchQueue = NULL;
+ }
+ _SCErrorSet(kSCStatusFailed);
+ return FALSE;
+#endif // !TARGET_OS_IPHONE
}
-Boolean
-SCNetworkConnectionUnscheduleFromRunLoop(SCNetworkConnectionRef connection,
- CFRunLoopRef runLoop,
- CFStringRef runLoopMode)
+static Boolean
+__SCNetworkConnectionUnscheduleFromRunLoop(SCNetworkConnectionRef connection,
+ CFRunLoopRef runLoop,
+ CFStringRef runLoopMode,
+#if !TARGET_OS_IPHONE
+ dispatch_queue_t queue
+#else // !TARGET_OS_IPHONE
+ void *queue
+#endif // !TARGET_OS_IPHONE
+ )
{
SCNetworkConnectionPrivateRef connectionPrivate = (SCNetworkConnectionPrivateRef)connection;
int error = kSCStatusFailed;
+ CFIndex n = 0;
mach_port_t session_port;
kern_return_t status;
- if (!isA_SCNetworkConnection(connection) || runLoop == NULL || runLoopMode == NULL) {
+ if ((runLoop != NULL) && !connectionPrivate->scheduled) { // if we should be scheduled (but are not)
_SCErrorSet(kSCStatusInvalidArgument);
return FALSE;
}
- if ((connectionPrivate->rlList == NULL) ||
- !_SC_unschedule(connectionPrivate, runLoop, runLoopMode, connectionPrivate->rlList, FALSE)) {
- /* if not currently scheduled */
- _SCErrorSet(kSCStatusFailed);
+#if !TARGET_OS_IPHONE
+ if (((runLoop == NULL) && (connectionPrivate->dispatchQueue == NULL)) || // if we should be scheduled on a dispatch queue (but are not)
+ ((runLoop != NULL) && (connectionPrivate->dispatchQueue != NULL))) { // if we should be scheduled on a CFRunLoop (but are scheduled on a dispatch queue)
+ _SCErrorSet(kSCStatusInvalidArgument);
return FALSE;
}
+#endif // !TARGET_OS_IPHONE
session_port = __SCNetworkConnectionSessionPort(connectionPrivate);
if (session_port == MACH_PORT_NULL) {
return FALSE;
}
- CFRunLoopRemoveSource(runLoop, connectionPrivate->rls, runLoopMode);
+#if !TARGET_OS_IPHONE
+ if (runLoop == NULL) {
+ dispatch_cancel(connectionPrivate->callbackSource);
+ dispatch_release(connectionPrivate->callbackSource);
+ connectionPrivate->callbackSource = NULL;
+ dispatch_release(connectionPrivate->callbackQueue);
+ connectionPrivate->callbackQueue = NULL;
+ dispatch_release(connectionPrivate->dispatchQueue);
+ connectionPrivate->dispatchQueue = NULL;
+ } else
+#endif // !TARGET_OS_IPHONE
+ {
+ if (!_SC_unschedule(connection, runLoop, runLoopMode, connectionPrivate->rlList, FALSE)) {
+ // if not currently scheduled on this runLoop / runLoopMode
+ _SCErrorSet(kSCStatusFailed);
+ return FALSE;
+ }
- if (CFArrayGetCount(connectionPrivate->rlList) == 0) {
- CFRelease(connectionPrivate->rls);
- connectionPrivate->rls = NULL;
- CFRelease(connectionPrivate->rlList);
- connectionPrivate->rlList = NULL;
+ n = CFArrayGetCount(connectionPrivate->rlList);
+ if (n == 0 || !_SC_isScheduled(NULL, runLoop, runLoopMode, connectionPrivate->rlList)) {
+ /*
+ * if we are no longer scheduled to receive notifications for
+ * this runLoop / runLoopMode
+ */
+ CFRunLoopRemoveSource(runLoop, connectionPrivate->rls, runLoopMode);
+
+ if (n == 0) {
+ // if *all* notifications have been unscheduled
+ CFRelease(connectionPrivate->rlList);
+ connectionPrivate->rlList = NULL;
+ CFRunLoopSourceInvalidate(connectionPrivate->rls);
+ CFRelease(connectionPrivate->rls);
+ connectionPrivate->rls = NULL;
+ }
+ }
+ }
+
+ if (n == 0) {
+ // if *all* notifications have been unscheduled
+ connectionPrivate->scheduled = FALSE;
status = pppcontroller_notification(session_port, 0, &error);
if ((status != KERN_SUCCESS) || (error != kSCStatusOK)) {
}
+Boolean
+SCNetworkConnectionScheduleWithRunLoop(SCNetworkConnectionRef connection,
+ CFRunLoopRef runLoop,
+ CFStringRef runLoopMode)
+{
+ if (!isA_SCNetworkConnection(connection) || (runLoop == NULL) || (runLoopMode == NULL)) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return FALSE;
+ }
+
+ return __SCNetworkConnectionScheduleWithRunLoop(connection, runLoop, runLoopMode, NULL);
+}
+
+
+Boolean
+SCNetworkConnectionUnscheduleFromRunLoop(SCNetworkConnectionRef connection,
+ CFRunLoopRef runLoop,
+ CFStringRef runLoopMode)
+{
+ if (!isA_SCNetworkConnection(connection) || (runLoop == NULL) || (runLoopMode == NULL)) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return FALSE;
+ }
+
+ return __SCNetworkConnectionUnscheduleFromRunLoop(connection, runLoop, runLoopMode, NULL);
+}
+
+
+#if !TARGET_OS_IPHONE
+Boolean
+SCNetworkConnectionSetDispatchQueue(SCNetworkConnectionRef connection,
+ dispatch_queue_t queue)
+{
+ Boolean ok = FALSE;
+
+ if (!isA_SCNetworkConnection(connection)) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return FALSE;
+ }
+
+ if (queue != NULL) {
+ ok = __SCNetworkConnectionScheduleWithRunLoop(connection, NULL, NULL, queue);
+ } else {
+ ok = __SCNetworkConnectionUnscheduleFromRunLoop(connection, NULL, NULL, NULL);
+ }
+
+ return ok;
+}
+#endif // !TARGET_OS_IPHONE
+
+
#pragma mark -
#pragma mark User level "dial" API
static Boolean SCNetworkConnectionPrivateIsPPPService (SCDynamicStoreRef session, CFStringRef serviceID, CFStringRef subType1, CFStringRef subType2);
static void addPasswordFromKeychain (SCDynamicStoreRef session, CFStringRef serviceID, CFDictionaryRef *userOptions);
static CFStringRef copyPasswordFromKeychain (CFStringRef uniqueID);
-static CFArrayRef copyKeychainEnumerator (CFStringRef uniqueIdentifier);
-static int notify_userprefs_token = -1;
+static int notify_userprefs_token = -1;
+
+static CFDictionaryRef onDemand_configuration = NULL;
+static pthread_mutex_t onDemand_notify_lock = PTHREAD_MUTEX_INITIALIZER;
+static int onDemand_notify_token = -1;
/*
* return TRUE if domain1 ends with domain2, and will check for trailing "."
return ret;
}
+/* VPN On Demand */
+
+Boolean
+__SCNetworkConnectionCopyOnDemandInfoWithName(SCDynamicStoreRef *storeP,
+ CFStringRef hostName,
+ Boolean onDemandRetry,
+ CFStringRef *connectionServiceID,
+ SCNetworkConnectionStatus *connectionStatus,
+ CFStringRef *vpnRemoteAddress) /* CFDictionaryRef *info */
+{
+ int changed = 1;
+ CFDictionaryRef configuration;
+ Boolean ok = FALSE;
+ int status;
+ SCDynamicStoreRef store = *storeP;
+ CFArrayRef triggers;
+ uint64_t triggersCount = 0;
+ int triggersIndex;
+
+ pthread_mutex_lock(&onDemand_notify_lock);
+ if (onDemand_notify_token == -1) {
+ status = notify_register_check(kSCNETWORKCONNECTION_ONDEMAND_NOTIFY_KEY, &onDemand_notify_token);
+ if (status != NOTIFY_STATUS_OK) {
+ SCLog(TRUE, LOG_ERR, CFSTR("notify_register_check() failed, status=%lu"), status);
+ onDemand_notify_token = -1;
+ }
+ }
+ if (onDemand_notify_token != -1) {
+ status = notify_check(onDemand_notify_token, &changed);
+ if (status != NOTIFY_STATUS_OK) {
+ SCLog(TRUE, LOG_ERR, CFSTR("notify_check() failed, status=%lu"), status);
+ (void)notify_cancel(onDemand_notify_token);
+ onDemand_notify_token = -1;
+ }
+ }
+
+ if (changed && (onDemand_notify_token != -1)) {
+ status = notify_get_state(onDemand_notify_token, &triggersCount);
+ if (status != NOTIFY_STATUS_OK) {
+ SCLog(TRUE, LOG_ERR, CFSTR("notify_get_state() failed, status=%lu"), status);
+ (void)notify_cancel(onDemand_notify_token);
+ onDemand_notify_token = -1;
+ }
+ }
+
+ if (changed) {
+ CFStringRef key;
+
+ if (_sc_debug || (debug > 0)) {
+ SCLog(TRUE, LOG_INFO,
+ CFSTR("OnDemand information %s"),
+ (onDemand_configuration == NULL) ? "fetched" : "updated");
+ }
+
+ if (onDemand_configuration != NULL) {
+ CFRelease(onDemand_configuration);
+ onDemand_configuration = NULL;
+ }
+
+ if (triggersCount > 0) {
+ if (store == NULL) {
+ store = SCDynamicStoreCreate(NULL, CFSTR("__SCNetworkConnectionCopyOnDemandInfoWithName"), NULL, NULL);
+ if (store == NULL) {
+ SCLog(TRUE, LOG_ERR, CFSTR("__SCNetworkConnectionCopyOnDemandInfoWithName SCDynamicStoreCreate() failed"));
+
+ // force retry on next check
+ if (onDemand_notify_token != -1) {
+ (void)notify_cancel(onDemand_notify_token);
+ onDemand_notify_token = -1;
+ }
+ pthread_mutex_unlock(&onDemand_notify_lock);
+ return FALSE;
+ }
+ *storeP = store;
+ }
+
+ key = SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL, kSCDynamicStoreDomainState, kSCEntNetOnDemand);
+ onDemand_configuration = SCDynamicStoreCopyValue(store, key);
+ CFRelease(key);
+ if ((onDemand_configuration != NULL) && !isA_CFDictionary(onDemand_configuration)) {
+ CFRelease(onDemand_configuration);
+ onDemand_configuration = NULL;
+ }
+ }
+ }
+
+ configuration = (onDemand_configuration != NULL) ? CFRetain(onDemand_configuration) : NULL;
+ pthread_mutex_unlock(&onDemand_notify_lock);
+
+ if (configuration == NULL) {
+ // if no "OnDemand" configurations
+ return FALSE;
+ }
+
+ triggers = CFDictionaryGetValue(configuration, kSCNetworkConnectionOnDemandTriggers);
+ triggersCount = isA_CFArray(triggers) ? CFArrayGetCount(triggers) : 0;
+ for (triggersIndex = 0; triggersIndex < triggersCount; triggersIndex++) {
+ CFArrayRef domains;
+ int domainsCount;
+ int domainsIndex;
+ CFStringRef key;
+ CFDictionaryRef trigger;
+
+ trigger = CFArrayGetValueAtIndex(triggers, triggersIndex);
+ if (!isA_CFDictionary(trigger)) {
+ // if not a valid "OnDemand" configuration
+ continue;
+ }
+
+ /*
+ * If we haven't tried a resulution yet, we only want to check for a name
+ * match for domains that require to always connect.
+ */
+ key = onDemandRetry ? kSCNetworkConnectionOnDemandMatchDomainsOnRetry
+ : kSCNetworkConnectionOnDemandMatchDomainsAlways;
+ domains = CFDictionaryGetValue(trigger, key);
+ domainsCount = isA_CFArray(domains) ? CFArrayGetCount(domains) : 0;
+ for (domainsIndex = 0; domainsIndex < domainsCount; domainsIndex++) {
+ CFStringRef domain;
+
+ domain = CFArrayGetValueAtIndex(domains, domainsIndex);
+ if (!isA_CFString(domain)) {
+ // if not a valid match domain
+ continue;
+ }
+
+ if (domainEndsWithDomain(hostName, domain)) {
+ CFArrayRef exceptions;
+ int exceptionsCount;
+ int exceptionsIndex;
+ CFNumberRef num;
+ SCNetworkConnectionStatus onDemandStatus = kSCNetworkConnectionDisconnected;
+
+ // we have a matching domain, check against exception list
+ exceptions = CFDictionaryGetValue(trigger, kSCNetworkConnectionOnDemandMatchDomainsNever);
+ exceptionsCount = isA_CFArray(exceptions) ? CFArrayGetCount(exceptions) : 0;
+ for (exceptionsIndex = 0; exceptionsIndex < exceptionsCount; exceptionsIndex++) {
+ CFStringRef exception;
+
+ exception = CFArrayGetValueAtIndex(exceptions, exceptionsIndex);
+ if (!isA_CFString(exception)) {
+ // if not a valid match exception
+ continue;
+ }
+
+ if (domainEndsWithDomain(hostName, exception)) {
+ // found matching exception
+ if (_sc_debug || (debug > 0)) {
+ SCLog(TRUE, LOG_INFO, CFSTR("OnDemand match exception"));
+ }
+ goto done;
+ }
+ }
+
+ // if we have a matching domain and there were no exceptions
+ // then we pass back the OnDemand info
+
+ if (!CFDictionaryGetValueIfPresent(trigger,
+ kSCNetworkConnectionOnDemandStatus,
+ (const void **)&num) ||
+ !isA_CFNumber(num) ||
+ !CFNumberGetValue(num, kCFNumberSInt32Type, &onDemandStatus)) {
+ onDemandStatus = kSCNetworkConnectionDisconnected;
+ }
+ if (connectionStatus != NULL) {
+ *connectionStatus = onDemandStatus;
+ }
+
+ if (connectionServiceID != NULL) {
+ *connectionServiceID = CFDictionaryGetValue(trigger, kSCNetworkConnectionOnDemandServiceID);
+ *connectionServiceID = isA_CFString(*connectionServiceID);
+ if (*connectionServiceID != NULL) {
+ CFRetain(*connectionServiceID);
+ }
+
+ }
+
+ if (vpnRemoteAddress != NULL) {
+ *vpnRemoteAddress = CFDictionaryGetValue(trigger, kSCNetworkConnectionOnDemandRemoteAddress);
+ *vpnRemoteAddress = isA_CFString(*vpnRemoteAddress);
+ if (*vpnRemoteAddress != NULL) {
+ CFRetain(*vpnRemoteAddress);
+ }
+ }
+
+ if (_sc_debug || (debug > 0)) {
+ SCLog(TRUE, LOG_INFO,
+ CFSTR("OnDemand%s match, connection status = %d"),
+ onDemandRetry ? " (on retry)" : "",
+ onDemandStatus);
+ }
+
+ ok = TRUE;
+ goto done;
+ }
+ }
+ }
+
+// if (_sc_debug || (debug > 0)) {
+// SCLog(TRUE, LOG_INFO, CFSTR("OnDemand domain name(s) not matched"));
+// }
+
+ done :
+
+ if (configuration != NULL) CFRelease(configuration);
+ return ok;
+}
+
Boolean
SCNetworkConnectionCopyUserPreferences(CFDictionaryRef selectionOptions,
CFStringRef *serviceID,
CFDictionaryRef *userOptions)
{
- int debug = 0;
- char *envdebug;
- int prefsChanged;
- SCDynamicStoreRef session;
+ int prefsChanged = 1;
+ SCDynamicStoreRef session = NULL;
Boolean success = FALSE;
int status;
- envdebug = getenv("PPPDebug");
- if (envdebug) {
- if (sscanf(envdebug, "%d", &debug) != 1)
- debug = 1; /* PPPDebug value is invalid, set debug to 1 */
+ /* initialize runtime */
+ pthread_once(&initialized, __SCNetworkConnectionInitialize);
+
+ /* first check for new VPN OnDemand style */
+ if (selectionOptions != NULL) {
+ CFStringRef hostName;
+
+ hostName = CFDictionaryGetValue(selectionOptions, kSCNetworkConnectionSelectionOptionOnDemandHostName);
+ if (isA_CFString(hostName)) {
+ CFStringRef connectionServiceID = NULL;
+ SCNetworkConnectionStatus connectionStatus;
+ Boolean onDemandRetry;
+ CFTypeRef val;
+
+ val = CFDictionaryGetValue(selectionOptions, kSCNetworkConnectionSelectionOptionOnDemandRetry);
+ onDemandRetry = isA_CFBoolean(val) ? CFBooleanGetValue(val) : TRUE;
+
+ success = __SCNetworkConnectionCopyOnDemandInfoWithName(&session,
+ hostName,
+ onDemandRetry,
+ &connectionServiceID,
+ &connectionStatus,
+ NULL);
+ if (debug > 1) {
+ SCLog(TRUE, LOG_DEBUG,
+ CFSTR("SCNetworkConnectionCopyUserPreferences __SCNetworkConnectionCopyOnDemandInfoWithName returns %d w/status %d"),
+ success,
+ connectionStatus);
+ }
+
+ if (success) {
+ // if the hostname matches an OnDemand domain
+ if (session != NULL) {
+ CFRelease(session);
+ }
+ if (connectionStatus == kSCNetworkConnectionConnected) {
+ // if we are already connected
+ if (connectionServiceID != NULL) {
+ CFRelease(connectionServiceID);
+ }
+ return FALSE;
+ }
+
+ *serviceID = connectionServiceID;
+ *userOptions = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+ CFDictionarySetValue((CFMutableDictionaryRef)*userOptions, kSCNetworkConnectionSelectionOptionOnDemandHostName, hostName);
+ return TRUE;
+ } else if (!onDemandRetry) {
+ // if the hostname does not match an OnDemand domain and we have
+ // not yet issued an initial DNS query (i.e. it's not a query
+ // being retried after the VPN has been established) than we're
+ // done
+ if (session != NULL) {
+ CFRelease(session);
+ }
+ return FALSE;
+ }
+ }
}
if (notify_userprefs_token == -1) {
status = notify_register_check(k_NetworkConnect_Notification, ¬ify_userprefs_token);
- if (status != NOTIFY_STATUS_OK)
+ if (status != NOTIFY_STATUS_OK) {
+ SCLog(TRUE, LOG_ERR, CFSTR("notify_register_check() failed, status=%lu"), status);
+ (void)notify_cancel(notify_userprefs_token);
notify_userprefs_token = -1;
- else
- // clear the flag
- notify_check(notify_userprefs_token, &prefsChanged);
+ } else {
+ // clear the "something has changed" state
+ (void) notify_check(notify_userprefs_token, &prefsChanged);
+ prefsChanged = 1;
+ }
+ }
+ if (notify_userprefs_token != -1) {
+ status = notify_check(notify_userprefs_token, &prefsChanged);
+ if (status != NOTIFY_STATUS_OK) {
+ SCLog(TRUE, LOG_ERR, CFSTR("notify_check() failed, status=%lu"), status);
+ (void)notify_cancel(notify_userprefs_token);
+ notify_userprefs_token = -1;
+ }
}
-
- prefsChanged = 1;
- if (notify_userprefs_token != -1)
- notify_check(notify_userprefs_token, &prefsChanged);
*serviceID = NULL;
*userOptions = NULL;
- session = SCDynamicStoreCreate(NULL, CFSTR("SCNetworkConnection"), NULL, NULL);
if (session == NULL) {
- fprintf(stderr, "Error, SCNetworkConnectionCopyUserPreferences, SCDynamicStoreCreate() returned NULL!\n");
+ session = SCDynamicStoreCreate(NULL, CFSTR("SCNetworkConnection"), NULL, NULL);
+ }
+ if (session == NULL) {
+ SCLog(TRUE, LOG_ERR, CFSTR("Error, SCNetworkConnectionCopyUserPreferences, SCDynamicStoreCreate() returned NULL!"));
return FALSE;
}
CFIndex serviceIndex;
CFIndex servicesCount;
- hostName = CFDictionaryGetValue(selectionOptions, kSCPropNetPPPOnDemandHostName);
- if (!isA_CFString(hostName))
- hostName = NULL;
-
- // can't select anything
+ hostName = CFDictionaryGetValue(selectionOptions, kSCNetworkConnectionSelectionOptionOnDemandHostName);
+ if (hostName == NULL) {
+ hostName = CFDictionaryGetValue(selectionOptions, kSCPropNetPPPOnDemandHostName);
+ }
+ hostName = isA_CFString(hostName);
if (hostName == NULL)
- goto done_selection;
+ goto done_selection; // if no hostname for matching
priority = CFDictionaryGetValue(selectionOptions, kSCPropNetPPPOnDemandPriority);
if (!isA_CFString(priority))
CFNumberGetValue(autodial, kCFNumberIntType, &val);
if (val) {
- CFArrayRef autoDomains;
- CFIndex domainIndex;
+ CFArrayRef domains;
CFIndex domainsCount;
+ CFIndex domainsIndex;
/* we found an conditional connection enabled configuration */
/* check domain */
- autoDomains = CFDictionaryGetValue(pppConfig, kSCPropNetPPPOnDemandDomains);
- if (!isA_CFArray(autoDomains))
+ domains = CFDictionaryGetValue(pppConfig, kSCPropNetPPPOnDemandDomains);
+ if (!isA_CFArray(domains))
continue;
- domainsCount = CFArrayGetCount(autoDomains);
- for (domainIndex = 0; domainIndex < domainsCount; domainIndex++) {
+ domainsCount = CFArrayGetCount(domains);
+ for (domainsIndex = 0; domainsIndex < domainsCount; domainsIndex++) {
CFStringRef domain;
- domain = CFArrayGetValueAtIndex(autoDomains, domainIndex);
+ domain = CFArrayGetValueAtIndex(domains, domainsIndex);
if (!isA_CFString(domain))
continue;
*serviceID = serviceName;
CFRetain(*serviceID);
*userOptions = CFDictionaryCreateMutableCopy(NULL, 0, config);
- CFDictionarySetValue((CFMutableDictionaryRef)*userOptions, kSCPropNetPPPOnDemandHostName, hostName);
+ CFDictionarySetValue((CFMutableDictionaryRef)*userOptions, kSCNetworkConnectionSelectionOptionOnDemandHostName, hostName);
CFDictionarySetValue((CFMutableDictionaryRef)*userOptions, kSCPropNetPPPOnDemandPriority, priority);
addPasswordFromKeychain(session, *serviceID, userOptions);
success = TRUE;
*serviceID = serviceName;
CFRetain(*serviceID);
*userOptions = CFDictionaryCreateMutableCopy(NULL, 0, config);
- CFDictionarySetValue((CFMutableDictionaryRef)*userOptions, kSCPropNetPPPOnDemandHostName, hostName);
+ CFDictionarySetValue((CFMutableDictionaryRef)*userOptions, kSCNetworkConnectionSelectionOptionOnDemandHostName, hostName);
CFDictionarySetValue((CFMutableDictionaryRef)*userOptions, kSCPropNetPPPOnDemandPriority, priority);
addPasswordFromKeychain(session, *serviceID, userOptions);
success = TRUE;
addPasswordFromKeychain(session, *serviceID, userOptions);
}
} else {
- fprintf(stderr, "Error, userServices are not of type CFArray!\n");
+ SCLog(TRUE, LOG_DEBUG, CFSTR("Error, userServices are not of type CFArray!"));
}
CFRelease(userServices); // this is OK because SCNetworkConnectionPrivateISExpectedCFType() checks for NULL
// SCNetworkConnectionPrivateCopyDefaultServiceIDForDial
// ----------------------------------------------------
// Try to find the service id to connect
-// (1) Start by looking at the last service used in Internet Connect
-// (2) If Internet Connect has not been used, find the PPP service with the highest ordering
+// (1) Start by looking at the last service used in Network Pref / Network menu extra
+// (2) If Network Pref / Network menu extra has not been used, find the PPP service
+// with the highest ordering
//********************************************************************************************
static Boolean
SCNetworkConnectionPrivateCopyDefaultServiceIDForDial(SCDynamicStoreRef session, CFStringRef *serviceID)
}
-//********************************************************************************
-// copyPasswordFromKeychain
-// --------------------------------------
-// Given a uniqueID, retrieve the password from the keychain
-//********************************************************************************
-static CFStringRef
-copyPasswordFromKeychain(CFStringRef uniqueID)
-{
- CFArrayRef enumerator;
- CFIndex n;
- CFStringRef password = NULL;
-
- enumerator = copyKeychainEnumerator(uniqueID);
- if (enumerator == NULL) {
- return NULL; // if no keychain enumerator
- }
-
- n = CFArrayGetCount(enumerator);
- if (n > 0) {
- void *data = NULL;
- UInt32 dataLen = 0;
- SecKeychainItemRef itemRef;
- OSStatus result;
-
- itemRef = (SecKeychainItemRef)CFArrayGetValueAtIndex(enumerator, 0);
- result = SecKeychainItemCopyContent(itemRef, // itemRef
- NULL, // itemClass
- NULL, // attrList
- &dataLen, // length
- (void *)&data); // outData
- if ((result == noErr) && (data != NULL) && (dataLen > 0)) {
- password = CFStringCreateWithBytes(NULL, data, dataLen, kCFStringEncodingUTF8, TRUE);
- (void) SecKeychainItemFreeContent(NULL, data);
- }
-
- }
-
- CFRelease(enumerator);
-
- return password;
-}
-
+#if !TARGET_OS_IPHONE
//********************************************************************************
// copyKeychainEnumerator
// --------------------------------------
return itemArray;
}
+#endif // !TARGET_OS_IPHONE
+
+//********************************************************************************
+// copyPasswordFromKeychain
+// --------------------------------------
+// Given a uniqueID, retrieve the password from the keychain
+//********************************************************************************
+static CFStringRef
+copyPasswordFromKeychain(CFStringRef uniqueID)
+{
+#if !TARGET_OS_IPHONE
+ CFArrayRef enumerator;
+ CFIndex n;
+ CFStringRef password = NULL;
+
+ enumerator = copyKeychainEnumerator(uniqueID);
+ if (enumerator == NULL) {
+ return NULL; // if no keychain enumerator
+ }
+
+ n = CFArrayGetCount(enumerator);
+ if (n > 0) {
+ void *data = NULL;
+ UInt32 dataLen = 0;
+ SecKeychainItemRef itemRef;
+ OSStatus result;
+
+ itemRef = (SecKeychainItemRef)CFArrayGetValueAtIndex(enumerator, 0);
+ result = SecKeychainItemCopyContent(itemRef, // itemRef
+ NULL, // itemClass
+ NULL, // attrList
+ &dataLen, // length
+ (void *)&data); // outData
+ if ((result == noErr) && (data != NULL) && (dataLen > 0)) {
+ password = CFStringCreateWithBytes(NULL, data, dataLen, kCFStringEncodingUTF8, TRUE);
+ (void) SecKeychainItemFreeContent(NULL, data);
+ }
+
+ }
+
+ CFRelease(enumerator);
+
+ return password;
+#else // !TARGET_OS_IPHONE
+ return NULL;
+#endif // !TARGET_OS_IPHONE
+}
/*
- * Copyright (c) 2003-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2003-2006, 2008, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*/
#ifndef _SCNETWORKCONNECTION_H
+#ifdef USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS
+#include <SystemConfiguration/_SCNetworkConnection.h>
+#else /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
#define _SCNETWORKCONNECTION_H
-#include <AvailabilityMacros.h>
+#include <Availability.h>
+#include <TargetConditionals.h>
#include <sys/cdefs.h>
+#if !TARGET_OS_IPHONE
+#include <dispatch/dispatch.h>
+#endif // !TARGET_OS_IPHONE
#include <sys/types.h>
#include <sys/socket.h>
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SystemConfiguration.h>
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
/*!
@header SCNetworkConnection
#define kSCNetworkConnectionErrorsOut CFSTR("ErrorsOut") /* CFNumber */
+/*
+ Keys for the SCNetworkConnectionCopyUserPreferences() "selectionOptions"
+ dictionary
+ */
+
+/*!
+ @define kSCNetworkConnectionSelectionOptionOnDemandHostName
+ @discussion A host name that will be used to select the
+ "best" SCNetworkConnection.
+ */
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 30000) || TARGET_IPHONE_SIMULATOR
+#define kSCNetworkConnectionSelectionOptionOnDemandHostName CFSTR("OnDemandHostName") /* CFString */
+#endif
+
+/*!
+ @define kSCNetworkConnectionSelectionOptionOnDemandRetry
+ @discussion A boolean value used to indicate whether a DNS query has
+ already been issued for the specified OnDemand host name.
+ */
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 30000) || TARGET_IPHONE_SIMULATOR
+#define kSCNetworkConnectionSelectionOptionOnDemandRetry CFSTR("OnDemandRetry") /* CFBoolean */
+#endif
+
__BEGIN_DECLS
/*!
instances.
*/
CF_EXPORT
-CFTypeID SCNetworkConnectionGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+CFTypeID
+SCNetworkConnectionGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/);
/*!
@result Returns TRUE if there is a valid service to dial;
FALSE if the function was unable to retrieve a service to dial.
*/
-Boolean SCNetworkConnectionCopyUserPreferences (
+Boolean
+SCNetworkConnectionCopyUserPreferences (
CFDictionaryRef selectionOptions,
CFStringRef *serviceID,
CFDictionaryRef *userOptions
- ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/);
/*!
CFStringRef serviceID,
SCNetworkConnectionCallBack callout,
SCNetworkConnectionContext *context
- ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/);
/*!
CFStringRef
SCNetworkConnectionCopyServiceID (
SCNetworkConnectionRef connection
- ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/);
/*!
SCNetworkConnectionStatus
SCNetworkConnectionGetStatus (
SCNetworkConnectionRef connection
- ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/);
/*!
 
Modem : ConnectSpeed : the speed of the modem connection
in bits/second.
+ 
+ IPSec : Status : the IPSec-specific status of type
+ SCNetworkConnectionIPSecStatus
+ 
+ ConnectTime : the time when the connection was
+ established.
+
@/textblock
</pre>
Other dictionaries could be present for PPPoE, PPTP, and L2TP.
CFDictionaryRef
SCNetworkConnectionCopyExtendedStatus (
SCNetworkConnectionRef connection
- ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/);
/*!
CFDictionaryRef
SCNetworkConnectionCopyStatistics (
SCNetworkConnectionRef connection
- ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/);
/*!
SCNetworkConnectionRef connection,
CFDictionaryRef userOptions,
Boolean linger
- ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/);
/*!
SCNetworkConnectionStop (
SCNetworkConnectionRef connection,
Boolean forceDisconnect
- ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/);
/*!
CFDictionaryRef
SCNetworkConnectionCopyUserOptions (
SCNetworkConnectionRef connection
- ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/);
/*!
SCNetworkConnectionRef connection,
CFRunLoopRef runLoop,
CFStringRef runLoopMode
- ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/);
/*!
SCNetworkConnectionRef connection,
CFRunLoopRef runLoop,
CFStringRef runLoopMode
- ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/);
-__END_DECLS
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */
+#if !TARGET_OS_IPHONE
+/*!
+ @function SCNetworkConnectionSetDispatchQueue
+ @discussion Caller provides a dispatch queue on which the callback contained in connection will run.
+ @param connection The SCNetworkConnection to notify.
+ @param queue The libdispatch queue to run the callback on.
+ Pass NULL to disable notifications, and release queue.
+ @result Returns TRUE if the notifications have been enabled/disabled as desired;
+ FALSE if not.
+ The error can be retrieved using the SCError function.
+ */
+Boolean
+SCNetworkConnectionSetDispatchQueue (
+ SCNetworkConnectionRef connection,
+ dispatch_queue_t queue
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA);
+#endif // !TARGET_OS_IPHONE
+
+__END_DECLS
+#endif /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
#endif /* _SCNETWORKCONNECTION_H */
/*
- * Copyright (c) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2006-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include "SCNetworkConfigurationInternal.h"
#include <notify.h>
#include <pthread.h>
-#include <ppp/PPPControllerPriv.h>
#pragma mark -
#define USER_PREFERENCES_DEFAULT CFSTR("ConnectByDefault")
+#define LOG_CFPREFERENCES_CHANGES
+#ifdef LOG_CFPREFERENCES_CHANGES
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+static void
+logCFPreferencesChange(CFStringRef serviceID, CFArrayRef newPreferences)
+{
+ CFBooleanRef bVal;
+ char dir[256];
+ CFArrayRef oldPreferences;
+ CFStringRef str;
+ CFStringRef trace;
+ struct tm tm_now;
+ struct timeval tv_now;
+
+ bVal = CFPreferencesCopyAppValue(CFSTR("LOG_SC_CHANGES"), USER_PREFERENCES_APPLICATION_ID);
+ if (bVal != NULL) {
+ if (!isA_CFBoolean(bVal) || !CFBooleanGetValue(bVal)) {
+ // if debugging not enabled
+ CFRelease(bVal);
+ return;
+ }
+ } else {
+ // if debugging not enabled
+ return;
+ }
+
+ (void)gettimeofday(&tv_now, NULL);
+ (void)localtime_r(&tv_now.tv_sec, &tm_now);
+
+ str = CFStringCreateWithFormat(NULL, NULL,
+ CFSTR("/var/tmp/com.apple.networkConnect-%@-%4d%02d%02d.%02d%02d%02d.%03d"),
+ serviceID,
+ tm_now.tm_year + 1900,
+ tm_now.tm_mon + 1,
+ tm_now.tm_mday,
+ tm_now.tm_hour,
+ tm_now.tm_min,
+ tm_now.tm_sec,
+ tv_now.tv_usec / 1000);
+ _SC_cfstring_to_cstring(str, dir, sizeof(dir), kCFStringEncodingUTF8);
+ CFRelease(str);
+
+ SCLog(TRUE, LOG_ERR, CFSTR("CFPreferences being updated, old/new in \"%s\""), dir);
+
+ if (mkdir(dir, 0755) == -1) {
+ SCLog(TRUE, LOG_ERR, CFSTR("logCFPreferencesChange mkdir() failed, error = %s"), SCErrorString(errno));
+ return;
+ }
+
+ trace = _SC_copyBacktrace();
+ if (trace != NULL) {
+ FILE *f;
+ int fd;
+ char path[256];
+
+ strlcpy(path, dir, sizeof(path));
+ strlcat(path, "/backtrace", sizeof(path));
+ fd = open(path, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, 0644);
+ if (fd == -1) {
+ SCLog(TRUE, LOG_ERR, CFSTR("logCFPreferencesChange fopen() failed, error = %s"), SCErrorString(errno));
+ CFRelease(trace);
+ return;
+ }
+ f = fdopen(fd, "w");
+ SCPrint(TRUE, f, CFSTR("%@"), trace);
+ (void) fclose(f);
+ CFRelease(trace);
+ }
+
+ oldPreferences = CFPreferencesCopyAppValue(serviceID, USER_PREFERENCES_APPLICATION_ID);
+ if (oldPreferences != NULL) {
+ int fd;
+ CFDataRef data;
+ char path[256];
+
+ strlcpy(path, dir, sizeof(path));
+ strlcat(path, "/old", sizeof(path));
+ fd = open(path, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, 0644);
+ if (fd == -1) {
+ SCLog(TRUE, LOG_ERR, CFSTR("logCFPreferencesChange fopen() failed, error = %s"), SCErrorString(errno));
+ CFRelease(oldPreferences);
+ return;
+ }
+ data = CFPropertyListCreateXMLData(NULL, oldPreferences);
+ if (data == NULL) {
+ SCLog(TRUE, LOG_ERR, CFSTR("logCFPreferencesChange CFPropertyListCreateXMLData() failed"));
+ close(fd);
+ CFRelease(oldPreferences);
+ return;
+ }
+ (void) write(fd, CFDataGetBytePtr(data), CFDataGetLength(data));
+ (void) close(fd);
+ CFRelease(data);
+ CFRelease(oldPreferences);
+ }
+
+ if (newPreferences != NULL) {
+ int fd;
+ CFDataRef data;
+ char path[256];
+
+ strlcpy(path, dir, sizeof(path));
+ strlcat(path, "/new", sizeof(path));
+ fd = open(path, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, 0644);
+ if (fd == -1) {
+ SCLog(TRUE, LOG_ERR, CFSTR("logCFPreferencesChange fopen() failed, error = %s"), SCErrorString(errno));
+ return;
+ }
+ data = CFPropertyListCreateXMLData(NULL, newPreferences);
+ if (data == NULL) {
+ SCLog(TRUE, LOG_ERR, CFSTR("logCFPreferencesChange CFPropertyListCreateXMLData() failed"));
+ close(fd);
+ return;
+ }
+ (void) write(fd, CFDataGetBytePtr(data), CFDataGetLength(data));
+ (void) close(fd);
+ CFRelease(data);
+ }
+
+ return;
+}
+#endif // LOG_CFPREFERENCES_CHANGES
+
+
static CFArrayRef
copyCFPreferencesForServiceID(CFStringRef serviceID)
{
return FALSE;
}
+#ifdef LOG_CFPREFERENCES_CHANGES
+ logCFPreferencesChange(serviceID, newPreferences);
+#endif // LOG_CFPREFERENCES_CHANGES
+
CFPreferencesSetValue(serviceID,
newPreferences,
USER_PREFERENCES_APPLICATION_ID,
}
-#ifdef NOTNOW
-Boolean
-SCNetworkConnectionSelectService(CFDictionaryRef selectionOptions,
- SCNetworkServiceRef *service,
- SCUserPreferencesRef *userPreferences)
-{
- return FALSE;
-}
-#endif // NOTNOW
-
-
static void
update_PPP_entity(SCUserPreferencesRef userPreferences, CFDictionaryRef *userOptions)
{
}
+static CFStringRef
+copyUserXAuthID(CFDictionaryRef config, SCUserPreferencesRef userPreferences)
+{
+ CFMutableStringRef xauth_id = NULL;
+
+ if (config != NULL) {
+ CFStringRef encryption;
+
+ encryption = CFDictionaryGetValue(config, kSCPropNetIPSecXAuthPasswordEncryption);
+ if (isA_CFString(encryption) &&
+ CFEqual(encryption, kSCValNetIPSecXAuthPasswordEncryptionKeychain)) {
+ xauth_id = (CFMutableStringRef)CFDictionaryGetValue(config, kSCPropNetIPSecXAuthPassword);
+ if (xauth_id != NULL) {
+ CFRetain(xauth_id);
+ }
+ }
+ }
+
+ if (xauth_id == NULL) {
+ CFStringRef unique_id;
+
+ unique_id = getUserPasswordID(config, userPreferences);
+ xauth_id = CFStringCreateMutableCopy(NULL, 0, unique_id);
+ CFStringAppend(xauth_id, CFSTR(".XAUTH"));
+ }
+
+ return xauth_id;
+}
+
+
static Boolean
checkUserPreferencesPassword(SCUserPreferencesRef userPreferences,
SCNetworkInterfaceRef interface,
return FALSE;
}
+ case kSCNetworkInterfacePasswordTypeIPSecXAuth : {
+ CFStringRef interfaceType;
+
+ interfaceType = SCNetworkInterfaceGetInterfaceType(interface);
+ if (!CFEqual(interfaceType, kSCNetworkInterfaceTypeIPSec)) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return FALSE;
+ }
+ break;
+ }
+
default :
break;
}
NULL);
if (config != NULL) CFRelease(config);
- CFRelease(shared_id);
+ CFRelease(shared_id);
+ break;
+ }
+
+ case kSCNetworkInterfacePasswordTypeIPSecXAuth : {
+ CFDictionaryRef config;
+ CFStringRef xauth_id;
+
+ // get configuration
+ config = SCUserPreferencesCopyInterfaceConfiguration(userPreferences, interface);
+
+ // get XAuth ID
+ xauth_id = copyUserXAuthID(config, userPreferences);
+
+ // check
+ exists = __extract_password(NULL,
+ config,
+ kSCPropNetIPSecXAuthPassword,
+ kSCPropNetIPSecXAuthPasswordEncryption,
+ kSCValNetIPSecXAuthPasswordEncryptionKeychain,
+ xauth_id,
+ NULL);
+
+ if (config != NULL) CFRelease(config);
+ CFRelease(xauth_id);
break;
}
&password);
if (config != NULL) CFRelease(config);
- CFRelease(shared_id);
+ CFRelease(shared_id);
+ break;
+ }
+
+ case kSCNetworkInterfacePasswordTypeIPSecXAuth : {
+ CFDictionaryRef config;
+ CFStringRef xauth_id;
+
+ // get configuration
+ config = SCUserPreferencesCopyInterfaceConfiguration(userPreferences, interface);
+
+ // get XAuth ID
+ xauth_id = copyUserXAuthID(config, userPreferences);
+
+ // extract
+ (void) __extract_password(NULL,
+ config,
+ kSCPropNetIPSecXAuthPassword,
+ kSCPropNetIPSecXAuthPasswordEncryption,
+ kSCValNetIPSecXAuthPasswordEncryptionKeychain,
+ xauth_id,
+ &password);
+
+ if (config != NULL) CFRelease(config);
+ CFRelease(xauth_id);
break;
}
switch (passwordType) {
case kSCNetworkInterfacePasswordTypePPP : {
CFDictionaryRef config;
+ CFDictionaryRef newConfig = NULL;
CFStringRef unique_id;
// get configuration
unique_id = getUserPasswordID(config, userPreferences);
// remove password
- ok = _SCSecKeychainPasswordItemRemove(NULL, unique_id);
+ ok = __remove_password(NULL,
+ config,
+ kSCPropNetPPPAuthPassword,
+ kSCPropNetPPPAuthPasswordEncryption,
+ kSCValNetPPPAuthPasswordEncryptionKeychain,
+ unique_id,
+ &newConfig);
if (ok) {
- CFDictionaryRef config;
- CFMutableDictionaryRef newConfig;
-
- config = SCUserPreferencesCopyInterfaceConfiguration(userPreferences, interface);
- if (config != NULL) {
- newConfig = CFDictionaryCreateMutableCopy(NULL, 0, config);
- CFDictionaryRemoveValue(newConfig, kSCPropNetPPPAuthPassword);
- CFDictionaryRemoveValue(newConfig, kSCPropNetPPPAuthPasswordEncryption);
- ok = SCUserPreferencesSetInterfaceConfiguration(userPreferences, interface, newConfig);
- CFRelease(newConfig);
- }
+ ok = SCUserPreferencesSetInterfaceConfiguration(userPreferences, interface, newConfig);
+ if (newConfig != NULL) CFRelease(newConfig);
}
+
+ if (config != NULL) CFRelease(config);
break;
}
case kSCNetworkInterfacePasswordTypeIPSecSharedSecret : {
CFDictionaryRef config;
+ CFDictionaryRef newConfig = NULL;
CFStringRef shared_id;
// get configuration
shared_id = copyUserSharedSecretID(config, userPreferences);
// remove password
- ok = _SCSecKeychainPasswordItemRemove(NULL, shared_id);
+ ok = __remove_password(NULL,
+ config,
+ kSCPropNetIPSecSharedSecret,
+ kSCPropNetIPSecSharedSecretEncryption,
+ kSCValNetIPSecSharedSecretEncryptionKeychain,
+ shared_id,
+ &newConfig);
if (ok) {
- CFMutableDictionaryRef newConfig;
-
- if (config != NULL) {
- newConfig = CFDictionaryCreateMutableCopy(NULL, 0, config);
- CFDictionaryRemoveValue(newConfig, kSCPropNetIPSecSharedSecret);
- CFDictionaryRemoveValue(newConfig, kSCPropNetIPSecSharedSecretEncryption);
- ok = SCUserPreferencesSetExtendedInterfaceConfiguration(userPreferences,
- interface,
- kSCEntNetIPSec,
- newConfig);
- CFRelease(newConfig);
- }
+ ok = SCUserPreferencesSetExtendedInterfaceConfiguration(userPreferences,
+ interface,
+ kSCEntNetIPSec,
+ newConfig);
+ if (newConfig != NULL) CFRelease(newConfig);
}
- if (config != NULL) CFRelease(config);
+ if (config != NULL) CFRelease(config);
CFRelease(shared_id);
break;
}
+ case kSCNetworkInterfacePasswordTypeIPSecXAuth : {
+ CFDictionaryRef config;
+ CFDictionaryRef newConfig = NULL;
+ CFStringRef xauth_id;
+
+ // get configuration
+ config = SCUserPreferencesCopyInterfaceConfiguration(userPreferences, interface);
+
+ // get XAuth ID
+ xauth_id = copyUserXAuthID(config, userPreferences);
+
+ // remove password
+ ok = __remove_password(NULL,
+ config,
+ kSCPropNetIPSecXAuthPassword,
+ kSCPropNetIPSecXAuthPasswordEncryption,
+ kSCValNetIPSecXAuthPasswordEncryptionKeychain,
+ xauth_id,
+ &newConfig);
+ if (ok) {
+ ok = SCUserPreferencesSetInterfaceConfiguration(userPreferences, interface, newConfig);
+ if (newConfig != NULL) CFRelease(newConfig);
+ }
+
+ if (config != NULL) CFRelease(config);
+ CFRelease(xauth_id);
+ break;
+ }
+
default :
_SCErrorSet(kSCStatusInvalidArgument);
return FALSE;
// "PPP Password" --> keychain "Kind"
if (bundle != NULL) {
description = CFBundleCopyLocalizedString(bundle,
- CFSTR("KEYCHAIN_PPP_PASSWORD"),
+ CFSTR("KEYCHAIN_KIND_PPP_PASSWORD"),
CFSTR("PPP Password"),
NULL);
}
// store password
ok = _SCSecKeychainPasswordItemSet(NULL,
unique_id,
- (label != NULL) ? label : CFSTR("PPP"),
+ (label != NULL) ? label : CFSTR("Network Connection"),
(description != NULL) ? description : CFSTR("PPP Password"),
account,
password,
// "IPSec Shared Secret" --> keychain "Kind"
if (bundle != NULL) {
description = CFBundleCopyLocalizedString(bundle,
- CFSTR("KEYCHAIN_IPSEC_SHARED_SECRET"),
+ CFSTR("KEYCHAIN_KIND_IPSEC_SHARED_SECRET"),
CFSTR("IPSec Shared Secret"),
NULL);
}
// set password
ok = _SCSecKeychainPasswordItemSet(NULL,
shared_id,
- (label != NULL) ? label : CFSTR("PPP"),
+ (label != NULL) ? label : CFSTR("VPN Connection"),
(description != NULL) ? description : CFSTR("IPSec Shared Secret"),
NULL,
password,
break;
}
+ case kSCNetworkInterfacePasswordTypeIPSecXAuth : {
+ CFStringRef xauth_id;
+
+ // get configuration
+ config = SCUserPreferencesCopyInterfaceConfiguration(userPreferences, interface);
+
+ // get XAuth ID
+ xauth_id = copyUserXAuthID(config, userPreferences);
+
+ // User prefs XAuth name --> keychain "Account"
+ if (config != NULL) {
+ account = CFDictionaryGetValue(config, kSCPropNetIPSecXAuthName);
+ }
+
+ // User prefs "name" --> keychain "Name"
+ label = SCUserPreferencesCopyName(userPreferences);
+
+ // "IPSec XAuth Password" --> keychain "Kind"
+ if (bundle != NULL) {
+ description = CFBundleCopyLocalizedString(bundle,
+ CFSTR("KEYCHAIN_KIND_IPSEC_XAUTH_PASSWORD"),
+ CFSTR("IPSec XAuth Password"),
+ NULL);
+ }
+
+ // store password
+ ok = _SCSecKeychainPasswordItemSet(NULL,
+ xauth_id,
+ (label != NULL) ? label : CFSTR("VPN Connection"),
+ (description != NULL) ? description : CFSTR("IPSec XAuth Password"),
+ account,
+ password,
+ options);
+ if (ok) {
+ CFMutableDictionaryRef newConfig;
+
+ if (config != NULL) {
+ newConfig = CFDictionaryCreateMutableCopy(NULL, 0, config);
+ } else {
+ newConfig = CFDictionaryCreateMutable(NULL,
+ 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ }
+ CFDictionarySetValue(newConfig,
+ kSCPropNetIPSecXAuthPassword,
+ xauth_id);
+ CFDictionarySetValue(newConfig,
+ kSCPropNetIPSecXAuthPasswordEncryption,
+ kSCValNetIPSecXAuthPasswordEncryptionKeychain);
+ ok = SCUserPreferencesSetInterfaceConfiguration(userPreferences, interface, newConfig);
+ CFRelease(newConfig);
+ }
+
+ if (config != NULL) CFRelease(config);
+ if (description != NULL) CFRelease(description);
+ if (label != NULL) CFRelease(label);
+ CFRelease(xauth_id);
+ break;
+ }
+
default :
_SCErrorSet(kSCStatusInvalidArgument);
return FALSE;
/*
- * Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2006, 2008, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#ifndef _SCNETWORKCONNECTIONPRIVATE_H
#define _SCNETWORKCONNECTIONPRIVATE_H
-#include <AvailabilityMacros.h>
+#include <Availability.h>
#include <sys/cdefs.h>
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SystemConfiguration.h>
#include <SystemConfiguration/SCNetworkConfigurationPrivate.h>
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
-
typedef const struct __SCUserPreferencesRef * SCUserPreferencesRef;
CFArrayRef /* of SCNetworkServiceRef's */
-SCNetworkConnectionCopyAvailableServices (SCNetworkSetRef set) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCNetworkConnectionCopyAvailableServices (SCNetworkSetRef set) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
SCNetworkConnectionRef
SCNetworkConnectionCreateWithService (CFAllocatorRef allocator,
SCNetworkServiceRef service,
SCNetworkConnectionCallBack callout,
- SCNetworkConnectionContext *context) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ SCNetworkConnectionContext *context) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
SCNetworkServiceRef
-SCNetworkConnectionGetService (SCNetworkConnectionRef connection) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCNetworkConnectionGetService (SCNetworkConnectionRef connection) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
CFArrayRef /* of SCUserPreferencesRef's */
-SCNetworkConnectionCopyAllUserPreferences (SCNetworkConnectionRef connection) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCNetworkConnectionCopyAllUserPreferences (SCNetworkConnectionRef connection) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
SCUserPreferencesRef
-SCNetworkConnectionCopyCurrentUserPreferences (SCNetworkConnectionRef connection) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCNetworkConnectionCopyCurrentUserPreferences (SCNetworkConnectionRef connection) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
SCUserPreferencesRef
-SCNetworkConnectionCreateUserPreferences (SCNetworkConnectionRef connection) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCNetworkConnectionCreateUserPreferences (SCNetworkConnectionRef connection) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
+
+
+#pragma mark -
+#pragma mark SCNetworkConnection "VPN on Demand" SPIs
+
+
+/* VPN On Demand
+ *
+ * in the SCDynamicStore we will have :
+ *
+ * <key>State:/Network/Global/OnDemand</key>
+ * <dict>
+ * <key>Triggers</key>
+ * <array>
+ * <dict>
+ * <key>ServiceID</key>
+ * <string>A740678C-1983-492B-BF64-B825AAE7101E</string>
+ * <key>Status</key>
+ * <integer>8</integer>
+ * <key>RemoteAddress</key>
+ * <string>vpn.mycompany.com</string>
+ * <key>OnDemandMatchDomainsAlways</key>
+ * <array>
+ * <string>internal.mycompany.com</string>
+ * </array>
+ * <key>OnDemandMatchDomainsOnRetry</key>
+ * <array>
+ * <string>mycompany.com</string>
+ * </array>
+ * <key>kSCNetworkConnectionOnDemandMatchDomainsNever</key>
+ * <array>
+ * <string>external.mycompany.com</string>
+ * </array>
+ * </dict>
+ * </array>
+ * </dict>
+ */
+
+// notify(3) key
+#define kSCNETWORKCONNECTION_ONDEMAND_NOTIFY_KEY "com.apple.system.SCNetworkConnectionOnDemand"
+
+// a CFArray[CFDictionary] of VPN on Demand "trigger" configurations
+#define kSCNetworkConnectionOnDemandTriggers CFSTR("Triggers")
+
+// VPN service ID
+#define kSCNetworkConnectionOnDemandServiceID CFSTR("ServiceID")
+
+// VPN service status (idle, connecting, connected, disconnecting)
+#define kSCNetworkConnectionOnDemandStatus CFSTR("Status")
+
+// VPN server address
+#define kSCNetworkConnectionOnDemandRemoteAddress CFSTR("RemoteAddress")
+
+// a CFArray[CFString] representing those domain (or host) names that, if
+// matched to a target hostname, should result in our first establishing
+// the VPN connection before any DNS queries are issued.
+#define kSCNetworkConnectionOnDemandMatchDomainsAlways CFSTR("OnDemandMatchDomainsAlways")
+
+// a CFArray[CFString] representing those domain (or host) names that, if
+// matched to a target hostname, should result in a DNS query regardless of
+// whether the VPN connection has been established. If the DNS query returns
+// an [EAI_NONAME] error then we should establish the VPN connection and
+// re-issue / retry the query.
+#define kSCNetworkConnectionOnDemandMatchDomainsOnRetry CFSTR("OnDemandMatchDomainsOnRetry")
+
+// a CFArray[CFString] representing those domain (or host) names that should
+// be excluded from those that would be used to establish tje VPN connection.
+#define kSCNetworkConnectionOnDemandMatchDomainsNever CFSTR("OnDemandMatchDomainsNever")
+
+
+__private_extern__
+Boolean
+__SCNetworkConnectionCopyOnDemandInfoWithName (SCDynamicStoreRef *storeP,
+ CFStringRef nodeName,
+ Boolean onDemandRetry,
+ CFStringRef *connectionServiceID,
+ SCNetworkConnectionStatus *connectionStatus,
+ CFStringRef *vpnRemoteAddress) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0);
#pragma mark -
Boolean
-SCUserPreferencesRemove (SCUserPreferencesRef userPreferences) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCUserPreferencesRemove (SCUserPreferencesRef userPreferences) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
Boolean
-SCUserPreferencesSetCurrent (SCUserPreferencesRef userPreferences) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCUserPreferencesSetCurrent (SCUserPreferencesRef userPreferences) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
CFStringRef
-SCUserPreferencesCopyName (SCUserPreferencesRef userPreferences) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCUserPreferencesCopyName (SCUserPreferencesRef userPreferences) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
CFTypeID
-SCUserPreferencesGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCUserPreferencesGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
CFStringRef
-SCUserPreferencesGetUniqueID (SCUserPreferencesRef userPreferences) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCUserPreferencesGetUniqueID (SCUserPreferencesRef userPreferences) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
Boolean
-SCUserPreferencesIsForced (SCUserPreferencesRef userPreferences) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+SCUserPreferencesIsForced (SCUserPreferencesRef userPreferences) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
Boolean
SCUserPreferencesSetName (SCUserPreferencesRef userPreferences,
- CFStringRef newName) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
-
-Boolean
-SCNetworkConnectionSelectService (CFDictionaryRef selectionOptions,
- SCNetworkServiceRef *service,
- SCUserPreferencesRef *userPreferences) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ CFStringRef newName) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
Boolean
SCNetworkConnectionStartWithUserPreferences (SCNetworkConnectionRef connection,
SCUserPreferencesRef userPreferences,
- Boolean linger) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ Boolean linger) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
CFDictionaryRef
SCUserPreferencesCopyInterfaceConfiguration (SCUserPreferencesRef userPreferences,
- SCNetworkInterfaceRef interface) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ SCNetworkInterfaceRef interface) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
Boolean
SCUserPreferencesSetInterfaceConfiguration (SCUserPreferencesRef userPreferences,
SCNetworkInterfaceRef interface,
- CFDictionaryRef newOptions) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ CFDictionaryRef newOptions) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
CFDictionaryRef
SCUserPreferencesCopyExtendedInterfaceConfiguration
(SCUserPreferencesRef userPreferences,
SCNetworkInterfaceRef interface,
- CFStringRef extendedType) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ CFStringRef extendedType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
Boolean
SCUserPreferencesSetExtendedInterfaceConfiguration
(SCUserPreferencesRef userPreferences,
SCNetworkInterfaceRef interface,
CFStringRef extendedType,
- CFDictionaryRef newOptions) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ CFDictionaryRef newOptions) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
#pragma mark -
Boolean
SCUserPreferencesCheckInterfacePassword (SCUserPreferencesRef userPreferences,
SCNetworkInterfaceRef interface,
- SCNetworkInterfacePasswordType passwordType) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
CFDataRef
SCUserPreferencesCopyInterfacePassword (SCUserPreferencesRef userPreferences,
SCNetworkInterfaceRef interface,
- SCNetworkInterfacePasswordType passwordType) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
Boolean
SCUserPreferencesRemoveInterfacePassword (SCUserPreferencesRef userPreferences,
SCNetworkInterfaceRef interface,
- SCNetworkInterfacePasswordType passwordType) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ SCNetworkInterfacePasswordType passwordType) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
Boolean
SCUserPreferencesSetInterfacePassword (SCUserPreferencesRef userPreferences,
SCNetworkInterfaceRef interface,
SCNetworkInterfacePasswordType passwordType,
CFDataRef password,
- CFDictionaryRef options) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+ CFDictionaryRef options) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
__END_DECLS
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 */
-
#endif /* _SCNETWORKCONNECTIONPRIVATE_H */
/*
- * Copyright (c) 2004-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2004-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*/
+#include <Availability.h>
+#include <TargetConditionals.h>
#include <CoreFoundation/CoreFoundation.h>
#include <CoreFoundation/CFRuntime.h>
#include <SystemConfiguration/SystemConfiguration.h>
#include "SCNetworkConfigurationInternal.h"
#include <SystemConfiguration/SCValidation.h>
#include <SystemConfiguration/SCPrivate.h>
-#include <SystemConfiguration/BondConfiguration.h>
-#include <SystemConfiguration/VLANConfiguration.h>
#include "SCPreferencesInternal.h"
#include "SCHelper_client.h"
+#if !TARGET_OS_IPHONE
#include <EAP8021X/EAPClientProperties.h>
+#else // !TARGET_OS_IPHONE
+#ifndef kEAPClientPropUserName
+#define kEAPClientPropUserName CFSTR("UserName")
+#endif
+#ifndef kEAPClientPropUserPasswordKeychainItemID
+#define kEAPClientPropUserPasswordKeychainItemID CFSTR("UserPasswordKeychainItemID")
+#endif
+#endif // !TARGET_OS_IPHONE
#include <IOKit/IOKitLib.h>
#include <IOKit/IOCFBundle.h>
#include <IOKit/network/IOEthernetInterface.h> // for kIOEthernetInterfaceClass
#include <IOKit/serial/IOSerialKeys.h>
#include <IOKit/storage/IOStorageDeviceCharacteristics.h>
+#include <IOKit/usb/USB.h>
+
#include "dy_framework.h"
#ifndef kIODeviceSupportsHoldKey
#define kIODeviceSupportsHoldKey "V92Modem"
#endif
+#ifndef kUSBProductString
+#define kUSBProductString "USB Product Name"
+#endif
+
#include <string.h>
#include <mach/mach.h>
#include <net/if.h>
#include <NSSystemDirectories.h>
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1040
-#error MAC_OS_X_VERSION_MIN_REQUIRED < 1040, Check MACOSX_DEPLOYMENT_TARGET
-#endif
-
-
static CFStringRef copy_interface_string (CFBundleRef bundle, CFStringRef key, Boolean localized);
static CFStringRef __SCNetworkInterfaceCopyDescription (CFTypeRef cf);
static void __SCNetworkInterfaceDeallocate (CFTypeRef cf);
kSortIrDA,
kSortSerialPort,
kSortWWAN,
+ kSortEthernetPPP,
+ kSortAirportPPP,
kSortEthernet,
kSortFireWire,
kSortAirPort,
kSortOtherWireless,
+ kSortTethered,
+ kSortWWANEthernet,
kSortBluetoothPAN,
+#if !TARGET_OS_IPHONE
kSortBond,
kSortVLAN,
+#endif // !TARGET_OS_IPHONE
kSortUnknown
};
const CFStringRef kSCNetworkInterfaceType6to4 = CFSTR("6to4");
const CFStringRef kSCNetworkInterfaceTypeBluetooth = CFSTR("Bluetooth");
+#if !TARGET_OS_IPHONE
const CFStringRef kSCNetworkInterfaceTypeBond = CFSTR("Bond");
+#endif // !TARGET_OS_IPHONE
const CFStringRef kSCNetworkInterfaceTypeEthernet = CFSTR("Ethernet");
const CFStringRef kSCNetworkInterfaceTypeFireWire = CFSTR("FireWire");
const CFStringRef kSCNetworkInterfaceTypeIEEE80211 = CFSTR("IEEE80211"); // IEEE 802.11, AirPort
+const CFStringRef kSCNetworkInterfaceTypeIPSec = CFSTR("IPSec");
const CFStringRef kSCNetworkInterfaceTypeIrDA = CFSTR("IrDA");
const CFStringRef kSCNetworkInterfaceTypeL2TP = CFSTR("L2TP");
const CFStringRef kSCNetworkInterfaceTypeModem = CFSTR("Modem");
const CFStringRef kSCNetworkInterfaceTypePPP = CFSTR("PPP");
const CFStringRef kSCNetworkInterfaceTypePPTP = CFSTR("PPTP");
const CFStringRef kSCNetworkInterfaceTypeSerial = CFSTR("Serial");
+#if !TARGET_OS_IPHONE
const CFStringRef kSCNetworkInterfaceTypeVLAN = CFSTR("VLAN");
+#endif // !TARGET_OS_IPHONE
const CFStringRef kSCNetworkInterfaceTypeWWAN = CFSTR("WWAN");
const CFStringRef kSCNetworkInterfaceTypeIPv4 = CFSTR("IPv4");
NULL, // serviceID
NULL, // unsaved
NULL, // entity_device
+ NULL, // entity_device_unique
NULL, // entity_type
NULL, // entity_subtype
NULL, // supported_interface_types
NULL, // address
NULL, // addressString
FALSE, // builtin
+ NULL, // configurationAction
NULL, // location
NULL, // path
NULL, // overrides
FALSE, // modemIsV92
- FALSE, // supportsBond
- FALSE, // supportsVLAN
NULL, // type
NULL, // unit
kSortUnknown, // sort_order
+#if !TARGET_OS_IPHONE
+ FALSE, // supportsBond
{ NULL, NULL}, // bond { interfaces, options }
+ FALSE, // supportsVLAN
{ NULL, NULL, NULL } // vlan { interface, tag, options }
+#endif // !TARGET_OS_IPHONE
};
const SCNetworkInterfaceRef kSCNetworkInterfaceIPv4 = (SCNetworkInterfaceRef)&__kSCNetworkInterfaceIPv4;
#define doL2TP 1<<1
#define doPPP 1<<2
#define doPPTP 1<<3
+#define doIPSec 1<<4
+#define doOverIP do6to4|doL2TP|doPPTP|doIPSec
+#if !TARGET_OS_IPHONE
#define doAppleTalk 1<<0
+#else // !TARGET_OS_IPHONE
+#define doAppleTalk 0
+#endif // !TARGET_OS_IPHONE
#define doDNS 1<<1
#define doIPv4 1<<2
#define doIPv6 1<<3
#define doProxies 1<<4
+#if !TARGET_OS_IPHONE
#define doSMB 1<<5
+#else // !TARGET_OS_IPHONE
+#define doSMB 0
+#endif // !TARGET_OS_IPHONE
static const struct {
const CFStringRef *interface_type;
const CFStringRef *ppp_subtype;
uint32_t supported_protocols;
} configurations[] = {
- // interface type entity_hardware if config? interface types PPP sub-type interface protocols
- // ===================================== ================= ========== ======================= ======================================= =========================================
- { &kSCNetworkInterfaceType6to4 , &kSCEntNet6to4 , FALSE, doNone, NULL, doIPv6 },
- { &kSCNetworkInterfaceTypeBluetooth , &kSCEntNetModem , FALSE, doPPP, &kSCValNetInterfaceSubTypePPPSerial, doNone },
- { &kSCNetworkInterfaceTypeBond , &kSCEntNetEthernet, TRUE , doNone, NULL, doAppleTalk|doDNS|doIPv4|doIPv6|doProxies|doSMB },
- { &kSCNetworkInterfaceTypeEthernet , &kSCEntNetEthernet, TRUE , doPPP, &kSCValNetInterfaceSubTypePPPoE, doAppleTalk|doDNS|doIPv4|doIPv6|doProxies|doSMB },
- { &kSCNetworkInterfaceTypeFireWire , &kSCEntNetFireWire, TRUE , doNone, NULL, doDNS|doIPv4|doIPv6|doProxies|doSMB },
- { &kSCNetworkInterfaceTypeIEEE80211 , &kSCEntNetAirPort , TRUE , doPPP, &kSCValNetInterfaceSubTypePPPoE, doAppleTalk|doDNS|doIPv4|doIPv6|doProxies|doSMB },
- { &kSCNetworkInterfaceTypeIrDA , &kSCEntNetModem , FALSE, doPPP, &kSCValNetInterfaceSubTypePPPSerial, doNone },
- { &kSCNetworkInterfaceTypeL2TP , NULL , FALSE, doPPP, &kSCValNetInterfaceSubTypeL2TP, doNone },
- { &kSCNetworkInterfaceTypeModem , &kSCEntNetModem , FALSE, doPPP, &kSCValNetInterfaceSubTypePPPSerial, doNone },
- { &kSCNetworkInterfaceTypePPP , &kSCEntNetPPP , FALSE, doNone, NULL, doDNS|doIPv4|doIPv6|doProxies|doSMB },
- { &kSCNetworkInterfaceTypePPTP , NULL , FALSE, doPPP, &kSCValNetInterfaceSubTypePPTP, doNone },
- { &kSCNetworkInterfaceTypeSerial , &kSCEntNetModem , FALSE, doPPP, &kSCValNetInterfaceSubTypePPPSerial, doNone },
- { &kSCNetworkInterfaceTypeVLAN , &kSCEntNetEthernet, TRUE , doNone, NULL, doAppleTalk|doDNS|doIPv4|doIPv6|doProxies|doSMB },
- { &kSCNetworkInterfaceTypeWWAN , &kSCEntNetModem , FALSE, doPPP, &kSCValNetInterfaceSubTypePPPSerial, doNone },
- // ===================================== ================= ========== ======================= ======================================= =========================================
- { &kSCNetworkInterfaceTypeIPv4 , NULL , FALSE, do6to4|doL2TP|doPPTP, NULL, doNone }
+ // interface type entity_hardware if config? interface types PPP sub-type interface protocols
+ // ===================================== ================= ========== =============== ======================================= =========================================
+ { &kSCNetworkInterfaceType6to4 , &kSCEntNet6to4 , FALSE, doNone, NULL, doIPv6 },
+ { &kSCNetworkInterfaceTypeBluetooth , &kSCEntNetModem , FALSE, doPPP, &kSCValNetInterfaceSubTypePPPSerial, doNone },
+#if !TARGET_OS_IPHONE
+ { &kSCNetworkInterfaceTypeBond , &kSCEntNetEthernet, TRUE , doNone, NULL, doAppleTalk|doDNS|doIPv4|doIPv6|doProxies|doSMB },
+#endif // !TARGET_OS_IPHONE
+ { &kSCNetworkInterfaceTypeEthernet , &kSCEntNetEthernet, TRUE , doPPP, &kSCValNetInterfaceSubTypePPPoE, doAppleTalk|doDNS|doIPv4|doIPv6|doProxies|doSMB },
+ { &kSCNetworkInterfaceTypeFireWire , &kSCEntNetFireWire, TRUE , doNone, NULL, doDNS|doIPv4|doIPv6|doProxies|doSMB },
+ { &kSCNetworkInterfaceTypeIEEE80211 , &kSCEntNetAirPort , TRUE , doPPP, &kSCValNetInterfaceSubTypePPPoE, doAppleTalk|doDNS|doIPv4|doIPv6|doProxies|doSMB },
+ { &kSCNetworkInterfaceTypeIPSec , &kSCEntNetIPSec , FALSE, doNone, NULL, doDNS|doIPv4|doIPv6|doProxies|doSMB },
+ { &kSCNetworkInterfaceTypeIrDA , &kSCEntNetModem , FALSE, doPPP, &kSCValNetInterfaceSubTypePPPSerial, doNone },
+ { &kSCNetworkInterfaceTypeL2TP , NULL , FALSE, doPPP, &kSCValNetInterfaceSubTypeL2TP, doNone },
+ { &kSCNetworkInterfaceTypeModem , &kSCEntNetModem , FALSE, doPPP, &kSCValNetInterfaceSubTypePPPSerial, doNone },
+ { &kSCNetworkInterfaceTypePPP , &kSCEntNetPPP , FALSE, doNone, NULL, doDNS|doIPv4|doIPv6|doProxies|doSMB },
+ { &kSCNetworkInterfaceTypePPTP , NULL , FALSE, doPPP, &kSCValNetInterfaceSubTypePPTP, doNone },
+ { &kSCNetworkInterfaceTypeSerial , &kSCEntNetModem , FALSE, doPPP, &kSCValNetInterfaceSubTypePPPSerial, doNone },
+#if !TARGET_OS_IPHONE
+ { &kSCNetworkInterfaceTypeVLAN , &kSCEntNetEthernet, TRUE , doNone, NULL, doAppleTalk|doDNS|doIPv4|doIPv6|doProxies|doSMB },
+#endif // !TARGET_OS_IPHONE
+ { &kSCNetworkInterfaceTypeWWAN , &kSCEntNetModem , FALSE, doPPP, &kSCValNetInterfaceSubTypePPPSerial, doNone },
+ // ===================================== ================= ========== =============== ======================================= =========================================
+ { &kSCNetworkInterfaceTypeIPv4 , NULL , FALSE, doOverIP, NULL, doNone }
};
CFStringAppendFormat(result, NULL, CFSTR("<SCNetworkInterface %p [%p]> {"), cf, allocator);
CFStringAppendFormat(result, NULL, CFSTR("type = %@"), interfacePrivate->interface_type);
CFStringAppendFormat(result, NULL, CFSTR(", entity_device = %@"), interfacePrivate->entity_device);
+ if (interfacePrivate->entity_device_unique != NULL) {
+ CFStringAppendFormat(result, NULL, CFSTR("+%@"), interfacePrivate->entity_device_unique);
+ }
CFStringAppendFormat(result, NULL, CFSTR(", entity_type = %@"), interfacePrivate->entity_type);
if (interfacePrivate->entity_subtype != NULL) {
CFStringAppendFormat(result, NULL, CFSTR(" / %@"), interfacePrivate->entity_subtype);
if (interfacePrivate->path != NULL) {
CFStringAppendFormat(result, NULL, CFSTR(", path = %@"), interfacePrivate->path);
}
+ if (interfacePrivate->configurationAction != NULL) {
+ CFStringAppendFormat(result, NULL, CFSTR(", action = %@"), interfacePrivate->configurationAction);
+ }
if (interfacePrivate->overrides != NULL) {
CFStringAppendFormat(result, NULL, CFSTR(", overrides = %p"), interfacePrivate->overrides);
}
if (interfacePrivate->unsaved != NULL) {
CFStringAppendFormat(result, NULL, CFSTR(", unsaved = %@"), interfacePrivate->unsaved);
}
+#if !TARGET_OS_IPHONE
if (interfacePrivate->bond.interfaces != NULL) {
CFIndex i;
CFIndex n;
if (interfacePrivate->vlan.options != NULL) {
CFStringAppendFormat(result, NULL, CFSTR(", options = %@"), interfacePrivate->vlan.options);
}
+#endif // !TARGET_OS_IPHONE
CFStringAppendFormat(result, NULL, CFSTR("}"));
return result;
if (interfacePrivate->entity_device != NULL)
CFRelease(interfacePrivate->entity_device);
+ if (interfacePrivate->entity_device_unique != NULL)
+ CFRelease(interfacePrivate->entity_device_unique);
+
if (interfacePrivate->supported_interface_types != NULL)
CFRelease(interfacePrivate->supported_interface_types);
if (interfacePrivate->path != NULL)
CFRelease(interfacePrivate->path);
+ if (interfacePrivate->configurationAction != NULL)
+ CFRelease(interfacePrivate->configurationAction);
+
if (interfacePrivate->overrides != NULL)
CFRelease(interfacePrivate->overrides);
if (interfacePrivate->unit != NULL)
CFRelease(interfacePrivate->unit);
+#if !TARGET_OS_IPHONE
if (interfacePrivate->bond.interfaces != NULL)
CFRelease(interfacePrivate->bond.interfaces);
if (interfacePrivate->vlan.options != NULL)
CFRelease(interfacePrivate->vlan.options);
+#endif // !TARGET_OS_IPHONE
return;
}
return FALSE; // if not the same device
}
+ if (!_SC_CFEqual(if1->entity_device_unique, if2->entity_device_unique)) {
+ return FALSE; // if not the same device unique identifier
+ }
+
+#if !TARGET_OS_IPHONE
if (CFEqual(if1->interface_type, kSCNetworkInterfaceTypeBond)) {
if (!_SC_CFEqual(if1->bond.interfaces, if2->bond.interfaces)) {
return FALSE; // if not the same interfaces
return FALSE; // if not the same tag
}
}
+#endif // !TARGET_OS_IPHONE
- if (!CFEqual(if1->interface, if2->interface)) {
+ if (!_SC_CFEqual(if1->interface, if2->interface)) {
return FALSE; // if not the same layering
}
static CFHashCode
__SCNetworkInterfaceHash(CFTypeRef cf)
{
+ CFHashCode hash = 0;
SCNetworkInterfacePrivateRef interfacePrivate = (SCNetworkInterfacePrivateRef)cf;
if (interfacePrivate->entity_device != NULL) {
- return CFHash(interfacePrivate->entity_device);
+ if (interfacePrivate->entity_device_unique == NULL) {
+ hash = CFHash(interfacePrivate->entity_device);
+ } else {
+ CFStringRef str;
+
+ str = CFStringCreateWithFormat(NULL, NULL, CFSTR("%@+%@"),
+ interfacePrivate->entity_device,
+ interfacePrivate->entity_device_unique);
+ hash = CFHash(str);
+ CFRelease(str);
+ }
}
- return 0;
+ return hash;
}
interfacePrivate->serviceID = (serviceID != NULL) ? CFRetain(serviceID) : NULL;
interfacePrivate->unsaved = NULL;
interfacePrivate->entity_device = NULL;
+ interfacePrivate->entity_device_unique = NULL;
interfacePrivate->entity_type = NULL;
interfacePrivate->entity_subtype = NULL;
interfacePrivate->supported_interface_types = NULL;
interfacePrivate->address = NULL;
interfacePrivate->addressString = NULL;
interfacePrivate->builtin = FALSE;
+ interfacePrivate->configurationAction = NULL;
interfacePrivate->path = (path != NULL) ? CFStringCreateWithCString(NULL, path, kCFStringEncodingUTF8)
: NULL;
interfacePrivate->location = NULL;
interfacePrivate->overrides = NULL;
interfacePrivate->modemIsV92 = FALSE;
- interfacePrivate->supportsBond = FALSE;
- interfacePrivate->supportsVLAN = FALSE;
interfacePrivate->type = NULL;
interfacePrivate->unit = NULL;
interfacePrivate->sort_order = kSortUnknown;
+#if !TARGET_OS_IPHONE
+ interfacePrivate->supportsBond = FALSE;
interfacePrivate->bond.interfaces = NULL;
interfacePrivate->bond.mode = NULL;
interfacePrivate->bond.options = NULL;
+ interfacePrivate->supportsVLAN = FALSE;
interfacePrivate->vlan.interface = NULL;
interfacePrivate->vlan.tag = NULL;
interfacePrivate->vlan.options = NULL;
+#endif // !TARGET_OS_IPHONE
return interfacePrivate;
}
+#if !TARGET_OS_IPHONE
__private_extern__
Boolean
__SCNetworkInterfaceSupportsVLAN(CFStringRef bsd_if)
}
interfacePrivate->interface_type = kSCNetworkInterfaceTypeBond;
- interfacePrivate->entity_type = kSCEntNetEthernet;
+ interfacePrivate->entity_type = kSCValNetInterfaceTypeEthernet;
interfacePrivate->entity_device = CFStringCreateCopy(allocator, bond_if);
interfacePrivate->builtin = TRUE;
interfacePrivate->supportsVLAN = __SCNetworkInterfaceSupportsVLAN(bond_if);
}
interfacePrivate->interface_type = kSCNetworkInterfaceTypeVLAN;
- interfacePrivate->entity_type = kSCEntNetEthernet;
+ interfacePrivate->entity_type = kSCValNetInterfaceTypeEthernet;
interfacePrivate->entity_device = CFStringCreateCopy(allocator, vlan_if);
interfacePrivate->builtin = TRUE;
interfacePrivate->sort_order = kSortVLAN;
return interfacePrivate;
}
+#endif // !TARGET_OS_IPHONE
#pragma mark -
}
}
- /* ... and lastly, sort by BSD interface name */
+ /* ... and, then sort by BSD interface name */
if ((dev1->entity_device != NULL) && (dev2->entity_device != NULL)) {
res = CFStringCompare(dev1->entity_device, dev2->entity_device, 0);
+ if (res != kCFCompareEqualTo) {
+ return (res);
+ }
+ }
+
+ /* ... and lastly, sort by BSD interface unique identifier */
+ if ((dev1->entity_device_unique != NULL) && (dev2->entity_device_unique != NULL)) {
+ res = CFStringCompare(dev1->entity_device_unique, dev2->entity_device_unique, 0);
+// if (res != kCFCompareEqualTo) {
+// return (res);
+// }
}
return res;
{
Boolean match = FALSE;
CFIndex prefixLen = CFStringGetLength(prefix);
- CFStringRef str = ioVal;
+ CFStringRef str = NULL;
if (!isA_CFString(ioVal)) {
if (isA_CFData(ioVal)) {
(const char *)CFDataGetBytePtr(ioVal),
kCFStringEncodingUTF8,
kCFAllocatorNull);
+ ioVal = str;
} else {
return FALSE;
}
}
- if ((str != NULL) &&
- (CFStringGetLength(str) >= prefixLen) &&
- (CFStringCompareWithOptions(str,
+ if ((ioVal != NULL) &&
+ (CFStringGetLength(ioVal) >= prefixLen) &&
+ (CFStringCompareWithOptions(ioVal,
prefix,
CFRangeMake(0, prefixLen),
kCFCompareCaseInsensitive) == kCFCompareEqualTo)) {
match = TRUE;
}
- if (str != ioVal) CFRelease(str);
+ if (str != NULL) CFRelease(str);
return match;
}
&child_iterator);
if (kr != kIOReturnSuccess) {
SCLog(TRUE, LOG_DEBUG, CFSTR("pci_port IORegistryEntryCreateIterator() failed, kr = 0x%x"), kr);
+ CFRelease(port_names);
return MACH_PORT_NULL;
}
}
+static Boolean
+isBluetoothBuiltin(Boolean *haveController)
+{
+ Boolean builtin = FALSE;
+ io_object_t hciController;
+ io_iterator_t iter = MACH_PORT_NULL;
+ kern_return_t kr;
+
+ kr = IOServiceGetMatchingServices(masterPort,
+ IOServiceMatching("IOBluetoothHCIController"),
+ &iter);
+ if ((kr != kIOReturnSuccess) || (iter == MACH_PORT_NULL)) {
+ if (kr != kIOReturnSuccess) {
+ SCLog(TRUE, LOG_DEBUG, CFSTR("isBluetoothBuiltin IOServiceGetMatchingServices() failed, kr = 0x%x"), kr);
+ }
+ *haveController = FALSE;
+ return FALSE;
+ }
+ *haveController = TRUE;
+
+ hciController = IOIteratorNext(iter);
+ IOObjectRelease(iter);
+ if(hciController != MACH_PORT_NULL) {
+ CFNumberRef idVendor;
+
+ idVendor = IORegistryEntryCreateCFProperty(hciController, CFSTR(kUSBVendorID), NULL, 0);
+ if (idVendor != NULL) {
+ int idVendorVal;
+
+ if (isA_CFNumber(idVendor) &&
+ CFNumberGetValue(idVendor, kCFNumberIntType, &idVendorVal) &&
+ (idVendorVal == kIOUSBVendorIDAppleComputer)) {
+ builtin = TRUE;
+ }
+
+ CFRelease(idVendor);
+ }
+
+ IOObjectRelease(hciController);
+ }
+
+ return builtin;
+}
+
+
#pragma mark -
#pragma mark Interface enumeration
io_registry_entry_t bus,
CFDictionaryRef bus_dict)
{
- CFBooleanRef bVal;
CFDataRef data;
int ift = -1;
int iVal;
CFNumberRef num;
CFStringRef str;
+ CFBooleanRef val;
// interface type
num = CFDictionaryGetValue(interface_dict, CFSTR(kIOInterfaceType));
(IOObjectConformsTo(controller, "AirPortPCI" )) ||
(IOObjectConformsTo(controller, "AirPortDriver" ))) {
interfacePrivate->interface_type = kSCNetworkInterfaceTypeIEEE80211;
- interfacePrivate->entity_type = kSCEntNetEthernet;
+ interfacePrivate->entity_type = kSCValNetInterfaceTypeEthernet;
interfacePrivate->sort_order = kSortAirPort;
} else if (IOObjectConformsTo(controller, "IOBluetoothBNEPDriver")) {
interfacePrivate->interface_type = kSCNetworkInterfaceTypeEthernet;
- interfacePrivate->entity_type = kSCEntNetEthernet;
+ interfacePrivate->entity_type = kSCValNetInterfaceTypeEthernet;
interfacePrivate->sort_order = kSortBluetoothPAN;
} else {
str = IODictionaryCopyCFStringValue(bus_dict, CFSTR("name"));
if ((str != NULL) && CFEqual(str, CFSTR("radio"))) {
interfacePrivate->interface_type = kSCNetworkInterfaceTypeEthernet; // ??
- interfacePrivate->entity_type = kSCEntNetEthernet;
+ interfacePrivate->entity_type = kSCValNetInterfaceTypeEthernet;
interfacePrivate->sort_order = kSortOtherWireless;
} else {
interfacePrivate->interface_type = kSCNetworkInterfaceTypeEthernet;
- interfacePrivate->entity_type = kSCEntNetEthernet;
+ interfacePrivate->entity_type = kSCValNetInterfaceTypeEthernet;
interfacePrivate->sort_order = kSortEthernet;
+#if !TARGET_OS_IPHONE
// BOND support only enabled for ethernet devices
interfacePrivate->supportsBond = TRUE;
+#endif // !TARGET_OS_IPHONE
}
if (str != NULL) CFRelease(str);
}
+ // check if WWAN Ethernet
+ if (IOObjectConformsTo(controller, "AppleUSBEthernetHost")) {
+ interfacePrivate->sort_order = kSortTethered;
+ } else if (IOObjectConformsTo(controller, "AppleUSBCDCECMData")) {
+ interfacePrivate->sort_order = kSortWWANEthernet;
+ }
+
// built-in
- bVal = isA_CFBoolean(CFDictionaryGetValue(interface_dict, CFSTR(kIOBuiltin)));
- if (bVal == NULL) {
- bVal = isA_CFBoolean(CFDictionaryGetValue(interface_dict, CFSTR(kIOPrimaryInterface)));
+ val = isA_CFBoolean(CFDictionaryGetValue(interface_dict, CFSTR(kIOBuiltin)));
+ if (val == NULL) {
+ val = isA_CFBoolean(CFDictionaryGetValue(interface_dict, CFSTR(kIOPrimaryInterface)));
}
- if (bVal != NULL) {
- interfacePrivate->builtin = CFBooleanGetValue(bVal);
+ if (val != NULL) {
+ interfacePrivate->builtin = CFBooleanGetValue(val);
} else {
interfacePrivate->builtin = isBuiltin(interface);
}
+ if (!interfacePrivate->builtin &&
+ CFEqual(interfacePrivate->interface_type, kSCNetworkInterfaceTypeIEEE80211)) {
+ // always treat AirPort interfaces as built-in
+ interfacePrivate->builtin = TRUE;
+ }
+
// location
interfacePrivate->location = IODictionaryCopyCFStringValue(interface_dict, CFSTR(kIOLocation));
+#if !TARGET_OS_IPHONE
// VLAN support
num = CFDictionaryGetValue(controller_dict, CFSTR(kIOFeatures));
if (isA_CFNumber(num) &&
interfacePrivate->supportsVLAN = TRUE;
}
}
+#endif // !TARGET_OS_IPHONE
// localized name
if (CFEqual(interfacePrivate->interface_type, kSCNetworkInterfaceTypeIEEE80211)) {
interfacePrivate->localized_arg2 = port_name;
}
}
- } else if (CFEqual(provider, CFSTR("IOUSBDevice"))) {
- CFTypeRef val;
-
+ } else if (CFEqual(provider, CFSTR("IOUSBDevice")) ||
+ CFEqual(provider, CFSTR("IOUSBInterface"))) {
// check if a "Product Name" has been provided
val = IORegistryEntrySearchCFProperty(interface,
kIOServicePlane,
CFSTR(kIOPropertyProductNameKey),
NULL,
kIORegistryIterateRecursively | kIORegistryIterateParents);
+ if (val == NULL) {
+ // check if a "USB Product Name" has been provided
+ val = IORegistryEntrySearchCFProperty(interface,
+ kIOServicePlane,
+ CFSTR(kUSBProductString),
+ NULL,
+ kIORegistryIterateRecursively | kIORegistryIterateParents);
+ }
if (val != NULL) {
CFStringRef productName;
interfacePrivate->interface_type = kSCNetworkInterfaceTypeFireWire;
// Entity
- interfacePrivate->entity_type = kSCEntNetFireWire;
+ interfacePrivate->entity_type = kSCValNetInterfaceTypeFireWire;
// built-in
interfacePrivate->builtin = isBuiltin(interface);
io_registry_entry_t bus,
CFDictionaryRef bus_dict)
{
+ CFStringRef base = NULL;
CFStringRef ift;
Boolean isModem = FALSE;
+ Boolean isWWAN = FALSE;
CFStringRef modemCCL = NULL;
- CFStringRef str;
+ Boolean ok = FALSE;
CFTypeRef val;
// check if hidden
return FALSE; // if this interface should not be exposed
}
- // Type
- str = CFDictionaryGetValue(interface_dict, CFSTR(kIOTTYBaseNameKey));
- if (str == NULL) {
+ // check if initializing
+ val = IORegistryEntrySearchCFProperty(interface,
+ kIOServicePlane,
+ CFSTR("Initializing"),
+ NULL,
+ kIORegistryIterateRecursively | kIORegistryIterateParents);
+ if (val != NULL) {
+ Boolean initializing;
+
+ initializing = isA_CFBoolean(val) && CFBooleanGetValue(val);
+ CFRelease(val);
+ if (initializing) {
+ return FALSE; // if this interface is still initializing
+ }
+ }
+
+ // check if WWAN
+ val = IORegistryEntrySearchCFProperty(interface,
+ kIOServicePlane,
+ CFSTR("WWAN"),
+ NULL,
+ kIORegistryIterateRecursively | kIORegistryIterateParents);
+ if (val != NULL) {
+ isWWAN = isA_CFBoolean(val) && CFBooleanGetValue(val);
+ CFRelease(val);
+ }
+
+ // Entity (Device)
+ interfacePrivate->entity_device = IODictionaryCopyCFStringValue(interface_dict, CFSTR(kIOTTYDeviceKey));
+ if (interfacePrivate->entity_device == NULL) {
return FALSE;
}
+ base = IODictionaryCopyCFStringValue(interface_dict, CFSTR(kIOTTYBaseNameKey));
+ if (base == NULL) {
+ base = CFRetain(interfacePrivate->entity_device);
+ }
+
/*
* From MoreSCF:
*
* that only the rev A actually had an IrDA port, and Mac OS X doesn't
* even support it, these ports definitely shouldn't be listed.
*/
- if (CFStringCompare(str,
+ if (CFStringCompare(base,
CFSTR("irda"),
kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
- return FALSE;
+ goto done;
}
- if (IOStringValueHasPrefix(str, CFSTR("bluetooth"))) {
+ if (IOStringValueHasPrefix(base, CFSTR("bluetooth"))) {
+ Boolean haveController = FALSE;
+
// Bluetooth
interfacePrivate->interface_type = kSCNetworkInterfaceTypeBluetooth;
interfacePrivate->sort_order = kSortBluetooth;
- } else if (IOStringValueHasPrefix(str, CFSTR("irda-ircomm"))) {
+ interfacePrivate->builtin = isBluetoothBuiltin(&haveController);
+ if (!haveController) {
+ // if device with no controller present
+ goto done;
+ }
+ } else if (IOStringValueHasPrefix(base, CFSTR("irda-ircomm"))) {
// IrDA
interfacePrivate->interface_type = kSCNetworkInterfaceTypeIrDA;
interfacePrivate->sort_order = kSortIrDA;
- } else if (IOStringValueHasPrefix(str, CFSTR("wwan"))) {
+ } else if (isWWAN) {
// WWAN
interfacePrivate->interface_type = kSCNetworkInterfaceTypeWWAN;
interfacePrivate->sort_order = kSortWWAN;
// Entity (Hardware)
ift = CFDictionaryGetValue(interface_dict, CFSTR(kIOSerialBSDTypeKey));
if (!isA_CFString(ift)) {
- return FALSE;
+ goto done;
}
if (CFEqual(ift, CFSTR(kIOSerialBSDModemType))) {
// if modem
isModem = TRUE;
- if (CFEqual(str, CFSTR("modem"))) {
+ if (CFEqual(base, CFSTR("modem"))) {
interfacePrivate->builtin = TRUE;
interfacePrivate->sort_order = kSortInternalModem;
- } else if (CFEqual(str, CFSTR("usbmodem"))) {
+ } else if (CFEqual(base, CFSTR("usbmodem"))) {
interfacePrivate->sort_order = kSortUSBModem;
}
} else if (CFEqual(ift, CFSTR(kIOSerialBSDRS232Type))) {
// if serial port
interfacePrivate->sort_order = kSortSerialPort;
} else {
- return FALSE;
+ goto done;
}
- // Entity (Device)
- interfacePrivate->entity_device = IODictionaryCopyCFStringValue(interface_dict, CFSTR(kIOTTYDeviceKey));
-
// configuration template overrides
val = IORegistryEntrySearchCFProperty(interface,
kIOServicePlane,
kIORegistryIterateRecursively | kIORegistryIterateParents);
if (val != NULL) {
if (isA_CFDictionary(val)) {
+ CFStringRef uniqueID;
+
if (interfacePrivate->overrides == NULL) {
interfacePrivate->overrides = CFDictionaryCreateMutable(NULL,
0,
modemCCL = CFDictionaryGetValue(val, kSCPropNetModemConnectionScript);
modemCCL = isA_CFString(modemCCL);
+
+ uniqueID = CFDictionaryGetValue(val, CFSTR("UniqueIdentifier"));
+ uniqueID = isA_CFString(uniqueID);
+ if (uniqueID != NULL) {
+ // retain the device's base name and the unique id
+ CFRelease(interfacePrivate->entity_device);
+ interfacePrivate->entity_device = CFRetain(base);
+ interfacePrivate->entity_device_unique = CFStringCreateCopy(NULL, uniqueID);
+ }
}
CFRelease(val);
}
- // modem CCL
+ // if not part of the DeviceModemOverrides, look harder for the modem CCL
if (modemCCL == NULL) {
val = IORegistryEntrySearchCFProperty(interface,
kIOServicePlane,
CFStringRef name = NULL;
CFMutableStringRef port;
- port = CFStringCreateMutableCopy(NULL, 0, str);
+ port = CFStringCreateMutableCopy(NULL, 0, base);
CFStringLowercase(port, NULL);
if (!isModem) {
} else {
// if no [English] localization available, use TTY base name
CFRelease(name);
- interfacePrivate->name = CFStringCreateCopy(NULL, str);
+ interfacePrivate->name = CFStringCreateCopy(NULL, base);
}
} else {
- interfacePrivate->name = CFStringCreateCopy(NULL, str);
+ interfacePrivate->name = CFStringCreateCopy(NULL, base);
}
// set localized name
} else {
// if no localization available, use TTY base name
CFRelease(localized);
- interfacePrivate->localized_name = CFStringCreateCopy(NULL, str);
+ interfacePrivate->localized_name = CFStringCreateCopy(NULL, base);
}
} else {
- interfacePrivate->localized_name = CFStringCreateCopy(NULL, str);
+ interfacePrivate->localized_name = CFStringCreateCopy(NULL, base);
}
- if (!isModem || !CFEqual(str, CFSTR("modem"))) {
+ if (!isModem || !CFEqual(base, CFSTR("modem"))) {
CFStringRef productName;
// check if a "Product Name" has been provided
CFSTR(kIOPropertyProductNameKey),
NULL,
kIORegistryIterateRecursively | kIORegistryIterateParents);
+ if (val == NULL) {
+ // check if a "USB Product Name" has been provided
+ val = IORegistryEntrySearchCFProperty(interface,
+ kIOServicePlane,
+ CFSTR(kUSBProductString),
+ NULL,
+ kIORegistryIterateRecursively | kIORegistryIterateParents);
+ }
if (val != NULL) {
productName = IOCopyCFStringValue(val);
CFRelease(val);
if ((modemCCL == NULL) &&
is_valid_connection_script(productName)) {
set_connection_script(interfacePrivate, productName);
- modemCCL = productName;
}
}
CFRelease(port);
}
- return TRUE;
+ ok = TRUE;
+
+ done :
+
+ if (!ok && (interfacePrivate->entity_device != NULL)) {
+ CFRelease(interfacePrivate->entity_device);
+ interfacePrivate->entity_device = NULL;
+ }
+ if (base != NULL) CFRelease(base);
+
+ return ok;
}
interfacePrivate = __SCNetworkInterfaceCreatePrivate(NULL, NULL, NULL, NULL, path);
- if (!(*func)(interfacePrivate, interface, interface_dict, controller, controller_dict, bus, bus_dict)) {
+ if ((*func)(interfacePrivate, interface, interface_dict, controller, controller_dict, bus, bus_dict)) {
+ CFTypeRef val;
+
+ /* check user-notification / auto-configuration preferences */
+ val = IORegistryEntrySearchCFProperty(interface,
+ kIOServicePlane,
+ kSCNetworkInterfaceConfigurationActionKey,
+ NULL,
+ kIORegistryIterateRecursively | kIORegistryIterateParents);
+ if (val != NULL) {
+ if (isA_CFString(val)) {
+ interfacePrivate->configurationAction = CFRetain(val);
+ }
+ CFRelease(val);
+ }
+ } else {
CFRelease(interfacePrivate);
interfacePrivate = NULL;
}
CFIndex extendedIndex;
CFIndex interfaceIndex;
SCNetworkInterfacePrivateRef interfacePrivate = (SCNetworkInterfacePrivateRef)interface;
+ Boolean isL2TP = FALSE;
Boolean ok = FALSE;
defaultType = __SCNetworkInterfaceGetDefaultConfigurationType(interface);
goto done;
}
-// It turns out that, for PPP interfaces, we want to be able to store
-// some extended interface configuration (e.g. IPSec [for L2TP]). For
-// now, I'm commenting out the following test.
-//
-// if (requirePerInterface && !configurations[interfaceIndex].per_interface_config) {
-// // we don't allow per-service extended configurations
-// goto done;
-// }
+ if (CFEqual(extendedType, kSCEntNetIPSec)) {
+ CFStringRef interfaceType;
+
+ interfaceType = SCNetworkInterfaceGetInterfaceType(interface);
+ if (CFEqual(interfaceType, kSCNetworkInterfaceTypePPP)) {
+ SCNetworkInterfaceRef child;
+
+ child = SCNetworkInterfaceGetInterface(interface);
+ if (child != NULL) {
+ interfaceType = SCNetworkInterfaceGetInterfaceType(child);
+ if (CFEqual(interfaceType, kSCNetworkInterfaceTypeL2TP)) {
+ isL2TP = TRUE;
+ }
+ }
+ }
+ }
+
+ if (requirePerInterface &&
+ !configurations[interfaceIndex].per_interface_config &&
+ !isL2TP) {
+ // we don't allow per-service extended configurations (except
+ // that we do allow IPSec as an extended type for PPP->L2TP)
+ goto done;
+ }
extendedIndex = findConfiguration(extendedType);
- if (extendedIndex != kCFNotFound) {
- // extended type cannot match a known interface type
+ if ((extendedIndex != kCFNotFound) && !isL2TP) {
+ // extended type cannot match a known interface type (except
+ // that we do allow IPSec as an extended type for PPP->L2TP)
goto done;
}
kSCPropNetInterfaceDeviceName,
interfacePrivate->entity_device);
}
+ if (interfacePrivate->entity_device_unique != NULL) {
+ CFDictionarySetValue(entity,
+ CFSTR("DeviceUniqueIdentifier"),
+ interfacePrivate->entity_device_unique);
+ }
// match the "hardware" with the lowest layer
while (TRUE) {
}
interfacePrivate = (SCNetworkInterfacePrivateRef)interface;
+ if (CFEqual(interface, kSCNetworkInterfaceIPv4)) {
+ return entity;
+ }
+
interfaceIndex = findConfiguration(interfacePrivate->interface_type);
if (interfaceIndex != kCFNotFound) {
if (configurations[interfaceIndex].entity_hardware != NULL) {
}
+#if !TARGET_OS_IPHONE
static SCNetworkInterfaceRef
findInterface(CFArrayRef interfaces, CFStringRef match_if)
{
}
return interface;
}
+#endif // !TARGET_OS_IPHONE
SCNetworkInterfaceRef
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
CFDictionarySetValue(entity, kSCPropNetInterfaceDeviceName, bsdName);
- if ((flags & kIncludeVLANInterfaces) == 0) {
- CFDictionarySetValue(entity, CFSTR("_NO_VLAN_INTERFACES_"), kCFBooleanTrue);
- }
+#if !TARGET_OS_IPHONE
if ((flags & kIncludeBondInterfaces) == 0) {
CFDictionarySetValue(entity, CFSTR("_NO_BOND_INTERFACES_"), kCFBooleanTrue);
}
+ if ((flags & kIncludeVLANInterfaces) == 0) {
+ CFDictionarySetValue(entity, CFSTR("_NO_VLAN_INTERFACES_"), kCFBooleanTrue);
+ }
+#endif // !TARGET_OS_IPHONE
interface = _SCNetworkInterfaceCreateWithEntity(NULL, entity, NULL);
CFRelease(entity);
}
+static void
+__SCNetworkInterfaceSetService(SCNetworkInterfaceRef interface,
+ SCNetworkServiceRef service)
+{
+ SCNetworkInterfacePrivateRef interfacePrivate;
+ SCNetworkServicePrivateRef servicePrivate;
+
+ interfacePrivate = (SCNetworkInterfacePrivateRef)interface;
+ if (interfacePrivate->prefs != NULL) {
+ CFRelease(interfacePrivate->prefs);
+ interfacePrivate->prefs = NULL;
+ }
+ if (interfacePrivate->serviceID != NULL) {
+ CFRelease(interfacePrivate->serviceID);
+ interfacePrivate->serviceID = NULL;
+ }
+
+ servicePrivate = (SCNetworkServicePrivateRef)service;
+ if (servicePrivate->prefs != NULL) {
+ interfacePrivate->prefs = CFRetain(servicePrivate->prefs);
+ }
+ if (servicePrivate->serviceID != NULL) {
+ interfacePrivate->serviceID = CFRetain(servicePrivate->serviceID);
+ }
+
+ return;
+}
+
+
+static Boolean
+_SCNetworkInterfaceMatchesName(CFStringRef name, CFStringRef key)
+{
+ Boolean match;
+ CFStringRef str;
+
+ if (bundle == NULL) {
+ // if no bundle
+ return FALSE;
+ }
+
+ if (!isA_CFString(name)) {
+ // if no interface "name"
+ return FALSE;
+ }
+
+ // check non-localized name for a match
+ str = copy_interface_string(bundle, key, FALSE);
+ if (str != NULL) {
+ match = CFEqual(name, str);
+ CFRelease(str);
+ if (match) {
+ return TRUE;
+ }
+ }
+
+ // check localized name for a match
+ str = copy_interface_string(bundle, key, TRUE);
+ if (str != NULL) {
+ match = CFEqual(name, str);
+ CFRelease(str);
+ if (match) {
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+
SCNetworkInterfaceRef
_SCNetworkInterfaceCreateWithEntity(CFAllocatorRef allocator,
CFDictionaryRef interface_entity,
{
SCNetworkInterfacePrivateRef interfacePrivate = NULL;
CFStringRef ifDevice;
+ CFStringRef ifUnique;
CFStringRef ifSubType;
CFStringRef ifType;
CFArrayRef matching_interfaces = NULL;
}
ifDevice = CFDictionaryGetValue(interface_entity, kSCPropNetInterfaceDeviceName);
+ ifUnique = CFDictionaryGetValue(interface_entity, CFSTR("DeviceUniqueIdentifier"));
if (CFEqual(ifType, kSCValNetInterfaceTypeEthernet) ||
CFEqual(ifType, kSCValNetInterfaceTypeFireWire) ||
match_keys[0] = CFSTR(kIOProviderClassKey);
match_vals[0] = CFSTR(kIOSerialBSDServiceValue);
- match_keys[1] = CFSTR(kIOTTYDeviceKey);
+ match_keys[1] = CFSTR(kIOTTYBaseNameKey);
match_vals[1] = ifDevice;
matching = CFDictionaryCreate(NULL,
interfacePrivate = (SCNetworkInterfacePrivateRef)SCNetworkInterfaceCreateWithInterface(kSCNetworkInterfaceIPv4,
kSCNetworkInterfaceType6to4);
+ } else if (CFEqual(ifType, kSCValNetInterfaceTypeIPSec)) {
+ interfacePrivate = (SCNetworkInterfacePrivateRef)SCNetworkInterfaceCreateWithInterface(kSCNetworkInterfaceIPv4,
+ kSCNetworkInterfaceTypeIPSec);
} else if ((CFStringFind(ifType, CFSTR("."), 0).location != kCFNotFound) && (ifDevice == NULL)) {
interfacePrivate = (SCNetworkInterfacePrivateRef)SCNetworkInterfaceCreateWithInterface(kSCNetworkInterfaceIPv4,
ifType);
n = CFArrayGetCount(matching_interfaces);
switch (n) {
+ case 1 :
+ interfacePrivate = (SCNetworkInterfacePrivateRef)CFArrayGetValueAtIndex(matching_interfaces, 0);
+ if (_SC_CFEqual(ifUnique, interfacePrivate->entity_device_unique)) {
+ // if the unique ID's match
+ CFRetain(interfacePrivate);
+ break;
+ }
+
+ interfacePrivate = NULL;
+ // fall through
case 0 :
if (!CFEqual(ifType, kSCValNetInterfaceTypeEthernet)) {
break;
if (prefs == NULL) {
break;
}
+#if !TARGET_OS_IPHONE
if (!CFDictionaryContainsKey(interface_entity, CFSTR("_NO_VLAN_INTERFACES_"))) {
interfacePrivate = (SCNetworkInterfacePrivateRef)findVLANInterface(prefs, ifDevice);
}
&& !CFDictionaryContainsKey(interface_entity, CFSTR("_NO_BOND_INTERFACES_"))) {
interfacePrivate = (SCNetworkInterfacePrivateRef)findBondInterface(prefs, ifDevice);
}
+#endif // !TARGET_OS_IPHONE
CFRelease(prefs);
break;
- case 1 :
- interfacePrivate = (SCNetworkInterfacePrivateRef)CFArrayGetValueAtIndex(matching_interfaces, 0);
+ default :
+ if (ifUnique != NULL) {
+ CFIndex i;
+
+ for (i = 0; i < n; i++) {
+ SCNetworkInterfacePrivateRef scan;
+
+ scan = (SCNetworkInterfacePrivateRef)CFArrayGetValueAtIndex(matching_interfaces, i);
+ if (_SC_CFEqual(ifUnique, scan->entity_device_unique)) {
+ if (interfacePrivate != NULL) {
+ // if we've matched more than one interface
+ interfacePrivate = NULL;
+ break;
+ }
+ interfacePrivate = scan;
+ }
+ }
+ }
+ if (interfacePrivate == NULL) {
+ SCLog(TRUE, LOG_ERR, CFSTR("_SCNetworkInterfaceCreateWithEntity() failed, more than one interface matches %@"), ifDevice);
+ interfacePrivate = (SCNetworkInterfacePrivateRef)CFArrayGetValueAtIndex(matching_interfaces, 0);
+ }
CFRetain(interfacePrivate);
break;
- default :
- SCLog(TRUE, LOG_DEBUG, CFSTR("_SCNetworkInterfaceCreateWithEntity() failed, more than one interface matches %@"), ifDevice);
- CFRelease(matching_interfaces);
- _SCErrorSet(kSCStatusFailed);
- return NULL;
}
CFRelease(matching_interfaces);
}
* if device not present on this system
*/
interfacePrivate = __SCNetworkInterfaceCreatePrivate(NULL, NULL, NULL, NULL, NULL);
- interfacePrivate->entity_type = ifType;
- interfacePrivate->entity_subtype = ifSubType;
- interfacePrivate->entity_device = (ifDevice != NULL) ? CFStringCreateCopy(NULL, ifDevice) : NULL;
+ interfacePrivate->entity_type = ifType;
+ interfacePrivate->entity_subtype = ifSubType;
+ interfacePrivate->entity_device = (ifDevice != NULL) ? CFStringCreateCopy(NULL, ifDevice) : NULL;
+ interfacePrivate->entity_device_unique = (ifUnique != NULL) ? CFStringCreateCopy(NULL, ifUnique) : NULL;
if (CFEqual(ifType, kSCValNetInterfaceTypeEthernet)) {
CFStringRef entity_hardware;
entity_hardware = CFDictionaryGetValue(interface_entity, kSCPropNetInterfaceHardware);
- if ((entity_hardware != NULL) &&
+ if (isA_CFString((entity_hardware)) &&
CFEqual(entity_hardware, kSCEntNetAirPort)) {
interfacePrivate->interface_type = kSCNetworkInterfaceTypeIEEE80211;
+ interfacePrivate->sort_order = kSortAirPort;
} else {
+ CFStringRef name;
+
interfacePrivate->interface_type = kSCNetworkInterfaceTypeEthernet;
+
+ name = CFDictionaryGetValue(interface_entity, kSCPropUserDefinedName);
+ if (_SCNetworkInterfaceMatchesName(name, CFSTR("iPhone"))) {
+ interfacePrivate->sort_order = kSortTethered;
+ } else if (_SCNetworkInterfaceMatchesName(name, CFSTR("bluetooth-pan"))) {
+ interfacePrivate->sort_order = kSortBluetoothPAN;
+ } else {
+ interfacePrivate->sort_order = kSortEthernet;
+ }
}
} else if (CFEqual(ifType, kSCValNetInterfaceTypeFireWire)) {
interfacePrivate->interface_type = kSCNetworkInterfaceTypeFireWire;
+ interfacePrivate->sort_order = kSortFireWire;
} else if (CFEqual(ifType, kSCValNetInterfaceTypePPP)) {
if (CFEqual(ifSubType, kSCValNetInterfaceSubTypePPPoE)) {
- interfacePrivate->interface_type = kSCNetworkInterfaceTypeEthernet;
+ CFStringRef entity_hardware;
+
+ entity_hardware = CFDictionaryGetValue(interface_entity, kSCPropNetInterfaceHardware);
+ if (isA_CFString((entity_hardware)) &&
+ CFEqual(entity_hardware, kSCEntNetAirPort)) {
+ interfacePrivate->interface_type = kSCNetworkInterfaceTypeIEEE80211;
+ interfacePrivate->sort_order = kSortAirPort;
+ } else {
+ interfacePrivate->interface_type = kSCNetworkInterfaceTypeEthernet;
+ interfacePrivate->sort_order = kSortEthernet;
+ }
} else if (CFEqual(ifSubType, kSCValNetInterfaceSubTypePPPSerial)) {
if (CFStringHasPrefix(ifDevice, CFSTR("Bluetooth"))) {
interfacePrivate->interface_type = kSCNetworkInterfaceTypeBluetooth;
+ interfacePrivate->sort_order = kSortBluetooth;
} else if (CFStringHasPrefix(ifDevice, CFSTR("irda"))) {
interfacePrivate->interface_type = kSCNetworkInterfaceTypeIrDA;
+ interfacePrivate->sort_order = kSortIrDA;
} else if (CFStringHasPrefix(ifDevice, CFSTR("wwan"))) {
interfacePrivate->interface_type = kSCNetworkInterfaceTypeWWAN;
+ interfacePrivate->sort_order = kSortWWAN;
} else {
interfacePrivate->interface_type = kSCNetworkInterfaceTypeModem;
+ interfacePrivate->sort_order = kSortModem;
}
} else {
// PPTP, L2TP, ...
}
if ((interfacePrivate != NULL) && (service != NULL)) {
- SCNetworkServicePrivateRef servicePrivate = (SCNetworkServicePrivateRef)service;
-
- if (interfacePrivate->prefs != NULL)
- CFRelease(interfacePrivate->prefs);
- if (interfacePrivate->serviceID != NULL)
- CFRelease(interfacePrivate->serviceID);
+ __SCNetworkInterfaceSetService((SCNetworkInterfaceRef)interfacePrivate,
+ service);
+#if !TARGET_OS_IPHONE
+ // set prefs & serviceID to VLANs and Bonds
+ if (CFEqual(interfacePrivate->interface_type, kSCNetworkInterfaceTypeBond)) {
+ CFIndex i;
+ CFArrayRef members;
+ CFIndex n;
+
+ members = SCBondInterfaceGetMemberInterfaces((SCNetworkInterfaceRef)interfacePrivate);
+ n = (members != NULL) ? CFArrayGetCount(members) : 0;
+ for (i = 0; i < n; i++) {
+ SCNetworkInterfaceRef member;
+
+ member = CFArrayGetValueAtIndex(members, i);
+ __SCNetworkInterfaceSetService(member, service);
+ }
+ } else if (CFEqual(interfacePrivate->interface_type, kSCNetworkInterfaceTypeVLAN)) {
+ SCNetworkInterfaceRef vlan_physical;
- interfacePrivate->prefs = CFRetain(servicePrivate->prefs);
- interfacePrivate->serviceID = CFRetain(servicePrivate->serviceID);
+ vlan_physical = SCVLANInterfaceGetPhysicalInterface((SCNetworkInterfaceRef)interfacePrivate);
+ if (vlan_physical != NULL) {
+ __SCNetworkInterfaceSetService(vlan_physical, service);
+ }
+ }
+#endif // !TARGET_OS_IPHONE
}
if (CFEqual(ifType, kSCValNetInterfaceTypePPP)) {
SCNetworkInterfaceRef parent;
+ // create parent
parent = SCNetworkInterfaceCreateWithInterface((SCNetworkInterfaceRef)interfacePrivate,
kSCNetworkInterfaceTypePPP);
CFRelease(interfacePrivate);
}
while (TRUE) {
+ CFArrayRef changedKeys;
CFDictionaryRef dict;
Boolean quiet = FALSE;
CFSTR("SCDynamicStoreNotifyWait() failed: %s"), SCErrorString(SCError()));
goto done;
}
+
+ changedKeys = SCDynamicStoreCopyNotifiedKeys(store);
+ if (changedKeys != NULL) {
+ CFRelease(changedKeys);
+ }
}
done :
{
CFMutableArrayRef all_interfaces;
CFArrayRef new_interfaces;
+#if !TARGET_OS_IPHONE
SCPreferencesRef prefs;
+#endif // !TARGET_OS_IPHONE
/* initialize runtime */
pthread_once(&initialized, __SCNetworkInterfaceInitialize);
CFRelease(new_interfaces);
}
+#if !TARGET_OS_IPHONE
// get virtual network interfaces (Bond, VLAN)
prefs = SCPreferencesCreate(NULL, CFSTR("SCNetworkInterfaceCopyAll"), NULL);
if (prefs != NULL) {
CFRelease(prefs);
}
+#endif // !TARGET_OS_IPHONE
// all interfaces have been identified, order and return
sort_interfaces(all_interfaces);
if (configurations[i].supported_interfaces & doPPTP) {
CFArrayAppendValue(interfacePrivate->supported_interface_types, kSCNetworkInterfaceTypePPTP);
}
+ if (configurations[i].supported_interfaces & doIPSec) {
+ CFArrayAppendValue(interfacePrivate->supported_interface_types, kSCNetworkInterfaceTypeIPSec);
+ }
}
}
if (i != kCFNotFound) {
if (configurations[i].supported_protocols != doNone) {
interfacePrivate->supported_protocol_types = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+#if !TARGET_OS_IPHONE
if (configurations[i].supported_protocols & doAppleTalk) {
CFArrayAppendValue(interfacePrivate->supported_protocol_types, kSCNetworkProtocolTypeAppleTalk);
}
+#endif // !TARGET_OS_IPHONE
if (configurations[i].supported_protocols & doDNS) {
CFArrayAppendValue(interfacePrivate->supported_protocol_types, kSCNetworkProtocolTypeDNS);
}
if (configurations[i].supported_protocols & doProxies) {
CFArrayAppendValue(interfacePrivate->supported_protocol_types, kSCNetworkProtocolTypeProxies);
}
+#if !TARGET_OS_IPHONE
if (configurations[i].supported_protocols & doSMB) {
CFArrayAppendValue(interfacePrivate->supported_protocol_types, kSCNetworkProtocolTypeSMB);
}
+#endif // !TARGET_OS_IPHONE
}
}
if (CFEqual(interfaceType, kSCNetworkInterfaceTypePPP)) {
parentPrivate->interface_type = kSCNetworkInterfaceTypePPP;
- parentPrivate->entity_type = kSCEntNetPPP;
+ parentPrivate->entity_type = kSCValNetInterfaceTypePPP;
// entity subtype
if (childIndex != kCFNotFound) {
if (childPrivate->entity_device != NULL) {
parentPrivate->entity_device = CFStringCreateCopy(NULL, childPrivate->entity_device);
}
+
+ if (childPrivate->entity_device_unique != NULL) {
+ parentPrivate->entity_device_unique = CFStringCreateCopy(NULL, childPrivate->entity_device_unique);
+ }
} else if (CFEqual(interfaceType, kSCNetworkInterfaceTypeL2TP)) {
if ((childIndex == kCFNotFound) ||
((configurations[childIndex].supported_interfaces & doL2TP) != doL2TP)) {
}
parentPrivate->interface_type = kSCNetworkInterfaceTypeL2TP;
parentPrivate->localized_key = CFSTR("l2tp");
- parentPrivate->entity_type = kSCValNetInterfaceSubTypeL2TP; // interface config goes into "L2TP"
+ parentPrivate->entity_type = kSCEntNetL2TP; // interface config goes into "L2TP"
} else if (CFEqual(interfaceType, kSCNetworkInterfaceTypePPTP)) {
if ((childIndex == kCFNotFound) ||
((configurations[childIndex].supported_interfaces & doPPTP) != doPPTP)) {
}
parentPrivate->interface_type = kSCNetworkInterfaceTypePPTP;
parentPrivate->localized_key = CFSTR("pptp");
- parentPrivate->entity_type = kSCValNetInterfaceSubTypePPTP; // interface config goes into "PPTP"
+ parentPrivate->entity_type = kSCEntNetPPTP; // interface config goes into "PPTP"
} else if (CFEqual(interfaceType, kSCNetworkInterfaceType6to4)) {
if ((childIndex == kCFNotFound) ||
((configurations[childIndex].supported_interfaces & do6to4) != do6to4)) {
parentPrivate->interface_type = kSCNetworkInterfaceType6to4;
parentPrivate->localized_key = CFSTR("6to4");
- parentPrivate->entity_type = kSCEntNet6to4;
+ parentPrivate->entity_type = kSCValNetInterfaceType6to4;
parentPrivate->entity_device = CFRetain(CFSTR("stf0"));
+ } else if (CFEqual(interfaceType, kSCNetworkInterfaceTypeIPSec)) {
+ if ((childIndex == kCFNotFound) ||
+ ((configurations[childIndex].supported_interfaces & doIPSec) != doIPSec)) {
+ // if the child interface does not support IPSec
+ goto fail;
+ }
+ parentPrivate->interface_type = kSCNetworkInterfaceTypeIPSec;
+ parentPrivate->localized_key = CFSTR("ipsec");
+ parentPrivate->entity_type = kSCValNetInterfaceTypeIPSec;
} else if (CFStringFind(interfaceType, CFSTR("."), 0).location != kCFNotFound) {
// if custom interface type
parentPrivate->interface_type = interfaceType;
if (childPrivate->overrides != NULL) {
parentPrivate->overrides = CFDictionaryCreateMutableCopy(NULL, 0, childPrivate->overrides);
- };
- parentPrivate->sort_order = childPrivate->sort_order;
+ }
+
+ // The following change handles the case where a user has both an Ethernet and
+ // PPPoE network service. Because a PPPoE service is typically associated with
+ // an ISP we want it to be sorted higher in the service order.
+ if ((parentPrivate->entity_subtype != NULL) &&
+ (CFEqual(parentPrivate->entity_subtype, kSCValNetInterfaceSubTypePPPoE))) {
+ if ((childPrivate->interface_type != NULL) &&
+ (CFEqual(childPrivate->interface_type, kSCNetworkInterfaceTypeIEEE80211))) {
+ parentPrivate->sort_order = kSortAirportPPP;
+ } else {
+ parentPrivate->sort_order = kSortEthernetPPP;
+ }
+ } else {
+ // set sort order of the parent to match the child interface
+ parentPrivate->sort_order = childPrivate->sort_order;
+ }
return (SCNetworkInterfaceRef)parentPrivate;
}
+__private_extern__
+CFDictionaryRef
+__SCNetworkInterfaceGetDefaultConfiguration(SCNetworkSetRef set, SCNetworkInterfaceRef interface)
+{
+ CFDictionaryRef config = NULL;
+ CFStringRef defaultType;
+ SCNetworkInterfacePrivateRef interfacePrivate = (SCNetworkInterfacePrivateRef)interface;
+
+ /* initialize runtime (and kSCNetworkInterfaceIPv4) */
+ pthread_once(&initialized, __SCNetworkInterfaceInitialize);
+
+ defaultType = __SCNetworkInterfaceGetDefaultConfigurationType(interface);
+ if (defaultType != NULL) {
+ if (set != NULL) {
+ CFStringRef path;
+
+ path = SCPreferencesPathKeyCreateSetNetworkInterfaceEntity(NULL, // allocator
+ SCNetworkSetGetSetID(set), // set
+ interfacePrivate->entity_device, // interface
+ defaultType); // entity
+ if (path != NULL) {
+ config = __getPrefsConfiguration(interfacePrivate->prefs, path);
+ CFRelease(path);
+
+ if (config == NULL) {
+ // if the "set" does not have a saved configuration, use
+ // the [template] "interface" configuration
+ if (interfacePrivate->unsaved != NULL) {
+ config = CFDictionaryGetValue(interfacePrivate->unsaved, defaultType);
+ if (config == (CFDictionaryRef)kCFNull) {
+ config = NULL;
+ }
+ }
+ }
+ if (isA_CFDictionary(config) && (CFDictionaryGetCount(config) == 0)) {
+ config = NULL;
+ }
+ }
+ }
+ }
+
+ return config;
+}
+
+
static CFDictionaryRef
__SCNetworkInterfaceGetConfiguration(SCNetworkInterfaceRef interface,
CFStringRef extendedType)
static CFStringRef
-copy_display_name(SCNetworkInterfaceRef interface, Boolean localized)
+copy_display_name(SCNetworkInterfaceRef interface, Boolean localized, Boolean oldLocalization)
{
CFMutableStringRef local;
CFStringRef name;
if ((bundle != NULL) && (interfacePrivate->localized_key != NULL)) {
CFStringRef fmt;
+ CFStringRef key = interfacePrivate->localized_key;
- fmt = copy_interface_string(bundle, interfacePrivate->localized_key, localized);
+ if (oldLocalization) {
+ key = CFStringCreateWithFormat(NULL, NULL, CFSTR("X-%@"),
+ interfacePrivate->localized_key);
+ }
+ fmt = copy_interface_string(bundle, key, localized);
if (fmt != NULL) {
CFStringAppendFormat(local,
NULL,
CFRelease(fmt);
added = TRUE;
}
+ if (oldLocalization) {
+ CFRelease(key);
+ }
}
if (!added &&
__private_extern__
CFStringRef
-__SCNetworkInterfaceGetNonLocalizedDisplayName(SCNetworkInterfaceRef interface)
+__SCNetworkInterfaceCopyXLocalizedDisplayName(SCNetworkInterfaceRef interface)
{
- SCNetworkInterfacePrivateRef interfacePrivate = (SCNetworkInterfacePrivateRef)interface;
+ CFStringRef name;
if (!isA_SCNetworkInterface(interface)) {
_SCErrorSet(kSCStatusInvalidArgument);
return NULL;
}
- if (interfacePrivate->name == NULL) {
- interfacePrivate->name = copy_display_name(interface, FALSE);
- }
-
- return interfacePrivate->name;
+ name = copy_display_name(interface, TRUE, TRUE);
+ return name;
+}
+
+
+__private_extern__
+CFStringRef
+__SCNetworkInterfaceCopyXNonLocalizedDisplayName(SCNetworkInterfaceRef interface)
+{
+ CFStringRef localized_name;
+
+ if (!isA_SCNetworkInterface(interface)) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return NULL;
+ }
+
+ localized_name = copy_display_name(interface, FALSE, TRUE);
+ return localized_name;
+}
+
+
+__private_extern__
+CFStringRef
+__SCNetworkInterfaceGetNonLocalizedDisplayName(SCNetworkInterfaceRef interface)
+{
+ SCNetworkInterfacePrivateRef interfacePrivate = (SCNetworkInterfacePrivateRef)interface;
+
+ if (!isA_SCNetworkInterface(interface)) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return NULL;
+ }
+
+ if (interfacePrivate->name == NULL) {
+ interfacePrivate->name = copy_display_name(interface, FALSE, FALSE);
+ }
+
+ return interfacePrivate->name;
}
}
if (interfacePrivate->localized_name == NULL) {
- interfacePrivate->localized_name = copy_display_name(interface, TRUE);
+ interfacePrivate->localized_name = copy_display_name(interface, TRUE, FALSE);
}
return interfacePrivate->localized_name;
}
+__private_extern__
+Boolean
+__SCNetworkInterfaceSetDefaultConfiguration(SCNetworkSetRef set,
+ SCNetworkInterfaceRef interface,
+ CFStringRef defaultType,
+ CFDictionaryRef config,
+ Boolean okToHold)
+{
+ SCNetworkInterfacePrivateRef interfacePrivate = (SCNetworkInterfacePrivateRef)interface;
+ Boolean ok = FALSE;
+
+ /* initialize runtime (and kSCNetworkInterfaceIPv4) */
+ pthread_once(&initialized, __SCNetworkInterfaceInitialize);
+
+ if (defaultType == NULL) {
+ defaultType = __SCNetworkInterfaceGetDefaultConfigurationType(interface);
+ if (defaultType == NULL) {
+ return FALSE;
+ }
+ }
+
+ if (isA_CFDictionary(config) && (CFDictionaryGetCount(config) == 0)) {
+ config = NULL;
+ }
+
+ if (set != NULL) {
+ CFStringRef path;
+
+ path = SCPreferencesPathKeyCreateSetNetworkInterfaceEntity(NULL, // allocator
+ SCNetworkSetGetSetID(set), // set
+ interfacePrivate->entity_device, // interface
+ defaultType); // entity
+ if (path != NULL) {
+ ok = __setPrefsConfiguration(interfacePrivate->prefs, path, config, FALSE);
+ CFRelease(path);
+ if (ok) {
+ // if configuration has been saved
+ if (interfacePrivate->unsaved != NULL) {
+ CFDictionaryRemoveValue(interfacePrivate->unsaved, defaultType);
+ if (CFDictionaryGetCount(interfacePrivate->unsaved) == 0) {
+ CFRelease(interfacePrivate->unsaved);
+ interfacePrivate->unsaved = NULL;
+ }
+ }
+ }
+ } else {
+ if (okToHold) {
+ if (config == NULL) {
+ // remember that we are clearing the configuration
+ config = (CFDictionaryRef)kCFNull;
+ }
+
+ if (interfacePrivate->unsaved == NULL) {
+ interfacePrivate->unsaved = CFDictionaryCreateMutable(NULL,
+ 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ }
+ CFDictionarySetValue(interfacePrivate->unsaved, defaultType, config);
+ ok = TRUE;
+ } else {
+ _SCErrorSet(kSCStatusNoKey);
+ }
+ }
+ }
+
+ return ok;
+}
+
+
__private_extern__
Boolean
__SCNetworkInterfaceSetConfiguration(SCNetworkInterfaceRef interface,
static CFStringRef
copySharedSecretID(CFDictionaryRef config, CFStringRef serviceID)
{
- CFMutableStringRef sharedSecret = NULL;
+ CFMutableStringRef shared_id = NULL;
if (config != NULL) {
CFStringRef encryption;
encryption = CFDictionaryGetValue(config, kSCPropNetIPSecSharedSecretEncryption);
if (isA_CFString(encryption) &&
CFEqual(encryption, kSCValNetIPSecSharedSecretEncryptionKeychain)) {
- sharedSecret = (CFMutableStringRef)CFDictionaryGetValue(config, kSCPropNetIPSecSharedSecret);
- if (sharedSecret != NULL) {
- CFRetain(sharedSecret);
+ shared_id = (CFMutableStringRef)CFDictionaryGetValue(config, kSCPropNetIPSecSharedSecret);
+ if (shared_id != NULL) {
+ CFRetain(shared_id);
+ }
+ }
+ }
+
+ if (shared_id == NULL) {
+ CFStringRef unique_id;
+
+ unique_id = getPasswordID(config, serviceID);
+ shared_id = CFStringCreateMutableCopy(NULL, 0, unique_id);
+ CFStringAppend(shared_id, CFSTR(".SS"));
+ }
+
+ return shared_id;
+}
+
+
+static CFStringRef
+copyXAuthID(CFDictionaryRef config, CFStringRef serviceID)
+{
+ CFMutableStringRef xauth_id = NULL;
+
+ if (config != NULL) {
+ CFStringRef encryption;
+
+ encryption = CFDictionaryGetValue(config, kSCPropNetIPSecXAuthPasswordEncryption);
+ if (isA_CFString(encryption) &&
+ CFEqual(encryption, kSCValNetIPSecXAuthPasswordEncryptionKeychain)) {
+ xauth_id = (CFMutableStringRef)CFDictionaryGetValue(config, kSCPropNetIPSecXAuthPassword);
+ if (xauth_id != NULL) {
+ CFRetain(xauth_id);
}
}
}
- if (sharedSecret == NULL) {
+ if (xauth_id == NULL) {
CFStringRef unique_id;
unique_id = getPasswordID(config, serviceID);
- sharedSecret = CFStringCreateMutableCopy(NULL, 0, unique_id);
- CFStringAppend(sharedSecret, CFSTR(".SS"));
+ xauth_id = CFStringCreateMutableCopy(NULL, 0, unique_id);
+ CFStringAppend(xauth_id, CFSTR(".XAUTH"));
}
- return sharedSecret;
+ return xauth_id;
}
SCNetworkInterfacePrivateRef interfacePrivate = (SCNetworkInterfacePrivateRef)interface;
if (!isA_SCNetworkInterface(interface)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
+ goto error;
}
*serviceID = interfacePrivate->serviceID;
if (*serviceID == NULL) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
+ goto error;
}
*prefs = interfacePrivate->prefs;
if (*prefs == NULL) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
+ goto error;
}
switch (passwordType) {
CFStringRef interfaceType;
interfaceType = SCNetworkInterfaceGetInterfaceType(interface);
- if (!CFEqual(interfaceType, kSCNetworkInterfaceTypePPP)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
+ if (CFEqual(interfaceType, kSCNetworkInterfaceTypePPP)) {
+ // if PPP
+ break;
}
- break;
+
+ goto error;
}
case kSCNetworkInterfacePasswordTypeIPSecSharedSecret : {
- CFStringRef interfaceType;
+ CFStringRef interfaceType;
interfaceType = SCNetworkInterfaceGetInterfaceType(interface);
- if (!CFEqual(interfaceType, kSCNetworkInterfaceTypePPP)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- interface = SCNetworkInterfaceGetInterface(interface);
- if (interface == NULL) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
+ if (CFEqual(interfaceType, kSCNetworkInterfaceTypePPP)) {
+ interface = SCNetworkInterfaceGetInterface(interface);
+ if (interface != NULL) {
+ interfaceType = SCNetworkInterfaceGetInterfaceType(interface);
+ if (CFEqual(interfaceType, kSCNetworkInterfaceTypeL2TP)) {
+ // if PPP->L2TP interface
+ break;
+ }
+ }
+ } else if (CFEqual(interfaceType, kSCNetworkInterfaceTypeIPSec)) {
+ // if IPSec interface
+ break;
}
- interfaceType = SCNetworkInterfaceGetInterfaceType(interface);
- if (!CFEqual(interfaceType, kSCNetworkInterfaceTypeL2TP)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
- break;
+ goto error;
}
case kSCNetworkInterfacePasswordTypeEAPOL : {
break;
}
+ case kSCNetworkInterfacePasswordTypeIPSecXAuth : {
+ CFStringRef interfaceType;
+
+ interfaceType = SCNetworkInterfaceGetInterfaceType(interface);
+ if (CFEqual(interfaceType, kSCNetworkInterfaceTypeIPSec)) {
+ // if IPSec interface
+ break;
+ }
+
+ goto error;
+ }
+
default :
break;
}
return TRUE;
+
+ error :
+
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return FALSE;
}
case kSCNetworkInterfacePasswordTypeIPSecSharedSecret : {
CFDictionaryRef config;
+ Boolean extended;
CFStringRef shared_id;
// get configuration
- config = SCNetworkInterfaceGetExtendedConfiguration(interface, kSCEntNetIPSec);
+ extended = CFEqual(SCNetworkInterfaceGetInterfaceType(interface), kSCNetworkInterfaceTypePPP);
+ if (extended) {
+ config = SCNetworkInterfaceGetExtendedConfiguration(interface, kSCEntNetIPSec);
+ } else {
+ config = SCNetworkInterfaceGetConfiguration(interface);
+ }
// get sharedSecret ID
shared_id = copySharedSecretID(config, serviceID);
break;
}
+ case kSCNetworkInterfacePasswordTypeIPSecXAuth : {
+ CFDictionaryRef config;
+ CFStringRef xauth_id;
+
+ // get configuration
+ config = SCNetworkInterfaceGetConfiguration(interface);
+
+ // get XAuth ID
+ xauth_id = copyXAuthID(config, serviceID);
+
+ // check
+ exists = __extract_password(prefs,
+ config,
+ kSCPropNetIPSecXAuthPassword,
+ kSCPropNetIPSecXAuthPasswordEncryption,
+ kSCValNetIPSecXAuthPasswordEncryptionKeychain,
+ xauth_id,
+ NULL);
+ CFRelease(xauth_id);
+ break;
+ }
+
default :
_SCErrorSet(kSCStatusInvalidArgument);
return FALSE;
case kSCNetworkInterfacePasswordTypeIPSecSharedSecret : {
CFDictionaryRef config;
+ Boolean extended;
CFStringRef shared_id;
// get configuration
- config = SCNetworkInterfaceGetExtendedConfiguration(interface, kSCEntNetIPSec);
+ extended = CFEqual(SCNetworkInterfaceGetInterfaceType(interface), kSCNetworkInterfaceTypePPP);
+ if (extended) {
+ config = SCNetworkInterfaceGetExtendedConfiguration(interface, kSCEntNetIPSec);
+ } else {
+ config = SCNetworkInterfaceGetConfiguration(interface);
+ }
// get sharedSecret ID
shared_id = copySharedSecretID(config, serviceID);
break;
}
+ case kSCNetworkInterfacePasswordTypeIPSecXAuth : {
+ CFDictionaryRef config;
+ CFStringRef xauth_id;
+
+ // get configuration
+ config = SCNetworkInterfaceGetConfiguration(interface);
+
+ // get XAuth ID
+ xauth_id = copyXAuthID(config, serviceID);
+
+ // extract
+ (void) __extract_password(prefs,
+ config,
+ kSCPropNetIPSecXAuthPassword,
+ kSCPropNetIPSecXAuthPasswordEncryption,
+ kSCValNetIPSecXAuthPasswordEncryptionKeychain,
+ xauth_id,
+ &password);
+ CFRelease(xauth_id);
+ break;
+ }
+
default :
_SCErrorSet(kSCStatusInvalidArgument);
return NULL;
switch (passwordType) {
case kSCNetworkInterfacePasswordTypePPP : {
CFDictionaryRef config;
+ CFDictionaryRef newConfig = NULL;
CFStringRef unique_id;
// get configuration
unique_id = getPasswordID(config, serviceID);
// remove password
- ok = _SCPreferencesSystemKeychainPasswordItemRemove(prefs, unique_id);
+ ok = __remove_password(prefs,
+ config,
+ kSCPropNetPPPAuthPassword,
+ kSCPropNetPPPAuthPasswordEncryption,
+ kSCValNetPPPAuthPasswordEncryptionKeychain,
+ unique_id,
+ &newConfig);
if (ok) {
- CFMutableDictionaryRef newConfig;
-
- if (config != NULL) {
- newConfig = CFDictionaryCreateMutableCopy(NULL, 0, config);
- CFDictionaryRemoveValue(newConfig, kSCPropNetPPPAuthPassword);
- CFDictionaryRemoveValue(newConfig, kSCPropNetPPPAuthPasswordEncryption);
- ok = SCNetworkInterfaceSetConfiguration(interface, newConfig);
- CFRelease(newConfig);
- }
+ ok = SCNetworkInterfaceSetConfiguration(interface, newConfig);
+ if (newConfig != NULL) CFRelease(newConfig);
}
+
break;
}
case kSCNetworkInterfacePasswordTypeIPSecSharedSecret : {
CFDictionaryRef config;
+ Boolean extended;
+ CFDictionaryRef newConfig = NULL;
CFStringRef shared_id;
// get configuration
- config = SCNetworkInterfaceGetExtendedConfiguration(interface, kSCEntNetIPSec);
+ extended = CFEqual(SCNetworkInterfaceGetInterfaceType(interface), kSCNetworkInterfaceTypePPP);
+ if (extended) {
+ config = SCNetworkInterfaceGetExtendedConfiguration(interface, kSCEntNetIPSec);
+ } else {
+ config = SCNetworkInterfaceGetConfiguration(interface);
+ }
// get sharedSecret ID
shared_id = copySharedSecretID(config, serviceID);
// remove password
- ok = _SCPreferencesSystemKeychainPasswordItemRemove(prefs, shared_id);
+ ok = __remove_password(prefs,
+ config,
+ kSCPropNetIPSecSharedSecret,
+ kSCPropNetIPSecSharedSecretEncryption,
+ kSCValNetIPSecSharedSecretEncryptionKeychain,
+ shared_id,
+ &newConfig);
if (ok) {
- CFMutableDictionaryRef newConfig;
-
- if (config != NULL) {
- newConfig = CFDictionaryCreateMutableCopy(NULL, 0, config);
- CFDictionaryRemoveValue(newConfig, kSCPropNetIPSecSharedSecret);
- CFDictionaryRemoveValue(newConfig, kSCPropNetIPSecSharedSecretEncryption);
+ if (extended) {
ok = SCNetworkInterfaceSetExtendedConfiguration(interface,
kSCEntNetIPSec,
newConfig);
- CFRelease(newConfig);
+ } else {
+ ok = SCNetworkInterfaceSetConfiguration(interface,
+ newConfig);
}
+ if (newConfig != NULL) CFRelease(newConfig);
}
CFRelease(shared_id);
break;
}
+ case kSCNetworkInterfacePasswordTypeIPSecXAuth : {
+ CFDictionaryRef config;
+ CFDictionaryRef newConfig = NULL;
+ CFStringRef xauth_id;
+
+ // get configuration
+ config = SCNetworkInterfaceGetConfiguration(interface);
+
+ // get XAuth ID
+ xauth_id = copyXAuthID(config, serviceID);
+
+ // remove password
+ ok = __remove_password(prefs,
+ config,
+ kSCPropNetIPSecXAuthPassword,
+ kSCPropNetIPSecXAuthPasswordEncryption,
+ kSCValNetIPSecXAuthPasswordEncryptionKeychain,
+ xauth_id,
+ &newConfig);
+ if (ok) {
+ ok = SCNetworkInterfaceSetConfiguration(interface, newConfig);
+ if (newConfig != NULL) CFRelease(newConfig);
+ }
+
+ CFRelease(xauth_id);
+ break;
+ }
+
default :
_SCErrorSet(kSCStatusInvalidArgument);
return FALSE;
if (bundle != NULL) {
// "PPP Password" --> keychain "Kind"
description = CFBundleCopyLocalizedString(bundle,
- CFSTR("KEYCHAIN_PPP_PASSWORD"),
+ CFSTR("KEYCHAIN_KIND_PPP_PASSWORD"),
CFSTR("PPP Password"),
NULL);
}
// store password
ok = _SCPreferencesSystemKeychainPasswordItemSet(prefs,
unique_id,
- (label != NULL) ? label : CFSTR("PPP"),
+ (label != NULL) ? label : CFSTR("Network Connection"),
(description != NULL) ? description : CFSTR("PPP Password"),
account,
password,
}
case kSCNetworkInterfacePasswordTypeIPSecSharedSecret : {
- SCNetworkServiceRef service = NULL;
+ CFDictionaryRef baseConfig = NULL;
+ Boolean extended;
+ SCNetworkServiceRef service = NULL;
CFStringRef shared_id;
// get configuration
- config = SCNetworkInterfaceGetExtendedConfiguration(interface, kSCEntNetIPSec);
+ extended = CFEqual(SCNetworkInterfaceGetInterfaceType(interface), kSCNetworkInterfaceTypePPP);
+ config = SCNetworkInterfaceGetConfiguration(interface);
+ if (extended) {
+ baseConfig = config;
+ config = SCNetworkInterfaceGetExtendedConfiguration(interface, kSCEntNetIPSec);
+ }
// get sharedSecret ID
shared_id = copySharedSecretID(config, serviceID);
- // get "Name", "Kind"
+ // get "Account", "Name", "Kind"
if (config != NULL) {
+ CFStringRef localIdentifier;
+ CFStringRef localIdentifierType;
+
+ if (CFDictionaryGetValueIfPresent(config,
+ kSCPropNetIPSecLocalIdentifierType,
+ (const void **)&localIdentifierType)
+ && CFEqual(localIdentifierType, kSCValNetIPSecLocalIdentifierTypeKeyID)
+ && CFDictionaryGetValueIfPresent(config,
+ kSCPropNetIPSecLocalIdentifier,
+ (const void **)&localIdentifier)
+ && isA_CFString(localIdentifier)) {
+ // local identifier --> keychain "Account"
+ account = localIdentifier;
+ }
+
// PPP [user defined] "name" --> keychain "Name"
- label = CFDictionaryGetValue(config, kSCPropUserDefinedName);
+ if (!extended) {
+ label = CFDictionaryGetValue(config, kSCPropUserDefinedName);
+ } else {
+ if (baseConfig != NULL) {
+ label = CFDictionaryGetValue(baseConfig, kSCPropUserDefinedName);
+ }
+ }
}
if (label == NULL) {
if (bundle != NULL) {
// "IPSec Shared Secret" --> keychain "Kind"
description = CFBundleCopyLocalizedString(bundle,
- CFSTR("KEYCHAIN_IPSEC_SHARED_SECRET"),
+ CFSTR("KEYCHAIN_KIND_IPSEC_SHARED_SECRET"),
CFSTR("IPSec Shared Secret"),
NULL);
}
// set password
ok = _SCPreferencesSystemKeychainPasswordItemSet(prefs,
shared_id,
- (label != NULL) ? label : CFSTR("PPP"),
+ (label != NULL) ? label : CFSTR("VPN Connection"),
(description != NULL) ? description : CFSTR("IPSec Shared Secret"),
- NULL,
+ account,
password,
options);
if (ok) {
CFDictionarySetValue(newConfig,
kSCPropNetIPSecSharedSecretEncryption,
kSCValNetIPSecSharedSecretEncryptionKeychain);
- ok = SCNetworkInterfaceSetExtendedConfiguration(interface,
- kSCEntNetIPSec,
- newConfig);
+ if (extended) {
+ ok = SCNetworkInterfaceSetExtendedConfiguration(interface,
+ kSCEntNetIPSec,
+ newConfig);
+ } else {
+ ok = SCNetworkInterfaceSetConfiguration(interface, newConfig);
+ }
CFRelease(newConfig);
}
}
case kSCNetworkInterfacePasswordTypeEAPOL : {
+ CFStringRef account = NULL;
CFStringRef unique_id = NULL;
// get configuration
CFRelease(uuid);
}
+ // 802.1x UserName --> keychain "Account"
+ if (config != NULL) {
+ account = CFDictionaryGetValue(config, kEAPClientPropUserName);
+ }
+
// get "Name", "Kind"
if (bundle != NULL) {
- // "802.1X Password" --> keychain "Name"
- label = CFBundleCopyLocalizedString(bundle,
- CFSTR("KEYCHAIN_EAPOL_PASSWORD"),
- CFSTR("802.1X Password"),
- NULL);
- // "Internet Connect" --> keychain "Kind"
+ CFStringRef interface_name;
+
+ // "Network Connection (%@)" --> keychain "Name"
+ interface_name = SCNetworkInterfaceGetLocalizedDisplayName(interface);
+ if (interface_name != NULL) {
+ CFStringRef label_fmt;
+
+ label_fmt = CFBundleCopyLocalizedString(bundle,
+ CFSTR("KEYCHAIN_DESCRIPTION_EAPOL_INTERFACE"),
+ CFSTR("Network Connection (%@)"),
+ NULL);
+ label = CFStringCreateWithFormat(NULL, NULL, label_fmt, interface_name);
+ CFRelease(label_fmt);
+ } else {
+ label = CFBundleCopyLocalizedString(bundle,
+ CFSTR("KEYCHAIN_DESCRIPTION_EAPOL"),
+ CFSTR("Network Connection"),
+ NULL);
+ }
+
+ // "802.1X Password" --> keychain "Kind"
description = CFBundleCopyLocalizedString(bundle,
- CFSTR("KEYCHAIN_INTERNET_CONNECT"),
- CFSTR("Internet Connect"),
+ CFSTR("KEYCHAIN_KIND_EAPOL"),
+ CFSTR("802.1X Password"),
NULL);
}
// set password
ok = _SCPreferencesSystemKeychainPasswordItemSet(prefs,
unique_id,
- (label != NULL) ? label : CFSTR("802.1X Password"),
- (description != NULL) ? description : CFSTR("Internet Connect"),
- NULL,
+ (label != NULL) ? label : CFSTR("Network Connection"),
+ (description != NULL) ? description : CFSTR("802.1X Password"),
+ account,
password,
options);
if (ok) {
break;
}
+ case kSCNetworkInterfacePasswordTypeIPSecXAuth : {
+ SCNetworkServiceRef service = NULL;
+ CFStringRef xauth_id;
+
+ // get configuration
+ config = SCNetworkInterfaceGetConfiguration(interface);
+
+ // get XAuth ID
+ xauth_id = copyXAuthID(config, serviceID);
+
+ // get "Account", "Name", "Kind"
+ if (config != NULL) {
+ // auth name --> keychain "Account"
+ account = CFDictionaryGetValue(config, kSCPropNetIPSecXAuthName);
+
+ // IPSec [user defined] "name" --> keychain "Name"
+ label = CFDictionaryGetValue(config, kSCPropUserDefinedName);
+ }
+
+ if (label == NULL) {
+ // service name --> keychain "Name"
+ service = (SCNetworkServiceRef)__SCNetworkServiceCreatePrivate(NULL,
+ prefs,
+ serviceID,
+ interface);
+
+ label = SCNetworkServiceGetName(service);
+ if (label == NULL) {
+ // interface name --> keychain "Name"
+ label = SCNetworkInterfaceGetLocalizedDisplayName(interface);
+ }
+ }
+
+ if (bundle != NULL) {
+ // "IPSec XAuth Password" --> keychain "Kind"
+ description = CFBundleCopyLocalizedString(bundle,
+ CFSTR("KEYCHAIN_KIND_IPSEC_XAUTH_PASSWORD"),
+ CFSTR("IPSec XAuth Password"),
+ NULL);
+ }
+
+ // store password
+ ok = _SCPreferencesSystemKeychainPasswordItemSet(prefs,
+ xauth_id,
+ (label != NULL) ? label : CFSTR("VPN Connection"),
+ (description != NULL) ? description : CFSTR("IPSec XAuth Password"),
+ account,
+ password,
+ options);
+ if (ok) {
+ CFMutableDictionaryRef newConfig;
+
+ if (config != NULL) {
+ newConfig = CFDictionaryCreateMutableCopy(NULL, 0, config);
+ } else {
+ newConfig = CFDictionaryCreateMutable(NULL,
+ 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ }
+ CFDictionarySetValue(newConfig,
+ kSCPropNetIPSecXAuthPassword,
+ xauth_id);
+ CFDictionarySetValue(newConfig,
+ kSCPropNetIPSecXAuthPasswordEncryption,
+ kSCValNetIPSecXAuthPasswordEncryptionKeychain);
+ ok = SCNetworkInterfaceSetConfiguration(interface, newConfig);
+ CFRelease(newConfig);
+ }
+
+ CFRelease(xauth_id);
+ if (description != NULL) CFRelease(description);
+ if (service != NULL) CFRelease(service);
+ break;
+ }
+
default :
_SCErrorSet(kSCStatusInvalidArgument);
break;
SCNetworkInterfaceRef
_SCNetworkInterfaceCreateWithIONetworkInterfaceObject(io_object_t if_obj)
{
- SCNetworkInterfaceRef interface;
+ SCNetworkInterfaceRef interface = NULL;
/* initialize runtime */
pthread_once(&initialized, __SCNetworkInterfaceInitialize);
- interface = createInterface(if_obj, processNetworkInterface);
+ if (IOObjectConformsTo(if_obj, kIONetworkInterfaceClass)) {
+ interface = createInterface(if_obj, processNetworkInterface);
+ } else if (IOObjectConformsTo(if_obj, kIOSerialBSDServiceValue)) {
+ interface = createInterface(if_obj, processSerialInterface);
+ }
+
return interface;
}
+CFStringRef
+_SCNetworkInterfaceGetConfigurationAction(SCNetworkInterfaceRef interface)
+{
+ SCNetworkInterfacePrivateRef interfacePrivate = (SCNetworkInterfacePrivateRef)interface;
+
+ return interfacePrivate->configurationAction;
+}
+
+
CFDataRef
_SCNetworkInterfaceGetHardwareAddress(SCNetworkInterfaceRef interface)
{
#pragma mark -
#pragma mark SCNetworkInterface SPIs
+
+CFStringRef
+_SCNetworkInterfaceCopySlashDevPath(SCNetworkInterfaceRef interface)
+{
+ io_registry_entry_t device;
+ io_iterator_t device_iterator = MACH_PORT_NULL;
+ CFStringRef device_path = NULL;
+ SCNetworkInterfacePrivateRef interfacePrivate = (SCNetworkInterfacePrivateRef)interface;
+ kern_return_t kr;
+ CFStringRef match_keys[2];
+ CFTypeRef match_vals[2];
+ CFDictionaryRef match_dict;
+ CFDictionaryRef matching;
+
+ if (interfacePrivate->entity_device == NULL) {
+ return NULL;
+ }
+
+ if (interfacePrivate->entity_device_unique == NULL) {
+ goto done;
+ }
+
+ match_keys[0] = CFSTR(kIOTTYBaseNameKey);
+ match_vals[0] = interfacePrivate->entity_device;
+ match_dict = CFDictionaryCreate(NULL,
+ (const void **)match_keys,
+ (const void **)match_vals,
+ 1,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+
+ match_keys[0] = CFSTR(kIOProviderClassKey);
+ match_vals[0] = CFSTR(kIOSerialBSDServiceValue);
+ match_keys[1] = CFSTR(kIOPropertyMatchKey);
+ match_vals[1] = match_dict;
+ matching = CFDictionaryCreate(NULL,
+ (const void **)match_keys,
+ (const void **)match_vals,
+ sizeof(match_keys)/sizeof(match_keys[0]),
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ CFRelease(match_dict);
+
+ // note: this "matching" dictionary will be consumed by the call to IOServiceGetMatchingServices
+ kr = IOServiceGetMatchingServices(masterPort, matching, &device_iterator);
+ if (kr != kIOReturnSuccess) {
+ SCLog(TRUE, LOG_DEBUG, CFSTR("IOServiceGetMatchingServices() failed, kr = 0x%x"), kr);
+ goto done;
+ }
+
+ while ((device_path == NULL) &&
+ ((device = IOIteratorNext(device_iterator)) != MACH_PORT_NULL)) {
+ CFDictionaryRef overrides;
+
+ overrides = IORegistryEntrySearchCFProperty(device,
+ kIOServicePlane,
+ CFSTR("DeviceModemOverrides"),
+ NULL,
+ kIORegistryIterateRecursively | kIORegistryIterateParents);
+ if (overrides != NULL) {
+ if (isA_CFDictionary(overrides)) {
+ CFStringRef matchIdentifier;
+
+ matchIdentifier = CFDictionaryGetValue(overrides, CFSTR("UniqueIdentifier"));
+ if (isA_CFString(matchIdentifier) &&
+ CFEqual(interfacePrivate->entity_device_unique, matchIdentifier)) {
+ device_path = IORegistryEntryCreateCFProperty(device,
+ CFSTR(kIOTTYDeviceKey),
+ NULL,
+ 0);
+ }
+ }
+ CFRelease(overrides);
+ }
+ IOObjectRelease(device);
+ }
+
+ IOObjectRelease(device_iterator);
+
+ done :
+
+ if (device_path == NULL) {
+ // if we haven't found an exact match to our UniqueIdentifier
+ // so we simply return the base name.
+ device_path = SCNetworkInterfaceGetBSDName(interface);
+ if (device_path != NULL) {
+ CFRetain(device_path);
+ }
+ }
+
+ return device_path;
+}
+
+
+Boolean
+_SCNetworkInterfaceIsBluetoothPAN(SCNetworkInterfaceRef interface)
+{
+ SCNetworkInterfacePrivateRef interfacePrivate = (SCNetworkInterfacePrivateRef)interface;
+
+ return (interfacePrivate->sort_order == kSortBluetoothPAN);
+}
+
+
Boolean
_SCNetworkInterfaceIsModemV92(SCNetworkInterfaceRef interface)
{
}
+Boolean
+_SCNetworkInterfaceIsTethered(SCNetworkInterfaceRef interface)
+{
+ SCNetworkInterfacePrivateRef interfacePrivate = (SCNetworkInterfacePrivateRef)interface;
+
+ return (interfacePrivate->sort_order == kSortTethered);
+}
+
+
#pragma mark -
#pragma mark SCNetworkInterface [internal] SPIs
/* initialize runtime (and kSCNetworkInterfaceIPv4) */
pthread_once(&initialized, __SCNetworkInterfaceInitialize);
+ if (interface == kSCNetworkInterfaceIPv4) {
+ return (SCNetworkInterfacePrivateRef)CFRetain(interface);
+ }
+
newPrivate = __SCNetworkInterfaceCreatePrivate(NULL, NULL, prefs, serviceID, NULL);
newPrivate->interface_type = oldPrivate->interface_type;
if (oldPrivate->interface != NULL) {
if (oldPrivate->entity_device != NULL) {
newPrivate->entity_device = CFRetain(oldPrivate->entity_device);
}
+ if (oldPrivate->entity_device_unique != NULL) {
+ newPrivate->entity_device_unique = CFRetain(oldPrivate->entity_device_unique);
+ }
newPrivate->entity_type = oldPrivate->entity_type;
newPrivate->entity_subtype = oldPrivate->entity_subtype;
if (oldPrivate->supported_interface_types != NULL) {
newPrivate->address = CFRetain(oldPrivate->address);
}
newPrivate->builtin = oldPrivate->builtin;
+ if (oldPrivate->configurationAction != NULL) {
+ newPrivate->configurationAction = CFRetain(oldPrivate->configurationAction);
+ }
if (oldPrivate->location != NULL) {
newPrivate->location = CFRetain(oldPrivate->location);
}
newPrivate->overrides = CFDictionaryCreateMutableCopy(NULL, 0, oldPrivate->overrides);
}
newPrivate->modemIsV92 = oldPrivate->modemIsV92;
- newPrivate->supportsBond = oldPrivate->supportsBond;
- newPrivate->supportsVLAN = oldPrivate->supportsVLAN;
if (oldPrivate->type != NULL) {
newPrivate->type = CFRetain(oldPrivate->type);
}
newPrivate->unit = CFRetain(oldPrivate->unit);
}
newPrivate->sort_order = oldPrivate->sort_order;
+#if !TARGET_OS_IPHONE
+ newPrivate->supportsBond = oldPrivate->supportsBond;
if (oldPrivate->bond.interfaces != NULL) {
newPrivate->bond.interfaces = CFRetain(oldPrivate->bond.interfaces);
}
if (oldPrivate->bond.options != NULL) {
newPrivate->bond.options = CFRetain(oldPrivate->bond.options);
}
+ newPrivate->supportsVLAN = oldPrivate->supportsVLAN;
if (oldPrivate->vlan.interface != NULL) {
newPrivate->vlan.interface = CFRetain(oldPrivate->vlan.interface);
}
if (oldPrivate->vlan.options != NULL) {
newPrivate->vlan.options = CFRetain(oldPrivate->vlan.options);
}
+#endif // !TARGET_OS_IPHONE
return newPrivate;
}
__private_extern__
CFArrayRef
-__SCNetworkInterfaceCopyDeepConfiguration(SCNetworkInterfaceRef interface)
+__SCNetworkInterfaceCopyDeepConfiguration(SCNetworkSetRef set, SCNetworkInterfaceRef interface)
{
CFMutableArrayRef configs;
CFDictionaryRef config;
CFArrayRef extendedTypes;
- config = __SCNetworkInterfaceGetConfiguration(interface, defaultType);
+ if (set == NULL) {
+ config = __SCNetworkInterfaceGetConfiguration(interface, defaultType);
+ } else {
+ config = __SCNetworkInterfaceGetDefaultConfiguration(set, interface);
+ }
if (config == NULL) {
config = (CFDictionaryRef)kCFNull;
}
__private_extern__
void
-__SCNetworkInterfaceSetDeepConfiguration(SCNetworkInterfaceRef interface, CFArrayRef configs)
+__SCNetworkInterfaceSetDeepConfiguration(SCNetworkSetRef set, SCNetworkInterfaceRef interface, CFArrayRef configs)
{
- CFIndex i;
+ CFIndex i;
for (i = 0; interface != NULL; i++) {
CFStringRef defaultType;
if (config == (CFDictionaryRef)kCFNull) {
config = NULL;
}
- if (!__SCNetworkInterfaceSetConfiguration(interface, defaultType, config, TRUE)) {
- SCLog(TRUE, LOG_DEBUG,
- CFSTR("__SCNetworkInterfaceSetDeepConfiguration __SCNetworkInterfaceSetConfiguration() failed, interface=%@, type=%@"),
- interface,
- defaultType);
+ if (set == NULL) {
+ // if service is not associated with the set
+ if (!__SCNetworkInterfaceSetConfiguration(interface, defaultType, config, TRUE)) {
+ SCLog(TRUE, LOG_DEBUG,
+ CFSTR("__SCNetworkInterfaceSetDeepConfiguration __SCNetworkInterfaceSetConfiguration() failed, interface=%@, type=%@"),
+ interface,
+ defaultType);
+ }
+ } else {
+ // apply default configuration to this set
+ if (!__SCNetworkInterfaceSetDefaultConfiguration(set, interface, defaultType, config, TRUE)) {
+ SCLog(TRUE, LOG_DEBUG,
+ CFSTR("__SCNetworkInterfaceSetDeepConfiguration __SCNetworkInterfaceSetDefaultConfiguration() failed, interface=%@, type=%@"),
+ interface,
+ defaultType);
+ }
}
extendedTypes = extendedConfigurationTypes(interface);
/*
- * Copyright (c) 2004-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2004-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
static CFHashCode __SCNetworkProtocolHash (CFTypeRef cf);
+#if !TARGET_OS_IPHONE
const CFStringRef kSCNetworkProtocolTypeAppleTalk = CFSTR("AppleTalk");
+#endif // !TARGET_OS_IPHONE
const CFStringRef kSCNetworkProtocolTypeDNS = CFSTR("DNS");
const CFStringRef kSCNetworkProtocolTypeIPv4 = CFSTR("IPv4");
const CFStringRef kSCNetworkProtocolTypeIPv6 = CFSTR("IPv6");
const CFStringRef kSCNetworkProtocolTypeProxies = CFSTR("Proxies");
+#if !TARGET_OS_IPHONE
const CFStringRef kSCNetworkProtocolTypeSMB = CFSTR("SMB");
+#endif // !TARGET_OS_IPHONE
static CFTypeID __kSCNetworkProtocolTypeID = _kCFRuntimeNotATypeID;
{
int i;
static const CFStringRef *valid_types[] = {
+#if !TARGET_OS_IPHONE
&kSCNetworkProtocolTypeAppleTalk,
+#endif // !TARGET_OS_IPHONE
&kSCNetworkProtocolTypeDNS,
&kSCNetworkProtocolTypeIPv4,
&kSCNetworkProtocolTypeIPv6,
&kSCNetworkProtocolTypeProxies,
- &kSCNetworkProtocolTypeSMB
+#if !TARGET_OS_IPHONE
+ &kSCNetworkProtocolTypeSMB,
+#endif // !TARGET_OS_IPHONE
};
for (i = 0; i < sizeof(valid_types)/sizeof(valid_types[0]); i++) {
/*
- * Copyright (c) 2003-2008 Apple Inc. All rights reserved.
+ * Copyright (c) 2003-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* - add advanced reachability APIs
*/
+#include <Availability.h>
+#include <TargetConditionals.h>
+#include <sys/cdefs.h>
+#if !TARGET_OS_IPHONE
+#include <dispatch/dispatch.h>
+#endif // !TARGET_OS_IPHONE
+#include <CoreFoundation/CoreFoundation.h>
+#include <CoreFoundation/CFRuntime.h>
#include <SystemConfiguration/SystemConfiguration.h>
#include <SystemConfiguration/SCValidation.h>
#include <SystemConfiguration/SCPrivate.h>
-
-#include <CoreFoundation/CFRuntime.h>
#include <pthread.h>
#include <libkern/OSAtomic.h>
+#if !TARGET_OS_IPHONE
+#include <IOKit/pwr_mgt/IOPMLibPrivate.h>
+#endif // !TARGET_OS_IPHONE
+
#include <notify.h>
#include <dnsinfo.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/if_dl.h>
+#include <net/if_types.h>
#define KERNEL_PRIVATE
#include <net/route.h>
#undef KERNEL_PRIVATE
-
-#define kSCNetworkFlagsFirstResolvePending (1<<31)
+#define kSCNetworkReachabilityFlagsFirstResolvePending (1<<31)
#define N_QUICK 32
static CFStringRef __SCNetworkReachabilityCopyDescription (CFTypeRef cf);
static void __SCNetworkReachabilityDeallocate (CFTypeRef cf);
+static void rlsPerform(void *info);
+
+
+static Boolean
+__SCNetworkReachabilityScheduleWithRunLoop (SCNetworkReachabilityRef target,
+ CFRunLoopRef runLoop,
+ CFStringRef runLoopMode,
+#if !TARGET_OS_IPHONE
+ dispatch_queue_t queue,
+#else // !TARGET_OS_IPHONE
+ void *queue,
+#endif // !TARGET_OS_IPHONE
+ Boolean onDemand);
+static Boolean
+__SCNetworkReachabilityUnscheduleFromRunLoop (SCNetworkReachabilityRef target,
+ CFRunLoopRef runLoop,
+ CFStringRef runLoopMode,
+ Boolean onDemand);
+
+
+typedef struct {
+ SCNetworkReachabilityFlags flags;
+ uint16_t if_index;
+ Boolean sleeping;
+} ReachabilityInfo;
typedef struct {
const char *name;
const char *serv;
struct addrinfo hints;
+ Boolean needResolve;
CFArrayRef resolvedAddress; /* CFArray[CFData] */
int resolvedAddressError;
struct sockaddr *remoteAddress;
/* current reachability flags */
- SCNetworkConnectionFlags flags;
- uint16_t if_index;
+ ReachabilityInfo info;
+ ReachabilityInfo last_notify;
/* run loop source, callout, context, rl scheduling info */
+ Boolean scheduled;
CFRunLoopSourceRef rls;
SCNetworkReachabilityCallBack rlsFunction;
SCNetworkReachabilityContext rlsContext;
CFMutableArrayRef rlList;
+#if !TARGET_OS_IPHONE
+ dispatch_queue_t dispatchQueue; // SCNetworkReachabilitySetDispatchQueue
+ dispatch_queue_t asyncDNSQueue;
+ dispatch_source_t asyncDNSSource;
+#endif // !TARGET_OS_IPHONE
+
/* [async] DNS query info */
Boolean haveDNS;
+ mach_port_t dnsMP;
CFMachPortRef dnsPort;
CFRunLoopSourceRef dnsRLS;
struct timeval dnsQueryStart;
+ /* on demand info */
+ Boolean onDemandBypass;
+ CFStringRef onDemandName;
+ CFStringRef onDemandRemoteAddress;
+ SCNetworkReachabilityRef onDemandServer;
+ CFStringRef onDemandServiceID;
+
+ /* logging */
+ char log_prefix[32];
+
} SCNetworkReachabilityPrivate, *SCNetworkReachabilityPrivateRef;
static pthread_once_t initialized = PTHREAD_ONCE_INIT;
+static ReachabilityInfo NOT_REACHABLE = { 0, 0, FALSE };
+static ReachabilityInfo NOT_REPORTED = { 0xFFFFFFFF, 0, FALSE };
static int rtm_seq = 0;
+#if !TARGET_OS_IPHONE
+/*
+ * Power capabilities (sleep/wake)
+ */
+static IOPMSystemPowerStateCapabilities power_capabilities = kIOPMSytemPowerStateCapabilitiesMask;
+#endif // !TARGET_OS_IPHONE
+
+
/*
* host "something has changed" notifications
*/
static pthread_mutex_t hn_lock = PTHREAD_MUTEX_INITIALIZER;
static SCDynamicStoreRef hn_store = NULL;
+#if !TARGET_OS_IPHONE
+static dispatch_queue_t hn_dispatchQueue = NULL;
+#else // !TARGET_OS_IPHONE
static CFRunLoopSourceRef hn_storeRLS = NULL;
static CFMutableArrayRef hn_rlList = NULL;
+#endif // !TARGET_OS_IPHONE
static CFMutableSetRef hn_targets = NULL;
static void
-__log_query_time(Boolean found, Boolean async, struct timeval *start)
+__log_query_time(SCNetworkReachabilityRef target, Boolean found, Boolean async, struct timeval *start)
{
- struct timeval dnsQueryComplete;
- struct timeval dnsQueryElapsed;
+ struct timeval dnsQueryComplete;
+ struct timeval dnsQueryElapsed;
+ SCNetworkReachabilityPrivateRef targetPrivate = (SCNetworkReachabilityPrivateRef)target;
if (!_sc_debug) {
return;
(void) gettimeofday(&dnsQueryComplete, NULL);
timersub(&dnsQueryComplete, start, &dnsQueryElapsed);
- SCLog(TRUE, LOG_DEBUG,
- CFSTR("%ssync DNS complete%s (query time = %d.%3.3d)"),
+ SCLog(TRUE, LOG_INFO,
+ CFSTR("%s%ssync DNS complete%s (query time = %d.%3.3d)"),
+ targetPrivate->log_prefix,
async ? "a" : "",
found ? "" : ", host not found",
dnsQueryElapsed.tv_sec,
updatePPPStatus(SCDynamicStoreRef *storeP,
const struct sockaddr *sa,
const char *if_name,
- SCNetworkConnectionFlags *flags)
+ SCNetworkReachabilityFlags *flags,
+ CFStringRef *ppp_server,
+ const char *log_prefix)
{
CFDictionaryRef dict = NULL;
CFStringRef entity;
CFIndex n;
CFStringRef ppp_if;
int sc_status = kSCStatusReachabilityUnknown;
- SCDynamicStoreRef store = (storeP != NULL) ? *storeP : NULL;
+ SCDynamicStoreRef store = *storeP;
const void * values_q[N_QUICK];
const void ** values = values_q;
if (store == NULL) {
store = SCDynamicStoreCreate(NULL, CFSTR("SCNetworkReachability"), NULL, NULL);
if (store == NULL) {
- SCLog(_sc_verbose, LOG_INFO, CFSTR("updatePPPStatus SCDynamicStoreCreate() failed"));
+ SCLog(TRUE, LOG_ERR, CFSTR("updatePPPStatus SCDynamicStoreCreate() failed"));
goto done;
}
+ *storeP = store;
}
- /*
- * grab a snapshot of the PPP configuration from the dynamic store
- */
+ // grab a snapshot of the PPP configuration from the dynamic store
{
CFStringRef pattern;
CFMutableArrayRef patterns;
CFRelease(patterns);
}
if (dict == NULL) {
- /* if we could not access the dynamic store */
+ // if we could not access the dynamic store
goto done;
}
sc_status = kSCStatusOK;
- /*
- * look for the service which matches the provided interface
- */
+ // look for the service which matches the provided interface
n = CFDictionaryGetCount(dict);
if (n <= 0) {
goto done;
CFNumberRef num;
CFDictionaryRef p_setup;
CFDictionaryRef p_state;
+ int32_t ppp_demand;
int32_t ppp_status;
CFStringRef service = NULL;
CFStringRef s_key = (CFStringRef) keys[i];
continue; // if not this interface
}
- /*
- * extract service ID, get PPP "state" entity (for status), and get
- * the "setup" entity (for dial-on-traffic flag)
- */
+ // extract the service ID, get the PPP "state" entity for
+ // the "Status", and get the PPP "setup" entity for the
+ // the "DialOnDemand" flag
components = CFStringCreateArrayBySeparatingStrings(NULL, s_key, CFSTR("/"));
if (CFArrayGetCount(components) != 5) {
CFRelease(components);
- continue;
+ break;
}
service = CFArrayGetValueAtIndex(components, 3);
key = SCDynamicStoreKeyCreateNetworkServiceEntity(NULL,
CFRelease(key);
CFRelease(components);
- // get PPP status
+ // ensure that this is a PPP service
if (!isA_CFDictionary(p_state)) {
- continue;
+ break;
}
- num = CFDictionaryGetValue(p_state, kSCPropNetPPPStatus);
- if (!isA_CFNumber(num)) {
- continue;
+
+ *flags |= kSCNetworkReachabilityFlagsTransientConnection;
+
+ // get PPP server
+ if (ppp_server != NULL) {
+ *ppp_server = CFDictionaryGetValue(s_dict, CFSTR("ServerAddress"));
+ *ppp_server = isA_CFString(*ppp_server);
+ if (*ppp_server != NULL) {
+ CFRetain(*ppp_server);
+ }
}
- if (!CFNumberGetValue(num, kCFNumberSInt32Type, &ppp_status)) {
- continue;
+ // get PPP status
+ if (!CFDictionaryGetValueIfPresent(p_state,
+ kSCPropNetPPPStatus,
+ (const void **)&num) ||
+ !isA_CFNumber(num) ||
+ !CFNumberGetValue(num, kCFNumberSInt32Type, &ppp_status)) {
+ break;
}
switch (ppp_status) {
case PPP_RUNNING :
- /* if we're really UP and RUNNING */
+ // if we're really UP and RUNNING
break;
case PPP_ONHOLD :
- /* if we're effectively UP and RUNNING */
+ // if we're effectively UP and RUNNING
break;
case PPP_IDLE :
case PPP_STATERESERVED :
- /* if we're not connected at all */
- SCLog(_sc_debug, LOG_INFO, CFSTR(" PPP link idle, dial-on-traffic to connect"));
- *flags |= kSCNetworkFlagsConnectionRequired;
+ // if we're not connected at all
+ SCLog(_sc_debug, LOG_INFO, CFSTR("%s PPP link idle, dial-on-traffic to connect"),
+ log_prefix);
+ *flags |= kSCNetworkReachabilityFlagsConnectionRequired;
break;
default :
- /* if we're in the process of [dis]connecting */
- SCLog(_sc_debug, LOG_INFO, CFSTR(" PPP link, connection in progress"));
- *flags |= kSCNetworkFlagsConnectionRequired;
+ // if we're in the process of [dis]connecting
+ SCLog(_sc_debug, LOG_INFO, CFSTR("%s PPP link, connection in progress"),
+ log_prefix);
+ *flags |= kSCNetworkReachabilityFlagsConnectionRequired;
break;
}
- // check PPP dial-on-traffic status
- if (isA_CFDictionary(p_setup)) {
- num = CFDictionaryGetValue(p_setup, kSCPropNetPPPDialOnDemand);
- if (isA_CFNumber(num)) {
- int32_t ppp_demand;
-
- if (CFNumberGetValue(num, kCFNumberSInt32Type, &ppp_demand)) {
- if (ppp_demand) {
- *flags |= kSCNetworkFlagsConnectionAutomatic;
- if (ppp_status == PPP_IDLE) {
- *flags |= kSCNetworkFlagsInterventionRequired;
- }
- }
- }
+ // get PPP dial-on-traffic status
+ if (isA_CFDictionary(p_setup) &&
+ CFDictionaryGetValueIfPresent(p_setup,
+ kSCPropNetPPPDialOnDemand,
+ (const void **)&num) &&
+ isA_CFNumber(num) &&
+ CFNumberGetValue(num, kCFNumberSInt32Type, &ppp_demand) &&
+ (ppp_demand != 0)) {
+ *flags |= kSCNetworkReachabilityFlagsConnectionOnTraffic;
+ if (ppp_status == PPP_IDLE) {
+ *flags |= kSCNetworkReachabilityFlagsInterventionRequired;
}
}
done :
if (dict != NULL) CFRelease(dict);
- if (storeP != NULL) *storeP = store;
return sc_status;
}
static int
updatePPPAvailable(SCDynamicStoreRef *storeP,
const struct sockaddr *sa,
- SCNetworkConnectionFlags *flags)
+ SCNetworkReachabilityFlags *flags,
+ const char *log_prefix)
{
CFDictionaryRef dict = NULL;
CFStringRef entity;
const void ** keys = keys_q;
CFIndex n;
int sc_status = kSCStatusReachabilityUnknown;
- SCDynamicStoreRef store = (storeP != NULL) ? *storeP : NULL;
+ SCDynamicStoreRef store = *storeP;
const void * values_q[N_QUICK];
const void ** values = values_q;
if (store == NULL) {
store = SCDynamicStoreCreate(NULL, CFSTR("SCNetworkReachability"), NULL, NULL);
if (store == NULL) {
- SCLog(_sc_debug, LOG_INFO, CFSTR(" status = unknown (could not access SCDynamicStore"));
+ SCLog(TRUE, LOG_ERR, CFSTR("updatePPPAvailable SCDynamicStoreCreate() failed"));
goto done;
}
+ *storeP = store;
}
- /*
- * grab a snapshot of the PPP configuration from the dynamic store
- */
+ // grab a snapshot of the PPP configuration from the dynamic store
{
CFStringRef pattern;
CFMutableArrayRef patterns;
entity);
CFArrayAppendValue(patterns, pattern);
CFRelease(pattern);
+ pattern = SCDynamicStoreKeyCreateNetworkServiceEntity(NULL,
+ kSCDynamicStoreDomainSetup,
+ kSCCompAnyRegex,
+ kSCEntNetInterface);
+ CFArrayAppendValue(patterns, pattern);
+ CFRelease(pattern);
pattern = SCDynamicStoreKeyCreateNetworkServiceEntity(NULL,
kSCDynamicStoreDomainSetup,
kSCCompAnyRegex,
CFRelease(patterns);
}
if (dict == NULL) {
- /* if we could not access the dynamic store */
+ // if we could not access the dynamic store
goto done;
}
sc_status = kSCStatusOK;
- /*
- * look for an available service which will provide connectivity
- * for the requested address family.
- */
+ // look for an available service which will provide connectivity
+ // for the requested address family.
n = CFDictionaryGetCount(dict);
if (n <= 0) {
goto done;
for (i = 0; i < n; i++) {
CFArrayRef components;
Boolean found = FALSE;
+ CFStringRef i_key;
+ CFDictionaryRef i_dict;
CFStringRef p_key;
CFDictionaryRef p_dict;
CFStringRef service;
}
service = CFArrayGetValueAtIndex(components, 3);
- // check for PPP entity
+ // check for [non-VPN] PPP entity
p_key = SCDynamicStoreKeyCreateNetworkServiceEntity(NULL,
kSCDynamicStoreDomainSetup,
service,
p_dict = CFDictionaryGetValue(dict, p_key);
CFRelease(p_key);
- if (isA_CFDictionary(p_dict)) {
+ i_key = SCDynamicStoreKeyCreateNetworkServiceEntity(NULL,
+ kSCDynamicStoreDomainSetup,
+ service,
+ kSCEntNetInterface);
+ i_dict = CFDictionaryGetValue(dict, i_key);
+ CFRelease(i_key);
+
+ if (isA_CFDictionary(p_dict) &&
+ isA_CFDictionary(i_dict) &&
+ CFDictionaryContainsKey(i_dict, kSCPropNetInterfaceDeviceName)) {
CFNumberRef num;
- /*
- * we have a PPP service for this address family
- */
+ // we have a PPP service for this address family
found = TRUE;
- *flags |= kSCNetworkFlagsReachable;
- *flags |= kSCNetworkFlagsTransientConnection;
- *flags |= kSCNetworkFlagsConnectionRequired;
+ *flags |= kSCNetworkReachabilityFlagsReachable;
+ *flags |= kSCNetworkReachabilityFlagsTransientConnection;
+ *flags |= kSCNetworkReachabilityFlagsConnectionRequired;
- /*
- * get PPP dial-on-traffic status
- */
+ // get PPP dial-on-traffic status
num = CFDictionaryGetValue(p_dict, kSCPropNetPPPDialOnDemand);
if (isA_CFNumber(num)) {
int32_t ppp_demand;
if (CFNumberGetValue(num, kCFNumberSInt32Type, &ppp_demand)) {
if (ppp_demand) {
- *flags |= kSCNetworkFlagsConnectionAutomatic;
+ *flags |= kSCNetworkReachabilityFlagsConnectionOnTraffic;
}
}
}
if (_sc_debug) {
- SCLog(TRUE, LOG_INFO, CFSTR(" status = isReachable (after connect)"));
- SCLog(TRUE, LOG_INFO, CFSTR(" service = %@"), service);
+ SCLog(TRUE, LOG_INFO, CFSTR("%s status = isReachable (after connect)"),
+ log_prefix);
+ SCLog(TRUE, LOG_INFO, CFSTR("%s service = %@"),
+ log_prefix,
+ service);
}
}
done :
if (dict != NULL) CFRelease(dict);
- if (storeP != NULL) *storeP = store;
return sc_status;
}
+static int
+updateIPSecStatus(SCDynamicStoreRef *storeP,
+ const struct sockaddr *sa,
+ const char *if_name,
+ SCNetworkReachabilityFlags *flags,
+ CFStringRef *ipsec_server)
+{
+ CFDictionaryRef dict = NULL;
+ CFStringRef entity;
+ CFIndex i;
+ CFStringRef ipsec_if;
+ const void * keys_q[N_QUICK];
+ const void ** keys = keys_q;
+ CFIndex n;
+ int sc_status = kSCStatusReachabilityUnknown;
+ SCDynamicStoreRef store = *storeP;
+ const void * values_q[N_QUICK];
+ const void ** values = values_q;
+
+ switch (sa->sa_family) {
+ case AF_INET :
+ entity = kSCEntNetIPv4;
+ break;
+ case AF_INET6 :
+ entity = kSCEntNetIPv6;
+ break;
+ default :
+ goto done;
+ }
+
+ if (store == NULL) {
+ store = SCDynamicStoreCreate(NULL, CFSTR("SCNetworkReachability"), NULL, NULL);
+ if (store == NULL) {
+ SCLog(TRUE, LOG_ERR, CFSTR("updateIPSecStatus SCDynamicStoreCreate() failed"));
+ goto done;
+ }
+ *storeP = store;
+ }
+
+ // grab a snapshot of the IPSec configuration from the dynamic store
+ {
+ CFStringRef pattern;
+ CFMutableArrayRef patterns;
+
+ patterns = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+ pattern = SCDynamicStoreKeyCreateNetworkServiceEntity(NULL,
+ kSCDynamicStoreDomainState,
+ kSCCompAnyRegex,
+ entity);
+ CFArrayAppendValue(patterns, pattern);
+ CFRelease(pattern);
+ pattern = SCDynamicStoreKeyCreateNetworkServiceEntity(NULL,
+ kSCDynamicStoreDomainSetup,
+ kSCCompAnyRegex,
+ kSCEntNetIPSec);
+ CFArrayAppendValue(patterns, pattern);
+ CFRelease(pattern);
+ dict = SCDynamicStoreCopyMultiple(store, NULL, patterns);
+ CFRelease(patterns);
+ }
+ if (dict == NULL) {
+ // if we could not access the dynamic store
+ goto done;
+ }
+
+ sc_status = kSCStatusOK;
+
+ // look for the service which matches the provided interface
+ n = CFDictionaryGetCount(dict);
+ if (n <= 0) {
+ goto done;
+ }
+
+ ipsec_if = CFStringCreateWithCStringNoCopy(NULL,
+ if_name,
+ kCFStringEncodingASCII,
+ kCFAllocatorNull);
+
+ if (n > (CFIndex)(sizeof(keys_q) / sizeof(CFTypeRef))) {
+ keys = CFAllocatorAllocate(NULL, n * sizeof(CFTypeRef), 0);
+ values = CFAllocatorAllocate(NULL, n * sizeof(CFTypeRef), 0);
+ }
+ CFDictionaryGetKeysAndValues(dict, keys, values);
+
+ for (i=0; i < n; i++) {
+ CFArrayRef components;
+ CFStringRef key;
+ CFDictionaryRef i_setup;
+ CFStringRef service = NULL;
+ CFStringRef s_key = (CFStringRef) keys[i];
+ CFDictionaryRef s_dict = (CFDictionaryRef)values[i];
+ CFStringRef s_if;
+
+ if (!isA_CFString(s_key) || !isA_CFDictionary(s_dict)) {
+ continue;
+ }
+
+ if (!CFStringHasSuffix(s_key, entity)) {
+ continue; // if not an IPv4 or IPv6 entity
+ }
+
+ s_if = CFDictionaryGetValue(s_dict, kSCPropInterfaceName);
+ if (!isA_CFString(s_if)) {
+ continue; // if no interface
+ }
+
+ if (!CFEqual(ipsec_if, s_if)) {
+ continue; // if not this interface
+ }
+
+ // extract the service ID and get the IPSec "setup" entity
+ // to confirm that we're looking at what we're expecting
+ components = CFStringCreateArrayBySeparatingStrings(NULL, s_key, CFSTR("/"));
+ if (CFArrayGetCount(components) != 5) {
+ CFRelease(components);
+ break;
+ }
+ service = CFArrayGetValueAtIndex(components, 3);
+ key = SCDynamicStoreKeyCreateNetworkServiceEntity(NULL,
+ kSCDynamicStoreDomainSetup,
+ service,
+ kSCEntNetIPSec);
+ i_setup = CFDictionaryGetValue(dict, key);
+ CFRelease(key);
+ CFRelease(components);
+
+ // ensure that this is an IPSec service
+ if (!isA_CFDictionary(i_setup)) {
+ break;
+ }
+
+ *flags |= kSCNetworkReachabilityFlagsTransientConnection;
+
+ // get IPSec server
+ if (ipsec_server != NULL) {
+ *ipsec_server = CFDictionaryGetValue(s_dict, CFSTR("ServerAddress"));
+ *ipsec_server = isA_CFString(*ipsec_server);
+ if (*ipsec_server != NULL) {
+ CFRetain(*ipsec_server);
+ }
+ }
+
+ break;
+ }
+
+ CFRelease(ipsec_if);
+ if (keys != keys_q) {
+ CFAllocatorDeallocate(NULL, keys);
+ CFAllocatorDeallocate(NULL, values);
+ }
+
+ done :
+
+ if (dict != NULL) CFRelease(dict);
+ return sc_status;
+}
+
+
+
+
#define ROUNDUP(a, size) \
(((a) & ((size)-1)) ? (1 + ((a) | ((size)-1))) : (a))
#define BUFLEN (sizeof(struct rt_msghdr) + 512) /* 8 * sizeof(struct sockaddr_in6) = 192 */
-static Boolean
-checkAddress(SCDynamicStoreRef *storeP,
- const struct sockaddr *address,
- SCNetworkConnectionFlags *flags,
- uint16_t *if_index)
-{
+
+typedef struct {
char buf[BUFLEN];
- struct ifreq ifr;
- char if_name[IFNAMSIZ + 1];
- int isock;
+ int error;
+ struct sockaddr *rti_info[RTAX_MAX];
+ struct rt_msghdr *rtm;
+ struct sockaddr_dl *sdl;
+} route_info, *route_info_p;
+
+
+/*
+ * route_get()
+ * returns zero if route exists an data returned, EHOSTUNREACH
+ * if no route, or errno for any other error.
+ */
+static int
+route_get(const struct sockaddr *address,
+ route_info *info)
+{
int n;
pid_t pid = getpid();
int rsock;
- struct sockaddr *rti_info[RTAX_MAX];
- struct rt_msghdr *rtm;
struct sockaddr *sa;
- int sc_status = kSCStatusReachabilityUnknown;
- struct sockaddr_dl *sdl;
int32_t seq = OSAtomicIncrement32Barrier(&rtm_seq);
- SCDynamicStoreRef store = (storeP != NULL) ? *storeP : NULL;
- char *statusMessage = NULL;
#ifndef RTM_GET_SILENT
#warning Note: Using RTM_GET (and not RTM_GET_SILENT)
static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
int sosize = 48 * 1024;
#endif
- *flags = 0;
- if (if_index != NULL) {
- *if_index = 0;
- }
-
- if (address == NULL) {
- /* special case: check only for available paths off the system */
- goto checkAvailable;
- }
-
- switch (address->sa_family) {
- case AF_INET :
- case AF_INET6 :
- if (_sc_debug) {
- _SC_sockaddr_to_string(address, buf, sizeof(buf));
- SCLog(TRUE, LOG_INFO, CFSTR("checkAddress(%s)"), buf);
- }
- break;
- default :
- /*
- * if no code for this address family (yet)
- */
- SCLog(_sc_verbose, LOG_ERR,
- CFSTR("checkAddress(): unexpected address family %d"),
- address->sa_family);
- sc_status = kSCStatusInvalidArgument;
- goto done;
- }
-
- bzero(&buf, sizeof(buf));
+ bzero(info, sizeof(*info));
- rtm = (struct rt_msghdr *)&buf;
- rtm->rtm_msglen = sizeof(struct rt_msghdr);
- rtm->rtm_version = RTM_VERSION;
+ info->rtm = (struct rt_msghdr *)&info->buf;
+ info->rtm->rtm_msglen = sizeof(struct rt_msghdr);
+ info->rtm->rtm_version = RTM_VERSION;
#ifdef RTM_GET_SILENT
- rtm->rtm_type = RTM_GET_SILENT;
+ info->rtm->rtm_type = RTM_GET_SILENT;
#else
- rtm->rtm_type = RTM_GET;
+ info->rtm->rtm_type = RTM_GET;
#endif
- rtm->rtm_flags = RTF_STATIC|RTF_UP|RTF_HOST|RTF_GATEWAY;
- rtm->rtm_addrs = RTA_DST|RTA_IFP; /* Both destination and device */
- rtm->rtm_pid = pid;
- rtm->rtm_seq = seq;
+ info->rtm->rtm_flags = RTF_STATIC|RTF_UP|RTF_HOST|RTF_GATEWAY;
+ info->rtm->rtm_addrs = RTA_DST|RTA_IFP; /* Both destination and device */
+ info->rtm->rtm_pid = pid;
+ info->rtm->rtm_seq = seq;
switch (address->sa_family) {
case AF_INET6: {
}
}
- sa = (struct sockaddr *) (rtm + 1);
+ sa = (struct sockaddr *) (info->rtm + 1);
bcopy(address, sa, address->sa_len);
n = ROUNDUP(sa->sa_len, sizeof(uint32_t));
- rtm->rtm_msglen += n;
+ info->rtm->rtm_msglen += n;
- sdl = (struct sockaddr_dl *) ((void *)sa + n);
- sdl->sdl_family = AF_LINK;
- sdl->sdl_len = sizeof (struct sockaddr_dl);
- n = ROUNDUP(sdl->sdl_len, sizeof(uint32_t));
- rtm->rtm_msglen += n;
+ info->sdl = (struct sockaddr_dl *) ((void *)sa + n);
+ info->sdl->sdl_family = AF_LINK;
+ info->sdl->sdl_len = sizeof (struct sockaddr_dl);
+ n = ROUNDUP(info->sdl->sdl_len, sizeof(uint32_t));
+ info->rtm->rtm_msglen += n;
#ifndef RTM_GET_SILENT
pthread_mutex_lock(&lock);
#endif
rsock = socket(PF_ROUTE, SOCK_RAW, 0);
if (rsock == -1) {
+ int error = errno;
+
#ifndef RTM_GET_SILENT
pthread_mutex_unlock(&lock);
#endif
- SCLog(TRUE, LOG_ERR, CFSTR("socket(PF_ROUTE) failed: %s"), strerror(errno));
- sc_status = kSCStatusFailed;
- goto done;
+ SCLog(TRUE, LOG_ERR, CFSTR("socket(PF_ROUTE) failed: %s"), strerror(error));
+ return error;
}
#ifndef RTM_GET_SILENT
if (setsockopt(rsock, SOL_SOCKET, SO_RCVBUF, &sosize, sizeof(sosize)) == -1) {
+ int error = errno;
+
(void)close(rsock);
pthread_mutex_unlock(&lock);
- SCLog(TRUE, LOG_ERR, CFSTR("setsockopt(SO_RCVBUF) failed: %s"), strerror(errno));
- sc_status = kSCStatusFailed;
- goto done;
+ SCLog(TRUE, LOG_ERR, CFSTR("setsockopt(SO_RCVBUF) failed: %s"), strerror(error));
+ return error;
}
#endif
- if (write(rsock, &buf, rtm->rtm_msglen) == -1) {
- int err = errno;
+ if (write(rsock, &info->buf, info->rtm->rtm_msglen) == -1) {
+ int error = errno;
(void)close(rsock);
#ifndef RTM_GET_SILENT
pthread_mutex_unlock(&lock);
#endif
- if (err != ESRCH) {
- SCLog(TRUE, LOG_ERR, CFSTR("write() failed: %s"), strerror(err));
- goto done;
+ if (error != ESRCH) {
+ SCLog(TRUE, LOG_ERR, CFSTR("write() failed: %s"), strerror(error));
+ return error;
}
- goto checkAvailable;
+ return EHOSTUNREACH;
}
/*
do {
int n;
- n = read(rsock, (void *)&buf, sizeof(buf));
+ n = read(rsock, (void *)&info->buf, sizeof(info->buf));
if (n == -1) {
- int err = errno;
+ if (errno != EINTR) {
+ int error = errno;
- if (err != EINTR) {
(void)close(rsock);
- SCLog(TRUE, LOG_ERR, CFSTR("read() failed: %s"), strerror(err));
#ifndef RTM_GET_SILENT
pthread_mutex_unlock(&lock);
#endif
- goto done;
+ SCLog(TRUE, LOG_ERR, CFSTR("read() failed: %s"), strerror(error));
+ return error;
}
}
- } while (rtm->rtm_type != RTM_GET ||
- rtm->rtm_seq != seq ||
- rtm->rtm_pid != pid);
+ } while ((info->rtm->rtm_type != RTM_GET) ||
+ (info->rtm->rtm_seq != seq) ||
+ (info->rtm->rtm_pid != pid));
(void)close(rsock);
#ifndef RTM_GET_SILENT
pthread_mutex_unlock(&lock);
#endif
- get_rtaddrs(rtm->rtm_addrs, sa, rti_info);
+ get_rtaddrs(info->rtm->rtm_addrs, sa, info->rti_info);
-#ifdef DEBUG
-{
- int i;
- char buf[200];
+#ifdef LOG_RTADDRS
+ {
+ int i;
- SCLog(_sc_debug, LOG_DEBUG, CFSTR("rtm_flags = 0x%8.8x"), rtm->rtm_flags);
+ SCLog(_sc_debug, LOG_DEBUG, CFSTR("rtm_flags = 0x%8.8x"), info->rtm->rtm_flags);
- if ((rti_info[RTAX_NETMASK] != NULL) && (rti_info[RTAX_DST] != NULL)) {
- rti_info[RTAX_NETMASK]->sa_family = rti_info[RTAX_DST]->sa_family;
- }
+ if ((info->rti_info[RTAX_NETMASK] != NULL) && (info->rti_info[RTAX_DST] != NULL)) {
+ info->rti_info[RTAX_NETMASK]->sa_family = info->rti_info[RTAX_DST]->sa_family;
+ }
- for (i = 0; i < RTAX_MAX; i++) {
- if (rti_info[i] != NULL) {
- _SC_sockaddr_to_string(rti_info[i], buf, sizeof(buf));
- SCLog(_sc_debug, LOG_DEBUG, CFSTR("%d: %s"), i, buf);
+ for (i = 0; i < RTAX_MAX; i++) {
+ if (info->rti_info[i] != NULL) {
+ char addr[128];
+
+ _SC_sockaddr_to_string(info->rti_info[i], addr, sizeof(addr));
+ SCLog(_sc_debug, LOG_DEBUG, CFSTR("%d: %s"), i, addr);
+ }
}
}
-}
-#endif /* DEBUG */
+#endif /* LOG_RTADDRS */
- if ((rti_info[RTAX_IFP] == NULL) ||
- (rti_info[RTAX_IFP]->sa_family != AF_LINK)) {
+ if ((info->rti_info[RTAX_IFP] == NULL) ||
+ (info->rti_info[RTAX_IFP]->sa_family != AF_LINK)) {
/* no interface info */
- goto done;
+ SCLog(TRUE, LOG_DEBUG, CFSTR("route_get() no interface info"));
+ return EINVAL;
}
- sdl = (struct sockaddr_dl *) rti_info[RTAX_IFP];
- if ((sdl->sdl_nlen == 0) || (sdl->sdl_nlen > IFNAMSIZ)) {
+ info->sdl = (struct sockaddr_dl *) info->rti_info[RTAX_IFP];
+ if ((info->sdl->sdl_nlen == 0) || (info->sdl->sdl_nlen > IFNAMSIZ)) {
/* no interface name */
- goto checkAvailable;
+ return EHOSTUNREACH;
}
- /* get the interface flags */
+ return 0;
+}
- bzero(&ifr, sizeof(ifr));
- bcopy(sdl->sdl_data, ifr.ifr_name, sdl->sdl_nlen);
+
+static Boolean
+checkAddress(SCDynamicStoreRef *storeP,
+ const struct sockaddr *address,
+ ReachabilityInfo *reach_info,
+ const char *log_prefix)
+{
+ route_info info;
+ struct ifreq ifr;
+ char if_name[IFNAMSIZ + 1];
+ int isock = -1;
+ int ret;
+ int sc_status = kSCStatusReachabilityUnknown;
+ CFStringRef server = NULL;
+ char *statusMessage = NULL;
+ struct sockaddr_in v4mapped;
+
+ *reach_info = NOT_REACHABLE;
+
+ if (address == NULL) {
+ /* special case: check only for available paths off the system */
+ goto checkAvailable;
+ }
+
+ switch (address->sa_family) {
+ case AF_INET :
+ case AF_INET6 :
+ if (_sc_debug) {
+ char addr[128];
+
+ _SC_sockaddr_to_string(address, addr, sizeof(addr));
+ SCLog(TRUE, LOG_INFO, CFSTR("%scheckAddress(%s)"),
+ log_prefix,
+ addr);
+ }
+ break;
+ default :
+ /*
+ * if no code for this address family (yet)
+ */
+ SCLog(TRUE, LOG_INFO,
+ CFSTR("checkAddress(): unexpected address family %d"),
+ address->sa_family);
+ sc_status = kSCStatusInvalidArgument;
+ goto done;
+ }
+
+ if (address->sa_family == AF_INET6) {
+ struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)address;
+
+ if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
+ bzero(&v4mapped, sizeof(v4mapped));
+ v4mapped.sin_len = sizeof(v4mapped);
+ v4mapped.sin_family = AF_INET;
+ v4mapped.sin_port = sin6->sin6_port;
+ v4mapped.sin_addr.s_addr = sin6->sin6_addr.__u6_addr.__u6_addr32[3];
+ address = (struct sockaddr *)&v4mapped;
+ }
+ }
+
+ ret = route_get(address, &info);
+ switch (ret) {
+ case 0 :
+ break;
+ case EHOSTUNREACH :
+ // if no route
+ goto checkAvailable;
+ default :
+ // if error
+ sc_status = ret;
+ goto done;
+ }
+
+ /* get the interface flags */
isock = socket(AF_INET, SOCK_DGRAM, 0);
if (isock == -1) {
- SCLog(TRUE, LOG_NOTICE, CFSTR("socket() failed: %s"), strerror(errno));
+ SCLog(TRUE, LOG_ERR, CFSTR("socket() failed: %s"), strerror(errno));
goto done;
}
+ bzero(&ifr, sizeof(ifr));
+ bcopy(info.sdl->sdl_data, ifr.ifr_name, info.sdl->sdl_nlen);
+
if (ioctl(isock, SIOCGIFFLAGS, (char *)&ifr) == -1) {
- SCLog(TRUE, LOG_NOTICE, CFSTR("ioctl() failed: %s"), strerror(errno));
- (void)close(isock);
+ SCLog(TRUE, LOG_ERR, CFSTR("ioctl() failed: %s"), strerror(errno));
goto done;
}
- (void)close(isock);
if (!(ifr.ifr_flags & IFF_UP)) {
goto checkAvailable;
}
statusMessage = "isReachable";
- *flags |= kSCNetworkFlagsReachable;
+ reach_info->flags |= kSCNetworkReachabilityFlagsReachable;
- if (rtm->rtm_flags & RTF_LOCAL) {
+ if (info.rtm->rtm_flags & RTF_LOCAL) {
statusMessage = "isReachable (is a local address)";
- *flags |= kSCNetworkFlagsIsLocalAddress;
+ reach_info->flags |= kSCNetworkReachabilityFlagsIsLocalAddress;
} else if (ifr.ifr_flags & IFF_LOOPBACK) {
statusMessage = "isReachable (is loopback network)";
- *flags |= kSCNetworkFlagsIsLocalAddress;
- } else if (rti_info[RTAX_IFA]) {
+ reach_info->flags |= kSCNetworkReachabilityFlagsIsLocalAddress;
+ } else if ((info.rti_info[RTAX_IFA] != NULL) &&
+ (info.rti_info[RTAX_IFA]->sa_family != AF_LINK)) {
void *addr1 = (void *)address;
- void *addr2 = (void *)rti_info[RTAX_IFA];
+ void *addr2 = (void *)info.rti_info[RTAX_IFA];
size_t len = address->sa_len;
- if ((address->sa_family != rti_info[RTAX_IFA]->sa_family) &&
- (address->sa_len != rti_info[RTAX_IFA]->sa_len)) {
+ if ((address->sa_family != info.rti_info[RTAX_IFA]->sa_family) &&
+ (address->sa_len != info.rti_info[RTAX_IFA]->sa_len)) {
SCLog(TRUE, LOG_NOTICE,
CFSTR("address family/length mismatch: %d/%d != %d/%d"),
address->sa_family,
address->sa_len,
- rti_info[RTAX_IFA]->sa_family,
- rti_info[RTAX_IFA]->sa_len);
+ info.rti_info[RTAX_IFA]->sa_family,
+ info.rti_info[RTAX_IFA]->sa_len);
goto done;
}
switch (address->sa_family) {
case AF_INET :
addr1 = &((struct sockaddr_in *)address)->sin_addr;
- addr2 = &((struct sockaddr_in *)rti_info[RTAX_IFA])->sin_addr;
+ addr2 = &((struct sockaddr_in *)info.rti_info[RTAX_IFA])->sin_addr;
len = sizeof(struct in_addr);
/*
*/
if (((struct sockaddr_in *)address)->sin_addr.s_addr == 0) {
statusMessage = "isReachable (this host)";
- *flags |= kSCNetworkFlagsIsLocalAddress;
+ reach_info->flags |= kSCNetworkReachabilityFlagsIsLocalAddress;
}
break;
case AF_INET6 :
addr1 = &((struct sockaddr_in6 *)address)->sin6_addr;
- addr2 = &((struct sockaddr_in6 *)rti_info[RTAX_IFA])->sin6_addr;
+ addr2 = &((struct sockaddr_in6 *)info.rti_info[RTAX_IFA])->sin6_addr;
len = sizeof(struct in6_addr);
break;
default :
break;
}
- if (memcmp(addr1, addr2, len) == 0) {
+ if (bcmp(addr1, addr2, len) == 0) {
statusMessage = "isReachable (is interface address)";
- *flags |= kSCNetworkFlagsIsLocalAddress;
+ reach_info->flags |= kSCNetworkReachabilityFlagsIsLocalAddress;
}
}
- if (!(rtm->rtm_flags & RTF_GATEWAY) &&
- (rti_info[RTAX_GATEWAY] != NULL) &&
- (rti_info[RTAX_GATEWAY]->sa_family == AF_LINK) &&
+ if (!(info.rtm->rtm_flags & RTF_GATEWAY) &&
+ (info.rti_info[RTAX_GATEWAY] != NULL) &&
+ (info.rti_info[RTAX_GATEWAY]->sa_family == AF_LINK) &&
!(ifr.ifr_flags & IFF_POINTOPOINT)) {
- *flags |= kSCNetworkFlagsIsDirect;
+ reach_info->flags |= kSCNetworkReachabilityFlagsIsDirect;
}
bzero(&if_name, sizeof(if_name));
- bcopy(sdl->sdl_data,
+ bcopy(info.sdl->sdl_data,
if_name,
- (sdl->sdl_nlen <= IFNAMSIZ) ? sdl->sdl_nlen : IFNAMSIZ);
+ (info.sdl->sdl_nlen <= IFNAMSIZ) ? info.sdl->sdl_nlen : IFNAMSIZ);
- if (if_index != NULL) {
- *if_index = sdl->sdl_index;
- }
+ reach_info->if_index = info.sdl->sdl_index;
if (_sc_debug) {
- SCLog(TRUE, LOG_INFO, CFSTR(" status = %s"), statusMessage);
- SCLog(TRUE, LOG_INFO, CFSTR(" device = %s (%hu)"), if_name, sdl->sdl_index);
- SCLog(TRUE, LOG_INFO, CFSTR(" ifr_flags = 0x%04hx"), ifr.ifr_flags);
- SCLog(TRUE, LOG_INFO, CFSTR(" rtm_flags = 0x%08x"), rtm->rtm_flags);
+ SCLog(TRUE, LOG_INFO, CFSTR("%s status = %s"), log_prefix, statusMessage);
+ SCLog(TRUE, LOG_INFO, CFSTR("%s device = %s (%hu)"), log_prefix, if_name, info.sdl->sdl_index);
+ SCLog(TRUE, LOG_INFO, CFSTR("%s sdl_type = 0x%x"), log_prefix, info.sdl->sdl_type);
+ SCLog(TRUE, LOG_INFO, CFSTR("%s ifr_flags = 0x%04hx"), log_prefix, ifr.ifr_flags);
+ SCLog(TRUE, LOG_INFO, CFSTR("%s rtm_flags = 0x%08x"), log_prefix, info.rtm->rtm_flags);
}
sc_status = kSCStatusOK;
if (ifr.ifr_flags & IFF_POINTOPOINT) {
+ reach_info->flags |= kSCNetworkReachabilityFlagsTransientConnection;
+ }
+
+ if (info.sdl->sdl_type == IFT_PPP) {
/*
- * We have an interface which "claims" to be a valid path
- * off of the system.
+ * 1. check if PPP service
+ * 2. check for dial-on-demand PPP link that is not yet connected
+ * 3. get PPP server address
*/
- *flags |= kSCNetworkFlagsTransientConnection;
-
+ sc_status = updatePPPStatus(storeP, address, if_name, &reach_info->flags, &server, log_prefix);
+ } else if (info.sdl->sdl_type == IFT_OTHER) {
/*
- * Check if this is a dial-on-demand PPP link that isn't
- * connected yet.
+ * 1. check if IPSec service
+ * 2. get IPSec server address
*/
- sc_status = updatePPPStatus(&store, address, if_name, flags);
+ sc_status = updateIPSecStatus(storeP, address, if_name, &reach_info->flags, &server);
}
+
goto done;
checkAvailable :
- sc_status = updatePPPAvailable(&store, address, flags);
+
+ sc_status = updatePPPAvailable(storeP, address, &reach_info->flags, log_prefix);
done :
- if (*flags == 0) {
- SCLog(_sc_debug, LOG_INFO, CFSTR(" cannot be reached"));
+ if (reach_info->flags == 0) {
+ SCLog(_sc_debug, LOG_INFO, CFSTR("%s cannot be reached"), log_prefix);
}
- if (storeP != NULL) *storeP = store;
+ if (isock != -1) (void)close(isock);
+ if (server != NULL) CFRelease(server);
if (sc_status != kSCStatusOK) {
_SCErrorSet(sc_status);
return FALSE;
}
+#pragma mark -
+#pragma mark SCNetworkReachability APIs
+
+
static CFStringRef
__SCNetworkReachabilityCopyDescription(CFTypeRef cf)
{
break;
}
}
- if (targetPrivate->rls != NULL) {
+ if (targetPrivate->scheduled) {
CFStringAppendFormat(result,
NULL,
- CFSTR(", flags = %8.8x, if_index = %hu"),
- targetPrivate->flags,
- targetPrivate->if_index);
+ CFSTR(", flags = 0x%08x, if_index = %hu"),
+ targetPrivate->info.flags,
+ targetPrivate->info.if_index);
}
CFStringAppendFormat(result, NULL, CFSTR("}"));
(*targetPrivate->rlsContext.release)(targetPrivate->rlsContext.info);
}
+ if (targetPrivate->onDemandName != NULL) {
+ CFRelease(targetPrivate->onDemandName);
+ }
+
+ if (targetPrivate->onDemandRemoteAddress != NULL) {
+ CFRelease(targetPrivate->onDemandRemoteAddress);
+ }
+
+ if (targetPrivate->onDemandServer != NULL) {
+ CFRelease(targetPrivate->onDemandServer);
+ }
+
+ if (targetPrivate->onDemandServiceID != NULL) {
+ CFRelease(targetPrivate->onDemandServiceID);
+ }
+
return;
}
}
+static void
+__SCNetworkReachabilityPerform(SCNetworkReachabilityRef target)
+{
+ SCNetworkReachabilityPrivateRef targetPrivate = (SCNetworkReachabilityPrivateRef)target;
+
+#if !TARGET_OS_IPHONE
+ if (targetPrivate->dispatchQueue != NULL) {
+ CFRetain(target);
+ dispatch_async(targetPrivate->dispatchQueue,
+ ^{
+ rlsPerform((void *)target);
+ CFRelease(target);
+ });
+ } else
+#endif // !TARGET_OS_IPHONE
+ if (targetPrivate->rls != NULL) {
+ CFRunLoopSourceSignal(targetPrivate->rls);
+ _SC_signalRunLoop(target, targetPrivate->rls, targetPrivate->rlList);
+ }
+
+ return;
+}
+
static SCNetworkReachabilityPrivateRef
__SCNetworkReachabilityCreatePrivate(CFAllocatorRef allocator)
{
targetPrivate->hints.ai_flags |= AI_PARALLEL;
#endif /* AI_PARALLEL */
+ targetPrivate->needResolve = FALSE;
targetPrivate->resolvedAddress = NULL;
targetPrivate->resolvedAddressError = NETDB_SUCCESS;
targetPrivate->localAddress = NULL;
targetPrivate->remoteAddress = NULL;
- targetPrivate->flags = 0;
- targetPrivate->if_index = 0;
+ targetPrivate->info = NOT_REACHABLE;
+ targetPrivate->last_notify = NOT_REPORTED;
+ targetPrivate->scheduled = FALSE;
targetPrivate->rls = NULL;
targetPrivate->rlsFunction = NULL;
targetPrivate->rlsContext.info = NULL;
targetPrivate->rlList = NULL;
targetPrivate->haveDNS = FALSE;
+ targetPrivate->dnsMP = MACH_PORT_NULL;
targetPrivate->dnsPort = NULL;
targetPrivate->dnsRLS = NULL;
+ targetPrivate->onDemandBypass = FALSE;
+ targetPrivate->onDemandName = NULL;
+ targetPrivate->onDemandRemoteAddress = NULL;
+ targetPrivate->onDemandServer = NULL;
+ targetPrivate->onDemandServiceID = NULL;
+
+ targetPrivate->log_prefix[0] = '\0';
+ if (_sc_log > 0) {
+ snprintf(targetPrivate->log_prefix,
+ sizeof(targetPrivate->log_prefix),
+ "[%p] ",
+ targetPrivate);
+ }
+
return targetPrivate;
}
targetPrivate->type = reachabilityTypeName;
- targetPrivate->flags |= kSCNetworkFlagsFirstResolvePending;
-
targetPrivate->name = CFAllocatorAllocate(NULL, nodenameLen + 1, 0);
strlcpy((char *)targetPrivate->name, nodename, nodenameLen + 1);
+ targetPrivate->needResolve = TRUE;
+ targetPrivate->info.flags |= kSCNetworkReachabilityFlagsFirstResolvePending;
+
return (SCNetworkReachabilityRef)targetPrivate;
}
SCNetworkReachabilityCreateWithOptions(CFAllocatorRef allocator,
CFDictionaryRef options)
{
+ CFBooleanRef bypass;
CFDataRef data;
struct addrinfo *hints = NULL;
+ const char *name;
CFStringRef nodename;
CFStringRef servname;
SCNetworkReachabilityPrivateRef targetPrivate;
return NULL;
}
}
+ bypass = CFDictionaryGetValue(options, kSCNetworkReachabilityOptionConnectionOnDemandByPass);
+ if ((bypass != NULL) && !isA_CFBoolean(bypass)) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return NULL;
+ }
if ((nodename == NULL) && (servname == NULL)) {
_SCErrorSet(kSCStatusInvalidArgument);
return NULL;
}
- targetPrivate = __SCNetworkReachabilityCreatePrivate(allocator);
+ name = _SC_cfstring_to_cstring(nodename, NULL, 0, kCFStringEncodingUTF8);
+ targetPrivate = (SCNetworkReachabilityPrivateRef)SCNetworkReachabilityCreateWithName(allocator, name);
+ CFAllocatorDeallocate(NULL, (void *)name);
if (targetPrivate == NULL) {
return NULL;
}
- targetPrivate->type = reachabilityTypeName;
- targetPrivate->flags |= kSCNetworkFlagsFirstResolvePending;
- if (nodename != NULL) {
- targetPrivate->name = _SC_cfstring_to_cstring(nodename, NULL, 0, kCFStringEncodingUTF8);
- }
- if (servname != NULL) {
- targetPrivate->serv = _SC_cfstring_to_cstring(servname, NULL, 0, kCFStringEncodingUTF8);
+
+ if (targetPrivate->type == reachabilityTypeName) {
+ if (servname != NULL) {
+ targetPrivate->serv = _SC_cfstring_to_cstring(servname, NULL, 0, kCFStringEncodingUTF8);
+ }
+ if (hints != NULL) {
+ bcopy(hints, &targetPrivate->hints, sizeof(targetPrivate->hints));
+ }
}
- if (hints != NULL) {
- bcopy(hints, &targetPrivate->hints, sizeof(targetPrivate->hints));
+
+ if (bypass != NULL) {
+ targetPrivate->onDemandBypass = CFBooleanGetValue(bypass);
}
return (SCNetworkReachabilityRef)targetPrivate;
}
-CFArrayRef
+CFArrayRef /* CFArray[CFData], where each CFData is a (struct sockaddr *) */
SCNetworkReachabilityCopyResolvedAddress(SCNetworkReachabilityRef target,
int *error_num)
{
}
if ((status == 0) && (res != NULL)) {
-
CFMutableArrayRef addresses;
addresses = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
for (resP = res; resP; resP = resP->ai_next) {
+ CFIndex n;
CFDataRef newAddress;
newAddress = CFDataCreate(NULL, (void *)resP->ai_addr, resP->ai_addr->sa_len);
- CFArrayAppendValue(addresses, newAddress);
+ n = CFArrayGetCount(addresses);
+ if ((n == 0) ||
+ !CFArrayContainsValue(addresses, CFRangeMake(0, n), newAddress)) {
+ CFArrayAppendValue(addresses, newAddress);
+ }
CFRelease(newAddress);
}
targetPrivate->resolvedAddress = addresses;
targetPrivate->resolvedAddressError = NETDB_SUCCESS;
} else {
- SCLog(_sc_debug, LOG_INFO, CFSTR("getaddrinfo() failed: %s"), gai_strerror(status));
+ SCLog(_sc_debug, LOG_INFO, CFSTR("%sgetaddrinfo() failed: %s"),
+ targetPrivate->log_prefix,
+ gai_strerror(status));
/* save the error associated with the attempt to resolve the name */
targetPrivate->resolvedAddress = CFRetain(kCFNull);
targetPrivate->resolvedAddressError = status;
}
+ targetPrivate->needResolve = FALSE;
if (res != NULL) freeaddrinfo(res);
- if (targetPrivate->rls != NULL) {
- SCLog(_sc_debug, LOG_INFO, CFSTR("DNS request completed"));
- CFRunLoopSourceSignal(targetPrivate->rls);
- _SC_signalRunLoop(target, targetPrivate->rls, targetPrivate->rlList);
+ if (targetPrivate->scheduled) {
+ __SCNetworkReachabilityPerform(target);
}
return;
SCNetworkReachabilityRef target = (SCNetworkReachabilityRef)context;
SCNetworkReachabilityPrivateRef targetPrivate = (SCNetworkReachabilityPrivateRef)target;
- __log_query_time(((status == 0) && (res != NULL)), // if successful query
+ __log_query_time(target,
+ ((status == 0) && (res != NULL)), // if successful query
TRUE, // async
&targetPrivate->dnsQueryStart); // start time
* Reachable == 2
*/
static int
-rankReachability(SCNetworkConnectionFlags flags)
+rankReachability(SCNetworkReachabilityFlags flags)
{
int rank = 0;
- if (flags & kSCNetworkFlagsReachable) rank = 2;
- if (flags & kSCNetworkFlagsConnectionRequired) rank = 1;
+ if (flags & kSCNetworkReachabilityFlagsReachable) rank = 2;
+ if (flags & kSCNetworkReachabilityFlagsConnectionRequired) rank = 1;
return rank;
}
+#pragma mark -
+#pragma mark DNS name resolution
+
+
+static CFStringRef
+replyMPCopyDescription(const void *info)
+{
+ SCNetworkReachabilityRef target = (SCNetworkReachabilityRef)info;
+ SCNetworkReachabilityPrivateRef targetPrivate = (SCNetworkReachabilityPrivateRef)target;
+
+ return CFStringCreateWithFormat(NULL,
+ NULL,
+ CFSTR("<getaddrinfo_async_start reply MP> {%s%s%s%s%s, target = %p}"),
+ targetPrivate->name != NULL ? "name = " : "",
+ targetPrivate->name != NULL ? targetPrivate->name : "",
+ targetPrivate->name != NULL && targetPrivate->serv != NULL ? ", " : "",
+ targetPrivate->serv != NULL ? "serv = " : "",
+ targetPrivate->serv != NULL ? targetPrivate->serv : "",
+ target);
+}
+
+
+static void
+processAsyncDNSReply(mach_port_t mp, void *msg, SCNetworkReachabilityRef target);
+
+
static void
getaddrinfo_async_handleCFReply(CFMachPortRef port, void *msg, CFIndex size, void *info)
+{
+ mach_port_t mp = CFMachPortGetPort(port);
+ SCNetworkReachabilityRef target = (SCNetworkReachabilityRef)info;
+
+ processAsyncDNSReply(mp, msg, target);
+ return;
+}
+
+
+#if !TARGET_OS_IPHONE
+static boolean_t
+SCNetworkReachabilityNotifyMIGCallback(mach_msg_header_t *message, mach_msg_header_t *reply)
+{
+ mach_port_t mp = message->msgh_local_port;
+ SCNetworkReachabilityRef target = dispatch_get_context(dispatch_get_current_queue());
+
+ processAsyncDNSReply(mp, message, target);
+ reply->msgh_remote_port = MACH_PORT_NULL;
+ return false;
+}
+#endif // !TARGET_OS_IPHONE
+
+
+static Boolean
+enqueueAsyncDNSQuery(SCNetworkReachabilityRef target, mach_port_t mp)
+{
+ CFMachPortContext context = { 0
+ , (void *)target
+ , CFRetain
+ , CFRelease
+ , replyMPCopyDescription
+ };
+ SCNetworkReachabilityPrivateRef targetPrivate = (SCNetworkReachabilityPrivateRef)target;
+
+ targetPrivate->dnsMP = mp;
+ targetPrivate->dnsPort = CFMachPortCreateWithPort(NULL,
+ mp,
+ getaddrinfo_async_handleCFReply,
+ &context,
+ NULL);
+#if !TARGET_OS_IPHONE
+ if (targetPrivate->dispatchQueue != NULL) {
+ dispatch_queue_attr_t attr;
+ long res;
+
+ attr = dispatch_queue_attr_create();
+ res = dispatch_queue_attr_set_finalizer(attr,
+ ^(dispatch_queue_t dq) {
+ SCNetworkReachabilityRef target;
+
+ target = (SCNetworkReachabilityRef)dispatch_get_context(dq);
+ CFRelease(target);
+ });
+ if (res != 0) {
+ SCLog(TRUE, LOG_ERR, CFSTR("SCNetworkReachability dispatch_queue_attr_set_finalizer() failed"));
+ dispatch_release(attr);
+ goto fail;
+ }
+ targetPrivate->asyncDNSQueue = dispatch_queue_create("com.apple.SCNetworkReachabilty.async_DNS_query", attr);
+ dispatch_release(attr);
+ if (targetPrivate->asyncDNSQueue == NULL) {
+ SCLog(TRUE, LOG_ERR, CFSTR("SCNetworkReachability dispatch_queue_create() failed"));
+ goto fail;
+ }
+ CFRetain(target); // Note: will be released when the dispatch queue is released
+ dispatch_set_context(targetPrivate->asyncDNSQueue, (void *)target);
+ targetPrivate->asyncDNSSource = dispatch_source_mig_create(mp,
+ sizeof(mach_msg_header_t),
+ NULL,
+ targetPrivate->asyncDNSQueue,
+ SCNetworkReachabilityNotifyMIGCallback);
+ if (targetPrivate->asyncDNSSource == NULL) {
+ SCLog(TRUE, LOG_ERR, CFSTR("SCNetworkReachability dispatch_source_mig_create() failed"));
+ goto fail;
+ }
+ } else
+#endif // !TARGET_OS_IPHONE
+ if (targetPrivate->rls != NULL) {
+ CFIndex i;
+ CFIndex n;
+
+ targetPrivate->dnsRLS = CFMachPortCreateRunLoopSource(NULL, targetPrivate->dnsPort, 0);
+
+ n = CFArrayGetCount(targetPrivate->rlList);
+ for (i = 0; i < n; i += 3) {
+ CFRunLoopRef rl = (CFRunLoopRef)CFArrayGetValueAtIndex(targetPrivate->rlList, i+1);
+ CFStringRef rlMode = (CFStringRef) CFArrayGetValueAtIndex(targetPrivate->rlList, i+2);
+
+ CFRunLoopAddSource(rl, targetPrivate->dnsRLS, rlMode);
+ }
+ }
+
+ return TRUE;
+
+#if !TARGET_OS_IPHONE
+ fail :
+
+ if (targetPrivate->asyncDNSSource != NULL) {
+ dispatch_cancel(targetPrivate->asyncDNSSource);
+ dispatch_release(targetPrivate->asyncDNSSource);
+ targetPrivate->asyncDNSSource = NULL;
+ }
+ if (targetPrivate->asyncDNSQueue != NULL) {
+ dispatch_release(targetPrivate->asyncDNSQueue);
+ targetPrivate->asyncDNSQueue = NULL;
+ }
+
+ CFMachPortInvalidate(targetPrivate->dnsPort);
+ CFRelease(targetPrivate->dnsPort);
+ targetPrivate->dnsPort = NULL;
+ targetPrivate->dnsMP = MACH_PORT_NULL;
+
+ _SCErrorSet(kSCStatusFailed);
+ return FALSE;
+#endif // !TARGET_OS_IPHONE
+}
+
+
+static void
+dequeueAsyncDNSQuery(SCNetworkReachabilityRef target)
+{
+ SCNetworkReachabilityPrivateRef targetPrivate = (SCNetworkReachabilityPrivateRef)target;
+
+#if !TARGET_OS_IPHONE
+ if (targetPrivate->asyncDNSSource != NULL) {
+ dispatch_cancel(targetPrivate->asyncDNSSource);
+ dispatch_release(targetPrivate->asyncDNSSource);
+ targetPrivate->asyncDNSSource = NULL;
+ }
+ if (targetPrivate->asyncDNSQueue != NULL) {
+ dispatch_release(targetPrivate->asyncDNSQueue);
+ targetPrivate->asyncDNSQueue = NULL;
+ }
+#endif // !TARGET_OS_IPHONE
+
+ if (targetPrivate->dnsRLS != NULL) {
+ CFRelease(targetPrivate->dnsRLS);
+ targetPrivate->dnsRLS = NULL;
+ }
+
+ CFMachPortInvalidate(targetPrivate->dnsPort);
+ CFRelease(targetPrivate->dnsPort);
+ targetPrivate->dnsPort = NULL;
+ targetPrivate->dnsMP = MACH_PORT_NULL;
+
+ return;
+}
+
+
+static void
+processAsyncDNSReply(mach_port_t mp, void *msg, SCNetworkReachabilityRef target)
{
int32_t status;
- SCNetworkReachabilityRef target = (SCNetworkReachabilityRef)info;
SCNetworkReachabilityPrivateRef targetPrivate = (SCNetworkReachabilityPrivateRef)target;
pthread_mutex_lock(&targetPrivate->lock);
+ if (mp != targetPrivate->dnsMP) {
+ // we've received a callback on the async DNS port but since the
+ // associated CFMachPort doesn't match than the request must have
+ // already been cancelled.
+ SCLog(TRUE, LOG_ERR, CFSTR("processAsyncDNSReply(): mp != targetPrivate->dnsMP"));
+ pthread_mutex_unlock(&targetPrivate->lock);
+ return;
+ }
+
+ dequeueAsyncDNSQuery(target);
status = getaddrinfo_async_handle_reply(msg);
if ((status == 0) &&
(targetPrivate->resolvedAddress == NULL) && (targetPrivate->resolvedAddressError == NETDB_SUCCESS)) {
- // if request has been re-queued
- goto again;
- }
+ Boolean ok;
- if (port == targetPrivate->dnsPort) {
- CFRunLoopSourceInvalidate(targetPrivate->dnsRLS);
- CFRelease(targetPrivate->dnsRLS);
- targetPrivate->dnsRLS = NULL;
- CFRelease(targetPrivate->dnsPort);
- targetPrivate->dnsPort = NULL;
+ // if the request is not complete and needs to be re-queued
+ ok = enqueueAsyncDNSQuery(target, mp);
+ if (!ok) {
+ SCLog(TRUE, LOG_ERR, CFSTR("processAsyncDNSReply enqueueAsyncDNSQuery() failed"));
+ }
}
- again :
-
pthread_mutex_unlock(&targetPrivate->lock);
return;
static Boolean
check_resolver_reachability(SCDynamicStoreRef *storeP,
dns_resolver_t *resolver,
- SCNetworkConnectionFlags *flags,
- Boolean *haveDNS)
+ SCNetworkReachabilityFlags *flags,
+ Boolean *haveDNS,
+ const char *log_prefix)
{
int i;
Boolean ok = TRUE;
- *flags = kSCNetworkFlagsReachable;
+ *flags = kSCNetworkReachabilityFlagsReachable;
*haveDNS = FALSE;
for (i = 0; i < resolver->n_nameserver; i++) {
- struct sockaddr *address = resolver->nameserver[i];
- SCNetworkConnectionFlags ns_flags = 0;
+ struct sockaddr *address = resolver->nameserver[i];
+ ReachabilityInfo ns_info;
*haveDNS = TRUE;
continue;
}
- ok = checkAddress(storeP, address, &ns_flags, NULL);
+ ok = checkAddress(storeP, address, &ns_info, log_prefix);
if (!ok) {
/* not today */
goto done;
}
- if (rankReachability(ns_flags) < rankReachability(*flags)) {
+ if (rankReachability(ns_info.flags) < rankReachability(*flags)) {
/* return the worst case result */
- *flags = ns_flags;
+ *flags = ns_info.flags;
}
}
check_matching_resolvers(SCDynamicStoreRef *storeP,
dns_config_t *dns_config,
const char *fqdn,
- SCNetworkConnectionFlags *flags,
- Boolean *haveDNS)
+ SCNetworkReachabilityFlags *flags,
+ Boolean *haveDNS,
+ const char *log_prefix)
{
int i;
Boolean matched = FALSE;
* if name matches domain
*/
matched = TRUE;
- ok = check_resolver_reachability(storeP, resolver, flags, haveDNS);
+ ok = check_resolver_reachability(storeP, resolver, flags, haveDNS, log_prefix);
if (!ok) {
/* not today */
return FALSE;
}
-Boolean
-_SC_checkResolverReachability(SCDynamicStoreRef *storeP,
- SCNetworkConnectionFlags *flags,
- Boolean *haveDNS,
- const char * nodename,
- const char * servname)
+static Boolean
+_SC_R_checkResolverReachability(SCDynamicStoreRef *storeP,
+ SCNetworkReachabilityFlags *flags,
+ Boolean *haveDNS,
+ const char *nodename,
+ const char *servname,
+ const char *log_prefix)
{
dns_resolver_t *default_resolver;
dns_configuration_t *dns;
Boolean isFQDN = FALSE;
uint32_t len;
Boolean ok = TRUE;
+ Boolean useDefault = FALSE;
/*
* We first assume that all of the configured DNS servers
* proceed if we know that our query can be answered.
*/
- *flags = kSCNetworkFlagsReachable;
+ *flags = kSCNetworkReachabilityFlagsReachable;
*haveDNS = FALSE;
len = (nodename != NULL) ? strlen(nodename) : 0;
dns = dns_configuration_retain();
if (dns == NULL) {
// if error
+ SCLog(_sc_debug, LOG_INFO, CFSTR("%sDNS: no configuration"), log_prefix);
goto done;
}
if (dns->config->n_resolver == 0) {
// if no resolver configuration
+ SCLog(_sc_debug, LOG_INFO, CFSTR("%sDNS: no resolvers"), log_prefix);
goto done;
}
- *flags = kSCNetworkFlagsReachable;
+ *flags = kSCNetworkReachabilityFlagsReachable;
if (fqdn[len - 1] == '.') {
isFQDN = TRUE;
default_resolver = dns->config->resolver[0];
/*
- * try the provided name
+ * check if the provided name matches a supplemental domain
*/
- found = check_matching_resolvers(storeP, dns->config, fqdn, flags, haveDNS);
- if (!found && !isFQDN && (dns->config->n_resolver > 1)) {
+ found = check_matching_resolvers(storeP, dns->config, fqdn, flags, haveDNS, log_prefix);
+
+ if (!found && !isFQDN) {
+ /*
+ * if we did not match a supplemental domain name and if the
+ * provided name has enough "."s then the first query will be
+ * directed to the default resolver.
+ */
+ char *cp;
+ int dots;
+ int ndots = 1;
+
+#define NDOTS_OPT "ndots="
+#define NDOTS_OPT_LEN (sizeof("ndots=") - 1)
+
+ if (default_resolver->options != NULL) {
+ cp = strstr(default_resolver->options, NDOTS_OPT);
+ if ((cp != NULL) &&
+ ((cp == default_resolver->options) || isspace(cp[-1])) &&
+ ((cp[NDOTS_OPT_LEN] != '\0') && isdigit(cp[NDOTS_OPT_LEN]))) {
+ char *end;
+ long val;
+
+ cp += NDOTS_OPT_LEN;
+ errno = 0;
+ val = strtol(cp, &end, 10);
+ if ((*cp != '\0') && (cp != end) && (errno == 0) &&
+ ((*end == '\0') || isspace(*end))) {
+ ndots = val;
+ }
+ }
+ }
+
+ dots = 0;
+ for (cp = fqdn; *cp != '\0'; cp++) {
+ if (*cp == '.') dots++;
+ }
+
+ if (dots > ndots) {
+ useDefault = TRUE;
+ }
+ }
+
+ if (!found && !isFQDN && !useDefault && (dns->config->n_resolver > 1)) {
/*
- * FQDN not specified, try w/search or default domain(s) too
+ * FQDN not specified, try matching w/search domains
*/
if (default_resolver->n_search > 0) {
for (i = 0; !found && (i < default_resolver->n_search); i++) {
}
// try the provided name with the search domain appended
- found = check_matching_resolvers(storeP, dns->config, search_fqdn, flags, haveDNS);
+ found = check_matching_resolvers(storeP,
+ dns->config,
+ search_fqdn,
+ flags,
+ haveDNS,
+ log_prefix);
free(search_fqdn);
}
} else if (default_resolver->domain != NULL) {
}
// try the provided name with the [default] domain appended
- found = check_matching_resolvers(storeP, dns->config, search_fqdn, flags, haveDNS);
+ found = check_matching_resolvers(storeP,
+ dns->config,
+ search_fqdn,
+ flags,
+ haveDNS,
+ log_prefix);
free(search_fqdn);
// move to the next component of the [default] domain
/*
* check the reachability of the default resolver
*/
- ok = check_resolver_reachability(storeP, default_resolver, flags, haveDNS);
+ ok = check_resolver_reachability(storeP, default_resolver, flags, haveDNS, log_prefix);
}
if (fqdn != nodename) free(fqdn);
}
+Boolean
+_SC_checkResolverReachability(SCDynamicStoreRef *storeP,
+ SCNetworkReachabilityFlags *flags,
+ Boolean *haveDNS,
+ const char *nodename,
+ const char *servname)
+{
+ return _SC_R_checkResolverReachability(storeP, flags, haveDNS, nodename, servname, "");
+}
+
+
/*
* _SC_checkResolverReachabilityByAddress()
*
* using the current network configuration.
*/
Boolean
-_SC_checkResolverReachabilityByAddress(SCDynamicStoreRef *storeP,
- SCNetworkConnectionFlags *flags,
- Boolean *haveDNS,
- struct sockaddr *sa)
+_SC_checkResolverReachabilityByAddress(SCDynamicStoreRef *storeP,
+ SCNetworkReachabilityFlags *flags,
+ Boolean *haveDNS,
+ struct sockaddr *sa)
{
int i;
Boolean ok = FALSE;
goto done;
}
- ok = _SC_checkResolverReachability(storeP, flags, haveDNS, ptr_name, NULL);
+ ok = _SC_R_checkResolverReachability(storeP, flags, haveDNS, ptr_name, NULL, "");
done :
}
-static CFStringRef
-replyMPCopyDescription(const void *info)
-{
- SCNetworkReachabilityRef target = (SCNetworkReachabilityRef)info;
- SCNetworkReachabilityPrivateRef targetPrivate = (SCNetworkReachabilityPrivateRef)target;
-
- return CFStringCreateWithFormat(NULL,
- NULL,
- CFSTR("<getaddrinfo_async_start reply MP> {%s%s%s%s%s, target = %p}"),
- targetPrivate->name != NULL ? "name = " : "",
- targetPrivate->name != NULL ? targetPrivate->name : "",
- targetPrivate->name != NULL && targetPrivate->serv != NULL ? ", " : "",
- targetPrivate->serv != NULL ? "serv = " : "",
- targetPrivate->serv != NULL ? targetPrivate->serv : "",
- target);
-}
-
-
static Boolean
startAsyncDNSQuery(SCNetworkReachabilityRef target) {
- CFMachPortContext context = { 0
- , (void *)target
- , CFRetain
- , CFRelease
- , replyMPCopyDescription
- };
int error;
- CFIndex i;
- CFIndex n;
- mach_port_t port;
+ mach_port_t mp;
+ Boolean ok;
SCNetworkReachabilityPrivateRef targetPrivate = (SCNetworkReachabilityPrivateRef)target;
(void) gettimeofday(&targetPrivate->dnsQueryStart, NULL);
- error = getaddrinfo_async_start(&port,
+ error = getaddrinfo_async_start(&mp,
targetPrivate->name,
targetPrivate->serv,
&targetPrivate->hints,
return FALSE;
}
- targetPrivate->dnsPort = CFMachPortCreateWithPort(NULL,
- port,
- getaddrinfo_async_handleCFReply,
- &context,
- NULL);
- targetPrivate->dnsRLS = CFMachPortCreateRunLoopSource(NULL, targetPrivate->dnsPort, 0);
-
- n = CFArrayGetCount(targetPrivate->rlList);
- for (i = 0; i < n; i += 3) {
- CFRunLoopRef rl = (CFRunLoopRef)CFArrayGetValueAtIndex(targetPrivate->rlList, i+1);
- CFStringRef rlMode = (CFStringRef) CFArrayGetValueAtIndex(targetPrivate->rlList, i+2);
+ ok = enqueueAsyncDNSQuery(target, mp);
+ return ok;
+}
- CFRunLoopAddSource(rl, targetPrivate->dnsRLS, rlMode);
- }
- return TRUE;
-}
+#pragma mark -
+#pragma mark OnDemand
-static Boolean
-__SCNetworkReachabilityGetFlags(SCDynamicStoreRef *storeP,
- SCNetworkReachabilityRef target,
- SCNetworkConnectionFlags *flags,
- uint16_t *if_index,
- Boolean async)
+SCNetworkServiceRef
+SCNetworkReachabilityCopyOnDemandService(SCNetworkReachabilityRef target,
+ CFDictionaryRef *userOptions)
{
- CFMutableArrayRef addresses = NULL;
+ SCNetworkServiceRef service = NULL;
SCNetworkReachabilityPrivateRef targetPrivate = (SCNetworkReachabilityPrivateRef)target;
- SCNetworkConnectionFlags my_flags = 0;
- uint16_t my_index = 0;
- Boolean ok = TRUE;
-
- *flags = 0;
- if (if_index != NULL) {
- *if_index = 0;
- }
if (!isA_SCNetworkReachability(target)) {
_SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
+ return NULL;
}
- switch (targetPrivate->type) {
- case reachabilityTypeAddress :
- case reachabilityTypeAddressPair : {
- /*
- * Check "local" address
- */
- if (targetPrivate->localAddress != NULL) {
- /*
+ if (targetPrivate->onDemandServiceID != NULL) {
+ service = _SCNetworkServiceCopyActive(NULL, targetPrivate->onDemandServiceID);
+ }
+
+ if (userOptions != NULL) {
+ if (targetPrivate->onDemandName != NULL) {
+ *userOptions = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+ CFDictionarySetValue((CFMutableDictionaryRef)*userOptions, kSCNetworkConnectionSelectionOptionOnDemandHostName, targetPrivate->onDemandName);
+ } else {
+ *userOptions = NULL;
+ }
+ }
+
+ return service;
+}
+
+
+static void
+__SCNetworkReachabilityOnDemandCheckCallback(SCNetworkReachabilityRef onDemandServer,
+ SCNetworkReachabilityFlags onDemandFlags,
+ void *info)
+{
+ SCNetworkReachabilityRef target = (SCNetworkReachabilityRef)info;
+ SCNetworkReachabilityPrivateRef targetPrivate = (SCNetworkReachabilityPrivateRef)target;
+
+ pthread_mutex_lock(&targetPrivate->lock);
+
+ if (!targetPrivate->scheduled) {
+ // if not currently scheduled
+ pthread_mutex_unlock(&targetPrivate->lock);
+ return;
+ }
+
+ SCLog(_sc_debug, LOG_INFO, CFSTR("%sOnDemand \"server\" status changed"),
+ targetPrivate->log_prefix);
+ __SCNetworkReachabilityPerform(target);
+
+ pthread_mutex_unlock(&targetPrivate->lock);
+
+ return;
+}
+
+
+static Boolean
+__SCNetworkReachabilityOnDemandCheck(SCDynamicStoreRef *storeP,
+ SCNetworkReachabilityRef target,
+ Boolean onDemandRetry,
+ SCNetworkReachabilityFlags *flags)
+{
+ Boolean ok;
+ Boolean onDemand = FALSE;
+ CFStringRef onDemandRemoteAddress = NULL;
+ CFStringRef onDemandServiceID = NULL;
+ SCNetworkConnectionStatus onDemandStatus;
+ SCNetworkReachabilityPrivateRef targetPrivate = (SCNetworkReachabilityPrivateRef)target;
+
+// SCLog(_sc_debug, LOG_INFO,
+// CFSTR("%s__SCNetworkReachabilityOnDemandCheck %s"),
+// targetPrivate->log_prefix,
+// onDemandRetry ? "after" : "before");
+
+ if (targetPrivate->onDemandName == NULL) {
+ targetPrivate->onDemandName = CFStringCreateWithCString(NULL, targetPrivate->name, kCFStringEncodingUTF8);
+ }
+
+ /*
+ * check if an OnDemand VPN configuration matches the name.
+ */
+ ok = __SCNetworkConnectionCopyOnDemandInfoWithName(storeP,
+ targetPrivate->onDemandName,
+ onDemandRetry,
+ &onDemandServiceID,
+ &onDemandStatus,
+ &onDemandRemoteAddress);
+ if (!_SC_CFEqual(targetPrivate->onDemandRemoteAddress, onDemandRemoteAddress) ||
+ !_SC_CFEqual(targetPrivate->onDemandServiceID, onDemandServiceID)) {
+ if (targetPrivate->onDemandRemoteAddress != NULL) {
+ CFRelease(targetPrivate->onDemandRemoteAddress);
+ targetPrivate->onDemandRemoteAddress = NULL;
+ }
+
+ if (targetPrivate->onDemandServer != NULL) {
+#if !TARGET_OS_IPHONE
+ if (targetPrivate->dispatchQueue != NULL) {
+ // unschedule
+ __SCNetworkReachabilityUnscheduleFromRunLoop(targetPrivate->onDemandServer, NULL, NULL, TRUE);
+ } else
+#endif // !TARGET_OS_IPHONE
+ if (targetPrivate->rls != NULL) {
+ CFIndex i;
+ CFIndex n;
+
+ // unschedule
+ n = CFArrayGetCount(targetPrivate->rlList);
+ for (i = 0; i < n; i += 3) {
+ CFRunLoopRef rl = (CFRunLoopRef)CFArrayGetValueAtIndex(targetPrivate->rlList, i+1);
+ CFStringRef rlMode = (CFStringRef) CFArrayGetValueAtIndex(targetPrivate->rlList, i+2);
+
+ __SCNetworkReachabilityUnscheduleFromRunLoop(targetPrivate->onDemandServer, rl, rlMode, TRUE);
+ }
+ }
+
+ CFRelease(targetPrivate->onDemandServer);
+ targetPrivate->onDemandServer = NULL;
+ }
+
+ if (targetPrivate->onDemandServiceID != NULL) {
+ CFRelease(targetPrivate->onDemandServiceID);
+ targetPrivate->onDemandServiceID = NULL;
+ }
+ }
+ if (ok) {
+ if (onDemandStatus != kSCNetworkConnectionConnected) {
+ /*
+ * if we have a VPN configuration matching the name *and* we need to
+ * bring the VPN up. Combine our flags with those of the VPN server.
+ */
+ if (targetPrivate->onDemandServer == NULL) {
+ CFMutableDictionaryRef options;
+
+ options = CFDictionaryCreateMutable(NULL,
+ 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ CFDictionarySetValue(options, kSCNetworkReachabilityOptionNodeName, onDemandRemoteAddress);
+ CFDictionarySetValue(options, kSCNetworkReachabilityOptionConnectionOnDemandByPass, kCFBooleanTrue);
+ targetPrivate->onDemandServer = SCNetworkReachabilityCreateWithOptions(NULL, options);
+ CFRelease(options);
+
+ if (targetPrivate->scheduled) {
+ SCNetworkReachabilityContext context = { 0, NULL, CFRetain, CFRelease, CFCopyDescription };
+
+ context.info = (void *)target;
+ SCNetworkReachabilitySetCallback(targetPrivate->onDemandServer,
+ __SCNetworkReachabilityOnDemandCheckCallback,
+ &context);
+
+ // schedule server reachability to match that of the target
+#if !TARGET_OS_IPHONE
+ if (targetPrivate->dispatchQueue != NULL) {
+ __SCNetworkReachabilityScheduleWithRunLoop(targetPrivate->onDemandServer, NULL, NULL, targetPrivate->dispatchQueue, TRUE);
+ } else
+#endif // !TARGET_OS_IPHONE
+ {
+ CFIndex i;
+ CFIndex n;
+
+ n = CFArrayGetCount(targetPrivate->rlList);
+ for (i = 0; i < n; i += 3) {
+ CFRunLoopRef rl = (CFRunLoopRef)CFArrayGetValueAtIndex(targetPrivate->rlList, i+1);
+ CFStringRef rlMode = (CFStringRef) CFArrayGetValueAtIndex(targetPrivate->rlList, i+2);
+
+ __SCNetworkReachabilityScheduleWithRunLoop(targetPrivate->onDemandServer, rl, rlMode, NULL, TRUE);
+ }
+ }
+ }
+ }
+
+ ok = SCNetworkReachabilityGetFlags(targetPrivate->onDemandServer, flags);
+ SCLog(_sc_debug, LOG_INFO, CFSTR("%s status * = 0x%08x"),
+ targetPrivate->log_prefix,
+ *flags);
+ if (ok && (*flags & kSCNetworkReachabilityFlagsReachable)) {
+ if (!(*flags & kSCNetworkReachabilityFlagsTransientConnection)) {
+ // start clean if not already layered on a transient network
+ *flags = 0;
+ }
+ *flags |= kSCNetworkReachabilityFlagsReachable;
+ *flags |= kSCNetworkReachabilityFlagsTransientConnection;
+ *flags |= kSCNetworkReachabilityFlagsConnectionRequired;
+ *flags |= kSCNetworkReachabilityFlagsConnectionOnDemand;
+
+ if (_sc_debug) {
+ SCLog(TRUE, LOG_INFO, CFSTR("%s service * = %@"),
+ targetPrivate->log_prefix,
+ onDemandServiceID);
+ SCLog(TRUE, LOG_INFO, CFSTR("%s status = isReachable (after OnDemand connect)"),
+ targetPrivate->log_prefix);
+ }
+
+ onDemand = TRUE;
+ }
+ }
+
+ if (onDemandRemoteAddress != NULL) {
+ if (targetPrivate->onDemandRemoteAddress == NULL) {
+ targetPrivate->onDemandRemoteAddress = onDemandRemoteAddress;
+ } else {
+ CFRelease(onDemandRemoteAddress);
+ }
+ }
+
+ if (onDemandServiceID != NULL) {
+ if (targetPrivate->onDemandServiceID == NULL) {
+ targetPrivate->onDemandServiceID = onDemandServiceID;
+ } else {
+ CFRelease(onDemandServiceID);
+ }
+ }
+ }
+
+ return onDemand;
+}
+
+
+#pragma mark -
+#pragma mark Reachability Flags
+
+
+static Boolean
+__SCNetworkReachabilityGetFlags(SCDynamicStoreRef *storeP,
+ SCNetworkReachabilityRef target,
+ ReachabilityInfo *reach_info,
+ Boolean async)
+{
+ CFMutableArrayRef addresses = NULL;
+ SCNetworkReachabilityPrivateRef targetPrivate = (SCNetworkReachabilityPrivateRef)target;
+ ReachabilityInfo my_info = NOT_REACHABLE;
+ Boolean ok = TRUE;
+
+ *reach_info = NOT_REACHABLE;
+
+ if (!isA_SCNetworkReachability(target)) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return FALSE;
+ }
+
+ switch (targetPrivate->type) {
+ case reachabilityTypeAddress :
+ case reachabilityTypeAddressPair : {
+ /*
+ * Check "local" address
+ */
+ if (targetPrivate->localAddress != NULL) {
+ /*
* Check "local" address
*/
- ok = checkAddress(storeP, targetPrivate->localAddress, &my_flags, &my_index);
+ ok = checkAddress(storeP,
+ targetPrivate->localAddress,
+ &my_info,
+ targetPrivate->log_prefix);
if (!ok) {
goto error; /* not today */
}
- if (!(my_flags & kSCNetworkFlagsIsLocalAddress)) {
+ if (!(my_info.flags & kSCNetworkReachabilityFlagsIsLocalAddress)) {
goto error; /* not reachable, non-"local" address */
}
}
* in cases where we have "local" and "remote" addresses
* we need to re-initialize the to-be-returned flags.
*/
- my_flags = 0;
- my_index = 0;
+ my_info = NOT_REACHABLE;
/*
* Check "remote" address
*/
- ok = checkAddress(storeP, targetPrivate->remoteAddress, &my_flags, &my_index);
+ ok = checkAddress(storeP,
+ targetPrivate->remoteAddress,
+ &my_info,
+ targetPrivate->log_prefix);
if (!ok) {
goto error; /* not today */
}
case reachabilityTypeName : {
struct timeval dnsQueryStart;
int error;
- SCNetworkConnectionFlags ns_flags;
+ SCNetworkReachabilityFlags ns_flags;
struct addrinfo *res;
addresses = (CFMutableArrayRef)SCNetworkReachabilityCopyResolvedAddress(target, &error);
if ((addresses != NULL) || (error != NETDB_SUCCESS)) {
/* if resolved or an error had been detected */
- goto checkResolvedAddress;
+ if (!async) {
+ /* if not an async request */
+ goto checkResolvedAddress;
+ } else if ((targetPrivate->dnsPort == NULL) && !targetPrivate->needResolve) {
+ /* if async request, no query active, and no query needed */
+ goto checkResolvedAddress;
+ }
+ }
+
+ if (!targetPrivate->onDemandBypass) {
+ Boolean onDemand;
+
+ /*
+ * before we attempt our initial DNS query, check if there is
+ * an OnDemand configuration that we should be using.
+ */
+ onDemand = __SCNetworkReachabilityOnDemandCheck(storeP, target, FALSE, &my_info.flags);
+ if (onDemand) {
+ /* if OnDemand connection is needed */
+ goto done;
+ }
}
/* check the reachability of the DNS servers */
- ok = _SC_checkResolverReachability(storeP,
- &ns_flags,
- &targetPrivate->haveDNS,
- targetPrivate->name,
- targetPrivate->serv);
+ ok = _SC_R_checkResolverReachability(storeP,
+ &ns_flags,
+ &targetPrivate->haveDNS,
+ targetPrivate->name,
+ targetPrivate->serv,
+ targetPrivate->log_prefix);
if (!ok) {
/* if we could not get DNS server info */
+ SCLog(_sc_debug, LOG_INFO, CFSTR("%sDNS server reachability unknown"),
+ targetPrivate->log_prefix);
goto error;
- }
-
- if (rankReachability(ns_flags) < 2) {
+ } else if (rankReachability(ns_flags) < 2) {
/*
* if DNS servers are not (or are no longer) reachable, set
* flags based on the availability of configured (but not
* active) services.
*/
- SCLog(_sc_debug, LOG_INFO, CFSTR("DNS server(s) not available"));
+ SCLog(_sc_debug, LOG_INFO, CFSTR("%sDNS server(s) not available"),
+ targetPrivate->log_prefix);
- if (!checkAddress(storeP, NULL, &my_flags, &my_index)) {
+ ok = checkAddress(storeP,
+ NULL,
+ &my_info,
+ targetPrivate->log_prefix);
+ if (!ok) {
+ SCLog(_sc_debug, LOG_INFO, CFSTR("%sNo available networks"),
+ targetPrivate->log_prefix);
goto error;
}
- if (async && (targetPrivate->rls != NULL)) {
+ if (async && targetPrivate->scheduled) {
/*
* return "host not found", set flags appropriately,
* and schedule notification.
__SCNetworkReachabilityCallbackSetResolvedAddress(EAI_NONAME,
NULL,
(void *)target);
- my_flags |= (targetPrivate->flags & kSCNetworkFlagsFirstResolvePending);
+ my_info.flags |= (targetPrivate->info.flags & kSCNetworkReachabilityFlagsFirstResolvePending);
- SCLog(_sc_debug, LOG_INFO, CFSTR("no DNS servers are reachable"));
- CFRunLoopSourceSignal(targetPrivate->rls);
- _SC_signalRunLoop(target, targetPrivate->rls, targetPrivate->rlList);
+ SCLog(_sc_debug, LOG_INFO, CFSTR("%sno DNS servers are reachable"),
+ targetPrivate->log_prefix);
+ __SCNetworkReachabilityPerform(target);
}
break;
}
if (async) {
/* for async requests we return the last known status */
- my_flags = targetPrivate->flags;
- my_index = targetPrivate->if_index;
+ my_info = targetPrivate->info;
if (targetPrivate->dnsPort != NULL) {
/* if request already in progress */
+ SCLog(_sc_debug, LOG_INFO,
+ CFSTR("%swaiting for DNS reply"),
+ targetPrivate->log_prefix);
+ if ((addresses != NULL) || (error != NETDB_SUCCESS)) {
+ /* updated reachability based on the previous reply */
+ goto checkResolvedAddress;
+ }
break;
}
SCLog(_sc_debug, LOG_INFO,
- CFSTR("start DNS query for %s%s%s%s%s"),
+ CFSTR("%sstart DNS query for %s%s%s%s%s"),
+ targetPrivate->log_prefix,
targetPrivate->name != NULL ? "name = " : "",
targetPrivate->name != NULL ? targetPrivate->name : "",
targetPrivate->name != NULL && targetPrivate->serv != NULL ? ", " : "",
}
SCLog(_sc_debug, LOG_INFO,
- CFSTR("check DNS for %s%s%s%s%s"),
+ CFSTR("%scheck DNS for %s%s%s%s%s"),
+ targetPrivate->log_prefix,
targetPrivate->name != NULL ? "name = " : "",
targetPrivate->name != NULL ? targetPrivate->name : "",
targetPrivate->name != NULL && targetPrivate->serv != NULL ? ", " : "",
&targetPrivate->hints,
&res);
- __log_query_time(((error == 0) && (res != NULL)),// if successful query
- FALSE, // sync
- &dnsQueryStart); // start time
+ __log_query_time(target,
+ ((error == 0) && (res != NULL)), // if successful query
+ FALSE, // sync
+ &dnsQueryStart); // start time
__SCNetworkReachabilitySetResolvedAddress(error, res, target);
* Then, check each address for accessibility and return the
* best status available.
*/
- my_flags = 0;
- my_index = 0;
+ my_info = NOT_REACHABLE;
if (isA_CFArray(addresses)) {
CFIndex i;
CFIndex n = CFArrayGetCount(addresses);
for (i = 0; i < n; i++) {
- SCNetworkConnectionFlags ns_flags = 0;
- uint16_t ns_if_index = 0;
- struct sockaddr *sa;
+ ReachabilityInfo ns_info = NOT_REACHABLE;
+ struct sockaddr *sa;
sa = (struct sockaddr *)CFDataGetBytePtr(CFArrayGetValueAtIndex(addresses, i));
- ok = checkAddress(storeP, sa, &ns_flags, &ns_if_index);
+ ok = checkAddress(storeP,
+ sa,
+ &ns_info,
+ targetPrivate->log_prefix);
if (!ok) {
goto error; /* not today */
}
- if (rankReachability(ns_flags) > rankReachability(my_flags)) {
+ if (rankReachability(ns_info.flags) > rankReachability(my_info.flags)) {
/* return the best case result */
- my_flags = ns_flags;
- my_index = ns_if_index;
- if (rankReachability(my_flags) == 2) {
+ my_info = ns_info;
+ if (rankReachability(my_info.flags) == 2) {
/* we're in luck */
break;
}
}
}
} else {
- if (((error == EAI_NONAME)
+ if ((error == EAI_NONAME)
#if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME)
|| (error == EAI_NODATA)
#endif
- ) && !targetPrivate->haveDNS) {
+ ) {
/*
- * No DNS servers are defined. Set flags based on
- * the availability of configured (but not active)
- * services.
+ * the target host name could not be resolved
*/
- ok = checkAddress(storeP, NULL, &my_flags, &my_index);
- if (!ok) {
- goto error; /* not today */
- }
+ if (!targetPrivate->onDemandBypass) {
+ Boolean onDemand;
- if ((my_flags & kSCNetworkFlagsReachable) &&
- (my_flags & kSCNetworkFlagsConnectionRequired)) {
/*
- * Since we might pick up a set of DNS servers when this connection
- * is established, don't reply with a "HOST NOT FOUND" error just yet.
+ * our initial DNS query failed, check again to see if there
+ * there is an OnDemand configuration that we should be using.
*/
- break;
+ onDemand = __SCNetworkReachabilityOnDemandCheck(storeP, target, TRUE, &my_info.flags);
+ if (onDemand) {
+ /* if OnDemand connection is needed */
+ goto done;
+ }
}
- /* Host not found, not reachable! */
- my_flags = 0;
- my_index = 0;
+ if (!targetPrivate->haveDNS) {
+ /*
+ * No DNS servers are defined. Set flags based on
+ * the availability of configured (but not active)
+ * services.
+ */
+ ok = checkAddress(storeP,
+ NULL,
+ &my_info,
+ targetPrivate->log_prefix);
+ if (!ok) {
+ goto error; /* not today */
+ }
+
+ if ((my_info.flags & kSCNetworkReachabilityFlagsReachable) &&
+ (my_info.flags & kSCNetworkReachabilityFlagsConnectionRequired)) {
+ /*
+ * Since we might pick up a set of DNS servers when this connection
+ * is established, don't reply with a "HOST NOT FOUND" error just yet.
+ */
+ break;
+ }
+
+ /* Host not found, not reachable! */
+ my_info = NOT_REACHABLE;
+ }
}
}
}
}
- *flags = my_flags;
- if (if_index != NULL) {
- *if_index = my_index;
- }
+ done:
+
+ *reach_info = my_info;
error :
Boolean
-SCNetworkReachabilityGetFlags(SCNetworkReachabilityRef target,
- SCNetworkConnectionFlags *flags)
+SCNetworkReachabilityGetFlags(SCNetworkReachabilityRef target,
+ SCNetworkReachabilityFlags *flags)
{
Boolean ok = TRUE;
SCDynamicStoreRef store = NULL;
pthread_mutex_lock(&targetPrivate->lock);
- if (targetPrivate->rlList != NULL) {
+ if (targetPrivate->scheduled) {
// if being watched, return the last known (and what should be current) status
- *flags = targetPrivate->flags & ~kSCNetworkFlagsFirstResolvePending;
+ *flags = targetPrivate->info.flags & ~kSCNetworkReachabilityFlagsFirstResolvePending;
goto done;
}
- ok = __SCNetworkReachabilityGetFlags(&store, target, flags, NULL, FALSE);
- *flags &= ~kSCNetworkFlagsFirstResolvePending;
+ ok = __SCNetworkReachabilityGetFlags(&store, target, &targetPrivate->info, FALSE);
+ *flags = targetPrivate->info.flags & ~kSCNetworkReachabilityFlagsFirstResolvePending;
if (store != NULL) CFRelease(store);
done :
}
+#pragma mark -
+#pragma mark Notifications
+
+
static void
__SCNetworkReachabilityReachabilitySetNotifications(SCDynamicStoreRef store)
{
CFArrayAppendValue(keys, key);
CFRelease(key);
+ // State:/Network/Global/DNS
key = SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL,
kSCDynamicStoreDomainState,
kSCEntNetDNS);
CFArrayAppendValue(keys, key);
CFRelease(key);
+ // State:/Network/Global/OnDemand
+ key = SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL,
+ kSCDynamicStoreDomainState,
+ kSCEntNetOnDemand);
+ CFArrayAppendValue(keys, key);
+ CFRelease(key);
+
// Setup: per-service IPv4 info
pattern = SCDynamicStoreKeyCreateNetworkServiceEntity(NULL,
kSCDynamicStoreDomainSetup,
CFArrayAppendValue(patterns, pattern);
CFRelease(pattern);
+ // State: per-service PPP info (for kSCPropNetPPPStatus)
+ pattern = SCDynamicStoreKeyCreateNetworkServiceEntity(NULL,
+ kSCDynamicStoreDomainState,
+ kSCCompAnyRegex,
+ kSCEntNetPPP);
+ CFArrayAppendValue(patterns, pattern);
+ CFRelease(pattern);
+
+ // Setup: per-service IPSec info
+ pattern = SCDynamicStoreKeyCreateNetworkServiceEntity(NULL,
+ kSCDynamicStoreDomainSetup,
+ kSCCompAnyRegex,
+ kSCEntNetIPSec);
+ CFArrayAppendValue(patterns, pattern);
+ CFRelease(pattern);
+
// State: per-interface IPv4 info
pattern = SCDynamicStoreKeyCreateNetworkInterfaceEntity(NULL,
kSCDynamicStoreDomainState,
CFArrayAppendValue(patterns, pattern);
CFRelease(pattern);
+#if !TARGET_OS_IPHONE
+ // State: Power Management Capabilities
+ key = SCDynamicStoreKeyCreate(NULL, CFSTR("%@%@"),
+ kSCDynamicStoreDomainState,
+ CFSTR(kIOPMSystemPowerCapabilitiesKeySuffix));
+ CFArrayAppendValue(keys, key);
+ CFRelease(key);
+#endif // TARGET_OS_IPHONE
+
+
(void)SCDynamicStoreSetNotificationKeys(store, keys, patterns);
CFRelease(keys);
CFRelease(patterns);
static void
-__SCNetworkReachabilityReachabilityHandleChanges(SCDynamicStoreRef store,
- CFArrayRef changedKeys,
- void *info)
+__SCNetworkReachabilityHandleChanges(SCDynamicStoreRef store,
+ CFArrayRef changedKeys,
+ void *info)
{
Boolean dnsConfigChanged = FALSE;
CFIndex i;
CFStringRef key;
+ CFIndex nChanges = CFArrayGetCount(changedKeys);
CFIndex nTargets;
+#if !TARGET_OS_IPHONE
+ Boolean powerStatusChanged = FALSE;
+#endif // !TARGET_OS_IPHONE
const void * targets_q[N_QUICK];
const void ** targets = targets_q;
+ if (nChanges == 0) {
+ /* if no changes */
+ return;
+ }
+
pthread_mutex_lock(&hn_lock);
- nTargets = CFSetGetCount(hn_targets);
+ nTargets = (hn_targets != NULL) ? CFSetGetCount(hn_targets) : 0;
if (nTargets == 0) {
/* if no addresses being monitored */
goto done;
}
- if (CFArrayGetCount(changedKeys) == 0) {
- /* if no changes */
- goto done;
- }
+#if !TARGET_OS_IPHONE
+ key = SCDynamicStoreKeyCreate(NULL, CFSTR("%@%@"),
+ kSCDynamicStoreDomainState,
+ CFSTR(kIOPMSystemPowerCapabilitiesKeySuffix));
+ if (CFArrayContainsValue(changedKeys, CFRangeMake(0, nChanges), key)) {
+ CFNumberRef num;
+
+ num = SCDynamicStoreCopyValue(store, key);
+ if (num != NULL) {
+ if (isA_CFNumber(num) &&
+ CFNumberGetValue(num, kCFNumberSInt32Type, &power_capabilities)) {
+ powerStatusChanged = TRUE;
+ }
- SCLog(_sc_debug, LOG_INFO, CFSTR("process configuration change"));
+ CFRelease(num);
+ }
+ }
+ CFRelease(key);
+#endif // !TARGET_OS_IPHONE
key = SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL,
kSCDynamicStoreDomainState,
kSCEntNetDNS);
- if (CFArrayContainsValue(changedKeys,
- CFRangeMake(0, CFArrayGetCount(changedKeys)),
- key)) {
+ if (CFArrayContainsValue(changedKeys, CFRangeMake(0, nChanges), key)) {
dnsConfigChanged = TRUE; /* the DNS server(s) have changed */
}
CFRelease(key);
- SCLog(_sc_debug && dnsConfigChanged, LOG_INFO, CFSTR(" DNS configuration changed"));
+ if (_sc_debug) {
+ int changes = 0;
+ const char *str;
+
+#if !TARGET_OS_IPHONE
+ if (powerStatusChanged) {
+ changes |= 4;
+ nChanges -= 1;
+ }
+#endif // !TARGET_OS_IPHONE
+
+ if (dnsConfigChanged) {
+ changes |= 2;
+ nChanges -= 1;
+ }
+
+ if (nChanges > 0) {
+ changes |= 1;
+ }
+
+ switch (changes) {
+ case 0 : str = ""; break;
+ case 1 : str = "network "; break;
+ case 2 : str = "DNS "; break;
+ case 3 : str = "network and DNS "; break;
+#if !TARGET_OS_IPHONE
+ case 4 : str = "power "; break;
+ case 5 : str = "network and power "; break;
+ case 6 : str = "DNS and power "; break;
+ case 7 : str = "network, DNS, and power "; break;
+#endif // !TARGET_OS_IPHONE
+ default : str = "??? ";
+ }
+
+ SCLog(TRUE, LOG_INFO, CFSTR("process %sconfiguration change"), str);
+ }
if (nTargets > (CFIndex)(sizeof(targets_q) / sizeof(CFTypeRef)))
targets = CFAllocatorAllocate(NULL, nTargets * sizeof(CFTypeRef), 0);
* if the DNS configuration didn't change we still need to
* check that the DNS servers are accessible.
*/
- SCNetworkConnectionFlags ns_flags;
+ SCNetworkReachabilityFlags ns_flags;
Boolean ok;
/* check the reachability of the DNS servers */
- ok = _SC_checkResolverReachability(&store,
- &ns_flags,
- &targetPrivate->haveDNS,
- targetPrivate->name,
- targetPrivate->serv);
- if (!ok || (rankReachability(ns_flags) < 2)) {
- /* if DNS servers are not reachable */
+ ok = _SC_R_checkResolverReachability(&store,
+ &ns_flags,
+ &targetPrivate->haveDNS,
+ targetPrivate->name,
+ targetPrivate->serv,
+ targetPrivate->log_prefix);
+ if (!ok) {
+ /* if we could not get DNS server info */
+ SCLog(_sc_debug, LOG_INFO, CFSTR("%sDNS server reachability unknown"),
+ targetPrivate->log_prefix);
+ dnsChanged = TRUE;
+ } else if (rankReachability(ns_flags) < 2) {
+ /*
+ * if DNS servers are not (or are no longer) reachable, set
+ * flags based on the availability of configured (but not
+ * active) services.
+ */
+ SCLog(_sc_debug, LOG_INFO, CFSTR("%sDNS server(s) not available"),
+ targetPrivate->log_prefix);
dnsChanged = TRUE;
}
}
if (dnsChanged) {
if (targetPrivate->dnsPort != NULL) {
+ mach_port_t mp = CFMachPortGetPort(targetPrivate->dnsPort);
+
/* cancel the outstanding DNS query */
- getaddrinfo_async_cancel(CFMachPortGetPort(targetPrivate->dnsPort));
- CFRunLoopSourceInvalidate(targetPrivate->dnsRLS);
- CFRelease(targetPrivate->dnsRLS);
- targetPrivate->dnsRLS = NULL;
- CFRelease(targetPrivate->dnsPort);
- targetPrivate->dnsPort = NULL;
+ SCLog(_sc_debug, LOG_INFO,
+ CFSTR("%scancel DNS query for %s%s%s%s%s"),
+ targetPrivate->log_prefix,
+ targetPrivate->name != NULL ? "name = " : "",
+ targetPrivate->name != NULL ? targetPrivate->name : "",
+ targetPrivate->name != NULL && targetPrivate->serv != NULL ? ", " : "",
+ targetPrivate->serv != NULL ? "serv = " : "",
+ targetPrivate->serv != NULL ? targetPrivate->serv : "");
+ dequeueAsyncDNSQuery(target);
+ getaddrinfo_async_cancel(mp);
}
/* schedule request to resolve the name again */
- if (targetPrivate->resolvedAddress != NULL) {
- CFRelease(targetPrivate->resolvedAddress);
- targetPrivate->resolvedAddress = NULL;
- }
- targetPrivate->resolvedAddress = NULL;
- targetPrivate->resolvedAddressError = NETDB_SUCCESS;
+ targetPrivate->needResolve = TRUE;
}
}
- CFRunLoopSourceSignal(targetPrivate->rls);
- _SC_signalRunLoop(target, targetPrivate->rls, targetPrivate->rlList);
+ __SCNetworkReachabilityPerform(target);
pthread_mutex_unlock(&targetPrivate->lock);
}
}
+#if !TARGET_OS_IPHONE
+static __inline__ Boolean
+systemIsAwake(IOPMSystemPowerStateCapabilities power_capabilities)
+{
+
+#define POWER_CAPABILITIES_NEED (kIOPMSystemPowerStateCapabilityCPU \
+ | kIOPMSystemPowerStateCapabilityNetwork \
+ | kIOPMSystemPowerStateCapabilityDisk)
+
+ if ((power_capabilities & POWER_CAPABILITIES_NEED) != POWER_CAPABILITIES_NEED) {
+ /*
+ * we're not awake (from a networking point of view) unless we
+ * have the CPU, disk, *and* network.
+ */
+ return FALSE;
+ }
+
+ if ((power_capabilities & kIOPMSytemPowerStateCapabilitiesMask) == POWER_CAPABILITIES_NEED) {
+ /*
+ * if all we have is the CPU, disk, and network than this must
+ * be a "maintenance" wake.
+ */
+ return FALSE;
+ }
+
+ return TRUE;
+}
+#endif // !TARGET_OS_IPHONE
+
+
static void
rlsPerform(void *info)
{
void *context_info;
void (*context_release)(const void *);
- SCNetworkConnectionFlags flags;
- uint16_t if_index;
+ Boolean defer = FALSE;
Boolean ok;
+ ReachabilityInfo reach_info = NOT_REACHABLE;
SCNetworkReachabilityCallBack rlsFunction;
SCDynamicStoreRef store = NULL;
SCNetworkReachabilityRef target = (SCNetworkReachabilityRef)info;
SCNetworkReachabilityPrivateRef targetPrivate = (SCNetworkReachabilityPrivateRef)target;
- SCLog(_sc_debug, LOG_DEBUG, CFSTR("process reachability change"));
+ SCLog(_sc_debug, LOG_INFO, CFSTR("%schecking target reachability"),
+ targetPrivate->log_prefix);
pthread_mutex_lock(&targetPrivate->lock);
+ if (!targetPrivate->scheduled) {
+ // if not currently scheduled
+ pthread_mutex_unlock(&targetPrivate->lock);
+ return;
+ }
+
/* update reachability, notify if status changed */
- ok = __SCNetworkReachabilityGetFlags(&store, target, &flags, &if_index, TRUE);
+ ok = __SCNetworkReachabilityGetFlags(&store, target, &reach_info, TRUE);
if (store != NULL) CFRelease(store);
if (!ok) {
/* if reachability status not available */
- flags = 0;
- if_index = 0;
+ SCLog(_sc_debug, LOG_INFO, CFSTR("%flags not available"),
+ targetPrivate->log_prefix);
+ reach_info = NOT_REACHABLE;
}
- if ((targetPrivate->flags == flags) && (targetPrivate->if_index == if_index)) {
- /* if reachability flags and interface have not changed */
+#if !TARGET_OS_IPHONE
+ /*
+ * We want to defer the notification if this is a maintenance wake *and*
+ * the reachability flags that we would be reporting to the application
+ * are better than those that we last reported.
+ */
+ if (!systemIsAwake(power_capabilities)) {
+ /* if this is a maintenace wake */
+ reach_info.sleeping = TRUE;
+
+ if (rankReachability(reach_info.flags) >= rankReachability(targetPrivate->info.flags)) {
+ /*
+ * don't report the change if the new reachability flags are
+ * the same or "better"
+ */
+ defer = TRUE;
+ } else if (bcmp(&targetPrivate->last_notify, &reach_info, sizeof(reach_info)) == 0) {
+ /* if we have already posted this change */
+ defer = TRUE;
+ }
+ }
+#endif // !TARGET_OS_IPHONE
+
+ if (bcmp(&targetPrivate->info, &reach_info, sizeof(reach_info)) == 0) {
+ SCLog(_sc_debug, LOG_INFO,
+ CFSTR("%sflags/interface match (now 0x%08x/%hu%s)"),
+ targetPrivate->log_prefix,
+ reach_info.flags,
+ reach_info.if_index,
+ reach_info.sleeping ? "*" : "");
pthread_mutex_unlock(&targetPrivate->lock);
- SCLog(_sc_debug, LOG_DEBUG,
- CFSTR("flags/interface match (now %8.8x/%hu)"),
- flags, if_index);
return;
- } else {
- SCLog(_sc_debug, LOG_DEBUG,
- CFSTR("flags/interface have changed (was %8.8x/%hu, now %8.8x/%hu)"),
- targetPrivate->flags, targetPrivate->if_index,
- flags, if_index);
}
+ SCLog(_sc_debug, LOG_INFO,
+ CFSTR("%sflags/interface have changed (was 0x%08x/%hu%s, now 0x%08x/%hu%s)%s"),
+ targetPrivate->log_prefix,
+ targetPrivate->info.flags,
+ targetPrivate->info.if_index,
+ targetPrivate->info.sleeping ? "*" : "",
+ reach_info.flags,
+ reach_info.if_index,
+ reach_info.sleeping ? "*" : "",
+ defer ? ", deferred" : "");
+
/* update flags / interface */
- targetPrivate->flags = flags;
- targetPrivate->if_index = if_index;
+ targetPrivate->info = reach_info;
+
+ /* as needed, defer the notification */
+ if (defer) {
+ pthread_mutex_unlock(&targetPrivate->lock);
+ return;
+ }
+
+ /* save last notification info */
+ targetPrivate->last_notify = reach_info;
/* callout */
rlsFunction = targetPrivate->rlsFunction;
pthread_mutex_unlock(&targetPrivate->lock);
if (rlsFunction != NULL) {
- (*rlsFunction)(target, flags, context_info);
+ (*rlsFunction)(target, reach_info.flags, context_info);
}
if (context_release != NULL) {
}
-Boolean
-SCNetworkReachabilityScheduleWithRunLoop(SCNetworkReachabilityRef target,
- CFRunLoopRef runLoop,
- CFStringRef runLoopMode)
+static Boolean
+__SCNetworkReachabilityScheduleWithRunLoop(SCNetworkReachabilityRef target,
+ CFRunLoopRef runLoop,
+ CFStringRef runLoopMode,
+#if !TARGET_OS_IPHONE
+ dispatch_queue_t queue,
+#else // !TARGET_OS_IPHONE
+ void *queue,
+#endif // !TARGET_OS_IPHONE
+ Boolean onDemand)
{
SCNetworkReachabilityPrivateRef targetPrivate = (SCNetworkReachabilityPrivateRef)target;
Boolean init = FALSE;
Boolean ok = FALSE;
- if (!isA_SCNetworkReachability(target) || runLoop == NULL || runLoopMode == NULL) {
+ if (!onDemand) {
+ pthread_mutex_lock(&hn_lock);
+ }
+ pthread_mutex_lock(&targetPrivate->lock);
+
+#if !TARGET_OS_IPHONE
+ if ((targetPrivate->dispatchQueue != NULL) || // if we are already scheduled with a dispatch queue
+ ((queue != NULL) && targetPrivate->scheduled)) { // if we are already scheduled on a CFRunLoop
_SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
+ goto done;
}
+#endif // !TARGET_OS_IPHONE
/* schedule the SCNetworkReachability run loop source */
- pthread_mutex_lock(&hn_lock);
- pthread_mutex_lock(&targetPrivate->lock);
-
- if (hn_store == NULL) {
+ if (!onDemand && (hn_store == NULL)) {
/*
* if we are not monitoring any hosts, start watching
*/
hn_store = SCDynamicStoreCreate(NULL,
CFSTR("SCNetworkReachability"),
- __SCNetworkReachabilityReachabilityHandleChanges,
+ __SCNetworkReachabilityHandleChanges,
NULL);
if (hn_store == NULL) {
- SCLog(_sc_verbose, LOG_INFO, CFSTR("SCDynamicStoreCreate() failed"));
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreCreate() failed"));
goto done;
}
__SCNetworkReachabilityReachabilitySetNotifications(hn_store);
+#if !TARGET_OS_IPHONE
+ dispatch_queue_attr_t attr;
+ long res;
+
+ attr = dispatch_queue_attr_create();
+ res = dispatch_queue_attr_set_finalizer(attr,
+ ^(dispatch_queue_t dq) {
+ SCDynamicStoreRef hn_store;
+
+ hn_store = (SCDynamicStoreRef)dispatch_get_context(dq);
+ CFRelease(hn_store);
+ });
+ if (res != 0) {
+ SCLog(TRUE, LOG_ERR, CFSTR("__SCNetworkReachabilityScheduleWithRunLoop dispatch_queue_attr_set_finalizer() failed"));
+ dispatch_release(attr);
+ CFRelease(hn_store);
+ hn_store = NULL;
+ _SCErrorSet(kSCStatusFailed);
+ goto done;
+ }
+ hn_dispatchQueue = dispatch_queue_create("com.apple.SCNetworkReachabilty.network_changes", attr);
+ dispatch_release(attr);
+ if (hn_dispatchQueue == NULL) {
+ SCLog(TRUE, LOG_ERR, CFSTR("__SCNetworkReachabilityScheduleWithRunLoop dispatch_queue_create() failed"));
+ _SCErrorSet(kSCStatusFailed);
+ CFRelease(hn_store);
+ hn_store = NULL;
+ goto done;
+ }
+ CFRetain(hn_store); // Note: will be released when the dispatch queue is released
+ dispatch_set_context(hn_dispatchQueue, (void *)hn_store);
+
+ ok = SCDynamicStoreSetDispatchQueue(hn_store, hn_dispatchQueue);
+ if (!ok) {
+ SCLog(TRUE, LOG_ERR, CFSTR("SCDynamicStoreSetDispatchQueue() failed"));
+ dispatch_release(hn_dispatchQueue);
+ hn_dispatchQueue = NULL;
+ CFRelease(hn_store);
+ hn_store = NULL;
+ goto done;
+ }
+#else // !TARGET_OS_IPHONE
hn_storeRLS = SCDynamicStoreCreateRunLoopSource(NULL, hn_store, 0);
hn_rlList = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+#endif // !TARGET_OS_IPHONE
hn_targets = CFSetCreateMutable(NULL, 0, &kCFTypeSetCallBacks);
}
- if (targetPrivate->rls == NULL) {
+ if (!targetPrivate->scheduled) {
CFRunLoopSourceContext context = { 0 // version
, (void *)target // info
, CFRetain // retain
, rlsPerform // perform
};
- targetPrivate->rls = CFRunLoopSourceCreate(NULL, 0, &context);
- targetPrivate->rlList = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+ if (runLoop != NULL) {
+ targetPrivate->rls = CFRunLoopSourceCreate(NULL, 0, &context);
+ targetPrivate->rlList = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+ }
+
+ targetPrivate->scheduled = TRUE;
+ if (targetPrivate->type == reachabilityTypeName) {
+ targetPrivate->needResolve = TRUE;
+ }
init = TRUE;
}
- if (!_SC_isScheduled(NULL, runLoop, runLoopMode, targetPrivate->rlList)) {
- /*
- * if we do not already have host notifications scheduled with
- * this runLoop / runLoopMode
- */
- CFRunLoopAddSource(runLoop, targetPrivate->rls, runLoopMode);
+#if !TARGET_OS_IPHONE
+ if (queue != NULL) {
+ targetPrivate->dispatchQueue = queue;
+ dispatch_retain(targetPrivate->dispatchQueue);
+ } else
+#endif // !TARGET_OS_IPHONE
+ {
+ if (!_SC_isScheduled(NULL, runLoop, runLoopMode, targetPrivate->rlList)) {
+ /*
+ * if we do not already have host notifications scheduled with
+ * this runLoop / runLoopMode
+ */
+ CFRunLoopAddSource(runLoop, targetPrivate->rls, runLoopMode);
- if (targetPrivate->dnsRLS != NULL) {
- /* if we have an active async DNS query too */
- CFRunLoopAddSource(runLoop, targetPrivate->dnsRLS, runLoopMode);
+ if (targetPrivate->dnsRLS != NULL) {
+ /* if we have an active async DNS query too */
+ CFRunLoopAddSource(runLoop, targetPrivate->dnsRLS, runLoopMode);
+ }
}
- }
- _SC_schedule(target, runLoop, runLoopMode, targetPrivate->rlList);
+ _SC_schedule(target, runLoop, runLoopMode, targetPrivate->rlList);
- /* schedule the SCNetworkReachability run loop source */
+#if TARGET_OS_IPHONE
+ if (!onDemand) {
+ /* schedule the global SCDynamicStore run loop source */
- if (!_SC_isScheduled(NULL, runLoop, runLoopMode, hn_rlList)) {
- /*
- * if we do not already have SC notifications scheduled with
- * this runLoop / runLoopMode
- */
- CFRunLoopAddSource(runLoop, hn_storeRLS, runLoopMode);
+ if (!_SC_isScheduled(NULL, runLoop, runLoopMode, hn_rlList)) {
+ /*
+ * if we do not already have SC notifications scheduled with
+ * this runLoop / runLoopMode
+ */
+ CFRunLoopAddSource(runLoop, hn_storeRLS, runLoopMode);
+ }
+
+ _SC_schedule(target, runLoop, runLoopMode, hn_rlList);
+ }
+#endif // TARGET_OS_IPHONE
}
- _SC_schedule(target, runLoop, runLoopMode, hn_rlList);
CFSetAddValue(hn_targets, target);
if (init) {
- SCNetworkConnectionFlags flags;
- uint16_t if_index;
- SCDynamicStoreRef store = NULL;
+ ReachabilityInfo reach_info = NOT_REACHABLE;
+ SCDynamicStoreRef store = NULL;
/*
* if we have yet to schedule SC notifications for this address
* - initialize current reachability status
*/
- if (__SCNetworkReachabilityGetFlags(&store, target, &flags, &if_index, TRUE)) {
+ if (__SCNetworkReachabilityGetFlags(&store, target, &reach_info, TRUE)) {
/*
* if reachability status available
* - set flags
* - schedule notification to report status via callback
*/
- targetPrivate->flags = flags;
- targetPrivate->if_index = if_index;
- CFRunLoopSourceSignal(targetPrivate->rls);
- _SC_signalRunLoop(target, targetPrivate->rls, targetPrivate->rlList);
+ targetPrivate->info = reach_info;
+ __SCNetworkReachabilityPerform(target);
} else {
/* if reachability status not available, async lookup started */
- targetPrivate->flags = 0;
- targetPrivate->if_index = 0;
+ targetPrivate->info = NOT_REACHABLE;
}
if (store != NULL) CFRelease(store);
}
+ if (targetPrivate->onDemandServer != NULL) {
+ __SCNetworkReachabilityScheduleWithRunLoop(targetPrivate->onDemandServer, runLoop, runLoopMode, queue, TRUE);
+ }
+
ok = TRUE;
done :
pthread_mutex_unlock(&targetPrivate->lock);
- pthread_mutex_unlock(&hn_lock);
+ if (!onDemand) {
+ pthread_mutex_unlock(&hn_lock);
+ }
return ok;
}
-Boolean
-SCNetworkReachabilityUnscheduleFromRunLoop(SCNetworkReachabilityRef target,
- CFRunLoopRef runLoop,
- CFStringRef runLoopMode)
+static Boolean
+__SCNetworkReachabilityUnscheduleFromRunLoop(SCNetworkReachabilityRef target,
+ CFRunLoopRef runLoop,
+ CFStringRef runLoopMode,
+ Boolean onDemand)
{
SCNetworkReachabilityPrivateRef targetPrivate = (SCNetworkReachabilityPrivateRef)target;
- CFIndex n;
+ CFIndex n = 0;
Boolean ok = FALSE;
- if (!isA_SCNetworkReachability(target) || runLoop == NULL || runLoopMode == NULL) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
+ if (!onDemand) {
+ pthread_mutex_lock(&hn_lock);
}
-
- pthread_mutex_lock(&hn_lock);
pthread_mutex_lock(&targetPrivate->lock);
- if (targetPrivate->rls == NULL) {
- /* if not currently scheduled */
+#if !TARGET_OS_IPHONE
+ if (((runLoop == NULL) && (targetPrivate->dispatchQueue == NULL)) || // if we should be scheduled on a dispatch queue (but are not)
+ ((runLoop != NULL) && (targetPrivate->dispatchQueue != NULL))) { // if we should be scheduled on a CFRunLoop (but are not)
_SCErrorSet(kSCStatusInvalidArgument);
goto done;
}
+#endif // !TARGET_OS_IPHONE
- if (!_SC_unschedule(NULL, runLoop, runLoopMode, targetPrivate->rlList, FALSE)) {
- /* if not currently scheduled */
+ if (!targetPrivate->scheduled) {
+ // if not currently scheduled
_SCErrorSet(kSCStatusInvalidArgument);
goto done;
}
- n = CFArrayGetCount(targetPrivate->rlList);
- if (n == 0 || !_SC_isScheduled(NULL, runLoop, runLoopMode, targetPrivate->rlList)) {
- /*
- * if this host is no longer scheduled for this runLoop / runLoopMode
- */
- CFRunLoopRemoveSource(runLoop, targetPrivate->rls, runLoopMode);
+ // first, unschedule the target specific sources
+#if !TARGET_OS_IPHONE
+ if (targetPrivate->dispatchQueue != NULL) {
+ if (targetPrivate->onDemandServer != NULL) {
+ __SCNetworkReachabilityUnscheduleFromRunLoop(targetPrivate->onDemandServer, NULL, NULL, TRUE);
+ }
+ } else
+#endif // !TARGET_OS_IPHONE
+ {
+ if (!_SC_unschedule(target, runLoop, runLoopMode, targetPrivate->rlList, FALSE)) {
+ // if not currently scheduled
+ _SCErrorSet(kSCStatusInvalidArgument);
+ goto done;
+ }
- if (targetPrivate->dnsRLS != NULL) {
- /* if we have an active async DNS query too */
- CFRunLoopRemoveSource(runLoop, targetPrivate->dnsRLS, runLoopMode);
+ if (targetPrivate->onDemandServer != NULL) {
+ __SCNetworkReachabilityUnscheduleFromRunLoop(targetPrivate->onDemandServer, runLoop, runLoopMode, TRUE);
}
- if (n == 0) {
- /*
- * if this host is no longer scheduled
- */
- CFRunLoopSourceInvalidate(targetPrivate->rls); /* cleanup SCNetworkReachability resources */
- CFRelease(targetPrivate->rls);
- targetPrivate->rls = NULL;
- CFRelease(targetPrivate->rlList);
- targetPrivate->rlList = NULL;
- CFSetRemoveValue(hn_targets, target); /* cleanup notification resources */
-
- if (targetPrivate->dnsPort != NULL) {
- /* if we have an active async DNS query too */
- getaddrinfo_async_cancel(CFMachPortGetPort(targetPrivate->dnsPort));
- CFRunLoopSourceInvalidate(targetPrivate->dnsRLS);
- CFRelease(targetPrivate->dnsRLS);
- targetPrivate->dnsRLS = NULL;
- CFRelease(targetPrivate->dnsPort);
- targetPrivate->dnsPort = NULL;
+ n = CFArrayGetCount(targetPrivate->rlList);
+ if ((n == 0) || !_SC_isScheduled(NULL, runLoop, runLoopMode, targetPrivate->rlList)) {
+ // if target is no longer scheduled for this runLoop / runLoopMode
+ CFRunLoopRemoveSource(runLoop, targetPrivate->rls, runLoopMode);
+
+ if (targetPrivate->dnsRLS != NULL) {
+ // if we have an active async DNS query too
+ CFRunLoopRemoveSource(runLoop, targetPrivate->dnsRLS, runLoopMode);
+ }
+
+ if (n == 0) {
+ // if *all* notifications have been unscheduled
+ CFRelease(targetPrivate->rlList);
+ targetPrivate->rlList = NULL;
+ CFRunLoopSourceInvalidate(targetPrivate->rls);
+ CFRelease(targetPrivate->rls);
+ targetPrivate->rls = NULL;
}
}
}
- (void)_SC_unschedule(target, runLoop, runLoopMode, hn_rlList, FALSE);
+ if (n == 0) {
+ // if *all* notifications have been unscheduled
+ targetPrivate->scheduled = FALSE;
- n = CFArrayGetCount(hn_rlList);
- if (n == 0 || !_SC_isScheduled(NULL, runLoop, runLoopMode, hn_rlList)) {
- /*
- * if we no longer have any addresses scheduled for
- * this runLoop / runLoopMode
- */
- CFRunLoopRemoveSource(runLoop, hn_storeRLS, runLoopMode);
+ if (!onDemand) {
+ CFSetRemoveValue(hn_targets, target); // cleanup notification resources
+ }
- if (n == 0) {
- /*
- * if we are no longer monitoring any addresses
- */
- CFRelease(hn_targets);
- hn_targets = NULL;
- CFRelease(hn_rlList);
- hn_rlList = NULL;
- CFRunLoopSourceInvalidate(hn_storeRLS);
- CFRelease(hn_storeRLS);
- hn_storeRLS = NULL;
- CFRelease(hn_store);
- hn_store = NULL;
+ if (targetPrivate->dnsPort != NULL) {
+ mach_port_t mp = CFMachPortGetPort(targetPrivate->dnsPort);
+
+ // if we have an active async DNS query
+ dequeueAsyncDNSQuery(target);
+ getaddrinfo_async_cancel(mp);
+ }
+ }
+
+#if !TARGET_OS_IPHONE
+ if (runLoop == NULL) {
+ dispatch_release(targetPrivate->dispatchQueue);
+ targetPrivate->dispatchQueue = NULL;
+ }
+#endif // !TARGET_OS_IPHONE
+ // now, unschedule the global dynamic store source
+#if TARGET_OS_IPHONE
+ if (!onDemand) {
+ (void)_SC_unschedule(target, runLoop, runLoopMode, hn_rlList, FALSE);
+
+ n = CFArrayGetCount(hn_rlList);
+ if ((n == 0) || !_SC_isScheduled(NULL, runLoop, runLoopMode, hn_rlList)) {
/*
- * until we start monitoring again, ensure that
- * any resources associated with tracking the
- * DNS configuration have been released.
+ * if we no longer have any addresses scheduled for
+ * this runLoop / runLoopMode
*/
- dns_configuration_unwatch();
+ CFRunLoopRemoveSource(runLoop, hn_storeRLS, runLoopMode);
+
+ if (n > 0) {
+ if (CFEqual(runLoopMode, kCFRunLoopCommonModes)) {
+ CFArrayRef modes;
+
+ modes = CFRunLoopCopyAllModes(runLoop);
+ if (modes != NULL) {
+ CFIndex i;
+ CFIndex n = CFArrayGetCount(modes);
+
+ for (i = 0; i < n; i++) {
+ CFStringRef mode;
+
+ mode = CFArrayGetValueAtIndex(modes, i);
+ if (_SC_isScheduled(NULL, runLoop, mode, hn_rlList)) {
+ /*
+ * removing kCFRunLoopCommonModes cleaned up more
+ * than we wanted. Add back the modes that were
+ * expect to be present.
+ */
+ CFRunLoopAddSource(runLoop, hn_storeRLS, mode);
+ }
+ }
+
+ CFRelease(modes);
+ }
+ } else if (_SC_isScheduled(NULL, runLoop, kCFRunLoopCommonModes, hn_rlList)) {
+ /*
+ * if we are still scheduling kCFRunLoopCommonModes, make sure that
+ * none of the common modes were inadvertently removed.
+ */
+ CFRunLoopAddSource(runLoop, hn_storeRLS, kCFRunLoopCommonModes);
+ }
+ }
}
}
+#endif // TARGET_OS_IPHONE
+
+ n = CFSetGetCount(hn_targets);
+ if (n == 0) {
+ // if we are no longer monitoring any targets
+#if !TARGET_OS_IPHONE
+ SCDynamicStoreSetDispatchQueue(hn_store, NULL);
+ dispatch_release(hn_dispatchQueue);
+ hn_dispatchQueue = NULL;
+#else // !TARGET_OS_IPHONE
+ CFRunLoopSourceInvalidate(hn_storeRLS);
+ CFRelease(hn_storeRLS);
+ hn_storeRLS = NULL;
+ CFRelease(hn_rlList);
+ hn_rlList = NULL;
+#endif // !TARGET_OS_IPHONE
+ CFRelease(hn_store);
+ hn_store = NULL;
+ CFRelease(hn_targets);
+ hn_targets = NULL;
+
+ /*
+ * until we start monitoring again, ensure that
+ * any resources associated with tracking the
+ * DNS configuration have been released.
+ */
+ dns_configuration_unwatch();
+ }
ok = TRUE;
done :
pthread_mutex_unlock(&targetPrivate->lock);
- pthread_mutex_unlock(&hn_lock);
+ if (!onDemand) {
+ pthread_mutex_unlock(&hn_lock);
+ }
+ return ok;
+}
+
+Boolean
+SCNetworkReachabilityScheduleWithRunLoop(SCNetworkReachabilityRef target,
+ CFRunLoopRef runLoop,
+ CFStringRef runLoopMode)
+{
+ if (!isA_SCNetworkReachability(target) || (runLoop == NULL) || (runLoopMode == NULL)) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return FALSE;
+ }
+
+ return __SCNetworkReachabilityScheduleWithRunLoop(target, runLoop, runLoopMode, NULL, FALSE);
+}
+
+Boolean
+SCNetworkReachabilityUnscheduleFromRunLoop(SCNetworkReachabilityRef target,
+ CFRunLoopRef runLoop,
+ CFStringRef runLoopMode)
+{
+ if (!isA_SCNetworkReachability(target) || (runLoop == NULL) || (runLoopMode == NULL)) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return FALSE;
+ }
+
+ return __SCNetworkReachabilityUnscheduleFromRunLoop(target, runLoop, runLoopMode, FALSE);
+}
+
+#if !TARGET_OS_IPHONE
+Boolean
+SCNetworkReachabilitySetDispatchQueue(SCNetworkReachabilityRef target,
+ dispatch_queue_t queue)
+{
+ Boolean ok = FALSE;
+
+ if (!isA_SCNetworkReachability(target)) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return FALSE;
+ }
+
+ if (queue != NULL) {
+ ok = __SCNetworkReachabilityScheduleWithRunLoop(target, NULL, NULL, queue, FALSE);
+ } else {
+ ok = __SCNetworkReachabilityUnscheduleFromRunLoop(target, NULL, NULL, FALSE);
+ }
+
return ok;
}
+#endif // !TARGET_OS_IPHONE
/*
- * Copyright (c) 2003-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2003-2005, 2008, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#ifndef _SCNETWORKREACHABILITY_H
#define _SCNETWORKREACHABILITY_H
-#include <AvailabilityMacros.h>
+#include <Availability.h>
+#include <TargetConditionals.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SCNetwork.h>
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+#if !TARGET_OS_IPHONE
+#include <dispatch/dispatch.h>
+#endif // !TARGET_OS_IPHONE
/*!
@header SCNetworkReachability
CFStringRef (*copyDescription)(const void *info);
} SCNetworkReachabilityContext;
+/*!
+ @enum SCNetworkReachabilityFlags
+ @discussion Flags that indicate whether the specified network
+ nodename or address is reachable, whether a connection is
+ required, and whether some user intervention may be required
+ when establishing a connection.
+ @constant kSCNetworkReachabilityFlagsTransientConnection
+ This flag indicates that the specified nodename or address can
+ be reached via a transient connection, such as PPP.
+ @constant kSCNetworkReachabilityFlagsReachable
+ This flag indicates that the specified nodename or address can
+ be reached using the current network configuration.
+ @constant kSCNetworkReachabilityFlagsConnectionRequired
+ This flag indicates that the specified nodename or address can
+ be reached using the current network configuration, but a
+ connection must first be established.
+
+ As an example, this status would be returned for a dialup
+ connection that was not currently active, but could handle
+ network traffic for the target system.
+ @constant kSCNetworkReachabilityFlagsConnectionOnTraffic
+ This flag indicates that the specified nodename or address can
+ be reached using the current network configuration, but a
+ connection must first be established. Any traffic directed
+ to the specified name or address will initiate the connection.
+
+ Note: this flag was previously named kSCNetworkReachabilityFlagsConnectionAutomatic
+ @constant kSCNetworkReachabilityFlagsInterventionRequired
+ This flag indicates that the specified nodename or address can
+ be reached using the current network configuration, but a
+ connection must first be established. In addition, some
+ form of user intervention will be required to establish this
+ connection, such as providing a password, an authentication
+ token, etc.
+
+ Note: At the present time, this flag will only be returned
+ in the case where you have a dial-on-traffic configuration
+ (ConnectionOnTraffic), where an attempt to connect has
+ already been made, and where some error (e.g. no dial tone,
+ no answer, bad password, ...) was encountered during the
+ automatic connection attempt. In this case the PPP controller
+ will stop attempting to establish a connection until the user
+ has intervened.
+ @constant kSCNetworkReachabilityFlagsConnectionOnDemand
+ This flag indicates that the specified nodename or address can
+ be reached using the current network configuration, but a
+ connection must first be established.
+ The connection will be established "On Demand" by the
+ CFSocketStream APIs.
+ Other APIs will not establish the connection.
+ @constant kSCNetworkReachabilityFlagsIsLocalAddress
+ This flag indicates that the specified nodename or address
+ is one associated with a network interface on the current
+ system.
+ @constant kSCNetworkReachabilityFlagsIsDirect
+ This flag indicates that network traffic to the specified
+ nodename or address will not go through a gateway, but is
+ routed directly to one of the interfaces in the system.
+#if TARGET_OS_IPHONE
+ @constant kSCNetworkReachabilityFlagsIsWWAN
+ This flag indicates that the specified nodename or address can
+ be reached via an EDGE, GPRS, or other "cell" connection.
+#endif // TARGET_OS_IPHONE
+ */
+enum {
+ kSCNetworkReachabilityFlagsTransientConnection = 1<<0,
+ kSCNetworkReachabilityFlagsReachable = 1<<1,
+ kSCNetworkReachabilityFlagsConnectionRequired = 1<<2,
+ kSCNetworkReachabilityFlagsConnectionOnTraffic = 1<<3,
+ kSCNetworkReachabilityFlagsInterventionRequired = 1<<4,
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 30000) || TARGET_IPHONE_SIMULATOR
+ kSCNetworkReachabilityFlagsConnectionOnDemand = 1<<5,
+#endif
+ kSCNetworkReachabilityFlagsIsLocalAddress = 1<<16,
+ kSCNetworkReachabilityFlagsIsDirect = 1<<17,
+#if TARGET_OS_IPHONE
+ kSCNetworkReachabilityFlagsIsWWAN = 1<<18,
+#endif // TARGET_OS_IPHONE
+
+ kSCNetworkReachabilityFlagsConnectionAutomatic = kSCNetworkReachabilityFlagsConnectionOnTraffic
+};
+typedef uint32_t SCNetworkReachabilityFlags;
+
/*!
@typedef SCNetworkReachabilityCallBack
@discussion Type of the callback function used when the
reachability of a network address or name changes.
@param target The SCNetworkReachability reference being monitored
for changes.
- @param flags The new SCNetworkConnectionFlags representing the
+ @param flags The new SCNetworkReachabilityFlags representing the
reachability status of the network address/name.
@param info A C pointer to a user-specified block of data.
*/
typedef void (*SCNetworkReachabilityCallBack) (
SCNetworkReachabilityRef target,
- SCNetworkConnectionFlags flags,
+ SCNetworkReachabilityFlags flags,
void *info
);
SCNetworkReachabilityCreateWithAddress (
CFAllocatorRef allocator,
const struct sockaddr *address
- ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0);
/*!
@function SCNetworkReachabilityCreateWithAddressPair
CFAllocatorRef allocator,
const struct sockaddr *localAddress,
const struct sockaddr *remoteAddress
- ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0);
/*!
@function SCNetworkReachabilityCreateWithName
SCNetworkReachabilityCreateWithName (
CFAllocatorRef allocator,
const char *nodename
- ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0);
/*!
@function SCNetworkReachabilityGetTypeID
instances.
*/
CFTypeID
-SCNetworkReachabilityGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+SCNetworkReachabilityGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0);
/*!
@param target The network reference associated with the address or name
to be checked for reachability.
@param flags A pointer to memory that will be filled with the
- SCNetworkConnectionFlags detailing the reachability
+ SCNetworkReachabilityFlags detailing the reachability
of the specified target.
@result Returns TRUE if the network connection flags are valid;
FALSE if the status could not be determined.
Boolean
SCNetworkReachabilityGetFlags (
SCNetworkReachabilityRef target,
- SCNetworkConnectionFlags *flags
- ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+ SCNetworkReachabilityFlags *flags
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0);
/*!
@function SCNetworkReachabilitySetCallback
SCNetworkReachabilityRef target,
SCNetworkReachabilityCallBack callout,
SCNetworkReachabilityContext *context
- ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0);
/*!
@function SCNetworkReachabilityScheduleWithRunLoop
SCNetworkReachabilityRef target,
CFRunLoopRef runLoop,
CFStringRef runLoopMode
- ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0);
/*!
@function SCNetworkReachabilityUnscheduleFromRunLoop
SCNetworkReachabilityRef target,
CFRunLoopRef runLoop,
CFStringRef runLoopMode
- ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0);
-__END_DECLS
+#if !TARGET_OS_IPHONE
+/*!
+ @function SCNetworkReachabilitySetDispatchQueue
+ @discussion Schedules callbacks for the given target on the given
+ dispatch queue.
+ @param target The address or name that is set up for asynchronous
+ notifications. Must be non-NULL.
+ @param queue A libdispatch queue to run the callback on. Pass NULL to disable notifications, and release queue.
+ @result Returns TRUE if the target is unscheduled successfully;
+ FALSE otherwise.
+ */
+Boolean
+SCNetworkReachabilitySetDispatchQueue (
+ SCNetworkReachabilityRef target,
+ dispatch_queue_t queue
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA);
+#endif // !TARGET_OS_IPHONE
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */
+__END_DECLS
#endif /* _SCNETWORKREACHABILITY_H */
/*
- * Copyright (c) 2004-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2004-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
static CFHashCode __SCNetworkServiceHash (CFTypeRef cf);
-static CFTypeID __kSCNetworkServiceTypeID = _kCFRuntimeNotATypeID;
+static CFTypeID __kSCNetworkServiceTypeID = _kCFRuntimeNotATypeID;
static const CFRuntimeClass __SCNetworkServiceClass = {
};
-static pthread_once_t initialized = PTHREAD_ONCE_INIT;
+static pthread_once_t initialized = PTHREAD_ONCE_INIT;
static CFStringRef
result = CFStringCreateMutable(allocator, 0);
CFStringAppendFormat(result, NULL, CFSTR("<SCNetworkService %p [%p]> {"), cf, allocator);
CFStringAppendFormat(result, NULL, CFSTR("id = %@"), servicePrivate->serviceID);
- CFStringAppendFormat(result, NULL, CFSTR(", prefs = %p"), servicePrivate->prefs);
+ if (servicePrivate->prefs != NULL) {
+ CFStringAppendFormat(result, NULL, CFSTR(", prefs = %p"), servicePrivate->prefs);
+ } else if (servicePrivate->store != NULL) {
+ CFStringAppendFormat(result, NULL, CFSTR(", store = %p"), servicePrivate->store);
+ }
if (servicePrivate->name != NULL) {
CFStringAppendFormat(result, NULL, CFSTR(", name = %@"), servicePrivate->name);
}
CFRelease(servicePrivate->serviceID);
if (servicePrivate->interface != NULL) CFRelease(servicePrivate->interface);
- CFRelease(servicePrivate->prefs);
+ if (servicePrivate->prefs != NULL) CFRelease(servicePrivate->prefs);
+ if (servicePrivate->store != NULL) CFRelease(servicePrivate->store);
if (servicePrivate->name != NULL) CFRelease(servicePrivate->name);
return;
return NULL;
}
- servicePrivate->prefs = CFRetain(prefs);
+ servicePrivate->prefs = (prefs != NULL) ? CFRetain(prefs): NULL;
servicePrivate->serviceID = CFStringCreateCopy(NULL, serviceID);
servicePrivate->interface = (interface != NULL) ? CFRetain(interface) : NULL;
servicePrivate->name = NULL;
SCNetworkProtocolRef protocol;
SCNetworkServicePrivateRef servicePrivate = (SCNetworkServicePrivateRef)service;
- if (!isA_SCNetworkService(service)) {
+ if (!isA_SCNetworkService(service) || (servicePrivate->prefs == NULL)) {
_SCErrorSet(kSCStatusInvalidArgument);
return FALSE;
}
}
+SCNetworkServiceRef
+_SCNetworkServiceCopyActive(SCDynamicStoreRef store, CFStringRef serviceID)
+{
+ SCNetworkServicePrivateRef servicePrivate;
+
+ if (!isA_CFString(serviceID)) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return NULL;
+ }
+
+ servicePrivate = __SCNetworkServiceCreatePrivate(NULL, NULL, serviceID, NULL);
+ if (store != NULL) {
+ servicePrivate->store = CFRetain(store);
+ }
+ return (SCNetworkServiceRef)servicePrivate;
+}
+
+
SCNetworkProtocolRef
SCNetworkServiceCopyProtocol(SCNetworkServiceRef service, CFStringRef protocolType)
{
SCNetworkProtocolPrivateRef protocolPrivate = NULL;
SCNetworkServicePrivateRef servicePrivate = (SCNetworkServicePrivateRef)service;
- if (!isA_SCNetworkService(service)) {
+ if (!isA_SCNetworkService(service) || (servicePrivate->prefs == NULL)) {
_SCErrorSet(kSCStatusInvalidArgument);
return NULL;
}
protocols = SCPreferencesPathGetValue(servicePrivate->prefs, path);
CFRelease(path);
- if ((protocols != NULL) && !isA_CFDictionary(protocols)) {
+ if (!isA_CFDictionary(protocols)) {
// if corrupt prefs
_SCErrorSet(kSCStatusFailed);
return NULL;
CFDictionaryRef protocols;
SCNetworkServicePrivateRef servicePrivate = (SCNetworkServicePrivateRef)service;
- if (!isA_SCNetworkService(service)) {
+ if (!isA_SCNetworkService(service) || (servicePrivate->prefs == NULL)) {
_SCErrorSet(kSCStatusInvalidArgument);
return NULL;
}
CFRelease(path);
if (!isA_CFDictionary(protocols)) {
+ // if corrupt prefs
+ _SCErrorSet(kSCStatusFailed);
return NULL;
}
CFEqual(interfaceType, kSCNetworkInterfaceTypeSerial ) ||
CFEqual(interfaceType, kSCNetworkInterfaceTypeWWAN )) {
CFDictionaryRef overrides;
- CFStringRef script;
overrides = __SCNetworkInterfaceGetTemplateOverrides(interface, kSCNetworkInterfaceTypeModem);
config = newConfig;
}
- // update template for v.92 modems
- if ((overrides == NULL) &&
- CFDictionaryGetValueIfPresent(config,
- kSCPropNetModemConnectionScript,
- (const void **)&script) &&
- CFEqual(script, CFSTR("v.34 Personality")) &&
- _SCNetworkInterfaceIsModemV92(interface)) {
- CFMutableDictionaryRef newConfig;
-
- newConfig = CFDictionaryCreateMutableCopy(NULL, 0, config);
- CFDictionarySetValue(newConfig,
- kSCPropNetModemConnectionPersonality,
- CFSTR("v.92 Personality"));
- CFDictionarySetValue(newConfig,
- kSCPropNetModemDeviceModel,
- CFSTR("Apple Modem (v.92)"));
- CFRelease(config);
- config = newConfig;
- }
-
if (overrides != NULL) {
CFMutableDictionaryRef newConfig;
servicePrivate->interface);
// push the [deep] interface configuration into the service.
- interface_config = __SCNetworkInterfaceCopyDeepConfiguration(servicePrivate->interface);
- __SCNetworkInterfaceSetDeepConfiguration(servicePrivate->interface, interface_config);
+ interface_config = __SCNetworkInterfaceCopyDeepConfiguration(NULL, servicePrivate->interface);
+ __SCNetworkInterfaceSetDeepConfiguration(NULL, servicePrivate->interface, interface_config);
if (interface_config != NULL) CFRelease(interface_config);
// set the service name to match that of the associated interface
Boolean
SCNetworkServiceEstablishDefaultConfiguration(SCNetworkServiceRef service)
{
- CFIndex i;
- SCNetworkInterfaceRef interface;
- CFIndex n;
- CFArrayRef protocolTypes;
+ CFIndex i;
+ SCNetworkInterfaceRef interface;
+ CFIndex n;
+ CFArrayRef protocolTypes;
+ SCNetworkServicePrivateRef servicePrivate = (SCNetworkServicePrivateRef)service;
+
+ if (!isA_SCNetworkService(service) || (servicePrivate->prefs == NULL)) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return FALSE;
+ }
interface = SCNetworkServiceGetInterface(service);
if (interface == NULL) {
CFStringRef path;
SCNetworkServicePrivateRef servicePrivate = (SCNetworkServicePrivateRef)service;
- if (!isA_SCNetworkService(service)) {
+ if (!isA_SCNetworkService(service) || (servicePrivate->prefs == NULL)) {
_SCErrorSet(kSCStatusInvalidArgument);
return FALSE;
}
{
SCNetworkServicePrivateRef servicePrivate = (SCNetworkServicePrivateRef)service;
- if (!isA_SCNetworkService(service)) {
+ if (!isA_SCNetworkService(service) || (servicePrivate->prefs == NULL)) {
_SCErrorSet(kSCStatusInvalidArgument);
return NULL;
}
{
CFDictionaryRef entity;
SCNetworkInterfaceRef interface;
- SCNetworkServicePrivateRef servicePrivate = (SCNetworkServicePrivateRef)service;
CFStringRef name = NULL;
CFStringRef path;
+ SCNetworkServicePrivateRef servicePrivate = (SCNetworkServicePrivateRef)service;
- if (!isA_SCNetworkService(service)) {
+ if (!isA_SCNetworkService(service) || (servicePrivate->prefs == NULL)) {
_SCErrorSet(kSCStatusInvalidArgument);
return NULL;
}
SCNetworkInterfaceRef childInterface;
childInterface = SCNetworkInterfaceGetInterface(interface);
- if (childInterface == NULL) {
+ if ((childInterface == NULL) || CFEqual(childInterface, kSCNetworkInterfaceIPv4)) {
break;
}
}
if (interface != NULL) {
- CFStringRef interface_name;
+ int i;
+ CFStringRef interface_name = NULL;
CFStringRef suffix = NULL;
- if (servicePrivate->name != NULL) {
- interface_name = __SCNetworkInterfaceGetNonLocalizedDisplayName(interface);
+ //
+ // check if the [stored] service name matches the non-localized interface
+ // name. If so, return the localized name.
+ //
+ // Also, the older "Built-in XXX" interface names are too long for the
+ // current UI. If we find that the [stored] service name matches the older
+ // name, return the newer (and shorter) localized name.
+ //
+ // Note: the user/admin will no longer be able to set the service name
+ // to "Built-in Ethernet".
+ //
+ for (i = 0; i < 3; i++) {
+ if (servicePrivate->name == NULL) {
+ // if no [stored] service name to compare
+ break;
+ }
+
+ switch (i) {
+ case 0 :
+ // compare the non-localized interface name
+ interface_name = __SCNetworkInterfaceGetNonLocalizedDisplayName(interface);
+ if (interface_name != NULL) {
+ CFRetain(interface_name);
+ }
+ break;
+ case 1 :
+ // compare the older "Built-in XXX" localized name
+ interface_name = __SCNetworkInterfaceCopyXLocalizedDisplayName(interface);
+ break;
+ case 2 :
+ // compare the older "Built-in XXX" non-localized name
+ interface_name = __SCNetworkInterfaceCopyXNonLocalizedDisplayName(interface);
+ break;
+ }
+
if (interface_name != NULL) {
+ Boolean match = FALSE;
+
if (CFEqual(name, interface_name)) {
- // if service name matches the [non-]localized
+ // if service name matches the OLD localized
// interface name
- CFRelease(servicePrivate->name);
- servicePrivate->name = NULL;
+ match = TRUE;
} else if (CFStringHasPrefix(name, interface_name)) {
CFIndex prefixLen = CFStringGetLength(interface_name);
CFIndex suffixLen = CFStringGetLength(name);
suffix = CFStringCreateWithSubstring(NULL,
name,
CFRangeMake(prefixLen, suffixLen - prefixLen));
+ match = TRUE;
+ }
+ CFRelease(interface_name);
+
+ if (match) {
CFRelease(servicePrivate->name);
servicePrivate->name = NULL;
+ break;
}
}
}
+ //
+ // if the service name has not been set, use the localized interface name
+ //
if (servicePrivate->name == NULL) {
interface_name = SCNetworkInterfaceGetLocalizedDisplayName(interface);
if (interface_name != NULL) {
SCNetworkServiceRemove(SCNetworkServiceRef service)
{
Boolean ok = FALSE;
+ CFStringRef path;
SCNetworkServicePrivateRef servicePrivate = (SCNetworkServicePrivateRef)service;
CFArrayRef sets;
- CFStringRef path;
- if (!isA_SCNetworkService(service)) {
+ if (!isA_SCNetworkService(service) || (servicePrivate->prefs == NULL)) {
_SCErrorSet(kSCStatusInvalidArgument);
return FALSE;
}
CFStringRef path;
SCNetworkServicePrivateRef servicePrivate = (SCNetworkServicePrivateRef)service;
- if (!isA_SCNetworkService(service)) {
+ if (!isA_SCNetworkService(service) || (servicePrivate->prefs == NULL)) {
_SCErrorSet(kSCStatusInvalidArgument);
return FALSE;
}
CFStringRef path;
SCNetworkServicePrivateRef servicePrivate = (SCNetworkServicePrivateRef)service;
- if (!isA_SCNetworkService(service)) {
+ if (!isA_SCNetworkService(service) || (servicePrivate->prefs == NULL)) {
_SCErrorSet(kSCStatusInvalidArgument);
return FALSE;
}
CFStringRef saveName = NULL;
SCNetworkServicePrivateRef servicePrivate = (SCNetworkServicePrivateRef)service;
- if (!isA_SCNetworkService(service)) {
+ if (!isA_SCNetworkService(service) || (servicePrivate->prefs == NULL)) {
_SCErrorSet(kSCStatusInvalidArgument);
return FALSE;
}
servicePrivate->serviceID, // service
NULL); // entity
entity = SCPreferencesPathGetValue(servicePrivate->prefs, path);
- if ((entity == NULL) && (name != NULL)) {
- entity = CFDictionaryCreate(NULL,
- NULL,
- NULL,
- 0,
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
- }
- if (isA_CFDictionary(entity)) {
+ if (isA_CFDictionary(entity) ||
+ ((entity == NULL) && (name != NULL))) {
CFMutableDictionaryRef newEntity;
- newEntity = CFDictionaryCreateMutableCopy(NULL, 0, entity);
+ if (entity != NULL) {
+ newEntity = CFDictionaryCreateMutableCopy(NULL, 0, entity);
+ } else {
+ newEntity = CFDictionaryCreateMutable(NULL,
+ 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ }
if (saveName != NULL) {
CFDictionarySetValue(newEntity, kSCPropUserDefinedName, saveName);
} else {
return ok;
}
+
+
+#pragma mark -
+#pragma mark SCNetworkService SPIs
+
+
+static Boolean
+str_to_rank(CFStringRef rankStr, SCNetworkServicePrimaryRank *rank)
+{
+ if (isA_CFString(rankStr)) {
+ if (CFEqual(rankStr, kSCValNetServicePrimaryRankFirst)) {
+ *rank = kSCNetworkServicePrimaryRankFirst;
+ } else if (CFEqual(rankStr, kSCValNetServicePrimaryRankLast)) {
+ *rank = kSCNetworkServicePrimaryRankLast;
+ } else if (CFEqual(rankStr, kSCValNetServicePrimaryRankNever)) {
+ *rank = kSCNetworkServicePrimaryRankNever;
+ } else {
+ return FALSE;
+ }
+ } else if (rankStr == NULL) {
+ *rank = kSCNetworkServicePrimaryRankDefault;
+ } else {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+SCNetworkServicePrimaryRank
+SCNetworkServiceGetPrimaryRank(SCNetworkServiceRef service)
+{
+ CFDictionaryRef entity;
+ Boolean ok = TRUE;
+ CFStringRef path;
+ SCNetworkServicePrimaryRank rank = kSCNetworkServicePrimaryRankDefault;
+ CFStringRef rankStr = NULL;
+ SCNetworkServicePrivateRef servicePrivate = (SCNetworkServicePrivateRef)service;
+
+ if (!isA_SCNetworkService(service)) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return rank;
+ }
+
+ if (servicePrivate->prefs != NULL) {
+ path = SCPreferencesPathKeyCreateNetworkServiceEntity(NULL,
+ servicePrivate->serviceID,
+ NULL);
+ entity = SCPreferencesPathGetValue(servicePrivate->prefs, path);
+ CFRelease(path);
+ if (isA_CFDictionary(entity)) {
+ rankStr = CFDictionaryGetValue(entity, kSCPropNetServicePrimaryRank);
+ ok = str_to_rank(rankStr, &rank);
+ }
+ } else if (servicePrivate->store != NULL) {
+ path = SCDynamicStoreKeyCreateNetworkServiceEntity(NULL,
+ kSCDynamicStoreDomainState,
+ servicePrivate->serviceID,
+ NULL);
+ entity = SCDynamicStoreCopyValue(servicePrivate->store, path);
+ CFRelease(path);
+ if (entity != NULL) {
+ if (isA_CFDictionary(entity)) {
+ rankStr = CFDictionaryGetValue(entity, kSCPropNetServicePrimaryRank);
+ ok = str_to_rank(rankStr, &rank);
+ }
+ CFRelease(entity);
+ }
+ } else {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return rank;
+ }
+
+ if (!ok) {
+ rank = kSCNetworkServicePrimaryRankDefault;
+ _SCErrorSet(kSCStatusInvalidArgument);
+ } else if (rank == kSCNetworkServicePrimaryRankDefault) {
+ _SCErrorSet(kSCStatusOK);
+ }
+
+ return rank;
+}
+
+
+static Boolean
+rank_to_str(SCNetworkServicePrimaryRank rank, CFStringRef *rankStr)
+{
+ switch (rank) {
+ case kSCNetworkServicePrimaryRankDefault :
+ *rankStr = NULL;
+ break;
+ case kSCNetworkServicePrimaryRankFirst :
+ *rankStr = kSCValNetServicePrimaryRankFirst;
+ break;
+ case kSCNetworkServicePrimaryRankLast :
+ *rankStr = kSCValNetServicePrimaryRankLast;
+ break;
+ case kSCNetworkServicePrimaryRankNever :
+ *rankStr = kSCValNetServicePrimaryRankNever;
+ break;
+ default :
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+Boolean
+SCNetworkServiceSetPrimaryRank(SCNetworkServiceRef service,
+ SCNetworkServicePrimaryRank newRank)
+{
+ Boolean ok;
+ CFDictionaryRef entity;
+ CFMutableDictionaryRef newEntity;
+ CFStringRef path = NULL;
+ CFStringRef rankStr = NULL;
+ SCNetworkServicePrivateRef servicePrivate = (SCNetworkServicePrivateRef)service;
+
+ if (!isA_SCNetworkService(service)) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return FALSE;
+ }
+
+ ok = rank_to_str(newRank, &rankStr);
+ if (!ok) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return FALSE;
+ }
+
+ if (servicePrivate->prefs != NULL) {
+ if ((newRank == kSCNetworkServicePrimaryRankDefault) || (newRank == kSCNetworkServicePrimaryRankNever)) {
+ path = SCPreferencesPathKeyCreateNetworkServiceEntity(NULL,
+ servicePrivate->serviceID,
+ NULL);
+ entity = SCPreferencesPathGetValue(servicePrivate->prefs, path);
+ if (entity != NULL) {
+ if (!isA_CFDictionary(entity)) {
+ // if corrupt prefs
+ _SCErrorSet(kSCStatusFailed);
+ goto done;
+ }
+ newEntity = CFDictionaryCreateMutableCopy(NULL, 0, entity);
+ } else {
+ newEntity = CFDictionaryCreateMutable(NULL,
+ 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ }
+ if (rankStr != NULL) {
+ CFDictionarySetValue(newEntity, kSCPropNetServicePrimaryRank, rankStr);
+ } else {
+ CFDictionaryRemoveValue(newEntity, kSCPropNetServicePrimaryRank);
+ }
+ if (CFDictionaryGetCount(newEntity) > 0) {
+ ok = SCPreferencesPathSetValue(servicePrivate->prefs, path, newEntity);
+ } else {
+ ok = SCPreferencesPathRemoveValue(servicePrivate->prefs, path);
+ }
+ CFRelease(newEntity);
+ if (!ok) {
+ goto done;
+ }
+ } else {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return FALSE;
+ }
+ } else if (servicePrivate->store != NULL) {
+ path = SCDynamicStoreKeyCreateNetworkServiceEntity(NULL,
+ kSCDynamicStoreDomainState,
+ servicePrivate->serviceID,
+ NULL);
+ entity = SCDynamicStoreCopyValue(servicePrivate->store, path);
+ if (entity != NULL) {
+ if (!isA_CFDictionary(entity)) {
+ // if corrupt prefs
+ CFRelease(entity);
+ _SCErrorSet(kSCStatusFailed);
+ goto done;
+ }
+ newEntity = CFDictionaryCreateMutableCopy(NULL, 0, entity);
+ CFRelease(entity);
+ } else {
+ newEntity = CFDictionaryCreateMutable(NULL,
+ 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ }
+ if (rankStr != NULL) {
+ CFDictionarySetValue(newEntity, kSCPropNetServicePrimaryRank, rankStr);
+ } else {
+ CFDictionaryRemoveValue(newEntity, kSCPropNetServicePrimaryRank);
+ }
+ if (CFDictionaryGetCount(newEntity) > 0) {
+ ok = SCDynamicStoreSetValue(servicePrivate->store, path, newEntity);
+ } else {
+ ok = SCDynamicStoreRemoveValue(servicePrivate->store, path);
+ }
+ CFRelease(newEntity);
+ if (!ok) {
+ goto done;
+ }
+ } else {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return FALSE;
+ }
+
+ done :
+
+ if (path != NULL) CFRelease(path);
+ return ok;
+}
/*
- * Copyright (c) 2004-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2004-2007, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
setPrivate->setID = CFStringCreateCopy(NULL, setID);
setPrivate->prefs = CFRetain(prefs);
setPrivate->name = NULL;
+ setPrivate->established = FALSE; // "new" (not yet established) set
return setPrivate;
}
static Boolean
-_serviceIsPPP(SCNetworkServiceRef service)
+_serviceIsVPN(SCNetworkServiceRef service)
{
SCNetworkInterfaceRef interface;
CFStringRef interfaceType;
}
interfaceType = SCNetworkInterfaceGetInterfaceType(interface);
- return CFEqual(interfaceType, kSCNetworkInterfaceTypePPP);
-}
-
-
-static Boolean
-_serviceIsVPN(SCNetworkServiceRef service)
-{
- SCNetworkInterfaceRef interface;
- CFStringRef interfaceType;
-
-// if (!_serviceIsPPP(service)) {
-// return FALSE;
-// }
-
- interface = SCNetworkServiceGetInterface(service);
-// if (interface == NULL) {
-// return FALSE;
-// }
+ if (CFEqual(interfaceType, kSCNetworkInterfaceTypePPP)) {
+ interface = SCNetworkInterfaceGetInterface(interface);
+ if (interface == NULL) {
+ return FALSE;
+ }
- interface = SCNetworkInterfaceGetInterface(interface);
- if (interface == NULL) {
+ interfaceType = SCNetworkInterfaceGetInterfaceType(interface);
+ if (CFEqual(interfaceType, kSCNetworkInterfaceTypeL2TP)) {
+ return TRUE;
+ }
+ if (CFEqual(interfaceType, kSCNetworkInterfaceTypePPTP)) {
+ return TRUE;
+ }
return FALSE;
}
+ if (CFEqual(interfaceType, kSCNetworkInterfaceTypeIPSec)) {
+ return TRUE;
+ }
- interfaceType = SCNetworkInterfaceGetInterfaceType(interface);
- return (CFEqual(interfaceType, kSCNetworkInterfaceTypeL2TP) ||
- CFEqual(interfaceType, kSCNetworkInterfaceTypePPTP));
+ return FALSE;
}
SCNetworkInterfaceRef interface;
interface = SCNetworkServiceGetInterface(service);
- if (interface == NULL) {
- return 100000; // sort last
+ if ((interface == NULL) || _serviceIsVPN(service)) {
+ return 100000; // if unknown or VPN interface, sort last
}
return __SCNetworkInterfaceOrder(interface);
CFMutableArrayRef newOrder;
CFArrayRef order;
CFStringRef serviceID;
+ CFIndex serviceOrder;
SCNetworkSetPrivateRef setPrivate = (SCNetworkSetPrivateRef)set;
CFIndex slot;
goto done;
}
- if (_serviceIsPPP(service) && !_serviceIsVPN(service)) {
- int serviceOrder;
+ serviceOrder = _serviceOrder(service);
- /*
- * we add [non-VPN] PPP interfaces to the head of the
- * service order but ensure that "modem" devices are
- * in front of "Bluetooth" & "IrDA" devices.
- */
- slot = 0;
-
- serviceOrder = _serviceOrder(service);
-
- for (i = 0; i < n; i++) {
- int slotOrder;
- CFStringRef slotServiceID;
- SCNetworkServiceRef slotService;
-
- slotServiceID = CFArrayGetValueAtIndex(newOrder, i);
- if (!isA_CFString(slotServiceID)) {
- // if bad prefs
- continue;
- }
+ slot = 0;
+ for (i = 0; i < n; i++) {
+ int slotOrder;
+ SCNetworkServiceRef slotService;
+ CFStringRef slotServiceID;
- slotService = SCNetworkServiceCopy(setPrivate->prefs, slotServiceID);
- if (slotService == NULL) {
- // if serviceID not valid
- continue;
- }
+ slotServiceID = CFArrayGetValueAtIndex(newOrder, i);
+ if (!isA_CFString(slotServiceID)) {
+ // if bad prefs
+ continue;
+ }
- if (_serviceIsPPP(slotService)) {
- // if PPP service
- slotOrder = _serviceOrder(slotService);
- if (serviceOrder >= slotOrder) {
- // add the service *after* this one
- slot = i + 1;
- }
- }
+ slotService = SCNetworkServiceCopy(setPrivate->prefs, slotServiceID);
+ if (slotService == NULL) {
+ // if serviceID not valid
+ continue;
+ }
- CFRelease(slotService);
+ slotOrder = _serviceOrder(slotService);
+ if (serviceOrder >= slotOrder) {
+ // add the service *after* this one
+ slot = i + 1;
}
- } else {
- /*
- * non-PPP interfaces are added to the end of the list.
- */
- slot = n;
+
+ CFRelease(slotService);
}
CFArrayInsertValueAtIndex(newOrder, slot, serviceID);
return FALSE;
}
- if (!isA_SCNetworkService(service)) {
+ if (!isA_SCNetworkService(service) || (servicePrivate->prefs == NULL)) {
_SCErrorSet(kSCStatusInvalidArgument);
return FALSE;
}
// get the [deep] interface configuration settings
interface = SCNetworkServiceGetInterface(service);
if (interface != NULL) {
- interface_config = __SCNetworkInterfaceCopyDeepConfiguration(interface);
+ interface_config = __SCNetworkInterfaceCopyDeepConfiguration(set, interface);
}
// create the link between "set" and the "service"
// push the [deep] interface configuration into all sets which contain this service.
if (interface != NULL) {
- __SCNetworkInterfaceSetDeepConfiguration(interface, interface_config);
+ __SCNetworkInterfaceSetDeepConfiguration(set, interface, interface_config);
}
// add service to ServiceOrder
_serviceOrder_add(set, service);
+ // mark set as no longer "new"
+ setPrivate->established = TRUE;
+
done :
if (interface_config != NULL) CFRelease(interface_config);
}
setPrivate = __SCNetworkSetCreatePrivate(NULL, prefs, setID);
+
+ // mark set as "old" (already established)
+ setPrivate->established = TRUE;
+
return (SCNetworkSetRef)setPrivate;
}
}
setPrivate = __SCNetworkSetCreatePrivate(NULL, prefs, keys[i]);
+
+ // mark set as "old" (already established)
+ setPrivate->established = TRUE;
+
CFArrayAppendValue(array, (SCNetworkSetRef)setPrivate);
CFRelease(setPrivate);
}
path = SCPreferencesPathKeyCreateSet(NULL, setID);
if (CFEqual(path, currentID)) {
setPrivate = __SCNetworkSetCreatePrivate(NULL, prefs, setID);
+
+ // mark set as "old" (already established)
+ setPrivate->established = TRUE;
} else {
SCLog(TRUE, LOG_ERR, CFSTR("SCNetworkSetCopyCurrent(): preferences are non-conformant"));
}
setPrivate = __SCNetworkSetCreatePrivate(NULL, prefs, setID);
CFRelease(components);
+ // mark set as "new" (not yet established)
+ setPrivate->established = FALSE;
+
return (SCNetworkSetRef)setPrivate;
}
CFArrayRef interface_config = NULL;
Boolean ok;
CFStringRef path;
+ int sc_status = kSCStatusOK;
SCNetworkServicePrivateRef servicePrivate = (SCNetworkServicePrivateRef)service;
SCNetworkSetPrivateRef setPrivate = (SCNetworkSetPrivateRef)set;
return FALSE;
}
- if (!isA_SCNetworkService(service)) {
+ if (!isA_SCNetworkService(service) || (servicePrivate->prefs == NULL)) {
_SCErrorSet(kSCStatusInvalidArgument);
return FALSE;
}
// get the [deep] interface configuration settings
interface = SCNetworkServiceGetInterface(service);
if (interface != NULL) {
- interface_config = __SCNetworkInterfaceCopyDeepConfiguration(interface);
+ interface_config = __SCNetworkInterfaceCopyDeepConfiguration(set, interface);
if (interface_config != NULL) {
// remove the interface configuration from all sets which contain this service.
- __SCNetworkInterfaceSetDeepConfiguration(interface, NULL);
+ __SCNetworkInterfaceSetDeepConfiguration(set, interface, NULL);
}
}
servicePrivate->serviceID,
NULL);
ok = SCPreferencesPathRemoveValue(setPrivate->prefs, path);
- CFRelease(path);
if (!ok) {
- goto done;
+ sc_status = SCError(); // preserve the error
}
+ CFRelease(path);
// push the [deep] interface configuration [back] into all sets which contain the service.
if (interface_config != NULL) {
- __SCNetworkInterfaceSetDeepConfiguration(interface, interface_config);
+ __SCNetworkInterfaceSetDeepConfiguration(set, interface, interface_config);
}
- done :
-
if (interface_config != NULL) CFRelease(interface_config);
+ if (!ok) {
+ _SCErrorSet(sc_status);
+ }
return ok;
}
path = SCPreferencesPathKeyCreateSet(NULL, setPrivate->setID);
entity = SCPreferencesPathGetValue(setPrivate->prefs, path);
- if ((entity == NULL) && (name != NULL)) {
- entity = CFDictionaryCreate(NULL,
- NULL,
- NULL,
- 0,
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
- }
- if (isA_CFDictionary(entity)) {
+ if (isA_CFDictionary(entity) ||
+ ((entity == NULL) && (name != NULL))) {
CFMutableDictionaryRef newEntity;
- newEntity = CFDictionaryCreateMutableCopy(NULL, 0, entity);
+ if (entity != NULL) {
+ newEntity = CFDictionaryCreateMutableCopy(NULL, 0, entity);
+ } else {
+ newEntity = CFDictionaryCreateMutable(NULL,
+ 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ }
if (name != NULL) {
CFDictionarySetValue(newEntity, kSCPropUserDefinedName, name);
} else {
// for those interfaces that are not represented in the
// current set.
services = SCNetworkSetCopyServices(set);
- if ((services != NULL) && (CFArrayGetCount(services) > 0)) {
- // but, if we are starting off with a non-empty
- // set than we only want to add new services for
- // those interfaces that are not represented in
- // *any* set.
+ if ((services != NULL) && setPrivate->established) {
+ // but, if we are given an existing (or "established") set
+ // than we only want to add new services for those interfaces
+ // that are not represented in *any* set.
CFRelease(services);
services = SCNetworkServiceCopyAll(setPrivate->prefs);
}
* @APPLE_LICENSE_HEADER_END@
*/
-/*
+/*
* SCNetworkSignature.c
* - implementation of SCNetworkSignatureRef API that allows access to
network identification information
- *
+ *
*/
/*
* Modification History
#include "SCNetworkSignature.h"
#include "SCNetworkSignaturePrivate.h"
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
-#error MAC_OS_X_VERSION_MIN_REQUIRED < 1050, Check MACOSX_DEPLOYMENT_TARGET
-#endif
-
const char * kSCNetworkSignatureActiveChangedNotifyName = NETWORK_ID_KEY ".active";
{
CFDictionaryRef id_dict = NULL;
Boolean release_store = FALSE;
-
+
if (store == NULL) {
store = store_create(alloc);
if (store == NULL) {
}
release_store = TRUE;
}
- id_dict = SCDynamicStoreCopyValue(store,
+ id_dict = SCDynamicStoreCopyValue(store,
kSCNetworkIdentificationStoreKey);
if (isA_CFDictionary(id_dict) == NULL) {
if (id_dict != NULL) {
return (id_dict);
}
-#pragma -
+#pragma -
#pragma mark SCNetworkSignature APIs
/* only accept 0.0.0.0 (i.e. default) for now */
sin_p = (struct sockaddr_in *)addr;
- if (addr == NULL
+ if (addr == NULL
|| addr->sa_family != AF_INET
|| addr->sa_len != sizeof(struct sockaddr_in)
|| sin_p->sin_addr.s_addr != 0) {
}
}
CFRetain(active);
-
+
done:
if (id_dict != NULL) {
CFRelease(id_dict);
/*
- * Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2006, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#ifndef _SCNETWORKSIGNATURE_H
#define _SCNETWORKSIGNATURE_H
-#include <AvailabilityMacros.h>
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
-
+#include <Availability.h>
#include <CoreFoundation/CFString.h>
#include <CoreFoundation/CFArray.h>
#include <netinet/in.h>
/*!
@header SCNetworkSignature
- @discussion The SCNetworkSignature API provides access to the
+ @discussion The SCNetworkSignature API provides access to the
network identification information. Each routable network
has an associated signature that is assigned a unique
identifier. The unique identifier allows an application
NULL if no networks are currently active.
*/
CFArrayRef /* of CFStringRef's */
-SCNetworkSignatureCopyActiveIdentifiers(CFAllocatorRef alloc);
+SCNetworkSignatureCopyActiveIdentifiers(CFAllocatorRef alloc) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
/*!
@function SCNetworkSignatureCopyActiveIdentifierForAddress
*/
CFStringRef
SCNetworkSignatureCopyActiveIdentifierForAddress(CFAllocatorRef alloc,
- const struct sockaddr * addr);
-
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 */
+ const struct sockaddr * addr) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
#endif /* _SCNETWORKSIGNATURE_H */
/*
- * Copyright (c) 2000, 2001, 2003-2005, 2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003-2005, 2007, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
sig = (SCPSignatureDataRef)CFDataGetBytePtr(signature);
sig->st_dev = statBuf->st_dev;
sig->st_ino = statBuf->st_ino;
- sig->st_mtimespec = statBuf->st_mtimespec;
+ sig->tv_sec = statBuf->st_mtimespec.tv_sec;
+ sig->tv_nsec = statBuf->st_mtimespec.tv_nsec;
sig->st_size = statBuf->st_size;
return signature;
}
/*
- * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
static ssize_t
-writen(int ref, void *data, size_t len)
+writen(int ref, const void *data, size_t len)
{
size_t left = len;
ssize_t n;
(void) close(fd);
goto done;
}
- if (writen(fd, (void *)CFDataGetBytePtr(newPrefs), CFDataGetLength(newPrefs)) == -1) {
+ if (writen(fd, (const void *)CFDataGetBytePtr(newPrefs), CFDataGetLength(newPrefs)) == -1) {
_SCErrorSet(errno);
SCLog(_sc_verbose, LOG_ERR, CFSTR("SCPreferencesCommitChanges write() failed: %s"), strerror(errno));
SCLog(_sc_verbose, LOG_ERR, CFSTR(" path = %s"), thePath);
goto done;
}
+#if !TARGET_OS_IPHONE
/* synchronize the file's in-core state with that on disk */
if (fsync(fd) == -1) {
_SCErrorSet(errno);
* Note: at present, this only works on HFS filesystems
*/
(void) fcntl(fd, F_FULLFSYNC, 0);
+#endif // !TARGET_OS_IPHONE
/* new preferences have been written */
if (close(fd) == -1) {
/*
- * Copyright (c) 2000, 2001, 2004-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2004-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include <grp.h>
#include <fcntl.h>
+#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
#include <sys/errno.h>
+#if TARGET_OS_IPHONE
+__private_extern__ int
+getgrnam_r(const char *name, __unused struct group *grp, __unused char *buf, __unused size_t bufsize, struct group **grpP)
+{
+ *grpP = getgrnam(name);
+ return (*grpP == NULL) ? -1 : 0;
+}
+#endif /* TARGET_OS_IPHONE */
+
+
static Boolean
__SCPreferencesLock_helper(SCPreferencesRef prefs, Boolean wait)
{
}
+static void
+reportDelay(SCPreferencesRef prefs, struct timeval *delay, Boolean isStale)
+{
+ aslmsg m;
+ SCPreferencesPrivateRef prefsPrivate = (SCPreferencesPrivateRef)prefs;
+ char str[256];
+
+ m = asl_new(ASL_TYPE_MSG);
+ asl_set(m, "com.apple.message.domain", "com.apple.SystemConfiguration.SCPreferencesLock");
+ (void) _SC_cfstring_to_cstring(prefsPrivate->name, str, sizeof(str), kCFStringEncodingUTF8);
+ asl_set(m, "com.apple.message.signature", str);
+ (void) _SC_cfstring_to_cstring(prefsPrivate->prefsID, str, sizeof(str), kCFStringEncodingUTF8);
+ asl_set(m, "com.apple.message.signature2", str);
+ (void) snprintf(str, sizeof(str),
+ "%d.%3.3d",
+ (int)delay->tv_sec,
+ delay->tv_usec / 1000);
+ asl_set(m, "com.apple.message.value", str);
+ SCLOG(NULL, m, ASL_LEVEL_DEBUG,
+ CFSTR("SCPreferences(%@:%@) lock delayed for %d.%3.3d seconds%s"),
+ prefsPrivate->name,
+ prefsPrivate->prefsID,
+ (int)delay->tv_sec,
+ delay->tv_usec / 1000,
+ isStale ? " (stale)" : "");
+ asl_free(m);
+
+ return;
+}
+
+
Boolean
SCPreferencesLock(SCPreferencesRef prefs, Boolean wait)
{
char buf[32];
+ struct timeval lockStart;
+ struct timeval lockElapsed;
SCPreferencesPrivateRef prefsPrivate = (SCPreferencesPrivateRef)prefs;
int sc_status = kSCStatusFailed;
struct stat statBuf;
snprintf(prefsPrivate->lockPath, pathLen, "%s-lock", path);
}
+ (void)gettimeofday(&lockStart, NULL);
+
retry :
prefsPrivate->lockFD = open(prefsPrivate->lockPath,
locked :
+ (void)gettimeofday(&prefsPrivate->lockTime, NULL);
+ timersub(&prefsPrivate->lockTime, &lockStart, &lockElapsed);
+
if (prefsPrivate->accessed) {
CFDataRef currentSignature;
Boolean match;
SCLog(TRUE, LOG_DEBUG,
CFSTR("SCPreferencesLock stat() failed: %s"),
strerror(errno));
- sc_status = kSCStatusStale;
- unlink(prefsPrivate->lockPath);
- goto error;
+ goto stale;
}
}
* session was accessed so we've got no choice
* but to deny the lock request.
*/
- sc_status = kSCStatusStale;
- unlink(prefsPrivate->lockPath);
- goto error;
+ goto stale;
}
// } else {
// /*
// */
}
+ if (lockElapsed.tv_sec > 0) {
+ // if we waited more than 1 second to acquire the lock
+ reportDelay(prefs, &lockElapsed, FALSE);
+ }
+
prefsPrivate->locked = TRUE;
pthread_mutex_unlock(&prefsPrivate->lock);
return TRUE;
+ stale :
+
+ sc_status = kSCStatusStale;
+ unlink(prefsPrivate->lockPath);
+
+ if (lockElapsed.tv_sec > 0) {
+ // if we waited more than 1 second to acquire the lock
+ reportDelay(prefs, &lockElapsed, TRUE);
+ }
+
error :
if (prefsPrivate->lockFD != -1) {
/*
- * Copyright(c) 2000-2007 Apple Inc. All rights reserved.
+ * Copyright(c) 2000-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* - initial revision
*/
+#include <Availability.h>
+#include <TargetConditionals.h>
+#include <sys/cdefs.h>
+#if !TARGET_OS_IPHONE
+#include <dispatch/dispatch.h>
+#endif // !TARGET_OS_IPHONE
#include <SystemConfiguration/SystemConfiguration.h>
#include <SystemConfiguration/SCValidation.h>
#include <SystemConfiguration/SCPrivate.h>
#include "SCPreferencesInternal.h"
#include "SCHelper_client.h"
-#include <Security/Security.h>
#include "dy_framework.h"
#include <fcntl.h>
#include <sys/errno.h>
+static __inline__ CFTypeRef
+isA_SCPreferences(CFTypeRef obj)
+{
+ return (isA_CFType(obj, SCPreferencesGetTypeID()));
+}
+
+
static CFStringRef
__SCPreferencesCopyDescription(CFTypeRef cf) {
CFAllocatorRef allocator = CFGetAllocator(cf);
prefsPrivate->session = NULL;
prefsPrivate->sessionKeyCommit = NULL;
prefsPrivate->sessionKeyApply = NULL;
+ prefsPrivate->scheduled = FALSE;
prefsPrivate->rls = NULL;
prefsPrivate->rlsFunction = NULL;
prefsPrivate->rlsContext.info = NULL;
prefsPrivate->rlsContext.release = NULL;
prefsPrivate->rlsContext.copyDescription = NULL;
prefsPrivate->rlList = NULL;
+#if !TARGET_OS_IPHONE
+ prefsPrivate->dispatchQueue = NULL;
+#endif // !TARGET_OS_IPHONE
prefsPrivate->prefs = NULL;
prefsPrivate->accessed = FALSE;
prefsPrivate->changed = FALSE;
__SCPreferencesCreate_helper(SCPreferencesRef prefs)
{
CFDataRef data = NULL;
+ CFMutableDictionaryRef info;
+ CFNumberRef num;
Boolean ok;
SCPreferencesPrivateRef prefsPrivate = (SCPreferencesPrivateRef)prefs;
uint32_t status = kSCStatusOK;
+ uint32_t pid = getpid();
// start helper
prefsPrivate->helper = _SCHelperOpen(prefsPrivate->authorizationData);
goto fail;
}
- // serialize the "prefsID"
+ // create a dictionary of information to pass to the helper
+ info = CFDictionaryCreateMutable(NULL,
+ 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
if (prefsPrivate->prefsID != NULL) {
- ok = _SCSerializeString(prefsPrivate->prefsID, &data, NULL, NULL);
- if (!ok) {
- goto fail;
- }
+ CFDictionarySetValue(info, CFSTR("prefsID"), prefsPrivate->prefsID);
+ }
+ CFDictionarySetValue(info, CFSTR("name"), prefsPrivate->name);
+ num = CFNumberCreate(NULL, kCFNumberSInt32Type, &pid);
+ CFDictionarySetValue(info, CFSTR("PID"), num);
+ CFRelease(num);
+
+ // serialize the info
+ ok = _SCSerialize(info, &data, NULL, NULL);
+ CFRelease(info);
+ if (data == NULL || !ok) {
+ goto fail;
}
// have the helper "open" the prefs
goto done;
}
+ SCLog(_sc_verbose, LOG_DEBUG, CFSTR("__SCPreferencesCreate open() failed: %s"), strerror(errno));
sc_status = kSCStatusAccessError;
break;
default :
+ SCLog(TRUE, LOG_ERR, CFSTR("__SCPreferencesCreate open() failed: %s"), strerror(errno));
sc_status = kSCStatusFailed;
break;
}
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("__SCPreferencesCreate open() failed: %s"), strerror(errno));
goto error;
}
if (fd != -1) {
(void) close(fd);
- fd = -1;
}
if (prefsPrivate->prefs == NULL) {
/*
* new file, create empty preferences
*/
- SCLog(_sc_verbose, LOG_DEBUG, CFSTR("__SCPreferencesAccess(): creating new preferences file."));
+// SCLog(_sc_verbose, LOG_DEBUG, CFSTR("__SCPreferencesAccess(): creating new preferences file."));
prefsPrivate->prefs = CFDictionaryCreateMutable(allocator,
0,
&kCFTypeDictionaryKeyCallBacks,
CFStringRef prefsID,
AuthorizationRef authorization)
{
- CFDataRef authorizationData;
+ CFDataRef authorizationData = NULL;
+ SCPreferencesPrivateRef prefsPrivate;
+
+#if !TARGET_OS_IPHONE
AuthorizationExternalForm extForm;
OSStatus os_status;
- SCPreferencesPrivateRef prefsPrivate;
os_status = AuthorizationMakeExternalForm(authorization, &extForm);
if (os_status != errAuthorizationSuccess) {
}
authorizationData = CFDataCreate(NULL, (const UInt8 *)extForm.bytes, sizeof(extForm.bytes));
+#else // !TARGET_OS_IPHONE
+ CFBundleRef bundle;
+ CFStringRef bundleID = NULL;
+
+ /* get the application/executable/bundle name */
+ bundle = CFBundleGetMainBundle();
+ if (bundle != NULL) {
+ bundleID = CFBundleGetIdentifier(bundle);
+ if (bundleID != NULL) {
+ CFRetain(bundleID);
+ } else {
+ CFURLRef url;
+
+ url = CFBundleCopyExecutableURL(bundle);
+ if (url != NULL) {
+ bundleID = CFURLCopyPath(url);
+ CFRelease(url);
+ }
+ }
+
+ if (bundleID != NULL) {
+ if (CFEqual(bundleID, CFSTR("/"))) {
+ CFRelease(bundleID);
+ bundleID = NULL;
+ }
+ }
+ }
+ if (bundleID == NULL) {
+ bundleID = CFStringCreateWithFormat(NULL, NULL, CFSTR("Unknown(%d)"), getpid());
+ }
+
+ _SCSerializeString(bundleID, &authorizationData, NULL, NULL);
+ CFRelease(bundleID);
+#endif // !TARGET_OS_IPHONE
+
prefsPrivate = __SCPreferencesCreate(allocator, name, prefsID, authorizationData);
CFRelease(authorizationData);
/* establish a dynamic store session */
prefsPrivate->session = SCDynamicStoreCreate(allocator,
- CFSTR("SCPreferences"),
+ prefsPrivate->name,
prefsNotify,
&context);
if (prefsPrivate->session == NULL) {
{
SCPreferencesPrivateRef prefsPrivate = (SCPreferencesPrivateRef)prefs;
- if (prefs == NULL) {
+ if (!isA_SCPreferences(prefs)) {
/* sorry, you must provide a session */
_SCErrorSet(kSCStatusNoPrefsSession);
return FALSE;
}
-Boolean
-SCPreferencesScheduleWithRunLoop(SCPreferencesRef prefs,
- CFRunLoopRef runLoop,
- CFStringRef runLoopMode)
+static Boolean
+__SCPreferencesScheduleWithRunLoop(SCPreferencesRef prefs,
+ CFRunLoopRef runLoop,
+ CFStringRef runLoopMode,
+#if !TARGET_OS_IPHONE
+ dispatch_queue_t queue
+#else // !TARGET_OS_IPHONE
+ void *queue
+#endif // !TARGET_OS_IPHONE
+ )
{
+ Boolean ok = FALSE;
SCPreferencesPrivateRef prefsPrivate = (SCPreferencesPrivateRef)prefs;
- if (prefs == NULL) {
- /* sorry, you must provide a session */
- _SCErrorSet(kSCStatusNoPrefsSession);
- return FALSE;
- }
-
pthread_mutex_lock(&prefsPrivate->lock);
- if (prefsPrivate->rls == NULL) {
+#if !TARGET_OS_IPHONE
+ if ((prefsPrivate->dispatchQueue != NULL) || // if we are already scheduled on a dispatch queue
+ ((queue != NULL) && prefsPrivate->scheduled)) { // if we are already scheduled on a CFRunLoop
+ _SCErrorSet(kSCStatusInvalidArgument);
+ goto done;
+ }
+#endif // !TARGET_OS_IPHONE
+
+ if (!prefsPrivate->scheduled) {
CFMutableArrayRef keys;
if (prefsPrivate->session == NULL) {
- __SCPreferencesAddSession(prefs);
+ ok = __SCPreferencesAddSession(prefs);
+ if (!ok) {
+ goto done;
+ }
}
CFRetain(prefs); // hold a reference to the prefs
(void) SCDynamicStoreSetNotificationKeys(prefsPrivate->session, keys, NULL);
CFRelease(keys);
- prefsPrivate->rls = SCDynamicStoreCreateRunLoopSource(NULL, prefsPrivate->session, 0);
- prefsPrivate->rlList = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+ if (runLoop != NULL) {
+ prefsPrivate->rls = SCDynamicStoreCreateRunLoopSource(NULL, prefsPrivate->session, 0);
+ prefsPrivate->rlList = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+ }
+
+ prefsPrivate->scheduled = TRUE;
}
- if (!_SC_isScheduled(NULL, runLoop, runLoopMode, prefsPrivate->rlList)) {
- /*
- * if we do not already have notifications scheduled with
- * this runLoop / runLoopMode
- */
- CFRunLoopAddSource(runLoop, prefsPrivate->rls, runLoopMode);
+#if !TARGET_OS_IPHONE
+ if (queue != NULL) {
+ ok = SCDynamicStoreSetDispatchQueue(prefsPrivate->session, queue);
+ if (!ok) {
+ prefsPrivate->scheduled = FALSE;
+ (void) SCDynamicStoreSetNotificationKeys(prefsPrivate->session, NULL, NULL);
+ CFRelease(prefs);
+ goto done;
+ }
+
+ prefsPrivate->dispatchQueue = queue;
+ dispatch_retain(prefsPrivate->dispatchQueue);
+ } else
+#endif // !TARGET_OS_IPHONE
+ {
+ if (!_SC_isScheduled(NULL, runLoop, runLoopMode, prefsPrivate->rlList)) {
+ /*
+ * if we do not already have notifications scheduled with
+ * this runLoop / runLoopMode
+ */
+ CFRunLoopAddSource(runLoop, prefsPrivate->rls, runLoopMode);
+ }
+
+ _SC_schedule(prefs, runLoop, runLoopMode, prefsPrivate->rlList);
}
- _SC_schedule(prefs, runLoop, runLoopMode, prefsPrivate->rlList);
+ ok = TRUE;
+
+ done :
pthread_mutex_unlock(&prefsPrivate->lock);
- return TRUE;
+ return ok;
}
-Boolean
-SCPreferencesUnscheduleFromRunLoop(SCPreferencesRef prefs,
- CFRunLoopRef runLoop,
- CFStringRef runLoopMode)
+static Boolean
+__SCPreferencesUnscheduleFromRunLoop(SCPreferencesRef prefs,
+ CFRunLoopRef runLoop,
+ CFStringRef runLoopMode)
{
SCPreferencesPrivateRef prefsPrivate = (SCPreferencesPrivateRef)prefs;
- CFIndex n;
+ CFIndex n = 0;
Boolean ok = FALSE;
- if (prefs == NULL) {
- /* sorry, you must provide a session */
- _SCErrorSet(kSCStatusNoPrefsSession);
- return FALSE;
- }
-
pthread_mutex_lock(&prefsPrivate->lock);
- if (prefsPrivate->rls == NULL) {
- /* if not currently scheduled */
+ if ((runLoop != NULL) && !prefsPrivate->scheduled) { // if we should be scheduled (but are not)
+ _SCErrorSet(kSCStatusInvalidArgument);
goto done;
}
- if (!_SC_unschedule(NULL, runLoop, runLoopMode, prefsPrivate->rlList, FALSE)) {
- /* if not currently scheduled */
+#if !TARGET_OS_IPHONE
+ if (((runLoop == NULL) && (prefsPrivate->dispatchQueue == NULL)) || // if we should be scheduled on a dispatch queue (but are not)
+ ((runLoop != NULL) && (prefsPrivate->dispatchQueue != NULL))) { // if we should be scheduled on a CFRunLoop (but are scheduled on a dispatch queue)
+ _SCErrorSet(kSCStatusInvalidArgument);
goto done;
}
+#endif // !TARGET_OS_IPHONE
+
+#if !TARGET_OS_IPHONE
+ if (runLoop == NULL) {
+ SCDynamicStoreSetDispatchQueue(prefsPrivate->session, NULL);
+ dispatch_release(prefsPrivate->dispatchQueue);
+ prefsPrivate->dispatchQueue = NULL;
+ } else
+#endif // !TARGET_OS_IPHONE
+ {
+ if (!_SC_unschedule(prefs, runLoop, runLoopMode, prefsPrivate->rlList, FALSE)) {
+ // if not currently scheduled on this runLoop / runLoopMode
+ _SCErrorSet(kSCStatusInvalidArgument);
+ goto done;
+ }
- n = CFArrayGetCount(prefsPrivate->rlList);
- if (n == 0 || !_SC_isScheduled(NULL, runLoop, runLoopMode, prefsPrivate->rlList)) {
- /*
- * if we are no longer scheduled to receive notifications for
- * this runLoop / runLoopMode
- */
- CFRunLoopRemoveSource(runLoop, prefsPrivate->rls, runLoopMode);
-
- if (n == 0) {
- CFArrayRef changedKeys;
-
+ n = CFArrayGetCount(prefsPrivate->rlList);
+ if (n == 0 || !_SC_isScheduled(NULL, runLoop, runLoopMode, prefsPrivate->rlList)) {
/*
- * if *all* notifications have been unscheduled
+ * if we are no longer scheduled to receive notifications for
+ * this runLoop / runLoopMode
*/
- CFRunLoopSourceInvalidate(prefsPrivate->rls);
- CFRelease(prefsPrivate->rls);
- prefsPrivate->rls = NULL;
- CFRelease(prefsPrivate->rlList);
- prefsPrivate->rlList = NULL;
+ CFRunLoopRemoveSource(runLoop, prefsPrivate->rls, runLoopMode);
+
+ if (n == 0) {
+ // if *all* notifications have been unscheduled
+ CFRelease(prefsPrivate->rlList);
+ prefsPrivate->rlList = NULL;
+ CFRunLoopSourceInvalidate(prefsPrivate->rls);
+ CFRelease(prefsPrivate->rls);
+ prefsPrivate->rls = NULL;
+ }
+ }
+ }
- CFRelease(prefs); // release our reference to the prefs
+ if (n == 0) {
+ CFArrayRef changedKeys;
- // no need to track changes
- (void) SCDynamicStoreSetNotificationKeys(prefsPrivate->session, NULL, NULL);
+ // if *all* notifications have been unscheduled
+ prefsPrivate->scheduled = FALSE;
- // clear out any pending notifications
- changedKeys = SCDynamicStoreCopyNotifiedKeys(prefsPrivate->session);
- if (changedKeys != NULL) {
- CFRelease(changedKeys);
- }
+ // no need to track changes
+ (void) SCDynamicStoreSetNotificationKeys(prefsPrivate->session, NULL, NULL);
+
+ // clear out any pending notifications
+ changedKeys = SCDynamicStoreCopyNotifiedKeys(prefsPrivate->session);
+ if (changedKeys != NULL) {
+ CFRelease(changedKeys);
}
+
+ // release our reference to the prefs
+ CFRelease(prefs);
}
ok = TRUE;
return ok;
}
+Boolean
+SCPreferencesScheduleWithRunLoop(SCPreferencesRef prefs,
+ CFRunLoopRef runLoop,
+ CFStringRef runLoopMode)
+{
+ if (!isA_SCPreferences(prefs) || (runLoop == NULL) || (runLoopMode == NULL)) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return FALSE;
+ }
+
+ return __SCPreferencesScheduleWithRunLoop(prefs, runLoop, runLoopMode, NULL);
+}
+
+Boolean
+SCPreferencesUnscheduleFromRunLoop(SCPreferencesRef prefs,
+ CFRunLoopRef runLoop,
+ CFStringRef runLoopMode)
+{
+ if (!isA_SCPreferences(prefs) || (runLoop == NULL) || (runLoopMode == NULL)) {
+ _SCErrorSet(kSCStatusInvalidArgument);
+ return FALSE;
+ }
+
+ return __SCPreferencesUnscheduleFromRunLoop(prefs, runLoop, runLoopMode);
+}
+
+#if !TARGET_OS_IPHONE
+Boolean
+SCPreferencesSetDispatchQueue(SCPreferencesRef prefs,
+ dispatch_queue_t queue)
+{
+ Boolean ok = FALSE;
+
+ if (!isA_SCPreferences(prefs)) {
+ /* sorry, you must provide a session */
+ _SCErrorSet(kSCStatusNoPrefsSession);
+ return FALSE;
+ }
+
+ if (queue != NULL) {
+ ok = __SCPreferencesScheduleWithRunLoop(prefs, NULL, NULL, queue);
+ } else {
+ ok = __SCPreferencesUnscheduleFromRunLoop(prefs, NULL, NULL);
+ }
+
+ return ok;
+}
+#endif // !TARGET_OS_IPHONE
+
static void
__SCPreferencesSynchronize_helper(SCPreferencesRef prefs)
Boolean ok;
SCPreferencesPrivateRef prefsPrivate = (SCPreferencesPrivateRef)prefs;
uint32_t status = kSCStatusOK;
-
+
if (prefsPrivate->helper == -1) {
// if no helper
return;
}
-
+
// have the helper "synchronize" the prefs
ok = _SCHelperExec(prefsPrivate->helper,
SCHELPER_MSG_PREFS_SYNCHRONIZE,
prefsPrivate->helper = -1;
}
}
-
+
return;
}
void
-SCPreferencesSynchronize(SCPreferencesRef prefs)
+SCPreferencesSynchronize(SCPreferencesRef prefs)
{
SCPreferencesPrivateRef prefsPrivate = (SCPreferencesPrivateRef)prefs;
- if (prefs == NULL) {
+ if (!isA_SCPreferences(prefs)) {
/* sorry, you must provide a session */
_SCErrorSet(kSCStatusNoPrefsSession);
return;
if (prefsPrivate->authorizationData != NULL) {
__SCPreferencesSynchronize_helper(prefs);
}
-
if (prefsPrivate->prefs != NULL) {
CFRelease(prefsPrivate->prefs);
prefsPrivate->prefs = NULL;
}
prefsPrivate->accessed = FALSE;
prefsPrivate->changed = FALSE;
+
return;
}
/*
- * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2006, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
}
newElements = CFArrayCreateMutableCopy(NULL, 0, linkElements);
+ CFRelease(linkElements);
CFArrayAppendArray(newElements,
elements,
CFRangeMake(i + 1, nElements-i - 1));
}
newElements = CFArrayCreateMutableCopy(NULL, 0, linkElements);
+ CFRelease(linkElements);
CFArrayAppendArray(newElements,
elements,
CFRangeMake(i + 1, nElements-i - 1));
/*
- * Copyright (c) 2000, 2001, 2004-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2004-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
}
+static void
+reportDelay(SCPreferencesRef prefs, struct timeval *delay)
+{
+ aslmsg m;
+ SCPreferencesPrivateRef prefsPrivate = (SCPreferencesPrivateRef)prefs;
+ char str[256];
+
+ m = asl_new(ASL_TYPE_MSG);
+ asl_set(m, "com.apple.message.domain", "com.apple.SystemConfiguration.SCPreferencesUnlock");
+ (void) _SC_cfstring_to_cstring(prefsPrivate->name, str, sizeof(str), kCFStringEncodingUTF8);
+ asl_set(m, "com.apple.message.signature", str);
+ (void) _SC_cfstring_to_cstring(prefsPrivate->prefsID, str, sizeof(str), kCFStringEncodingUTF8);
+ asl_set(m, "com.apple.message.signature2", str);
+ (void) snprintf(str, sizeof(str),
+ "%d.%3.3d",
+ (int)delay->tv_sec,
+ delay->tv_usec / 1000);
+ asl_set(m, "com.apple.message.value", str);
+ SCLOG(NULL, m, ASL_LEVEL_DEBUG,
+ CFSTR("SCPreferences(%@:%@) lock held for %d.%3.3d seconds"),
+ prefsPrivate->name,
+ prefsPrivate->prefsID,
+ (int)delay->tv_sec,
+ delay->tv_usec / 1000);
+ asl_free(m);
+
+ return;
+}
+
+
Boolean
SCPreferencesUnlock(SCPreferencesRef prefs)
{
+ struct timeval lockElapsed;
+ struct timeval lockEnd;
SCPreferencesPrivateRef prefsPrivate = (SCPreferencesPrivateRef)prefs;
if (prefs == NULL) {
prefsPrivate->lockFD = -1;
}
+ (void)gettimeofday(&lockEnd, NULL);
+ timersub(&lockEnd, &prefsPrivate->lockTime, &lockElapsed);
+ if (lockElapsed.tv_sec > 0) {
+ // if we held the lock for more than 1 second
+ reportDelay(prefs, &lockElapsed);
+ }
+
prefsPrivate->locked = FALSE;
pthread_mutex_unlock(&prefsPrivate->lock);
/*
- * Copyright (c) 2000, 2001, 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2004, 2005, 2007-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*/
#ifndef _SCPREFERENCES_H
+#ifdef USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS
+#include <SystemConfiguration/_SCPreferences.h>
+#else /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
#define _SCPREFERENCES_H
-#include <AvailabilityMacros.h>
+#include <Availability.h>
+#include <TargetConditionals.h>
#include <sys/cdefs.h>
+#if !TARGET_OS_IPHONE
+#include <dispatch/dispatch.h>
+#endif // !TARGET_OS_IPHONE
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SCDynamicStore.h>
+
+#if !TARGET_OS_IPHONE
#include <Security/Security.h>
+#else // !TARGET_OS_IPHONE
+typedef const struct AuthorizationOpaqueRef * AuthorizationRef;
+#endif // !TARGET_OS_IPHONE
+
/*!
@header SCPreferences
*/
typedef const struct __SCPreferences * SCPreferencesRef;
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
-
/*!
@enum SCPreferencesNotification
@discussion Used with the SCPreferencesCallBack callback
request has been made to apply the currently saved
preferences to the active system configuration.
*/
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
enum {
kSCPreferencesNotificationCommit = 1<<0,
kSCPreferencesNotificationApply = 1<<1
};
+#endif (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+
typedef uint32_t SCPreferencesNotification;
/*!
void *info
);
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 */
-
__BEGIN_DECLS
@discussion Returns the type identifier of all SCPreferences instances.
*/
CFTypeID
-SCPreferencesGetTypeID (void);
+SCPreferencesGetTypeID (void) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesCreate
You must release the returned value.
*/
SCPreferencesRef
-SCPreferencesCreate (
- CFAllocatorRef allocator,
- CFStringRef name,
- CFStringRef prefsID
- );
+SCPreferencesCreate (
+ CFAllocatorRef allocator,
+ CFStringRef name,
+ CFStringRef prefsID
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
/*!
@function SCPreferencesCreateWithAuthorization
CFStringRef name,
CFStringRef prefsID,
AuthorizationRef authorization
- ) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
-
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 */
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesLock
FALSE if an error occurred.
*/
Boolean
-SCPreferencesLock (
- SCPreferencesRef prefs,
- Boolean wait
- );
+SCPreferencesLock (
+ SCPreferencesRef prefs,
+ Boolean wait
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesCommitChanges
FALSE if an error occurred.
*/
Boolean
-SCPreferencesCommitChanges (
- SCPreferencesRef prefs
- );
+SCPreferencesCommitChanges (
+ SCPreferencesRef prefs
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesApplyChanges
FALSE if an error occurred.
*/
Boolean
-SCPreferencesApplyChanges (
- SCPreferencesRef prefs
- );
+SCPreferencesApplyChanges (
+ SCPreferencesRef prefs
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesUnlock
FALSE if an error occurred.
*/
Boolean
-SCPreferencesUnlock (
- SCPreferencesRef prefs
- );
+SCPreferencesUnlock (
+ SCPreferencesRef prefs
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesGetSignature
preferences at the time of the call to the SCPreferencesCreate function.
*/
CFDataRef
-SCPreferencesGetSignature (
- SCPreferencesRef prefs
- );
+SCPreferencesGetSignature (
+ SCPreferencesRef prefs
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesCopyKeyList
You must release the returned value.
*/
CFArrayRef
-SCPreferencesCopyKeyList (
- SCPreferencesRef prefs
- );
+SCPreferencesCopyKeyList (
+ SCPreferencesRef prefs
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesGetValue
NULL if no value was located.
*/
CFPropertyListRef
-SCPreferencesGetValue (
- SCPreferencesRef prefs,
- CFStringRef key
- );
+SCPreferencesGetValue (
+ SCPreferencesRef prefs,
+ CFStringRef key
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesAddValue
if an error occurred.
*/
Boolean
-SCPreferencesAddValue (
- SCPreferencesRef prefs,
- CFStringRef key,
- CFPropertyListRef value
- );
+SCPreferencesAddValue (
+ SCPreferencesRef prefs,
+ CFStringRef key,
+ CFPropertyListRef value
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesSetValue
FALSE if an error occurred.
*/
Boolean
-SCPreferencesSetValue (
- SCPreferencesRef prefs,
- CFStringRef key,
- CFPropertyListRef value
- );
+SCPreferencesSetValue (
+ SCPreferencesRef prefs,
+ CFStringRef key,
+ CFPropertyListRef value
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesRemoveValue
FALSE if the key did not exist or if an error occurred.
*/
Boolean
-SCPreferencesRemoveValue (
- SCPreferencesRef prefs,
- CFStringRef key
- );
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
+SCPreferencesRemoveValue (
+ SCPreferencesRef prefs,
+ CFStringRef key
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesSetCallback
SCPreferencesRef prefs,
SCPreferencesCallBack callout,
SCPreferencesContext *context
- ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesScheduleWithRunLoop
SCPreferencesRef prefs,
CFRunLoopRef runLoop,
CFStringRef runLoopMode
- ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesUnscheduleFromRunLoop
SCPreferencesRef prefs,
CFRunLoopRef runLoop,
CFStringRef runLoopMode
- ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
+
+#if !TARGET_OS_IPHONE
+/*!
+ @function SCPreferencesSetDispatchQueue
+ @discussion Schedule commit and apply notifications for the specified
+ preferences session.
+ @param prefs The preferences session.
+ @param queue The dispatch queue to run the callback function on.
+ @result Returns TRUE if the notifications are successfully scheduled;
+ FALSE otherwise.
+ */
+Boolean
+SCPreferencesSetDispatchQueue (
+ SCPreferencesRef prefs,
+ dispatch_queue_t queue
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA);
+#endif // !TARGET_OS_IPHONE
/*!
@function SCPreferencesSynchronize
void
SCPreferencesSynchronize (
SCPreferencesRef prefs
- ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
-
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 */
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/);
__END_DECLS
+#endif /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
#endif /* _SCPREFERENCES_H */
/*
- * Copyright (c) 2000, 2001, 2003-2005, 2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003-2005, 2007-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include <CoreFoundation/CFRuntime.h>
#include <SystemConfiguration/SCPreferences.h>
#include <SystemConfiguration/SCDynamicStore.h>
+#if !TARGET_OS_IPHONE
+#include <dispatch/dispatch.h>
+#endif // !TARGET_OS_IPHONE
#define PREFS_DEFAULT_DIR CFSTR("/Library/Preferences/SystemConfiguration")
Boolean locked;
int lockFD;
char *lockPath;
+ struct timeval lockTime;
/* configuration file signature */
CFDataRef signature;
CFStringRef sessionKeyApply;
/* run loop source, callout, context, rl scheduling info */
+ Boolean scheduled;
CFRunLoopSourceRef rls;
SCPreferencesCallBack rlsFunction;
SCPreferencesContext rlsContext;
CFMutableArrayRef rlList;
+#if !TARGET_OS_IPHONE
+ dispatch_queue_t dispatchQueue; // SCPreferencesSetDispatchQueue
+#endif // !TARGET_OS_IPHONE
/* preferences */
CFMutableDictionaryRef prefs;
/* Define signature data */
typedef struct {
- dev_t st_dev; /* inode's device */
- ino_t st_ino; /* inode's number */
- struct timespec st_mtimespec; /* time of last data modification */
- off_t st_size; /* file size, in bytes */
+ int64_t st_dev; /* inode's device */
+ uint64_t st_ino; /* inode's number */
+ uint64_t tv_sec; /* time of last data modification */
+ uint64_t tv_nsec;
+ off_t st_size; /* file size, in bytes */
} SCPSignatureData, *SCPSignatureDataRef;
/*
- * Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2006, 2007 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* - created (for EAP)
*/
+#include <Availability.h>
+#include <TargetConditionals.h>
#include <sys/param.h>
-
#include <CoreFoundation/CoreFoundation.h>
#include <CoreFoundation/CFBundlePriv.h> // for _CFBundleCopyMainBundleExecutableURL
#include <SystemConfiguration/SCPrivate.h> // for _SCErrorSet
-#include <Security/Security.h>
#include "dy_framework.h"
#include "SCPreferencesInternal.h"
+#if !TARGET_OS_IPHONE
static CFDataRef
copyMyExecutablePath(void)
{
return access;
}
+#endif // !TARGET_OS_IPHONE
SecKeychainRef
_SCSecKeychainCopySystemKeychain(void)
{
+#if !TARGET_OS_IPHONE
SecPreferencesDomain domain;
SecKeychainRef keychain = NULL;
OSStatus status;
}
return keychain;
+#else // !TARGET_OS_IPHONE
+ _SCErrorSet(kSCStatusAccessError);
+ return NULL;
+#endif // !TARGET_OS_IPHONE
}
+#if !TARGET_OS_IPHONE
static OSStatus
findKeychainItem(SecKeychainRef keychain,
UInt32 serviceNameLength,
return status;
}
+#endif // !TARGET_OS_IPHONE
CFDataRef
_SCSecKeychainPasswordItemCopy(SecKeychainRef keychain,
CFStringRef unique_id)
{
+#if !TARGET_OS_IPHONE
SecKeychainItemRef item = NULL;
CFDataRef keychain_password = NULL;
const char *keychain_serviceName;
}
return keychain_password;
+#else // !TARGET_OS_IPHONE
+ _SCErrorSet(kSCStatusAccessError);
+ return NULL;
+#endif // !TARGET_OS_IPHONE
}
Boolean
_SCSecKeychainPasswordItemExists(SecKeychainRef keychain, CFStringRef unique_id)
{
+#if !TARGET_OS_IPHONE
SecKeychainItemRef item;
const char *keychain_serviceName;
OSStatus status;
CFRelease(item);
return TRUE;
+#else // !TARGET_OS_IPHONE
+ _SCErrorSet(kSCStatusAccessError);
+ return FALSE;
+#endif // !TARGET_OS_IPHONE
}
Boolean
_SCSecKeychainPasswordItemRemove(SecKeychainRef keychain, CFStringRef unique_id)
{
+#if !TARGET_OS_IPHONE
SecKeychainItemRef item;
const char *keychain_serviceName;
OSStatus status;
}
return TRUE;
+#else // !TARGET_OS_IPHONE
+ _SCErrorSet(kSCStatusAccessError);
+ return FALSE;
+#endif // !TARGET_OS_IPHONE
}
CFDataRef password,
CFDictionaryRef options)
{
+#if !TARGET_OS_IPHONE
SecAccessRef access = NULL;
CFBooleanRef allowRoot = NULL;
CFArrayRef allowedExecutables = NULL;
}
return TRUE;
+#else // !TARGET_OS_IPHONE
+ _SCErrorSet(kSCStatusAccessError);
+ return FALSE;
+#endif // !TARGET_OS_IPHONE
}
#include <sys/errno.h>
+#if !TARGET_OS_IPHONE
static CFDataRef
__SCPreferencesSystemKeychainPasswordItemCopy_helper(SCPreferencesRef prefs,
CFStringRef unique_id)
_SCErrorSet(status);
return NULL;
}
+#endif // !TARGET_OS_IPHONE
CFDataRef
_SCPreferencesSystemKeychainPasswordItemCopy(SCPreferencesRef prefs,
CFStringRef unique_id)
{
+#if !TARGET_OS_IPHONE
SecKeychainRef keychain = NULL;
CFDataRef password = NULL;
SCPreferencesPrivateRef prefsPrivate = (SCPreferencesPrivateRef)prefs;
if (prefs == NULL) {
/* sorry, you must provide a session */
_SCErrorSet(kSCStatusNoPrefsSession);
- return FALSE;
+ return NULL;
}
if (!isA_CFString(unique_id)) {
_SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
+ return NULL;
}
if (prefsPrivate->authorizationData != NULL) {
if (keychain != NULL) CFRelease(keychain);
return password;
+#else // !TARGET_OS_IPHONE
+ _SCErrorSet(kSCStatusAccessError);
+ return NULL;
+#endif // !TARGET_OS_IPHONE
}
_SCPreferencesSystemKeychainPasswordItemExists(SCPreferencesRef prefs,
CFStringRef unique_id)
{
+#if !TARGET_OS_IPHONE
SecKeychainRef keychain = NULL;
Boolean ok = FALSE;
// SCPreferencesPrivateRef prefsPrivate = (SCPreferencesPrivateRef)prefs;
if (keychain != NULL) CFRelease(keychain);
return ok;
+#else // !TARGET_OS_IPHONE
+ _SCErrorSet(kSCStatusAccessError);
+ return FALSE;
+#endif // !TARGET_OS_IPHONE
}
+#if !TARGET_OS_IPHONE
static Boolean
__SCPreferencesSystemKeychainPasswordItemRemove_helper(SCPreferencesRef prefs,
CFStringRef unique_id)
_SCErrorSet(status);
return FALSE;
}
+#endif // !TARGET_OS_IPHONE
Boolean
_SCPreferencesSystemKeychainPasswordItemRemove(SCPreferencesRef prefs,
CFStringRef unique_id)
{
+#if !TARGET_OS_IPHONE
SecKeychainRef keychain = NULL;
Boolean ok = FALSE;
SCPreferencesPrivateRef prefsPrivate = (SCPreferencesPrivateRef)prefs;
if (keychain != NULL) CFRelease(keychain);
return ok;
+#else // !TARGET_OS_IPHONE
+ _SCErrorSet(kSCStatusAccessError);
+ return FALSE;
+#endif // !TARGET_OS_IPHONE
}
+#if !TARGET_OS_IPHONE
static Boolean
__SCPreferencesSystemKeychainPasswordItemSet_helper(SCPreferencesRef prefs,
CFStringRef unique_id,
_SCErrorSet(status);
return FALSE;
}
+#endif // !TARGET_OS_IPHONE
Boolean
CFDataRef password,
CFDictionaryRef options)
{
+#if !TARGET_OS_IPHONE
SecKeychainRef keychain = NULL;
Boolean ok = FALSE;
SCPreferencesPrivateRef prefsPrivate = (SCPreferencesPrivateRef)prefs;
if (keychain != NULL) CFRelease(keychain);
return ok;
+#else // !TARGET_OS_IPHONE
+ _SCErrorSet(kSCStatusAccessError);
+ return FALSE;
+#endif // !TARGET_OS_IPHONE
}
/*
- * Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2006, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* - routines to deal with keychain passwords
*/
+#include <Availability.h>
+#include <TargetConditionals.h>
+#include <sys/cdefs.h>
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SCPreferences.h>
+#if !TARGET_OS_IPHONE
#include <Security/Security.h>
-
-#include <AvailabilityMacros.h>
-#include <sys/cdefs.h>
+#else // !TARGET_OS_IPHONE
+typedef struct OpaqueSecKeychainRef *SecKeychainRef;
+#endif // !TARGET_OS_IPHONE
#pragma mark -
#pragma mark Keychain helper APIs
__BEGIN_DECLS
SecKeychainRef
-_SCSecKeychainCopySystemKeychain (void);
+_SCSecKeychainCopySystemKeychain (void) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
CFDataRef
_SCSecKeychainPasswordItemCopy (SecKeychainRef keychain,
- CFStringRef unique_id);
+ CFStringRef unique_id) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
Boolean
_SCSecKeychainPasswordItemExists (SecKeychainRef keychain,
- CFStringRef unique_id);
+ CFStringRef unique_id) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
Boolean
_SCSecKeychainPasswordItemRemove (SecKeychainRef keychain,
- CFStringRef unique_id);
+ CFStringRef unique_id) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
Boolean
_SCSecKeychainPasswordItemSet (SecKeychainRef keychain,
CFStringRef description,
CFStringRef account,
CFDataRef password,
- CFDictionaryRef options);
+ CFDictionaryRef options) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
#pragma mark -
CFDataRef
_SCPreferencesSystemKeychainPasswordItemCopy (SCPreferencesRef prefs,
- CFStringRef unique_id);
+ CFStringRef unique_id) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
Boolean
_SCPreferencesSystemKeychainPasswordItemExists (SCPreferencesRef prefs,
- CFStringRef unique_id);
+ CFStringRef unique_id) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
Boolean
_SCPreferencesSystemKeychainPasswordItemRemove (SCPreferencesRef prefs,
- CFStringRef unique_id);
+ CFStringRef unique_id) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
Boolean
_SCPreferencesSystemKeychainPasswordItemSet (SCPreferencesRef prefs,
CFStringRef description,
CFStringRef account,
CFDataRef password,
- CFDictionaryRef options);
+ CFDictionaryRef options) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
__END_DECLS
/*
- * Copyright (c) 2000, 2001, 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2004, 2005, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*/
#ifndef _SCPREFERENCESPATH_H
+#ifdef USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS
+#include <SystemConfiguration/_SCPreferencesPath.h>
+#else /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
#define _SCPREFERENCESPATH_H
+#include <Availability.h>
#include <sys/cdefs.h>
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SCPreferences.h>
SCPreferencesPathCreateUniqueChild (
SCPreferencesRef prefs,
CFStringRef prefix
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesPathGetValue
SCPreferencesPathGetValue (
SCPreferencesRef prefs,
CFStringRef path
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesPathGetLink
SCPreferencesPathGetLink (
SCPreferencesRef prefs,
CFStringRef path
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesPathSetValue
SCPreferencesRef prefs,
CFStringRef path,
CFDictionaryRef value
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesPathSetLink
SCPreferencesRef prefs,
CFStringRef path,
CFStringRef link
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesPathRemoveValue
SCPreferencesPathRemoveValue (
SCPreferencesRef prefs,
CFStringRef path
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
__END_DECLS
+#endif /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
#endif /* _SCPREFERENCESPATH_H */
/*
- * Copyright (c) 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004, 2005, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#ifndef _SCPREFERENCESPATHKEY_H
#define _SCPREFERENCESPATHKEY_H
-#include <AvailabilityMacros.h>
+#include <Availability.h>
#include <sys/cdefs.h>
#include <CoreFoundation/CoreFoundation.h>
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
-
/*!
@header SCPreferencesPathKey
*/
CFAllocatorRef allocator,
CFStringRef fmt,
...
- ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0);
/*!
@function SCPreferencesPathKeyCreateNetworkServices
CFStringRef
SCPreferencesPathKeyCreateNetworkServices (
CFAllocatorRef allocator
- ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0);
/*!
@function SCPreferencesPathKeyCreateNetworkServiceEntity
CFAllocatorRef allocator,
CFStringRef service,
CFStringRef entity
- ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0);
/*!
@function SCPreferencesPathKeyCreateSets
CFStringRef
SCPreferencesPathKeyCreateSets (
CFAllocatorRef allocator
- ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0);
/*!
@function SCPreferencesPathKeyCreateSet
SCPreferencesPathKeyCreateSet (
CFAllocatorRef allocator,
CFStringRef set
- ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0);
/*!
@function SCPreferencesPathKeyCreateSetNetworkInterfaceEntity
CFStringRef set,
CFStringRef ifname,
CFStringRef entity
- ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0);
/*!
@function SCPreferencesPathKeyCreateSetNetworkGlobalEntity
CFAllocatorRef allocator,
CFStringRef set,
CFStringRef entity
- ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0);
/*!
@function SCPreferencesPathKeyCreateSetNetworkService
CFAllocatorRef allocator,
CFStringRef set,
CFStringRef service
- ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0);
/*!
@function SCPreferencesPathKeyCreateSetNetworkServiceEntity
CFStringRef set,
CFStringRef service,
CFStringRef entity
- ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0);
__END_DECLS
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 */
-
#endif /* _SCPREFERENCESPATHKEY_H */
/*
- * Copyright (c) 2000-2005, 2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2005, 2007, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#define _SCPREFERENCESPRIVATE_H
+#include <Availability.h>
#include <sys/cdefs.h>
-#include <AvailabilityMacros.h>
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SCPreferences.h>
CFAllocatorRef allocator,
CFStringRef prefsID,
SCPreferencesKeyType keyType
- ) AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4;
+ ) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_2_0,__IPHONE_2_0);
__END_DECLS
/*
- * Copyright (c) 2000-2002, 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2002, 2004, 2005, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*/
#ifndef _SCPREFERENCESSETSPECIFIC_H
+#ifdef USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS
+#include <SystemConfiguration/_SCPreferencesSetSpecific.h>
+#else /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
#define _SCPREFERENCESSETSPECIFIC_H
+#include <Availability.h>
#include <sys/cdefs.h>
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SCPreferences.h>
SCPreferencesRef prefs,
CFStringRef name,
CFStringEncoding nameEncoding
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/);
/*!
@function SCPreferencesSetLocalHostName
SCPreferencesSetLocalHostName (
SCPreferencesRef prefs,
CFStringRef name
- );
+ ) __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/);
__END_DECLS
+#endif /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
#endif /* _SCPREFERENCESSETSPECIFIC_H */
/*
- * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include <sys/cdefs.h>
#include <sys/socket.h>
+#include <asl.h>
#include <sys/syslog.h>
#include <mach/message.h>
*/
/* framework variables */
-extern Boolean _sc_debug; /* TRUE if debugging enabled */
-extern Boolean _sc_verbose; /* TRUE if verbose logging enabled */
-extern Boolean _sc_log; /* TRUE if SCLog() output goes to syslog */
+extern int _sc_debug; /* non-zero if debugging enabled */
+extern int _sc_verbose; /* non-zero if verbose logging enabled */
+extern int _sc_log; /* 0 if SC messages should be written to stdout/stderr,
+ 1 if SC messages should be logged w/asl(3),
+ 2 if SC messages should be written to stdout/stderr AND logged */
/*!
@group SCNetworkReachabilityCreateWithOptions #defines
*/
#define kSCNetworkReachabilityOptionHints CFSTR("hints")
+/*!
+ @constant kSCNetworkReachabilityOptionConnectionOnDemandByPass
+ @discussion A CFBoolean that indicates if we should bypass the VPNOnDemand
+ checks for this target.
+ */
+#define kSCNetworkReachabilityOptionConnectionOnDemandByPass CFSTR("ConnectionOnDemandByPass")
+
/*!
@group
*/
mach_msg_id_t msg_id);
+/*!
+ @function _SCCopyDescription
+ @discussion Returns a formatted textual description of a CF object.
+ @param cf The CFType object (a generic reference of type CFTypeRef) from
+ which to derive a description.
+ @param formatOptions A dictionary containing formatting options for the object.
+ @result A string that contains a formatted description of cf.
+ */
+CFStringRef _SCCopyDescription (CFTypeRef cf,
+ CFDictionaryRef formatOptions);
+
+
/*!
@function SCLog
@discussion Conditionally issue a log message.
CFStringRef formatString,
...);
+
+/*!
+ @function SCLOG
+ @discussion Issue a log message.
+ @param asl An asl client handle to be used for logging. If NULL, a shared
+ handle will be used.
+ @param msg An asl msg structure to be used for logging. If NULL, a default
+ asl msg will be used.
+ @param level A asl(3) logging priority. Passing the complement of a logging
+ priority (e.g. ~ASL_LEVEL_NOTICE) will result in log message lines
+ NOT being split by a "\n".
+ @param formatString The format string
+ @result The specified message will be written to the system message
+ logger (See syslogd(8)).
+ */
+void SCLOG (aslclient asl,
+ aslmsg msg,
+ int level,
+ CFStringRef formatString,
+ ...);
+
+
/*!
@function SCPrint
@discussion Conditionally issue a debug message.
CFStringRef formatString,
...);
+/*!
+ @function SCNetworkReachabilityCopyOnDemandService
+ @discussion For target hosts that require an OnDemand connection, returns
+ the SCNetworkService associated with the connection and user
+ options to use with SCNetworkConnectionStart.
+ @result The SCNetworkService for the target; NULL if there is
+ no associated OnDemand service.
+ */
+SCNetworkServiceRef
+SCNetworkReachabilityCopyOnDemandService (SCNetworkReachabilityRef target,
+ CFDictionaryRef *userOptions);
+
+/*!
+ @function SCNetworkReachabilityCopyResolvedAddress
+ @discussion Return the resolved addresses associated with the
+ target host.
+ @result A CFArray[CFData], where each CFData is a (struct sockaddr)
+ */
+CFArrayRef
+SCNetworkReachabilityCopyResolvedAddress (SCNetworkReachabilityRef target,
+ int *error_num);
+
/*!
@function SCNetworkReachabilityCreateWithOptions
@discussion Creates a reference to a specified network host. The
SCNetworkReachabilityCreateWithOptions (CFAllocatorRef allocator,
CFDictionaryRef options);
+/*!
+ @function _SC_checkResolverReachabilityByAddress
+ @discussion Check the reachability of a reverse DNS query
+ */
+Boolean
+_SC_checkResolverReachabilityByAddress (SCDynamicStoreRef *storeP,
+ SCNetworkReachabilityFlags *flags,
+ Boolean *haveDNS,
+ struct sockaddr *sa);
+
+#if !TARGET_OS_IPHONE
/*
* DOS encoding/codepage
*/
UInt32 macRegion,
CFStringEncoding *dosEncoding,
UInt32 *dosCodepage);
-
-CFDataRef
-_SC_dos_copy_string (CFStringRef str,
- CFStringEncoding dosEncoding,
- UInt32 dosCodepage);
+#endif // !TARGET_OS_IPHONE
/*
* object / CFRunLoop management
return FALSE;
}
+/*
+ * debugging
+ */
+
+#ifdef DEBUG_MACH_PORT_ALLOCATIONS
+ #define __MACH_PORT_DEBUG(cond, str, port) \
+ do { \
+ if (cond) _SC_logMachPortReferences(str, port); \
+ } while (0)
+#else // DEBUG_MACH_PORT_ALLOCATIONS
+ #define __MACH_PORT_DEBUG(cond, str, port)
+#endif // DEBUG_MACH_PORT_ALLOCATIONS
+
+void
+_SC_logMachPortStatus (void);
+
+void
+_SC_logMachPortReferences (const char *str,
+ mach_port_t port);
+
+CFStringRef
+_SC_copyBacktrace (void);
+
__END_DECLS
#endif /* _SCPRIVATE_H */
/*
- * Copyright (c) 2000-2004, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2004, 2006-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
{
int enabled = 0;
CFNumberRef num;
- CFStringRef host;
- CFNumberRef port = NULL;
num = CFDictionaryGetValue(proxies, proxy_enable);
if (num != NULL) {
}
}
- host = CFDictionaryGetValue(proxies, proxy_host);
- if (((enabled == 0) && (host != NULL)) ||
- ((enabled != 0) && !isA_CFString(host))) {
- // pass only valid proxy hosts and only when enabled
- goto disable;
+ if (proxy_host != NULL) {
+ CFStringRef host;
+
+ host = CFDictionaryGetValue(proxies, proxy_host);
+ if (((enabled == 0) && (host != NULL)) ||
+ ((enabled != 0) && !isA_CFString(host))) {
+ // pass only valid proxy hosts and only when enabled
+ goto disable;
+ }
}
if (proxy_port != NULL) {
+ CFNumberRef port;
+
port = CFDictionaryGetValue(proxies, proxy_port);
if (((enabled == 0) && (port != NULL)) ||
((enabled != 0) && (port != NULL) && !isA_CFNumber(port))) {
num = CFNumberCreate(NULL, kCFNumberIntType, &enabled);
CFDictionarySetValue(proxies, proxy_enable, num);
CFRelease(num);
- CFDictionaryRemoveValue(proxies, proxy_host);
+ if (proxy_host != NULL) {
+ CFDictionaryRemoveValue(proxies, proxy_host);
+ }
if (proxy_port != NULL) {
CFDictionaryRemoveValue(proxies, proxy_port);
}
NULL,
NULL,
0);
+ validate_proxy_content(newProxies,
+ kSCPropNetProxiesProxyAutoDiscoveryEnable,
+ NULL,
+ NULL,
+ NULL,
+ 0);
// validate FTP passive setting
num = CFDictionaryGetValue(newProxies, kSCPropNetProxiesFTPPassive);
if (num != NULL) {
- int enabled;
+ int enabled = 0;
if (!isA_CFNumber(num) ||
!CFNumberGetValue(num, kCFNumberIntType, &enabled)) {
}
}
- // validate WPAD setting
- num = CFDictionaryGetValue(newProxies, kSCPropNetProxiesProxyAutoDiscoveryEnable);
- if (num != NULL) {
- int enabled;
-
- if (!isA_CFNumber(num) ||
- !CFNumberGetValue(num, kCFNumberIntType, &enabled)) {
- // if we don't like the enabled key/value
- enabled = 0;
- num = CFNumberCreate(NULL, kCFNumberIntType, &enabled);
- CFDictionarySetValue(newProxies,
- kSCPropNetProxiesProxyAutoDiscoveryEnable,
- num);
- CFRelease(num);
- }
- }
-
// validate proxy exception list
array = CFDictionaryGetValue(newProxies, kSCPropNetProxiesExceptionsList);
if (array != NULL) {
* DO NOT EDIT!
*/
+#include <Availability.h>
+#include <TargetConditionals.h>
#include <CoreFoundation/CFString.h>
const CFStringRef kSCResvLink = CFSTR("__LINK__");
const CFStringRef kSCCompUsers = CFSTR("Users");
const CFStringRef kSCCompAnyRegex = CFSTR("[^/]+");
const CFStringRef kSCEntNetAirPort = CFSTR("AirPort");
+
+#if !TARGET_OS_IPHONE
const CFStringRef kSCEntNetAppleTalk = CFSTR("AppleTalk");
+#endif // !TARGET_OS_IPHONE
+
const CFStringRef kSCEntNetDHCP = CFSTR("DHCP");
const CFStringRef kSCEntNetDNS = CFSTR("DNS");
const CFStringRef kSCEntNetEthernet = CFSTR("Ethernet");
const CFStringRef kSCEntNetL2TP = CFSTR("L2TP");
const CFStringRef kSCEntNetLink = CFSTR("Link");
const CFStringRef kSCEntNetModem = CFSTR("Modem");
+
+#if !TARGET_OS_IPHONE
const CFStringRef kSCEntNetNetInfo = CFSTR("NetInfo");
+#endif // !TARGET_OS_IPHONE
+
const CFStringRef kSCEntNetPPP = CFSTR("PPP");
const CFStringRef kSCEntNetPPPoE = CFSTR("PPPoE");
const CFStringRef kSCEntNetPPPSerial = CFSTR("PPPSerial");
const CFStringRef kSCEntNetPPTP = CFSTR("PPTP");
const CFStringRef kSCEntNetProxies = CFSTR("Proxies");
+
+#if !TARGET_OS_IPHONE
const CFStringRef kSCEntNetSMB = CFSTR("SMB");
+#endif // !TARGET_OS_IPHONE
+
const CFStringRef kSCEntNet6to4 = CFSTR("6to4");
+
+
const CFStringRef kSCEntNetEAPOL = CFSTR("EAPOL");
+const CFStringRef kSCEntNetOnDemand = CFSTR("OnDemand");
+const CFStringRef kSCEntNetService = CFSTR("__SERVICE__");
const CFStringRef kSCPropNetOverridePrimary = CFSTR("OverridePrimary");
const CFStringRef kSCPropNetServiceOrder = CFSTR("ServiceOrder");
const CFStringRef kSCPropNetPPPOverridePrimary = CFSTR("PPPOverridePrimary");
const CFStringRef kSCValNetAirPortJoinModeRecent = CFSTR("Recent");
const CFStringRef kSCValNetAirPortJoinModeStrongest = CFSTR("Strongest");
const CFStringRef kSCValNetAirPortAuthPasswordEncryptionKeychain = CFSTR("Keychain");
+
+#if !TARGET_OS_IPHONE
const CFStringRef kSCPropNetAppleTalkComputerName = CFSTR("ComputerName");
const CFStringRef kSCPropNetAppleTalkComputerNameEncoding = CFSTR("ComputerNameEncoding");
const CFStringRef kSCPropNetAppleTalkConfigMethod = CFSTR("ConfigMethod");
const CFStringRef kSCValNetAppleTalkConfigMethodNode = CFSTR("Node");
const CFStringRef kSCValNetAppleTalkConfigMethodRouter = CFSTR("Router");
const CFStringRef kSCValNetAppleTalkConfigMethodSeedRouter = CFSTR("SeedRouter");
+#endif // !TARGET_OS_IPHONE
+
+
+
const CFStringRef kSCPropNetDNSDomainName = CFSTR("DomainName");
const CFStringRef kSCPropNetDNSOptions = CFSTR("Options");
const CFStringRef kSCPropNetDNSSearchDomains = CFSTR("SearchDomains");
const CFStringRef kSCValNetInterfaceTypeFireWire = CFSTR("FireWire");
const CFStringRef kSCValNetInterfaceTypePPP = CFSTR("PPP");
const CFStringRef kSCValNetInterfaceType6to4 = CFSTR("6to4");
+const CFStringRef kSCValNetInterfaceTypeIPSec = CFSTR("IPSec");
const CFStringRef kSCValNetInterfaceSubTypePPPoE = CFSTR("PPPoE");
const CFStringRef kSCValNetInterfaceSubTypePPPSerial = CFSTR("PPPSerial");
const CFStringRef kSCValNetInterfaceSubTypePPTP = CFSTR("PPTP");
const CFStringRef kSCValNetInterfaceSubTypeL2TP = CFSTR("L2TP");
+const CFStringRef kSCPropNetIPSecAuthenticationMethod = CFSTR("AuthenticationMethod");
+const CFStringRef kSCPropNetIPSecLocalCertificate = CFSTR("LocalCertificate");
const CFStringRef kSCPropNetIPSecLocalIdentifier = CFSTR("LocalIdentifier");
const CFStringRef kSCPropNetIPSecLocalIdentifierType = CFSTR("LocalIdentifierType");
-const CFStringRef kSCPropNetIPSecAuthenticationMethod = CFSTR("AuthenticationMethod");
const CFStringRef kSCPropNetIPSecSharedSecret = CFSTR("SharedSecret");
const CFStringRef kSCPropNetIPSecSharedSecretEncryption = CFSTR("SharedSecretEncryption");
-const CFStringRef kSCPropNetIPSecLocalCertificate = CFSTR("LocalCertificate");
+const CFStringRef kSCPropNetIPSecConnectTime = CFSTR("ConnectTime");
+const CFStringRef kSCPropNetIPSecRemoteAddress = CFSTR("RemoteAddress");
+const CFStringRef kSCPropNetIPSecStatus = CFSTR("Status");
+const CFStringRef kSCPropNetIPSecXAuthEnabled = CFSTR("XAuthEnabled");
+const CFStringRef kSCPropNetIPSecXAuthName = CFSTR("XAuthName");
+const CFStringRef kSCPropNetIPSecXAuthPassword = CFSTR("XAuthPassword");
+const CFStringRef kSCPropNetIPSecXAuthPasswordEncryption = CFSTR("XAuthPasswordEncryption");
const CFStringRef kSCValNetIPSecAuthenticationMethodSharedSecret = CFSTR("SharedSecret");
const CFStringRef kSCValNetIPSecAuthenticationMethodCertificate = CFSTR("Certificate");
-const CFStringRef kSCValNetIPSecSharedSecretEncryptionKeychain = CFSTR("Keychain");
+const CFStringRef kSCValNetIPSecAuthenticationMethodHybrid = CFSTR("Hybrid");
const CFStringRef kSCValNetIPSecLocalIdentifierTypeKeyID = CFSTR("KeyID");
+const CFStringRef kSCValNetIPSecSharedSecretEncryptionKeychain = CFSTR("Keychain");
+const CFStringRef kSCValNetIPSecXAuthPasswordEncryptionKeychain = CFSTR("Keychain");
+const CFStringRef kSCValNetIPSecXAuthPasswordEncryptionPrompt = CFSTR("Prompt");
+const CFStringRef kSCPropNetIPSecLastCause = CFSTR("LastCause");
+const CFStringRef kSCPropNetIPSecOnDemandEnabled = CFSTR("OnDemandEnabled");
+const CFStringRef kSCPropNetIPSecOnDemandMatchDomainsAlways = CFSTR("OnDemandMatchDomainsAlways");
+const CFStringRef kSCPropNetIPSecOnDemandMatchDomainsOnRetry = CFSTR("OnDemandMatchDomainsOnRetry");
+const CFStringRef kSCPropNetIPSecOnDemandMatchDomainsNever = CFSTR("OnDemandMatchDomainsNever");
const CFStringRef kSCPropNetIPv4Addresses = CFSTR("Addresses");
const CFStringRef kSCPropNetIPv4ConfigMethod = CFSTR("ConfigMethod");
const CFStringRef kSCPropNetIPv4DHCPClientID = CFSTR("DHCPClientID");
const CFStringRef kSCPropNetIPv4SubnetMasks = CFSTR("SubnetMasks");
const CFStringRef kSCPropNetIPv4DestAddresses = CFSTR("DestAddresses");
const CFStringRef kSCPropNetIPv4BroadcastAddresses = CFSTR("BroadcastAddresses");
+const CFStringRef kSCValNetIPv4ConfigMethodAutomatic = CFSTR("Automatic");
const CFStringRef kSCValNetIPv4ConfigMethodBOOTP = CFSTR("BOOTP");
const CFStringRef kSCValNetIPv4ConfigMethodDHCP = CFSTR("DHCP");
const CFStringRef kSCValNetIPv4ConfigMethodINFORM = CFSTR("INFORM");
const CFStringRef kSCValNetModemDialModeIgnoreDialTone = CFSTR("IgnoreDialTone");
const CFStringRef kSCValNetModemDialModeManual = CFSTR("Manual");
const CFStringRef kSCValNetModemDialModeWaitForDialTone = CFSTR("WaitForDialTone");
+
+#if !TARGET_OS_IPHONE
const CFStringRef kSCPropNetNetInfoBindingMethods = CFSTR("BindingMethods");
const CFStringRef kSCPropNetNetInfoServerAddresses = CFSTR("ServerAddresses");
const CFStringRef kSCPropNetNetInfoServerTags = CFSTR("ServerTags");
const CFStringRef kSCValNetNetInfoBindingMethodsDHCP = CFSTR("DHCP");
const CFStringRef kSCValNetNetInfoBindingMethodsManual = CFSTR("Manual");
const CFStringRef kSCValNetNetInfoDefaultServerTag = CFSTR("network");
+#endif // !TARGET_OS_IPHONE
+
const CFStringRef kSCPropNetPPPACSPEnabled = CFSTR("ACSPEnabled");
const CFStringRef kSCPropNetPPPConnectTime = CFSTR("ConnectTime");
const CFStringRef kSCPropNetPPPDeviceLastCause = CFSTR("DeviceLastCause");
const CFStringRef kSCPropNetProxiesProxyAutoConfigEnable = CFSTR("ProxyAutoConfigEnable");
const CFStringRef kSCPropNetProxiesProxyAutoConfigURLString = CFSTR("ProxyAutoConfigURLString");
const CFStringRef kSCPropNetProxiesProxyAutoDiscoveryEnable = CFSTR("ProxyAutoDiscoveryEnable");
+const CFStringRef kSCPropNetServicePrimaryRank = CFSTR("PrimaryRank");
+const CFStringRef kSCPropNetServiceUserDefinedName = CFSTR("UserDefinedName");
+const CFStringRef kSCValNetServicePrimaryRankFirst = CFSTR("First");
+const CFStringRef kSCValNetServicePrimaryRankLast = CFSTR("Last");
+const CFStringRef kSCValNetServicePrimaryRankNever = CFSTR("Never");
+
+#if !TARGET_OS_IPHONE
const CFStringRef kSCPropNetSMBNetBIOSName = CFSTR("NetBIOSName");
const CFStringRef kSCPropNetSMBNetBIOSNodeType = CFSTR("NetBIOSNodeType");
const CFStringRef kSCPropNetSMBNetBIOSScope = CFSTR("NetBIOSScope");
const CFStringRef kSCValNetSMBNetBIOSNodeTypePeer = CFSTR("Peer");
const CFStringRef kSCValNetSMBNetBIOSNodeTypeMixed = CFSTR("Mixed");
const CFStringRef kSCValNetSMBNetBIOSNodeTypeHybrid = CFSTR("Hybrid");
+#endif // !TARGET_OS_IPHONE
+
+
+#if !TARGET_OS_IPHONE
const CFStringRef kSCEntUsersConsoleUser = CFSTR("ConsoleUser");
+#endif // !TARGET_OS_IPHONE
+
const CFStringRef kSCPropSystemComputerName = CFSTR("ComputerName");
const CFStringRef kSCPropSystemComputerNameEncoding = CFSTR("ComputerNameEncoding");
const CFStringRef kSCPropSystemComputerNameRegion = CFSTR("ComputerNameRegion");
const CFStringRef kSCDynamicStorePropNetPrimaryInterface = CFSTR("PrimaryInterface");
const CFStringRef kSCDynamicStorePropNetPrimaryService = CFSTR("PrimaryService");
const CFStringRef kSCDynamicStorePropNetServiceIDs = CFSTR("ServiceIDs");
+
+#if !TARGET_OS_IPHONE
const CFStringRef kSCPropVirtualNetworkInterfacesBondInterfaces = CFSTR("Interfaces");
const CFStringRef kSCPropVirtualNetworkInterfacesBondMode = CFSTR("Mode");
const CFStringRef kSCPropVirtualNetworkInterfacesBondOptions = CFSTR("Options");
const CFStringRef kSCPropVirtualNetworkInterfacesVLANInterface = CFSTR("Interface");
const CFStringRef kSCPropVirtualNetworkInterfacesVLANTag = CFSTR("Tag");
const CFStringRef kSCPropVirtualNetworkInterfacesVLANOptions = CFSTR("Options");
+#endif // !TARGET_OS_IPHONE
+
+
+#if !TARGET_OS_IPHONE
const CFStringRef kSCPropUsersConsoleUserName = CFSTR("Name");
const CFStringRef kSCPropUsersConsoleUserUID = CFSTR("UID");
const CFStringRef kSCPropUsersConsoleUserGID = CFSTR("GID");
+#endif // !TARGET_OS_IPHONE
+
/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* Network Entity Keys
*
* kSCEntNetAirPort "AirPort" CFDictionary
- * kSCEntNetAppleTalk "AppleTalk" CFDictionary
* kSCEntNetDHCP "DHCP" CFDictionary
* kSCEntNetDNS "DNS" CFDictionary
* kSCEntNetEthernet "Ethernet" CFDictionary
* --- kSCPropNetAirPortPasswordEncryption values ---
* kSCValNetAirPortAuthPasswordEncryptionKeychain "Keychain"
*
- * kSCEntNetAppleTalk Entity Keys
- *
- * kSCPropNetAppleTalkComputerName "ComputerName" CFString
- * kSCPropNetAppleTalkComputerNameEncoding "ComputerNameEncoding" CFNumber
- * kSCPropNetAppleTalkConfigMethod "ConfigMethod" CFString
- * kSCPropNetAppleTalkDefaultZone "DefaultZone" CFString
- * kSCPropNetAppleTalkNetworkID "NetworkID" CFNumber
- * kSCPropNetAppleTalkNetworkRange "NetworkRange" CFArray[CFNumber]
- * kSCPropNetAppleTalkNodeID "NodeID" CFNumber
- * kSCPropNetAppleTalkSeedNetworkRange "SeedNetworkRange" CFArray[CFNumber]
- * kSCPropNetAppleTalkSeedZones "SeedZones" CFArray[CFString]
- *
- * --- kSCPropNetAppleTalkConfigMethod values ---
- * kSCValNetAppleTalkConfigMethodNode "Node"
- * kSCValNetAppleTalkConfigMethodRouter "Router"
- * kSCValNetAppleTalkConfigMethodSeedRouter "SeedRouter"
- *
* kSCEntNetDNS Entity Keys
*
* kSCPropNetDNSDomainName "DomainName" CFString
* kSCValNetInterfaceTypeFireWire "FireWire"
* kSCValNetInterfaceTypePPP "PPP"
* kSCValNetInterfaceType6to4 "6to4"
+ * kSCValNetInterfaceTypeIPSec "IPSec"
*
* --- kSCPropNetServiceSubType values (for PPP) ---
* kSCValNetInterfaceSubTypePPPoE "PPPoE"
*
* kSCEntNetIPSec Entity Keys
*
+ * kSCPropNetIPSecAuthenticationMethod "AuthenticationMethod" CFString
+ * kSCPropNetIPSecLocalCertificate "LocalCertificate" CFData
* kSCPropNetIPSecLocalIdentifier "LocalIdentifier" CFString
* kSCPropNetIPSecLocalIdentifierType "LocalIdentifierType" CFString
- * kSCPropNetIPSecAuthenticationMethod "AuthenticationMethod" CFString
* kSCPropNetIPSecSharedSecret "SharedSecret" CFString
* kSCPropNetIPSecSharedSecretEncryption "SharedSecretEncryption" CFString
- * kSCPropNetIPSecLocalCertificate "LocalCertificate" CFData
+ * kSCPropNetIPSecConnectTime "ConnectTime" CFNumber
+ * kSCPropNetIPSecRemoteAddress "RemoteAddress" CFString
+ * kSCPropNetIPSecStatus "Status" CFNumber
+ * kSCPropNetIPSecXAuthEnabled "XAuthEnabled" CFNumber (0 or 1)
+ * kSCPropNetIPSecXAuthName "XAuthName" CFString
+ * kSCPropNetIPSecXAuthPassword "XAuthPassword" CFString
+ * kSCPropNetIPSecXAuthPasswordEncryption "XAuthPasswordEncryption" CFString
*
* --- kSCPropNetIPSecAuthenticationMethod values ---
* kSCValNetIPSecAuthenticationMethodSharedSecret "SharedSecret"
* kSCValNetIPSecAuthenticationMethodCertificate "Certificate"
+ * kSCValNetIPSecAuthenticationMethodHybrid "Hybrid"
+ *
+ * --- kSCPropNetIPSecLocalIdentifierType values ---
+ * kSCValNetIPSecLocalIdentifierTypeKeyID "KeyID"
*
* --- kSCPropNetIPSecSharedSecretEncryption values ---
* kSCValNetIPSecSharedSecretEncryptionKeychain "Keychain"
*
- * --- kSCPropNetIPSecLocalIdentifierType values ---
- * kSCValNetIPSecLocalIdentifierTypeKeyID "KeyID"
+ * --- kSCPropNetIPSecXAuthPasswordEncryption values ---
+ * kSCValNetIPSecXAuthPasswordEncryptionKeychain "Keychain"
+ * kSCValNetIPSecXAuthPasswordEncryptionPrompt "Prompt"
*
* kSCEntNetIPv4 Entity Keys
*
* kSCPropNetIPv4BroadcastAddresses "BroadcastAddresses" CFArray[CFString]
*
* --- kSCPropNetIPv4ConfigMethod values ---
+ * kSCValNetIPv4ConfigMethodAutomatic "Automatic"
* kSCValNetIPv4ConfigMethodBOOTP "BOOTP"
* kSCValNetIPv4ConfigMethodDHCP "DHCP"
* kSCValNetIPv4ConfigMethodINFORM "INFORM"
*/
-#ifndef _SCSCHEMADEFINITIONS_H
-#define _SCSCHEMADEFINITIONS_H
+#ifndef _SCSCHEMADEFINITIONS_H
+#ifdef USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS
+#include <SystemConfiguration/_SCSchemaDefinitions.h>
+#else /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
+#define _SCSCHEMADEFINITIONS_H
/* -------------------- Macro declarations -------------------- */
-#include <AvailabilityMacros.h>
+#include <Availability.h>
+#include <TargetConditionals.h>
/*
* let's "do the right thing" for those wishing to build for
* Mac OS X 10.1.0 ... 10.2.x
*/
-#if MAC_OS_X_VERSION_MIN_REQUIRED <= 1020
+#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (__MAC_OS_X_VERSION_MIN_REQUIRED <= 1020) && !defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
#ifndef SCSTR
#include <CoreFoundation/CFString.h>
#define SCSTR(s) CFSTR(s)
#define SC_SCHEMA_DECLARATION(k,q) extern NSString * k q;
#endif
#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) && (MAC_OS_X_VERSION_MAX_ALLOWED <= 1040)
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) && (__MAC_OS_X_VERSION_MAX_ALLOWED <= 1040) && !defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
#ifndef SCSTR
#include <CoreFoundation/CFString.h>
#define SCSTR(s) CFSTR(s)
/*!
@const kSCEntNetAppleTalk
- @availability Introduced in Mac OS X 10.1.
+ @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.6.
*/
extern const CFStringRef kSCEntNetAppleTalk;
/*!
@const kSCPropNetAppleTalkComputerName
- @availability Introduced in Mac OS X 10.1.
+ @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.6.
*/
extern const CFStringRef kSCPropNetAppleTalkComputerName;
/*!
@const kSCPropNetAppleTalkComputerNameEncoding
- @availability Introduced in Mac OS X 10.1.
+ @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.6.
*/
extern const CFStringRef kSCPropNetAppleTalkComputerNameEncoding;
/*!
@const kSCPropNetAppleTalkConfigMethod
- @availability Introduced in Mac OS X 10.1.
+ @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.6.
*/
extern const CFStringRef kSCPropNetAppleTalkConfigMethod;
/*!
@const kSCPropNetAppleTalkDefaultZone
- @availability Introduced in Mac OS X 10.1.
+ @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.6.
*/
extern const CFStringRef kSCPropNetAppleTalkDefaultZone;
/*!
@const kSCPropNetAppleTalkNetworkID
- @availability Introduced in Mac OS X 10.1.
+ @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.6.
*/
extern const CFStringRef kSCPropNetAppleTalkNetworkID;
/*!
@const kSCPropNetAppleTalkNetworkRange
- @availability Introduced in Mac OS X 10.2.
+ @availability Introduced in Mac OS X 10.2, but later deprecated in Mac OS X 10.6.
*/
extern const CFStringRef kSCPropNetAppleTalkNetworkRange;
/*!
@const kSCPropNetAppleTalkNodeID
- @availability Introduced in Mac OS X 10.1.
+ @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.6.
*/
extern const CFStringRef kSCPropNetAppleTalkNodeID;
/*!
@const kSCPropNetAppleTalkSeedNetworkRange
- @availability Introduced in Mac OS X 10.1.
+ @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.6.
*/
extern const CFStringRef kSCPropNetAppleTalkSeedNetworkRange;
/*!
@const kSCPropNetAppleTalkSeedZones
- @availability Introduced in Mac OS X 10.1.
+ @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.6.
*/
extern const CFStringRef kSCPropNetAppleTalkSeedZones;
/*!
@const kSCValNetAppleTalkConfigMethodNode
- @availability Introduced in Mac OS X 10.1.
+ @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.6.
*/
extern const CFStringRef kSCValNetAppleTalkConfigMethodNode;
/*!
@const kSCValNetAppleTalkConfigMethodRouter
- @availability Introduced in Mac OS X 10.1.
+ @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.6.
*/
extern const CFStringRef kSCValNetAppleTalkConfigMethodRouter;
/*!
@const kSCValNetAppleTalkConfigMethodSeedRouter
- @availability Introduced in Mac OS X 10.1.
+ @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.6.
*/
extern const CFStringRef kSCValNetAppleTalkConfigMethodSeedRouter;
*/
extern const CFStringRef kSCValNetInterfaceType6to4;
+/*!
+ @const kSCValNetInterfaceTypeIPSec
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCValNetInterfaceTypeIPSec;
+
/*!
@const kSCValNetInterfaceSubTypePPPoE
@availability Introduced in Mac OS X 10.1.
*/
/*!
- @const kSCPropNetIPSecLocalIdentifier
+ @const kSCPropNetIPSecAuthenticationMethod
@availability Introduced in Mac OS X 10.5.
*/
-extern const CFStringRef kSCPropNetIPSecLocalIdentifier;
+extern const CFStringRef kSCPropNetIPSecAuthenticationMethod;
/*!
- @const kSCPropNetIPSecLocalIdentifierType
+ @const kSCPropNetIPSecLocalCertificate
@availability Introduced in Mac OS X 10.5.
*/
-extern const CFStringRef kSCPropNetIPSecLocalIdentifierType;
+extern const CFStringRef kSCPropNetIPSecLocalCertificate;
/*!
- @const kSCPropNetIPSecAuthenticationMethod
+ @const kSCPropNetIPSecLocalIdentifier
@availability Introduced in Mac OS X 10.5.
*/
-extern const CFStringRef kSCPropNetIPSecAuthenticationMethod;
+extern const CFStringRef kSCPropNetIPSecLocalIdentifier;
+
+/*!
+ @const kSCPropNetIPSecLocalIdentifierType
+ @availability Introduced in Mac OS X 10.5.
+ */
+extern const CFStringRef kSCPropNetIPSecLocalIdentifierType;
/*!
@const kSCPropNetIPSecSharedSecret
extern const CFStringRef kSCPropNetIPSecSharedSecretEncryption;
/*!
- @const kSCPropNetIPSecLocalCertificate
- @availability Introduced in Mac OS X 10.5.
+ @const kSCPropNetIPSecConnectTime
+ @availability Introduced in Mac OS X 10.6.
*/
-extern const CFStringRef kSCPropNetIPSecLocalCertificate;
+extern const CFStringRef kSCPropNetIPSecConnectTime;
+
+/*!
+ @const kSCPropNetIPSecRemoteAddress
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCPropNetIPSecRemoteAddress;
+
+/*!
+ @const kSCPropNetIPSecStatus
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCPropNetIPSecStatus;
+
+/*!
+ @const kSCPropNetIPSecXAuthEnabled
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCPropNetIPSecXAuthEnabled;
+
+/*!
+ @const kSCPropNetIPSecXAuthName
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCPropNetIPSecXAuthName;
+
+/*!
+ @const kSCPropNetIPSecXAuthPassword
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCPropNetIPSecXAuthPassword;
+
+/*!
+ @const kSCPropNetIPSecXAuthPasswordEncryption
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCPropNetIPSecXAuthPasswordEncryption;
/*!
@const kSCValNetIPSecAuthenticationMethodSharedSecret
extern const CFStringRef kSCValNetIPSecAuthenticationMethodCertificate;
/*!
- @const kSCValNetIPSecSharedSecretEncryptionKeychain
+ @const kSCValNetIPSecAuthenticationMethodHybrid
@availability Introduced in Mac OS X 10.5.
*/
-extern const CFStringRef kSCValNetIPSecSharedSecretEncryptionKeychain;
+extern const CFStringRef kSCValNetIPSecAuthenticationMethodHybrid;
/*!
@const kSCValNetIPSecLocalIdentifierTypeKeyID
*/
extern const CFStringRef kSCValNetIPSecLocalIdentifierTypeKeyID;
+/*!
+ @const kSCValNetIPSecSharedSecretEncryptionKeychain
+ @availability Introduced in Mac OS X 10.5.
+ */
+extern const CFStringRef kSCValNetIPSecSharedSecretEncryptionKeychain;
+
+/*!
+ @const kSCValNetIPSecXAuthPasswordEncryptionKeychain
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCValNetIPSecXAuthPasswordEncryptionKeychain;
+
+/*!
+ @const kSCValNetIPSecXAuthPasswordEncryptionPrompt
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCValNetIPSecXAuthPasswordEncryptionPrompt;
+
/*!
@group kSCEntNetIPv4 Entity Keys
*/
*/
extern const CFStringRef kSCPropNetIPv4BroadcastAddresses;
+/*!
+ @const kSCValNetIPv4ConfigMethodAutomatic
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCValNetIPv4ConfigMethodAutomatic;
+
/*!
@const kSCValNetIPv4ConfigMethodBOOTP
@availability Introduced in Mac OS X 10.1.
/* -------------------- Schema declarations -------------------- */
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCResvLink, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCResvLink, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCResvLink \
SC_SCHEMA_KV(kSCResvLink \
,"__LINK__" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCResvInactive, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCResvInactive, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCResvInactive \
SC_SCHEMA_KV(kSCResvInactive \
,"__INACTIVE__" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropInterfaceName, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropInterfaceName, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropInterfaceName \
SC_SCHEMA_KV(kSCPropInterfaceName \
,"InterfaceName" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropMACAddress, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropMACAddress, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropMACAddress \
SC_SCHEMA_KV(kSCPropMACAddress \
,"MACAddress" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropUserDefinedName, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropUserDefinedName, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropUserDefinedName \
SC_SCHEMA_KV(kSCPropUserDefinedName \
,"UserDefinedName" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropVersion, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropVersion, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropVersion \
SC_SCHEMA_KV(kSCPropVersion \
,"Version" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPrefCurrentSet, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPrefCurrentSet, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPrefCurrentSet \
SC_SCHEMA_KV(kSCPrefCurrentSet \
,"CurrentSet" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPrefNetworkServices, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPrefNetworkServices, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPrefNetworkServices \
SC_SCHEMA_KV(kSCPrefNetworkServices \
,"NetworkServices" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPrefSets, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPrefSets, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPrefSets \
SC_SCHEMA_KV(kSCPrefSets \
,"Sets" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPrefSystem, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPrefSystem, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPrefSystem \
SC_SCHEMA_KV(kSCPrefSystem \
,"System" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCCompNetwork, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCCompNetwork, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCCompNetwork \
SC_SCHEMA_KV(kSCCompNetwork \
,"Network" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCCompService, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCCompService, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCCompService \
SC_SCHEMA_KV(kSCCompService \
,"Service" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCCompGlobal, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCCompGlobal, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCCompGlobal \
SC_SCHEMA_KV(kSCCompGlobal \
,"Global" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCCompHostNames, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCCompHostNames, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCCompHostNames \
SC_SCHEMA_KV(kSCCompHostNames \
,"HostNames" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCCompInterface, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCCompInterface, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCCompInterface \
SC_SCHEMA_KV(kSCCompInterface \
,"Interface" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCCompSystem, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCCompSystem, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCCompSystem \
SC_SCHEMA_KV(kSCCompSystem \
,"System" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCCompUsers, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCCompUsers, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCCompUsers \
SC_SCHEMA_KV(kSCCompUsers \
,"Users" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCCompAnyRegex, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCCompAnyRegex, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCCompAnyRegex \
SC_SCHEMA_KV(kSCCompAnyRegex \
,"[^/]+" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCEntNetAirPort, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCEntNetAirPort, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNetAirPort \
SC_SCHEMA_KV(kSCEntNetAirPort \
,"AirPort" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCEntNetAppleTalk, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+#if !TARGET_OS_IPHONE
+
+ SC_SCHEMA_DECLARATION(kSCEntNetAppleTalk, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_6,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCEntNetAppleTalk \
SC_SCHEMA_KV(kSCEntNetAppleTalk \
,"AppleTalk" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCEntNetDHCP, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+#endif // !TARGET_OS_IPHONE
+
+ SC_SCHEMA_DECLARATION(kSCEntNetDHCP, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNetDHCP \
SC_SCHEMA_KV(kSCEntNetDHCP \
,"DHCP" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCEntNetDNS, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCEntNetDNS, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNetDNS \
SC_SCHEMA_KV(kSCEntNetDNS \
,"DNS" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCEntNetEthernet, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCEntNetEthernet, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNetEthernet \
SC_SCHEMA_KV(kSCEntNetEthernet \
,"Ethernet" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCEntNetFireWire, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCEntNetFireWire, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNetFireWire \
SC_SCHEMA_KV(kSCEntNetFireWire \
,"FireWire" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCEntNetInterface, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCEntNetInterface, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNetInterface \
SC_SCHEMA_KV(kSCEntNetInterface \
,"Interface" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCEntNetIPSec, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCEntNetIPSec, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNetIPSec \
SC_SCHEMA_KV(kSCEntNetIPSec \
,"IPSec" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCEntNetIPv4, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCEntNetIPv4, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNetIPv4 \
SC_SCHEMA_KV(kSCEntNetIPv4 \
,"IPv4" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCEntNetIPv6, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCEntNetIPv6, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNetIPv6 \
SC_SCHEMA_KV(kSCEntNetIPv6 \
,"IPv6" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCEntNetL2TP, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCEntNetL2TP, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNetL2TP \
SC_SCHEMA_KV(kSCEntNetL2TP \
,"L2TP" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCEntNetLink, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCEntNetLink, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNetLink \
SC_SCHEMA_KV(kSCEntNetLink \
,"Link" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCEntNetModem, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCEntNetModem, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNetModem \
SC_SCHEMA_KV(kSCEntNetModem \
,"Modem" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCEntNetNetInfo, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+#if !TARGET_OS_IPHONE
+
+ SC_SCHEMA_DECLARATION(kSCEntNetNetInfo, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCEntNetNetInfo \
SC_SCHEMA_KV(kSCEntNetNetInfo \
,"NetInfo" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCEntNetPPP, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+#endif // !TARGET_OS_IPHONE
+
+ SC_SCHEMA_DECLARATION(kSCEntNetPPP, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNetPPP \
SC_SCHEMA_KV(kSCEntNetPPP \
,"PPP" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCEntNetPPPoE, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCEntNetPPPoE, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNetPPPoE \
SC_SCHEMA_KV(kSCEntNetPPPoE \
,"PPPoE" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCEntNetPPPSerial, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCEntNetPPPSerial, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNetPPPSerial \
SC_SCHEMA_KV(kSCEntNetPPPSerial \
,"PPPSerial" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCEntNetPPTP, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCEntNetPPTP, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNetPPTP \
SC_SCHEMA_KV(kSCEntNetPPTP \
,"PPTP" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCEntNetProxies, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCEntNetProxies, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNetProxies \
SC_SCHEMA_KV(kSCEntNetProxies \
,"Proxies" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCEntNetSMB, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+#if !TARGET_OS_IPHONE
+
+ SC_SCHEMA_DECLARATION(kSCEntNetSMB, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNetSMB \
SC_SCHEMA_KV(kSCEntNetSMB \
,"SMB" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCEntNet6to4, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+#endif // !TARGET_OS_IPHONE
+
+ SC_SCHEMA_DECLARATION(kSCEntNet6to4, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNet6to4 \
SC_SCHEMA_KV(kSCEntNet6to4 \
,"6to4" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetOverridePrimary, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetOverridePrimary, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetOverridePrimary \
SC_SCHEMA_KV(kSCPropNetOverridePrimary \
,"OverridePrimary" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetServiceOrder, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetServiceOrder, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetServiceOrder \
SC_SCHEMA_KV(kSCPropNetServiceOrder \
,"ServiceOrder" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPOverridePrimary, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPOverridePrimary, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPOverridePrimary \
SC_SCHEMA_KV(kSCPropNetPPPOverridePrimary \
,"PPPOverridePrimary" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetInterfaces, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetInterfaces, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetInterfaces \
SC_SCHEMA_KV(kSCPropNetInterfaces \
,"Interfaces" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetLocalHostName, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetLocalHostName, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetLocalHostName \
SC_SCHEMA_KV(kSCPropNetLocalHostName \
,"LocalHostName" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetAirPortAllowNetCreation, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetAirPortAllowNetCreation, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetAirPortAllowNetCreation \
SC_SCHEMA_KV(kSCPropNetAirPortAllowNetCreation \
,"AllowNetCreation" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetAirPortAuthPassword, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetAirPortAuthPassword, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetAirPortAuthPassword \
SC_SCHEMA_KV(kSCPropNetAirPortAuthPassword \
,"AuthPassword" \
,CFData )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetAirPortAuthPasswordEncryption, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetAirPortAuthPasswordEncryption, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetAirPortAuthPasswordEncryption \
SC_SCHEMA_KV(kSCPropNetAirPortAuthPasswordEncryption \
,"AuthPasswordEncryption" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetAirPortJoinMode, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetAirPortJoinMode, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetAirPortJoinMode \
SC_SCHEMA_KV(kSCPropNetAirPortJoinMode \
,"JoinMode" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetAirPortPowerEnabled, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetAirPortPowerEnabled, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetAirPortPowerEnabled \
SC_SCHEMA_KV(kSCPropNetAirPortPowerEnabled \
,"PowerEnabled" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetAirPortPreferredNetwork, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetAirPortPreferredNetwork, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetAirPortPreferredNetwork \
SC_SCHEMA_KV(kSCPropNetAirPortPreferredNetwork \
,"PreferredNetwork" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetAirPortSavePasswords, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetAirPortSavePasswords, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetAirPortSavePasswords \
SC_SCHEMA_KV(kSCPropNetAirPortSavePasswords \
,"SavePasswords" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetAirPortJoinModeAutomatic, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCValNetAirPortJoinModeAutomatic, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetAirPortJoinModeAutomatic \
SC_SCHEMA_KV(kSCValNetAirPortJoinModeAutomatic \
,"Automatic" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetAirPortJoinModePreferred, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCValNetAirPortJoinModePreferred, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetAirPortJoinModePreferred \
SC_SCHEMA_KV(kSCValNetAirPortJoinModePreferred \
,"Preferred" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCValNetAirPortJoinModeRanked, AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
+ SC_SCHEMA_DECLARATION(kSCValNetAirPortJoinModeRanked, __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetAirPortJoinModeRanked \
SC_SCHEMA_KV(kSCValNetAirPortJoinModeRanked \
,"Ranked" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetAirPortJoinModeRecent, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCValNetAirPortJoinModeRecent, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetAirPortJoinModeRecent \
SC_SCHEMA_KV(kSCValNetAirPortJoinModeRecent \
,"Recent" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetAirPortJoinModeStrongest, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCValNetAirPortJoinModeStrongest, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetAirPortJoinModeStrongest \
SC_SCHEMA_KV(kSCValNetAirPortJoinModeStrongest \
,"Strongest" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetAirPortAuthPasswordEncryptionKeychain, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCValNetAirPortAuthPasswordEncryptionKeychain, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetAirPortAuthPasswordEncryptionKeychain \
SC_SCHEMA_KV(kSCValNetAirPortAuthPasswordEncryptionKeychain \
,"Keychain" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetAppleTalkComputerName, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+#if !TARGET_OS_IPHONE
+
+ SC_SCHEMA_DECLARATION(kSCPropNetAppleTalkComputerName, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_6,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCPropNetAppleTalkComputerName \
SC_SCHEMA_KV(kSCPropNetAppleTalkComputerName \
,"ComputerName" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetAppleTalkComputerNameEncoding, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetAppleTalkComputerNameEncoding, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_6,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCPropNetAppleTalkComputerNameEncoding \
SC_SCHEMA_KV(kSCPropNetAppleTalkComputerNameEncoding \
,"ComputerNameEncoding" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetAppleTalkConfigMethod, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetAppleTalkConfigMethod, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_6,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCPropNetAppleTalkConfigMethod \
SC_SCHEMA_KV(kSCPropNetAppleTalkConfigMethod \
,"ConfigMethod" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetAppleTalkDefaultZone, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetAppleTalkDefaultZone, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_6,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCPropNetAppleTalkDefaultZone \
SC_SCHEMA_KV(kSCPropNetAppleTalkDefaultZone \
,"DefaultZone" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetAppleTalkNetworkID, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetAppleTalkNetworkID, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_6,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCPropNetAppleTalkNetworkID \
SC_SCHEMA_KV(kSCPropNetAppleTalkNetworkID \
,"NetworkID" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetAppleTalkNetworkRange, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetAppleTalkNetworkRange, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_6,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020)
#define kSCPropNetAppleTalkNetworkRange \
SC_SCHEMA_KV(kSCPropNetAppleTalkNetworkRange \
,"NetworkRange" \
,CFArray[CFNumber] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetAppleTalkNodeID, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetAppleTalkNodeID, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_6,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCPropNetAppleTalkNodeID \
SC_SCHEMA_KV(kSCPropNetAppleTalkNodeID \
,"NodeID" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetAppleTalkSeedNetworkRange, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetAppleTalkSeedNetworkRange, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_6,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCPropNetAppleTalkSeedNetworkRange \
SC_SCHEMA_KV(kSCPropNetAppleTalkSeedNetworkRange \
,"SeedNetworkRange" \
,CFArray[CFNumber] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetAppleTalkSeedZones, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetAppleTalkSeedZones, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_6,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCPropNetAppleTalkSeedZones \
SC_SCHEMA_KV(kSCPropNetAppleTalkSeedZones \
,"SeedZones" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetAppleTalkConfigMethodNode, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCValNetAppleTalkConfigMethodNode, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_6,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCValNetAppleTalkConfigMethodNode \
SC_SCHEMA_KV(kSCValNetAppleTalkConfigMethodNode \
,"Node" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetAppleTalkConfigMethodRouter, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCValNetAppleTalkConfigMethodRouter, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_6,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCValNetAppleTalkConfigMethodRouter \
SC_SCHEMA_KV(kSCValNetAppleTalkConfigMethodRouter \
,"Router" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetAppleTalkConfigMethodSeedRouter, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCValNetAppleTalkConfigMethodSeedRouter, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_6,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCValNetAppleTalkConfigMethodSeedRouter \
SC_SCHEMA_KV(kSCValNetAppleTalkConfigMethodSeedRouter \
,"SeedRouter" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetDNSDomainName, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+#endif // !TARGET_OS_IPHONE
+
+ SC_SCHEMA_DECLARATION(kSCPropNetDNSDomainName, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetDNSDomainName \
SC_SCHEMA_KV(kSCPropNetDNSDomainName \
,"DomainName" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCPropNetDNSOptions, AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
+ SC_SCHEMA_DECLARATION(kSCPropNetDNSOptions, __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetDNSOptions \
SC_SCHEMA_KV(kSCPropNetDNSOptions \
,"Options" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetDNSSearchDomains, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetDNSSearchDomains, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetDNSSearchDomains \
SC_SCHEMA_KV(kSCPropNetDNSSearchDomains \
,"SearchDomains" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCPropNetDNSSearchOrder, AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
+ SC_SCHEMA_DECLARATION(kSCPropNetDNSSearchOrder, __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetDNSSearchOrder \
SC_SCHEMA_KV(kSCPropNetDNSSearchOrder \
,"SearchOrder" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetDNSServerAddresses, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetDNSServerAddresses, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetDNSServerAddresses \
SC_SCHEMA_KV(kSCPropNetDNSServerAddresses \
,"ServerAddresses" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCPropNetDNSServerPort, AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
+ SC_SCHEMA_DECLARATION(kSCPropNetDNSServerPort, __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetDNSServerPort \
SC_SCHEMA_KV(kSCPropNetDNSServerPort \
,"ServerPort" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCPropNetDNSServerTimeout, AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
+ SC_SCHEMA_DECLARATION(kSCPropNetDNSServerTimeout, __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetDNSServerTimeout \
SC_SCHEMA_KV(kSCPropNetDNSServerTimeout \
,"ServerTimeout" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetDNSSortList, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetDNSSortList, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetDNSSortList \
SC_SCHEMA_KV(kSCPropNetDNSSortList \
,"SortList" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCPropNetDNSSupplementalMatchDomains, AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
+ SC_SCHEMA_DECLARATION(kSCPropNetDNSSupplementalMatchDomains, __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetDNSSupplementalMatchDomains \
SC_SCHEMA_KV(kSCPropNetDNSSupplementalMatchDomains \
,"SupplementalMatchDomains" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCPropNetDNSSupplementalMatchOrders, AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
+ SC_SCHEMA_DECLARATION(kSCPropNetDNSSupplementalMatchOrders, __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetDNSSupplementalMatchOrders \
SC_SCHEMA_KV(kSCPropNetDNSSupplementalMatchOrders \
,"SupplementalMatchOrders" \
,CFArray[CFNumber] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetEthernetMediaSubType, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetEthernetMediaSubType, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetEthernetMediaSubType \
SC_SCHEMA_KV(kSCPropNetEthernetMediaSubType \
,"MediaSubType" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetEthernetMediaOptions, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetEthernetMediaOptions, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetEthernetMediaOptions \
SC_SCHEMA_KV(kSCPropNetEthernetMediaOptions \
,"MediaOptions" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetEthernetMTU, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetEthernetMTU, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetEthernetMTU \
SC_SCHEMA_KV(kSCPropNetEthernetMTU \
,"MTU" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetInterfaceDeviceName, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetInterfaceDeviceName, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetInterfaceDeviceName \
SC_SCHEMA_KV(kSCPropNetInterfaceDeviceName \
,"DeviceName" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetInterfaceHardware, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetInterfaceHardware, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetInterfaceHardware \
SC_SCHEMA_KV(kSCPropNetInterfaceHardware \
,"Hardware" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetInterfaceType, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetInterfaceType, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetInterfaceType \
SC_SCHEMA_KV(kSCPropNetInterfaceType \
,"Type" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetInterfaceSubType, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetInterfaceSubType, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetInterfaceSubType \
SC_SCHEMA_KV(kSCPropNetInterfaceSubType \
,"SubType" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetInterfaceSupportsModemOnHold, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetInterfaceSupportsModemOnHold, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetInterfaceSupportsModemOnHold \
SC_SCHEMA_KV(kSCPropNetInterfaceSupportsModemOnHold \
,"SupportsModemOnHold" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetInterfaceTypeEthernet, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCValNetInterfaceTypeEthernet, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetInterfaceTypeEthernet \
SC_SCHEMA_KV(kSCValNetInterfaceTypeEthernet \
,"Ethernet" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetInterfaceTypeFireWire, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCValNetInterfaceTypeFireWire, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetInterfaceTypeFireWire \
SC_SCHEMA_KV(kSCValNetInterfaceTypeFireWire \
,"FireWire" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetInterfaceTypePPP, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCValNetInterfaceTypePPP, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetInterfaceTypePPP \
SC_SCHEMA_KV(kSCValNetInterfaceTypePPP \
,"PPP" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetInterfaceType6to4, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCValNetInterfaceType6to4, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetInterfaceType6to4 \
SC_SCHEMA_KV(kSCValNetInterfaceType6to4 \
,"6to4" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetInterfaceSubTypePPPoE, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
+ SC_SCHEMA_DECLARATION(kSCValNetInterfaceTypeIPSec, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCValNetInterfaceTypeIPSec \
+ SC_SCHEMA_KV(kSCValNetInterfaceTypeIPSec \
+ ,"IPSec" \
+ , )
#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+
+ SC_SCHEMA_DECLARATION(kSCValNetInterfaceSubTypePPPoE, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetInterfaceSubTypePPPoE \
SC_SCHEMA_KV(kSCValNetInterfaceSubTypePPPoE \
,"PPPoE" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetInterfaceSubTypePPPSerial, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCValNetInterfaceSubTypePPPSerial, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetInterfaceSubTypePPPSerial \
SC_SCHEMA_KV(kSCValNetInterfaceSubTypePPPSerial \
,"PPPSerial" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetInterfaceSubTypePPTP, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCValNetInterfaceSubTypePPTP, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetInterfaceSubTypePPTP \
SC_SCHEMA_KV(kSCValNetInterfaceSubTypePPTP \
,"PPTP" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetInterfaceSubTypeL2TP, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCValNetInterfaceSubTypeL2TP, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetInterfaceSubTypeL2TP \
SC_SCHEMA_KV(kSCValNetInterfaceSubTypeL2TP \
,"L2TP" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetIPSecLocalIdentifier, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
+ SC_SCHEMA_DECLARATION(kSCPropNetIPSecAuthenticationMethod, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCPropNetIPSecAuthenticationMethod \
+ SC_SCHEMA_KV(kSCPropNetIPSecAuthenticationMethod \
+ ,"AuthenticationMethod" \
+ ,CFString )
#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+
+ SC_SCHEMA_DECLARATION(kSCPropNetIPSecLocalCertificate, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCPropNetIPSecLocalCertificate \
+ SC_SCHEMA_KV(kSCPropNetIPSecLocalCertificate \
+ ,"LocalCertificate" \
+ ,CFData )
+#endif
+
+ SC_SCHEMA_DECLARATION(kSCPropNetIPSecLocalIdentifier, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetIPSecLocalIdentifier \
SC_SCHEMA_KV(kSCPropNetIPSecLocalIdentifier \
,"LocalIdentifier" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetIPSecLocalIdentifierType, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropNetIPSecLocalIdentifierType, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetIPSecLocalIdentifierType \
SC_SCHEMA_KV(kSCPropNetIPSecLocalIdentifierType \
,"LocalIdentifierType" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetIPSecAuthenticationMethod, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
- #define kSCPropNetIPSecAuthenticationMethod \
- SC_SCHEMA_KV(kSCPropNetIPSecAuthenticationMethod \
- ,"AuthenticationMethod" \
- ,CFString )
-#endif
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetIPSecSharedSecret, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropNetIPSecSharedSecret, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetIPSecSharedSecret \
SC_SCHEMA_KV(kSCPropNetIPSecSharedSecret \
,"SharedSecret" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetIPSecSharedSecretEncryption, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropNetIPSecSharedSecretEncryption, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetIPSecSharedSecretEncryption \
SC_SCHEMA_KV(kSCPropNetIPSecSharedSecretEncryption \
,"SharedSecretEncryption" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetIPSecLocalCertificate, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
+ SC_SCHEMA_DECLARATION(kSCPropNetIPSecConnectTime, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCPropNetIPSecConnectTime \
+ SC_SCHEMA_KV(kSCPropNetIPSecConnectTime \
+ ,"ConnectTime" \
+ ,CFNumber )
#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
- #define kSCPropNetIPSecLocalCertificate \
- SC_SCHEMA_KV(kSCPropNetIPSecLocalCertificate \
- ,"LocalCertificate" \
- ,CFData )
+
+ SC_SCHEMA_DECLARATION(kSCPropNetIPSecRemoteAddress, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCPropNetIPSecRemoteAddress \
+ SC_SCHEMA_KV(kSCPropNetIPSecRemoteAddress \
+ ,"RemoteAddress" \
+ ,CFString )
+#endif
+
+ SC_SCHEMA_DECLARATION(kSCPropNetIPSecStatus, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCPropNetIPSecStatus \
+ SC_SCHEMA_KV(kSCPropNetIPSecStatus \
+ ,"Status" \
+ ,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCValNetIPSecAuthenticationMethodSharedSecret, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
+ SC_SCHEMA_DECLARATION(kSCPropNetIPSecXAuthEnabled, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCPropNetIPSecXAuthEnabled \
+ SC_SCHEMA_KV(kSCPropNetIPSecXAuthEnabled \
+ ,"XAuthEnabled" \
+ ,CFNumber (0 or 1) )
+#endif
+
+ SC_SCHEMA_DECLARATION(kSCPropNetIPSecXAuthName, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCPropNetIPSecXAuthName \
+ SC_SCHEMA_KV(kSCPropNetIPSecXAuthName \
+ ,"XAuthName" \
+ ,CFString )
+#endif
+
+ SC_SCHEMA_DECLARATION(kSCPropNetIPSecXAuthPassword, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCPropNetIPSecXAuthPassword \
+ SC_SCHEMA_KV(kSCPropNetIPSecXAuthPassword \
+ ,"XAuthPassword" \
+ ,CFString )
#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+
+ SC_SCHEMA_DECLARATION(kSCPropNetIPSecXAuthPasswordEncryption, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCPropNetIPSecXAuthPasswordEncryption \
+ SC_SCHEMA_KV(kSCPropNetIPSecXAuthPasswordEncryption \
+ ,"XAuthPasswordEncryption" \
+ ,CFString )
+#endif
+
+ SC_SCHEMA_DECLARATION(kSCValNetIPSecAuthenticationMethodSharedSecret, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetIPSecAuthenticationMethodSharedSecret \
SC_SCHEMA_KV(kSCValNetIPSecAuthenticationMethodSharedSecret \
,"SharedSecret" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCValNetIPSecAuthenticationMethodCertificate, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCValNetIPSecAuthenticationMethodCertificate, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetIPSecAuthenticationMethodCertificate \
SC_SCHEMA_KV(kSCValNetIPSecAuthenticationMethodCertificate \
,"Certificate" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCValNetIPSecSharedSecretEncryptionKeychain, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
+ SC_SCHEMA_DECLARATION(kSCValNetIPSecAuthenticationMethodHybrid, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCValNetIPSecAuthenticationMethodHybrid \
+ SC_SCHEMA_KV(kSCValNetIPSecAuthenticationMethodHybrid \
+ ,"Hybrid" \
+ , )
+#endif
+
+ SC_SCHEMA_DECLARATION(kSCValNetIPSecLocalIdentifierTypeKeyID, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCValNetIPSecLocalIdentifierTypeKeyID \
+ SC_SCHEMA_KV(kSCValNetIPSecLocalIdentifierTypeKeyID \
+ ,"KeyID" \
+ , )
#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+
+ SC_SCHEMA_DECLARATION(kSCValNetIPSecSharedSecretEncryptionKeychain, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetIPSecSharedSecretEncryptionKeychain \
SC_SCHEMA_KV(kSCValNetIPSecSharedSecretEncryptionKeychain \
,"Keychain" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCValNetIPSecLocalIdentifierTypeKeyID, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
- #define kSCValNetIPSecLocalIdentifierTypeKeyID \
- SC_SCHEMA_KV(kSCValNetIPSecLocalIdentifierTypeKeyID \
- ,"KeyID" \
+ SC_SCHEMA_DECLARATION(kSCValNetIPSecXAuthPasswordEncryptionKeychain, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCValNetIPSecXAuthPasswordEncryptionKeychain \
+ SC_SCHEMA_KV(kSCValNetIPSecXAuthPasswordEncryptionKeychain \
+ ,"Keychain" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetIPv4Addresses, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
+ SC_SCHEMA_DECLARATION(kSCValNetIPSecXAuthPasswordEncryptionPrompt, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 30000)/*SPI*/
+ #define kSCValNetIPSecXAuthPasswordEncryptionPrompt \
+ SC_SCHEMA_KV(kSCValNetIPSecXAuthPasswordEncryptionPrompt \
+ ,"Prompt" \
+ , )
#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+
+ SC_SCHEMA_DECLARATION(kSCPropNetIPv4Addresses, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetIPv4Addresses \
SC_SCHEMA_KV(kSCPropNetIPv4Addresses \
,"Addresses" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetIPv4ConfigMethod, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetIPv4ConfigMethod, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetIPv4ConfigMethod \
SC_SCHEMA_KV(kSCPropNetIPv4ConfigMethod \
,"ConfigMethod" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetIPv4DHCPClientID, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetIPv4DHCPClientID, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetIPv4DHCPClientID \
SC_SCHEMA_KV(kSCPropNetIPv4DHCPClientID \
,"DHCPClientID" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetIPv4Router, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetIPv4Router, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetIPv4Router \
SC_SCHEMA_KV(kSCPropNetIPv4Router \
,"Router" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetIPv4SubnetMasks, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetIPv4SubnetMasks, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetIPv4SubnetMasks \
SC_SCHEMA_KV(kSCPropNetIPv4SubnetMasks \
,"SubnetMasks" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetIPv4DestAddresses, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetIPv4DestAddresses, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetIPv4DestAddresses \
SC_SCHEMA_KV(kSCPropNetIPv4DestAddresses \
,"DestAddresses" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetIPv4BroadcastAddresses, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetIPv4BroadcastAddresses, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetIPv4BroadcastAddresses \
SC_SCHEMA_KV(kSCPropNetIPv4BroadcastAddresses \
,"BroadcastAddresses" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetIPv4ConfigMethodBOOTP, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
+ SC_SCHEMA_DECLARATION(kSCValNetIPv4ConfigMethodAutomatic, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCValNetIPv4ConfigMethodAutomatic \
+ SC_SCHEMA_KV(kSCValNetIPv4ConfigMethodAutomatic \
+ ,"Automatic" \
+ , )
#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+
+ SC_SCHEMA_DECLARATION(kSCValNetIPv4ConfigMethodBOOTP, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetIPv4ConfigMethodBOOTP \
SC_SCHEMA_KV(kSCValNetIPv4ConfigMethodBOOTP \
,"BOOTP" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetIPv4ConfigMethodDHCP, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCValNetIPv4ConfigMethodDHCP, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetIPv4ConfigMethodDHCP \
SC_SCHEMA_KV(kSCValNetIPv4ConfigMethodDHCP \
,"DHCP" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetIPv4ConfigMethodINFORM, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCValNetIPv4ConfigMethodINFORM, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetIPv4ConfigMethodINFORM \
SC_SCHEMA_KV(kSCValNetIPv4ConfigMethodINFORM \
,"INFORM" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetIPv4ConfigMethodLinkLocal, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCValNetIPv4ConfigMethodLinkLocal, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetIPv4ConfigMethodLinkLocal \
SC_SCHEMA_KV(kSCValNetIPv4ConfigMethodLinkLocal \
,"LinkLocal" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetIPv4ConfigMethodManual, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCValNetIPv4ConfigMethodManual, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetIPv4ConfigMethodManual \
SC_SCHEMA_KV(kSCValNetIPv4ConfigMethodManual \
,"Manual" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetIPv4ConfigMethodPPP, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCValNetIPv4ConfigMethodPPP, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetIPv4ConfigMethodPPP \
SC_SCHEMA_KV(kSCValNetIPv4ConfigMethodPPP \
,"PPP" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetIPv6Addresses, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetIPv6Addresses, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetIPv6Addresses \
SC_SCHEMA_KV(kSCPropNetIPv6Addresses \
,"Addresses" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetIPv6ConfigMethod, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetIPv6ConfigMethod, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetIPv6ConfigMethod \
SC_SCHEMA_KV(kSCPropNetIPv6ConfigMethod \
,"ConfigMethod" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetIPv6DestAddresses, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCPropNetIPv6DestAddresses, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetIPv6DestAddresses \
SC_SCHEMA_KV(kSCPropNetIPv6DestAddresses \
,"DestAddresses" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetIPv6Flags, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCPropNetIPv6Flags, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetIPv6Flags \
SC_SCHEMA_KV(kSCPropNetIPv6Flags \
,"Flags" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetIPv6PrefixLength, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCPropNetIPv6PrefixLength, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetIPv6PrefixLength \
SC_SCHEMA_KV(kSCPropNetIPv6PrefixLength \
,"PrefixLength" \
,CFArray[CFNumber] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetIPv6Router, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCPropNetIPv6Router, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetIPv6Router \
SC_SCHEMA_KV(kSCPropNetIPv6Router \
,"Router" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetIPv6ConfigMethodAutomatic, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCValNetIPv6ConfigMethodAutomatic, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetIPv6ConfigMethodAutomatic \
SC_SCHEMA_KV(kSCValNetIPv6ConfigMethodAutomatic \
,"Automatic" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetIPv6ConfigMethodManual, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCValNetIPv6ConfigMethodManual, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetIPv6ConfigMethodManual \
SC_SCHEMA_KV(kSCValNetIPv6ConfigMethodManual \
,"Manual" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetIPv6ConfigMethodRouterAdvertisement, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCValNetIPv6ConfigMethodRouterAdvertisement, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetIPv6ConfigMethodRouterAdvertisement \
SC_SCHEMA_KV(kSCValNetIPv6ConfigMethodRouterAdvertisement \
,"RouterAdvertisement" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetIPv6ConfigMethod6to4, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCValNetIPv6ConfigMethod6to4, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetIPv6ConfigMethod6to4 \
SC_SCHEMA_KV(kSCValNetIPv6ConfigMethod6to4 \
,"6to4" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNet6to4Relay, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCPropNet6to4Relay, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNet6to4Relay \
SC_SCHEMA_KV(kSCPropNet6to4Relay \
,"Relay" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetLinkActive, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetLinkActive, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetLinkActive \
SC_SCHEMA_KV(kSCPropNetLinkActive \
,"Active" \
,CFBoolean )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetLinkDetaching, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetLinkDetaching, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetLinkDetaching \
SC_SCHEMA_KV(kSCPropNetLinkDetaching \
,"Detaching" \
,CFBoolean )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetModemAccessPointName, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropNetModemAccessPointName, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetModemAccessPointName \
SC_SCHEMA_KV(kSCPropNetModemAccessPointName \
,"AccessPointName" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetModemConnectionPersonality, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropNetModemConnectionPersonality, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetModemConnectionPersonality \
SC_SCHEMA_KV(kSCPropNetModemConnectionPersonality \
,"ConnectionPersonality" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetModemConnectionScript, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetModemConnectionScript, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetModemConnectionScript \
SC_SCHEMA_KV(kSCPropNetModemConnectionScript \
,"ConnectionScript" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetModemConnectSpeed, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetModemConnectSpeed, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetModemConnectSpeed \
SC_SCHEMA_KV(kSCPropNetModemConnectSpeed \
,"ConnectSpeed" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetModemDataCompression, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetModemDataCompression, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetModemDataCompression \
SC_SCHEMA_KV(kSCPropNetModemDataCompression \
,"DataCompression" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetModemDeviceContextID, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropNetModemDeviceContextID, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetModemDeviceContextID \
SC_SCHEMA_KV(kSCPropNetModemDeviceContextID \
,"DeviceContextID" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetModemDeviceModel, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropNetModemDeviceModel, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetModemDeviceModel \
SC_SCHEMA_KV(kSCPropNetModemDeviceModel \
,"DeviceModel" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetModemDeviceVendor, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropNetModemDeviceVendor, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetModemDeviceVendor \
SC_SCHEMA_KV(kSCPropNetModemDeviceVendor \
,"DeviceVendor" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetModemDialMode, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetModemDialMode, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetModemDialMode \
SC_SCHEMA_KV(kSCPropNetModemDialMode \
,"DialMode" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetModemErrorCorrection, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetModemErrorCorrection, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetModemErrorCorrection \
SC_SCHEMA_KV(kSCPropNetModemErrorCorrection \
,"ErrorCorrection" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetModemHoldCallWaitingAudibleAlert, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetModemHoldCallWaitingAudibleAlert, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetModemHoldCallWaitingAudibleAlert \
SC_SCHEMA_KV(kSCPropNetModemHoldCallWaitingAudibleAlert \
,"HoldCallWaitingAudibleAlert" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetModemHoldDisconnectOnAnswer, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetModemHoldDisconnectOnAnswer, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetModemHoldDisconnectOnAnswer \
SC_SCHEMA_KV(kSCPropNetModemHoldDisconnectOnAnswer \
,"HoldDisconnectOnAnswer" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetModemHoldEnabled, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetModemHoldEnabled, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetModemHoldEnabled \
SC_SCHEMA_KV(kSCPropNetModemHoldEnabled \
,"HoldEnabled" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetModemHoldReminder, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetModemHoldReminder, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetModemHoldReminder \
SC_SCHEMA_KV(kSCPropNetModemHoldReminder \
,"HoldReminder" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetModemHoldReminderTime, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetModemHoldReminderTime, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetModemHoldReminderTime \
SC_SCHEMA_KV(kSCPropNetModemHoldReminderTime \
,"HoldReminderTime" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetModemNote, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetModemNote, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetModemNote \
SC_SCHEMA_KV(kSCPropNetModemNote \
,"Note" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetModemPulseDial, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetModemPulseDial, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetModemPulseDial \
SC_SCHEMA_KV(kSCPropNetModemPulseDial \
,"PulseDial" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetModemSpeaker, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetModemSpeaker, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetModemSpeaker \
SC_SCHEMA_KV(kSCPropNetModemSpeaker \
,"Speaker" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetModemSpeed, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetModemSpeed, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetModemSpeed \
SC_SCHEMA_KV(kSCPropNetModemSpeed \
,"Speed" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetModemDialModeIgnoreDialTone, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCValNetModemDialModeIgnoreDialTone, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetModemDialModeIgnoreDialTone \
SC_SCHEMA_KV(kSCValNetModemDialModeIgnoreDialTone \
,"IgnoreDialTone" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetModemDialModeManual, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCValNetModemDialModeManual, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetModemDialModeManual \
SC_SCHEMA_KV(kSCValNetModemDialModeManual \
,"Manual" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetModemDialModeWaitForDialTone, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCValNetModemDialModeWaitForDialTone, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetModemDialModeWaitForDialTone \
SC_SCHEMA_KV(kSCValNetModemDialModeWaitForDialTone \
,"WaitForDialTone" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCPropNetNetInfoBindingMethods, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+#if !TARGET_OS_IPHONE
+
+ SC_SCHEMA_DECLARATION(kSCPropNetNetInfoBindingMethods, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCPropNetNetInfoBindingMethods \
SC_SCHEMA_KV(kSCPropNetNetInfoBindingMethods \
,"BindingMethods" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCPropNetNetInfoServerAddresses, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetNetInfoServerAddresses, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCPropNetNetInfoServerAddresses \
SC_SCHEMA_KV(kSCPropNetNetInfoServerAddresses \
,"ServerAddresses" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCPropNetNetInfoServerTags, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetNetInfoServerTags, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCPropNetNetInfoServerTags \
SC_SCHEMA_KV(kSCPropNetNetInfoServerTags \
,"ServerTags" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCPropNetNetInfoBroadcastServerTag, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetNetInfoBroadcastServerTag, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCPropNetNetInfoBroadcastServerTag \
SC_SCHEMA_KV(kSCPropNetNetInfoBroadcastServerTag \
,"BroadcastServerTag" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCValNetNetInfoBindingMethodsBroadcast, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCValNetNetInfoBindingMethodsBroadcast, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCValNetNetInfoBindingMethodsBroadcast \
SC_SCHEMA_KV(kSCValNetNetInfoBindingMethodsBroadcast \
,"Broadcast" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCValNetNetInfoBindingMethodsDHCP, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCValNetNetInfoBindingMethodsDHCP, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCValNetNetInfoBindingMethodsDHCP \
SC_SCHEMA_KV(kSCValNetNetInfoBindingMethodsDHCP \
,"DHCP" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCValNetNetInfoBindingMethodsManual, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCValNetNetInfoBindingMethodsManual, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCValNetNetInfoBindingMethodsManual \
SC_SCHEMA_KV(kSCValNetNetInfoBindingMethodsManual \
,"Manual" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCValNetNetInfoDefaultServerTag, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCValNetNetInfoDefaultServerTag, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCValNetNetInfoDefaultServerTag \
SC_SCHEMA_KV(kSCValNetNetInfoDefaultServerTag \
,"network" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPACSPEnabled, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+#endif // !TARGET_OS_IPHONE
+
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPACSPEnabled, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPACSPEnabled \
SC_SCHEMA_KV(kSCPropNetPPPACSPEnabled \
,"ACSPEnabled" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPConnectTime, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPConnectTime, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPConnectTime \
SC_SCHEMA_KV(kSCPropNetPPPConnectTime \
,"ConnectTime" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPDeviceLastCause, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPDeviceLastCause, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPDeviceLastCause \
SC_SCHEMA_KV(kSCPropNetPPPDeviceLastCause \
,"DeviceLastCause" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPDialOnDemand, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPDialOnDemand, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPDialOnDemand \
SC_SCHEMA_KV(kSCPropNetPPPDialOnDemand \
,"DialOnDemand" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCPropNetPPPDisconnectOnFastUserSwitch, AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPDisconnectOnFastUserSwitch, __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPDisconnectOnFastUserSwitch \
SC_SCHEMA_KV(kSCPropNetPPPDisconnectOnFastUserSwitch \
,"DisconnectOnFastUserSwitch" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPDisconnectOnIdle, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPDisconnectOnIdle, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPDisconnectOnIdle \
SC_SCHEMA_KV(kSCPropNetPPPDisconnectOnIdle \
,"DisconnectOnIdle" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPDisconnectOnIdleTimer, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPDisconnectOnIdleTimer, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPDisconnectOnIdleTimer \
SC_SCHEMA_KV(kSCPropNetPPPDisconnectOnIdleTimer \
,"DisconnectOnIdleTimer" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPDisconnectOnLogout, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPDisconnectOnLogout, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPDisconnectOnLogout \
SC_SCHEMA_KV(kSCPropNetPPPDisconnectOnLogout \
,"DisconnectOnLogout" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPDisconnectOnSleep, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPDisconnectOnSleep, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPDisconnectOnSleep \
SC_SCHEMA_KV(kSCPropNetPPPDisconnectOnSleep \
,"DisconnectOnSleep" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPDisconnectTime, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPDisconnectTime, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPDisconnectTime \
SC_SCHEMA_KV(kSCPropNetPPPDisconnectTime \
,"DisconnectTime" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPIdleReminderTimer, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPIdleReminderTimer, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPIdleReminderTimer \
SC_SCHEMA_KV(kSCPropNetPPPIdleReminderTimer \
,"IdleReminderTimer" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPIdleReminder, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPIdleReminder, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPIdleReminder \
SC_SCHEMA_KV(kSCPropNetPPPIdleReminder \
,"IdleReminder" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPLastCause, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPLastCause, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPLastCause \
SC_SCHEMA_KV(kSCPropNetPPPLastCause \
,"LastCause" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPLogfile, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPLogfile, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPLogfile \
SC_SCHEMA_KV(kSCPropNetPPPLogfile \
,"Logfile" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPPlugins, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPPlugins, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPPlugins \
SC_SCHEMA_KV(kSCPropNetPPPPlugins \
,"Plugins" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPRetryConnectTime, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPRetryConnectTime, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPRetryConnectTime \
SC_SCHEMA_KV(kSCPropNetPPPRetryConnectTime \
,"RetryConnectTime" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPSessionTimer, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPSessionTimer, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPSessionTimer \
SC_SCHEMA_KV(kSCPropNetPPPSessionTimer \
,"SessionTimer" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPStatus, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPStatus, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPStatus \
SC_SCHEMA_KV(kSCPropNetPPPStatus \
,"Status" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPUseSessionTimer, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPUseSessionTimer, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPUseSessionTimer \
SC_SCHEMA_KV(kSCPropNetPPPUseSessionTimer \
,"UseSessionTimer" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPVerboseLogging, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPVerboseLogging, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPVerboseLogging \
SC_SCHEMA_KV(kSCPropNetPPPVerboseLogging \
,"VerboseLogging" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPAuthEAPPlugins, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPAuthEAPPlugins, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPAuthEAPPlugins \
SC_SCHEMA_KV(kSCPropNetPPPAuthEAPPlugins \
,"AuthEAPPlugins" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPAuthName, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPAuthName, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPAuthName \
SC_SCHEMA_KV(kSCPropNetPPPAuthName \
,"AuthName" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPAuthPassword, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPAuthPassword, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPAuthPassword \
SC_SCHEMA_KV(kSCPropNetPPPAuthPassword \
,"AuthPassword" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPAuthPasswordEncryption, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPAuthPasswordEncryption, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPAuthPasswordEncryption \
SC_SCHEMA_KV(kSCPropNetPPPAuthPasswordEncryption \
,"AuthPasswordEncryption" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPAuthPrompt, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPAuthPrompt, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPAuthPrompt \
SC_SCHEMA_KV(kSCPropNetPPPAuthPrompt \
,"AuthPrompt" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPAuthProtocol, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPAuthProtocol, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPAuthProtocol \
SC_SCHEMA_KV(kSCPropNetPPPAuthProtocol \
,"AuthProtocol" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetPPPAuthPasswordEncryptionKeychain, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCValNetPPPAuthPasswordEncryptionKeychain, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetPPPAuthPasswordEncryptionKeychain \
SC_SCHEMA_KV(kSCValNetPPPAuthPasswordEncryptionKeychain \
,"Keychain" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCValNetPPPAuthPasswordEncryptionToken, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCValNetPPPAuthPasswordEncryptionToken, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetPPPAuthPasswordEncryptionToken \
SC_SCHEMA_KV(kSCValNetPPPAuthPasswordEncryptionToken \
,"Token" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetPPPAuthPromptBefore, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCValNetPPPAuthPromptBefore, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetPPPAuthPromptBefore \
SC_SCHEMA_KV(kSCValNetPPPAuthPromptBefore \
,"Before" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetPPPAuthPromptAfter, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCValNetPPPAuthPromptAfter, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetPPPAuthPromptAfter \
SC_SCHEMA_KV(kSCValNetPPPAuthPromptAfter \
,"After" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetPPPAuthProtocolCHAP, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCValNetPPPAuthProtocolCHAP, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetPPPAuthProtocolCHAP \
SC_SCHEMA_KV(kSCValNetPPPAuthProtocolCHAP \
,"CHAP" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetPPPAuthProtocolEAP, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCValNetPPPAuthProtocolEAP, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetPPPAuthProtocolEAP \
SC_SCHEMA_KV(kSCValNetPPPAuthProtocolEAP \
,"EAP" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetPPPAuthProtocolMSCHAP1, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCValNetPPPAuthProtocolMSCHAP1, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetPPPAuthProtocolMSCHAP1 \
SC_SCHEMA_KV(kSCValNetPPPAuthProtocolMSCHAP1 \
,"MSCHAP1" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetPPPAuthProtocolMSCHAP2, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCValNetPPPAuthProtocolMSCHAP2, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetPPPAuthProtocolMSCHAP2 \
SC_SCHEMA_KV(kSCValNetPPPAuthProtocolMSCHAP2 \
,"MSCHAP2" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetPPPAuthProtocolPAP, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCValNetPPPAuthProtocolPAP, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetPPPAuthProtocolPAP \
SC_SCHEMA_KV(kSCValNetPPPAuthProtocolPAP \
,"PAP" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPCommAlternateRemoteAddress, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPCommAlternateRemoteAddress, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPCommAlternateRemoteAddress \
SC_SCHEMA_KV(kSCPropNetPPPCommAlternateRemoteAddress \
,"CommAlternateRemoteAddress" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPCommConnectDelay, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPCommConnectDelay, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPCommConnectDelay \
SC_SCHEMA_KV(kSCPropNetPPPCommConnectDelay \
,"CommConnectDelay" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPCommDisplayTerminalWindow, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPCommDisplayTerminalWindow, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPCommDisplayTerminalWindow \
SC_SCHEMA_KV(kSCPropNetPPPCommDisplayTerminalWindow \
,"CommDisplayTerminalWindow" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPCommRedialCount, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPCommRedialCount, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPCommRedialCount \
SC_SCHEMA_KV(kSCPropNetPPPCommRedialCount \
,"CommRedialCount" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPCommRedialEnabled, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPCommRedialEnabled, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPCommRedialEnabled \
SC_SCHEMA_KV(kSCPropNetPPPCommRedialEnabled \
,"CommRedialEnabled" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPCommRedialInterval, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPCommRedialInterval, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPCommRedialInterval \
SC_SCHEMA_KV(kSCPropNetPPPCommRedialInterval \
,"CommRedialInterval" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPCommRemoteAddress, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPCommRemoteAddress, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPCommRemoteAddress \
SC_SCHEMA_KV(kSCPropNetPPPCommRemoteAddress \
,"CommRemoteAddress" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPCommTerminalScript, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPCommTerminalScript, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPCommTerminalScript \
SC_SCHEMA_KV(kSCPropNetPPPCommTerminalScript \
,"CommTerminalScript" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPCommUseTerminalScript, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPCommUseTerminalScript, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPCommUseTerminalScript \
SC_SCHEMA_KV(kSCPropNetPPPCommUseTerminalScript \
,"CommUseTerminalScript" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPCCPEnabled, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPCCPEnabled, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPCCPEnabled \
SC_SCHEMA_KV(kSCPropNetPPPCCPEnabled \
,"CCPEnabled" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCPropNetPPPCCPMPPE40Enabled, AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPCCPMPPE40Enabled, __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPCCPMPPE40Enabled \
SC_SCHEMA_KV(kSCPropNetPPPCCPMPPE40Enabled \
,"CCPMPPE40Enabled" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCPropNetPPPCCPMPPE128Enabled, AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPCCPMPPE128Enabled, __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPCCPMPPE128Enabled \
SC_SCHEMA_KV(kSCPropNetPPPCCPMPPE128Enabled \
,"CCPMPPE128Enabled" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPIPCPCompressionVJ, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPIPCPCompressionVJ, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPIPCPCompressionVJ \
SC_SCHEMA_KV(kSCPropNetPPPIPCPCompressionVJ \
,"IPCPCompressionVJ" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCPropNetPPPIPCPUsePeerDNS, AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPIPCPUsePeerDNS, __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPIPCPUsePeerDNS \
SC_SCHEMA_KV(kSCPropNetPPPIPCPUsePeerDNS \
,"IPCPUsePeerDNS" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPLCPEchoEnabled, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPLCPEchoEnabled, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPLCPEchoEnabled \
SC_SCHEMA_KV(kSCPropNetPPPLCPEchoEnabled \
,"LCPEchoEnabled" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPLCPEchoFailure, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPLCPEchoFailure, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPLCPEchoFailure \
SC_SCHEMA_KV(kSCPropNetPPPLCPEchoFailure \
,"LCPEchoFailure" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPLCPEchoInterval, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPLCPEchoInterval, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPLCPEchoInterval \
SC_SCHEMA_KV(kSCPropNetPPPLCPEchoInterval \
,"LCPEchoInterval" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPLCPCompressionACField, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPLCPCompressionACField, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPLCPCompressionACField \
SC_SCHEMA_KV(kSCPropNetPPPLCPCompressionACField \
,"LCPCompressionACField" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPLCPCompressionPField, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPLCPCompressionPField, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPLCPCompressionPField \
SC_SCHEMA_KV(kSCPropNetPPPLCPCompressionPField \
,"LCPCompressionPField" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPLCPMRU, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPLCPMRU, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPLCPMRU \
SC_SCHEMA_KV(kSCPropNetPPPLCPMRU \
,"LCPMRU" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPLCPMTU, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPLCPMTU, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPLCPMTU \
SC_SCHEMA_KV(kSCPropNetPPPLCPMTU \
,"LCPMTU" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPLCPReceiveACCM, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPLCPReceiveACCM, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPLCPReceiveACCM \
SC_SCHEMA_KV(kSCPropNetPPPLCPReceiveACCM \
,"LCPReceiveACCM" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetPPPLCPTransmitACCM, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPLCPTransmitACCM, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPLCPTransmitACCM \
SC_SCHEMA_KV(kSCPropNetPPPLCPTransmitACCM \
,"LCPTransmitACCM" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetL2TPIPSecSharedSecret, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCPropNetL2TPIPSecSharedSecret, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetL2TPIPSecSharedSecret \
SC_SCHEMA_KV(kSCPropNetL2TPIPSecSharedSecret \
,"IPSecSharedSecret" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetL2TPIPSecSharedSecretEncryption, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCPropNetL2TPIPSecSharedSecretEncryption, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetL2TPIPSecSharedSecretEncryption \
SC_SCHEMA_KV(kSCPropNetL2TPIPSecSharedSecretEncryption \
,"IPSecSharedSecretEncryption" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetL2TPTransport, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCPropNetL2TPTransport, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetL2TPTransport \
SC_SCHEMA_KV(kSCPropNetL2TPTransport \
,"Transport" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetL2TPIPSecSharedSecretEncryptionKeychain, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCValNetL2TPIPSecSharedSecretEncryptionKeychain, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetL2TPIPSecSharedSecretEncryptionKeychain \
SC_SCHEMA_KV(kSCValNetL2TPIPSecSharedSecretEncryptionKeychain \
,"Keychain" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetL2TPTransportIP, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCValNetL2TPTransportIP, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetL2TPTransportIP \
SC_SCHEMA_KV(kSCValNetL2TPTransportIP \
,"IP" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCValNetL2TPTransportIPSec, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)
+ SC_SCHEMA_DECLARATION(kSCValNetL2TPTransportIPSec, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetL2TPTransportIPSec \
SC_SCHEMA_KV(kSCValNetL2TPTransportIPSec \
,"IPSec" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesExceptionsList, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesExceptionsList, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesExceptionsList \
SC_SCHEMA_KV(kSCPropNetProxiesExceptionsList \
,"ExceptionsList" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesExcludeSimpleHostnames, AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesExcludeSimpleHostnames, __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesExcludeSimpleHostnames \
SC_SCHEMA_KV(kSCPropNetProxiesExcludeSimpleHostnames \
,"ExcludeSimpleHostnames" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesFTPEnable, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesFTPEnable, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesFTPEnable \
SC_SCHEMA_KV(kSCPropNetProxiesFTPEnable \
,"FTPEnable" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesFTPPassive, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesFTPPassive, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesFTPPassive \
SC_SCHEMA_KV(kSCPropNetProxiesFTPPassive \
,"FTPPassive" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesFTPPort, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesFTPPort, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesFTPPort \
SC_SCHEMA_KV(kSCPropNetProxiesFTPPort \
,"FTPPort" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesFTPProxy, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesFTPProxy, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesFTPProxy \
SC_SCHEMA_KV(kSCPropNetProxiesFTPProxy \
,"FTPProxy" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesGopherEnable, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesGopherEnable, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesGopherEnable \
SC_SCHEMA_KV(kSCPropNetProxiesGopherEnable \
,"GopherEnable" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesGopherPort, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesGopherPort, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesGopherPort \
SC_SCHEMA_KV(kSCPropNetProxiesGopherPort \
,"GopherPort" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesGopherProxy, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesGopherProxy, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesGopherProxy \
SC_SCHEMA_KV(kSCPropNetProxiesGopherProxy \
,"GopherProxy" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesHTTPEnable, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesHTTPEnable, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesHTTPEnable \
SC_SCHEMA_KV(kSCPropNetProxiesHTTPEnable \
,"HTTPEnable" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesHTTPPort, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesHTTPPort, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesHTTPPort \
SC_SCHEMA_KV(kSCPropNetProxiesHTTPPort \
,"HTTPPort" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesHTTPProxy, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesHTTPProxy, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesHTTPProxy \
SC_SCHEMA_KV(kSCPropNetProxiesHTTPProxy \
,"HTTPProxy" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesHTTPSEnable, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesHTTPSEnable, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesHTTPSEnable \
SC_SCHEMA_KV(kSCPropNetProxiesHTTPSEnable \
,"HTTPSEnable" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesHTTPSPort, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesHTTPSPort, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesHTTPSPort \
SC_SCHEMA_KV(kSCPropNetProxiesHTTPSPort \
,"HTTPSPort" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesHTTPSProxy, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesHTTPSProxy, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesHTTPSProxy \
SC_SCHEMA_KV(kSCPropNetProxiesHTTPSProxy \
,"HTTPSProxy" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesRTSPEnable, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesRTSPEnable, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesRTSPEnable \
SC_SCHEMA_KV(kSCPropNetProxiesRTSPEnable \
,"RTSPEnable" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesRTSPPort, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesRTSPPort, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesRTSPPort \
SC_SCHEMA_KV(kSCPropNetProxiesRTSPPort \
,"RTSPPort" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesRTSPProxy, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesRTSPProxy, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesRTSPProxy \
SC_SCHEMA_KV(kSCPropNetProxiesRTSPProxy \
,"RTSPProxy" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesSOCKSEnable, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesSOCKSEnable, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesSOCKSEnable \
SC_SCHEMA_KV(kSCPropNetProxiesSOCKSEnable \
,"SOCKSEnable" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesSOCKSPort, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesSOCKSPort, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesSOCKSPort \
SC_SCHEMA_KV(kSCPropNetProxiesSOCKSPort \
,"SOCKSPort" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesSOCKSProxy, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesSOCKSProxy, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesSOCKSProxy \
SC_SCHEMA_KV(kSCPropNetProxiesSOCKSProxy \
,"SOCKSProxy" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesProxyAutoConfigEnable, AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesProxyAutoConfigEnable, __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesProxyAutoConfigEnable \
SC_SCHEMA_KV(kSCPropNetProxiesProxyAutoConfigEnable \
,"ProxyAutoConfigEnable" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesProxyAutoConfigURLString, AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesProxyAutoConfigURLString, __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesProxyAutoConfigURLString \
SC_SCHEMA_KV(kSCPropNetProxiesProxyAutoConfigURLString \
,"ProxyAutoConfigURLString" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
- SC_SCHEMA_DECLARATION(kSCPropNetProxiesProxyAutoDiscoveryEnable, AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
+ SC_SCHEMA_DECLARATION(kSCPropNetProxiesProxyAutoDiscoveryEnable, __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetProxiesProxyAutoDiscoveryEnable \
SC_SCHEMA_KV(kSCPropNetProxiesProxyAutoDiscoveryEnable \
,"ProxyAutoDiscoveryEnable" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetSMBNetBIOSName, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+#if !TARGET_OS_IPHONE
+
+ SC_SCHEMA_DECLARATION(kSCPropNetSMBNetBIOSName, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetSMBNetBIOSName \
SC_SCHEMA_KV(kSCPropNetSMBNetBIOSName \
,"NetBIOSName" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetSMBNetBIOSNodeType, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropNetSMBNetBIOSNodeType, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetSMBNetBIOSNodeType \
SC_SCHEMA_KV(kSCPropNetSMBNetBIOSNodeType \
,"NetBIOSNodeType" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetSMBNetBIOSScope, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropNetSMBNetBIOSScope, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetSMBNetBIOSScope \
SC_SCHEMA_KV(kSCPropNetSMBNetBIOSScope \
,"NetBIOSScope" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetSMBWINSAddresses, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropNetSMBWINSAddresses, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetSMBWINSAddresses \
SC_SCHEMA_KV(kSCPropNetSMBWINSAddresses \
,"WINSAddresses" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetSMBWorkgroup, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropNetSMBWorkgroup, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetSMBWorkgroup \
SC_SCHEMA_KV(kSCPropNetSMBWorkgroup \
,"Workgroup" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCValNetSMBNetBIOSNodeTypeBroadcast, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCValNetSMBNetBIOSNodeTypeBroadcast, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetSMBNetBIOSNodeTypeBroadcast \
SC_SCHEMA_KV(kSCValNetSMBNetBIOSNodeTypeBroadcast \
,"Broadcast" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCValNetSMBNetBIOSNodeTypePeer, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCValNetSMBNetBIOSNodeTypePeer, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetSMBNetBIOSNodeTypePeer \
SC_SCHEMA_KV(kSCValNetSMBNetBIOSNodeTypePeer \
,"Peer" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCValNetSMBNetBIOSNodeTypeMixed, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCValNetSMBNetBIOSNodeTypeMixed, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetSMBNetBIOSNodeTypeMixed \
SC_SCHEMA_KV(kSCValNetSMBNetBIOSNodeTypeMixed \
,"Mixed" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCValNetSMBNetBIOSNodeTypeHybrid, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCValNetSMBNetBIOSNodeTypeHybrid, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetSMBNetBIOSNodeTypeHybrid \
SC_SCHEMA_KV(kSCValNetSMBNetBIOSNodeTypeHybrid \
,"Hybrid" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCEntUsersConsoleUser, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+#endif // !TARGET_OS_IPHONE
+
+#if !TARGET_OS_IPHONE
+
+ SC_SCHEMA_DECLARATION(kSCEntUsersConsoleUser, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntUsersConsoleUser \
SC_SCHEMA_KV(kSCEntUsersConsoleUser \
,"ConsoleUser" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropSystemComputerName, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+#endif // !TARGET_OS_IPHONE
+
+ SC_SCHEMA_DECLARATION(kSCPropSystemComputerName, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropSystemComputerName \
SC_SCHEMA_KV(kSCPropSystemComputerName \
,"ComputerName" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropSystemComputerNameEncoding, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropSystemComputerNameEncoding, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropSystemComputerNameEncoding \
SC_SCHEMA_KV(kSCPropSystemComputerNameEncoding \
,"ComputerNameEncoding" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCDynamicStoreDomainFile, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCDynamicStoreDomainFile, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCDynamicStoreDomainFile \
SC_SCHEMA_KV(kSCDynamicStoreDomainFile \
,"File:" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCDynamicStoreDomainPlugin, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCDynamicStoreDomainPlugin, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCDynamicStoreDomainPlugin \
SC_SCHEMA_KV(kSCDynamicStoreDomainPlugin \
,"Plugin:" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCDynamicStoreDomainSetup, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCDynamicStoreDomainSetup, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCDynamicStoreDomainSetup \
SC_SCHEMA_KV(kSCDynamicStoreDomainSetup \
,"Setup:" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCDynamicStoreDomainState, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCDynamicStoreDomainState, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCDynamicStoreDomainState \
SC_SCHEMA_KV(kSCDynamicStoreDomainState \
,"State:" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCDynamicStoreDomainPrefs, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCDynamicStoreDomainPrefs, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCDynamicStoreDomainPrefs \
SC_SCHEMA_KV(kSCDynamicStoreDomainPrefs \
,"Prefs:" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCDynamicStorePropSetupCurrentSet, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCDynamicStorePropSetupCurrentSet, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCDynamicStorePropSetupCurrentSet \
SC_SCHEMA_KV(kSCDynamicStorePropSetupCurrentSet \
,"CurrentSet" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCDynamicStorePropSetupLastUpdated, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCDynamicStorePropSetupLastUpdated, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCDynamicStorePropSetupLastUpdated \
SC_SCHEMA_KV(kSCDynamicStorePropSetupLastUpdated \
,"LastUpdated" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCDynamicStorePropNetInterfaces, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCDynamicStorePropNetInterfaces, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCDynamicStorePropNetInterfaces \
SC_SCHEMA_KV(kSCDynamicStorePropNetInterfaces \
,"Interfaces" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCDynamicStorePropNetPrimaryInterface, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCDynamicStorePropNetPrimaryInterface, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCDynamicStorePropNetPrimaryInterface \
SC_SCHEMA_KV(kSCDynamicStorePropNetPrimaryInterface \
,"PrimaryInterface" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCDynamicStorePropNetPrimaryService, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCDynamicStorePropNetPrimaryService, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCDynamicStorePropNetPrimaryService \
SC_SCHEMA_KV(kSCDynamicStorePropNetPrimaryService \
,"PrimaryService" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCDynamicStorePropNetServiceIDs, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCDynamicStorePropNetServiceIDs, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCDynamicStorePropNetServiceIDs \
SC_SCHEMA_KV(kSCDynamicStorePropNetServiceIDs \
,"ServiceIDs" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropUsersConsoleUserName, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+#if !TARGET_OS_IPHONE
+
+ SC_SCHEMA_DECLARATION(kSCPropUsersConsoleUserName, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCPropUsersConsoleUserName \
SC_SCHEMA_KV(kSCPropUsersConsoleUserName \
,"Name" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropUsersConsoleUserUID, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropUsersConsoleUserUID, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCPropUsersConsoleUserUID \
SC_SCHEMA_KV(kSCPropUsersConsoleUserUID \
,"UID" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- SC_SCHEMA_DECLARATION(kSCPropUsersConsoleUserGID, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)
+ SC_SCHEMA_DECLARATION(kSCPropUsersConsoleUserGID, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)
#define kSCPropUsersConsoleUserGID \
SC_SCHEMA_KV(kSCPropUsersConsoleUserGID \
,"GID" \
,CFNumber )
#endif
-#endif /* _SCSCHEMADEFINITIONS_H */
+#endif // !TARGET_OS_IPHONE
+
+#endif /* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */
+#endif /* _SCSCHEMADEFINITIONS_H */
/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*
* Network Entity Keys
*
+ * kSCEntNetCommCenter "com.apple.CommCenter" CFDictionary
* kSCEntNetEAPOL "EAPOL" CFDictionary
+ * kSCEntNetOnDemand "OnDemand" CFDictionary
+ * kSCEntNetService "__SERVICE__" CFDictionary
*
* kSCCompNetwork Properties
*
* kSCPropNetIgnoreLinkStatus "IgnoreLinkStatus" CFBoolean
*
+ * kSCEntNetCommCenter Entity Keys
+ *
+ * kSCPropNetCommCenterAllowNetworkAccess "AllowNetworkAccess" CFNumber (0 or 1)
+ * kSCPropNetCommCenterAvailable "Available" CFNumber (0 or 1)
+ *
+ * kSCEntNetIPSec Entity Keys
+ *
+ * kSCPropNetIPSecLastCause "LastCause" CFNumber
+ *
+ * --- OnDemand: ---
+ * kSCPropNetIPSecOnDemandEnabled "OnDemandEnabled" CFNumber (0 or 1)
+ * kSCPropNetIPSecOnDemandMatchDomainsAlways "OnDemandMatchDomainsAlways" CFArray[CFString]
+ * kSCPropNetIPSecOnDemandMatchDomainsOnRetry "OnDemandMatchDomainsOnRetry" CFArray[CFString]
+ * kSCPropNetIPSecOnDemandMatchDomainsNever "OnDemandMatchDomainsNever" CFArray[CFString]
+ *
* kSCEntNetIPv4 Entity Keys
*
* --- kSCPropNetIPv4ConfigMethod values ---
* kSCValNetPPPOnDemandPriorityHigh "High"
* kSCValNetPPPOnDemandPriorityLow "Low"
*
+ * kSCEntNetService Entity Keys
+ *
+ * kSCPropNetServicePrimaryRank "PrimaryRank" CFString
+ * kSCPropNetServiceUserDefinedName "UserDefinedName" CFString
+ *
+ * --- kSCPropNetServicePrimaryRank values ---
+ * kSCValNetServicePrimaryRankFirst "First"
+ * kSCValNetServicePrimaryRankLast "Last"
+ * kSCValNetServicePrimaryRankNever "Never"
+ *
* kSCCompSystem Properties
*
* kSCPropSystemComputerNameRegion "ComputerNameRegion" CFNumber
@group Network Entity Keys
*/
+/*!
+ @const kSCEntNetCommCenter
+ @availability Introduced in iPhone OS 2.0.
+ */
+extern const CFStringRef kSCEntNetCommCenter;
+
/*!
@const kSCEntNetEAPOL
@availability Introduced in Mac OS X 10.5.
*/
extern const CFStringRef kSCEntNetEAPOL;
+/*!
+ @const kSCEntNetOnDemand
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCEntNetOnDemand;
+
+/*!
+ @const kSCEntNetService
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCEntNetService;
+
/*!
@group kSCCompNetwork Properties
*/
*/
extern const CFStringRef kSCPropNetIgnoreLinkStatus;
+/*!
+ @group kSCEntNetCommCenter Entity Keys
+ */
+
+/*!
+ @const kSCPropNetCommCenterAllowNetworkAccess
+ @availability Introduced in iPhone OS 2.0.
+ */
+extern const CFStringRef kSCPropNetCommCenterAllowNetworkAccess;
+
+/*!
+ @const kSCPropNetCommCenterAvailable
+ @availability Introduced in iPhone OS 2.0.
+ */
+extern const CFStringRef kSCPropNetCommCenterAvailable;
+
+/*!
+ @group kSCEntNetIPSec Entity Keys
+ */
+
+/*!
+ @const kSCPropNetIPSecLastCause
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCPropNetIPSecLastCause;
+
+/*!
+ @const kSCPropNetIPSecOnDemandEnabled
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCPropNetIPSecOnDemandEnabled;
+
+/*!
+ @const kSCPropNetIPSecOnDemandMatchDomainsAlways
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCPropNetIPSecOnDemandMatchDomainsAlways;
+
+/*!
+ @const kSCPropNetIPSecOnDemandMatchDomainsOnRetry
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCPropNetIPSecOnDemandMatchDomainsOnRetry;
+
+/*!
+ @const kSCPropNetIPSecOnDemandMatchDomainsNever
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCPropNetIPSecOnDemandMatchDomainsNever;
+
/*!
@group kSCEntNetIPv4 Entity Keys
*/
*/
extern const CFStringRef kSCValNetPPPOnDemandPriorityLow;
+/*!
+ @group kSCEntNetService Entity Keys
+ */
+
+/*!
+ @const kSCPropNetServicePrimaryRank
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCPropNetServicePrimaryRank;
+
+/*!
+ @const kSCPropNetServiceUserDefinedName
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCPropNetServiceUserDefinedName;
+
+/*!
+ @const kSCValNetServicePrimaryRankFirst
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCValNetServicePrimaryRankFirst;
+
+/*!
+ @const kSCValNetServicePrimaryRankLast
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCValNetServicePrimaryRankLast;
+
+/*!
+ @const kSCValNetServicePrimaryRankNever
+ @availability Introduced in Mac OS X 10.6.
+ */
+extern const CFStringRef kSCValNetServicePrimaryRankNever;
+
/*!
@group kSCCompSystem Properties
*/
/* -------------------- Schema declarations -------------------- */
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPrefVirtualNetworkInterfaces, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPrefVirtualNetworkInterfaces, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPrefVirtualNetworkInterfaces \
SC_SCHEMA_KV(kSCPrefVirtualNetworkInterfaces \
,"VirtualNetworkInterfaces" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCEntNetEAPOL, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+
+ SC_SCHEMA_DECLARATION(kSCEntNetEAPOL, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCEntNetEAPOL \
SC_SCHEMA_KV(kSCEntNetEAPOL \
,"EAPOL" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetIgnoreLinkStatus, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
+ SC_SCHEMA_DECLARATION(kSCEntNetOnDemand, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 30000)/*SPI*/
+ #define kSCEntNetOnDemand \
+ SC_SCHEMA_KV(kSCEntNetOnDemand \
+ ,"OnDemand" \
+ ,CFDictionary )
#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+
+ SC_SCHEMA_DECLARATION(kSCEntNetService, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCEntNetService \
+ SC_SCHEMA_KV(kSCEntNetService \
+ ,"__SERVICE__" \
+ ,CFDictionary )
+#endif
+
+ SC_SCHEMA_DECLARATION(kSCPropNetIgnoreLinkStatus, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetIgnoreLinkStatus \
SC_SCHEMA_KV(kSCPropNetIgnoreLinkStatus \
,"IgnoreLinkStatus" \
,CFBoolean )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCValNetIPv4ConfigMethodFailover, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
+
+ SC_SCHEMA_DECLARATION(kSCPropNetIPSecLastCause, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 30000)/*SPI*/
+ #define kSCPropNetIPSecLastCause \
+ SC_SCHEMA_KV(kSCPropNetIPSecLastCause \
+ ,"LastCause" \
+ ,CFNumber )
+#endif
+
+ SC_SCHEMA_DECLARATION(kSCPropNetIPSecOnDemandEnabled, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 30000)/*SPI*/
+ #define kSCPropNetIPSecOnDemandEnabled \
+ SC_SCHEMA_KV(kSCPropNetIPSecOnDemandEnabled \
+ ,"OnDemandEnabled" \
+ ,CFNumber (0 or 1) )
+#endif
+
+ SC_SCHEMA_DECLARATION(kSCPropNetIPSecOnDemandMatchDomainsAlways, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 30000)/*SPI*/
+ #define kSCPropNetIPSecOnDemandMatchDomainsAlways \
+ SC_SCHEMA_KV(kSCPropNetIPSecOnDemandMatchDomainsAlways \
+ ,"OnDemandMatchDomainsAlways" \
+ ,CFArray[CFString] )
+#endif
+
+ SC_SCHEMA_DECLARATION(kSCPropNetIPSecOnDemandMatchDomainsOnRetry, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 30000)/*SPI*/
+ #define kSCPropNetIPSecOnDemandMatchDomainsOnRetry \
+ SC_SCHEMA_KV(kSCPropNetIPSecOnDemandMatchDomainsOnRetry \
+ ,"OnDemandMatchDomainsOnRetry" \
+ ,CFArray[CFString] )
#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+
+ SC_SCHEMA_DECLARATION(kSCPropNetIPSecOnDemandMatchDomainsNever, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 30000)/*SPI*/
+ #define kSCPropNetIPSecOnDemandMatchDomainsNever \
+ SC_SCHEMA_KV(kSCPropNetIPSecOnDemandMatchDomainsNever \
+ ,"OnDemandMatchDomainsNever" \
+ ,CFArray[CFString] )
+#endif
+
+ SC_SCHEMA_DECLARATION(kSCValNetIPv4ConfigMethodFailover, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetIPv4ConfigMethodFailover \
SC_SCHEMA_KV(kSCValNetIPv4ConfigMethodFailover \
,"Failover" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetPPPOnDemandDomains, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPOnDemandDomains, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPOnDemandDomains \
SC_SCHEMA_KV(kSCPropNetPPPOnDemandDomains \
,"OnDemandDomains" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetPPPOnDemandEnabled, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPOnDemandEnabled, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPOnDemandEnabled \
SC_SCHEMA_KV(kSCPropNetPPPOnDemandEnabled \
,"OnDemandEnabled" \
,CFNumber (0 or 1) )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetPPPOnDemandHostName, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPOnDemandHostName, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPOnDemandHostName \
SC_SCHEMA_KV(kSCPropNetPPPOnDemandHostName \
,"OnDemandHostName" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetPPPOnDemandMode, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPOnDemandMode, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPOnDemandMode \
SC_SCHEMA_KV(kSCPropNetPPPOnDemandMode \
,"OnDemandMode" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropNetPPPOnDemandPriority, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropNetPPPOnDemandPriority, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropNetPPPOnDemandPriority \
SC_SCHEMA_KV(kSCPropNetPPPOnDemandPriority \
,"OnDemandPriority" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCValNetPPPOnDemandModeAggressive, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCValNetPPPOnDemandModeAggressive, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetPPPOnDemandModeAggressive \
SC_SCHEMA_KV(kSCValNetPPPOnDemandModeAggressive \
,"Aggressive" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCValNetPPPOnDemandModeConservative, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCValNetPPPOnDemandModeConservative, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetPPPOnDemandModeConservative \
SC_SCHEMA_KV(kSCValNetPPPOnDemandModeConservative \
,"Conservative" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCValNetPPPOnDemandModeCompatible, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCValNetPPPOnDemandModeCompatible, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetPPPOnDemandModeCompatible \
SC_SCHEMA_KV(kSCValNetPPPOnDemandModeCompatible \
,"Compatible" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCValNetPPPOnDemandPriorityDefault, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCValNetPPPOnDemandPriorityDefault, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetPPPOnDemandPriorityDefault \
SC_SCHEMA_KV(kSCValNetPPPOnDemandPriorityDefault \
,"Default" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCValNetPPPOnDemandPriorityHigh, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCValNetPPPOnDemandPriorityHigh, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetPPPOnDemandPriorityHigh \
SC_SCHEMA_KV(kSCValNetPPPOnDemandPriorityHigh \
,"High" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCValNetPPPOnDemandPriorityLow, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCValNetPPPOnDemandPriorityLow, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCValNetPPPOnDemandPriorityLow \
SC_SCHEMA_KV(kSCValNetPPPOnDemandPriorityLow \
,"Low" \
, )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropSystemComputerNameRegion, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
+ SC_SCHEMA_DECLARATION(kSCPropNetServicePrimaryRank, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCPropNetServicePrimaryRank \
+ SC_SCHEMA_KV(kSCPropNetServicePrimaryRank \
+ ,"PrimaryRank" \
+ ,CFString )
+#endif
+
+ SC_SCHEMA_DECLARATION(kSCPropNetServiceUserDefinedName, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCPropNetServiceUserDefinedName \
+ SC_SCHEMA_KV(kSCPropNetServiceUserDefinedName \
+ ,"UserDefinedName" \
+ ,CFString )
+#endif
+
+ SC_SCHEMA_DECLARATION(kSCValNetServicePrimaryRankFirst, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCValNetServicePrimaryRankFirst \
+ SC_SCHEMA_KV(kSCValNetServicePrimaryRankFirst \
+ ,"First" \
+ , )
+#endif
+
+ SC_SCHEMA_DECLARATION(kSCValNetServicePrimaryRankLast, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCValNetServicePrimaryRankLast \
+ SC_SCHEMA_KV(kSCValNetServicePrimaryRankLast \
+ ,"Last" \
+ , )
+#endif
+
+ SC_SCHEMA_DECLARATION(kSCValNetServicePrimaryRankNever, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
+ #define kSCValNetServicePrimaryRankNever \
+ SC_SCHEMA_KV(kSCValNetServicePrimaryRankNever \
+ ,"Never" \
+ , )
#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+
+ SC_SCHEMA_DECLARATION(kSCPropSystemComputerNameRegion, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropSystemComputerNameRegion \
SC_SCHEMA_KV(kSCPropSystemComputerNameRegion \
,"ComputerNameRegion" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropSystemHostName, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropSystemHostName, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropSystemHostName \
SC_SCHEMA_KV(kSCPropSystemHostName \
,"HostName" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropVirtualNetworkInterfacesBondInterfaces, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+#if !TARGET_OS_IPHONE
+
+ SC_SCHEMA_DECLARATION(kSCPropVirtualNetworkInterfacesBondInterfaces, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropVirtualNetworkInterfacesBondInterfaces \
SC_SCHEMA_KV(kSCPropVirtualNetworkInterfacesBondInterfaces \
,"Interfaces" \
,CFArray[CFString] )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropVirtualNetworkInterfacesBondMode, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropVirtualNetworkInterfacesBondMode, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropVirtualNetworkInterfacesBondMode \
SC_SCHEMA_KV(kSCPropVirtualNetworkInterfacesBondMode \
,"Mode" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropVirtualNetworkInterfacesBondOptions, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropVirtualNetworkInterfacesBondOptions, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropVirtualNetworkInterfacesBondOptions \
SC_SCHEMA_KV(kSCPropVirtualNetworkInterfacesBondOptions \
,"Options" \
,CFDictionary )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropVirtualNetworkInterfacesVLANInterface, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropVirtualNetworkInterfacesVLANInterface, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropVirtualNetworkInterfacesVLANInterface \
SC_SCHEMA_KV(kSCPropVirtualNetworkInterfacesVLANInterface \
,"Interface" \
,CFString )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropVirtualNetworkInterfacesVLANTag, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropVirtualNetworkInterfacesVLANTag, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropVirtualNetworkInterfacesVLANTag \
SC_SCHEMA_KV(kSCPropVirtualNetworkInterfacesVLANTag \
,"Tag" \
,CFNumber )
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
- SC_SCHEMA_DECLARATION(kSCPropVirtualNetworkInterfacesVLANOptions, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)
-#endif
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ SC_SCHEMA_DECLARATION(kSCPropVirtualNetworkInterfacesVLANOptions, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/
#define kSCPropVirtualNetworkInterfacesVLANOptions \
SC_SCHEMA_KV(kSCPropVirtualNetworkInterfacesVLANOptions \
,"Options" \
,CFDictionary )
#endif
+#endif // !TARGET_OS_IPHONE
+
#endif /* _SCSCHEMADEFINITIONSPRIVATE_H */
/*
- * Copyright (c) 2000-2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2004, 2006, 2008, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#ifndef _SYSTEMCONFIGURATION_H
#define _SYSTEMCONFIGURATION_H
+#include <Availability.h>
#include <sys/cdefs.h>
#include <CoreFoundation/CoreFoundation.h>
@constant kSCStatusReachabilityUnknown
A determination could not be made regarding the reachability
of the specified nodename or address.
+ @constant kSCStatusConnectionNoService Network service for connection not available
*/
enum {
/*
/*
* SCNetwork error codes
*/
- kSCStatusReachabilityUnknown = 4001 /* Network reachability cannot be determined */
+ kSCStatusReachabilityUnknown = 4001, /* Network reachability cannot be determined */
+ /*
+ * SCNetworkConnection error codes
+ */
+#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)
+ kSCStatusConnectionNoService = 5001 /* Network service for connection not available */
+#endif
};
@discussion CFError domain associated with errors reported by
the SystemConfiguration.framework.
*/
-extern const CFStringRef kCFErrorDomainSystemConfiguration AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
+extern const CFStringRef kCFErrorDomainSystemConfiguration __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
__BEGIN_DECLS
as the result of calling a System Configuration framework API.
@result Returns the last error encountered.
*/
-CFErrorRef SCCopyLastError (void);
+CFErrorRef SCCopyLastError (void) __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0);
/*!
@function SCError
as the result of calling a System Configuration framework API.
@result Returns the last error encountered.
*/
-int SCError (void);
+int SCError (void) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0);
/*!
@function SCErrorString
@param status The SCDynamicStoreStatus to be returned.
@result Returns a pointer to the error message string.
*/
-const char * SCErrorString (int status);
+const char * SCErrorString (int status) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0);
__END_DECLS
/*
- * Copyright (c) 2003-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2003-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include <net/if_vlan_var.h>
#include <net/if_types.h>
-#include <SystemConfiguration/VLANConfiguration.h>
-
/* ---------- VLAN support ---------- */
static int
}
if (ok) {
+ SCNetworkInterfacePrivateRef newInterface;
+ CFTypeRef save;
+
// set physical interface
- if (interfacePrivate->vlan.interface != NULL)
- CFRelease(interfacePrivate->vlan.interface);
- interfacePrivate->vlan.interface = CFRetain(physical);
+ newInterface = __SCNetworkInterfaceCreateCopy(NULL,
+ physical,
+ interfacePrivate->prefs,
+ interfacePrivate->serviceID);
+ save = interfacePrivate->vlan.interface;
+ interfacePrivate->vlan.interface = (SCNetworkInterfaceRef)newInterface;
+ if (save != NULL) CFRelease(save);
// set tag
- if (interfacePrivate->vlan.tag != NULL)
- CFRelease(interfacePrivate->vlan.tag);
+ save = interfacePrivate->vlan.tag;
interfacePrivate->vlan.tag = CFRetain(tag);
+ if (save != NULL) CFRelease(save);
}
return ok;
return ok;
}
-
-
-#pragma mark -
-#pragma mark Deprecated SPIs (remove when no longer referenced)
-
-
-/* ---------- VLAN "device" ---------- */
-
-Boolean
-IsVLANSupported(CFStringRef device)
-{
- return __SCNetworkInterfaceSupportsVLAN(device);
-}
-
-/* ---------- VLANInterface ---------- */
-
-typedef struct {
-
- /* base CFType information */
- CFRuntimeBase cfBase;
-
- /* vlan interface configuration */
- CFStringRef ifname; // e.g. vlan0, vlan1, ...
- CFStringRef device; // e.g. en0, en1, ...
- CFNumberRef tag; // e.g. 1 <= tag <= 4094
- CFDictionaryRef options; // e.g. UserDefinedName
-
-} VLANInterfacePrivate, * VLANInterfacePrivateRef;
-
-
-static CFStringRef __VLANInterfaceCopyDescription (CFTypeRef cf);
-static void __VLANInterfaceDeallocate (CFTypeRef cf);
-static Boolean __VLANInterfaceEqual (CFTypeRef cf1, CFTypeRef cf2);
-
-
-static const CFRuntimeClass __VLANInterfaceClass = {
- 0, // version
- "VLANInterface", // className
- NULL, // init
- NULL, // copy
- __VLANInterfaceDeallocate, // dealloc
- __VLANInterfaceEqual, // equal
- NULL, // hash
- NULL, // copyFormattingDesc
- __VLANInterfaceCopyDescription // copyDebugDesc
-};
-
-
-static CFTypeID __kVLANInterfaceTypeID = _kCFRuntimeNotATypeID;
-
-
-static pthread_once_t vlanInterface_init = PTHREAD_ONCE_INIT;
-
-
-static CFStringRef
-__VLANInterfaceCopyDescription(CFTypeRef cf)
-{
- CFAllocatorRef allocator = CFGetAllocator(cf);
- CFMutableStringRef result;
- VLANInterfacePrivateRef vlanPrivate = (VLANInterfacePrivateRef)cf;
-
- result = CFStringCreateMutable(allocator, 0);
- CFStringAppendFormat(result, NULL, CFSTR("<VLANInterface %p [%p]> {"), cf, allocator);
- CFStringAppendFormat(result, NULL, CFSTR("if = %@"), vlanPrivate->ifname);
- CFStringAppendFormat(result, NULL, CFSTR(", device = %@"), vlanPrivate->device);
- CFStringAppendFormat(result, NULL, CFSTR(", tag = %@"), vlanPrivate->tag);
- if (vlanPrivate->options != NULL) {
- CFStringAppendFormat(result, NULL, CFSTR(", options = %@"), vlanPrivate->options);
- }
- CFStringAppendFormat(result, NULL, CFSTR("}"));
-
- return result;
-}
-
-
-static void
-__VLANInterfaceDeallocate(CFTypeRef cf)
-{
- VLANInterfacePrivateRef vlanPrivate = (VLANInterfacePrivateRef)cf;
-
- /* release resources */
-
- CFRelease(vlanPrivate->ifname);
- CFRelease(vlanPrivate->device);
- CFRelease(vlanPrivate->tag);
- if (vlanPrivate->options) CFRelease(vlanPrivate->options);
-
- return;
-}
-
-
-static Boolean
-__VLANInterfaceEquiv(CFTypeRef cf1, CFTypeRef cf2)
-{
- VLANInterfacePrivateRef vlan1 = (VLANInterfacePrivateRef)cf1;
- VLANInterfacePrivateRef vlan2 = (VLANInterfacePrivateRef)cf2;
-
- if (vlan1 == vlan2)
- return TRUE;
-
- if (!CFEqual(vlan1->ifname, vlan2->ifname))
- return FALSE; // if not the same interface
-
- if (!CFEqual(vlan1->device, vlan2->device))
- return FALSE; // if not the same device
-
- if (!CFEqual(vlan1->tag, vlan2->tag))
- return FALSE; // if not the same tag
-
- return TRUE;
-}
-
-
-static Boolean
-__VLANInterfaceEqual(CFTypeRef cf1, CFTypeRef cf2)
-{
- VLANInterfacePrivateRef vlan1 = (VLANInterfacePrivateRef)cf1;
- VLANInterfacePrivateRef vlan2 = (VLANInterfacePrivateRef)cf2;
-
- if (!__VLANInterfaceEquiv(vlan1, vlan2))
- return FALSE; // if not the same VLAN interface/device/tag
-
- if (vlan1->options != vlan2->options) {
- // if the options may differ
- if ((vlan1->options != NULL) && (vlan2->options != NULL)) {
- // if both VLANs have options
- if (!CFEqual(vlan1->options, vlan2->options)) {
- // if the options are not equal
- return FALSE;
- }
- } else {
- // if only one VLAN has options
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-
-static void
-__VLANInterfaceInitialize(void)
-{
- __kVLANInterfaceTypeID = _CFRuntimeRegisterClass(&__VLANInterfaceClass);
- return;
-}
-
-
-static __inline__ CFTypeRef
-isA_VLANInterface(CFTypeRef obj)
-{
- return (isA_CFType(obj, VLANInterfaceGetTypeID()));
-}
-
-
-CFTypeID
-VLANInterfaceGetTypeID(void)
-{
- pthread_once(&vlanInterface_init, __VLANInterfaceInitialize); /* initialize runtime */
- return __kVLANInterfaceTypeID;
-}
-
-
-static VLANInterfaceRef
-__VLANInterfaceCreatePrivate(CFAllocatorRef allocator,
- CFStringRef ifname,
- CFStringRef device,
- CFNumberRef tag,
- CFDictionaryRef options)
-{
- VLANInterfacePrivateRef vlanPrivate;
- uint32_t size;
-
- /* initialize runtime */
- pthread_once(&vlanInterface_init, __VLANInterfaceInitialize);
-
- /* allocate vlan */
- size = sizeof(VLANInterfacePrivate) - sizeof(CFRuntimeBase);
- vlanPrivate = (VLANInterfacePrivateRef)_CFRuntimeCreateInstance(allocator,
- __kVLANInterfaceTypeID,
- size,
- NULL);
- if (!vlanPrivate) {
- return NULL;
- }
-
- /* establish the vlan */
-
- vlanPrivate->ifname = CFStringCreateCopy(allocator, ifname);
- vlanPrivate->device = CFStringCreateCopy(allocator, device);
- vlanPrivate->tag = CFRetain(tag);
- if (options != NULL) {
- vlanPrivate->options = CFDictionaryCreateCopy(allocator, options);
- } else {
- vlanPrivate->options = NULL;
- }
-
- return (VLANInterfaceRef)vlanPrivate;
-}
-
-
-CFStringRef
-VLANInterfaceGetInterface(VLANInterfaceRef vlan)
-{
- VLANInterfacePrivateRef vlanPrivate = (VLANInterfacePrivateRef)vlan;
- CFStringRef vlan_if = NULL;
-
- if (isA_VLANInterface(vlan)) {
- vlan_if = vlanPrivate->ifname;
- }
-
- return vlan_if;
-}
-
-
-CFStringRef
-VLANInterfaceGetDevice(VLANInterfaceRef vlan)
-{
- VLANInterfacePrivateRef vlanPrivate = (VLANInterfacePrivateRef)vlan;
- CFStringRef vlan_device = NULL;
-
- if (isA_VLANInterface(vlan)) {
- vlan_device = vlanPrivate->device;
- }
-
- return vlan_device;
-}
-
-
-static void
-VLANInterfaceSetDevice(VLANInterfaceRef vlan, CFStringRef newDevice)
-{
- VLANInterfacePrivateRef vlanPrivate = (VLANInterfacePrivateRef)vlan;
-
- if (isA_VLANInterface(vlan)) {
- CFAllocatorRef allocator = CFGetAllocator(vlan);
-
- CFRelease(vlanPrivate->device);
- vlanPrivate->device = CFStringCreateCopy(allocator, newDevice);
- }
-
- return;
-}
-
-
-CFNumberRef
-VLANInterfaceGetTag(VLANInterfaceRef vlan)
-{
- VLANInterfacePrivateRef vlanPrivate = (VLANInterfacePrivateRef)vlan;
- CFNumberRef vlan_tag = NULL;
-
- if (isA_VLANInterface(vlan)) {
- vlan_tag = vlanPrivate->tag;
- }
-
- return vlan_tag;
-}
-
-
-static void
-VLANInterfaceSetTag(VLANInterfaceRef vlan, CFNumberRef newTag)
-{
- VLANInterfacePrivateRef vlanPrivate = (VLANInterfacePrivateRef)vlan;
-
- if (isA_VLANInterface(vlan)) {
- CFRelease(vlanPrivate->tag);
- vlanPrivate->tag = CFRetain(newTag);
- }
-
- return;
-}
-
-
-CFDictionaryRef
-VLANInterfaceGetOptions(VLANInterfaceRef vlan)
-{
- VLANInterfacePrivateRef vlanPrivate = (VLANInterfacePrivateRef)vlan;
- CFDictionaryRef vlan_options = NULL;
-
- if (isA_VLANInterface(vlan)) {
- vlan_options = vlanPrivate->options;
- }
-
- return vlan_options;
-}
-
-
-static void
-VLANInterfaceSetOptions(VLANInterfaceRef vlan, CFDictionaryRef newOptions)
-{
- VLANInterfacePrivateRef vlanPrivate = (VLANInterfacePrivateRef)vlan;
-
- if (isA_VLANInterface(vlan)) {
- CFAllocatorRef allocator = CFGetAllocator(vlan);
-
- if (vlanPrivate->options) CFRelease(vlanPrivate->options);
- if (newOptions != NULL) {
- vlanPrivate->options = CFDictionaryCreateCopy(allocator, newOptions);
- } else {
- vlanPrivate->options = NULL;
- }
- }
-
- return;
-}
-
-
-/* ---------- VLANPreferences ---------- */
-
-typedef struct {
-
- /* base CFType information */
- CFRuntimeBase cfBase;
-
- /* lock */
- pthread_mutex_t lock;
-
- /* underlying preferences */
- SCPreferencesRef prefs;
-
- /* base VLANs (before any commits) */
- CFArrayRef vlBase;
-
-} VLANPreferencesPrivate, * VLANPreferencesPrivateRef;
-
-
-static CFStringRef __VLANPreferencesCopyDescription (CFTypeRef cf);
-static void __VLANPreferencesDeallocate (CFTypeRef cf);
-
-
-static const CFRuntimeClass __VLANPreferencesClass = {
- 0, // version
- "VLANPreferences", // className
- NULL, // init
- NULL, // copy
- __VLANPreferencesDeallocate, // dealloc
- NULL, // equal
- NULL, // hash
- NULL, // copyFormattingDesc
- __VLANPreferencesCopyDescription // copyDebugDesc
-};
-
-
-static CFTypeID __kVLANPreferencesTypeID = _kCFRuntimeNotATypeID;
-
-
-static pthread_once_t vlanPreferences_init = PTHREAD_ONCE_INIT;
-
-
-static CFStringRef
-__VLANPreferencesCopyDescription(CFTypeRef cf)
-{
- CFAllocatorRef allocator = CFGetAllocator(cf);
- CFIndex i;
- CFArrayRef keys;
- CFIndex n;
- VLANPreferencesPrivateRef prefsPrivate = (VLANPreferencesPrivateRef)cf;
- CFMutableStringRef result;
-
- result = CFStringCreateMutable(allocator, 0);
- CFStringAppendFormat(result, NULL, CFSTR("<VLANPreferences %p [%p]> {"), cf, allocator);
-
- keys = SCPreferencesCopyKeyList(prefsPrivate->prefs);
- n = CFArrayGetCount(keys);
- for (i = 0; i < n; i++) {
- CFStringRef key;
- CFPropertyListRef val;
-
- key = CFArrayGetValueAtIndex(keys, i);
- val = SCPreferencesGetValue(prefsPrivate->prefs, key);
-
- CFStringAppendFormat(result, NULL, CFSTR("%@ : %@"), key, val);
- }
- CFRelease(keys);
-
- CFStringAppendFormat(result, NULL, CFSTR(" }"));
-
- return result;
-}
-
-
-#define N_QUICK 8
-
-
-static void
-__VLANPreferencesDeallocate(CFTypeRef cf)
-{
- VLANPreferencesPrivateRef prefsPrivate = (VLANPreferencesPrivateRef)cf;
-
- /* release resources */
-
- pthread_mutex_destroy(&prefsPrivate->lock);
-
- if (prefsPrivate->prefs) CFRelease(prefsPrivate->prefs);
- if (prefsPrivate->vlBase) CFRelease(prefsPrivate->vlBase);
-
- return;
-}
-
-
-static void
-__VLANPreferencesInitialize(void)
-{
- __kVLANPreferencesTypeID = _CFRuntimeRegisterClass(&__VLANPreferencesClass);
- return;
-}
-
-
-static __inline__ CFTypeRef
-isA_VLANPreferences(CFTypeRef obj)
-{
- return (isA_CFType(obj, VLANPreferencesGetTypeID()));
-}
-
-
-CFArrayRef
-_VLANPreferencesCopyActiveInterfaces()
-{
- CFArrayCallBacks callbacks;
- struct ifaddrs *ifap;
- struct ifaddrs *ifp;
- int s;
- CFMutableArrayRef vlans = NULL;
-
- if (getifaddrs(&ifap) == -1) {
- SCLog(TRUE, LOG_ERR, CFSTR("getifaddrs() failed: %s"), strerror(errno));
- _SCErrorSet(kSCStatusFailed);
- return NULL;
- }
-
- s = inet_dgram_socket();
- if (s == -1) {
- _SCErrorSet(errno);
- goto done;
- }
-
- callbacks = kCFTypeArrayCallBacks;
- callbacks.equal = __VLANInterfaceEquiv;
- vlans = CFArrayCreateMutable(NULL, 0, &callbacks);
-
- for (ifp = ifap; ifp != NULL; ifp = ifp->ifa_next) {
- switch (ifp->ifa_addr->sa_family) {
- case AF_LINK : {
- CFStringRef device;
- struct if_data *if_data;
- struct ifreq ifr;
- CFNumberRef tag;
- VLANInterfaceRef vlan;
- CFStringRef vlan_if;
- char vlr_parent[IFNAMSIZ + 1];
- int vlr_tag;
- struct vlanreq vreq;
-
- if_data = (struct if_data *)ifp->ifa_data;
- if (if_data == NULL) {
- break; // if no interface data
- }
-
- if (if_data->ifi_type != IFT_L2VLAN) {
- break; // if not VLAN
- }
-
- bzero(&ifr, sizeof(ifr));
- bzero(&vreq, sizeof(vreq));
- strncpy(ifr.ifr_name, ifp->ifa_name, sizeof(ifr.ifr_name));
- ifr.ifr_data = (caddr_t)&vreq;
-
- if (ioctl(s, SIOCGIFVLAN, (caddr_t)&ifr) == -1) {
- SCLog(TRUE, LOG_ERR, CFSTR("ioctl() failed: %s"), strerror(errno));
- CFRelease(vlans);
- vlans = NULL;
- _SCErrorSet(kSCStatusFailed);
- goto done;
- }
- vlr_tag = vreq.vlr_tag;
- bzero(&vlr_parent, sizeof(vlr_parent));
- bcopy(vreq.vlr_parent, vlr_parent, IFNAMSIZ);
-
- vlan_if = CFStringCreateWithCString(NULL, ifp->ifa_name, kCFStringEncodingASCII);
- device = CFStringCreateWithCString(NULL, vlr_parent, kCFStringEncodingASCII);
- tag = CFNumberCreate(NULL, kCFNumberIntType, &vlr_tag);
- vlan = __VLANInterfaceCreatePrivate(NULL, vlan_if, device, tag, NULL);
- CFArrayAppendValue(vlans, vlan);
- CFRelease(vlan_if);
- CFRelease(device);
- CFRelease(tag);
- CFRelease(vlan);
- break;
- }
-
- default :
- break;
- }
- }
-
- done :
-
- (void) close(s);
- freeifaddrs(ifap);
- return vlans;
-}
-
-
-static CFIndex
-findVLAN(CFArrayRef vlans, CFStringRef device, CFNumberRef tag)
-{
- CFIndex found = kCFNotFound;
- CFIndex i;
- CFIndex n;
-
- n = isA_CFArray(vlans) ? CFArrayGetCount(vlans) : 0;
- for (i = 0; i < n; i++) {
- CFDictionaryRef vlan_dict;
- CFStringRef vlan_device;
- CFStringRef vlan_if;
- CFNumberRef vlan_tag;
-
- vlan_dict = CFArrayGetValueAtIndex(vlans, i);
- if (!isA_CFDictionary(vlan_dict)) {
- continue; // if the prefs are confused
- }
-
- vlan_if = CFDictionaryGetValue(vlan_dict, __kVLANInterface_interface);
- if (!isA_CFString(vlan_if)) {
- continue; // if the prefs are confused
- }
-
- vlan_device = CFDictionaryGetValue(vlan_dict, __kVLANInterface_device);
- if (isA_CFString(vlan_device)) {
- if (!CFEqual(device, vlan_device)) {
- continue; // if not a match
- }
- }
-
- vlan_tag = CFDictionaryGetValue(vlan_dict, __kVLANInterface_tag);
- if (isA_CFNumber(vlan_tag)) {
- if (!CFEqual(tag, vlan_tag)) {
- continue; // if not a match
- }
- }
-
- // if we have found a match
- found = i;
- break;
- }
-
- return found;
-}
-
-
-static void
-setConfigurationChanged(VLANPreferencesRef prefs)
-{
- VLANPreferencesPrivateRef prefsPrivate = (VLANPreferencesPrivateRef)prefs;
-
- /*
- * to facilitate device configuration we will take
- * a snapshot of the VLAN preferences before any
- * changes are made. Then, when the changes are
- * applied we can compare what we had to what we
- * want and configured the system accordingly.
- */
- if (prefsPrivate->vlBase == NULL) {
- prefsPrivate->vlBase = VLANPreferencesCopyInterfaces(prefs);
- }
-
- return;
-}
-
-
-CFTypeID
-VLANPreferencesGetTypeID(void)
-{
- pthread_once(&vlanPreferences_init, __VLANPreferencesInitialize); /* initialize runtime */
- return __kVLANPreferencesTypeID;
-}
-
-
-VLANPreferencesRef
-VLANPreferencesCreate(CFAllocatorRef allocator)
-{
- CFBundleRef bundle;
- CFStringRef bundleID = NULL;
- CFStringRef name = CFSTR("VLANConfiguration");
- VLANPreferencesPrivateRef prefsPrivate;
- uint32_t size;
-
- /* initialize runtime */
- pthread_once(&vlanPreferences_init, __VLANPreferencesInitialize);
-
- /* allocate preferences */
- size = sizeof(VLANPreferencesPrivate) - sizeof(CFRuntimeBase);
- prefsPrivate = (VLANPreferencesPrivateRef)_CFRuntimeCreateInstance(allocator,
- __kVLANPreferencesTypeID,
- size,
- NULL);
- if (prefsPrivate == NULL) {
- return NULL;
- }
-
- /* establish the prefs */
-
- pthread_mutex_init(&prefsPrivate->lock, NULL);
-
- bundle = CFBundleGetMainBundle();
- if (bundle) {
- bundleID = CFBundleGetIdentifier(bundle);
- if (bundleID) {
- CFRetain(bundleID);
- } else {
- CFURLRef url;
-
- url = CFBundleCopyExecutableURL(bundle);
- if (url) {
- bundleID = CFURLCopyPath(url);
- CFRelease(url);
- }
- }
- }
-
- if (bundleID) {
- CFStringRef fullName;
-
- if (CFEqual(bundleID, CFSTR("/"))) {
- CFRelease(bundleID);
- bundleID = CFStringCreateWithFormat(allocator, NULL, CFSTR("(%d)"), getpid());
- }
-
- fullName = CFStringCreateWithFormat(allocator, NULL, CFSTR("%@:%@"), bundleID, name);
- name = fullName;
- CFRelease(bundleID);
- } else {
- CFRetain(name);
- }
-
- prefsPrivate->prefs = SCPreferencesCreate(allocator, name, VLAN_PREFERENCES_ID);
- CFRelease(name);
-
- prefsPrivate->vlBase = NULL;
-
- return (VLANPreferencesRef)prefsPrivate;
-}
-
-
-CFArrayRef
-VLANPreferencesCopyInterfaces(VLANPreferencesRef prefs)
-{
- CFAllocatorRef allocator;
- CFArrayCallBacks callbacks;
- CFIndex i;
- CFIndex n;
- VLANPreferencesPrivateRef prefsPrivate = (VLANPreferencesPrivateRef)prefs;
- CFMutableArrayRef result;
- CFArrayRef vlans;
-
- if (!isA_VLANPreferences(prefs)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return NULL;
- }
-
- allocator = CFGetAllocator(prefs);
- callbacks = kCFTypeArrayCallBacks;
- callbacks.equal = __VLANInterfaceEquiv;
- result = CFArrayCreateMutable(allocator, 0, &callbacks);
-
- vlans = SCPreferencesGetValue(prefsPrivate->prefs, VLAN_PREFERENCES_VLANS);
- n = isA_CFArray(vlans) ? CFArrayGetCount(vlans) : 0;
- for (i = 0; i < n; i++) {
- CFDictionaryRef vlan_dict;
- CFStringRef device;
- CFDictionaryRef options;
- CFNumberRef tag;
- VLANInterfaceRef vlan;
- CFStringRef vlan_if;
-
- vlan_dict = CFArrayGetValueAtIndex(vlans, i);
- if (!isA_CFDictionary(vlan_dict)) {
- continue; // if the prefs are confused
- }
-
- vlan_if = CFDictionaryGetValue(vlan_dict, __kVLANInterface_interface);
- if (!isA_CFString(vlan_if)) {
- continue; // if the prefs are confused
- }
-
-
- device = CFDictionaryGetValue(vlan_dict, __kVLANInterface_device);
- if (!isA_CFString(device)) {
- continue; // if the prefs are confused
- }
-
- tag = CFDictionaryGetValue(vlan_dict, __kVLANInterface_tag);
- if (!isA_CFNumber(tag)) {
- continue; // if the prefs are confused
- }
-
- options = CFDictionaryGetValue(vlan_dict, __kVLANInterface_options);
- if ((options != NULL) && !isA_CFDictionary(options)) {
- continue; // if the prefs are confused
- }
-
- vlan = __VLANInterfaceCreatePrivate(allocator, vlan_if, device, tag, options);
- CFArrayAppendValue(result, vlan);
- CFRelease(vlan);
- }
-
- return result;
-}
-
-
-VLANInterfaceRef
-VLANPreferencesAddInterface(VLANPreferencesRef prefs,
- CFStringRef device,
- CFNumberRef tag,
- CFDictionaryRef options)
-{
- CFArrayRef active_vlans;
- CFAllocatorRef allocator;
- CFArrayRef config_vlans;
- CFIndex dup_if;
- CFIndex i;
- CFIndex nActive;
- CFIndex nConfig;
- VLANInterfaceRef newVlan = NULL;
- VLANPreferencesPrivateRef prefsPrivate = (VLANPreferencesPrivateRef)prefs;
-
- if (!isA_VLANPreferences(prefs)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return NULL;
- }
-
- if (!isA_CFString(device)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return NULL;
- }
-
- if (isA_CFNumber(tag)) {
- int tag_val;
-
- CFNumberGetValue(tag, kCFNumberIntType, &tag_val);
- if ((tag_val < 1) || (tag_val > 4094)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return NULL;
- }
- } else {
- _SCErrorSet(kSCStatusInvalidArgument);
- return NULL;
- }
-
- if ((options != NULL) && !isA_CFDictionary(options)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return NULL;
- }
-
- pthread_mutex_lock(&prefsPrivate->lock);
-
- /* get "configured" VLANs (and check to ensure we are not creating a duplicate) */
- config_vlans = SCPreferencesGetValue(prefsPrivate->prefs, VLAN_PREFERENCES_VLANS);
- nConfig = isA_CFArray(config_vlans) ? CFArrayGetCount(config_vlans) : 0;
-
- dup_if = findVLAN(config_vlans, device, tag);
- if (dup_if != kCFNotFound) {
- // sorry, you can't add a vlan using the same device/tag */
- _SCErrorSet(kSCStatusKeyExists);
- goto done;
- }
-
- /* get "active" VLANs */
- active_vlans = _VLANPreferencesCopyActiveInterfaces();
- nActive = isA_CFArray(active_vlans) ? CFArrayGetCount(active_vlans) : 0;
-
- /* create a new vlan using an unused interface name */
- allocator = CFGetAllocator(prefs);
-
- for (i = 0; newVlan == NULL; i++) {
- CFIndex j;
- CFMutableDictionaryRef newDict;
- CFMutableArrayRef newVlans;
- CFStringRef vlan_if;
-
- vlan_if = CFStringCreateWithFormat(allocator, NULL, CFSTR("vlan%d"), i);
-
- for (j = 0; j < nActive; j++) {
- CFStringRef active_if;
- VLANInterfaceRef active_vlan;
-
- active_vlan = CFArrayGetValueAtIndex(active_vlans, j);
- active_if = VLANInterfaceGetInterface(active_vlan);
-
- if (CFEqual(vlan_if, active_if)) {
- goto next_if; // if VLAN interface name not available
- }
- }
-
- for (j = 0; j < nConfig; j++) {
- CFDictionaryRef config;
- CFStringRef config_if;
-
- config = CFArrayGetValueAtIndex(config_vlans, j);
- if (!isA_CFDictionary(config)) {
- continue; // if the prefs are confused
- }
-
- config_if = CFDictionaryGetValue(config, __kVLANInterface_interface);
- if (!isA_CFString(config_if)) {
- continue; // if the prefs are confused
- }
-
- if (CFEqual(vlan_if, config_if)) {
- goto next_if; // if VLAN interface name not available
- }
- }
-
- /* create the vlan */
-
- newDict = CFDictionaryCreateMutable(allocator,
- 0,
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
- CFDictionaryAddValue(newDict, __kVLANInterface_interface, vlan_if);
- CFDictionaryAddValue(newDict, __kVLANInterface_device, device);
- CFDictionaryAddValue(newDict, __kVLANInterface_tag, tag);
- if (options != NULL) {
- CFDictionaryAddValue(newDict, __kVLANInterface_options, options);
- }
-
- /* create the accessor handle to be returned */
-
- newVlan = __VLANInterfaceCreatePrivate(allocator, vlan_if, device, tag, options);
-
- /* yes, we're going to be changing the configuration */
- setConfigurationChanged(prefs);
-
- /* save in the prefs */
-
- if (nConfig == 0) {
- newVlans = CFArrayCreateMutable(allocator, 0, &kCFTypeArrayCallBacks);
- } else {
- newVlans = CFArrayCreateMutableCopy(allocator, 0, config_vlans);
- }
- CFArrayAppendValue(newVlans, newDict);
- CFRelease(newDict);
-
- (void) SCPreferencesSetValue(prefsPrivate->prefs, VLAN_PREFERENCES_VLANS, newVlans);
- CFRelease(newVlans);
-
- next_if :
- CFRelease(vlan_if);
- }
-
- CFRelease(active_vlans);
-
- done :
-
- pthread_mutex_unlock(&prefsPrivate->lock);
-
- return (VLANInterfaceRef) newVlan;
-}
-
-
-Boolean
-VLANPreferencesUpdateInterface(VLANPreferencesRef prefs,
- VLANInterfaceRef vlan,
- CFStringRef newDevice,
- CFNumberRef newTag,
- CFDictionaryRef newOptions)
-{
- CFAllocatorRef allocator;
- CFIndex cur_if;
- CFIndex dup_if;
- CFMutableDictionaryRef newDict;
- CFMutableArrayRef newVlans;
- Boolean ok = FALSE;
- VLANPreferencesPrivateRef prefsPrivate = (VLANPreferencesPrivateRef)prefs;
- CFArrayRef vlans;
- CFStringRef vlan_if;
-
- if (!isA_VLANPreferences(prefs)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- if (!isA_VLANInterface(vlan)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- if ((newDevice != NULL) && !isA_CFString(newDevice)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- if (newTag != NULL) {
- if (isA_CFNumber(newTag)) {
- int tag_val;
-
- CFNumberGetValue(newTag, kCFNumberIntType, &tag_val);
- if ((tag_val < 1) || (tag_val > 4094)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
- } else {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
- }
-
- if ((newOptions != NULL)
- && !isA_CFDictionary(newOptions) && (newOptions != (CFDictionaryRef)kCFNull)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- pthread_mutex_lock(&prefsPrivate->lock);
-
- vlan_if = VLANInterfaceGetInterface(vlan);
-
- vlans = SCPreferencesGetValue(prefsPrivate->prefs, VLAN_PREFERENCES_VLANS);
- if (!isA_CFArray(vlans)) {
- goto done; // if the prefs are confused
- }
-
- cur_if = findVLAN(vlans,
- VLANInterfaceGetDevice(vlan),
- VLANInterfaceGetTag (vlan));
- if (cur_if == kCFNotFound) {
- _SCErrorSet(kSCStatusNoKey);
- goto done;
- }
-
- dup_if = findVLAN(vlans,
- newDevice != NULL ? newDevice : VLANInterfaceGetDevice(vlan),
- newTag != NULL ? newTag : VLANInterfaceGetTag (vlan));
- if (dup_if != kCFNotFound) {
- // if the same device/tag has already been defined
- if (cur_if != dup_if) {
- /*
- * sorry, you can't update another vlan that is using
- * the same device/tag
- */
- _SCErrorSet(kSCStatusKeyExists);
- goto done;
- }
- }
-
- /* update the vlan */
-
- if (newDevice != NULL) {
- VLANInterfaceSetDevice(vlan, newDevice);
- } else {
- newDevice = VLANInterfaceGetDevice(vlan);
- }
-
- if (newTag != NULL) {
- VLANInterfaceSetTag(vlan, newTag);
- } else {
- newTag = VLANInterfaceGetTag(vlan);
- }
-
- if (newOptions != NULL) {
- if (newOptions != (CFDictionaryRef)kCFNull) {
- VLANInterfaceSetOptions(vlan, newOptions);
- } else {
- VLANInterfaceSetOptions(vlan, NULL);
- newOptions = NULL;
- }
- } else {
- newOptions = VLANInterfaceGetOptions(vlan);
- }
-
- /* update the prefs */
-
- allocator = CFGetAllocator(prefs);
- newDict = CFDictionaryCreateMutable(allocator,
- 0,
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
- CFDictionaryAddValue(newDict, __kVLANInterface_interface, vlan_if);
- CFDictionaryAddValue(newDict, __kVLANInterface_device, newDevice);
- CFDictionaryAddValue(newDict, __kVLANInterface_tag, newTag);
- if (newOptions != NULL) {
- CFDictionaryAddValue(newDict, __kVLANInterface_options, newOptions);
- }
-
- /* yes, we're going to be changing the configuration */
- setConfigurationChanged(prefs);
-
- /* update the prefs */
-
- newVlans = CFArrayCreateMutableCopy(allocator, 0, vlans);
- CFArraySetValueAtIndex(newVlans, cur_if, newDict);
- CFRelease(newDict);
-
- (void) SCPreferencesSetValue(prefsPrivate->prefs, VLAN_PREFERENCES_VLANS, newVlans);
- CFRelease(newVlans);
-
- ok = TRUE;
-
- done :
-
- pthread_mutex_unlock(&prefsPrivate->lock);
-
- return ok;
-}
-
-
-Boolean
-VLANPreferencesRemoveInterface(VLANPreferencesRef prefs,
- VLANInterfaceRef vlan)
-{
- CFAllocatorRef allocator;
- CFIndex cur_if;
- CFMutableArrayRef newVlans;
- Boolean ok = FALSE;
- VLANPreferencesPrivateRef prefsPrivate = (VLANPreferencesPrivateRef)prefs;
- CFArrayRef vlans;
-
- if (!isA_VLANPreferences(prefs)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- if (!isA_VLANInterface(vlan)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- pthread_mutex_lock(&prefsPrivate->lock);
-
- vlans = SCPreferencesGetValue(prefsPrivate->prefs, VLAN_PREFERENCES_VLANS);
- if (!isA_CFArray(vlans)) {
- _SCErrorSet(kSCStatusNoKey);
- goto done; // if the prefs are confused
- }
-
- cur_if = findVLAN(vlans,
- VLANInterfaceGetDevice(vlan),
- VLANInterfaceGetTag (vlan));
- if (cur_if == kCFNotFound) {
- _SCErrorSet(kSCStatusNoKey);
- goto done;
- }
-
- /* yes, we're going to be changing the configuration */
- setConfigurationChanged(prefs);
-
- /* remove the vlan */
-
- allocator = CFGetAllocator(prefs);
- newVlans = CFArrayCreateMutableCopy(allocator, 0, vlans);
- CFArrayRemoveValueAtIndex(newVlans, cur_if);
-
- (void) SCPreferencesSetValue(prefsPrivate->prefs, VLAN_PREFERENCES_VLANS, newVlans);
- CFRelease(newVlans);
-
- ok = TRUE;
-
- done :
-
- pthread_mutex_unlock(&prefsPrivate->lock);
-
- return ok;
-}
-
-
-Boolean
-VLANPreferencesCommitChanges(VLANPreferencesRef prefs)
-{
- Boolean ok = FALSE;
- VLANPreferencesPrivateRef prefsPrivate = (VLANPreferencesPrivateRef)prefs;
-
- if (!isA_VLANPreferences(prefs)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- ok = SCPreferencesCommitChanges(prefsPrivate->prefs);
- if (!ok) {
- return ok;
- }
-
- if (prefsPrivate->vlBase != NULL) {
- CFRelease(prefsPrivate->vlBase);
- prefsPrivate->vlBase = NULL;
- }
-
- return TRUE;
-}
-
-
-Boolean
-_VLANPreferencesUpdateConfiguration(VLANPreferencesRef prefs)
-{
- return TRUE;
-}
-
-
-Boolean
-VLANPreferencesApplyChanges(VLANPreferencesRef prefs)
-{
- SCPreferencesRef defaultPrefs;
- Boolean ok = FALSE;
- VLANPreferencesPrivateRef prefsPrivate = (VLANPreferencesPrivateRef)prefs;
-
- if (!isA_VLANPreferences(prefs)) {
- _SCErrorSet(kSCStatusInvalidArgument);
- return FALSE;
- }
-
- pthread_mutex_lock(&prefsPrivate->lock);
-
- /* apply the preferences */
- ok = SCPreferencesApplyChanges(prefsPrivate->prefs);
- if (!ok) {
- goto done;
- }
-
- /* apply the VLAN configuration */
- defaultPrefs = SCPreferencesCreate(NULL, CFSTR("VLANPreferencesApplyChanges"), NULL);
- {
- /*
- * Note: In an ideal world, we'd simply call SCPreferencesApplyChanges()
- * Unfortunately, it's possible that the caller (e.g NetworkCfgTool)
- * is holding the lock on the default prefs and since "Apply" attempts
- * to grab the lock we could end up in a deadlock situation.
- */
-#include "SCPreferencesInternal.h"
- SCPreferencesPrivateRef defaultPrefsPrivate;
-
- defaultPrefsPrivate = (SCPreferencesPrivateRef)defaultPrefs;
-
- pthread_mutex_lock(&defaultPrefsPrivate->lock);
- if (defaultPrefsPrivate->session == NULL) {
- __SCPreferencesAddSession(defaultPrefs);
- }
- pthread_mutex_unlock(&defaultPrefsPrivate->lock);
-
- ok = SCDynamicStoreNotifyValue(defaultPrefsPrivate->session, defaultPrefsPrivate->sessionKeyApply);
- }
- CFRelease(defaultPrefs);
- if (!ok) {
- goto done;
- }
-
- done :
-
- pthread_mutex_unlock(&prefsPrivate->lock);
-
- return ok;
-}
+++ /dev/null
-/*
- * Copyright (c) 2003-2006 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-
-#ifndef _VLANCONFIGURATION_H
-#define _VLANCONFIGURATION_H
-
-#include <AvailabilityMacros.h>
-#include <sys/cdefs.h>
-#include <CoreFoundation/CoreFoundation.h>
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
-
-/*!
- @header VLANConfiguration
-*/
-
-typedef const struct __VLANInterface * VLANInterfaceRef;
-
-typedef const struct __VLANPreferences * VLANPreferencesRef;
-
-
-__BEGIN_DECLS
-
-// ----------
-
-Boolean
-IsVLANSupported (CFStringRef device) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; // e.g. "en0", "en1", ...
-
-// ----------
-
-CFTypeID
-VLANInterfaceGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-CFStringRef
-VLANInterfaceGetInterface (VLANInterfaceRef vlan) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; // returns "vlan0", "vlan1", ...
-
-CFStringRef
-VLANInterfaceGetDevice (VLANInterfaceRef vlan) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; // returns "en0", "en1, ...
-
-CFNumberRef
-VLANInterfaceGetTag (VLANInterfaceRef vlan) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; // returns 1 <= tag <= 4094
-
-CFDictionaryRef
-VLANInterfaceGetOptions (VLANInterfaceRef vlan) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; // e.g. UserDefinedName, ...
-
-// ----------
-
-CFTypeID
-VLANPreferencesGetTypeID (void) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-VLANPreferencesRef
-VLANPreferencesCreate (CFAllocatorRef allocator) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-CFArrayRef /* of VLANInterfaceRef's */
-VLANPreferencesCopyInterfaces (VLANPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-VLANInterfaceRef
-VLANPreferencesAddInterface (VLANPreferencesRef prefs,
- CFStringRef device, // e.g. "en0", "en1", ...
- CFNumberRef tag, // e.g. 1 <= tag <= 4094
- CFDictionaryRef options) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; // e.g. UserDefinedName, ...
-
-Boolean
-VLANPreferencesUpdateInterface (VLANPreferencesRef prefs,
- VLANInterfaceRef vlan,
- CFStringRef newDevice,
- CFNumberRef newTag,
- CFDictionaryRef newOptions) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-Boolean
-VLANPreferencesRemoveInterface (VLANPreferencesRef prefs,
- VLANInterfaceRef vlan) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-Boolean
-VLANPreferencesCommitChanges (VLANPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-Boolean
-VLANPreferencesApplyChanges (VLANPreferencesRef prefs) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
-
-// ----------
-
-__END_DECLS
-
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */
-
-#endif /* _VLANCONFIGURATION_H */
/*
- * Copyright (c) 2000, 2001, 2003, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003, 2005, 2007 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#define mig_external __private_extern__
/* Turn MIG type checking on by default */
+#ifdef __MigTypeCheck
+#undef __MigTypeCheck
+#endif
#define __MigTypeCheck 1
/*
/*
- * Copyright (c) 2002-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2002-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
return dyfunc ? dyfunc(name) : NULL;
}
+#if !TARGET_OS_IPHONE
+
static void *
__loadSecurity(void) {
static void *image = NULL;
return dyfunc ? dyfunc(path, app) : -1;
}
+#endif // !TARGET_OS_IPHONE
/*
- * Copyright (c) 2002-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2002-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#ifndef _DY_FRAMEWORK_H
#define _DY_FRAMEWORK_H
+#include <Availability.h>
+#include <TargetConditionals.h>
#include <sys/cdefs.h>
#include <mach/mach.h>
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/IOKitLib.h>
+
+#if !TARGET_OS_IPHONE
#include <Security/Security.h>
+#endif // !TARGET_OS_IPHONE
__BEGIN_DECLS
#pragma mark -
#pragma mark Security.framework APIs
+#if !TARGET_OS_IPHONE
+
OSStatus
_AuthorizationMakeExternalForm (
AuthorizationRef authorization,
);
#define SecTrustedApplicationCreateFromPath _SecTrustedApplicationCreateFromPath
+#endif // !TARGET_OS_IPHONE
+
__END_DECLS
-#endif /* _DY_FRAMEWORK_H */
+#endif // _DY_FRAMEWORK_H
/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
char copyright_string[] =
"/*\n"
-" * Copyright (c) 2000-2007 Apple Inc. All rights reserved.\n"
+" * Copyright (c) 2000-2009 Apple Inc. All rights reserved.\n"
" *\n"
" * @APPLE_LICENSE_HEADER_START@\n"
" * \n"
typedef enum {
+ DEFINE,
+ DEFINE_PRIVATE,
COMMENT,
GROUP,
SC_10_1,
- SC_10_1_10_4, // deprecated in 10.4
- SC_10_1_10_5, // deprecated in 10.5
SC_10_2,
SC_10_3,
+ SC_10_1_10_4, // deprecated in 10.4
SC_10_4,
+ SC_10_1_10_5, // deprecated in 10.5
SC_10_5,
+ SC_10_1_10_6, // deprecated in 10.6
+ SC_10_2_10_6, // deprecated in 10.6
+ SC_10_6_IPHONE_2_0,
+ SC_10_6_IPHONE_3_0,
COMMENT_PRIVATE,
GROUP_PRIVATE,
SC_10_5_PRIVATE,
+ SC_10_6_IPHONE_2_0_PRIVATE,
+ SC_10_6_IPHONE_3_0_PRIVATE,
+ SC_IPHONE_2_0_PRIVATE,
COMMENT_DEPRECATED,
GROUP_DEPRECATED,
END
#define ALERT "Alert"
#define ALLOWNETCREATION "AllowNetCreation"
#define ALTERNATEREMOTEADDRESS "AlternateRemoteAddress"
+#define ALWAYS "Always"
#define ANYREGEX "AnyRegex"
#define APPLETALK "AppleTalk"
#define AUTH "Auth"
#define MEDIA "Media"
#define MIXED "Mixed"
#define MODEL "Model"
-#define OPTIONS "Options"
#define MODE "Mode"
#define MODEM "Modem"
#define MPPE40 "MPPE40"
#define NETWORKID "NetworkID"
#define NETWORKRANGE "NetworkRange"
#define NETWORKSERVICES "NetworkServices"
+#define NEVER "Never"
#define NODE "Node"
#define NODEID "NodeID"
#define NOTE "Note"
#define ONDEMAND "OnDemand"
+#define ONRETRY "OnRetry"
+#define OPTIONS "Options"
#define ORDER "Order"
#define ORDERS "Orders"
#define OVERRIDEPRIMARY "OverridePrimary"
#define PREFIXLENGTH "PrefixLength"
#define PREFS "Prefs"
#define PRIMARYINTERFACE "PrimaryInterface"
+#define PRIMARYRANK "PrimaryRank"
#define PRIMARYSERVICE "PrimaryService"
#define PRIORITY "Priority"
#define PROMPT "Prompt"
#define WAITFORDIALTONE "WaitForDialTone"
#define WINS "WINS"
#define WORKGROUP "Workgroup"
+#define XAUTH "XAuth"
+
typedef struct {
int control;
{ GROUP, NETENT, "Network Entity Keys", NULL, NULL },
{ SC_10_1, NETENT, AIRPORT, NULL, CFDICTIONARY },
- { SC_10_1, NETENT, APPLETALK, NULL, CFDICTIONARY },
+ { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
+ { SC_10_1_10_6, NETENT, APPLETALK, NULL, CFDICTIONARY },
+ { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
{ SC_10_1, NETENT, DHCP, NULL, CFDICTIONARY },
{ SC_10_1, NETENT, DNS, NULL, CFDICTIONARY },
{ SC_10_1, NETENT, ETHERNET, NULL, CFDICTIONARY },
{ SC_10_3, NETENT, L2TP, NULL, CFDICTIONARY },
{ SC_10_1, NETENT, LINK, NULL, CFDICTIONARY },
{ SC_10_1, NETENT, MODEM, NULL, CFDICTIONARY },
+ { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
{ SC_10_1_10_5, NETENT, NETINFO, NULL, CFDICTIONARY },
+ { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
{ SC_10_1, NETENT, PPP, NULL, CFDICTIONARY },
{ SC_10_1, NETENT, PPPOE, NULL, CFDICTIONARY },
{ SC_10_3, NETENT, PPPSERIAL, NULL, CFDICTIONARY },
{ SC_10_3, NETENT, PPTP, NULL, CFDICTIONARY },
{ SC_10_1, NETENT, PROXIES, NULL, CFDICTIONARY },
+ { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
{ SC_10_5, NETENT, SMB, NULL, CFDICTIONARY },
+ { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
{ SC_10_3, NETENT, STF, NULL, CFDICTIONARY },
{ COMMENT, "", NULL, NULL, NULL },
{ GROUP_PRIVATE, NETENT, "Network Entity Keys", NULL, NULL },
{ SC_10_5_PRIVATE, NETENT, EAPOL, NULL, CFDICTIONARY },
+ { SC_10_6_IPHONE_3_0_PRIVATE, NETENT, ONDEMAND, NULL, CFDICTIONARY },
+ { SC_10_6_IPHONE_2_0_PRIVATE, NETENT, SERVICE, "__SERVICE__", CFDICTIONARY },
{ COMMENT_PRIVATE, "", NULL, NULL, NULL },
{ GROUP, NETPROP, KEY_PREFIX COMP NETWORK " Properties", NULL, NULL },
{ SC_10_3, NETVAL AIRPORT AUTH PASSWORD ENCRYPTION, KEYCHAIN, NULL, NULL },
{ COMMENT, "", NULL, NULL, NULL },
- { GROUP, NETPROP APPLETALK, KEY_PREFIX NETENT APPLETALK " Entity Keys", NULL, NULL },
-
- { SC_10_1, NETPROP APPLETALK, COMPUTERNAME, NULL, CFSTRING },
- { SC_10_1, NETPROP APPLETALK, COMPUTERNAME ENCODING, NULL, CFNUMBER },
- { SC_10_1, NETPROP APPLETALK, CONFIGMETHOD, NULL, CFSTRING },
- { SC_10_1, NETPROP APPLETALK, DEFAULTZONE, NULL, CFSTRING },
- { SC_10_1, NETPROP APPLETALK, NETWORKID, NULL, CFNUMBER },
- { SC_10_2, NETPROP APPLETALK, NETWORKRANGE, NULL, CFARRAY_CFNUMBER },
- { SC_10_1, NETPROP APPLETALK, NODEID, NULL, CFNUMBER },
- { SC_10_1, NETPROP APPLETALK, SEEDNETWORKRANGE, NULL, CFARRAY_CFNUMBER },
- { SC_10_1, NETPROP APPLETALK, SEEDZONES, NULL, CFARRAY_CFSTRING },
- { COMMENT, "", NULL, NULL, NULL },
- { COMMENT, "--- " KEY_PREFIX NETPROP APPLETALK CONFIGMETHOD " values ---", NULL, NULL, NULL },
- { SC_10_1, NETVAL APPLETALK CONFIGMETHOD, NODE, NULL, NULL },
- { SC_10_1, NETVAL APPLETALK CONFIGMETHOD, ROUTER, NULL, NULL },
- { SC_10_1, NETVAL APPLETALK CONFIGMETHOD, SEEDROUTER, NULL, NULL },
- { COMMENT, "", NULL, NULL, NULL },
+ { GROUP_DEPRECATED, NETPROP APPLETALK, KEY_PREFIX NETENT APPLETALK " Entity Keys", NULL, NULL },
+
+ { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
+ { SC_10_1_10_6, NETPROP APPLETALK, COMPUTERNAME, NULL, CFSTRING },
+ { SC_10_1_10_6, NETPROP APPLETALK, COMPUTERNAME ENCODING, NULL, CFNUMBER },
+ { SC_10_1_10_6, NETPROP APPLETALK, CONFIGMETHOD, NULL, CFSTRING },
+ { SC_10_1_10_6, NETPROP APPLETALK, DEFAULTZONE, NULL, CFSTRING },
+ { SC_10_1_10_6, NETPROP APPLETALK, NETWORKID, NULL, CFNUMBER },
+ { SC_10_2_10_6, NETPROP APPLETALK, NETWORKRANGE, NULL, CFARRAY_CFNUMBER },
+ { SC_10_1_10_6, NETPROP APPLETALK, NODEID, NULL, CFNUMBER },
+ { SC_10_1_10_6, NETPROP APPLETALK, SEEDNETWORKRANGE, NULL, CFARRAY_CFNUMBER },
+ { SC_10_1_10_6, NETPROP APPLETALK, SEEDZONES, NULL, CFARRAY_CFSTRING },
+ { COMMENT_DEPRECATED, "", NULL, NULL, NULL },
+ { COMMENT_DEPRECATED, "--- " KEY_PREFIX NETPROP APPLETALK CONFIGMETHOD " values ---", NULL, NULL, NULL },
+ { SC_10_1_10_6, NETVAL APPLETALK CONFIGMETHOD, NODE, NULL, NULL },
+ { SC_10_1_10_6, NETVAL APPLETALK CONFIGMETHOD, ROUTER, NULL, NULL },
+ { SC_10_1_10_6, NETVAL APPLETALK CONFIGMETHOD, SEEDROUTER, NULL, NULL },
+ { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
+ { COMMENT_DEPRECATED, "", NULL, NULL, NULL },
+
{ GROUP, NETPROP DNS, KEY_PREFIX NETENT DNS " Entity Keys", NULL, NULL },
{ SC_10_3, NETVAL INTERFACE TYPE, FIREWIRE, NULL, NULL },
{ SC_10_1, NETVAL INTERFACE TYPE, PPP, NULL, NULL },
{ SC_10_3, NETVAL INTERFACE TYPE, STF, NULL, NULL },
+ { SC_10_6_IPHONE_2_0, NETVAL INTERFACE TYPE, IPSEC, NULL, NULL },
{ COMMENT, "", NULL, NULL, NULL },
{ COMMENT, "--- " KEY_PREFIX NETPROP SERVICE SUBTYPE " values (for " PPP ") ---", NULL, NULL, NULL },
{ SC_10_1, NETVAL INTERFACE SUBTYPE, PPPOE, NULL, NULL },
{ GROUP, NETPROP IPSEC, KEY_PREFIX NETENT IPSEC " Entity Keys", NULL, NULL },
+ { SC_10_5, NETPROP IPSEC, AUTHENTICATIONMETHOD, NULL, CFSTRING },
+ { SC_10_5, NETPROP IPSEC, LOCALCERTIFICATE, NULL, CFDATA },
{ SC_10_5, NETPROP IPSEC, LOCALIDENTIFIER, NULL, CFSTRING },
{ SC_10_5, NETPROP IPSEC, LOCALIDENTIFIER TYPE, NULL, CFSTRING },
- { SC_10_5, NETPROP IPSEC, AUTHENTICATIONMETHOD, NULL, CFSTRING },
{ SC_10_5, NETPROP IPSEC, SHAREDSECRET, NULL, CFSTRING },
{ SC_10_5, NETPROP IPSEC, SHAREDSECRET ENCRYPTION, NULL, CFSTRING },
- { SC_10_5, NETPROP IPSEC, LOCALCERTIFICATE, NULL, CFDATA },
+ { SC_10_6_IPHONE_2_0, NETPROP IPSEC, CONNECTTIME, NULL, CFNUMBER },
+ { SC_10_6_IPHONE_2_0, NETPROP IPSEC, REMOTEADDRESS, NULL, CFSTRING },
+ { SC_10_6_IPHONE_2_0, NETPROP IPSEC, STATUS, STATUS, CFNUMBER },
+ { SC_10_6_IPHONE_2_0, NETPROP IPSEC, XAUTH ENABLED, NULL, CFNUMBER_BOOL },
+ { SC_10_6_IPHONE_2_0, NETPROP IPSEC, XAUTH NAME, NULL, CFSTRING },
+ { SC_10_6_IPHONE_2_0, NETPROP IPSEC, XAUTH PASSWORD, NULL, CFSTRING },
+ { SC_10_6_IPHONE_2_0, NETPROP IPSEC, XAUTH PASSWORD ENCRYPTION, NULL, CFSTRING },
{ COMMENT, "", NULL, NULL, NULL },
{ COMMENT, "--- " KEY_PREFIX NETPROP IPSEC AUTHENTICATIONMETHOD " values ---", NULL, NULL, NULL },
{ SC_10_5, NETVAL IPSEC AUTHENTICATIONMETHOD, SHAREDSECRET, NULL, NULL },
{ SC_10_5, NETVAL IPSEC AUTHENTICATIONMETHOD, CERTIFICATE, NULL, NULL },
+ { SC_10_5, NETVAL IPSEC AUTHENTICATIONMETHOD, HYBRID, NULL, NULL },
+ { COMMENT, "", NULL, NULL, NULL },
+ { COMMENT, "--- " KEY_PREFIX NETPROP IPSEC LOCALIDENTIFIER TYPE " values ---", NULL, NULL, NULL },
+ { SC_10_5, NETVAL IPSEC LOCALIDENTIFIER TYPE, KEYID, NULL, NULL },
{ COMMENT, "", NULL, NULL, NULL },
{ COMMENT, "--- " KEY_PREFIX NETPROP IPSEC SHAREDSECRET ENCRYPTION " values ---", NULL, NULL, NULL },
{ SC_10_5, NETVAL IPSEC SHAREDSECRET ENCRYPTION, KEYCHAIN, NULL, NULL },
{ COMMENT, "", NULL, NULL, NULL },
- { COMMENT, "--- " KEY_PREFIX NETPROP IPSEC LOCALIDENTIFIER TYPE " values ---", NULL, NULL, NULL },
- { SC_10_5, NETVAL IPSEC LOCALIDENTIFIER TYPE, KEYID, NULL, NULL },
+ { COMMENT, "--- " KEY_PREFIX NETPROP IPSEC XAUTH PASSWORD ENCRYPTION " values ---", NULL, NULL, NULL },
+ { SC_10_6_IPHONE_2_0, NETVAL IPSEC XAUTH PASSWORD ENCRYPTION, KEYCHAIN, NULL, NULL },
+ { SC_10_6_IPHONE_3_0, NETVAL IPSEC XAUTH PASSWORD ENCRYPTION, PROMPT, NULL, NULL },
{ COMMENT, "", NULL, NULL, NULL },
+ { GROUP_PRIVATE, NETPROP IPSEC, KEY_PREFIX NETENT IPSEC " Entity Keys", NULL, NULL },
+
+ { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP IPSEC, LAST CAUSE, NULL, CFNUMBER },
+ { COMMENT_PRIVATE, "", NULL, NULL, NULL },
+ { COMMENT_PRIVATE, "--- " ONDEMAND ": ---", NULL, NULL, NULL },
+ { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP IPSEC, ONDEMAND ENABLED, NULL, CFNUMBER_BOOL },
+ { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP IPSEC, ONDEMAND MATCH DOMAINS ALWAYS, NULL, CFARRAY_CFSTRING },
+ { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP IPSEC, ONDEMAND MATCH DOMAINS ONRETRY, NULL, CFARRAY_CFSTRING },
+ { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP IPSEC, ONDEMAND MATCH DOMAINS NEVER, NULL, CFARRAY_CFSTRING },
+ { COMMENT_PRIVATE, "", NULL, NULL, NULL },
+
{ GROUP, NETPROP IPV4, KEY_PREFIX NETENT IPV4 " Entity Keys", NULL, NULL },
{ SC_10_1, NETPROP IPV4, ADDRESSES, NULL, CFARRAY_CFSTRING },
{ SC_10_1, NETPROP IPV4, BROADCAST ADDRESSES, NULL, CFARRAY_CFSTRING },
{ COMMENT, "", NULL, NULL, NULL },
{ COMMENT, "--- " KEY_PREFIX NETPROP IPV4 CONFIGMETHOD " values ---", NULL, NULL, NULL },
+ { SC_10_6_IPHONE_2_0, NETVAL IPV4 CONFIGMETHOD, AUTOMATIC, NULL, NULL },
{ SC_10_1, NETVAL IPV4 CONFIGMETHOD, BOOTP, NULL, NULL },
{ SC_10_1, NETVAL IPV4 CONFIGMETHOD, DHCP, NULL, NULL },
{ SC_10_1, NETVAL IPV4 CONFIGMETHOD, INFORM, NULL, NULL },
{ GROUP_DEPRECATED, NETPROP NETINFO, KEY_PREFIX NETENT NETINFO " Entity Keys", NULL, NULL },
+ { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
{ SC_10_1_10_5, NETPROP NETINFO, BINDINGMETHODS, NULL, CFSTRING },
{ SC_10_1_10_5, NETPROP NETINFO, SERVER ADDRESSES, NULL, CFARRAY_CFSTRING },
{ SC_10_1_10_5, NETPROP NETINFO, SERVER TAGS, NULL, CFARRAY_CFSTRING },
{ COMMENT_DEPRECATED, "", NULL, NULL, NULL },
{ COMMENT_DEPRECATED, "--- " KEY_PREFIX NETPROP NETINFO BROADCAST SERVER TAG " default value ---", NULL, NULL, NULL },
{ SC_10_1_10_5, NETVAL NETINFO, DEFAULT SERVER TAG, "network", NULL },
+ { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
{ COMMENT_DEPRECATED, "", NULL, NULL, NULL },
{ GROUP, NETPROP PPP, KEY_PREFIX NETENT PPP " Entity Keys", NULL, NULL },
{ COMMENT_PRIVATE, "--- " ONDEMAND ": ---", NULL, NULL, NULL },
{ SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND DOMAINS, NULL, CFARRAY_CFSTRING },
{ SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND ENABLED, NULL, CFNUMBER_BOOL },
- { SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND HOSTNAME, NULL, CFSTRING },
+ { SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND HOSTNAME, NULL, CFSTRING }, // DEPRECATED, use kSCNetworkConnectionSelectionOptionOnDemandHostName
+#ifdef NOTYET
+ { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP PPP, ONDEMAND MATCH DOMAINS ALWAYS, NULL, CFARRAY_CFSTRING },
+ { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP PPP, ONDEMAND MATCH DOMAINS ONRETRY, NULL, CFARRAY_CFSTRING },
+ { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP PPP, ONDEMAND MATCH DOMAINS NEVER, NULL, CFARRAY_CFSTRING },
+#endif // NOTYET
{ SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND MODE, NULL, CFSTRING },
{ SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND PRIORITY, NULL, CFSTRING },
{ COMMENT_PRIVATE, "", NULL, NULL, NULL },
{ SC_10_4, NETPROP PROXIES, PROXY AUTODISCOVERY ENABLE, NULL, CFNUMBER_BOOL },
{ COMMENT, "", NULL, NULL, NULL },
+ { GROUP_PRIVATE, NETPROP SERVICE, KEY_PREFIX NETENT SERVICE " Entity Keys", NULL, NULL },
+
+ { SC_10_6_IPHONE_2_0_PRIVATE, NETPROP SERVICE, PRIMARYRANK, NULL, CFSTRING },
+ { SC_10_6_IPHONE_2_0_PRIVATE, NETPROP SERVICE, USERDEFINEDNAME, NULL, CFSTRING },
+ { COMMENT_PRIVATE, "", NULL, NULL, NULL },
+ { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP SERVICE PRIMARYRANK " values ---", NULL, NULL, NULL },
+ { SC_10_6_IPHONE_2_0_PRIVATE, NETVAL SERVICE PRIMARYRANK, FIRST, NULL },
+ { SC_10_6_IPHONE_2_0_PRIVATE, NETVAL SERVICE PRIMARYRANK, LAST, NULL },
+ { SC_10_6_IPHONE_2_0_PRIVATE, NETVAL SERVICE PRIMARYRANK, NEVER, NULL },
+ { COMMENT_PRIVATE, "", NULL, NULL, NULL },
+
{ GROUP, NETPROP SMB, KEY_PREFIX NETENT SMB " Entity Keys", NULL, NULL },
+ { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
{ SC_10_5, NETPROP SMB, NETBIOS NAME, NULL, CFSTRING },
{ SC_10_5, NETPROP SMB, NETBIOS NODE TYPE, NULL, CFSTRING },
{ SC_10_5, NETPROP SMB, NETBIOS SCOPE, NULL, CFSTRING },
{ SC_10_5, NETVAL SMB NETBIOS NODE TYPE, PEER, NULL },
{ SC_10_5, NETVAL SMB NETBIOS NODE TYPE, MIXED, NULL },
{ SC_10_5, NETVAL SMB NETBIOS NODE TYPE, HYBRID, NULL },
+ { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
{ COMMENT, "", NULL, NULL, NULL },
{ GROUP, USERSENT CONSOLEUSER, KEY_PREFIX COMP USERS " Entity Keys", NULL, NULL },
+ { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
{ SC_10_1, USERSENT, CONSOLEUSER, NULL, NULL },
+ { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
{ COMMENT, "", NULL, NULL, NULL },
{ GROUP, SYSTEMPROP COMPUTERNAME, KEY_PREFIX COMP SYSTEM " Properties", NULL, NULL },
{ GROUP_PRIVATE, VIRTUALNETWORKINTERFACES, "Virtual Network Interface Keys", NULL, NULL },
+ { DEFINE_PRIVATE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
{ SC_10_5_PRIVATE, VIRTUALPROP BOND, INTERFACES, NULL, CFARRAY_CFSTRING },
{ SC_10_5_PRIVATE, VIRTUALPROP BOND, MODE, NULL, CFNUMBER },
{ SC_10_5_PRIVATE, VIRTUALPROP BOND, OPTIONS, NULL, CFDICTIONARY },
{ SC_10_5_PRIVATE, VIRTUALPROP VLAN, INTERFACE, NULL, CFSTRING },
{ SC_10_5_PRIVATE, VIRTUALPROP VLAN, TAG, NULL, CFNUMBER },
{ SC_10_5_PRIVATE, VIRTUALPROP VLAN, OPTIONS, NULL, CFDICTIONARY },
+ { DEFINE_PRIVATE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
// { COMMENT_PRIVATE, "", NULL, NULL, NULL },
//{ GROUP, "DEPRECATED", "Deprecated schema definition keys", NULL, NULL },
+ { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
{ SC_10_1_10_4, USERSPROP CONSOLEUSER, NAME, NULL, CFSTRING },
{ SC_10_1_10_4, USERSPROP CONSOLEUSER, UID, NULL, CFNUMBER },
{ SC_10_1_10_4, USERSPROP CONSOLEUSER, GID, NULL, CFNUMBER },
+ { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
// { COMMENT, "", NULL, NULL, NULL },
{ END, NULL, NULL, NULL, NULL },
return;
}
+void
+print_define(schemaDefinition *def)
+{
+ printf("%s %s\n", def->prefix, def->key);
+ return;
+}
+
void
print_headerdoc(schemaDefinition *def)
{
case SC_10_2:
printf(" @availability Introduced in Mac OS X 10.2.\n");
break;
- case SC_10_1_10_4:
- printf(" @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.4.\n");
- break;
- case SC_10_1_10_5:
- printf(" @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.5.\n");
- break;
case SC_10_3:
printf(" @availability Introduced in Mac OS X 10.3.\n");
break;
+ case SC_10_1_10_4:
+ printf(" @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.4.\n");
+ break;
case SC_10_4:
printf(" @availability Introduced in Mac OS X 10.4.\n");
break;
+ case SC_10_1_10_5:
+ printf(" @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.5.\n");
+ break;
case SC_10_5:
case SC_10_5_PRIVATE:
printf(" @availability Introduced in Mac OS X 10.5.\n");
break;
+ case SC_10_1_10_6:
+ printf(" @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.6.\n");
+ break;
+ case SC_10_2_10_6:
+ printf(" @availability Introduced in Mac OS X 10.2, but later deprecated in Mac OS X 10.6.\n");
+ break;
+ case SC_10_6_IPHONE_2_0:
+ case SC_10_6_IPHONE_2_0_PRIVATE:
+ printf(" @availability Introduced in Mac OS X 10.6.\n");
+ break;
+ case SC_10_6_IPHONE_3_0:
+ case SC_10_6_IPHONE_3_0_PRIVATE:
+ printf(" @availability Introduced in Mac OS X 10.6.\n");
+ break;
+ case SC_IPHONE_2_0_PRIVATE:
+ printf(" @availability Introduced in iPhone OS 2.0.\n");
+ break;
}
printf(" */\n");
printf("extern const CFStringRef %s;\n", kbuf);
switch (def->control) {
case SC_10_1:
- printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030\n");
- printf(" " SC_SCHEMA_DECLARATION "(%s, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER)\n", kbuf);
- printf("#endif\n");
+ printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))\n", kbuf);
break;
case SC_10_2:
- printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030\n");
- printf(" " SC_SCHEMA_DECLARATION "(%s, AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER)\n", kbuf);
- printf("#endif\n");
+ printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))\n", kbuf);
break;
case SC_10_3:
- printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030\n");
- printf(" " SC_SCHEMA_DECLARATION "(%s, AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER)\n", kbuf);
- printf("#endif\n");
+ printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))\n", kbuf);
break;
case SC_10_1_10_4:
- printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030\n");
- printf(" " SC_SCHEMA_DECLARATION "(%s, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4)\n", kbuf);
- printf("#endif\n");
- break;
- case SC_10_1_10_5:
- printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040\n");
- printf(" " SC_SCHEMA_DECLARATION "(%s, AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5)\n", kbuf);
- printf("#endif\n");
+ printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA))\n", kbuf);
break;
case SC_10_4:
- printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040\n");
- printf(" " SC_SCHEMA_DECLARATION "(%s, AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER)\n", kbuf);
- printf("#endif\n");
+ printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/))\n", kbuf);
+ break;
+ case SC_10_1_10_5:
+ printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA))\n", kbuf);
break;
case SC_10_5:
case SC_10_5_PRIVATE:
- printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050\n");
- printf(" " SC_SCHEMA_DECLARATION "(%s, AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER)\n", kbuf);
- printf("#endif\n");
+ printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))\n", kbuf);
+ break;
+ case SC_10_1_10_6:
+ printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_6,__IPHONE_NA,__IPHONE_NA))\n", kbuf);
+ break;
+ case SC_10_2_10_6:
+ printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_6,__IPHONE_NA,__IPHONE_NA))\n", kbuf);
+ break;
+ case SC_10_6_IPHONE_2_0:
+ case SC_10_6_IPHONE_2_0_PRIVATE:
+ printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0/*SPI*/))\n", kbuf);
+ break;
+ case SC_10_6_IPHONE_3_0:
+ case SC_10_6_IPHONE_3_0_PRIVATE:
+ printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0/*SPI*/))\n", kbuf);
+ break;
+ case SC_IPHONE_2_0_PRIVATE:
+ printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_2_0/*SPI*/))\n", kbuf);
break;
default:
- printf("#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030\n");
printf(" " SC_SCHEMA_DECLARATION "(%s,)\n", kbuf);
- printf("#endif\n");
break;
}
switch (def->control) {
case SC_10_1:
- case SC_10_1_10_4:
- case SC_10_1_10_5:
- printf("#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1010)\n");
+ printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/\n");
break;
case SC_10_2:
- printf("#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1020)\n");
+ printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/\n");
break;
case SC_10_3:
- printf("#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1030)\n");
+ printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/\n");
+ break;
+ case SC_10_1_10_4:
+ printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)\n");
break;
case SC_10_4:
- printf("#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)\n");
+ printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/\n");
+ break;
+ case SC_10_1_10_5:
+ printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)\n");
break;
case SC_10_5:
case SC_10_5_PRIVATE:
- printf("#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)\n");
+ printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/\n");
+ break;
+ case SC_10_1_10_6:
+ printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)\n");
+ break;
+ case SC_10_2_10_6:
+ printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020)\n");
+ break;
+ case SC_10_6_IPHONE_2_0:
+ case SC_10_6_IPHONE_2_0_PRIVATE:
+ printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/\n");
+ break;
+ case SC_10_6_IPHONE_3_0:
+ case SC_10_6_IPHONE_3_0_PRIVATE:
+ printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 30000)/*SPI*/\n");
+ break;
+ case SC_IPHONE_2_0_PRIVATE:
+ printf("#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/\n");
break;
}
switch (def->control) {
case SC_10_1:
- case SC_10_1_10_4:
- case SC_10_1_10_5:
case SC_10_2:
case SC_10_3:
+ case SC_10_1_10_4:
case SC_10_4:
+ case SC_10_1_10_5:
case SC_10_5:
case SC_10_5_PRIVATE:
+ case SC_10_1_10_6:
+ case SC_10_2_10_6:
+ case SC_10_6_IPHONE_2_0:
+ case SC_10_6_IPHONE_3_0:
+ case SC_10_6_IPHONE_2_0_PRIVATE:
+ case SC_10_6_IPHONE_3_0_PRIVATE:
+ case SC_IPHONE_2_0_PRIVATE:
printf("#endif\n");
break;
}
break;
}
+ case DEFINE: {
+ switch (type) {
+ case gen_hfile_e:
+ printf("\n");
+ print_define(&names[i]);
+ break;
+ case gen_cfile_e:
+ if ((strcmp(names[i].prefix, "#if") == 0) ||
+ (strcmp(names[i].prefix, "#ifdef") == 0) ||
+ (strcmp(names[i].prefix, "#ifndef") == 0))
+ printf("\n");
+ print_define(&names[i]);
+ if (strcmp(names[i].prefix, "#endif") == 0)
+ printf("\n");
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+
+ case DEFINE_PRIVATE: {
+ switch (type) {
+ case gen_hfile_private_e:
+ printf("\n");
+ print_define(&names[i]);
+ break;
+ case gen_cfile_e:
+ if ((strcmp(names[i].prefix, "#if") == 0) ||
+ (strcmp(names[i].prefix, "#ifdef") == 0) ||
+ (strcmp(names[i].prefix, "#ifndef") == 0))
+ printf("\n");
+ print_define(&names[i]);
+ if (strcmp(names[i].prefix, "#endif") == 0)
+ printf("\n");
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+
case GROUP:
case GROUP_DEPRECATED: {
switch (type) {
switch (names[i].control) {
case SC_10_1_10_4:
case SC_10_1_10_5:
+ case SC_10_1_10_6:
+ case SC_10_2_10_6:
// don't report deprecated keys
break;
case SC_10_5_PRIVATE:
+ case SC_10_6_IPHONE_2_0_PRIVATE:
+ case SC_10_6_IPHONE_3_0_PRIVATE:
+ case SC_IPHONE_2_0_PRIVATE:
// don't report private definitions
break;
default:
switch (names[i].control) {
case SC_10_1_10_4:
case SC_10_1_10_5:
+ case SC_10_1_10_6:
+ case SC_10_2_10_6:
// don't report deprecated keys
break;
case SC_10_5_PRIVATE:
+ case SC_10_6_IPHONE_2_0_PRIVATE:
+ case SC_10_6_IPHONE_3_0_PRIVATE:
+ case SC_IPHONE_2_0_PRIVATE:
print_comment(&names[i]);
break;
default:
case gen_headerdoc_e:
switch (names[i].control) {
case SC_10_5_PRIVATE:
- break;
+ case SC_10_6_IPHONE_2_0_PRIVATE:
+ case SC_10_6_IPHONE_3_0_PRIVATE:
+ case SC_IPHONE_2_0_PRIVATE:
// don't report private definitions
+ break;
default:
print_headerdoc(&names[i]);
break;
case gen_headerdoc_private_e:
switch (names[i].control) {
case SC_10_5_PRIVATE:
+ case SC_10_6_IPHONE_2_0_PRIVATE:
+ case SC_10_6_IPHONE_3_0_PRIVATE:
+ case SC_IPHONE_2_0_PRIVATE:
print_headerdoc(&names[i]);
break;
default:
case gen_hfile_e:
switch (names[i].control) {
case SC_10_5_PRIVATE:
+ case SC_10_6_IPHONE_2_0_PRIVATE:
+ case SC_10_6_IPHONE_3_0_PRIVATE:
+ case SC_IPHONE_2_0_PRIVATE:
break;
// don't report private definitions
default:
case gen_hfile_private_e:
switch (names[i].control) {
case SC_10_5_PRIVATE:
+ case SC_10_6_IPHONE_2_0_PRIVATE:
+ case SC_10_6_IPHONE_3_0_PRIVATE:
+ case SC_IPHONE_2_0_PRIVATE:
print_hfile(&names[i]);
break;
default:
if (argc >= 2)
type = argv[1];
- if (strcmp(type, "header-x") == 0) {
- printf("%s\n", copyright_string);
- printf("/*\n * This file is automatically generated\n * DO NOT EDIT!\n */\n\n");
-
- printf("/*\n");
- printf(" * Note: For Cocoa/Obj-C/Foundation programs accessing these preference\n");
- printf(" * keys you may want to consider the following:\n");
- printf(" *\n");
- printf(" * #define SCSTR(s) (NSString *)CFSTR(s)\n");
- printf(" * #import <SystemConfiguration/SystemConfiguration.h>\n");
- printf(" */\n\n");
-
- printf("#ifndef _SCSCHEMADEFINITIONS_10_1_H\n#define _SCSCHEMADEFINITIONS_10_1_H\n\n");
-
- printf("#warning USE OF THIS HEADER HAS BEEN DEPRECATED\n");
-
- printf("#ifndef _SCSCHEMADEFINITIONS_H\n");
- printf("#warning Please #include <SystemConfiguration/SystemConfiguration.h> instead\n");
- printf("#warning of including this file directly.\n");
- printf("#include <SystemConfiguration/SCSchemaDefinitions.h>\n");
- printf("#endif\n\n");
-
-// printf("#ifndef SCSTR\n");
-// printf("#include <CoreFoundation/CFString.h>\n");
-// printf("#define SCSTR(s) CFSTR(s)\n");
-// printf("#endif\n\n");
-//
-// dump_names(gen_header_e);
-// printf("\n");
-
- printf("#endif /* _SCSCHEMADEFINITIONS_10_1_H */\n");
- }
- else if (strcmp(type, "header") == 0) {
+ if (strcmp(type, "header") == 0) {
printf("%s\n", copyright_string);
printf("/*\n * This file is automatically generated\n * DO NOT EDIT!\n */\n\n");
printf(" * \"" SC_SCHEMA_DECLARATION "\" and \"" SC_SCHEMA_KV "\" macros\n");
printf(" */\n\n\n");
- printf("#ifndef _SCSCHEMADEFINITIONS_H\n#define _SCSCHEMADEFINITIONS_H\n\n");
+ printf("#ifndef\t_SCSCHEMADEFINITIONS_H\n");
+ printf("#ifdef\tUSE_SYSTEMCONFIGURATION_PRIVATE_HEADERS\n");
+ printf("#include <SystemConfiguration/_SCSchemaDefinitions.h>\n");
+ printf("#else\t/* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */\n");
+ printf("#define\t_SCSCHEMADEFINITIONS_H\n");
+ printf("\n");
printf("/* -------------------- Macro declarations -------------------- */\n\n");
- printf("#include <AvailabilityMacros.h>\n\n");
+ printf("#include <Availability.h>\n");
+ printf("#include <TargetConditionals.h>\n");
+ printf("\n");
printf("/*\n");
printf(" * let's \"do the right thing\" for those wishing to build for\n");
printf(" * Mac OS X 10.1.0 ... 10.2.x\n");
printf(" */\n");
- printf("#if MAC_OS_X_VERSION_MIN_REQUIRED <= 1020\n");
+ printf("#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (__MAC_OS_X_VERSION_MIN_REQUIRED <= 1020) && !defined(__IPHONE_OS_VERSION_MIN_REQUIRED)\n");
printf(" #ifndef SCSTR\n");
printf(" #include <CoreFoundation/CFString.h>\n");
printf(" #define SCSTR(s) CFSTR(s)\n");
printf("#endif\n");
// The SCSTR() macro should only be availble for Mac OS X 10.1.0 ... 10.4.x
- printf("#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) && (MAC_OS_X_VERSION_MAX_ALLOWED <= 1040)\n");
+ printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) && (__MAC_OS_X_VERSION_MAX_ALLOWED <= 1040) && !defined(__IPHONE_OS_VERSION_MIN_REQUIRED)\n");
printf(" #ifndef SCSTR\n");
printf(" #include <CoreFoundation/CFString.h>\n");
printf(" #define SCSTR(s) CFSTR(s)\n");
dump_names(gen_hfile_e);
printf("\n");
- printf("#endif /* _SCSCHEMADEFINITIONS_H */\n");
+ printf("#endif\t/* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */\n");
+ printf("#endif\t/* _SCSCHEMADEFINITIONS_H */\n");
}
else if (strcmp(type, "private") == 0) {
printf("%s\n", copyright_string);
dump_names(gen_comments_private_e);
printf(" */\n\n\n");
- printf("#ifndef _SCSCHEMADEFINITIONSPRIVATE_H\n#define _SCSCHEMADEFINITIONSPRIVATE_H\n\n");
+ printf("#ifndef _SCSCHEMADEFINITIONSPRIVATE_H\n");
+ printf("#define _SCSCHEMADEFINITIONSPRIVATE_H\n");
+ printf("\n");
printf("/* -------------------- Macro declarations -------------------- */\n\n");
printf(" * DO NOT EDIT!\n");
printf(" */\n");
printf("\n");
+ printf("#include <Availability.h>\n");
+ printf("#include <TargetConditionals.h>\n");
printf("#include <CoreFoundation/CFString.h>\n");
printf("\n");
dump_names(gen_cfile_e);
#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
+#include <sys/un.h>
#include <sys/wait.h>
#include <CoreFoundation/CoreFoundation.h>
int
_SCHelperOpen(CFDataRef authorizationData)
{
- sigset_t block;
- sigset_t block_old;
- CFBundleRef bundle;
- int comm[2] = { -1, -1 };
- int exit_status = 0;
- struct sigaction ignore;
- struct sigaction int_old;
- Boolean ok = FALSE;
- char path[MAXPATHLEN]= { 0 };
- pid_t pid1;
- struct sigaction quit_old;
- uint32_t status = 0;
- CFURLRef url = NULL;
- static int yes = 1;
-
- // get CFBundleRef for SystemConfiguration.framework
- bundle = _SC_CFBundleGet();
- if (bundle != NULL) {
- url = CFBundleCopyResourceURL(bundle, CFSTR(HELPER), NULL, NULL);
- }
-
- if (url != NULL) {
- if (!CFURLGetFileSystemRepresentation(url, TRUE, (UInt8 *)path, sizeof(path))) {
- path[0] = 0;
- }
- CFRelease(url);
- }
-
- // create tool<-->helper communications socket
- if (socketpair(AF_UNIX, SOCK_STREAM, 0, comm) == -1) {
- perror("_SCHelperOpen socketpair() failed");
+ Boolean ok;
+ int sock;
+ struct sockaddr_un sun;
+ uint32_t status = 0;
+ static int yes = 1;
+
+ if ((sock = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
+ perror("_SCHelperOpen socket() failed");
return -1;
}
- // ignore SIGINT, SIGQUIT
- ignore.sa_handler = SIG_IGN;
- ignore.sa_flags = 0;
- (void)sigemptyset(&ignore.sa_mask);
- (void)sigaction(SIGINT , &ignore, &int_old );
- (void)sigaction(SIGQUIT, &ignore, &quit_old);
-
- // block SIGCHLD
- (void)sigemptyset(&block);
- (void)sigaddset(&block, SIGCHLD);
- (void)sigprocmask(SIG_BLOCK, &block, &block_old);
-
- // fork
- pid1 = fork();
- if (pid1 == -1) { // if error
- perror("_SCHelperOpen fork() failed");
- goto done;
- } else if (pid1 == 0) { // if [first] child
- int i;
- pid_t pid2;
-
- // make sure that we don't step on syslog's FD (if open)
- closelog();
-
- // set stdin, stdout, stderr (and close other FD's)
- if (comm[0] != STDIN_FILENO) {
- (void)dup2(comm[0], STDIN_FILENO);
- }
-
- if (comm[0] != STDOUT_FILENO) {
- (void)dup2(comm[0], STDOUT_FILENO);
- }
-
- (void)close(STDERR_FILENO);
- (void)open(_PATH_CONSOLE, O_WRONLY, 0);
-
- for (i = getdtablesize() - 1; i > STDERR_FILENO; i--) {
- (void)close(i);
- }
-
- pid2 = vfork();
- if (pid2 == -1) { // if error
- int err = errno;
-
- perror("_SCHelperOpen vfork() failed\n");
- (void)__SCHelper_txMessage(STDOUT_FILENO, err, NULL);
- _exit(err);
- } else if (pid2 == 0) { // if [second] child
- char *env;
- int err = ENOENT;
- size_t len;
-
- // restore signal processing
- (void)sigaction(SIGINT , &int_old , NULL);
- (void)sigaction(SIGQUIT, &quit_old, NULL);
- (void)sigprocmask(SIG_SETMASK, &block_old, NULL);
-
- if (path[0] != 0) {
- (void)execl(path, path, NULL);
- err = errno;
- }
-
- // if appropriate (e.g. when debugging), try a bit harder
-
- env = getenv("DYLD_FRAMEWORK_PATH");
- len = (env != NULL) ? strlen(env) : 0;
-
- // trim any trailing slashes
- while ((len > 1) && (env[len - 1] == '/')) {
- len--;
- }
-
- // if DYLD_FRAMEWORK_PATH is ".../xxx~sym" than try ".../xxx~sym/SCHelper"
- if ((len > SUFFIX_SYM_LEN) &&
- (strncmp(&env[len - SUFFIX_SYM_LEN], SUFFIX_SYM, SUFFIX_SYM_LEN) == 0) &&
- ((len + 1 + HELPER_LEN) < MAXPATHLEN)) {
- char path[MAXPATHLEN];
-
- strlcpy(path, env, sizeof(path));
- strlcpy(&path[len], "/", sizeof(path) - (len - 1));
- strlcat(&path[len], HELPER, sizeof(path) - len);
-
- (void)execl(path, path, NULL);
- err = errno;
- }
-
- // if SCHelper could not be started
- (void)__SCHelper_txMessage(STDOUT_FILENO, err, NULL);
- _exit(err != 0 ? err : ENOENT);
- }
-
- // [first] child
- _exit(0);
- }
-
- if (wait4(pid1, &exit_status, 0, NULL) == -1) {
- perror("_SCHelperOpen wait4() failed");
- goto done;
- }
-
- if (WIFEXITED(exit_status)) {
- if (WEXITSTATUS(exit_status) != 0) {
- SCLog(TRUE, LOG_INFO,
- CFSTR("could not start \"" HELPER "[1]\", exited w/status = %d"),
- WEXITSTATUS(exit_status));
- goto done;
- }
- } else if (WIFSIGNALED(exit_status)) {
- SCLog(TRUE, LOG_INFO,
- CFSTR("could not start \"" HELPER "[1]\", terminated w/signal = %d"),
- WTERMSIG(exit_status));
- goto done;
- } else {
- SCLog(TRUE, LOG_INFO,
- CFSTR("could not start \"" HELPER "[1]\", exit_status = %x"),
- exit_status);
- goto done;
+ sun.sun_family = AF_UNIX;
+ strlcpy(sun.sun_path, "/var/run/SCHelper", sizeof(sun.sun_path));
+ if (connect(sock, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
+ perror("_SCHelperOpen connect() failed");
+ close(sock);
+ return -1;
}
- (void)close(comm[0]);
- comm[0] = -1;
-
- if (setsockopt(comm[1], SOL_SOCKET, SO_NOSIGPIPE, (const void *)&yes, sizeof(yes)) == -1) {
+ if (setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, (const void *)&yes, sizeof(yes)) == -1) {
perror("_SCHelperOpen setsockopt() failed");
- goto done;
+ close(sock);
+ return -1;
}
- ok = __SCHelper_rxMessage(comm[1], &status, NULL);
+ ok = _SCHelperExec(sock, SCHELPER_MSG_AUTH, authorizationData, &status, NULL);
if (!ok) {
- SCLog(TRUE, LOG_INFO, CFSTR("could not start \"" HELPER "\", no status available"));
- goto done;
+ SCLog(TRUE, LOG_INFO, CFSTR("_SCHelperOpen: could not send authorization"));
+ close(sock);
+ return -1;
}
ok = (status == 0);
if (!ok) {
SCLog(TRUE, LOG_INFO, CFSTR("could not start \"" HELPER "\", status = %u"), status);
- goto done;
- }
-
- ok = _SCHelperExec(comm[1], SCHELPER_MSG_AUTH, authorizationData, &status, NULL);
- if (!ok) {
- SCLog(TRUE, LOG_INFO, CFSTR("_SCHelperOpen: could not send authorization"));
- goto done;
- }
-
- done :
-
- // restore signal processing
- (void)sigaction(SIGINT , &int_old , NULL);
- (void)sigaction(SIGQUIT, &quit_old, NULL);
- (void)sigprocmask(SIG_SETMASK, &block_old, NULL);
-
- if (comm[0] > 0) {
- (void)close(comm[0]);
-// comm[0] = -1;
- }
-
- if (!ok) {
- (void)close(comm[1]);
- comm[1] = -1;
+ close(sock);
+ return -1;
}
- return comm[1];
+ return sock;
}
#define _SCHELPER_CLIENT_H
#include <sys/cdefs.h>
-#include <Security/Security.h>
+#include <Availability.h>
+#include <TargetConditionals.h>
+#include <CoreFoundation/CoreFoundation.h>
#define kSCKeychainOptionsAccount CFSTR("Account") // CFString
#define kSCKeychainOptionsDescription CFSTR("Description") // CFString
// SCNetworkConfiguration
SCHELPER_MSG_INTERFACE_REFRESH = 200,
+#if !TARGET_OS_IPHONE
// "System" Keychain
SCHELPER_MSG_KEYCHAIN_COPY = 300,
SCHELPER_MSG_KEYCHAIN_EXISTS,
SCHELPER_MSG_KEYCHAIN_REMOVE,
SCHELPER_MSG_KEYCHAIN_SET,
+#endif // !TARGET_OS_IPHONE
// miscellaneous
SCHELPER_MSG_EXIT = 9999
/*
- * Copyright (c) 2005-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2005-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*/
#include <stdlib.h>
+#include <getopt.h>
#include <unistd.h>
#include <sys/types.h>
#include <CoreFoundation/CoreFoundation.h>
+#include <CoreFoundation/CFRuntime.h>
#include <SystemConfiguration/SystemConfiguration.h>
#include <SystemConfiguration/SCPrivate.h>
-#include <Security/Security.h>
+#include <SystemConfiguration/SCValidation.h>
+#include <pthread.h>
+#include <sysexits.h>
#include "SCPreferencesInternal.h"
#include "SCHelper_client.h"
#include "helper_comm.h"
-static AuthorizationRef authorization = NULL;
-static SCPreferencesRef prefs = NULL;
+#if TARGET_OS_IPHONE
+#include <grp.h>
+
+__private_extern__ int
+getgrnam_r(const char *name, __unused struct group *grp, __unused char *buf, __unused size_t bufsize, struct group **grpP)
+{
+ *grpP = getgrnam(name);
+ return (*grpP == NULL) ? -1 : 0;
+}
+#endif // TARGET_OS_IPHONE
+
+
+#pragma mark -
+#pragma mark Session managment
+
+
+typedef const struct __SCHelperSession * SCHelperSessionRef;
+
+typedef struct {
+
+ // base CFType information
+ CFRuntimeBase cfBase;
+
+ // authorization
+ AuthorizationRef authorization;
+#if TARGET_OS_IPHONE
+ uid_t peer_euid;
+ gid_t peer_egid;
+#endif // TARGET_OS_IPHONE
+
+ // preferences
+ SCPreferencesRef prefs;
+
+} SCHelperSessionPrivate, *SCHelperSessionPrivateRef;
+
+
+static AuthorizationRef
+__SCHelperSessionGetAuthorization(SCHelperSessionRef session)
+{
+ SCHelperSessionPrivateRef sessionPrivate = (SCHelperSessionPrivateRef)session;
+
+ return sessionPrivate->authorization;
+}
+
+
+static Boolean
+__SCHelperSessionSetAuthorization(SCHelperSessionRef session, CFTypeRef authorizationData)
+{
+ Boolean ok = TRUE;
+ SCHelperSessionPrivateRef sessionPrivate = (SCHelperSessionPrivateRef)session;
+
+#if !TARGET_OS_IPHONE
+ if (sessionPrivate->authorization != NULL) {
+ AuthorizationFree(sessionPrivate->authorization, kAuthorizationFlagDefaults);
+// AuthorizationFree(sessionPrivate->authorization, kAuthorizationFlagDestroyRights);
+ sessionPrivate->authorization = NULL;
+ }
+
+ if (isA_CFData(authorizationData)) {
+ AuthorizationExternalForm extForm;
+
+ if (CFDataGetLength(authorizationData) == sizeof(extForm.bytes)) {
+ OSStatus err;
+
+ bcopy(CFDataGetBytePtr(authorizationData), extForm.bytes, sizeof(extForm.bytes));
+ err = AuthorizationCreateFromExternalForm(&extForm,
+ &sessionPrivate->authorization);
+ if (err != errAuthorizationSuccess) {
+ SCLog(TRUE, LOG_ERR,
+ CFSTR("AuthorizationCreateFromExternalForm() failed: status = %d"),
+ (int)err);
+ sessionPrivate->authorization = NULL;
+ ok = FALSE;
+ }
+ }
+ }
+#else // !TARGET_OS_IPHONE
+ if (sessionPrivate->authorization != NULL) {
+ CFRelease(sessionPrivate->authorization);
+ sessionPrivate->authorization = NULL;
+ }
+
+ if (isA_CFString(authorizationData)) {
+ sessionPrivate->authorization = (void *)CFRetain(authorizationData);
+ }
+#endif // !TARGET_OS_IPHONE
+
+ return ok;
+}
+
+
+#if TARGET_OS_IPHONE
+static void
+__SCHelperSessionGetCredentials(SCHelperSessionRef session, uid_t *euid, gid_t *egid)
+{
+ SCHelperSessionPrivateRef sessionPrivate = (SCHelperSessionPrivateRef)session;
+
+ if (euid != NULL) *euid = sessionPrivate->peer_euid;
+ if (egid != NULL) *egid = sessionPrivate->peer_egid;
+ return;
+}
+
+
+static Boolean
+__SCHelperSessionSetCredentials(SCHelperSessionRef session, uid_t euid, gid_t egid)
+{
+ SCHelperSessionPrivateRef sessionPrivate = (SCHelperSessionPrivateRef)session;
+
+ sessionPrivate->peer_euid = euid;
+ sessionPrivate->peer_egid = egid;
+ return TRUE;
+}
+#endif // TARGET_OS_IPHONE
+
+static SCPreferencesRef
+__SCHelperSessionGetPreferences(SCHelperSessionRef session)
+{
+ SCHelperSessionPrivateRef sessionPrivate = (SCHelperSessionPrivateRef)session;
+
+ return sessionPrivate->prefs;
+}
+
+
+static Boolean
+__SCHelperSessionSetPreferences(SCHelperSessionRef session, SCPreferencesRef prefs)
+{
+ SCHelperSessionPrivateRef sessionPrivate = (SCHelperSessionPrivateRef)session;
+
+ if (prefs != NULL) {
+ CFRetain(prefs);
+ }
+ if (sessionPrivate->prefs != NULL) {
+ CFRelease(sessionPrivate->prefs);
+ }
+ sessionPrivate->prefs = prefs;
+
+ return TRUE;
+}
+
+
+static CFStringRef __SCHelperSessionCopyDescription (CFTypeRef cf);
+static void __SCHelperSessionDeallocate (CFTypeRef cf);
+
+
+static CFTypeID __kSCHelperSessionTypeID = _kCFRuntimeNotATypeID;
+static Boolean debug = FALSE;
+static pthread_once_t initialized = PTHREAD_ONCE_INIT;
+static CFRunLoopRef main_runLoop = NULL;
+static CFMutableSetRef sessions = NULL;
+static int sessions_closed = 0; // count of sessions recently closed
+static pthread_mutex_t sessions_lock = PTHREAD_MUTEX_INITIALIZER;
+
+
+static const CFRuntimeClass __SCHelperSessionClass = {
+ 0, // version
+ "SCHelperSession", // className
+ NULL, // init
+ NULL, // copy
+ __SCHelperSessionDeallocate, // dealloc
+ NULL, // equal
+ NULL, // hash
+ NULL, // copyFormattingDesc
+ __SCHelperSessionCopyDescription // copyDebugDesc
+};
+
+
+static CFStringRef
+__SCHelperSessionCopyDescription(CFTypeRef cf)
+{
+ CFAllocatorRef allocator = CFGetAllocator(cf);
+ CFMutableStringRef result;
+ SCHelperSessionPrivateRef sessionPrivate = (SCHelperSessionPrivateRef)cf;
+
+ result = CFStringCreateMutable(allocator, 0);
+ CFStringAppendFormat(result, NULL, CFSTR("<SCHelperSession %p [%p]> {"), cf, allocator);
+ CFStringAppendFormat(result, NULL, CFSTR("authorization = %p"), sessionPrivate->authorization);
+ CFStringAppendFormat(result, NULL, CFSTR(", prefs = %p"), sessionPrivate->prefs);
+ CFStringAppendFormat(result, NULL, CFSTR("}"));
+
+ return result;
+}
+
+
+static void
+__SCHelperSessionDeallocate(CFTypeRef cf)
+{
+ SCHelperSessionPrivateRef sessionPrivate = (SCHelperSessionPrivateRef)cf;
+
+ // release resources
+ __SCHelperSessionSetAuthorization((SCHelperSessionRef)sessionPrivate, NULL);
+ __SCHelperSessionSetPreferences ((SCHelperSessionRef)sessionPrivate, NULL);
+
+ // we no longer need/want to track this session
+ pthread_mutex_lock(&sessions_lock);
+ CFSetRemoveValue(sessions, sessionPrivate);
+ sessions_closed++;
+ pthread_mutex_unlock(&sessions_lock);
+ CFRunLoopWakeUp(main_runLoop);
+
+ return;
+}
+
+
+static void
+__SCHelperSessionInitialize(void)
+{
+ __kSCHelperSessionTypeID = _CFRuntimeRegisterClass(&__SCHelperSessionClass);
+ return;
+}
+
+
+static SCHelperSessionRef
+__SCHelperSessionCreate(CFAllocatorRef allocator)
+{
+ SCHelperSessionPrivateRef sessionPrivate;
+ uint32_t size;
+
+ /* initialize runtime */
+ pthread_once(&initialized, __SCHelperSessionInitialize);
+
+ /* allocate session */
+ size = sizeof(SCHelperSessionPrivate) - sizeof(CFRuntimeBase);
+ sessionPrivate = (SCHelperSessionPrivateRef)_CFRuntimeCreateInstance(allocator,
+ __kSCHelperSessionTypeID,
+ size,
+ NULL);
+ if (sessionPrivate == NULL) {
+ return NULL;
+ }
+
+ sessionPrivate->authorization = NULL;
+#if TARGET_OS_IPHONE
+ sessionPrivate->peer_euid = 0;
+ sessionPrivate->peer_egid = 0;
+#endif // TARGET_OS_IPHONE
+ sessionPrivate->prefs = NULL;
+
+ // keep track this session
+ pthread_mutex_lock(&sessions_lock);
+ if (sessions == NULL) {
+ sessions = CFSetCreateMutable(NULL, 0, NULL); // create a non-retaining set
+ }
+ CFSetAddValue(sessions, sessionPrivate);
+ pthread_mutex_unlock(&sessions_lock);
+
+ return (SCHelperSessionRef)sessionPrivate;
+}
+
+
+#pragma mark -
+#pragma mark Helpers
/*
* (out) reply = N/A
*/
static Boolean
-do_Exit(void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
+do_Exit(SCHelperSessionRef session, void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
{
+ *status = -1;
return FALSE;
}
* (out) reply = N/A
*/
static Boolean
-do_Auth(void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
+do_Auth(SCHelperSessionRef session, void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
{
- if (authorization != NULL) {
- AuthorizationFree(authorization, kAuthorizationFlagDefaults);
-// AuthorizationFree(authorization, kAuthorizationFlagDestroyRights);
- authorization = NULL;
- }
+ Boolean ok;
- if (data != NULL) {
- AuthorizationExternalForm extForm;
+#if !TARGET_OS_IPHONE
- if (CFDataGetLength(data) == sizeof(extForm.bytes)) {
- OSStatus err;
+ ok = __SCHelperSessionSetAuthorization(session, data);
- bcopy(CFDataGetBytePtr(data), extForm.bytes, sizeof(extForm.bytes));
- err = AuthorizationCreateFromExternalForm(&extForm, &authorization);
- if (err != errAuthorizationSuccess) {
- SCLog(TRUE, LOG_ERR,
- CFSTR("AuthorizationCreateFromExternalForm() failed: status = %d"),
- (int)err);
- }
- }
+#else //!TARGET_OS_IPHONE
- CFRelease(data);
+ CFStringRef authorizationInfo = NULL;
+
+ if ((data != NULL) && !_SCUnserializeString(&authorizationInfo, data, NULL, 0)) {
+ return FALSE;
}
- *status = (authorization != NULL) ? 0 : 1;
+ if (!isA_CFString(authorizationInfo)) {
+ if (authorizationInfo != NULL) CFRelease(authorizationInfo);
+ return FALSE;
+ }
+
+ ok = __SCHelperSessionSetAuthorization(session, authorizationInfo);
+ if (authorizationInfo != NULL) CFRelease(authorizationInfo);
+
+#endif // !TARGET_OS_IPHONE
+ *status = ok ? 0 : 1;
return TRUE;
}
+#if !TARGET_OS_IPHONE
+
+
/*
* SCHELPER_MSG_KEYCHAIN_COPY
* (in) data = unique_id
* (out) reply = password
*/
static Boolean
-do_keychain_copy(void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
+do_keychain_copy(SCHelperSessionRef session, void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
{
- CFStringRef unique_id = NULL;
+ SCPreferencesRef prefs;
+ CFStringRef unique_id = NULL;
if ((data != NULL) && !_SCUnserializeString(&unique_id, data, NULL, 0)) {
return FALSE;
return FALSE;
}
+ prefs = __SCHelperSessionGetPreferences(session);
*reply = _SCPreferencesSystemKeychainPasswordItemCopy(prefs, unique_id);
CFRelease(unique_id);
if (*reply == NULL) {
* (out) reply = N/A
*/
static Boolean
-do_keychain_exists(void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
+do_keychain_exists(SCHelperSessionRef session, void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
{
- Boolean ok;
- CFStringRef unique_id = NULL;
+ Boolean ok;
+ SCPreferencesRef prefs;
+ CFStringRef unique_id = NULL;
if ((data != NULL) && !_SCUnserializeString(&unique_id, data, NULL, 0)) {
return FALSE;
}
if (!isA_CFString(unique_id)) {
+ if (unique_id != NULL) CFRelease(unique_id);
return FALSE;
}
+ prefs = __SCHelperSessionGetPreferences(session);
ok = _SCPreferencesSystemKeychainPasswordItemExists(prefs, unique_id);
CFRelease(unique_id);
-
if (!ok) {
*status = SCError();
}
* (out) reply = N/A
*/
static Boolean
-do_keychain_remove(void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
+do_keychain_remove(SCHelperSessionRef session, void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
{
- Boolean ok;
- CFStringRef unique_id = NULL;
+ Boolean ok;
+ SCPreferencesRef prefs;
+ CFStringRef unique_id = NULL;
if ((data != NULL) && !_SCUnserializeString(&unique_id, data, NULL, 0)) {
return FALSE;
}
if (!isA_CFString(unique_id)) {
+ if (unique_id != NULL) CFRelease(unique_id);
return FALSE;
}
+ prefs = __SCHelperSessionGetPreferences(session);
ok = _SCPreferencesSystemKeychainPasswordItemRemove(prefs, unique_id);
CFRelease(unique_id);
-
if (!ok) {
*status = SCError();
}
* (out) reply = N/A
*/
static Boolean
-do_keychain_set(void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
+do_keychain_set(SCHelperSessionRef session, void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
{
- CFStringRef account;
- CFStringRef description;
- CFArrayRef executablePaths = NULL;
- CFStringRef label;
- Boolean ok;
- CFDictionaryRef options = NULL;
- CFDataRef password;
- CFStringRef unique_id;
+ CFStringRef account;
+ CFStringRef description;
+ CFArrayRef executablePaths = NULL;
+ CFStringRef label;
+ Boolean ok;
+ CFDictionaryRef options = NULL;
+ CFDataRef password;
+ SCPreferencesRef prefs;
+ CFStringRef unique_id;
if ((data != NULL) && !_SCUnserialize((CFPropertyListRef *)&options, data, NULL, 0)) {
return FALSE;
}
if (!isA_CFDictionary(options)) {
+ if (options != NULL) CFRelease(options);
return FALSE;
}
account = CFDictionaryGetValue(options, kSCKeychainOptionsAccount);
password = CFDictionaryGetValue(options, kSCKeychainOptionsPassword);
+ prefs = __SCHelperSessionGetPreferences(session);
ok = _SCPreferencesSystemKeychainPasswordItemSet(prefs,
unique_id,
label,
password,
options);
CFRelease(options);
-
if (!ok) {
*status = SCError();
}
}
+#endif // !TARGET_OS_IPHONE
+
+
/*
* SCHELPER_MSG_INTERFACE_REFRESH
* (in) data = ifName
* (out) reply = N/A
*/
static Boolean
-do_interface_refresh(void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
+do_interface_refresh(SCHelperSessionRef session, void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
{
CFStringRef ifName = NULL;
Boolean ok;
if (!isA_CFString(ifName)) {
SCLog(TRUE, LOG_ERR, CFSTR("interface name not valid"));
+ if (ifName != NULL) CFRelease(ifName);
return FALSE;
}
ok = _SCNetworkInterfaceForceConfigurationRefresh(ifName);
CFRelease(ifName);
-
if (!ok) {
*status = SCError();
}
* (out) reply = N/A
*/
static Boolean
-do_prefs_Open(void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
+do_prefs_Open(SCHelperSessionRef session, void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
{
- CFStringRef prefsID = NULL;
+ CFStringRef name;
+ CFNumberRef pid;
+ SCPreferencesRef prefs = __SCHelperSessionGetPreferences(session);
+ CFDictionaryRef prefsInfo = NULL;
+ CFStringRef prefsID;
+ CFStringRef prefsName;
if (prefs != NULL) {
return FALSE;
}
- if ((data != NULL) && !_SCUnserializeString(&prefsID, data, NULL, 0)) {
- SCLog(TRUE, LOG_ERR, CFSTR("prefsID not valid"));
+ if ((data != NULL) && !_SCUnserialize((CFPropertyListRef *)&prefsInfo, data, NULL, 0)) {
+ SCLog(TRUE, LOG_ERR, CFSTR("data not valid, %@"), data);
return FALSE;
}
- prefs = SCPreferencesCreate(NULL, CFSTR("SCHelper"), prefsID);
- if (prefsID != NULL) CFRelease(prefsID);
+ if ((prefsInfo == NULL) || !isA_CFDictionary(prefsInfo)) {
+ SCLog(TRUE, LOG_ERR, CFSTR("info not valid"));
+ if (prefsInfo != NULL) CFRelease(prefsInfo);
+ return FALSE;
+ }
- if (prefs == NULL) {
+ // get [optional] prefsID
+ prefsID = CFDictionaryGetValue(prefsInfo, CFSTR("prefsID"));
+ prefsID = isA_CFString(prefsID);
+ if (prefsID != NULL) {
+ if (CFStringHasPrefix(prefsID, CFSTR("/")) ||
+ CFStringHasPrefix(prefsID, CFSTR("../")) ||
+ CFStringHasSuffix(prefsID, CFSTR("/..")) ||
+ (CFStringFind(prefsID, CFSTR("/../"), 0).location != kCFNotFound)) {
+ // if we're trying to escape from the preferences directory
+ SCLog(TRUE, LOG_ERR, CFSTR("prefsID (%@) not valid"), prefsID);
+ CFRelease(prefsInfo);
+ *status = kSCStatusInvalidArgument;
+ return TRUE;
+ }
+ }
+
+ // get preferences session "name"
+ name = CFDictionaryGetValue(prefsInfo, CFSTR("name"));
+ if (!isA_CFString(name)) {
+ SCLog(TRUE, LOG_ERR, CFSTR("session \"name\" not valid"));
+ CFRelease(prefsInfo);
+ return FALSE;
+ }
+
+ // get PID of caller
+ pid = CFDictionaryGetValue(prefsInfo, CFSTR("PID"));
+ if (!isA_CFNumber(pid)) {
+ SCLog(TRUE, LOG_ERR, CFSTR("PID not valid"));
+ CFRelease(prefsInfo);
+ return FALSE;
+ }
+
+ // build [helper] preferences "name" (used for debugging) and estabish
+ // a preferences session.
+ prefsName = CFStringCreateWithFormat(NULL, NULL, CFSTR("%@:%@"), pid, name);
+ prefs = SCPreferencesCreate(NULL, prefsName, prefsID);
+ CFRelease(prefsName);
+ CFRelease(prefsInfo);
+
+ __SCHelperSessionSetPreferences(session, prefs);
+ if (prefs != NULL) {
+ CFRelease(prefs);
+ } else {
*status = SCError();
}
* (out) reply = current signature + current preferences
*/
static Boolean
-do_prefs_Access(void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
+do_prefs_Access(SCHelperSessionRef session, void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
{
Boolean ok;
- SCPreferencesPrivateRef prefsPrivate = (SCPreferencesPrivateRef)prefs;
+ SCPreferencesRef prefs = __SCHelperSessionGetPreferences(session);
CFDataRef signature;
if (prefs == NULL) {
signature = SCPreferencesGetSignature(prefs);
if (signature != NULL) {
- const void * dictKeys[2];
- const void * dictVals[2];
- CFDictionaryRef replyDict;
+ const void * dictKeys[2];
+ const void * dictVals[2];
+ SCPreferencesPrivateRef prefsPrivate = (SCPreferencesPrivateRef)prefs;
+ CFDictionaryRef replyDict;
dictKeys[0] = CFSTR("signature");
dictVals[0] = signature;
* (out) reply = N/A
*/
static Boolean
-do_prefs_Lock(void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
+do_prefs_Lock(SCHelperSessionRef session, void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
{
- CFDataRef clientSignature = (CFDataRef)data;
- Boolean ok;
- Boolean wait = (info == (void *)FALSE) ? FALSE : TRUE;
+ CFDataRef clientSignature = (CFDataRef)data;
+ Boolean ok;
+ SCPreferencesRef prefs = __SCHelperSessionGetPreferences(session);
+ Boolean wait = (info == (void *)FALSE) ? FALSE : TRUE;
if (prefs == NULL) {
return FALSE;
* (out) reply = new signature
*/
static Boolean
-do_prefs_Commit(void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
+do_prefs_Commit(SCHelperSessionRef session, void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
{
Boolean ok;
- SCPreferencesPrivateRef prefsPrivate = (SCPreferencesPrivateRef)prefs;
+ SCPreferencesRef prefs = __SCHelperSessionGetPreferences(session);
if (prefs == NULL) {
return FALSE;
}
if (data != NULL) {
+ SCPreferencesPrivateRef prefsPrivate = (SCPreferencesPrivateRef)prefs;
+
if (prefsPrivate->prefs != NULL) {
CFRelease(prefsPrivate->prefs);
}
* (out) reply = N/A
*/
static Boolean
-do_prefs_Apply(void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
+do_prefs_Apply(SCHelperSessionRef session, void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
{
- Boolean ok;
+ Boolean ok;
+ SCPreferencesRef prefs = __SCHelperSessionGetPreferences(session);
if (prefs == NULL) {
return FALSE;
* (out) reply = N/A
*/
static Boolean
-do_prefs_Unlock(void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
+do_prefs_Unlock(SCHelperSessionRef session, void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
{
- Boolean ok;
+ Boolean ok;
+ SCPreferencesRef prefs = __SCHelperSessionGetPreferences(session);
if (prefs == NULL) {
return FALSE;
* (out) reply = N/A
*/
static Boolean
-do_prefs_Close(void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
+do_prefs_Close(SCHelperSessionRef session, void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
{
+ SCPreferencesRef prefs = __SCHelperSessionGetPreferences(session);
+
if (prefs == NULL) {
return FALSE;
}
- CFRelease(prefs);
- prefs = NULL;
-
+ __SCHelperSessionSetPreferences(session, NULL);
+ *status = -1;
return TRUE;
}
* (out) reply = N/A
*/
static Boolean
-do_prefs_Synchronize(void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
+do_prefs_Synchronize(SCHelperSessionRef session, void *info, CFDataRef data, uint32_t *status, CFDataRef *reply)
{
+ SCPreferencesRef prefs = __SCHelperSessionGetPreferences(session);
+
if (prefs == NULL) {
return FALSE;
}
-
+
SCPreferencesSynchronize(prefs);
*status = kSCStatusOK;
return TRUE;
}
+#pragma mark -
+#pragma mark Process commands
+
+
static Boolean
-hasAuthorization()
+hasAuthorization(SCHelperSessionRef session)
{
+ AuthorizationRef authorization = __SCHelperSessionGetAuthorization(session);
+
+#if !TARGET_OS_IPHONE
AuthorizationFlags flags;
AuthorizationItem items[1];
AuthorizationRights rights;
if (status != errAuthorizationSuccess) {
return FALSE;
}
+#else // !TARGET_OS_IPHONE
+ uid_t peer_euid;
+ gid_t peer_egid;
-if (items[0].flags != 0) SCLog(TRUE, LOG_DEBUG, CFSTR("***** success w/flags (%u) != 0"), items[0].flags);
+ if (authorization == NULL) {
+ return FALSE;
+ }
+
+ __SCHelperSessionGetCredentials(session, &peer_euid, &peer_egid);
+ if ((peer_euid != 0) && (peer_egid != 0)) {
+ static gid_t mobile_gid = -1;
+
+ /*
+ * if peer is not user "root" nor group "wheel" then
+ * we check to see if we are one of the authorized
+ * callers.
+ */
+ if (mobile_gid == -1) {
+ char buffer[1024];
+ struct group grp;
+ struct group *grpP;
+
+ if (getgrnam_r("mobile", &grp, buffer, sizeof(buffer), &grpP) == 0) {
+ mobile_gid = grpP->gr_gid;
+ }
+ }
+
+ if (peer_egid != mobile_gid) {
+ return FALSE;
+ }
+ }
+#endif // !TARGET_OS_IPHONE
+
+// if (items[0].flags != 0) SCLog(TRUE, LOG_DEBUG, CFSTR("***** success w/flags (%u) != 0"), items[0].flags);
return TRUE;
}
-typedef Boolean (*helperFunction) (void *info,
- CFDataRef data,
- uint32_t *status,
- CFDataRef *reply);
+typedef Boolean (*helperFunction) (SCHelperSessionRef session,
+ void *info,
+ CFDataRef data,
+ uint32_t *status,
+ CFDataRef *reply);
static const struct helper {
{ SCHELPER_MSG_INTERFACE_REFRESH, "INTERFACE refresh", TRUE, do_interface_refresh , NULL },
+#if !TARGET_OS_IPHONE
{ SCHELPER_MSG_KEYCHAIN_COPY, "KEYCHAIN copy", TRUE, do_keychain_copy , NULL },
{ SCHELPER_MSG_KEYCHAIN_EXISTS, "KEYCHAIN exists", TRUE, do_keychain_exists , NULL },
{ SCHELPER_MSG_KEYCHAIN_REMOVE, "KEYCHAIN remove", TRUE, do_keychain_remove , NULL },
{ SCHELPER_MSG_KEYCHAIN_SET, "KEYCHAIN set", TRUE, do_keychain_set , NULL },
+#endif // !TARGET_OS_IPHONE
{ SCHELPER_MSG_EXIT, "EXIT", FALSE, do_Exit , NULL }
};
static int
-findHelper(command)
+findHelper(uint32_t command)
{
int i;
}
-int
-main(int argc, char **argv)
+static Boolean
+process_command(SCHelperSessionRef session, int fd, int *err)
{
- int err = 0;
- Boolean ok = TRUE;
+ uint32_t command = 0;
+ CFDataRef data = NULL;
+ int i;
+ Boolean ok = FALSE;
+ CFDataRef reply = NULL;
+ uint32_t status = kSCStatusOK;
+
+ if (!__SCHelper_rxMessage(fd, &command, &data)) {
+ SCLog(TRUE, LOG_ERR, CFSTR("no command"));
+ *err = EIO;
+ goto done;
+ }
- openlog("SCHelper", LOG_CONS|LOG_PID, LOG_DAEMON);
+ i = findHelper(command);
+ if (i == -1) {
+ SCLog(TRUE, LOG_ERR, CFSTR("received unknown command : %u"), command);
+ *err = EINVAL;
+ goto done;
+ }
- if (geteuid() != 0) {
- (void)__SCHelper_txMessage(STDOUT_FILENO, EACCES, NULL);
- exit(EACCES);
+ SCLog(debug, LOG_DEBUG,
+ CFSTR("processing command \"%s\"%s"),
+ helpers[i].commandName,
+ (data != NULL) ? " w/data" : "");
+
+ if (helpers[i].needsAuthorization && !hasAuthorization(session)) {
+ SCLog(debug, LOG_DEBUG,
+ CFSTR("command \"%s\" : not authorized"),
+ helpers[i].commandName);
+ status = kSCStatusAccessError;
}
- // send "we are here" message
- if (!__SCHelper_txMessage(STDOUT_FILENO, 0, NULL)) {
- exit(EIO);
+ if (status == kSCStatusOK) {
+ ok = (*helpers[i].func)(session, helpers[i].info, data, &status, &reply);
}
- while (ok) {
- uint32_t command;
- CFDataRef data;
- int i;
- CFDataRef reply;
- uint32_t status;
+ if ((status != -1) || (reply != NULL)) {
+ SCLog(debug, LOG_DEBUG,
+ CFSTR("sending status %u%s"),
+ status,
+ (reply != NULL) ? " w/reply" : "");
- command = 0;
- data = NULL;
- if (!__SCHelper_rxMessage(STDIN_FILENO, &command, &data)) {
- SCLog(TRUE, LOG_ERR, CFSTR("no command"));
- err = EIO;
- break;
+ if (!__SCHelper_txMessage(fd, status, reply)) {
+ *err = EIO;
+ ok = FALSE;
+ goto done;
}
+ }
- i = findHelper(command);
- if (i == -1) {
- SCLog(TRUE, LOG_ERR, CFSTR("received unknown command : %u"), command);
- err = EINVAL;
- break;
- }
+ done :
- SCLog(TRUE, LOG_DEBUG,
- CFSTR("processing command \"%s\"%s"),
- helpers[i].commandName,
- (data != NULL) ? " w/data" : "");
+ if (data != NULL) {
+ CFRelease(data);
+ }
- status = kSCStatusOK;
- reply = NULL;
+ if (reply != NULL) {
+ CFRelease(reply);
+ }
- if (helpers[i].needsAuthorization && !hasAuthorization()) {
- SCLog(TRUE, LOG_DEBUG,
- CFSTR("command \"%s\" : not authorized"),
- helpers[i].commandName);
- status = kSCStatusAccessError;
- }
+ return ok;
+}
- if (status == kSCStatusOK) {
- ok = (*helpers[i].func)(helpers[i].info, data, &status, &reply);
- }
- SCLog(TRUE, LOG_DEBUG,
- CFSTR("sending status %u%s"),
- status,
- (reply != NULL) ? " w/reply" : "");
+#pragma mark -
+#pragma mark Main loop
+
+
+static void
+readCallback(CFSocketRef s,
+ CFSocketCallBackType callbackType,
+ CFDataRef address,
+ const void *data,
+ void *info)
+{
+ CFSocketNativeHandle fd;
+ int err = 0;
+ Boolean ok;
+ SCHelperSessionRef session = (SCHelperSessionRef)info;
+
+ if (callbackType != kCFSocketReadCallBack) {
+ SCLog(TRUE, LOG_ERR, CFSTR("readCallback w/callbackType = %d"), callbackType);
+ return;
+ }
+
+ fd = CFSocketGetNative(s);
+ ok = process_command(session, fd, &err);
+ if (!ok) {
+ SCLog(debug, LOG_DEBUG, CFSTR("per-session socket : invalidate fd %d"), fd);
+ CFSocketInvalidate(s);
+ }
+
+ return;
+}
+
+
+static void *
+newHelper(void *arg)
+{
+ CFSocketContext context = { 0, NULL, CFRetain, CFRelease, CFCopyDescription };
+ CFSocketNativeHandle fd = (CFSocketNativeHandle)(intptr_t)arg;
+ CFRunLoopSourceRef rls;
+ SCHelperSessionRef session;
+ CFSocketRef sock;
+
+#if TARGET_OS_IPHONE
+ uid_t peer_euid;
+ gid_t peer_egid;
+#endif // TARGET_OS_IPHONE
+
+ session = __SCHelperSessionCreate(NULL);
+#if TARGET_OS_IPHONE
+ if (getpeereid(fd, &peer_euid, &peer_egid) == 0) {
+ __SCHelperSessionSetCredentials(session, peer_euid, peer_egid);
+ } else {
+ SCLog(TRUE, LOG_ERR, CFSTR("getpeereid() failed: %s"), strerror(errno));
+ }
+#endif // TARGET_OS_IPHONE
+
+ context.info = (void *)session;
+ sock = CFSocketCreateWithNative(NULL,
+ fd,
+ kCFSocketReadCallBack,
+ readCallback,
+ &context);
+ CFRelease(session);
+
+ rls = CFSocketCreateRunLoopSource(NULL, sock, 0);
+ CFRelease(sock);
+
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);
+ CFRelease(rls);
+
+ CFRunLoopRun();
+ return NULL;
+}
+
+
+static void
+acceptCallback(CFSocketRef s,
+ CFSocketCallBackType callbackType,
+ CFDataRef address,
+ const void *data,
+ void *info)
+{
+ CFSocketNativeHandle fd;
+ pthread_attr_t tattr;
+ pthread_t tid;
+ static int yes = 1;
+
+ if (callbackType != kCFSocketAcceptCallBack) {
+ SCLog(TRUE, LOG_ERR, CFSTR("acceptCallback w/callbackType = %d"), callbackType);
+ return;
+ }
+
+ if ((data == NULL) ||
+ ((fd = *((CFSocketNativeHandle *)data)) == -1)) {
+ SCLog(TRUE, LOG_ERR, CFSTR("accept w/no FD"));
+ return;
+ }
+
+ if (setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, (const void *)&yes, sizeof(yes)) == -1) {
+ SCLog(TRUE, LOG_ERR, CFSTR("setsockopt(SO_NOSIGPIPE) failed: %s"), strerror(errno));
+ return;
+ }
+
+ // start per-session thread
+ pthread_attr_init(&tattr);
+ pthread_attr_setscope(&tattr, PTHREAD_SCOPE_SYSTEM);
+ pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED);
+ pthread_attr_setstacksize(&tattr, 96 * 1024); // each thread gets a 96K stack
+ pthread_create(&tid, &tattr, newHelper, (void *)(intptr_t)fd);
+ pthread_attr_destroy(&tattr);
- if (!__SCHelper_txMessage(STDOUT_FILENO, status, reply)) {
- err = EIO;
- break;
+ return;
+}
+
+
+#include <launch.h>
+
+
+static const struct option longopts[] = {
+ { "debug", no_argument, 0, 'd' },
+ { 0, 0, 0, 0 }
+};
+
+
+int
+main(int argc, char **argv)
+{
+ Boolean done = FALSE;
+ int err = 0;
+ int i;
+ launch_data_t l_listeners;
+ launch_data_t l_msg;
+ launch_data_t l_reply;
+ launch_data_t l_sockets;
+ launch_data_type_t l_type;
+ int n = 0;
+ extern int optind;
+ int opt;
+ int opti;
+
+ openlog("SCHelper", LOG_CONS|LOG_PID, LOG_DAEMON);
+
+ // process any arguments
+ while ((opt = getopt_long(argc, argv, "d", longopts, &opti)) != -1) {
+ switch(opt) {
+ case 'd':
+ debug = TRUE;
+ break;
+ case 0 :
+// if (strcmp(longopts[opti].name, "debug") == 1) {
+// }
+ break;
+ case '?':
+ default :
+ SCLog(TRUE, LOG_ERR,
+ CFSTR("ignoring unknown or ambiguous command line option"));
+ break;
}
+ }
+// argc -= optind;
+// argv += optind;
- if (reply != NULL) {
- CFRelease(reply);
+ if (geteuid() != 0) {
+ SCLog(TRUE, LOG_ERR, CFSTR("%s"), strerror(EACCES));
+ exit(EACCES);
+ }
+
+ main_runLoop = CFRunLoopGetCurrent();
+
+ l_msg = launch_data_new_string(LAUNCH_KEY_CHECKIN);
+ l_reply = launch_msg(l_msg);
+ launch_data_free(l_msg);
+ l_type = (l_reply != NULL) ? launch_data_get_type(l_reply) : 0;
+ if (l_type != LAUNCH_DATA_DICTIONARY) {
+ SCLog(TRUE, LOG_ERR,
+ CFSTR("SCHelper: error w/launchd " LAUNCH_KEY_CHECKIN " dictionary (%p, %d)"),
+ l_reply,
+ l_type);
+ err = 1;
+ goto done;
+ }
+
+ l_sockets = launch_data_dict_lookup(l_reply, LAUNCH_JOBKEY_SOCKETS);
+ l_type = (l_sockets != NULL) ? launch_data_get_type(l_sockets) : 0;
+ if (l_type != LAUNCH_DATA_DICTIONARY) {
+ SCLog(TRUE, LOG_ERR,
+ CFSTR("SCHelper: error w/" LAUNCH_JOBKEY_SOCKETS " (%p, %d)"),
+ l_sockets,
+ l_type);
+ err = 1;
+ goto done;
+ }
+
+ l_listeners = launch_data_dict_lookup(l_sockets, "Listeners");
+ l_type = (l_listeners != NULL) ? launch_data_get_type(l_listeners) : 0;
+ if (l_type != LAUNCH_DATA_ARRAY) {
+ SCLog(TRUE, LOG_ERR, CFSTR("SCHelper: error w/Listeners (%p, %d)"),
+ l_listeners,
+ l_type);
+ goto done;
+ }
+
+ n = launch_data_array_get_count(l_listeners);
+ for (i = 0; i < n; i++) {
+ CFSocketNativeHandle fd;
+ launch_data_t l_fd;
+ CFRunLoopSourceRef rls;
+ CFSocketRef sock;
+
+ l_fd = launch_data_array_get_index(l_listeners, i);
+ l_type = (l_fd != NULL) ? launch_data_get_type(l_fd) : 0;
+ if (l_type != LAUNCH_DATA_FD) {
+ SCLog(TRUE, LOG_ERR, CFSTR("SCHelper: error w/Listeners[%d] (%p, %d)"),
+ i,
+ l_fd,
+ l_type);
+ err = 1;
+ goto done;
}
+
+ fd = launch_data_get_fd(l_fd);
+ sock = CFSocketCreateWithNative(NULL,
+ fd,
+ kCFSocketAcceptCallBack,
+ acceptCallback,
+ NULL);
+ rls = CFSocketCreateRunLoopSource(NULL, sock, 0);
+ CFRunLoopAddSource(main_runLoop, rls, kCFRunLoopDefaultMode);
+ CFRelease(rls);
+ CFRelease(sock);
}
- if (prefs != NULL) {
- CFRelease(prefs);
+ done :
+
+ if (l_reply != NULL) launch_data_free(l_reply);
+
+ if ((err != 0) || (n == 0)) {
+ exit(err);
}
- if (authorization != NULL) {
- AuthorizationFree(authorization, kAuthorizationFlagDefaults);
-// AuthorizationFree(authorization, kAuthorizationFlagDestroyRights);
+ while (!done) {
+ SInt32 rlStatus;
+
+ rlStatus = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 15.0, TRUE);
+ if (rlStatus == kCFRunLoopRunTimedOut) {
+ pthread_mutex_lock(&sessions_lock);
+ done = ((sessions != NULL) &&
+ (CFSetGetCount(sessions) == 0) &&
+ (sessions_closed == 0));
+ sessions_closed = 0;
+ pthread_mutex_unlock(&sessions_lock);
+ }
}
- exit(err);
+ exit(EX_OK);
}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Label</key>
+ <string>com.apple.SCHelper</string>
+ <key>Program</key>
+ <string>/System/Library/Frameworks/SystemConfiguration.framework/SCHelper</string>
+ <key>Sockets</key>
+ <dict>
+ <key>Listeners</key>
+ <dict>
+ <key>SockFamily</key>
+ <string>Unix</string>
+ <key>SockPathMode</key>
+ <integer>438</integer>
+ <key>SockPathName</key>
+ <string>/var/run/SCHelper</string>
+ </dict>
+ </dict>
+</dict>
+</plist>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Label</key>
+ <string>com.apple.SCHelper</string>
+ <key>Program</key>
+ <string>/System/Library/Frameworks/SystemConfiguration.framework/Resources/SCHelper</string>
+ <key>Sockets</key>
+ <dict>
+ <key>Listeners</key>
+ <dict>
+ <key>SockFamily</key>
+ <string>Unix</string>
+ <key>SockPathMode</key>
+ <integer>438</integer>
+ <key>SockPathName</key>
+ <string>/var/run/SCHelper</string>
+ </dict>
+ </dict>
+</dict>
+</plist>
--- /dev/null
+#!/usr/bin/perl
+
+if (!$ENV{"INSTALL_DIR"} or !$ENV{"PUBLIC_HEADERS_FOLDER_PATH"} or !$ENV{"PRIVATE_HEADERS_FOLDER_PATH"}) {
+ die "Cannot update headers, missing ENV vars\n";
+}
+
+$DO_SPLIT = ($#ARGV >= 0 and $ARGV[0] eq "split");
+
+$API_BASE = $ENV{"INSTALL_DIR"} . "/" . $ENV{"PUBLIC_HEADERS_FOLDER_PATH"};
+$SPI_BASE = $ENV{"INSTALL_DIR"} . "/" . $ENV{"PRIVATE_HEADERS_FOLDER_PATH"};
+
+sub clean_INC {
+ my ($inc) = @_;
+
+ $inc =~ s/#ifdef\s+USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS\s*.*?\n#include\s+<SystemConfiguration\/.*?>.*?\n#else.*?\n//;
+ $inc =~ s/#endif\s+.*?USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS.*?\n//;
+
+ return $inc;
+}
+
+sub clean_API {
+ my ($api) = @_;
+ my ($api_new);
+
+ $api_new = $DO_SPLIT ? $api : clean_INC($api);
+ $api_new =~ s/(__MAC)_\w+\/\*SPI\*\//\1_NA/g;
+ $api_new =~ s/(\(__MAC_OS_X_VERSION_MIN_REQUIRED >= \d+\)\/\*SPI\*\/ \|\| )//g;
+ $api_new =~ s/(__IPHONE)_\w+\/\*SPI\*\//\1_NA/g;
+ $api_new =~ s/( \|\| \(__IPHONE_OS_VERSION_MIN_REQUIRED >= \d+\))\/\*SPI\*\///g;
+
+ return $api_new;
+}
+
+sub clean_SPI {
+ my ($spi) = @_;
+ my ($spi_new);
+
+ $spi_new = clean_INC($spi);
+ $spi_new =~ s/(__MAC_\w+)\/\*SPI\*\//\1/g;
+ $api_new =~ s/(\(__MAC_OS_X_VERSION_MIN_REQUIRED >= \d+\))\/\*SPI\*\/( \|\| )/\1\2/g;
+ $spi_new =~ s/(__IPHONE_\w+)\/\*SPI\*\//\1/g;
+ $spi_new =~ s/( \|\| )(\(__IPHONE_OS_VERSION_MIN_REQUIRED >= \d+\))\/\*SPI\*\//\1\2/g;
+
+ return $spi_new;
+}
+
+#
+# Update .../PrivateHeaders
+#
+
+opendir(HEADERS, $SPI_BASE);
+@headers = readdir(HEADERS);
+closedir(HEADERS);
+
+undef $/;
+for (@headers) {
+ next if ($_ eq '.');
+ next if ($_ eq '..');
+
+ $spi_header = $_;
+ $spi_path = $SPI_BASE . "/" . $spi_header;
+ next if (! -f $spi_path);
+
+ open(SPI, "<", $spi_path);
+ $spi = <SPI>;
+ close(SPI);
+
+ $spi_new = clean_SPI($spi);
+ if ($spi ne $spi_new) {
+# printf "cleaning .../PrivateHeaders/%s\n", $spi_header;
+ open(SPI, ">", $spi_path);
+ print SPI $spi_new;
+ close(SPI);
+ }
+}
+$/ = "\n";
+
+#
+# Update .../Headers
+#
+
+opendir(HEADERS, $API_BASE);
+@headers = readdir(HEADERS);
+closedir(HEADERS);
+
+undef $/;
+for (@headers) {
+ next if ($_ eq '.');
+ next if ($_ eq '..');
+
+ $api_header = $_;
+ $api_path = $API_BASE . "/" . $api_header;
+ next if (! -f $api_path);
+
+ open(API, "<", $api_path);
+ $api = <API>;
+ close(API);
+
+ $api_new = clean_API($api);
+ if ($api ne $api_new) {
+# printf "cleaning .../Headers/%s\n", $api_header;
+ open(API, ">", $api_path);
+ print API $api_new;
+ close(API);
+
+ if ($DO_SPLIT) {
+ $spi_new = clean_SPI($api);
+ if ($api_new ne $spi_new) {
+ if ((($spi_header) = ($api =~ /#ifdef\s+USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS\s*.*?\n#include\s+<SystemConfiguration\/(.*?\.h)>\s*.*?\n/))) {
+ if ($api_header eq $spi_header) {
+ die "API & SPI header not unique: $api_header\n";
+ }
+ } else {
+ die "Header missing #ifdef/#else/#endif: $api_header\n";
+# $spi_header = $api_header;
+# $spi_header =~ s/\.h$/PRIVATE.h/;
+ }
+
+# printf " adding .../PrivateHeaders/%s\n", $spi_header;
+ $spi_path = $SPI_BASE . "/" . $spi_header;
+ open(SPI, ">", $spi_path);
+ print SPI $spi_new;
+ close(SPI);
+ }
+ }
+ }
+}
+$/ = "\n";
+
+exit 0;
/*
- * Copyright (c) 2000, 2001, 2003-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003-2005, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
__private_extern__
void
-pushNotifications()
+pushNotifications(FILE *_configd_trace)
{
const void **sessionsToNotify;
CFIndex notifyCnt;
/*
* Post notification as mach message
*/
-#ifdef DEBUG
- if (_configd_verbose) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("sending mach message notification."));
- SCLog(TRUE, LOG_DEBUG, CFSTR(" port = %d"), storePrivate->notifyPort);
- SCLog(TRUE, LOG_DEBUG, CFSTR(" msgid = %d"), storePrivate->notifyPortIdentifier);
+ if (_configd_trace != NULL) {
+ SCTrace(TRUE, _configd_trace,
+ CFSTR("%s : %5d : port = %d, msgid = %d\n"),
+ "-->port",
+ storePrivate->server,
+ storePrivate->notifyPort,
+ storePrivate->notifyPortIdentifier);
}
-#endif /* DEBUG */
+
_SC_sendMachMessage(storePrivate->notifyPort, storePrivate->notifyPortIdentifier);
}
(storePrivate->notifyFile >= 0)) {
ssize_t written;
-#ifdef DEBUG
- if (_configd_verbose) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("sending (UNIX domain) socket notification"));
- SCLog(TRUE, LOG_DEBUG, CFSTR(" fd = %d"), storePrivate->notifyFile);
- SCLog(TRUE, LOG_DEBUG, CFSTR(" msgid = %d"), storePrivate->notifyFileIdentifier);
+ if (_configd_trace != NULL) {
+ SCTrace(TRUE, _configd_trace,
+ CFSTR("%s : %5d : fd = %d, msgid = %d\n"),
+ "-->fd ",
+ storePrivate->server,
+ storePrivate->notifyFile,
+ storePrivate->notifyFileIdentifier);
}
-#endif /* DEBUG */
written = write(storePrivate->notifyFile,
&storePrivate->notifyFileIdentifier,
*/
status = pid_for_task(storePrivate->notifySignalTask, &pid);
if (status == KERN_SUCCESS) {
-#ifdef DEBUG
- if (_configd_verbose) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("sending signal notification"));
- SCLog(TRUE, LOG_DEBUG, CFSTR(" pid = %d"), pid);
- SCLog(TRUE, LOG_DEBUG, CFSTR(" signal = %d"), storePrivate->notifySignal);
+ if (_configd_trace != NULL) {
+ SCTrace(TRUE, _configd_trace,
+ CFSTR("%s : %5d : pid = %d, signal = sig%s (%d)\n"),
+ "-->sig ",
+ storePrivate->server,
+ pid,
+ sys_signame[storePrivate->notifySignal],
+ storePrivate->notifySignal);
}
-#endif /* DEBUG */
+
if (kill(pid, storePrivate->notifySignal) != 0) {
-#ifdef DEBUG
- SCLog(_configd_verbose, LOG_DEBUG, CFSTR("could not send signal: %s"), strerror(errno));
-#endif /* DEBUG */
- status = KERN_FAILURE;
+ if (errno != ESRCH) {
+ SCLog(TRUE, LOG_ERR,
+ CFSTR("could not send sig%s to PID %d: %s"),
+ sys_signame[storePrivate->notifySignal],
+ pid,
+ strerror(errno));
+ }
}
} else {
mach_port_type_t pt;
- if ((mach_port_type(mach_task_self(), storePrivate->notifySignalTask, &pt) == KERN_SUCCESS) &&
- (pt & MACH_PORT_TYPE_DEAD_NAME)) {
- SCLog(_configd_verbose, LOG_DEBUG, CFSTR("could not send signal, process died"));
+ __MACH_PORT_DEBUG(TRUE, "*** pushNotifications pid_for_task failed: releasing task", storePrivate->notifySignalTask);
+ if (mach_port_type(mach_task_self(), storePrivate->notifySignalTask, &pt) == KERN_SUCCESS) {
+ if ((pt & MACH_PORT_TYPE_DEAD_NAME) != 0) {
+ SCLog(TRUE, LOG_ERR, CFSTR("pushNotifications pid_for_task() failed: %s"), mach_error_string(status));
+ }
} else {
- SCLog(_configd_verbose, LOG_DEBUG, CFSTR("could not send signal: %s"), mach_error_string(status));
+ SCLog(TRUE, LOG_ERR, CFSTR("pushNotifications mach_port_type() failed: %s"), mach_error_string(status));
}
- }
- if (status != KERN_SUCCESS) {
/* don't bother with any more attempts */
- (void) mach_port_destroy(mach_task_self(), storePrivate->notifySignalTask);
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->notifySignalTask);
storePrivate->notifySignal = 0;
storePrivate->notifySignalTask = TASK_NULL;
}
/*
- * Copyright (c) 2000, 2001, 2003, 2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003, 2004, 2006, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
int
__SCDynamicStoreNotifyMachPort (SCDynamicStoreRef store,
mach_msg_id_t msgid,
- mach_port_t *port);
+ mach_port_t port);
int
__SCDynamicStoreNotifyFileDescriptor (SCDynamicStoreRef store,
CFStringRef watchedKey);
void
-pushNotifications (void);
+pushNotifications (FILE *_configd_trace);
__END_DECLS
/*
- * Copyright (c) 2000, 2001, 2003, 2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003, 2004, 2006, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
{
CFStringRef key = NULL; /* key (un-serialized) */
CFDataRef data = NULL; /* data (un-serialized) */
- serverSessionRef mySession = getSession(server);
+ serverSessionRef mySession;
*sc_status = kSCStatusOK;
goto done;
}
+ mySession = getSession(server);
if (mySession == NULL) {
*sc_status = kSCStatusNoStoreSession; /* you must have an open session to play */
goto done;
{
CFDataRef data = NULL; /* data (un-serialized) */
CFStringRef key = NULL; /* key (un-serialized) */
- serverSessionRef mySession = getSession(server);
+ serverSessionRef mySession;
SCDynamicStorePrivateRef storePrivate;
Boolean useSessionKeys;
goto done;
}
+ mySession = getSession(server);
if (mySession == NULL) {
*sc_status = kSCStatusNoStoreSession; /* you must have an open session to play */
goto done;
/*
- * Copyright (c) 2000, 2001, 2003, 2004, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003, 2004, 2006-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
removeAllKeys(*store, TRUE); // patterns
/* Remove/cancel any outstanding notification requests. */
+ __MACH_PORT_DEBUG(storePrivate->notifyPort != MACH_PORT_NULL, "*** __SCDynamicStoreClose", storePrivate->notifyPort);
(void) __SCDynamicStoreNotifyCancel(*store);
/* Remove any session keys */
if (mySession->serverRunLoopSource) {
CFRunLoopSourceInvalidate(mySession->serverRunLoopSource);
CFRelease(mySession->serverRunLoopSource);
+ mySession->serverRunLoopSource = NULL;
+ }
+ if (mySession->serverPort != NULL) {
+ CFMachPortInvalidate(mySession->serverPort);
+ CFRelease(mySession->serverPort);
+ mySession->serverPort = NULL;
}
- CFMachPortInvalidate(mySession->serverPort);
- CFRelease(mySession->serverPort);
storePrivate->server = MACH_PORT_NULL;
CFRelease(*store);
/*
* Close the session.
*/
+ __MACH_PORT_DEBUG(TRUE, "*** _configclose", server);
*sc_status = __SCDynamicStoreClose(&mySession->store, FALSE);
if (*sc_status != kSCStatusOK) {
+ SCLog(TRUE, LOG_ERR,
+ CFSTR("_configclose __SCDynamicStoreClose() failed, status = %s"),
+ SCErrorString(*sc_status));
return KERN_SUCCESS;
}
+ __MACH_PORT_DEBUG(TRUE, "*** _configclose (after __SCDynamicStoreClose)", server);
/*
- * Remove send and receive right
+ * Remove our receive right.
+ *
+ * Note: there is no need to cancel the notification request because the
+ * kernel will have no way to deliver the notification once the
+ * receive right has been removed.
*/
- mach_port_mod_refs(mach_task_self(), mySession->key, MACH_PORT_RIGHT_SEND , -1);
- mach_port_mod_refs(mach_task_self(), mySession->key, MACH_PORT_RIGHT_RECEIVE, -1);
+ (void) mach_port_mod_refs(mach_task_self(), server, MACH_PORT_RIGHT_RECEIVE, -1);
/*
* Remove the session entry.
/*
- * Copyright (c) 2000-2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2004, 2006, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
)
{
CFStringRef key = NULL; /* key (un-serialized) */
- serverSessionRef mySession = getSession(server);
+ serverSessionRef mySession;
Boolean ok;
CFDataRef value;
goto done;
}
+ mySession = getSession(server);
if (mySession == NULL) {
*sc_status = kSCStatusNoStoreSession; /* you must have an open session to play */
goto done;
{
CFDictionaryRef dict = NULL; /* keys/values (un-serialized) */
CFArrayRef keys = NULL; /* keys (un-serialized) */
- serverSessionRef mySession = getSession(server);
+ serverSessionRef mySession;
Boolean ok;
CFArrayRef patterns = NULL; /* patterns (un-serialized) */
goto done;
}
+ mySession = getSession(server);
if (mySession == NULL) {
*sc_status = kSCStatusNoStoreSession; /* you must have an open session to play */
goto done;
/*
- * Copyright (c) 2000-2004, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2004, 2006-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
)
{
CFStringRef key = NULL; /* key (un-serialized) */
- serverSessionRef mySession = getSession(server);
+ serverSessionRef mySession;
Boolean ok;
CFArrayRef subKeys; /* array of CFStringRef's */
goto done;
}
+ mySession = getSession(server);
if (mySession == NULL) {
*sc_status = kSCStatusNoStoreSession; /* you must have an open session to play */
goto done;
/*
- * Copyright (c) 2000, 2001, 2003, 2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003, 2004, 2006, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
/* check credentials */
mySession = getSession(storePrivate->server);
- if (mySession->callerEUID != 0) {
+ if (!hasWriteAccess(mySession)) {
return kSCStatusAccessError;
}
/*
- * Copyright (c) 2000-2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2004, 2006, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
)
{
CFStringRef key = NULL; /* key (un-serialized) */
- serverSessionRef mySession = getSession(server);
+ serverSessionRef mySession;
/* un-serialize the key */
if (!_SCUnserializeString(&key, NULL, (void *)keyRef, keyLen)) {
goto done;
}
+ mySession = getSession(server);
if (mySession == NULL) {
*sc_status = kSCStatusNoStoreSession; /* you must have an open session to play */
goto done;
/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*/
mySession = addSession(MACH_PORT_NULL, openMPCopyDescription);
*newServer = mySession->key;
+ __MACH_PORT_DEBUG(TRUE, "*** _configopen (after addSession)", *newServer);
- /*
- * get the credentials associated with the caller.
- */
- audit_token_to_au32(audit_token,
- NULL, // auidp
- &mySession->callerEUID, // euid
- NULL, // egid
- NULL, // ruid
- NULL, // rgid
- NULL, // pid
- NULL, // asid
- NULL); // tid
+ /* save the audit_token in case we need to check the callers credentials */
+ mySession->auditToken = audit_token;
/* Create and add a run loop source for the port */
mySession->serverRunLoopSource = CFMachPortCreateRunLoopSource(NULL, mySession->serverPort, 0);
/*
* Make the server port accessible to the framework routines.
+ * ... and be sure to clear before calling CFRelease(store)
*/
storePrivate->server = *newServer;
MACH_MSG_TYPE_MAKE_SEND_ONCE,
&oldNotify);
if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("_configopen() mach_port_request_notification() failed: %s"), mach_error_string(status));
+ SCLog(TRUE, LOG_ERR, CFSTR("_configopen() mach_port_request_notification() failed: %s"), mach_error_string(status));
cleanupSession(*newServer);
*newServer = MACH_PORT_NULL;
*sc_status = kSCStatusFailed;
goto done;
}
+ __MACH_PORT_DEBUG(TRUE, "*** _configopen (after mach_port_request_notification)", *newServer);
-#ifdef DEBUG
if (oldNotify != MACH_PORT_NULL) {
- SCLog(TRUE, LOG_ERR, CFSTR("_configopen(): why is oldNotify != MACH_PORT_NULL?"));
+ SCLog(TRUE, LOG_ERR, CFSTR("_configopen(): oldNotify != MACH_PORT_NULL"));
}
-#endif /* DEBUG */
/*
* Save the name of the calling application / plug-in with the session data.
CFRelease(newInfo);
CFRelease(sessionKey);
+ /*
+ * Note: at this time we should be holding ONE send right and
+ * ONE receive right to the server. The send right is
+ * moved to the caller.
+ */
+
done :
if (name != NULL) CFRelease(name);
/*
- * Copyright (c) 2000-2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2004, 2006, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
)
{
CFStringRef key = NULL; /* key (un-serialized) */
- serverSessionRef mySession = getSession(server);
+ serverSessionRef mySession;
/* un-serialize the key */
if (!_SCUnserializeString(&key, NULL, (void *)keyRef, keyLen)) {
goto done;
}
+ mySession = getSession(server);
if (mySession == NULL) {
*sc_status = kSCStatusNoStoreSession; /* you must have an open session to play */
goto done;
/*
- * Copyright (c) 2000-2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2004, 2006, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
{
CFDataRef data = NULL; /* data (un-serialized) */
CFStringRef key = NULL; /* key (un-serialized) */
- serverSessionRef mySession = getSession(server);
+ serverSessionRef mySession;
*sc_status = kSCStatusOK;
goto done;
}
+ mySession = getSession(server);
if (mySession == NULL) {
*sc_status = kSCStatusNoStoreSession; /* you must have an open session to play */
goto done;
int *sc_status)
{
CFDictionaryRef dict = NULL; /* key/value dictionary (un-serialized) */
- serverSessionRef mySession = getSession(server);
+ serverSessionRef mySession;
CFArrayRef notify = NULL; /* keys to notify (un-serialized) */
CFArrayRef remove = NULL; /* keys to remove (un-serialized) */
goto done;
}
+ mySession = getSession(server);
if (mySession == NULL) {
/* you must have an open session to play */
*sc_status = kSCStatusNoStoreSession;
/*
- * Copyright (c) 2000-2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2004, 2006, 2008, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
__SCDynamicStoreTouchValue(SCDynamicStoreRef store, CFStringRef key)
{
SCDynamicStorePrivateRef storePrivate = (SCDynamicStorePrivateRef)store;
- int sc_status;
+ int sc_status = kSCStatusOK;
CFDataRef value;
if ((store == NULL) || (storePrivate->server == MACH_PORT_NULL)) {
*/
__SCDynamicStoreUnlock(store, TRUE);
- return kSCStatusOK;
+ return sc_status;
}
)
{
CFStringRef key = NULL; /* key (un-serialized) */
- serverSessionRef mySession = getSession(server);
+ serverSessionRef mySession;
/* un-serialize the key */
if (!_SCUnserializeString(&key, NULL, (void *)keyRef, keyLen)) {
goto done;
}
+ mySession = getSession(server);
if (mySession == NULL) {
*sc_status = kSCStatusNoStoreSession; /* you must have an open session to play */
goto done;
/*
- * Copyright (c) 2000-2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2004, 2006, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
)
{
CFStringRef key = NULL; /* key (un-serialized) */
- serverSessionRef mySession = getSession(server);
+ serverSessionRef mySession;
/* un-serialize the key */
if (!_SCUnserializeString(&key, NULL, (void *)keyRef, keyLen)) {
goto done;
}
+ mySession = getSession(server);
if (mySession == NULL) {
*sc_status = kSCStatusNoStoreSession; /* you must have an open session to play */
goto done;
)
{
CFArrayRef keys = NULL; /* key (un-serialized) */
- serverSessionRef mySession = getSession(server);
+ serverSessionRef mySession;
CFArrayRef patterns = NULL; /* patterns (un-serialized) */
*sc_status = kSCStatusOK;
goto done;
}
+ mySession = getSession(server);
if (mySession == NULL) {
/* you must have an open session to play */
*sc_status = kSCStatusNoStoreSession;
/*
- * Copyright (c) 2000, 2001, 2003-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003-2006, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* cleanup any mach port based notifications.
*/
if (storePrivate->notifyPort != MACH_PORT_NULL) {
- (void) mach_port_destroy(mach_task_self(), storePrivate->notifyPort);
+ __MACH_PORT_DEBUG(TRUE, "*** __SCDynamicStoreNotifyCancel (notify port)", storePrivate->notifyPort);
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->notifyPort);
storePrivate->notifyPort = MACH_PORT_NULL;
}
* cleanup any signal notifications.
*/
if (storePrivate->notifySignal > 0) {
- (void) mach_port_destroy(mach_task_self(), storePrivate->notifySignalTask);
+ __MACH_PORT_DEBUG(TRUE, "*** __SCDynamicStoreNotifyCancel (signal)", storePrivate->notifySignalTask);
+ (void) mach_port_deallocate(mach_task_self(), storePrivate->notifySignalTask);
storePrivate->notifySignal = 0;
storePrivate->notifySignalTask = TASK_NULL;
}
return KERN_SUCCESS;
}
+ __MACH_PORT_DEBUG(((SCDynamicStorePrivateRef)mySession->store)->notifyPort != MACH_PORT_NULL,
+ "*** _notifycancel",
+ ((SCDynamicStorePrivateRef)mySession->store)->notifyPort);
*sc_status = __SCDynamicStoreNotifyCancel(mySession->store);
return KERN_SUCCESS;
}
/*
- * Copyright (c) 2000-2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2004, 2006, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
)
{
CFStringRef key = NULL; /* key (un-serialized) */
- serverSessionRef mySession = getSession(server);
+ serverSessionRef mySession;
/* un-serialize the key */
if (!_SCUnserializeString(&key, NULL, (void *)keyRef, keyLen)) {
goto done;
}
+ mySession = getSession(server);
if (mySession == NULL) {
*sc_status = kSCStatusNoStoreSession; /* you must have an open session to play */
goto done;
/*
- * Copyright (c) 2000, 2001, 2003-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003-2006, 2008, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include <unistd.h>
#include <sys/ioctl.h>
+#include <sys/stat.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
serverSessionRef mySession = getSession(server);
int nbioYes;
int sock;
- kern_return_t status;
- SCDynamicStorePrivateRef storePrivate = (SCDynamicStorePrivateRef)mySession->store;
+ SCDynamicStorePrivateRef storePrivate;
struct sockaddr_un un;
/*
/* validate the UNIX domain socket path */
if (pathLen > (sizeof(un.sun_path) - 1)) {
SCLog(TRUE, LOG_NOTICE, CFSTR("_notifyviafd(): domain socket path length too long!"));
- status = vm_deallocate(mach_task_self(), (vm_address_t)pathRef, pathLen);
-#ifdef DEBUG
- if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("_notifyviafd vm_deallocate() failed: %s"), mach_error_string(status));
- /* non-fatal???, proceed */
- }
-#endif /* DEBUG */
+ (void) vm_deallocate(mach_task_self(), (vm_address_t)pathRef, pathLen);
*sc_status = kSCStatusFailed;
return KERN_SUCCESS;
}
un.sun_family = AF_UNIX;
bcopy(pathRef, un.sun_path, pathLen);
un.sun_path[pathLen] = '\0';
- status = vm_deallocate(mach_task_self(), (vm_address_t)pathRef, pathLen);
-#ifdef DEBUG
- if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("_notifyviafd vm_deallocate() failed: %s"), mach_error_string(status));
- /* non-fatal???, proceed */
- }
-#endif /* DEBUG */
+ (void) vm_deallocate(mach_task_self(), (vm_address_t)pathRef, pathLen);
if (mySession == NULL) {
*sc_status = kSCStatusNoStoreSession; /* you must have an open session to play */
return KERN_SUCCESS;
}
+ storePrivate = (SCDynamicStorePrivateRef)mySession->store;
+
+ /* check permissions */
+ if (!hasRootAccess(mySession)) {
+ struct stat statbuf;
+
+ bzero(&statbuf, sizeof(statbuf));
+ if (stat(un.sun_path, &statbuf) == -1) {
+ *sc_status = errno;
+ SCLog(TRUE, LOG_DEBUG, CFSTR("_notifyviafd stat() failed: %s"), strerror(errno));
+ return KERN_SUCCESS;
+ }
+ if (mySession->callerEUID != statbuf.st_uid) {
+ *sc_status = kSCStatusAccessError;
+ SCLog(TRUE, LOG_DEBUG, CFSTR("_notifyviafd permissions error"));
+ return KERN_SUCCESS;
+ }
+ }
/* do common sanity checks, get socket */
*sc_status = __SCDynamicStoreNotifyFileDescriptor(mySession->store, identifier, &sock);
/* establish the connection, get ready for a read() */
if (connect(sock, (struct sockaddr *)&un, sizeof(un)) == -1) {
+ *sc_status = errno;
SCLog(TRUE, LOG_DEBUG, CFSTR("_notifyviafd connect() failed: %s"), strerror(errno));
(void) close(sock);
- storePrivate->notifyStatus = NotifierNotRegistered;
- storePrivate->notifyFile = -1;
- *sc_status = kSCStatusFailed;
return KERN_SUCCESS;
}
- (void) unlink(un.sun_path);
-
bufSiz = sizeof(storePrivate->notifyFileIdentifier);
if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF, &bufSiz, sizeof(bufSiz)) == -1) {
+ *sc_status = errno;
SCLog(TRUE, LOG_DEBUG, CFSTR("_notifyviafd setsockopt() failed: %s"), strerror(errno));
(void) close(sock);
- *sc_status = kSCStatusFailed;
return KERN_SUCCESS;
}
nbioYes = 1;
if (ioctl(sock, FIONBIO, &nbioYes) == -1) {
+ *sc_status = errno;
SCLog(TRUE, LOG_DEBUG, CFSTR("_notifyviafd ioctl(,FIONBIO,) failed: %s"), strerror(errno));
(void) close(sock);
- *sc_status = kSCStatusFailed;
return KERN_SUCCESS;
}
/*
- * Copyright (c) 2000, 2001, 2003, 2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003, 2004, 2006, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
int
__SCDynamicStoreNotifyMachPort(SCDynamicStoreRef store,
mach_msg_id_t identifier,
- mach_port_t *port)
+ mach_port_t port)
{
SCDynamicStorePrivateRef storePrivate = (SCDynamicStorePrivateRef)store;
CFStringRef sessionKey;
return kSCStatusNotifierActive;
}
- if (*port == MACH_PORT_NULL) {
+ if (port == MACH_PORT_NULL) {
/* sorry, you must specify a valid mach port */
return kSCStatusInvalidArgument;
}
int *sc_status
)
{
- serverSessionRef mySession = getSession(server);
- SCDynamicStorePrivateRef storePrivate = (SCDynamicStorePrivateRef)mySession->store;
+ serverSessionRef mySession = getSession(server);
+ SCDynamicStorePrivateRef storePrivate;
if (mySession == NULL) {
- *sc_status = kSCStatusNoStoreSession; /* you must have an open session to play */
+ /* sorry, you must have an open session to play */
+ *sc_status = kSCStatusNoStoreSession;
+ if (port != MACH_PORT_NULL) {
+ (void) mach_port_deallocate(mach_task_self(), port);
+ }
return KERN_SUCCESS;
}
-
- if (storePrivate->notifyPort != MACH_PORT_NULL) {
- // destroying [old] callback mach port
- (void) mach_port_destroy(mach_task_self(), storePrivate->notifyPort);
+ storePrivate = (SCDynamicStorePrivateRef)mySession->store;
+
+ *sc_status = __SCDynamicStoreNotifyMachPort(mySession->store, identifier, port);
+ if (*sc_status != kSCStatusOK) {
+ // if we can't enable the notification, release the provided callback port
+ if (port != MACH_PORT_NULL) {
+ __MACH_PORT_DEBUG(TRUE, "*** _notifyviaport __SCDynamicStoreNotifyMachPort failed: releasing port", port);
+ (void) mach_port_deallocate(mach_task_self(), port);
+ }
+ return KERN_SUCCESS;
}
- *sc_status = __SCDynamicStoreNotifyMachPort(mySession->store, identifier, &port);
-
- if (*sc_status == kSCStatusOK) {
- /* save notification port, requested identifier, and set notifier active */
- storePrivate->notifyStatus = Using_NotifierInformViaMachPort;
- storePrivate->notifyPort = port;
- storePrivate->notifyPortIdentifier = identifier;
- }
+ /* save notification port, requested identifier, and set notifier active */
+ __MACH_PORT_DEBUG(TRUE, "*** _notifyviaport", port);
+ storePrivate->notifyStatus = Using_NotifierInformViaMachPort;
+ storePrivate->notifyPort = port;
+ storePrivate->notifyPortIdentifier = identifier;
return KERN_SUCCESS;
}
/*
- * Copyright (c) 2000-2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2004, 2006, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
serverSessionRef mySession = getSession(server);
pid_t pid;
kern_return_t status;
- SCDynamicStorePrivateRef storePrivate = (SCDynamicStorePrivateRef)mySession->store;
-#ifdef NOTYET
- mach_port_t oldNotify;
-#endif /* NOTYET */
-
- status = pid_for_task(task, &pid);
- if (status != KERN_SUCCESS) {
- *sc_status = kSCStatusFailed; /* could not determine pid for task */
- return KERN_SUCCESS;
- }
+ SCDynamicStorePrivateRef storePrivate;
if (mySession == NULL) {
- *sc_status = kSCStatusNoStoreSession; /* you must have an open session to play */
- return KERN_SUCCESS;
- }
-
- *sc_status = __SCDynamicStoreNotifySignal(mySession->store, pid, sig);
- if (*sc_status != kSCStatusOK) {
+ /* sorry, you must have an open session to play */
+ *sc_status = kSCStatusNoStoreSession;
if (task != TASK_NULL) {
- (void) mach_port_destroy(mach_task_self(), task);
+ (void) mach_port_deallocate(mach_task_self(), task);
}
return KERN_SUCCESS;
}
-
-#ifdef DEBUG
- { mach_port_type_t pt;
-
- status = mach_port_type(mach_task_self(), task, &pt);
- if (status == MACH_MSG_SUCCESS) {
- char rights[8], *rp = &rights[0];
-
- if (pt & MACH_PORT_TYPE_SEND)
- *rp++ = 'S';
- if (pt & MACH_PORT_TYPE_RECEIVE)
- *rp++ = 'R';
- if (pt & MACH_PORT_TYPE_SEND_ONCE)
- *rp++ = 'O';
- if (pt & MACH_PORT_TYPE_PORT_SET)
- *rp++ = 'P';
- if (pt & MACH_PORT_TYPE_DEAD_NAME)
- *rp++ = 'D';
- *rp = '\0';
-
- SCLog(_configd_verbose, LOG_DEBUG, CFSTR("Task %d, port rights = %s"), task, rights);
+ storePrivate = (SCDynamicStorePrivateRef)mySession->store;
+
+ if (task != TASK_NULL) {
+ status = pid_for_task(task, &pid);
+ if (status != KERN_SUCCESS) {
+ /* could not determine pid for task */
+ *sc_status = kSCStatusFailed;
+ (void) mach_port_deallocate(mach_task_self(), task);
+ return KERN_SUCCESS;
}
- }
-#endif /* DEBUG */
-
-#ifdef NOTYET
- /* Request a notification when/if the client dies */
- status = mach_port_request_notification(mach_task_self(),
- task,
- MACH_NOTIFY_DEAD_NAME,
- 1,
- task,
- MACH_MSG_TYPE_MAKE_SEND_ONCE,
- &oldNotify);
- if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("_notifyviasignal mach_port_request_notification() failed: %s"), mach_error_string(status));
- *sc_status = kSCStatusFailed;
+ } else {
+ /* sorry, you must specify a valid task */
+ *sc_status = kSCStatusInvalidArgument;
return KERN_SUCCESS;
}
-#ifdef NOTYET_DEBUG
- if (oldNotify != MACH_PORT_NULL) {
- SCLog(TRUE, LOG_ERR, CFSTR("_notifyviasignal(): why is oldNotify != MACH_PORT_NULL?"));
- }
-#endif /* NOTYET_DEBUG */
-
- // add task notification port to the server's port set
- status = mach_port_move_member(mach_task_self(), task, server_ports);
- if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_DEBUG, CFSTR("_notifyviasignal mach_port_move_member() failed: %s"), mach_error_string(status));
- *sc_status = kSCStatusFailed;
+ *sc_status = __SCDynamicStoreNotifySignal(mySession->store, pid, sig);
+ if (*sc_status != kSCStatusOK) {
+ __MACH_PORT_DEBUG(TRUE, "*** _notifyviasignal __SCDynamicStoreNotifySignal failed: releasing task)", task);
+ (void) mach_port_deallocate(mach_task_self(), task);
return KERN_SUCCESS;
}
-#endif /* NOTYET */
+ __MACH_PORT_DEBUG(TRUE, "*** _notifyviasignal", task);
storePrivate->notifyStatus = Using_NotifierInformViaSignal;
storePrivate->notifySignal = sig;
storePrivate->notifySignalTask = task;
/*
- * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2006, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
/* check credentials */
mySession = getSession(storePrivate->server);
- if (mySession->callerEUID != 0) {
+ if (!hasRootAccess(mySession)) {
return kSCStatusAccessError;
}
SCPrint(TRUE, f, CFSTR("Plug-in thread :\n\n"));
SCPrint(TRUE, f, CFSTR("%@\n"), plugin_runLoop);
}
+ listSessions(f);
(void) fclose(f);
/* Save a snapshot of the "store" data */
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key>EnableTransactions</key>
+ <true/>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.apple.configd</string>
+ <key>MachExceptionHandler</key>
+ <string>com.apple.ReportCrash.DirectoryService</string>
<key>MachServices</key>
<dict>
<key>com.apple.SystemConfiguration.configd</key>
</dict>
<key>ProgramArguments</key>
<array>
- <string>/usr/sbin/configd</string>
+ <string>/usr/libexec/configd</string>
</array>
+ <key>Umask</key>
+ <integer>18</integer>
</dict>
</plist>
are used to establish and maintain the network configuration.
These agents include:
.Pp
-.Ss ATconfig
-This bundle is responsible for establishing and maintaining the AppleTalk network configuration on the system.
.Ss KernelEventMonitor
This bundle is responsible for monitoring kernel events and conveying changes to the network state (e.g. link status) to other configuration agents and interested applications.
.Ss InterfaceNamer
.Ss LinkConfiguration
This agent is responsible for establishing and maintaining the media type, media options, and MTU for ethernet interfaces.
.Ss PreferencesMonitor
-This agent is responsible for conveying the network configuration preferences specified by the administrator to the various configuration agents (AppleTalk, IPv4, IPv6, ...).
+This agent is responsible for conveying the network configuration preferences specified by the administrator to the various configuration agents (IPv4, IPv6, ...).
.Ss PPPController
This agent is responsible for establishing and maintaining PPP connections on the system.
.Sh FILES
/*
- * Copyright (c) 2000, 2001, 2003, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003, 2006, 2007 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
extern Boolean _configd_verbose; /* TRUE if verbose logging enabled */
extern FILE *_configd_trace; /* non-NULL if tracing enabled */
extern CFMutableSetRef _plugins_exclude; /* bundle identifiers to exclude from loading */
+extern Boolean _plugins_fork; /* TRUE if plugins should be exec'd in their own process */
extern CFMutableSetRef _plugins_verbose; /* bundle identifiers to enable verbose logging */
__BEGIN_DECLS
/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include <sys/wait.h>
#include <objc/objc-runtime.h>
#include <servers/bootstrap.h>
+#include <vproc.h>
+#include <vproc_priv.h>
#include "configd.h"
#include "configd_server.h"
__private_extern__
CFMutableSetRef _plugins_exclude = NULL; /* bundle identifiers to exclude from loading */
+__private_extern__
+Boolean _plugins_fork = FALSE; /* TRUE if plugins should be exec'd in their own process */
+
__private_extern__
CFMutableSetRef _plugins_verbose = NULL; /* bundle identifiers to enable verbose logging */
}
-static void
-allow_crash_reports(void)
-{
- mach_msg_type_number_t i;
- exception_mask_t masks[EXC_TYPES_COUNT];
- mach_msg_type_number_t n_masks = 0;
- mach_port_t new_exception_port = MACH_PORT_NULL;
- exception_port_t old_handlers[EXC_TYPES_COUNT];
- exception_behavior_t old_behaviors[EXC_TYPES_COUNT];
- thread_state_flavor_t old_flavors[EXC_TYPES_COUNT];
- kern_return_t status;
-
- status = bootstrap_look_up(bootstrap_port, "com.apple.ReportCrash.DirectoryService", &new_exception_port);
- if (status != BOOTSTRAP_SUCCESS) {
- SCLog(TRUE, LOG_ERR,
- CFSTR("allow_crash_reports bootstrap_look_up() failed: %s"),
- bootstrap_strerror(status));
- return;
- }
-
- // get information about the original crash exception port for the task
- status = task_get_exception_ports(mach_task_self(),
- EXC_MASK_CRASH,
- masks,
- &n_masks,
- old_handlers,
- old_behaviors,
- old_flavors);
- if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_ERR,
- CFSTR("allow_crash_reports task_get_exception_ports() failed: %s"),
- mach_error_string(status));
- return;
- }
-
- // replace the original crash exception port with our new port
- for (i = 0; i < n_masks; i++) {
- status = task_set_exception_ports(mach_task_self(),
- masks[i],
- new_exception_port,
- old_behaviors[i],
- old_flavors[i]);
- if (status != KERN_SUCCESS) {
- SCLog(TRUE, LOG_ERR,
- CFSTR("allow_crash_reports task_set_exception_ports() failed: %s"),
- mach_error_string(status));
- }
- }
-
- return;
-}
-
-
static void
catcher(int signum)
{
* such, let's also push any remaining log
* messages to stdout/stderr.
*/
- _sc_log++;
+ _sc_log = 2;
}
/*
, NULL
, termMPCopyDescription
};
- Boolean enableRestart = (argc <= 1); /* only if there are no arguments */
Boolean forceForeground = FALSE;
+ Boolean forcePlugin = FALSE;
+ int64_t is_launchd_job = 0;
mach_port_limits_t limits;
Boolean loadBundles = TRUE;
struct sigaction nact;
extern int optind;
const char *prog = argv[0];
CFRunLoopSourceRef rls;
- mach_port_t service_port = MACH_PORT_NULL;
kern_return_t status;
CFStringRef str;
const char *testBundle = NULL;
/* process any arguments */
- while ((opt = getopt_long(argc, argv, "bB:dt:vV:", longopts, NULL)) != -1) {
+ while ((opt = getopt_long(argc, argv, "bB:dt:vV:f", longopts, NULL)) != -1) {
switch(opt) {
case 'b':
loadBundles = FALSE;
CFRelease(str);
}
break;
+ case 'f':
+ _plugins_fork = TRUE;
+ break;
case '?':
default :
usage(prog);
}
}
- argc -= optind;
- argv += optind;
-
- /*
- * display an error if configd is already running and we are
- * not solely executing/testing a bundle.
- */
- if (testBundle == NULL) {
- if (server_active(&service_port)) {
- exit (EX_UNAVAILABLE);
- }
- }
+// argc -= optind;
+// argv += optind;
/* check credentials */
if (getuid() != 0) {
exit (EX_NOPERM);
}
- if (!forceForeground && (service_port == MACH_PORT_NULL)) {
+ /* check if we have been started by launchd */
+ vproc_swap_integer(NULL, VPROC_GSK_IS_MANAGED, NULL, &is_launchd_job);
+
+ /* ensure that forked plugins behave */
+ if ((testBundle != NULL) && (getenv("__FORKED_PLUGIN__") != NULL)) {
+ forcePlugin = TRUE;
+ }
+
+ /* if needed, daemonize */
+ if (!forceForeground && !is_launchd_job) {
/*
* if we haven't been asked to run in the foreground
* and have not been started by launchd (i.e. we're
* close file descriptors, establish stdin/stdout/stderr,
* setup logging.
*/
- if (!forceForeground) {
+ if (!forceForeground || forcePlugin) {
int facility = LOG_DAEMON;
int logopt = LOG_CONS|LOG_NDELAY|LOG_PID;
struct stat statbuf;
- if (service_port == MACH_PORT_NULL) {
+ if (!is_launchd_job && !forcePlugin) {
init_fds();
}
_sc_log = FALSE; /* redirect SCLog() to stdout/stderr */
}
- /* enable crash reporting */
- allow_crash_reports();
-
/* check/enable trace logging */
set_trace();
if (testBundle == NULL) {
/* initialize primary (store management) thread */
- server_init(service_port, enableRestart);
+ server_init();
- if (!forceForeground && (service_port == MACH_PORT_NULL)) {
+ if (!forceForeground && !is_launchd_job) {
/* synchronize with parent process */
kill(getppid(), SIGTERM);
}
/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
/* configd server port (for new session requests) */
static CFMachPortRef configd_port = NULL;
-/* priviledged bootstrap port (for registering/unregistering w/launchd) */
-static mach_port_t priv_bootstrap_port = MACH_PORT_NULL;
-
__private_extern__
boolean_t
config_demux(mach_msg_header_t *request, mach_msg_header_t *reply)
}
-__private_extern__
-boolean_t
-server_active(mach_port_t *restart_service_port)
-{
- char *service_name;
- kern_return_t status;
-
- service_name = getenv("SCD_SERVER");
- if (!service_name) {
- service_name = SCD_SERVER;
- }
-
- /* Check "configd" server status */
- status = bootstrap_check_in(bootstrap_port, service_name, restart_service_port);
- switch (status) {
- case BOOTSTRAP_SUCCESS :
- /* if we are being restarted by launchd */
- priv_bootstrap_port = bootstrap_port;
- break;
- case BOOTSTRAP_SERVICE_ACTIVE :
- case BOOTSTRAP_NOT_PRIVILEGED :
- /* if another instance of the server is active (or starting) */
- fprintf(stderr, "'%s' server already active\n",
- service_name);
- return TRUE;
- case BOOTSTRAP_UNKNOWN_SERVICE :
- /* if the server is not currently registered/active */
- *restart_service_port = MACH_PORT_NULL;
- break;
- default :
- fprintf(stderr,
- "bootstrap_check_in() failed: %s\n",
- bootstrap_strerror(status));
- exit (EX_UNAVAILABLE);
- }
-
- return FALSE;
-}
-
-
static CFStringRef
serverMPCopyDescription(const void *info)
{
__private_extern__
void
-server_init(mach_port_t restart_service_port,
- Boolean enableRestart)
+server_init()
{
serverSessionRef mySession;
CFRunLoopSourceRef rls;
char *service_name;
- mach_port_t service_port = restart_service_port;
+ mach_port_t service_port = MACH_PORT_NULL;
kern_return_t status;
- mach_port_t unpriv_bootstrap_port;
service_name = getenv("SCD_SERVER");
if (!service_name) {
service_name = SCD_SERVER;
}
- if (service_port == MACH_PORT_NULL) {
- mach_port_t service_send_port;
-
- /* Check "configd" server status */
- status = bootstrap_check_in(bootstrap_port, service_name, &service_port);
- switch (status) {
- case BOOTSTRAP_SUCCESS :
- /* if we are being restarted by launchd */
- priv_bootstrap_port = bootstrap_port;
- break;
- case BOOTSTRAP_NOT_PRIVILEGED :
- /* if another instance of the server is starting */
- SCLog(TRUE, LOG_ERR, CFSTR("'%s' server already starting"), service_name);
- exit (EX_UNAVAILABLE);
- case BOOTSTRAP_UNKNOWN_SERVICE :
- /* service not currently registered, "a good thing" (tm) */
- if (enableRestart) {
- status = bootstrap_create_server(bootstrap_port,
- "/usr/sbin/configd",
- geteuid(),
- FALSE, /* not onDemand == restart now */
- &priv_bootstrap_port);
- if (status != BOOTSTRAP_SUCCESS) {
- SCLog(TRUE, LOG_ERR,
- CFSTR("server_init bootstrap_create_server() failed: %s"),
- bootstrap_strerror(status));
- exit (EX_UNAVAILABLE);
- }
- } else {
- priv_bootstrap_port = bootstrap_port;
- }
-
- status = bootstrap_create_service(priv_bootstrap_port, service_name, &service_send_port);
- if (status != BOOTSTRAP_SUCCESS) {
- SCLog(TRUE, LOG_ERR,
- CFSTR("server_init bootstrap_create_service() failed: %s"),
- bootstrap_strerror(status));
- exit (EX_UNAVAILABLE);
- }
-
- status = bootstrap_check_in(priv_bootstrap_port, service_name, &service_port);
- if (status != BOOTSTRAP_SUCCESS) {
- SCLog(TRUE, LOG_ERR,
- CFSTR("server_init bootstrap_check_in() failed: %s"),
- bootstrap_strerror(status));
- exit (EX_UNAVAILABLE);
- }
- break;
- case BOOTSTRAP_SERVICE_ACTIVE :
- /* if another instance of the server is active */
- SCLog(TRUE, LOG_ERR, CFSTR("'%s' server already active"), service_name);
- exit (EX_UNAVAILABLE);
- default :
+ /* Check "configd" server status */
+ status = bootstrap_check_in(bootstrap_port, service_name, &service_port);
+ switch (status) {
+ case BOOTSTRAP_SUCCESS :
+ /* if we are being [re-]started by launchd */
+ break;
+ case BOOTSTRAP_NOT_PRIVILEGED :
+ /* if another instance of the server is starting */
+ SCLog(TRUE, LOG_ERR, CFSTR("'%s' server already starting"), service_name);
+ exit (EX_UNAVAILABLE);
+ case BOOTSTRAP_SERVICE_ACTIVE :
+ /* if another instance of the server is active */
+ SCLog(TRUE, LOG_ERR, CFSTR("'%s' server already active"), service_name);
+ exit (EX_UNAVAILABLE);
+ default :
SCLog(TRUE, LOG_ERR,
CFSTR("server_init bootstrap_check_in() failed: %s"),
bootstrap_strerror(status));
exit (EX_UNAVAILABLE);
- }
-
- }
-
- /* we don't want to pass our priviledged bootstrap port along to any spawned helpers so... */
- status = bootstrap_unprivileged(priv_bootstrap_port, &unpriv_bootstrap_port);
- if (status != BOOTSTRAP_SUCCESS) {
- SCLog(TRUE, LOG_ERR,
- CFSTR("server_init bootstrap_unprivileged() failed: %s"),
- bootstrap_strerror(status));
- exit (EX_UNAVAILABLE);
}
- status = task_set_bootstrap_port(mach_task_self(), unpriv_bootstrap_port);
- if (status != BOOTSTRAP_SUCCESS) {
- SCLog(TRUE, LOG_ERR,
- CFSTR("server_init task_set_bootstrap_port(): %s"),
- mach_error_string(status));
- exit (EX_UNAVAILABLE);
- }
-
- /* ... and make sure that the global "bootstrap_port" is also unpriviledged */
- bootstrap_port = unpriv_bootstrap_port;
-
/* Create the primary / new connection port and backing session */
mySession = addSession(service_port, serverMPCopyDescription);
configd_port = mySession->serverPort;
int
server_shutdown()
{
- char *service_name;
- mach_port_t service_port;
- kern_return_t status;
-
- /*
- * Note: we can't use SCLog() since the signal may be received while the
- * logging thread lock is held.
- */
- if ((priv_bootstrap_port == MACH_PORT_NULL) || (configd_port == NULL)) {
- return EX_OK;
- }
-
- service_name = getenv("SCD_SERVER");
- if (!service_name) {
- service_name = SCD_SERVER;
- }
+ if (configd_port != NULL) {
+ mach_port_t service_port;
+
+ service_port = CFMachPortGetPort(configd_port);
+ if (service_port != MACH_PORT_NULL) {
+ (void) mach_port_mod_refs(mach_task_self(),
+ service_port,
+ MACH_PORT_RIGHT_RECEIVE,
+ -1);
+ }
- service_port = CFMachPortGetPort(configd_port);
- if (service_port != MACH_PORT_NULL) {
- (void) mach_port_destroy(mach_task_self(), service_port);
- }
-
- status = bootstrap_register(priv_bootstrap_port, service_name, MACH_PORT_NULL);
- switch (status) {
- case BOOTSTRAP_SUCCESS :
- break;
- case MACH_SEND_INVALID_DEST :
- case MIG_SERVER_DIED :
- /* something happened to launchd */
- break;
- default :
- SCLog(TRUE, LOG_ERR,
- CFSTR("server_shutdown bootstrap_register(): %s"),
- bootstrap_strerror(status));
- return EX_UNAVAILABLE;
+ CFMachPortInvalidate(configd_port);
+ CFRelease(configd_port);
+ configd_port = NULL;
}
return EX_OK;
server_loop()
{
CFStringRef rlMode;
- int rlStatus;
while (TRUE) {
- /*
- * if linked with a DEBUG version of the framework, display some
- * debugging information
- */
- __showMachPortStatus();
-
/*
* process one run loop event
*/
rlMode = (storeLocked > 0) ? CFSTR("locked") : kCFRunLoopDefaultMode;
- rlStatus = CFRunLoopRunInMode(rlMode, 1.0e10, TRUE);
+ CFRunLoopRunInMode(rlMode, 1.0e10, TRUE);
/*
* check for, and if necessary, push out change notifications
* to other processes.
*/
- pushNotifications();
+ pushNotifications(_configd_trace);
}
}
/*
- * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2006, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
CFIndex size,
void *info);
-boolean_t server_active (mach_port_t *service_port);
-
-void server_init (mach_port_t service_port,
- Boolean enableRestart);
+void server_init (void);
int server_shutdown (void);
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>keychain-access-groups</key>
+ <array>
+ <string>apple</string>
+ </array>
+ <key>com.apple.springboard.launchapplications</key>
+ <true/>
+ <key>com.apple.wifi.manager-access</key>
+ <true/>
+ <key>com.apple.MobileInternetSharing.allow</key>
+ <true/>
+</dict>
+</plist>
switch (Request->not_header.msgh_id) {
case MACH_NOTIFY_NO_SENDERS :
- SCLog(_configd_verbose, LOG_DEBUG, CFSTR("No more senders for port %d, closing."),
- Request->not_header.msgh_local_port);
+ __MACH_PORT_DEBUG(TRUE, "*** notify_server MACH_NOTIFY_NO_SENDERS", Request->not_header.msgh_local_port);
cleanupSession(Request->not_header.msgh_local_port);
Reply->Head.msgh_bits = 0;
/*
- * Copyright (c) 2003, 2004, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2003, 2004, 2006-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
void
patternAddKey(CFStringRef key)
{
+ void *context = (void *)key;
+
my_CFDictionaryApplyFunction(patternData,
(CFDictionaryApplierFunction)addKeyForPattern,
- (void *)key);
+ context);
return;
}
void
patternRemoveKey(CFStringRef key)
{
+ void *context = (void *)key;
+
my_CFDictionaryApplyFunction(patternData,
(CFDictionaryApplierFunction)removeKeyFromPattern,
- (void *)key);
+ context);
return;
}
/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
CFRunLoopRef plugin_runLoop = NULL;
-extern SCDynamicStoreBundleLoadFunction load_ATconfig;
-extern SCDynamicStoreBundleStopFunction stop_ATconfig;
extern SCDynamicStoreBundleLoadFunction load_IPMonitor;
extern SCDynamicStoreBundlePrimeFunction prime_IPMonitor;
extern SCDynamicStoreBundleLoadFunction load_InterfaceNamer;
extern SCDynamicStoreBundleLoadFunction load_KernelEventMonitor;
extern SCDynamicStoreBundlePrimeFunction prime_KernelEventMonitor;
-#ifdef INCLUDE_KICKER
-extern SCDynamicStoreBundleLoadFunction load_Kicker;
-#endif // INCLUDE_KICKER
extern SCDynamicStoreBundleLoadFunction load_LinkConfiguration;
extern SCDynamicStoreBundleLoadFunction load_PreferencesMonitor;
extern SCDynamicStoreBundlePrimeFunction prime_PreferencesMonitor;
-extern SCDynamicStoreBundleStopFunction stop_PreferencesMonitor;
extern SCDynamicStoreBundleLoadFunction load_NetworkIdentification;
extern SCDynamicStoreBundlePrimeFunction prime_NetworkIdentification;
-extern SCDynamicStoreBundleStopFunction stop_NetworkIdentification;
typedef struct {
static const builtin builtin_plugins[] = {
- {
- CFSTR("com.apple.SystemConfiguration.ATconfig"),
- &load_ATconfig,
- NULL,
- NULL,
- &stop_ATconfig
- },
{
CFSTR("com.apple.SystemConfiguration.IPMonitor"),
&load_IPMonitor,
&prime_KernelEventMonitor,
NULL
},
-#ifdef INCLUDE_KICKER
- {
- CFSTR("com.apple.SystemConfiguration.Kicker"),
- &load_Kicker,
- NULL,
- NULL,
- NULL
- },
-#endif // INCLUDE_KICKER
{
CFSTR("com.apple.SystemConfiguration.LinkConfiguration"),
&load_LinkConfiguration,
&load_NetworkIdentification,
NULL,
&prime_NetworkIdentification,
- &stop_NetworkIdentification
+ NULL
},
{
CFSTR("com.apple.SystemConfiguration.PreferencesMonitor"),
&load_PreferencesMonitor,
NULL,
&prime_PreferencesMonitor,
- &stop_PreferencesMonitor
+ NULL
}
};
}
+static const char *
+getBundleDirNameAndPath(CFBundleRef bundle, char *buf, size_t buf_len)
+{
+ char *cp;
+ int len;
+ Boolean ok;
+ CFURLRef url;
+
+ url = CFBundleCopyBundleURL(bundle);
+ if (url == NULL) {
+ return NULL;
+ }
+
+ ok = CFURLGetFileSystemRepresentation(url, TRUE, (UInt8 *)buf, buf_len);
+ CFRelease(url);
+ if (!ok) {
+ return NULL;
+ }
+
+ cp = strrchr(buf, '/');
+ if (cp != NULL) {
+ cp++;
+ } else {
+ cp = buf;
+ }
+
+ /* check if this directory entry is a valid bundle name */
+ len = strlen(cp);
+ if (len <= (int)sizeof(BUNDLE_DIR_EXTENSION)) {
+ /* if entry name isn't long enough */
+ return NULL;
+ }
+
+ len -= sizeof(BUNDLE_DIR_EXTENSION) - 1;
+ if (strcmp(&cp[len], BUNDLE_DIR_EXTENSION) != 0) {
+ /* if entry name doesn't end with ".bundle" */
+ return NULL;
+ }
+
+ return cp;
+}
+
+
+#pragma mark -
+#pragma mark load
+
+
+static void
+forkBundle_setup(pid_t pid, void *setupContext)
+{
+ if (pid == 0) {
+ // if child
+ unsetenv("__LAUNCHD_FD");
+ setenv("__FORKED_PLUGIN__", "Yes", 1);
+ }
+
+ return;
+}
+
+
+static void
+forkBundle(CFBundleRef bundle, CFStringRef bundleID)
+{
+ char *argv[] = { "configd", "-d", "-t", NULL, NULL };
+ const char *name;
+ char path[MAXPATHLEN];
+ pid_t pid;
+
+ // get the bundle's path
+ name = getBundleDirNameAndPath(bundle, path, sizeof(path));
+ if (name == NULL) {
+ SCLog(TRUE, LOG_ERR, CFSTR("skipped %@ (could not determine path)"), bundle);
+ return;
+ }
+
+ // fork and exec configd opting to load only this plugin
+ argv[3] = path;
+ pid = _SCDPluginExecCommand2(NULL, NULL, 0, 0, "/usr/libexec/configd", argv, forkBundle_setup, NULL);
+ if (pid == -1) {
+ SCLog(TRUE, LOG_ERR,
+ CFSTR("skipped %@ (could not exec child) : %s"),
+ bundle,
+ strerror(errno));
+ return;
+ }
+
+ SCLog(TRUE, LOG_NOTICE, CFSTR("forked %@, pid=%d"), bundleID, pid);
+ return;
+}
+
+
static void
loadBundle(const void *value, void *context) {
CFStringRef bundleID;
bundleID = CFBundleGetIdentifier(bundleInfo->bundle);
if (bundleID == NULL) {
// sorry, no bundles without a bundle identifier
- SCLog(TRUE, LOG_DEBUG, CFSTR("skipped %@ (no bundle ID)"), bundleInfo->bundle);
+ SCLog(TRUE, LOG_NOTICE, CFSTR("skipped %@ (no bundle ID)"), bundleInfo->bundle);
return;
}
if (bundleExclude) {
// sorry, this bundle has been excluded
- SCLog(TRUE, LOG_DEBUG, CFSTR("skipped %@ (excluded)"), bundleID);
+ SCLog(TRUE, LOG_NOTICE, CFSTR("skipped %@ (excluded)"), bundleID);
goto done;
}
if (!bundleInfo->enabled) {
- // sorry, this bundle has not been enaabled
- SCLog(TRUE, LOG_DEBUG, CFSTR("skipped %@ (disabled)"), bundleID);
+ // sorry, this bundle has not been enabled
+ SCLog(TRUE, LOG_INFO, CFSTR("skipped %@ (disabled)"), bundleID);
+ goto done;
+ }
+
+ if (_plugins_fork) {
+ forkBundle(bundleInfo->bundle, bundleID);
goto done;
}
}
if (bundleInfo->builtin) {
- int i;
+ int i;
SCLog(TRUE, LOG_DEBUG, CFSTR("adding %@"), bundleID);
goto done;
}
} else {
+ CFErrorRef error = NULL;
+
SCLog(TRUE, LOG_DEBUG, CFSTR("loading %@"), bundleID);
#ifdef DEBUG
traceBundle("loading", bundleInfo->bundle);
#endif /* DEBUG */
- if (!CFBundleLoadExecutable(bundleInfo->bundle)) {
+ if (!CFBundleLoadExecutableAndReturnError(bundleInfo->bundle, &error)) {
+ CFStringRef description;
+
+ description = CFErrorCopyDescription(error);
SCLog(TRUE, LOG_NOTICE, CFSTR("%@ load failed"), bundleID);
+ SCLog(TRUE, LOG_NOTICE, CFSTR(" %@"), description);
+ CFRelease(description);
+ CFRelease(error);
goto done;
}
}
+#pragma mark -
+#pragma mark start
+
+
void
callStartFunction(const void *value, void *context) {
+ const char *bundleDirName;
bundleInfoRef bundleInfo = (bundleInfoRef)value;
- CFURLRef bundleURL;
char bundleName[MAXNAMLEN + 1];
char bundlePath[MAXPATHLEN];
- char *cp;
int len;
- Boolean ok;
if (!bundleInfo->loaded) {
return;
return;
}
- bundleURL = CFBundleCopyBundleURL(bundleInfo->bundle);
- if (bundleURL == NULL) {
- return;
- }
-
- ok = CFURLGetFileSystemRepresentation(bundleURL,
- TRUE,
- (UInt8 *)&bundlePath,
- sizeof(bundlePath));
- CFRelease(bundleURL);
- if (!ok) {
- return;
- }
-
- cp = strrchr(bundlePath, '/');
- if (cp) {
- cp++;
- } else {
- cp = bundlePath;
- }
-
- /* check if this directory entry is a valid bundle name */
- len = strlen(cp);
- if (len <= (int)sizeof(BUNDLE_DIR_EXTENSION)) {
- /* if entry name isn't long enough */
+ /* copy the bundle's path */
+ bundleDirName = getBundleDirNameAndPath(bundleInfo->bundle, bundlePath, sizeof(bundlePath));
+ if (bundleDirName == NULL) {
+ // if we have a problem with the bundle's path
return;
}
- len -= sizeof(BUNDLE_DIR_EXTENSION) - 1;
- if (strcmp(&cp[len], BUNDLE_DIR_EXTENSION) != 0) {
- /* if entry name doesn end with ".bundle" */
+ /* copy (just) the bundle's name */
+ if (strlcpy(bundleName, bundleDirName, sizeof(bundleName)) > sizeof(bundleName)) {
+ // if we have a problem with the bundle's name
return;
}
-
- /* get (just) the bundle's name */
- bundleName[0] = '\0';
- (void) strncat(bundleName, cp, len);
+ len = strlen(bundleName) - (sizeof(BUNDLE_DIR_EXTENSION) - 1);
+ bundleName[len] = '\0';
#ifdef DEBUG
traceBundle("calling start() for", bundleInfo->bundle);
}
+#pragma mark -
+#pragma mark prime
+
+
void
callPrimeFunction(const void *value, void *context) {
bundleInfoRef bundleInfo = (bundleInfoRef)value;
}
+#pragma mark -
+#pragma mark stop
+
+
static void
stopComplete(void *info)
{
SCLog(TRUE, LOG_DEBUG, CFSTR("** %@ complete (%f)"), bundleID, CFAbsoluteTimeGetCurrent());
stopRls = (CFRunLoopSourceRef)CFDictionaryGetValue(exiting, bundle);
+ if (stopRls == NULL) {
+ return;
+ }
+
CFRunLoopSourceInvalidate(stopRls);
CFDictionaryRemoveValue(exiting, bundle);
}
+#pragma mark -
+#pragma mark term
+
+
static CFStringRef
termRLSCopyDescription(const void *info)
{
}
+#pragma mark -
+#pragma mark initialization
+
+
#ifdef DEBUG
static void
timerCallback(CFRunLoopTimerRef timer, void *info)
callLoadFunction,
NULL);
+ if (nLoaded == 0) {
+ // if no bundles loaded
+ goto done;
+ }
+
/*
* If defined, call each bundles start() function. This function is
* called after the bundle has been loaded and its load() function has
plugin_runLoop = CFRunLoopGetCurrent();
CFRunLoopRun();
+ done :
+
SCLog(_configd_verbose, LOG_INFO, CFSTR("No more work for the \"configd\" plugins"));
plugin_runLoop = NULL;
return NULL;
/*
- * Copyright (c) 2000, 2001, 2003-2005, 2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003-2005, 2007-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include "configd_server.h"
#include "session.h"
+#include <unistd.h>
+#include <bsm/libbsm.h>
+
/* information maintained for each active session */
static serverSessionRef *sessions = NULL;
static int nSessions = 0;
int i;
if (server == MACH_PORT_NULL) {
- SCLog(TRUE, LOG_NOTICE, CFSTR("Excuse me, why is getSession() being called with an invalid port?"));
+ SCLog(TRUE, LOG_ERR, CFSTR("Excuse me, why is getSession() being called with an invalid port?"));
return NULL;
}
} else if (thisSession->key == server) {
return thisSession; /* we've seen this server before */
} else if (thisSession->store &&
- (((SCDynamicStorePrivateRef)thisSession->store)->notifySignalTask == server)) {
+ (((SCDynamicStorePrivateRef)thisSession->store)->notifySignalTask == server)) {
return thisSession;
}
}
addSession(mach_port_t server, CFStringRef (*copyDescription)(const void *info))
{
CFMachPortContext context = { 0, NULL, NULL, NULL, NULL };
+ mach_port_t mp = server;
int n = -1;
if (nSessions <= 0) {
context.copyDescription = copyDescription;
if (server == MACH_PORT_NULL) {
- // SCDynamicStore client ports
+ // create mach port for SCDynamicStore client
(void) mach_port_allocate(mach_task_self(),
MACH_PORT_RIGHT_RECEIVE,
- &server);
+ &mp);
+ }
+
+ //
+ // Note: we create the CFMachPort *before* we insert a send
+ // right present to ensure that CF does not establish
+ // its dead name notification.
+ //
+ sessions[n]->serverPort = CFMachPortCreateWithPort(NULL,
+ mp,
+ configdCallback,
+ &context,
+ NULL);
+
+ if (server == MACH_PORT_NULL) {
+ // insert send right that will be moved to the client
(void) mach_port_insert_right(mach_task_self(),
- server,
- server,
+ mp,
+ mp,
MACH_MSG_TYPE_MAKE_SEND);
}
- sessions[n]->key = server;
- sessions[n]->serverPort = CFMachPortCreateWithPort(NULL,
- server,
- configdCallback,
- &context,
- NULL);
+
+ sessions[n]->key = mp;
// sessions[n]->serverRunLoopSource = NULL;
// sessions[n]->store = NULL;
- sessions[n]->callerEUID = 1; /* not "root" */
+ sessions[n]->callerEUID = 1; /* not "root" */
+ sessions[n]->callerRootAccess = UNKNOWN;
+ sessions[n]->callerWriteAccess = UNKNOWN;
return sessions[n];
}
* Close any open connections including cancelling any outstanding
* notification requests and releasing any locks.
*/
+ __MACH_PORT_DEBUG(TRUE, "*** cleanupSession", server);
(void) __SCDynamicStoreClose(&thisSession->store, TRUE);
+ __MACH_PORT_DEBUG(TRUE, "*** cleanupSession (after __SCDynamicStoreClose)", server);
/*
- * Our send right has already been removed. Remove our
- * receive right.
+ * Our send right has already been removed. Remove our receive right.
*/
- mach_port_mod_refs(mach_task_self(),
- thisSession->key,
- MACH_PORT_RIGHT_RECEIVE,
- -1);
-
+ (void) mach_port_mod_refs(mach_task_self(), server, MACH_PORT_RIGHT_RECEIVE, -1);
+
/*
* Lastly, remove the session entry.
*/
return;
}
}
+
+ SCLog(TRUE, LOG_ERR, CFSTR("MACH_NOTIFY_NO_SENDERS w/no session, port = %d"), server);
+ __MACH_PORT_DEBUG(TRUE, "*** cleanupSession w/no session", server);
return;
}
__private_extern__
void
-listSessions()
+listSessions(FILE *f)
{
int i;
- fprintf(stderr, "Current sessions:");
+ SCPrint(TRUE, f, CFSTR("Current sessions :\n"));
for (i = 0; i < nSessions; i++) {
serverSessionRef thisSession = sessions[i];
continue;
}
- fprintf(stderr, " %d", thisSession->key);
+ SCPrint(TRUE, f, CFSTR("\t%d : port = 0x%x"), i, thisSession->key);
+
+ if (thisSession->store != NULL) {
+ SCDynamicStorePrivateRef storePrivate = (SCDynamicStorePrivateRef)thisSession->store;
+
+ if (storePrivate->notifySignalTask != TASK_NULL) {
+ SCPrint(TRUE, f, CFSTR(", task = %d"), storePrivate->notifySignalTask);
+ }
+ }
+
+ if (sessionData != NULL) {
+ CFDictionaryRef info;
+ CFStringRef key;
+
+ key = CFStringCreateWithFormat(NULL, NULL, CFSTR("%d"), thisSession->key);
+ info = CFDictionaryGetValue(sessionData, key);
+ CFRelease(key);
+ if (info != NULL) {
+ CFStringRef name;
+
+ name = CFDictionaryGetValue(info, kSCDName);
+ if (name != NULL) {
+ SCPrint(TRUE, f, CFSTR(", name = %@"), name);
+ }
+ }
+ }
+
+ if (thisSession->serverPort != NULL) {
+ SCPrint(TRUE, f, CFSTR("\n\t\t%@"), thisSession->serverPort);
+ }
+
+ if (thisSession->serverRunLoopSource != NULL) {
+ SCPrint(TRUE, f, CFSTR("\n\t\t%@"), thisSession->serverRunLoopSource);
+ }
+
+ SCPrint(TRUE, f, CFSTR("\n"));
+ }
+
+ SCPrint(TRUE, f, CFSTR("\n"));
+ return;
+}
+
+
+#if TARGET_OS_IPHONE
+
+#include <Security/Security.h>
+#include <Security/SecTask.h>
- if (thisSession->store) {
- task_t task = ((SCDynamicStorePrivateRef)thisSession->store)->notifySignalTask;
+static CFStringRef
+sessionName(serverSessionRef session)
+{
+ CFDictionaryRef info;
+ CFStringRef name = NULL;
+ CFStringRef sessionKey;
+
+ sessionKey = CFStringCreateWithFormat(NULL, NULL, CFSTR("%d"), session->key);
+ info = CFDictionaryGetValue(sessionData, sessionKey);
+ CFRelease(sessionKey);
+
+ if (info != NULL) {
+ name = CFDictionaryGetValue(info, kSCDName);
+ }
- if (task != TASK_NULL) {
- fprintf(stderr, "/%d", task);
+ return (name != NULL) ? name : CFSTR("???");
+}
+
+
+static Boolean
+hasEntitlement(serverSessionRef session, CFStringRef entitlement)
+{
+ Boolean hasEntitlement = FALSE;
+ SecTaskRef task;
+
+ /* Create the security task from the audit token. */
+ task = SecTaskCreateWithAuditToken(NULL, session->auditToken);
+ if (task != NULL) {
+ CFErrorRef error = NULL;
+ CFTypeRef value;
+
+ /* Get the value for the entitlement. */
+ value = SecTaskCopyValueForEntitlement(task, kSCWriteEntitlementName, &error);
+ if (value != NULL) {
+ if (isA_CFBoolean(value)) {
+ if (CFBooleanGetValue(value)) {
+ /* if client DOES have entitlement */
+ hasEntitlement = YES;
+ }
+ } else {
+ SCLog(TRUE, LOG_ERR,
+ CFSTR("hasEntitlement: entitlement not valid: %@"),
+ sessionName(session));
}
+
+ CFRelease(value);
+ } else if (error != NULL) {
+ SCLog(TRUE, LOG_ERR,
+ CFSTR("hasEntitlement SecTaskCopyValueForEntitlement() failed, error=%@: %@"),
+ error,
+ sessionName(session));
+ CFRelease(error);
}
+
+ CFRelease(task);
+ } else {
+ SCLog(TRUE, LOG_ERR,
+ CFSTR("hasEntitlement SecTaskCreateWithAuditToken() failed: %@"),
+ sessionName(session));
}
- fprintf(stderr, "\n");
+
+ return hasEntitlement;
}
+#endif // TARGET_OS_IPHONE
+
+
+__private_extern__
+Boolean
+hasRootAccess(serverSessionRef session)
+{
+ if (session->callerRootAccess == UNKNOWN) {
+ /*
+ * get the credentials associated with the caller.
+ */
+ audit_token_to_au32(session->auditToken,
+ NULL, // auidp
+ &session->callerEUID, // euid
+ NULL, // egid
+ NULL, // ruid
+ NULL, // rgid
+ NULL, // pid
+ NULL, // asid
+ NULL); // tid
+
+ session->callerRootAccess = (session->callerEUID == 0) ? YES : NO;
+ }
+
+ return (session->callerRootAccess == YES) ? TRUE : FALSE;
+}
+
+
+__private_extern__
+Boolean
+hasWriteAccess(serverSessionRef session)
+{
+ if (session->callerWriteAccess == UNKNOWN) {
+ /* assume that the client DOES NOT have the entitlement */
+ session->callerWriteAccess = NO;
+
+ if (hasRootAccess(session)) {
+ // grant write access to eUID==0 processes
+ session->callerWriteAccess = YES;
+ }
+#if TARGET_OS_IPHONE
+ else if (hasEntitlement(session, kSCWriteEntitlementName)) {
+ // grant write access to "entitled" processes
+ session->callerWriteAccess = YES;
+ }
+#endif // TARGET_OS_IPHONE
+ }
+
+ return (session->callerWriteAccess == YES) ? TRUE : FALSE;
+}
/*
- * Copyright (c) 2000, 2001, 2005-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2005-2007, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#define _S_SESSION_H
#include <sys/cdefs.h>
+#include <Availability.h>
+#include <TargetConditionals.h>
+
+
+#if TARGET_OS_IPHONE
+#define kSCWriteEntitlementName CFSTR("com.apple.SystemConfiguration.SCDynamicStore-write-access")
+#endif // TARGET_OS_IPHONE
+
+
+typedef enum { UNKNOWN, NO, YES } lazyBoolean;
+
/* Per client server state */
typedef struct {
/* credentials associated with this "open" session */
uid_t callerEUID;
+ /* Mach security audit trailer for evaluating credentials */
+ audit_token_t auditToken;
+
+ /* root access credential associated with this "open" session */
+ lazyBoolean callerRootAccess;
+
+ /* write access entitlement associated with this "open" session */
+ lazyBoolean callerWriteAccess;
+
} serverSession, *serverSessionRef;
__BEGIN_DECLS
void cleanupSession (mach_port_t server);
-void listSessions (void);
+void listSessions (FILE *f);
+
+Boolean hasRootAccess (serverSessionRef session);
+
+Boolean hasWriteAccess (serverSessionRef session);
__END_DECLS
archiveVersion = 1;
classes = {
};
- objectVersion = 42;
+ objectVersion = 45;
objects = {
/* Begin PBXAggregateTarget section */
+ 151C1CC60CFB487000C5AFD6 /* All-Embedded */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = 151C1CD60CFB48E300C5AFD6 /* Build configuration list for PBXAggregateTarget "All-Embedded" */;
+ buildPhases = (
+ );
+ dependencies = (
+ 15C64A2F0F684C8300D78394 /* PBXTargetDependency */,
+ 158317100CFB77D1006F62B9 /* PBXTargetDependency */,
+ 158317160CFB783B006F62B9 /* PBXTargetDependency */,
+ 158317180CFB784D006F62B9 /* PBXTargetDependency */,
+ );
+ name = "All-Embedded";
+ productName = Embedded;
+ };
+ 151FE2DD0D5B7046000D6DB1 /* configd_base-EmbeddedSimulator */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = 151FE2E40D5B7046000D6DB1 /* Build configuration list for PBXAggregateTarget "configd_base-EmbeddedSimulator" */;
+ buildPhases = (
+ );
+ dependencies = (
+ 15A5A2710D5B942D0087BDA0 /* PBXTargetDependency */,
+ );
+ name = "configd_base-EmbeddedSimulator";
+ productName = Frameworks;
+ };
155847FA07550D210046C2E9 /* configd_executables */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 156EB62E0905594A00EEF749 /* Build configuration list for PBXAggregateTarget "configd_executables" */;
1558480607550D470046C2E9 /* PBXTargetDependency */,
1558480807550D470046C2E9 /* PBXTargetDependency */,
1558480A07550D470046C2E9 /* PBXTargetDependency */,
- 150ECB3C0D0079280065E94D /* PBXTargetDependency */,
+ 150ECB300D0042DA0065E94D /* PBXTargetDependency */,
);
name = configd_executables;
productName = configd_executables;
buildPhases = (
);
dependencies = (
- 157BB8C2075924470025DA7A /* PBXTargetDependency */,
157BB8C0075924460025DA7A /* PBXTargetDependency */,
1520A386084681350010B584 /* PBXTargetDependency */,
);
name = configd_base;
productName = Frameworks;
};
+ 158316CF0CFB774B006F62B9 /* configd_base-Embedded */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = 158316D80CFB774B006F62B9 /* Build configuration list for PBXAggregateTarget "configd_base-Embedded" */;
+ buildPhases = (
+ );
+ dependencies = (
+ 158317120CFB77E1006F62B9 /* PBXTargetDependency */,
+ 158317140CFB77E8006F62B9 /* PBXTargetDependency */,
+ );
+ name = "configd_base-Embedded";
+ productName = Frameworks;
+ };
+ 158316E30CFB7761006F62B9 /* configd_plugins-Embedded */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = 158317000CFB7761006F62B9 /* Build configuration list for PBXAggregateTarget "configd_plugins-Embedded" */;
+ buildPhases = (
+ );
+ dependencies = (
+ 157A85480D56CA0B00B6F1A0 /* PBXTargetDependency */,
+ 158317BB0CFB8660006F62B9 /* PBXTargetDependency */,
+ 157A854A0D56CA2300B6F1A0 /* PBXTargetDependency */,
+ 158317B90CFB8660006F62B9 /* PBXTargetDependency */,
+ 157A854C0D56CA5100B6F1A0 /* PBXTargetDependency */,
+ 158317B70CFB8660006F62B9 /* PBXTargetDependency */,
+ 157A854E0D56CA6F00B6F1A0 /* PBXTargetDependency */,
+ 158317B50CFB8660006F62B9 /* PBXTargetDependency */,
+ 156CA4A80EF8550800C59A18 /* PBXTargetDependency */,
+ 157A85500D56CA8800B6F1A0 /* PBXTargetDependency */,
+ 158317B30CFB8660006F62B9 /* PBXTargetDependency */,
+ 157A85520D56CA9E00B6F1A0 /* PBXTargetDependency */,
+ 157A85540D56CACA00B6F1A0 /* PBXTargetDependency */,
+ );
+ name = "configd_plugins-Embedded";
+ productName = Plugins;
+ };
+ 158317040CFB7782006F62B9 /* configd_executables-Embedded */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = 1583170B0CFB7782006F62B9 /* Build configuration list for PBXAggregateTarget "configd_executables-Embedded" */;
+ buildPhases = (
+ );
+ dependencies = (
+ 158317660CFB80D5006F62B9 /* PBXTargetDependency */,
+ 157434210D4A8166002ACA73 /* PBXTargetDependency */,
+ 1574341F0D4A815E002ACA73 /* PBXTargetDependency */,
+ );
+ name = "configd_executables-Embedded";
+ productName = configd_executables;
+ };
159D542007528E7C004F8947 /* configd_plugins */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 156EB61E0905594A00EEF749 /* Build configuration list for PBXAggregateTarget "configd_plugins" */;
buildPhases = (
);
dependencies = (
- 1533B94109731A9600F2B34A /* PBXTargetDependency */,
- 15DAD5740759115F0084A6ED /* PBXTargetDependency */,
159D542807528E85004F8947 /* PBXTargetDependency */,
158AD9860754E72500124717 /* PBXTargetDependency */,
159D542607528E85004F8947 /* PBXTargetDependency */,
159D542207528E85004F8947 /* PBXTargetDependency */,
159D542A07528E85004F8947 /* PBXTargetDependency */,
158AD98C0754E72500124717 /* PBXTargetDependency */,
+ 1521405B0E9400BF00DACD2C /* PBXTargetDependency */,
159D542C07528E85004F8947 /* PBXTargetDependency */,
158AD98E0754E72500124717 /* PBXTargetDependency */,
F95B8A790B03FB9100993BA3 /* PBXTargetDependency */,
name = configd_plugins;
productName = Plugins;
};
+ 15C64A1E0F684C3300D78394 /* configd_libSystem */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = 15C64A270F684C6B00D78394 /* Build configuration list for PBXAggregateTarget "configd_libSystem" */;
+ buildPhases = (
+ 15BED7930F6853F800016614 /* OLD libdnsinfo.a */,
+ );
+ dependencies = (
+ 15C64A220F684C4900D78394 /* PBXTargetDependency */,
+ );
+ name = configd_libSystem;
+ productName = configd_libSystem;
+ };
+ 15C64A280F684C6B00D78394 /* configd_libSystem-Embedded */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = 15C64A2B0F684C6B00D78394 /* Build configuration list for PBXAggregateTarget "configd_libSystem-Embedded" */;
+ buildPhases = (
+ 15BED7A20F68551200016614 /* OLD libdnsinfo.a */,
+ );
+ dependencies = (
+ 15C64A310F684C8F00D78394 /* PBXTargetDependency */,
+ );
+ name = "configd_libSystem-Embedded";
+ productName = configd_libSystem;
+ };
15CB690005C0722A0099E85F /* All */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 156EB6320905594A00EEF749 /* Build configuration list for PBXAggregateTarget "All" */;
buildPhases = (
);
dependencies = (
+ 15C64A240F684C5700D78394 /* PBXTargetDependency */,
157BB8C40759244B0025DA7A /* PBXTargetDependency */,
159D542E07529008004F8947 /* PBXTargetDependency */,
1558480F07550DD00046C2E9 /* PBXTargetDependency */,
name = All;
productName = "configd (Aggregate)";
};
+ 15FD13BF0D59485000F9409C /* All-EmbeddedSimulator */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = 15FD13C60D59485000F9409C /* Build configuration list for PBXAggregateTarget "All-EmbeddedSimulator" */;
+ buildPhases = (
+ );
+ dependencies = (
+ 151FE37A0D5B713C000D6DB1 /* PBXTargetDependency */,
+ );
+ name = "All-EmbeddedSimulator";
+ productName = EmbeddedSimulator;
+ };
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
15060818075A00A300B147BA /* SCSchemaDefinitions.c in Sources */ = {isa = PBXBuildFile; fileRef = 150607BD075A00A200B147BA /* SCSchemaDefinitions.c */; };
1506081A075A00A300B147BA /* SCSchemaDefinitions.h in Headers */ = {isa = PBXBuildFile; fileRef = 150607DE075A00A300B147BA /* SCSchemaDefinitions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 1508E39F07552B6A0062B350 /* atconfig.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53C707528B36004F8947 /* atconfig.c */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
- 1508E3A007552B6B0062B350 /* cfManager.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53C507528B36004F8947 /* cfManager.c */; };
- 1508E3A107552B720062B350 /* cache.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53CA07528B36004F8947 /* cache.c */; };
150D7E1E0D16DC6C00AF4BED /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1520A3DE0846B2DC0010B584 /* Security.framework */; };
1520A3870846829A0010B584 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CB6A6F05C0722B0099E85F /* CoreFoundation.framework */; };
- 1520A3D0084682A30010B584 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15DAD6C807591A1A0084A6ED /* SystemConfiguration.framework */; };
1520A3DF0846B2DD0010B584 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1520A3DE0846B2DC0010B584 /* Security.framework */; };
- 1523F6F1075A36F70066F0B2 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15DAD6C807591A1A0084A6ED /* SystemConfiguration.framework */; };
- 1523F6F2075A37050066F0B2 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15DAD6C807591A1A0084A6ED /* SystemConfiguration.framework */; };
- 1523F710075A371D0066F0B2 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15DAD6C807591A1A0084A6ED /* SystemConfiguration.framework */; };
- 1523F715075A376B0066F0B2 /* libdnsinfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15DAD5EE075913CE0084A6ED /* libdnsinfo.a */; };
- 1523F719075A37C70066F0B2 /* libdnsinfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15DAD5EE075913CE0084A6ED /* libdnsinfo.a */; };
+ 152140020E93EC6500DACD2C /* logger.c in Sources */ = {isa = PBXBuildFile; fileRef = 1531D3DB0E93E6DA00248432 /* logger.c */; };
+ 1521400C0E93FFF500DACD2C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CB6A6F05C0722B0099E85F /* CoreFoundation.framework */; };
+ 152140580E93FFFC00DACD2C /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1559C4440D349A4E0098FD59 /* SystemConfiguration.framework */; };
+ 1522FCFB0FA7FE4B00B24128 /* dnsinfo_flatfile.c in Sources */ = {isa = PBXBuildFile; fileRef = 1522FCE50FA7FD7000B24128 /* dnsinfo_flatfile.c */; };
152E68C10A2C89C70011FDA8 /* SCPreferencesKeychainPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 152E68C00A2C89C70011FDA8 /* SCPreferencesKeychainPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
152E68C30A2C89E30011FDA8 /* SCPreferencesKeychainPrivate.c in Sources */ = {isa = PBXBuildFile; fileRef = 152E68C20A2C89E30011FDA8 /* SCPreferencesKeychainPrivate.c */; };
- 1533B94D09731BE600F2B34A /* libATconfig.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15FD73400754DBDA001CC321 /* libATconfig.a */; };
1533D77B0B10A14300CA4946 /* libNetworkIdentification.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F95B8A5F0B03F81400993BA3 /* libNetworkIdentification.a */; };
- 153BED940B75566200989D5C /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1587A31F0B6AACD70063104A /* libicucore.dylib */; };
1540E3610987DA9500157C07 /* com.apple.configd.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1540E3600987DA9500157C07 /* com.apple.configd.plist */; };
154361E00752C81800A8EC6C /* set-hostname.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53AB07528B36004F8947 /* set-hostname.c */; };
1543636B0752D03C00A8EC6C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1543636A0752D03C00A8EC6C /* IOKit.framework */; };
+ 154707300D1F70C80075C28D /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1547072E0D1F70C80075C28D /* SystemConfiguration.framework */; };
+ 154707350D1F70C80075C28D /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1547072E0D1F70C80075C28D /* SystemConfiguration.framework */; };
154CF3F407E1EA4D00D8302E /* SCPreferencesGetSpecificPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 154CF3F307E1EA4D00D8302E /* SCPreferencesGetSpecificPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 155281020E3E4A0F00C54315 /* ip_plugin.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53A707528B36004F8947 /* ip_plugin.c */; };
155847470754FDCD0046C2E9 /* scutil.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB6A4305C0722B0099E85F /* scutil.h */; };
155847480754FDCD0046C2E9 /* commands.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB6A4505C0722B0099E85F /* commands.h */; };
155847490754FDCD0046C2E9 /* dictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB6A4705C0722B0099E85F /* dictionary.h */; };
1558481607550EC10046C2E9 /* scselect.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A2E05C0722B0099E85F /* scselect.c */; settings = {ATTRIBUTES = (); }; };
1558481907550EC10046C2E9 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CB6A6F05C0722B0099E85F /* CoreFoundation.framework */; };
1558481C07550EC10046C2E9 /* scselect.8 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 15CB6A3605C0722B0099E85F /* scselect.8 */; };
+ 1559C4450D349A4E0098FD59 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1559C4440D349A4E0098FD59 /* SystemConfiguration.framework */; };
+ 1559C4490D349A4E0098FD59 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1559C4440D349A4E0098FD59 /* SystemConfiguration.framework */; };
+ 1559C44A0D349A4E0098FD59 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1559C4440D349A4E0098FD59 /* SystemConfiguration.framework */; };
+ 1559C44E0D349A4E0098FD59 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1559C4440D349A4E0098FD59 /* SystemConfiguration.framework */; };
+ 1559C44F0D349A4E0098FD59 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1559C4440D349A4E0098FD59 /* SystemConfiguration.framework */; };
155A1E6C081079CC00F70D98 /* SCNetworkConfigurationPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 155A1E6B081079CC00F70D98 /* SCNetworkConfigurationPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
155B7BF70847776D00F0E262 /* SCHelper_client.h in Headers */ = {isa = PBXBuildFile; fileRef = 155B7BF60847776D00F0E262 /* SCHelper_client.h */; };
155B7BF80847776D00F0E262 /* SCHelper_client.h in Headers */ = {isa = PBXBuildFile; fileRef = 155B7BF60847776D00F0E262 /* SCHelper_client.h */; };
155D223C0AF13A7300D52ED0 /* set-hostname.h in Headers */ = {isa = PBXBuildFile; fileRef = 155D22390AF13A7300D52ED0 /* set-hostname.h */; };
155D223D0AF13A7300D52ED0 /* smb-configuration.h in Headers */ = {isa = PBXBuildFile; fileRef = 155D223A0AF13A7300D52ED0 /* smb-configuration.h */; };
156BD6BC07E0DFA9008698FF /* SCPreferencesSetSpecificPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 156BD6BB07E0DFA9008698FF /* SCPreferencesSetSpecificPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 156CA47B0EF853BB00C59A18 /* logger.c in Sources */ = {isa = PBXBuildFile; fileRef = 1531D3DB0E93E6DA00248432 /* logger.c */; };
+ 156CA47D0EF853BB00C59A18 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CB6A6F05C0722B0099E85F /* CoreFoundation.framework */; };
+ 156CA47E0EF853BB00C59A18 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1559C4440D349A4E0098FD59 /* SystemConfiguration.framework */; };
+ 156CA47F0EF853BB00C59A18 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1543636A0752D03C00A8EC6C /* IOKit.framework */; };
+ 1572C4A90CFB55B400E2776E /* SCSchemaDefinitions.h in Headers */ = {isa = PBXBuildFile; fileRef = 150607DE075A00A300B147BA /* SCSchemaDefinitions.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 1572C4AA0CFB55B400E2776E /* SystemConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB691305C0722B0099E85F /* SystemConfiguration.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 1572C4AB0CFB55B400E2776E /* SCPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB691505C0722B0099E85F /* SCPrivate.h */; settings = {ATTRIBUTES = (Project, Private, ); }; };
+ 1572C4AC0CFB55B400E2776E /* SCDPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB691705C0722B0099E85F /* SCDPlugin.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 1572C4AD0CFB55B400E2776E /* SCDynamicStoreInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB691B05C0722B0099E85F /* SCDynamicStoreInternal.h */; settings = {ATTRIBUTES = (Project, ); }; };
+ 1572C4AE0CFB55B400E2776E /* SCDynamicStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB691D05C0722B0099E85F /* SCDynamicStore.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 1572C4AF0CFB55B400E2776E /* SCDynamicStorePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB691F05C0722B0099E85F /* SCDynamicStorePrivate.h */; settings = {ATTRIBUTES = (Project, Private, ); }; };
+ 1572C4B00CFB55B400E2776E /* SCDynamicStoreKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB692105C0722B0099E85F /* SCDynamicStoreKey.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 1572C4B10CFB55B400E2776E /* SCDynamicStoreCopySpecific.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB692305C0722B0099E85F /* SCDynamicStoreCopySpecific.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 1572C4B20CFB55B400E2776E /* SCDynamicStoreCopySpecificPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB692505C0722B0099E85F /* SCDynamicStoreCopySpecificPrivate.h */; settings = {ATTRIBUTES = (Project, Private, ); }; };
+ 1572C4B30CFB55B400E2776E /* SCDynamicStoreSetSpecificPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB692705C0722B0099E85F /* SCDynamicStoreSetSpecificPrivate.h */; settings = {ATTRIBUTES = (Project, Private, ); }; };
+ 1572C4B40CFB55B400E2776E /* SCPreferencesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB692905C0722B0099E85F /* SCPreferencesInternal.h */; settings = {ATTRIBUTES = (Project, ); }; };
+ 1572C4B50CFB55B400E2776E /* SCPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB692B05C0722B0099E85F /* SCPreferences.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 1572C4B60CFB55B400E2776E /* SCPreferencesPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB692D05C0722B0099E85F /* SCPreferencesPrivate.h */; settings = {ATTRIBUTES = (Project, Private, ); }; };
+ 1572C4B70CFB55B400E2776E /* SCPreferencesPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB692F05C0722B0099E85F /* SCPreferencesPath.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 1572C4B80CFB55B400E2776E /* SCPreferencesSetSpecific.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB693105C0722B0099E85F /* SCPreferencesSetSpecific.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 1572C4B90CFB55B400E2776E /* SCNetworkConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 15AD7A380670A85900BFE03C /* SCNetworkConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 1572C4BA0CFB55B400E2776E /* SCNetworkConfigurationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 15AD7A3A0670A85900BFE03C /* SCNetworkConfigurationInternal.h */; settings = {ATTRIBUTES = (); }; };
+ 1572C4BB0CFB55B400E2776E /* SCNetwork.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB693305C0722B0099E85F /* SCNetwork.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 1572C4BC0CFB55B400E2776E /* SCNetworkConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB693505C0722B0099E85F /* SCNetworkConnection.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 1572C4BD0CFB55B400E2776E /* SCNetworkReachability.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB693705C0722B0099E85F /* SCNetworkReachability.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 1572C4BE0CFB55B400E2776E /* SCValidation.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB693905C0722B0099E85F /* SCValidation.h */; settings = {ATTRIBUTES = (Project, Private, ); }; };
+ 1572C4BF0CFB55B400E2776E /* DHCPClientPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB693D05C0722B0099E85F /* DHCPClientPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 1572C4C00CFB55B400E2776E /* SCDynamicStoreCopyDHCPInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB693F05C0722B0099E85F /* SCDynamicStoreCopyDHCPInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 1572C4C10CFB55B400E2776E /* moh_msg.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB694105C0722B0099E85F /* moh_msg.h */; };
+ 1572C4C20CFB55B400E2776E /* moh.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB694305C0722B0099E85F /* moh.h */; };
+ 1572C4C30CFB55B400E2776E /* DeviceOnHold.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB694505C0722B0099E85F /* DeviceOnHold.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 1572C4C50CFB55B400E2776E /* dy_framework.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB694905C0722B0099E85F /* dy_framework.h */; };
+ 1572C4C70CFB55B400E2776E /* SCPreferencesPathKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 151BDA2B05D9E28B00657BC7 /* SCPreferencesPathKey.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 1572C4C80CFB55B400E2776E /* dnsinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 15B73F0905FD1B670096477F /* dnsinfo.h */; };
+ 1572C4C90CFB55B400E2776E /* dnsinfo_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 15B73F0C05FD1B670096477F /* dnsinfo_private.h */; };
+ 1572C4CA0CFB55B400E2776E /* pppcontroller_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 23C1E2B4062DD2C700835B54 /* pppcontroller_types.h */; };
+ 1572C4CB0CFB55B400E2776E /* pppcontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = 23C1E2BE062DD5DB00835B54 /* pppcontroller.h */; };
+ 1572C4CE0CFB55B400E2776E /* SCPreferencesSetSpecificPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 156BD6BB07E0DFA9008698FF /* SCPreferencesSetSpecificPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 1572C4CF0CFB55B400E2776E /* SCPreferencesGetSpecificPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 154CF3F307E1EA4D00D8302E /* SCPreferencesGetSpecificPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 1572C4D00CFB55B400E2776E /* SCNetworkConfigurationPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 155A1E6B081079CC00F70D98 /* SCNetworkConfigurationPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 1572C4D10CFB55B400E2776E /* helper_comm.h in Headers */ = {isa = PBXBuildFile; fileRef = 15DAF2D708466D4900D1B2BD /* helper_comm.h */; };
+ 1572C4D20CFB55B400E2776E /* SCHelper_client.h in Headers */ = {isa = PBXBuildFile; fileRef = 155B7BF60847776D00F0E262 /* SCHelper_client.h */; };
+ 1572C4D40CFB55B400E2776E /* SCNetworkConnectionPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A2972E0A13C08C009879B3 /* SCNetworkConnectionPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 1572C4D50CFB55B400E2776E /* SCPreferencesKeychainPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 152E68C00A2C89C70011FDA8 /* SCPreferencesKeychainPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 1572C4D60CFB55B400E2776E /* SCSchemaDefinitionsPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 157A88880A470D0F003A4256 /* SCSchemaDefinitionsPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 1572C4D70CFB55B400E2776E /* SCNetworkSignature.h in Headers */ = {isa = PBXBuildFile; fileRef = F95B8A440B03E09300993BA3 /* SCNetworkSignature.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 1572C4D80CFB55B400E2776E /* SCNetworkSignaturePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = F95B8A450B03E09300993BA3 /* SCNetworkSignaturePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 1572C4DA0CFB55B400E2776E /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 15A6F7C20A4B266D00B907EA /* Localizable.strings */; };
+ 1572C4DB0CFB55B400E2776E /* NetworkInterface.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1577253606EFBF3100D7B52B /* NetworkInterface.strings */; };
+ 1572C4DC0CFB55B400E2776E /* NetworkConfiguration.plist in Resources */ = {isa = PBXBuildFile; fileRef = 15B686220678B65C00FF4023 /* NetworkConfiguration.plist */; };
+ 1572C4DD0CFB55B400E2776E /* get-mobility-info in Resources */ = {isa = PBXBuildFile; fileRef = 15CFC229068B222F00123568 /* get-mobility-info */; };
+ 1572C4DF0CFB55B400E2776E /* SCSchemaDefinitions.c in Sources */ = {isa = PBXBuildFile; fileRef = 150607BD075A00A200B147BA /* SCSchemaDefinitions.c */; };
+ 1572C4E00CFB55B400E2776E /* SCD.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB695005C0722B0099E85F /* SCD.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4E10CFB55B400E2776E /* SCDKeys.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB695205C0722B0099E85F /* SCDKeys.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4E20CFB55B400E2776E /* SCDPrivate.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB695405C0722B0099E85F /* SCDPrivate.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4E30CFB55B400E2776E /* SCDPlugin.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB695605C0722B0099E85F /* SCDPlugin.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4E40CFB55B400E2776E /* SCDOpen.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB695805C0722B0099E85F /* SCDOpen.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4E50CFB55B400E2776E /* SCDLock.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB695A05C0722B0099E85F /* SCDLock.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4E60CFB55B400E2776E /* SCDUnlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB695C05C0722B0099E85F /* SCDUnlock.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4E70CFB55B400E2776E /* SCDList.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB695E05C0722B0099E85F /* SCDList.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4E80CFB55B400E2776E /* SCDAdd.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB696005C0722B0099E85F /* SCDAdd.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4E90CFB55B400E2776E /* SCDGet.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB696405C0722B0099E85F /* SCDGet.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4EA0CFB55B400E2776E /* SCDSet.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB696605C0722B0099E85F /* SCDSet.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4EB0CFB55B400E2776E /* SCDRemove.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB696805C0722B0099E85F /* SCDRemove.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4EC0CFB55B400E2776E /* SCDTouch.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB696A05C0722B0099E85F /* SCDTouch.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4ED0CFB55B400E2776E /* SCDNotify.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB696C05C0722B0099E85F /* SCDNotify.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4EE0CFB55B400E2776E /* SCDNotifierSetKeys.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB696E05C0722B0099E85F /* SCDNotifierSetKeys.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4EF0CFB55B400E2776E /* SCDNotifierAdd.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB697005C0722B0099E85F /* SCDNotifierAdd.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4F00CFB55B400E2776E /* SCDNotifierRemove.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB697205C0722B0099E85F /* SCDNotifierRemove.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4F10CFB55B400E2776E /* SCDNotifierGetChanges.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB697405C0722B0099E85F /* SCDNotifierGetChanges.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4F20CFB55B400E2776E /* SCDNotifierWait.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB697605C0722B0099E85F /* SCDNotifierWait.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4F30CFB55B400E2776E /* SCDNotifierInformViaCallback.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB697805C0722B0099E85F /* SCDNotifierInformViaCallback.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4F40CFB55B400E2776E /* SCDNotifierInformViaMachPort.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB697A05C0722B0099E85F /* SCDNotifierInformViaMachPort.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4F50CFB55B400E2776E /* SCDNotifierInformViaFD.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB697C05C0722B0099E85F /* SCDNotifierInformViaFD.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4F60CFB55B400E2776E /* SCDNotifierInformViaSignal.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB697E05C0722B0099E85F /* SCDNotifierInformViaSignal.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4F70CFB55B400E2776E /* SCDNotifierCancel.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB698005C0722B0099E85F /* SCDNotifierCancel.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4F80CFB55B400E2776E /* SCDSnapshot.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB698205C0722B0099E85F /* SCDSnapshot.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4F90CFB55B400E2776E /* SCP.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB698405C0722B0099E85F /* SCP.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4FA0CFB55B400E2776E /* SCPOpen.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB698605C0722B0099E85F /* SCPOpen.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4FB0CFB55B400E2776E /* SCPLock.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB698805C0722B0099E85F /* SCPLock.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4FC0CFB55B400E2776E /* SCPUnlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB698A05C0722B0099E85F /* SCPUnlock.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4FD0CFB55B400E2776E /* SCPList.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB698C05C0722B0099E85F /* SCPList.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4FE0CFB55B400E2776E /* SCPGet.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB698E05C0722B0099E85F /* SCPGet.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C4FF0CFB55B400E2776E /* SCPAdd.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB699005C0722B0099E85F /* SCPAdd.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C5000CFB55B400E2776E /* SCPSet.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB699205C0722B0099E85F /* SCPSet.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C5010CFB55B400E2776E /* SCPRemove.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB699405C0722B0099E85F /* SCPRemove.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C5020CFB55B400E2776E /* SCPCommit.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB699605C0722B0099E85F /* SCPCommit.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C5030CFB55B400E2776E /* SCPApply.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB699805C0722B0099E85F /* SCPApply.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C5040CFB55B400E2776E /* SCPPath.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB699A05C0722B0099E85F /* SCPPath.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C5060CFB55B400E2776E /* SCDHostName.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB699E05C0722B0099E85F /* SCDHostName.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C5070CFB55B400E2776E /* SCLocation.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69A005C0722B0099E85F /* SCLocation.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C5080CFB55B400E2776E /* SCNetwork.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69A205C0722B0099E85F /* SCNetwork.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C5090CFB55B400E2776E /* pppcontroller.defs in Sources */ = {isa = PBXBuildFile; fileRef = 23C1E2B8062DD45900835B54 /* pppcontroller.defs */; settings = {ATTRIBUTES = (Client, ); }; };
+ 1572C50A0CFB55B400E2776E /* SCNetworkConnection.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69A405C0722B0099E85F /* SCNetworkConnection.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C50B0CFB55B400E2776E /* SCNetworkConnectionPrivate.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A2972D0A13C08C009879B3 /* SCNetworkConnectionPrivate.c */; };
+ 1572C50C0CFB55B400E2776E /* SCNetworkReachability.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69A605C0722B0099E85F /* SCNetworkReachability.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C50D0CFB55B400E2776E /* SCProxies.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69A805C0722B0099E85F /* SCProxies.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C50E0CFB55B400E2776E /* DHCP.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69AC05C0722B0099E85F /* DHCP.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C50F0CFB55B400E2776E /* moh.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69AE05C0722B0099E85F /* moh.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C5100CFB55B400E2776E /* DeviceOnHold.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69B005C0722B0099E85F /* DeviceOnHold.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C5110CFB55B400E2776E /* LinkConfiguration.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69B205C0722B0099E85F /* LinkConfiguration.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C5120CFB55B400E2776E /* dy_framework.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69B405C0722B0099E85F /* dy_framework.c */; settings = {ATTRIBUTES = (); }; };
+ 1572C5140CFB55B400E2776E /* config.defs in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69BE05C0722B0099E85F /* config.defs */; settings = {ATTRIBUTES = (Client, ); }; };
+ 1572C5150CFB55B400E2776E /* SCPreferencesPathKey.c in Sources */ = {isa = PBXBuildFile; fileRef = 151BDA5D05D9E2ED00657BC7 /* SCPreferencesPathKey.c */; };
+ 1572C5160CFB55B400E2776E /* dnsinfo_private.c in Sources */ = {isa = PBXBuildFile; fileRef = 15B73F0B05FD1B670096477F /* dnsinfo_private.c */; };
+ 1572C5170CFB55B400E2776E /* dnsinfo_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = 15B73F0805FD1B670096477F /* dnsinfo_copy.c */; };
+ 1572C5180CFB55B400E2776E /* shared_dns_info.defs in Sources */ = {isa = PBXBuildFile; fileRef = 15FCAAD005FD0EBF00CB79E6 /* shared_dns_info.defs */; settings = {ATTRIBUTES = (Client, ); }; };
+ 1572C5190CFB55B400E2776E /* SCNetworkConfigurationInternal.c in Sources */ = {isa = PBXBuildFile; fileRef = 15AD7A390670A85900BFE03C /* SCNetworkConfigurationInternal.c */; };
+ 1572C51A0CFB55B400E2776E /* SCNetworkInterface.c in Sources */ = {isa = PBXBuildFile; fileRef = 15AD7A3B0670A85900BFE03C /* SCNetworkInterface.c */; };
+ 1572C51B0CFB55B400E2776E /* SCNetworkProtocol.c in Sources */ = {isa = PBXBuildFile; fileRef = 15AD7A3C0670A85900BFE03C /* SCNetworkProtocol.c */; };
+ 1572C51C0CFB55B400E2776E /* SCNetworkService.c in Sources */ = {isa = PBXBuildFile; fileRef = 15AD7A3D0670A85900BFE03C /* SCNetworkService.c */; };
+ 1572C51D0CFB55B400E2776E /* SCNetworkSet.c in Sources */ = {isa = PBXBuildFile; fileRef = 15AD7A3E0670A85900BFE03C /* SCNetworkSet.c */; };
+ 1572C51F0CFB55B400E2776E /* helper_comm.c in Sources */ = {isa = PBXBuildFile; fileRef = 15DAF2D608466D4900D1B2BD /* helper_comm.c */; };
+ 1572C5200CFB55B400E2776E /* SCHelper_client.c in Sources */ = {isa = PBXBuildFile; fileRef = 15DAF2D808466D4900D1B2BD /* SCHelper_client.c */; };
+ 1572C5210CFB55B400E2776E /* SCPreferencesKeychainPrivate.c in Sources */ = {isa = PBXBuildFile; fileRef = 152E68C20A2C89E30011FDA8 /* SCPreferencesKeychainPrivate.c */; };
+ 1572C5220CFB55B400E2776E /* SCNetworkSignature.c in Sources */ = {isa = PBXBuildFile; fileRef = F95B8A420B03E07A00993BA3 /* SCNetworkSignature.c */; };
+ 1572C5240CFB55B400E2776E /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CB6A6F05C0722B0099E85F /* CoreFoundation.framework */; };
1572EB7B0A506D3B00D02459 /* smb-configuration.c in Sources */ = {isa = PBXBuildFile; fileRef = 1572EB7A0A506D3B00D02459 /* smb-configuration.c */; };
+ 157433E00D4A8122002ACA73 /* scselect.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A2E05C0722B0099E85F /* scselect.c */; settings = {ATTRIBUTES = (); }; };
+ 157433E20D4A8122002ACA73 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CB6A6F05C0722B0099E85F /* CoreFoundation.framework */; };
+ 157433E30D4A8122002ACA73 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1547072E0D1F70C80075C28D /* SystemConfiguration.framework */; };
+ 157433F20D4A8137002ACA73 /* scutil.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB6A4305C0722B0099E85F /* scutil.h */; };
+ 157433F30D4A8137002ACA73 /* commands.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB6A4505C0722B0099E85F /* commands.h */; };
+ 157433F40D4A8137002ACA73 /* dictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB6A4705C0722B0099E85F /* dictionary.h */; };
+ 157433F50D4A8137002ACA73 /* session.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB6A4905C0722B0099E85F /* session.h */; };
+ 157433F60D4A8137002ACA73 /* cache.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB6A4B05C0722B0099E85F /* cache.h */; };
+ 157433F70D4A8137002ACA73 /* notifications.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB6A4D05C0722B0099E85F /* notifications.h */; };
+ 157433F80D4A8137002ACA73 /* tests.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB6A4F05C0722B0099E85F /* tests.h */; };
+ 157433F90D4A8137002ACA73 /* prefs.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB6A5105C0722B0099E85F /* prefs.h */; };
+ 157433FA0D4A8137002ACA73 /* net.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A509A406C2518F001F0AB7 /* net.h */; };
+ 157433FB0D4A8137002ACA73 /* net_interface.h in Headers */ = {isa = PBXBuildFile; fileRef = 15DC34680711D49400A3311C /* net_interface.h */; };
+ 157433FC0D4A8137002ACA73 /* net_protocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 15DC346A0711D49400A3311C /* net_protocol.h */; };
+ 157433FD0D4A8137002ACA73 /* net_service.h in Headers */ = {isa = PBXBuildFile; fileRef = 15DC346C0711D49400A3311C /* net_service.h */; };
+ 157433FE0D4A8137002ACA73 /* net_set.h in Headers */ = {isa = PBXBuildFile; fileRef = 15DC346E0711D49400A3311C /* net_set.h */; };
+ 157434000D4A8137002ACA73 /* scutil.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A5405C0722B0099E85F /* scutil.c */; settings = {ATTRIBUTES = (); }; };
+ 157434010D4A8137002ACA73 /* commands.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A5605C0722B0099E85F /* commands.c */; settings = {ATTRIBUTES = (); }; };
+ 157434020D4A8137002ACA73 /* dictionary.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A5805C0722B0099E85F /* dictionary.c */; settings = {ATTRIBUTES = (); }; };
+ 157434030D4A8137002ACA73 /* session.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A5A05C0722B0099E85F /* session.c */; settings = {ATTRIBUTES = (); }; };
+ 157434040D4A8137002ACA73 /* cache.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A5C05C0722B0099E85F /* cache.c */; settings = {ATTRIBUTES = (); }; };
+ 157434050D4A8137002ACA73 /* notifications.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A5E05C0722B0099E85F /* notifications.c */; settings = {ATTRIBUTES = (); }; };
+ 157434060D4A8137002ACA73 /* tests.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A6005C0722B0099E85F /* tests.c */; settings = {ATTRIBUTES = (); }; };
+ 157434070D4A8137002ACA73 /* prefs.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A6205C0722B0099E85F /* prefs.c */; settings = {ATTRIBUTES = (); }; };
+ 157434080D4A8137002ACA73 /* net.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A509A306C2518F001F0AB7 /* net.c */; };
+ 157434090D4A8137002ACA73 /* net_interface.c in Sources */ = {isa = PBXBuildFile; fileRef = 15DC34670711D49400A3311C /* net_interface.c */; };
+ 1574340A0D4A8137002ACA73 /* net_protocol.c in Sources */ = {isa = PBXBuildFile; fileRef = 15DC34690711D49400A3311C /* net_protocol.c */; };
+ 1574340B0D4A8137002ACA73 /* net_service.c in Sources */ = {isa = PBXBuildFile; fileRef = 15DC346B0711D49400A3311C /* net_service.c */; };
+ 1574340C0D4A8137002ACA73 /* net_set.c in Sources */ = {isa = PBXBuildFile; fileRef = 15DC346D0711D49400A3311C /* net_set.c */; };
+ 1574340E0D4A8137002ACA73 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CB6A6F05C0722B0099E85F /* CoreFoundation.framework */; };
+ 1574340F0D4A8137002ACA73 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1547072E0D1F70C80075C28D /* SystemConfiguration.framework */; };
+ 157434110D4A8137002ACA73 /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 152CEED0070CF6640050F23C /* libedit.dylib */; };
+ 15792B9B0DA2C190008DDED9 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1543636A0752D03C00A8EC6C /* IOKit.framework */; };
+ 157A84DA0D56C63900B6F1A0 /* dnsinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 15B73F0905FD1B670096477F /* dnsinfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 157A84DB0D56C63900B6F1A0 /* dnsinfo_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 15B73F0C05FD1B670096477F /* dnsinfo_private.h */; };
+ 157A84DE0D56C63900B6F1A0 /* shared_dns_info.defs in Sources */ = {isa = PBXBuildFile; fileRef = 15FCAAD005FD0EBF00CB79E6 /* shared_dns_info.defs */; settings = {ATTRIBUTES = (Client, ); }; };
+ 157A84DF0D56C63900B6F1A0 /* dnsinfo_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = 15B73F0805FD1B670096477F /* dnsinfo_copy.c */; };
+ 157A84E00D56C63900B6F1A0 /* dnsinfo_private.c in Sources */ = {isa = PBXBuildFile; fileRef = 15B73F0B05FD1B670096477F /* dnsinfo_private.c */; };
+ 157A84F60D56C7E800B6F1A0 /* dns-configuration.h in Headers */ = {isa = PBXBuildFile; fileRef = 155D22380AF13A7300D52ED0 /* dns-configuration.h */; };
+ 157A84F70D56C7E800B6F1A0 /* set-hostname.h in Headers */ = {isa = PBXBuildFile; fileRef = 155D22390AF13A7300D52ED0 /* set-hostname.h */; };
+ 157A84FB0D56C7E800B6F1A0 /* dns-configuration.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53AA07528B36004F8947 /* dns-configuration.c */; };
+ 157A84FC0D56C7E800B6F1A0 /* set-hostname.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53AB07528B36004F8947 /* set-hostname.c */; };
+ 157A85080D56C8AA00B6F1A0 /* ifnamer.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53AE07528B36004F8947 /* ifnamer.c */; };
+ 157A85120D56C8E000B6F1A0 /* cache.h in Headers */ = {isa = PBXBuildFile; fileRef = 159D53CB07528B36004F8947 /* cache.h */; };
+ 157A85140D56C8E000B6F1A0 /* ev_dlil.h in Headers */ = {isa = PBXBuildFile; fileRef = 159D53B207528B36004F8947 /* ev_dlil.h */; };
+ 157A85150D56C8E000B6F1A0 /* ev_ipv4.h in Headers */ = {isa = PBXBuildFile; fileRef = 159D53B807528B36004F8947 /* ev_ipv4.h */; };
+ 157A85160D56C8E000B6F1A0 /* ev_ipv6.h in Headers */ = {isa = PBXBuildFile; fileRef = 159D53BA07528B36004F8947 /* ev_ipv6.h */; };
+ 157A85170D56C8E000B6F1A0 /* eventmon.h in Headers */ = {isa = PBXBuildFile; fileRef = 159D53B707528B36004F8947 /* eventmon.h */; };
+ 157A85190D56C8E000B6F1A0 /* cache.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53CA07528B36004F8947 /* cache.c */; };
+ 157A851B0D56C8E000B6F1A0 /* ev_dlil.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53B107528B36004F8947 /* ev_dlil.c */; };
+ 157A851C0D56C8E000B6F1A0 /* ev_ipv4.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53B307528B36004F8947 /* ev_ipv4.c */; };
+ 157A851D0D56C8E000B6F1A0 /* ev_ipv6.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53B407528B36004F8947 /* ev_ipv6.c */; };
+ 157A851E0D56C8E000B6F1A0 /* eventmon.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53B007528B36004F8947 /* eventmon.c */; };
+ 157A85290D56C91100B6F1A0 /* linkconfig.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53C107528B36004F8947 /* linkconfig.c */; };
+ 157A85340D56C94F00B6F1A0 /* NetworkIdentification.c in Sources */ = {isa = PBXBuildFile; fileRef = F95B8A680B03F97800993BA3 /* NetworkIdentification.c */; };
+ 157A853F0D56C96F00B6F1A0 /* prefsmon.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53C307528B36004F8947 /* prefsmon.c */; };
157A88890A470D0F003A4256 /* SCSchemaDefinitionsPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 157A88880A470D0F003A4256 /* SCSchemaDefinitionsPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 158ADD0E0754F1A000124717 /* Resolvers.plist in Resources */ = {isa = PBXBuildFile; fileRef = 159D53A807528B36004F8947 /* Resolvers.plist */; };
+ 158317250CFB80A1006F62B9 /* configd.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB69CF05C0722B0099E85F /* configd.h */; };
+ 158317260CFB80A1006F62B9 /* _SCD.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB69D105C0722B0099E85F /* _SCD.h */; };
+ 158317270CFB80A1006F62B9 /* configd_server.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB69D305C0722B0099E85F /* configd_server.h */; };
+ 158317280CFB80A1006F62B9 /* notify_server.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB69D505C0722B0099E85F /* notify_server.h */; };
+ 158317290CFB80A1006F62B9 /* plugin_support.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB69D705C0722B0099E85F /* plugin_support.h */; };
+ 1583172A0CFB80A1006F62B9 /* session.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB69D905C0722B0099E85F /* session.h */; };
+ 1583172B0CFB80A1006F62B9 /* pattern.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB69DB05C0722B0099E85F /* pattern.h */; };
+ 1583172D0CFB80A1006F62B9 /* configd.m in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69E005C0722B0099E85F /* configd.m */; settings = {ATTRIBUTES = (); }; };
+ 1583172E0CFB80A1006F62B9 /* _SCD.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69E205C0722B0099E85F /* _SCD.c */; settings = {ATTRIBUTES = (); }; };
+ 1583172F0CFB80A1006F62B9 /* configd_server.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69E405C0722B0099E85F /* configd_server.c */; settings = {ATTRIBUTES = (); }; };
+ 158317300CFB80A1006F62B9 /* notify_server.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69E605C0722B0099E85F /* notify_server.c */; settings = {ATTRIBUTES = (); }; };
+ 158317310CFB80A1006F62B9 /* plugin_support.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69E805C0722B0099E85F /* plugin_support.c */; settings = {ATTRIBUTES = (); }; };
+ 158317320CFB80A1006F62B9 /* session.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69EA05C0722B0099E85F /* session.c */; settings = {ATTRIBUTES = (); }; };
+ 158317330CFB80A1006F62B9 /* pattern.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69EC05C0722B0099E85F /* pattern.c */; settings = {ATTRIBUTES = (); }; };
+ 158317340CFB80A1006F62B9 /* _configopen.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69F005C0722B0099E85F /* _configopen.c */; settings = {ATTRIBUTES = (); }; };
+ 158317350CFB80A1006F62B9 /* _configclose.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69F205C0722B0099E85F /* _configclose.c */; settings = {ATTRIBUTES = (); }; };
+ 158317360CFB80A1006F62B9 /* _configlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69F405C0722B0099E85F /* _configlock.c */; settings = {ATTRIBUTES = (); }; };
+ 158317370CFB80A1006F62B9 /* _configunlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69F605C0722B0099E85F /* _configunlock.c */; settings = {ATTRIBUTES = (); }; };
+ 158317380CFB80A1006F62B9 /* _configlist.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69F805C0722B0099E85F /* _configlist.c */; settings = {ATTRIBUTES = (); }; };
+ 158317390CFB80A1006F62B9 /* _configadd.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69FA05C0722B0099E85F /* _configadd.c */; settings = {ATTRIBUTES = (); }; };
+ 1583173A0CFB80A1006F62B9 /* _configget.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69FE05C0722B0099E85F /* _configget.c */; settings = {ATTRIBUTES = (); }; };
+ 1583173B0CFB80A1006F62B9 /* _configset.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A0005C0722B0099E85F /* _configset.c */; settings = {ATTRIBUTES = (); }; };
+ 1583173C0CFB80A1006F62B9 /* _configremove.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A0205C0722B0099E85F /* _configremove.c */; settings = {ATTRIBUTES = (); }; };
+ 1583173D0CFB80A1006F62B9 /* _configtouch.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A0405C0722B0099E85F /* _configtouch.c */; settings = {ATTRIBUTES = (); }; };
+ 1583173E0CFB80A1006F62B9 /* _confignotify.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A0605C0722B0099E85F /* _confignotify.c */; settings = {ATTRIBUTES = (); }; };
+ 1583173F0CFB80A1006F62B9 /* _notifyadd.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A0805C0722B0099E85F /* _notifyadd.c */; settings = {ATTRIBUTES = (); }; };
+ 158317400CFB80A1006F62B9 /* _notifyremove.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A0A05C0722B0099E85F /* _notifyremove.c */; settings = {ATTRIBUTES = (); }; };
+ 158317410CFB80A1006F62B9 /* _notifychanges.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A0C05C0722B0099E85F /* _notifychanges.c */; settings = {ATTRIBUTES = (); }; };
+ 158317420CFB80A1006F62B9 /* _notifyviaport.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A0E05C0722B0099E85F /* _notifyviaport.c */; settings = {ATTRIBUTES = (); }; };
+ 158317430CFB80A1006F62B9 /* _notifyviafd.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A1005C0722B0099E85F /* _notifyviafd.c */; settings = {ATTRIBUTES = (); }; };
+ 158317440CFB80A1006F62B9 /* _notifyviasignal.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A1205C0722B0099E85F /* _notifyviasignal.c */; settings = {ATTRIBUTES = (); }; };
+ 158317450CFB80A1006F62B9 /* _notifycancel.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A1405C0722B0099E85F /* _notifycancel.c */; settings = {ATTRIBUTES = (); }; };
+ 158317460CFB80A1006F62B9 /* _snapshot.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB6A1605C0722B0099E85F /* _snapshot.c */; settings = {ATTRIBUTES = (); }; };
+ 158317470CFB80A1006F62B9 /* config.defs in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69BE05C0722B0099E85F /* config.defs */; settings = {ATTRIBUTES = (Server, ); }; };
+ 158317480CFB80A1006F62B9 /* dnsinfo_private.c in Sources */ = {isa = PBXBuildFile; fileRef = 15B73F0B05FD1B670096477F /* dnsinfo_private.c */; };
+ 158317490CFB80A1006F62B9 /* dnsinfo_server.c in Sources */ = {isa = PBXBuildFile; fileRef = 15B73F0D05FD1B670096477F /* dnsinfo_server.c */; };
+ 1583174A0CFB80A1006F62B9 /* shared_dns_info.defs in Sources */ = {isa = PBXBuildFile; fileRef = 15FCAAD005FD0EBF00CB79E6 /* shared_dns_info.defs */; settings = {ATTRIBUTES = (Server, ); }; };
+ 1583174C0CFB80A1006F62B9 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CB6A6F05C0722B0099E85F /* CoreFoundation.framework */; };
+ 1583174E0CFB80A1006F62B9 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1543636A0752D03C00A8EC6C /* IOKit.framework */; };
+ 158317500CFB80A1006F62B9 /* libbsm.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15BAA32207F0699A00D9EC95 /* libbsm.dylib */; };
+ 158317520CFB80A1006F62B9 /* libKernelEventMonitor.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 159D53D407528BDA004F8947 /* libKernelEventMonitor.a */; };
+ 158317530CFB80A1006F62B9 /* libInterfaceNamer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 159D53E507528C4A004F8947 /* libInterfaceNamer.a */; };
+ 158317540CFB80A1006F62B9 /* libIPMonitor.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 159D53EC07528C61004F8947 /* libIPMonitor.a */; };
+ 158317550CFB80A1006F62B9 /* libLinkConfiguration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 159D53F307528C79004F8947 /* libLinkConfiguration.a */; };
+ 158317560CFB80A1006F62B9 /* libNetworkIdentification.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F95B8A5F0B03F81400993BA3 /* libNetworkIdentification.a */; };
+ 158317570CFB80A1006F62B9 /* libPreferencesMonitor.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 159D53FA07528C95004F8947 /* libPreferencesMonitor.a */; };
+ 1583175C0CFB80A1006F62B9 /* com.apple.configd.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1540E3600987DA9500157C07 /* com.apple.configd.plist */; };
+ 1583379B0CFB6B9E0033AB93 /* helper_comm.h in Headers */ = {isa = PBXBuildFile; fileRef = 15DAF2D708466D4900D1B2BD /* helper_comm.h */; };
+ 1583379C0CFB6B9E0033AB93 /* SCHelper_client.h in Headers */ = {isa = PBXBuildFile; fileRef = 155B7BF60847776D00F0E262 /* SCHelper_client.h */; };
+ 1583379E0CFB6B9E0033AB93 /* SCHelper_server.c in Sources */ = {isa = PBXBuildFile; fileRef = 15DAF2D908466D4900D1B2BD /* SCHelper_server.c */; };
+ 158337A00CFB6B9E0033AB93 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CB6A6F05C0722B0099E85F /* CoreFoundation.framework */; };
+ 158337A20CFB6B9E0033AB93 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1520A3DE0846B2DC0010B584 /* Security.framework */; };
+ 158337AD0CFB6BDC0033AB93 /* com.apple.SCHelper-embedded.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 151356AD0CE0CF2F0017E523 /* com.apple.SCHelper-embedded.plist */; };
158ADD190754F1F100124717 /* Kicker.xml in Resources */ = {isa = PBXBuildFile; fileRef = 159D53BC07528B36004F8947 /* Kicker.xml */; };
158ADD1B0754F1F400124717 /* enable-network in Resources */ = {isa = PBXBuildFile; fileRef = 159D53BD07528B36004F8947 /* enable-network */; };
+ 15943D440E94081800B87535 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1543636A0752D03C00A8EC6C /* IOKit.framework */; };
+ 159C32B60F583724008A72EE /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1520A3DE0846B2DC0010B584 /* Security.framework */; };
+ 159C9B290DB68E0700BEEF10 /* atconfig.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53C707528B36004F8947 /* atconfig.c */; };
+ 159C9B2A0DB68E0800BEEF10 /* cfManager.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53C507528B36004F8947 /* cfManager.c */; };
+ 159C9B2D0DB68E3D00BEEF10 /* cache.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53CA07528B36004F8947 /* cache.c */; };
+ 159C9B300DB68E8400BEEF10 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CB6A6F05C0722B0099E85F /* CoreFoundation.framework */; };
+ 159C9B7A0DB68E8A00BEEF10 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1559C4440D349A4E0098FD59 /* SystemConfiguration.framework */; };
+ 159C9B820DB68EE500BEEF10 /* kicker.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53BE07528B36004F8947 /* kicker.c */; };
+ 159C9B860DB68F1600BEEF10 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CB6A6F05C0722B0099E85F /* CoreFoundation.framework */; };
+ 159C9B870DB68F1600BEEF10 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1559C4440D349A4E0098FD59 /* SystemConfiguration.framework */; };
159D540907528D3A004F8947 /* cache.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53CA07528B36004F8947 /* cache.c */; };
159D540A07528D3B004F8947 /* cache.h in Headers */ = {isa = PBXBuildFile; fileRef = 159D53CB07528B36004F8947 /* cache.h */; };
- 159D540B07528DA9004F8947 /* ev_appletalk.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53B907528B36004F8947 /* ev_appletalk.c */; };
- 159D540C07528DAA004F8947 /* ev_appletalk.h in Headers */ = {isa = PBXBuildFile; fileRef = 159D53B607528B36004F8947 /* ev_appletalk.h */; };
159D540D07528DAE004F8947 /* ev_dlil.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53B107528B36004F8947 /* ev_dlil.c */; };
159D540E07528DAE004F8947 /* ev_dlil.h in Headers */ = {isa = PBXBuildFile; fileRef = 159D53B207528B36004F8947 /* ev_dlil.h */; };
159D540F07528DB0004F8947 /* ev_ipv4.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53B307528B36004F8947 /* ev_ipv4.c */; };
159D541207528DB3004F8947 /* ev_ipv6.h in Headers */ = {isa = PBXBuildFile; fileRef = 159D53BA07528B36004F8947 /* ev_ipv6.h */; };
159D541307528DB5004F8947 /* eventmon.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53B007528B36004F8947 /* eventmon.c */; };
159D541407528DB5004F8947 /* eventmon.h in Headers */ = {isa = PBXBuildFile; fileRef = 159D53B707528B36004F8947 /* eventmon.h */; };
- 159D541507528DDE004F8947 /* kicker.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53BE07528B36004F8947 /* kicker.c */; };
159D541607528DF1004F8947 /* ifnamer.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53AE07528B36004F8947 /* ifnamer.c */; };
159D541707528E05004F8947 /* ip_plugin.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53A707528B36004F8947 /* ip_plugin.c */; };
159D541807528E09004F8947 /* dns-configuration.c in Sources */ = {isa = PBXBuildFile; fileRef = 159D53AA07528B36004F8947 /* dns-configuration.c */; };
159D54D607529FFF004F8947 /* configd.8 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 15CB6A2005C0722B0099E85F /* configd.8 */; };
15A2972F0A13C08C009879B3 /* SCNetworkConnectionPrivate.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A2972D0A13C08C009879B3 /* SCNetworkConnectionPrivate.c */; };
15A297300A13C08C009879B3 /* SCNetworkConnectionPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A2972E0A13C08C009879B3 /* SCNetworkConnectionPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 15A5A1E70D5B94190087BDA0 /* SCSchemaDefinitions.h in Headers */ = {isa = PBXBuildFile; fileRef = 150607DE075A00A300B147BA /* SCSchemaDefinitions.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 15A5A1E80D5B94190087BDA0 /* SystemConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB691305C0722B0099E85F /* SystemConfiguration.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 15A5A1E90D5B94190087BDA0 /* SCPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB691505C0722B0099E85F /* SCPrivate.h */; settings = {ATTRIBUTES = (Project, Private, ); }; };
+ 15A5A1EA0D5B94190087BDA0 /* SCDPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB691705C0722B0099E85F /* SCDPlugin.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 15A5A1EB0D5B94190087BDA0 /* SCDynamicStoreInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB691B05C0722B0099E85F /* SCDynamicStoreInternal.h */; settings = {ATTRIBUTES = (Project, ); }; };
+ 15A5A1EC0D5B94190087BDA0 /* SCDynamicStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB691D05C0722B0099E85F /* SCDynamicStore.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 15A5A1ED0D5B94190087BDA0 /* SCDynamicStorePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB691F05C0722B0099E85F /* SCDynamicStorePrivate.h */; settings = {ATTRIBUTES = (Project, Private, ); }; };
+ 15A5A1EE0D5B94190087BDA0 /* SCDynamicStoreKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB692105C0722B0099E85F /* SCDynamicStoreKey.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 15A5A1EF0D5B94190087BDA0 /* SCDynamicStoreCopySpecific.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB692305C0722B0099E85F /* SCDynamicStoreCopySpecific.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 15A5A1F00D5B94190087BDA0 /* SCDynamicStoreCopySpecificPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB692505C0722B0099E85F /* SCDynamicStoreCopySpecificPrivate.h */; settings = {ATTRIBUTES = (Project, Private, ); }; };
+ 15A5A1F10D5B94190087BDA0 /* SCDynamicStoreSetSpecificPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB692705C0722B0099E85F /* SCDynamicStoreSetSpecificPrivate.h */; settings = {ATTRIBUTES = (Project, Private, ); }; };
+ 15A5A1F20D5B94190087BDA0 /* SCPreferencesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB692905C0722B0099E85F /* SCPreferencesInternal.h */; settings = {ATTRIBUTES = (Project, ); }; };
+ 15A5A1F30D5B94190087BDA0 /* SCPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB692B05C0722B0099E85F /* SCPreferences.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 15A5A1F40D5B94190087BDA0 /* SCPreferencesPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB692D05C0722B0099E85F /* SCPreferencesPrivate.h */; settings = {ATTRIBUTES = (Project, Private, ); }; };
+ 15A5A1F50D5B94190087BDA0 /* SCPreferencesPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB692F05C0722B0099E85F /* SCPreferencesPath.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 15A5A1F60D5B94190087BDA0 /* SCPreferencesSetSpecific.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB693105C0722B0099E85F /* SCPreferencesSetSpecific.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 15A5A1F70D5B94190087BDA0 /* SCNetworkConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 15AD7A380670A85900BFE03C /* SCNetworkConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 15A5A1F80D5B94190087BDA0 /* SCNetworkConfigurationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 15AD7A3A0670A85900BFE03C /* SCNetworkConfigurationInternal.h */; settings = {ATTRIBUTES = (); }; };
+ 15A5A1F90D5B94190087BDA0 /* SCNetwork.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB693305C0722B0099E85F /* SCNetwork.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 15A5A1FA0D5B94190087BDA0 /* SCNetworkConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB693505C0722B0099E85F /* SCNetworkConnection.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 15A5A1FB0D5B94190087BDA0 /* SCNetworkReachability.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB693705C0722B0099E85F /* SCNetworkReachability.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
+ 15A5A1FC0D5B94190087BDA0 /* SCValidation.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB693905C0722B0099E85F /* SCValidation.h */; settings = {ATTRIBUTES = (Project, Private, ); }; };
+ 15A5A1FD0D5B94190087BDA0 /* DHCPClientPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB693D05C0722B0099E85F /* DHCPClientPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 15A5A1FE0D5B94190087BDA0 /* SCDynamicStoreCopyDHCPInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB693F05C0722B0099E85F /* SCDynamicStoreCopyDHCPInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 15A5A1FF0D5B94190087BDA0 /* moh_msg.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB694105C0722B0099E85F /* moh_msg.h */; };
+ 15A5A2000D5B94190087BDA0 /* moh.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB694305C0722B0099E85F /* moh.h */; };
+ 15A5A2010D5B94190087BDA0 /* DeviceOnHold.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB694505C0722B0099E85F /* DeviceOnHold.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 15A5A2030D5B94190087BDA0 /* dy_framework.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB694905C0722B0099E85F /* dy_framework.h */; };
+ 15A5A2050D5B94190087BDA0 /* SCPreferencesPathKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 151BDA2B05D9E28B00657BC7 /* SCPreferencesPathKey.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 15A5A2060D5B94190087BDA0 /* dnsinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 15B73F0905FD1B670096477F /* dnsinfo.h */; };
+ 15A5A2070D5B94190087BDA0 /* dnsinfo_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 15B73F0C05FD1B670096477F /* dnsinfo_private.h */; };
+ 15A5A2080D5B94190087BDA0 /* pppcontroller_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 23C1E2B4062DD2C700835B54 /* pppcontroller_types.h */; };
+ 15A5A2090D5B94190087BDA0 /* pppcontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = 23C1E2BE062DD5DB00835B54 /* pppcontroller.h */; };
+ 15A5A20C0D5B94190087BDA0 /* SCPreferencesSetSpecificPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 156BD6BB07E0DFA9008698FF /* SCPreferencesSetSpecificPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 15A5A20D0D5B94190087BDA0 /* SCPreferencesGetSpecificPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 154CF3F307E1EA4D00D8302E /* SCPreferencesGetSpecificPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 15A5A20E0D5B94190087BDA0 /* SCNetworkConfigurationPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 155A1E6B081079CC00F70D98 /* SCNetworkConfigurationPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 15A5A20F0D5B94190087BDA0 /* helper_comm.h in Headers */ = {isa = PBXBuildFile; fileRef = 15DAF2D708466D4900D1B2BD /* helper_comm.h */; };
+ 15A5A2100D5B94190087BDA0 /* SCHelper_client.h in Headers */ = {isa = PBXBuildFile; fileRef = 155B7BF60847776D00F0E262 /* SCHelper_client.h */; };
+ 15A5A2110D5B94190087BDA0 /* SCNetworkConnectionPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A2972E0A13C08C009879B3 /* SCNetworkConnectionPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 15A5A2120D5B94190087BDA0 /* SCPreferencesKeychainPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 152E68C00A2C89C70011FDA8 /* SCPreferencesKeychainPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 15A5A2130D5B94190087BDA0 /* SCSchemaDefinitionsPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 157A88880A470D0F003A4256 /* SCSchemaDefinitionsPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 15A5A2140D5B94190087BDA0 /* SCNetworkSignature.h in Headers */ = {isa = PBXBuildFile; fileRef = F95B8A440B03E09300993BA3 /* SCNetworkSignature.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 15A5A2150D5B94190087BDA0 /* SCNetworkSignaturePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = F95B8A450B03E09300993BA3 /* SCNetworkSignaturePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 15A5A2190D5B94190087BDA0 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 15A6F7C20A4B266D00B907EA /* Localizable.strings */; };
+ 15A5A21A0D5B94190087BDA0 /* NetworkInterface.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1577253606EFBF3100D7B52B /* NetworkInterface.strings */; };
+ 15A5A21B0D5B94190087BDA0 /* NetworkConfiguration.plist in Resources */ = {isa = PBXBuildFile; fileRef = 15B686220678B65C00FF4023 /* NetworkConfiguration.plist */; };
+ 15A5A21E0D5B94190087BDA0 /* SCSchemaDefinitions.c in Sources */ = {isa = PBXBuildFile; fileRef = 150607BD075A00A200B147BA /* SCSchemaDefinitions.c */; };
+ 15A5A21F0D5B94190087BDA0 /* SCD.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB695005C0722B0099E85F /* SCD.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2200D5B94190087BDA0 /* SCDKeys.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB695205C0722B0099E85F /* SCDKeys.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2210D5B94190087BDA0 /* SCDPrivate.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB695405C0722B0099E85F /* SCDPrivate.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2220D5B94190087BDA0 /* SCDPlugin.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB695605C0722B0099E85F /* SCDPlugin.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2230D5B94190087BDA0 /* SCDOpen.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB695805C0722B0099E85F /* SCDOpen.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2240D5B94190087BDA0 /* SCDLock.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB695A05C0722B0099E85F /* SCDLock.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2250D5B94190087BDA0 /* SCDUnlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB695C05C0722B0099E85F /* SCDUnlock.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2260D5B94190087BDA0 /* SCDList.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB695E05C0722B0099E85F /* SCDList.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2270D5B94190087BDA0 /* SCDAdd.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB696005C0722B0099E85F /* SCDAdd.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2280D5B94190087BDA0 /* SCDGet.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB696405C0722B0099E85F /* SCDGet.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2290D5B94190087BDA0 /* SCDSet.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB696605C0722B0099E85F /* SCDSet.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A22A0D5B94190087BDA0 /* SCDRemove.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB696805C0722B0099E85F /* SCDRemove.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A22B0D5B94190087BDA0 /* SCDTouch.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB696A05C0722B0099E85F /* SCDTouch.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A22C0D5B94190087BDA0 /* SCDNotify.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB696C05C0722B0099E85F /* SCDNotify.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A22D0D5B94190087BDA0 /* SCDNotifierSetKeys.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB696E05C0722B0099E85F /* SCDNotifierSetKeys.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A22E0D5B94190087BDA0 /* SCDNotifierAdd.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB697005C0722B0099E85F /* SCDNotifierAdd.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A22F0D5B94190087BDA0 /* SCDNotifierRemove.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB697205C0722B0099E85F /* SCDNotifierRemove.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2300D5B94190087BDA0 /* SCDNotifierGetChanges.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB697405C0722B0099E85F /* SCDNotifierGetChanges.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2310D5B94190087BDA0 /* SCDNotifierWait.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB697605C0722B0099E85F /* SCDNotifierWait.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2320D5B94190087BDA0 /* SCDNotifierInformViaCallback.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB697805C0722B0099E85F /* SCDNotifierInformViaCallback.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2330D5B94190087BDA0 /* SCDNotifierInformViaMachPort.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB697A05C0722B0099E85F /* SCDNotifierInformViaMachPort.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2340D5B94190087BDA0 /* SCDNotifierInformViaFD.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB697C05C0722B0099E85F /* SCDNotifierInformViaFD.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2350D5B94190087BDA0 /* SCDNotifierInformViaSignal.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB697E05C0722B0099E85F /* SCDNotifierInformViaSignal.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2360D5B94190087BDA0 /* SCDNotifierCancel.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB698005C0722B0099E85F /* SCDNotifierCancel.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2370D5B94190087BDA0 /* SCDSnapshot.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB698205C0722B0099E85F /* SCDSnapshot.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2380D5B94190087BDA0 /* SCP.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB698405C0722B0099E85F /* SCP.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2390D5B94190087BDA0 /* SCPOpen.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB698605C0722B0099E85F /* SCPOpen.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A23A0D5B94190087BDA0 /* SCPLock.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB698805C0722B0099E85F /* SCPLock.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A23B0D5B94190087BDA0 /* SCPUnlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB698A05C0722B0099E85F /* SCPUnlock.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A23C0D5B94190087BDA0 /* SCPList.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB698C05C0722B0099E85F /* SCPList.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A23D0D5B94190087BDA0 /* SCPGet.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB698E05C0722B0099E85F /* SCPGet.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A23E0D5B94190087BDA0 /* SCPAdd.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB699005C0722B0099E85F /* SCPAdd.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A23F0D5B94190087BDA0 /* SCPSet.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB699205C0722B0099E85F /* SCPSet.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2400D5B94190087BDA0 /* SCPRemove.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB699405C0722B0099E85F /* SCPRemove.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2410D5B94190087BDA0 /* SCPCommit.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB699605C0722B0099E85F /* SCPCommit.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2420D5B94190087BDA0 /* SCPApply.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB699805C0722B0099E85F /* SCPApply.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2430D5B94190087BDA0 /* SCPPath.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB699A05C0722B0099E85F /* SCPPath.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2450D5B94190087BDA0 /* SCDHostName.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB699E05C0722B0099E85F /* SCDHostName.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2460D5B94190087BDA0 /* SCLocation.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69A005C0722B0099E85F /* SCLocation.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2470D5B94190087BDA0 /* SCNetwork.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69A205C0722B0099E85F /* SCNetwork.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2480D5B94190087BDA0 /* pppcontroller.defs in Sources */ = {isa = PBXBuildFile; fileRef = 23C1E2B8062DD45900835B54 /* pppcontroller.defs */; settings = {ATTRIBUTES = (Client, ); }; };
+ 15A5A2490D5B94190087BDA0 /* SCNetworkConnection.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69A405C0722B0099E85F /* SCNetworkConnection.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A24A0D5B94190087BDA0 /* SCNetworkConnectionPrivate.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A2972D0A13C08C009879B3 /* SCNetworkConnectionPrivate.c */; };
+ 15A5A24B0D5B94190087BDA0 /* SCNetworkReachability.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69A605C0722B0099E85F /* SCNetworkReachability.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A24C0D5B94190087BDA0 /* SCProxies.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69A805C0722B0099E85F /* SCProxies.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A24D0D5B94190087BDA0 /* DHCP.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69AC05C0722B0099E85F /* DHCP.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A24E0D5B94190087BDA0 /* moh.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69AE05C0722B0099E85F /* moh.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A24F0D5B94190087BDA0 /* DeviceOnHold.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69B005C0722B0099E85F /* DeviceOnHold.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2500D5B94190087BDA0 /* LinkConfiguration.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69B205C0722B0099E85F /* LinkConfiguration.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2510D5B94190087BDA0 /* dy_framework.c in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69B405C0722B0099E85F /* dy_framework.c */; settings = {ATTRIBUTES = (); }; };
+ 15A5A2530D5B94190087BDA0 /* config.defs in Sources */ = {isa = PBXBuildFile; fileRef = 15CB69BE05C0722B0099E85F /* config.defs */; settings = {ATTRIBUTES = (Client, ); }; };
+ 15A5A2540D5B94190087BDA0 /* SCPreferencesPathKey.c in Sources */ = {isa = PBXBuildFile; fileRef = 151BDA5D05D9E2ED00657BC7 /* SCPreferencesPathKey.c */; };
+ 15A5A2550D5B94190087BDA0 /* dnsinfo_private.c in Sources */ = {isa = PBXBuildFile; fileRef = 15B73F0B05FD1B670096477F /* dnsinfo_private.c */; };
+ 15A5A2560D5B94190087BDA0 /* dnsinfo_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = 15B73F0805FD1B670096477F /* dnsinfo_copy.c */; };
+ 15A5A2570D5B94190087BDA0 /* shared_dns_info.defs in Sources */ = {isa = PBXBuildFile; fileRef = 15FCAAD005FD0EBF00CB79E6 /* shared_dns_info.defs */; settings = {ATTRIBUTES = (Client, ); }; };
+ 15A5A2580D5B94190087BDA0 /* SCNetworkConfigurationInternal.c in Sources */ = {isa = PBXBuildFile; fileRef = 15AD7A390670A85900BFE03C /* SCNetworkConfigurationInternal.c */; };
+ 15A5A2590D5B94190087BDA0 /* SCNetworkInterface.c in Sources */ = {isa = PBXBuildFile; fileRef = 15AD7A3B0670A85900BFE03C /* SCNetworkInterface.c */; };
+ 15A5A25A0D5B94190087BDA0 /* SCNetworkProtocol.c in Sources */ = {isa = PBXBuildFile; fileRef = 15AD7A3C0670A85900BFE03C /* SCNetworkProtocol.c */; };
+ 15A5A25B0D5B94190087BDA0 /* SCNetworkService.c in Sources */ = {isa = PBXBuildFile; fileRef = 15AD7A3D0670A85900BFE03C /* SCNetworkService.c */; };
+ 15A5A25C0D5B94190087BDA0 /* SCNetworkSet.c in Sources */ = {isa = PBXBuildFile; fileRef = 15AD7A3E0670A85900BFE03C /* SCNetworkSet.c */; };
+ 15A5A25E0D5B94190087BDA0 /* helper_comm.c in Sources */ = {isa = PBXBuildFile; fileRef = 15DAF2D608466D4900D1B2BD /* helper_comm.c */; };
+ 15A5A25F0D5B94190087BDA0 /* SCHelper_client.c in Sources */ = {isa = PBXBuildFile; fileRef = 15DAF2D808466D4900D1B2BD /* SCHelper_client.c */; };
+ 15A5A2600D5B94190087BDA0 /* SCPreferencesKeychainPrivate.c in Sources */ = {isa = PBXBuildFile; fileRef = 152E68C20A2C89E30011FDA8 /* SCPreferencesKeychainPrivate.c */; };
+ 15A5A2610D5B94190087BDA0 /* SCNetworkSignature.c in Sources */ = {isa = PBXBuildFile; fileRef = F95B8A420B03E07A00993BA3 /* SCNetworkSignature.c */; };
+ 15A5A2630D5B94190087BDA0 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CB6A6F05C0722B0099E85F /* CoreFoundation.framework */; };
15A6F7C40A4B266D00B907EA /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 15A6F7C20A4B266D00B907EA /* Localizable.strings */; };
15BAA32307F0699A00D9EC95 /* libbsm.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15BAA32207F0699A00D9EC95 /* libbsm.dylib */; };
+ 15D48EBF0F67061600B4711E /* dnsinfo_create.c in Sources */ = {isa = PBXBuildFile; fileRef = 1521FC5C060F296A003B28F5 /* dnsinfo_create.c */; };
+ 15D48EC00F67061700B4711E /* dnsinfo_create.h in Headers */ = {isa = PBXBuildFile; fileRef = 1532629006281C9D00B1C10C /* dnsinfo_create.h */; };
+ 15D48EC10F67061F00B4711E /* dnsinfo_create.c in Sources */ = {isa = PBXBuildFile; fileRef = 1521FC5C060F296A003B28F5 /* dnsinfo_create.c */; };
+ 15D48EC20F67061F00B4711E /* dnsinfo_create.h in Headers */ = {isa = PBXBuildFile; fileRef = 1532629006281C9D00B1C10C /* dnsinfo_create.h */; };
+ 15D48ED30F67079B00B4711E /* shared_dns_info.defs in Sources */ = {isa = PBXBuildFile; fileRef = 15FCAAD005FD0EBF00CB79E6 /* shared_dns_info.defs */; };
+ 15D48ED40F6707A600B4711E /* shared_dns_info.defs in Sources */ = {isa = PBXBuildFile; fileRef = 15FCAAD005FD0EBF00CB79E6 /* shared_dns_info.defs */; };
15DAD5E1075913CE0084A6ED /* dnsinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 15B73F0905FD1B670096477F /* dnsinfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
15DAD5E2075913CE0084A6ED /* dnsinfo_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 15B73F0C05FD1B670096477F /* dnsinfo_private.h */; };
- 15DAD5E3075913CE0084A6ED /* dnsinfo_create.h in Headers */ = {isa = PBXBuildFile; fileRef = 1532629006281C9D00B1C10C /* dnsinfo_create.h */; settings = {ATTRIBUTES = (Public, ); }; };
15DAD5E5075913CE0084A6ED /* shared_dns_info.defs in Sources */ = {isa = PBXBuildFile; fileRef = 15FCAAD005FD0EBF00CB79E6 /* shared_dns_info.defs */; settings = {ATTRIBUTES = (Client, ); }; };
15DAD5E6075913CE0084A6ED /* dnsinfo_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = 15B73F0805FD1B670096477F /* dnsinfo_copy.c */; };
15DAD5E7075913CE0084A6ED /* dnsinfo_private.c in Sources */ = {isa = PBXBuildFile; fileRef = 15B73F0B05FD1B670096477F /* dnsinfo_private.c */; };
- 15DAD5E8075913CE0084A6ED /* dnsinfo_create.c in Sources */ = {isa = PBXBuildFile; fileRef = 1521FC5C060F296A003B28F5 /* dnsinfo_create.c */; };
15DAD64307591A1A0084A6ED /* SystemConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB691305C0722B0099E85F /* SystemConfiguration.h */; settings = {ATTRIBUTES = (Public, Project, ); }; };
15DAD64407591A1A0084A6ED /* SCPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB691505C0722B0099E85F /* SCPrivate.h */; settings = {ATTRIBUTES = (Project, Private, ); }; };
15DAD64507591A1A0084A6ED /* SCDPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB691705C0722B0099E85F /* SCDPlugin.h */; settings = {ATTRIBUTES = (Private, ); }; };
15DAD65C07591A1A0084A6ED /* DeviceOnHold.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB694505C0722B0099E85F /* DeviceOnHold.h */; settings = {ATTRIBUTES = (Private, ); }; };
15DAD65D07591A1A0084A6ED /* LinkConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB694705C0722B0099E85F /* LinkConfiguration.h */; settings = {ATTRIBUTES = (Private, ); }; };
15DAD65E07591A1A0084A6ED /* dy_framework.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB694905C0722B0099E85F /* dy_framework.h */; };
- 15DAD65F07591A1A0084A6ED /* VLANConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CB694B05C0722B0099E85F /* VLANConfiguration.h */; settings = {ATTRIBUTES = (Private, ); }; };
15DAD66107591A1A0084A6ED /* SCPreferencesPathKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 151BDA2B05D9E28B00657BC7 /* SCPreferencesPathKey.h */; settings = {ATTRIBUTES = (Private, ); }; };
15DAD66207591A1A0084A6ED /* dnsinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 15B73F0905FD1B670096477F /* dnsinfo.h */; };
15DAD66307591A1A0084A6ED /* dnsinfo_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 15B73F0C05FD1B670096477F /* dnsinfo_private.h */; };
15DAD66407591A1A0084A6ED /* pppcontroller_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 23C1E2B4062DD2C700835B54 /* pppcontroller_types.h */; };
15DAD66507591A1A0084A6ED /* pppcontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = 23C1E2BE062DD5DB00835B54 /* pppcontroller.h */; };
- 15DAD66607591A1A0084A6ED /* BondConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 9EE943F406AF409B00772EB5 /* BondConfiguration.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 15DAD66707591A1A0084A6ED /* BondConfigurationPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 9EE943F506AF409B00772EB5 /* BondConfigurationPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
15DAD66907591A1A0084A6ED /* NetworkConfiguration.plist in Resources */ = {isa = PBXBuildFile; fileRef = 15B686220678B65C00FF4023 /* NetworkConfiguration.plist */; };
15DAD66A07591A1A0084A6ED /* get-mobility-info in Resources */ = {isa = PBXBuildFile; fileRef = 15CFC229068B222F00123568 /* get-mobility-info */; };
15DAD66B07591A1A0084A6ED /* NetworkInterface.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1577253606EFBF3100D7B52B /* NetworkInterface.strings */; };
15DAD6A407591A1A0084A6ED /* dnsinfo_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = 15B73F0805FD1B670096477F /* dnsinfo_copy.c */; };
15DAD6A507591A1A0084A6ED /* shared_dns_info.defs in Sources */ = {isa = PBXBuildFile; fileRef = 15FCAAD005FD0EBF00CB79E6 /* shared_dns_info.defs */; settings = {ATTRIBUTES = (Client, ); }; };
15DAD6A607591A1A0084A6ED /* SCNetworkConfigurationInternal.c in Sources */ = {isa = PBXBuildFile; fileRef = 15AD7A390670A85900BFE03C /* SCNetworkConfigurationInternal.c */; };
- 15DAD6A707591A1A0084A6ED /* SCNetworkInterface.c in Sources */ = {isa = PBXBuildFile; fileRef = 15AD7A3B0670A85900BFE03C /* SCNetworkInterface.c */; };
- 15DAD6A807591A1A0084A6ED /* SCNetworkProtocol.c in Sources */ = {isa = PBXBuildFile; fileRef = 15AD7A3C0670A85900BFE03C /* SCNetworkProtocol.c */; };
+ 15DAD6A707591A1A0084A6ED /* SCNetworkInterface.c in Sources */ = {isa = PBXBuildFile; fileRef = 15AD7A3B0670A85900BFE03C /* SCNetworkInterface.c */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
+ 15DAD6A807591A1A0084A6ED /* SCNetworkProtocol.c in Sources */ = {isa = PBXBuildFile; fileRef = 15AD7A3C0670A85900BFE03C /* SCNetworkProtocol.c */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
15DAD6A907591A1A0084A6ED /* SCNetworkService.c in Sources */ = {isa = PBXBuildFile; fileRef = 15AD7A3D0670A85900BFE03C /* SCNetworkService.c */; };
15DAD6AA07591A1A0084A6ED /* SCNetworkSet.c in Sources */ = {isa = PBXBuildFile; fileRef = 15AD7A3E0670A85900BFE03C /* SCNetworkSet.c */; };
15DAD6AB07591A1A0084A6ED /* BondConfiguration.c in Sources */ = {isa = PBXBuildFile; fileRef = 9EE943F306AF409B00772EB5 /* BondConfiguration.c */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
15DAF2DC08466D4900D1B2BD /* SCHelper_client.c in Sources */ = {isa = PBXBuildFile; fileRef = 15DAF2D808466D4900D1B2BD /* SCHelper_client.c */; };
15DAF2DF08466D4900D1B2BD /* helper_comm.h in Headers */ = {isa = PBXBuildFile; fileRef = 15DAF2D708466D4900D1B2BD /* helper_comm.h */; };
15DAF2E108466D4900D1B2BD /* SCHelper_server.c in Sources */ = {isa = PBXBuildFile; fileRef = 15DAF2D908466D4900D1B2BD /* SCHelper_server.c */; };
- 15E517680CCFBCD0008FFE82 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15DAD6C807591A1A0084A6ED /* SystemConfiguration.framework */; };
15FC130B0CCEA59E0013872C /* monitor.c in Sources */ = {isa = PBXBuildFile; fileRef = 15FC130A0CCEA59E0013872C /* monitor.c */; };
15FC13180CCF74740013872C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CB6A6F05C0722B0099E85F /* CoreFoundation.framework */; };
15FEE80E0CCFD341001312F9 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15FEE80D0CCFD341001312F9 /* ApplicationServices.framework */; };
15FEE81F0CD03E75001312F9 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 15FEE8180CD03CBB001312F9 /* Localizable.strings */; };
+ 15FF5C370CDF776200EEC8AA /* com.apple.SCHelper.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 15FF5C290CDF770500EEC8AA /* com.apple.SCHelper.plist */; };
F95B8A430B03E07A00993BA3 /* SCNetworkSignature.c in Sources */ = {isa = PBXBuildFile; fileRef = F95B8A420B03E07A00993BA3 /* SCNetworkSignature.c */; };
F95B8A460B03E09300993BA3 /* SCNetworkSignature.h in Headers */ = {isa = PBXBuildFile; fileRef = F95B8A440B03E09300993BA3 /* SCNetworkSignature.h */; settings = {ATTRIBUTES = (Private, ); }; };
F95B8A470B03E09300993BA3 /* SCNetworkSignaturePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = F95B8A450B03E09300993BA3 /* SCNetworkSignaturePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
- 150ECB3B0D0079280065E94D /* PBXContainerItemProxy */ = {
+ 150ECB2F0D0042DA0065E94D /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
proxyType = 1;
remoteGlobalIDString = 151F5D990CCE98E50093AC3B;
remoteInfo = SCMonitor;
};
+ 151FE3790D5B713C000D6DB1 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 151FE2DD0D5B7046000D6DB1;
+ remoteInfo = "configd_base-EmbeddedSimulator";
+ };
1520A385084681350010B584 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
remoteGlobalIDString = 1547001808455B98006787CE;
remoteInfo = SCHelper;
};
- 1533B94009731A9600F2B34A /* PBXContainerItemProxy */ = {
+ 1521405A0E9400BF00DACD2C /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
proxyType = 1;
- remoteGlobalIDString = 15FD733A0754DBDA001CC321;
- remoteInfo = ATconfig;
+ remoteGlobalIDString = 15213FF90E93E9F500DACD2C;
+ remoteInfo = Logger.bundle;
};
1558480507550D470046C2E9 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
remoteGlobalIDString = 155847FA07550D210046C2E9;
remoteInfo = configd_executables;
};
- 157BB8BF075924460025DA7A /* PBXContainerItemProxy */ = {
+ 156CA4A70EF8550800C59A18 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
proxyType = 1;
- remoteGlobalIDString = 15DAD63F07591A1A0084A6ED;
- remoteInfo = SystemConfiguration.framework;
+ remoteGlobalIDString = 156CA4790EF853BB00C59A18;
+ remoteInfo = "Logger.bundle-Embedded";
};
- 157BB8C1075924470025DA7A /* PBXContainerItemProxy */ = {
+ 1574341E0D4A815E002ACA73 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
proxyType = 1;
- remoteGlobalIDString = 15DAD5DF075913CE0084A6ED;
- remoteInfo = DNSConfiguration;
+ remoteGlobalIDString = 157433F00D4A8137002ACA73;
+ remoteInfo = "scutil-Embedded";
+ };
+ 157434200D4A8166002ACA73 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 157433DD0D4A8122002ACA73;
+ remoteInfo = "scselect-Embedded";
+ };
+ 157A85470D56CA0B00B6F1A0 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 157A84F40D56C7E800B6F1A0;
+ remoteInfo = "IPMonitor-Embedded";
+ };
+ 157A85490D56CA2300B6F1A0 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 157A85050D56C8AA00B6F1A0;
+ remoteInfo = "InterfaceNamer-Embedded";
+ };
+ 157A854B0D56CA5100B6F1A0 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 157A85100D56C8E000B6F1A0;
+ remoteInfo = "KernelEventMonitor-Embedded";
+ };
+ 157A854D0D56CA6F00B6F1A0 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 157A85260D56C91100B6F1A0;
+ remoteInfo = "LinkConfiguration-Embedded";
+ };
+ 157A854F0D56CA8800B6F1A0 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 157A85310D56C94F00B6F1A0;
+ remoteInfo = "NetworkIdentification-Embedded";
+ };
+ 157A85510D56CA9E00B6F1A0 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 157A853C0D56C96F00B6F1A0;
+ remoteInfo = "PreferencesMonitor-Embedded";
+ };
+ 157A85530D56CACA00B6F1A0 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 158317A80CFB8639006F62B9;
+ remoteInfo = "PreferencesMonitor.bundle-Embedded";
+ };
+ 157BB8BF075924460025DA7A /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 15DAD63F07591A1A0084A6ED;
+ remoteInfo = SystemConfiguration.framework;
};
157BB8C30759244B0025DA7A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
remoteGlobalIDString = 15828AE60753B5F900AD4710;
remoteInfo = KernelEventMonitor.bundle;
};
+ 1583170F0CFB77D1006F62B9 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 158316CF0CFB774B006F62B9;
+ remoteInfo = "configd_base-Embedded";
+ };
+ 158317110CFB77E1006F62B9 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 1572C4A60CFB55B400E2776E;
+ remoteInfo = "SystemConfiguration.framework-Embedded";
+ };
+ 158317130CFB77E8006F62B9 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 158337990CFB6B9E0033AB93;
+ remoteInfo = "SCHelper-Embedded";
+ };
+ 158317150CFB783B006F62B9 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 158316E30CFB7761006F62B9;
+ remoteInfo = "configd_plugins-Embedded";
+ };
+ 158317170CFB784D006F62B9 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 158317040CFB7782006F62B9;
+ remoteInfo = "configd_executables-Embedded";
+ };
+ 158317650CFB80D5006F62B9 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 158317230CFB80A1006F62B9;
+ remoteInfo = "configd-Embedded";
+ };
+ 158317B20CFB8660006F62B9 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 158317A00CFB8626006F62B9;
+ remoteInfo = "NetworkIdentification.bundle-Embedded";
+ };
+ 158317B40CFB8660006F62B9 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 158317980CFB860C006F62B9;
+ remoteInfo = "LinkConfiguration.bundle-Embedded";
+ };
+ 158317B60CFB8660006F62B9 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 158317900CFB85F7006F62B9;
+ remoteInfo = "KernelEventMonitor.bundle-Embedded";
+ };
+ 158317B80CFB8660006F62B9 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 158317870CFB85DD006F62B9;
+ remoteInfo = "InterfaceNamer.bundle-Embedded";
+ };
+ 158317BA0CFB8660006F62B9 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 1583177D0CFB85C8006F62B9;
+ remoteInfo = "IPMonitor.bundle-Embedded";
+ };
158AD9850754E72500124717 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
remoteGlobalIDString = 159D542007528E7C004F8947;
remoteInfo = Plugins;
};
- 15DAD5730759115F0084A6ED /* PBXContainerItemProxy */ = {
+ 15A5A2700D5B942D0087BDA0 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 15A5A1E40D5B94190087BDA0;
+ remoteInfo = "SystemConfiguration.framework-EmbeddedSimulator";
+ };
+ 15C64A210F684C4900D78394 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 15DAD5DF075913CE0084A6ED;
+ remoteInfo = DNSConfiguration;
+ };
+ 15C64A230F684C5700D78394 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 15C64A1E0F684C3300D78394;
+ remoteInfo = configd_libSystem;
+ };
+ 15C64A2E0F684C8300D78394 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 15C64A280F684C6B00D78394;
+ remoteInfo = "configd_libSystem-Embedded";
+ };
+ 15C64A300F684C8F00D78394 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 15CB6A7705C0722B0099E85F /* Project object */;
proxyType = 1;
- remoteGlobalIDString = 15FD731E0754DB9F001CC321;
- remoteInfo = ATconfig.bundle;
+ remoteGlobalIDString = 157A84D80D56C63900B6F1A0;
+ remoteInfo = "DNSConfiguration-Embedded";
};
F95B8A760B03FB9100993BA3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
);
runOnlyForDeploymentPostprocessing = 1;
};
+ 1583175B0CFB80A1006F62B9 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 8;
+ dstPath = /System/Library/LaunchDaemons;
+ dstSubfolderSpec = 0;
+ files = (
+ 1583175C0CFB80A1006F62B9 /* com.apple.configd.plist in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ };
+ 158337A40CFB6B9E0033AB93 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 8;
+ dstPath = /System/Library/LaunchDaemons;
+ dstSubfolderSpec = 0;
+ files = (
+ 158337AD0CFB6BDC0033AB93 /* com.apple.SCHelper-embedded.plist in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ };
159D54D507529FFF004F8947 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 8;
);
runOnlyForDeploymentPostprocessing = 1;
};
+ 15FF5C380CDF778F00EEC8AA /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 8;
+ dstPath = /System/Library/LaunchDaemons;
+ dstSubfolderSpec = 0;
+ files = (
+ 15FF5C370CDF776200EEC8AA /* com.apple.SCHelper.plist in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ };
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
150607BD075A00A200B147BA /* SCSchemaDefinitions.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SCSchemaDefinitions.c; sourceTree = "<group>"; };
150607DE075A00A300B147BA /* SCSchemaDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SCSchemaDefinitions.h; sourceTree = "<group>"; };
+ 151356AD0CE0CF2F0017E523 /* com.apple.SCHelper-embedded.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "com.apple.SCHelper-embedded.plist"; path = "helper/com.apple.SCHelper-embedded.plist"; sourceTree = "<group>"; };
1514D76D05C08A5F00757DC9 /* config_types.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = config_types.h; path = SystemConfiguration.fproj/config_types.h; sourceTree = SOURCE_ROOT; };
151BDA2B05D9E28B00657BC7 /* SCPreferencesPathKey.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SCPreferencesPathKey.h; path = SystemConfiguration.fproj/SCPreferencesPathKey.h; sourceTree = SOURCE_ROOT; };
151BDA5D05D9E2ED00657BC7 /* SCPreferencesPathKey.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = SCPreferencesPathKey.c; path = SystemConfiguration.fproj/SCPreferencesPathKey.c; sourceTree = SOURCE_ROOT; };
151F5D9A0CCE98E50093AC3B /* SCMonitor.plugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SCMonitor.plugin; sourceTree = BUILT_PRODUCTS_DIR; };
151F63EC09328A3C0096DCC9 /* genSCPreferences */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = genSCPreferences; sourceTree = BUILT_PRODUCTS_DIR; };
1520A3DE0846B2DC0010B584 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; };
+ 15213FFA0E93E9F500DACD2C /* Logger.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Logger.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
1521FC5C060F296A003B28F5 /* dnsinfo_create.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dnsinfo_create.c; path = dnsinfo/dnsinfo_create.c; sourceTree = SOURCE_ROOT; };
+ 1522FCE50FA7FD7000B24128 /* dnsinfo_flatfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = dnsinfo_flatfile.c; path = dnsinfo/dnsinfo_flatfile.c; sourceTree = "<group>"; };
152CEED0070CF6640050F23C /* libedit.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libedit.dylib; path = /usr/lib/libedit.2.dylib; sourceTree = "<absolute>"; };
152E68C00A2C89C70011FDA8 /* SCPreferencesKeychainPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SCPreferencesKeychainPrivate.h; sourceTree = "<group>"; };
152E68C20A2C89E30011FDA8 /* SCPreferencesKeychainPrivate.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SCPreferencesKeychainPrivate.c; sourceTree = "<group>"; };
+ 1531D3DA0E93E6DA00248432 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Plugins/Logger/Info.plist; sourceTree = "<group>"; };
+ 1531D3DB0E93E6DA00248432 /* logger.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = logger.c; path = Plugins/Logger/logger.c; sourceTree = "<group>"; };
1532629006281C9D00B1C10C /* dnsinfo_create.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = dnsinfo_create.h; path = dnsinfo/dnsinfo_create.h; sourceTree = "<group>"; };
- 1540E3600987DA9500157C07 /* com.apple.configd.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = com.apple.configd.plist; sourceTree = "<group>"; };
+ 153393E20D34994100FE74E7 /* update-headers */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = "update-headers"; sourceTree = "<group>"; };
+ 1540E3600987DA9500157C07 /* com.apple.configd.plist */ = {isa = PBXFileReference; explicitFileType = text.plist.xml; fileEncoding = 30; path = com.apple.configd.plist; sourceTree = "<group>"; };
1543636A0752D03C00A8EC6C /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
1547001D08455B98006787CE /* SCHelper */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = SCHelper; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1547072E0D1F70C80075C28D /* SystemConfiguration.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SystemConfiguration.framework; sourceTree = BUILT_PRODUCTS_DIR; };
154CF3F307E1EA4D00D8302E /* SCPreferencesGetSpecificPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SCPreferencesGetSpecificPrivate.h; sourceTree = "<group>"; };
1558476A0754FDCD0046C2E9 /* scutil */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = scutil; sourceTree = BUILT_PRODUCTS_DIR; };
1558481D07550EC10046C2E9 /* scselect */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = scselect; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1559C4440D349A4E0098FD59 /* SystemConfiguration.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SystemConfiguration.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1559C4470D349A4E0098FD59 /* SCHelper */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = SCHelper; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1559C44C0D349A4E0098FD59 /* configd */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = configd; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1559C4500D349A4E0098FD59 /* IPMonitor.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = IPMonitor.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1559C4510D349A4E0098FD59 /* InterfaceNamer.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InterfaceNamer.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1559C4520D349A4E0098FD59 /* KernelEventMonitor.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = KernelEventMonitor.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1559C4530D349A4E0098FD59 /* LinkConfiguration.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LinkConfiguration.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1559C4540D349A4E0098FD59 /* PreferencesMonitor.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PreferencesMonitor.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1559C4550D349A4E0098FD59 /* NetworkIdentification.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NetworkIdentification.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
155A1E6B081079CC00F70D98 /* SCNetworkConfigurationPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SCNetworkConfigurationPrivate.h; sourceTree = "<group>"; };
155B7BF60847776D00F0E262 /* SCHelper_client.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SCHelper_client.h; path = helper/SCHelper_client.h; sourceTree = "<group>"; };
155D22380AF13A7300D52ED0 /* dns-configuration.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = "dns-configuration.h"; sourceTree = "<group>"; };
155D22390AF13A7300D52ED0 /* set-hostname.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = "set-hostname.h"; sourceTree = "<group>"; };
155D223A0AF13A7300D52ED0 /* smb-configuration.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = "smb-configuration.h"; sourceTree = "<group>"; };
+ 1567333E0DD1FD6500145179 /* entitlements.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = entitlements.plist; sourceTree = "<group>"; };
156BD6BB07E0DFA9008698FF /* SCPreferencesSetSpecificPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SCPreferencesSetSpecificPrivate.h; sourceTree = "<group>"; };
+ 156CA4850EF853BB00C59A18 /* Logger.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Logger.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
+ 156CA48D0EF853BB00C59A18 /* Info-Embedded.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Info-Embedded.plist"; path = "Plugins/Logger/Info-Embedded.plist"; sourceTree = "<group>"; };
1572EB7A0A506D3B00D02459 /* smb-configuration.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = "smb-configuration.c"; sourceTree = "<group>"; };
+ 157433EC0D4A8122002ACA73 /* scselect */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = scselect; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1574341A0D4A8137002ACA73 /* scutil */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = scutil; sourceTree = BUILT_PRODUCTS_DIR; };
1577252F06EFB96700D7B52B /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/NetworkInterface.strings; sourceTree = "<group>"; };
+ 157A84E80D56C63900B6F1A0 /* libdnsinfo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libdnsinfo.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 157A85020D56C7E800B6F1A0 /* libIPMonitor.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libIPMonitor.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 157A850D0D56C8AA00B6F1A0 /* libInterfaceNamer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libInterfaceNamer.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 157A85230D56C8E000B6F1A0 /* libKernelEventMonitor.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libKernelEventMonitor.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 157A852E0D56C91100B6F1A0 /* libLinkConfiguration.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libLinkConfiguration.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 157A85390D56C94F00B6F1A0 /* libNetworkIdentification.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libNetworkIdentification.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 157A85440D56C96F00B6F1A0 /* libPreferencesMonitor.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPreferencesMonitor.a; sourceTree = BUILT_PRODUCTS_DIR; };
157A88880A470D0F003A4256 /* SCSchemaDefinitionsPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SCSchemaDefinitionsPrivate.h; sourceTree = "<group>"; };
15828AE70753B5F900AD4710 /* KernelEventMonitor.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = KernelEventMonitor.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
- 1587A31F0B6AACD70063104A /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = /usr/lib/libicucore.dylib; sourceTree = "<absolute>"; };
- 158AD85B0754E38F00124717 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; };
- 158AD8700754E3D400124717 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; };
- 158AD8C00754E3EF00124717 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; };
- 158AD9100754E40E00124717 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; };
+ 158AD85B0754E38F00124717 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 158AD8700754E3D400124717 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 158AD8C00754E3EF00124717 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 158AD9100754E40E00124717 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
158AD9F80754EA2F00124717 /* AppleTalk.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppleTalk.framework; path = /System/Library/Frameworks/AppleTalk.framework; sourceTree = "<absolute>"; };
- 159D53A707528B36004F8947 /* ip_plugin.c */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.c; path = ip_plugin.c; sourceTree = "<group>"; tabWidth = 8; usesTabs = 1; };
- 159D53A807528B36004F8947 /* Resolvers.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = Resolvers.plist; sourceTree = "<group>"; };
+ 159D53A707528B36004F8947 /* ip_plugin.c */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.c; path = ip_plugin.c; sourceTree = "<group>"; };
159D53AA07528B36004F8947 /* dns-configuration.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = "dns-configuration.c"; sourceTree = "<group>"; };
159D53AB07528B36004F8947 /* set-hostname.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = "set-hostname.c"; sourceTree = "<group>"; };
- 159D53AE07528B36004F8947 /* ifnamer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = ifnamer.c; sourceTree = "<group>"; };
+ 159D53AE07528B36004F8947 /* ifnamer.c */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.c; path = ifnamer.c; sourceTree = "<group>"; };
159D53B007528B36004F8947 /* eventmon.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = eventmon.c; sourceTree = "<group>"; };
159D53B107528B36004F8947 /* ev_dlil.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = ev_dlil.c; sourceTree = "<group>"; };
159D53B207528B36004F8947 /* ev_dlil.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ev_dlil.h; sourceTree = "<group>"; };
159D53CA07528B36004F8947 /* cache.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = cache.c; sourceTree = "<group>"; };
159D53CB07528B36004F8947 /* cache.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cache.h; sourceTree = "<group>"; };
159D53D407528BDA004F8947 /* libKernelEventMonitor.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libKernelEventMonitor.a; sourceTree = BUILT_PRODUCTS_DIR; };
- 159D53DE07528C2E004F8947 /* libKicker.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libKicker.a; sourceTree = BUILT_PRODUCTS_DIR; };
159D53E507528C4A004F8947 /* libInterfaceNamer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libInterfaceNamer.a; sourceTree = BUILT_PRODUCTS_DIR; };
159D53EC07528C61004F8947 /* libIPMonitor.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libIPMonitor.a; sourceTree = BUILT_PRODUCTS_DIR; };
159D53F307528C79004F8947 /* libLinkConfiguration.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libLinkConfiguration.a; sourceTree = BUILT_PRODUCTS_DIR; };
15A2972E0A13C08C009879B3 /* SCNetworkConnectionPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SCNetworkConnectionPrivate.h; sourceTree = "<group>"; };
15A509A306C2518F001F0AB7 /* net.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = net.c; sourceTree = "<group>"; };
15A509A406C2518F001F0AB7 /* net.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = net.h; sourceTree = "<group>"; };
+ 15A5A26A0D5B94190087BDA0 /* SystemConfiguration.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SystemConfiguration.framework; sourceTree = BUILT_PRODUCTS_DIR; };
15A6F7C30A4B266D00B907EA /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; };
15AD7A380670A85900BFE03C /* SCNetworkConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SCNetworkConfiguration.h; sourceTree = "<group>"; };
15AD7A390670A85900BFE03C /* SCNetworkConfigurationInternal.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SCNetworkConfigurationInternal.c; sourceTree = "<group>"; };
15AD7A3C0670A85900BFE03C /* SCNetworkProtocol.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SCNetworkProtocol.c; sourceTree = "<group>"; };
15AD7A3D0670A85900BFE03C /* SCNetworkService.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SCNetworkService.c; sourceTree = "<group>"; };
15AD7A3E0670A85900BFE03C /* SCNetworkSet.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SCNetworkSet.c; sourceTree = "<group>"; };
- 15B686220678B65C00FF4023 /* NetworkConfiguration.plist */ = {isa = PBXFileReference; explicitFileType = text.xml; fileEncoding = 4; path = NetworkConfiguration.plist; sourceTree = "<group>"; };
+ 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = AspenSDK.xcconfig; path = AppleInternal/XcodeConfig/AspenSDK.xcconfig; sourceTree = DEVELOPER_DIR; };
+ 15B686220678B65C00FF4023 /* NetworkConfiguration.plist */ = {isa = PBXFileReference; explicitFileType = text.plist.xml; fileEncoding = 4; path = NetworkConfiguration.plist; sourceTree = "<group>"; };
15B73F0805FD1B670096477F /* dnsinfo_copy.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dnsinfo_copy.c; path = dnsinfo/dnsinfo_copy.c; sourceTree = "<group>"; };
15B73F0905FD1B670096477F /* dnsinfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = dnsinfo.h; path = dnsinfo/dnsinfo.h; sourceTree = "<group>"; };
15B73F0B05FD1B670096477F /* dnsinfo_private.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dnsinfo_private.c; path = dnsinfo/dnsinfo_private.c; sourceTree = "<group>"; };
15B73F0D05FD1B670096477F /* dnsinfo_server.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dnsinfo_server.c; path = dnsinfo/dnsinfo_server.c; sourceTree = "<group>"; };
15B73F0E05FD1B670096477F /* dnsinfo_server.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = dnsinfo_server.h; path = dnsinfo/dnsinfo_server.h; sourceTree = "<group>"; };
15BAA32207F0699A00D9EC95 /* libbsm.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libbsm.dylib; path = /usr/lib/libbsm.dylib; sourceTree = "<absolute>"; };
- 15CB690505C0722A0099E85F /* preferences.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = preferences.xml; sourceTree = "<group>"; };
15CB691305C0722B0099E85F /* SystemConfiguration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SystemConfiguration.h; sourceTree = "<group>"; };
15CB691505C0722B0099E85F /* SCPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SCPrivate.h; sourceTree = "<group>"; };
15CB691705C0722B0099E85F /* SCDPlugin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SCDPlugin.h; sourceTree = "<group>"; };
15CB694505C0722B0099E85F /* DeviceOnHold.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DeviceOnHold.h; sourceTree = "<group>"; };
15CB694705C0722B0099E85F /* LinkConfiguration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LinkConfiguration.h; sourceTree = "<group>"; };
15CB694905C0722B0099E85F /* dy_framework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = dy_framework.h; sourceTree = "<group>"; };
- 15CB694B05C0722B0099E85F /* VLANConfiguration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLANConfiguration.h; sourceTree = "<group>"; };
15CB695005C0722B0099E85F /* SCD.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SCD.c; sourceTree = "<group>"; };
15CB695205C0722B0099E85F /* SCDKeys.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SCDKeys.c; sourceTree = "<group>"; };
15CB695405C0722B0099E85F /* SCDPrivate.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SCDPrivate.c; sourceTree = "<group>"; };
15CB698005C0722B0099E85F /* SCDNotifierCancel.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SCDNotifierCancel.c; sourceTree = "<group>"; };
15CB698205C0722B0099E85F /* SCDSnapshot.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SCDSnapshot.c; sourceTree = "<group>"; };
15CB698405C0722B0099E85F /* SCP.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SCP.c; sourceTree = "<group>"; };
- 15CB698605C0722B0099E85F /* SCPOpen.c */ = {isa = PBXFileReference; indentWidth = 8; lastKnownFileType = sourcecode.c.c; path = SCPOpen.c; sourceTree = "<group>"; tabWidth = 8; };
+ 15CB698605C0722B0099E85F /* SCPOpen.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SCPOpen.c; sourceTree = "<group>"; };
15CB698805C0722B0099E85F /* SCPLock.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SCPLock.c; sourceTree = "<group>"; };
15CB698A05C0722B0099E85F /* SCPUnlock.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SCPUnlock.c; sourceTree = "<group>"; };
15CB698C05C0722B0099E85F /* SCPList.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SCPList.c; sourceTree = "<group>"; };
15CB69B405C0722B0099E85F /* dy_framework.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = dy_framework.c; sourceTree = "<group>"; };
15CB69B605C0722B0099E85F /* VLANConfiguration.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = VLANConfiguration.c; sourceTree = "<group>"; };
15CB69BE05C0722B0099E85F /* config.defs */ = {isa = PBXFileReference; explicitFileType = sourcecode.mig; name = config.defs; path = SystemConfiguration.fproj/config.defs; sourceTree = "<group>"; };
- 15CB69BF05C0722B0099E85F /* genSCPreferences.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = genSCPreferences.c; path = SystemConfiguration.fproj/genSCPreferences.c; sourceTree = "<group>"; };
+ 15CB69BF05C0722B0099E85F /* genSCPreferences.c */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.c; name = genSCPreferences.c; path = SystemConfiguration.fproj/genSCPreferences.c; sourceTree = "<group>"; };
15CB69CF05C0722B0099E85F /* configd.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = configd.h; sourceTree = "<group>"; };
15CB69D105C0722B0099E85F /* _SCD.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _SCD.h; sourceTree = "<group>"; };
15CB69D305C0722B0099E85F /* configd_server.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = configd_server.h; sourceTree = "<group>"; };
15CB6A6F05C0722B0099E85F /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
15CFC229068B222F00123568 /* get-mobility-info */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = "get-mobility-info"; sourceTree = SOURCE_ROOT; };
15DAD5EE075913CE0084A6ED /* libdnsinfo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libdnsinfo.a; sourceTree = BUILT_PRODUCTS_DIR; };
- 15DAD6C807591A1A0084A6ED /* SystemConfiguration.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SystemConfiguration.framework; sourceTree = BUILT_PRODUCTS_DIR; };
15DAF2D608466D4900D1B2BD /* helper_comm.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = helper_comm.c; path = helper/helper_comm.c; sourceTree = "<group>"; };
15DAF2D708466D4900D1B2BD /* helper_comm.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = helper_comm.h; path = helper/helper_comm.h; sourceTree = "<group>"; };
15DAF2D808466D4900D1B2BD /* SCHelper_client.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = SCHelper_client.c; path = helper/SCHelper_client.c; sourceTree = "<group>"; };
15FC130A0CCEA59E0013872C /* monitor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = monitor.c; path = SCMonitor/monitor.c; sourceTree = "<group>"; };
15FCAACF05FD0EBF00CB79E6 /* shared_dns_info_types.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = shared_dns_info_types.h; path = dnsinfo/shared_dns_info_types.h; sourceTree = SOURCE_ROOT; };
15FCAAD005FD0EBF00CB79E6 /* shared_dns_info.defs */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.mig; name = shared_dns_info.defs; path = dnsinfo/shared_dns_info.defs; sourceTree = "<group>"; };
+ 15FD147B0D594FE700F9409C /* IndigoSDK.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = IndigoSDK.xcconfig; path = /AppleInternal/Indigo/IndigoSDK.xcconfig; sourceTree = "<absolute>"; };
15FD71090754D628001CC321 /* Kicker.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Kicker.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
15FD72970754DA2B001CC321 /* InterfaceNamer.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InterfaceNamer.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
15FD72A50754DA4C001CC321 /* IPMonitor.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = IPMonitor.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
15FD72B50754DA69001CC321 /* LinkConfiguration.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LinkConfiguration.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
15FD72C90754DA7E001CC321 /* PreferencesMonitor.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PreferencesMonitor.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
15FD73220754DB9F001CC321 /* ATconfig.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ATconfig.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
- 15FD73400754DBDA001CC321 /* libATconfig.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libATconfig.a; sourceTree = BUILT_PRODUCTS_DIR; };
- 15FD73970754DE49001CC321 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; };
- 15FD73EE0754DE62001CC321 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; };
- 15FD743E0754DE7A001CC321 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; };
+ 15FD73970754DE49001CC321 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 15FD73EE0754DE62001CC321 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 15FD743E0754DE7A001CC321 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
15FEE80D0CCFD341001312F9 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<absolute>"; };
15FEE8160CD03CA3001312F9 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = SCMonitor/English.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 15FF5C290CDF770500EEC8AA /* com.apple.SCHelper.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.SCHelper.plist; path = helper/com.apple.SCHelper.plist; sourceTree = "<group>"; };
23C1E2B4062DD2C700835B54 /* pppcontroller_types.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = pppcontroller_types.h; path = /usr/local/include/ppp/pppcontroller_types.h; sourceTree = "<absolute>"; };
23C1E2B8062DD45900835B54 /* pppcontroller.defs */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.mig; name = pppcontroller.defs; path = SystemConfiguration.fproj/pppcontroller.defs; sourceTree = "<group>"; };
23C1E2BE062DD5DB00835B54 /* pppcontroller.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = pppcontroller.h; path = configd.build/SystemConfiguration.framework.build/DerivedSources/pppcontroller.h; sourceTree = BUILT_PRODUCTS_DIR; };
9EE943F306AF409B00772EB5 /* BondConfiguration.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = BondConfiguration.c; sourceTree = "<group>"; };
- 9EE943F406AF409B00772EB5 /* BondConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BondConfiguration.h; sourceTree = "<group>"; };
- 9EE943F506AF409B00772EB5 /* BondConfigurationPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BondConfigurationPrivate.h; sourceTree = "<group>"; };
F95B8A420B03E07A00993BA3 /* SCNetworkSignature.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SCNetworkSignature.c; sourceTree = "<group>"; };
F95B8A440B03E09300993BA3 /* SCNetworkSignature.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SCNetworkSignature.h; sourceTree = "<group>"; };
F95B8A450B03E09300993BA3 /* SCNetworkSignaturePrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SCNetworkSignaturePrivate.h; sourceTree = "<group>"; };
F95B8A5F0B03F81400993BA3 /* libNetworkIdentification.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libNetworkIdentification.a; sourceTree = BUILT_PRODUCTS_DIR; };
- F95B8A670B03F97800993BA3 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; };
- F95B8A680B03F97800993BA3 /* NetworkIdentification.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = NetworkIdentification.c; sourceTree = "<group>"; };
+ F95B8A670B03F97800993BA3 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ F95B8A680B03F97800993BA3 /* NetworkIdentification.c */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.c; path = NetworkIdentification.c; sourceTree = "<group>"; };
F95B8A700B03F9D100993BA3 /* NetworkIdentification.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NetworkIdentification.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
buildActionMask = 2147483647;
files = (
15FC13180CCF74740013872C /* CoreFoundation.framework in Frameworks */,
- 15E517680CCFBCD0008FFE82 /* SystemConfiguration.framework in Frameworks */,
+ 1559C4490D349A4E0098FD59 /* SystemConfiguration.framework in Frameworks */,
+ 15792B9B0DA2C190008DDED9 /* IOKit.framework in Frameworks */,
15FEE80E0CCFD341001312F9 /* ApplicationServices.framework in Frameworks */,
150D7E1E0D16DC6C00AF4BED /* Security.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
+ 1521400B0E93FF8600DACD2C /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1521400C0E93FFF500DACD2C /* CoreFoundation.framework in Frameworks */,
+ 152140580E93FFFC00DACD2C /* SystemConfiguration.framework in Frameworks */,
+ 15943D440E94081800B87535 /* IOKit.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
1547001B08455B98006787CE /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1520A3870846829A0010B584 /* CoreFoundation.framework in Frameworks */,
- 1520A3D0084682A30010B584 /* SystemConfiguration.framework in Frameworks */,
+ 1559C4450D349A4E0098FD59 /* SystemConfiguration.framework in Frameworks */,
1520A3DF0846B2DD0010B584 /* Security.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
buildActionMask = 2147483647;
files = (
155847640754FDCD0046C2E9 /* CoreFoundation.framework in Frameworks */,
- 1523F710075A371D0066F0B2 /* SystemConfiguration.framework in Frameworks */,
- 1523F719075A37C70066F0B2 /* libdnsinfo.a in Frameworks */,
+ 1559C44F0D349A4E0098FD59 /* SystemConfiguration.framework in Frameworks */,
155847660754FDCD0046C2E9 /* libedit.dylib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
buildActionMask = 2147483647;
files = (
1558481907550EC10046C2E9 /* CoreFoundation.framework in Frameworks */,
- 1523F6F2075A37050066F0B2 /* SystemConfiguration.framework in Frameworks */,
+ 1559C44E0D349A4E0098FD59 /* SystemConfiguration.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 156CA47C0EF853BB00C59A18 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 156CA47D0EF853BB00C59A18 /* CoreFoundation.framework in Frameworks */,
+ 156CA47E0EF853BB00C59A18 /* SystemConfiguration.framework in Frameworks */,
+ 156CA47F0EF853BB00C59A18 /* IOKit.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 1572C5230CFB55B400E2776E /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1572C5240CFB55B400E2776E /* CoreFoundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 157433E10D4A8122002ACA73 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 157433E20D4A8122002ACA73 /* CoreFoundation.framework in Frameworks */,
+ 157433E30D4A8122002ACA73 /* SystemConfiguration.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
- 159D53D207528BDA004F8947 /* Frameworks */ = {
+ 1574340D0D4A8137002ACA73 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 1574340E0D4A8137002ACA73 /* CoreFoundation.framework in Frameworks */,
+ 1574340F0D4A8137002ACA73 /* SystemConfiguration.framework in Frameworks */,
+ 157434110D4A8137002ACA73 /* libedit.dylib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
- 159D53DC07528C2E004F8947 /* Frameworks */ = {
+ 157A84E20D56C63900B6F1A0 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
- 159D53E307528C4A004F8947 /* Frameworks */ = {
+ 1583174B0CFB80A1006F62B9 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 1583174C0CFB80A1006F62B9 /* CoreFoundation.framework in Frameworks */,
+ 154707350D1F70C80075C28D /* SystemConfiguration.framework in Frameworks */,
+ 1583174E0CFB80A1006F62B9 /* IOKit.framework in Frameworks */,
+ 159C32B60F583724008A72EE /* Security.framework in Frameworks */,
+ 158317500CFB80A1006F62B9 /* libbsm.dylib in Frameworks */,
+ 158317520CFB80A1006F62B9 /* libKernelEventMonitor.a in Frameworks */,
+ 158317530CFB80A1006F62B9 /* libInterfaceNamer.a in Frameworks */,
+ 158317540CFB80A1006F62B9 /* libIPMonitor.a in Frameworks */,
+ 158317550CFB80A1006F62B9 /* libLinkConfiguration.a in Frameworks */,
+ 158317560CFB80A1006F62B9 /* libNetworkIdentification.a in Frameworks */,
+ 158317570CFB80A1006F62B9 /* libPreferencesMonitor.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
- 159D53EA07528C61004F8947 /* Frameworks */ = {
+ 1583379F0CFB6B9E0033AB93 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 158337A00CFB6B9E0033AB93 /* CoreFoundation.framework in Frameworks */,
+ 154707300D1F70C80075C28D /* SystemConfiguration.framework in Frameworks */,
+ 158337A20CFB6B9E0033AB93 /* Security.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
- 159D53F107528C79004F8947 /* Frameworks */ = {
+ 159C9B2F0DB68E8300BEEF10 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 159C9B300DB68E8400BEEF10 /* CoreFoundation.framework in Frameworks */,
+ 159C9B7A0DB68E8A00BEEF10 /* SystemConfiguration.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
- 159D53F807528C95004F8947 /* Frameworks */ = {
+ 159C9B850DB68F0300BEEF10 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 159C9B860DB68F1600BEEF10 /* CoreFoundation.framework in Frameworks */,
+ 159C9B870DB68F1600BEEF10 /* SystemConfiguration.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
buildActionMask = 2147483647;
files = (
159D54CC07529FFF004F8947 /* CoreFoundation.framework in Frameworks */,
- 1523F6F1075A36F70066F0B2 /* SystemConfiguration.framework in Frameworks */,
+ 1559C44A0D349A4E0098FD59 /* SystemConfiguration.framework in Frameworks */,
1543636B0752D03C00A8EC6C /* IOKit.framework in Frameworks */,
- 1523F715075A376B0066F0B2 /* libdnsinfo.a in Frameworks */,
15BAA32307F0699A00D9EC95 /* libbsm.dylib in Frameworks */,
- 1533B94D09731BE600F2B34A /* libATconfig.a in Frameworks */,
159D54CE07529FFF004F8947 /* libKernelEventMonitor.a in Frameworks */,
159D54D007529FFF004F8947 /* libInterfaceNamer.a in Frameworks */,
159D54D107529FFF004F8947 /* libIPMonitor.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
- 15DAD5E9075913CE0084A6ED /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 15DAD6AD07591A1A0084A6ED /* Frameworks */ = {
+ 15A5A2620D5B94190087BDA0 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- 15DAD6AE07591A1A0084A6ED /* CoreFoundation.framework in Frameworks */,
- 153BED940B75566200989D5C /* libicucore.dylib in Frameworks */,
+ 15A5A2630D5B94190087BDA0 /* CoreFoundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
- 15FD733F0754DBDA001CC321 /* Frameworks */ = {
+ 15DAD5E9075913CE0084A6ED /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
- F95B8A5D0B03F81400993BA3 /* Frameworks */ = {
+ 15DAD6AD07591A1A0084A6ED /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 15DAD6AE07591A1A0084A6ED /* CoreFoundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
- 1514D77D05C08AB700757DC9 /* Initial Preferences */ = {
- isa = PBXGroup;
- children = (
- 15CB690505C0722A0099E85F /* preferences.xml */,
- );
- name = "Initial Preferences";
- sourceTree = "<group>";
- };
151F5DA80CCE995D0093AC3B /* SCMonitor */ = {
isa = PBXGroup;
children = (
name = SCMonitor;
sourceTree = "<group>";
};
- 1547002E084561B4006787CE /* SCHelper */ = {
+ 1531D3D90E93E6AA00248432 /* Logger */ = {
isa = PBXGroup;
children = (
- 1547002F084561ED006787CE /* Headers */,
- 15470030084561FF006787CE /* Sources */,
+ 1531D3DB0E93E6DA00248432 /* logger.c */,
+ 1531D3DA0E93E6DA00248432 /* Info.plist */,
+ 156CA48D0EF853BB00C59A18 /* Info-Embedded.plist */,
);
- name = SCHelper;
- path = SystemConfiguration.fproj;
+ name = Logger;
sourceTree = "<group>";
};
- 1547002F084561ED006787CE /* Headers */ = {
+ 154083530D5B824400E07907 /* MacOSX */ = {
isa = PBXGroup;
children = (
- 15DAF2D708466D4900D1B2BD /* helper_comm.h */,
- 155B7BF60847776D00F0E262 /* SCHelper_client.h */,
+ 15DAD5EE075913CE0084A6ED /* libdnsinfo.a */,
+ 1547072E0D1F70C80075C28D /* SystemConfiguration.framework */,
+ 1547001D08455B98006787CE /* SCHelper */,
+ 151F5D9A0CCE98E50093AC3B /* SCMonitor.plugin */,
+ 158ADBFD0754ECB100124717 /* Plugins */,
+ 158ADCA60754ECC800124717 /* configd, scutil, scselect */,
);
- name = Headers;
+ name = MacOSX;
sourceTree = "<group>";
};
- 15470030084561FF006787CE /* Sources */ = {
+ 1540835A0D5B825200E07907 /* Embedded */ = {
isa = PBXGroup;
children = (
- 15DAF2D608466D4900D1B2BD /* helper_comm.c */,
- 15DAF2D808466D4900D1B2BD /* SCHelper_client.c */,
- 15DAF2D908466D4900D1B2BD /* SCHelper_server.c */,
+ 157A84E80D56C63900B6F1A0 /* libdnsinfo.a */,
+ 1559C4440D349A4E0098FD59 /* SystemConfiguration.framework */,
+ 154083C50D5B832F00E07907 /* Plugins */,
+ 1559C4470D349A4E0098FD59 /* SCHelper */,
+ 154083C90D5B835200E07907 /* configd, scutil, scselect */,
);
- name = Sources;
+ name = Embedded;
sourceTree = "<group>";
};
- 1582B36B05FD1A4D009C2750 /* DNSConfiguration */ = {
+ 154083890D5B82A900E07907 /* EmbeddedSimulator */ = {
isa = PBXGroup;
children = (
- 1582B37205FD1A5B009C2750 /* Headers */,
- 1582B37905FD1A66009C2750 /* Sources */,
+ 15A5A26A0D5B94190087BDA0 /* SystemConfiguration.framework */,
);
- name = DNSConfiguration;
+ name = EmbeddedSimulator;
sourceTree = "<group>";
};
- 1582B37205FD1A5B009C2750 /* Headers */ = {
+ 154083C50D5B832F00E07907 /* Plugins */ = {
isa = PBXGroup;
children = (
- 15B73F0905FD1B670096477F /* dnsinfo.h */,
- 1532629006281C9D00B1C10C /* dnsinfo_create.h */,
- 15B73F0C05FD1B670096477F /* dnsinfo_private.h */,
- 15B73F0E05FD1B670096477F /* dnsinfo_server.h */,
+ 157A85020D56C7E800B6F1A0 /* libIPMonitor.a */,
+ 1559C4500D349A4E0098FD59 /* IPMonitor.bundle */,
+ 157A850D0D56C8AA00B6F1A0 /* libInterfaceNamer.a */,
+ 1559C4510D349A4E0098FD59 /* InterfaceNamer.bundle */,
+ 157A85230D56C8E000B6F1A0 /* libKernelEventMonitor.a */,
+ 1559C4520D349A4E0098FD59 /* KernelEventMonitor.bundle */,
+ 157A852E0D56C91100B6F1A0 /* libLinkConfiguration.a */,
+ 1559C4530D349A4E0098FD59 /* LinkConfiguration.bundle */,
+ 156CA4850EF853BB00C59A18 /* Logger.bundle */,
+ 157A85440D56C96F00B6F1A0 /* libPreferencesMonitor.a */,
+ 1559C4540D349A4E0098FD59 /* PreferencesMonitor.bundle */,
+ 157A85390D56C94F00B6F1A0 /* libNetworkIdentification.a */,
+ 1559C4550D349A4E0098FD59 /* NetworkIdentification.bundle */,
);
- name = Headers;
+ name = Plugins;
+ sourceTree = "<group>";
+ };
+ 154083C90D5B835200E07907 /* configd, scutil, scselect */ = {
+ isa = PBXGroup;
+ children = (
+ 1559C44C0D349A4E0098FD59 /* configd */,
+ 157433EC0D4A8122002ACA73 /* scselect */,
+ 1574341A0D4A8137002ACA73 /* scutil */,
+ );
+ name = "configd, scutil, scselect";
+ sourceTree = "<group>";
+ };
+ 1547002E084561B4006787CE /* SCHelper */ = {
+ isa = PBXGroup;
+ children = (
+ 1547002F084561ED006787CE /* Headers */,
+ 15470030084561FF006787CE /* Sources */,
+ 15FF5C390CDF9C4000EEC8AA /* Supporting Files */,
+ );
+ name = SCHelper;
+ path = SystemConfiguration.fproj;
+ sourceTree = "<group>";
+ };
+ 1547002F084561ED006787CE /* Headers */ = {
+ isa = PBXGroup;
+ children = (
+ 15DAF2D708466D4900D1B2BD /* helper_comm.h */,
+ 155B7BF60847776D00F0E262 /* SCHelper_client.h */,
+ );
+ name = Headers;
+ sourceTree = "<group>";
+ };
+ 15470030084561FF006787CE /* Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 15DAF2D608466D4900D1B2BD /* helper_comm.c */,
+ 15DAF2D808466D4900D1B2BD /* SCHelper_client.c */,
+ 15DAF2D908466D4900D1B2BD /* SCHelper_server.c */,
+ );
+ name = Sources;
+ sourceTree = "<group>";
+ };
+ 1582B36B05FD1A4D009C2750 /* DNSConfiguration */ = {
+ isa = PBXGroup;
+ children = (
+ 1582B37205FD1A5B009C2750 /* Headers */,
+ 1582B37905FD1A66009C2750 /* Sources */,
+ );
+ name = DNSConfiguration;
+ sourceTree = "<group>";
+ };
+ 1582B37205FD1A5B009C2750 /* Headers */ = {
+ isa = PBXGroup;
+ children = (
+ 15B73F0905FD1B670096477F /* dnsinfo.h */,
+ 1532629006281C9D00B1C10C /* dnsinfo_create.h */,
+ 15B73F0C05FD1B670096477F /* dnsinfo_private.h */,
+ 15B73F0E05FD1B670096477F /* dnsinfo_server.h */,
+ );
+ name = Headers;
sourceTree = "<group>";
};
1582B37905FD1A66009C2750 /* Sources */ = {
15B73F0B05FD1B670096477F /* dnsinfo_private.c */,
15B73F0805FD1B670096477F /* dnsinfo_copy.c */,
1521FC5C060F296A003B28F5 /* dnsinfo_create.c */,
+ 1522FCE50FA7FD7000B24128 /* dnsinfo_flatfile.c */,
15B73F0D05FD1B670096477F /* dnsinfo_server.c */,
);
name = Sources;
158ADBFD0754ECB100124717 /* Plugins */ = {
isa = PBXGroup;
children = (
- 15FD73400754DBDA001CC321 /* libATconfig.a */,
15FD73220754DB9F001CC321 /* ATconfig.bundle */,
159D53EC07528C61004F8947 /* libIPMonitor.a */,
15FD72A50754DA4C001CC321 /* IPMonitor.bundle */,
15FD72970754DA2B001CC321 /* InterfaceNamer.bundle */,
159D53D407528BDA004F8947 /* libKernelEventMonitor.a */,
15828AE70753B5F900AD4710 /* KernelEventMonitor.bundle */,
- 159D53DE07528C2E004F8947 /* libKicker.a */,
15FD71090754D628001CC321 /* Kicker.bundle */,
159D53F307528C79004F8947 /* libLinkConfiguration.a */,
15FD72B50754DA69001CC321 /* LinkConfiguration.bundle */,
- F95B8A700B03F9D100993BA3 /* NetworkIdentification.bundle */,
F95B8A5F0B03F81400993BA3 /* libNetworkIdentification.a */,
- 15FD72C90754DA7E001CC321 /* PreferencesMonitor.bundle */,
+ 15213FFA0E93E9F500DACD2C /* Logger.bundle */,
+ F95B8A700B03F9D100993BA3 /* NetworkIdentification.bundle */,
159D53FA07528C95004F8947 /* libPreferencesMonitor.a */,
+ 15FD72C90754DA7E001CC321 /* PreferencesMonitor.bundle */,
);
name = Plugins;
sourceTree = "<group>";
159D53AF07528B36004F8947 /* KernelEventMonitor */,
159D53BB07528B36004F8947 /* Kicker */,
159D53C007528B36004F8947 /* LinkConfiguration */,
+ 1531D3D90E93E6AA00248432 /* Logger */,
F95B8A660B03F97800993BA3 /* NetworkIdentification */,
159D53C207528B36004F8947 /* PreferencesMonitor */,
);
159D53AB07528B36004F8947 /* set-hostname.c */,
155D223A0AF13A7300D52ED0 /* smb-configuration.h */,
1572EB7A0A506D3B00D02459 /* smb-configuration.c */,
- 159D53A807528B36004F8947 /* Resolvers.plist */,
15FD743E0754DE7A001CC321 /* Info.plist */,
);
name = IPMonitor;
15B686220678B65C00FF4023 /* NetworkConfiguration.plist */,
1577253606EFBF3100D7B52B /* NetworkInterface.strings */,
15CFC229068B222F00123568 /* get-mobility-info */,
+ 153393E20D34994100FE74E7 /* update-headers */,
);
name = "Supporting Files";
sourceTree = "<group>";
15CB6A2205C0722B0099E85F /* scselect */,
15CB6A3705C0722B0099E85F /* scutil */,
159D53A207528B06004F8947 /* Plugins */,
- 1514D77D05C08AB700757DC9 /* Initial Preferences */,
15CB6A6E05C0722B0099E85F /* External Frameworks and Libraries */,
15CB690F05C0722B0099E85F /* Products */,
+ 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */,
+ 15FD147B0D594FE700F9409C /* IndigoSDK.xcconfig */,
);
+ indentWidth = 8;
name = configd;
sourceTree = "<group>";
+ tabWidth = 8;
+ usesTabs = 1;
};
15CB690705C0722A0099E85F /* SystemConfiguration */ = {
isa = PBXGroup;
15CB690F05C0722B0099E85F /* Products */ = {
isa = PBXGroup;
children = (
- 15DAD6C807591A1A0084A6ED /* SystemConfiguration.framework */,
- 15DAD5EE075913CE0084A6ED /* libdnsinfo.a */,
- 1547001D08455B98006787CE /* SCHelper */,
- 151F5D9A0CCE98E50093AC3B /* SCMonitor.plugin */,
- 158ADCA60754ECC800124717 /* configd, scutil, scselect */,
- 158ADBFD0754ECB100124717 /* Plugins */,
151F63EC09328A3C0096DCC9 /* genSCPreferences */,
+ 154083530D5B824400E07907 /* MacOSX */,
+ 1540835A0D5B825200E07907 /* Embedded */,
+ 154083890D5B82A900E07907 /* EmbeddedSimulator */,
);
name = Products;
sourceTree = "<group>";
15CB691205C0722B0099E85F /* Headers */ = {
isa = PBXGroup;
children = (
- F95B8A440B03E09300993BA3 /* SCNetworkSignature.h */,
- F95B8A450B03E09300993BA3 /* SCNetworkSignaturePrivate.h */,
- 152E68C00A2C89C70011FDA8 /* SCPreferencesKeychainPrivate.h */,
15CB691305C0722B0099E85F /* SystemConfiguration.h */,
150607DE075A00A300B147BA /* SCSchemaDefinitions.h */,
157A88880A470D0F003A4256 /* SCSchemaDefinitionsPrivate.h */,
154CF3F307E1EA4D00D8302E /* SCPreferencesGetSpecificPrivate.h */,
15CB693105C0722B0099E85F /* SCPreferencesSetSpecific.h */,
156BD6BB07E0DFA9008698FF /* SCPreferencesSetSpecificPrivate.h */,
+ 152E68C00A2C89C70011FDA8 /* SCPreferencesKeychainPrivate.h */,
15CB691505C0722B0099E85F /* SCPrivate.h */,
15AD7A380670A85900BFE03C /* SCNetworkConfiguration.h */,
155A1E6B081079CC00F70D98 /* SCNetworkConfigurationPrivate.h */,
15CB693505C0722B0099E85F /* SCNetworkConnection.h */,
15A2972E0A13C08C009879B3 /* SCNetworkConnectionPrivate.h */,
15CB693705C0722B0099E85F /* SCNetworkReachability.h */,
+ F95B8A440B03E09300993BA3 /* SCNetworkSignature.h */,
+ F95B8A450B03E09300993BA3 /* SCNetworkSignaturePrivate.h */,
15CB693905C0722B0099E85F /* SCValidation.h */,
- 9EE943F406AF409B00772EB5 /* BondConfiguration.h */,
- 9EE943F506AF409B00772EB5 /* BondConfigurationPrivate.h */,
15CB694505C0722B0099E85F /* DeviceOnHold.h */,
15CB693D05C0722B0099E85F /* DHCPClientPreferences.h */,
15CB694705C0722B0099E85F /* LinkConfiguration.h */,
- 15CB694B05C0722B0099E85F /* VLANConfiguration.h */,
15CB694905C0722B0099E85F /* dy_framework.h */,
15CB694305C0722B0099E85F /* moh.h */,
15CB694105C0722B0099E85F /* moh_msg.h */,
15CB694F05C0722B0099E85F /* Sources */ = {
isa = PBXGroup;
children = (
- F95B8A420B03E07A00993BA3 /* SCNetworkSignature.c */,
- 152E68C20A2C89E30011FDA8 /* SCPreferencesKeychainPrivate.c */,
150607BD075A00A200B147BA /* SCSchemaDefinitions.c */,
15CB695005C0722B0099E85F /* SCD.c */,
- 15CB695205C0722B0099E85F /* SCDKeys.c */,
15CB695405C0722B0099E85F /* SCDPrivate.c */,
- 15CB695605C0722B0099E85F /* SCDPlugin.c */,
+ 15CB695205C0722B0099E85F /* SCDKeys.c */,
15CB695805C0722B0099E85F /* SCDOpen.c */,
15CB695A05C0722B0099E85F /* SCDLock.c */,
15CB695C05C0722B0099E85F /* SCDUnlock.c */,
15CB699805C0722B0099E85F /* SCPApply.c */,
15CB699A05C0722B0099E85F /* SCPPath.c */,
151BDA5D05D9E2ED00657BC7 /* SCPreferencesPathKey.c */,
+ 152E68C20A2C89E30011FDA8 /* SCPreferencesKeychainPrivate.c */,
15AD7A390670A85900BFE03C /* SCNetworkConfigurationInternal.c */,
15AD7A3B0670A85900BFE03C /* SCNetworkInterface.c */,
15AD7A3C0670A85900BFE03C /* SCNetworkProtocol.c */,
15AD7A3D0670A85900BFE03C /* SCNetworkService.c */,
15AD7A3E0670A85900BFE03C /* SCNetworkSet.c */,
+ 15CB69B205C0722B0099E85F /* LinkConfiguration.c */,
+ 9EE943F306AF409B00772EB5 /* BondConfiguration.c */,
+ 15CB69B605C0722B0099E85F /* VLANConfiguration.c */,
+ 15CB695605C0722B0099E85F /* SCDPlugin.c */,
15CB699C05C0722B0099E85F /* SCDConsoleUser.c */,
15CB699E05C0722B0099E85F /* SCDHostName.c */,
15CB69A005C0722B0099E85F /* SCLocation.c */,
15CB69A405C0722B0099E85F /* SCNetworkConnection.c */,
15A2972D0A13C08C009879B3 /* SCNetworkConnectionPrivate.c */,
15CB69A605C0722B0099E85F /* SCNetworkReachability.c */,
+ F95B8A420B03E07A00993BA3 /* SCNetworkSignature.c */,
15CB69A805C0722B0099E85F /* SCProxies.c */,
15CB69AC05C0722B0099E85F /* DHCP.c */,
15CB69AE05C0722B0099E85F /* moh.c */,
15CB69B005C0722B0099E85F /* DeviceOnHold.c */,
- 15CB69B205C0722B0099E85F /* LinkConfiguration.c */,
15CB69B405C0722B0099E85F /* dy_framework.c */,
- 9EE943F306AF409B00772EB5 /* BondConfiguration.c */,
- 15CB69B605C0722B0099E85F /* VLANConfiguration.c */,
);
name = Sources;
sourceTree = "<group>";
children = (
1540E3600987DA9500157C07 /* com.apple.configd.plist */,
15CB6A2005C0722B0099E85F /* configd.8 */,
+ 1567333E0DD1FD6500145179 /* entitlements.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
1520A3DE0846B2DC0010B584 /* Security.framework */,
15BAA32207F0699A00D9EC95 /* libbsm.dylib */,
152CEED0070CF6640050F23C /* libedit.dylib */,
- 1587A31F0B6AACD70063104A /* libicucore.dylib */,
);
name = "External Frameworks and Libraries";
sourceTree = "<group>";
name = MiG;
sourceTree = "<group>";
};
+ 15FF5C390CDF9C4000EEC8AA /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 15FF5C290CDF770500EEC8AA /* com.apple.SCHelper.plist */,
+ 151356AD0CE0CF2F0017E523 /* com.apple.SCHelper-embedded.plist */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
F95B8A660B03F97800993BA3 /* NetworkIdentification */ = {
isa = PBXGroup;
children = (
);
runOnlyForDeploymentPostprocessing = 0;
};
- 159D53D007528BDA004F8947 /* Headers */ = {
+ 1572C4A80CFB55B400E2776E /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1572C4A90CFB55B400E2776E /* SCSchemaDefinitions.h in Headers */,
+ 1572C4AA0CFB55B400E2776E /* SystemConfiguration.h in Headers */,
+ 1572C4AB0CFB55B400E2776E /* SCPrivate.h in Headers */,
+ 1572C4AC0CFB55B400E2776E /* SCDPlugin.h in Headers */,
+ 1572C4AD0CFB55B400E2776E /* SCDynamicStoreInternal.h in Headers */,
+ 1572C4AE0CFB55B400E2776E /* SCDynamicStore.h in Headers */,
+ 1572C4AF0CFB55B400E2776E /* SCDynamicStorePrivate.h in Headers */,
+ 1572C4B00CFB55B400E2776E /* SCDynamicStoreKey.h in Headers */,
+ 1572C4B10CFB55B400E2776E /* SCDynamicStoreCopySpecific.h in Headers */,
+ 1572C4B20CFB55B400E2776E /* SCDynamicStoreCopySpecificPrivate.h in Headers */,
+ 1572C4B30CFB55B400E2776E /* SCDynamicStoreSetSpecificPrivate.h in Headers */,
+ 1572C4B40CFB55B400E2776E /* SCPreferencesInternal.h in Headers */,
+ 1572C4B50CFB55B400E2776E /* SCPreferences.h in Headers */,
+ 1572C4B60CFB55B400E2776E /* SCPreferencesPrivate.h in Headers */,
+ 1572C4B70CFB55B400E2776E /* SCPreferencesPath.h in Headers */,
+ 1572C4B80CFB55B400E2776E /* SCPreferencesSetSpecific.h in Headers */,
+ 1572C4B90CFB55B400E2776E /* SCNetworkConfiguration.h in Headers */,
+ 1572C4BA0CFB55B400E2776E /* SCNetworkConfigurationInternal.h in Headers */,
+ 1572C4BB0CFB55B400E2776E /* SCNetwork.h in Headers */,
+ 1572C4BC0CFB55B400E2776E /* SCNetworkConnection.h in Headers */,
+ 1572C4BD0CFB55B400E2776E /* SCNetworkReachability.h in Headers */,
+ 1572C4BE0CFB55B400E2776E /* SCValidation.h in Headers */,
+ 1572C4BF0CFB55B400E2776E /* DHCPClientPreferences.h in Headers */,
+ 1572C4C00CFB55B400E2776E /* SCDynamicStoreCopyDHCPInfo.h in Headers */,
+ 1572C4C10CFB55B400E2776E /* moh_msg.h in Headers */,
+ 1572C4C20CFB55B400E2776E /* moh.h in Headers */,
+ 1572C4C30CFB55B400E2776E /* DeviceOnHold.h in Headers */,
+ 1572C4C50CFB55B400E2776E /* dy_framework.h in Headers */,
+ 1572C4C70CFB55B400E2776E /* SCPreferencesPathKey.h in Headers */,
+ 1572C4C80CFB55B400E2776E /* dnsinfo.h in Headers */,
+ 1572C4C90CFB55B400E2776E /* dnsinfo_private.h in Headers */,
+ 1572C4CA0CFB55B400E2776E /* pppcontroller_types.h in Headers */,
+ 1572C4CB0CFB55B400E2776E /* pppcontroller.h in Headers */,
+ 1572C4CE0CFB55B400E2776E /* SCPreferencesSetSpecificPrivate.h in Headers */,
+ 1572C4CF0CFB55B400E2776E /* SCPreferencesGetSpecificPrivate.h in Headers */,
+ 1572C4D00CFB55B400E2776E /* SCNetworkConfigurationPrivate.h in Headers */,
+ 1572C4D10CFB55B400E2776E /* helper_comm.h in Headers */,
+ 1572C4D20CFB55B400E2776E /* SCHelper_client.h in Headers */,
+ 1572C4D40CFB55B400E2776E /* SCNetworkConnectionPrivate.h in Headers */,
+ 1572C4D50CFB55B400E2776E /* SCPreferencesKeychainPrivate.h in Headers */,
+ 1572C4D60CFB55B400E2776E /* SCSchemaDefinitionsPrivate.h in Headers */,
+ 1572C4D70CFB55B400E2776E /* SCNetworkSignature.h in Headers */,
+ 1572C4D80CFB55B400E2776E /* SCNetworkSignaturePrivate.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 157433DE0D4A8122002ACA73 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 157433F10D4A8137002ACA73 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 157433F20D4A8137002ACA73 /* scutil.h in Headers */,
+ 157433F30D4A8137002ACA73 /* commands.h in Headers */,
+ 157433F40D4A8137002ACA73 /* dictionary.h in Headers */,
+ 157433F50D4A8137002ACA73 /* session.h in Headers */,
+ 157433F60D4A8137002ACA73 /* cache.h in Headers */,
+ 157433F70D4A8137002ACA73 /* notifications.h in Headers */,
+ 157433F80D4A8137002ACA73 /* tests.h in Headers */,
+ 157433F90D4A8137002ACA73 /* prefs.h in Headers */,
+ 157433FA0D4A8137002ACA73 /* net.h in Headers */,
+ 157433FB0D4A8137002ACA73 /* net_interface.h in Headers */,
+ 157433FC0D4A8137002ACA73 /* net_protocol.h in Headers */,
+ 157433FD0D4A8137002ACA73 /* net_service.h in Headers */,
+ 157433FE0D4A8137002ACA73 /* net_set.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 157A84D90D56C63900B6F1A0 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 157A84DA0D56C63900B6F1A0 /* dnsinfo.h in Headers */,
+ 157A84DB0D56C63900B6F1A0 /* dnsinfo_private.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 157A84F50D56C7E800B6F1A0 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 157A84F60D56C7E800B6F1A0 /* dns-configuration.h in Headers */,
+ 157A84F70D56C7E800B6F1A0 /* set-hostname.h in Headers */,
+ 15D48EC20F67061F00B4711E /* dnsinfo_create.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 157A85060D56C8AA00B6F1A0 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 157A85110D56C8E000B6F1A0 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 157A85120D56C8E000B6F1A0 /* cache.h in Headers */,
+ 157A85140D56C8E000B6F1A0 /* ev_dlil.h in Headers */,
+ 157A85150D56C8E000B6F1A0 /* ev_ipv4.h in Headers */,
+ 157A85160D56C8E000B6F1A0 /* ev_ipv6.h in Headers */,
+ 157A85170D56C8E000B6F1A0 /* eventmon.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 157A85270D56C91100B6F1A0 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 157A85320D56C94F00B6F1A0 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 157A853D0D56C96F00B6F1A0 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 158317240CFB80A1006F62B9 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 158317250CFB80A1006F62B9 /* configd.h in Headers */,
+ 158317260CFB80A1006F62B9 /* _SCD.h in Headers */,
+ 158317270CFB80A1006F62B9 /* configd_server.h in Headers */,
+ 158317280CFB80A1006F62B9 /* notify_server.h in Headers */,
+ 158317290CFB80A1006F62B9 /* plugin_support.h in Headers */,
+ 1583172A0CFB80A1006F62B9 /* session.h in Headers */,
+ 1583172B0CFB80A1006F62B9 /* pattern.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 1583379A0CFB6B9E0033AB93 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1583379B0CFB6B9E0033AB93 /* helper_comm.h in Headers */,
+ 1583379C0CFB6B9E0033AB93 /* SCHelper_client.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 159C9B2B0DB68E2600BEEF10 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
- 159D540A07528D3B004F8947 /* cache.h in Headers */,
- 159D540C07528DAA004F8947 /* ev_appletalk.h in Headers */,
- 159D540E07528DAE004F8947 /* ev_dlil.h in Headers */,
- 159D541007528DB1004F8947 /* ev_ipv4.h in Headers */,
- 159D541207528DB3004F8947 /* ev_ipv6.h in Headers */,
- 159D541407528DB5004F8947 /* eventmon.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
- 159D53DA07528C2E004F8947 /* Headers */ = {
+ 159C9B830DB68F0300BEEF10 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
+ 159D53D007528BDA004F8947 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 159D540A07528D3B004F8947 /* cache.h in Headers */,
+ 159D540E07528DAE004F8947 /* ev_dlil.h in Headers */,
+ 159D541007528DB1004F8947 /* ev_ipv4.h in Headers */,
+ 159D541207528DB3004F8947 /* ev_ipv6.h in Headers */,
+ 159D541407528DB5004F8947 /* eventmon.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
159D53E107528C4A004F8947 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
155D223B0AF13A7300D52ED0 /* dns-configuration.h in Headers */,
155D223C0AF13A7300D52ED0 /* set-hostname.h in Headers */,
155D223D0AF13A7300D52ED0 /* smb-configuration.h in Headers */,
+ 15D48EC00F67061700B4711E /* dnsinfo_create.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
);
runOnlyForDeploymentPostprocessing = 0;
};
+ 15A5A1E60D5B94190087BDA0 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 15A5A1E70D5B94190087BDA0 /* SCSchemaDefinitions.h in Headers */,
+ 15A5A1E80D5B94190087BDA0 /* SystemConfiguration.h in Headers */,
+ 15A5A1E90D5B94190087BDA0 /* SCPrivate.h in Headers */,
+ 15A5A1EA0D5B94190087BDA0 /* SCDPlugin.h in Headers */,
+ 15A5A1EB0D5B94190087BDA0 /* SCDynamicStoreInternal.h in Headers */,
+ 15A5A1EC0D5B94190087BDA0 /* SCDynamicStore.h in Headers */,
+ 15A5A1ED0D5B94190087BDA0 /* SCDynamicStorePrivate.h in Headers */,
+ 15A5A1EE0D5B94190087BDA0 /* SCDynamicStoreKey.h in Headers */,
+ 15A5A1EF0D5B94190087BDA0 /* SCDynamicStoreCopySpecific.h in Headers */,
+ 15A5A1F00D5B94190087BDA0 /* SCDynamicStoreCopySpecificPrivate.h in Headers */,
+ 15A5A1F10D5B94190087BDA0 /* SCDynamicStoreSetSpecificPrivate.h in Headers */,
+ 15A5A1F20D5B94190087BDA0 /* SCPreferencesInternal.h in Headers */,
+ 15A5A1F30D5B94190087BDA0 /* SCPreferences.h in Headers */,
+ 15A5A1F40D5B94190087BDA0 /* SCPreferencesPrivate.h in Headers */,
+ 15A5A1F50D5B94190087BDA0 /* SCPreferencesPath.h in Headers */,
+ 15A5A1F60D5B94190087BDA0 /* SCPreferencesSetSpecific.h in Headers */,
+ 15A5A1F70D5B94190087BDA0 /* SCNetworkConfiguration.h in Headers */,
+ 15A5A1F80D5B94190087BDA0 /* SCNetworkConfigurationInternal.h in Headers */,
+ 15A5A1F90D5B94190087BDA0 /* SCNetwork.h in Headers */,
+ 15A5A1FA0D5B94190087BDA0 /* SCNetworkConnection.h in Headers */,
+ 15A5A1FB0D5B94190087BDA0 /* SCNetworkReachability.h in Headers */,
+ 15A5A1FC0D5B94190087BDA0 /* SCValidation.h in Headers */,
+ 15A5A1FD0D5B94190087BDA0 /* DHCPClientPreferences.h in Headers */,
+ 15A5A1FE0D5B94190087BDA0 /* SCDynamicStoreCopyDHCPInfo.h in Headers */,
+ 15A5A1FF0D5B94190087BDA0 /* moh_msg.h in Headers */,
+ 15A5A2000D5B94190087BDA0 /* moh.h in Headers */,
+ 15A5A2010D5B94190087BDA0 /* DeviceOnHold.h in Headers */,
+ 15A5A2030D5B94190087BDA0 /* dy_framework.h in Headers */,
+ 15A5A2050D5B94190087BDA0 /* SCPreferencesPathKey.h in Headers */,
+ 15A5A2060D5B94190087BDA0 /* dnsinfo.h in Headers */,
+ 15A5A2070D5B94190087BDA0 /* dnsinfo_private.h in Headers */,
+ 15A5A2080D5B94190087BDA0 /* pppcontroller_types.h in Headers */,
+ 15A5A2090D5B94190087BDA0 /* pppcontroller.h in Headers */,
+ 15A5A20C0D5B94190087BDA0 /* SCPreferencesSetSpecificPrivate.h in Headers */,
+ 15A5A20D0D5B94190087BDA0 /* SCPreferencesGetSpecificPrivate.h in Headers */,
+ 15A5A20E0D5B94190087BDA0 /* SCNetworkConfigurationPrivate.h in Headers */,
+ 15A5A20F0D5B94190087BDA0 /* helper_comm.h in Headers */,
+ 15A5A2100D5B94190087BDA0 /* SCHelper_client.h in Headers */,
+ 15A5A2110D5B94190087BDA0 /* SCNetworkConnectionPrivate.h in Headers */,
+ 15A5A2120D5B94190087BDA0 /* SCPreferencesKeychainPrivate.h in Headers */,
+ 15A5A2130D5B94190087BDA0 /* SCSchemaDefinitionsPrivate.h in Headers */,
+ 15A5A2140D5B94190087BDA0 /* SCNetworkSignature.h in Headers */,
+ 15A5A2150D5B94190087BDA0 /* SCNetworkSignaturePrivate.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
15DAD5E0075913CE0084A6ED /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
15DAD5E1075913CE0084A6ED /* dnsinfo.h in Headers */,
15DAD5E2075913CE0084A6ED /* dnsinfo_private.h in Headers */,
- 15DAD5E3075913CE0084A6ED /* dnsinfo_create.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
15DAD65C07591A1A0084A6ED /* DeviceOnHold.h in Headers */,
15DAD65D07591A1A0084A6ED /* LinkConfiguration.h in Headers */,
15DAD65E07591A1A0084A6ED /* dy_framework.h in Headers */,
- 15DAD65F07591A1A0084A6ED /* VLANConfiguration.h in Headers */,
15DAD66107591A1A0084A6ED /* SCPreferencesPathKey.h in Headers */,
15DAD66207591A1A0084A6ED /* dnsinfo.h in Headers */,
15DAD66307591A1A0084A6ED /* dnsinfo_private.h in Headers */,
15DAD66407591A1A0084A6ED /* pppcontroller_types.h in Headers */,
15DAD66507591A1A0084A6ED /* pppcontroller.h in Headers */,
- 15DAD66607591A1A0084A6ED /* BondConfiguration.h in Headers */,
- 15DAD66707591A1A0084A6ED /* BondConfigurationPrivate.h in Headers */,
156BD6BC07E0DFA9008698FF /* SCPreferencesSetSpecificPrivate.h in Headers */,
154CF3F407E1EA4D00D8302E /* SCPreferencesGetSpecificPrivate.h in Headers */,
155A1E6C081079CC00F70D98 /* SCNetworkConfigurationPrivate.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
- 15FD733C0754DBDA001CC321 /* Headers */ = {
- isa = PBXHeadersBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
F95B8A5B0B03F81400993BA3 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
productReference = 151F63EC09328A3C0096DCC9 /* genSCPreferences */;
productType = "com.apple.product-type.tool";
};
+ 15213FF90E93E9F500DACD2C /* Logger.bundle */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 15213FFF0E93E9F600DACD2C /* Build configuration list for PBXNativeTarget "Logger.bundle" */;
+ buildPhases = (
+ 15213FF70E93E9F500DACD2C /* Sources */,
+ 1521400B0E93FF8600DACD2C /* Frameworks */,
+ 15213FF60E93E9F500DACD2C /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = Logger.bundle;
+ productName = Logger.bundle;
+ productReference = 15213FFA0E93E9F500DACD2C /* Logger.bundle */;
+ productType = "com.apple.product-type.bundle";
+ };
1547001808455B98006787CE /* SCHelper */ = {
isa = PBXNativeTarget;
buildConfigurationList = 156EB5E20905594A00EEF749 /* Build configuration list for PBXNativeTarget "SCHelper" */;
1547001908455B98006787CE /* Headers */,
1547001A08455B98006787CE /* Sources */,
1547001B08455B98006787CE /* Frameworks */,
- 1547001C08455B98006787CE /* Rez */,
+ 15FF5C380CDF778F00EEC8AA /* CopyFiles */,
);
buildRules = (
);
155847460754FDCD0046C2E9 /* Headers */,
155847540754FDCD0046C2E9 /* Sources */,
155847620754FDCD0046C2E9 /* Frameworks */,
- 155847670754FDCD0046C2E9 /* Rez */,
155847680754FDCD0046C2E9 /* CopyFiles */,
);
buildRules = (
1558481407550EC10046C2E9 /* Headers */,
1558481507550EC10046C2E9 /* Sources */,
1558481707550EC10046C2E9 /* Frameworks */,
- 1558481A07550EC10046C2E9 /* Rez */,
1558481B07550EC10046C2E9 /* CopyFiles */,
);
buildRules = (
productReference = 1558481D07550EC10046C2E9 /* scselect */;
productType = "com.apple.product-type.tool";
};
- 15828AE60753B5F900AD4710 /* KernelEventMonitor.bundle */ = {
+ 156CA4790EF853BB00C59A18 /* Logger.bundle-Embedded */ = {
isa = PBXNativeTarget;
- buildConfigurationList = 156EB5FE0905594A00EEF749 /* Build configuration list for PBXNativeTarget "KernelEventMonitor.bundle" */;
+ buildConfigurationList = 156CA4820EF853BB00C59A18 /* Build configuration list for PBXNativeTarget "Logger.bundle-Embedded" */;
buildPhases = (
- 15828AE30753B5F900AD4710 /* Resources */,
+ 156CA47A0EF853BB00C59A18 /* Sources */,
+ 156CA47C0EF853BB00C59A18 /* Frameworks */,
+ 156CA4810EF853BB00C59A18 /* Resources */,
);
buildRules = (
);
dependencies = (
);
- name = KernelEventMonitor.bundle;
- productName = KernelEventMonitor.bundle;
- productReference = 15828AE70753B5F900AD4710 /* KernelEventMonitor.bundle */;
+ name = "Logger.bundle-Embedded";
+ productName = Logger.bundle;
+ productReference = 156CA4850EF853BB00C59A18 /* Logger.bundle */;
productType = "com.apple.product-type.bundle";
};
- 159D53D307528BDA004F8947 /* KernelEventMonitor */ = {
+ 1572C4A60CFB55B400E2776E /* SystemConfiguration.framework-Embedded */ = {
isa = PBXNativeTarget;
- buildConfigurationList = 156EB6020905594A00EEF749 /* Build configuration list for PBXNativeTarget "KernelEventMonitor" */;
+ buildConfigurationList = 1572C5290CFB55B400E2776E /* Build configuration list for PBXNativeTarget "SystemConfiguration.framework-Embedded" */;
buildPhases = (
- 159D53D007528BDA004F8947 /* Headers */,
- 159D53D107528BDA004F8947 /* Sources */,
- 159D53D207528BDA004F8947 /* Frameworks */,
+ 1572C4A80CFB55B400E2776E /* Headers */,
+ 153393E40D34999D00FE74E7 /* Update Headers */,
+ 1572C4D90CFB55B400E2776E /* Resources */,
+ 1572C4DE0CFB55B400E2776E /* Sources */,
+ 1572C5230CFB55B400E2776E /* Frameworks */,
+ 1572C5270CFB55B400E2776E /* get-mobility-info */,
);
buildRules = (
);
dependencies = (
);
- name = KernelEventMonitor;
- productName = KernelEventMonitor;
- productReference = 159D53D407528BDA004F8947 /* libKernelEventMonitor.a */;
- productType = "com.apple.product-type.library.static";
+ name = "SystemConfiguration.framework-Embedded";
+ productInstallPath = "$(SYSTEM_LIBRARY_DIR)/Frameworks";
+ productName = "SystemConfiguration (Framework)";
+ productReference = 1547072E0D1F70C80075C28D /* SystemConfiguration.framework */;
+ productType = "com.apple.product-type.framework";
};
- 159D53DD07528C2E004F8947 /* Kicker */ = {
+ 157433DD0D4A8122002ACA73 /* scselect-Embedded */ = {
isa = PBXNativeTarget;
- buildConfigurationList = 156EB6060905594A00EEF749 /* Build configuration list for PBXNativeTarget "Kicker" */;
+ buildConfigurationList = 157433E80D4A8122002ACA73 /* Build configuration list for PBXNativeTarget "scselect-Embedded" */;
buildPhases = (
- 159D53DA07528C2E004F8947 /* Headers */,
- 159D53DB07528C2E004F8947 /* Sources */,
- 159D53DC07528C2E004F8947 /* Frameworks */,
+ 157433DE0D4A8122002ACA73 /* Headers */,
+ 157433DF0D4A8122002ACA73 /* Sources */,
+ 157433E10D4A8122002ACA73 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
- name = Kicker;
- productName = Kicker;
- productReference = 159D53DE07528C2E004F8947 /* libKicker.a */;
- productType = "com.apple.product-type.library.static";
+ name = "scselect-Embedded";
+ productInstallPath = /usr/sbin;
+ productName = "scselect (Tool)";
+ productReference = 157433EC0D4A8122002ACA73 /* scselect */;
+ productType = "com.apple.product-type.tool";
};
- 159D53E407528C4A004F8947 /* InterfaceNamer */ = {
+ 157433F00D4A8137002ACA73 /* scutil-Embedded */ = {
isa = PBXNativeTarget;
- buildConfigurationList = 156EB5F60905594A00EEF749 /* Build configuration list for PBXNativeTarget "InterfaceNamer" */;
+ buildConfigurationList = 157434160D4A8137002ACA73 /* Build configuration list for PBXNativeTarget "scutil-Embedded" */;
buildPhases = (
- 159D53E107528C4A004F8947 /* Headers */,
- 159D53E207528C4A004F8947 /* Sources */,
- 159D53E307528C4A004F8947 /* Frameworks */,
+ 157433F10D4A8137002ACA73 /* Headers */,
+ 157433FF0D4A8137002ACA73 /* Sources */,
+ 1574340D0D4A8137002ACA73 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
- name = InterfaceNamer;
- productName = InterfaceNamer;
- productReference = 159D53E507528C4A004F8947 /* libInterfaceNamer.a */;
- productType = "com.apple.product-type.library.static";
+ name = "scutil-Embedded";
+ productInstallPath = /usr/sbin;
+ productName = "scutil (Tool)";
+ productReference = 1574341A0D4A8137002ACA73 /* scutil */;
+ productType = "com.apple.product-type.tool";
};
- 159D53EB07528C61004F8947 /* IPMonitor */ = {
+ 157A84D80D56C63900B6F1A0 /* DNSConfiguration-Embedded */ = {
isa = PBXNativeTarget;
- buildConfigurationList = 156EB5EE0905594A00EEF749 /* Build configuration list for PBXNativeTarget "IPMonitor" */;
+ buildConfigurationList = 157A84E40D56C63900B6F1A0 /* Build configuration list for PBXNativeTarget "DNSConfiguration-Embedded" */;
buildPhases = (
- 159D53E807528C61004F8947 /* Headers */,
- 159D53E907528C61004F8947 /* Sources */,
- 159D53EA07528C61004F8947 /* Frameworks */,
+ 157A84D90D56C63900B6F1A0 /* Headers */,
+ 157A84DD0D56C63900B6F1A0 /* Sources */,
+ 157A84E20D56C63900B6F1A0 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
- name = IPMonitor;
- productName = IPMonitor;
- productReference = 159D53EC07528C61004F8947 /* libIPMonitor.a */;
+ name = "DNSConfiguration-Embedded";
+ productInstallPath = /usr/local/lib/system;
+ productName = DNSConfiguration;
+ productReference = 157A84E80D56C63900B6F1A0 /* libdnsinfo.a */;
productType = "com.apple.product-type.library.static";
};
- 159D53F207528C79004F8947 /* LinkConfiguration */ = {
+ 157A84F40D56C7E800B6F1A0 /* IPMonitor-Embedded */ = {
isa = PBXNativeTarget;
- buildConfigurationList = 156EB60E0905594A00EEF749 /* Build configuration list for PBXNativeTarget "LinkConfiguration" */;
+ buildConfigurationList = 157A84FE0D56C7E800B6F1A0 /* Build configuration list for PBXNativeTarget "IPMonitor-Embedded" */;
buildPhases = (
- 159D53EF07528C79004F8947 /* Headers */,
- 159D53F007528C79004F8947 /* Sources */,
- 159D53F107528C79004F8947 /* Frameworks */,
+ 157A84F50D56C7E800B6F1A0 /* Headers */,
+ 157A84F90D56C7E800B6F1A0 /* Sources */,
);
buildRules = (
);
dependencies = (
);
- name = LinkConfiguration;
- productName = LinkConfiguration;
- productReference = 159D53F307528C79004F8947 /* libLinkConfiguration.a */;
+ name = "IPMonitor-Embedded";
+ productName = IPMonitor;
+ productReference = 157A85020D56C7E800B6F1A0 /* libIPMonitor.a */;
productType = "com.apple.product-type.library.static";
};
- 159D53F907528C95004F8947 /* PreferencesMonitor */ = {
+ 157A85050D56C8AA00B6F1A0 /* InterfaceNamer-Embedded */ = {
isa = PBXNativeTarget;
- buildConfigurationList = 156EB6160905594A00EEF749 /* Build configuration list for PBXNativeTarget "PreferencesMonitor" */;
+ buildConfigurationList = 157A85090D56C8AA00B6F1A0 /* Build configuration list for PBXNativeTarget "InterfaceNamer-Embedded" */;
buildPhases = (
- 159D53F607528C95004F8947 /* Headers */,
- 159D53F707528C95004F8947 /* Sources */,
- 159D53F807528C95004F8947 /* Frameworks */,
+ 157A85060D56C8AA00B6F1A0 /* Headers */,
+ 157A85070D56C8AA00B6F1A0 /* Sources */,
);
buildRules = (
);
dependencies = (
);
- name = PreferencesMonitor;
- productName = PreferencesMonitor;
+ name = "InterfaceNamer-Embedded";
+ productName = InterfaceNamer;
+ productReference = 157A850D0D56C8AA00B6F1A0 /* libInterfaceNamer.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ 157A85100D56C8E000B6F1A0 /* KernelEventMonitor-Embedded */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 157A851F0D56C8E000B6F1A0 /* Build configuration list for PBXNativeTarget "KernelEventMonitor-Embedded" */;
+ buildPhases = (
+ 157A85110D56C8E000B6F1A0 /* Headers */,
+ 157A85180D56C8E000B6F1A0 /* Sources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "KernelEventMonitor-Embedded";
+ productName = KernelEventMonitor;
+ productReference = 157A85230D56C8E000B6F1A0 /* libKernelEventMonitor.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ 157A85260D56C91100B6F1A0 /* LinkConfiguration-Embedded */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 157A852A0D56C91100B6F1A0 /* Build configuration list for PBXNativeTarget "LinkConfiguration-Embedded" */;
+ buildPhases = (
+ 157A85270D56C91100B6F1A0 /* Headers */,
+ 157A85280D56C91100B6F1A0 /* Sources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "LinkConfiguration-Embedded";
+ productName = LinkConfiguration;
+ productReference = 157A852E0D56C91100B6F1A0 /* libLinkConfiguration.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ 157A85310D56C94F00B6F1A0 /* NetworkIdentification-Embedded */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 157A85350D56C94F00B6F1A0 /* Build configuration list for PBXNativeTarget "NetworkIdentification-Embedded" */;
+ buildPhases = (
+ 157A85320D56C94F00B6F1A0 /* Headers */,
+ 157A85330D56C94F00B6F1A0 /* Sources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "NetworkIdentification-Embedded";
+ productName = NetworkIdentification;
+ productReference = 157A85390D56C94F00B6F1A0 /* libNetworkIdentification.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ 157A853C0D56C96F00B6F1A0 /* PreferencesMonitor-Embedded */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 157A85400D56C96F00B6F1A0 /* Build configuration list for PBXNativeTarget "PreferencesMonitor-Embedded" */;
+ buildPhases = (
+ 157A853D0D56C96F00B6F1A0 /* Headers */,
+ 157A853E0D56C96F00B6F1A0 /* Sources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "PreferencesMonitor-Embedded";
+ productName = PreferencesMonitor;
+ productReference = 157A85440D56C96F00B6F1A0 /* libPreferencesMonitor.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ 15828AE60753B5F900AD4710 /* KernelEventMonitor.bundle */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 156EB5FE0905594A00EEF749 /* Build configuration list for PBXNativeTarget "KernelEventMonitor.bundle" */;
+ buildPhases = (
+ 15828AE30753B5F900AD4710 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = KernelEventMonitor.bundle;
+ productName = KernelEventMonitor.bundle;
+ productReference = 15828AE70753B5F900AD4710 /* KernelEventMonitor.bundle */;
+ productType = "com.apple.product-type.bundle";
+ };
+ 158317230CFB80A1006F62B9 /* configd-Embedded */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1583175D0CFB80A1006F62B9 /* Build configuration list for PBXNativeTarget "configd-Embedded" */;
+ buildPhases = (
+ 158317240CFB80A1006F62B9 /* Headers */,
+ 1583172C0CFB80A1006F62B9 /* Sources */,
+ 1583174B0CFB80A1006F62B9 /* Frameworks */,
+ 1583175B0CFB80A1006F62B9 /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "configd-Embedded";
+ productInstallPath = /usr/sbin;
+ productName = "configd (Tool)";
+ productReference = 1559C44C0D349A4E0098FD59 /* configd */;
+ productType = "com.apple.product-type.tool";
+ };
+ 1583177D0CFB85C8006F62B9 /* IPMonitor.bundle-Embedded */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 158317800CFB85C8006F62B9 /* Build configuration list for PBXNativeTarget "IPMonitor.bundle-Embedded" */;
+ buildPhases = (
+ 1583177E0CFB85C8006F62B9 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "IPMonitor.bundle-Embedded";
+ productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
+ productName = IPMonitor.bundle;
+ productReference = 1559C4500D349A4E0098FD59 /* IPMonitor.bundle */;
+ productType = "com.apple.product-type.bundle";
+ };
+ 158317870CFB85DD006F62B9 /* InterfaceNamer.bundle-Embedded */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 158317890CFB85DD006F62B9 /* Build configuration list for PBXNativeTarget "InterfaceNamer.bundle-Embedded" */;
+ buildPhases = (
+ 158317880CFB85DD006F62B9 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "InterfaceNamer.bundle-Embedded";
+ productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
+ productName = InterfaceNamer.bundle;
+ productReference = 1559C4510D349A4E0098FD59 /* InterfaceNamer.bundle */;
+ productType = "com.apple.product-type.bundle";
+ };
+ 158317900CFB85F7006F62B9 /* KernelEventMonitor.bundle-Embedded */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 158317920CFB85F7006F62B9 /* Build configuration list for PBXNativeTarget "KernelEventMonitor.bundle-Embedded" */;
+ buildPhases = (
+ 158317910CFB85F7006F62B9 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "KernelEventMonitor.bundle-Embedded";
+ productName = KernelEventMonitor.bundle;
+ productReference = 1559C4520D349A4E0098FD59 /* KernelEventMonitor.bundle */;
+ productType = "com.apple.product-type.bundle";
+ };
+ 158317980CFB860C006F62B9 /* LinkConfiguration.bundle-Embedded */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1583179A0CFB860C006F62B9 /* Build configuration list for PBXNativeTarget "LinkConfiguration.bundle-Embedded" */;
+ buildPhases = (
+ 158317990CFB860C006F62B9 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "LinkConfiguration.bundle-Embedded";
+ productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
+ productName = LinkConfiguration.bundle;
+ productReference = 1559C4530D349A4E0098FD59 /* LinkConfiguration.bundle */;
+ productType = "com.apple.product-type.bundle";
+ };
+ 158317A00CFB8626006F62B9 /* NetworkIdentification.bundle-Embedded */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 158317A20CFB8626006F62B9 /* Build configuration list for PBXNativeTarget "NetworkIdentification.bundle-Embedded" */;
+ buildPhases = (
+ 158317A10CFB8626006F62B9 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "NetworkIdentification.bundle-Embedded";
+ productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
+ productName = NetworkIdentification.bundle;
+ productReference = 1559C4550D349A4E0098FD59 /* NetworkIdentification.bundle */;
+ productType = "com.apple.product-type.bundle";
+ };
+ 158317A80CFB8639006F62B9 /* PreferencesMonitor.bundle-Embedded */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 158317AA0CFB8639006F62B9 /* Build configuration list for PBXNativeTarget "PreferencesMonitor.bundle-Embedded" */;
+ buildPhases = (
+ 158317A90CFB8639006F62B9 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "PreferencesMonitor.bundle-Embedded";
+ productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
+ productName = PreferencesMonitor.bundle;
+ productReference = 1559C4540D349A4E0098FD59 /* PreferencesMonitor.bundle */;
+ productType = "com.apple.product-type.bundle";
+ };
+ 158337990CFB6B9E0033AB93 /* SCHelper-Embedded */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 158337A60CFB6B9E0033AB93 /* Build configuration list for PBXNativeTarget "SCHelper-Embedded" */;
+ buildPhases = (
+ 1583379A0CFB6B9E0033AB93 /* Headers */,
+ 1583379D0CFB6B9E0033AB93 /* Sources */,
+ 1583379F0CFB6B9E0033AB93 /* Frameworks */,
+ 158337A40CFB6B9E0033AB93 /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "SCHelper-Embedded";
+ productInstallPath = /usr/local/bin;
+ productName = SCPreferencesHelper;
+ productReference = 1559C4470D349A4E0098FD59 /* SCHelper */;
+ productType = "com.apple.product-type.tool";
+ };
+ 159D53D307528BDA004F8947 /* KernelEventMonitor */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 156EB6020905594A00EEF749 /* Build configuration list for PBXNativeTarget "KernelEventMonitor" */;
+ buildPhases = (
+ 159D53D007528BDA004F8947 /* Headers */,
+ 159D53D107528BDA004F8947 /* Sources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = KernelEventMonitor;
+ productName = KernelEventMonitor;
+ productReference = 159D53D407528BDA004F8947 /* libKernelEventMonitor.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ 159D53E407528C4A004F8947 /* InterfaceNamer */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 156EB5F60905594A00EEF749 /* Build configuration list for PBXNativeTarget "InterfaceNamer" */;
+ buildPhases = (
+ 159D53E107528C4A004F8947 /* Headers */,
+ 159D53E207528C4A004F8947 /* Sources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = InterfaceNamer;
+ productName = InterfaceNamer;
+ productReference = 159D53E507528C4A004F8947 /* libInterfaceNamer.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ 159D53EB07528C61004F8947 /* IPMonitor */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 156EB5EE0905594A00EEF749 /* Build configuration list for PBXNativeTarget "IPMonitor" */;
+ buildPhases = (
+ 159D53E807528C61004F8947 /* Headers */,
+ 159D53E907528C61004F8947 /* Sources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = IPMonitor;
+ productName = IPMonitor;
+ productReference = 159D53EC07528C61004F8947 /* libIPMonitor.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ 159D53F207528C79004F8947 /* LinkConfiguration */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 156EB60E0905594A00EEF749 /* Build configuration list for PBXNativeTarget "LinkConfiguration" */;
+ buildPhases = (
+ 159D53EF07528C79004F8947 /* Headers */,
+ 159D53F007528C79004F8947 /* Sources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = LinkConfiguration;
+ productName = LinkConfiguration;
+ productReference = 159D53F307528C79004F8947 /* libLinkConfiguration.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ 159D53F907528C95004F8947 /* PreferencesMonitor */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 156EB6160905594A00EEF749 /* Build configuration list for PBXNativeTarget "PreferencesMonitor" */;
+ buildPhases = (
+ 159D53F607528C95004F8947 /* Headers */,
+ 159D53F707528C95004F8947 /* Sources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = PreferencesMonitor;
+ productName = PreferencesMonitor;
productReference = 159D53FA07528C95004F8947 /* libPreferencesMonitor.a */;
productType = "com.apple.product-type.library.static";
};
159D54A307529FFF004F8947 /* Headers */,
159D54AB07529FFF004F8947 /* Sources */,
159D54CA07529FFF004F8947 /* Frameworks */,
- 159D54D407529FFF004F8947 /* Rez */,
159D54D507529FFF004F8947 /* CopyFiles */,
159D54D707529FFF004F8947 /* CopyFiles */,
);
productReference = 159D54D907529FFF004F8947 /* configd */;
productType = "com.apple.product-type.tool";
};
+ 15A5A1E40D5B94190087BDA0 /* SystemConfiguration.framework-EmbeddedSimulator */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 15A5A2660D5B94190087BDA0 /* Build configuration list for PBXNativeTarget "SystemConfiguration.framework-EmbeddedSimulator" */;
+ buildPhases = (
+ 15A5A1E60D5B94190087BDA0 /* Headers */,
+ 15A5A2170D5B94190087BDA0 /* Update Headers */,
+ 15A5A2180D5B94190087BDA0 /* Resources */,
+ 15A5A21D0D5B94190087BDA0 /* Sources */,
+ 15A5A2620D5B94190087BDA0 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "SystemConfiguration.framework-EmbeddedSimulator";
+ productInstallPath = "$(SYSTEM_LIBRARY_DIR)/Frameworks";
+ productName = "SystemConfiguration (Framework)";
+ productReference = 15A5A26A0D5B94190087BDA0 /* SystemConfiguration.framework */;
+ productType = "com.apple.product-type.framework";
+ };
15DAD5DF075913CE0084A6ED /* DNSConfiguration */ = {
isa = PBXNativeTarget;
buildConfigurationList = 156EB5DA0905594A00EEF749 /* Build configuration list for PBXNativeTarget "DNSConfiguration" */;
15DAD5E0075913CE0084A6ED /* Headers */,
15DAD5E4075913CE0084A6ED /* Sources */,
15DAD5E9075913CE0084A6ED /* Frameworks */,
- 15DAD5EA075913CE0084A6ED /* Rez */,
);
buildRules = (
);
dependencies = (
);
name = DNSConfiguration;
- productInstallPath = /usr/local/lib;
+ productInstallPath = /usr/local/lib/system;
productName = DNSConfiguration;
productReference = 15DAD5EE075913CE0084A6ED /* libdnsinfo.a */;
productType = "com.apple.product-type.library.static";
buildPhases = (
15DAD6AC07591A1A0084A6ED /* SystemConfiguration.order */,
15DAD64107591A1A0084A6ED /* Headers */,
+ 15AC82480D376E2400A579D0 /* Update Headers */,
15DAD66807591A1A0084A6ED /* Resources */,
15DAD66C07591A1A0084A6ED /* Sources */,
15DAD6AD07591A1A0084A6ED /* Frameworks */,
- 15DAD6AF07591A1A0084A6ED /* Rez */,
15DAD6B007591A1A0084A6ED /* get-mobility-info */,
- 15DAD6B107591A1A0084A6ED /* preferences.plist */,
);
buildRules = (
);
name = SystemConfiguration.framework;
productInstallPath = "$(SYSTEM_LIBRARY_DIR)/Frameworks";
productName = "SystemConfiguration (Framework)";
- productReference = 15DAD6C807591A1A0084A6ED /* SystemConfiguration.framework */;
+ productReference = 1559C4440D349A4E0098FD59 /* SystemConfiguration.framework */;
productType = "com.apple.product-type.framework";
};
15FD70FF0754D627001CC321 /* Kicker.bundle */ = {
isa = PBXNativeTarget;
buildConfigurationList = 156EB60A0905594A00EEF749 /* Build configuration list for PBXNativeTarget "Kicker.bundle" */;
buildPhases = (
+ 159C9B830DB68F0300BEEF10 /* Headers */,
+ 159C9B840DB68F0300BEEF10 /* Sources */,
+ 159C9B850DB68F0300BEEF10 /* Frameworks */,
15FD71010754D627001CC321 /* Resources */,
);
buildRules = (
);
name = InterfaceNamer.bundle;
productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
- productName = Kicker.bundle;
+ productName = InterfaceNamer.bundle;
productReference = 15FD72970754DA2B001CC321 /* InterfaceNamer.bundle */;
productType = "com.apple.product-type.bundle";
};
);
name = IPMonitor.bundle;
productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
- productName = Kicker.bundle;
+ productName = IPMonitor.bundle;
productReference = 15FD72A50754DA4C001CC321 /* IPMonitor.bundle */;
productType = "com.apple.product-type.bundle";
};
);
name = LinkConfiguration.bundle;
productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
- productName = Kicker.bundle;
+ productName = LinkConfiguration.bundle;
productReference = 15FD72B50754DA69001CC321 /* LinkConfiguration.bundle */;
productType = "com.apple.product-type.bundle";
};
);
name = PreferencesMonitor.bundle;
productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
- productName = Kicker.bundle;
+ productName = PreferencesMonitor.bundle;
productReference = 15FD72C90754DA7E001CC321 /* PreferencesMonitor.bundle */;
productType = "com.apple.product-type.bundle";
};
isa = PBXNativeTarget;
buildConfigurationList = 156EB5EA0905594A00EEF749 /* Build configuration list for PBXNativeTarget "ATconfig.bundle" */;
buildPhases = (
+ 159C9B2B0DB68E2600BEEF10 /* Headers */,
+ 159C9B2C0DB68E2600BEEF10 /* Sources */,
+ 159C9B2F0DB68E8300BEEF10 /* Frameworks */,
15FD731F0754DB9F001CC321 /* Resources */,
);
buildRules = (
);
name = ATconfig.bundle;
productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
- productName = Kicker.bundle;
+ productName = ATconfig.bundle;
productReference = 15FD73220754DB9F001CC321 /* ATconfig.bundle */;
productType = "com.apple.product-type.bundle";
};
- 15FD733A0754DBDA001CC321 /* ATconfig */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 156EB63A0905594A00EEF749 /* Build configuration list for PBXNativeTarget "ATconfig" */;
- buildPhases = (
- 15FD733C0754DBDA001CC321 /* Headers */,
- 15FD733D0754DBDA001CC321 /* Sources */,
- 15FD733F0754DBDA001CC321 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = ATconfig;
- productName = InterfaceNamer;
- productReference = 15FD73400754DBDA001CC321 /* libATconfig.a */;
- productType = "com.apple.product-type.library.static";
- };
F95B8A5E0B03F81400993BA3 /* NetworkIdentification */ = {
isa = PBXNativeTarget;
buildConfigurationList = F95B8A610B03F83200993BA3 /* Build configuration list for PBXNativeTarget "NetworkIdentification" */;
buildPhases = (
F95B8A5B0B03F81400993BA3 /* Headers */,
F95B8A5C0B03F81400993BA3 /* Sources */,
- F95B8A5D0B03F81400993BA3 /* Frameworks */,
);
buildRules = (
);
);
name = NetworkIdentification.bundle;
productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
- productName = Kicker.bundle;
+ productName = NetworkIdentification.bundle;
productReference = F95B8A700B03F9D100993BA3 /* NetworkIdentification.bundle */;
productType = "com.apple.product-type.bundle";
};
15CB6A7705C0722B0099E85F /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 156EB63E0905594A00EEF749 /* Build configuration list for PBXProject "configd" */;
- compatibilityVersion = "Xcode 2.4";
+ compatibilityVersion = "Xcode 3.1";
hasScannedForEncodings = 1;
mainGroup = 15CB68FC05C072220099E85F /* configd */;
productRefGroup = 15CB690F05C0722B0099E85F /* Products */;
projectRoot = "";
targets = (
15CB690005C0722A0099E85F /* All */,
- 157BB8AE075924360025DA7A /* configd_base */,
- 159D542007528E7C004F8947 /* configd_plugins */,
- 155847FA07550D210046C2E9 /* configd_executables */,
+ 15C64A1E0F684C3300D78394 /* configd_libSystem */,
15DAD5DF075913CE0084A6ED /* DNSConfiguration */,
- 151F63DA09328A3C0096DCC9 /* Schema */,
+ 157BB8AE075924360025DA7A /* configd_base */,
15DAD63F07591A1A0084A6ED /* SystemConfiguration.framework */,
1547001808455B98006787CE /* SCHelper */,
- 151F5D990CCE98E50093AC3B /* SCMonitor */,
- 159D549F07529FFF004F8947 /* configd */,
- 1558481207550EC10046C2E9 /* scselect */,
- 155847430754FDCD0046C2E9 /* scutil */,
- 15FD733A0754DBDA001CC321 /* ATconfig */,
+ 159D542007528E7C004F8947 /* configd_plugins */,
15FD731E0754DB9F001CC321 /* ATconfig.bundle */,
159D53EB07528C61004F8947 /* IPMonitor */,
15FD72A10754DA4C001CC321 /* IPMonitor.bundle */,
15FD72930754DA2B001CC321 /* InterfaceNamer.bundle */,
159D53D307528BDA004F8947 /* KernelEventMonitor */,
15828AE60753B5F900AD4710 /* KernelEventMonitor.bundle */,
- 159D53DD07528C2E004F8947 /* Kicker */,
15FD70FF0754D627001CC321 /* Kicker.bundle */,
159D53F207528C79004F8947 /* LinkConfiguration */,
15FD72B10754DA69001CC321 /* LinkConfiguration.bundle */,
+ 15213FF90E93E9F500DACD2C /* Logger.bundle */,
F95B8A5E0B03F81400993BA3 /* NetworkIdentification */,
F95B8A6A0B03F9D100993BA3 /* NetworkIdentification.bundle */,
159D53F907528C95004F8947 /* PreferencesMonitor */,
15FD72C50754DA7E001CC321 /* PreferencesMonitor.bundle */,
- );
+ 155847FA07550D210046C2E9 /* configd_executables */,
+ 159D549F07529FFF004F8947 /* configd */,
+ 1558481207550EC10046C2E9 /* scselect */,
+ 155847430754FDCD0046C2E9 /* scutil */,
+ 151F5D990CCE98E50093AC3B /* SCMonitor */,
+ 151C1CC60CFB487000C5AFD6 /* All-Embedded */,
+ 15C64A280F684C6B00D78394 /* configd_libSystem-Embedded */,
+ 157A84D80D56C63900B6F1A0 /* DNSConfiguration-Embedded */,
+ 158316CF0CFB774B006F62B9 /* configd_base-Embedded */,
+ 1572C4A60CFB55B400E2776E /* SystemConfiguration.framework-Embedded */,
+ 158337990CFB6B9E0033AB93 /* SCHelper-Embedded */,
+ 158316E30CFB7761006F62B9 /* configd_plugins-Embedded */,
+ 157A84F40D56C7E800B6F1A0 /* IPMonitor-Embedded */,
+ 1583177D0CFB85C8006F62B9 /* IPMonitor.bundle-Embedded */,
+ 157A85050D56C8AA00B6F1A0 /* InterfaceNamer-Embedded */,
+ 158317870CFB85DD006F62B9 /* InterfaceNamer.bundle-Embedded */,
+ 157A85100D56C8E000B6F1A0 /* KernelEventMonitor-Embedded */,
+ 158317900CFB85F7006F62B9 /* KernelEventMonitor.bundle-Embedded */,
+ 157A85260D56C91100B6F1A0 /* LinkConfiguration-Embedded */,
+ 158317980CFB860C006F62B9 /* LinkConfiguration.bundle-Embedded */,
+ 156CA4790EF853BB00C59A18 /* Logger.bundle-Embedded */,
+ 157A85310D56C94F00B6F1A0 /* NetworkIdentification-Embedded */,
+ 158317A00CFB8626006F62B9 /* NetworkIdentification.bundle-Embedded */,
+ 157A853C0D56C96F00B6F1A0 /* PreferencesMonitor-Embedded */,
+ 158317A80CFB8639006F62B9 /* PreferencesMonitor.bundle-Embedded */,
+ 158317040CFB7782006F62B9 /* configd_executables-Embedded */,
+ 158317230CFB80A1006F62B9 /* configd-Embedded */,
+ 157433DD0D4A8122002ACA73 /* scselect-Embedded */,
+ 157433F00D4A8137002ACA73 /* scutil-Embedded */,
+ 15FD13BF0D59485000F9409C /* All-EmbeddedSimulator */,
+ 151FE2DD0D5B7046000D6DB1 /* configd_base-EmbeddedSimulator */,
+ 15A5A1E40D5B94190087BDA0 /* SystemConfiguration.framework-EmbeddedSimulator */,
+ 151F63DA09328A3C0096DCC9 /* Schema */,
+ );
};
/* End PBXProject section */
);
runOnlyForDeploymentPostprocessing = 0;
};
+ 15213FF60E93E9F500DACD2C /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 156CA4810EF853BB00C59A18 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 1572C4D90CFB55B400E2776E /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1572C4DA0CFB55B400E2776E /* Localizable.strings in Resources */,
+ 1572C4DB0CFB55B400E2776E /* NetworkInterface.strings in Resources */,
+ 1572C4DC0CFB55B400E2776E /* NetworkConfiguration.plist in Resources */,
+ 1572C4DD0CFB55B400E2776E /* get-mobility-info in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
15828AE30753B5F900AD4710 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
);
runOnlyForDeploymentPostprocessing = 0;
};
- 15DAD66807591A1A0084A6ED /* Resources */ = {
+ 1583177E0CFB85C8006F62B9 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 15A6F7C40A4B266D00B907EA /* Localizable.strings in Resources */,
- 15DAD66B07591A1A0084A6ED /* NetworkInterface.strings in Resources */,
- 15DAD66907591A1A0084A6ED /* NetworkConfiguration.plist in Resources */,
- 15DAD66A07591A1A0084A6ED /* get-mobility-info in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
- 15FD71010754D627001CC321 /* Resources */ = {
+ 158317880CFB85DD006F62B9 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 158ADD190754F1F100124717 /* Kicker.xml in Resources */,
- 158ADD1B0754F1F400124717 /* enable-network in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
- 15FD72940754DA2B001CC321 /* Resources */ = {
+ 158317910CFB85F7006F62B9 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
- 15FD72A20754DA4C001CC321 /* Resources */ = {
+ 158317990CFB860C006F62B9 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 158ADD0E0754F1A000124717 /* Resolvers.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
- 15FD72B20754DA69001CC321 /* Resources */ = {
+ 158317A10CFB8626006F62B9 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
- 15FD72C60754DA7E001CC321 /* Resources */ = {
+ 158317A90CFB8639006F62B9 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
- 15FD731F0754DB9F001CC321 /* Resources */ = {
+ 15A5A2180D5B94190087BDA0 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 15A5A2190D5B94190087BDA0 /* Localizable.strings in Resources */,
+ 15A5A21A0D5B94190087BDA0 /* NetworkInterface.strings in Resources */,
+ 15A5A21B0D5B94190087BDA0 /* NetworkConfiguration.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
- F95B8A6B0B03F9D100993BA3 /* Resources */ = {
+ 15DAD66807591A1A0084A6ED /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 15A6F7C40A4B266D00B907EA /* Localizable.strings in Resources */,
+ 15DAD66B07591A1A0084A6ED /* NetworkInterface.strings in Resources */,
+ 15DAD66907591A1A0084A6ED /* NetworkConfiguration.plist in Resources */,
+ 15DAD66A07591A1A0084A6ED /* get-mobility-info in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXRezBuildPhase section */
- 1547001C08455B98006787CE /* Rez */ = {
- isa = PBXRezBuildPhase;
+ 15FD71010754D627001CC321 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 158ADD190754F1F100124717 /* Kicker.xml in Resources */,
+ 158ADD1B0754F1F400124717 /* enable-network in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 15FD72940754DA2B001CC321 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
- 155847670754FDCD0046C2E9 /* Rez */ = {
- isa = PBXRezBuildPhase;
+ 15FD72A20754DA4C001CC321 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
- 1558481A07550EC10046C2E9 /* Rez */ = {
- isa = PBXRezBuildPhase;
+ 15FD72B20754DA69001CC321 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
- 159D54D407529FFF004F8947 /* Rez */ = {
- isa = PBXRezBuildPhase;
+ 15FD72C60754DA7E001CC321 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
- 15DAD5EA075913CE0084A6ED /* Rez */ = {
- isa = PBXRezBuildPhase;
+ 15FD731F0754DB9F001CC321 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
- 15DAD6AF07591A1A0084A6ED /* Rez */ = {
- isa = PBXRezBuildPhase;
+ F95B8A6B0B03F9D100993BA3 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
-/* End PBXRezBuildPhase section */
+/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
151F63DB09328A3C0096DCC9 /* ShellScript */ = {
shellPath = /bin/sh;
shellScript = "echo ${BUILT_PRODUCTS_DIR}\ncc -o ${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME} ${SRCROOT}/SystemConfiguration.fproj/genSCPreferences.c || exit 1\n${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME} header > ${BUILT_PRODUCTS_DIR}/SCSchemaDefinitions.h || exit 1\n${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME} private > ${BUILT_PRODUCTS_DIR}/SCSchemaDefinitionsPrivate.h || exit 1\n${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME} cfile > ${BUILT_PRODUCTS_DIR}/SCSchemaDefinitions.c || exit 1\nexit 0";
};
- 15DAD6AC07591A1A0084A6ED /* SystemConfiguration.order */ = {
+ 153393E40D34999D00FE74E7 /* Update Headers */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
- /usr/local/lib/OrderFiles/SystemConfiguration.order,
+ "$(SRCROOT)/SystemConfiguration.fproj/update-headers",
);
- name = SystemConfiguration.order;
+ name = "Update Headers";
outputPaths = (
- "${OBJROOT}/SystemConfiguration.order",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "if [ -r /usr/local/lib/OrderFiles/SystemConfiguration.order ]; then\n\tcp /usr/local/lib/OrderFiles/SystemConfiguration.order ${OBJROOT}/SystemConfiguration.order\nelse\n\ttouch ${OBJROOT}/SystemConfiguration.order\nfi";
+ shellScript = "if [ -x ${SCRIPT_INPUT_FILE_0} ]; then\n\t${SCRIPT_INPUT_FILE_0} split\nfi\n";
+ showEnvVarsInLog = 0;
};
- 15DAD6B007591A1A0084A6ED /* get-mobility-info */ = {
+ 1572C5270CFB55B400E2776E /* get-mobility-info */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 8;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
shellPath = /bin/sh;
- shellScript = "mkdir -p \"${DSTROOT}/usr/local/bin\"\nln -fs \"${INSTALL_PATH}/${TARGET_NAME}/Resources/get-mobility-info\" \"${DSTROOT}/usr/local/bin/\"\n";
+ shellScript = "mkdir -p \"${DSTROOT}/usr/local/bin\"\nln -fs \"${INSTALL_PATH}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/get-mobility-info\" \"${DSTROOT}/usr/local/bin/\"\n";
+ showEnvVarsInLog = 0;
+ };
+ 15A5A2170D5B94190087BDA0 /* Update Headers */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "$(SRCROOT)/SystemConfiguration.fproj/update-headers",
+ );
+ name = "Update Headers";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "if [ -x ${SCRIPT_INPUT_FILE_0} ]; then\n\t${SCRIPT_INPUT_FILE_0} split\nfi\n";
+ showEnvVarsInLog = 0;
+ };
+ 15AC82480D376E2400A579D0 /* Update Headers */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ "$(SRCROOT)/SystemConfiguration.fproj/update-headers",
+ );
+ name = "Update Headers";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "if [ -x ${SCRIPT_INPUT_FILE_0} ]; then\n\t${SCRIPT_INPUT_FILE_0} clean\nfi\n";
+ showEnvVarsInLog = 0;
+ };
+ 15BED7930F6853F800016614 /* OLD libdnsinfo.a */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 8;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "OLD libdnsinfo.a";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ shellPath = /bin/sh;
+ shellScript = "if [ -f \"${INSTALL_DIR}/libdnsinfo.a\" ]; then\n\tln -f \"${INSTALL_DIR}/libdnsinfo.a\" \"${INSTALL_DIR}/../libdnsinfo.a\"\nfi";
+ showEnvVarsInLog = 0;
+ };
+ 15BED7A20F68551200016614 /* OLD libdnsinfo.a */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 8;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "OLD libdnsinfo.a";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ shellPath = /bin/sh;
+ shellScript = "if [ -f \"${INSTALL_DIR}/libdnsinfo.a\" ]; then\n\tln -f \"${INSTALL_DIR}/libdnsinfo.a\" \"${INSTALL_DIR}/../libdnsinfo.a\"\nfi";
+ showEnvVarsInLog = 0;
+ };
+ 15DAD6AC07591A1A0084A6ED /* SystemConfiguration.order */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ /usr/local/lib/OrderFiles/SystemConfiguration.order,
+ );
+ name = SystemConfiguration.order;
+ outputPaths = (
+ "${OBJROOT}/SystemConfiguration.order",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "if [ -r /usr/local/lib/OrderFiles/SystemConfiguration.order ]; then\n\tcp /usr/local/lib/OrderFiles/SystemConfiguration.order ${OBJROOT}/SystemConfiguration.order\nelse\n\ttouch ${OBJROOT}/SystemConfiguration.order\nfi";
+ showEnvVarsInLog = 0;
};
- 15DAD6B107591A1A0084A6ED /* preferences.plist */ = {
+ 15DAD6B007591A1A0084A6ED /* get-mobility-info */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 8;
files = (
);
inputPaths = (
- preferences.xml,
);
- name = preferences.plist;
+ name = "get-mobility-info";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 1;
shellPath = /bin/sh;
- shellScript = "PREFS_DIR=\"/Library/Preferences/SystemConfiguration\"\nmkdir -p ${DSTROOT}${PREFS_DIR}\nchmod 755 ${DSTROOT}${PREFS_DIR}\n#install -c -m 644 preferences.xml ${DSTROOT}${PREFS_DIR}/preferences.plist";
+ shellScript = "mkdir -p \"${DSTROOT}/usr/local/bin\"\nln -fs \"${INSTALL_PATH}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/get-mobility-info\" \"${DSTROOT}/usr/local/bin/\"\n";
+ showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
);
runOnlyForDeploymentPostprocessing = 0;
};
+ 15213FF70E93E9F500DACD2C /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 152140020E93EC6500DACD2C /* logger.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
1547001A08455B98006787CE /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
);
runOnlyForDeploymentPostprocessing = 0;
};
- 159D53D107528BDA004F8947 /* Sources */ = {
+ 156CA47A0EF853BB00C59A18 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 159D540907528D3A004F8947 /* cache.c in Sources */,
- 159D540B07528DA9004F8947 /* ev_appletalk.c in Sources */,
- 159D540D07528DAE004F8947 /* ev_dlil.c in Sources */,
- 159D540F07528DB0004F8947 /* ev_ipv4.c in Sources */,
- 159D541107528DB2004F8947 /* ev_ipv6.c in Sources */,
- 159D541307528DB5004F8947 /* eventmon.c in Sources */,
+ 156CA47B0EF853BB00C59A18 /* logger.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 1572C4DE0CFB55B400E2776E /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1572C4DF0CFB55B400E2776E /* SCSchemaDefinitions.c in Sources */,
+ 1572C4E00CFB55B400E2776E /* SCD.c in Sources */,
+ 1572C4E10CFB55B400E2776E /* SCDKeys.c in Sources */,
+ 1572C4E20CFB55B400E2776E /* SCDPrivate.c in Sources */,
+ 1572C4E30CFB55B400E2776E /* SCDPlugin.c in Sources */,
+ 1572C4E40CFB55B400E2776E /* SCDOpen.c in Sources */,
+ 1572C4E50CFB55B400E2776E /* SCDLock.c in Sources */,
+ 1572C4E60CFB55B400E2776E /* SCDUnlock.c in Sources */,
+ 1572C4E70CFB55B400E2776E /* SCDList.c in Sources */,
+ 1572C4E80CFB55B400E2776E /* SCDAdd.c in Sources */,
+ 1572C4E90CFB55B400E2776E /* SCDGet.c in Sources */,
+ 1572C4EA0CFB55B400E2776E /* SCDSet.c in Sources */,
+ 1572C4EB0CFB55B400E2776E /* SCDRemove.c in Sources */,
+ 1572C4EC0CFB55B400E2776E /* SCDTouch.c in Sources */,
+ 1572C4ED0CFB55B400E2776E /* SCDNotify.c in Sources */,
+ 1572C4EE0CFB55B400E2776E /* SCDNotifierSetKeys.c in Sources */,
+ 1572C4EF0CFB55B400E2776E /* SCDNotifierAdd.c in Sources */,
+ 1572C4F00CFB55B400E2776E /* SCDNotifierRemove.c in Sources */,
+ 1572C4F10CFB55B400E2776E /* SCDNotifierGetChanges.c in Sources */,
+ 1572C4F20CFB55B400E2776E /* SCDNotifierWait.c in Sources */,
+ 1572C4F30CFB55B400E2776E /* SCDNotifierInformViaCallback.c in Sources */,
+ 1572C4F40CFB55B400E2776E /* SCDNotifierInformViaMachPort.c in Sources */,
+ 1572C4F50CFB55B400E2776E /* SCDNotifierInformViaFD.c in Sources */,
+ 1572C4F60CFB55B400E2776E /* SCDNotifierInformViaSignal.c in Sources */,
+ 1572C4F70CFB55B400E2776E /* SCDNotifierCancel.c in Sources */,
+ 1572C4F80CFB55B400E2776E /* SCDSnapshot.c in Sources */,
+ 1572C4F90CFB55B400E2776E /* SCP.c in Sources */,
+ 1572C4FA0CFB55B400E2776E /* SCPOpen.c in Sources */,
+ 1572C4FB0CFB55B400E2776E /* SCPLock.c in Sources */,
+ 1572C4FC0CFB55B400E2776E /* SCPUnlock.c in Sources */,
+ 1572C4FD0CFB55B400E2776E /* SCPList.c in Sources */,
+ 1572C4FE0CFB55B400E2776E /* SCPGet.c in Sources */,
+ 1572C4FF0CFB55B400E2776E /* SCPAdd.c in Sources */,
+ 1572C5000CFB55B400E2776E /* SCPSet.c in Sources */,
+ 1572C5010CFB55B400E2776E /* SCPRemove.c in Sources */,
+ 1572C5020CFB55B400E2776E /* SCPCommit.c in Sources */,
+ 1572C5030CFB55B400E2776E /* SCPApply.c in Sources */,
+ 1572C5040CFB55B400E2776E /* SCPPath.c in Sources */,
+ 1572C5060CFB55B400E2776E /* SCDHostName.c in Sources */,
+ 1572C5070CFB55B400E2776E /* SCLocation.c in Sources */,
+ 1572C5080CFB55B400E2776E /* SCNetwork.c in Sources */,
+ 1572C5090CFB55B400E2776E /* pppcontroller.defs in Sources */,
+ 1572C50A0CFB55B400E2776E /* SCNetworkConnection.c in Sources */,
+ 1572C50B0CFB55B400E2776E /* SCNetworkConnectionPrivate.c in Sources */,
+ 1572C50C0CFB55B400E2776E /* SCNetworkReachability.c in Sources */,
+ 1572C50D0CFB55B400E2776E /* SCProxies.c in Sources */,
+ 1572C50E0CFB55B400E2776E /* DHCP.c in Sources */,
+ 1572C50F0CFB55B400E2776E /* moh.c in Sources */,
+ 1572C5100CFB55B400E2776E /* DeviceOnHold.c in Sources */,
+ 1572C5110CFB55B400E2776E /* LinkConfiguration.c in Sources */,
+ 1572C5120CFB55B400E2776E /* dy_framework.c in Sources */,
+ 1572C5140CFB55B400E2776E /* config.defs in Sources */,
+ 1572C5150CFB55B400E2776E /* SCPreferencesPathKey.c in Sources */,
+ 1572C5160CFB55B400E2776E /* dnsinfo_private.c in Sources */,
+ 1572C5170CFB55B400E2776E /* dnsinfo_copy.c in Sources */,
+ 1572C5180CFB55B400E2776E /* shared_dns_info.defs in Sources */,
+ 1572C5190CFB55B400E2776E /* SCNetworkConfigurationInternal.c in Sources */,
+ 1572C51A0CFB55B400E2776E /* SCNetworkInterface.c in Sources */,
+ 1572C51B0CFB55B400E2776E /* SCNetworkProtocol.c in Sources */,
+ 1572C51C0CFB55B400E2776E /* SCNetworkService.c in Sources */,
+ 1572C51D0CFB55B400E2776E /* SCNetworkSet.c in Sources */,
+ 1572C51F0CFB55B400E2776E /* helper_comm.c in Sources */,
+ 1572C5200CFB55B400E2776E /* SCHelper_client.c in Sources */,
+ 1572C5210CFB55B400E2776E /* SCPreferencesKeychainPrivate.c in Sources */,
+ 1572C5220CFB55B400E2776E /* SCNetworkSignature.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 157433DF0D4A8122002ACA73 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 157433E00D4A8122002ACA73 /* scselect.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 157433FF0D4A8137002ACA73 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 157434000D4A8137002ACA73 /* scutil.c in Sources */,
+ 157434010D4A8137002ACA73 /* commands.c in Sources */,
+ 157434020D4A8137002ACA73 /* dictionary.c in Sources */,
+ 157434030D4A8137002ACA73 /* session.c in Sources */,
+ 157434040D4A8137002ACA73 /* cache.c in Sources */,
+ 157434050D4A8137002ACA73 /* notifications.c in Sources */,
+ 157434060D4A8137002ACA73 /* tests.c in Sources */,
+ 157434070D4A8137002ACA73 /* prefs.c in Sources */,
+ 157434080D4A8137002ACA73 /* net.c in Sources */,
+ 157434090D4A8137002ACA73 /* net_interface.c in Sources */,
+ 1574340A0D4A8137002ACA73 /* net_protocol.c in Sources */,
+ 1574340B0D4A8137002ACA73 /* net_service.c in Sources */,
+ 1574340C0D4A8137002ACA73 /* net_set.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 157A84DD0D56C63900B6F1A0 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 157A84DE0D56C63900B6F1A0 /* shared_dns_info.defs in Sources */,
+ 157A84DF0D56C63900B6F1A0 /* dnsinfo_copy.c in Sources */,
+ 157A84E00D56C63900B6F1A0 /* dnsinfo_private.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 157A84F90D56C7E800B6F1A0 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 155281020E3E4A0F00C54315 /* ip_plugin.c in Sources */,
+ 157A84FB0D56C7E800B6F1A0 /* dns-configuration.c in Sources */,
+ 157A84FC0D56C7E800B6F1A0 /* set-hostname.c in Sources */,
+ 15D48EC10F67061F00B4711E /* dnsinfo_create.c in Sources */,
+ 15D48ED40F6707A600B4711E /* shared_dns_info.defs in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 157A85070D56C8AA00B6F1A0 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 157A85080D56C8AA00B6F1A0 /* ifnamer.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 157A85180D56C8E000B6F1A0 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 157A85190D56C8E000B6F1A0 /* cache.c in Sources */,
+ 157A851B0D56C8E000B6F1A0 /* ev_dlil.c in Sources */,
+ 157A851C0D56C8E000B6F1A0 /* ev_ipv4.c in Sources */,
+ 157A851D0D56C8E000B6F1A0 /* ev_ipv6.c in Sources */,
+ 157A851E0D56C8E000B6F1A0 /* eventmon.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 157A85280D56C91100B6F1A0 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 157A85290D56C91100B6F1A0 /* linkconfig.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 157A85330D56C94F00B6F1A0 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 157A85340D56C94F00B6F1A0 /* NetworkIdentification.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 157A853E0D56C96F00B6F1A0 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 157A853F0D56C96F00B6F1A0 /* prefsmon.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 1583172C0CFB80A1006F62B9 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1583172D0CFB80A1006F62B9 /* configd.m in Sources */,
+ 1583172E0CFB80A1006F62B9 /* _SCD.c in Sources */,
+ 1583172F0CFB80A1006F62B9 /* configd_server.c in Sources */,
+ 158317300CFB80A1006F62B9 /* notify_server.c in Sources */,
+ 158317310CFB80A1006F62B9 /* plugin_support.c in Sources */,
+ 158317320CFB80A1006F62B9 /* session.c in Sources */,
+ 158317330CFB80A1006F62B9 /* pattern.c in Sources */,
+ 158317340CFB80A1006F62B9 /* _configopen.c in Sources */,
+ 158317350CFB80A1006F62B9 /* _configclose.c in Sources */,
+ 158317360CFB80A1006F62B9 /* _configlock.c in Sources */,
+ 158317370CFB80A1006F62B9 /* _configunlock.c in Sources */,
+ 158317380CFB80A1006F62B9 /* _configlist.c in Sources */,
+ 158317390CFB80A1006F62B9 /* _configadd.c in Sources */,
+ 1583173A0CFB80A1006F62B9 /* _configget.c in Sources */,
+ 1583173B0CFB80A1006F62B9 /* _configset.c in Sources */,
+ 1583173C0CFB80A1006F62B9 /* _configremove.c in Sources */,
+ 1583173D0CFB80A1006F62B9 /* _configtouch.c in Sources */,
+ 1583173E0CFB80A1006F62B9 /* _confignotify.c in Sources */,
+ 1583173F0CFB80A1006F62B9 /* _notifyadd.c in Sources */,
+ 158317400CFB80A1006F62B9 /* _notifyremove.c in Sources */,
+ 158317410CFB80A1006F62B9 /* _notifychanges.c in Sources */,
+ 158317420CFB80A1006F62B9 /* _notifyviaport.c in Sources */,
+ 158317430CFB80A1006F62B9 /* _notifyviafd.c in Sources */,
+ 158317440CFB80A1006F62B9 /* _notifyviasignal.c in Sources */,
+ 158317450CFB80A1006F62B9 /* _notifycancel.c in Sources */,
+ 158317460CFB80A1006F62B9 /* _snapshot.c in Sources */,
+ 158317470CFB80A1006F62B9 /* config.defs in Sources */,
+ 158317480CFB80A1006F62B9 /* dnsinfo_private.c in Sources */,
+ 158317490CFB80A1006F62B9 /* dnsinfo_server.c in Sources */,
+ 1583174A0CFB80A1006F62B9 /* shared_dns_info.defs in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 1583379D0CFB6B9E0033AB93 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1583379E0CFB6B9E0033AB93 /* SCHelper_server.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 159C9B2C0DB68E2600BEEF10 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 159C9B290DB68E0700BEEF10 /* atconfig.c in Sources */,
+ 159C9B2A0DB68E0800BEEF10 /* cfManager.c in Sources */,
+ 159C9B2D0DB68E3D00BEEF10 /* cache.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 159C9B840DB68F0300BEEF10 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 159C9B820DB68EE500BEEF10 /* kicker.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
- 159D53DB07528C2E004F8947 /* Sources */ = {
+ 159D53D107528BDA004F8947 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 159D541507528DDE004F8947 /* kicker.c in Sources */,
+ 159D540907528D3A004F8947 /* cache.c in Sources */,
+ 159D540D07528DAE004F8947 /* ev_dlil.c in Sources */,
+ 159D540F07528DB0004F8947 /* ev_ipv4.c in Sources */,
+ 159D541107528DB2004F8947 /* ev_ipv6.c in Sources */,
+ 159D541307528DB5004F8947 /* eventmon.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
159D541807528E09004F8947 /* dns-configuration.c in Sources */,
154361E00752C81800A8EC6C /* set-hostname.c in Sources */,
1572EB7B0A506D3B00D02459 /* smb-configuration.c in Sources */,
+ 15D48EBF0F67061600B4711E /* dnsinfo_create.c in Sources */,
+ 15D48ED30F67079B00B4711E /* shared_dns_info.defs in Sources */,
+ 1522FCFB0FA7FE4B00B24128 /* dnsinfo_flatfile.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
);
runOnlyForDeploymentPostprocessing = 0;
};
+ 15A5A21D0D5B94190087BDA0 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 15A5A21E0D5B94190087BDA0 /* SCSchemaDefinitions.c in Sources */,
+ 15A5A21F0D5B94190087BDA0 /* SCD.c in Sources */,
+ 15A5A2200D5B94190087BDA0 /* SCDKeys.c in Sources */,
+ 15A5A2210D5B94190087BDA0 /* SCDPrivate.c in Sources */,
+ 15A5A2220D5B94190087BDA0 /* SCDPlugin.c in Sources */,
+ 15A5A2230D5B94190087BDA0 /* SCDOpen.c in Sources */,
+ 15A5A2240D5B94190087BDA0 /* SCDLock.c in Sources */,
+ 15A5A2250D5B94190087BDA0 /* SCDUnlock.c in Sources */,
+ 15A5A2260D5B94190087BDA0 /* SCDList.c in Sources */,
+ 15A5A2270D5B94190087BDA0 /* SCDAdd.c in Sources */,
+ 15A5A2280D5B94190087BDA0 /* SCDGet.c in Sources */,
+ 15A5A2290D5B94190087BDA0 /* SCDSet.c in Sources */,
+ 15A5A22A0D5B94190087BDA0 /* SCDRemove.c in Sources */,
+ 15A5A22B0D5B94190087BDA0 /* SCDTouch.c in Sources */,
+ 15A5A22C0D5B94190087BDA0 /* SCDNotify.c in Sources */,
+ 15A5A22D0D5B94190087BDA0 /* SCDNotifierSetKeys.c in Sources */,
+ 15A5A22E0D5B94190087BDA0 /* SCDNotifierAdd.c in Sources */,
+ 15A5A22F0D5B94190087BDA0 /* SCDNotifierRemove.c in Sources */,
+ 15A5A2300D5B94190087BDA0 /* SCDNotifierGetChanges.c in Sources */,
+ 15A5A2310D5B94190087BDA0 /* SCDNotifierWait.c in Sources */,
+ 15A5A2320D5B94190087BDA0 /* SCDNotifierInformViaCallback.c in Sources */,
+ 15A5A2330D5B94190087BDA0 /* SCDNotifierInformViaMachPort.c in Sources */,
+ 15A5A2340D5B94190087BDA0 /* SCDNotifierInformViaFD.c in Sources */,
+ 15A5A2350D5B94190087BDA0 /* SCDNotifierInformViaSignal.c in Sources */,
+ 15A5A2360D5B94190087BDA0 /* SCDNotifierCancel.c in Sources */,
+ 15A5A2370D5B94190087BDA0 /* SCDSnapshot.c in Sources */,
+ 15A5A2380D5B94190087BDA0 /* SCP.c in Sources */,
+ 15A5A2390D5B94190087BDA0 /* SCPOpen.c in Sources */,
+ 15A5A23A0D5B94190087BDA0 /* SCPLock.c in Sources */,
+ 15A5A23B0D5B94190087BDA0 /* SCPUnlock.c in Sources */,
+ 15A5A23C0D5B94190087BDA0 /* SCPList.c in Sources */,
+ 15A5A23D0D5B94190087BDA0 /* SCPGet.c in Sources */,
+ 15A5A23E0D5B94190087BDA0 /* SCPAdd.c in Sources */,
+ 15A5A23F0D5B94190087BDA0 /* SCPSet.c in Sources */,
+ 15A5A2400D5B94190087BDA0 /* SCPRemove.c in Sources */,
+ 15A5A2410D5B94190087BDA0 /* SCPCommit.c in Sources */,
+ 15A5A2420D5B94190087BDA0 /* SCPApply.c in Sources */,
+ 15A5A2430D5B94190087BDA0 /* SCPPath.c in Sources */,
+ 15A5A2450D5B94190087BDA0 /* SCDHostName.c in Sources */,
+ 15A5A2460D5B94190087BDA0 /* SCLocation.c in Sources */,
+ 15A5A2470D5B94190087BDA0 /* SCNetwork.c in Sources */,
+ 15A5A2480D5B94190087BDA0 /* pppcontroller.defs in Sources */,
+ 15A5A2490D5B94190087BDA0 /* SCNetworkConnection.c in Sources */,
+ 15A5A24A0D5B94190087BDA0 /* SCNetworkConnectionPrivate.c in Sources */,
+ 15A5A24B0D5B94190087BDA0 /* SCNetworkReachability.c in Sources */,
+ 15A5A24C0D5B94190087BDA0 /* SCProxies.c in Sources */,
+ 15A5A24D0D5B94190087BDA0 /* DHCP.c in Sources */,
+ 15A5A24E0D5B94190087BDA0 /* moh.c in Sources */,
+ 15A5A24F0D5B94190087BDA0 /* DeviceOnHold.c in Sources */,
+ 15A5A2500D5B94190087BDA0 /* LinkConfiguration.c in Sources */,
+ 15A5A2510D5B94190087BDA0 /* dy_framework.c in Sources */,
+ 15A5A2530D5B94190087BDA0 /* config.defs in Sources */,
+ 15A5A2540D5B94190087BDA0 /* SCPreferencesPathKey.c in Sources */,
+ 15A5A2550D5B94190087BDA0 /* dnsinfo_private.c in Sources */,
+ 15A5A2560D5B94190087BDA0 /* dnsinfo_copy.c in Sources */,
+ 15A5A2570D5B94190087BDA0 /* shared_dns_info.defs in Sources */,
+ 15A5A2580D5B94190087BDA0 /* SCNetworkConfigurationInternal.c in Sources */,
+ 15A5A2590D5B94190087BDA0 /* SCNetworkInterface.c in Sources */,
+ 15A5A25A0D5B94190087BDA0 /* SCNetworkProtocol.c in Sources */,
+ 15A5A25B0D5B94190087BDA0 /* SCNetworkService.c in Sources */,
+ 15A5A25C0D5B94190087BDA0 /* SCNetworkSet.c in Sources */,
+ 15A5A25E0D5B94190087BDA0 /* helper_comm.c in Sources */,
+ 15A5A25F0D5B94190087BDA0 /* SCHelper_client.c in Sources */,
+ 15A5A2600D5B94190087BDA0 /* SCPreferencesKeychainPrivate.c in Sources */,
+ 15A5A2610D5B94190087BDA0 /* SCNetworkSignature.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
15DAD5E4075913CE0084A6ED /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
15DAD5E5075913CE0084A6ED /* shared_dns_info.defs in Sources */,
15DAD5E6075913CE0084A6ED /* dnsinfo_copy.c in Sources */,
15DAD5E7075913CE0084A6ED /* dnsinfo_private.c in Sources */,
- 15DAD5E8075913CE0084A6ED /* dnsinfo_create.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
);
runOnlyForDeploymentPostprocessing = 0;
};
- 15FD733D0754DBDA001CC321 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 1508E39F07552B6A0062B350 /* atconfig.c in Sources */,
- 1508E3A007552B6B0062B350 /* cfManager.c in Sources */,
- 1508E3A107552B720062B350 /* cache.c in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
F95B8A5C0B03F81400993BA3 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
- 150ECB3C0D0079280065E94D /* PBXTargetDependency */ = {
+ 150ECB300D0042DA0065E94D /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 151F5D990CCE98E50093AC3B /* SCMonitor */;
- targetProxy = 150ECB3B0D0079280065E94D /* PBXContainerItemProxy */;
+ targetProxy = 150ECB2F0D0042DA0065E94D /* PBXContainerItemProxy */;
+ };
+ 151FE37A0D5B713C000D6DB1 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 151FE2DD0D5B7046000D6DB1 /* configd_base-EmbeddedSimulator */;
+ targetProxy = 151FE3790D5B713C000D6DB1 /* PBXContainerItemProxy */;
};
1520A386084681350010B584 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 1547001808455B98006787CE /* SCHelper */;
targetProxy = 1520A385084681350010B584 /* PBXContainerItemProxy */;
};
- 1533B94109731A9600F2B34A /* PBXTargetDependency */ = {
+ 1521405B0E9400BF00DACD2C /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
- target = 15FD733A0754DBDA001CC321 /* ATconfig */;
- targetProxy = 1533B94009731A9600F2B34A /* PBXContainerItemProxy */;
+ target = 15213FF90E93E9F500DACD2C /* Logger.bundle */;
+ targetProxy = 1521405A0E9400BF00DACD2C /* PBXContainerItemProxy */;
};
1558480607550D470046C2E9 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 155847FA07550D210046C2E9 /* configd_executables */;
targetProxy = 1558480E07550DD00046C2E9 /* PBXContainerItemProxy */;
};
- 157BB8C0075924460025DA7A /* PBXTargetDependency */ = {
+ 156CA4A80EF8550800C59A18 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
- target = 15DAD63F07591A1A0084A6ED /* SystemConfiguration.framework */;
- targetProxy = 157BB8BF075924460025DA7A /* PBXContainerItemProxy */;
+ target = 156CA4790EF853BB00C59A18 /* Logger.bundle-Embedded */;
+ targetProxy = 156CA4A70EF8550800C59A18 /* PBXContainerItemProxy */;
};
- 157BB8C2075924470025DA7A /* PBXTargetDependency */ = {
+ 1574341F0D4A815E002ACA73 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
- target = 15DAD5DF075913CE0084A6ED /* DNSConfiguration */;
- targetProxy = 157BB8C1075924470025DA7A /* PBXContainerItemProxy */;
+ target = 157433F00D4A8137002ACA73 /* scutil-Embedded */;
+ targetProxy = 1574341E0D4A815E002ACA73 /* PBXContainerItemProxy */;
+ };
+ 157434210D4A8166002ACA73 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 157433DD0D4A8122002ACA73 /* scselect-Embedded */;
+ targetProxy = 157434200D4A8166002ACA73 /* PBXContainerItemProxy */;
+ };
+ 157A85480D56CA0B00B6F1A0 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 157A84F40D56C7E800B6F1A0 /* IPMonitor-Embedded */;
+ targetProxy = 157A85470D56CA0B00B6F1A0 /* PBXContainerItemProxy */;
+ };
+ 157A854A0D56CA2300B6F1A0 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 157A85050D56C8AA00B6F1A0 /* InterfaceNamer-Embedded */;
+ targetProxy = 157A85490D56CA2300B6F1A0 /* PBXContainerItemProxy */;
+ };
+ 157A854C0D56CA5100B6F1A0 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 157A85100D56C8E000B6F1A0 /* KernelEventMonitor-Embedded */;
+ targetProxy = 157A854B0D56CA5100B6F1A0 /* PBXContainerItemProxy */;
+ };
+ 157A854E0D56CA6F00B6F1A0 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 157A85260D56C91100B6F1A0 /* LinkConfiguration-Embedded */;
+ targetProxy = 157A854D0D56CA6F00B6F1A0 /* PBXContainerItemProxy */;
+ };
+ 157A85500D56CA8800B6F1A0 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 157A85310D56C94F00B6F1A0 /* NetworkIdentification-Embedded */;
+ targetProxy = 157A854F0D56CA8800B6F1A0 /* PBXContainerItemProxy */;
+ };
+ 157A85520D56CA9E00B6F1A0 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 157A853C0D56C96F00B6F1A0 /* PreferencesMonitor-Embedded */;
+ targetProxy = 157A85510D56CA9E00B6F1A0 /* PBXContainerItemProxy */;
+ };
+ 157A85540D56CACA00B6F1A0 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 158317A80CFB8639006F62B9 /* PreferencesMonitor.bundle-Embedded */;
+ targetProxy = 157A85530D56CACA00B6F1A0 /* PBXContainerItemProxy */;
+ };
+ 157BB8C0075924460025DA7A /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 15DAD63F07591A1A0084A6ED /* SystemConfiguration.framework */;
+ targetProxy = 157BB8BF075924460025DA7A /* PBXContainerItemProxy */;
};
157BB8C40759244B0025DA7A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 15828AE60753B5F900AD4710 /* KernelEventMonitor.bundle */;
targetProxy = 15828B060753B77E00AD4710 /* PBXContainerItemProxy */;
};
+ 158317100CFB77D1006F62B9 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 158316CF0CFB774B006F62B9 /* configd_base-Embedded */;
+ targetProxy = 1583170F0CFB77D1006F62B9 /* PBXContainerItemProxy */;
+ };
+ 158317120CFB77E1006F62B9 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 1572C4A60CFB55B400E2776E /* SystemConfiguration.framework-Embedded */;
+ targetProxy = 158317110CFB77E1006F62B9 /* PBXContainerItemProxy */;
+ };
+ 158317140CFB77E8006F62B9 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 158337990CFB6B9E0033AB93 /* SCHelper-Embedded */;
+ targetProxy = 158317130CFB77E8006F62B9 /* PBXContainerItemProxy */;
+ };
+ 158317160CFB783B006F62B9 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 158316E30CFB7761006F62B9 /* configd_plugins-Embedded */;
+ targetProxy = 158317150CFB783B006F62B9 /* PBXContainerItemProxy */;
+ };
+ 158317180CFB784D006F62B9 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 158317040CFB7782006F62B9 /* configd_executables-Embedded */;
+ targetProxy = 158317170CFB784D006F62B9 /* PBXContainerItemProxy */;
+ };
+ 158317660CFB80D5006F62B9 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 158317230CFB80A1006F62B9 /* configd-Embedded */;
+ targetProxy = 158317650CFB80D5006F62B9 /* PBXContainerItemProxy */;
+ };
+ 158317B30CFB8660006F62B9 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 158317A00CFB8626006F62B9 /* NetworkIdentification.bundle-Embedded */;
+ targetProxy = 158317B20CFB8660006F62B9 /* PBXContainerItemProxy */;
+ };
+ 158317B50CFB8660006F62B9 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 158317980CFB860C006F62B9 /* LinkConfiguration.bundle-Embedded */;
+ targetProxy = 158317B40CFB8660006F62B9 /* PBXContainerItemProxy */;
+ };
+ 158317B70CFB8660006F62B9 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 158317900CFB85F7006F62B9 /* KernelEventMonitor.bundle-Embedded */;
+ targetProxy = 158317B60CFB8660006F62B9 /* PBXContainerItemProxy */;
+ };
+ 158317B90CFB8660006F62B9 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 158317870CFB85DD006F62B9 /* InterfaceNamer.bundle-Embedded */;
+ targetProxy = 158317B80CFB8660006F62B9 /* PBXContainerItemProxy */;
+ };
+ 158317BB0CFB8660006F62B9 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 1583177D0CFB85C8006F62B9 /* IPMonitor.bundle-Embedded */;
+ targetProxy = 158317BA0CFB8660006F62B9 /* PBXContainerItemProxy */;
+ };
158AD9860754E72500124717 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 15FD72A10754DA4C001CC321 /* IPMonitor.bundle */;
target = 159D542007528E7C004F8947 /* configd_plugins */;
targetProxy = 159D542D07529008004F8947 /* PBXContainerItemProxy */;
};
- 15DAD5740759115F0084A6ED /* PBXTargetDependency */ = {
+ 15A5A2710D5B942D0087BDA0 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 15A5A1E40D5B94190087BDA0 /* SystemConfiguration.framework-EmbeddedSimulator */;
+ targetProxy = 15A5A2700D5B942D0087BDA0 /* PBXContainerItemProxy */;
+ };
+ 15C64A220F684C4900D78394 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 15DAD5DF075913CE0084A6ED /* DNSConfiguration */;
+ targetProxy = 15C64A210F684C4900D78394 /* PBXContainerItemProxy */;
+ };
+ 15C64A240F684C5700D78394 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
- target = 15FD731E0754DB9F001CC321 /* ATconfig.bundle */;
- targetProxy = 15DAD5730759115F0084A6ED /* PBXContainerItemProxy */;
+ target = 15C64A1E0F684C3300D78394 /* configd_libSystem */;
+ targetProxy = 15C64A230F684C5700D78394 /* PBXContainerItemProxy */;
+ };
+ 15C64A2F0F684C8300D78394 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 15C64A280F684C6B00D78394 /* configd_libSystem-Embedded */;
+ targetProxy = 15C64A2E0F684C8300D78394 /* PBXContainerItemProxy */;
+ };
+ 15C64A310F684C8F00D78394 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 157A84D80D56C63900B6F1A0 /* DNSConfiguration-Embedded */;
+ targetProxy = 15C64A300F684C8F00D78394 /* PBXContainerItemProxy */;
};
F95B8A770B03FB9100993BA3 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
- 151F5D9C0CCE98E60093AC3B /* Development */ = {
+ 151C1CC70CFB487000C5AFD6 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COPY_PHASE_STRIP = NO;
- FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
- GCC_MODEL_TUNING = G5;
- GCC_OPTIMIZATION_LEVEL = 0;
- INFOPLIST_FILE = "$(SRCROOT)/SCMonitor/Info.plist";
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /System/Library/UserEventPlugins;
- PRODUCT_NAME = SCMonitor;
- WRAPPER_EXTENSION = plugin;
- ZERO_LINK = YES;
+ PRODUCT_NAME = "configd (Aggregate/Embedded)";
};
- name = Development;
+ name = Debug;
};
- 151F5D9D0CCE98E60093AC3B /* Deployment */ = {
+ 151C1CC80CFB487000C5AFD6 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COPY_PHASE_STRIP = YES;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ PRODUCT_NAME = "configd (Aggregate/Embedded)";
+ };
+ name = Release;
+ };
+ 151F5D9C0CCE98E60093AC3B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = "$(RC_ProjectSourceVersion)";
FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- GCC_MODEL_TUNING = G5;
- INFOPLIST_FILE = "$(SRCROOT)/SCMonitor/Info.plist";
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ INFOPLIST_FILE = SCMonitor/Info.plist;
INSTALL_MODE_FLAG = "a-w,a+rX";
INSTALL_PATH = /System/Library/UserEventPlugins;
PRODUCT_NAME = SCMonitor;
WRAPPER_EXTENSION = plugin;
- ZERO_LINK = NO;
};
- name = Deployment;
+ name = Debug;
};
- 151F5D9E0CCE98E60093AC3B /* Default */ = {
+ 151F5D9D0CCE98E60093AC3B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = "$(RC_ProjectSourceVersion)";
FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
- GCC_MODEL_TUNING = G5;
- INFOPLIST_FILE = "$(SRCROOT)/SCMonitor/Info.plist";
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ INFOPLIST_FILE = SCMonitor/Info.plist;
INSTALL_MODE_FLAG = "a-w,a+rX";
INSTALL_PATH = /System/Library/UserEventPlugins;
PRODUCT_NAME = SCMonitor;
- VALID_ARCHS = "i386 ppc";
WRAPPER_EXTENSION = plugin;
- ZERO_LINK = YES;
};
- name = Default;
+ name = Release;
};
- 151F63DD09328A3C0096DCC9 /* Development */ = {
+ 151F63DD09328A3C0096DCC9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
- GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
INSTALLHDRS_SCRIPT_PHASE = YES;
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
PRODUCT_NAME = genSCPreferences;
- SECTORDER_FLAGS = "";
WARNING_CFLAGS = (
"-Wall",
"-Wno-four-char-constants",
"-Wno-unknown-pragmas",
);
};
- name = Development;
+ name = Debug;
};
- 151F63DE09328A3C0096DCC9 /* Deployment */ = {
+ 151F63DE09328A3C0096DCC9 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = YES;
- GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
INSTALLHDRS_SCRIPT_PHASE = YES;
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
PRODUCT_NAME = genSCPreferences;
- SECTORDER_FLAGS = "";
WARNING_CFLAGS = (
"-Wall",
"-Wno-four-char-constants",
"-Wno-unknown-pragmas",
);
};
- name = Deployment;
+ name = Release;
};
- 151F63DF09328A3C0096DCC9 /* Default */ = {
+ 151FE2E50D5B7046000D6DB1 /* Debug */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = 15FD147B0D594FE700F9409C /* IndigoSDK.xcconfig */;
buildSettings = {
- INSTALLHDRS_SCRIPT_PHASE = YES;
- OTHER_CFLAGS = "";
- OTHER_LDFLAGS = "";
- PRODUCT_NAME = genSCPreferences;
- SECTORDER_FLAGS = "";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-four-char-constants",
- "-Wno-unknown-pragmas",
- );
+ PRODUCT_NAME = "configd_base (EmbeddedSimulator)";
};
- name = Default;
+ name = Debug;
};
- 156EB5DB0905594A00EEF749 /* Development */ = {
+ 151FE2E60D5B7046000D6DB1 /* Release */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = 15FD147B0D594FE700F9409C /* IndigoSDK.xcconfig */;
buildSettings = {
- COPY_PHASE_STRIP = NO;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 212.2;
- GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
- INSTALLHDRS_COPY_PHASE = YES;
+ PRODUCT_NAME = "configd_base (EmbeddedSimulator)";
+ };
+ name = Release;
+ };
+ 15213FFC0E93E9F600DACD2C /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = Plugins/Logger/Info.plist;
INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/local/lib;
- LIBRARY_STYLE = STATIC;
- PRODUCT_NAME = dnsinfo;
- SECTORDER_FLAGS = "";
- UNSTRIPPED_PRODUCT = YES;
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
+ PRODUCT_NAME = Logger;
};
- name = Development;
+ name = Debug;
};
- 156EB5DC0905594A00EEF749 /* Deployment */ = {
+ 15213FFD0E93E9F600DACD2C /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COPY_PHASE_STRIP = YES;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 212.2;
- GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
- INSTALLHDRS_COPY_PHASE = YES;
+ INFOPLIST_FILE = Plugins/Logger/Info.plist;
INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/local/lib;
- LIBRARY_STYLE = STATIC;
- PRODUCT_NAME = dnsinfo;
- SECTORDER_FLAGS = "";
- UNSTRIPPED_PRODUCT = YES;
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
+ PRODUCT_NAME = Logger;
};
- name = Deployment;
+ name = Release;
};
- 156EB5DD0905594A00EEF749 /* Default */ = {
+ 156CA4830EF853BB00C59A18 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 212.2;
+ INFOPLIST_FILE = "Plugins/Logger/Info-Embedded.plist";
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
+ PRODUCT_NAME = Logger;
+ };
+ name = Debug;
+ };
+ 156CA4840EF853BB00C59A18 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Plugins/Logger/Info-Embedded.plist";
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
+ PRODUCT_NAME = Logger;
+ };
+ name = Release;
+ };
+ 156EB5DB0905594A00EEF749 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ BUILD_VARIANTS = (
+ normal,
+ debug,
+ profile,
+ );
+ COPY_PHASE_STRIP = NO;
+ GENERATE_PROFILING_CODE_profile = YES;
INSTALLHDRS_COPY_PHASE = YES;
INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/local/lib;
+ INSTALL_PATH = /usr/local/lib/system;
LIBRARY_STYLE = STATIC;
+ OTHER_CFLAGS_debug = "-O0";
+ OTHER_MIGFLAGS = "-DLIBDNSINFO";
PRODUCT_NAME = dnsinfo;
- SECTORDER_FLAGS = "";
- UNSTRIPPED_PRODUCT = YES;
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
+ STRIPFLAGS = "";
+ STRIP_INSTALLED_PRODUCT_debug = NO;
+ STRIP_INSTALLED_PRODUCT_normal = YES;
+ STRIP_INSTALLED_PRODUCT_profile = NO;
};
- name = Default;
+ name = Debug;
};
- 156EB5DF0905594A00EEF749 /* Development */ = {
+ 156EB5DC0905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COPY_PHASE_STRIP = NO;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 212.2;
- FRAMEWORK_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks";
- HEADER_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/PrivateHeaders";
- INFOPLIST_FILE = SystemConfiguration.fproj/Info.plist;
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Frameworks";
- LIBRARY_SEARCH_PATHS = "$(SYMROOT)";
- OTHER_CFLAGS = "-fconstant-cfstrings";
- OTHER_LDFLAGS = (
- "-seg_addr_table",
- "$(APPLE_INTERNAL_DEVELOPER_DIR)/seg_addr_table",
- );
- PRODUCT_NAME = SystemConfiguration;
- SECTORDER_FLAGS = (
- "-sectorder",
- __TEXT,
- __text,
- "$(OBJROOT)/SystemConfiguration.order",
- );
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
+ BUILD_VARIANTS = (
+ normal,
+ debug,
+ profile,
);
- WRAPPER_EXTENSION = framework;
+ GENERATE_PROFILING_CODE_profile = YES;
+ INSTALLHDRS_COPY_PHASE = YES;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = /usr/local/lib/system;
+ LIBRARY_STYLE = STATIC;
+ OTHER_CFLAGS_debug = "-O0";
+ OTHER_CFLAGS_normal = "";
+ OTHER_CFLAGS_profile = "";
+ OTHER_MIGFLAGS = "-DLIBDNSINFO";
+ PRODUCT_NAME = dnsinfo;
+ STRIPFLAGS = "";
+ STRIP_INSTALLED_PRODUCT_debug = NO;
+ STRIP_INSTALLED_PRODUCT_normal = YES;
+ STRIP_INSTALLED_PRODUCT_profile = NO;
};
- name = Development;
+ name = Release;
};
- 156EB5E00905594A00EEF749 /* Deployment */ = {
+ 156EB5DF0905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COPY_PHASE_STRIP = YES;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 212.2;
+ COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks";
HEADER_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/PrivateHeaders";
INFOPLIST_FILE = SystemConfiguration.fproj/Info.plist;
+ INSTALLHDRS_SCRIPT_PHASE = YES;
INSTALL_MODE_FLAG = "a-w,a+rX";
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Frameworks";
LIBRARY_SEARCH_PATHS = "$(SYMROOT)";
- OTHER_CFLAGS = "-fconstant-cfstrings";
- OTHER_LDFLAGS = (
- "-seg_addr_table",
- "$(APPLE_INTERNAL_DEVELOPER_DIR)/seg_addr_table",
- );
PRODUCT_NAME = SystemConfiguration;
SECTORDER_FLAGS = (
"-sectorder",
__text,
"$(OBJROOT)/SystemConfiguration.order",
);
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
WRAPPER_EXTENSION = framework;
};
- name = Deployment;
+ name = Debug;
};
- 156EB5E10905594A00EEF749 /* Default */ = {
+ 156EB5E00905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 212.2;
+ COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks";
HEADER_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/PrivateHeaders";
INFOPLIST_FILE = SystemConfiguration.fproj/Info.plist;
+ INSTALLHDRS_SCRIPT_PHASE = YES;
INSTALL_MODE_FLAG = "a-w,a+rX";
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Frameworks";
LIBRARY_SEARCH_PATHS = "$(SYMROOT)";
- OTHER_CFLAGS = "-fconstant-cfstrings";
- OTHER_LDFLAGS = (
- "-seg_addr_table",
- "$(APPLE_INTERNAL_DEVELOPER_DIR)/seg_addr_table",
- );
PRODUCT_NAME = SystemConfiguration;
SECTORDER_FLAGS = (
"-sectorder",
__text,
"$(OBJROOT)/SystemConfiguration.order",
);
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
WRAPPER_EXTENSION = framework;
};
- name = Default;
+ name = Release;
};
- 156EB5E30905594A00EEF749 /* Development */ = {
+ 156EB5E30905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
- INSTALL_MODE_FLAG = "a-w,a+rX,u+s";
+ INSTALL_MODE_FLAG = "a-w,a+rX";
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Frameworks/SystemConfiguration.framework/Versions/A/Resources";
- OTHER_CFLAGS = "-fconstant-cfstrings";
PRODUCT_NAME = SCHelper;
STRIPFLAGS = "-S";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
};
- name = Development;
+ name = Debug;
};
- 156EB5E40905594A00EEF749 /* Deployment */ = {
+ 156EB5E40905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = YES;
DEAD_CODE_STRIPPING = YES;
FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
- INSTALL_MODE_FLAG = "a-w,a+rX,u+s";
- INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Frameworks/SystemConfiguration.framework/Versions/A/Resources";
- OTHER_CFLAGS = "-fconstant-cfstrings";
- PRODUCT_NAME = SCHelper;
- STRIPFLAGS = "-S";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
- };
- name = Deployment;
- };
- 156EB5E50905594A00EEF749 /* Default */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- DEAD_CODE_STRIPPING = YES;
- FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
- INSTALL_MODE_FLAG = "a-w,a+rX,u+s";
+ INSTALL_MODE_FLAG = "a-w,a+rX";
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Frameworks/SystemConfiguration.framework/Versions/A/Resources";
- OTHER_CFLAGS = "-fconstant-cfstrings";
PRODUCT_NAME = SCHelper;
STRIPFLAGS = "-S";
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
- };
- name = Default;
- };
- 156EB5E70905594A00EEF749 /* Development */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
- PRODUCT_NAME = Frameworks;
- WARNING_CFLAGS = (
- "-Wmost",
- "-Wno-unknown-pragmas",
- );
- };
- name = Development;
- };
- 156EB5E80905594A00EEF749 /* Deployment */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
- PRODUCT_NAME = Frameworks;
- WARNING_CFLAGS = (
- "-Wmost",
- "-Wno-unknown-pragmas",
- );
};
- name = Deployment;
+ name = Release;
};
- 156EB5E90905594A00EEF749 /* Default */ = {
+ 156EB5E70905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- PRODUCT_NAME = Frameworks;
- WARNING_CFLAGS = (
- "-Wmost",
- "-Wno-unknown-pragmas",
- );
+ PRODUCT_NAME = configd_base;
};
- name = Default;
+ name = Debug;
};
- 156EB5EB0905594A00EEF749 /* Development */ = {
+ 156EB5E80905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- INFOPLIST_FILE = Plugins/ATconfig/Info.plist;
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
- PRODUCT_NAME = ATconfig;
+ PRODUCT_NAME = configd_base;
};
- name = Development;
+ name = Release;
};
- 156EB5EC0905594A00EEF749 /* Deployment */ = {
+ 156EB5EB0905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ HEADER_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/PrivateHeaders";
INFOPLIST_FILE = Plugins/ATconfig/Info.plist;
INSTALL_MODE_FLAG = "a-w,a+rX";
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
PRODUCT_NAME = ATconfig;
};
- name = Deployment;
+ name = Debug;
};
- 156EB5ED0905594A00EEF749 /* Default */ = {
+ 156EB5EC0905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ HEADER_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/PrivateHeaders";
INFOPLIST_FILE = Plugins/ATconfig/Info.plist;
INSTALL_MODE_FLAG = "a-w,a+rX";
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
PRODUCT_NAME = ATconfig;
};
- name = Default;
+ name = Release;
};
- 156EB5EF0905594A00EEF749 /* Development */ = {
+ 156EB5EF0905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
INSTALL_MODE_FLAG = "a-w,a+rX";
INSTALL_PATH = /usr/local/lib/SystemConfiguration;
LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
PRODUCT_NAME = IPMonitor;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
};
- name = Development;
+ name = Debug;
};
- 156EB5F00905594A00EEF749 /* Deployment */ = {
+ 156EB5F00905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = YES;
INSTALL_MODE_FLAG = "a-w,a+rX";
INSTALL_PATH = /usr/local/lib/SystemConfiguration;
LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- PRODUCT_NAME = IPMonitor;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
- };
- name = Deployment;
- };
- 156EB5F10905594A00EEF749 /* Default */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/local/lib/SystemConfiguration;
- LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- PRODUCT_NAME = IPMonitor;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
- };
- name = Default;
- };
- 156EB5F30905594A00EEF749 /* Development */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- INFOPLIST_FILE = Plugins/IPMonitor/Info.plist;
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
PRODUCT_NAME = IPMonitor;
};
- name = Development;
+ name = Release;
};
- 156EB5F40905594A00EEF749 /* Deployment */ = {
+ 156EB5F30905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Plugins/IPMonitor/Info.plist;
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
PRODUCT_NAME = IPMonitor;
};
- name = Deployment;
+ name = Debug;
};
- 156EB5F50905594A00EEF749 /* Default */ = {
+ 156EB5F40905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Plugins/IPMonitor/Info.plist;
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
PRODUCT_NAME = IPMonitor;
};
- name = Default;
+ name = Release;
};
- 156EB5F70905594A00EEF749 /* Development */ = {
+ 156EB5F70905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
INSTALL_MODE_FLAG = "a-w,a+rX";
INSTALL_PATH = /usr/local/lib/SystemConfiguration;
LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
PRODUCT_NAME = InterfaceNamer;
- VALID_ARCHS = "ppc i386";
WARNING_CFLAGS = (
"-Wall",
"-Wno-unknown-pragmas",
);
};
- name = Development;
+ name = Debug;
};
- 156EB5F80905594A00EEF749 /* Deployment */ = {
+ 156EB5F80905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = YES;
INSTALL_MODE_FLAG = "a-w,a+rX";
INSTALL_PATH = /usr/local/lib/SystemConfiguration;
LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
PRODUCT_NAME = InterfaceNamer;
- VALID_ARCHS = "ppc i386";
WARNING_CFLAGS = (
"-Wall",
"-Wno-unknown-pragmas",
);
};
- name = Deployment;
+ name = Release;
};
- 156EB5F90905594A00EEF749 /* Default */ = {
+ 156EB5FB0905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ INFOPLIST_FILE = Plugins/InterfaceNamer/Info.plist;
INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/local/lib/SystemConfiguration;
- LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- PRODUCT_NAME = InterfaceNamer;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
- };
- name = Default;
- };
- 156EB5FB0905594A00EEF749 /* Development */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- INFOPLIST_FILE = Plugins/InterfaceNamer/Info.plist;
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
- PRODUCT_NAME = InterfaceNamer;
- };
- name = Development;
- };
- 156EB5FC0905594A00EEF749 /* Deployment */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- INFOPLIST_FILE = Plugins/InterfaceNamer/Info.plist;
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
PRODUCT_NAME = InterfaceNamer;
};
- name = Deployment;
+ name = Debug;
};
- 156EB5FD0905594A00EEF749 /* Default */ = {
+ 156EB5FC0905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Plugins/InterfaceNamer/Info.plist;
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
PRODUCT_NAME = InterfaceNamer;
};
- name = Default;
- };
- 156EB5FF0905594A00EEF749 /* Development */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- INFOPLIST_FILE = Plugins/KernelEventMonitor/Info.plist;
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
- PRODUCT_NAME = KernelEventMonitor;
- };
- name = Development;
+ name = Release;
};
- 156EB6000905594A00EEF749 /* Deployment */ = {
+ 156EB5FF0905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Plugins/KernelEventMonitor/Info.plist;
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
PRODUCT_NAME = KernelEventMonitor;
};
- name = Deployment;
+ name = Debug;
};
- 156EB6010905594A00EEF749 /* Default */ = {
+ 156EB6000905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Plugins/KernelEventMonitor/Info.plist;
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
PRODUCT_NAME = KernelEventMonitor;
};
- name = Default;
+ name = Release;
};
- 156EB6030905594A00EEF749 /* Development */ = {
+ 156EB6030905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
INSTALL_MODE_FLAG = "a-w,a+rX";
INSTALL_PATH = /usr/local/lib/SystemConfiguration;
LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
PRODUCT_NAME = KernelEventMonitor;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
};
- name = Development;
+ name = Debug;
};
- 156EB6040905594A00EEF749 /* Deployment */ = {
+ 156EB6040905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = YES;
INSTALL_MODE_FLAG = "a-w,a+rX";
INSTALL_PATH = /usr/local/lib/SystemConfiguration;
LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- PRODUCT_NAME = KernelEventMonitor;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
- };
- name = Deployment;
- };
- 156EB6050905594A00EEF749 /* Default */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/PrivateHeaders";
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/local/lib/SystemConfiguration;
- LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
PRODUCT_NAME = KernelEventMonitor;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
- };
- name = Default;
- };
- 156EB6070905594A00EEF749 /* Development */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/local/lib/SystemConfiguration;
- LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- PRODUCT_NAME = Kicker;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
- };
- name = Development;
- };
- 156EB6080905594A00EEF749 /* Deployment */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/local/lib/SystemConfiguration;
- LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- PRODUCT_NAME = Kicker;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
- };
- name = Deployment;
- };
- 156EB6090905594A00EEF749 /* Default */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/local/lib/SystemConfiguration;
- LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- PRODUCT_NAME = Kicker;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
- };
- name = Default;
- };
- 156EB60B0905594A00EEF749 /* Development */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- INFOPLIST_FILE = Plugins/Kicker/Info.plist;
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
- PRODUCT_NAME = Kicker;
};
- name = Development;
+ name = Release;
};
- 156EB60C0905594A00EEF749 /* Deployment */ = {
+ 156EB60B0905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Plugins/Kicker/Info.plist;
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
PRODUCT_NAME = Kicker;
};
- name = Deployment;
+ name = Debug;
};
- 156EB60D0905594A00EEF749 /* Default */ = {
+ 156EB60C0905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Plugins/Kicker/Info.plist;
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
PRODUCT_NAME = Kicker;
};
- name = Default;
+ name = Release;
};
- 156EB60F0905594A00EEF749 /* Development */ = {
+ 156EB60F0905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
INSTALL_MODE_FLAG = "a-w,a+rX";
INSTALL_PATH = /usr/local/lib/SystemConfiguration;
LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
PRODUCT_NAME = LinkConfiguration;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
};
- name = Development;
+ name = Debug;
};
- 156EB6100905594A00EEF749 /* Deployment */ = {
+ 156EB6100905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = YES;
INSTALL_MODE_FLAG = "a-w,a+rX";
INSTALL_PATH = /usr/local/lib/SystemConfiguration;
LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- PRODUCT_NAME = LinkConfiguration;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
- };
- name = Deployment;
- };
- 156EB6110905594A00EEF749 /* Default */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/local/lib/SystemConfiguration;
- LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- PRODUCT_NAME = LinkConfiguration;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
- };
- name = Default;
- };
- 156EB6130905594A00EEF749 /* Development */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- INFOPLIST_FILE = Plugins/LinkConfiguration/Info.plist;
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
PRODUCT_NAME = LinkConfiguration;
};
- name = Development;
+ name = Release;
};
- 156EB6140905594A00EEF749 /* Deployment */ = {
+ 156EB6130905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Plugins/LinkConfiguration/Info.plist;
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
PRODUCT_NAME = LinkConfiguration;
};
- name = Deployment;
+ name = Debug;
};
- 156EB6150905594A00EEF749 /* Default */ = {
+ 156EB6140905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Plugins/LinkConfiguration/Info.plist;
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
PRODUCT_NAME = LinkConfiguration;
};
- name = Default;
+ name = Release;
};
- 156EB6170905594A00EEF749 /* Development */ = {
+ 156EB6170905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
INSTALL_MODE_FLAG = "a-w,a+rX";
INSTALL_PATH = /usr/local/lib/SystemConfiguration;
LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
PRODUCT_NAME = PreferencesMonitor;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
};
- name = Development;
+ name = Debug;
};
- 156EB6180905594A00EEF749 /* Deployment */ = {
+ 156EB6180905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = YES;
INSTALL_MODE_FLAG = "a-w,a+rX";
INSTALL_PATH = /usr/local/lib/SystemConfiguration;
LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- PRODUCT_NAME = PreferencesMonitor;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
- };
- name = Deployment;
- };
- 156EB6190905594A00EEF749 /* Default */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/local/lib/SystemConfiguration;
- LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- PRODUCT_NAME = PreferencesMonitor;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
- };
- name = Default;
- };
- 156EB61B0905594A00EEF749 /* Development */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- INFOPLIST_FILE = Plugins/PreferencesMonitor/Info.plist;
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
PRODUCT_NAME = PreferencesMonitor;
};
- name = Development;
+ name = Release;
};
- 156EB61C0905594A00EEF749 /* Deployment */ = {
+ 156EB61B0905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Plugins/PreferencesMonitor/Info.plist;
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
PRODUCT_NAME = PreferencesMonitor;
};
- name = Deployment;
+ name = Debug;
};
- 156EB61D0905594A00EEF749 /* Default */ = {
+ 156EB61C0905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Plugins/PreferencesMonitor/Info.plist;
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
PRODUCT_NAME = PreferencesMonitor;
};
- name = Default;
- };
- 156EB61F0905594A00EEF749 /* Development */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
- PRODUCT_NAME = Plugins;
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
- };
- name = Development;
+ name = Release;
};
- 156EB6200905594A00EEF749 /* Deployment */ = {
+ 156EB61F0905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COPY_PHASE_STRIP = YES;
- GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
- PRODUCT_NAME = Plugins;
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
+ PRODUCT_NAME = configd_plugins;
};
- name = Deployment;
+ name = Debug;
};
- 156EB6210905594A00EEF749 /* Default */ = {
+ 156EB6200905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- PRODUCT_NAME = Plugins;
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
+ PRODUCT_NAME = configd_plugins;
};
- name = Default;
+ name = Release;
};
- 156EB6230905594A00EEF749 /* Development */ = {
+ 156EB6230905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/sbin;
+ INSTALL_PATH = /usr/libexec;
LIBRARY_SEARCH_PATHS = (
"$(SYMROOT)",
/usr/local/lib/SystemConfiguration,
);
- OTHER_CFLAGS = "-fconstant-cfstrings";
- OTHER_LDFLAGS = "-prebind_all_twolevel_modules";
PRODUCT_NAME = configd;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
};
- name = Development;
+ name = Debug;
};
- 156EB6240905594A00EEF749 /* Deployment */ = {
+ 156EB6240905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CODE_SIGN_IDENTITY = "-";
DEAD_CODE_STRIPPING = YES;
FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/sbin;
- LIBRARY_SEARCH_PATHS = (
- "$(SYMROOT)",
- /usr/local/lib/SystemConfiguration,
- );
- OTHER_CFLAGS = "-fconstant-cfstrings";
- OTHER_LDFLAGS = "-prebind_all_twolevel_modules";
- PRODUCT_NAME = configd;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
- };
- name = Deployment;
- };
- 156EB6250905594A00EEF749 /* Default */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- DEAD_CODE_STRIPPING = YES;
- FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/sbin;
+ INSTALL_PATH = /usr/libexec;
LIBRARY_SEARCH_PATHS = (
"$(SYMROOT)",
/usr/local/lib/SystemConfiguration,
);
- OTHER_CFLAGS = "-fconstant-cfstrings";
- OTHER_LDFLAGS = "-prebind_all_twolevel_modules";
PRODUCT_NAME = configd;
- STRIPFLAGS = "-S";
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
};
- name = Default;
+ name = Release;
};
- 156EB6270905594A00EEF749 /* Development */ = {
+ 156EB6270905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
INSTALL_MODE_FLAG = "a-w,a+rX,u+s";
INSTALL_PATH = /usr/sbin;
- OTHER_CFLAGS = "-fconstant-cfstrings";
PRODUCT_NAME = scselect;
STRIPFLAGS = "-S";
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
};
- name = Development;
+ name = Debug;
};
- 156EB6280905594A00EEF749 /* Deployment */ = {
+ 156EB6280905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = YES;
DEAD_CODE_STRIPPING = YES;
FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
INSTALL_MODE_FLAG = "a-w,a+rX,u+s";
INSTALL_PATH = /usr/sbin;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- PRODUCT_NAME = scselect;
- STRIPFLAGS = "-S";
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
- };
- name = Deployment;
- };
- 156EB6290905594A00EEF749 /* Default */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- DEAD_CODE_STRIPPING = YES;
- FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
- INSTALL_MODE_FLAG = "a-w,a+rX,u+s";
- INSTALL_PATH = /usr/sbin;
- OTHER_CFLAGS = "-fconstant-cfstrings";
PRODUCT_NAME = scselect;
STRIPFLAGS = "-S";
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
};
- name = Default;
+ name = Release;
};
- 156EB62B0905594A00EEF749 /* Development */ = {
+ 156EB62B0905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
"$(SYMROOT)",
/usr/local/lib/SystemConfiguration,
);
- MACOSX_DEPLOYMENT_TARGET = 10.5;
- OTHER_CFLAGS = "-fconstant-cfstrings";
PREBINDING = NO;
PRODUCT_NAME = scutil;
STRIPFLAGS = "-S";
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
};
- name = Development;
+ name = Debug;
};
- 156EB62C0905594A00EEF749 /* Deployment */ = {
+ 156EB62C0905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = YES;
DEAD_CODE_STRIPPING = YES;
FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
"$(SYMROOT)",
/usr/local/lib/SystemConfiguration,
);
- OTHER_CFLAGS = "-fconstant-cfstrings";
PREBINDING = YES;
PRODUCT_NAME = scutil;
STRIPFLAGS = "-S";
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
};
- name = Deployment;
+ name = Release;
};
- 156EB62D0905594A00EEF749 /* Default */ = {
+ 156EB62F0905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- DEAD_CODE_STRIPPING = YES;
- FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/sbin;
- LIBRARY_SEARCH_PATHS = (
- "$(SYMROOT)",
- /usr/local/lib/SystemConfiguration,
- );
- OTHER_CFLAGS = "-fconstant-cfstrings";
- PREBINDING = YES;
- PRODUCT_NAME = scutil;
- STRIPFLAGS = "-S";
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
+ PRODUCT_NAME = configd_executables;
};
- name = Default;
+ name = Debug;
};
- 156EB62F0905594A00EEF749 /* Development */ = {
+ 156EB6300905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COPY_PHASE_STRIP = NO;
- DEAD_CODE_STRIPPING = YES;
- GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
PRODUCT_NAME = configd_executables;
- STRIPFLAGS = "-S";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
};
- name = Development;
+ name = Release;
};
- 156EB6300905594A00EEF749 /* Deployment */ = {
+ 156EB6330905594A00EEF749 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- COPY_PHASE_STRIP = YES;
- DEAD_CODE_STRIPPING = YES;
- GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
- PRODUCT_NAME = configd_executables;
+ PRODUCT_NAME = "configd (Aggregate)";
+ };
+ name = Debug;
+ };
+ 156EB6340905594A00EEF749 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = "configd (Aggregate)";
+ };
+ name = Release;
+ };
+ 156EB63F0905594A00EEF749 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CURRENT_PROJECT_VERSION = "$(RC_ProjectSourceVersion)";
+ DEAD_CODE_STRIPPING = YES;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = "$(RC_ProjectSourceVersion)";
+ GCC_OPTIMIZATION_LEVEL = 0;
+ INSTALL_GROUP = wheel;
+ INSTALL_MODE_FLAG = "u+s,ugo-w,o+rX";
+ INSTALL_OWNER = root;
+ INSTALL_PATH = /usr/sbin;
+ OTHER_CFLAGS = (
+ "-fconstant-cfstrings",
+ "-fstack-protector",
+ "-D_FORTIFY_SOURCE=2",
+ );
STRIPFLAGS = "-S";
+ VERSIONING_SYSTEM = "apple-generic";
WARNING_CFLAGS = (
"-Wall",
+ "-Wno-four-char-constants",
"-Wno-unknown-pragmas",
+ "-Wformat-security",
);
};
- name = Deployment;
+ name = Debug;
};
- 156EB6310905594A00EEF749 /* Default */ = {
+ 156EB6400905594A00EEF749 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CURRENT_PROJECT_VERSION = "$(RC_ProjectSourceVersion)";
DEAD_CODE_STRIPPING = YES;
- PRODUCT_NAME = configd_executables;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = "$(RC_ProjectSourceVersion)";
+ INSTALL_GROUP = wheel;
+ INSTALL_MODE_FLAG = "u+s,ugo-w,o+rX";
+ INSTALL_OWNER = root;
+ INSTALL_PATH = /usr/sbin;
+ OTHER_CFLAGS = (
+ "-fconstant-cfstrings",
+ "-fstack-protector",
+ "-D_FORTIFY_SOURCE=2",
+ );
STRIPFLAGS = "-S";
+ VERSIONING_SYSTEM = "apple-generic";
WARNING_CFLAGS = (
"-Wall",
+ "-Wno-four-char-constants",
"-Wno-unknown-pragmas",
+ "-Wformat-security",
);
};
- name = Default;
+ name = Release;
+ };
+ 1572C52A0CFB55B400E2776E /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ HEADER_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/PrivateHeaders";
+ INFOPLIST_FILE = "SystemConfiguration.fproj/Info-Embedded.plist";
+ INSTALLHDRS_SCRIPT_PHASE = YES;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Frameworks";
+ LIBRARY_SEARCH_PATHS = "$(SYMROOT)";
+ PRODUCT_NAME = SystemConfiguration;
+ WRAPPER_EXTENSION = framework;
+ };
+ name = Debug;
+ };
+ 1572C52B0CFB55B400E2776E /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ HEADER_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/PrivateHeaders";
+ INFOPLIST_FILE = "SystemConfiguration.fproj/Info-Embedded.plist";
+ INSTALLHDRS_SCRIPT_PHASE = YES;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Frameworks";
+ LIBRARY_SEARCH_PATHS = "$(SYMROOT)";
+ PRODUCT_NAME = SystemConfiguration;
+ WRAPPER_EXTENSION = framework;
+ };
+ name = Release;
};
- 156EB6330905594A00EEF749 /* Development */ = {
+ 157433E90D4A8122002ACA73 /* Debug */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
buildSettings = {
COPY_PHASE_STRIP = NO;
+ DEAD_CODE_STRIPPING = YES;
+ FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
- PRODUCT_NAME = "configd (Aggregate)";
+ INSTALL_MODE_FLAG = "a-w,a+rX,u+s";
+ INSTALL_PATH = /usr/sbin;
+ PRODUCT_NAME = scselect;
+ STRIPFLAGS = "-S";
+ };
+ name = Debug;
+ };
+ 157433EA0D4A8122002ACA73 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ DEAD_CODE_STRIPPING = YES;
+ FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+ INSTALL_MODE_FLAG = "a-w,a+rX,u+s";
+ INSTALL_PATH = /usr/sbin;
+ PRODUCT_NAME = scselect;
+ STRIPFLAGS = "-S";
+ };
+ name = Release;
+ };
+ 157434170D4A8137002ACA73 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ DEAD_CODE_STRIPPING = YES;
+ FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = /usr/sbin;
+ LIBRARY_SEARCH_PATHS = (
+ "$(SYMROOT)",
+ "$(SDKROOT)/usr/local/lib/SystemConfiguration",
+ );
+ PREBINDING = NO;
+ PRODUCT_NAME = scutil;
+ STRIPFLAGS = "-S";
+ };
+ name = Debug;
+ };
+ 157434180D4A8137002ACA73 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ DEAD_CODE_STRIPPING = YES;
+ FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = /usr/sbin;
+ LIBRARY_SEARCH_PATHS = (
+ "$(SYMROOT)",
+ "$(SDKROOT)/usr/local/lib/SystemConfiguration",
+ );
+ PREBINDING = YES;
+ PRODUCT_NAME = scutil;
+ STRIPFLAGS = "-S";
+ };
+ name = Release;
+ };
+ 157A84E50D56C63900B6F1A0 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ BUILD_VARIANTS = (
+ normal,
+ debug,
+ profile,
+ );
+ COPY_PHASE_STRIP = NO;
+ GENERATE_PROFILING_CODE_profile = YES;
+ INSTALLHDRS_COPY_PHASE = YES;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = /usr/local/lib/system;
+ LIBRARY_STYLE = STATIC;
+ OTHER_CFLAGS_debug = "-O0";
+ OTHER_CFLAGS_normal = "";
+ OTHER_CFLAGS_profile = "";
+ OTHER_MIGFLAGS = "-DLIBDNSINFO";
+ PRODUCT_NAME = dnsinfo;
+ STRIPFLAGS = "";
+ STRIP_INSTALLED_PRODUCT_debug = NO;
+ STRIP_INSTALLED_PRODUCT_normal = YES;
+ STRIP_INSTALLED_PRODUCT_profile = NO;
+ };
+ name = Debug;
+ };
+ 157A84E60D56C63900B6F1A0 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ BUILD_VARIANTS = (
+ normal,
+ debug,
+ profile,
+ );
+ COPY_PHASE_STRIP = YES;
+ GENERATE_PROFILING_CODE_profile = YES;
+ INSTALLHDRS_COPY_PHASE = YES;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = /usr/local/lib/system;
+ LIBRARY_STYLE = STATIC;
+ OTHER_CFLAGS_debug = "-O0";
+ OTHER_CFLAGS_normal = "";
+ OTHER_CFLAGS_profile = "";
+ OTHER_MIGFLAGS = "-DLIBDNSINFO";
+ PRODUCT_NAME = dnsinfo;
+ STRIPFLAGS = "";
+ STRIP_INSTALLED_PRODUCT_debug = NO;
+ STRIP_INSTALLED_PRODUCT_normal = YES;
+ STRIP_INSTALLED_PRODUCT_profile = NO;
+ };
+ name = Release;
+ };
+ 157A84FF0D56C7E800B6F1A0 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = /usr/local/lib/SystemConfiguration;
+ LIBRARY_STYLE = STATIC;
+ PRODUCT_NAME = IPMonitor;
+ };
+ name = Debug;
+ };
+ 157A85000D56C7E800B6F1A0 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = /usr/local/lib/SystemConfiguration;
+ LIBRARY_STYLE = STATIC;
+ PRODUCT_NAME = IPMonitor;
+ };
+ name = Release;
+ };
+ 157A850A0D56C8AA00B6F1A0 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = /usr/local/lib/SystemConfiguration;
+ LIBRARY_STYLE = STATIC;
+ PRODUCT_NAME = InterfaceNamer;
+ };
+ name = Debug;
+ };
+ 157A850B0D56C8AA00B6F1A0 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = /usr/local/lib/SystemConfiguration;
+ LIBRARY_STYLE = STATIC;
+ PRODUCT_NAME = InterfaceNamer;
+ };
+ name = Release;
+ };
+ 157A85200D56C8E000B6F1A0 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+ HEADER_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/PrivateHeaders";
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = /usr/local/lib/SystemConfiguration;
+ LIBRARY_STYLE = STATIC;
+ PRODUCT_NAME = KernelEventMonitor;
+ };
+ name = Debug;
+ };
+ 157A85210D56C8E000B6F1A0 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+ HEADER_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/PrivateHeaders";
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = /usr/local/lib/SystemConfiguration;
+ LIBRARY_STYLE = STATIC;
+ PRODUCT_NAME = KernelEventMonitor;
+ };
+ name = Release;
+ };
+ 157A852B0D56C91100B6F1A0 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = /usr/local/lib/SystemConfiguration;
+ LIBRARY_STYLE = STATIC;
+ PRODUCT_NAME = LinkConfiguration;
+ };
+ name = Debug;
+ };
+ 157A852C0D56C91100B6F1A0 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = /usr/local/lib/SystemConfiguration;
+ LIBRARY_STYLE = STATIC;
+ PRODUCT_NAME = LinkConfiguration;
+ };
+ name = Release;
+ };
+ 157A85360D56C94F00B6F1A0 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = /usr/local/lib/SystemConfiguration;
+ LIBRARY_STYLE = STATIC;
+ PRODUCT_NAME = NetworkIdentification;
+ };
+ name = Debug;
+ };
+ 157A85370D56C94F00B6F1A0 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = /usr/local/lib/SystemConfiguration;
+ LIBRARY_STYLE = STATIC;
+ PRODUCT_NAME = NetworkIdentification;
+ };
+ name = Release;
+ };
+ 157A85410D56C96F00B6F1A0 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = /usr/local/lib/SystemConfiguration;
+ LIBRARY_STYLE = STATIC;
+ PRODUCT_NAME = PreferencesMonitor;
+ };
+ name = Debug;
+ };
+ 157A85420D56C96F00B6F1A0 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = /usr/local/lib/SystemConfiguration;
+ LIBRARY_STYLE = STATIC;
+ PRODUCT_NAME = PreferencesMonitor;
+ };
+ name = Release;
+ };
+ 158316D90CFB774B006F62B9 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = "configd_base (Embedded)";
+ };
+ name = Debug;
+ };
+ 158316DA0CFB774B006F62B9 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = "configd_base (Embedded)";
+ };
+ name = Release;
+ };
+ 158317010CFB7761006F62B9 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = "configd_plugins (Embedded)";
+ };
+ name = Debug;
+ };
+ 158317020CFB7761006F62B9 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = "configd_plugins (Embedded)";
+ };
+ name = Release;
+ };
+ 1583170C0CFB7782006F62B9 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = "configd_executables (Embedded)";
+ };
+ name = Debug;
+ };
+ 1583170D0CFB7782006F62B9 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = "configd_executables (Embedded)";
+ };
+ name = Release;
+ };
+ 1583175E0CFB80A1006F62B9 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ APPLY_RULES_IN_COPY_FILES = YES;
+ CODE_SIGN_ENTITLEMENTS = configd.tproj/entitlements.plist;
+ COPY_PHASE_STRIP = NO;
+ DEAD_CODE_STRIPPING = YES;
+ FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = /usr/libexec;
+ LIBRARY_SEARCH_PATHS = (
+ "$(SYMROOT)",
+ "$(SDKROOT)/usr/local/lib/SystemConfiguration",
+ );
+ PRODUCT_NAME = configd;
+ };
+ name = Debug;
+ };
+ 1583175F0CFB80A1006F62B9 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ APPLY_RULES_IN_COPY_FILES = YES;
+ CODE_SIGN_ENTITLEMENTS = configd.tproj/entitlements.plist;
+ DEAD_CODE_STRIPPING = YES;
+ FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = /usr/libexec;
+ LIBRARY_SEARCH_PATHS = (
+ "$(SYMROOT)",
+ "$(SDKROOT)/usr/local/lib/SystemConfiguration",
+ );
+ PRODUCT_NAME = configd;
+ };
+ name = Release;
+ };
+ 158317810CFB85C8006F62B9 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ INFOPLIST_FILE = Plugins/IPMonitor/Info.plist;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
+ PRODUCT_NAME = IPMonitor;
+ };
+ name = Debug;
+ };
+ 158317820CFB85C8006F62B9 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ INFOPLIST_FILE = Plugins/IPMonitor/Info.plist;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
+ PRODUCT_NAME = IPMonitor;
+ };
+ name = Release;
+ };
+ 1583178A0CFB85DD006F62B9 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ INFOPLIST_FILE = Plugins/InterfaceNamer/Info.plist;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
+ PRODUCT_NAME = InterfaceNamer;
+ };
+ name = Debug;
+ };
+ 1583178B0CFB85DD006F62B9 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ INFOPLIST_FILE = Plugins/InterfaceNamer/Info.plist;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
+ PRODUCT_NAME = InterfaceNamer;
+ };
+ name = Release;
+ };
+ 158317930CFB85F7006F62B9 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ INFOPLIST_FILE = Plugins/KernelEventMonitor/Info.plist;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
+ PRODUCT_NAME = KernelEventMonitor;
+ };
+ name = Debug;
+ };
+ 158317940CFB85F7006F62B9 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ INFOPLIST_FILE = Plugins/KernelEventMonitor/Info.plist;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
+ PRODUCT_NAME = KernelEventMonitor;
+ };
+ name = Release;
+ };
+ 1583179B0CFB860C006F62B9 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ INFOPLIST_FILE = Plugins/LinkConfiguration/Info.plist;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
+ PRODUCT_NAME = LinkConfiguration;
+ };
+ name = Debug;
+ };
+ 1583179C0CFB860C006F62B9 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ INFOPLIST_FILE = Plugins/LinkConfiguration/Info.plist;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
+ PRODUCT_NAME = LinkConfiguration;
+ };
+ name = Release;
+ };
+ 158317A30CFB8626006F62B9 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ INFOPLIST_FILE = Plugins/NetworkIdentification/Info.plist;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
+ PRODUCT_NAME = NetworkIdentification;
+ };
+ name = Debug;
+ };
+ 158317A40CFB8626006F62B9 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ INFOPLIST_FILE = Plugins/NetworkIdentification/Info.plist;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
+ PRODUCT_NAME = NetworkIdentification;
+ };
+ name = Release;
+ };
+ 158317AB0CFB8639006F62B9 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ INFOPLIST_FILE = Plugins/PreferencesMonitor/Info.plist;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
+ PRODUCT_NAME = PreferencesMonitor;
+ };
+ name = Debug;
+ };
+ 158317AC0CFB8639006F62B9 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ INFOPLIST_FILE = Plugins/PreferencesMonitor/Info.plist;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
+ PRODUCT_NAME = PreferencesMonitor;
+ };
+ name = Release;
+ };
+ 158337A70CFB6B9E0033AB93 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
+ buildSettings = {
+ APPLY_RULES_IN_COPY_FILES = YES;
+ COPY_PHASE_STRIP = NO;
+ DEAD_CODE_STRIPPING = YES;
+ FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Frameworks/SystemConfiguration.framework";
+ PRODUCT_NAME = SCHelper;
+ STRIPFLAGS = "-S";
};
- name = Development;
+ name = Debug;
};
- 156EB6340905594A00EEF749 /* Deployment */ = {
+ 158337A80CFB6B9E0033AB93 /* Release */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = 15AEABBC0DAD5B3000D1C969 /* AspenSDK.xcconfig */;
buildSettings = {
+ APPLY_RULES_IN_COPY_FILES = YES;
COPY_PHASE_STRIP = YES;
+ DEAD_CODE_STRIPPING = YES;
+ FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
- PRODUCT_NAME = "configd (Aggregate)";
- };
- name = Deployment;
- };
- 156EB6350905594A00EEF749 /* Default */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = "configd (Aggregate)";
+ INSTALL_MODE_FLAG = "a-w,a+rX";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Frameworks/SystemConfiguration.framework";
+ PRODUCT_NAME = SCHelper;
+ STRIPFLAGS = "-S";
};
- name = Default;
+ name = Release;
};
- 156EB63B0905594A00EEF749 /* Development */ = {
+ 15A5A2670D5B94190087BDA0 /* Debug */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = 15FD147B0D594FE700F9409C /* IndigoSDK.xcconfig */;
buildSettings = {
COPY_PHASE_STRIP = NO;
- GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
HEADER_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/PrivateHeaders";
+ INFOPLIST_FILE = "SystemConfiguration.fproj/Info-Embedded.plist";
+ INSTALLHDRS_SCRIPT_PHASE = YES;
INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/local/lib/SystemConfiguration;
- LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- PRODUCT_NAME = ATconfig;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
+ INSTALL_PATH_ACTUAL = "$(SYSTEM_LIBRARY_DIR)/Frameworks";
+ LIBRARY_SEARCH_PATHS = "$(SYMROOT)";
+ PRODUCT_NAME = SystemConfiguration;
+ WRAPPER_EXTENSION = framework;
};
- name = Development;
+ name = Debug;
};
- 156EB63C0905594A00EEF749 /* Deployment */ = {
+ 15A5A2680D5B94190087BDA0 /* Release */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = 15FD147B0D594FE700F9409C /* IndigoSDK.xcconfig */;
buildSettings = {
COPY_PHASE_STRIP = YES;
- GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
HEADER_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/PrivateHeaders";
+ INFOPLIST_FILE = "SystemConfiguration.fproj/Info-Embedded.plist";
+ INSTALLHDRS_SCRIPT_PHASE = YES;
INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/local/lib/SystemConfiguration;
- LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- PRODUCT_NAME = ATconfig;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
+ INSTALL_PATH_ACTUAL = "$(SYSTEM_LIBRARY_DIR)/Frameworks";
+ LIBRARY_SEARCH_PATHS = "$(SYMROOT)";
+ PRODUCT_NAME = SystemConfiguration;
+ WRAPPER_EXTENSION = framework;
};
- name = Deployment;
+ name = Release;
};
- 156EB63D0905594A00EEF749 /* Default */ = {
+ 15C64A1F0F684C3300D78394 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- HEADER_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/PrivateHeaders";
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/local/lib/SystemConfiguration;
- LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- PRODUCT_NAME = ATconfig;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
+ INSTALL_PATH = /usr/local/lib/system;
+ PRODUCT_NAME = configd_libSystem;
};
- name = Default;
+ name = Debug;
};
- 156EB63F0905594A00EEF749 /* Development */ = {
+ 15C64A200F684C3300D78394 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 212.2;
- DEAD_CODE_STRIPPING = YES;
- INSTALL_GROUP = wheel;
- INSTALL_MODE_FLAG = "u+s,ugo-w,o+rX";
- INSTALL_OWNER = root;
- INSTALL_PATH = /usr/sbin;
- MACOSX_DEPLOYMENT_TARGET = 10.5;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- STRIPFLAGS = "-S";
- VERSIONING_SYSTEM = "apple-generic";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-four-char-constants",
- "-Wno-unknown-pragmas",
- );
+ INSTALL_PATH = /usr/local/lib/system;
+ PRODUCT_NAME = configd_libSystem;
};
- name = Development;
+ name = Release;
};
- 156EB6400905594A00EEF749 /* Deployment */ = {
+ 15C64A2C0F684C6B00D78394 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 212.2;
- DEAD_CODE_STRIPPING = YES;
- INSTALL_GROUP = wheel;
- INSTALL_MODE_FLAG = "u+s,ugo-w,o+rX";
- INSTALL_OWNER = root;
- INSTALL_PATH = /usr/sbin;
- MACOSX_DEPLOYMENT_TARGET = 10.5;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- STRIPFLAGS = "-S";
- VERSIONING_SYSTEM = "apple-generic";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-four-char-constants",
- "-Wno-unknown-pragmas",
- );
+ INSTALL_PATH = /usr/local/lib/system;
+ PRODUCT_NAME = "configd_libSystem (Embedded)";
};
- name = Deployment;
+ name = Debug;
};
- 156EB6410905594A00EEF749 /* Default */ = {
+ 15C64A2D0F684C6B00D78394 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 212.2;
- DEAD_CODE_STRIPPING = YES;
- INSTALL_GROUP = wheel;
- INSTALL_MODE_FLAG = "u+s,ugo-w,o+rX";
- INSTALL_OWNER = root;
- INSTALL_PATH = /usr/sbin;
- MACOSX_DEPLOYMENT_TARGET = 10.5;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- STRIPFLAGS = "-S";
- VERSIONING_SYSTEM = "apple-generic";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-four-char-constants",
- "-Wno-unknown-pragmas",
- );
+ INSTALL_PATH = /usr/local/lib/system;
+ PRODUCT_NAME = "configd_libSystem (Embedded)";
};
- name = Default;
+ name = Release;
};
- F95B8A620B03F83200993BA3 /* Development */ = {
+ 15FD13C70D59485000F9409C /* Debug */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = 15FD147B0D594FE700F9409C /* IndigoSDK.xcconfig */;
buildSettings = {
- COPY_PHASE_STRIP = NO;
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/local/lib/SystemConfiguration;
- LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- PRODUCT_NAME = NetworkIdentification;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
+ PRODUCT_NAME = "configd (Aggregate/EmbeddedSimulator)";
};
- name = Development;
+ name = Debug;
};
- F95B8A630B03F83200993BA3 /* Deployment */ = {
+ 15FD13C80D59485000F9409C /* Release */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = 15FD147B0D594FE700F9409C /* IndigoSDK.xcconfig */;
buildSettings = {
- COPY_PHASE_STRIP = YES;
- INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = /usr/local/lib/SystemConfiguration;
- LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
- PRODUCT_NAME = NetworkIdentification;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
+ PRODUCT_NAME = "configd (Aggregate/EmbeddedSimulator)";
};
- name = Deployment;
+ name = Release;
};
- F95B8A640B03F83200993BA3 /* Default */ = {
+ F95B8A620B03F83200993BA3 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ COPY_PHASE_STRIP = NO;
INSTALL_MODE_FLAG = "a-w,a+rX";
INSTALL_PATH = /usr/local/lib/SystemConfiguration;
LIBRARY_STYLE = STATIC;
- OTHER_CFLAGS = "-fconstant-cfstrings";
PRODUCT_NAME = NetworkIdentification;
- VALID_ARCHS = "ppc i386";
- WARNING_CFLAGS = (
- "-Wall",
- "-Wno-unknown-pragmas",
- );
};
- name = Default;
+ name = Debug;
};
- F95B8A6D0B03F9D100993BA3 /* Development */ = {
+ F95B8A630B03F83200993BA3 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- INFOPLIST_FILE = Plugins/NetworkIdentification/Info.plist;
+ COPY_PHASE_STRIP = YES;
INSTALL_MODE_FLAG = "a-w,a+rX";
- INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
+ INSTALL_PATH = /usr/local/lib/SystemConfiguration;
+ LIBRARY_STYLE = STATIC;
PRODUCT_NAME = NetworkIdentification;
};
- name = Development;
+ name = Release;
};
- F95B8A6E0B03F9D100993BA3 /* Deployment */ = {
+ F95B8A6D0B03F9D100993BA3 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Plugins/NetworkIdentification/Info.plist;
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
PRODUCT_NAME = NetworkIdentification;
};
- name = Deployment;
+ name = Debug;
};
- F95B8A6F0B03F9D100993BA3 /* Default */ = {
+ F95B8A6E0B03F9D100993BA3 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = Plugins/NetworkIdentification/Info.plist;
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/SystemConfiguration";
PRODUCT_NAME = NetworkIdentification;
};
- name = Default;
+ name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
+ 151C1CD60CFB48E300C5AFD6 /* Build configuration list for PBXAggregateTarget "All-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 151C1CC70CFB487000C5AFD6 /* Debug */,
+ 151C1CC80CFB487000C5AFD6 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
151F5D9F0CCE98E60093AC3B /* Build configuration list for PBXNativeTarget "SCMonitor" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 151F5D9C0CCE98E60093AC3B /* Development */,
- 151F5D9D0CCE98E60093AC3B /* Deployment */,
- 151F5D9E0CCE98E60093AC3B /* Default */,
+ 151F5D9C0CCE98E60093AC3B /* Debug */,
+ 151F5D9D0CCE98E60093AC3B /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
151F63DC09328A3C0096DCC9 /* Build configuration list for PBXNativeTarget "Schema" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 151F63DD09328A3C0096DCC9 /* Development */,
- 151F63DE09328A3C0096DCC9 /* Deployment */,
- 151F63DF09328A3C0096DCC9 /* Default */,
+ 151F63DD09328A3C0096DCC9 /* Debug */,
+ 151F63DE09328A3C0096DCC9 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 151FE2E40D5B7046000D6DB1 /* Build configuration list for PBXAggregateTarget "configd_base-EmbeddedSimulator" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 151FE2E50D5B7046000D6DB1 /* Debug */,
+ 151FE2E60D5B7046000D6DB1 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 15213FFF0E93E9F600DACD2C /* Build configuration list for PBXNativeTarget "Logger.bundle" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 15213FFC0E93E9F600DACD2C /* Debug */,
+ 15213FFD0E93E9F600DACD2C /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 156CA4820EF853BB00C59A18 /* Build configuration list for PBXNativeTarget "Logger.bundle-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 156CA4830EF853BB00C59A18 /* Debug */,
+ 156CA4840EF853BB00C59A18 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB5DA0905594A00EEF749 /* Build configuration list for PBXNativeTarget "DNSConfiguration" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB5DB0905594A00EEF749 /* Development */,
- 156EB5DC0905594A00EEF749 /* Deployment */,
- 156EB5DD0905594A00EEF749 /* Default */,
+ 156EB5DB0905594A00EEF749 /* Debug */,
+ 156EB5DC0905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB5DE0905594A00EEF749 /* Build configuration list for PBXNativeTarget "SystemConfiguration.framework" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB5DF0905594A00EEF749 /* Development */,
- 156EB5E00905594A00EEF749 /* Deployment */,
- 156EB5E10905594A00EEF749 /* Default */,
+ 156EB5DF0905594A00EEF749 /* Debug */,
+ 156EB5E00905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB5E20905594A00EEF749 /* Build configuration list for PBXNativeTarget "SCHelper" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB5E30905594A00EEF749 /* Development */,
- 156EB5E40905594A00EEF749 /* Deployment */,
- 156EB5E50905594A00EEF749 /* Default */,
+ 156EB5E30905594A00EEF749 /* Debug */,
+ 156EB5E40905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB5E60905594A00EEF749 /* Build configuration list for PBXAggregateTarget "configd_base" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB5E70905594A00EEF749 /* Development */,
- 156EB5E80905594A00EEF749 /* Deployment */,
- 156EB5E90905594A00EEF749 /* Default */,
+ 156EB5E70905594A00EEF749 /* Debug */,
+ 156EB5E80905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB5EA0905594A00EEF749 /* Build configuration list for PBXNativeTarget "ATconfig.bundle" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB5EB0905594A00EEF749 /* Development */,
- 156EB5EC0905594A00EEF749 /* Deployment */,
- 156EB5ED0905594A00EEF749 /* Default */,
+ 156EB5EB0905594A00EEF749 /* Debug */,
+ 156EB5EC0905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB5EE0905594A00EEF749 /* Build configuration list for PBXNativeTarget "IPMonitor" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB5EF0905594A00EEF749 /* Development */,
- 156EB5F00905594A00EEF749 /* Deployment */,
- 156EB5F10905594A00EEF749 /* Default */,
+ 156EB5EF0905594A00EEF749 /* Debug */,
+ 156EB5F00905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB5F20905594A00EEF749 /* Build configuration list for PBXNativeTarget "IPMonitor.bundle" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB5F30905594A00EEF749 /* Development */,
- 156EB5F40905594A00EEF749 /* Deployment */,
- 156EB5F50905594A00EEF749 /* Default */,
+ 156EB5F30905594A00EEF749 /* Debug */,
+ 156EB5F40905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB5F60905594A00EEF749 /* Build configuration list for PBXNativeTarget "InterfaceNamer" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB5F70905594A00EEF749 /* Development */,
- 156EB5F80905594A00EEF749 /* Deployment */,
- 156EB5F90905594A00EEF749 /* Default */,
+ 156EB5F70905594A00EEF749 /* Debug */,
+ 156EB5F80905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB5FA0905594A00EEF749 /* Build configuration list for PBXNativeTarget "InterfaceNamer.bundle" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB5FB0905594A00EEF749 /* Development */,
- 156EB5FC0905594A00EEF749 /* Deployment */,
- 156EB5FD0905594A00EEF749 /* Default */,
+ 156EB5FB0905594A00EEF749 /* Debug */,
+ 156EB5FC0905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB5FE0905594A00EEF749 /* Build configuration list for PBXNativeTarget "KernelEventMonitor.bundle" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB5FF0905594A00EEF749 /* Development */,
- 156EB6000905594A00EEF749 /* Deployment */,
- 156EB6010905594A00EEF749 /* Default */,
+ 156EB5FF0905594A00EEF749 /* Debug */,
+ 156EB6000905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB6020905594A00EEF749 /* Build configuration list for PBXNativeTarget "KernelEventMonitor" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB6030905594A00EEF749 /* Development */,
- 156EB6040905594A00EEF749 /* Deployment */,
- 156EB6050905594A00EEF749 /* Default */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
- };
- 156EB6060905594A00EEF749 /* Build configuration list for PBXNativeTarget "Kicker" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 156EB6070905594A00EEF749 /* Development */,
- 156EB6080905594A00EEF749 /* Deployment */,
- 156EB6090905594A00EEF749 /* Default */,
+ 156EB6030905594A00EEF749 /* Debug */,
+ 156EB6040905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB60A0905594A00EEF749 /* Build configuration list for PBXNativeTarget "Kicker.bundle" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB60B0905594A00EEF749 /* Development */,
- 156EB60C0905594A00EEF749 /* Deployment */,
- 156EB60D0905594A00EEF749 /* Default */,
+ 156EB60B0905594A00EEF749 /* Debug */,
+ 156EB60C0905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB60E0905594A00EEF749 /* Build configuration list for PBXNativeTarget "LinkConfiguration" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB60F0905594A00EEF749 /* Development */,
- 156EB6100905594A00EEF749 /* Deployment */,
- 156EB6110905594A00EEF749 /* Default */,
+ 156EB60F0905594A00EEF749 /* Debug */,
+ 156EB6100905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB6120905594A00EEF749 /* Build configuration list for PBXNativeTarget "LinkConfiguration.bundle" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB6130905594A00EEF749 /* Development */,
- 156EB6140905594A00EEF749 /* Deployment */,
- 156EB6150905594A00EEF749 /* Default */,
+ 156EB6130905594A00EEF749 /* Debug */,
+ 156EB6140905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB6160905594A00EEF749 /* Build configuration list for PBXNativeTarget "PreferencesMonitor" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB6170905594A00EEF749 /* Development */,
- 156EB6180905594A00EEF749 /* Deployment */,
- 156EB6190905594A00EEF749 /* Default */,
+ 156EB6170905594A00EEF749 /* Debug */,
+ 156EB6180905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB61A0905594A00EEF749 /* Build configuration list for PBXNativeTarget "PreferencesMonitor.bundle" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB61B0905594A00EEF749 /* Development */,
- 156EB61C0905594A00EEF749 /* Deployment */,
- 156EB61D0905594A00EEF749 /* Default */,
+ 156EB61B0905594A00EEF749 /* Debug */,
+ 156EB61C0905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB61E0905594A00EEF749 /* Build configuration list for PBXAggregateTarget "configd_plugins" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB61F0905594A00EEF749 /* Development */,
- 156EB6200905594A00EEF749 /* Deployment */,
- 156EB6210905594A00EEF749 /* Default */,
+ 156EB61F0905594A00EEF749 /* Debug */,
+ 156EB6200905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB6220905594A00EEF749 /* Build configuration list for PBXNativeTarget "configd" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB6230905594A00EEF749 /* Development */,
- 156EB6240905594A00EEF749 /* Deployment */,
- 156EB6250905594A00EEF749 /* Default */,
+ 156EB6230905594A00EEF749 /* Debug */,
+ 156EB6240905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB6260905594A00EEF749 /* Build configuration list for PBXNativeTarget "scselect" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB6270905594A00EEF749 /* Development */,
- 156EB6280905594A00EEF749 /* Deployment */,
- 156EB6290905594A00EEF749 /* Default */,
+ 156EB6270905594A00EEF749 /* Debug */,
+ 156EB6280905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB62A0905594A00EEF749 /* Build configuration list for PBXNativeTarget "scutil" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB62B0905594A00EEF749 /* Development */,
- 156EB62C0905594A00EEF749 /* Deployment */,
- 156EB62D0905594A00EEF749 /* Default */,
+ 156EB62B0905594A00EEF749 /* Debug */,
+ 156EB62C0905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB62E0905594A00EEF749 /* Build configuration list for PBXAggregateTarget "configd_executables" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB62F0905594A00EEF749 /* Development */,
- 156EB6300905594A00EEF749 /* Deployment */,
- 156EB6310905594A00EEF749 /* Default */,
+ 156EB62F0905594A00EEF749 /* Debug */,
+ 156EB6300905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
156EB6320905594A00EEF749 /* Build configuration list for PBXAggregateTarget "All" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB6330905594A00EEF749 /* Development */,
- 156EB6340905594A00EEF749 /* Deployment */,
- 156EB6350905594A00EEF749 /* Default */,
+ 156EB6330905594A00EEF749 /* Debug */,
+ 156EB6340905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
- 156EB63A0905594A00EEF749 /* Build configuration list for PBXNativeTarget "ATconfig" */ = {
+ 156EB63E0905594A00EEF749 /* Build configuration list for PBXProject "configd" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB63B0905594A00EEF749 /* Development */,
- 156EB63C0905594A00EEF749 /* Deployment */,
- 156EB63D0905594A00EEF749 /* Default */,
+ 156EB63F0905594A00EEF749 /* Debug */,
+ 156EB6400905594A00EEF749 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
- 156EB63E0905594A00EEF749 /* Build configuration list for PBXProject "configd" */ = {
+ 1572C5290CFB55B400E2776E /* Build configuration list for PBXNativeTarget "SystemConfiguration.framework-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1572C52A0CFB55B400E2776E /* Debug */,
+ 1572C52B0CFB55B400E2776E /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 157433E80D4A8122002ACA73 /* Build configuration list for PBXNativeTarget "scselect-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 157433E90D4A8122002ACA73 /* Debug */,
+ 157433EA0D4A8122002ACA73 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 157434160D4A8137002ACA73 /* Build configuration list for PBXNativeTarget "scutil-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 157434170D4A8137002ACA73 /* Debug */,
+ 157434180D4A8137002ACA73 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 157A84E40D56C63900B6F1A0 /* Build configuration list for PBXNativeTarget "DNSConfiguration-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 157A84E50D56C63900B6F1A0 /* Debug */,
+ 157A84E60D56C63900B6F1A0 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 157A84FE0D56C7E800B6F1A0 /* Build configuration list for PBXNativeTarget "IPMonitor-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 157A84FF0D56C7E800B6F1A0 /* Debug */,
+ 157A85000D56C7E800B6F1A0 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 157A85090D56C8AA00B6F1A0 /* Build configuration list for PBXNativeTarget "InterfaceNamer-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 157A850A0D56C8AA00B6F1A0 /* Debug */,
+ 157A850B0D56C8AA00B6F1A0 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 157A851F0D56C8E000B6F1A0 /* Build configuration list for PBXNativeTarget "KernelEventMonitor-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 157A85200D56C8E000B6F1A0 /* Debug */,
+ 157A85210D56C8E000B6F1A0 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 157A852A0D56C91100B6F1A0 /* Build configuration list for PBXNativeTarget "LinkConfiguration-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 157A852B0D56C91100B6F1A0 /* Debug */,
+ 157A852C0D56C91100B6F1A0 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 157A85350D56C94F00B6F1A0 /* Build configuration list for PBXNativeTarget "NetworkIdentification-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 157A85360D56C94F00B6F1A0 /* Debug */,
+ 157A85370D56C94F00B6F1A0 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 157A85400D56C96F00B6F1A0 /* Build configuration list for PBXNativeTarget "PreferencesMonitor-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 157A85410D56C96F00B6F1A0 /* Debug */,
+ 157A85420D56C96F00B6F1A0 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 158316D80CFB774B006F62B9 /* Build configuration list for PBXAggregateTarget "configd_base-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 158316D90CFB774B006F62B9 /* Debug */,
+ 158316DA0CFB774B006F62B9 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 158317000CFB7761006F62B9 /* Build configuration list for PBXAggregateTarget "configd_plugins-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 158317010CFB7761006F62B9 /* Debug */,
+ 158317020CFB7761006F62B9 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 1583170B0CFB7782006F62B9 /* Build configuration list for PBXAggregateTarget "configd_executables-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1583170C0CFB7782006F62B9 /* Debug */,
+ 1583170D0CFB7782006F62B9 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 1583175D0CFB80A1006F62B9 /* Build configuration list for PBXNativeTarget "configd-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1583175E0CFB80A1006F62B9 /* Debug */,
+ 1583175F0CFB80A1006F62B9 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 158317800CFB85C8006F62B9 /* Build configuration list for PBXNativeTarget "IPMonitor.bundle-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 158317810CFB85C8006F62B9 /* Debug */,
+ 158317820CFB85C8006F62B9 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 158317890CFB85DD006F62B9 /* Build configuration list for PBXNativeTarget "InterfaceNamer.bundle-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1583178A0CFB85DD006F62B9 /* Debug */,
+ 1583178B0CFB85DD006F62B9 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 158317920CFB85F7006F62B9 /* Build configuration list for PBXNativeTarget "KernelEventMonitor.bundle-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 158317930CFB85F7006F62B9 /* Debug */,
+ 158317940CFB85F7006F62B9 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 1583179A0CFB860C006F62B9 /* Build configuration list for PBXNativeTarget "LinkConfiguration.bundle-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1583179B0CFB860C006F62B9 /* Debug */,
+ 1583179C0CFB860C006F62B9 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 158317A20CFB8626006F62B9 /* Build configuration list for PBXNativeTarget "NetworkIdentification.bundle-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 158317A30CFB8626006F62B9 /* Debug */,
+ 158317A40CFB8626006F62B9 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 158317AA0CFB8639006F62B9 /* Build configuration list for PBXNativeTarget "PreferencesMonitor.bundle-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 158317AB0CFB8639006F62B9 /* Debug */,
+ 158317AC0CFB8639006F62B9 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 158337A60CFB6B9E0033AB93 /* Build configuration list for PBXNativeTarget "SCHelper-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 158337A70CFB6B9E0033AB93 /* Debug */,
+ 158337A80CFB6B9E0033AB93 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 15A5A2660D5B94190087BDA0 /* Build configuration list for PBXNativeTarget "SystemConfiguration.framework-EmbeddedSimulator" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 15A5A2670D5B94190087BDA0 /* Debug */,
+ 15A5A2680D5B94190087BDA0 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 15C64A270F684C6B00D78394 /* Build configuration list for PBXAggregateTarget "configd_libSystem" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 15C64A1F0F684C3300D78394 /* Debug */,
+ 15C64A200F684C3300D78394 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 15C64A2B0F684C6B00D78394 /* Build configuration list for PBXAggregateTarget "configd_libSystem-Embedded" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 15C64A2C0F684C6B00D78394 /* Debug */,
+ 15C64A2D0F684C6B00D78394 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 15FD13C60D59485000F9409C /* Build configuration list for PBXAggregateTarget "All-EmbeddedSimulator" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- 156EB63F0905594A00EEF749 /* Development */,
- 156EB6400905594A00EEF749 /* Deployment */,
- 156EB6410905594A00EEF749 /* Default */,
+ 15FD13C70D59485000F9409C /* Debug */,
+ 15FD13C80D59485000F9409C /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
F95B8A610B03F83200993BA3 /* Build configuration list for PBXNativeTarget "NetworkIdentification" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- F95B8A620B03F83200993BA3 /* Development */,
- F95B8A630B03F83200993BA3 /* Deployment */,
- F95B8A640B03F83200993BA3 /* Default */,
+ F95B8A620B03F83200993BA3 /* Debug */,
+ F95B8A630B03F83200993BA3 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
F95B8A6C0B03F9D100993BA3 /* Build configuration list for PBXNativeTarget "NetworkIdentification.bundle" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- F95B8A6D0B03F9D100993BA3 /* Development */,
- F95B8A6E0B03F9D100993BA3 /* Deployment */,
- F95B8A6F0B03F9D100993BA3 /* Default */,
+ F95B8A6D0B03F9D100993BA3 /* Debug */,
+ F95B8A6E0B03F9D100993BA3 /* Release */,
);
defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Default;
+ defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
/*
- * Copyright (c) 2004-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004-2006, 2008, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* These routines provide access to the systems DNS configuration
*/
-#include <AvailabilityMacros.h>
+#include <Availability.h>
#include <sys/cdefs.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
-
#define DEFAULT_SEARCH_ORDER 200000 /* search order for the "default" resolver domain name */
#define DNS_PTR(type, name) \
/*
* DNS configuration access APIs
*/
-const char * dns_configuration_notify_key (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
-dns_config_t * dns_configuration_copy (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
-void dns_configuration_free (dns_config_t *config) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+const char *
+dns_configuration_notify_key () __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0);
-__END_DECLS
+dns_config_t *
+dns_configuration_copy () __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0);
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 */
+void
+dns_configuration_free (dns_config_t *config) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0);
+
+__END_DECLS
#endif /* __DNSINFO_H__ */
/*
- * Copyright (c) 2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* - initial revision
*/
+#include <stdio.h>
#include <stdlib.h>
+#include <pthread.h>
#include <mach/mach.h>
#include <mach/mach_error.h>
#include "shared_dns_info.h"
+static pthread_once_t _dns_initialized = PTHREAD_ONCE_INIT;
+static pthread_mutex_t _dns_lock = PTHREAD_MUTEX_INITIALIZER;
+static mach_port_t _dns_server = MACH_PORT_NULL;
+
+
+static void
+__dns_fork_handler()
+{
+ // the process has forked (and we are the child process)
+ _dns_server = MACH_PORT_NULL;
+ return;
+}
+
+
+static void
+__dns_initialize(void)
+{
+ // add handler to cleanup after fork()
+ (void) pthread_atfork(NULL, NULL, __dns_fork_handler);
+
+ return;
+}
+
+
static boolean_t
add_list(void **padding, uint32_t *n_padding, int32_t count, int32_t size, void **list)
{
mach_port_t server;
kern_return_t status;
- server = _dns_configuration_server_port();
- if (server == MACH_PORT_NULL) {
- return NULL;
- }
+ // initialize runtime
+ pthread_once(&_dns_initialized, __dns_initialize);
- status = shared_dns_infoGet(server, &dataRef, &dataLen);
- (void)mach_port_deallocate(mach_task_self(), server);
- if (status != KERN_SUCCESS) {
- mach_error("shared_dns_infoGet():", status);
- return NULL;
+ // open a new session with the DNS configuration server
+ server = _dns_server;
+ while (TRUE) {
+ if (server != MACH_PORT_NULL) {
+ status = shared_dns_infoGet(server, &dataRef, &dataLen);
+ if (status == KERN_SUCCESS) {
+ break;
+ }
+
+ // our [cached] server port is not valid
+ if (status != MACH_SEND_INVALID_DEST) {
+ // if we got an unexpected error, don't retry
+ fprintf(stderr,
+ "dns_configuration_copy shared_dns_infoGet(): %s\n",
+ mach_error_string(status));
+ break;
+ }
+ }
+
+ pthread_mutex_lock(&_dns_lock);
+ if (_dns_server != MACH_PORT_NULL) {
+ if (server == _dns_server) {
+ // if the server we tried returned the error
+ (void)mach_port_deallocate(mach_task_self(), server);
+ _dns_server = _dns_configuration_server_port();
+ } else {
+ // another thread has refreshed the DNS server port
+ }
+ } else {
+ _dns_server = _dns_configuration_server_port();
+ }
+ server = _dns_server;
+ pthread_mutex_unlock(&_dns_lock);
+
+ if (server == MACH_PORT_NULL) {
+ // if server not available
+ break;
+ }
}
if (dataRef != NULL) {
}
-__private_extern__
const char *
dns_configuration_notify_key()
{
}
-__private_extern__
dns_config_t *
dns_configuration_copy()
{
}
-__private_extern__
void
dns_configuration_free(dns_config_t *config)
{
/*
- * Copyright (c) 2004, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004, 2006, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
*/
-__private_extern__
dns_create_config_t
_dns_configuration_create()
{
}
-__private_extern__
void
_dns_configuration_add_resolver(dns_create_config_t *_config,
dns_create_resolver_t _resolver)
}
-__private_extern__
_Bool
_dns_configuration_store(dns_create_config_t *_config)
{
}
-__private_extern__
void
_dns_configuration_free(dns_create_config_t *_config)
{
* DNS resolver configuration functions
*/
-__private_extern__
dns_create_resolver_t
_dns_resolver_create()
{
}
-__private_extern__
void
_dns_resolver_set_domain(dns_create_resolver_t *_resolver, const char *domain)
{
}
-__private_extern__
void
_dns_resolver_add_nameserver(dns_create_resolver_t *_resolver, struct sockaddr *nameserver)
{
}
-__private_extern__
void
_dns_resolver_set_port(dns_create_resolver_t *_resolver, uint16_t port)
{
}
-__private_extern__
void
_dns_resolver_add_search(dns_create_resolver_t *_resolver, const char *search)
{
}
-__private_extern__
void
_dns_resolver_add_sortaddr(dns_create_resolver_t *_resolver, dns_sortaddr_t *sortaddr)
{
}
-__private_extern__
void
_dns_resolver_set_options(dns_create_resolver_t *_resolver, const char *options)
{
}
-__private_extern__
void
_dns_resolver_set_timeout(dns_create_resolver_t *_resolver, uint32_t timeout)
{
}
-__private_extern__
void
_dns_resolver_set_order(dns_create_resolver_t *_resolver, uint32_t order)
{
}
-__private_extern__
void
_dns_resolver_free(dns_create_resolver_t *_resolver)
{
/*
- * Copyright (c) 2004-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004-2006, 2008, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* These routines provide access to the systems DNS configuration
*/
-#include <AvailabilityMacros.h>
+#include <TargetConditionals.h>
+#include <Availability.h>
#include <sys/cdefs.h>
#include <stdint.h>
#include <sys/types.h>
#include <dnsinfo.h>
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
-
typedef const struct __dns_create_config * dns_create_config_t;
typedef const struct __dns_create_resolver * dns_create_resolver_t;
+#if !TARGET_OS_IPHONE
+#ifndef _PATH_RESOLVER_DIR
+#define _PATH_RESOLVER_DIR "/etc/resolver"
+#endif
+#endif /* !TARGET_OS_IPHONE */
+
__BEGIN_DECLS
+/*
+ * NOTE: __private_extern__ and __OSX_AVAILABLE_STARTING() cannot be mixed
+ * due to a "visibility" conflict
+ */
+
/*
* DNS configuration creation APIs
*/
-dns_create_config_t _dns_configuration_create (void);
-void _dns_configuration_add_resolver (dns_create_config_t *_config, dns_create_resolver_t _resolver);
-_Bool _dns_configuration_store (dns_create_config_t *_config);
-void _dns_configuration_free (dns_create_config_t *_config);
+__private_extern__
+dns_create_config_t
+_dns_configuration_create (void) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
+
+__private_extern__
+void
+_dns_configuration_add_resolver (dns_create_config_t *_config,
+ dns_create_resolver_t _resolver) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
+
+__private_extern__
+_Bool
+_dns_configuration_store (dns_create_config_t *_config) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
+
+__private_extern__
+void
+_dns_configuration_free (dns_create_config_t *_config) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
/*
* DNS [resolver] configuration creation APIs
*/
-dns_create_resolver_t _dns_resolver_create (void);
-void _dns_resolver_set_domain (dns_create_resolver_t *_resolver, const char *domain);
-void _dns_resolver_add_nameserver (dns_create_resolver_t *_resolver, struct sockaddr *nameserver);
-void _dns_resolver_set_port (dns_create_resolver_t *_resolver, uint16_t port); // host byte order
-void _dns_resolver_add_search (dns_create_resolver_t *_resolver, const char *search);
-void _dns_resolver_add_sortaddr (dns_create_resolver_t *_resolver, dns_sortaddr_t *sortaddr);
-void _dns_resolver_set_options (dns_create_resolver_t *_resolver, const char *options);
-void _dns_resolver_set_timeout (dns_create_resolver_t *_resolver, uint32_t timeout);
-void _dns_resolver_set_order (dns_create_resolver_t *_resolver, uint32_t order);
-void _dns_resolver_free (dns_create_resolver_t *_resolver);
+__private_extern__
+dns_create_resolver_t
+_dns_resolver_create (void) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
-__END_DECLS
+__private_extern__
+void
+_dns_resolver_set_domain (dns_create_resolver_t *_resolver,
+ const char *domain) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
+
+__private_extern__
+void
+_dns_resolver_add_nameserver (dns_create_resolver_t *_resolver,
+ struct sockaddr *nameserver) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
+
+__private_extern__
+void
+_dns_resolver_set_port (dns_create_resolver_t *_resolver,
+ uint16_t port) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/; // host byte order
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 */
+__private_extern__
+void
+_dns_resolver_add_search (dns_create_resolver_t *_resolver,
+ const char *search) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
+
+__private_extern__
+void
+_dns_resolver_add_sortaddr (dns_create_resolver_t *_resolver,
+ dns_sortaddr_t *sortaddr) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
+
+__private_extern__
+void
+_dns_resolver_set_options (dns_create_resolver_t *_resolver,
+ const char *options) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
+
+__private_extern__
+void
+_dns_resolver_set_timeout (dns_create_resolver_t *_resolver,
+ uint32_t timeout) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
+
+__private_extern__
+void
+_dns_resolver_set_order (dns_create_resolver_t *_resolver,
+ uint32_t order) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
+
+__private_extern__
+void
+_dns_resolver_free (dns_create_resolver_t *_resolver) /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
+
+#if !TARGET_OS_IPHONE
+/*
+ * DNS [resolver] flat-file configuration creation APIs
+ */
+__private_extern__
+void
+_dnsinfo_flatfile_add_resolvers (dns_create_config_t *config) /*__OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_NA)*/;
+#endif // !TARGET_OS_IPHONE
+
+__END_DECLS
#endif /* __DNSINFO_CREATE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2009 Apple Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+
+#include <dirent.h>
+#include <fcntl.h>
+#include <libgen.h>
+#include <netdb.h>
+#include <resolv.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/dir.h>
+#include <unistd.h>
+
+#include "dnsinfo.h"
+#include "dnsinfo_private.h"
+#include "dnsinfo_create.h"
+
+enum {
+ TOKEN_NAMESERVER,
+ TOKEN_PORT,
+ TOKEN_DOMAIN,
+ TOKEN_SEARCH,
+ TOKEN_SEARCH_ORDER,
+ TOKEN_SORTLIST,
+ TOKEN_TIMEOUT,
+ TOKEN_OPTIONS,
+ TOKEN_MAX
+};
+
+/*
+ * tokens
+ * The supported configuration token strings and enumerated values.
+ */
+static const struct {
+ const char *name;
+ int token;
+ int max_count;
+} tokens [] = {
+ { "nameserver", TOKEN_NAMESERVER, MAXNS },
+ { "port", TOKEN_PORT, 1 },
+ { "domain", TOKEN_DOMAIN, 1 },
+ { "search", TOKEN_SEARCH, 1 },
+ { "search_order", TOKEN_SEARCH_ORDER, 1 },
+ { "sortlist", TOKEN_SORTLIST, 1 },
+ { "timeout", TOKEN_TIMEOUT, 1 },
+ { "options", TOKEN_OPTIONS, 1 },
+};
+
+
+/*
+ * _dnsinfo_parse_address
+ *
+ * Parse IP address
+ */
+static struct sockaddr *
+_dnsinfo_parse_address(char *nameserver)
+{
+ struct addrinfo *ai;
+ struct addrinfo hints;
+ int res;
+ struct sockaddr *sa = NULL;
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_flags = AI_NUMERICHOST;
+
+ res = getaddrinfo(nameserver, NULL, &hints, &ai);
+ if (res == 0) {
+ if ((ai->ai_family == AF_INET) || (ai->ai_family == AF_INET6)) {
+ sa = malloc(ai->ai_addrlen);
+ memcpy(sa, ai->ai_addr, ai->ai_addrlen);
+ }
+ freeaddrinfo(ai);
+ }
+
+ return sa;
+}
+
+
+/*
+ * _dnsinfo_parse_nameserver
+ *
+ * Parse arguments to the nameserver token. This is essentially a getaddrinfo(3)
+ * with AI_NUMERICHOST. However, if the conversion fails, check if the address
+ * contains an optional trailing '.' followed by a numeric port number. If found,
+ * remove the port number and retry the conversion (e.g. 127.0.0.1.55 or ::1.55).
+ */
+static struct sockaddr *
+_dnsinfo_parse_nameserver(char *token)
+{
+ char *dot;
+ long number;
+ struct sockaddr *sa;
+
+ sa = _dnsinfo_parse_address(token);
+ if (sa != NULL) {
+ return sa;
+ }
+
+ // if we could not parse address, attempt to remove
+ // an optional trailing port number
+ dot = strrchr(token, '.');
+ if (dot == NULL) {
+ return NULL;
+ }
+
+ number = strtol(dot + 1, NULL, 10);
+ if ((number < 0) || (number > UINT16_MAX)) {
+ return NULL;
+ }
+
+ *dot = '\0';
+ sa = _dnsinfo_parse_address(token);
+ if (sa != NULL) {
+ in_port_t port = htons(number);
+
+ switch (sa->sa_family) {
+ case AF_INET :
+ ((struct sockaddr_in *)sa)->sin_port = port;
+ break;
+ case AF_INET6 :
+ ((struct sockaddr_in6 *)sa)->sin6_port = port;
+ break;
+ }
+ }
+
+ return sa;
+}
+
+
+/*
+ * _dnsinfo_parse_sortaddr
+ *
+ * Parse arguments to the sortlist token.
+ */
+static dns_sortaddr_t *
+_dnsinfo_parse_sortaddr(char *token)
+{
+ struct in_addr addr;
+ struct in_addr mask;
+ struct sockaddr *sa;
+ char *slash;
+ dns_sortaddr_t *sortaddr = NULL;
+
+ slash = strchr(token, '/');
+ if (slash != NULL) {
+ *slash = '\0';
+ }
+
+ sa = _dnsinfo_parse_address(token);
+ if (sa == NULL) {
+ // if we could not parse the address
+ goto done;
+ } else if (sa->sa_family != AF_INET) {
+ // if not AF_INET
+ goto done;
+ } else {
+ addr = ((struct sockaddr_in *)sa)->sin_addr;
+ free(sa);
+ sa = NULL;
+ }
+
+ if (slash != NULL) {
+ sa = _dnsinfo_parse_address(slash + 1);
+ if (sa == NULL) {
+ // if we could not parse the provided mask
+ goto done;
+ } else if (sa->sa_family != AF_INET) {
+ // if mask not AF_INET
+ goto done;
+ } else {
+ mask = ((struct sockaddr_in *)sa)->sin_addr;
+ free(sa);
+ sa = NULL;
+ }
+ } else {
+ in_addr_t a;
+ in_addr_t m;
+
+ a = ntohl(addr.s_addr);
+ if (IN_CLASSA(a)) {
+ m = IN_CLASSA_NET;
+ } else if (IN_CLASSB(a)) {
+ m = IN_CLASSB_NET;
+ } else if (IN_CLASSC(a)) {
+ m = IN_CLASSC_NET;
+ } else {
+ goto done;
+ }
+
+ mask.s_addr = htonl(m);
+ }
+
+ sortaddr = malloc(sizeof(*sortaddr));
+ sortaddr->address = addr;
+ sortaddr->mask = mask;
+
+ done :
+
+ if (sa != NULL) free(sa);
+ return sortaddr;
+}
+
+
+/*
+ * _dnsinfo_flatfile_create_resolver
+ *
+ * Create a new dns resolver configuration from the configuration file at the
+ * specified path. (e.g. /etc/resolv.conf or /etc/resolver/apple.com)
+ */
+static dns_create_resolver_t
+_dnsinfo_flatfile_create_resolver(const char *dir, const char *path)
+{
+ char *buf;
+ FILE *f;
+ char filename[FILENAME_MAX];
+ size_t len = 0;
+ char *line = NULL;
+ dns_create_resolver_t res = NULL;
+ const char *sep = " \t";
+ int token_count[TOKEN_MAX] = { 0 };
+
+ filename[0] = 0;
+ if (dir != NULL) {
+ strlcpy(filename, dir, sizeof(filename));
+ strlcat(filename, "/", sizeof(filename));
+ }
+ strlcat(filename, path, sizeof(filename));
+
+ f = fopen(filename, "r");
+ if (f == NULL) return NULL;
+
+ while ((buf = fgetln(f, &len)) != NULL) {
+ int i;
+ char *lineptr;
+ int max_count;
+ int token;
+ char *word;
+
+ if (len == 0) continue;
+ if (buf[len-1] == '\n') buf[len-1] = '\0';
+
+ line = reallocf(line, len+1);
+ if (line == NULL) continue;
+
+ strncpy(line, buf, len);
+ line[len] = '\0';
+
+ // parse the first word of the line (the config token)
+ lineptr = line;
+ word = strsep(&lineptr, sep);
+ if (word == NULL) {
+ // if empty line
+ continue;
+ }
+ if (word[0] == ';' || word[0] == '#') {
+ // if comment
+ continue;
+ }
+
+ // translate config token to enumerated value
+ token = -1;
+ for (i = 0; i < sizeof(tokens) / sizeof(tokens[0]); i++) {
+ if (strcasecmp(word, tokens[i].name) == 0) {
+ token = tokens[i].token;
+ max_count = tokens[i].max_count;
+ break;
+ }
+ }
+ if (token == -1) {
+ // if not a recognized token
+ continue;
+ }
+
+ // parse the next word of the line (the config option)
+ word = strsep(&lineptr, sep);
+ if (word == NULL) {
+ // if no option
+ continue;
+ }
+ if (++token_count[token] > max_count) {
+ // if too many options
+ continue;
+ }
+
+ // create resolver
+ if (res == NULL) {
+ res = _dns_resolver_create();
+ if (res == NULL) {
+ // if we could not create a resolver
+ goto done;
+ }
+ }
+
+ switch (token) {
+ case TOKEN_DOMAIN:
+ _dns_resolver_set_domain(&res, word);
+ break;
+
+ case TOKEN_NAMESERVER: {
+ struct sockaddr *sa;
+
+ sa = _dnsinfo_parse_nameserver(word);
+ if (sa != NULL) {
+ _dns_resolver_add_nameserver(&res, sa);
+ free(sa);
+ }
+ break;
+ }
+
+ case TOKEN_PORT: {
+ long number = -1;
+
+ number = strtol(word, NULL, 0);
+ if (number < 0 || number > UINT16_MAX) break;
+ _dns_resolver_set_port(&res, number);
+ break;
+ }
+
+ case TOKEN_SEARCH: {
+ int n = 0;
+
+ // multiple search domains are supported
+ while ((word != NULL) && (n++ < MAXDNSRCH)) {
+ _dns_resolver_add_search(&res, word);
+ word = strsep(&lineptr, sep);
+ }
+ break;
+ }
+
+ case TOKEN_SORTLIST: {
+ int n = 0;
+
+ while ((word != NULL) && (n++ < MAXRESOLVSORT)) {
+ dns_sortaddr_t *sortaddr;
+
+ sortaddr = _dnsinfo_parse_sortaddr(word);
+ if (sortaddr == NULL) break;
+ _dns_resolver_add_sortaddr(&res, sortaddr);
+ free(sortaddr);
+ word = strsep(&lineptr, sep);
+ }
+ break;
+ }
+
+ case TOKEN_OPTIONS:
+ _dns_resolver_set_options(&res, lineptr);
+ break;
+
+ case TOKEN_TIMEOUT: {
+ long number = -1;
+
+ number = strtol(word, NULL, 0);
+ if (number < 0 || number > UINT32_MAX) break;
+ _dns_resolver_set_timeout(&res, number);
+ break;
+ }
+
+ case TOKEN_SEARCH_ORDER: {
+ long number = -1;
+
+ number = strtol(word, NULL, 0);
+ if (number < 0 || number > UINT32_MAX) break;
+ _dns_resolver_set_order(&res, number);
+ break;
+ }
+ }
+ }
+ if (line != NULL) free(line);
+
+ // set the domain to the basename of the path if not specified
+ if ((res != NULL) && (token_count[TOKEN_DOMAIN] == 0)) {
+ const char *domain;
+
+ domain = strrchr(path, '/');
+ if (domain == NULL) {
+ domain = path;
+ } else {
+ domain = domain + 1;
+ }
+ _dns_resolver_set_domain(&res, domain);
+ }
+
+ done :
+
+ fclose(f);
+ return res;
+}
+
+
+/*
+ * _dnsinfo_flatfile_add_resolvers
+ *
+ * Parse the files in the resolver config directory (/etc/resolver) and add each
+ * resolver to the dns config.
+ */
+void
+_dnsinfo_flatfile_add_resolvers(dns_create_config_t *config)
+{
+ struct dirent *de;
+ DIR *dp;
+ dns_create_resolver_t res;
+
+ dp = opendir(_PATH_RESOLVER_DIR);
+ if (dp == NULL) {
+ return;
+ }
+
+ while ((de = readdir(dp)) != NULL) {
+ if (strcmp(de->d_name, ".") == 0 ||
+ strcmp(de->d_name, "..") == 0) continue;
+
+ res = _dnsinfo_flatfile_create_resolver(_PATH_RESOLVER_DIR, de->d_name);
+ if (res != NULL) {
+ _dns_configuration_add_resolver(config, res);
+ _dns_resolver_free(&res);
+ }
+ }
+
+ closedir(dp);
+ return;
+}
+
+
+#ifdef MAIN
+
+#include "dnsinfo_copy.c"
+
+int
+main(int argc, char **argv)
+{
+ uint8_t *buf;
+ dns_config_t *config;
+ dns_create_config_t create_config;
+ _dns_config_buf_t *config_buf;
+ uint32_t n_config;
+ uint32_t n_padding;
+ dns_create_resolver_t resolver;
+
+ resolver = _dnsinfo_flatfile_create_resolver(NULL, _PATH_RESCONF);
+
+ create_config = _dns_configuration_create();
+ _dnsinfo_flatfile_add_resolvers(&create_config);
+
+ config_buf = (_dns_config_buf_t *)create_config;
+ n_config = sizeof(_dns_config_buf_t) + ntohl(config_buf->n_attribute);
+ n_padding = ntohl(config_buf->n_padding);
+ buf = malloc(n_config + n_padding);
+ bcopy((void *)config_buf, buf, n_config);
+ bzero(&buf[n_config], n_padding);
+ config = expand_config((_dns_config_buf_t *)buf);
+
+ return 0;
+}
+#endif
/*
- * Copyright (c) 2004, 2005, 2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2004, 2005, 2007, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
/*
- * Copyright (c) 2004-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004-2006, 2008, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#define __DNSINFO_PRIVATE_H__
-#include <AvailabilityMacros.h>
+#include <Availability.h>
#include <sys/cdefs.h>
#include <stdint.h>
#include <sys/types.h>
#include "dnsinfo.h"
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
-
/*
* What's all of this stuff about???
*
__BEGIN_DECLS
-const char * _dns_configuration_notify_key (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
-mach_port_t _dns_configuration_server_port (void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+/*
+ * NOTE: __private_extern__ and __OSX_AVAILABLE_STARTING() cannot be mixed
+ * due to a "visibility" conflict
+ */
+
+__private_extern__
+const char *
+_dns_configuration_notify_key () /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
-__END_DECLS
+__private_extern__
+mach_port_t
+_dns_configuration_server_port () /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 */
+__END_DECLS
#endif /* __DNSINFO_PRIVATE_H__ */
/*
- * Copyright (c) 2004-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004-2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
mach_msg_type_number_t dataLen,
audit_token_t audit_token)
{
- uid_t euid = 0;
- CFDataRef new_dns_info = NULL;
- const char *notify_key;
+ uid_t euid = 0;
+ CFDataRef new_dns_info = NULL;
+ const char *notify_key;
if ((dataRef != NULL) && (dataLen > 0)) {
if (!_SCUnserializeData(&new_dns_info, (void *)dataRef, dataLen)) {
/*
- * Copyright (c) 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004, 2005, 2009 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
__BEGIN_DECLS
+__private_extern__
kern_return_t _shared_dns_infoGet (mach_port_t server,
dnsDataOut_t *dataRef,
mach_msg_type_number_t *dataLen);
+__private_extern__
kern_return_t _shared_dns_infoSet (mach_port_t server,
dnsData_t dataRef,
mach_msg_type_number_t dataLen,
/*
- * Copyright (c) 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004, 2005, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
routine shared_dns_infoGet ( server : mach_port_t;
out data : dnsDataOut, dealloc);
+#ifndef LIBDNSINFO_A
routine shared_dns_infoSet ( server : mach_port_t;
data : dnsData;
ServerAuditToken audit_token : audit_token_t);
+#else // LIBDNSINFO_A
+ skip; /* shared_dns_infoSet */
+#endif LIBDNSINFO_A
/*
- * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004, 2007 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#define mig_external __private_extern__
/* Turn MIG type checking on by default */
+#ifdef __MigTypeCheck
+#undef __MigTypeCheck
+#endif
#define __MigTypeCheck 1
/*
#!/bin/sh
-# Copyright (c) 2004-2007 Apple Inc.
+# Copyright (c) 2004-2009 Apple Inc.
#
# get-mobility-info
#
OUTDIR="/var/tmp"
if [ -d ~/Desktop ]; then
OUTDIR=~/Desktop
+elif [ "`readlink /tmp`" = "private/var/tmp" ]; then
+ OUTDIR=/Library/Logs/CrashReporter/SystemConfiguration
+ mkdir -p ${OUTDIR}
fi
umask 077
exit 1
fi
-ARCHIVE=`mktemp -q "${OUTDIR}/${OUT}.tar.gz"`
+GZ_EXT=""
+GZ_OPT=""
+if [ -x /usr/bin/gzip ]; then
+ GZ_EXT=".gz"
+ GZ_OPT="-z"
+fi
+
+ARCHIVE=`mktemp -q "${OUTDIR}/${OUT}.tar${GZ_EXT}"`
if [ $? -ne 0 ]; then
echo "Could not create snapshot archive"
rm -rf "${WORKDIR}"
#
# IOKit info
#
-ioreg -i -l -w 0 > ioreg 2>&1
+ioreg -i -l -w 0 > ioreg 2>&1
+ioreg -i -l -p IODeviceTree -w 0 >> ioreg 2>&1
#
# Host name
/Library/Preferences/SystemConfiguration/com.apple.nat.plist \
/Library/Preferences/SystemConfiguration/com.apple.network.identification.plist \
/Library/Preferences/SystemConfiguration/com.apple.smb.server.plist \
+ /Library/Preferences/SystemConfiguration/com.apple.wifi.plist \
/Library/Preferences/SystemConfiguration/preferences.plist \
+ /Library/Preferences/com.apple.alf.plist \
/Library/Preferences/com.apple.sharing.firewall.plist \
do
# network reachability
#
scutil -d -v -r www.apple.com > reachability-info 2>&1
-if [ -x /usr/bin/dig ]; then
- dig -t any -c any www.apple.com > dig-results 2>&1
+if [ -x /usr/bin/dig -a -f /etc/resolv.conf ]; then
+ /usr/bin/dig -t any -c any www.apple.com > dig-results 2>/dev/null
fi
#
fi
#
-# system log, early boot log messages
+# system log, kernel.log, early boot log messages
+#
+if [ -x /usr/bin/syslog ]; then
+ ${PRIV} syslog | tail -n 25000 > syslog
+ if [ -d /var/log/DiagnosticMessages ]; then
+ ${PRIV} syslog -d /var/log/DiagnosticMessages \
+ -F raw \
+ -T local \
+ | tail -n 25000 > DiagnosticMessages
+ fi
+else
+ if [ -f /var/log/system.log ]; then
+ ${PRIV} tail -n 25000 /var/log/system.log > system.log
+ fi
+ if [ -f /var/log/kernel.log ]; then
+ ${PRIV} tail -n 25000 /var/log/kernel.log > kernel.log
+ fi
+fi
+${PRIV} dmesg > dmesg
+
+#
+# IPConfiguration log
#
-${PRIV} tail -n 2000 /var/log/system.log > system.log
-${PRIV} dmesg > dmesg
+if [ -f /var/log/com.apple.IPConfiguration.bootp ]; then
+ ${PRIV} tail -n 2000 /var/log/com.apple.IPConfiguration.bootp \
+ > com.apple.IPConfiguration.bootp
+fi
#
# ppp log file(s)
if [ -f "${logFile}" ]; then
b="`basename ${logFile}`"
cat "${logFile}" > "${b}" 2>&1
- fi
+ fi
done
#
# network statistics
#
echo "#" > network-statistics
-echo "# netstat -n -a -A -f inet" >> network-statistics
+echo "# arp -n -a" >> network-statistics
echo "#" >> network-statistics
-netstat -n -a -A -f inet >> network-statistics 2>&1
+arp -n -a >> network-statistics 2>&1
echo "#" >> network-statistics
-echo "# lsof -i -n -P" >> network-statistics
+echo "# netstat -n -a -A" >> network-statistics
echo "#" >> network-statistics
-${PRIV} lsof -i -n -P >> network-statistics 2>&1
+netstat -n -a -A >> network-statistics 2>&1
+
+if [ -x /usr/sbin/lsof ]; then
+ echo "#" >> network-statistics
+ echo "# lsof -i -n -P" >> network-statistics
+ echo "#" >> network-statistics
+ ${PRIV} lsof -i -n -P >> network-statistics 2>&1
+fi
echo "#" >> network-statistics
echo "# netstat -s" >> network-statistics
echo "#" >> network-statistics
netstat -i -n -d >> network-statistics 2>&1
-echo "#" >> network-statistics
-echo "# ipfw -at show" >> network-statistics
-echo "#" >> network-statistics
-ipfw -at show >> network-statistics 2>&1
+if [ -x /sbin/ipfw ]; then
+ echo "#" >> network-statistics
+ echo "# ipfw -at show" >> network-statistics
+ echo "#" >> network-statistics
+ ipfw -at show >> network-statistics 2>&1
+fi
-echo "#" >> network-statistics
-echo "# appletalk -s" >> network-statistics
-echo "#" >> network-statistics
-appletalk -s >> network-statistics 2>&1
+if [ -x /usr/sbin/appletalk ]; then
+ echo "#" >> network-statistics
+ echo "# appletalk -s" >> network-statistics
+ echo "#" >> network-statistics
+ appletalk -s >> network-statistics 2>&1
+fi
#
# system usage statistics
echo "#" >> ipsec
${PRIV} setkey -Pp -D >> ipsec
-for CF in /etc/racoon/remote/*.conf
+for CF in /var/run/racoon/*.conf
do
+ if [ ! -r "${CF}" ]; then
+ continue
+ fi
+
echo "" >> ipsec
echo "#" >> ipsec
echo "# ${CF}" >> ipsec
#
# Kerberos configuration
#
-echo "#" > kerberos
-echo "# klist -e -c -A -f -a -n" >> kerberos
-echo "#" >> kerberos
-${PRIV} klist -e -c -A -f -a -n >> kerberos
+if [ -x /usr/bin/klist ]; then
+ echo "#" > kerberos
+ echo "# klist -e -c -A -f -a -n" >> kerberos
+ echo "#" >> kerberos
+ ${PRIV} klist -e -c -A -f -a -n >> kerberos 2>&1
-echo "#" >> kerberos
-echo "# klist -e -k -t -K" >> kerberos
-echo "#" >> kerberos
-${PRIV} klist -e -k -t -K >> kerberos
+ echo "#" >> kerberos
+ echo "# klist -e -k -t -K" >> kerberos
+ echo "#" >> kerberos
+ ${PRIV} klist -e -k -t -K >> kerberos 2>&1
+fi
#
# BTMM configuration
#
DIG()
{
- /usr/bin/dig @pm-members.mac.com -y "${DOMAIN}:${TSIG}" +short "${1}" "${2}"
+ /usr/bin/dig @pm-members.mac.com -y "${DOMAIN}:${TSIG}" +short "${1}" "${2}" 2>/dev/null
}
scutil <<_END_OF_INPUT \
# lookup TSIG in base64 format
TSIG=` \
${PRIV} security find-generic-password \
- -a ${DOMAIN} \
+ -s dns:${DOMAIN} \
-g /Library/Keychains/System.keychain 2>&1 \
| grep "^password: " \
| cut -d '"' -f 2 \
continue
fi
+ KEYHASH="[SHA-1:`echo ${TSIG} | openssl sha1`]"
+ echo "" >> btmm
+ echo " KEY: ${KEYHASH}" >> btmm
+
for TYPE in \
_afpovertcp._tcp \
_airport._tcp \
_adisk._tcp \
+ _http._tcp \
_rfb._tcp \
_smb._tcp \
_ssh._tcp
fi
HOST=`/bin/echo "${SRV}" | cut -d ' ' -f 4-`
+ if [ -n "${HOST}" ]; then
V4=`DIG ${HOST} a`
+ V6=`DIG ${HOST} aaaa`
+ KRB=`DIG _kerberos.${HOST} txt`
+ TUN=`DIG _autotunnel._udp.${HOST} srv`
+ else
+ V4=""
+ V6=""
+ KRB=""
+ TUN=""
+ fi
if [ -n "${V4}" ]; then
echo " v4: ${V4}" >> btmm
fi
- V6=`DIG ${HOST} aaaa`
if [ -n "${V6}" ]; then
echo " v6: ${V6}" >> btmm
fi
-
- KRB=`DIG _kerberos.${HOST} txt`
echo " KRB: ${KRB}" >> btmm
-
- TUN=`DIG _autotunnel._udp.${HOST} srv`
echo " TUN: ${TUN}" >> btmm
-
+ if [ -n "${TUN}" ]; then
HOST=`/bin/echo "${TUN}" | cut -d ' ' -f 4-`
+ if [ -n "${HOST}" ]; then
V4=`DIG ${HOST} a`
+ V6=`DIG ${HOST} aaaa`
+ fi
if [ -n "${V4}" ]; then
echo " v4: ${V4}" >> btmm
fi
- V6=`DIG ${HOST} aaaa`
if [ -n "${V6}" ]; then
echo " v6: ${V6}" >> btmm
fi
+ fi
done
done
done
#
# collect crash reports
#
-CRASH_DIR=/Library/Logs/CrashReporter
-for daemon in bootpd configd pppd
+for daemon in \
+ bootpd \
+ configd \
+ eapolclient \
+ mDNSResponder \
+ mDNSResponderHelper \
+ pppd \
+ racoon \
+ socketfilterfw \
+ SCHelper \
+ SCMonitor \
+
do
- /bin/ls -1 ${CRASH_DIR}/${daemon}_*.crash 2>/dev/null \
+ /bin/ls -1 /Library/Logs/CrashReporter/${daemon}_*.crash \
+ /Library/Logs/DiagnosticReports/${daemon}/*.crash \
+ 2>/dev/null \
| while read log
do
b="`basename ${log}`"
# collect everything into a single archive
#
cd "${WORKDIR}/.."
-tar cfz "${ARCHIVE}" "${OUT}"
+pax -w ${GZ_OPT} -f "${ARCHIVE}" "${OUT}"
rm -rf "${WORKDIR}"
if [ ${UID} -eq 0 ]; then
fi
echo "Network data collected to \"${ARCHIVE}\""
+
+#
+# if requested, generate a crash report
+#
+if [ "${OUTDIR}" = "/Library/Logs/CrashReporter/SystemConfiguration" -a "${1}" = "CRASH" ]; then
+ kill -ABRT $$
+fi
+
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CurrentSet</key>
- <string>/Sets/0</string>
- <key>NetworkServices</key>
- <dict>
- <key>0</key>
- <dict>
- <key>AppleTalk</key>
- <dict>
- <key>ConfigMethod</key>
- <string>Node</string>
- <key>__INACTIVE__</key>
- <integer>1</integer>
- </dict>
- <key>DNS</key>
- <dict/>
- <key>Ethernet</key>
- <dict/>
- <key>IPv4</key>
- <dict>
- <key>ConfigMethod</key>
- <string>DHCP</string>
- </dict>
- <key>IPv6</key>
- <dict>
- <key>ConfigMethod</key>
- <string>Automatic</string>
- </dict>
- <key>Interface</key>
- <dict>
- <key>DeviceName</key>
- <string>en0</string>
- <key>Hardware</key>
- <string>Ethernet</string>
- <key>Type</key>
- <string>Ethernet</string>
- <key>UserDefinedName</key>
- <string>Built-in Ethernet</string>
- </dict>
- <key>PPP</key>
- <dict>
- <key>CommDisplayTerminalWindow</key>
- <integer>0</integer>
- <key>CommRedialCount</key>
- <integer>1</integer>
- <key>CommRedialEnabled</key>
- <integer>1</integer>
- <key>CommRedialInterval</key>
- <integer>30</integer>
- <key>DialOnDemand</key>
- <integer>0</integer>
- <key>DisconnectOnIdle</key>
- <integer>1</integer>
- <key>DisconnectOnIdleTimer</key>
- <integer>600</integer>
- <key>DisconnectOnLogout</key>
- <integer>0</integer>
- <key>IPCPCompressionVJ</key>
- <integer>1</integer>
- <key>IdleReminder</key>
- <integer>1</integer>
- <key>IdleReminderTimer</key>
- <integer>900</integer>
- <key>LCPEchoEnabled</key>
- <integer>1</integer>
- <key>LCPEchoFailure</key>
- <integer>4</integer>
- <key>LCPEchoInterval</key>
- <integer>10</integer>
- <key>Logfile</key>
- <string>/var/log/ppp.log</string>
- <key>VerboseLogging</key>
- <integer>0</integer>
- <key>__INACTIVE__</key>
- <integer>1</integer>
- </dict>
- <key>Proxies</key>
- <dict>
- <key>FTPEnable</key>
- <integer>0</integer>
- <key>FTPPassive</key>
- <integer>1</integer>
- <key>GopherEnable</key>
- <integer>0</integer>
- <key>HTTPEnable</key>
- <integer>0</integer>
- <key>HTTPSEnable</key>
- <integer>0</integer>
- <key>RTSPEnable</key>
- <integer>0</integer>
- <key>SOCKSEnable</key>
- <integer>0</integer>
- </dict>
- <key>UserDefinedName</key>
- <string>Built-in Ethernet</string>
- </dict>
- </dict>
- <key>Sets</key>
- <dict>
- <key>0</key>
- <dict>
- <key>Network</key>
- <dict>
- <key>Global</key>
- <dict>
- <key>IPv4</key>
- <dict>
- <key>PPPOverridePrimary</key>
- <integer>0</integer>
- <key>ServiceOrder</key>
- <array>
- <string>0</string>
- </array>
- </dict>
- </dict>
- <key>Service</key>
- <dict>
- <key>0</key>
- <dict>
- <key>__LINK__</key>
- <string>/NetworkServices/0</string>
- </dict>
- </dict>
- </dict>
- <key>UserDefinedName</key>
- <string>Automatic</string>
- </dict>
- </dict>
- <key>System</key>
- <dict/>
-</dict>
-</plist>
/*
- * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include <SystemConfiguration/SystemConfiguration.h>
#include <SystemConfiguration/SCPrivate.h>
-#include <Security/Security.h>
+#if !TARGET_OS_IPHONE
#include <Security/AuthSession.h>
+#endif /* !TARGET_OS_IPHONE */
static Boolean apply = TRUE;
}
+#if !TARGET_OS_IPHONE
static void *
__loadSecurity(void) {
static void *image = NULL;
return dyfunc ? dyfunc(session, sessionId, attributes) : -1;
}
#define SessionGetInfo _SessionGetInfo
-
+#endif /* !TARGET_OS_IPHONE */
static Boolean
hasLocalConsoleAccess()
{
+#if !TARGET_OS_IPHONE
OSStatus error;
SecuritySessionId sessionID = 0;
SessionAttributeBits attributeBits = 0;
}
return (attributeBits & (sessionHasGraphicAccess|sessionIsRemote)) == sessionHasGraphicAccess;
+#else /* !TARGET_OS_IPHONE */
+ return TRUE;
+#endif /* !TARGET_OS_IPHONE */
}
newSet = (argc == 1)
? CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingMacRoman)
- : CFSTR("");
+ : CFRetain(CFSTR(""));
prefs = SCPreferencesCreate(NULL, CFSTR("Select Set Command"), NULL);
if (prefs == NULL) {
CFStringDelete(tmp, CFRangeMake(0, CFStringGetLength(prefix)));
current = tmp;
} else {
+ CFRetain(current);
currentMatched = -1; /* not prefixed */
}
} else {
- current = CFSTR("");
+ current = CFRetain(CFSTR(""));
currentMatched = -2; /* not defined */
}
if (CFEqual(newSet, key)) {
newSetUDN = CFDictionaryGetValue(dict, kSCPropUserDefinedName);
if (newSetUDN != NULL) CFRetain(newSetUDN);
- current = CFStringCreateWithFormat(NULL, NULL, CFSTR("%@%@"), prefix, newSet);
goto found;
}
}
CFRelease(newSet);
newSet = CFRetain(key);
CFRetain(newSetUDN);
- current = CFStringCreateWithFormat(NULL, NULL, CFSTR("%@%@"), prefix, newSet);
goto found;
}
}
exit (EX_NOPERM);
}
+ CFRelease(current);
+ current = CFStringCreateWithFormat(NULL, NULL, CFSTR("%@%@"), prefix, newSet);
+
if (!SCPreferencesSetValue(prefs, kSCPrefCurrentSet, current)) {
SCPrint(TRUE, stderr,
CFSTR("SCPreferencesSetValue(...,%@,%@) failed\n"),
}
}
- CFRelease(prefs);
-
SCPrint(TRUE, stdout,
CFSTR("%@ updated to %@ (%@)\n"),
kSCPrefCurrentSet,
newSet,
newSetUDN ? newSetUDN : CFSTR(""));
+ CFRelease(current);
+ CFRelease(newSet);
+ if (newSetUDN != NULL) CFRelease(newSetUDN);
+ CFRelease(prefix);
+ CFRelease(prefs);
+
exit (0);
return 0;
}
/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include "net.h"
#include "prefs.h"
-#include "SCDynamicStoreInternal.h"
-
__private_extern__
const cmdInfo commands_store[] = {
{ "n.changes", 0, 0, do_notify_changes, 5, 0,
" n.changes : list changed keys" },
- { "n.watch", 0, 1, do_notify_watch, 5, 0,
- " n.watch [verbose] : watch for changes" },
+ { "n.watch", 0, 0, do_notify_watch, 5, 0,
+ " n.watch : watch for changes" },
{ "n.wait", 0, 0, do_notify_wait, 5, 2,
" n.wait : wait for changes" },
" remove service [ <serviceName> | <service#> ]\n"
" remove set [ <setName> | <set#> ]" },
- { "select", 2, 2, do_net_select, 7, 0,
- " select interface <interfaceName> | <interface#> | $child | $service\n"
+ { "select", 2, 3, do_net_select, 7, 0,
+ " select interface <interfaceName> | <interface#> | $child | $service | $vlan | $bond <memberName>\n"
" select protocol <protocolType>\n"
" select service <serviceName> | <service#>\n"
" select set <setName> | <set#>" },
{ "set", 2, 101, do_net_set, 8, 0,
" set interface context-sensitive-arguments (or ? for help)\n"
" set protocol context-sensitive-arguments (or ? for help)\n"
- " set service [ name <serviceName> ] [ order new-order ]\n"
+ " set service [ name <serviceName> ] [ order new-order ] [ rank ("" | First | Last | Never) [temp] ]\n"
" set set [ name setName ]" },
{ "show", 1, 2, do_net_show, 9, 0,
/* data store manipulation commands */
{ "open", 0, 1, do_prefs_open, 2, 1,
- " open [\"prefsID\"] : open a \"preferences\" session" },
+ " open [\"prefsID\"] : open a \"preferences\" session" },
{ "lock", 0, 1, do_prefs_lock, 3, 1,
" lock [wait] : locks write access to preferences" },
{ "synchronize",0, 1, do_prefs_synchronize, 2, 0,
" synchronize : synchronize a \"preferences\" session" },
-
+
{ "list", 0, 1, do_prefs_list, 4, 0,
" list [path] : list preference paths" },
SCPrint(TRUE, stdout, CFSTR("f.read: reading file (%s).\n"), argv[0]);
nesting++;
- while (process_line(src) == TRUE) {
- /* debug information, diagnostics */
- __showMachPortStatus();
+ while (TRUE) {
+ Boolean ok;
+
+ ok = process_line(src);
+ if (!ok) {
+ break;
+ }
}
(void)fclose(src->fp);
/*
- * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2004, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
void
do_dictSetKey(int argc, char **argv)
{
- CFMutableArrayRef array = NULL;
- Boolean doArray = FALSE;
- Boolean doBoolean = FALSE;
- Boolean doNumeric = FALSE;
+ CFMutableArrayRef array = NULL;
+ Boolean doArray = FALSE;
+ Boolean doBoolean = FALSE;
+ Boolean doNumeric = FALSE;
CFStringRef key;
- CFTypeRef val;
+ CFMutableDictionaryRef newValue;
+ CFTypeRef val = NULL;
if (value == NULL) {
SCPrint(TRUE, stdout, CFSTR("d.add: dictionary must be initialized.\n"));
return;
}
- val = CFDictionaryCreateMutableCopy(NULL, 0, value);
- CFRelease(value);
- value = val;
-
key = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingUTF8);
argv++; argc--;
doArray = TRUE;
} else if (!doArray && (argc == 0)) {
SCPrint(TRUE, stdout, CFSTR("d.add: no values.\n"));
+ CFRelease(key);
return;
}
val = CFRetain(kCFBooleanFalse);
} else {
SCPrint(TRUE, stdout, CFSTR("d.add: invalid data.\n"));
- if (doArray) {
- CFRelease(array);
- }
+ if (doArray) CFRelease(array);
+ CFRelease(key);
return;
}
} else if (doNumeric) {
val = CFNumberCreate(NULL, kCFNumberIntType, &intValue);
} else {
SCPrint(TRUE, stdout, CFSTR("d.add: invalid data.\n"));
- if (doArray) {
- CFRelease(array);
- }
+ if (doArray) CFRelease(array);
+ CFRelease(key);
return;
}
} else {
if (doArray) {
CFArrayAppendValue(array, val);
+ CFRelease(val);
+ argv++; argc--;
+ } else {
+ break;
}
-
- argv++; argc--;
}
+ newValue = CFDictionaryCreateMutableCopy(NULL, 0, value);
if (doArray) {
- val = array;
+ CFDictionarySetValue(newValue, key, array);
+ CFRelease(array);
+ } else {
+ CFDictionarySetValue(newValue, key, val);
+ CFRelease(val);
}
-
- CFDictionarySetValue((CFMutableDictionaryRef)value, key, val);
- CFRelease(val);
CFRelease(key);
+ CFRelease(value);
+ value = newValue;
return;
}
/*
- * Copyright (c) 2004-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2004-2007, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
key = CFArrayGetValueAtIndex(sorted, i);
value = CFDictionaryGetValue(entity, key);
if (isA_CFArray(value)) {
- CFStringRef str;
+ CFIndex i;
+ CFIndex n = CFArrayGetCount(value);
- str = CFStringCreateByCombiningStrings(NULL, value, CFSTR(", "));
- SCPrint(TRUE, stdout, CFSTR("%@ %@ = (%@)\n"), prefix, key, str);
- CFRelease(str);
+ SCPrint(TRUE, stdout, CFSTR("%@ %@ = ("), prefix, key);
+ for (i = 0; i < n; i++) {
+ CFTypeRef val;
+
+ val = CFArrayGetValueAtIndex(value, i);
+ SCPrint(TRUE, stdout,
+ CFSTR("%s%@"),
+ (i > 0) ? ", " : "",
+ val);
+ }
+ SCPrint(TRUE, stdout, CFSTR(")\n"));
} else {
SCPrint(TRUE, stdout, CFSTR("%@ %@ = %@\n"), prefix, key, value);
}
net_set = set;
setCreated = TRUE;
- setUpdated = TRUE;
CFRelease(setName);
CFRetain(set);
/*
- * Copyright (c) 2004-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include <SystemConfiguration/LinkConfiguration.h>
-/* -------------------- */
+#pragma mark -
+#pragma mark Interface management
static CFArrayRef
__private_extern__
SCNetworkInterfaceRef
-_find_interface(char *match)
+_find_interface(int argc, char **argv, int *nArgs)
{
Boolean allowIndex = TRUE;
CFIndex i;
+ CFArrayRef myInterfaces = interfaces;
CFIndex n;
CFStringRef select_name = NULL;
SCNetworkInterfaceRef selected = NULL;
- if (strcasecmp(match, "$child") == 0) {
+ if (argc < 1) {
+ SCPrint(TRUE, stdout, CFSTR("no interface specified\n"));
+ return NULL;
+ }
+
+ if (nArgs != NULL) *nArgs = 1;
+
+ if (strcasecmp(argv[0], "$child") == 0) {
if (net_interface == NULL) {
SCPrint(TRUE, stdout, CFSTR("interface not selected\n"));
goto done;
}
goto done;
- } else if (strcasecmp(match, "$service") == 0) {
+ } else if (strcasecmp(argv[0], "$service") == 0) {
if (net_service == NULL) {
SCPrint(TRUE, stdout, CFSTR("service not selected\n"));
goto done;
}
goto done;
+#if !TARGET_OS_IPHONE
+ } else if (strcasecmp(argv[0], "$bond") == 0) {
+ CFStringRef interfaceType;
+
+ if (net_interface == NULL) {
+ SCPrint(TRUE, stdout, CFSTR("interface not selected\n"));
+ goto done;
+ }
+
+ interfaceType = SCNetworkInterfaceGetInterfaceType(net_interface);
+ if (!CFEqual(interfaceType, kSCNetworkInterfaceTypeBond)) {
+ SCPrint(TRUE, stdout, CFSTR("interface not Bond\n"));
+ goto done;
+ }
+
+ if (argc < 2) {
+ SCPrint(TRUE, stdout, CFSTR("no member interface specified\n"));
+ return NULL;
+ }
+ argv++;
+ argc--;
+ if (nArgs != NULL) *nArgs += 1;
+
+ myInterfaces = SCBondInterfaceGetMemberInterfaces(net_interface);
+ if (myInterfaces == NULL) {
+ SCPrint(TRUE, stdout, CFSTR("no member interfaces\n"));
+ goto done;
+ }
+ allowIndex = FALSE;
+ } else if (strcasecmp(argv[0], "$vlan") == 0) {
+ CFStringRef interfaceType;
+
+ if (net_interface == NULL) {
+ SCPrint(TRUE, stdout, CFSTR("interface not selected\n"));
+ goto done;
+ }
+
+ interfaceType = SCNetworkInterfaceGetInterfaceType(net_interface);
+ if (!CFEqual(interfaceType, kSCNetworkInterfaceTypeVLAN)) {
+ SCPrint(TRUE, stdout, CFSTR("interface not VLAN\n"));
+ goto done;
+ }
+
+ selected = SCVLANInterfaceGetPhysicalInterface(net_interface);
+ if(selected == NULL) {
+ SCPrint(TRUE, stdout, CFSTR("no physical interface\n"));
+ }
+
+ goto done;
+#endif // !TARGET_OS_IPHONE
}
- if (interfaces == NULL) {
+ if ((myInterfaces == NULL) && (interfaces == NULL)) {
interfaces = _copy_interfaces();
if (interfaces == NULL) {
return NULL;
}
+ myInterfaces = interfaces;
allowIndex = FALSE;
}
// try to select the interface by its display name
- select_name = CFStringCreateWithCString(NULL, match, kCFStringEncodingUTF8);
+ select_name = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingUTF8);
- n = CFArrayGetCount(interfaces);
+ n = (myInterfaces != NULL) ? CFArrayGetCount(myInterfaces) : 0;
for (i = 0; i < n; i++) {
SCNetworkInterfaceRef interface;
CFStringRef interfaceName;
- interface = CFArrayGetValueAtIndex(interfaces, i);
+ interface = CFArrayGetValueAtIndex(myInterfaces, i);
interfaceName = SCNetworkInterfaceGetLocalizedDisplayName(interface);
if ((interfaceName != NULL) && CFEqual(select_name, interfaceName)) {
if (selected == NULL) {
SCNetworkInterfaceRef interface;
CFStringRef bsd_name = NULL;
- interface = CFArrayGetValueAtIndex(interfaces, i);
+ interface = CFArrayGetValueAtIndex(myInterfaces, i);
while ((interface != NULL) && (bsd_name == NULL)) {
bsd_name = SCNetworkInterfaceGetBSDName(interface);
if (bsd_name == NULL) {
SCNetworkInterfaceRef interface;
CFStringRef interfaceType;
- interface = CFArrayGetValueAtIndex(interfaces, i);
+ interface = CFArrayGetValueAtIndex(myInterfaces, i);
interfaceType = SCNetworkInterfaceGetInterfaceType(interface);
if (CFEqual(select_name, interfaceType)) {
if (selected == NULL) {
if (allowIndex) {
char *end;
- char *str = match;
+ char *str = argv[0];
long val;
// try to select the interface by its index
((*end == '\0') || (*end == '.')) &&
(errno == 0)) {
if ((val > 0) && (val <= n)) {
- selected = CFArrayGetValueAtIndex(interfaces, val - 1);
+ selected = CFArrayGetValueAtIndex(myInterfaces, val - 1);
if (*end == '.') {
str = end + 1;
}
interfaceType = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingUTF8);
+ argv++;
+ argc--;
+#if !TARGET_OS_IPHONE
+ if (CFEqual(interfaceType, kSCNetworkInterfaceTypeBond)) {
+ SCPrint(TRUE, stdout, CFSTR("bond creation not yet supported\n"));
+ goto done;
+ }
if (CFEqual(interfaceType, kSCNetworkInterfaceTypeVLAN)) {
-// xxxxx
-SCPrint(TRUE, stdout, CFSTR("vlan creation not yet supported\n"));
-goto done;
- } else if (CFEqual(interfaceType, kSCNetworkInterfaceTypeBond)) {
-// xxxxx
-SCPrint(TRUE, stdout, CFSTR("bond creation not yet supported\n"));
-goto done;
- } else {
- if (argc < 2) {
- if (net_interface == NULL) {
- SCPrint(TRUE, stdout, CFSTR("no network interface selected\n"));
- goto done;
- }
+ SCPrint(TRUE, stdout, CFSTR("vlan creation not yet supported\n"));
+ goto done;
+ }
+#endif // !TARGET_OS_IPHONE
- interface = net_interface;
- } else {
- interface = _find_interface(argv[1]);
+ if (argc < 1) {
+ if (net_interface == NULL) {
+ SCPrint(TRUE, stdout, CFSTR("no network interface selected\n"));
+ goto done;
}
- if (interface == NULL) {
- return;
- }
+ interface = net_interface;
+ } else {
+ interface = _find_interface(argc, argv, NULL);
+ }
- new_interface = SCNetworkInterfaceCreateWithInterface(interface, interfaceType);
- if (new_interface == NULL) {
- SCPrint(TRUE, stdout, CFSTR("%s\n"), SCErrorString(SCError()));
- goto done;
- }
+ if (interface == NULL) {
+ goto done;
+ }
+
+ new_interface = SCNetworkInterfaceCreateWithInterface(interface, interfaceType);
+ if (new_interface == NULL) {
+ SCPrint(TRUE, stdout, CFSTR("%s\n"), SCErrorString(SCError()));
+ goto done;
}
if (new_interfaces == NULL) {
{
SCNetworkInterfaceRef interface;
- interface = _find_interface(argv[0]);
-
+ interface = _find_interface(argc, argv, NULL);
if (interface != NULL) {
CFStringRef interfaceName;
}
}
- SCPrint(TRUE, stdout, CFSTR("%@ mtu %c = %ld (%ld < n < %ld)\n"),
+ SCPrint(TRUE, stdout, CFSTR("%@ mtu %c = %d (%d < n < %d)\n"),
prefix,
isCurrent,
mtu_cur,
}
CFRelease(subtype_options);
}
+ if (subtypes != NULL) CFRelease(subtypes);
}
} else {
SCPrint(TRUE, stdout, CFSTR("\n"));
CFRelease(effective);
}
+ if (CFEqual(if_type, kSCNetworkInterfaceTypePPP)) {
+ SCNetworkInterfaceRef childInterface;
+
+ childInterface = SCNetworkInterfaceGetInterface(interface);
+ if (childInterface != NULL) {
+ CFStringRef childInterfaceType;
+
+ childInterfaceType = SCNetworkInterfaceGetInterfaceType(childInterface);
+ if (CFEqual(childInterfaceType, kSCNetworkInterfaceTypeL2TP)) {
+ CFDictionaryRef ipsec_configuration;
+
+ ipsec_configuration = SCNetworkInterfaceGetExtendedConfiguration(interface, kSCEntNetIPSec);
+ if (isA_CFDictionary(ipsec_configuration) &&
+ (CFDictionaryGetCount(ipsec_configuration) > 0)) {
+ SCPrint(TRUE, stdout, CFSTR("\n%@ per-interface IPSec configuration\n"), prefix);
+ _show_entity(ipsec_configuration, prefix);
+ }
+ }
+ }
+ }
+
if (_sc_debug) {
SCPrint(TRUE, stdout, CFSTR("\n%@\n"), interface);
}
}
-/* -------------------- */
+#pragma mark -
+#pragma mark Bond options
+
+
+#if !TARGET_OS_IPHONE
static options bondOptions[] = {
}
-/* -------------------- */
+#endif // !TARGET_OS_IPHONE
+
+
+#pragma mark -
+#pragma mark AirPort options
static options airportOptions[] = {
}
-/* -------------------- */
+#pragma mark -
+#pragma mark Ethernet options
static options ethernetOptions[] = {
}
-/* -------------------- */
+#pragma mark -
+#pragma mark IPSec options
+
+
+static void
+replaceOne(const void *key, const void *value, void *context)
+{
+ CFMutableDictionaryRef newConfiguration = (CFMutableDictionaryRef)context;
+
+ CFDictionarySetValue(newConfiguration, key, value);
+ return;
+}
+
+
+static void
+updateInterfaceConfiguration(CFMutableDictionaryRef newConfiguration)
+{
+ CFDictionaryRef configuration;
+
+ CFDictionaryRemoveAllValues(newConfiguration);
+
+ configuration = SCNetworkInterfaceGetConfiguration(net_interface);
+ if (configuration != NULL) {
+ CFDictionaryApplyFunction(configuration, replaceOne, (void *)newConfiguration);
+ }
+
+ return;
+}
+
+
+static int
+__doIPSecSharedSecret(CFStringRef key, const char *description, void *info, int argc, char **argv, CFMutableDictionaryRef newConfiguration)
+{
+ if (argc < 1) {
+ SCPrint(TRUE, stdout, CFSTR("IPSec shared secret not specified\n"));
+ return -1;
+ }
+
+ if (strlen(argv[0]) > 0) {
+ CFStringRef encryptionType;
+
+ encryptionType = CFDictionaryGetValue(newConfiguration, kSCPropNetIPSecSharedSecretEncryption);
+ if (encryptionType == NULL) {
+ CFIndex n;
+ CFMutableDataRef pw;
+ CFStringRef str;
+
+ str = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingUTF8);
+ n = CFStringGetLength(str);
+ pw = CFDataCreateMutable(NULL, n * sizeof(UniChar));
+ CFDataSetLength(pw, n * sizeof(UniChar));
+ CFStringGetCharacters(str,
+ CFRangeMake(0, n),
+ (UniChar *)CFDataGetMutableBytePtr(pw));
+ CFRelease(str);
+
+ CFDictionarySetValue(newConfiguration, key, pw);
+ CFRelease(pw);
+ } else if (CFEqual(encryptionType, kSCValNetIPSecSharedSecretEncryptionKeychain)) {
+ Boolean ok;
+ CFDataRef pw;
+ CFStringRef str;
+
+ str = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingUTF8);
+ pw = CFStringCreateExternalRepresentation(NULL, str, kCFStringEncodingUTF8, 0);
+ ok = SCNetworkInterfaceSetPassword(net_interface,
+ kSCNetworkInterfacePasswordTypeIPSecSharedSecret,
+ pw,
+ NULL);
+ CFRelease(pw);
+ CFRelease(str);
+ if (ok) {
+ updateInterfaceConfiguration(newConfiguration);
+ } else {
+ return -1;
+ }
+ } else {
+ SCPrint(TRUE, stdout, CFSTR("IPSec shared secret type \"%@\" not supported\n"), encryptionType);
+ return -1;
+ }
+ } else {
+ CFDictionaryRemoveValue(newConfiguration, key);
+ }
+
+ return 1;
+}
+
+
+static int
+__doIPSecSharedSecretType(CFStringRef key, const char *description, void *info, int argc, char **argv, CFMutableDictionaryRef newConfiguration)
+{
+ if (argc < 1) {
+ SCPrint(TRUE, stdout, CFSTR("IPSec shared secret type mode not specified\n"));
+ return -1;
+ }
+
+ if (strlen(argv[0]) > 0) {
+ if (strcasecmp(argv[0], "keychain") == 0) {
+ CFDictionarySetValue(newConfiguration, key, kSCValNetIPSecSharedSecretEncryptionKeychain);
+ } else {
+ SCPrint(TRUE, stdout, CFSTR("invalid shared secret type\n"));
+ return -1;
+ }
+ } else {
+ CFDictionaryRemoveValue(newConfiguration, key);
+ }
+
+ // encryption type changed, reset shared secret
+ CFDictionaryRemoveValue(newConfiguration, kSCPropNetIPSecSharedSecret);
+
+ return 1;
+}
+
+
+static int
+__doIPSecXAuthPassword(CFStringRef key, const char *description, void *info, int argc, char **argv, CFMutableDictionaryRef newConfiguration)
+{
+ if (argc < 1) {
+ SCPrint(TRUE, stdout, CFSTR("IPSec XAuth password not specified\n"));
+ return -1;
+ }
+
+ if (strlen(argv[0]) > 0) {
+ CFStringRef encryptionType;
+
+ encryptionType = CFDictionaryGetValue(newConfiguration, kSCPropNetIPSecXAuthPasswordEncryption);
+ if (encryptionType == NULL) {
+ CFIndex n;
+ CFMutableDataRef pw;
+ CFStringRef str;
+
+ str = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingUTF8);
+ n = CFStringGetLength(str);
+ pw = CFDataCreateMutable(NULL, n * sizeof(UniChar));
+ CFDataSetLength(pw, n * sizeof(UniChar));
+ CFStringGetCharacters(str,
+ CFRangeMake(0, n),
+ (UniChar *)CFDataGetMutableBytePtr(pw));
+ CFRelease(str);
+
+ CFDictionarySetValue(newConfiguration, key, pw);
+ CFRelease(pw);
+ } else if (CFEqual(encryptionType, kSCValNetIPSecXAuthPasswordEncryptionKeychain)) {
+ Boolean ok;
+ CFDataRef pw;
+ CFStringRef str;
+
+ str = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingUTF8);
+ pw = CFStringCreateExternalRepresentation(NULL, str, kCFStringEncodingUTF8, 0);
+ ok = SCNetworkInterfaceSetPassword(net_interface,
+ kSCNetworkInterfacePasswordTypeIPSecXAuth,
+ pw,
+ NULL);
+ CFRelease(pw);
+ CFRelease(str);
+ if (ok) {
+ updateInterfaceConfiguration(newConfiguration);
+ } else {
+ return -1;
+ }
+ } else {
+ SCPrint(TRUE, stdout, CFSTR("IPSec XAuthPassword type \"%@\" not supported\n"), encryptionType);
+ return -1;
+ }
+ } else {
+ CFDictionaryRemoveValue(newConfiguration, key);
+ }
+
+ return 1;
+}
+
+
+static int
+__doIPSecXAuthPasswordType(CFStringRef key, const char *description, void *info, int argc, char **argv, CFMutableDictionaryRef newConfiguration)
+{
+ if (argc < 1) {
+ SCPrint(TRUE, stdout, CFSTR("IPSec XAuth password type mode not specified\n"));
+ return -1;
+ }
+
+ if (strlen(argv[0]) > 0) {
+ if (strcasecmp(argv[0], "keychain") == 0) {
+ CFDictionarySetValue(newConfiguration, key, kSCValNetIPSecXAuthPasswordEncryptionKeychain);
+ } else {
+ SCPrint(TRUE, stdout, CFSTR("invalid XAuth password type\n"));
+ return -1;
+ }
+ } else {
+ CFDictionaryRemoveValue(newConfiguration, key);
+ }
+
+ // encryption type changed, reset XAuthPassword
+ CFDictionaryRemoveValue(newConfiguration, kSCPropNetIPSecXAuthPassword);
+
+ return 1;
+}
+
+
+static CFStringRef
+__cleanupDomainName(CFStringRef domain)
+{
+ CFMutableStringRef newDomain;
+
+ newDomain = CFStringCreateMutableCopy(NULL, 0, domain);
+ CFStringTrimWhitespace(newDomain);
+ CFStringTrim(newDomain, CFSTR("."));
+ if (CFStringGetLength(newDomain) == 0) {
+ CFRelease(newDomain);
+ newDomain = NULL;
+ }
+
+ return newDomain;
+}
+
+
+static int
+__doOnDemandDomains(CFStringRef key, const char *description, void *info, int argc, char **argv, CFMutableDictionaryRef newConfiguration)
+{
+ CFMutableArrayRef domains;
+
+ if (argc < 1) {
+ SCPrint(TRUE, stdout, CFSTR("OnDemand domain name(s) not specified\n"));
+ return -1;
+ }
+
+ domains = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+
+ if (strlen(argv[0]) > 0) {
+ CFArrayRef array;
+ CFStringRef str;
+
+ str = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingUTF8);
+ array = CFStringCreateArrayBySeparatingStrings(NULL, str, CFSTR(","));
+ CFRelease(str);
+
+ if (array != NULL) {
+ CFIndex i;
+ CFIndex n = CFArrayGetCount(array);
+
+ for (i = 0; i < n; i++) {
+ CFStringRef domain;
+
+ domain = __cleanupDomainName(CFArrayGetValueAtIndex(array, i));
+ if (domain != NULL) {
+ CFArrayAppendValue(domains, domain);
+ CFRelease(domain);
+ } else {
+ CFRelease(array);
+ CFRelease(domains);
+ SCPrint(TRUE, stdout, CFSTR("invalid OnDemand domain name\n"));
+ return -1;
+ }
+ }
+ CFRelease(array);
+ }
+ }
+
+ if (CFArrayGetCount(domains) > 0) {
+ CFDictionarySetValue(newConfiguration, key, domains);
+ } else {
+ CFDictionaryRemoveValue(newConfiguration, key);
+ }
+
+ CFRelease(domains);
+ return 1;
+}
+
+
+static options ipsecOnDemandOptions[] = {
+ { "OnDemandMatchDomainsAlways" , "domain", isOther , &kSCPropNetIPSecOnDemandMatchDomainsAlways , __doOnDemandDomains, NULL },
+ { "always" , "domain", isOther , &kSCPropNetIPSecOnDemandMatchDomainsAlways , __doOnDemandDomains, NULL },
+ { "OnDemandMatchDomainsOnRetry", "domain", isOther , &kSCPropNetIPSecOnDemandMatchDomainsOnRetry, __doOnDemandDomains, NULL },
+ { "retry" , "domain", isOther , &kSCPropNetIPSecOnDemandMatchDomainsOnRetry, __doOnDemandDomains, NULL },
+ { "OnDemandMatchDomainsNever" , "domain", isOther , &kSCPropNetIPSecOnDemandMatchDomainsNever , __doOnDemandDomains, NULL },
+ { "never" , "domain", isOther , &kSCPropNetIPSecOnDemandMatchDomainsNever , __doOnDemandDomains, NULL },
+
+ { "?" , NULL , isHelp , NULL , NULL ,
+ "\nOnDemandMatch configuration commands\n\n"
+ " set interface OnDemandMatch always domain-name[,domain-name]\n"
+ " set interface OnDemandMatch retry domain-name[,domain-name]\n"
+ " set interface OnDemandMatch never domain-name[,domain-name]\n"
+ }
+};
+#define N_IPSEC_ONDEMAND_OPTIONS (sizeof(ipsecOnDemandOptions) / sizeof(ipsecOnDemandOptions[0]))
+
+
+static int
+__doIPSecOnDemandMatch(CFStringRef key, const char *description, void *info, int argc, char **argv, CFMutableDictionaryRef newConfiguration)
+{
+ Boolean ok;
+
+ if (argc < 1) {
+ SCPrint(TRUE, stdout, CFSTR("set what?\n"));
+ return -1;
+ }
+
+ ok = _process_options(ipsecOnDemandOptions, N_IPSEC_ONDEMAND_OPTIONS, argc, argv, newConfiguration);
+ if (!ok) {
+ goto done;
+ }
+
+ done :
+
+ return argc;
+}
+
+
+static selections ipsecAuthenticationMethodSelections[] = {
+ { CFSTR("SharedSecret"), &kSCValNetIPSecAuthenticationMethodSharedSecret, 0 },
+ { CFSTR("Certificate") , &kSCValNetIPSecAuthenticationMethodCertificate , 0 },
+ { CFSTR("Hybrid") , &kSCValNetIPSecAuthenticationMethodHybrid , 0 },
+ { NULL , NULL , 0 }
+};
+
+
+static selections ipsecLocalIdentifierTypeSelections[] = {
+ { CFSTR("KeyID") , &kSCValNetIPSecLocalIdentifierTypeKeyID , 0 },
+ { NULL , NULL , 0 }
+};
+
+
+static options ipsecOptions[] = {
+ { "AuthenticationMethod" , NULL, isChooseOne , &kSCPropNetIPSecAuthenticationMethod , NULL , (void *)ipsecAuthenticationMethodSelections },
+ { "LocalIdentifier" , NULL, isString , &kSCPropNetIPSecLocalIdentifier , NULL , NULL },
+ { "group" , NULL, isString , &kSCPropNetIPSecLocalIdentifier , NULL , NULL },
+ { "LocalIdentifierType" , NULL, isChooseOne , &kSCPropNetIPSecLocalIdentifierType , NULL , (void *)ipsecLocalIdentifierTypeSelections },
+ { "RemoteAddress" , NULL, isString , &kSCPropNetIPSecRemoteAddress , NULL , NULL },
+ { "SharedSecret" , NULL, isOther , &kSCPropNetIPSecSharedSecret , __doIPSecSharedSecret , NULL },
+ { "SharedSecretEncryption" , NULL, isOther , &kSCPropNetIPSecSharedSecretEncryption , __doIPSecSharedSecretType , NULL },
+
+ // --- XAuth: ---
+ { "XAuthEnabled" , NULL, isBoolean , &kSCPropNetIPSecXAuthEnabled , NULL , NULL },
+ { "XAuthName" , NULL, isString , &kSCPropNetIPSecXAuthName , NULL , NULL },
+ { "XAuthPassword" , NULL, isOther , &kSCPropNetIPSecXAuthPassword , __doIPSecXAuthPassword , NULL },
+ { "XAuthPasswordEncryption", NULL, isOther , &kSCPropNetIPSecXAuthPasswordEncryption, __doIPSecXAuthPasswordType, NULL },
+
+ // --- OnDemand: ---
+ { "OnDemandEnabled" , NULL, isBoolean , &kSCPropNetIPSecOnDemandEnabled , NULL , NULL },
+ { "OnDemandMatch" , NULL, isOther , NULL , __doIPSecOnDemandMatch , NULL },
+
+ { "?" , NULL , isHelp , NULL , NULL,
+ "\nIPSec configuration commands\n\n"
+ " set interface [AuthenticationMethod {SharedSecret|Certificate|Hybrid}]\n"
+ " set interface [LocalIdentifier group]\n"
+ " set interface [LocalIdentifierType {KeyID}]\n"
+ " set interface [RemoteAddress name-or-address]\n"
+ " set interface [SharedSecret secret]\n"
+ " set interface [SharedSecretEncryption {Keychain}]\n"
+ " set interface [XAuthEnabled {enable|disable}]\n"
+ " set interface [XAuthPassword password]\n"
+ " set interface [XAuthPasswordEncryption {Keychain}]\n"
+ " set interface [OnDemandEnabled {enable|disable}]\n"
+ " set interface [OnDemandMatch <match-options>]\n"
+ }
+};
+#define N_IPSEC_OPTIONS (sizeof(ipsecOptions) / sizeof(ipsecOptions[0]))
+
+
+static Boolean
+set_interface_ipsec(int argc, char **argv, CFMutableDictionaryRef newConfiguration)
+{
+ Boolean ok;
+
+ ok = _process_options(ipsecOptions, N_IPSEC_OPTIONS, argc, argv, newConfiguration);
+ return ok;
+}
+
+
+#pragma mark -
+#pragma mark FireWire options
static options firewireOptions[] = {
}
-/* -------------------- */
+#pragma mark -
+#pragma mark Modem options
static selections modemDialSelections[] = {
" set interface [HoldReminder {enable|disable}]\n"
" set interface [HoldReminderTime n]\n"
" set interface [PulseDial {enable|disable}]\n"
- " set interface [Speaker {enable|disable}]"
+ " set interface [Speaker {enable|disable}]\n"
}
};
#define N_MODEM_OPTIONS (sizeof(modemOptions) / sizeof(modemOptions[0]))
}
-/* -------------------- */
+#pragma mark -
+#pragma mark PPP options
static int
}
+static options l2tp_ipsecOptions[] = {
+ { "SharedSecret" , NULL, isOther , &kSCPropNetIPSecSharedSecret , __doIPSecSharedSecret , NULL },
+ { "SharedSecretEncryption", NULL, isOther , &kSCPropNetIPSecSharedSecretEncryption, __doIPSecSharedSecretType, NULL },
+
+ { "?" , NULL , isHelp , NULL , NULL,
+ "\nIPSec configuration commands\n\n"
+ " set interface ipsec [SharedSecret secret]\n"
+ " set interface ipsec [SharedSecretEncryption {Keychain}]\n"
+ }
+};
+#define N_L2TP_IPSEC_OPTIONS (sizeof(l2tp_ipsecOptions) / sizeof(l2tp_ipsecOptions[0]))
+
+
+static int
+__doPPPIPSec(CFStringRef key, const char *description, void *info, int argc, char **argv, CFMutableDictionaryRef newPPPConfiguration)
+{
+ SCNetworkInterfaceRef childInterface;
+ CFStringRef childInterfaceType;
+ CFDictionaryRef configuration;
+ CFMutableDictionaryRef newConfiguration;
+ Boolean ok;
+
+ if (argc < 1) {
+ SCPrint(TRUE, stdout, CFSTR("set what?\n"));
+ return -1;
+ }
+
+ childInterface = SCNetworkInterfaceGetInterface(net_interface);
+ if (childInterface == NULL) {
+ SCPrint(TRUE, stdout, CFSTR("this interfaces configuration cannot be changed\n"));
+ return -1;
+ }
+
+ childInterfaceType = SCNetworkInterfaceGetInterfaceType(childInterface);
+ if (!CFEqual(childInterfaceType, kSCNetworkInterfaceTypeL2TP)) {
+ SCPrint(TRUE, stdout, CFSTR("this interfaces configuration cannot be changed\n"));
+ return -1;
+ }
+
+ configuration = SCNetworkInterfaceGetExtendedConfiguration(net_interface, kSCEntNetIPSec);
+ if (configuration == NULL) {
+ newConfiguration = CFDictionaryCreateMutable(NULL,
+ 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ } else {
+ newConfiguration = CFDictionaryCreateMutableCopy(NULL, 0, configuration);
+ CFDictionaryRemoveValue(newConfiguration, kSCResvInactive);
+ }
+
+ ok = _process_options(l2tp_ipsecOptions, N_L2TP_IPSEC_OPTIONS, argc, argv, newConfiguration);
+ if (!ok) {
+ goto done;
+ }
+
+ if (((configuration == NULL) && (CFDictionaryGetCount(newConfiguration) > 0)) ||
+ ((configuration != NULL) && !CFEqual(configuration, newConfiguration))) {
+ if (!SCNetworkInterfaceSetExtendedConfiguration(net_interface, kSCEntNetIPSec, newConfiguration)) {
+ if (SCError() == kSCStatusNoKey) {
+ SCPrint(TRUE, stdout, CFSTR("could not update per-service interface configuration\n"));
+ } else {
+ SCPrint(TRUE, stdout, CFSTR("%s\n"), SCErrorString(SCError()));
+ }
+ goto done;
+ }
+
+ _prefs_changed = TRUE;
+ }
+
+ done :
+
+ if (newConfiguration != NULL) CFRelease(newConfiguration);
+ return argc;
+}
+
+
+#ifdef NOTYET
+static options pppOnDemandOptions[] = {
+ { "OnDemandMatchDomainsAlways" , "domain", isOther , &kSCPropNetPPPOnDemandMatchDomainsAlways , __doOnDemandDomains, NULL },
+ { "always" , "domain", isOther , &kSCPropNetPPPOnDemandMatchDomainsAlways , __doOnDemandDomains, NULL },
+ { "OnDemandMatchDomainsOnRetry", "domain", isOther , &kSCPropNetPPPOnDemandMatchDomainsOnRetry, __doOnDemandDomains, NULL },
+ { "retry" , "domain", isOther , &kSCPropNetPPPOnDemandMatchDomainsOnRetry, __doOnDemandDomains, NULL },
+ { "OnDemandMatchDomainsNever" , "domain", isOther , &kSCPropNetPPPOnDemandMatchDomainsNever , __doOnDemandDomains, NULL },
+ { "never" , "domain", isOther , &kSCPropNetPPPOnDemandMatchDomainsNever , __doOnDemandDomains, NULL },
+
+ { "?" , NULL , isHelp , NULL , NULL ,
+ "\nOnDemandMatch configuration commands\n\n"
+ " set interface OnDemand always domain-name[,domain-name]\n"
+ " set interface OnDemand retry domain-name[,domain-name]\n"
+ " set interface OnDemand never domain-name[,domain-name]\n"
+ }
+};
+#define N_PPP_ONDEMAND_OPTIONS (sizeof(pppOnDemandOptions) / sizeof(pppOnDemandOptions[0]))
+
+
+static int
+__doPPPOnDemandMatch(CFStringRef key, const char *description, void *info, int argc, char **argv, CFMutableDictionaryRef newConfiguration)
+{
+ Boolean ok;
+
+ if (argc < 1) {
+ SCPrint(TRUE, stdout, CFSTR("set what?\n"));
+ return -1;
+ }
+
+ ok = _process_options(pppOnDemandOptions, N_PPP_ONDEMAND_OPTIONS, argc, argv, newConfiguration);
+ if (!ok) {
+ goto done;
+ }
+
+ done :
+
+ return argc;
+}
+#endif // NOTYET
+
+
static selections authPromptSelections[] = {
{ CFSTR("before"), &kSCValNetPPPAuthPromptBefore, 0 },
{ CFSTR("after") , &kSCValNetPPPAuthPromptAfter , 0 },
static options pppOptions[] = {
- { "ACSP" , NULL , isBoolean , &kSCPropNetPPPACSPEnabled , NULL , NULL },
- { "ConnectTime" , "?time" , isNumber , &kSCPropNetPPPConnectTime , NULL , NULL },
- { "DialOnDemand" , NULL , isBoolean , &kSCPropNetPPPDialOnDemand , NULL , NULL },
- { "DisconnectOnFastUserSwitch", NULL , isBoolean , &kSCPropNetPPPDisconnectOnFastUserSwitch, NULL , NULL },
- { "DisconnectOnIdle" , NULL , isBoolean , &kSCPropNetPPPDisconnectOnIdle , NULL , NULL },
- { "DisconnectOnIdleTimer" , "timeout" , isNumber , &kSCPropNetPPPDisconnectOnIdleTimer , NULL , NULL },
- { "DisconnectOnLogout" , NULL , isBoolean , &kSCPropNetPPPDisconnectOnLogout , NULL , NULL },
- { "DisconnectOnSleep" , NULL , isBoolean , &kSCPropNetPPPDisconnectOnSleep , NULL , NULL },
- { "DisconnectTime" , "?time" , isNumber , &kSCPropNetPPPDisconnectTime , NULL , NULL },
- { "IdleReminder" , NULL , isBoolean , &kSCPropNetPPPIdleReminder , NULL , NULL },
- { "IdleReminderTimer" , "time" , isNumber , &kSCPropNetPPPIdleReminderTimer , NULL , NULL },
- { "Logfile" , "path" , isString , &kSCPropNetPPPLogfile , NULL , NULL },
- { "Plugins" , "plugin" , isStringArray , &kSCPropNetPPPPlugins , NULL , NULL },
- { "RetryConnectTime" , "time" , isNumber , &kSCPropNetPPPRetryConnectTime , NULL , NULL },
- { "SessionTimer" , "time" , isNumber , &kSCPropNetPPPSessionTimer , NULL , NULL },
- { "UseSessionTimer" , NULL , isBoolean , &kSCPropNetPPPUseSessionTimer , NULL , NULL },
- { "VerboseLogging" , NULL , isBoolean , &kSCPropNetPPPVerboseLogging , NULL , NULL },
+ { "ACSP" , NULL , isBoolean , &kSCPropNetPPPACSPEnabled , NULL , NULL },
+ { "ConnectTime" , "?time" , isNumber , &kSCPropNetPPPConnectTime , NULL , NULL },
+ { "DialOnDemand" , NULL , isBoolean , &kSCPropNetPPPDialOnDemand , NULL , NULL },
+ { "DisconnectOnFastUserSwitch", NULL , isBoolean , &kSCPropNetPPPDisconnectOnFastUserSwitch, NULL , NULL },
+ { "DisconnectOnIdle" , NULL , isBoolean , &kSCPropNetPPPDisconnectOnIdle , NULL , NULL },
+ { "DisconnectOnIdleTimer" , "timeout" , isNumber , &kSCPropNetPPPDisconnectOnIdleTimer , NULL , NULL },
+ { "DisconnectOnLogout" , NULL , isBoolean , &kSCPropNetPPPDisconnectOnLogout , NULL , NULL },
+ { "DisconnectOnSleep" , NULL , isBoolean , &kSCPropNetPPPDisconnectOnSleep , NULL , NULL },
+ { "DisconnectTime" , "?time" , isNumber , &kSCPropNetPPPDisconnectTime , NULL , NULL },
+ { "IdleReminder" , NULL , isBoolean , &kSCPropNetPPPIdleReminder , NULL , NULL },
+ { "IdleReminderTimer" , "time" , isNumber , &kSCPropNetPPPIdleReminderTimer , NULL , NULL },
+ { "Logfile" , "path" , isString , &kSCPropNetPPPLogfile , NULL , NULL },
+ { "Plugins" , "plugin" , isStringArray , &kSCPropNetPPPPlugins , NULL , NULL },
+ { "RetryConnectTime" , "time" , isNumber , &kSCPropNetPPPRetryConnectTime , NULL , NULL },
+ { "SessionTimer" , "time" , isNumber , &kSCPropNetPPPSessionTimer , NULL , NULL },
+ { "UseSessionTimer" , NULL , isBoolean , &kSCPropNetPPPUseSessionTimer , NULL , NULL },
+ { "VerboseLogging" , NULL , isBoolean , &kSCPropNetPPPVerboseLogging , NULL , NULL },
// --- Auth: ---
- { "AuthEAPPlugins" , "plugin" , isStringArray , &kSCPropNetPPPAuthEAPPlugins , NULL , NULL },
- { "AuthName" , "account" , isString , &kSCPropNetPPPAuthName , NULL , NULL },
- { "Account" , "account" , isString , &kSCPropNetPPPAuthName , NULL , NULL },
- { "AuthPassword" , "password" , isOther , &kSCPropNetPPPAuthPassword , __doPPPAuthPW , NULL },
- { "Password" , "password" , isOther , &kSCPropNetPPPAuthPassword , __doPPPAuthPW , NULL },
- { "AuthPasswordEncryption" , "type" , isOther , &kSCPropNetPPPAuthPasswordEncryption , __doPPPAuthPWType, NULL },
- { "AuthPrompt" , "before/after", isChooseOne , &kSCPropNetPPPAuthPrompt , NULL , (void *)authPromptSelections },
- { "AuthProtocol" , "protocol" , isChooseMultiple , &kSCPropNetPPPAuthProtocol , NULL , (void *)authProtocolSelections },
+ { "AuthEAPPlugins" , "plugin" , isStringArray , &kSCPropNetPPPAuthEAPPlugins , NULL , NULL },
+ { "AuthName" , "account" , isString , &kSCPropNetPPPAuthName , NULL , NULL },
+ { "Account" , "account" , isString , &kSCPropNetPPPAuthName , NULL , NULL },
+ { "AuthPassword" , "password" , isOther , &kSCPropNetPPPAuthPassword , __doPPPAuthPW , NULL },
+ { "Password" , "password" , isOther , &kSCPropNetPPPAuthPassword , __doPPPAuthPW , NULL },
+ { "AuthPasswordEncryption" , "type" , isOther , &kSCPropNetPPPAuthPasswordEncryption , __doPPPAuthPWType , NULL },
+ { "AuthPrompt" , "before/after", isChooseOne , &kSCPropNetPPPAuthPrompt , NULL , (void *)authPromptSelections },
+ { "AuthProtocol" , "protocol" , isChooseMultiple , &kSCPropNetPPPAuthProtocol , NULL , (void *)authProtocolSelections },
// --- Comm: ---
- { "CommRemoteAddress" , "phone#" , isString , &kSCPropNetPPPCommRemoteAddress , NULL , NULL },
- { "CommAlternateRemoteAddress", "phone#" , isString , &kSCPropNetPPPCommAlternateRemoteAddress, NULL , NULL },
- { "CommConnectDelay" , "time" , isNumber , &kSCPropNetPPPCommConnectDelay , NULL , NULL },
- { "CommDisplayTerminalWindow" , NULL , isBoolean , &kSCPropNetPPPCommDisplayTerminalWindow , NULL , NULL },
- { "CommRedialCount" , "retry count" , isNumber , &kSCPropNetPPPCommRedialCount , NULL , NULL },
- { "CommRedialEnabled" , NULL , isBoolean , &kSCPropNetPPPCommRedialEnabled , NULL , NULL },
- { "CommRedialInterval" , "retry delay" , isNumber , &kSCPropNetPPPCommRedialInterval , NULL , NULL },
- { "CommTerminalScript" , "script" , isString , &kSCPropNetPPPCommTerminalScript , NULL , NULL },
- { "CommUseTerminalScript" , NULL , isBoolean , &kSCPropNetPPPCommUseTerminalScript , NULL , NULL },
+ { "CommRemoteAddress" , "phone#" , isString , &kSCPropNetPPPCommRemoteAddress , NULL , NULL },
+ { "CommAlternateRemoteAddress", "phone#" , isString , &kSCPropNetPPPCommAlternateRemoteAddress, NULL , NULL },
+ { "CommConnectDelay" , "time" , isNumber , &kSCPropNetPPPCommConnectDelay , NULL , NULL },
+ { "CommDisplayTerminalWindow" , NULL , isBoolean , &kSCPropNetPPPCommDisplayTerminalWindow , NULL , NULL },
+ { "CommRedialCount" , "retry count" , isNumber , &kSCPropNetPPPCommRedialCount , NULL , NULL },
+ { "CommRedialEnabled" , NULL , isBoolean , &kSCPropNetPPPCommRedialEnabled , NULL , NULL },
+ { "CommRedialInterval" , "retry delay" , isNumber , &kSCPropNetPPPCommRedialInterval , NULL , NULL },
+ { "CommTerminalScript" , "script" , isString , &kSCPropNetPPPCommTerminalScript , NULL , NULL },
+ { "CommUseTerminalScript" , NULL , isBoolean , &kSCPropNetPPPCommUseTerminalScript , NULL , NULL },
// --- CCP: ---
- { "CCPEnabled" , NULL , isBoolean , &kSCPropNetPPPCCPEnabled , NULL , NULL },
- { "CCPMPPE40Enabled" , NULL , isBoolean , &kSCPropNetPPPCCPMPPE40Enabled , NULL , NULL },
- { "CCPMPPE128Enabled" , NULL , isBoolean , &kSCPropNetPPPCCPMPPE128Enabled , NULL , NULL },
+ { "CCPEnabled" , NULL , isBoolean , &kSCPropNetPPPCCPEnabled , NULL , NULL },
+ { "CCPMPPE40Enabled" , NULL , isBoolean , &kSCPropNetPPPCCPMPPE40Enabled , NULL , NULL },
+ { "CCPMPPE128Enabled" , NULL , isBoolean , &kSCPropNetPPPCCPMPPE128Enabled , NULL , NULL },
// --- IPCP: ---
- { "IPCPCompressionVJ" , NULL , isBoolean , &kSCPropNetPPPIPCPCompressionVJ , NULL , NULL },
- { "IPCPUsePeerDNS" , NULL , isBoolean , &kSCPropNetPPPIPCPUsePeerDNS , NULL , NULL },
+ { "IPCPCompressionVJ" , NULL , isBoolean , &kSCPropNetPPPIPCPCompressionVJ , NULL , NULL },
+ { "IPCPUsePeerDNS" , NULL , isBoolean , &kSCPropNetPPPIPCPUsePeerDNS , NULL , NULL },
// --- LCP: ---
- { "LCPEchoEnabled" , NULL , isBoolean , &kSCPropNetPPPLCPEchoEnabled , NULL , NULL },
- { "LCPEchoFailure" , NULL , isNumber , &kSCPropNetPPPLCPEchoFailure , NULL , NULL },
- { "LCPEchoInterval" , NULL , isNumber , &kSCPropNetPPPLCPEchoInterval , NULL , NULL },
- { "LCPCompressionACField" , NULL , isBoolean , &kSCPropNetPPPLCPCompressionACField , NULL , NULL },
- { "LCPCompressionPField" , NULL , isBoolean , &kSCPropNetPPPLCPCompressionPField , NULL , NULL },
- { "LCPMRU" , NULL , isNumber , &kSCPropNetPPPLCPMRU , NULL , NULL },
- { "LCPMTU" , NULL , isNumber , &kSCPropNetPPPLCPMTU , NULL , NULL },
- { "LCPReceiveACCM" , NULL , isNumber , &kSCPropNetPPPLCPReceiveACCM , NULL , NULL },
- { "LCPTransmitACCM" , NULL , isNumber , &kSCPropNetPPPLCPTransmitACCM , NULL , NULL },
+ { "LCPEchoEnabled" , NULL , isBoolean , &kSCPropNetPPPLCPEchoEnabled , NULL , NULL },
+ { "LCPEchoFailure" , NULL , isNumber , &kSCPropNetPPPLCPEchoFailure , NULL , NULL },
+ { "LCPEchoInterval" , NULL , isNumber , &kSCPropNetPPPLCPEchoInterval , NULL , NULL },
+ { "LCPCompressionACField" , NULL , isBoolean , &kSCPropNetPPPLCPCompressionACField , NULL , NULL },
+ { "LCPCompressionPField" , NULL , isBoolean , &kSCPropNetPPPLCPCompressionPField , NULL , NULL },
+ { "LCPMRU" , NULL , isNumber , &kSCPropNetPPPLCPMRU , NULL , NULL },
+ { "LCPMTU" , NULL , isNumber , &kSCPropNetPPPLCPMTU , NULL , NULL },
+ { "LCPReceiveACCM" , NULL , isNumber , &kSCPropNetPPPLCPReceiveACCM , NULL , NULL },
+ { "LCPTransmitACCM" , NULL , isNumber , &kSCPropNetPPPLCPTransmitACCM , NULL , NULL },
+
+ // --- IPSec: ---
+ { "IPSec" , NULL , isOther , NULL , __doPPPIPSec , NULL },
+
+#ifdef NOTYET
+ // --- OnDemand: ---
+ { "OnDemandEnabled" , NULL , isBoolean , &kSCPropNetPPPOnDemandEnabled , NULL , NULL },
+ { "OnDemandMatch" , NULL , isOther , NULL , __doPPPOnDemandMatch, NULL },
+#endif // NOTYET
// --- Help ---
- { "?" , NULL , isHelp , NULL , NULL ,
+ { "?" , NULL , isHelp , NULL , NULL ,
"\nPPP configuration commands\n\n"
" set interface [Account account]\n"
" set interface [Password password]\n"
" set interface [IdleReminderTimer time-in-seconds]\n"
" set interface [DisconnectOnIdle {enable|disable}]\n"
" set interface [DisconnectOnIdleTimer time-in-seconds]\n"
- " set interface [DisconnectOnLogout {enable|disable}]"
+ " set interface [DisconnectOnLogout {enable|disable}]\n"
+ " set interface [IPSec <ipsec-options>]\n"
+#ifdef NOTYET
+ " set interface [OnDemandEnabled {enable|disable}]\n"
+ " set interface [OnDemandMatch <match-options>]\n"
+#endif // NOTYET
}
};
#define N_PPP_OPTIONS (sizeof(pppOptions) / sizeof(pppOptions[0]))
}
-/* -------------------- */
+#pragma mark -
+#pragma mark VLAN options
+
+
+#if !TARGET_OS_IPHONE
static Boolean
}
-/* -------------------- */
+#endif // !TARGET_OS_IPHONE
+
+
+#pragma mark -
+#pragma mark [more] Interface management
__private_extern__
}
configuration = SCNetworkInterfaceGetConfiguration(net_interface);
- if (configuration == NULL) {
+ if (configuration != NULL) {
+ configuration = CFDictionaryCreateCopy(NULL, configuration);
+ newConfiguration = CFDictionaryCreateMutableCopy(NULL, 0, configuration);
+ CFDictionaryRemoveValue(newConfiguration, kSCResvInactive);
+ } else {
newConfiguration = CFDictionaryCreateMutable(NULL,
0,
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
- } else {
- newConfiguration = CFDictionaryCreateMutableCopy(NULL, 0, configuration);
- CFDictionaryRemoveValue(newConfiguration, kSCResvInactive);
}
interfaceType = SCNetworkInterfaceGetInterfaceType(net_interface);
- if (CFEqual(interfaceType, kSCNetworkInterfaceTypeBond)) {
- ok = set_interface_bond(argc, argv, newConfiguration);
- } else if (CFEqual(interfaceType, kSCNetworkInterfaceTypeEthernet)) {
+ if (CFEqual(interfaceType, kSCNetworkInterfaceTypeEthernet)) {
ok = set_interface_ethernet(argc, argv, newConfiguration);
} else if (CFEqual(interfaceType, kSCNetworkInterfaceTypeFireWire)) {
ok = set_interface_firewire(argc, argv, newConfiguration);
+ } else if (CFEqual(interfaceType, kSCNetworkInterfaceTypeIPSec)) {
+ ok = set_interface_ipsec(argc, argv, newConfiguration);
} else if (CFEqual(interfaceType, kSCNetworkInterfaceTypeModem)) {
ok = set_interface_modem(argc, argv, newConfiguration);
} else if (CFEqual(interfaceType, kSCNetworkInterfaceTypeIEEE80211)) {
ok = set_interface_airport(argc, argv, newConfiguration);
} else if (CFEqual(interfaceType, kSCNetworkInterfaceTypePPP)) {
ok = set_interface_ppp(argc, argv, newConfiguration);
+#if !TARGET_OS_IPHONE
+ } else if (CFEqual(interfaceType, kSCNetworkInterfaceTypeBond)) {
+ ok = set_interface_bond(argc, argv, newConfiguration);
} else if (CFEqual(interfaceType, kSCNetworkInterfaceTypeVLAN)) {
ok = set_interface_vlan(argc, argv, newConfiguration);
+#endif // !TARGET_OS_IPHONE
} else {
SCPrint(TRUE, stdout, CFSTR("this interfaces configuration cannot be changed\n"));
}
done :
+ if (configuration != NULL) CFRelease(configuration);
if (newConfiguration != NULL) CFRelease(newConfiguration);
return;
}
{
SCNetworkInterfaceRef interface;
- if (argc == 1) {
- interface = _find_interface(argv[0]);
+ if (argc >= 1) {
+ interface = _find_interface(argc, argv, NULL);
} else {
if (net_interface != NULL) {
interface = net_interface;
__BEGIN_DECLS
CFStringRef _interface_description (SCNetworkInterfaceRef interface);
-SCNetworkInterfaceRef _find_interface (char *match);
+SCNetworkInterfaceRef _find_interface (int argc, char **argv, int *nArgs);
void create_interface (int argc, char **argv);
void select_interface (int argc, char **argv);
/*
- * Copyright (c) 2004-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#pragma mark AppleTalk
+#if !TARGET_OS_IPHONE && INCLUDE_APPLETALK
+
+
static selections appletalkConfigMethods[] = {
{ CFSTR("node") , &kSCValNetAppleTalkConfigMethodNode , 0 },
{ CFSTR("router") , &kSCValNetAppleTalkConfigMethodRouter , 0 },
}
+#endif // !TARGET_OS_IPHONE && INCLUDE_APPLETALK
+
+
#pragma mark -
#pragma mark DNS
{ "?" , NULL , isHelp , NULL , NULL,
"\nDNS configuration commands\n\n"
" set protocol search domain-name[,domain-name-2]\n"
- " set protocol nameserver x1.x1.x1.x1[,x2.x2.x2.x2]"
+ " set protocol nameserver x1.x1.x1.x1[,x2.x2.x2.x2]\n"
}
};
#define N_DNS_OPTIONS (sizeof(dnsOptions) / sizeof(dnsOptions[0]))
}
-static int
-__doIPv6PrefixLength(CFStringRef key, const char *description, void *info, int argc, char **argv, CFMutableDictionaryRef newConfiguration)
-{
- CFNumberRef num;
- int prefixLength;
-
- num = CFDictionaryGetValue(newConfiguration, kSCPropNetPPPAuthPasswordEncryption);
- if (isA_CFNumber(num) &&
- CFNumberGetValue(num, kCFNumberIntType, &prefixLength) &&
- (prefixLength >= 0) && (prefixLength <= (sizeof(struct in6_addr) * 8))) {
- return 0;
- }
-
- return -1;
-}
-
-
static options ipv6Options[] = {
{ "ConfigMethod", "configuration method"
, isChooseOne, &kSCPropNetIPv6ConfigMethod, __doIPv6ConfigMethod, (void *)ipv6ConfigMethods },
, isChooseOne, &kSCPropNetIPv6ConfigMethod, __doIPv6ConfigMethod, (void *)ipv6ConfigMethods },
{ "Addresses" , "address" , isOther , &kSCPropNetIPv6Addresses , __doIPv6Addresses , (void *)TRUE },
{ "address" , "address" , isOther , &kSCPropNetIPv6Addresses , __doIPv6Addresses , (void *)TRUE },
- { "PrefixLength", "prefix length", isNumber , &kSCPropNetIPv6PrefixLength, __doIPv6PrefixLength, NULL },
+ { "PrefixLength", "prefix length", isNumber , &kSCPropNetIPv6PrefixLength, NULL , NULL },
{ "Router" , "address" , isOther , &kSCPropNetIPv6Router , __doIPv6Addresses , (void *)FALSE },
{ "?" , NULL , isHelp , NULL , NULL ,
if (enabled) {
CFDictionarySetValue(newConfiguration, *(currentProxy->keyEnable), CFNumberRef_1);
} else {
- CFDictionarySetValue(newConfiguration, *(currentProxy->keyEnable), CFNumberRef_0);
+ CFDictionaryRemoveValue(newConfiguration, *(currentProxy->keyEnable));
if (currentProxy->keyProxy != NULL) {
CFDictionaryRemoveValue(newConfiguration, *(currentProxy->keyProxy));
#pragma mark SMB
+#if !TARGET_OS_IPHONE
+
+
static CFStringRef
__cleanupName(CFStringRef name)
{
" set protocol name NetBIOS-name\n"
" set protocol type (Broadcast|Peer|Mixed|Hybrid)\n"
" set protocol workgroup SMB-workgroup\n"
- " set protocol wins x1.x1.x1.x1[,x2.x2.x2.x2]"
+ " set protocol wins x1.x1.x1.x1[,x2.x2.x2.x2]\n"
}
};
#define N_SMB_OPTIONS (sizeof(smbOptions) / sizeof(smbOptions[0]))
}
+#endif // !TARGET_OS_IPHONE
+
+
#pragma mark -
#pragma mark *Protocol*
}
protocolType = SCNetworkProtocolGetProtocolType(net_protocol);
- if (CFEqual(protocolType, kSCNetworkProtocolTypeAppleTalk)) {
- ok = set_protocol_appletalk(argc, argv, newConfiguration);
- } else if (CFEqual(protocolType, kSCNetworkProtocolTypeDNS)) {
+ if (CFEqual(protocolType, kSCNetworkProtocolTypeDNS)) {
ok = set_protocol_dns(argc, argv, newConfiguration);
} else if (CFEqual(protocolType, kSCNetworkProtocolTypeIPv4)) {
ok = set_protocol_ipv4(argc, argv, newConfiguration);
ok = set_protocol_ipv6(argc, argv, newConfiguration);
} else if (CFEqual(protocolType, kSCNetworkProtocolTypeProxies)) {
ok = set_protocol_proxies(argc, argv, newConfiguration);
+#if !TARGET_OS_IPHONE && INCLUDE_APPLETALK
+ } else if (CFEqual(protocolType, kSCNetworkProtocolTypeAppleTalk)) {
+ ok = set_protocol_appletalk(argc, argv, newConfiguration);
+#endif // !TARGET_OS_IPHONE && INCLUDE_APPLETALK
+#if !TARGET_OS_IPHONE
} else if (CFEqual(protocolType, kSCNetworkProtocolTypeSMB)) {
ok = set_protocol_smb(argc, argv, newConfiguration);
+#endif // !TARGET_OS_IPHONE
} else {
SCPrint(TRUE, stdout, CFSTR("this protocols configuration cannot be changed\n"));
}
}
protocolType = SCNetworkProtocolGetProtocolType(protocol);
- if (CFEqual(protocolType, kSCNetworkProtocolTypeAppleTalk)) {
- CFStringRef method;
-
- method = CFDictionaryGetValue(configuration, kSCPropNetAppleTalkConfigMethod);
- if (isA_CFString(method)) {
- CFStringAppendFormat(description,
- NULL,
- CFSTR("%@"),
- method);
- }
- } else if (CFEqual(protocolType, kSCNetworkProtocolTypeDNS)) {
+ if (CFEqual(protocolType, kSCNetworkProtocolTypeDNS)) {
CFStringRef domain;
CFArrayRef search;
CFArrayRef servers;
CFStringGetLength(description) > 0 ? ", " : "",
currentProxy->proxy);
}
+#if !TARGET_OS_IPHONE && INCLUDE_APPLETALK
+ } else if (CFEqual(protocolType, kSCNetworkProtocolTypeAppleTalk)) {
+ CFStringRef method;
+
+ method = CFDictionaryGetValue(configuration, kSCPropNetAppleTalkConfigMethod);
+ if (isA_CFString(method)) {
+ CFStringAppendFormat(description,
+ NULL,
+ CFSTR("%@"),
+ method);
+ }
+#endif // !TARGET_OS_IPHONE && INCLUDE_APPLETALK
+#if !TARGET_OS_IPHONE
} else if (CFEqual(protocolType, kSCNetworkProtocolTypeSMB)) {
CFStringRef name;
CFArrayRef servers;
str);
CFRelease(str);
}
+#endif // !TARGET_OS_IPHONE
}
done :
/*
- * Copyright (c) 2004-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2004-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
interface = net_interface;
} else {
- interface = _find_interface(argv[0]);
- argv++;
- argc--;
+ int nArgs;
+
+ interface = _find_interface(argc, argv, &nArgs);
+ argv += nArgs;
+ argc -= nArgs;
}
if (interface == NULL) {
Boolean ok;
serviceName = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingUTF8);
- argv++;
- argc--;
+// argv++;
+// argc--;
ok = SCNetworkServiceSetName(service, serviceName);
CFRelease(serviceName);
}
}
+ ok = SCNetworkServiceEstablishDefaultConfiguration(service);
+ if (!ok) {
+ SCPrint(TRUE, stdout, CFSTR("%s\n"), SCErrorString(SCError()));
+ (void)SCNetworkServiceRemove(service);
+ goto done;
+ }
+
ok = SCNetworkSetAddService(net_set, service);
if (!ok) {
SCPrint(TRUE, stdout, CFSTR("service not created: %s\n"), SCErrorString(SCError()));
}
if (net_interface != NULL) CFRelease(net_interface);
- net_interface = CFRetain(interface);
+ net_interface = SCNetworkServiceGetInterface(net_service);
+ CFRetain(net_interface);
interfaceName = SCNetworkInterfaceGetLocalizedDisplayName(interface);
if (interfaceName == NULL) {
SCPrint(TRUE, stdout, CFSTR("set what?\n"));
return;
}
+ } else if (strcmp(command, "rank") == 0) {
+ SCNetworkServicePrimaryRank rank = kSCNetworkServicePrimaryRankDefault;
+ SCNetworkServiceRef service = (argc < 2) ? net_service : NULL;
+
+ if (argc < 1) {
+ SCPrint(TRUE, stdout, CFSTR("rank not specified\n"));
+ return;
+ }
+
+ if (strlen(argv[0]) > 0) {
+ if (strcasecmp(argv[0], "Never") == 0) {
+ rank = kSCNetworkServicePrimaryRankNever;
+ } else if ((service != net_service) && (strcasecmp(argv[0], "First") == 0)) {
+ rank = kSCNetworkServicePrimaryRankFirst;
+ } else if ((service != net_service) && (strcasecmp(argv[0], "Last") == 0)) {
+ rank = kSCNetworkServicePrimaryRankLast;
+ } else {
+ SCPrint(TRUE, stdout, CFSTR("rank not valid\n"));
+ return;
+ }
+ }
+ argv++;
+ argc--;
+
+ if (service == NULL) {
+ CFStringRef serviceID;
+ SCDynamicStoreRef store;
+
+ store = SCDynamicStoreCreate(NULL,
+ CFSTR("scutil (set primary rank)"),
+ NULL,
+ NULL);
+ serviceID = SCNetworkServiceGetServiceID(net_service);
+ service = _SCNetworkServiceCopyActive(store, serviceID);
+ CFRelease(store);
+
+ argv++;
+ argc--;
+ }
+
+ ok = SCNetworkServiceSetPrimaryRank(service, rank);
+ if (service != net_service) CFRelease(service);
+ if (ok) {
+ if (service == net_service) _prefs_changed = TRUE;
+ } else {
+ SCPrint(TRUE, stdout, CFSTR("%s\n"), SCErrorString(SCError()));
+ return;
+ }
} else {
SCPrint(TRUE, stdout, CFSTR("set what?\n"));
}
void
show_service(int argc, char **argv)
{
- SCNetworkInterfaceRef interface;
- CFArrayRef protocols;
- SCNetworkServiceRef service;
- CFStringRef serviceName;
+ SCNetworkInterfaceRef interface;
+ CFArrayRef protocols;
+ SCNetworkServiceRef service;
+ CFStringRef serviceName;
+ SCNetworkServicePrimaryRank serviceRank;
if (argc == 1) {
service = _find_service(argv[0]);
SCPrint(TRUE, stdout, CFSTR("name = %@\n"),
(serviceName != NULL) ? serviceName : CFSTR(""));
+ serviceRank = SCNetworkServiceGetPrimaryRank(service);
+ switch (serviceRank) {
+ case kSCNetworkServicePrimaryRankDefault :
+ // nothing to report
+ break;
+ case kSCNetworkServicePrimaryRankFirst :
+ SCPrint(TRUE, stdout, CFSTR("primary rank = FIRST\n"));
+ break;
+ case kSCNetworkServicePrimaryRankLast :
+ SCPrint(TRUE, stdout, CFSTR("primary rank = LAST\n"));
+ break;
+ case kSCNetworkServicePrimaryRankNever :
+ SCPrint(TRUE, stdout, CFSTR("primary rank = NEVER\n"));
+ break;
+ default :
+ SCPrint(TRUE, stdout, CFSTR("primary rank = %d\n"), serviceRank);
+ break;
+ }
+
interface = SCNetworkServiceGetInterface(service);
if (interface != NULL) {
CFStringRef interfaceName;
/*
- * Copyright (c) 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004, 2005, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
Boolean ok;
setName = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingUTF8);
- argv++;
- argc--;
+// argv++;
+// argc--;
ok = SCNetworkSetSetName(set, setName);
CFRelease(setName);
CFIndex n;
CFIndex nOrder = 0;
CFArrayRef order;
- CFMutableArrayRef sorted = (CFMutableArrayRef)services;
order = SCNetworkSetGetServiceOrder(set);
if (order != NULL) {
n = CFArrayGetCount(services);
if (n > 1) {
+ CFMutableArrayRef sorted;
+
sorted = CFArrayCreateMutableCopy(NULL, 0, services);
CFArraySortValues(sorted,
CFRangeMake(0, CFArrayGetCount(sorted)),
_compare_services,
(void *)order);
+ CFRelease(services);
+ services = sorted;
}
SCPrint(TRUE, stdout, CFSTR("services =\n"));
CFStringRef serviceName;
CFStringRef serviceID;
- service = CFArrayGetValueAtIndex(sorted, i);
+ service = CFArrayGetValueAtIndex(services, i);
serviceID = SCNetworkServiceGetServiceID(service);
serviceName = SCNetworkServiceGetName(service);
if (serviceName == NULL) serviceName = CFSTR("");
}
CFRelease(services);
-
- if (sorted != services) CFRelease(sorted);
}
if (_sc_debug) {
/*
- * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2004, 2008, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
{
SCPrint(TRUE, stdout, CFSTR("notification callback (store address = %p).\n"), store);
SCPrint(TRUE, stdout, CFSTR(" arg = %s.\n"), (char *)arg);
- do_notify_changes(0, NULL); /* report the keys which changed */
+ do_notify_changes(0, NULL); /* report the keys that changed */
return TRUE;
}
SCPrint(TRUE, stdout, CFSTR(" Received notification, identifier = %d.\n"), buf.gotID);
}
+ /* report the keys that changed */
+ do_notify_changes(0, NULL);
+
/* this utility only allows processes one notification per "n.file" request */
(void) SCDynamicStoreNotifyCancel(store);
int sig;
pid_t pid;
struct sigaction nact;
- int ret;
if (isdigit(*argv[0])) {
if ((sscanf(argv[0], "%d", &sig) != 1) || (sig <= 0) || (sig >= NSIG)) {
}
if (oact != NULL) {
- ret = sigaction(osig, oact, NULL); /* restore original signal handler */
+ (void) sigaction(osig, oact, NULL); /* restore original signal handler */
} else {
oact = malloc(sizeof(struct sigaction));
}
nact.sa_handler = signalCatcher;
sigemptyset(&nact.sa_mask);
nact.sa_flags = SA_RESTART;
- ret = sigaction(sig, &nact, oact);
+ (void) sigaction(sig, &nact, oact);
osig = sig;
SCPrint(TRUE, stdout, CFSTR("signal handler started.\n"));
void
do_notify_cancel(int argc, char **argv)
{
- int ret;
-
if (notifyRls) {
CFRunLoopSourceInvalidate(notifyRls);
CFRelease(notifyRls);
}
if (oact != NULL) {
- ret = sigaction(osig, oact, NULL); /* restore original signal handler */
+ (void) sigaction(osig, oact, NULL); /* restore original signal handler */
free(oact);
oact = NULL;
}
#include <dlfcn.h>
#include <SystemConfiguration/SCPreferencesSetSpecific.h>
+#if !TARGET_OS_IPHONE
#include <Security/Authorization.h>
+#endif /* !TARGET_OS_IPHONE */
#include "scutil.h"
#include "commands.h"
/* -------------------- */
+#if !TARGET_OS_IPHONE
static void *
__loadSecurity(void) {
static void *image = NULL;
return authorization;
}
-
+#endif /* !TARGET_OS_IPHONE */
/* -------------------- */
if (geteuid() == 0) {
prefs = SCPreferencesCreate(NULL, name, prefsID);
} else {
+#if !TARGET_OS_IPHONE
authorization = _createAuthorization();
+#else /* !TARGET_OS_IPHONE */
+ authorization = NULL;
+#endif /* !TARGET_OS_IPHONE */
prefs = SCPreferencesCreateWithAuthorization(NULL, name, prefsID, authorization);
}
}
if (authorization != NULL) {
+#if !TARGET_OS_IPHONE
AuthorizationFree(authorization, kAuthorizationFlagDefaults);
// AuthorizationFree(authorization, kAuthorizationFlagDestroyRights);
+#else /* !TARGET_OS_IPHONE */
+ // Uh...if authorization isn't NULL, something went horribly wrong.
+#endif /* !TARGET_OS_IPHONE */
authorization = NULL;
}
static void
set_ComputerName(int argc, char **argv)
{
- CFStringEncoding encoding;
CFStringRef hostname;
Boolean ok;
if (argc == 0) {
hostname = _copyStringFromSTDIN();
- encoding = kCFStringEncodingUTF8;
} else {
- hostname = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingASCII);
- encoding = kCFStringEncodingASCII;
+ hostname = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingUTF8);
}
- ok = SCPreferencesSetComputerName(prefs, hostname, encoding);
+ ok = SCPreferencesSetComputerName(prefs, hostname, kCFStringEncodingUTF8);
if (hostname != NULL) CFRelease(hostname);
if (!ok) {
SCPrint(TRUE,
if (argc == 0) {
hostname = _copyStringFromSTDIN();
} else {
- hostname = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingASCII);
+ hostname = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingUTF8);
}
ok = SCPreferencesSetHostName(prefs, hostname);
if (argc == 0) {
hostname = _copyStringFromSTDIN();
} else {
- hostname = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingASCII);
+ hostname = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingUTF8);
}
ok = SCPreferencesSetLocalHostName(prefs, hostname);
.\"
.\" @(#)scutil.8
.\"
-.Dd November 4, 2003
+.Dd January 23, 2008
.Dt SCUTIL 8
.Os "Mac OS X"
.Sh NAME
.Fl -prefs Op preference-file
.Br
.Nm
-.Fl r Bro "" Ar nodename | Ar address | Ar local-address remote-address "" Brc
+.Fl r
+.Op Fl W
+.Bro "" Ar nodename | Ar address | Ar local-address remote-address "" Brc
.Br
.Nm
.Fl w Ar dynamic-store-key Op Fl t Ar timeout
The
.Fl w
option provides a means of checking for (and optionally waiting for the
-creation of) a dynamic store key.
+creation of or posting of a notification to) a dynamic store key.
.Pp
The
.Fl -get
.\"option provides a means of managing the system's network configuration.
.Sh OPTIONS
.Bl -tag -width xx
-.It Fl r Bro "" Ar nodename | Ar address | Ar local-address remote-address "" Brc
+.It Fl r Oo Fl W Oc Bro "" Ar nodename | Ar address | Ar local-address remote-address "" Brc
Check the network reachability of the specified host name, IP address, or a
pair of local and remote IP addresses.
One or more of the following strings will be reported to standard output.
gateway but is routed directly to one of the interfaces on the system.
.El
.Pp
+The reachability can also be monitored by specifying the
+.Fl W
+(watch) option.
+This will result in the current status being reported as well as the
+status when/if the network configuration changes.
+.Pp
A zero exit status will be returned when the reachability status is reported correctly.
A non-zero exit status will be returned if errors are detected with an error reported to standard error.
.It Fl w Ar dynamic-store-key Op Fl t Ar timeout
will return with a zero exit status.
If not present,
.Nm
-will wait for the specified time for the key to be established.
-A non-zero exit status will be returned if the key was not created within the specified time.
+will wait for the specified time for data to be associated with or a notification
+to be posted using the key.
+A non-zero exit status will be returned if the key was not created/posted
+within the specified time.
.Pp
.Nm
will wait indefinitely if a timeout of 0 seconds is specified.
/*
- * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include "session.h"
#include "tests.h"
-#include "SCDynamicStoreInternal.h"
-
#define LINE_LENGTH 256
SCPrint(TRUE, stderr, CFSTR(" or: %s --prefs\n"), command);
SCPrint(TRUE, stderr, CFSTR("\tinteractive access to the [raw] stored preferences.\n"));
SCPrint(TRUE, stderr, CFSTR("\n"));
- SCPrint(TRUE, stderr, CFSTR(" or: %s -r nodename\n"), command);
- SCPrint(TRUE, stderr, CFSTR(" or: %s -r address\n"), command);
- SCPrint(TRUE, stderr, CFSTR(" or: %s -r local-address remote-address\n"), command);
- SCPrint(TRUE, stderr, CFSTR("\tcheck reachability of node, address, or address pair.\n"));
+ SCPrint(TRUE, stderr, CFSTR(" or: %s [-W] -r nodename\n"), command);
+ SCPrint(TRUE, stderr, CFSTR(" or: %s [-W] -r address\n"), command);
+ SCPrint(TRUE, stderr, CFSTR(" or: %s [-W] -r local-address remote-address\n"), command);
+ SCPrint(TRUE, stderr, CFSTR("\tcheck reachability of node, address, or address pair (-W to \"watch\").\n"));
SCPrint(TRUE, stderr, CFSTR("\n"));
SCPrint(TRUE, stderr, CFSTR(" or: %s -w dynamic-store-key [ -t timeout ]\n"), command);
SCPrint(TRUE, stderr, CFSTR("\t-w\twait for presense of dynamic store key\n"));
InputRef src;
int timeout = 15; /* default timeout (in seconds) */
char *wait = NULL;
+ Boolean watch = FALSE;
int xStore = 0; /* non dynamic store command line options */
/* process any arguments */
- while ((opt = getopt_long(argc, argv, "dvprt:w:", longopts, &opti)) != -1)
+ while ((opt = getopt_long(argc, argv, "dvprt:w:W", longopts, &opti)) != -1)
switch(opt) {
case 'd':
_sc_debug = TRUE;
wait = optarg;
xStore++;
break;
+ case 'W':
+ watch = TRUE;
+ break;
case 0:
if (strcmp(longopts[opti].name, "dns") == 0) {
doDNS = TRUE;
usage(prog);
}
- /* are we checking the reachability of a host/address */
+ /* are we checking (or watching) the reachability of a host/address */
if (doReach) {
- if ((argc < 1) || (argc > 2)) {
+ if (argc < 1) {
usage(prog);
}
- do_checkReachability(argc, (char **)argv);
+ if (watch) {
+ do_watchReachability(argc, (char **)argv);
+ } else {
+ do_checkReachability(argc, (char **)argv);
+ }
/* NOT REACHED */
}
}
}
- while (process_line(src) == TRUE) {
- /* debug information, diagnostics */
- __showMachPortStatus();
+ while (TRUE) {
+ Boolean ok;
+
+ ok = process_line(src);
+ if (!ok) {
+ break;
+ }
}
/* close the socket, free resources */
/*
- * Copyright (c) 2000, 2001, 2003-2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2003-2005, 2007-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include "scutil.h"
#include "tests.h"
+#include <netdb.h>
+#include <netdb_async.h>
#include <sys/time.h>
#include <net/if.h>
#include <netinet/in.h>
#include <dnsinfo.h>
-__private_extern__
-void
-do_checkReachability(int argc, char **argv)
+static SCNetworkReachabilityRef
+_setupReachability(int argc, char **argv, SCNetworkReachabilityContext *context)
{
- SCNetworkConnectionFlags flags = 0;
+ struct sockaddr_in sin;
+ struct sockaddr_in6 sin6;
SCNetworkReachabilityRef target = NULL;
- if (argc == 1) {
- struct sockaddr_in sin;
- struct sockaddr_in6 sin6;
-
- bzero(&sin, sizeof(sin));
- sin.sin_len = sizeof(sin);
- sin.sin_family = AF_INET;
+ bzero(&sin, sizeof(sin));
+ sin.sin_len = sizeof(sin);
+ sin.sin_family = AF_INET;
- bzero(&sin6, sizeof(sin6));
- sin6.sin6_len = sizeof(sin6);
- sin6.sin6_family = AF_INET6;
+ bzero(&sin6, sizeof(sin6));
+ sin6.sin6_len = sizeof(sin6);
+ sin6.sin6_family = AF_INET6;
- if (inet_aton(argv[0], &sin.sin_addr) == 1) {
+ if (inet_aton(argv[0], &sin.sin_addr) == 1) {
+ if (argc == 1) {
target = SCNetworkReachabilityCreateWithAddress(NULL, (struct sockaddr *)&sin);
- } else if (inet_pton(AF_INET6, argv[0], &sin6.sin6_addr) == 1) {
- char *p;
+ if (context != NULL) {
+ context->info = "by address";
+ }
+ } else {
+ struct sockaddr_in r_sin;
+
+ bzero(&r_sin, sizeof(r_sin));
+ r_sin.sin_len = sizeof(r_sin);
+ r_sin.sin_family = AF_INET;
+ if (inet_aton(argv[1], &r_sin.sin_addr) == 0) {
+ SCPrint(TRUE, stderr, CFSTR("Could not interpret address \"%s\"\n"), argv[1]);
+ exit(1);
+ }
- p = strchr(argv[0], '%');
- if (p != NULL) {
- sin6.sin6_scope_id = if_nametoindex(p + 1);
+ target = SCNetworkReachabilityCreateWithAddressPair(NULL,
+ (struct sockaddr *)&sin,
+ (struct sockaddr *)&r_sin);
+ if (context != NULL) {
+ context->info = "by address pair";
}
+ }
+ } else if (inet_pton(AF_INET6, argv[0], &sin6.sin6_addr) == 1) {
+ char *p;
+
+ p = strchr(argv[0], '%');
+ if (p != NULL) {
+ sin6.sin6_scope_id = if_nametoindex(p + 1);
+ }
+ if (argc == 1) {
target = SCNetworkReachabilityCreateWithAddress(NULL, (struct sockaddr *)&sin6);
+ if (context != NULL) {
+ context->info = "by (v6) address";
+ }
} else {
- target = SCNetworkReachabilityCreateWithName(NULL, argv[0]);
- }
- } else /* if (argc == 2) */ {
- struct sockaddr_in l_sin;
- struct sockaddr_in r_sin;
-
- bzero(&l_sin, sizeof(l_sin));
- l_sin.sin_len = sizeof(l_sin);
- l_sin.sin_family = AF_INET;
- if (inet_aton(argv[0], &l_sin.sin_addr) == 0) {
- SCPrint(TRUE, stderr, CFSTR("Could not interpret address \"%s\"\n"), argv[0]);
- exit(1);
- }
+ struct sockaddr_in6 r_sin6;
+
+ bzero(&r_sin6, sizeof(r_sin6));
+ r_sin6.sin6_len = sizeof(r_sin6);
+ r_sin6.sin6_family = AF_INET6;
+ if (inet_pton(AF_INET6, argv[1], &r_sin6.sin6_addr) == 0) {
+ SCPrint(TRUE, stderr, CFSTR("Could not interpret address \"%s\"\n"), argv[1]);
+ exit(1);
+ }
- bzero(&r_sin, sizeof(r_sin));
- r_sin.sin_len = sizeof(r_sin);
- r_sin.sin_family = AF_INET;
- if (inet_aton(argv[1], &r_sin.sin_addr) == 0) {
- SCPrint(TRUE, stderr, CFSTR("Could not interpret address \"%s\"\n"), argv[1]);
- exit(1);
- }
+ p = strchr(argv[1], '%');
+ if (p != NULL) {
+ r_sin6.sin6_scope_id = if_nametoindex(p + 1);
+ }
- target = SCNetworkReachabilityCreateWithAddressPair(NULL,
- (struct sockaddr *)&l_sin,
- (struct sockaddr *)&r_sin);
+ target = SCNetworkReachabilityCreateWithAddressPair(NULL,
+ (struct sockaddr *)&sin6,
+ (struct sockaddr *)&r_sin6);
+ if (context != NULL) {
+ context->info = "by (v6) address pair";
+ }
+ }
+ } else {
+ if (argc == 1) {
+ target = SCNetworkReachabilityCreateWithName(NULL, argv[0]);
+ if (context != NULL) {
+ context->info = "by name";
+ }
+ } else {
+ CFStringRef str;
+ CFMutableDictionaryRef options;
+
+ options = CFDictionaryCreateMutable(NULL,
+ 0,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ if (strlen(argv[0]) > 0) {
+ str = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingUTF8);
+ CFDictionarySetValue(options, kSCNetworkReachabilityOptionNodeName, str);
+ CFRelease(str);
+ }
+ if (strlen(argv[1]) > 0) {
+ str = CFStringCreateWithCString(NULL, argv[1], kCFStringEncodingUTF8);
+ CFDictionarySetValue(options, kSCNetworkReachabilityOptionServName, str);
+ CFRelease(str);
+ }
+ if (argc > 2) {
+ CFDataRef data;
+ struct addrinfo hints = { 0 };
+ int i;
+
+ for (i = 2; i < argc; i++) {
+ if (strcasecmp(argv[i], "AI_ADDRCONFIG") == 0) {
+ hints.ai_flags |= AI_ADDRCONFIG;
+ } else if (strcasecmp(argv[i], "AI_ALL") == 0) {
+ hints.ai_flags |= AI_ALL;
+ } else if (strcasecmp(argv[i], "AI_V4MAPPED") == 0) {
+ hints.ai_flags |= AI_V4MAPPED;
+ } else if (strcasecmp(argv[i], "AI_V4MAPPED_CFG") == 0) {
+ hints.ai_flags |= AI_V4MAPPED_CFG;
+ } else if (strcasecmp(argv[i], "AI_ADDRCONFIG") == 0) {
+ hints.ai_flags |= AI_ADDRCONFIG;
+ } else if (strcasecmp(argv[i], "AI_V4MAPPED") == 0) {
+ hints.ai_flags |= AI_V4MAPPED;
+ } else if (strcasecmp(argv[i], "AI_DEFAULT") == 0) {
+ hints.ai_flags |= AI_DEFAULT;
+#ifdef AI_PARALLEL
+ } else if (strcasecmp(argv[i], "AI_PARALLEL") == 0) {
+ hints.ai_flags |= AI_PARALLEL;
+#endif // AI_PARALLEL
+ } else if (strcasecmp(argv[i], "PF_INET") == 0) {
+ hints.ai_family = PF_INET;
+ } else if (strcasecmp(argv[i], "PF_INET6") == 0) {
+ hints.ai_family = PF_INET6;
+ } else if (strcasecmp(argv[i], "SOCK_STREAM") == 0) {
+ hints.ai_socktype = SOCK_STREAM;
+ } else if (strcasecmp(argv[i], "SOCK_DGRAM") == 0) {
+ hints.ai_socktype = SOCK_DGRAM;
+ } else if (strcasecmp(argv[i], "SOCK_RAW") == 0) {
+ hints.ai_socktype = SOCK_RAW;
+ } else if (strcasecmp(argv[i], "IPPROTO_TCP") == 0) {
+ hints.ai_protocol = IPPROTO_TCP;
+ } else if (strcasecmp(argv[i], "IPPROTO_UDP") == 0) {
+ hints.ai_protocol = IPPROTO_UDP;
+ } else {
+ SCPrint(TRUE, stderr, CFSTR("Unrecognized hint: %s\n"), argv[i]);
+ exit(1);
+ }
+ }
+
+ data = CFDataCreate(NULL, (const UInt8 *)&hints, sizeof(hints));
+ CFDictionarySetValue(options, kSCNetworkReachabilityOptionHints, data);
+ CFRelease(data);
+ }
+ if (CFDictionaryGetCount(options) > 0) {
+ target = SCNetworkReachabilityCreateWithOptions(NULL, options);
+ if (context != NULL) {
+ context->info = "by (node and/or serv) name";
+ }
+ } else {
+ SCPrint(TRUE, stderr, CFSTR("Must specify nodename or servname\n"));
+ exit(1);
+ }
+ CFRelease(options);
+ }
}
- if (!target) {
- SCPrint(TRUE, stderr, CFSTR(" Could not determine status: %s\n"), SCErrorString(SCError()));
- exit(1);
- }
+ return target;
+}
- if (!SCNetworkReachabilityGetFlags(target, &flags)) {
- SCPrint(TRUE, stderr, CFSTR(" Could not determine status: %s\n"), SCErrorString(SCError()));
- exit(1);
+static void
+_printReachability(SCNetworkReachabilityRef target)
+{
+ SCNetworkReachabilityFlags flags;
+ Boolean ok;
+
+ ok = SCNetworkReachabilityGetFlags(target, &flags);
+ if (!ok) {
+ printf(" could not determine reachability, %s\n", SCErrorString(SCError()));
+ return;
}
- SCPrint(_sc_debug, stdout, CFSTR("flags = 0x%x"), flags);
+ SCPrint(_sc_debug, stdout, CFSTR("flags = 0x%08x"), flags);
if (flags != 0) {
SCPrint(_sc_debug, stdout, CFSTR(" ("));
- if (flags & kSCNetworkFlagsReachable) {
+ if (flags & kSCNetworkReachabilityFlagsReachable) {
SCPrint(TRUE, stdout, CFSTR("Reachable"));
- flags &= ~kSCNetworkFlagsReachable;
+ flags &= ~kSCNetworkReachabilityFlagsReachable;
SCPrint(flags != 0, stdout, CFSTR(","));
}
- if (flags & kSCNetworkFlagsTransientConnection) {
+ if (flags & kSCNetworkReachabilityFlagsTransientConnection) {
SCPrint(TRUE, stdout, CFSTR("Transient Connection"));
- flags &= ~kSCNetworkFlagsTransientConnection;
+ flags &= ~kSCNetworkReachabilityFlagsTransientConnection;
SCPrint(flags != 0, stdout, CFSTR(","));
}
- if (flags & kSCNetworkFlagsConnectionRequired) {
+ if (flags & kSCNetworkReachabilityFlagsConnectionRequired) {
SCPrint(TRUE, stdout, CFSTR("Connection Required"));
- flags &= ~kSCNetworkFlagsConnectionRequired;
+ flags &= ~kSCNetworkReachabilityFlagsConnectionRequired;
+ SCPrint(flags != 0, stdout, CFSTR(","));
+ }
+ if (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) {
+ SCPrint(TRUE, stdout, CFSTR("Automatic Connection On Traffic"));
+ flags &= ~kSCNetworkReachabilityFlagsConnectionOnTraffic;
SCPrint(flags != 0, stdout, CFSTR(","));
}
- if (flags & kSCNetworkFlagsConnectionAutomatic) {
- SCPrint(TRUE, stdout, CFSTR("Connection Automatic"));
- flags &= ~kSCNetworkFlagsConnectionAutomatic;
+ if (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) {
+ SCPrint(TRUE, stdout, CFSTR("Automatic Connection On Demand"));
+ flags &= ~kSCNetworkReachabilityFlagsConnectionOnDemand;
SCPrint(flags != 0, stdout, CFSTR(","));
}
- if (flags & kSCNetworkFlagsInterventionRequired) {
+ if (flags & kSCNetworkReachabilityFlagsInterventionRequired) {
SCPrint(TRUE, stdout, CFSTR("Intervention Required"));
- flags &= ~kSCNetworkFlagsInterventionRequired;
+ flags &= ~kSCNetworkReachabilityFlagsInterventionRequired;
SCPrint(flags != 0, stdout, CFSTR(","));
}
- if (flags & kSCNetworkFlagsIsLocalAddress) {
+ if (flags & kSCNetworkReachabilityFlagsIsLocalAddress) {
SCPrint(TRUE, stdout, CFSTR("Local Address"));
- flags &= ~kSCNetworkFlagsIsLocalAddress;
+ flags &= ~kSCNetworkReachabilityFlagsIsLocalAddress;
SCPrint(flags != 0, stdout, CFSTR(","));
}
- if (flags & kSCNetworkFlagsIsDirect) {
+ if (flags & kSCNetworkReachabilityFlagsIsDirect) {
SCPrint(TRUE, stdout, CFSTR("Directly Reachable Address"));
- flags &= ~kSCNetworkFlagsIsDirect;
+ flags &= ~kSCNetworkReachabilityFlagsIsDirect;
SCPrint(flags != 0, stdout, CFSTR(","));
}
+#if TARGET_OS_IPHONE
+ if (flags & kSCNetworkReachabilityFlagsIsWWAN) {
+ SCPrint(TRUE, stdout, CFSTR("WWAN"));
+ flags &= ~kSCNetworkReachabilityFlagsIsWWAN;
+ SCPrint(flags != 0, stdout, CFSTR(","));
+ }
+#endif // TARGET_OS_IPHONE
+ if (flags != 0) {
+ SCPrint(TRUE, stdout, CFSTR("0x%08x"), flags);
+ }
SCPrint(_sc_debug, stdout, CFSTR(")"));
} else {
SCPrint(_sc_debug, stdout, CFSTR(" ("));
SCPrint(_sc_debug, stdout, CFSTR(")"));
}
SCPrint(TRUE, stdout, CFSTR("\n"));
+
+ return;
+}
+
+
+__private_extern__
+void
+do_checkReachability(int argc, char **argv)
+{
+ SCNetworkReachabilityRef target;
+
+ target = _setupReachability(argc, argv, NULL);
+ if (target == NULL) {
+ SCPrint(TRUE, stderr, CFSTR(" Could not determine status: %s\n"), SCErrorString(SCError()));
+ exit(1);
+ }
+
+ _printReachability(target);
+ CFRelease(target);
+ exit(0);
+}
+
+
+static void
+callout(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void *info)
+{
+ static int n = 3;
+ struct tm tm_now;
+ struct timeval tv_now;
+
+ (void)gettimeofday(&tv_now, NULL);
+ (void)localtime_r(&tv_now.tv_sec, &tm_now);
+
+ SCPrint(TRUE, stdout, CFSTR("\n*** %2d:%02d:%02d.%03d\n\n"),
+ tm_now.tm_hour,
+ tm_now.tm_min,
+ tm_now.tm_sec,
+ tv_now.tv_usec / 1000);
+ SCPrint(TRUE, stdout, CFSTR("%2d: callback w/flags=0x%08x (info=\"%s\")\n"), n++, flags, (char *)info);
+ SCPrint(TRUE, stdout, CFSTR(" %@\n"), target);
+ _printReachability(target);
+ SCPrint(TRUE, stdout, CFSTR("\n"));
+ return;
+}
+
+
+__private_extern__
+void
+do_watchReachability(int argc, char **argv)
+{
+ SCNetworkReachabilityContext context = { 0, NULL, NULL, NULL, NULL };
+ SCNetworkReachabilityRef target;
+ SCNetworkReachabilityRef target_async;
+
+ target = _setupReachability(argc, argv, NULL);
+ if (target == NULL) {
+ SCPrint(TRUE, stderr, CFSTR(" Could not determine status: %s\n"), SCErrorString(SCError()));
+ exit(1);
+ }
+
+ target_async = _setupReachability(argc, argv, &context);
+ if (target_async == NULL) {
+ SCPrint(TRUE, stderr, CFSTR(" Could not determine status: %s\n"), SCErrorString(SCError()));
+ exit(1);
+ }
+
+ // Normally, we don't want to make any calls to SCNetworkReachabilityGetFlags()
+ // until after the "target" has been scheduled on a run loop. Otherwise, we'll
+ // end up making a synchronous DNS request and that's not what we want.
+ //
+ // But, to test the case were an application call SCNetworkReachabilityGetFlags()
+ // we provide the "CHECK_REACHABILITY_BEFORE_SCHEDULING" environment variable.
+ if (getenv("CHECK_REACHABILITY_BEFORE_SCHEDULING") != NULL) {
+ CFRelease(target_async);
+ target_async = CFRetain(target);
+ }
+
+ // Direct check of reachability
+ SCPrint(TRUE, stdout, CFSTR(" 0: direct\n"));
+ SCPrint(TRUE, stdout, CFSTR(" %@\n"), target);
+ _printReachability(target);
+ CFRelease(target);
+ SCPrint(TRUE, stdout, CFSTR("\n"));
+
+ // schedule the target
+ SCPrint(TRUE, stdout, CFSTR(" 1: start\n"));
+ SCPrint(TRUE, stdout, CFSTR(" %@\n"), target_async);
+ //_printReachability(target_async);
+ SCPrint(TRUE, stdout, CFSTR("\n"));
+
+ if (!SCNetworkReachabilitySetCallback(target_async, callout, &context)) {
+ printf("SCNetworkReachabilitySetCallback() failed: %s\n", SCErrorString(SCError()));
+ exit(1);
+ }
+
+ if (!SCNetworkReachabilityScheduleWithRunLoop(target_async, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)) {
+ printf("SCNetworkReachabilityScheduleWithRunLoop() failed: %s\n", SCErrorString(SCError()));
+ exit(1);
+ }
+
+ // Note: now that we are scheduled on a run loop we can call SCNetworkReachabilityGetFlags()
+ // to get the current status. For "names", a DNS lookup has already been initiated.
+ SCPrint(TRUE, stdout, CFSTR(" 2: on runloop\n"));
+ SCPrint(TRUE, stdout, CFSTR(" %@\n"), target_async);
+ _printReachability(target_async);
+ SCPrint(TRUE, stdout, CFSTR("\n"));
+
+ CFRunLoopRun();
exit(0);
}
}
for (i = 0; i < resolver->n_sortaddr; i++) {
- SCPrint(TRUE, stdout, CFSTR(" sortaddr[%d] : %s/%s\n"),
- i,
- inet_ntoa(resolver->sortaddr[i]->address),
- inet_ntoa(resolver->sortaddr[i]->mask));
+ char abuf[32];
+ char mbuf[32];
+
+ (void)inet_ntop(AF_INET, &resolver->sortaddr[i]->address, abuf, sizeof(abuf));
+ (void)inet_ntop(AF_INET, &resolver->sortaddr[i]->mask, mbuf, sizeof(mbuf));
+ SCPrint(TRUE, stdout, CFSTR(" sortaddr[%d] : %s/%s\n"), i, abuf, mbuf);
}
if (resolver->options != NULL) {
proxies = SCDynamicStoreCopyProxies(NULL);
if (proxies != NULL) {
SCPrint(TRUE, stdout, CFSTR("%@\n"), proxies);
+ CFRelease(proxies);
} else {
SCPrint(TRUE, stdout, CFSTR("No proxy configuration available\n"));
}
struct itimerval itv;
CFStringRef key;
CFMutableArrayRef keys;
+ Boolean ok;
store = SCDynamicStoreCreate(NULL, CFSTR("scutil (wait)"), waitKeyFound, NULL);
if (store == NULL) {
exit(1);
}
- keys = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
key = CFStringCreateWithCString(NULL, waitKey, kCFStringEncodingUTF8);
- CFArrayAppendValue(keys, key);
- if (!SCDynamicStoreSetNotificationKeys(store, keys, NULL)) {
+ keys = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+ CFArrayAppendValue(keys, key);
+ ok = SCDynamicStoreSetNotificationKeys(store, keys, NULL);
+ CFRelease(keys);
+ if (!ok) {
SCPrint(TRUE, stderr,
CFSTR("SCDynamicStoreSetNotificationKeys() failed: %s\n"), SCErrorString(SCError()));
exit(1);
CFRunLoopSourceRef notifyRls = NULL;
SCDynamicStoreRef store = NULL;
CFPropertyListRef value = NULL;
-
+
int
main(int argc, char **argv)
{
/*
- * Copyright (c) 2000, 2001, 2004 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2001, 2004, 2007 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
__BEGIN_DECLS
void do_checkReachability (int argc, char **argv);
+void do_watchReachability (int argc, char **argv);
void do_showDNSConfiguration (int argc, char **argv);
void do_showProxyConfiguration (int argc, char **argv);
void do_snapshot (int argc, char **argv);