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
c1ecb12c
Commit
c1ecb12c
authored
Mar 24, 2010
by
Mike Hibler
Browse files
Begin to hack tcl code to support passing through elabinelab attributes
parent
43efbee5
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/ns2ir/tb_compat.tcl.in
View file @
c1ecb12c
...
...
@@ -130,6 +130,14 @@ namespace eval TBCOMPAT {
variable elabinelab_source_tarfile
""
variable elabinelab_tarfiles
# Elabinelab attribute stuff.
variable elabinelab_attributes
array set elabinelab_attributes
{}
variable EINEROLE
{
^
(
boss|ops|fs|router
)
$
}
variable EINEKEY
{
^
(
\w
[
-
\w\.
]
+
)
$
}
variable EINEVALUE
{
^
([
-
\w\s\.\,\/
]
+
)
$
}
variable EINEORDER
{
^
\d
+$
}
# Mapping of
"resource classes"
and
"reservation types"
to bootstrap
# values, where a resource class is a symbolic string provided by the user
#
(
e.g. Client, Server
)
, and a reservation type is a resource name provided
...
...
@@ -1719,7 +1727,7 @@ proc tb-set-dpdb {onoff} {
}
}
#
# Change the default topo
graph
y.
# Change the default topo
log
y.
#
proc tb-elab-in-elab-topology
{
topo
}
{
var_import ::GLOBALS::elabinelab_topo
...
...
@@ -1746,6 +1754,34 @@ proc tb-elabinelab-singlenet {args} {
set elabinelab_singlenet $onoff
}
#
# Set/clear elabinelab attributes:
# tb-set-elabinelab-attribute <role> <key> <value>
[
<order>
]
# tb-unset-elabinelab-attribute <role> <key>
#
proc tb-set-elabinelab-attribute
{
role key value
{
order 0
}}
{
if
{[
regexp $EINEROLE $role
]
== 0
}
{
perror
"
\[
tb-set-elabinelab-attribute] -
$role
is not a valid elabinelab role"
return
}
if
{[
regexp $EINEKEY $key
]
== 0
}
{
perror
"
\[
tb-set-elabinelab-attribute] -
\"
$key
\"
is not a valid elabinelab key"
return
}
if
{[
regexp $EINEVALUE $value
]
== 0
}
{
perror
"
\[
tb-set-elabinelab-attribute] -
\"
$value
\"
is not a valid elabinelab value"
return
}
if
{[
regexp $EINEORDER $order
]
== 0
}
{
perror
"
\[
tb-set-elabinelab-attribute] -
$order
is not a valid elabinelab order"
return
}
}
proc tb-unset-elabinelab-attribute
{
role key
}
{
}
#
# Set the inner elab role for a node.
#
...
...
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