IP -Restriktionsfunktion
Wenn Sie gute Vorschläge und Algorithmen haben, kontaktieren Sie mich bitte! ! :)
************************************************************
"FunctionCheckip (cinput_ip, cBound_ip)
„ErstelltByqqdao, [email protected]/11/8
"Hinweis: Zuerst müssen Sie entsprechend der Zahl radeln; dann bestimmen Sie, ob es"-", wenn es vorhanden ist, eine geteilte Verarbeitung durchführen und schließlich feststellen, ob es sich innerhalb des Bereichs befindet
"Parameter: Cinput_ip, IP zur Inspektion nach Generation
"CBOUND_IP, das angegebene Bereichsformat ist, einzelne IP und Bereich IP, der Bereich IP wird zuletzt verwendet"-"Segment, wenn es"*"ist, muss es in der letzten Ziffer platziert werden
"Hinzufügen": Erlauben "Nach jedem Bereich bedeutet das Anmeldung, und Hinzufügen": Abfall "bedeutet, dass Anmeldung abgelehnt wird. Mehrere Bereiche werden verwendet"; "isolieren sie
"Zum Beispiel 192.168.1*.*: Erlauben; 192.168.1.1:allow; 192.168.1.1-10: Müll"
"Rückgabewert: TRUE/FALSE
"Update: 2001/12/05 Supports erlauben, Abfallunterstützung ' *', nicht richtig? Unterstützung, weil es ähnlich ist *
************************************************************
functionCheckip (cinput_ip, cBound_ip)
dimcsingle_ip, ctemp_ip, cstart_ip, cend_ip
Checkip = false
csingle_ip = split (cbound_ip, ";")
fei = 0Toubund (csingle_ip)
ifInstr (csingle_ip (i), "mapitale") <> 0Then "lehnt nur ab
ctemp_ip = links (csingle_ip (i), Instr (csingle_ip (i), ":")-1)
IFINSTR (CTEMP_IP, "*") <> 0Then "ist ein breiter Bereich
cstart_ip = links (ctemp_ip, instr (ctemp_ip, "*")-1)
iFleft (Cinput_ip, len (cstart_ip)) = cstart_iphen
Checkip = false
Ausgangsfunktion
Endif
Endif
ifInStr (ctemp_ip, "-") = 0Then
cstart_ip = ctemp_ip
cend_ip = ctemp_ip
anders
cstart_ip = links (ctemp_ip, instr (ctemp_ip, "-")-1)
cend_ip = links (cstart_ip, instrrev (cstart_ip, ".")-1)+".
Endif
iFIP2STR (cinput_ip)> = ip2str (cstart_ip) und Ip2str (cinput_ip) <= ip2str (cend_ip) dann
Checkip = false
Ausgangsfunktion
Endif
ElseIfinStr (csingle_ip (i), "erlauben") <> 0Then "erlauben
ctemp_ip = links (csingle_ip (i), Instr (csingle_ip (i), ":")-1)
IFINSTR (CTEMP_IP, "*") <> 0Then "ist ein breiter Bereich
cstart_ip = links (ctemp_ip, instr (ctemp_ip, "*")-1)
iFleft (Cinput_ip, len (cstart_ip)) = cstart_iphen
Checkip = true
Endif
Endif
ifInStr (ctemp_ip, "-") = 0Then
cstart_ip = ctemp_ip
cend_ip = ctemp_ip
anders
cstart_ip = links (ctemp_ip, instr (ctemp_ip, "-")-1)
cend_ip = links (cstart_ip, instrrev (cstart_ip, ".")-1)+".
Endif
iFIP2STR (cinput_ip)> = ip2str (cstart_ip) und Ip2str (cinput_ip) <= ip2str (cend_ip) dann
Checkip = true