Skip to content

Commit

Permalink
合并部分IP段
Browse files Browse the repository at this point in the history
  • Loading branch information
moonshawdo committed Aug 13, 2014
1 parent 7cb8b07 commit 0d8b621
Showing 1 changed file with 28 additions and 121 deletions.
149 changes: 28 additions & 121 deletions checkip.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,24 @@
72.14.192.0/18
209.85.128.0/17
66.102.0.0/20
74.125.0.0/16
74.125.0.0-74.125.31.255
74.125.32.0-74.125.63.255
74.125.64.0-74.125.95.255
74.125.96.0-74.125.127.255
74.125.128.0-74.125.159.255
74.125.160.0-74.125.191.255
74.125.192.0-74.125.223.255
74.125.224.0-74.125.255.255
64.18.0.0/20
207.126.144.0/20
173.194.0.0/16
173.194.0.0-173.194.31.255
173.194.32.0-173.194.63.255
173.194.64.0-173.194.95.255
173.194.96.0-173.194.127.255
173.194.128.0-173.194.159.255
173.194.160.0-173.194.191.255
173.194.192.0-173.194.223.255
173.194.224.0-173.194.255.255
1.179.248.0-255
106.162.192.148-187
108.166.34.0-255
Expand All @@ -107,90 +121,6 @@
146.148.34.0-255
146.148.8.0-255
146.148.9.0-255
173.194.0.0-255
173.194.1.0-255
173.194.10.0-255
173.194.11.0-255
173.194.12.0-255
173.194.120.0-255
173.194.121.0-255
173.194.122.0-255
173.194.123.0-255
173.194.124.0-255
173.194.125.0-255
173.194.126.0-255
173.194.127.0-255
173.194.128.0-255
173.194.129.0-255
173.194.13.0-255
173.194.130.0-255
173.194.131.0-255
173.194.132.0-255
173.194.133.0-255
173.194.134.0-255
173.194.135.0-255
173.194.136.0-255
173.194.137.0-255
173.194.138.0-255
173.194.139.0-255
173.194.14.0-255
173.194.140.0-255
173.194.141.0-255
173.194.142.0-255
173.194.143.0-255
173.194.162.0-255
173.194.166.0-255
173.194.174.0-255
173.194.193.0-255
173.194.196.0-255
173.194.198.0-255
173.194.201.0-255
173.194.202.0-255
173.194.203.0-255
173.194.205.0-255
173.194.206.0-255
173.194.207.0-255
173.194.208.0-255
173.194.209.0-255
173.194.21.0-255
173.194.212.0-255
173.194.214.0-255
173.194.22.0-255
173.194.220.0-255
173.194.221.0-255
173.194.222.0-255
173.194.223.0-255
173.194.224.0-255
173.194.225.0-255
173.194.226.0-255
173.194.227.0-255
173.194.228.0-255
173.194.229.0-255
173.194.23.0-255
173.194.230.0-255
173.194.231.0-255
173.194.232.0-255
173.194.233.0-255
173.194.234.0-255
173.194.24.0-255
173.194.25.0-255
173.194.26.0-255
173.194.34.0-255
173.194.6.0-255
173.194.64.0-255
173.194.65.0-255
173.194.66.0-255
173.194.67.0-255
173.194.69.0-255
173.194.7.0-255
173.194.70.0-255
173.194.71.0-255
173.194.73.0-255
173.194.74.0-255
173.194.77.0-255
173.194.78.0-255
173.194.79.0-255
173.194.9.0-255
178.60.128.1-63
193.120.166.64-127
193.92.133.0-63
Expand All @@ -201,25 +131,9 @@
202.39.143.1-123
202.69.26.0-255
203.66.124.129-251
208.117.224.0-255
208.117.225.0-255
208.117.226.0-255
208.117.227.0-255
208.117.228.0-255
208.117.229.0-255
208.117.230.0-255
208.117.231.0-255
208.117.232.0-255
208.117.236.0-255
208.117.238.0-255
208.117.239.0-255
208.117.240.0-255
208.117.242.0-255
208.117.248.0-255
208.117.250.0-255
208.117.251.0-255
208.117.254.0-255
208.117.255.0-255
208.117.224.0-208.117.229.255
208.117.230.0-208.117.239.55
208.117.240.0-208.117.255.255
209.85.228.0-255
210.242.125.20-59
212.188.15.0-255
Expand All @@ -230,15 +144,8 @@
41.206.96.0-255
62.116.207.0-63
62.197.198.193-251
64.15.112.0-255
64.15.113.0-255
64.15.114.0-255
64.15.115.0-255
64.15.117.0-255
64.15.119.0-255
64.15.120.0-255
64.15.124.0-255
64.15.126.0-255
64.15.112.0-64.15.117.255
64.15.119.0-64.15.126.255
64.233.160.0-255
64.233.168.0-255
64.233.171.0-255
Expand Down Expand Up @@ -712,6 +619,7 @@ def __init__(self,checkqueue,cacheResult):
threading.Thread.__init__(self)
self.ipqueue = checkqueue
self.cacheResult = cacheResult
self.hadaddipcnt = 0

def ramdomip(self):
lastokresult,lasterrorresult = self.cacheResult.loadLastResult()
Expand Down Expand Up @@ -766,12 +674,9 @@ def ramdomip(self):
continue
if self.cacheResult.queryfinish():
break
'''if itemlen > 1000:
itemlen = 10
elif itemlen > 5:
itemlen = 5
'''
if itemlen <= 2:
if itemlen > 1000:
selectcnt = 5
elif itemlen <= 2:
selectcnt = itemlen
else:
selectcnt = 2
Expand All @@ -798,6 +703,7 @@ def ramdomip(self):
hadIPData = True
self.ipqueue.put(k)
cacheip.add(k)
self.hadaddipcnt += 1
if not putdata:
evt_ipramdomstart.set()
putdata = True
Expand All @@ -819,7 +725,8 @@ def run(self):
PRINT("begin to get ramdom ip")
self.ramdomip()
evt_ipramdomend.set()
PRINT("ramdom ip thread stopped.ip queue size: %d" % self.ipqueue.qsize())
qsize = self.ipqueue.qsize()
PRINT("ramdom ip thread stopped.had check ip: %d,rest ip queue size: %d" % (self.hadaddipcnt - qsize,qsize))

def from_string(s):
"""Convert dotted IPv4 address to integer."""
Expand Down

0 comments on commit 0d8b621

Please sign in to comment.