home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Spezial
/
SPEZIAL2_97.zip
/
SPEZIAL2_97.iso
/
ANWEND
/
ONLINE
/
SREFPRC1
/
BADIPS.SRF
< prev
next >
Wrap
Text File
|
1996-09-22
|
1KB
|
36 lines
/* -----------------------------------------------------------------------*/
/* see if ip address matches one of a set of bad ips (1 if yes)*/
/* -----------------------------------------------------------------------*/
sref_badips:
parse arg anips,enmadd,host_nickname
parse var anips ip.1 '.' ip.2 '.' ip.3 '.' ip.4
aa='unallowedips.' ;addit=''
if host_Nickname<>"" then addit='.'||strip(host_nickname)
nin=0
do mm=1 to 10000
tt=strip(value(enmadd||aa||mm||addit,,'os2environment')) ;tt=strip(tt)
if tt="" | tt=0 then leave
nin=nin+1 ; unallowedips.nin=tt
end
unallowedips.0=nin
mdo=unallowedips.0
do mm=1 to mdo
chekips=uNALLOWEDIPS.mm
if chekips=' ' then iterate
parse var chekips uip.1 '.' uip.2 '.' uip.3 '.' uip.4
match=1
do mm2=1 to 4
if uip.mm2="*" then iterate
if uip.mm2=ip.mm2 then iterate
match=0 /*if here, not a match */
leave
end
if match=1 then return 1 /* got a match */
end
return 0