cd ~/secnet/sites-test/
execute ~/secnet/make-secnet-sites.py -u vpnheader groupfiles sites
-This program is part of secnet. It relies on the "ipaddr" library from
-Cendio Systems AB.
+This program is part of secnet.
"""
import getopt
import re
-import ipaddr
+import ipaddress
# entry 0 is "near the executable", or maybe from PYTHONPATH=.,
# which we don't want to preempt
class single_ipaddr (basetype):
"An IP address"
def __init__(self,w):
- self.addr=ipaddr.IPAddress(w[1])
+ self.addr=ipaddress.ip_address(w[1])
def __str__(self):
return '"%s"'%self.addr
def __init__(self,w):
self.set=ipaddrset.IPAddressSet()
for i in w[1:]:
- x=ipaddr.IPNetwork(i,strict=True)
+ x=ipaddress.ip_network(i,strict=True)
self.set.append([x])
def __str__(self):
return ",".join(map((lambda n: '"%s"'%n), self.set.networks()))