X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/43866e378188c25dd1e2208016ab3cbeb086ae6c..c0fea4742e91338fffdcf79f86a7c1d5e2b97eb1:/bsd/netat/ddp_rtmptable.c diff --git a/bsd/netat/ddp_rtmptable.c b/bsd/netat/ddp_rtmptable.c index cd1bfd49b..933c07649 100644 --- a/bsd/netat/ddp_rtmptable.c +++ b/bsd/netat/ddp_rtmptable.c @@ -3,22 +3,19 @@ * * @APPLE_LICENSE_HEADER_START@ * - * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * 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. * - * 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 + * 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@ */ @@ -89,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 */ @@ -149,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) { @@ -179,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. @@ -193,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)); @@ -499,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); } @@ -710,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++) { @@ -730,7 +714,6 @@ RT_entry *ent; zmap++; } - ATENABLE(s, ddpinp_lock); return (zone_count); } @@ -742,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; @@ -772,13 +753,10 @@ at_nvestr_t *zname; } } - if (found) { - ATENABLE(s, ddpinp_lock); + if (found) return (i+1); - } } - ATENABLE(s, ddpinp_lock); return(0); } @@ -791,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); } @@ -810,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); }