Commit 1c0efe2c authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

By the pervision of TCL, I have hidden the details:

	source tb_compat.tcl
	set ns [new Simulator]

	tb-elab-in-elab 1
	tb-set-inner-elab-eid two-simple
	tb-set-security-level Red

	$ns run

tbsetup/ns2ir/elabinelab.ns has all the goo, which is sourced from the
NS run subroutine, using "uplevel 1" so that the context is correct.
You can of course include you own goo, in which case the default goo
will be skipped.
parent 1f16a276
source tb_compat.tcl #
# This file is intended to be included into another NS file. It is not
set ns [new Simulator] # a stand alone file.
#
set maxpcs @MAXPCS@
set security_level @SECURITY_LEVEL@
set myboss [$ns node] set myboss [$ns node]
set myops [$ns node] set myops [$ns node]
tb-set-hardware $myboss pc2000 tb-set-hardware $myboss pc2000
tb-set-hardware $myops pc850 tb-set-hardware $myops pc850
tb-elab-in-elab 1
tb-set-node-inner-elab-role $myboss boss tb-set-node-inner-elab-role $myboss boss
tb-set-node-inner-elab-role $myops ops tb-set-node-inner-elab-role $myops ops
#
# This is passed in by the parser, when wrapping an existing experiment.
# The parser wrapper gets info about the wrapped experiment and passes it
# along in the TBCOMPAT namespace.
#
if { ${::TBCOMPAT::elabinelab_maxpcs} != 0 } {
set maxpcs ${::TBCOMPAT::elabinelab_maxpcs}
} else {
set maxpcs 0
}
set lanstr "myboss myops " set lanstr "myboss myops "
for {set i 1} {$i <= $maxpcs} {incr i} { for {set i 1} {$i <= $maxpcs} {incr i} {
set name "mypc${i}" set name "mypc${i}"
...@@ -22,7 +29,6 @@ for {set i 1} {$i <= $maxpcs} {incr i} { ...@@ -22,7 +29,6 @@ for {set i 1} {$i <= $maxpcs} {incr i} {
append lanstr "[set $name] " append lanstr "[set $name] "
tb-set-node-os [set $name] FBSD-STD tb-set-node-os [set $name] FBSD-STD
tb-set-node-inner-elab-role [set $name] node tb-set-node-inner-elab-role [set $name] node
# tb-set-hardware [set $name] pc600
} }
set publiclan [$ns make-lan $lanstr 100Mb 0ms] set publiclan [$ns make-lan $lanstr 100Mb 0ms]
...@@ -37,13 +43,14 @@ tb-set-node-os $myboss FBSD410-UPDATE ...@@ -37,13 +43,14 @@ tb-set-node-os $myboss FBSD410-UPDATE
tb-set-node-cmdline $myboss /kernel.linkdelay tb-set-node-cmdline $myboss /kernel.linkdelay
tb-set-node-os $myops FBSD410-UPDATE tb-set-node-os $myops FBSD410-UPDATE
if {$security_level >= 2} { if {${::GLOBALS::security_level} >= 2} {
# Set up a firewall # Set up a firewall
set fw [new Firewall $ns] set fw [new Firewall $ns]
$fw set-type ipfw2-vlan $fw set-type ipfw2-vlan
$fw set-style open
if {${::GLOBALS::security_level} == 2} {
$fw set-style open
} else {
$fw set-style closed
}
} }
# No routing!
$ns run
...@@ -278,6 +278,10 @@ Simulator instproc run {} { ...@@ -278,6 +278,10 @@ Simulator instproc run {} {
return return
} }
if {$elab_in_elab && [llength [array names node_list]] == 0} {
uplevel 1 source "@prefix@/lib/ns2ir/elabinelab.ns"
}
# Fill out IPs # Fill out IPs
if {! $use_ipassign } { if {! $use_ipassign } {
foreach obj [concat [array names lanlink_list]] { foreach obj [concat [array names lanlink_list]] {
......
...@@ -267,7 +267,7 @@ if (! TBExptSecurityLevel($pid, $eid, \$security_level)) { ...@@ -267,7 +267,7 @@ if (! TBExptSecurityLevel($pid, $eid, \$security_level)) {
fatal("Could not get security_level from DB!"); fatal("Could not get security_level from DB!");
} }
if ($security_level >= TBDB_SECLEVEL_ORANGE()) { if (0 && $security_level >= TBDB_SECLEVEL_ORANGE()) {
my $elabinelab_eid = $eid . "-" . "elabinelab"; my $elabinelab_eid = $eid . "-" . "elabinelab";
my $tempnsfile = "/tmp/$pid-$elabinelab_eid-$$.nsfile"; my $tempnsfile = "/tmp/$pid-$elabinelab_eid-$$.nsfile";
my $maxnodes; my $maxnodes;
......
Markdown is supported
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