From 32d1564cd1903e1a2b4f495ae36ef4d0ac982960 Mon Sep 17 00:00:00 2001 From: marko Date: Thu, 1 Nov 2007 11:11:06 +0000 Subject: [PATCH] Nuke away the cleanupCfg function, which provided functionality redundant to vimageCleanup. Bug found by: Submitted by: Reviewed by: Approved by: Obtained from: --- exec.tcl | 74 ++------------------------------------------------------ 1 file changed, 2 insertions(+), 72 deletions(-) diff --git a/exec.tcl b/exec.tcl index ef536a2..580d1e4 100755 --- a/exec.tcl +++ b/exec.tcl @@ -1,4 +1,4 @@ -# $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. # @@ -92,7 +92,7 @@ proc nexec { args } { # 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. #**** @@ -833,76 +833,6 @@ proc execSetLinkParams { eid link } { 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 -- 2.39.5