]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netat/ddp_rtmptable.c
xnu-792.10.96.tar.gz
[apple/xnu.git] / bsd / netat / ddp_rtmptable.c
index a8be83510e152f41c497ff95c5dac903e37e9639..933c07649ca45ecb75b7a570d77d930f13ae8c31 100644 (file)
@@ -3,20 +3,19 @@
  *
  * @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 contents of this file constitute Original Code as defined in and
+ * are subject to the Apple Public Source License Version 1.1 (the
+ * "License").  You may not use this file except in compliance with the
+ * License.  Please obtain a copy of the License at
+ * http://www.apple.com/publicsource 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
+ * This 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.
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
  * 
  * @APPLE_LICENSE_HEADER_END@
  */
@@ -87,7 +86,6 @@ char errstr[512];             /* used to display meaningfull router errors*/
 extern at_ifaddr_t *ifID_table[];
 extern at_ifaddr_t *ifID_home;
 extern snmpStats_t     snmpStats;
-extern atlock_t        ddpinp_lock;
 
 short ErrorRTMPoverflow = 0;   /* flag if RTMP table is too small for this net */
 short ErrorZIPoverflow  = 0;   /* flag if ZIP table is too small for this net */
@@ -147,12 +145,10 @@ at_net_al NetNumber;
 
        RT_entry *ptree = &RT_table_start;
        at_net_al LowEnd;
-       register unsigned int s;
 /*
        dPrintf(D_M_RTMP_LOW, D_L_ROUTING, ("%s : Lookup for Net=%d\n",
                 "rt_blookup", NetNumber));
 */     
-       ATDISABLE(s, ddpinp_lock);
        while (ptree) {
 
                if (NetNumber > ptree->NetStop) {
@@ -177,7 +173,6 @@ at_net_al NetNumber;
                        ptree = ptree->left;
                        continue;
                   }
-                  ATENABLE(s, ddpinp_lock);
                   
                   /* we're in the range (either extended or not)
                    * return the entry found.
@@ -191,7 +186,6 @@ at_net_al NetNumber;
                   return (ptree);
                }       
        }
-       ATENABLE(s, ddpinp_lock);
 
        dPrintf(D_M_RTMP_LOW, D_L_ROUTING, ("%s : %04d : NOT FOUND\n",
                 "rt_blookup", NetNumber));
@@ -497,23 +491,19 @@ int zt_add_zonename(zname)
 at_nvestr_t *zname;
 {
        register short res,i;
-       register unsigned int s;
 
        if (res = zt_find_zname(zname))
                return(res);
 
-       ATDISABLE(s, ddpinp_lock);
        for (i = 0; i < ZT_maxentry ; i++) {
                if (ZT_table[i].ZoneCount == 0 && ZT_table[i].Zone.len == 0) {/* free entry */
                        ZT_table[i].Zone = *zname;
                        dPrintf(D_M_RTMP, D_L_VERBOSE, ("zt_add_zonename: zone #%d %s len=%d\n",
                                i, ZT_table[i].Zone.str, ZT_table[i].Zone.len));
                        at_state.flags |= AT_ST_ZT_CHANGED;
-                       ATENABLE(s, ddpinp_lock);
                        return(i+1);
                }
        }
-       ATENABLE(s, ddpinp_lock);
        /* table full... */
        return (ZT_MAXEDOUT);
 }
@@ -708,14 +698,10 @@ RT_entry *ent;
        register u_char *zmap;
        register u_short i,j;
        register int       zone_count = 0 ;
-       register unsigned int s;
 
-       ATDISABLE(s, ddpinp_lock);
 
-       if (!RT_ALL_ZONES_KNOWN(ent)) {
-                       ATENABLE(s, ddpinp_lock);
+       if (!RT_ALL_ZONES_KNOWN(ent))
                        return (0);
-       }
        zmap = ent->ZoneBitMap;
 
        for (i = 0 ; i < ZT_BYTES ; i++) {
@@ -728,7 +714,6 @@ RT_entry *ent;
                zmap++;
        }
 
-       ATENABLE(s, ddpinp_lock);
        return (zone_count);
 }
 
@@ -740,13 +725,11 @@ at_nvestr_t *zname;
 {
        register short i, j, found;
        register char c1, c2;
-       register unsigned int s;
 
 
        if (!zname->len)
                return(0);
 
-       ATDISABLE(s, ddpinp_lock);
        for (i = 0 ; i < ZT_maxentry ; i++) {
                        if (!ZT_table[i].ZoneCount || zname->len != ZT_table[i].Zone.len)
                                        continue;
@@ -770,13 +753,10 @@ at_nvestr_t *zname;
                                }
                        }
 
-                       if (found) {
-                               ATENABLE(s, ddpinp_lock);
+                       if (found)
                                return (i+1);
-                       }
        }
 
-       ATENABLE(s, ddpinp_lock);
        return(0);
 }
 
@@ -789,14 +769,11 @@ void zt_set_zmap(znum, zmap)
      char *zmap;
 {
        register u_short num = znum -1;
-       register unsigned int s;
 
-       ATDISABLE(s, ddpinp_lock);
        if (!(zmap[num >> 3] & 0x80 >> (num % 8))) {
                zmap[num >> 3] |= 0x80 >> (num % 8);
                ZT_table[num].ZoneCount++;
        }
-       ATENABLE(s, ddpinp_lock);
 }
 
 
@@ -808,14 +785,11 @@ void zt_clr_zmap(znum, zmap)
      char *zmap;
 {
        register u_short num = znum -1;
-       register unsigned int s;
 
-       ATDISABLE(s, ddpinp_lock);
        if (zmap[num >> 3] & 0x80 >> (num % 8)) {
                zmap[num >> 3] ^= 0x80 >> (num % 8);
                ZT_table[num].ZoneCount--;
        }
-       ATENABLE(s, ddpinp_lock);
 }