]> git.saurik.com Git - apple/configd.git/commitdiff
configd-137.2.tar.gz mac-os-x-1044x86 mac-os-x-1045x86 mac-os-x-1046x86 v137.2
authorApple <opensource@apple.com>
Mon, 20 Feb 2006 21:45:42 +0000 (21:45 +0000)
committerApple <opensource@apple.com>
Mon, 20 Feb 2006 21:45:42 +0000 (21:45 +0000)
26 files changed:
Plugins/ATconfig/Info.plist
Plugins/IPMonitor/Info.plist
Plugins/IPMonitor/dns-configuration.c
Plugins/IPMonitor/ip_plugin.c
Plugins/InterfaceNamer/Info.plist
Plugins/KernelEventMonitor/Info.plist
Plugins/Kicker/Info.plist
Plugins/LinkConfiguration/Info.plist
Plugins/PreferencesMonitor/Info.plist
Plugins/PreferencesMonitor/prefsmon.c
SystemConfiguration.fproj/Info.plist
SystemConfiguration.fproj/NetworkConfiguration.plist
SystemConfiguration.fproj/SCDOpen.c
SystemConfiguration.fproj/SCLocation.c
SystemConfiguration.fproj/SCNetworkConfigurationInternal.c
SystemConfiguration.fproj/SCNetworkConfigurationInternal.h
SystemConfiguration.fproj/SCNetworkConnection.c
SystemConfiguration.fproj/SCNetworkInterface.c
SystemConfiguration.fproj/SCNetworkReachability.c
SystemConfiguration.fproj/SCNetworkService.c
SystemConfiguration.fproj/SCPLock.c
SystemConfiguration.fproj/SCPPath.c
SystemConfiguration.fproj/SCProxies.c
configd.tproj/plugin_support.c
configd.xcode/project.pbxproj
scutil.tproj/scutil.c

index b7032f7f1e0949932feba2ccde323137ca45c5f0..79a296b8e67ead7fea6aa71cae88ac91a3a5c821 100644 (file)
@@ -15,7 +15,7 @@
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.8.3</string>
+       <string>1.8.5</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
index eacab67a7952434c4e4b543bdf5b22ecc4557ed6..32df8de19b5e187a1d53d4587688dab8b12cf8b7 100644 (file)
@@ -15,7 +15,7 @@
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.8.3</string>
+       <string>1.8.5</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
index d8ed3045607997fa6bf66c10a25aa8ea698dc042..bcbae5aa80cbdd71c0008c9a4bfb068075476c6b 100644 (file)
@@ -108,8 +108,6 @@ add_supplemental(CFMutableArrayRef supplemental, CFDictionaryRef dns, uint32_t d
                        num = CFNumberCreate(NULL, kCFNumberIntType, &defaultOrder);
                        CFDictionarySetValue(match_resolver, kSCPropNetDNSSearchOrder, num);
                        CFRelease(num);
-
-                       defaultOrder++;         // if multiple domains, maintain ordering
                }
 
                match_order = CFDictionaryGetValue(match_resolver, kSCPropNetDNSSearchOrder);
@@ -293,42 +291,6 @@ compareBySearchOrder(const void *val1, const void *val2, void *context)
 }
 
 
-static CFStringRef
-trimDomain(CFStringRef domain)
-{
-       CFIndex length;
-       CFRange range;
-       Boolean trimmed = FALSE;
-
-       if (!isA_CFString(domain)) {
-               return NULL;
-       }
-
-       // remove trailing dots
-       length = CFStringGetLength(domain);
-       while (CFStringFindWithOptions(domain,
-                                      CFSTR("."),
-                                      CFRangeMake(0, length),
-                                      kCFCompareAnchored|kCFCompareBackwards,
-                                      &range)) {
-               trimmed = TRUE;
-               length = range.location;
-       }
-
-       if (length == 0) {
-               return NULL;
-       }
-
-       if (trimmed) {
-               domain = CFStringCreateWithSubstring(NULL, domain, CFRangeMake(0, length));
-       } else {
-               CFRetain(domain);
-       }
-
-       return domain;
-}
-
-
 static void
 update_search_domains(CFMutableDictionaryRef *defaultDomain, CFArrayRef supplemental)
 {
@@ -337,13 +299,13 @@ update_search_domains(CFMutableDictionaryRef *defaultDomain, CFArrayRef suppleme
        CFArrayRef              defaultSearchDomains    = NULL;
        CFIndex                 defaultSearchIndex      = 0;
        CFIndex                 i;
+       CFIndex                 n;
        CFMutableArrayRef       mySearchDomains;
        CFMutableArrayRef       mySupplemental          = (CFMutableArrayRef)supplemental;
-       CFIndex                 n_supplemental;
        Boolean                 searchDomainAdded       = FALSE;
 
-       n_supplemental = CFArrayGetCount(supplemental);
-       if (n_supplemental == 0) {
+       n = CFArrayGetCount(supplemental);
+       if (n == 0) {
                // if no supplemental domains
                return;
        }
@@ -361,36 +323,20 @@ update_search_domains(CFMutableDictionaryRef *defaultDomain, CFArrayRef suppleme
                defaultSearchDomains = CFDictionaryGetValue(*defaultDomain, kSCPropNetDNSSearchDomains);
        }
 
-       mySearchDomains = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
-
        if (isA_CFArray(defaultSearchDomains)) {
-               CFIndex n_search;
-
-               n_search = CFArrayGetCount(defaultSearchDomains);
-               for (i = 0; i < n_search; i++) {
-                       CFStringRef     search;
-
-                       search = CFArrayGetValueAtIndex(defaultSearchDomains, i);
-                       search = trimDomain(search);
-                       if (search != NULL) {
-                               CFArrayAppendValue(mySearchDomains, search);
-                               CFRelease(search);
-                       }
-               }
+               mySearchDomains = CFArrayCreateMutableCopy(NULL, 0, defaultSearchDomains);
        } else {
-               defaultDomainName = trimDomain(defaultDomainName);
-               if (defaultDomainName != NULL) {
+               mySearchDomains = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+               if (isA_CFString(defaultDomainName)) {
                        char    *domain;
-                       int     domain_parts    = 1;
-                       char    *dp;
+                       int     domain_parts    = 1;
+                       char    *dp;
 
                        domain = _SC_cfstring_to_cstring(defaultDomainName,
                                                         NULL,
                                                         0,
                                                         kCFStringEncodingUTF8);
-                       CFRelease(defaultDomainName);
 
-                       // count domain parts
                        for (dp = domain; *dp != '\0'; dp++) {
                                if (*dp == '.') {
                                        domain_parts++;
@@ -399,13 +345,13 @@ update_search_domains(CFMutableDictionaryRef *defaultDomain, CFArrayRef suppleme
 
                        dp = domain;
                        for (i = LOCALDOMAINPARTS; i <= domain_parts; i++) {
-                               CFStringRef     search;
+                               CFStringRef    searchDomain;
 
-                               search = CFStringCreateWithCString(NULL,
-                                                                  dp,
-                                                                  kCFStringEncodingUTF8);
-                               CFArrayAppendValue(mySearchDomains, search);
-                               CFRelease(search);
+                               searchDomain = CFStringCreateWithCString(NULL,
+                                                                        dp,
+                                                                        kCFStringEncodingUTF8);
+                               CFArrayAppendValue(mySearchDomains, searchDomain);
+                               CFRelease(searchDomain);
 
                                dp = strchr(dp, '.') + 1;
                        }
@@ -414,17 +360,16 @@ update_search_domains(CFMutableDictionaryRef *defaultDomain, CFArrayRef suppleme
                }
        }
 
-       if (n_supplemental > 1) {
+       if (n > 1) {
                mySupplemental = CFArrayCreateMutableCopy(NULL, 0, supplemental);
                CFArraySortValues(mySupplemental,
-                                 CFRangeMake(0, n_supplemental),
+                                 CFRangeMake(0, n),
                                  compareBySearchOrder,
                                  NULL);
        }
 
-       for (i = 0; i < n_supplemental; i++) {
+       for (i = 0; i < n; i++) {
                CFDictionaryRef dns;
-               CFIndex         domainIndex;
                CFNumberRef     num;
                CFStringRef     supplementalDomain;
                uint32_t        supplementalOrder;
@@ -432,21 +377,13 @@ update_search_domains(CFMutableDictionaryRef *defaultDomain, CFArrayRef suppleme
                dns = CFArrayGetValueAtIndex(mySupplemental, i);
 
                supplementalDomain = CFDictionaryGetValue(dns, kSCPropNetDNSDomainName);
-               supplementalDomain = trimDomain(supplementalDomain);
-               if (supplementalDomain == NULL) {
+               if (CFArrayContainsValue(mySearchDomains,
+                                        CFRangeMake(0, CFArrayGetCount(mySearchDomains)),
+                                        supplementalDomain)) {
+                       // if supplemental domain is already in the search list
                        continue;
                }
 
-               if (CFStringHasSuffix(supplementalDomain, CFSTR(".in-addr.arpa")) ||
-                   CFStringHasSuffix(supplementalDomain, CFSTR(".ip6.arpa"    ))) {
-                       CFRelease(supplementalDomain);
-                       continue;
-               }
-
-               domainIndex = CFArrayGetFirstIndexOfValue(mySearchDomains,
-                                                         CFRangeMake(0, CFArrayGetCount(mySearchDomains)),
-                                                         supplementalDomain);
-
                num = CFDictionaryGetValue(dns, kSCPropNetDNSSearchOrder);
                if (!isA_CFNumber(num) ||
                    !CFNumberGetValue(num, kCFNumberIntType, &supplementalOrder)) {
@@ -454,27 +391,15 @@ update_search_domains(CFMutableDictionaryRef *defaultDomain, CFArrayRef suppleme
                }
 
                if (supplementalOrder < defaultOrder) {
-                       if (domainIndex != kCFNotFound) {
-                               // if supplemental domain is already in the search list
-                               CFArrayRemoveValueAtIndex(mySearchDomains, domainIndex);
-                               if (domainIndex < defaultSearchIndex) {
-                                       defaultSearchIndex--;
-                               }
-                       }
                        CFArrayInsertValueAtIndex(mySearchDomains,
                                                  defaultSearchIndex,
                                                  supplementalDomain);
                        defaultSearchIndex++;
-                       searchDomainAdded = TRUE;
                } else {
-                       if (domainIndex == kCFNotFound) {
-                               // add to the (end of the) search list
-                               CFArrayAppendValue(mySearchDomains, supplementalDomain);
-                               searchDomainAdded = TRUE;
-                       }
+                       CFArrayAppendValue(mySearchDomains, supplementalDomain);
                }
 
-               CFRelease(supplementalDomain);
+               searchDomainAdded = TRUE;
        }
 
        if (searchDomainAdded) {
@@ -567,7 +492,7 @@ create_resolver(CFDictionaryRef dns)
 
                                p = strchr(buf, '%');
                                if (p != NULL) {
-                                       addr.sin6.sin6_scope_id = if_nametoindex(p + 1);
+                                       addr.sin6.sin6_scope_id = if_nametoindex(p+1);
                                }
 
                                addr.sin6.sin6_len    = sizeof(addr.sin6);
index daa906522d75186060545c19527d14a9f502ad89..8603a743781017ac9617606dbc3d446a3cb31800 100644 (file)
@@ -1697,16 +1697,20 @@ update_dnsinfo(CFStringRef primary, CFArrayRef service_order, keyChangeListRef k
 {
     CFDictionaryRef            dict = NULL;
 
-    if (primary == NULL) {
-       dns_configuration_set(NULL, NULL, NULL);
-    } else {
+    if (primary != NULL) {
        CFDictionaryRef         service_dict;
 
        service_dict = CFDictionaryGetValue(S_service_state_dict, primary);
        if (service_dict != NULL) {
            dict = CFDictionaryGetValue(service_dict, kSCEntNetDNS);
        }
-
+    }
+    if (dict == NULL) {
+       /* update DNS configuration */
+       dns_configuration_set(NULL, NULL, NULL);
+    }
+    else {
+       /* update DNS configuration */
        dns_configuration_set(dict, S_service_state_dict, service_order);
     }
     keyChangeListNotifyKey(keys, S_notify_dnsinfo);
index a65b9928b866dc82bf2eb323afdeef91ade5ff52..31fdb04f1ed77cc095b51c59729d127dd04c0231 100644 (file)
@@ -15,7 +15,7 @@
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.8.3</string>
+       <string>1.8.5</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
index d223f68809dc545e355d6168e7b0d3029634269b..ce479f234cf235d3852a8aed8846c300eed69c2f 100644 (file)
@@ -15,7 +15,7 @@
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.8.3</string>
+       <string>1.8.5</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
index 17bf9e386ff0677ae80406f51d58c9962c716002..64d854e966180544acc20ca392bfe68fb1675767 100644 (file)
@@ -15,7 +15,7 @@
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.8.3</string>
+       <string>1.8.5</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
index f403d7df3fe195400ee3f82833fb82c67a936e31..895367569b98480485c9932eeaf4447d54c50a7e 100644 (file)
@@ -15,7 +15,7 @@
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.8.3</string>
+       <string>1.8.5</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
index 578b8262d9e1543197a5111987944d4097a85298..67b33759ef8ef86b5f8905d9362cbbd2646cedf2 100644 (file)
@@ -15,7 +15,7 @@
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.8.3</string>
+       <string>1.8.5</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
index 3d42d36f205a8cf6d63547a4f2aac8b247bfbd26..c96145789328e76846c8cd96819cee3af814458b 100644 (file)
@@ -46,6 +46,8 @@
 #include <SystemConfiguration/SCValidation.h>
 
 
+
+
 static SCPreferencesRef                prefs           = NULL;
 static SCDynamicStoreRef       store           = NULL;
 
@@ -198,6 +200,7 @@ updateConfiguration(SCPreferencesRef                prefs,
        CFMutableArrayRef       patterns;
        CFDictionaryRef         set             = NULL;
 
+
        if ((notificationType & kSCPreferencesNotificationApply) != kSCPreferencesNotificationApply) {
                return;
        }
index 4f233ea8b6738bc7f1e745229e9f5de815b3ebf3..04a63697070e4a9292fb5d0505659933da68d261 100644 (file)
@@ -7,7 +7,7 @@
        <key>CFBundleExecutable</key>
        <string>SystemConfiguration</string>
        <key>CFBundleGetInfoString</key>
-       <string>1.8.3</string>
+       <string>1.8.5</string>
        <key>CFBundleIdentifier</key>
        <string>com.apple.SystemConfiguration</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <key>CFBundlePackageType</key>
        <string>FMWK</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.8.3</string>
+       <string>1.8.5</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>1.8.3</string>
+       <string>1.8.5</string>
 </dict>
 </plist>
index 46a3254a6b0d512c3868e85ea9cc1cb46a901c97..a56f10033c9faefd661a09701a1dad02c28243c5 100644 (file)
@@ -23,7 +23,7 @@
                <key>Modem</key>
                <dict>
                        <key>ConnectionScript</key>
-                       <string>Apple Internal 56K Modem (v.34)</string>
+                       <string>Apple Internal 56K Modem (v.92)</string>
                        <key>DataCompression</key>
                        <integer>1</integer>
                        <key>DialMode</key>
                        <key>VerboseLogging</key>
                        <integer>0</integer>
                </dict>
-               <key>PPP-IEEE80211</key>
-               <dict>
-                       <key>ACSPEnabled</key>
-                       <integer>0</integer>
-                       <key>CommDisplayTerminalWindow</key>
-                       <integer>0</integer>
-                       <key>CommRedialCount</key>
-                       <integer>1</integer>
-                       <key>CommRedialEnabled</key>
-                       <integer>1</integer>
-                       <key>CommRedialInterval</key>
-                       <integer>5</integer>
-                       <key>CommUseTerminalScript</key>
-                       <integer>0</integer>
-                       <key>DialOnDemand</key>
-                       <integer>0</integer>
-                       <key>DisconnectOnIdle</key>
-                       <integer>0</integer>
-                       <key>DisconnectOnIdleTimer</key>
-                       <integer>1800</integer>
-                       <key>DisconnectOnLogout</key>
-                       <integer>1</integer>
-                       <key>DisconnectOnSleep</key>
-                       <integer>1</integer>
-                       <key>IPCPCompressionVJ</key>
-                       <integer>1</integer>
-                       <key>IdleReminder</key>
-                       <integer>0</integer>
-                       <key>IdleReminderTimer</key>
-                       <integer>1800</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>
-               </dict>
                <key>PPP-IrDA</key>
                <dict/>
                <key>PPP-L2TP</key>
                <key>IEEE80211</key>
                <dict>
                        <key>AppleTalk</key>
-                       <dict>
-                               <key>ConfigMethod</key>
-                               <string>Node</string>
-                               <key>__INACTIVE__</key>
-                               <true/>
-                       </dict>
+                       <dict/>
                        <key>DNS</key>
                        <dict/>
                        <key>IPv4</key>
                                <string>DHCP</string>
                        </dict>
                        <key>IPv6</key>
-                       <dict>
-                               <key>ConfigMethod</key>
-                               <string>Automatic</string>
-                       </dict>
+                       <dict/>
                        <key>Proxies</key>
                        <dict>
                                <key>FTPPassive</key>
index 77352f520aed4688e9a4616b97783d6d41ab97bd..aa66c3ec1888a525497a3eade4280ad7808eb5cf 100644 (file)
@@ -246,6 +246,7 @@ __SCDynamicStoreCreatePrivate(CFAllocatorRef                allocator,
        /* initialize runtime */
        pthread_once(&initialized, __SCDynamicStoreInitialize);
 
+
        /* allocate session */
        size  = sizeof(SCDynamicStorePrivate) - sizeof(CFRuntimeBase);
        storePrivate = (SCDynamicStorePrivateRef)_CFRuntimeCreateInstance(allocator,
index 602ab547dfdc406b1363082bed2e8422626f2351..bf049ce63d437ee7a4ed987d34e71a148a12fce6 100644 (file)
@@ -32,6 +32,7 @@
 #include <SystemConfiguration/SCValidation.h>
 #include <SystemConfiguration/SCPrivate.h>
 
+
 CFStringRef
 SCDynamicStoreKeyCreateLocation(CFAllocatorRef allocator)
 {
@@ -77,6 +78,7 @@ SCDynamicStoreCopyLocation(SCDynamicStoreRef store)
 
     done :
 
+
        if (tempSession)        CFRelease(store);
        if (dict)               CFRelease(dict);
 
index 14266e6beb4c88488c3b466e340fe8764085f6e7..d9f157922068e4deafbef78fa06adcdbf7217ca2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004,2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
@@ -72,20 +72,26 @@ __setPrefsConfiguration(SCPreferencesRef    prefs,
                        CFDictionaryRef         config,
                        Boolean                 keepInactive)
 {
-       CFMutableDictionaryRef  newConfig;
-       Boolean                 ok;
+       CFMutableDictionaryRef  newConfig       = NULL;
+       Boolean                 ok              = FALSE;
 
-       if (!isA_CFDictionary(config)) {
-               _SCErrorSet(kSCStatusInvalidArgument);
-               return FALSE;
+       if (config != NULL) {
+               if (!isA_CFDictionary(config)) {
+                       _SCErrorSet(kSCStatusInvalidArgument);
+                       return FALSE;
+               }
+               newConfig = CFDictionaryCreateMutableCopy(NULL, 0, config);
+       } else {
+               newConfig = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
        }
 
-       newConfig = CFDictionaryCreateMutableCopy(NULL, 0, config);
-
        if (keepInactive) {
                CFDictionaryRef curConfig;
 
-               // preserve enabled/disabled state
+               /*
+                * preserve enabled/disabled state
+                */
+
                curConfig = SCPreferencesPathGetValue(prefs, path);
                if (isA_CFDictionary(curConfig) && CFDictionaryContainsKey(curConfig, kSCResvInactive)) {
                        // if currently disabled
@@ -96,10 +102,22 @@ __setPrefsConfiguration(SCPreferencesRef   prefs,
                }
        }
 
-       // set new configuration
-       ok = SCPreferencesPathSetValue(prefs, path, newConfig);
+       /*
+        * set new configuration
+        */
 
-       CFRelease(newConfig);
+       if (CFDictionaryGetCount(newConfig) == 0) {
+               CFRelease(newConfig);
+               newConfig = NULL;
+       }
+
+       if (newConfig == NULL) {
+               ok = SCPreferencesPathRemoveValue(prefs, path);
+       } else {
+               ok = SCPreferencesPathSetValue(prefs, path, newConfig);
+       }
+
+       if (newConfig != NULL)  CFRelease(newConfig);
        return ok;
 }
 
@@ -127,7 +145,10 @@ __setPrefsEnabled(SCPreferencesRef      prefs,
        CFMutableDictionaryRef  newConfig       = NULL;
        Boolean                 ok              = FALSE;
 
-       // preserve current configuration
+       /*
+        * preserve current configuration
+        */
+
        curConfig = SCPreferencesPathGetValue(prefs, path);
        if (curConfig != NULL) {
                if (!isA_CFDictionary(curConfig)) {
@@ -147,7 +168,10 @@ __setPrefsEnabled(SCPreferencesRef      prefs,
                CFDictionarySetValue(newConfig, kSCResvInactive, kCFBooleanTrue);
        }
 
-       // update configuration
+       /*
+        * update configuration
+        */
+
        if (CFDictionaryGetCount(newConfig) == 0) {
                CFRelease(newConfig);
                newConfig = NULL;
@@ -194,7 +218,7 @@ __copyTemplates()
                return NULL;
        }
 
-       // convert the XML data into a property list
+       /* convert the XML data into a property list */
        templates = CFPropertyListCreateFromXMLData(NULL, xmlTemplates, kCFPropertyListImmutable, &xmlError);
        CFRelease(xmlTemplates);
        if (templates == NULL) {
index 0a3f2dd39b1c418e18f889f1d1fa8a4e831f0777..e0c981b38862f214b948c88283e3f76c07afa28a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
@@ -104,6 +104,7 @@ typedef struct {
 
        // [SCPreferences] interface entity information
        CFStringRef             entity_device;          // interface device
+       CFStringRef             entity_hardware;        // interface hardware
        CFStringRef             entity_type;            // interface type
        CFStringRef             entity_subtype;         // interface subtype
 
@@ -116,8 +117,7 @@ typedef struct {
        Boolean                 builtin;
        CFStringRef             location;
        CFStringRef             path;
-       CFStringRef             modemCCL;
-       Boolean                 modemIsV92;
+       Boolean                 supportsDeviceOnHold;
        Boolean                 supportsBond;
        Boolean                 supportsVLAN;
 
@@ -156,9 +156,6 @@ __SCNetworkInterfaceCreatePrivate           (CFAllocatorRef         allocator,
                                                 SCNetworkServiceRef    service,
                                                 io_string_t            path);
 
-CFDictionaryRef
-__SCNetworkInterfaceCopyInterfaceEntity                (SCNetworkInterfaceRef  interface);
-
 SCNetworkInterfaceRef
 __SCNetworkInterfaceCreateWithEntity           (CFAllocatorRef         allocator,
                                                 CFDictionaryRef        interface_entity,
@@ -167,12 +164,6 @@ __SCNetworkInterfaceCreateWithEntity               (CFAllocatorRef         allocator,
 CFArrayRef
 __SCNetworkInterfaceCopyDeepConfiguration       (SCNetworkInterfaceRef  interface);
 
-CFStringRef
-__SCNetworkInterfaceGetModemCCL                        (SCNetworkInterfaceRef  interface);
-
-Boolean
-__SCNetworkInterfaceIsModemV92                 (SCNetworkInterfaceRef  interface);
-
 Boolean
 __SCNetworkInterfaceSetConfiguration           (SCNetworkInterfaceRef  interface,
                                                 CFDictionaryRef        config,
index eb67e80272a943a953e286cf2857f6523432d6c5..88d9170cb5af2dc8ea35eb0f3255574555d75e48 100644 (file)
@@ -61,6 +61,7 @@
 #include "pppcontroller.h"
 #include <ppp/pppcontroller_types.h>
 
+
 /* -------------------------------------------------------------------------------------------
 ------------------------------------------------------------------------------------------- */
 
@@ -415,6 +416,7 @@ SCNetworkConnectionCreateWithServiceID(CFAllocatorRef                       allocator,
                return NULL;
        }
 
+
        connectionPrivate = __SCNetworkConnectionCreatePrivate(allocator, serviceID, callout, context);
 
        return (SCNetworkConnectionRef)connectionPrivate;
@@ -983,6 +985,7 @@ SCNetworkConnectionCopyUserPreferences(CFDictionaryRef      selectionOptions,
        Boolean                 success         = FALSE;
        int                     status;
 
+
        envdebug = getenv("PPPDebug");
        if (envdebug) {
                if (sscanf(envdebug, "%d", &debug) != 1)
@@ -1211,6 +1214,7 @@ SCNetworkConnectionPrivateCopyDefaultServiceIDForDial(SCDynamicStoreRef session,
        CFPropertyListRef       lastServiceSelectedInIC = NULL;
 
 
+
        // we found the service the user last had open in IC
        if (lastServiceSelectedInIC != NULL) {
                // make sure its a PPP service
index 9943ed13220554f81db689ffa65ea1b820cf6b5b..058a032ecc491daa1fc4939eba2246dad02c5c68 100644 (file)
 #include "SCNetworkConfiguration.h"
 #include "SCNetworkConfigurationInternal.h"
 
-#include <string.h>
 #include <mach/mach.h>
 #include <net/if.h>
 #include <net/if_types.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <pthread.h>
-#include <NSSystemDirectories.h>
 
 
 static CFStringRef     __SCNetworkInterfaceCopyDescription     (CFTypeRef cf);
@@ -119,6 +114,7 @@ static SCNetworkInterfacePrivate __kSCNetworkInterfaceIPv4      = {
        NULL,                                   // service
        NULL,                                   // unsaved
        NULL,                                   // entity_device
+       NULL,                                   // entity_hardware
        NULL,                                   // entity_type
        NULL,                                   // entity_subtype
        NULL,                                   // supported_interface_types
@@ -127,8 +123,7 @@ static SCNetworkInterfacePrivate __kSCNetworkInterfaceIPv4      = {
        FALSE,                                  // builtin
        NULL,                                   // location
        NULL,                                   // path
-       NULL,                                   // modemCCL
-       FALSE,                                  // modemIsV92
+       FALSE,                                  // supportsDeviceOnHold
        FALSE,                                  // supportsBond
        FALSE,                                  // supportsVLAN
        kSortUnknown                            // sort_order
@@ -151,29 +146,28 @@ const SCNetworkInterfaceRef kSCNetworkInterfaceIPv4     = (SCNetworkInterfaceRef
 
 static const struct {
        const CFStringRef       *interface_type;
-       const CFStringRef       *entity_hardware;
        Boolean                 per_interface_config;
        uint32_t                supported_interfaces;
        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       },
-       { &kSCNetworkInterfaceTypeEthernet      , &kSCEntNetEthernet, TRUE ,    doPPP,                  &kSCValNetInterfaceSubTypePPPoE,        doAppleTalk|doDNS|doIPv4|doIPv6|doProxies       },
-       { &kSCNetworkInterfaceTypeFireWire      , &kSCEntNetFireWire, TRUE ,    doNone,                 NULL,                                   doDNS|doIPv4|doIPv6|doProxies                   },
-       { &kSCNetworkInterfaceTypeIEEE80211     , &kSCEntNetAirPort , TRUE ,    doPPP,                  &kSCValNetInterfaceSubTypePPPoE,        doAppleTalk|doDNS|doIPv4|doIPv6|doProxies       },
-       { &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                   },
-       { &kSCNetworkInterfaceTypePPTP          , NULL              , FALSE,    doPPP,                  &kSCValNetInterfaceSubTypePPTP,         doNone                                          },
-       { &kSCNetworkInterfaceTypeSerial        , &kSCEntNetModem   , FALSE,    doPPP,                  &kSCValNetInterfaceSubTypePPPSerial,    doNone                                          },
-       { &kSCNetworkInterfaceTypeVLAN          , &kSCEntNetEthernet, TRUE ,    doNone,                 NULL,                                   doAppleTalk|doDNS|doIPv4|doIPv6|doProxies       },
-       // =====================================  =================  ========== ======================= ======================================= =========================================
-       { &kSCNetworkInterfaceTypeIPv4          , NULL              , FALSE,    do6to4|doL2TP|doPPTP,   NULL,                                   doNone                                          }
+       // interface type                         if config?    interface types         PPP sub-type                            interface protocols
+       // =====================================  ==========    ======================= ======================================= =========================================
+       { &kSCNetworkInterfaceType6to4          , FALSE,        doNone,                 NULL,                                   doIPv6                                          },
+       { &kSCNetworkInterfaceTypeBluetooth     , FALSE,        doPPP,                  &kSCValNetInterfaceSubTypePPPSerial,    doNone                                          },
+       { &kSCNetworkInterfaceTypeBond          , TRUE,         doNone,                 NULL,                                   doAppleTalk|doDNS|doIPv4|doIPv6|doProxies       },
+       { &kSCNetworkInterfaceTypeEthernet      , TRUE,         doPPP,                  &kSCValNetInterfaceSubTypePPPoE,        doAppleTalk|doDNS|doIPv4|doIPv6|doProxies       },
+       { &kSCNetworkInterfaceTypeFireWire      , TRUE,         doNone,                 NULL,                                   doDNS|doIPv4|doIPv6|doProxies                   },
+       { &kSCNetworkInterfaceTypeIEEE80211     , TRUE,         doPPP,                  &kSCValNetInterfaceSubTypePPPoE,        doAppleTalk|doDNS|doIPv4|doIPv6|doProxies       },
+       { &kSCNetworkInterfaceTypeIrDA          , FALSE,        doPPP,                  &kSCValNetInterfaceSubTypePPPSerial,    doNone                                          },
+       { &kSCNetworkInterfaceTypeL2TP          , FALSE,        doPPP,                  &kSCValNetInterfaceSubTypeL2TP,         doNone                                          },
+       { &kSCNetworkInterfaceTypeModem         , FALSE,        doPPP,                  &kSCValNetInterfaceSubTypePPPSerial,    doNone                                          },
+       { &kSCNetworkInterfaceTypePPP           , FALSE,        doNone,                 NULL,                                   doDNS|doIPv4|doIPv6|doProxies                   },
+       { &kSCNetworkInterfaceTypePPTP          , FALSE,        doPPP,                  &kSCValNetInterfaceSubTypePPTP,         doNone                                          },
+       { &kSCNetworkInterfaceTypeSerial        , FALSE,        doPPP,                  &kSCValNetInterfaceSubTypePPPSerial,    doNone                                          },
+       { &kSCNetworkInterfaceTypeVLAN          , TRUE,         doNone,                 NULL,                                   doAppleTalk|doDNS|doIPv4|doIPv6|doProxies       },
+       // =====================================  ==========    ======================= ======================================= =========================================
+       { &kSCNetworkInterfaceTypeIPv4          , FALSE,        do6to4|doPPTP|doL2TP,   NULL,                                   doNone                                          }
 };
 
 
@@ -216,10 +210,12 @@ __SCNetworkInterfaceCopyDescription(CFTypeRef cf)
        SCNetworkInterfacePrivateRef    interfacePrivate        = (SCNetworkInterfacePrivateRef)cf;
 
        result = CFStringCreateMutable(allocator, 0);
-       CFStringAppendFormat(result, NULL, CFSTR("<SCNetworkInterface %p [%p]> {"), cf, allocator);
+       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);
-       CFStringAppendFormat(result, NULL, CFSTR(", entity_type = %@"), interfacePrivate->entity_type);
+       CFStringAppendFormat(result, NULL, CFSTR(", entity = %@ / %@ / %@"),
+                            interfacePrivate->entity_device,
+                            interfacePrivate->entity_hardware,
+                            interfacePrivate->entity_type);
        if (interfacePrivate->entity_subtype != NULL) {
                CFStringAppendFormat(result, NULL, CFSTR(" / %@"), interfacePrivate->entity_subtype);
        }
@@ -243,23 +239,21 @@ __SCNetworkInterfaceCopyDescription(CFTypeRef cf)
        if (interfacePrivate->location != NULL) {
                CFStringAppendFormat(result, NULL, CFSTR(", location = %@"), interfacePrivate->location);
        }
-       if (interfacePrivate->path != NULL) {
-               CFStringAppendFormat(result, NULL, CFSTR(", path = %@"), interfacePrivate->path);
-       }
-       if (interfacePrivate->modemCCL != NULL) {
-               CFStringAppendFormat(result, NULL, CFSTR(", modemCCL = %@"), interfacePrivate->modemCCL);
-       }
+       CFStringAppendFormat(result, NULL, CFSTR(", path = %@"), interfacePrivate->path);
        CFStringAppendFormat(result, NULL, CFSTR(", order = %d"), interfacePrivate->sort_order);
+
        if (interfacePrivate->service != NULL) {
                CFStringAppendFormat(result, NULL, CFSTR(", service=%@"), interfacePrivate->service);
        }
+
        if (interfacePrivate->interface != NULL) {
                CFStringAppendFormat(result, NULL, CFSTR(", interface=%@"), interfacePrivate->interface);
        }
+
        if (interfacePrivate->unsaved != NULL) {
                CFStringAppendFormat(result, NULL, CFSTR(", unsaved=%@"), interfacePrivate->unsaved);
        }
-       CFStringAppendFormat(result, NULL, CFSTR("}"));
+       CFStringAppendFormat(result, NULL, CFSTR(" }"));
 
        return result;
 }
@@ -305,9 +299,6 @@ __SCNetworkInterfaceDeallocate(CFTypeRef cf)
        if (interfacePrivate->path != NULL)
                CFRelease(interfacePrivate->path);
 
-       if (interfacePrivate->modemCCL != NULL)
-               CFRelease(interfacePrivate->modemCCL);
-
        return;
 }
 
@@ -399,6 +390,7 @@ __SCNetworkInterfaceCreatePrivate(CFAllocatorRef    allocator,
        interfacePrivate->service                       = service;
        interfacePrivate->unsaved                       = NULL;
        interfacePrivate->entity_device                 = NULL;
+       interfacePrivate->entity_hardware               = NULL;
        interfacePrivate->entity_type                   = NULL;
        interfacePrivate->entity_subtype                = NULL;
        interfacePrivate->supported_interface_types     = NULL;
@@ -408,8 +400,7 @@ __SCNetworkInterfaceCreatePrivate(CFAllocatorRef    allocator,
        interfacePrivate->path                          = (path != NULL) ? CFStringCreateWithCString(NULL, path, kCFStringEncodingUTF8)
                                                                         : NULL;
        interfacePrivate->location                      = NULL;
-       interfacePrivate->modemCCL                      = NULL;
-       interfacePrivate->modemIsV92                    = FALSE;
+       interfacePrivate->supportsDeviceOnHold          = FALSE;
        interfacePrivate->supportsBond                  = FALSE;
        interfacePrivate->supportsVLAN                  = FALSE;
        interfacePrivate->sort_order                    = kSortUnknown;
@@ -720,80 +711,77 @@ static CFStringRef
 pci_slot(io_registry_entry_t interface, CFTypeRef *pci_slot_name)
 {
        kern_return_t           kr;
-       io_registry_entry_t     parent;
-       CFMutableStringRef      slot;
-       CFTypeRef               slot_name;
+       io_registry_entry_t     slot    = interface;
 
-       slot = NULL;
        if (pci_slot_name != NULL) *pci_slot_name = NULL;
 
-       slot_name = IORegistryEntryCreateCFProperty(interface, CFSTR("AAPL,slot-name"), NULL, 0);
-       if (slot_name != NULL) {
-               CFIndex i;
-
-               slot = CFStringCreateMutable(NULL, 0);
-               if (isA_CFString(slot_name)) {
-                       if (pci_slot_name != NULL) *pci_slot_name = CFStringCreateCopy(NULL, slot_name);
-                       CFStringAppend(slot, slot_name);
-               } else if (isA_CFData(slot_name)) {
-                       if (pci_slot_name != NULL) *pci_slot_name = CFDataCreateCopy(NULL, slot_name);
-                       CFStringAppendCString(slot,
-                                             (const char *)CFDataGetBytePtr(slot_name),
-                                             kCFStringEncodingUTF8);
-               }
+       while (slot != MACH_PORT_NULL) {
+               io_registry_entry_t     parent;
+               CFTypeRef               slot_name;
+
+               slot_name = IORegistryEntryCreateCFProperty(slot, CFSTR("AAPL,slot-name"), NULL, 0);
+               if (slot_name != NULL) {
+                       Boolean         found;
+
+                       found = IOStringValueHasPrefix(slot_name, CFSTR("slot"));
+                       if (found) {
+                               CFIndex                 i;
+                               CFMutableStringRef      name;
+
+                               // if we found a slot #
+                               name = CFStringCreateMutable(NULL, 0);
+                               if (isA_CFString(slot_name)) {
+                                       if (pci_slot_name != NULL) *pci_slot_name = CFStringCreateCopy(NULL, slot_name);
+                                       CFStringAppend(name, slot_name);
+                               } else if (isA_CFData(slot_name)) {
+                                       if (pci_slot_name != NULL) *pci_slot_name = CFDataCreateCopy(NULL, slot_name);
+                                       CFStringAppendCString(name,
+                                                             (const char *)CFDataGetBytePtr(slot_name),
+                                                             kCFStringEncodingUTF8);
+                               }
 
-               if (CFStringGetLength(slot) > 5) {
-                       (void) CFStringFindAndReplace(slot,
-                                                     CFSTR("slot-"),
-                                                     CFSTR(""),
-                                                     CFRangeMake(0, 5),
-                                                     kCFCompareCaseInsensitive|kCFCompareAnchored);
-               }
+                               (void) CFStringFindAndReplace(name,
+                                                             CFSTR("slot-"),
+                                                             CFSTR(""),
+                                                             CFRangeMake(0, 5),
+                                                             kCFCompareCaseInsensitive|kCFCompareAnchored);
+                               for (i = 0; i < sizeof(slot_mappings)/sizeof(slot_mappings[0]); i++) {
+                                       if (CFStringCompareWithOptions(name,
+                                                                      slot_mappings[i].name,
+                                                                      CFRangeMake(0, CFStringGetLength(slot_mappings[i].name)),
+                                                                      kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
+                                               CFRelease(name);
+                                               name = (CFMutableStringRef)CFRetain(slot_mappings[i].slot);
+                                               break;
+                                       }
+                               }
 
-               for (i = 0; i < sizeof(slot_mappings)/sizeof(slot_mappings[0]); i++) {
-                       if (CFStringCompare(slot,
-                                           slot_mappings[i].name,
-                                           kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
-                               CFRelease(slot);
-                               slot = (CFMutableStringRef)CFRetain(slot_mappings[i].slot);
-                               break;
+                               CFRelease(slot_name);
+                               if (slot != interface) IOObjectRelease(slot);
+                               return name;
                        }
-               }
-
-               CFRelease(slot_name);
-       }
-
-       kr = IORegistryEntryGetParentEntry(interface, kIOServicePlane, &parent);
-       switch (kr) {
-               case kIOReturnSuccess : {
-                       CFTypeRef       parent_pci_slot_name    = NULL;
-                       CFStringRef     parent_slot;
-
-                       parent_slot = pci_slot(parent, &parent_pci_slot_name);
-                       if (parent_slot != NULL) {
-                               if (slot != NULL) CFRelease(slot);
-                               slot = (CFMutableStringRef)parent_slot;
 
-                               if (pci_slot_name != NULL) {
-                                       if (*pci_slot_name != NULL) CFRelease(*pci_slot_name);
-                                       *pci_slot_name = parent_pci_slot_name;
-                               } else {
-                                       CFRelease(parent_pci_slot_name);
-                               }
-                       }
+                       CFRelease(slot_name);
+               }
 
-                       IOObjectRelease(parent);
-                       break;
+               kr = IORegistryEntryGetParentEntry(slot, kIOServicePlane, &parent);
+               if (slot != interface) IOObjectRelease(slot);
+               switch (kr) {
+                       case kIOReturnSuccess :
+                               slot = parent;
+                               break;
+                       case kIOReturnNoDevice :
+                               // if we have hit the root node without finding a slot #
+                               goto done;
+                       default :
+                               SCLog(TRUE, LOG_INFO, CFSTR("pci_slot IORegistryEntryGetParentEntry() failed, kr = 0x%x"), kr);
+                               goto done;
                }
-               case kIOReturnNoDevice :
-                       // if we have hit the root node
-                       break;
-               default :
-                       SCLog(TRUE, LOG_DEBUG, CFSTR("pci_slot IORegistryEntryGetParentEntry() failed, kr = 0x%x"), kr);
-                       break;
        }
 
-       return slot;
+    done :
+
+       return NULL;
 }
 
 
@@ -849,7 +837,7 @@ pci_port(mach_port_t masterPort, CFTypeRef slot_name, CFStringRef bsdName)
 
        kr = IOServiceGetMatchingServices(masterPort, matching, &slot_iterator);
        if (kr != kIOReturnSuccess) {
-               SCLog(TRUE, LOG_DEBUG, CFSTR("pci_port IOServiceGetMatchingServices() failed, kr = 0x%x"), kr);
+               SCPrint(TRUE, stderr, CFSTR("IOServiceGetMatchingServices() failed, kr = 0x%x\n"), kr);
                return MACH_PORT_NULL;
        }
 
@@ -864,7 +852,7 @@ pci_port(mach_port_t masterPort, CFTypeRef slot_name, CFStringRef bsdName)
                                                   kIORegistryIterateRecursively,
                                                   &child_iterator);
                if (kr != kIOReturnSuccess) {
-                       SCLog(TRUE, LOG_DEBUG, CFSTR("pci_port IORegistryEntryCreateIterator() failed, kr = 0x%x"), kr);
+                       SCPrint(TRUE, stderr, CFSTR("IORegistryEntryCreateIterator() failed, kr = 0x%x\n"), kr);
                        return MACH_PORT_NULL;
                }
 
@@ -934,16 +922,43 @@ pci_slot_info(mach_port_t masterPort, io_registry_entry_t interface, CFStringRef
 static Boolean
 isBuiltIn(io_registry_entry_t interface)
 {
-       CFStringRef     slot;
+       kern_return_t           kr;
+       io_registry_entry_t     slot    = interface;
 
-       slot = pci_slot(interface, NULL);
-       if (slot != NULL) {
-               // interfaces which have a "slot" are not built-in
-               CFRelease(slot);
-               return FALSE;
+       while (slot != MACH_PORT_NULL) {
+               io_registry_entry_t     parent;
+               CFTypeRef               slot_name;
+
+               slot_name = IORegistryEntryCreateCFProperty(slot, CFSTR("AAPL,slot-name"), NULL, 0);
+               if (slot_name != NULL) {
+                       Boolean         found;
+
+                       found = IOStringValueHasPrefix(slot_name, CFSTR("slot"));
+                       CFRelease(slot_name);
+
+                       if (found) {
+                               // if we found a slot # then this is not a built-in interface
+                               if (slot != interface) IOObjectRelease(slot);
+                               return FALSE;
+                       }
+               }
+
+               kr = IORegistryEntryGetParentEntry(slot, kIOServicePlane, &parent);
+               if (slot != interface) IOObjectRelease(slot);
+               switch (kr) {
+                       case kIOReturnSuccess :
+                               slot = parent;
+                               break;
+                       case kIOReturnNoDevice :
+                               // if we have hit the root node without finding a slot #
+                               return TRUE;
+                       default :
+                               SCLog(TRUE, LOG_INFO, CFSTR("isBuiltIn IORegistryEntryGetParentEntry() failed, kr = 0x%x"), kr);
+                               return FALSE;
+               }
        }
 
-       return TRUE;
+       return FALSE;
 }
 
 
@@ -971,12 +986,16 @@ processNetworkInterface(mach_port_t                       masterPort,
                        CFDictionaryRef                 bus_dict)
 {
        CFBooleanRef    bVal;
+       io_name_t       c_IOClass;
+       io_name_t       c_IOName;
+       io_name_t       i_IOClass;
        int             ift     = -1;
        int             iVal;
        CFNumberRef     num;
        CFStringRef     str;
 
-       // interface type
+       // get the interface type
+
        num = CFDictionaryGetValue(interface_dict, CFSTR(kIOInterfaceType));
        if (!isA_CFNumber(num) ||
            !CFNumberGetValue(num, kCFNumberIntType, &ift)) {
@@ -988,21 +1007,35 @@ processNetworkInterface(mach_port_t                      masterPort,
                case IFT_ETHER :
                        // Type, Hardware
 
-                       if ((IOObjectConformsTo(controller, "IO80211Controller")) ||
-                           (IOObjectConformsTo(controller, "AirPortPCI"       )) ||
-                           (IOObjectConformsTo(controller, "AirPortDriver"    ))) {
+                       if (IOObjectGetClass(interface, i_IOClass) != KERN_SUCCESS) {
+                               i_IOClass[0] = '\0';
+                       }
+                       if (IOObjectGetClass(controller, c_IOClass) != KERN_SUCCESS) {
+                               c_IOClass[0] = '\0';
+                       }
+                       if (IORegistryEntryGetName(controller, c_IOName) != KERN_SUCCESS) {
+                               c_IOName[0] = '\0';
+                       }
+
+                       if ((strcmp(i_IOClass, "IO80211Interface"  ) == 0) ||
+                           (strcmp(c_IOClass, "AirPortPCI"        ) == 0) ||
+                           (strcmp(c_IOClass, "AirPortDriver"     ) == 0) ||
+                           (strcmp(c_IOName , "AppleWireless80211") == 0)) {
                                interfacePrivate->interface_type        = kSCNetworkInterfaceTypeIEEE80211;
                                interfacePrivate->entity_type           = kSCEntNetEthernet;
+                               interfacePrivate->entity_hardware       = kSCEntNetAirPort;
                                interfacePrivate->sort_order            = kSortAirPort;
                        } else {
                                str = IODictionaryCopyCFStringValue(bus_dict, CFSTR("name"));
                                if ((str != NULL) && CFEqual(str, CFSTR("radio"))) {
                                        interfacePrivate->interface_type        = kSCNetworkInterfaceTypeEthernet;      // ??
                                        interfacePrivate->entity_type           = kSCEntNetEthernet;
+                                       interfacePrivate->entity_hardware       = kSCEntNetEthernet;                    // ??
                                        interfacePrivate->sort_order            = kSortOtherWireless;
                                } else {
                                        interfacePrivate->interface_type        = kSCNetworkInterfaceTypeEthernet;
                                        interfacePrivate->entity_type           = kSCEntNetEthernet;
+                                       interfacePrivate->entity_hardware       = kSCEntNetEthernet;
                                        interfacePrivate->sort_order            = kSortEthernet;
 
                                        // BOND support only enabled for ethernet devices
@@ -1091,6 +1124,7 @@ processNetworkInterface(mach_port_t                       masterPort,
 
                        // Entity
                        interfacePrivate->entity_type     = kSCEntNetFireWire;
+                       interfacePrivate->entity_hardware = kSCEntNetFireWire;
 
                        // built-in
                        interfacePrivate->builtin = isBuiltIn(interface);
@@ -1113,7 +1147,7 @@ processNetworkInterface(mach_port_t                       masterPort,
 
                        break;
                default :
-                       SCLog(TRUE, LOG_DEBUG, CFSTR("processNetworkInterface() failed, unknown interface type = %d"), ift);
+                       SCPrint(TRUE, stderr, CFSTR("Unknown interface type = %d\n"), ift);
                        return FALSE;
        }
 
@@ -1185,18 +1219,18 @@ processSerialInterface(mach_port_t                      masterPort,
                // Modem
                interfacePrivate->interface_type        = kSCNetworkInterfaceTypeModem;
 
-               // V.92 support
+               // DeviceOnHold support
                val = IORegistryEntrySearchCFProperty(interface,
                                                      kIOServicePlane,
                                                      CFSTR(kIODeviceSupportsHoldKey),
                                                      NULL,
                                                      kIORegistryIterateRecursively | kIORegistryIterateParents);
                if (val != NULL) {
-                       uint32_t        v92;
+                       uint32_t        supportsHold;
 
                        if (isA_CFNumber(val) &&
-                           CFNumberGetValue(val, kCFNumberSInt32Type, &v92)) {
-                               interfacePrivate->modemIsV92 = (v92 == 1);
+                           CFNumberGetValue(val, kCFNumberSInt32Type, &supportsHold)) {
+                               interfacePrivate->supportsDeviceOnHold = (supportsHold == 1);
                        }
                        CFRelease(val);
                }
@@ -1214,6 +1248,7 @@ processSerialInterface(mach_port_t                        masterPort,
        if (CFEqual(ift, CFSTR(kIOSerialBSDModemType))) {
                // if modem
                isModem = TRUE;
+               interfacePrivate->entity_hardware = kSCEntNetModem;
 
                if (CFEqual(str, CFSTR("modem"))) {
                        interfacePrivate->builtin = TRUE;
@@ -1225,6 +1260,7 @@ processSerialInterface(mach_port_t                        masterPort,
                }
        } else if (CFEqual(ift, CFSTR(kIOSerialBSDRS232Type))) {
                // if serial port
+               interfacePrivate->entity_hardware = kSCEntNetModem;
                interfacePrivate->sort_order = kSortSerialPort;
        } else {
                return FALSE;
@@ -1233,24 +1269,13 @@ processSerialInterface(mach_port_t                      masterPort,
        // Entity (Device)
        interfacePrivate->entity_device = IODictionaryCopyCFStringValue(interface_dict, CFSTR(kIOTTYDeviceKey));
 
-       // modem CCL
-       val = IORegistryEntrySearchCFProperty(interface,
-                                             kIOServicePlane,
-                                             CFSTR("ModemCCL"),
-                                             NULL,
-                                             kIORegistryIterateRecursively | kIORegistryIterateParents);
-       if (val != NULL) {
-               interfacePrivate->modemCCL = IOCopyCFStringValue(val);
-               CFRelease(val);
-       }
-
        // localized name
        if (CFEqual(interfacePrivate->interface_type, kSCNetworkInterfaceTypeIrDA)) {
                interfacePrivate->localized_key = CFSTR("irda");
        } else if (CFEqual(interfacePrivate->interface_type, kSCNetworkInterfaceTypeBluetooth)) {
                interfacePrivate->localized_key = CFSTR("bluetooth");
        } else {
-               CFStringRef             localized       = NULL;
+               CFStringRef             localized;
                CFMutableStringRef      port;
 
                port = CFStringCreateMutableCopy(NULL, 0, str);
@@ -1260,12 +1285,10 @@ processSerialInterface(mach_port_t                      masterPort,
                        CFStringAppend(port, CFSTR("-port"));
                }
 
-               if (bundle != NULL) {
-                       localized = CFBundleCopyLocalizedString(bundle,
-                                                               port,
-                                                               port,
-                                                               NETWORKINTERFACE_LOCALIZATIONS);
-               }
+               localized = CFBundleCopyLocalizedString(bundle,
+                                                       port,
+                                                       port,
+                                                       NETWORKINTERFACE_LOCALIZATIONS);
                if (localized != NULL) {
                        if (!CFEqual(port, localized)) {
                                // if localization available
@@ -1297,14 +1320,7 @@ processSerialInterface(mach_port_t                       masterPort,
                                                // if we have a [somewhat reasonable?] product name
                                                CFRelease(interfacePrivate->localized_name);
                                                interfacePrivate->localized_name = CFRetain(productName);
-
-                                               // if not provided, also check if the product name
-                                               // matches a CCL script
-                                               if (interfacePrivate->modemCCL == NULL) {
-                                                       interfacePrivate->modemCCL = CFRetain(productName);
-                                               }
                                        }
-
                                        CFRelease(productName);
                                }
                        }
@@ -1313,55 +1329,6 @@ processSerialInterface(mach_port_t                       masterPort,
                CFRelease(port);
        }
 
-       // validate the CCL script
-       if (interfacePrivate->modemCCL != NULL) {
-               char                            ccl[MAXPATHLEN];
-               char                            path[MAXPATHLEN];
-               NSSearchPathEnumerationState    state;
-               Boolean                         valid   = FALSE;
-
-               (void) _SC_cfstring_to_cstring(interfacePrivate->modemCCL,
-                                              ccl,
-                                              sizeof(ccl),
-                                              kCFStringEncodingUTF8);
-
-               state = NSStartSearchPathEnumeration(NSLibraryDirectory,
-                                                    NSLocalDomainMask|NSSystemDomainMask);
-               while ((state = NSGetNextSearchPathEnumeration(state, path))) {
-                       struct stat     statBuf;
-
-                       if (ccl[0] == '/') {
-                               path[0] = '\0';         // if modemCCL is a full path
-                       } else {
-                               strlcat(path, "/Modem Scripts/", sizeof(path));
-                               strlcat(path, ccl, sizeof(path));
-                       }
-
-                       if (stat(path, &statBuf) == 0) {
-                               if (S_ISREG(statBuf.st_mode)) {
-                                       // if we have a valid CCL script
-                                       valid = TRUE;
-                                       break;
-                               }
-                       } else {
-                               if (errno == ENOENT) {
-                                       continue;
-                               }
-
-                               SCLog(TRUE, LOG_DEBUG,
-                                     CFSTR("processSerialInterface stat() failed: %s"),
-                                     strerror(errno));
-                               break;
-                       }
-               }
-
-               if (!valid) {
-                       // if the CCL script is not valid
-                       CFRelease(interfacePrivate->modemCCL);
-                       interfacePrivate->modemCCL = NULL;
-               }
-       }
-
        return TRUE;
 }
 
@@ -1376,7 +1343,7 @@ findMatchingInterfaces(mach_port_t masterPort, CFDictionaryRef matching, process
 
        kr = IOServiceGetMatchingServices(masterPort, matching, &iterator);
        if (kr != kIOReturnSuccess) {
-               SCLog(TRUE, LOG_DEBUG, CFSTR("findMatchingInterfaces IOServiceGetMatchingServices() failed, kr = 0x%x"), kr);
+               SCPrint(TRUE, stderr, CFSTR("IOServiceGetMatchingServices() failed, kr = 0x%x\n"), kr);
                return NULL;
        }
 
@@ -1484,6 +1451,7 @@ SCNetworkInterfaceCreateWithBond(BondInterfaceRef bond)
 
        interfacePrivate->interface_type        = kSCNetworkInterfaceTypeBond;
        interfacePrivate->entity_type           = kSCEntNetEthernet;
+       interfacePrivate->entity_hardware       = kSCEntNetEthernet;
        interfacePrivate->entity_device         = CFStringCreateCopy(NULL, bond_if);
        interfacePrivate->builtin               = TRUE;
        interfacePrivate->sort_order            = kSortBond;
@@ -1571,6 +1539,7 @@ SCNetworkInterfaceCreateWithVLAN(VLANInterfaceRef vlan)
 
        interfacePrivate->interface_type        = kSCNetworkInterfaceTypeVLAN;
        interfacePrivate->entity_type           = kSCEntNetEthernet;
+       interfacePrivate->entity_hardware       = kSCEntNetEthernet;
        interfacePrivate->entity_device         = CFStringCreateCopy(NULL, vlan_if);
        interfacePrivate->builtin               = TRUE;
        interfacePrivate->sort_order            = kSortVLAN;
@@ -1638,185 +1607,7 @@ findVLANInterfaces(CFStringRef match)
 }
 
 
-/* ---------- helper functions ---------- */
-
-
-static CFIndex
-findConfiguration(CFStringRef interface_type)
-{
-       CFIndex i;
-
-       for (i = 0; i < sizeof(configurations)/sizeof(configurations[0]); i++) {
-               if (CFEqual(interface_type, *configurations[i].interface_type)) {
-                       return i;
-               }
-       }
-
-       return kCFNotFound;
-}
-
-
-static CFArrayRef
-copyConfigurationPaths(SCNetworkInterfacePrivateRef interfacePrivate)
-{
-       CFMutableArrayRef               array           = NULL;
-       CFIndex                         interfaceIndex;
-       CFStringRef                     path;
-       SCNetworkServicePrivateRef      servicePrivate;
-
-       servicePrivate = (SCNetworkServicePrivateRef)interfacePrivate->service;
-       if (servicePrivate == NULL) {
-               // if not associated with a service (yet)
-               return NULL;
-       }
-
-       array = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
-
-       interfaceIndex = findConfiguration(interfacePrivate->interface_type);
-       if (interfaceIndex == kCFNotFound) {
-               // unknown interface type, use per-service configuration preferences
-               path = SCPreferencesPathKeyCreateNetworkServiceEntity(NULL,                                     // allocator
-                                                                     servicePrivate->serviceID,                // service
-                                                                     interfacePrivate->interface_type);        // entity
-               CFArrayAppendValue(array, path);
-               CFRelease(path);
-               goto done;
-       }
-
-       if (configurations[interfaceIndex].entity_hardware == NULL) {
-               // if no configuration information can be associated with this interface type
-               CFRelease(array);
-               array = NULL;
-               goto done;
-       }
-
-       if (configurations[interfaceIndex].per_interface_config) {
-               CFIndex         i;
-               CFIndex         n;
-               CFArrayRef      sets;
-
-               // known interface type, per-interface configuration preferences
-               //
-               // 1. look for all sets which contain the associated service
-               // 2. add a per-set path for the interface configuration for
-               //    each set.
-
-               sets = SCNetworkSetCopyAll(servicePrivate->prefs);
-               n = (sets != NULL) ? CFArrayGetCount(sets) : 0;
-
-               for (i = 0; i < n; i++) {
-                       CFArrayRef      services;
-                       SCNetworkSetRef set;
-
-                       set = CFArrayGetValueAtIndex(sets, i);
-                       services = SCNetworkSetCopyServices(set);
-                       if (CFArrayContainsValue(services,
-                                                CFRangeMake(0, CFArrayGetCount(services)),
-                                                interfacePrivate->service)) {
-                               path = SCPreferencesPathKeyCreateSetNetworkInterfaceEntity(NULL,                                                // allocator
-                                                                                          SCNetworkSetGetSetID(set),                           // set
-                                                                                          interfacePrivate->entity_device,                     // service
-                                                                                          *configurations[interfaceIndex].entity_hardware);    // entity
-                               CFArrayAppendValue(array, path);
-                               CFRelease(path);
-                       }
-                       CFRelease(services);
-               }
-
-               if (CFArrayGetCount(array) == 0) {
-                       CFRelease(array);
-                       array = NULL;
-               }
-
-               if (sets != NULL) CFRelease(sets);
-       } else {
-               // known interface type, per-service configuration preferences
-               path = SCPreferencesPathKeyCreateNetworkServiceEntity(NULL,                                             // allocator
-                                                                     servicePrivate->serviceID,                        // service
-                                                                     *configurations[interfaceIndex].entity_hardware); // entity
-               CFArrayAppendValue(array, path);
-               CFRelease(path);
-       }
-
-    done :
-
-       return array;
-}
-
-
-/* ---------- preferences entity for interface ---------- */
-
-
-__private_extern__ CFDictionaryRef
-__SCNetworkInterfaceCopyInterfaceEntity(SCNetworkInterfaceRef interface)
-{
-       CFMutableDictionaryRef          entity;
-       CFIndex                         interfaceIndex;
-       SCNetworkInterfacePrivateRef    interfacePrivate        = (SCNetworkInterfacePrivateRef)interface;
-
-       entity = CFDictionaryCreateMutable(NULL,
-                                          0,
-                                          &kCFTypeDictionaryKeyCallBacks,
-                                          &kCFTypeDictionaryValueCallBacks);
-       if (interfacePrivate->entity_type != NULL) {
-               CFDictionarySetValue(entity,
-                                    kSCPropNetInterfaceType,
-                                    interfacePrivate->entity_type);
-       }
-       if (interfacePrivate->entity_subtype != NULL) {
-               CFDictionarySetValue(entity,
-                                    kSCPropNetInterfaceSubType,
-                                    interfacePrivate->entity_subtype);
-       }
-       if (interfacePrivate->entity_device != NULL) {
-               CFDictionarySetValue(entity,
-                                    kSCPropNetInterfaceDeviceName,
-                                    interfacePrivate->entity_device);
-       }
-
-       // match the "hardware" with the lowest layer
-       while (TRUE) {
-               SCNetworkInterfaceRef   nextInterface;
-
-               nextInterface = SCNetworkInterfaceGetInterface(interface);
-               if (nextInterface == NULL) {
-                       break;
-               }
-
-               interface = nextInterface;
-       }
-       interfacePrivate = (SCNetworkInterfacePrivateRef)interface;
-
-       interfaceIndex = findConfiguration(interfacePrivate->interface_type);
-       if (interfaceIndex != kCFNotFound) {
-               if (configurations[interfaceIndex].entity_hardware != NULL) {
-                       CFDictionarySetValue(entity,
-                                            kSCPropNetInterfaceHardware,
-                                            *configurations[interfaceIndex].entity_hardware);
-               }
-       } else {
-               CFDictionarySetValue(entity,
-                                    kSCPropNetInterfaceHardware,
-                                    interfacePrivate->interface_type);
-       }
-
-       if (CFEqual(interfacePrivate->interface_type, kSCNetworkInterfaceTypeModem) &&
-           interfacePrivate->modemIsV92) {
-               int             one     = 1;
-               CFNumberRef     num;
-
-               num = CFNumberCreate(NULL, kCFNumberIntType, &one);
-               CFDictionarySetValue(entity,
-                                    kSCPropNetInterfaceSupportsModemOnHold,
-                                    num);
-               CFRelease(num);
-       }
-
-       return entity;
-}
-
-
-/* ---------- interface from preferences entity ---------- */
+/* ---------- interface from preferences ---------- */
 
 
 __private_extern__ SCNetworkInterfaceRef
@@ -1831,9 +1622,6 @@ __SCNetworkInterfaceCreateWithEntity(CFAllocatorRef               allocator,
        static mach_port_t              masterPort              = MACH_PORT_NULL;
        CFArrayRef                      matching_interfaces     = NULL;
 
-       /* initialize runtime (and kSCNetworkInterfaceIPv4) */
-       pthread_once(&initialized, __SCNetworkInterfaceInitialize);
-
        if (masterPort == MACH_PORT_NULL) {
                kern_return_t   kr;
 
@@ -1923,9 +1711,6 @@ __SCNetworkInterfaceCreateWithEntity(CFAllocatorRef               allocator,
 
                interfacePrivate = (SCNetworkInterfacePrivateRef)SCNetworkInterfaceCreateWithInterface(kSCNetworkInterfaceIPv4,
                                                                                                       kSCNetworkInterfaceType6to4);
-       } else if (CFStringFind(ifType, CFSTR("."), 0).location != kCFNotFound) {
-               interfacePrivate = (SCNetworkInterfacePrivateRef)SCNetworkInterfaceCreateWithInterface(kSCNetworkInterfaceIPv4,
-                                                                                                      ifType);
        }
 
        if (matching_interfaces != NULL) {
@@ -1964,7 +1749,7 @@ __SCNetworkInterfaceCreateWithEntity(CFAllocatorRef               allocator,
                                CFRetain(interfacePrivate);
                                break;
                        default :
-                               SCLog(TRUE, LOG_DEBUG, CFSTR("__SCNetworkInterfaceCreateWithEntity() failed, more than one interface matches %@"), ifDevice);
+                               SCPrint(TRUE, stderr, CFSTR("more than one interface matches %@\n"), ifDevice);
                                if (matching_interfaces != NULL) CFRelease(matching_interfaces);
                                _SCErrorSet(kSCStatusFailed);
                                return NULL;
@@ -1975,8 +1760,6 @@ __SCNetworkInterfaceCreateWithEntity(CFAllocatorRef               allocator,
     done :
 
        if (interfacePrivate == NULL) {
-               CFStringRef     entity_hardware;
-
                /*
                 * if device not present on this system
                 */
@@ -1984,11 +1767,11 @@ __SCNetworkInterfaceCreateWithEntity(CFAllocatorRef             allocator,
                interfacePrivate->entity_type     = ifType;
                interfacePrivate->entity_subtype  = ifSubType;
                interfacePrivate->entity_device   = (ifDevice != NULL) ? CFStringCreateCopy(NULL, ifDevice) : NULL;
+               interfacePrivate->entity_hardware = CFDictionaryGetValue(interface_entity, kSCPropNetInterfaceHardware);
 
-               entity_hardware = CFDictionaryGetValue(interface_entity, kSCPropNetInterfaceHardware);
                if (CFEqual(ifType, kSCValNetInterfaceTypeEthernet)) {
-                       if ((entity_hardware != NULL) &&
-                           CFEqual(entity_hardware, kSCEntNetAirPort)) {
+                       if ((interfacePrivate->entity_hardware != NULL) &&
+                           CFEqual(interfacePrivate->entity_hardware, kSCEntNetAirPort)) {
                                interfacePrivate->interface_type = kSCNetworkInterfaceTypeIEEE80211;
                        } else {
                                interfacePrivate->interface_type = kSCNetworkInterfaceTypeEthernet;
@@ -2036,6 +1819,100 @@ __SCNetworkInterfaceCreateWithEntity(CFAllocatorRef             allocator,
 }
 
 
+/* ---------- helper functions ---------- */
+
+
+static CFIndex
+findConfiguration(CFStringRef interface_type)
+{
+       CFIndex i;
+
+       for (i = 0; i < sizeof(configurations)/sizeof(configurations[0]); i++) {
+               if (CFEqual(interface_type, *configurations[i].interface_type)) {
+                       return i;
+               }
+       }
+
+       return kCFNotFound;
+}
+
+
+static CFArrayRef
+copyConfigurationPaths(SCNetworkInterfacePrivateRef interfacePrivate)
+{
+       CFMutableArrayRef               array           = NULL;
+       CFIndex                         interfaceIndex;
+       CFStringRef                     path;
+       SCNetworkServicePrivateRef      servicePrivate;
+
+       interfaceIndex = findConfiguration(interfacePrivate->interface_type);
+       if (interfaceIndex == kCFNotFound) {
+               // if unknown interface type
+               return NULL;
+       }
+
+       servicePrivate = (SCNetworkServicePrivateRef)interfacePrivate->service;
+       if (servicePrivate == NULL) {
+               // if not associated with a service (yet)
+               return NULL;
+       }
+
+       array = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+
+       if (configurations[interfaceIndex].per_interface_config) {
+               CFIndex         i;
+               CFIndex         n;
+               CFArrayRef      sets;
+
+               /*
+                * per-interface configuration preferences
+                *
+                * 1. look for all sets which contain the associated service
+                * 2. add a per-set path for the interface configuration for
+                *    each set.
+                */
+
+               sets = SCNetworkSetCopyAll(servicePrivate->prefs);
+               n = (sets != NULL) ? CFArrayGetCount(sets) : 0;
+
+               for (i = 0; i < n; i++) {
+                       CFArrayRef      services;
+                       SCNetworkSetRef set;
+
+                       set = CFArrayGetValueAtIndex(sets, i);
+                       services = SCNetworkSetCopyServices(set);
+                       if (CFArrayContainsValue(services,
+                                                CFRangeMake(0, CFArrayGetCount(services)),
+                                                interfacePrivate->service)) {
+                               path = SCPreferencesPathKeyCreateSetNetworkInterfaceEntity(NULL,                                // allocator
+                                                                                          SCNetworkSetGetSetID(set),           // set
+                                                                                          interfacePrivate->entity_device,     // service
+                                                                                          interfacePrivate->entity_type);      // entity
+                               CFArrayAppendValue(array, path);
+                               CFRelease(path);
+                       }
+                       CFRelease(services);
+               }
+
+               if (CFArrayGetCount(array) == 0) {
+                       CFRelease(array);
+                       array = NULL;
+               }
+
+               CFRelease(sets);
+       } else {
+               // per-service configuration preferences
+               path = SCPreferencesPathKeyCreateNetworkServiceEntity(NULL,                                     // allocator
+                                                                     servicePrivate->serviceID,                // service
+                                                                     interfacePrivate->entity_type);           // entity
+               CFArrayAppendValue(array, path);
+               CFRelease(path);
+       }
+
+       return array;
+}
+
+
 /* ---------- SCNetworkInterface APIs ---------- */
 
 
@@ -2133,13 +2010,13 @@ SCNetworkInterfaceGetSupportedInterfaceTypes(SCNetworkInterfaceRef interface)
        CFIndex                         i;
        SCNetworkInterfacePrivateRef    interfacePrivate        = (SCNetworkInterfacePrivateRef)interface;
 
-       /* initialize runtime (and kSCNetworkInterfaceIPv4) */
-       pthread_once(&initialized, __SCNetworkInterfaceInitialize);
-
        if (interfacePrivate->supported_interface_types != NULL) {
                goto done;
        }
 
+       /* initialize runtime (and kSCNetworkInterfaceIPv4) */
+       pthread_once(&initialized, __SCNetworkInterfaceInitialize);
+
        i = findConfiguration(interfacePrivate->interface_type);
        if (i != kCFNotFound) {
                if (configurations[i].supported_interfaces != doNone) {
@@ -2171,13 +2048,13 @@ SCNetworkInterfaceGetSupportedProtocolTypes(SCNetworkInterfaceRef interface)
        CFIndex                         i;
        SCNetworkInterfacePrivateRef    interfacePrivate        = (SCNetworkInterfacePrivateRef)interface;
 
-       /* initialize runtime (and kSCNetworkInterfaceIPv4) */
-       pthread_once(&initialized, __SCNetworkInterfaceInitialize);
-
        if (interfacePrivate->supported_protocol_types != NULL) {
                goto done;
        }
 
+       /* initialize runtime (and kSCNetworkInterfaceIPv4) */
+       pthread_once(&initialized, __SCNetworkInterfaceInitialize);
+
        i = findConfiguration(interfacePrivate->interface_type);
        if (i != kCFNotFound) {
                if (configurations[i].supported_protocols != doNone) {
@@ -2270,17 +2147,13 @@ SCNetworkInterfaceCreateWithInterface(SCNetworkInterfaceRef child, CFStringRef i
                parentPrivate->interface_type = kSCNetworkInterfaceType6to4;
                parentPrivate->entity_type    = kSCEntNet6to4;
                parentPrivate->entity_device  = CFRetain(CFSTR("stf0"));
-       } else if (CFStringFind(interfaceType, CFSTR("."), 0).location != kCFNotFound) {
-               // if custom interface type
-               parentPrivate->interface_type = interfaceType;
-               parentPrivate->entity_type    = interfaceType;                  // interface config goes into a
-                                                                               // a dictionary with the same
-                                                                               // name as the interfaceType
+               CFRetain(parentPrivate->entity_device);
        } else {
                // unknown interface type
                goto fail;
        }
 
+       parentPrivate->entity_hardware = childPrivate->entity_hardware;
        parentPrivate->sort_order = childPrivate->sort_order;
 
        return (SCNetworkInterfaceRef)parentPrivate;
@@ -2348,7 +2221,6 @@ SCNetworkInterfaceGetHardwareAddressString(SCNetworkInterfaceRef interface)
        return interfacePrivate->address;
 }
 
-
 SCNetworkInterfaceRef
 SCNetworkInterfaceGetInterface(SCNetworkInterfaceRef interface)
 {
@@ -2379,11 +2251,13 @@ SCNetworkInterfaceGetLocalizedDisplayName(SCNetworkInterfaceRef interface)
                CFStringRef             child   = NULL;
                CFMutableStringRef      local   = NULL;
 
+               pthread_once(&initialized, __SCNetworkInterfaceInitialize);     /* initialize runtime */
+
                if (interfacePrivate->interface != NULL) {
                        child = SCNetworkInterfaceGetLocalizedDisplayName(interfacePrivate->interface);
                }
 
-               if ((bundle != NULL) && (interfacePrivate->localized_key != NULL)) {
+               if (interfacePrivate->localized_key != NULL) {
                        CFStringRef     fmt;
 
                        fmt = CFBundleCopyLocalizedString(bundle,
@@ -2429,26 +2303,6 @@ SCNetworkInterfaceGetLocalizedDisplayName(SCNetworkInterfaceRef interface)
 }
 
 
-__private_extern__
-CFStringRef
-__SCNetworkInterfaceGetModemCCL(SCNetworkInterfaceRef interface)
-{
-       SCNetworkInterfacePrivateRef    interfacePrivate        = (SCNetworkInterfacePrivateRef)interface;
-
-       return interfacePrivate->modemCCL;
-}
-
-
-__private_extern__
-Boolean
-__SCNetworkInterfaceIsModemV92(SCNetworkInterfaceRef interface)
-{
-       SCNetworkInterfacePrivateRef    interfacePrivate        = (SCNetworkInterfacePrivateRef)interface;
-
-       return interfacePrivate->modemIsV92;
-}
-
-
 CFTypeID
 SCNetworkInterfaceGetTypeID(void)
 {
@@ -2518,11 +2372,8 @@ __SCNetworkInterfaceCreateCopy(CFAllocatorRef            allocator,
        SCNetworkInterfacePrivateRef            oldPrivate      = (SCNetworkInterfacePrivateRef)interface;
        SCNetworkInterfacePrivateRef            newPrivate;
 
-       /* initialize runtime (and kSCNetworkInterfaceIPv4) */
-       pthread_once(&initialized, __SCNetworkInterfaceInitialize);
-
        newPrivate = __SCNetworkInterfaceCreatePrivate(NULL, NULL, NULL, NULL);
-       newPrivate->interface_type              = oldPrivate->interface_type;
+       newPrivate->interface_type              = CFRetain(oldPrivate->interface_type);
        if (oldPrivate->interface != NULL) {
                newPrivate->interface = (SCNetworkInterfaceRef)__SCNetworkInterfaceCreateCopy(NULL,                     // allocator
                                                                                              oldPrivate->interface,    // interface
@@ -2532,6 +2383,7 @@ __SCNetworkInterfaceCreateCopy(CFAllocatorRef             allocator,
        newPrivate->service                     = service;
        newPrivate->unsaved                     = (oldPrivate->unsaved != NULL) ? CFRetain(oldPrivate->unsaved) : NULL;
        newPrivate->entity_device               = (oldPrivate->entity_device != NULL) ? CFRetain(oldPrivate->entity_device) : NULL;
+       newPrivate->entity_hardware             = CFRetain(oldPrivate->entity_hardware);
        newPrivate->entity_type                 = oldPrivate->entity_type;
        newPrivate->entity_subtype              = oldPrivate->entity_subtype;
        if (oldPrivate->supported_interface_types != NULL) {
@@ -2544,8 +2396,7 @@ __SCNetworkInterfaceCreateCopy(CFAllocatorRef             allocator,
        newPrivate->builtin                     = oldPrivate->builtin;
        newPrivate->path                        = (oldPrivate->path != NULL) ? CFRetain(oldPrivate->path) : NULL;
        newPrivate->location                    = (oldPrivate->location != NULL) ? CFRetain(oldPrivate->location) : NULL;
-       newPrivate->modemCCL                    = (oldPrivate->modemCCL != NULL) ? CFRetain(oldPrivate->modemCCL) : NULL;
-       newPrivate->modemIsV92                  = oldPrivate->modemIsV92;
+       newPrivate->supportsDeviceOnHold        = oldPrivate->supportsDeviceOnHold;
        newPrivate->supportsBond                = oldPrivate->supportsBond;
        newPrivate->supportsVLAN                = oldPrivate->supportsVLAN;
        newPrivate->sort_order                  = oldPrivate->sort_order;
index 038c61be677aac40505e441b935404b97cc4b1c7..f28d6f3cd7db6999dcd4d98313ef60b6a0e3a622 100644 (file)
@@ -61,6 +61,8 @@
 #include <ppp/ppp_msg.h>
 
 
+
+
 #define kSCNetworkFlagsFirstResolvePending     (1<<31)
 
 
@@ -1696,26 +1698,14 @@ _SC_checkResolverReachability(SCDynamicStoreRef         *storeP,
                        }
                } else if (default_resolver->domain != NULL) {
                        char    *dp;
-                       int     domain_parts    = 0;
+                       int     domain_parts    = 1;
 
-                       // count domain parts
                        for (dp = default_resolver->domain; *dp != '\0'; dp++) {
                                if (*dp == '.') {
                                        domain_parts++;
                                }
                        }
 
-                       // remove trailing dots
-                       for (dp--; (dp >= default_resolver->domain) && (*dp == '.'); dp--) {
-                               *dp = '\0';
-                               domain_parts--;
-                       }
-
-                       if (dp >= default_resolver->domain) {
-                               // dots are separators, bump # of components
-                               domain_parts++;
-                       }
-
                        dp = default_resolver->domain;
                        for (i = LOCALDOMAINPARTS; !found && (i <= domain_parts); i++) {
                                int     ret;
@@ -2069,6 +2059,7 @@ SCNetworkReachabilityGetFlags(SCNetworkReachabilityRef    target,
                return TRUE;
        }
 
+
        ok = __SCNetworkReachabilityGetFlags(&store, target, flags, NULL, FALSE);
        *flags &= ~kSCNetworkFlagsFirstResolvePending;
        if (store != NULL)      CFRelease(store);
@@ -2282,6 +2273,7 @@ rlsPerform(void *info)
 
        SCLog(_sc_debug, LOG_DEBUG, CFSTR("process reachability change"));
 
+
        pthread_mutex_lock(&targetPrivate->lock);
 
        /* update reachability, notify if status changed */
index 5a88d5399494e7cd13f5fe4091c16188ea27e3f5..db30ae7724e434a435e3eaedbce4325c176a6fdf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
@@ -478,7 +478,8 @@ static Boolean
 __SCNetworkServiceSetInterfaceEntity(SCNetworkServiceRef     service,
                                     SCNetworkInterfaceRef   interface)
 {
-       CFDictionaryRef                 entity;
+       CFMutableDictionaryRef          entity;
+       SCNetworkInterfacePrivateRef    interfacePrivate        = (SCNetworkInterfacePrivateRef)interface;
        Boolean                         ok;
        CFStringRef                     path;
        SCNetworkServicePrivateRef      servicePrivate          = (SCNetworkServicePrivateRef)service;
@@ -486,7 +487,41 @@ __SCNetworkServiceSetInterfaceEntity(SCNetworkServiceRef     service,
        path = SCPreferencesPathKeyCreateNetworkServiceEntity(NULL,                             // allocator
                                                              servicePrivate->serviceID,        // service
                                                              kSCEntNetInterface);              // entity
-       entity = __SCNetworkInterfaceCopyInterfaceEntity(interface);
+       entity = CFDictionaryCreateMutable(NULL,
+                                          0,
+                                          &kCFTypeDictionaryKeyCallBacks,
+                                          &kCFTypeDictionaryValueCallBacks);
+       if (interfacePrivate->entity_type != NULL) {
+               CFDictionarySetValue(entity,
+                                    kSCPropNetInterfaceType,
+                                    interfacePrivate->entity_type);
+       }
+       if (interfacePrivate->entity_subtype != NULL) {
+               CFDictionarySetValue(entity,
+                                    kSCPropNetInterfaceSubType,
+                                    interfacePrivate->entity_subtype);
+       }
+       if (interfacePrivate->entity_device != NULL) {
+               CFDictionarySetValue(entity,
+                                    kSCPropNetInterfaceDeviceName,
+                                    interfacePrivate->entity_device);
+       }
+       if (interfacePrivate->entity_hardware != NULL) {
+               CFDictionarySetValue(entity,
+                                    kSCPropNetInterfaceHardware,
+                                    interfacePrivate->entity_hardware);
+       }
+       if (CFEqual(interfacePrivate->interface_type, kSCNetworkInterfaceTypeModem) &&
+           interfacePrivate->supportsDeviceOnHold) {
+               int             one     = 1;
+               CFNumberRef     num;
+
+               num = CFNumberCreate(NULL, kCFNumberIntType, &one);
+               CFDictionarySetValue(entity,
+                                    kSCPropNetInterfaceSupportsModemOnHold,
+                                    num);
+               CFRelease(num);
+       }
        ok = SCPreferencesPathSetValue(servicePrivate->prefs, path, entity);
        CFRelease(entity);
        CFRelease(path);
@@ -505,20 +540,6 @@ SCNetworkServiceCreate(SCPreferencesRef prefs, SCNetworkInterfaceRef interface)
        CFStringRef                     prefix;
        CFStringRef                     serviceID;
        SCNetworkServicePrivateRef      servicePrivate;
-       CFArrayRef                      supported_protocols;
-
-       // only allow network interfaces which support one or more protocols
-       // to be added to a service.  The one exception is that we allow
-       // third-party interface types to be configured.
-       supported_protocols = SCNetworkInterfaceGetSupportedProtocolTypes(interface);
-       if (supported_protocols == NULL) {
-               CFStringRef     interface_type;
-
-               interface_type = SCNetworkInterfaceGetInterfaceType(interface);
-               if (CFStringFind(interface_type, CFSTR("."), 0).location == kCFNotFound) {
-                       return NULL;
-               }
-       }
 
        // establish the service
        prefix = SCPreferencesPathKeyCreateNetworkServices(NULL);
@@ -551,35 +572,13 @@ SCNetworkServiceCreate(SCPreferencesRef prefs, SCNetworkInterfaceRef interface)
                CFStringRef             interfaceType;
 
                interfaceType = SCNetworkInterfaceGetInterfaceType(interface);
-               childInterface = SCNetworkInterfaceGetInterface(interface);
+               childInterface = SCNetworkInterfaceGetInterface(servicePrivate->interface);
                if (childInterface != NULL) {
                        childInterfaceType = SCNetworkInterfaceGetInterfaceType(childInterface);
                }
 
                config = __copyInterfaceTemplate(interfaceType, childInterfaceType);
                if (config != NULL) {
-                       if (CFEqual(interfaceType, kSCNetworkInterfaceTypeModem) ||
-                           CFEqual(interfaceType, kSCNetworkInterfaceTypeSerial)) {
-                               CFStringRef     modemCCL;
-
-                               modemCCL = __SCNetworkInterfaceGetModemCCL(interface);
-                               if (modemCCL == NULL) {
-                                       if (__SCNetworkInterfaceIsModemV92(interface)) {
-                                               modemCCL = CFSTR("Apple Internal 56K Modem (v.92)");
-                                       }
-                               }
-
-                               if (modemCCL != NULL) {
-                                       CFMutableDictionaryRef  newConfig;
-
-                                       newConfig = CFDictionaryCreateMutableCopy(NULL, 0, config);
-                                       CFDictionarySetValue(newConfig, kSCPropNetModemConnectionScript, modemCCL);
-
-                                       CFRelease(config);
-                                       config = newConfig;
-                               }
-                       }
-
                        (void) __SCNetworkInterfaceSetConfiguration(interface, config, TRUE);
                        CFRelease(config);
                }
@@ -589,7 +588,7 @@ SCNetworkServiceCreate(SCPreferencesRef prefs, SCNetworkInterfaceRef interface)
        (void) __SCNetworkServiceSetInterfaceEntity((SCNetworkServiceRef)servicePrivate,
                                                    servicePrivate->interface);
 
-       // push the [deep] interface configuration into the service.
+       // push the [deep] interface configuration into into the service.
        interface_config = __SCNetworkInterfaceCopyDeepConfiguration(servicePrivate->interface);
        __SCNetworkInterfaceSetDeepConfiguration(servicePrivate->interface, interface_config);
 
@@ -699,8 +698,7 @@ SCNetworkServiceRemove(SCNetworkServiceRef service)
                        set = CFArrayGetValueAtIndex(sets, i);
                        ok = SCNetworkSetRemoveService(set, service);
                        if (!ok && (SCError() != kSCStatusNoKey)) {
-                               CFRelease(sets);
-                               return ok;
+                               break;
                        }
                }
                CFRelease(sets);
index f7b155170cfb7d3cbd91062410f05f79fe232dcd..7b7af2ce914a09fedbfd1db319a392348e0e94c0 100644 (file)
@@ -40,6 +40,7 @@
 #include <pthread.h>
 #include <sys/errno.h>
 
+
 Boolean
 SCPreferencesLock(SCPreferencesRef prefs, Boolean wait)
 {
@@ -71,6 +72,7 @@ SCPreferencesLock(SCPreferencesRef prefs, Boolean wait)
                }
        }
 
+
        pthread_mutex_lock(&prefsPrivate->lock);
 
        if (prefsPrivate->session == NULL) {
index dce62a0b780dc97b4dc7903b226c360c9f23f597..ef817dd7fe1fb9d88ad232582b1b246c42c60427 100644 (file)
@@ -60,13 +60,18 @@ normalizePath(CFStringRef path)
        for (i = nElements; i > 0; i--) {
                CFStringRef     pathElement;
 
-               pathElement = CFArrayGetValueAtIndex(elements, i - 1);
+               pathElement = CFArrayGetValueAtIndex(elements, i-1);
                if (CFStringGetLength(pathElement) == 0) {
-                       CFArrayRemoveValueAtIndex(elements, i - 1);
+                       CFArrayRemoveValueAtIndex(elements, i-1);
                        nElements--;
                }
        }
 
+       if (nElements < 1) {
+               CFRelease(elements);
+               return NULL;
+       }
+
        return elements;
 }
 
@@ -81,6 +86,7 @@ getPath(SCPreferencesRef prefs, CFStringRef path, CFDictionaryRef *entity)
        CFIndex                 nElements;
        CFIndex                 nLinks          = 0;
        Boolean                 ok              = FALSE;
+       SCPreferencesPrivateRef prefsPrivate    = (SCPreferencesPrivateRef)prefs;
        CFDictionaryRef         value           = NULL;
 
        elements = normalizePath(path);
@@ -89,21 +95,16 @@ getPath(SCPreferencesRef prefs, CFStringRef path, CFDictionaryRef *entity)
                return FALSE;
        }
 
+       __SCPreferencesAccess(prefs);
+
     restart :
 
        nElements = CFArrayGetCount(elements);
-
-       if (nElements < 1) {
-               SCPreferencesPrivateRef prefsPrivate    = (SCPreferencesPrivateRef)prefs;
-
-               __SCPreferencesAccess(prefs);
-               value = prefsPrivate->prefs;
-       }
-
        for (i = 0; i < nElements; i++) {
                element = CFArrayGetValueAtIndex(elements, i);
                if (i == 0) {
-                       value = SCPreferencesGetValue(prefs, CFArrayGetValueAtIndex(elements, 0));
+                       value = CFDictionaryGetValue(prefsPrivate->prefs,
+                                                    CFArrayGetValueAtIndex(elements, 0));
                } else {
                        value = CFDictionaryGetValue(value, element);
                }
@@ -119,7 +120,7 @@ getPath(SCPreferencesRef prefs, CFStringRef path, CFDictionaryRef *entity)
                        goto done;
                }
 
-               if ((i < nElements - 1) &&
+               if ((i < nElements-1) &&
                    CFDictionaryGetValueIfPresent(value, kSCResvLink, (const void **)&link)) {
                        /*
                         * if not the last path component and this
@@ -144,7 +145,7 @@ getPath(SCPreferencesRef prefs, CFStringRef path, CFDictionaryRef *entity)
                        newElements = CFArrayCreateMutableCopy(NULL, 0, linkElements);
                        CFArrayAppendArray(newElements,
                                           elements,
-                                          CFRangeMake(i + 1, nElements-i - 1));
+                                          CFRangeMake(i+1, nElements-i-1));
                        CFRelease(elements);
                        elements = newElements;
 
@@ -173,13 +174,9 @@ setPath(SCPreferencesRef prefs, CFStringRef path, CFDictionaryRef entity)
        CFIndex                 nLinks          = 0;
        CFDictionaryRef         newEntity       = NULL;
        CFDictionaryRef         node            = NULL;
-       CFMutableArrayRef       nodes           = NULL;
+       CFMutableArrayRef       nodes;
        Boolean                 ok              = FALSE;
-
-       if ((entity != NULL) && !isA_CFDictionary(entity)) {
-               _SCErrorSet(kSCStatusInvalidArgument);
-               return FALSE;
-       }
+       SCPreferencesPrivateRef prefsPrivate    = (SCPreferencesPrivateRef)prefs;
 
        elements = normalizePath(path);
        if (elements == NULL) {
@@ -187,38 +184,16 @@ setPath(SCPreferencesRef prefs, CFStringRef path, CFDictionaryRef entity)
                return FALSE;
        }
 
+       __SCPreferencesAccess(prefs);
+
     restart :
 
        nElements = CFArrayGetCount(elements);
-
-       if (nElements < 1) {
-               SCPreferencesPrivateRef prefsPrivate    = (SCPreferencesPrivateRef)prefs;
-
-               __SCPreferencesAccess(prefs);
-
-               if (prefsPrivate->prefs != NULL) {
-                       CFRelease(prefsPrivate->prefs);
-               }
-
-               if (entity == NULL) {
-                       prefsPrivate->prefs = CFDictionaryCreateMutable(NULL,
-                                                                       0,
-                                                                       &kCFTypeDictionaryKeyCallBacks,
-                                                                       &kCFTypeDictionaryValueCallBacks);
-               } else {
-                       prefsPrivate->prefs = CFDictionaryCreateMutableCopy(NULL, 0, entity);
-               }
-
-               prefsPrivate->changed = TRUE;
-               ok = TRUE;
-               goto done;
-       }
-
-       nodes = CFArrayCreateMutable(NULL, nElements - 1, &kCFTypeArrayCallBacks);
+       nodes     = CFArrayCreateMutable(NULL, nElements-1, &kCFTypeArrayCallBacks);
        for (i = 0; i < nElements - 1; i++) {
                element = CFArrayGetValueAtIndex(elements, i);
                if (i == 0) {
-                       node = SCPreferencesGetValue(prefs, element);
+                       node = CFDictionaryGetValue(prefsPrivate->prefs, element);
                } else {
                        node = CFDictionaryGetValue(node, element);
 
@@ -244,7 +219,7 @@ setPath(SCPreferencesRef prefs, CFStringRef path, CFDictionaryRef entity)
                        goto done;
                }
 
-               if ((i < nElements - 1) &&
+               if ((i < nElements-1) &&
                    CFDictionaryGetValueIfPresent(node, kSCResvLink, (const void **)&link)) {
                        /*
                         * if not the last path component and this
@@ -269,7 +244,7 @@ setPath(SCPreferencesRef prefs, CFStringRef path, CFDictionaryRef entity)
                        newElements = CFArrayCreateMutableCopy(NULL, 0, linkElements);
                        CFArrayAppendArray(newElements,
                                           elements,
-                                          CFRangeMake(i + 1, nElements-i - 1));
+                                          CFRangeMake(i+1, nElements-i-1));
                        CFRelease(elements);
                        elements = newElements;
 
@@ -278,40 +253,25 @@ setPath(SCPreferencesRef prefs, CFStringRef path, CFDictionaryRef entity)
                }
        }
 
-       /*
-        * make sure that the last component doesn't step on top
-        * of a non-dictionary component.
-        */
-       element = CFArrayGetValueAtIndex(elements, nElements - 1);
-       if (nElements > 1) {
-               node = CFArrayGetValueAtIndex(nodes, nElements - 2);
-               node = CFDictionaryGetValue(node, element);
-       } else {
-               node = SCPreferencesGetValue(prefs, element);
-       }
-       if ((node != NULL) && !isA_CFDictionary(node)) {
-               // we won't step on a non-dictionary component
-               _SCErrorSet(kSCStatusInvalidArgument);
-               goto done;
-       }
-
-       if (entity != NULL) {
+       if (entity) {
                newEntity = CFRetain(entity);
        }
        for (i = nElements - 1; i >= 0; i--) {
                element = CFArrayGetValueAtIndex(elements, i);
                if (i == 0) {
-                       if (newEntity != NULL) {
-                               ok = SCPreferencesSetValue(prefs, element, newEntity);
+                       if (newEntity) {
+                               CFDictionarySetValue(prefsPrivate->prefs, element, newEntity);
                        } else {
-                               ok = SCPreferencesRemoveValue(prefs, element);
+                               CFDictionaryRemoveValue(prefsPrivate->prefs, element);
                        }
+                       prefsPrivate->changed  = TRUE;
+                       ok = TRUE;
                } else {
                        CFMutableDictionaryRef  newNode;
 
-                       node    = CFArrayGetValueAtIndex(nodes, i - 1);
+                       node    = CFArrayGetValueAtIndex(nodes, i-1);
                        newNode = CFDictionaryCreateMutableCopy(NULL, 0, node);
-                       if (newEntity != NULL) {
+                       if (newEntity) {
                                CFDictionarySetValue(newNode, element, newEntity);
                                CFRelease(newEntity);
                        } else {
@@ -325,13 +285,13 @@ setPath(SCPreferencesRef prefs, CFStringRef path, CFDictionaryRef entity)
                        newEntity = newNode;
                }
        }
-       if (newEntity != NULL) {
+       if (newEntity) {
                CFRelease(newEntity);
        }
 
     done :
 
-       if (nodes != NULL)      CFRelease(nodes);
+       CFRelease(nodes);
        CFRelease(elements);
        return ok;
 }
@@ -456,22 +416,7 @@ SCPreferencesPathSetValue(SCPreferencesRef prefs,
                return FALSE;
        }
 
-#define        NETPREF_NEEDS_REPAIR
-#ifdef NETPREF_NEEDS_REPAIR
-       if (CFEqual(path, CFSTR("/CurrentSet")) && isA_CFString(value)) {
-//             static Boolean  warned  = FALSE;
-//             if (!warned) {
-//                     SCPrint(TRUE, stderr, CFSTR("SCPreferencesPathSetValue(, %@, ) called with non-dictionary value\n"), path);
-//                     warned = TRUE;
-//             }
-               return SCPreferencesSetValue(prefs, CFSTR("CurrentSet"), value);
-       }
-#endif // NETPREF_NEEDS_REPAIR
-
-       if (!isA_CFDictionary(value)) {
-#ifdef NETPREF_NEEDS_REPAIR
-SCPrint(TRUE, stderr, CFSTR("SCPreferencesPathSetValue(, %@, ) called with non-dictionary value\n"), path);
-#endif // NETPREF_NEEDS_REPAIR
+       if (!value) {
                _SCErrorSet(kSCStatusInvalidArgument);
                return FALSE;
        }
@@ -496,7 +441,7 @@ SCPreferencesPathSetLink(SCPreferencesRef   prefs,
                return FALSE;
        }
 
-       if (!isA_CFString(link)) {
+       if (!link) {
                _SCErrorSet(kSCStatusInvalidArgument);
                return FALSE;
        }
index 9caf2cd29ab09630e925e82d2aa4414795cf6fad..e15f541ed41211bf78690494b6a4933fa2d19dde 100644 (file)
@@ -35,6 +35,8 @@
 #include <netdb.h>
 
 
+
+
 CFStringRef
 SCDynamicStoreKeyCreateProxies(CFAllocatorRef allocator)
 {
@@ -121,7 +123,6 @@ SCDynamicStoreCopyProxies(SCDynamicStoreRef store)
        Boolean                 tempSession     = FALSE;
 
 
-
        /* copy proxy information from dynamic store */
 
        if (store == NULL) {
@@ -257,6 +258,7 @@ SCDynamicStoreCopyProxies(SCDynamicStoreRef store)
                }
        }
 
+
        proxies = CFDictionaryCreateCopy(NULL, newProxies);
        CFRelease(newProxies);
 
index 52fa072ace2cf2d87c8b86e8f37a8f4c0b004ac4..97357cae6f0fe8e2ba07a2bdac0e13ce6c259083 100644 (file)
@@ -82,8 +82,8 @@ static CFRunLoopRef           plugin_runLoop  = NULL;
 
 
 #ifdef ppc
-//extern SCDynamicStoreBundleLoadFunction      load_ATconfig;
-//extern SCDynamicStoreBundleStopFunction      stop_ATconfig;
+extern SCDynamicStoreBundleLoadFunction                load_ATconfig;
+extern SCDynamicStoreBundleStopFunction                stop_ATconfig;
 #endif /* ppc */
 extern SCDynamicStoreBundleLoadFunction                load_IPMonitor;
 extern SCDynamicStoreBundlePrimeFunction       prime_IPMonitor;
@@ -108,13 +108,13 @@ typedef struct {
 
 static const builtin builtin_plugins[] = {
 #ifdef ppc
-//     {
-//             CFSTR("com.apple.SystemConfiguration.ATconfig"),
-//             &load_ATconfig,
-//             NULL,
-//             NULL,
-//             &stop_ATconfig
-//     },
+       {
+               CFSTR("com.apple.SystemConfiguration.ATconfig"),
+               &load_ATconfig,
+               NULL,
+               NULL,
+               &stop_ATconfig
+       },
 #endif /* ppc */
        {
                CFSTR("com.apple.SystemConfiguration.IPMonitor"),
index 4c5e1bfd4842155ccb5b7cb981b415debf7c0524..ad7bbeaeb7ed0736292c9e615f616fc128262769 100644 (file)
                        buildRules = (
                        );
                        buildSettings = {
-                               CURRENT_PROJECT_VERSION = 136.2;
+                               CURRENT_PROJECT_VERSION = 137.2;
                                DEAD_CODE_STRIPPING = YES;
                                FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
                                INSTALL_MODE_FLAG = "a-w,a+rX";
                        buildRules = (
                        );
                        buildSettings = {
-                               CURRENT_PROJECT_VERSION = 136.2;
+                               CURRENT_PROJECT_VERSION = 137.2;
                                DEAD_CODE_STRIPPING = YES;
                                FRAMEWORK_SEARCH_PATHS = "$(SYMROOT)";
                                INSTALL_MODE_FLAG = "a-w,a+rX,u+s";
                        buildRules = (
                        );
                        buildSettings = {
-                               CURRENT_PROJECT_VERSION = 136.2;
+                               CURRENT_PROJECT_VERSION = 137.2;
                                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";
+                               LIBRARY_SEARCH_PATHS = "\"$(SYMROOT)\" /usr/local/lib/SystemConfiguration";
                                OTHER_CFLAGS = "-fconstant-cfstrings";
                                OTHER_LDFLAGS = "-prebind_all_twolevel_modules";
                                PRODUCT_NAME = configd;
                };
                15CB6A7705C0722B0099E85F = {
                        buildSettings = {
-                               CURRENT_PROJECT_VERSION = 136.2;
+                               CURRENT_PROJECT_VERSION = 137.2;
                                FRAMEWORK_SEARCH_PATHS = "";
                                HEADER_SEARCH_PATHS = "";
                                INSTALL_GROUP = wheel;
                        buildRules = (
                        );
                        buildSettings = {
-                               CURRENT_PROJECT_VERSION = 136.2;
+                               CURRENT_PROJECT_VERSION = 137.2;
                                DYLIB_COMPATIBILITY_VERSION = 1;
                                DYLIB_CURRENT_VERSION = 1;
                                HEADER_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/Frameworks/System.framework/PrivateHeaders";
                        buildRules = (
                        );
                        buildSettings = {
-                               CURRENT_PROJECT_VERSION = 136.2;
+                               CURRENT_PROJECT_VERSION = 137.2;
                                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";
                                OTHER_CFLAGS = "-fconstant-cfstrings";
                                PRODUCT_NAME = ATconfig;
-                               VALID_ARCHS = ppc;
                                VERSIONING_SYSTEM = "apple-generic";
                                WARNING_CFLAGS = "-Wall -Wno-unknown-pragmas";
                                WRAPPER_EXTENSION = bundle;
                        buildRules = (
                        );
                        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;
index 09b6f0ac0ac78a6bb4644f9580f00b94789b2fd4..8909745fda74e39ab7f684b6a48c4e06f9eccc0b 100644 (file)
@@ -133,6 +133,7 @@ getLine(char *buf, int len, InputRef src)
                history(src->h, &ev, H_ENTER, buf);
        }
 
+
        return buf;
 }