chiark / gitweb /
Import release 0.1.12
[secnet.git] / make-secnet-sites
index fb8802863adeaacacb2760a407e18f9d2e778300..5d6de21a8ce591604e013486fcacbdfe20212643 100755 (executable)
@@ -58,7 +58,7 @@ sys.path.append("/usr/local/share/secnet")
 sys.path.append("/usr/share/secnet")
 import ipaddr
 
-VERSION="0.1.9"
+VERSION="0.1.10"
 
 class vpn:
        def __init__(self,name):
@@ -100,12 +100,12 @@ class nets:
                i=sc.intersection(self.set)
                return i.is_empty()
        def out(self):
-               rn=''
-               if (self.w[0]=='restrict-nets'): rn='# '
-               return '%s%s %s;'%(rn,self.w[0],
-                       string.join(map(lambda x:'"%s/%s"'%(x.ip_str(),
+               if (self.w[0]=='restrict-nets'): pattern="# restrict-nets %s;"
+               else:
+                       pattern="link netlink { routes %s; };"
+               return pattern%string.join(map(lambda x:'"%s/%s"'%(x.ip_str(),
                                x.mask.netmask_bits_str),
-                               self.set.as_list_of_networks()),","))
+                               self.set.as_list_of_networks()),",")
 
 class dhgroup:
        def __init__(self,w):