Skip to content
GitLab
Menu
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
999700f3
Commit
999700f3
authored
Jan 09, 2012
by
Yathindra Naik
Browse files
Added some more references to custom agent
parent
a0922248
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/ns2ir/sim.tcl.in
View file @
999700f3
...
...
@@ -24,6 +24,7 @@
Class Simulator
Class Program -superclass NSObject
Class Disk -superclass NSObject
Class Custom -superclass NSObject
Class EventGroup -superclass NSObject
Class Firewall -superclass NSObject
...
...
@@ -73,6 +74,10 @@ Simulator instproc init {args} {
$self instvar disk_list
;
array set disk_list
{}
#Custom list.
$self instvar custom_list
;
array set custom_list
{}
# EventGroup list.
$self instvar eventgroup_list
;
array set eventgroup_list
{}
...
...
@@ -401,6 +406,7 @@ Simulator instproc run {} {
$self instvar event_list
$self instvar prog_list
$self instvar disk_list
$self instvar custom_list
$self instvar eventgroup_list
$self instvar firewall_list
$self instvar timeline_list
...
...
@@ -625,6 +631,9 @@ Simulator instproc run {} {
foreach disk
[
array names disk_list
]
{
$disk updatedb
"sql"
}
foreach custom
[
array names custom_list
]
{
$custom updatedb
"sql"
}
foreach egroup
[
array names eventgroup_list
]
{
$egroup
updatedb
"sql"
}
...
...
@@ -919,7 +928,7 @@ Simulator instproc at {time eventstring} {
}
else
{
set ptime
[
::GLOBALS::reltime-to-secs $time
]
if
{
$ptime
== -1
}
{
perror
"Invalid time spec:
$time
"
u
perror
"Invalid time spec:
$time
"
return
}
set time $ptime
...
...
@@ -1028,6 +1037,12 @@ Simulator instproc rename_disk {old new} {
set disk_list
(
$new
)
{}
}
Simulator instproc rename_custom
{
old new
}
{
$self instvar custom_list
unset custom_list
(
$old
)
set custom_list
(
$new
)
{}
}
Simulator instproc rename_eventgroup
{
old new
}
{
$self instvar eventgroup_list
unset eventgroup_list
(
$old
)
...
...
@@ -1232,6 +1247,13 @@ Simulator instproc add_disk {disk} {
set disk_list
(
$disk
)
{}
}
# add_custom
# Link to a new custom object.
Simulator instproc add_custom
{
custom
}
{
$self instvar custom_list
set custom_list
(
$custom
)
{}
}
# add_eventgroup
# Link to a EventGroup object.
Simulator instproc add_eventgroup
{
group
}
{
...
...
@@ -1794,6 +1816,25 @@ Simulator instproc make_event {outer event} {
}
}
}
"Custom"
{
set otype CUSTOM
set vname $obj
switch -- $cmd
{
"start"
{
set etype START
set args
[
lindex $event 2
]
}
"stop"
{
set etype STOP
if
{[
llength $event
]
< 3
}
{
perror
"Wrong number of arguments:
$obj
$cmd
$evargs
"
return
}
set args
[
lindex $event 2
]
}
}
}
"Console"
{
set otype CONSOLE
set vname $obj
...
...
Write
Preview
Supports
Markdown
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