You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			19 lines
		
	
	
		
			429 B
		
	
	
	
		
			Python
		
	
			
		
		
	
	
			19 lines
		
	
	
		
			429 B
		
	
	
	
		
			Python
		
	
#!/usr/bin/env -S python3 -u
 | 
						|
import sys
 | 
						|
from ipaddress import ip_network, ip_address
 | 
						|
 | 
						|
nets = []
 | 
						|
with open("goog-prefixes.txt") as f:
 | 
						|
    nets = [line.strip() for line in f.readlines()]
 | 
						|
 | 
						|
for line in iter(sys.stdin.readline, ''):
 | 
						|
    line = line.strip()
 | 
						|
    for net in nets:
 | 
						|
        try:
 | 
						|
            if ip_address(line) in ip_network(net):
 | 
						|
                print(line)
 | 
						|
 | 
						|
                continue
 | 
						|
        except:
 | 
						|
            continue
 |