]> git.entuzijast.net Git - imunes.git/commitdiff
Simplify / reduce the autogenerated config file for a XORP router.
authormarko <marko>
Sun, 28 Aug 2005 11:22:38 +0000 (11:22 +0000)
committermarko <marko>
Sun, 28 Aug 2005 11:22:38 +0000 (11:22 +0000)
Bug found by:
Submitted by:
Requested by:
Reviewed by:
Approved by:
Obtained from:

xorp.tcl

index 1a3308a0a785f8670a890c54cd26c7a906723b8d..28d2abe09c943374d35e7a905a3607af52841725 100755 (executable)
--- 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] {