From a16d703c48d3f6d48ec8d66df294ca75be67b9b7 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 7 Jan 2006 17:43:50 +0000 Subject: Make default networks configureable git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@53 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- Generate | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Generate b/Generate index a942738..3dca294 100755 --- a/Generate +++ b/Generate @@ -75,13 +75,6 @@ log syslog !debug bgp updates ! ' -QUAGGA_BGPD_DEFAULT_PREFIX_LIST_PERMIT= -' -ip prefix-list LISTNAME seq 10 permit 10.200.0.0/16 le 32 -ip prefix-list LISTNAME seq 11 permit 172.22.0.0/16 le 32 -ip prefix-list LISTNAME seq 12 permit 192.168.224.0/24 le 32' - -QUAGGA_BGPD_DEFAULT_PREFIX_LIST_STARTEXTRASEQ = 31 DEFAULT_OPENSSLCNF = ' HOME = CA oid_section = new_oids @@ -426,15 +419,23 @@ hostlist.each{ |host| bgpdfilename = "#{dir}/#{$NAMESPACE}.quagga.bgpd" bgpd = File.new(bgpdfilename, "w") bgpd.puts QUAGGA_BGPD_HEAD.gsub('HOSTNAME', host['name']) - bgpd.puts QUAGGA_BGPD_DEFAULT_PREFIX_LIST_PERMIT.gsub('LISTNAME', 'VPNn2') + count = 10 + makelist($config['default_networks']).each{ |net| + bgpd.puts "ip prefix-list VPNn2 seq #{count} permit #{net} #{net =~ /\/32/ ? '' : "le 32"}" + count = count + 1 + } bgpd.puts "!" %w(import export).each{ |inout| if host.has_key?('extra_'+inout) host['extra_'+inout].each_pair{ |peer, extras| listname = makelistname(peer, inout) - bgpd.puts QUAGGA_BGPD_DEFAULT_PREFIX_LIST_PERMIT.gsub('LISTNAME', listname) unless host.has_key?('no_defaults_'+inout) and - host['no_defaults_'+inout] - count = QUAGGA_BGPD_DEFAULT_PREFIX_LIST_STARTEXTRASEQ + count = 10 + unless host['no_defaults_'+inout] + makelist($config['default_networks']).each{ |net| + bgpd.puts "ip prefix-list #{listname} seq #{count} permit #{net} #{net =~ /\/32/ ? '' : "le 32"}" + count = count + 1 + } + end makelist(extras).each{ |net| bgpd.puts "ip prefix-list #{listname} seq #{count} permit #{net} #{net =~ /\/32/ ? '' : "le 32"}" count = count + 1 -- cgit v1.2.3