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))
+ if (!RT_ALL_ZONES_KNOWN(ent)) {
+ ATENABLE(s, ddpinp_lock);
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)
+ if (found) {
+ ATENABLE(s, ddpinp_lock);
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);
}