*
* @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@
*/
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 */
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) {
ptree = ptree->left;
continue;
}
- ATENABLE(s, ddpinp_lock);
/* we're in the range (either extended or not)
* return the entry found.
return (ptree);
}
}
- ATENABLE(s, ddpinp_lock);
dPrintf(D_M_RTMP_LOW, D_L_ROUTING, ("%s : %04d : NOT FOUND\n",
"rt_blookup", NetNumber));
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);
}
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++) {
zmap++;
}
- ATENABLE(s, ddpinp_lock);
return (zone_count);
}
{
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;
}
}
- if (found) {
- ATENABLE(s, ddpinp_lock);
+ if (found)
return (i+1);
- }
}
- ATENABLE(s, ddpinp_lock);
return(0);
}
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);
}
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);
}