Commit 210e4955 authored by Ryan Jackson's avatar Ryan Jackson
Browse files

Add new setting for firewalled elabinelab

parent 94132262
......@@ -19,7 +19,7 @@ if {${::GLOBALS::explicit_firewall}} {
set fw [new Firewall $ns]
set ::GLOBALS::security_level $sl
$fw set-type ipfw2-vlan
$fw set-type ${::GLOBALS::elabinelab_fw_type}
if {${::GLOBALS::security_level} == 1} {
$fw set-style basic
......
......@@ -9,6 +9,7 @@
# under ns.
namespace eval GLOBALS {
variable elabinelab_fw_type "ipfw2-vlan"
variable security_level 0
variable pid {}
variable gid {}
......@@ -139,6 +140,26 @@ proc tb-set-security-level {level} {
set ::GLOBALS::security_level $level
}
#
# Set firewall type for firewalled elabinelab experiments
#
proc tb-set-elabinelab-fw-type {type} {
switch -- $type {
"ipfw2-vlan" {
set type "ipfw2-vlan"
}
"iptables-vlan" {
set type "iptables-vlan"
}
unknown {
perror "\[tb-set-elabinelab-fw-type] $type is not a valid type"
return
}
}
set ::GLOBALS::elabinelab_fw_type $type
}
#
# 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
......
......@@ -13,6 +13,7 @@ namespace eval TBCOMPAT {
var_import ::GLOBALS::DB
var_import ::GLOBALS::pid
var_import ::GLOBALS::eid
var_import ::GLOBALS::elabinelab_fw_type
# This is regular expression that matches slightly more than valid
# IP addresses. The only thing it doesn't check is that IP
......@@ -2186,6 +2187,27 @@ proc tb-set-security-level {level} {
set security_level $level
}
#
# Set firewall type for firewalled elabinelab experiments
#
proc tb-set-elabinelab-fw-type {type} {
var_import ::GLOBALS::elabinelab_fw_type
switch -- $type {
"ipfw2-vlan" {
set type "ipfw2-vlan"
}
"iptables-vlan" {
set type "iptables-vlan"
}
unknown {
perror "\[tb-set-elabinelab-fw-type] $type is not a valid type"
return
}
}
set elabinelab_fw_type $type
}
#
# Set numeric ID (this is a mote thing)
#
......
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