From f77d4d79e946cd6171e1c577daa8bb25b3f195c9 Mon Sep 17 00:00:00 2001 From: numa Date: Thu, 3 Sep 2009 12:20:10 +0200 Subject: [PATCH] jos debugginga i dokumentacija prvog vimage -c poziva (u deployCfg) (cherry picked from commit b7de5d9c8ef1b2044e6c7a1cb9e00443a9b3cb40) Signed-off-by: Josip Rodin --- exec.tcl | 66 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/exec.tcl b/exec.tcl index 8e355ff..b6a77e0 100755 --- a/exec.tcl +++ b/exec.tcl @@ -231,7 +231,9 @@ proc statline {line} { #**** proc createIfc { eid type hook } { puts "usli u createIfc $eid $type $hook" - return false + puts " izvrsili bismo exec printf mkpeer $type $hook $hook \n show .$hook | vimage $eid ngctl -f -" + puts " izvadili bi drugi element iz toga" + return fake_if_id catch { exec printf "mkpeer $type $hook $hook \n show .$hook" | vimage $eid ngctl -f - } nglist return [lindex $nglist 1] } @@ -461,13 +463,13 @@ proc l3node.start { eid node } { #**** proc l3node.shutdown { eid node } { set node_id "$eid\.$node" - catch "nexec vimage $node_id kill -9 -1 2> /dev/null" + puts "nexec vimage $node_id kill -9 -1 2> /dev/null" foreach ifc [ifcList $node] { foreach ipv4 [getIfcIPv4addr $node $ifc] { - catch "nexec vimage $node_id ifconfig $ifc $ipv4 -alias" + puts "nexec vimage $node_id ifconfig $ifc $ipv4 -alias" } foreach ipv6 [getIfcIPv6addr $node $ifc] { - catch "nexec vimage $node_id ifconfig $ifc inet6 $ipv6 -alias" + puts "nexec vimage $node_id ifconfig $ifc inet6 $ipv6 -alias" } } } @@ -489,14 +491,14 @@ proc l3node.shutdown { eid node } { proc l3node.destroy { eid node } { set node_id $node foreach ifc [ifcList $node] { - catch { nexec vimage $eid ngctl msg $ifc@$node_id: shutdown } + puts { nexec vimage $eid ngctl msg $ifc@$node_id: shutdown } set ifnum [string range $ifc 3 end] set ifname [string range $ifc 0 2] if { $ifname == "ser" } { - catch { nexec vimage $eid ngctl msg hdlc$ifnum@$node_id: shutdown } + puts { nexec vimage $eid ngctl msg hdlc$ifnum@$node_id: shutdown } } } - catch {nexec vimage -d $node_id} + puts {nexec vimage -d $node_id} set node_dir "/tmp/$eid/$node" nexec rm -fr $node_dir } @@ -532,18 +534,22 @@ proc deployCfg {} { set t_start [clock seconds] - catch { nexec vimage -c $eid } - catch { nexec rm -fr /tmp/$eid } - catch { nexec mkdir /tmp/$eid } - - catch { nexec kldload ng_ether } - catch { nexec kldload ng_iface } - catch { nexec kldload ng_eiface } - catch { nexec kldload ng_cisco } - catch { nexec kldload ng_pipe } - catch { nexec kldload ng_hub } - catch { nexec kldload ng_bridge } - catch { nexec kldload ng_socket } +# na FreeBSD-u napravi jedan osnovni vimage unutar kojeg ce drzati +# network peeringe izmedju nodeova +# na Linuxu to necemo napraviti jer ne mozemo dirati network linkove +# jednog VEa iz drugog, pa ce to sve biti na parent hostu + puts " nexec vimage -c $eid " + puts " nexec rm -fr /tmp/$eid " + puts " nexec mkdir /tmp/$eid " + +# puts { nexec kldload ng_ether } +# puts { nexec kldload ng_iface } +# puts { nexec kldload ng_eiface } +# puts { nexec kldload ng_cisco } +# puts { nexec kldload ng_pipe } +# puts { nexec kldload ng_hub } +# puts { nexec kldload ng_bridge } +# puts { nexec kldload ng_socket } foreach node $node_list { set node_id "$eid\.$node" @@ -630,10 +636,10 @@ proc deployCfg {} { # XXX race if starting two imunes instances simultaneously nexec rm -fr /var/run/quagga nexec rm -f /usr/local/etc/quagga/Quagga.conf - catch { nexec ln -s /tmp/$eid/@ /var/run/quagga } - catch { nexec ln -s /tmp/$eid/@/boot.conf /usr/local/etc/quagga/Quagga.conf } + puts { nexec ln -s /tmp/$eid/@ /var/run/quagga } + puts { nexec ln -s /tmp/$eid/@/boot.conf /usr/local/etc/quagga/Quagga.conf } foreach file { bgpd ospfd ospf6d ripd ripngd vtysh zebra } { - catch { nexec cp /dev/null /usr/local/etc/quagga/$file.conf } + puts { nexec cp /dev/null /usr/local/etc/quagga/$file.conf } } foreach node $node_list { @@ -683,7 +689,7 @@ proc vimageCleanup { eid } { } else { # wm title $wi "Please wait ..." set w .timewait - catch {destroy $w} + puts {destroy $w} toplevel $w -takefocus 1 wm geometry $w +150+150 wm title $w "Please wait ..." @@ -724,7 +730,7 @@ Please don't try killing the process. foreach vimage $vimages { set stattxt "Terminating processes in vimage $vimage" statline $stattxt - catch {nexec vimage $eid.$vimage kill -9 -1 2> /dev/null} + puts {nexec vimage $eid.$vimage kill -9 -1 2> /dev/null} } # Detach / destroy / reassign interfaces pipe, eiface, iface, bridge @@ -733,22 +739,22 @@ Please don't try killing the process. foreach ngline $ngnodes { set node [lindex [eval list $ngline] 1] statline "Shutting down netgraph node $node" - catch "nexec vimage $eid ngctl msg $node: shutdown" + puts "nexec vimage $eid ngctl msg $node: shutdown" } # Shut down all vimages foreach vimage $vimages { set stattxt "Shutting down vimage $vimage" statline $stattxt - catch {nexec vimage $eid.$vimage kill -9 -1 2> /dev/null} + puts {nexec vimage $eid.$vimage kill -9 -1 2> /dev/null} while { [catch {nexec vimage -d $eid.$vimage}] } { set stattxt $stattxt. statline $stattxt - catch {nexec vimage $eid.$vimage kill -9 -1 2> /dev/null} + puts {nexec vimage $eid.$vimage kill -9 -1 2> /dev/null} } } - catch { nexec vimage -d $eid } - catch { nexec rm -f /usr/local/etc/quagga/Quagga.conf } + puts { nexec vimage -d $eid } + puts { nexec rm -f /usr/local/etc/quagga/Quagga.conf } nexec rm -fr "/tmp/$eid" statline "Cleanup completed in [expr [clock seconds] - $t_start] seconds." } @@ -963,7 +969,7 @@ proc openFwrd { lPort rPort rHost } { proc closeFwrd { pid } { global tcl_platform platform if { $tcl_platform(platform) == "unix" } { - catch {eval exec kill $pid} + puts {eval exec kill $pid} return "" } } -- 2.39.5