Commit b12dad65 authored by Timothy Stack's avatar Timothy Stack

nsverify stuff: Fix a regression wrt to firewalls and handle

security-level.
parent cacc42dd
......@@ -8,6 +8,10 @@
# This is a nop tb_compact.tcl file that should be used when running scripts
# under ns.
namespace eval GLOBALS {
variable security_level 0
}
proc tb-set-ip {node ip} {}
proc tb-set-ip-interface {src dst ip} {}
proc tb-set-ip-link {src link ip} {}
......@@ -68,12 +72,38 @@ proc tb-elab-in-elab-topology {topo} {}
proc tb-set-inner-elab-eid {eid} {}
proc tb-set-elabinelab-cvstag {cvstag} {}
proc tb-set-node-inner-elab-role {node role} {}
proc tb-set-security-level {level} {}
proc tb-set-node-id {vnode myid} {}
proc tb-set-link-est-bandwidth {srclink args} {}
proc tb-set-lan-est-bandwidth {lan bw} {}
proc tb-set-node-lan-est-bandwidth {node lan bw} {}
proc tb-set-security-level {level} {
switch -- $level {
"Green" {
set level 0
}
"Blue" {
set level 1
}
"Yellow" {
set level 2
}
"Orange" {
set level 3
}
"Red" {
perror "\[tb-set-security-level] Red security not implemented yet"
return
}
unknown {
perror "\[tb-set-security-level] $level is not a valid level"
return
}
}
set ::GLOBALS::security_level $level
}
#
# Set the startup command for a node. Replaces the tb-set-node-startup
# command above, but we have to keep that one around for a while. This
......@@ -116,9 +146,12 @@ Program instproc unknown {m args} {
Class Firewall
Firewall instproc init {args} {
Firewall instproc init {sim args} {
global last_fw
set last_fw $self
global last_fw_node
real_set tmp [$sim node]
real_set last_fw $self
real_set last_fw_node $tmp
}
Firewall instproc unknown {m args} {
......@@ -213,6 +246,9 @@ Node instproc console {} {
return [new Console]
}
Node instproc unknown {m args} {
}
Simulator instproc connect {src dst} {
}
......
......@@ -6,6 +6,7 @@ variable last_lan {}
variable last_link {}
variable last_sim {}
variable last_fw {}
variable last_fw_node {}
# arrays mapping tcl hostnames to variable names
variable hosts
variable lans
......@@ -20,7 +21,7 @@ proc puts {args} {
rename set real_set
proc set {args} {
global last_host last_lan last_link last_sim last_fw
global last_host last_lan last_link last_sim last_fw last_fw_node
global hosts lans links simname
if {[llength $args] == 1} {
......@@ -62,7 +63,7 @@ proc set {args} {
} elseif {$rval == $last_sim} {
real_set simname $var
} elseif {$rval == $last_fw} {
array set hosts [list $last_fw $val]
array set hosts [list $last_fw_node $val]
} else {
real_set do_rename 0
}
......
......@@ -184,6 +184,12 @@ Simulator instproc addLTLink { linkref {qtype DropTail} } {
Simulator instproc run {args} {
global simname
if {${::GLOBALS::security_level} >= 1} {
global fw
set fw [new Firewall $self]
}
join_lans
output
real_puts "s $simname"
......
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