From: marko Date: Sun, 28 Aug 2005 11:22:38 +0000 (+0000) Subject: Simplify / reduce the autogenerated config file for a XORP router. X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=7d32742154bcc0501c3eec3bcb37650c3b5123d3;p=imunes.git Simplify / reduce the autogenerated config file for a XORP router. Bug found by: Submitted by: Requested by: Reviewed by: Approved by: Obtained from: --- diff --git a/xorp.tcl b/xorp.tcl index 1a3308a..28d2abe 100755 --- a/xorp.tcl +++ b/xorp.tcl @@ -71,34 +71,28 @@ proc $MODULE.cfggen { node } { lappend cfg "}" lappend cfg "" - lappend cfg "fea {" - lappend cfg "}" - lappend cfg "" - lappend cfg "protocols {" lappend cfg " static {" foreach rte [getStatIPv4routes $node] { set dest [lindex $rte 0] set gw [lindex $rte 1] set metric [lindex $rte 2] - if { $metric == "" } { - set metric 0 - } lappend cfg " route4 $dest {" lappend cfg " next-hop: $gw" - lappend cfg " metric: $metric" + if { $metric != "" } { + lappend cfg " metric: $metric" + } lappend cfg " }" } foreach rte [getStatIPv6routes $node] { set dest [lindex $rte 0] set gw [lindex $rte 1] set metric [lindex $rte 2] - if { $metric == "" } { - set metric 0 - } lappend cfg " route6 $dest {" lappend cfg " next-hop: $gw" - lappend cfg " metric: $metric" + if { $metric == "" } { + lappend cfg " metric: $metric" + } lappend cfg " }" } lappend cfg " }" @@ -109,12 +103,8 @@ proc $MODULE.cfggen { node } { lappend cfg "protocols {" lappend cfg " rip {" lappend cfg " export static {" - lappend cfg " metric: 1" - lappend cfg " tag: 0" lappend cfg " }" lappend cfg " export connected {" - lappend cfg " metric: 1" - lappend cfg " tag: 0" lappend cfg " }" lappend cfg "" foreach ifc [ifcList $node] { @@ -137,8 +127,8 @@ proc $MODULE.cfggen { node } { lappend cfg "protocols {" lappend cfg " ripng {" lappend cfg " export static {" - lappend cfg " metric: 1" - lappend cfg " tag: 0" + lappend cfg " }" + lappend cfg " export connected {" lappend cfg " }" lappend cfg "" foreach ifc [ifcList $node] {