Commit 2ab334c1 authored by Mike Hibler's avatar Mike Hibler
Browse files

Accept 'emulab' style firewall

parent 2e3339ca
...@@ -28,7 +28,7 @@ Firewall instproc init {s} { ...@@ -28,7 +28,7 @@ Firewall instproc init {s} {
$self set cmdline "" $self set cmdline ""
$self set parent "" $self set parent ""
$self set next_rule 1 $self set next_rule 100
$self instvar rules $self instvar rules
array set rules {} array set rules {}
...@@ -78,10 +78,16 @@ Firewall instproc set-type {targ} { ...@@ -78,10 +78,16 @@ Firewall instproc set-type {targ} {
Firewall instproc set-style {starg} { Firewall instproc set-style {starg} {
$self instvar style $self instvar style
if {$starg == "open" || $starg == "closed" || $starg == "basic"} { switch -- $starg {
set style $starg "closed" -
} else { "basic" -
perror "\[set-style] unsupported firewall style: $starg" "emulab" -
"open" {
set style $starg
}
default {
perror "\[set-style] unsupported firewall style: $starg"
}
} }
} }
...@@ -102,8 +108,8 @@ Firewall instproc add-rule {rule} { ...@@ -102,8 +108,8 @@ Firewall instproc add-rule {rule} {
Firewall instproc add-numbered-rule {num rule} { Firewall instproc add-numbered-rule {num rule} {
$self instvar rules $self instvar rules
if {$num >= 50000} { if {$num < 100 || $num >= 50000} {
perror "\[add-numbered-rule] rule number must be < 50000!" perror "\[add-numbered-rule] 100 <= rule_number < 50000!"
return return
} }
if {[info exists rules($num)]} { if {[info exists rules($num)]} {
......
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