--- /dev/null
+#****f* appstart.tcl/spawnShell
+# NAME
+# spawnShell -- spawn shell
+# SYNOPSIS
+# spawnShell $node $cmd
+# FUNCTION
+# This procedure spawns a new shell for a specified node.
+# The shell is specified in cmd parameter.
+# INPUTS
+# * node -- node id of the node for which the shell
+# is spawned.
+# * cmd -- the path to the shell.
+#****
+proc spawnShell { node cmd } {
+ upvar 0 ::cf::[set ::curcfg]::eid eid
+ global remote_exec exec_host gui_unix
+
+ set node_id $eid\.$node
+
+ if { $remote_exec } {
+ nexec vimageShellServer.sh $node_id 1234 $cmd &
+ if { $gui_unix } {
+ exec xterm -sb -rightbar \
+ -T "IMUNES: [getNodeName $node] (console)" \
+ -e "nc $exec_host 1234" &
+ } else {
+ exec cmd /c nc $exec_host 1234 &
+ }
+ } else {
+ nexec xterm -sb -rightbar \
+ -T "IMUNES: [getNodeName $node] (console)" \
+ -e "vimage $node_id $cmd" &
+ }
+}
+
+
+#****f* appstart.tcl/startethereal
+# NAME
+# startethereal -- start ethereal
+# SYNOPSIS
+# startethereal $node $iface
+# FUNCTION
+# This procedure starts ethereal for the specified node
+# and the specified interface.
+# INPUTS
+# * node -- node id
+# * iface -- interface name
+#****
+proc startethereal { node iface } {
+ upvar 0 ::cf::[set ::curcfg]::eid eid
+
+ set interface "$iface@$eid\.$node"
+ nexec wireshark -i $interface -f " " &
+}
+
+
+#****f* appstart.tcl/startopera
+# NAME
+# startopera -- start opera
+# SYNOPSIS
+# startopera $node
+# FUNCTION
+# This procedure starts opera on the specified node
+# INPUTS
+# * node -- node id
+# * iface -- interface name
+#****
+proc startopera { node } {
+ upvar 0 ::cf::[set ::curcfg]::eid eid
+
+ # set interface "$iface@$eid\.$node"
+ nexec startopera $eid.$node &
+}
+
}
-#****f* editor.tcl/spawnShell
-# NAME
-# spawnShell -- spawn shell
-# SYNOPSIS
-# spawnShell $node $cmd
-# FUNCTION
-# This procedure spawns a new shell for a specified node.
-# The shell is specified in cmd parameter.
-# INPUTS
-# * node -- node id of the node for which the shell
-# is spawned.
-# * cmd -- the path to the shell.
-#****
-proc spawnShell { node cmd } {
- upvar 0 ::cf::[set ::curcfg]::eid eid
- global remote_exec exec_host gui_unix gui_freebsd gui_linux
-
- set node_id $eid\.$node
-
- if { $remote_exec } {
- nexec vimageShellServer.sh $node_id 1234 $cmd &
- if { $gui_unix } {
- exec xterm -sb -rightbar \
- -T "IMUNES: [getNodeName $node] (console)" \
- -e "nc $exec_host 1234" &
- } else {
- exec cmd /c nc $exec_host 1234 &
- }
- } else {
- if { $gui_freebsd } {
- set shellcommand "vimage $node_id $cmd"
- } elseif { $gui_linux } {
- if { $cmd == "enter" } {
- set shellcommand "vzctl enter $node"
- } else {
- set shellcommand "vzctl exec $node $cmd"
- }
- }
- nexec xterm -sb -rightbar \
- -T "IMUNES: [getNodeName $node] (console)" \
- -e "$shellcommand" &
- }
-}
-
-
-#****f* editor.tcl/startethereal
-# NAME
-# startethereal -- start ethereal
-# SYNOPSIS
-# startethereal $node $iface
-# FUNCTION
-# This procedure starts ethereal for the specified node
-# and the specified interface.
-# INPUTS
-# * node -- node id
-# * iface -- interface name
-#****
-proc startethereal { node iface } {
- upvar 0 ::cf::[set ::curcfg]::eid eid
- global gui_unix gui_linux
-
- #OpenVZ - lokalni interface-i za VE-ve, imaju drukciju nomenklaturu
- if { $gui_unix && $gui_linux } {
- set interface "to_[set node]_[set iface]"
- } else {
- set interface "$iface@$eid\.$node"
- }
-
- nexec wireshark -i $interface -f " " &
-}
-
-
-#****f* editor.tcl/startopera
-# NAME
-# startopera -- start opera
-# SYNOPSIS
-# startopera $node
-# FUNCTION
-# This procedure starts opera on the specified node
-# INPUTS
-# * node -- node id
-# * iface -- interface name
-#****
-proc startopera { node } {
- upvar 0 ::cf::[set ::curcfg]::eid eid
-
- # set interface "$iface@$eid\.$node"
- nexec startopera $eid.$node &
-}
-
-
#****f* editor.tcl/button1
# NAME
# button1
}
source "$ROOTDIR/$LIBDIR/editor.tcl"
+
+if { $gui_unix && $gui_linux } {
+ source "$ROOTDIR/$LIBDIR/linux/appstart.tcl"
+} else {
+ source "$ROOTDIR/$LIBDIR/appstart.tcl"
+}
+
source "$ROOTDIR/$LIBDIR/copypaste.tcl"
source "$ROOTDIR/$LIBDIR/annotations.tcl"
chmod 755 $ROOTDIR/$BINDIR/imunes
lib_files="nodecfg.tcl linkcfg.tcl cfgparse.tcl ipv4.tcl ipv6.tcl exec.tcl \
- canvas.tcl editor.tcl filemgmt.tcl help.tcl initgui.tcl \
+ canvas.tcl editor.tcl appstart.tcl filemgmt.tcl help.tcl initgui.tcl \
copypaste.tcl quagga.tcl xorp.tcl static.tcl pc.tcl host.tcl \
lanswitch.tcl rj45.tcl hub.tcl ns2imunes.tcl ipsec.tcl \
topogen.tcl annotations.tcl gpgui.tcl graph_partitioning.tcl \
--- /dev/null
+#****f* appstart.tcl/spawnShell
+# NAME
+# spawnShell -- spawn shell
+# SYNOPSIS
+# spawnShell $node $cmd
+# FUNCTION
+# This procedure spawns a new shell for a specified node.
+# The shell is specified in cmd parameter.
+# INPUTS
+# * node -- node id of the node for which the shell
+# is spawned.
+# * cmd -- the path to the shell.
+#****
+proc spawnShell { node cmd } {
+ upvar 0 ::cf::[set ::curcfg]::eid eid
+ global remote_exec exec_host gui_unix gui_freebsd gui_linux
+
+ set node_id $eid\.$node
+
+ if { $remote_exec } {
+ nexec vimageShellServer.sh $node_id 1234 $cmd &
+ if { $gui_unix } {
+ exec xterm -sb -rightbar \
+ -T "IMUNES: [getNodeName $node] (console)" \
+ -e "nc $exec_host 1234" &
+ } else {
+ exec cmd /c nc $exec_host 1234 &
+ }
+ } else {
+ if { $gui_freebsd } {
+ set shellcommand "vimage $node_id $cmd"
+ } elseif { $gui_linux } {
+ if { $cmd == "enter" } {
+ set shellcommand "vzctl enter $node"
+ } else {
+ set shellcommand "vzctl exec $node $cmd"
+ }
+ }
+ nexec xterm -sb -rightbar \
+ -T "IMUNES: [getNodeName $node] (console)" \
+ -e "$shellcommand" &
+ }
+}
+
+
+
+#****f* appstart.tcl/startethereal
+# NAME
+# startethereal -- start ethereal
+# SYNOPSIS
+# startethereal $node $iface
+# FUNCTION
+# This procedure starts ethereal for the specified node
+# and the specified interface.
+# INPUTS
+# * node -- node id
+# * iface -- interface name
+#****
+proc startethereal { node iface } {
+ upvar 0 ::cf::[set ::curcfg]::eid eid
+ global gui_unix gui_linux
+
+ #OpenVZ - lokalni interface-i za VE-ve, imaju drukciju nomenklaturu
+ if { $gui_unix && $gui_linux } {
+ set interface "to_[set node]_[set iface]"
+ } else {
+ set interface "$iface@$eid\.$node"
+ }
+
+ nexec wireshark -i $interface -f " " &
+}
+
+
+#****f* appstart.tcl/startopera
+# NAME
+# startopera -- start opera
+# SYNOPSIS
+# startopera $node
+# FUNCTION
+# This procedure starts opera on the specified node
+# INPUTS
+# * node -- node id
+# * iface -- interface name
+#****
+proc startopera { node } {
+ upvar 0 ::cf::[set ::curcfg]::eid eid
+
+ # set interface "$iface@$eid\.$node"
+ nexec startopera $eid.$node &
+}
+