set node [lindex [$c gettags {node && current}] 1]
set node_id $eid\_$node
if { $node != "" && $oper_mode == "exec" } {
- set cmd ""
- set type [nodeType $node]
- set model [getNodeModel $node]
- switch -exact -- $type {
- router {
- switch -exact -- $model {
- quagga {
- set cmd "vtysh"
- }
- xorp {
- set cmd "/usr/local/xorp/bin/xorpsh"
- }
- static {
- set cmd "$env(SHELL)"
- }
- }
- }
- host {
- set cmd "$env(SHELL)"
- }
- pc {
- set cmd "$env(SHELL)"
- }
- }
+ set cmd [[typemodel $node].shellcmd $node]
if { $cmd != "" } {
exec xterm -sb -rightbar \
-T "IMUNES: [getNodeName $node] (console)" \
if {[lsearch {router pc host} $type] >= 0} {
#
- # Static IP routes
+ # Static routes
#
set routes [getStatIPv4routes $target]
labelframe $wi.statrt -padx 4 -pady 4
- label $wi.statrt.label -text "Static IP routes:"
+ label $wi.statrt.label -text "Static routes:"
pack $wi.statrt.label -side top -anchor w
frame $wi.statrt.tab -width 10
frame $wi.statrt.tab1 -width 10
foreach route $routes {
$wi.statrt.cfg.text insert end "$route\r"
}
- if { $model == "xorp" && $oper_mode != "edit" } {
- $wi.statrt.cfg.text configure -state disabled
- }
pack $wi.statrt.cfg.text -expand yes
pack $wi.statrt.tab $wi.statrt.cfg $wi.statrt.tab1 -side left
pack $wi.statrt -side top -anchor w -fill both
}
+proc router.quagga.shellcmd { node } {
+ return "vtysh"
+}
+
+
proc router.quagga.instantiate { eid node } {
set node_id "$eid\_$node"
l3node.instantiate $eid $node
}
+proc router.static.shellcmd { node } {
+ global env
+ return "$env(SHELL)"
+}
+
+
proc router.static.instantiate { eid node } {
set node_id "$eid\_$node"
l3node.instantiate $eid $node
}
+proc router.xorp.shellcmd { node } {
+ return "/usr/local/xorp/bin/xorpsh"
+}
+
+
proc router.xorp.instantiate { eid node } {
set node_id "$eid\_$node"
l3node.instantiate $eid $node