]> git.entuzijast.net Git - imunes.git/commitdiff
Initial import
authormarko <marko>
Mon, 14 Mar 2005 08:37:03 +0000 (08:37 +0000)
committermarko <marko>
Mon, 14 Mar 2005 08:37:03 +0000 (08:37 +0000)
README [new file with mode: 0755]
help.tcl [new file with mode: 0755]
linkcfg.tcl [new file with mode: 0755]

diff --git a/README b/README
new file mode 100755 (executable)
index 0000000..01fb31c
--- /dev/null
+++ b/README
@@ -0,0 +1,55 @@
+************************************************************************       IMUNES - an Integrated Multiprotocol Network Emulator / Simulator
+************************************************************************
+
+Overview
+========
+
+IMUNES GUI is a simple Tcl/Tk based management console, allowing for
+specification and management of virtual network topologies. The emulation
+execution engine itself operates within the operating system kernel.
+
+
+System requirements
+===================
+  
+    1) Operating system
+    IMUNES works on top of the FreeBSD 4.10 kernel with network stack
+    cloning extensions. The extensions to the FreeBSD kernel source
+    tree are available in form of a patch file at
+
+        http://www.tel.fer.hr/imunes/dl/index.html
+
+    You need to have a standard FreeBSD 4.10-RELEASE installation
+    up and running on your x86 machine. Follow the instructions on the
+    above link on how to patch your kernel sources, and build and install
+    a new kernel. No modifications of any kind are required on the
+    user space side.
+  
+    2) FreeBSD packages 
+  
+    The following packages have to be installed for IMUNES console to
+    work:
+        tcl-8.4.6,1.tgz
+        tk-8.4.6,1.tgz
+        expect-5.38.0_3
+        quagga-0.96.4-5.tgz
+        netperf-2.2.4
+
+    3) Fetch, compile and install the following additional utilities:
+   
+       - vimage management utility,
+       - ng_pipe,
+       - ngctl
+
+       available at http://www.tel.fer.hr/imunes/dl/index.html
+
+Installation
+============
+
+To install the IMUNES GUI just run the install.sh script.
+       ./install.sh
+
+For additional information visit our web site:
+       http://www.tel.fer.hr/imunes/
+
diff --git a/help.tcl b/help.tcl
new file mode 100755 (executable)
index 0000000..27884b2
--- /dev/null
+++ b/help.tcl
@@ -0,0 +1,72 @@
+#
+# Copyright 2004 University of Zagreb, Croatia.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+#    must display the following acknowledgement:
+# This product includes software developed by the University of Zagreb,
+# Croatia and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# This work was supported in part by Croatian Ministry of Science
+# and Technology through the research contract #IP-2003-143.
+#
+
+
+set copyright {
+
+Copyright 2004 University of Zagreb, Croatia.  All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. All advertising materials mentioning features or use of this software
+   must display the following acknowledgement:
+This product includes software developed by the University of Zagreb,
+Croatia and its contributors.
+4. Neither the name of the University nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+This work was supported in part by Croatian Ministry of Science
+and Technology through the research contract #IP-2003-143.
+
+}
diff --git a/linkcfg.tcl b/linkcfg.tcl
new file mode 100755 (executable)
index 0000000..30b7f6c
--- /dev/null
@@ -0,0 +1,190 @@
+#
+# Copyright 2004 University of Zagreb, Croatia.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+#    must display the following acknowledgement:
+# This product includes software developed by the University of Zagreb,
+# Croatia and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# This work was supported in part by Croatian Ministry of Science
+# and Technology through the research contract #IP-2003-143.
+#
+
+
+#
+# linkEndpoints { link_id }
+#      Returns node_ids of link endpoints
+#
+# getLinkBandwidth { link_id }
+#      ... in bits per second
+#
+# getLinkBandwidthString { link_id }
+#      ... as string 
+#
+# getLinkDelay { link_id }
+#      ... in microseconds
+#
+# getLinkDelayString { link_id }
+#      ... as sting
+#
+# setLinkBandwidth { link_id bandwidth }
+#      ... in bits per second
+#
+# setLinkDelay { link_id delay }
+#      ... in microseconds
+#
+# All of the above functions are independent to any Tk objects. This means
+# they can be used for implementing tasks external to GUI, yet inside the
+# GUI any updating of related Tk objects (such as text labels etc.) will
+# have to be implemented by additional Tk code.
+#
+
+
+proc linkEndpoints { link } {
+    global $link
+
+    set entry [lsearch -inline [set $link] "nodes {*}"]
+    return [lindex $entry 1]
+}
+
+
+proc getLinkBandwidth { link } {
+    global $link
+
+    set entry [lsearch -inline [set $link] "bandwidth *"]
+    return [lindex $entry 1]
+}
+
+
+proc getLinkBandwidthString { link } {
+    global $link
+    set bandstr ""
+    set bandwidth [getLinkBandwidth $link]
+    if { "$bandwidth" != "" } {
+       if { $bandwidth >= 660000000 } {
+           set bandstr "[format %.2f [expr $bandwidth / 1000000000.0]] Gbps"
+       } elseif { $bandwidth >= 99000000 } {
+           set bandstr "[format %d [expr $bandwidth / 1000000]] Mbps"
+       } elseif { $bandwidth >= 9900000 } {
+           set bandstr "[format %.2f [expr $bandwidth / 1000000.0]] Mbps"
+       } elseif { $bandwidth >= 990000 } {
+           set bandstr "[format %d [expr $bandwidth / 1000]] Kbps"
+       } elseif { $bandwidth >= 9900 } {
+           set bandstr "[format %.2f [expr $bandwidth / 1000.0]] Kbps"
+       } else {
+           set bandstr "$bandwidth bps"
+       }
+    }
+    return $bandstr
+}
+
+proc setLinkBandwidth { link value } {
+    global $link
+
+    set i [lsearch [set $link] "bandwidth *"]
+    if { $value <= 0 } {
+       set $link [lreplace [set $link] $i $i]
+    } else {
+       set $link [lreplace [set $link] $i $i "bandwidth $value"]
+    }
+}
+
+
+proc getLinkDelay { link } {
+    global $link
+
+    set entry [lsearch -inline [set $link] "delay *"]
+    return [lindex $entry 1]
+}
+
+proc getLinkDelayString { link } {
+    global $link
+
+    set delay [getLinkDelay $link]
+    if { "$delay" != "" } {
+       if { $delay >= 10000 } {
+           set delstr "[expr $delay / 1000] ms"
+       } elseif { $delay >= 1000 } {
+           set delstr "[expr (1.0 * $delay) / 1000] ms"
+       } else {
+            set delstr "$delay us"
+       }
+    } else {
+        set delstr ""
+    }
+    return $delstr
+}
+
+proc setLinkDelay { link value } {
+    global $link
+
+    set i [lsearch [set $link] "delay *"]
+    if { $value <= 0 } {
+       set $link [lreplace [set $link] $i $i]
+    } else {
+       set $link [lreplace [set $link] $i $i "delay $value"]
+    }
+}
+
+
+proc getLinkBER { link } {
+    global $link
+
+    set entry [lsearch -inline [set $link] "ber *"]
+    return [lindex $entry 1]
+}
+
+
+proc setLinkBER { link value } {
+    global $link
+
+    set i [lsearch [set $link] "ber *"]
+    if { $value <= 0 } {
+       set $link [lreplace [set $link] $i $i]
+    } else {
+       set $link [lreplace [set $link] $i $i "ber $value"]
+    }
+}
+
+
+proc getLinkDup { link } {
+    global $link
+
+    set entry [lsearch -inline [set $link] "duplicate *"]
+    return [lindex $entry 1]
+}
+
+
+proc setLinkDup { link value } {
+    global $link
+
+    set i [lsearch [set $link] "duplicate *"]
+    if { $value <= 0 || $value > 50 } {
+       set $link [lreplace [set $link] $i $i]
+    } else {
+       set $link [lreplace [set $link] $i $i "duplicate $value"]
+    }
+}