Commit 554b1fa8 authored by Christopher Alfeld's avatar Christopher Alfeld
Browse files

Another minor fix related to LANs

parent 9082dc03
...@@ -198,21 +198,16 @@ if ($@) { ...@@ -198,21 +198,16 @@ if ($@) {
print STDERR "Incomplete IR - Could not find /topology/lans\n"; print STDERR "Incomplete IR - Could not find /topology/lans\n";
exit(1); exit(1);
} }
@links = split("\n",$raw); @lans = split("\n",$raw);
@newlinks = (); @newlans = ();
foreach (@links) { foreach (@lans) {
@info = split; ($lan,$prefix,$postfix) = /^([^ ]+) ("[^\"]+" [^ ]+ [^ ]+)[ \t]+(.*)$/;
if (defined($lanloss{$info[0]})) { if (defined($lanloss{$lan})) {
$loss = $lanloss{$info[0]} $loss = $lanloss{$lan}
} else { } else {
$loss = "0.0"; $loss = "0.0";
} }
# This is kind of ugly because it has a sub list. push(@newlans,"$lan $prefix $loss $postfix");
# Works very nicely in TCL though.
@t = split("\"");
@t2 = split("[ \t]+",$t[2]);
$s = "$t[0]\"$t[1]\" $t2[1] $t2[2] $lanloss{$info[0]} " . join(" ",@t2[3..$#t2]);
push(@newlans,$s);
} }
if ($#newlans != -1) { if ($#newlans != -1) {
&ir_set("/topology/lans",join("\n",@newlans) . "\n"); &ir_set("/topology/lans",join("\n",@newlans) . "\n");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment