Commit 54b18556 authored by Leigh Stoller's avatar Leigh Stoller

tb-set-ip-routing command for Mike and router support. Remove the

previous tb-set-node-routertype, and replace with a global directive
that sets the router for the entire NS file (all nodes). Also change
from "gated" to "ospf". New command is:

	tb-set-ip-routing "none|ospf"
parent 27a9cbab
...@@ -40,7 +40,6 @@ Node instproc init {s} { ...@@ -40,7 +40,6 @@ Node instproc init {s} {
$self set deltas "" $self set deltas ""
$self set tarfiles "" $self set tarfiles ""
$self set failureaction "fatal" $self set failureaction "fatal"
$self set routertype "none"
} }
# The following procs support renaming (see README) # The following procs support renaming (see README)
...@@ -81,6 +80,7 @@ Node instproc updatedb {DB} { ...@@ -81,6 +80,7 @@ Node instproc updatedb {DB} {
$self instvar routertype $self instvar routertype
var_import ::GLOBALS::pid var_import ::GLOBALS::pid
var_import ::GLOBALS::eid var_import ::GLOBALS::eid
var_import ::GLOBALS::default_ip_routing_type
# If we haven't specified a osid so far then we should fill it # If we haven't specified a osid so far then we should fill it
# with the id from the node_types table now. # with the id from the node_types table now.
...@@ -99,7 +99,7 @@ Node instproc updatedb {DB} { ...@@ -99,7 +99,7 @@ Node instproc updatedb {DB} {
} }
# Update the DB # Update the DB
sql exec $DB "insert into virt_nodes (pid,eid,vname,type,ips,osid,cmd_line,rpms,deltas,startupcmd,tarfiles,failureaction,routertype) values (\"$pid\",\"$eid\",\"$self\",\"$type\",\"$ipraw\",\"$osid\",\"$cmdline\",\"$rpms\",\"$deltas\",\"$startup\",\"$tarfiles\",\"$failureaction\",\"$routertype\")"; sql exec $DB "insert into virt_nodes (pid,eid,vname,type,ips,osid,cmd_line,rpms,deltas,startupcmd,tarfiles,failureaction,routertype) values (\"$pid\",\"$eid\",\"$self\",\"$type\",\"$ipraw\",\"$osid\",\"$cmdline\",\"$rpms\",\"$deltas\",\"$startup\",\"$tarfiles\",\"$failureaction\",\"$default_ip_routing_type\")";
} }
# add_lanlink lanlink # add_lanlink lanlink
......
...@@ -139,6 +139,9 @@ namespace eval GLOBALS { ...@@ -139,6 +139,9 @@ namespace eval GLOBALS {
# This will hold the handle for the database connection # This will hold the handle for the database connection
variable DB {} variable DB {}
# These are going to be default values within the NS file.
variable default_ip_routing_type "none"
} }
# Connect to the DB # Connect to the DB
......
...@@ -151,17 +151,19 @@ proc tb-set-node-deltas {node args} { ...@@ -151,17 +151,19 @@ proc tb-set-node-deltas {node args} {
} }
$node set deltas [join $args :] $node set deltas [join $args :]
} }
proc tb-set-node-routertype {node type} { proc tb-set-ip-routing {type} {
var_import ::GLOBALS::default_ip_routing_type
if {$type == {}} { if {$type == {}} {
perror "\[tb-set-node-routertype] No type given." perror "\[tb-set-ip-routing] No type given."
return return
} }
if {($type != "none") && if {($type != "none") &&
($type != "gated")} { ($type != "ospf")} {
perror "\[tb-set-node-routertype] Type is not one of none|gated" perror "\[tb-set-ip-routing] Type is not one of none|ospf"
return return
} }
$node set routertype $type set default_ip_routing_type $type
} }
# Lan/Link state routines. # Lan/Link state routines.
......
...@@ -19,4 +19,4 @@ proc tb-set-node-lan-bandwidth {node lan bw} {} ...@@ -19,4 +19,4 @@ proc tb-set-node-lan-bandwidth {node lan bw} {}
proc tb-set-node-lan-loss {node lan loss} {} proc tb-set-node-lan-loss {node lan loss} {}
proc tb-set-node-lan-params {node lan delay bw loss} {} proc tb-set-node-lan-params {node lan delay bw loss} {}
proc tb-set-node-failure-action {node type} {} proc tb-set-node-failure-action {node type} {}
proc tb-set-node-routertype {node type} {} proc tb-set-ip-routing {type} {}
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