]> git.saurik.com Git - apple/configd.git/commitdiff
configd-84.6.tar.gz mac-os-x-1033 mac-os-x-1034 mac-os-x-1035 mac-os-x-1036 mac-os-x-1037 mac-os-x-1038 mac-os-x-1039 v84.6
authorApple <opensource@apple.com>
Fri, 16 Jan 2004 22:21:15 +0000 (22:21 +0000)
committerApple <opensource@apple.com>
Fri, 16 Jan 2004 22:21:15 +0000 (22:21 +0000)
143 files changed:
SystemConfiguration.fproj/CustomInfo.plist
SystemConfiguration.fproj/DHCP.c
SystemConfiguration.fproj/DHCPClientPreferences.h
SystemConfiguration.fproj/DeviceOnHold.c
SystemConfiguration.fproj/DeviceOnHold.h
SystemConfiguration.fproj/LinkConfiguration.c
SystemConfiguration.fproj/LinkConfiguration.h
SystemConfiguration.fproj/Makefile
SystemConfiguration.fproj/Makefile.preamble
SystemConfiguration.fproj/PB.project
SystemConfiguration.fproj/SCD.c
SystemConfiguration.fproj/SCDAdd.c
SystemConfiguration.fproj/SCDAddSession.c
SystemConfiguration.fproj/SCDConsoleUser.c
SystemConfiguration.fproj/SCDGet.c
SystemConfiguration.fproj/SCDHostName.c
SystemConfiguration.fproj/SCDKeys.c
SystemConfiguration.fproj/SCDList.c
SystemConfiguration.fproj/SCDLock.c
SystemConfiguration.fproj/SCDNotifierAdd.c
SystemConfiguration.fproj/SCDNotifierCancel.c
SystemConfiguration.fproj/SCDNotifierGetChanges.c
SystemConfiguration.fproj/SCDNotifierInformViaCallback.c
SystemConfiguration.fproj/SCDNotifierInformViaFD.c
SystemConfiguration.fproj/SCDNotifierInformViaMachPort.c
SystemConfiguration.fproj/SCDNotifierInformViaSignal.c
SystemConfiguration.fproj/SCDNotifierRemove.c
SystemConfiguration.fproj/SCDNotifierSetKeys.c
SystemConfiguration.fproj/SCDNotifierWait.c
SystemConfiguration.fproj/SCDNotify.c
SystemConfiguration.fproj/SCDOpen.c
SystemConfiguration.fproj/SCDPlugin.c
SystemConfiguration.fproj/SCDPlugin.h
SystemConfiguration.fproj/SCDPrivate.c
SystemConfiguration.fproj/SCDRemove.c
SystemConfiguration.fproj/SCDSet.c
SystemConfiguration.fproj/SCDSnapshot.c
SystemConfiguration.fproj/SCDTouch.c
SystemConfiguration.fproj/SCDUnlock.c
SystemConfiguration.fproj/SCDynamicStore.h
SystemConfiguration.fproj/SCDynamicStoreCopyDHCPInfo.h
SystemConfiguration.fproj/SCDynamicStoreCopySpecific.h
SystemConfiguration.fproj/SCDynamicStoreCopySpecificPrivate.h
SystemConfiguration.fproj/SCDynamicStoreInternal.h
SystemConfiguration.fproj/SCDynamicStoreKey.h
SystemConfiguration.fproj/SCDynamicStorePrivate.h
SystemConfiguration.fproj/SCDynamicStoreSetSpecificPrivate.h
SystemConfiguration.fproj/SCLocation.c
SystemConfiguration.fproj/SCNetwork.c
SystemConfiguration.fproj/SCNetwork.h
SystemConfiguration.fproj/SCNetworkConnection.c
SystemConfiguration.fproj/SCNetworkConnection.h
SystemConfiguration.fproj/SCNetworkReachability.c
SystemConfiguration.fproj/SCNetworkReachability.h
SystemConfiguration.fproj/SCP.c
SystemConfiguration.fproj/SCPAdd.c
SystemConfiguration.fproj/SCPApply.c
SystemConfiguration.fproj/SCPCommit.c
SystemConfiguration.fproj/SCPGet.c
SystemConfiguration.fproj/SCPList.c
SystemConfiguration.fproj/SCPLock.c
SystemConfiguration.fproj/SCPOpen.c
SystemConfiguration.fproj/SCPPath.c
SystemConfiguration.fproj/SCPRemove.c
SystemConfiguration.fproj/SCPSet.c
SystemConfiguration.fproj/SCPUnlock.c
SystemConfiguration.fproj/SCPreferences.h
SystemConfiguration.fproj/SCPreferencesInternal.h
SystemConfiguration.fproj/SCPreferencesPath.h
SystemConfiguration.fproj/SCPreferencesPrivate.h
SystemConfiguration.fproj/SCPreferencesSetSpecific.h
SystemConfiguration.fproj/SCPrivate.h
SystemConfiguration.fproj/SCProxies.c
SystemConfiguration.fproj/SCValidation.h
SystemConfiguration.fproj/SystemConfiguration.h
SystemConfiguration.fproj/VLANConfiguration.c [new file with mode: 0644]
SystemConfiguration.fproj/VLANConfiguration.h [new file with mode: 0644]
SystemConfiguration.fproj/VLANConfigurationPrivate.h [new file with mode: 0644]
SystemConfiguration.fproj/config.defs
SystemConfiguration.fproj/config_types.h
SystemConfiguration.fproj/dy_framework.c
SystemConfiguration.fproj/dy_framework.h
SystemConfiguration.fproj/genSCPreferences.c
SystemConfiguration.fproj/moh.c
SystemConfiguration.fproj/moh.h
SystemConfiguration.fproj/moh_msg.h
SystemConfiguration.fproj/ppp.c
SystemConfiguration.fproj/ppp.h
configd.tproj/_SCD.c
configd.tproj/_SCD.h
configd.tproj/_configadd.c
configd.tproj/_configadd_s.c
configd.tproj/_configclose.c
configd.tproj/_configget.c
configd.tproj/_configlist.c
configd.tproj/_configlock.c
configd.tproj/_confignotify.c
configd.tproj/_configopen.c
configd.tproj/_configremove.c
configd.tproj/_configset.c
configd.tproj/_configtouch.c
configd.tproj/_configunlock.c
configd.tproj/_notifyadd.c
configd.tproj/_notifycancel.c
configd.tproj/_notifychanges.c
configd.tproj/_notifyremove.c
configd.tproj/_notifyviafd.c
configd.tproj/_notifyviaport.c
configd.tproj/_notifyviasignal.c
configd.tproj/_snapshot.c
configd.tproj/config.defs
configd.tproj/configd.h
configd.tproj/configd.m
configd.tproj/configd_server.c
configd.tproj/configd_server.h
configd.tproj/notify.c
configd.tproj/notify.h
configd.tproj/notify_server.c
configd.tproj/notify_server.h
configd.tproj/pattern.c
configd.tproj/pattern.h
configd.tproj/plugin_support.c
configd.tproj/plugin_support.h
configd.tproj/session.c
configd.tproj/session.h
scselect.tproj/PB.project
scselect.tproj/scselect.c
scutil.tproj/cache.c
scutil.tproj/cache.h
scutil.tproj/commands.c
scutil.tproj/commands.h
scutil.tproj/dictionary.c
scutil.tproj/dictionary.h
scutil.tproj/notify.c
scutil.tproj/notify.h
scutil.tproj/prefs.c
scutil.tproj/prefs.h
scutil.tproj/scutil.c
scutil.tproj/scutil.h
scutil.tproj/session.c
scutil.tproj/session.h
scutil.tproj/tests.c
scutil.tproj/tests.h

index a1d45775a00b37f1910ec3ada112e617bcad0ab0..b2deea508273bce3a5c26d47ea65454ae78a472a 100644 (file)
@@ -1,5 +1,5 @@
 {
        CFBundleName = "SystemConfiguration";
        CFBundleIdentifier = "com.apple.SystemConfiguration";
-       CFBundleShortVersionString = "1.4.1";
+       CFBundleShortVersionString = "1.7.1";
 }
index 778f9fff5fd2fbf3c264a30525552c63e034061d..7b6d1d724dbdf9c87a579b56bdb42e9a1e7c386f 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index aa30111fc8fb94e6806ce2d58453c6974963ddcb..7ba074a5ea57fa6d70c1e11bb397e116c53b9631 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 48c93b1d9308385fe1f7da25f80f13ca6c1a9138..0ee06ce981e4c2f1fe867f178d14abb00b62d6a5 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 7d9d1cee8f7038cfb89f9886701a53d5177d98d9..7cd4902bff6660cfaf5244e833313f234658d2c3 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 8ea15faba3768f8ff31917090e05177268e708bb..b88db0e8a4f3ba0a4e8a98526880da89d80b6440 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
 
 
 #include <unistd.h>
+#define KERNEL_PRIVATE
 #include <sys/ioctl.h>
+#undef  KERNEL_PRIVATE
 #include <sys/socket.h>
 #include <net/ethernet.h>
 #include <net/if.h>
+#include <net/if_vlan_var.h>
 #include <net/if_media.h>
 #include <net/if_types.h>
 
@@ -434,6 +435,90 @@ NetworkInterfaceCopyMediaSubTypeOptions(CFArrayRef available,
 }
 
 
+static Boolean
+__getMTULimits(char    ifr_name[IFNAMSIZ],
+              int      *mtu_min,
+              int      *mtu_max)
+{
+       int                     ifType          = 0;
+       io_iterator_t           io_iter         = 0;
+       io_registry_entry_t     io_interface    = 0;
+       io_registry_entry_t     io_controller   = 0;
+       kern_return_t           kr;
+       mach_port_t             masterPort      = MACH_PORT_NULL;
+       CFMutableDictionaryRef  matchingDict;
+
+       /* look for a matching interface in the IORegistry */
+
+       matchingDict = IOBSDNameMatching(masterPort, 0, ifr_name);
+       if (matchingDict) {
+               /* Note: IOServiceGetMatchingServices consumes a reference on the 'matchingDict' */
+               kr = IOServiceGetMatchingServices(masterPort, matchingDict, &io_iter);
+               if ((kr == KERN_SUCCESS) && io_iter) {
+                   /* should only have a single match */
+                   io_interface = IOIteratorNext(io_iter);
+               }
+               if (io_iter)    IOObjectRelease(io_iter);
+       }
+
+       if (io_interface) {
+               CFNumberRef     num;
+
+               /*
+                * found an interface, get the interface type
+                */
+               num = IORegistryEntryCreateCFProperty(io_interface, CFSTR(kIOInterfaceType), NULL, kNilOptions);
+               if (num) {
+                       if (isA_CFNumber(num)) {
+                               CFNumberGetValue(num, kCFNumberIntType, &ifType);
+                       }
+                       CFRelease(num);
+               }
+
+               /*
+                * ...and the property we are REALLY interested is in the controller,
+                * which is the parent of the interface object.
+                */
+               (void)IORegistryEntryGetParentEntry(io_interface, kIOServicePlane, &io_controller);
+               IOObjectRelease(io_interface);
+       } else {
+               /* if no matching interface */
+               return FALSE;
+       }
+
+       if (io_controller) {
+               CFNumberRef     num;
+
+               num = IORegistryEntryCreateCFProperty(io_controller, CFSTR(kIOMaxPacketSize), NULL, kNilOptions);
+               if (num) {
+                       if (isA_CFNumber(num)) {
+                               int     value;
+
+                               /*
+                                * Get the value and subtract the FCS bytes and Ethernet header
+                                * sizes from the maximum frame size reported by the controller
+                                * to get the MTU size. The 14 byte media header can be found
+                                * in the registry, but not the size for the trailing FCS bytes.
+                                */
+                               CFNumberGetValue(num, kCFNumberIntType, &value);
+
+                               if (ifType == IFT_ETHER) {
+                                       value -= (ETHER_HDR_LEN + ETHER_CRC_LEN);
+                               }
+
+                               if (mtu_min)    *mtu_min = IF_MINMTU;
+                               if (mtu_max)    *mtu_max = value;
+                       }
+                       CFRelease(num);
+               }
+
+               IOObjectRelease(io_controller);
+       }
+
+       return TRUE;
+}
+
+
 Boolean
 NetworkInterfaceCopyMTU(CFStringRef    interface,
                        int             *mtu_cur,
@@ -462,88 +547,42 @@ NetworkInterfaceCopyMTU(CFStringRef       interface,
        }
 
        if (mtu_cur)    *mtu_cur = ifr.ifr_mtu;
+       if (mtu_min)    *mtu_min = ifr.ifr_mtu;
+       if (mtu_max)    *mtu_max = ifr.ifr_mtu;
 
        /* get valid MTU range */
 
        if (mtu_min || mtu_max) {
-               int                     ifType          = 0;
-               io_iterator_t           io_iter         = 0;
-               io_registry_entry_t     io_interface    = 0;
-               io_registry_entry_t     io_controller   = 0;
-               kern_return_t           kr;
-               mach_port_t             masterPort      = MACH_PORT_NULL;
-               CFMutableDictionaryRef  matchingDict;
-
-               /* assume that we don't know */
-
-               if (mtu_min) *mtu_min = -1;
-               if (mtu_max) *mtu_max = -1;
-
-               /* look for a matching interface in the IORegistry */
-
-               matchingDict = IOBSDNameMatching(masterPort, 0, ifr.ifr_name);
-               if (matchingDict) {
-                       /* Note: IOServiceGetMatchingServices consumes a reference on the 'matchingDict' */
-                       kr = IOServiceGetMatchingServices(masterPort, matchingDict, &io_iter);
-                       if ((kr == KERN_SUCCESS) && io_iter) {
-                           /* should only have a single match */
-                           io_interface = IOIteratorNext(io_iter);
-                       }
-                       if (io_iter)    IOObjectRelease(io_iter);
-               }
-
-               /* found an interface with the given BSD name, get its parent */
-
-               if (io_interface) {
-                       CFNumberRef     num;
-
-                       /*
-                        * get the interface type
-                        */
-                       num = IORegistryEntryCreateCFProperty(io_interface, CFSTR(kIOInterfaceType), NULL, kNilOptions);
-                       if (num) {
-                               if (isA_CFNumber(num)) {
-                                       CFNumberGetValue(num, kCFNumberIntType, &ifType);
+               ok = __getMTULimits(ifr.ifr_name, mtu_min, mtu_max);
+               if (!ok) {
+                       struct ifreq    vifr;
+                       struct vlanreq  vreq;
+
+                       // check if this is a vlan
+
+                       bzero(&vifr, sizeof(vifr));
+                       bzero(&vreq, sizeof(vreq));
+                       strncpy(vifr.ifr_name, ifr.ifr_name, sizeof(vifr.ifr_name));
+                       vifr.ifr_data = (caddr_t)&vreq;
+
+                       if (ioctl(sock, SIOCGETVLAN, (caddr_t)&vifr) == 0) {
+                               /*
+                                * yes, pass parent device MTU settings
+                                *
+                                *   min == parent device minimum MTU
+                                *   max == parent device current MTU
+                                */
+                               if (mtu_min) {
+                                       (void) __getMTULimits(vreq.vlr_parent, mtu_min, NULL);
                                }
-                               CFRelease(num);
-                      }
-
-                       /*
-                        * ...and the property we are REALLY interested is in the controller,
-                        * which is the parent of the interface object.
-                        */
-                       (void)IORegistryEntryGetParentEntry(io_interface, kIOServicePlane, &io_controller);
-
-                       IOObjectRelease(io_interface);
-               }
-
-               if (io_controller) {
-                       CFNumberRef     num;
-
-                       num = IORegistryEntryCreateCFProperty(io_controller, CFSTR(kIOMaxPacketSize), NULL, kNilOptions);
-                       if (num) {
-                               if (isA_CFNumber(num)) {
-                                       int     value;
-
-                                       /*
-                                        * Get the value and subtract the FCS bytes and Ethernet header
-                                        * sizes from the maximum frame size reported by the controller
-                                        * to get the MTU size. The 14 byte media header can be found
-                                        * in the registry, but not the size for the trailing FCS bytes.
-                                        */
-                                       CFNumberGetValue(num, kCFNumberIntType, &value);
-
-                                       if (ifType == IFT_ETHER) {
-                                               value -= (ETHER_HDR_LEN + ETHER_CRC_LEN);
+                               if (mtu_max) {
+                                       bzero(&vifr, sizeof(vifr));
+                                       strncpy(vifr.ifr_name, vreq.vlr_parent, sizeof(vifr.ifr_name));
+                                       if (ioctl(sock, SIOCGIFMTU, (caddr_t)&vifr) == 0) {
+                                               *mtu_max = vifr.ifr_mtu;
                                        }
-
-                                       if (mtu_min)    *mtu_min = IF_MINMTU;
-                                       if (mtu_max)    *mtu_max = value;
                                }
-                               CFRelease(num);
                        }
-
-                       IOObjectRelease(io_controller);
                }
        }
 
index 09701b3d02300cd5602e627185f6e79f7d83fbf1..f33f8c714fc0555ace0eb33a0ddb72526669b4b4 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 01955bbb40c42a34315feae6d9dd0a7a817cb456..1b406d47e3534b32476dec03806a0c7d27390839 100644 (file)
@@ -21,7 +21,8 @@ HFILES = SystemConfiguration.h SCPrivate.h SCDPlugin.h config_types.h\
          SCPreferencesSetSpecific.h SCNetwork.h SCNetworkConnection.h\
          SCNetworkReachability.h SCValidation.h ppp.h\
          DHCPClientPreferences.h SCDynamicStoreCopyDHCPInfo.h moh_msg.h\
-         moh.h DeviceOnHold.h LinkConfiguration.h dy_framework.h
+         moh.h DeviceOnHold.h LinkConfiguration.h dy_framework.h\
+         VLANConfiguration.h VLANConfigurationPrivate.h
 
 CFILES = SCD.c SCDKeys.c SCDPrivate.c SCDPlugin.c SCDOpen.c SCDLock.c\
          SCDUnlock.c SCDList.c SCDAdd.c SCDAddSession.c SCDGet.c\
@@ -35,7 +36,8 @@ CFILES = SCD.c SCDKeys.c SCDPrivate.c SCDPlugin.c SCDOpen.c SCDLock.c\
          SCPCommit.c SCPApply.c SCPPath.c SCDConsoleUser.c\
          SCDHostName.c SCLocation.c SCNetwork.c SCNetworkConnection.c\
          SCNetworkReachability.c SCProxies.c ppp.c DHCP.c moh.c\
-         DeviceOnHold.c LinkConfiguration.c dy_framework.c
+         DeviceOnHold.c LinkConfiguration.c dy_framework.c\
+         VLANConfiguration.c
 
 OTHERSRCS = Makefile.preamble Makefile Makefile.postamble m.template\
             h.template config.defs genSCPreferences.c CustomInfo.plist
@@ -75,7 +77,7 @@ PROJECT_HEADERS = SystemConfiguration.h SCPrivate.h config_types.h\
                   SCPreferencesPrivate.h SCPreferencesPath.h\
                   SCPreferencesSetSpecific.h SCNetwork.h\
                   SCNetworkConnection.h SCNetworkReachability.h\
-                  SCValidation.h
+                  SCValidation.h VLANConfigurationPrivate.h
 
 
 
index 07d79b1dc9cd93bdf34485e70a0dac704170e2bb..ac111aff6ec5173337dd30a149bcec89ae2e6a5e 100644 (file)
@@ -148,6 +148,8 @@ OTHER_PRIVATE_HEADERS += SCValidation.h
 OTHER_PRIVATE_HEADERS += SCDPlugin.h
 OTHER_PRIVATE_HEADERS += DeviceOnHold.h
 OTHER_PRIVATE_HEADERS += LinkConfiguration.h
+OTHER_PRIVATE_HEADERS += VLANConfiguration.h
+OTHER_PRIVATE_HEADERS += VLANConfigurationPrivate.h
 
 #
 # MiG generated files
index 63378a26bff2be82219d9dfe998c76ff7a9c2ed4..3d2e5a7c55325da13c41959763c5fe08f2d0f271 100644 (file)
@@ -36,7 +36,9 @@
             "moh.h", 
             "DeviceOnHold.h", 
             "LinkConfiguration.h", 
-            "dy_framework.h"
+            "dy_framework.h", 
+            "VLANConfiguration.h", 
+            "VLANConfigurationPrivate.h"
         ); 
         "OTHER_LIBS" = (); 
         "OTHER_LINKED" = (
@@ -90,7 +92,8 @@
             "moh.c", 
             "DeviceOnHold.c", 
             "LinkConfiguration.c", 
-            "dy_framework.c"
+            "dy_framework.c", 
+            "VLANConfiguration.c"
         ); 
         "OTHER_SOURCES" = (
             "Makefile.preamble", 
             "SCNetwork.h", 
             "SCNetworkConnection.h", 
             "SCNetworkReachability.h", 
-            "SCValidation.h"
+            "SCValidation.h", 
+            "VLANConfigurationPrivate.h"
         ); 
         "PUBLIC_HEADERS" = (
             "SystemConfiguration.h", 
index e58d4f9e2927dfa685c08aede23e14b0669587e7..50c0f86bb819753ba3a6f893998d7aed8da16fa6 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index b643c738739a0e6fea7074757f3f17c1eb208809..00503ab652b223a19fde5376b79a6bf6626da97c 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 9a265fe5a5129cab280fd66bffaa9ea6a4f20670..7957db17343d0d19e99af89937797fb238ff2238 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 06c2858bbf352dffed5d9bf494920caf2f960087..ad97b87c5320e375f4930965ce3ade9edd43a471 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index d691cd1a1c9c97ca174bad037678ba4af7b6fe55..1d566af5dd3c465b054a17e824779fad7850cc9d 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 6d62ee43316623559844267253a3530d3fe3707c..7bd5fe1894612395daa9e2de5c04096859d3b91b 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index a3cb2a1c6f6e33afe4939c7b9958064592aa7532..c52d5ab71e0b473ab6972588d870221c27eda685 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index cee6ec9adaa86cdbfe588afac994cf11fd630cd8..4ab3068433cfe2774efb6b451fe386d1b4e57ff6 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 6a08e8d32083562cb3952fd696570ab224ecf534..c478dc83f1a3d015613e5144f3be1df8eccf590c 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index c10977f45c9aa061eda2baf0893cbc3688377ec6..85c2969d4ba682313aaf77333329dcbab2058d8f 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 25c57d5052d86d98ee90a187a482da0888de3572..41613e03d6975e113a95ba6ad8ecb8d681d4e76e 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 3d37574380b64ebbd1caf3bfca17cae9de57cde4..871131275593705c3c130ee1f7730d27b9d7c89e 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 74096c5c4e009f36158a0d2818f3aeb34b119980..f5cac0806bf071542a354f2f7a134cdae3dfd6a2 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index e91cd8b01bfa1c82e44d68c82a90ad0222bd3b34..7aec2213dded341904239272bc491135d13fc626 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 42fffca6085cadfa217a6e2280c38454b36118c6..bef3896cbead994547f82c98b2cfcc02f7345b20 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 967277044ab0683b820c5ae1a8360cc5bd310342..4356c6e87627bd6d42aa2d76e37dd64b8234ae9b 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 1cffd11818713fae1ad4bba3a106db33fb8ad221..06f81b9ee059526f14cd6f8e92aae04f96340171 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 483e5495f5413546fb409c015732b6ca5f423bcd..c9eb908ad009b2415486b6036ce691f9e23a754c 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index c0992dcbbd0b04da05c609041d2b7e480cf98524..2417fd293d585f26d853d6aca8789e0a9515901c 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index fafcea090296784111403778ef8852386f23b5eb..409523b13204829074cf9c864f1cd7a87a5ad718 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 39ffadea3ce824595eed342a4c8fbf041713dff0..1ce5cfb5cd2f3993922d8cfdb99a4f1538fd3a2a 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index d25a14c8f919d4cc1f4e7b68a48ef4568cb43efd..a92f51d40dbc57d819511142b3a8f0766a384ddb 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 2daaa0f29f494c0b4d2a016cacece129abc1974a..24955c460095012b18f852d6d0474ce59d540257 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 391f504549290160738a7d5d2543a1eb5967048e..4248bd6bd22ed49d9a861db2b58bfc12e8f07736 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index c91f82b213db70e33d78292bdf173b845ec297dd..b523f567de491853c3df9ab7d964fd028fe6a988 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 56cc859fda1581c41e04e35769a655e15c6bc7de..aba8569882fcfa2c0cf7984228de7d69d95c0d8f 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 851f785aa58d84f7ffde7ff0f15f633a9061eb63..13e069d14ed4852167576507e93ab63ee6ce13a2 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index b79c8bb9b7e6b927bf4d79a200472b45e42c8e98..4450e9ed361ec9d02cc48b5148bc860daf7ab2f6 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 8d206216a8f64293fe785700911daaeb09e971d5..c847c3fe1abc86aedcf8040602eb611768ad962a 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index b2cec8be1b5e0347f4ea786dc7b4b1c995b8c5ff..ea0d504e7f4839965c9c8a73d30be8877939db7a 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 4eab51cd6da2f681f2cab3fb501586755948c4e9..088b4089a73e60e297b1c2fc17ce4af44d51b1ce 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index b1baeaaa5b879d72932bc536a35974c09d67031d..e95c460a3da352109ae6559e866fe80f6b6b661c 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index a47a0ea1900c741e3e0924a414ef106a5eabdaf3..5746a819ae971147abc9c81e2d9a8bfe29e4c58d 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index be5209a5c50340a75b529622c212533c1e05b0a5..51f28b239d01f0f9829d3bd58972ce5d0eac5a3c 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 25c96a75081718355bf1f37877962fd7e7d63c71..18bde7d783d3228647c3516ffa827de1bf5ec406 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 12c180b982364bf7ef6b0d6cc5871928ec7f3699..ebf7b284e0d85b83ff7fca4ae51d1e88c07b36e1 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index ab325a291519df68536fc35b3e75ca72eda72b73..76f8c90ae32766711a4e10c061b3e9a0cfb0081f 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index e60486d1a75ee59be0f8b328dfb96147e813e37b..06dd8699af97466f01a34a40a4a6f75cccfaf560 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 550e1fdf779e31dacd3a8049ebfcb8df183561a6..e5f1671604f70c981ba563869c7991e9b0ca12a3 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 7ac71686a9410e63cca8579de9f62f0480724f64..b9c9ee1019ed9a4c0396e36a10f497e3f8d25e09 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index b50cda00ffa48da805c3d43647533b885c95dd94..bd3c33166157aea6e8404b0e9957c3f58f9d2027 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 53357bc42ada8157c4e065eed8dc50109d35eba3..74a70d1a498a6a35d8c8346b2b8904899f6570a7 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 36be12a07485908a18fdf3ba933d2c72c49ceed2..c838bc71167ae4c313a3070ddef62e6f877c5946 100644 (file)
@@ -2,16 +2,14 @@
  * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
- * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
+ *
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
  * compliance with the License. Please obtain a copy of the License at
  * http://www.opensource.apple.com/apsl/ and read it before using this
  * file.
- * 
+ *
  * The Original Code and all software distributed under the License are
  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
@@ -19,7 +17,7 @@
  * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
  * Please see the License for the specific language governing rights and
  * limitations under the License.
- * 
+ *
  * @APPLE_LICENSE_HEADER_END@
  */
 
index 7ad9962bf5018e97b986b2edf05f284f0ba876d2..8efa2d3f6a2ac9fa7c4a6aaa3aa8ecbddc3e07fb 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 40f2edab4fe7890e78b851a493078e6bfa80600d..0d6474354c639a9075fc3d36f94990f040137488 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 43de7f2fc1426b8c8e2eb239b759d54cc797ceed..963c2f068c6d212f9b1d9214f382066f6f44532f 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 65c9acd025f9d78ed7ecc89c1815eb83cdca25c1..951eb4fdc287d5af3c9293239c05cd93b436b46d 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 18f00f3c7955cb9947ee8e06a470bc29ff91aca3..8998e4bcd7a04c9c4008348c058d3c691d216a05 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index bdbfc41792a31d422b4c9077725ead9e61a7a608..896d27c6c5ade02c476328e70b84f337ec643b93 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 031c33e41dbcb004301958f2c3f362c308751260..1626811c08409faad29413e1fe153ee455abfa3d 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index d69c81e61993c9f4e74b1a6ae8bbdef1e8bed954..88bd2819c8c0d890a53b3f3f4a447848be5bf9c4 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index a748210bacdd45520b9f35821af57dca801aa4b2..47f21f22ae3c1d1ad3477e5ff316dc7599f666f2 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index fc27f6bca1f5ea62f76fa561cd0d5e927b7ceed1..1fd06ed1d999cd1526d83cea9281ca2332c6cc3e 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index ab526480427c48f763e1aa520e17811ca713de30..1de5c1df617dd16323972422eeaa764da237f9cb 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 2b1357e6ee545729ddb88b46b094d0ef0d11512f..c5f6c3fb9fe300ba0bdd21422ace9330eda7f16e 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 5a2ab73169d06063d24089cec61d481620ccb900..c41ee1022a59a0ed2c0528eab4cf1102ac3c4a00 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 5db981e2bb51be0773687283063df6e70d0181d5..aaebc2a4b90d2911bcf461e917e1a86dd36f0ac5 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 488e5d7d79e15de9f0822fab6634ec8420f0c3c7..b1f669d3f1c80f8edb3dea8b07099abbd9e155fe 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 98cd637d14e8e81c328d003acbc38e79d0a21771..e3a85cd272f2fc7b2dc732ebf3800aa8b1324d59 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 076e1af8a7ca18b8be3f892ce614c8fddff5359a..23c37efd4115d060b982ee2ff88f7ac337f30103 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index c4f4fed47300b68638641d71f7091463a5cd60e5..4ff04ea5152f5a28e2fdf6ca8065bf25035f226f 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index c63ca5951c4315bf79e6bc6b57acb16675500175..5ee8e130d804a938daba05a74aa23b3dd78c6407 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 5606ddc4a37d209dda18413257a3105ee44f996d..85f55ebcafa0547d2669969b60741dfc4681f822 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 254c0a4f04cd38c763ce3d7e3c878b1fecff1317..2ff0f04be018ca3c9c0bb385930683f2d4dc8c6e 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 5278005e71c5f947edfb8d3295a0ca274322eaee..5d74bbc0a8d314287e22615f3ae7debdd1927a7c 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
diff --git a/SystemConfiguration.fproj/VLANConfiguration.c b/SystemConfiguration.fproj/VLANConfiguration.c
new file mode 100644 (file)
index 0000000..7072892
--- /dev/null
@@ -0,0 +1,1573 @@
+/*
+ * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ * 
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+
+/*
+ * Modification History
+ *
+ * November 14, 2003           Allan Nathanson <ajn@apple.com>
+ * - initial revision
+ */
+
+
+#include <CoreFoundation/CoreFoundation.h>
+#include <CoreFoundation/CFRuntime.h>
+
+#include <SystemConfiguration/SystemConfiguration.h>
+#include <SystemConfiguration/SCValidation.h>
+#include <SystemConfiguration/SCPrivate.h>
+
+#include <ifaddrs.h>
+#include <pthread.h>
+#include <sys/types.h>
+#define        KERNEL_PRIVATE
+#include <sys/ioctl.h>
+#undef KERNEL_PRIVATE
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+#include <net/ethernet.h>
+#define        KERNEL_PRIVATE  1
+#include <net/if.h>
+#include <net/if_var.h>
+#undef KERNEL_PRIVATE
+#include <net/if_vlan_var.h>
+#include <net/if_types.h>
+#include <net/route.h>
+
+#include <SystemConfiguration/VLANConfiguration.h>
+#include <SystemConfiguration/VLANConfigurationPrivate.h>
+
+/* ---------- VLAN support ---------- */
+
+static int
+inet_dgram_socket()
+{
+       int     s;
+
+       s = socket(AF_INET, SOCK_DGRAM, 0);
+       if (s == -1) {
+               SCLog(TRUE, LOG_ERR, CFSTR("socket() failed: %s"), strerror(errno));
+               _SCErrorSet(kSCStatusFailed);
+       }
+
+       return s;
+}
+
+
+static Boolean
+_VLAN_create(int s, CFStringRef interface)
+{
+#ifdef SIOCIFCREATE
+       struct ifreq    ifr;
+
+       bzero(&ifr, sizeof(ifr));
+       (void) _SC_cfstring_to_cstring(interface,
+                                      ifr.ifr_name,
+                                      sizeof(ifr.ifr_name),
+                                      kCFStringEncodingASCII);
+
+       if (ioctl(s, SIOCIFCREATE, &ifr) == -1) {
+               SCLog(TRUE, LOG_ERR, CFSTR("ioctl(SIOCIFCREATE) failed: %s"), strerror(errno));
+               _SCErrorSet(kSCStatusFailed);
+               return FALSE;
+       }
+
+       return TRUE;
+#else  /* SIOCIFCREATE */
+       return FALSE;
+#endif /* SIOCIFCREATE */
+}
+
+
+static Boolean
+_VLAN_destroy(int s, CFStringRef interface)
+{
+#ifdef SIOCIFDESTROY
+       struct ifreq    ifr;
+
+       bzero(&ifr, sizeof(ifr));
+       (void) _SC_cfstring_to_cstring(interface,
+                                      ifr.ifr_name,
+                                      sizeof(ifr.ifr_name),
+                                      kCFStringEncodingASCII);
+
+       if (ioctl(s, SIOCIFDESTROY, &ifr) == -1) {
+               SCLog(TRUE, LOG_ERR, CFSTR("ioctl(SIOCIFDESTROY) failed: %s"), strerror(errno));
+               _SCErrorSet(kSCStatusFailed);
+               return FALSE;
+       }
+
+       return TRUE;
+#else  /* SIOCIFDESTROY */
+       return FALSE;
+#endif /* SIOCIFDESTROY */
+}
+
+
+static Boolean
+_VLANDevice_set(int s, CFStringRef interface, CFStringRef device, CFNumberRef tag)
+{
+#ifdef SIOCSETVLAN
+       struct ifreq    ifr;
+       int             tag_val;
+       struct vlanreq  vreq;
+
+       bzero(&ifr, sizeof(ifr));
+       bzero(&vreq, sizeof(vreq));
+
+       // interface
+       (void) _SC_cfstring_to_cstring(interface,
+                                      ifr.ifr_name,
+                                      sizeof(ifr.ifr_name),
+                                      kCFStringEncodingASCII);
+       ifr.ifr_data = (caddr_t)&vreq;
+
+       // parent device
+       (void) _SC_cfstring_to_cstring(device,
+                                      vreq.vlr_parent,
+                                      sizeof(vreq.vlr_parent),
+                                      kCFStringEncodingASCII);
+
+       // tag
+       CFNumberGetValue(tag, kCFNumberIntType, &tag_val);
+       vreq.vlr_tag = tag_val;
+
+       // update parent device and tag
+       if (ioctl(s, SIOCSETVLAN, (caddr_t)&ifr) == -1) {
+               SCLog(TRUE, LOG_ERR, CFSTR("ioctl(SIOCSETVLAN) failed: %s"), strerror(errno));
+               _SCErrorSet(kSCStatusFailed);
+               return FALSE;
+       }
+
+       return TRUE;
+#else  /* SIOCSETVLAN */
+       return FALSE;
+#endif /* SIOCSETVLAN */
+}
+
+
+static Boolean
+_VLANDevice_unset(int s, CFStringRef interface)
+{
+#ifdef SIOCSETVLAN
+       struct ifreq    ifr;
+       struct vlanreq  vreq;
+
+       bzero(&ifr, sizeof(ifr));
+       bzero(&vreq, sizeof(vreq));
+
+       // interface
+       (void) _SC_cfstring_to_cstring(interface,
+                                      ifr.ifr_name,
+                                      sizeof(ifr.ifr_name),
+                                      kCFStringEncodingASCII);
+       ifr.ifr_data = (caddr_t)&vreq;
+
+       // clear parent device
+       bzero(&vreq.vlr_parent, sizeof(vreq.vlr_parent));
+
+       // clear tag
+       vreq.vlr_tag = 0;
+
+       // update parent device and tag
+       if (ioctl(s, SIOCSETVLAN, (caddr_t)&ifr) == -1) {
+               SCLog(TRUE, LOG_ERR, CFSTR("ioctl(SIOCSETVLAN) failed: %s"), strerror(errno));
+               _SCErrorSet(kSCStatusFailed);
+               return FALSE;
+       }
+
+       return TRUE;
+#else  /* SIOCSETVLAN */
+       return FALSE;
+#endif /* SIOCSETVLAN */
+}
+
+
+/* ---------- VLAN "device" ---------- */
+
+Boolean
+IsVLANSupported(CFStringRef device)
+{
+       char *                  buf     = NULL;
+       size_t                  buf_len = 0;
+       struct if_msghdr *      ifm;
+       char *                  if_name = NULL;
+       unsigned int            if_index;
+       Boolean                 isVlan  = FALSE;
+       int                     mib[6];
+
+       /* get the interface index */
+
+       if_name = _SC_cfstring_to_cstring(device, NULL, NULL, kCFStringEncodingASCII);
+       if (if_name == NULL) {
+               return FALSE;   // if conversion error
+       }
+       if_index = if_nametoindex(if_name);
+       if (if_index == 0) {
+               goto done;      // if unknown interface
+       }
+
+       /* get information for the specified device */
+
+       mib[0] = CTL_NET;
+       mib[1] = PF_ROUTE;
+       mib[2] = 0;
+       mib[3] = AF_LINK;
+       mib[4] = NET_RT_IFLIST;
+       mib[5] = if_index;      /* ask for exactly one interface */
+
+       if (sysctl(mib, 6, NULL, &buf_len, NULL, 0) < 0) {
+               SCLog(TRUE, LOG_ERR, CFSTR("sysctl() size failed: %s"), strerror(errno));
+               goto done;
+       }
+       buf = CFAllocatorAllocate(NULL, buf_len, 0);
+       if (sysctl(mib, 6, buf, &buf_len, NULL, 0) < 0) {
+               SCLog(TRUE, LOG_ERR, CFSTR("sysctl() failed: %s"), strerror(errno));
+               goto done;
+       }
+
+       /* check the link type and hwassist flags */
+
+       ifm = (struct if_msghdr *)buf;
+       switch (ifm->ifm_type) {
+               case RTM_IFINFO : {
+#if    defined(IF_HWASSIST_VLAN_TAGGING) && defined(IF_HWASSIST_VLAN_MTU)
+                       struct if_data  *if_data = &ifm->ifm_data;
+
+                       if (if_data->ifi_hwassist & (IF_HWASSIST_VLAN_TAGGING | IF_HWASSIST_VLAN_MTU)) {
+                               isVlan = TRUE;
+                       }
+#endif
+                       break;
+               }
+       }
+
+    done :
+
+       if (if_name != NULL)    CFAllocatorDeallocate(NULL, if_name);
+       if (buf != NULL)        CFAllocatorDeallocate(NULL, buf);
+
+       return isVlan;
+}
+
+/* ---------- VLANInterface ---------- */
+
+typedef struct {
+
+       /* base CFType information */
+       CFRuntimeBase                   cfBase;
+
+       /* vlan interface configuration */
+       CFStringRef                     ifname;         // e.g. vlan0, vlan1, ...
+       CFStringRef                     device;         // e.g. en0, en1, ...
+       CFNumberRef                     tag;            // e.g. 1 <= tag <= 4094
+       CFDictionaryRef                 options;        // e.g. UserDefinedName
+
+} VLANInterfacePrivate, * VLANInterfacePrivateRef;
+
+
+static CFStringRef     __VLANInterfaceCopyDescription  (CFTypeRef cf);
+static void            __VLANInterfaceDeallocate       (CFTypeRef cf);
+static Boolean         __VLANInterfaceEqual            (CFTypeRef cf1, CFTypeRef cf2);
+
+
+static const CFRuntimeClass __VLANInterfaceClass = {
+       0,                                      // version
+       "VLANInterface",                        // className
+       NULL,                                   // init
+       NULL,                                   // copy
+       __VLANInterfaceDeallocate,              // dealloc
+       __VLANInterfaceEqual,                   // equal
+       NULL,                                   // hash
+       NULL,                                   // copyFormattingDesc
+       __VLANInterfaceCopyDescription          // copyDebugDesc
+};
+
+
+static CFTypeID                __kVLANInterfaceTypeID  = _kCFRuntimeNotATypeID;
+
+
+static pthread_once_t  vlanInterface_init      = PTHREAD_ONCE_INIT;
+
+
+static CFStringRef
+__VLANInterfaceCopyDescription(CFTypeRef cf)
+{
+       CFAllocatorRef          allocator       = CFGetAllocator(cf);
+       CFMutableStringRef      result;
+       VLANInterfacePrivateRef vlanPrivate     = (VLANInterfacePrivateRef)cf;
+
+       result = CFStringCreateMutable(allocator, 0);
+       CFStringAppendFormat(result, NULL, CFSTR("<VLANInterface %p [%p]> {"), cf, allocator);
+       CFStringAppendFormat(result, NULL, CFSTR(" if = %@"), vlanPrivate->ifname);
+       CFStringAppendFormat(result, NULL, CFSTR(", device = %@"), vlanPrivate->device);
+       CFStringAppendFormat(result, NULL, CFSTR(", tag = %@"), vlanPrivate->tag);
+       if (vlanPrivate->options != NULL) {
+               CFStringAppendFormat(result, NULL, CFSTR(", options = %@"), vlanPrivate->options);
+       }
+       CFStringAppendFormat(result, NULL, CFSTR(" }"));
+
+       return result;
+}
+
+
+static void
+__VLANInterfaceDeallocate(CFTypeRef cf)
+{
+       VLANInterfacePrivateRef vlanPrivate     = (VLANInterfacePrivateRef)cf;
+
+       SCLog(_sc_verbose, LOG_DEBUG, CFSTR("__VLANInterfaceDeallocate:"));
+
+       /* release resources */
+
+       CFRelease(vlanPrivate->ifname);
+       CFRelease(vlanPrivate->device);
+       CFRelease(vlanPrivate->tag);
+       if (vlanPrivate->options)       CFRelease(vlanPrivate->options);
+
+       return;
+}
+
+
+static Boolean
+__VLANInterfaceEquiv(CFTypeRef cf1, CFTypeRef cf2)
+{
+       VLANInterfacePrivateRef vlan1   = (VLANInterfacePrivateRef)cf1;
+       VLANInterfacePrivateRef vlan2   = (VLANInterfacePrivateRef)cf2;
+
+       if (vlan1 == vlan2)
+               return TRUE;
+
+       if (!CFEqual(vlan1->ifname, vlan2->ifname))
+               return FALSE;   // if not the same interface
+
+       if (!CFEqual(vlan1->device, vlan2->device))
+               return FALSE;   // if not the same device
+
+       if (!CFEqual(vlan1->tag, vlan2->tag))
+               return FALSE;   // if not the same tag
+
+       return TRUE;
+}
+
+
+static Boolean
+__VLANInterfaceEqual(CFTypeRef cf1, CFTypeRef cf2)
+{
+       VLANInterfacePrivateRef vlan1   = (VLANInterfacePrivateRef)cf1;
+       VLANInterfacePrivateRef vlan2   = (VLANInterfacePrivateRef)cf2;
+
+       if (!__VLANInterfaceEquiv(vlan1, vlan2))
+               return FALSE;   // if not the same VLAN interface/device/tag
+
+       if (vlan1->options != vlan2->options) {
+               // if the options may differ
+               if ((vlan1->options != NULL) && (vlan2->options != NULL)) {
+                       // if both VLANs have options
+                       if (!CFEqual(vlan1->options, vlan2->options)) {
+                               // if the options are not equal
+                               return FALSE;
+                       }
+               } else {
+                       // if only one VLAN has options
+                       return FALSE;
+               }
+       }
+
+       return TRUE;
+}
+
+
+static void
+__VLANInterfaceInitialize(void)
+{
+       __kVLANInterfaceTypeID = _CFRuntimeRegisterClass(&__VLANInterfaceClass);
+       return;
+}
+
+
+static __inline__ CFTypeRef
+isA_VLANInterface(CFTypeRef obj)
+{
+       return (isA_CFType(obj, VLANInterfaceGetTypeID()));
+}
+
+
+CFTypeID
+VLANInterfaceGetTypeID(void)
+{
+       pthread_once(&vlanInterface_init, __VLANInterfaceInitialize);   /* initialize runtime */
+       return __kVLANInterfaceTypeID;
+}
+
+
+static VLANInterfaceRef
+__VLANInterfaceCreatePrivate(CFAllocatorRef    allocator,
+                            CFStringRef        ifname,
+                            CFStringRef        device,
+                            CFNumberRef        tag,
+                            CFDictionaryRef    options)
+{
+       VLANInterfacePrivateRef         vlanPrivate;
+       uint32_t                        size;
+
+       SCLog(_sc_verbose, LOG_DEBUG, CFSTR("__VLANInterfaceCreatePrivate:"));
+
+       /* initialize runtime */
+       pthread_once(&vlanInterface_init, __VLANInterfaceInitialize);
+
+       /* allocate vlan */
+       size        = sizeof(VLANInterfacePrivate) - sizeof(CFRuntimeBase);
+       vlanPrivate = (VLANInterfacePrivateRef)_CFRuntimeCreateInstance(allocator,
+                                                                       __kVLANInterfaceTypeID,
+                                                                       size,
+                                                                       NULL);
+       if (!vlanPrivate) {
+               return NULL;
+       }
+
+       /* establish the vlan */
+
+       vlanPrivate->ifname  = CFStringCreateCopy(allocator, ifname);
+       vlanPrivate->device  = CFStringCreateCopy(allocator, device);
+       vlanPrivate->tag     = CFRetain(tag);
+       if (options != NULL) {
+               vlanPrivate->options = CFDictionaryCreateCopy(allocator, options);
+       } else {
+               vlanPrivate->options = NULL;
+       }
+
+       return (VLANInterfaceRef)vlanPrivate;
+}
+
+
+CFStringRef
+VLANInterfaceGetInterface(VLANInterfaceRef vlan)
+{
+       VLANInterfacePrivateRef vlanPrivate     = (VLANInterfacePrivateRef)vlan;
+       CFStringRef             vlan_if         = NULL;
+
+       if (isA_VLANInterface(vlan)) {
+               vlan_if = vlanPrivate->ifname;
+       }
+
+       return vlan_if;
+}
+
+
+CFStringRef
+VLANInterfaceGetDevice(VLANInterfaceRef        vlan)
+{
+       VLANInterfacePrivateRef vlanPrivate     = (VLANInterfacePrivateRef)vlan;
+       CFStringRef             vlan_device     = NULL;
+
+       if (isA_VLANInterface(vlan)) {
+               vlan_device = vlanPrivate->device;
+       }
+
+       return vlan_device;
+}
+
+
+static void
+VLANInterfaceSetDevice(VLANInterfaceRef        vlan, CFStringRef newDevice)
+{
+       VLANInterfacePrivateRef vlanPrivate     = (VLANInterfacePrivateRef)vlan;
+
+       if (isA_VLANInterface(vlan)) {
+               CFAllocatorRef  allocator       = CFGetAllocator(vlan);
+
+               CFRelease(vlanPrivate->device);
+               vlanPrivate->device = CFStringCreateCopy(allocator, newDevice);
+       }
+
+       return;
+}
+
+
+CFNumberRef
+VLANInterfaceGetTag(VLANInterfaceRef vlan)
+{
+       VLANInterfacePrivateRef vlanPrivate     = (VLANInterfacePrivateRef)vlan;
+       CFNumberRef             vlan_tag        = NULL;
+
+       if (isA_VLANInterface(vlan)) {
+               vlan_tag = vlanPrivate->tag;
+       }
+
+       return vlan_tag;
+}
+
+
+static void
+VLANInterfaceSetTag(VLANInterfaceRef vlan, CFNumberRef newTag)
+{
+       VLANInterfacePrivateRef vlanPrivate     = (VLANInterfacePrivateRef)vlan;
+
+       if (isA_VLANInterface(vlan)) {
+               CFRelease(vlanPrivate->tag);
+               vlanPrivate->tag = CFRetain(newTag);
+       }
+
+       return;
+}
+
+
+CFDictionaryRef
+VLANInterfaceGetOptions(VLANInterfaceRef vlan)
+{
+       VLANInterfacePrivateRef vlanPrivate     = (VLANInterfacePrivateRef)vlan;
+       CFDictionaryRef         vlan_options    = NULL;
+
+       if (isA_VLANInterface(vlan)) {
+               vlan_options = vlanPrivate->options;
+       }
+
+       return vlan_options;
+}
+
+
+static void
+VLANInterfaceSetOptions(VLANInterfaceRef vlan, CFDictionaryRef newOptions)
+{
+       VLANInterfacePrivateRef vlanPrivate     = (VLANInterfacePrivateRef)vlan;
+
+       if (isA_VLANInterface(vlan)) {
+               CFAllocatorRef  allocator       = CFGetAllocator(vlan);
+
+               if (vlanPrivate->options)       CFRelease(vlanPrivate->options);
+               if (newOptions != NULL) {
+                       vlanPrivate->options = CFDictionaryCreateCopy(allocator, newOptions);
+               } else {
+                       vlanPrivate->options = NULL;
+               }
+       }
+
+       return;
+}
+
+
+/* ---------- VLANPreferences ---------- */
+
+#define        VLAN_PREFERENCES_VLANS          CFSTR("VLANs")
+
+#define        __kVLANInterface_interface      CFSTR("interface")      // e.g. vlan0, vlan1, ...
+#define        __kVLANInterface_device         CFSTR("device")         // e.g. en0, en1, ...
+#define __kVLANInterface_tag           CFSTR("tag")            // e.g. 1 <= tag <= 4094
+#define __kVLANInterface_options       CFSTR("options")        // e.g. UserDefinedName
+
+typedef struct {
+
+       /* base CFType information */
+       CFRuntimeBase                   cfBase;
+
+       /* lock */
+       pthread_mutex_t                 lock;
+
+       /* underlying preferences */
+       SCPreferencesRef                prefs;
+
+       /* base VLANs (before any commits) */
+       CFArrayRef                      vlBase;
+
+} VLANPreferencesPrivate, * VLANPreferencesPrivateRef;
+
+
+static CFStringRef     __VLANPreferencesCopyDescription        (CFTypeRef cf);
+static void            __VLANPreferencesDeallocate             (CFTypeRef cf);
+
+
+static const CFRuntimeClass __VLANPreferencesClass = {
+       0,                                      // version
+       "VLANPreferences",                      // className
+       NULL,                                   // init
+       NULL,                                   // copy
+       __VLANPreferencesDeallocate,            // dealloc
+       NULL,                                   // equal
+       NULL,                                   // hash
+       NULL,                                   // copyFormattingDesc
+       __VLANPreferencesCopyDescription        // copyDebugDesc
+};
+
+
+static CFTypeID                __kVLANPreferencesTypeID        = _kCFRuntimeNotATypeID;
+
+
+static pthread_once_t  vlanPreferences_init            = PTHREAD_ONCE_INIT;
+
+
+static CFStringRef
+__VLANPreferencesCopyDescription(CFTypeRef cf)
+{
+       CFAllocatorRef                  allocator       = CFGetAllocator(cf);
+       CFIndex                         i;
+       CFArrayRef                      keys;
+       CFIndex                         n;
+       VLANPreferencesPrivateRef       prefsPrivate    = (VLANPreferencesPrivateRef)cf;
+       CFMutableStringRef              result;
+
+       result = CFStringCreateMutable(allocator, 0);
+       CFStringAppendFormat(result, NULL, CFSTR("<VLANPreferences %p [%p]> {"), cf, allocator);
+
+       keys = SCPreferencesCopyKeyList(prefsPrivate->prefs);
+       n = CFArrayGetCount(keys);
+       for (i = 0; i < n; i++) {
+               CFStringRef             key;
+               CFPropertyListRef       val;
+
+               key = CFArrayGetValueAtIndex(keys, i);
+               val = SCPreferencesGetValue(prefsPrivate->prefs, key);
+
+               CFStringAppendFormat(result, NULL, CFSTR("%@ : %@"), key, val);
+       }
+       CFRelease(keys);
+
+       CFStringAppendFormat(result, NULL, CFSTR(" }"));
+
+       return result;
+}
+
+
+#define N_QUICK        8
+
+
+static void
+__VLANPreferencesDeallocate(CFTypeRef cf)
+{
+       VLANPreferencesPrivateRef       prefsPrivate    = (VLANPreferencesPrivateRef)cf;
+
+       SCLog(_sc_verbose, LOG_DEBUG, CFSTR("__VLANPreferencesDeallocate:"));
+
+       /* release resources */
+
+       pthread_mutex_destroy(&prefsPrivate->lock);
+
+       if (prefsPrivate->prefs)        CFRelease(prefsPrivate->prefs);
+       if (prefsPrivate->vlBase)       CFRelease(prefsPrivate->vlBase);
+
+       return;
+}
+
+
+static void
+__VLANPreferencesInitialize(void)
+{
+       __kVLANPreferencesTypeID = _CFRuntimeRegisterClass(&__VLANPreferencesClass);
+       return;
+}
+
+
+static __inline__ CFTypeRef
+isA_VLANPreferences(CFTypeRef obj)
+{
+       return (isA_CFType(obj, VLANPreferencesGetTypeID()));
+}
+
+
+CFArrayRef
+_VLANPreferencesCopyActiveInterfaces()
+{
+       CFArrayCallBacks        callbacks;
+       struct ifaddrs          *ifap;
+       struct ifaddrs          *ifp;
+       int                     s;
+       CFMutableArrayRef       vlans   = NULL;
+
+       if (getifaddrs(&ifap) == -1) {
+               SCLog(TRUE, LOG_ERR, CFSTR("getifaddrs() failed: %s"), strerror(errno));
+               _SCErrorSet(kSCStatusFailed);
+               return NULL;
+       }
+
+       s = inet_dgram_socket();
+       if (s == -1) {
+               SCLog(TRUE, LOG_ERR, CFSTR("socket() failed: %s"), strerror(errno));
+               _SCErrorSet(kSCStatusFailed);
+               goto done;
+       }
+
+       callbacks = kCFTypeArrayCallBacks;
+       callbacks.equal = __VLANInterfaceEquiv;
+       vlans = CFArrayCreateMutable(NULL, 0, &callbacks);
+
+       for (ifp = ifap; ifp != NULL; ifp = ifp->ifa_next) {
+               switch (ifp->ifa_addr->sa_family) {
+                       case AF_LINK : {
+                               CFStringRef             device;
+                               struct if_data          *if_data;
+                               struct ifreq            ifr;
+                               CFNumberRef             tag;
+                               VLANInterfaceRef        vlan;
+                               CFStringRef             vlan_if;
+                               char                    vlr_parent[IFNAMSIZ+1];
+                               int                     vlr_tag;
+                               struct vlanreq          vreq;
+
+                               if_data = (struct if_data *)ifp->ifa_data;
+                               if (if_data == NULL) {
+                                       break;  // if no interface data
+                               }
+
+                               if (if_data->ifi_type != IFT_L2VLAN) {
+                                       break;  // if not VLAN
+                               }
+
+                               bzero(&ifr, sizeof(ifr));
+                               bzero(&vreq, sizeof(vreq));
+                               strncpy(ifr.ifr_name, ifp->ifa_name, sizeof(ifr.ifr_name));
+                               ifr.ifr_data = (caddr_t)&vreq;
+
+                               if (ioctl(s, SIOCGETVLAN, (caddr_t)&ifr) == -1) {
+                                       SCLog(TRUE, LOG_ERR, CFSTR("ioctl() failed: %s"), strerror(errno));
+                                       _SCErrorSet(kSCStatusFailed);
+                                       CFRelease(vlans);
+                                       goto done;
+                               }
+                               vlr_tag = vreq.vlr_tag;
+                               strlcpy(vlr_parent, vreq.vlr_parent, sizeof(vlr_parent));
+
+                               vlan_if = CFStringCreateWithCString(NULL, ifp->ifa_name, kCFStringEncodingASCII);
+                               device  = CFStringCreateWithCString(NULL, vlr_parent, kCFStringEncodingASCII);
+                               tag     = CFNumberCreate(NULL, kCFNumberIntType, &vlr_tag);
+                               vlan    = __VLANInterfaceCreatePrivate(NULL, vlan_if, device, tag, NULL);
+                               CFArrayAppendValue(vlans, vlan);
+                               CFRelease(vlan_if);
+                               CFRelease(device);
+                               CFRelease(tag);
+                               CFRelease(vlan);
+                               break;
+                       }
+
+                       default :
+                               break;
+               }
+       }
+
+    done :
+
+       (void) close(s);
+       freeifaddrs(ifap);
+       return vlans;
+}
+
+
+static CFIndex
+findVLAN(CFArrayRef vlans, CFStringRef device, CFNumberRef tag)
+{
+       CFIndex found   = kCFNotFound;
+       CFIndex i;
+       CFIndex n;
+
+       n = isA_CFArray(vlans) ? CFArrayGetCount(vlans) : 0;
+       for (i = 0; i < n; i++) {
+               CFDictionaryRef vlan_dict;
+               CFStringRef     vlan_device;
+               CFStringRef     vlan_if;
+               CFNumberRef     vlan_tag;
+
+               vlan_dict = CFArrayGetValueAtIndex(vlans, i);
+               if (!isA_CFDictionary(vlan_dict)) {
+                       continue;       // if the prefs are confused
+               }
+
+               vlan_if = CFDictionaryGetValue(vlan_dict, __kVLANInterface_interface);
+               if (!isA_CFString(vlan_if)) {
+                       continue;       // if the prefs are confused
+               }
+
+               vlan_device = CFDictionaryGetValue(vlan_dict, __kVLANInterface_device);
+               if (isA_CFString(vlan_device)) {
+                       if (!CFEqual(device, vlan_device)) {
+                               continue;       // if not a match
+                       }
+               }
+
+               vlan_tag = CFDictionaryGetValue(vlan_dict, __kVLANInterface_tag);
+               if (isA_CFNumber(vlan_tag)) {
+                       if (!CFEqual(tag, vlan_tag)) {
+                               continue;       // if not a match
+                       }
+               }
+
+               // if we have found a match
+               found = i;
+               break;
+       }
+
+       return found;
+}
+
+
+static void
+setConfigurationChanged(VLANPreferencesRef prefs)
+{
+       VLANPreferencesPrivateRef       prefsPrivate    = (VLANPreferencesPrivateRef)prefs;
+
+       /*
+        * to facilitate device configuration we will take
+        * a snapshot of the VLAN preferences before any
+        * changes are made.  Then, when the changes are
+        * applied we can compare what we had to what we
+        * want and configured the system accordingly.
+        */
+       if (prefsPrivate->vlBase == NULL) {
+               prefsPrivate->vlBase = VLANPreferencesCopyInterfaces(prefs);
+       }
+
+       return;
+}
+
+
+CFTypeID
+VLANPreferencesGetTypeID(void)
+{
+       pthread_once(&vlanPreferences_init, __VLANPreferencesInitialize);       /* initialize runtime */
+       return __kVLANPreferencesTypeID;
+}
+
+
+VLANPreferencesRef
+VLANPreferencesCreate(CFAllocatorRef allocator)
+{
+       CFBundleRef                     bundle;
+       CFStringRef                     bundleID        = NULL;
+       CFStringRef                     name            = CFSTR("VLANConfiguration");
+       VLANPreferencesPrivateRef       prefsPrivate;
+       uint32_t                        size;
+
+       SCLog(_sc_verbose, LOG_DEBUG, CFSTR("__VLANPreferencesCreate:"));
+
+       /* initialize runtime */
+       pthread_once(&vlanPreferences_init, __VLANPreferencesInitialize);
+
+       /* allocate preferences */
+       size         = sizeof(VLANPreferencesPrivate) - sizeof(CFRuntimeBase);
+       prefsPrivate = (VLANPreferencesPrivateRef)_CFRuntimeCreateInstance(allocator,
+                                                                          __kVLANPreferencesTypeID,
+                                                                          size,
+                                                                          NULL);
+       if (!prefsPrivate) {
+               return NULL;
+       }
+
+       /* establish the prefs */
+
+       pthread_mutex_init(&prefsPrivate->lock, NULL);
+
+       bundle = CFBundleGetMainBundle();
+       if (bundle) {
+               bundleID = CFBundleGetIdentifier(bundle);
+               if (bundleID) {
+                       CFRetain(bundleID);
+               } else {
+                       CFURLRef        url;
+
+                       url = CFBundleCopyExecutableURL(bundle);
+                       if (url) {
+                               bundleID = CFURLCopyPath(url);
+                               CFRelease(url);
+                       }
+               }
+       }
+
+       if (bundleID) {
+               CFStringRef     fullName;
+
+               if (CFEqual(bundleID, CFSTR("/"))) {
+                       CFRelease(bundleID);
+                       bundleID = CFStringCreateWithFormat(allocator, NULL, CFSTR("(%d)"), getpid());
+               }
+
+               fullName = CFStringCreateWithFormat(allocator, NULL, CFSTR("%@:%@"), bundleID, name);
+               name = fullName;
+               CFRelease(bundleID);
+       } else {
+               CFRetain(name);
+       }
+
+       prefsPrivate->prefs = SCPreferencesCreate(allocator, name, VLAN_PREFERENCES_ID);
+       CFRelease(name);
+
+       prefsPrivate->vlBase = NULL;
+
+       return (VLANPreferencesRef)prefsPrivate;
+}
+
+
+CFArrayRef
+VLANPreferencesCopyInterfaces(VLANPreferencesRef prefs)
+{
+       CFAllocatorRef                  allocator;
+       CFArrayCallBacks                callbacks;
+       CFIndex                         i;
+       CFIndex                         n;
+       VLANPreferencesPrivateRef       prefsPrivate    = (VLANPreferencesPrivateRef)prefs;
+       CFMutableArrayRef               result;
+       CFArrayRef                      vlans;
+
+       if (!isA_VLANPreferences(prefs)) {
+               _SCErrorSet(kSCStatusInvalidArgument);
+               return NULL;
+       }
+
+       allocator = CFGetAllocator(prefs);
+       callbacks = kCFTypeArrayCallBacks;
+       callbacks.equal = __VLANInterfaceEquiv;
+       result = CFArrayCreateMutable(allocator, 0, &callbacks);
+
+       vlans = SCPreferencesGetValue(prefsPrivate->prefs, VLAN_PREFERENCES_VLANS);
+       n = isA_CFArray(vlans) ? CFArrayGetCount(vlans) : 0;
+       for (i = 0; i < n; i++) {
+               CFDictionaryRef         vlan_dict;
+               CFStringRef             device;
+               CFDictionaryRef         options;
+               CFNumberRef             tag;
+               VLANInterfaceRef        vlan;
+               CFStringRef             vlan_if;
+
+               vlan_dict = CFArrayGetValueAtIndex(vlans, i);
+               if (!isA_CFDictionary(vlan_dict)) {
+                       continue;       // if the prefs are confused
+               }
+
+               vlan_if = CFDictionaryGetValue(vlan_dict, __kVLANInterface_interface);
+               if (!isA_CFString(vlan_if)) {
+                       continue;       // if the prefs are confused
+               }
+
+
+               device = CFDictionaryGetValue(vlan_dict, __kVLANInterface_device);
+               if (!isA_CFString(device)) {
+                       continue;       // if the prefs are confused
+               }
+
+               tag = CFDictionaryGetValue(vlan_dict, __kVLANInterface_tag);
+               if (!isA_CFNumber(tag)) {
+                       continue;       // if the prefs are confused
+               }
+
+               options = CFDictionaryGetValue(vlan_dict, __kVLANInterface_options);
+               if ((options != NULL) && !isA_CFDictionary(options)) {
+                       continue;       // if the prefs are confused
+               }
+
+               vlan = __VLANInterfaceCreatePrivate(allocator, vlan_if, device, tag, options);
+               CFArrayAppendValue(result, vlan);
+               CFRelease(vlan);
+       }
+
+       return result;
+}
+
+
+VLANInterfaceRef
+VLANPreferencesAddInterface(VLANPreferencesRef prefs,
+                           CFStringRef         device,
+                           CFNumberRef         tag,
+                           CFDictionaryRef     options)
+{
+       CFArrayRef                      active_vlans;
+       CFAllocatorRef                  allocator;
+       CFArrayRef                      config_vlans;
+       CFIndex                         dup_if;
+       CFIndex                         i;
+       CFIndex                         nActive;
+       CFIndex                         nConfig;
+       VLANInterfaceRef                newVlan         = NULL;
+       VLANPreferencesPrivateRef       prefsPrivate    = (VLANPreferencesPrivateRef)prefs;
+
+       if (!isA_VLANPreferences(prefs)) {
+               _SCErrorSet(kSCStatusInvalidArgument);
+               return NULL;
+       }
+
+       if (!isA_CFString(device)) {
+               _SCErrorSet(kSCStatusInvalidArgument);
+               return NULL;
+       }
+
+       if (isA_CFNumber(tag)) {
+               int     tag_val;
+
+               CFNumberGetValue(tag, kCFNumberIntType, &tag_val);
+               if ((tag_val < 1) || (tag_val > 4094)) {
+                       _SCErrorSet(kSCStatusInvalidArgument);
+                       return NULL;
+               }
+       } else {
+               _SCErrorSet(kSCStatusInvalidArgument);
+               return NULL;
+       }
+
+       if ((options != NULL) && !isA_CFDictionary(options)) {
+               _SCErrorSet(kSCStatusInvalidArgument);
+               return NULL;
+       }
+
+       pthread_mutex_lock(&prefsPrivate->lock);
+
+       /* get "configured" VLANs (and check to ensure we are not creating a duplicate) */
+       config_vlans = SCPreferencesGetValue(prefsPrivate->prefs, VLAN_PREFERENCES_VLANS);
+       nConfig      = isA_CFArray(config_vlans) ? CFArrayGetCount(config_vlans) : 0;
+
+       dup_if = findVLAN(config_vlans, device, tag);
+       if (dup_if != kCFNotFound) {
+               // sorry, you can't add a vlan using the same device/tag */
+               _SCErrorSet(kSCStatusKeyExists);
+               goto done;
+       }
+
+       /* get "active" VLANs */
+       active_vlans = _VLANPreferencesCopyActiveInterfaces();
+       nActive      = isA_CFArray(active_vlans) ? CFArrayGetCount(active_vlans) : 0;
+
+       /* create a new vlan using an unused interface name */
+       allocator = CFGetAllocator(prefs);
+
+       for (i = 0; newVlan == NULL; i++) {
+               CFIndex                 j;
+               CFMutableDictionaryRef  newDict;
+               CFMutableArrayRef       newVlans;
+               CFStringRef             vlan_if;
+
+               vlan_if = CFStringCreateWithFormat(allocator, NULL, CFSTR("vlan%d"), i);
+
+               for (j = 0; j < nActive; j++) {
+                       CFStringRef             active_if;
+                       VLANInterfaceRef        active_vlan;
+
+                       active_vlan = CFArrayGetValueAtIndex(active_vlans, j);
+                       active_if   = VLANInterfaceGetInterface(active_vlan);
+
+                       if (CFEqual(vlan_if, active_if)) {
+                               goto next_if;   // if VLAN interface name not available
+                       }
+               }
+
+               for (j = 0; j < nConfig; j++) {
+                       CFDictionaryRef config;
+                       CFStringRef     config_if;
+
+                       config = CFArrayGetValueAtIndex(config_vlans, j);
+                       if (!isA_CFDictionary(config)) {
+                               continue;       // if the prefs are confused
+                       }
+
+                       config_if = CFDictionaryGetValue(config, __kVLANInterface_interface);
+                       if (!isA_CFString(config_if)) {
+                               continue;       // if the prefs are confused
+                       }
+
+                       if (CFEqual(vlan_if, config_if)) {
+                               goto next_if;   // if VLAN interface name not available
+                       }
+               }
+
+               /* create the vlan */
+
+               newDict = CFDictionaryCreateMutable(allocator,
+                                                   0,
+                                                   &kCFTypeDictionaryKeyCallBacks,
+                                                   &kCFTypeDictionaryValueCallBacks);
+               CFDictionaryAddValue(newDict, __kVLANInterface_interface, vlan_if);
+               CFDictionaryAddValue(newDict, __kVLANInterface_device,    device);
+               CFDictionaryAddValue(newDict, __kVLANInterface_tag,       tag);
+               if (options != NULL) {
+                       CFDictionaryAddValue(newDict, __kVLANInterface_options, options);
+               }
+
+               /* create the accessor handle to be returned */
+
+               newVlan = __VLANInterfaceCreatePrivate(allocator, vlan_if, device, tag, options);
+
+               /* save in the prefs */
+
+               if (nConfig == 0) {
+                       newVlans = CFArrayCreateMutable(allocator, 0, &kCFTypeArrayCallBacks);
+               } else {
+                       newVlans = CFArrayCreateMutableCopy(allocator, 0, config_vlans);
+               }
+               CFArrayAppendValue(newVlans, newDict);
+               CFRelease(newDict);
+
+               (void) SCPreferencesSetValue(prefsPrivate->prefs, VLAN_PREFERENCES_VLANS, newVlans);
+               CFRelease(newVlans);
+
+               /* yes, we've change the configuration */
+               setConfigurationChanged(prefs);
+
+           next_if :
+               CFRelease(vlan_if);
+       }
+
+       CFRelease(active_vlans);
+
+    done :
+
+       pthread_mutex_unlock(&prefsPrivate->lock);
+
+       return (VLANInterfaceRef) newVlan;
+}
+
+
+Boolean
+VLANPreferencesUpdateInterface(VLANPreferencesRef      prefs,
+                              VLANInterfaceRef         vlan,
+                              CFStringRef              newDevice,
+                              CFNumberRef              newTag,
+                              CFDictionaryRef          newOptions)
+{
+       CFAllocatorRef                  allocator;
+       CFIndex                         cur_if;
+       CFIndex                         dup_if;
+       CFMutableDictionaryRef          newDict;
+       CFMutableArrayRef               newVlans;
+       Boolean                         ok              = FALSE;
+       VLANPreferencesPrivateRef       prefsPrivate    = (VLANPreferencesPrivateRef)prefs;
+       CFArrayRef                      vlans;
+       CFStringRef                     vlan_if;
+
+       if (!isA_VLANPreferences(prefs)) {
+               _SCErrorSet(kSCStatusInvalidArgument);
+               return FALSE;
+       }
+
+       if (!isA_VLANInterface(vlan)) {
+               _SCErrorSet(kSCStatusInvalidArgument);
+               return FALSE;
+       }
+
+       if ((newDevice != NULL) && !isA_CFString(newDevice)) {
+               _SCErrorSet(kSCStatusInvalidArgument);
+               return FALSE;
+       }
+
+       if (newTag != NULL) {
+               if (isA_CFNumber(newTag)) {
+                       int     tag_val;
+
+                       CFNumberGetValue(newTag, kCFNumberIntType, &tag_val);
+                       if ((tag_val < 1) || (tag_val > 4094)) {
+                               _SCErrorSet(kSCStatusInvalidArgument);
+                               return FALSE;
+                       }
+               } else {
+                       _SCErrorSet(kSCStatusInvalidArgument);
+                       return FALSE;
+               }
+       }
+
+       if ((newOptions != NULL)
+           && !isA_CFDictionary(newOptions) && (newOptions != (CFDictionaryRef)kCFNull)) {
+               _SCErrorSet(kSCStatusInvalidArgument);
+               return FALSE;
+       }
+
+       pthread_mutex_lock(&prefsPrivate->lock);
+
+       vlan_if = VLANInterfaceGetInterface(vlan);
+
+       vlans = SCPreferencesGetValue(prefsPrivate->prefs, VLAN_PREFERENCES_VLANS);
+       if (!isA_CFArray(vlans)) {
+               goto done;      // if the prefs are confused
+       }
+
+       cur_if = findVLAN(vlans,
+                         VLANInterfaceGetDevice(vlan),
+                         VLANInterfaceGetTag   (vlan));
+       if (cur_if == kCFNotFound) {
+               _SCErrorSet(kSCStatusNoKey);
+               goto done;
+       }
+
+       dup_if = findVLAN(vlans,
+                         newDevice != NULL ? newDevice : VLANInterfaceGetDevice(vlan),
+                         newTag    != NULL ? newTag    : VLANInterfaceGetTag   (vlan));
+       if (dup_if != kCFNotFound) {
+               // if the same device/tag has already been defined
+               if (cur_if != dup_if) {
+                       /*
+                        * sorry, you can't update another vlan that is using
+                        * the same device/tag
+                        */
+                       _SCErrorSet(kSCStatusKeyExists);
+                       goto done;
+               }
+       }
+
+       /* update the vlan */
+
+       if (newDevice != NULL) {
+               VLANInterfaceSetDevice(vlan, newDevice);
+       } else {
+               newDevice = VLANInterfaceGetDevice(vlan);
+       }
+
+       if (newTag != NULL) {
+               VLANInterfaceSetTag(vlan, newTag);
+       } else {
+               newTag = VLANInterfaceGetTag(vlan);
+       }
+
+       if (newOptions != NULL) {
+               if (newOptions != (CFDictionaryRef)kCFNull) {
+                       VLANInterfaceSetOptions(vlan, newOptions);
+               } else {
+                       VLANInterfaceSetOptions(vlan, NULL);
+                       newOptions = NULL;
+               }
+       } else {
+               newOptions = VLANInterfaceGetOptions(vlan);
+       }
+
+       /* update the prefs */
+
+       allocator = CFGetAllocator(prefs);
+       newDict = CFDictionaryCreateMutable(allocator,
+                                           0,
+                                           &kCFTypeDictionaryKeyCallBacks,
+                                           &kCFTypeDictionaryValueCallBacks);
+       CFDictionaryAddValue(newDict, __kVLANInterface_interface, vlan_if);
+       CFDictionaryAddValue(newDict, __kVLANInterface_device,    newDevice);
+       CFDictionaryAddValue(newDict, __kVLANInterface_tag,       newTag);
+       if (newOptions != NULL) {
+               CFDictionaryAddValue(newDict, __kVLANInterface_options, newOptions);
+       }
+
+       /* update the prefs */
+
+       newVlans = CFArrayCreateMutableCopy(allocator, 0, vlans);
+       CFArrayRemoveValueAtIndex(newVlans, cur_if);
+       CFArrayAppendValue(newVlans, newDict);
+       CFRelease(newDict);
+
+       (void) SCPreferencesSetValue(prefsPrivate->prefs, VLAN_PREFERENCES_VLANS, newVlans);
+       CFRelease(newVlans);
+
+       /* yes, we've change the configuration */
+       setConfigurationChanged(prefs);
+
+       ok = TRUE;
+
+    done :
+
+       pthread_mutex_unlock(&prefsPrivate->lock);
+
+       return ok;
+}
+
+
+Boolean
+VLANPreferencesRemoveInterface(VLANPreferencesRef      prefs,
+                              VLANInterfaceRef         vlan)
+{
+       CFAllocatorRef                  allocator;
+       CFIndex                         cur_if;
+       CFMutableArrayRef               newVlans;
+       Boolean                         ok              = FALSE;
+       VLANPreferencesPrivateRef       prefsPrivate    = (VLANPreferencesPrivateRef)prefs;
+       CFArrayRef                      vlans;
+
+       if (!isA_VLANPreferences(prefs)) {
+               _SCErrorSet(kSCStatusInvalidArgument);
+               return FALSE;
+       }
+
+       if (!isA_VLANInterface(vlan)) {
+               _SCErrorSet(kSCStatusInvalidArgument);
+               return FALSE;
+       }
+
+       pthread_mutex_lock(&prefsPrivate->lock);
+
+       vlans = SCPreferencesGetValue(prefsPrivate->prefs, VLAN_PREFERENCES_VLANS);
+       if (!isA_CFArray(vlans)) {
+               _SCErrorSet(kSCStatusNoKey);
+               goto done;      // if the prefs are confused
+       }
+
+       cur_if = findVLAN(vlans,
+                         VLANInterfaceGetDevice(vlan),
+                         VLANInterfaceGetTag   (vlan));
+       if (cur_if == kCFNotFound) {
+               _SCErrorSet(kSCStatusNoKey);
+               goto done;
+       }
+
+       /* remove the vlan */
+
+       allocator = CFGetAllocator(prefs);
+       newVlans = CFArrayCreateMutableCopy(allocator, 0, vlans);
+       CFArrayRemoveValueAtIndex(newVlans, cur_if);
+
+       (void) SCPreferencesSetValue(prefsPrivate->prefs, VLAN_PREFERENCES_VLANS, newVlans);
+       CFRelease(newVlans);
+
+       /* yes, we've change the configuration */
+       setConfigurationChanged(prefs);
+
+       ok = TRUE;
+
+    done :
+
+       pthread_mutex_unlock(&prefsPrivate->lock);
+
+       return ok;
+}
+
+
+Boolean
+VLANPreferencesCommitChanges(VLANPreferencesRef        prefs)
+{
+       Boolean                         ok              = FALSE;
+       VLANPreferencesPrivateRef       prefsPrivate    = (VLANPreferencesPrivateRef)prefs;
+
+       if (!isA_VLANPreferences(prefs)) {
+               _SCErrorSet(kSCStatusInvalidArgument);
+               return FALSE;
+       }
+
+       ok = SCPreferencesCommitChanges(prefsPrivate->prefs);
+       if (!ok) {
+               return ok;
+       }
+
+       if (prefsPrivate->vlBase != NULL)  {
+               CFRelease(prefsPrivate->vlBase);
+               prefsPrivate->vlBase = NULL;
+       }
+
+       return TRUE;
+}
+
+
+Boolean
+_VLANPreferencesUpdateConfiguration(VLANPreferencesRef prefs)
+{
+       CFArrayRef                      active          = NULL;
+       CFArrayRef                      config          = NULL;
+       CFMutableDictionaryRef          devices         = NULL;
+       CFIndex                         i;
+       CFIndex                         nActive;
+       CFIndex                         nConfig;
+       Boolean                         ok              = FALSE;
+       VLANPreferencesPrivateRef       prefsPrivate    = (VLANPreferencesPrivateRef)prefs;
+       int                             s               = -1;
+
+       if (!isA_VLANPreferences(prefs)) {
+               _SCErrorSet(kSCStatusInvalidArgument);
+               return FALSE;
+       }
+
+       /* configured VLANs */
+       if (prefsPrivate->vlBase != NULL) {
+               /*
+                * updated VLAN preferences have not been committed
+                * so we ignore any in-progress changes and apply the
+                * saved preferences.
+                */
+               config = CFRetain(prefsPrivate->vlBase);
+       } else {
+               /*
+                * apply the saved preferences
+                */
+               config = VLANPreferencesCopyInterfaces(prefs);
+       }
+       nConfig = CFArrayGetCount(config);
+
+       /* [parent] devices */
+       devices = CFDictionaryCreateMutable(NULL,
+                                           0,
+                                           &kCFTypeDictionaryKeyCallBacks,
+                                           &kCFTypeDictionaryValueCallBacks);
+
+       /* active VLANs */
+       active  = _VLANPreferencesCopyActiveInterfaces();
+       nActive = CFArrayGetCount(active);
+
+       /* remove any no-longer-configured VLAN interfaces */
+       for (i = 0; i < nActive; i++) {
+               VLANInterfaceRef        a_vlan;
+               CFStringRef             a_vlan_if;
+               CFIndex                 j;
+               Boolean                 found   = FALSE;
+
+               a_vlan    = CFArrayGetValueAtIndex(active, i);
+               a_vlan_if = VLANInterfaceGetInterface(a_vlan);
+
+               for (j = 0; j < nConfig; j++) {
+                       VLANInterfaceRef        c_vlan;
+                       CFStringRef             c_vlan_if;
+
+                       c_vlan    = CFArrayGetValueAtIndex(config, j);
+                       c_vlan_if = VLANInterfaceGetInterface(c_vlan);
+
+                       if (CFEqual(a_vlan_if, c_vlan_if)) {
+                               found = TRUE;
+                               break;
+                       }
+               }
+
+               if (!found) {
+                       // remove VLAN interface
+                       if (s == -1) {
+                               s = inet_dgram_socket();
+                       }
+
+                       ok = _VLAN_destroy(s, a_vlan_if);
+                       if (!ok) {
+                               goto done;
+                       }
+               }
+       }
+
+       /* create (and update) configured VLAN interfaces */
+       for (i = 0; i < nConfig; i++) {
+               VLANInterfaceRef        c_vlan;
+               CFStringRef             c_vlan_device;
+               CFStringRef             c_vlan_if;
+               Boolean                 found           = FALSE;
+               CFIndex                 j;
+               CFBooleanRef            supported;
+
+               c_vlan        = CFArrayGetValueAtIndex(config, i);
+               c_vlan_device = VLANInterfaceGetDevice(c_vlan);
+               c_vlan_if     = VLANInterfaceGetInterface(c_vlan);
+
+               // determine if the [parent] device supports VLANs
+               supported = CFDictionaryGetValue(devices, c_vlan_device);
+               if (supported == NULL) {
+                       supported = IsVLANSupported(c_vlan_device) ? kCFBooleanTrue
+                                                                  : kCFBooleanFalse;
+                       CFDictionaryAddValue(devices, c_vlan_device, supported);
+               }
+
+               for (j = 0; j < nActive; j++) {
+                       VLANInterfaceRef        a_vlan;
+                       CFStringRef             a_vlan_if;
+
+                       a_vlan    = CFArrayGetValueAtIndex(active, j);
+                       a_vlan_if = VLANInterfaceGetInterface(a_vlan);
+
+                       if (CFEqual(c_vlan_if, a_vlan_if)) {
+                               if (!__VLANInterfaceEquiv(c_vlan, a_vlan)) {
+                                       // update VLAN interface;
+                                       if (s == -1) {
+                                               s = inet_dgram_socket();
+                                       }
+
+                                       if (CFBooleanGetValue(supported)) {
+                                               // if the new [parent] device supports VLANs
+                                               ok = _VLANDevice_unset(s, c_vlan_if);
+                                               if (!ok) {
+                                                       goto done;
+                                               }
+
+                                               ok = _VLANDevice_set(s,
+                                                                    c_vlan_if,
+                                                                    c_vlan_device,
+                                                                    VLANInterfaceGetTag(c_vlan));
+                                               if (!ok) {
+                                                       goto done;
+                                               }
+                                       } else {
+                                               // if the new [parent] device does not support VLANs
+                                               ok = _VLAN_destroy(s, c_vlan_if);
+                                               if (!ok) {
+                                                       goto done;
+                                               }
+                                       }
+                               }
+
+                               found = TRUE;
+                               break;
+                       }
+               }
+
+               if (!found && CFBooleanGetValue(supported)) {
+                       // if the [parent] device supports VLANs, add new interface
+                       if (s == -1) {
+                               s = inet_dgram_socket();
+                       }
+
+                       ok = _VLAN_create(s, c_vlan_if);
+                       if (!ok) {
+                               goto done;
+                       }
+
+                       ok = _VLANDevice_set(s,
+                                            c_vlan_if,
+                                            c_vlan_device,
+                                            VLANInterfaceGetTag(c_vlan));
+                       if (!ok) {
+                               goto done;
+                       }
+               }
+
+       }
+
+       ok = TRUE;
+
+    done :
+
+       if (active)     CFRelease(active);
+       if (config)     CFRelease(config);
+       if (devices)    CFRelease(devices);
+       if (s != -1)    (void) close(s);
+
+       return ok;
+}
+
+
+Boolean
+VLANPreferencesApplyChanges(VLANPreferencesRef prefs)
+{
+       Boolean                         ok              = FALSE;
+       VLANPreferencesPrivateRef       prefsPrivate    = (VLANPreferencesPrivateRef)prefs;
+
+       if (!isA_VLANPreferences(prefs)) {
+               _SCErrorSet(kSCStatusInvalidArgument);
+               return FALSE;
+       }
+
+       pthread_mutex_lock(&prefsPrivate->lock);
+
+       /* apply the preferences */
+       ok = SCPreferencesApplyChanges(prefsPrivate->prefs);
+       if (!ok) {
+               goto done;
+       }
+
+       /* apply the VLAN configuration */
+       ok = _VLANPreferencesUpdateConfiguration(prefs);
+       if (!ok) {
+               goto done;
+       }
+
+       ok = TRUE;
+
+    done :
+
+       pthread_mutex_unlock(&prefsPrivate->lock);
+
+       return ok;
+}
diff --git a/SystemConfiguration.fproj/VLANConfiguration.h b/SystemConfiguration.fproj/VLANConfiguration.h
new file mode 100644 (file)
index 0000000..bfa115e
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ * 
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+
+#ifndef _VLANCONFIGURATION_H
+#define _VLANCONFIGURATION_H
+
+
+#include <sys/cdefs.h>
+#include <CoreFoundation/CoreFoundation.h>
+
+
+typedef const struct __VLANInterface *         VLANInterfaceRef;
+
+typedef const struct __VLANPreferences *       VLANPreferencesRef;
+
+
+__BEGIN_DECLS
+
+// ----------
+
+Boolean
+IsVLANSupported                        (CFStringRef            device);        // e.g. "en0", "en1", ...
+
+// ----------
+
+CFTypeID
+VLANInterfaceGetTypeID         (void);
+
+CFStringRef
+VLANInterfaceGetInterface      (VLANInterfaceRef       vlan);  // returns "vlan0", "vlan1", ...
+
+CFStringRef
+VLANInterfaceGetDevice         (VLANInterfaceRef       vlan);  // returns "en0", "en1, ...
+
+CFNumberRef
+VLANInterfaceGetTag            (VLANInterfaceRef       vlan);  // returns 1 <= tag <= 4094
+
+CFDictionaryRef
+VLANInterfaceGetOptions                (VLANInterfaceRef       vlan);  // e.g. UserDefinedName, ...
+
+// ----------
+
+CFTypeID
+VLANPreferencesGetTypeID       (void);
+
+VLANPreferencesRef
+VLANPreferencesCreate          (CFAllocatorRef         allocator);
+
+CFArrayRef /* of VLANInterfaceRef's */
+VLANPreferencesCopyInterfaces  (VLANPreferencesRef     prefs);
+
+VLANInterfaceRef
+VLANPreferencesAddInterface    (VLANPreferencesRef     prefs,
+                                CFStringRef            device,         // e.g. "en0", "en1", ...
+                                CFNumberRef            tag,            // e.g. 1 <= tag <= 4094
+                                CFDictionaryRef        options);       // e.g. UserDefinedName, ...
+
+Boolean
+VLANPreferencesUpdateInterface (VLANPreferencesRef     prefs,
+                                VLANInterfaceRef       vlan,
+                                CFStringRef            newDevice,
+                                CFNumberRef            newTag,
+                                CFDictionaryRef        newOptions);
+
+Boolean
+VLANPreferencesRemoveInterface (VLANPreferencesRef     prefs,
+                                VLANInterfaceRef       vlan);
+
+Boolean
+VLANPreferencesCommitChanges   (VLANPreferencesRef     prefs);
+
+Boolean
+VLANPreferencesApplyChanges    (VLANPreferencesRef     prefs);
+
+// ----------
+
+__END_DECLS
+
+#endif /* _VLANCONFIGURATION_H */
diff --git a/SystemConfiguration.fproj/VLANConfigurationPrivate.h b/SystemConfiguration.fproj/VLANConfigurationPrivate.h
new file mode 100644 (file)
index 0000000..811e616
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ * 
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ * 
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ * 
+ * @APPLE_LICENSE_HEADER_END@
+ */
+
+#ifndef _VLANCONFIGURATIONPRIVATE_H
+#define _VLANCONFIGURATIONPRIVATE_H
+
+
+#include <sys/cdefs.h>
+#include <CoreFoundation/CoreFoundation.h>
+
+
+#define VLAN_PREFERENCES_ID    CFSTR("VirtualNetworkInterfaces.plist")
+
+
+__BEGIN_DECLS
+
+CFArrayRef
+_VLANPreferencesCopyActiveInterfaces   ();
+
+Boolean
+_VLANPreferencesUpdateConfiguration    (VLANPreferencesRef     prefs);
+
+__END_DECLS
+
+#endif /* _VLANCONFIGURATIONPRIVATE_H */
index 943de07787a669855c815a90384cf08e64511709..b1ed4c81ebb8b9bcf81daebd5bd3faec86b47da8 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 4508412509f2f8ea29dcc93f4a202b344852e8bb..2cfa849dbbb0d82085748df57d5c4554ffc75414 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index a104decac00a9af4b508623b53687b47ee26f0a1..33046cd9abaac780b5e7d13d69539bab00ed0fb7 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index bcc656c0abb597355b276969842bf8971266f86a..6560839ad444ce1301582a2865a9486903e81733 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index f6484a2d1a444ba5ffb7857c76cf33ab9392bdb6..49d96c46b3a29b9b55a87a0ae14812651e234bb6 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
@@ -58,26 +56,24 @@ char copyright_string[] =
 "/*\n"
 " * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.\n"
 " *\n"
-" * @APPLE_LICENSE_HEADER_START@
-" * 
-" * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
-" * 
-" * This file contains Original Code and/or Modifications of Original Code
-" * as defined in and that are subject to the Apple Public Source License
-" * Version 2.0 (the 'License'). You may not use this file except in
-" * compliance with the License. Please obtain a copy of the License at
-" * http://www.opensource.apple.com/apsl/ and read it before using this
-" * file.
-" * 
-" * The Original Code and all software distributed under the License are
-" * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
-" * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
-" * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
-" * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
-" * Please see the License for the specific language governing rights and
-" * limitations under the License.
-" * 
-" * @APPLE_LICENSE_HEADER_END@
+" * @APPLE_LICENSE_HEADER_START@\n"
+" * \n"
+" * This file contains Original Code and/or Modifications of Original Code\n"
+" * as defined in and that are subject to the Apple Public Source License\n"
+" * Version 2.0 (the 'License'). You may not use this file except in\n"
+" * compliance with the License. Please obtain a copy of the License at\n"
+" * http://www.opensource.apple.com/apsl/ and read it before using this\n"
+" * file.\n"
+" * \n"
+" * The Original Code and all software distributed under the License are\n"
+" * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\n"
+" * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\n"
+" * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\n"
+" * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\n"
+" * Please see the License for the specific language governing rights and\n"
+" * limitations under the License.\n"
+" * \n"
+" * @APPLE_LICENSE_HEADER_END@\n"
 " */\n";
 
 
index 546c70e600a77514cf1227e33597b73324064c09..31929d73cb85852749e20fc23bcba9d5291bfcb2 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 14b54be503c18d6381d05176c6902e9ea8275d58..22c39d1ed3daca49f48c307245f3ea3eaf7bb34f 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 4434db816ae321aa4f7e5a7d4c17b685c5360423..f03fe939d05f49cc09f5d562a86047bb245b4dc6 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 12e5685c9178763463cdb1384262b1a4f3658a5b..07b9ffc77bb6780dda9459c1b2b34f936880d315 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 4ef7c4066aea1429551031a3b2194230a10aff31..c7135d5476b313078c2973a1194a27f3b0e518ec 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 57bdaad0123197a1479a9cc3f8680f89b9841558..a6a31dad1a7fdcae58b49787ab416f88df4ce678 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 6cc7046a267459128a935e2b10f3df86a8466783..98cb81ef4938153ef8c509de83d035f8c9dbfabe 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 8c7884bdbe03dd5d86c101d5cb438f13a4ed212c..5e0d5015d3076d92e22f9ac84500e51e7b43c49b 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index b4f96e7269b2cf0b63d751cdbe9fda027a403724..7a690d7727ca4f6ed190212b5356331d132ae1dd 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index b408b89f6b72b5d20b9ae6e36bf65facf69ffeca..6b3c72d34d725263ceef4e3c1f551d2ee46872e6 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index b211b6bc55f97cc83363fd2292e03df4443b5c1f..fa889fe3f32635faf73b9b5909e50f7f3004089b 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index bd0277adb722502c07e3b7aeb3466549f68a49cf..a43e889b6b146e93aeafda75cf073ea0b08d8973 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 2e6b33a5c3087bffbdf2b892780586c35fd6a2a2..02ecc715d21e2005ed50db31b8382be7432b68d5 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 0d5b7c6a1b5a2f983a9abea752e3898dc9a77976..892d5426adf7cebe6c657f2fd250cbf94794a0c8 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 705b2f6eb339cab2bc6f0298d911a6732659255d..82630c9f77247217070c01e15bf02a63d84fc9cb 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 7a37c8ca3839bb76052de9ca2615d1dd96f859a2..0b0ad14c585c71c369c9211b132f567ffae09be6 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index e2a41f61643ea504b9aef8a4d4271c36e17177b0..08747c313418daef826671a90ad06ade3ba4ae5a 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 8a082b81d089d5dce47a58dd56d95f0566f80d95..8c62cf447a663f5d94edb02a3b842a8057d1db95 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 253a26d02e48a63f1aaf96b49e22c0b834407b48..c00fa5d445c162ff7398c384b9bb5e8bed588221 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 739171f3c56be5f1c958dc63379244d70994bef3..55a6ec2b46234b0305aedb03694bcb9b9e2ff30c 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 1352d6a0bac301b8493ce44a29b5da7b487b40f0..66673a38a131b4e60be7ed198c4bc1f2495df4c4 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 87a7de1afc6aa153d9f110ca27f1d4680238f8cd..80be21354f860747ee7d750f2e5761d328720fbd 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 710d2e03c5ffe0be1760b5264746dc990fc9edd9..9463d395a89af5d6f2c511ca7d9d2c4c41e93b3d 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index dda1bb1d73f59bb1c5cc61ba474c8c80bfa37786..4f6b317899bfba2512a5dd7c7cf41a239d393754 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 08ee0d796d5d8967a4f7d23884ddae2cf9d1b08a..a0d1f7b99aaf78eb1f94fff2e5d409030ea1e3e1 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 29cd45b44ed9cfeddaca8fd49e769b9f7fb9bc72..7bd555345c07e2935f820b8299e89ae8702cd4ee 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index d07fa1fd97d0152f18aa72cbdcf46c84e3c4ade2..60869d57891da4f05a4f07cd179d4433fd219d64 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 12c6e0c565f92baf23fc66f0d9fa5cd8258a9149..3b28e89106c4294169c280b4fe077a6a3bdfd63f 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index cb7ddf8df216e55f77b36653b4521f8581f3149c..c49cf8ae74cb022154e8287301aba6d0c1279025 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 925dc7bc0401d6642e28bdb299360647530623ec..af823c4218d761c547fb38ee04bae92dee729aba 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 642d7487eb446e082ec1b50838fc0a538898ac93..a55f4001d94ca084399dafb217e36ce4dec8eb64 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 9104deb077ac3e253f4e2093236603e8a0f9ac7e..af388a11764e0a3a7e21806f7fb18c4078ec5934 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 0a75827dcdd270a41e9508efed4765ec3f5f0cb6..7ebc7ab4a5e9c644aea4f73a7f1388a516199924 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 7050f4027d3b8ec616bb5a02eb8683af965d8892..014da25ff5bb969896c391f0b036fff5ed137586 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 4ddc272748f7dc02e685786e2ba4d11d7e1c38ed..b914891db5f92a900d27724f83c78424e0a7b5c8 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 18a3e5b55a4ce6b2a20ff1eac8b67da592633b7a..704eedd122dc6039876fca055fbcc1962fb2f523 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 444fb86c56e02a8d12ee979eeaa48c51ad0249ee..fa3bf864fa0f276ba0bb1af9e4c53d8eb9cdf24b 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 89535c4c754781bce75c55e891092947d00c7f09..549d8ef2a394fa3ec5b426d3ea9b9f77dec4bce6 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index c9e1177c6b0a8fa4ecd0943ba358e176ad0770e0..80e5b85ad29770d8226fe92e409df3dc35565f52 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 9664ef2f4882dc67e5244062129dbe061946403b..0891ca68e426690396154bcfc6f90313062f67fa 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index d2175fc3f562d7b657a8fcc0be1dd68a792666a4..6c299bbe3670dd4e985723ff341f2b86c88cb60b 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 896a3a721b5805dd6fd77508df8c4f71145f4d5e..d4921ed90da65949b3cffcbdcee63011471e690b 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 75217410f9ca5ca7a8e1e2e2c217a336a3a51c96..f5d4f31ed2e2fdaf14edee8a058fa95a8f003996 100644 (file)
@@ -1,13 +1,19 @@
 {
     DYNAMIC_CODE_GEN = YES; 
     FILESTABLE = {
-        FRAMEWORKS = (CoreFoundation.framework, SystemConfiguration.framework); 
-        H_FILES = (); 
-        OTHER_LINKED = (scselect.c); 
-        OTHER_SOURCES = (Makefile.preamble, Makefile, Makefile.postamble, m.template, h.template); 
-        PRECOMPILED_HEADERS = (); 
-        PROJECT_HEADERS = (); 
-        PUBLIC_HEADERS = (); 
+        FRAMEWORKS = ("CoreFoundation.framework", "SystemConfiguration.framework"); 
+        "H_FILES" = (); 
+        "OTHER_LINKED" = ("scselect.c"); 
+        "OTHER_SOURCES" = (
+            "Makefile.preamble", 
+            Makefile, 
+            "Makefile.postamble", 
+            "m.template", 
+            "h.template"
+        ); 
+        "PRECOMPILED_HEADERS" = (); 
+        "PROJECT_HEADERS" = (); 
+        "PUBLIC_HEADERS" = (); 
         SUBPROJECTS = (); 
     }; 
     LANGUAGE = English; 
index 2e29fe20ea9f3e0410390f7ac9c59d89be8bb5fe..04a241e6e637ab1c80a303bb66e9b171950e9801 100644 (file)
@@ -1,10 +1,8 @@
 /*
- * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
 /*
  * Modification History
  *
+ * January 15, 2004            Allan Nathanson <ajn@apple.com>
+ * - limit location changes to "root" (uid==0), users who are
+ *   a member of group "admin", and processses which have access
+ *   to a local graphics console.
+ *
  * June 1, 2001                        Allan Nathanson <ajn@apple.com>
  * - public API conversion
  *
 #include <getopt.h>
 #include <unistd.h>
 #include <sysexits.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <mach-o/dyld.h>
+#include <grp.h>
 
 #include <SystemConfiguration/SystemConfiguration.h>
 #include <SystemConfiguration/SCPrivate.h>
 
+#include <Security/Security.h>
+#include <Security/AuthSession.h>
+
 
 Boolean        apply   = TRUE;
 
@@ -53,7 +65,7 @@ static struct option longopts[] = {
 };
 
 
-void
+static void
 usage(const char *command)
 {
        SCPrint(TRUE, stderr, CFSTR("usage: %s [-n] new-set-name\n"), command);
@@ -61,6 +73,88 @@ usage(const char *command)
 }
 
 
+static Boolean
+isAdmin()
+{
+        gid_t  groups[NGROUPS_MAX];
+        int    ngroups;
+
+        if (getuid() == 0) {
+                return TRUE;   // if "root"
+        }
+
+        ngroups = getgroups(NGROUPS_MAX, groups);
+        if(ngroups > 0) {
+                struct group   *adminGroup;
+
+                adminGroup = getgrnam("admin");
+                if (adminGroup != NULL) {
+                        gid_t  adminGid = adminGroup->gr_gid;
+                        int    i;
+
+                        for (i = 0; i < ngroups; i++) {
+                                if (groups[i] == adminGid) {
+                                        return TRUE;   // if a member of group "admin"
+                                }
+                        }
+                }
+        }
+
+        return FALSE;
+}
+
+
+static void *
+__loadSecurity(void) {
+       static const void *image = NULL;
+       if (NULL == image) {
+               const char      *framework              = "/System/Library/Frameworks/Security.framework/Security";
+               struct stat     statbuf;
+               const char      *suffix                 = getenv("DYLD_IMAGE_SUFFIX");
+               char            path[MAXPATHLEN];
+
+               strcpy(path, framework);
+               if (suffix) strcat(path, suffix);
+               if (0 <= stat(path, &statbuf)) {
+                       image = NSAddImage(path, NSADDIMAGE_OPTION_NONE);
+               } else {
+                       image = NSAddImage(framework, NSADDIMAGE_OPTION_NONE);
+               }
+       }
+       return (void *)image;
+}
+
+
+static OSStatus
+_SessionGetInfo(SecuritySessionId session, SecuritySessionId *sessionId, SessionAttributeBits *attributes)
+{
+       static OSStatus (*dyfunc)(SecuritySessionId, SecuritySessionId *, SessionAttributeBits *) = NULL;
+       if (!dyfunc) {
+               void *image = __loadSecurity();
+               if (image) dyfunc = NSAddressOfSymbol(NSLookupSymbolInImage(image, "_SessionGetInfo", NSLOOKUPSYMBOLINIMAGE_OPTION_BIND));
+       }
+       return dyfunc ? dyfunc(session, sessionId, attributes) : -1;
+}
+#define SessionGetInfo _SessionGetInfo
+
+
+static Boolean
+hasLocalConsoleAccess()
+{
+        OSStatus               error;
+        SecuritySessionId      sessionID       = 0;
+        SessionAttributeBits   attributeBits   = 0;
+
+        error = SessionGetInfo(callerSecuritySession, &sessionID, &attributeBits);
+        if (error != noErr) {
+                /* Security check failed, must not permit access */
+                return FALSE;
+        }
+
+        return (attributeBits & (sessionHasGraphicAccess|sessionIsRemote)) == sessionHasGraphicAccess;
+}
+
+
 int
 main(int argc, char **argv)
 {
@@ -229,6 +323,12 @@ main(int argc, char **argv)
 
     found :
 
+       if (!(isAdmin() || hasLocalConsoleAccess())) {
+                SCPrint(TRUE, stderr,
+                        CFSTR("Only local console users and administrators can change locations\n"));
+                exit (EX_NOPERM);
+       }
+        
        if (!SCPreferencesSetValue(session, kSCPrefCurrentSet, current)) {
                SCPrint(TRUE, stderr,
                        CFSTR("SCPreferencesSetValue(...,%@,%@) failed\n"),
index 15d1d67f12995d72ba2b9bd38a6ffd0a83e8e2fe..84074543cd1e2a6e15643c00fb408816cc312c01 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 3f1ad92d42cd8d5b88303a6bb1c2d5e88ed3efcd..ed4be7e95962b22cd27060a0464307abc03fa1ee 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 7288d1bca1ca0dfbfdf57ebf97255ee8e1aaebbd..561f15c1e5d13f55bc4b679b071f6920373f519a 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index e5eb65f37a05d15c456cfa9df00faeba0fd74386..a0a082129a557b3e58ee8022c6b431152244640d 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 1261a5c024c32de8cc4d6aa447d9aa2d602cd9cc..8507ddac44ca179fb08636b53f17bb74ab3f6030 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 1f8d63afd30114583ad6452c3b5c822b196b372d..cad9a29d7fa3fabf37f398c16a5c18620f3ce47b 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 492b6e7a0d763626d57c5d1cc17f466f91ea395e..9b0d9cc7ae1a10733b14a5609ed76d4ba20b7036 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index dbea67c071dfeb5e38bc4200b257560f3bdd62d3..72bf1f227bd23f55c1bd4b216eee54f2a0f49968 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 5354839e7162cdc149cedd55abbae2bc25e83d12..f522a4296927437440abca54639c89bef3061a63 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 49c8f82b6b46a7f5d49088bd0790d35100492930..190ba475b499a658c7e76d608d6f9aa20af8fb51 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index ecea776f359ffa6eb554fe3a9510ffc0de6bb07e..b5387111b489790e8b263a413c61c26c401fe05c 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 98be1962f352003b0552a1a91370b68bb41d7590..794530bd9f538b09ae4bba1ca5178414b4b8e4c1 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 246e91761012caf626e10fa306db890d32cd37ee..9c5d2cbd5fd14945612e07e2b4e7a453c8192de0 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index ed80b8e74105e4019f81a0a4bc7dff0da8c27985..72ce17d6e5955ad9305263408ba12077c1512776 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 3afd472898600b4e578b8a1b8d3e3b51405e47a8..74a404931a63e659a55c1e95574ee0fe9908416f 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
index 867f2c86e0e7da11ce4d178537b0ff1e6505dabf..c13c99f51f8115f4ac7a76e966a85feab3c4f1f0 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in