-# $Id: exec.tcl,v 1.61 2007/11/01 10:42:27 marko Exp $
+# $Id: exec.tcl,v 1.62 2007/11/01 11:11:06 marko Exp $
# Copyright 2004, 2005 University of Zagreb, Croatia. All rights reserved.
#
# editor mode (editor_only variable is set).
# When changing the mode to edit, all required buttons are enabled
# (except for simulation/Terminate button that is disabled) and
-# procedure cleanupCfg is called.
+# procedure vimageCleanup is called.
# INPUTS
# * mode -- the new operating mode. Can be edit or exec.
#****
downstream={ BER=$ber duplicate=$dup } }"
}
-#****f* exec.tcl/cleanupCfg
-# NAME
-# cleanupCfg -- cleanup configuration
-# SYNOPSIS
-# cleanupCfg
-# FUNCTION
-# Called upon the termination of the simulation. If cleans all
-# the imunes objects created by the simulation that is terminated.
-# Operates in three steps, first shutdowns all the nodes, than all
-# the links and on the end destroys all the nodes.
-#****
-proc cleanupCfg { } {
- global .c link_list eid node_list
-
- set t_start [clock seconds]
-
-#shutting down nodes...
-
- foreach node $node_list {
- set type [nodeType $node]
- set name [getNodeName $node]
- if { $type != "pseudo" } {
- statline "Shutting down node $name"
- [typemodel $node].shutdown $eid $node
- }
- }
-
-#shutting down links...
-
- for { set pending_links $link_list } { $pending_links != "" } {} {
- set link [lindex $pending_links 0]
- set i [lsearch -exact $pending_links $link]
- set pending_links [lreplace $pending_links $i $i]
-
- set lnode1 [lindex [linkPeers $link] 0]
- set lnode2 [lindex [linkPeers $link] 1]
- set ifname1 [ifcByPeer $lnode1 $lnode2]
- set ifname2 [ifcByPeer $lnode2 $lnode1]
-
- if { [getLinkMirror $link] != "" } {
- set mirror_link [getLinkMirror $link]
- set i [lsearch -exact $pending_links $mirror_link]
- set pending_links [lreplace $pending_links $i $i]
-
- set p_lnode2 $lnode2
- set lnode2 [lindex [linkPeers $mirror_link] 0]
- set ifnode2 [ifcByPeer $lnode2 [getNodeMirror $p_lnode2]]
- }
- set lname $lnode1-$lnode2
- statline "Shutting down netgraph node $lname"
- catch "nexec vimage $eid ngctl msg $lname: shutdown"
- }
-
-
-#destroying nodes...
-
- foreach node $node_list {
- set type [nodeType $node]
- set name [getNodeName $node]
- if { $type != "pseudo" } {
- statline "Destroying node $node"
- [typemodel $node].destroy $eid $node
- }
- }
-
-#all the rest...
- catch { nexec rm -f /usr/local/etc/quagga/Quagga.conf }
- statline "Cleanup completed in [expr [clock seconds] - $t_start] seconds."
-
-}
#****f* exec.tcl/openFwrd
# NAME