]> git.saurik.com Git - apple/configd.git/commitdiff
configd-395.7.tar.gz mac-os-x-1072 v395.7
authorApple <opensource@apple.com>
Tue, 11 Oct 2011 22:51:44 +0000 (22:51 +0000)
committerApple <opensource@apple.com>
Tue, 11 Oct 2011 22:51:44 +0000 (22:51 +0000)
13 files changed:
Plugins/IPMonitor/Info.plist
Plugins/InterfaceNamer/Info.plist
Plugins/KernelEventMonitor/Info.plist
Plugins/LinkConfiguration/Info.plist
Plugins/Logger/Info-Embedded.plist
Plugins/Logger/Info.plist
Plugins/NetworkIdentification/Info.plist
Plugins/PreferencesMonitor/Info.plist
SCMonitor/Info.plist
SystemConfiguration.fproj/English.lproj/NetworkInterface.strings
SystemConfiguration.fproj/Info-Embedded.plist
SystemConfiguration.fproj/Info.plist
SystemConfiguration.fproj/SCNetworkInterface.c

index 473dee5894d662ebe5a9a4ccae7f3a5140dee1f0..52c80f5d1d5501eb26904131425ea3722fd10607 100644 (file)
@@ -15,7 +15,7 @@
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.11</string>
+       <string>1.11.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
index 2dbc4b432069c00d2c51419029a7ad148c0edf87..244ec1a8c9a27423777c4923ea4f0755413fe64b 100644 (file)
@@ -17,7 +17,7 @@
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.11</string>
+       <string>1.11.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
index 995a9300ee7f53b78adf0437b080564e15e93054..024f0382d8cce8d50293635070aaf72bc156cf1e 100644 (file)
@@ -15,7 +15,7 @@
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.11</string>
+       <string>1.11.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
index a4e758fd4d708a232c14714353b9f5a405dd2f60..21adc60cba2cd59bb35f7e7327d6a089c8ea3dbd 100644 (file)
@@ -15,7 +15,7 @@
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.11</string>
+       <string>1.11.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
index 42509e52a699df94dad96c20a6ccb4cc33c45189..db9e6298b7162881f416140c8c6f5496b38335ab 100644 (file)
@@ -15,7 +15,7 @@
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.11</string>
+       <string>1.11.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
index a5ca3f62e0cb661ab32ba1b1da58b2d6e25596e7..b8c904d0fb2d8889a150dcbdf02c0462d06a30cb 100644 (file)
@@ -15,7 +15,7 @@
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.11</string>
+       <string>1.11.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
index f3aa4210c9645add630ccc1fd10f486546717529..db066bda0c25c55aa6e3ae4ba7ab59af4e9e14c7 100644 (file)
@@ -15,7 +15,7 @@
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.11</string>
+       <string>1.11.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
index d202828d1b329104997055ddbef1e754369ea0bf..59113e547c27368c35349babde65949230edde88 100644 (file)
@@ -15,7 +15,7 @@
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.11</string>
+       <string>1.11.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
index 0f5dca288bc2a1e7c315eab57951795f78b3e902..1889870fd12212bac5a6e2487bcfe47a5f8ad347 100644 (file)
@@ -15,7 +15,7 @@
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.11</string>
+       <string>1.11.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
index fe6b31b7bdf48cec1e1088599dae58108e1327cb..c88493feea4dfaf9435bd3213b51a8f79081c73c 100644 (file)
Binary files a/SystemConfiguration.fproj/English.lproj/NetworkInterface.strings and b/SystemConfiguration.fproj/English.lproj/NetworkInterface.strings differ
index 5597be55d5da82e9856fd69f705e500ca6d16c7a..9112621d5c5121ab8c6a3e7a21ed1ff82a70546b 100644 (file)
@@ -17,7 +17,7 @@
        <key>CFBundlePackageType</key>
        <string>FMWK</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.11</string>
+       <string>1.11.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
index 5597be55d5da82e9856fd69f705e500ca6d16c7a..9112621d5c5121ab8c6a3e7a21ed1ff82a70546b 100644 (file)
@@ -17,7 +17,7 @@
        <key>CFBundlePackageType</key>
        <string>FMWK</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.11</string>
+       <string>1.11.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
index c751a62fb820439aec34263cf5330cbcdcc328d3..5820ad27fa5f530d9adda507960b9fa18057691f 100644 (file)
 #define        kIODeviceSupportsHoldKey        "V92Modem"
 #endif
 
+#ifndef        kPCIThunderboltString
+#define kPCIThunderboltString          "PCI-Thunderbolt"
+#endif
+
 #ifndef        kUSBProductString
 #define kUSBProductString              "USB Product Name"
 #endif
@@ -1223,6 +1227,13 @@ static const struct {
 };
 
 
+static const CFStringRef       slot_prefixes[] = {
+       CFSTR("thunderbolt slot "),
+       CFSTR("pci slot "),
+       CFSTR("slot-"),
+};
+
+
 static CFStringRef
 pci_slot(io_registry_entry_t interface, CFTypeRef *pci_slot_name)
 {
@@ -1249,12 +1260,17 @@ pci_slot(io_registry_entry_t interface, CFTypeRef *pci_slot_name)
                                              kCFStringEncodingUTF8);
                }
 
-               if (CFStringGetLength(slot) > 5) {
-                       (void) CFStringFindAndReplace(slot,
-                                                     CFSTR("slot-"),
-                                                     CFSTR(""),
-                                                     CFRangeMake(0, 5),
-                                                     kCFCompareCaseInsensitive|kCFCompareAnchored);
+               for (i = 0; i < sizeof(slot_prefixes)/sizeof(slot_prefixes[0]); i++) {
+                       CFIndex         len;
+
+                       len = CFStringGetLength(slot_prefixes[i]);
+                       if (CFStringGetLength(slot) > len) {
+                               (void) CFStringFindAndReplace(slot,
+                                                             slot_prefixes[i],
+                                                             CFSTR(""),
+                                                             CFRangeMake(0, len),
+                                                             kCFCompareCaseInsensitive|kCFCompareAnchored);
+                       }
                }
 
                for (i = 0; i < sizeof(slot_mappings)/sizeof(slot_mappings[0]); i++) {
@@ -1315,7 +1331,7 @@ compare_bsdNames(const void *val1, const void *val2, void *context)
 
 
 static CFStringRef
-pci_port(CFTypeRef slot_name, CFStringRef bsdName)
+pci_port(CFTypeRef slot_name, int ift, CFStringRef bsdName)
 {
        CFIndex                 n;
        CFStringRef             port_name       = NULL;
@@ -1378,15 +1394,33 @@ pci_port(CFTypeRef slot_name, CFStringRef bsdName)
 
                while ((child = IOIteratorNext(child_iterator)) != MACH_PORT_NULL) {
                        if (IOObjectConformsTo(child, kIONetworkInterfaceClass)) {
-                               CFStringRef     if_bsdName;
-
-                               if_bsdName = IORegistryEntryCreateCFProperty(child,
-                                                                            CFSTR(kIOBSDNameKey),
-                                                                            NULL,
-                                                                            0);
-                               if (if_bsdName != NULL) {
-                                       CFArrayAppendValue(port_names, if_bsdName);
-                                       CFRelease(if_bsdName);
+                               CFNumberRef     child_if_type;
+                               int             child_ift       = ift;
+
+                               child_if_type = IORegistryEntryCreateCFProperty(child,
+                                                                               CFSTR(kIOInterfaceType),
+                                                                               NULL,
+                                                                               0);
+                               if (child_if_type != NULL) {
+                                       if (!isA_CFNumber(child_if_type) ||
+                                           !CFNumberGetValue(child_if_type, kCFNumberIntType, &child_ift)) {
+                                               // assume that it's a match
+                                               child_ift = ift;
+                                       }
+                                       CFRelease(child_if_type);
+                               }
+
+                               if (ift == child_ift) {
+                                       CFStringRef     if_bsdName;
+
+                                       if_bsdName = IORegistryEntryCreateCFProperty(child,
+                                                                                    CFSTR(kIOBSDNameKey),
+                                                                                    NULL,
+                                                                                    0);
+                                       if (if_bsdName != NULL) {
+                                               CFArrayAppendValue(port_names, if_bsdName);
+                                               CFRelease(if_bsdName);
+                                       }
                                }
                        }
                        IOObjectRelease(child);
@@ -1411,7 +1445,7 @@ pci_port(CFTypeRef slot_name, CFStringRef bsdName)
 
 
 static Boolean
-pci_slot_info(io_registry_entry_t interface, CFStringRef *slot_name, CFStringRef *port_name)
+pci_slot_info(io_registry_entry_t interface, int ift, CFStringRef *slot_name, CFStringRef *port_name)
 {
        CFStringRef     bsd_name;
        Boolean         ok              = FALSE;
@@ -1428,7 +1462,7 @@ pci_slot_info(io_registry_entry_t interface, CFStringRef *slot_name, CFStringRef
        *slot_name = pci_slot(interface, &pci_slot_name);
        if (*slot_name != NULL) {
                if (pci_slot_name != NULL) {
-                       *port_name = pci_port(pci_slot_name, bsd_name);
+                       *port_name = pci_port(pci_slot_name, ift, bsd_name);
                        CFRelease(pci_slot_name);
                }
                ok = TRUE;
@@ -1500,6 +1534,25 @@ isBluetoothBuiltin(Boolean *haveController)
 }
 
 
+static Boolean
+isThunderbolt(io_registry_entry_t interface)
+{
+       CFTypeRef       val;
+
+       val = IORegistryEntrySearchCFProperty(interface,
+                                             kIOServicePlane,
+                                             CFSTR(kPCIThunderboltString),
+                                             NULL,
+                                             kIORegistryIterateRecursively | kIORegistryIterateParents);
+       if (val != NULL) {
+               CFRelease(val);
+               return TRUE;
+       }
+
+       return FALSE;
+}
+
+
 static void
 processUSBInterface(SCNetworkInterfacePrivateRef       interfacePrivate,
                    io_registry_entry_t                 interface,
@@ -1530,6 +1583,53 @@ processUSBInterface(SCNetworkInterfacePrivateRef interfacePrivate,
 }
 
 
+static Boolean
+update_interface_name(SCNetworkInterfacePrivateRef     interfacePrivate,
+                     io_registry_entry_t               interface,
+                     Boolean                           useUSBInfo)
+{
+       Boolean         updated = FALSE;
+       CFTypeRef       val;
+
+       // check if a "Product Name" has been provided
+       val = IORegistryEntrySearchCFProperty(interface,
+                                             kIOServicePlane,
+                                             CFSTR(kIOPropertyProductNameKey),
+                                             NULL,
+                                             kIORegistryIterateRecursively | kIORegistryIterateParents);
+       if ((val == NULL) && useUSBInfo && (interfacePrivate->usb.name != NULL)) {
+               // else, use "USB Product Name" if available
+               val = CFRetain(interfacePrivate->usb.name);
+       }
+       if (val != NULL) {
+               CFStringRef     productName;
+
+               productName = IOCopyCFStringValue(val);
+               CFRelease(val);
+
+               if (productName != NULL) {
+                       if (CFStringGetLength(productName) > 0) {
+                               // if we have a [somewhat reasonable?] product name
+                               if (interfacePrivate->name != NULL) {
+                                       CFRelease(interfacePrivate->name);
+                               }
+                               interfacePrivate->name = CFRetain(productName);
+                               if (interfacePrivate->localized_name != NULL) {
+                                       CFRelease(interfacePrivate->localized_name);
+                               }
+                               interfacePrivate->localized_name = copy_interface_string(bundle, productName, TRUE);
+
+                               updated = TRUE;
+                       }
+
+                       CFRelease(productName);
+               }
+       }
+
+       return updated;
+}
+
+
 #pragma mark -
 #pragma mark Interface enumeration
 
@@ -1740,19 +1840,33 @@ processNetworkInterface(SCNetworkInterfacePrivateRef    interfacePrivate,
                                                CFStringRef             port_name;
                                                CFStringRef             slot_name;
 
-                                               if (pci_slot_info(interface, &slot_name, &port_name)) {
-                                                       if (port_name == NULL) {
-                                                               interfacePrivate->localized_key  = CFSTR("pci-ether");
-                                                               interfacePrivate->localized_arg1 = slot_name;
+                                               // set interface "name"
+                                               if (!update_interface_name(interfacePrivate, interface, FALSE) &&
+                                                   pci_slot_info(interface, ift, &slot_name, &port_name)) {
+                                                       if (isThunderbolt(interface)) {
+                                                               if (port_name == NULL) {
+                                                                       interfacePrivate->localized_key  = CFSTR("thunderbolt-ether");
+                                                                       interfacePrivate->localized_arg1 = slot_name;
+                                                               } else {
+                                                                       interfacePrivate->localized_key  = CFSTR("thunderbolt-multiether");
+                                                                       interfacePrivate->localized_arg1 = slot_name;
+                                                                       interfacePrivate->localized_arg2 = port_name;
+                                                               }
+
                                                        } else {
-                                                               interfacePrivate->localized_key  = CFSTR("pci-multiether");
-                                                               interfacePrivate->localized_arg1 = slot_name;
-                                                               interfacePrivate->localized_arg2 = port_name;
+                                                               if (port_name == NULL) {
+                                                                       interfacePrivate->localized_key  = CFSTR("pci-ether");
+                                                                       interfacePrivate->localized_arg1 = slot_name;
+                                                               } else {
+                                                                       interfacePrivate->localized_key  = CFSTR("pci-multiether");
+                                                                       interfacePrivate->localized_arg1 = slot_name;
+                                                                       interfacePrivate->localized_arg2 = port_name;
+                                                               }
                                                        }
                                                }
                                        } else if (CFEqual(provider, CFSTR("IOUSBDevice")) ||
                                                   CFEqual(provider, CFSTR("IOUSBInterface"))) {
-
+                                               // get USB info (if available)
                                                processUSBInterface(interfacePrivate,
                                                                    interface,
                                                                    interface_dict,
@@ -1761,38 +1875,8 @@ processNetworkInterface(SCNetworkInterfacePrivateRef     interfacePrivate,
                                                                    bus,
                                                                    bus_dict);
 
-                                               // check if a "Product Name" has been provided
-                                               val = IORegistryEntrySearchCFProperty(interface,
-                                                                                     kIOServicePlane,
-                                                                                     CFSTR(kIOPropertyProductNameKey),
-                                                                                     NULL,
-                                                                                     kIORegistryIterateRecursively | kIORegistryIterateParents);
-                                               if ((val == NULL) && (interfacePrivate->usb.name != NULL)) {
-                                                       // else, use "USB Product Name" if available
-                                                       val = CFRetain(interfacePrivate->usb.name);
-                                               }
-                                               if (val != NULL) {
-                                                       CFStringRef     productName;
-
-                                                       productName = IOCopyCFStringValue(val);
-                                                       CFRelease(val);
-
-                                                       if (productName != NULL) {
-                                                               if (CFStringGetLength(productName) > 0) {
-                                                                       // if we have a [somewhat reasonable?] product name
-                                                                       if (interfacePrivate->name != NULL) {
-                                                                               CFRelease(interfacePrivate->name);
-                                                                       }
-                                                                       interfacePrivate->name = CFRetain(productName);
-                                                                       if (interfacePrivate->localized_name != NULL) {
-                                                                               CFRelease(interfacePrivate->localized_name);
-                                                                       }
-                                                                       interfacePrivate->localized_name = copy_interface_string(bundle, productName, TRUE);
-                                                               }
-
-                                                               CFRelease(productName);
-                                                       }
-                                               } else {
+                                               // set interface "name"
+                                               if (!update_interface_name(interfacePrivate, interface, TRUE)) {
                                                        interfacePrivate->localized_key  = CFSTR("usb-ether");
                                                        interfacePrivate->localized_arg1 = IODictionaryCopyCFStringValue(interface_dict, CFSTR(kIOBSDNameKey));
                                                }
@@ -1825,12 +1909,31 @@ processNetworkInterface(SCNetworkInterfacePrivateRef    interfacePrivate,
                        if (interfacePrivate->builtin) {
                                interfacePrivate->localized_key = CFSTR("firewire");
                        } else {
+                               CFStringRef     port_name;
                                CFStringRef     slot_name;
 
-                               slot_name = pci_slot(interface, NULL);
-                               if (slot_name != NULL) {
-                                       interfacePrivate->localized_key  = CFSTR("pci-firewire");
-                                       interfacePrivate->localized_arg1 = slot_name;
+                               // set interface "name"
+                               if (!update_interface_name(interfacePrivate, interface, FALSE) &&
+                                   pci_slot_info(interface, ift, &slot_name, &port_name)) {
+                                       if (isThunderbolt(interface)) {
+                                               if (port_name == NULL) {
+                                                       interfacePrivate->localized_key  = CFSTR("thunderbolt-firewire");
+                                                       interfacePrivate->localized_arg1 = slot_name;
+                                               } else {
+                                                       interfacePrivate->localized_key  = CFSTR("thunderbolt-multifirewire");
+                                                       interfacePrivate->localized_arg1 = slot_name;
+                                                       interfacePrivate->localized_arg2 = port_name;
+                                               }
+                                       } else {
+                                               if (port_name == NULL) {
+                                                       interfacePrivate->localized_key  = CFSTR("pci-firewire");
+                                                       interfacePrivate->localized_arg1 = slot_name;
+                                               } else {
+                                                       interfacePrivate->localized_key  = CFSTR("pci-multifirewire");
+                                                       interfacePrivate->localized_arg1 = slot_name;
+                                                       interfacePrivate->localized_arg2 = port_name;
+                                               }
+                                       }
                                }
                        }
 
@@ -2219,47 +2322,22 @@ processSerialInterface(SCNetworkInterfacePrivateRef     interfacePrivate,
                }
 
                if (!isModem || !CFEqual(base, CFSTR("modem"))) {
-                       CFStringRef     productName;
-
-                       // check if a "Product Name" has been provided
-                       val = IORegistryEntrySearchCFProperty(interface,
-                                                             kIOServicePlane,
-                                                             CFSTR(kIOPropertyProductNameKey),
-                                                             NULL,
-                                                             kIORegistryIterateRecursively | kIORegistryIterateParents);
-                       if (val == NULL) {
-                               // check if a "USB Product Name" has been provided
-                               val = IORegistryEntrySearchCFProperty(interface,
-                                                                     kIOServicePlane,
-                                                                     CFSTR(kUSBProductString),
-                                                                     NULL,
-                                                                     kIORegistryIterateRecursively | kIORegistryIterateParents);
-                       }
-                       if (val != NULL) {
-                               productName = IOCopyCFStringValue(val);
-                               CFRelease(val);
-
-                               if (productName != NULL) {
-                                       if (CFStringGetLength(productName) > 0) {
-                                               // if we have a [somewhat reasonable?] product name
-                                               if (interfacePrivate->name != NULL) {
-                                                       CFRelease(interfacePrivate->name);
-                                               }
-                                               interfacePrivate->name = CFRetain(productName);
-                                               if (interfacePrivate->localized_name != NULL) {
-                                                       CFRelease(interfacePrivate->localized_name);
-                                               }
-                                               interfacePrivate->localized_name = copy_interface_string(bundle, productName, TRUE);
-
-                                               // if not provided, also check if the product name
-                                               // matches a CCL script
-                                               if ((modemCCL == NULL) &&
-                                                   is_valid_connection_script(productName)) {
-                                                       set_connection_script(interfacePrivate, productName);
-                                               }
-                                       }
-
-                                       CFRelease(productName);
+                       // get USB info (if available)
+                       processUSBInterface(interfacePrivate,
+                                           interface,
+                                           interface_dict,
+                                           controller,
+                                           controller_dict,
+                                           bus,
+                                           bus_dict);
+
+                       // set interface "name"
+                       if (update_interface_name(interfacePrivate, interface, TRUE)) {
+                               // if "ModemCCL" not provided, also check if the product/interface
+                               // name matches a CCL script
+                               if ((modemCCL == NULL) &&
+                                   is_valid_connection_script(interfacePrivate->name)) {
+                                       set_connection_script(interfacePrivate, interfacePrivate->name);
                                }
                        }
                }