Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
7d3fab8c
Commit
7d3fab8c
authored
Dec 19, 2000
by
Christopher Alfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
postparse.tcl - Added code to parse set-link-loss command.
parent
76d2a4e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
tbsetup/ns2ir/postparse.tcl
tbsetup/ns2ir/postparse.tcl
+20
-1
No files found.
tbsetup/ns2ir/postparse.tcl
View file @
7d3fab8c
...
...
@@ -14,7 +14,7 @@ source $scriptdir/../ir/libir.tcl
namespace import TB_LIBIR::ir
if
{
$argc
!= 2
}
{
puts
"usage:
$argv
ns_file ir_file"
puts
"usage:
$argv
0
ns_file ir_file"
exit 1
}
...
...
@@ -37,6 +37,11 @@ while {[gets $nsFP line] >= 0} {
set type
[
lindex $line 3
]
# XXX currently only shark-shelf supported
set hwtype
(
$node
)
$type
}
elseif
{
$cmd
==
"set-link-loss"
}
{
set src
[
lindex $line 2
]
set dst
[
lindex $line 3
]
set loss
[
lindex $line 4
]
set linkloss
(
$src:$dst
)
$loss
}
}
}
...
...
@@ -55,5 +60,19 @@ foreach node $nodes {
}
ir set /topology/nodes $newnodes
set links
[
ir get /topology/links
]
set newlinks
{}
foreach link $links
{
set src
[
lindex $link 1
]
set dst
[
lindex $link 3
]
if
{[
info exists linkloss
(
$src:$dst
)]}
{
lappend newlinks
[
concat $link $linkloss
(
$src:$dst
)]
}
else
{
lappend newlinks
[
concat $link 0.0
]
}
}
ir set /topology/links $newlinks
ir write $irfile
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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