- 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 (CFEqual(interfaceType, kSCNetworkInterfaceTypeBluetooth) ||
+ CFEqual(interfaceType, kSCNetworkInterfaceTypeIrDA ) ||
+ CFEqual(interfaceType, kSCNetworkInterfaceTypeModem ) ||
+ CFEqual(interfaceType, kSCNetworkInterfaceTypeSerial ) ||
+ CFEqual(interfaceType, kSCNetworkInterfaceTypeWWAN )) {
+ CFDictionaryRef overrides;
+ CFStringRef script;
+
+ overrides = __SCNetworkInterfaceGetTemplateOverrides(interface, kSCNetworkInterfaceTypeModem);
+
+ // a ConnectionScript (and related keys) from the interface
+ // should trump the settings from the configuration template.
+ if ((overrides != NULL) &&
+ CFDictionaryContainsKey(overrides, kSCPropNetModemConnectionScript)) {
+ CFMutableDictionaryRef newConfig;
+
+ newConfig = CFDictionaryCreateMutableCopy(NULL, 0, config);
+ CFDictionaryRemoveValue(newConfig, kSCPropNetModemConnectionPersonality);
+ CFDictionaryRemoveValue(newConfig, kSCPropNetModemConnectionScript);
+ CFDictionaryRemoveValue(newConfig, kSCPropNetModemDeviceVendor);
+ CFDictionaryRemoveValue(newConfig, kSCPropNetModemDeviceModel);
+ CFRelease(config);
+ config = newConfig;
+ }
+
+ // update template for v.92 modems
+ if ((overrides == NULL) &&
+ CFDictionaryGetValueIfPresent(config,
+ kSCPropNetModemConnectionScript,
+ (const void **)&script) &&
+ CFEqual(script, CFSTR("v.34 Personality")) &&
+ _SCNetworkInterfaceIsModemV92(interface)) {
+ CFMutableDictionaryRef newConfig;
+
+ newConfig = CFDictionaryCreateMutableCopy(NULL, 0, config);
+ CFDictionarySetValue(newConfig,
+ kSCPropNetModemConnectionPersonality,
+ CFSTR("v.92 Personality"));
+ CFDictionarySetValue(newConfig,
+ kSCPropNetModemDeviceModel,
+ CFSTR("Apple Modem (v.92)"));
+ CFRelease(config);
+ config = newConfig;