Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
554b1fa8
Commit
554b1fa8
authored
Jan 01, 2001
by
Christopher Alfeld
Browse files
Another minor fix related to LANs
parent
9082dc03
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/ns2ir/postparse
View file @
554b1fa8
...
...
@@ -198,21 +198,16 @@ if ($@) {
print
STDERR
"
Incomplete IR - Could not find /topology/lans
\n
";
exit
(
1
);
}
@l
ink
s
=
split
("
\n
",
$raw
);
@newl
ink
s
=
();
foreach
(
@l
ink
s
)
{
@info
=
split
;
if
(
defined
(
$lanloss
{
$
info
[
0
]
}))
{
$loss
=
$lanloss
{
$
info
[
0
]
}
@l
an
s
=
split
("
\n
",
$raw
);
@newl
an
s
=
();
foreach
(
@l
an
s
)
{
(
$lan
,
$prefix
,
$postfix
)
=
/^([^ ]+) ("[^\"]+" [^ ]+ [^ ]+)[ \t]+(.*)$/
;
if
(
defined
(
$lanloss
{
$
lan
}))
{
$loss
=
$lanloss
{
$
lan
}
}
else
{
$loss
=
"
0.0
";
}
# This is kind of ugly because it has a sub list.
# 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
);
push
(
@newlans
,"
$lan
$prefix
$loss
$postfix
");
}
if
(
$#newlans
!=
-
1
)
{
&ir_set
("
/topology/lans
",
join
("
\n
",
@newlans
)
.
"
\n
");
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment