Skip to content

Commit

Permalink
update chnroute
Browse files Browse the repository at this point in the history
  • Loading branch information
madeye committed Nov 24, 2015
1 parent 331434d commit be4ddc3
Show file tree
Hide file tree
Showing 2 changed files with 164 additions and 9 deletions.
8 changes: 1 addition & 7 deletions gfwlist/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@
def main():
china_list_set = IPy.IPSet()
for line in sys.stdin:
line_params = line.split("|")
if len(line_params) < 5 or line_params[2] != "ipv4" or line_params[1] != "CN":
continue
ip_addr = line_params[3]
ip_length = float(line_params[4])
ip_mask = 32 - int(math.ceil(math.log(ip_length, 2)))
china_list_set.add(IPy.IP("%s/%d" % (ip_addr, ip_mask)))
china_list_set.add(IPy.IP(line))

# 添加内网地址
internal_list = IPy.IPSet(map(IPy.IP, [
Expand Down
Loading

0 comments on commit be4ddc3

Please sign in to comment.