# and Technology through the research contract #IP-2003-143.
#
+#****h* imunes/host.tcl
+# NAME
+# host.tcl -- defines host specific procedures
+# FUNCTION
+# This module is used to define all the host specific procedures.
+# NOTES
+# Procedures in this module start with the keyword host and
+# end with function specific part that is the same for all the node
+# types that work on the same layer.
+#****
+
+
set MODULE host
+#****f* host.tcl/host.layer
+# NAME
+# host.layer
+# SYNOPSIS
+# set layer [host.layer]
+# FUNCTION
+# Returns the layer on which the host operates
+# i.e. returns NETWORK.
+# RESULT
+# * layer -- set to NETWORK
+#****
proc $MODULE.layer {} {
return NETWORK
}
+#****f* host.tcl/host.cfggen
+# NAME
+# host.cfggen
+# SYNOPSIS
+# set config [host.cfggen $node_id]
+# FUNCTION
+# Returns the generated configuration. This configuration represents
+# the configuration loaded on the booting time of the virtual nodes
+# and it is closly related to the procedure host.bootcmd
+# Foreach interface in the interface list of the node ip address is
+# configured and each static route from the simulator is added. portmap
+# and inetd are also started.
+# INPUTS
+# * node_id - id of the node (type of the node is host)
+# RESULT
+# * congif -- generated configuration
+#****
proc $MODULE.cfggen { node } {
global $node
return $cfg
}
+#****f* host.tcl/host.bootcmd
+# NAME
+# host.bootcmd
+# SYNOPSIS
+# set appl [host.bootcmd $node_id]
+# FUNCTION
+# Procedure bootcmd returns the application that reads and
+# employes the configuration generated in host.cfggen.
+# In this case (procedure host.bootcmd) specific application
+# is /bin/sh
+# INPUTS
+# * node_id - id of the node (type of the node is host)
+# RESULT
+# * appl -- application that reads the configuration (/bin/sh)
+#****
proc $MODULE.bootcmd { node } {
return "/bin/sh"
}
+#****f* host.tcl/host.shellcmd
+# NAME
+# host.shellcmd
+# SYNOPSIS
+# set shell [host.shellcmd $node_id]
+# FUNCTION
+# Procedure shellcmd returns the shell that will be opened
+# as a default shell for the system.
+# Procedure host.shellcmd searches the system for bash shell,
+# if it is not found the sh shell is used insted.
+# INPUTS
+# * node_id - id of the node (type of the node is host)
+# RESULT
+# * shell -- defalut shell for the host
+#****
proc $MODULE.shellcmd { node } {
set ret [nexec whereis -b bash]
}
}
+#****f* host.tcl/host.instantiate
+# NAME
+# host.instantiate
+# SYNOPSIS
+# host.instantiate $eid $node_id
+# FUNCTION
+# Procedure instantiate creates a new virtaul node
+# for a given node in imunes.
+# Procedure host.instantiate cretaes a new virtual node
+# with all the interfaces and CPU parameters as defined
+# in imunes.
+# INPUTS
+# * eid - experiment id
+# * node_id - id of the node (type of the node is host)
+#****
proc $MODULE.instantiate { eid node } {
l3node.instantiate $eid $node
return
}
+#****f* host.tcl/host.nghook
+# NAME
+# host.nghook
+# SYNOPSIS
+# host.nghook $eid $node_id $ifc
+# FUNCTION
+# Returns the id of the netgraph node and the name of the
+# netgraph hook which is used for connecting two netgraph
+# nodes. This procedure calls l3node.hook procedure and
+# passes the result of that procedure.
+# INPUTS
+# * eid - experiment id
+# * node_id - node id
+# * ifc - interface name
+# RESULT
+# * nghook - the list containing netgraph node id and the
+# netgraph hook (ngNode ngHook).
+#****
proc $MODULE.nghook { eid node ifc } {
return [l3node.nghook $eid $node $ifc]
# and Technology through the research contract #IP-2003-143.
#
+#****h* imunes/hub.tcl
+# NAME
+# hub.tcl -- defines hub specific procedures
+# FUNCTION
+# This module is used to define all the hub specific procedures.
+# NOTES
+# Procedures in this module start with the keyword hub and
+# end with function specific part that is the same for all the
+# node types that work on the same layer.
+#****
set MODULE hub
+#****f* hub.tcl/hub.layer
+# NAME
+# hub.layer
+# SYNOPSIS
+# set layer [hub.layer]
+# FUNCTION
+# Returns the layer on which the hub operates
+# i.e. returns LINK.
+# RESULT
+# * layer -- set to LINK
+#****
proc $MODULE.layer {} {
return LINK
}
+#****f* hub.tcl/hub.instantiate
+# NAME
+# hub.instantiate
+# SYNOPSIS
+# hub.instantiate $eid $node_id
+# FUNCTION
+# Procedure hub.instantiate cretaes a new netgraph node
+# of the type hub. The name of the netgraph node is in form
+# of exprimentId_nodeId.
+# INPUTS
+# * eid - experiment id
+# * node_id - id of the node (type of the node is hub)
+#****
proc $MODULE.instantiate { eid node } {
catch {nexec ngctl mkpeer hub anchor anchor | tail -1} resp
return
}
+#****f* hub.tcl/hub.nghook
+# NAME
+# hub.nghook
+# SYNOPSIS
+# hub.nghook $eid $node_id $ifc
+# FUNCTION
+# Returns the id of the netgraph node and the name of the
+# netgraph hook which is used for connecting two netgraph
+# nodes. Netgraph node name is in format experimentId_nodeId
+# and the netgraph hook is in the form of linkN, where N is
+# interface number.
+# INPUTS
+# * eid - experiment id
+# * node_id - node id
+# * ifc - interface name
+# RESULT
+# * nghook - the list containing netgraph node id and the
+# netgraph hook (ngNode ngHook).
+#****
proc $MODULE.nghook { eid node ifc } {
set ifunit [string range $ifc 1 end]
# and Technology through the research contract #IP-2003-143.
#
+#****h* imunes/lanswitch.tcl
+# NAME
+# lanswitch.tcl -- defines lanswitch specific procedures
+# FUNCTION
+# This module is used to define all the lanswitch specific procedures.
+# NOTES
+# Procedures in this module start with the keyword lanswitch and
+# end with function specific part that is the same for all the
+# node types that work on the same layer.
+#****
set MODULE lanswitch
+#****f* lanswitch.tcl/lanswitch.layer
+# NAME
+# lanswitch.layer
+# SYNOPSIS
+# set layer [lanswitch.layer]
+# FUNCTION
+# Returns the layer on which the lanswitch operates
+# i.e. returns LINK.
+# RESULT
+# * layer -- set to LINK
+#****
proc $MODULE.layer {} {
return LINK
}
+#****f* lanswitch.tcl/lanswitch.instantiate
+# NAME
+# lanswitch.instantiate
+# SYNOPSIS
+# lanswitch.instantiate $eid $node_id
+# FUNCTION
+# Procedure lanswitch.instantiate cretaes a new netgraph node
+# of the type bridge. The name of the netgraph node is in the form
+# of exprimentId_nodeId.
+# INPUTS
+# * eid - experiment id
+# * node_id - id of the node (type of the node is lanswitch)
+#****
proc $MODULE.instantiate { eid node } {
catch {nexec ngctl mkpeer bridge anchor anchor | tail -1} resp
return
}
+#****f* lanswitch.tcl/lanswitch.nghook
+# NAME
+# lanswitch.nghook
+# SYNOPSIS
+# set nghook [lanswitch.nghook $eid $node_id $ifc]
+# FUNCTION
+# Returns the id of the netgraph node and the name of the
+# netgraph hook which is used for connecting two netgraph
+# nodes. Netgraph node name is in format experimentId_nodeId
+# and the netgraph hook is in the form of linkN, where N is
+# interface number.
+# INPUTS
+# * eid - experiment id
+# * node_id - node id
+# * ifc - interface name
+# RESULT
+# * nghook - the list containing netgraph node id and the
+# netgraph hook (ngNode ngHook).
+#****
proc $MODULE.nghook { eid node ifc } {
set ifunit [string range $ifc 1 end]
# and Technology through the research contract #IP-2003-143.
#
+#****h* imunes/pc.tcl
+# NAME
+# pc.tcl -- defines pc specific procedures
+# FUNCTION
+# This module is used to define all the pc specific procedures.
+# NOTES
+# Procedures in this module start with the keyword pc and
+# end with function specific part that is the same for all the node
+# types that work on the same layer.
+#****
set MODULE pc
+#****f* pc.tcl/pc.layer
+# NAME
+# pc.layer
+# SYNOPSIS
+# set layer [pc.layer]
+# FUNCTION
+# Returns the layer on which the pc communicates
+# i.e. returns NETWORK.
+# RESULT
+# * layer -- set to NETWORK
+#****
proc $MODULE.layer {} {
return NETWORK
}
+#****f* pc.tcl/pc.cfggen
+# NAME
+# pc.cfggen
+# SYNOPSIS
+# set config [pc.cfggen $node_id]
+# FUNCTION
+# Returns the generated configuration. This configuration represents
+# the configuration loaded on the booting time of the virtual nodes
+# and it is closly related to the procedure pc.bootcmd
+# Foreach interface in the interface list of the node ip address is
+# configured and each static route from the simulator is added.
+# INPUTS
+# * node_id - id of the node (type of the node is pc)
+# RESULT
+# * congif -- generated configuration
+#****
proc $MODULE.cfggen { node } {
global $node
return $cfg
}
+#****f* pc.tcl/pc.bootcmd
+# NAME
+# pc.bootcmd
+# SYNOPSIS
+# set appl [pc.bootcmd $node_id]
+# FUNCTION
+# Procedure bootcmd returns the application that reads and
+# employes the configuration generated in pc.cfggen.
+# In this case (procedure pc.bootcmd) specific application
+# is /bin/sh
+# INPUTS
+# * node_id - id of the node (type of the node is pc)
+# RESULT
+# * appl -- application that reads the configuration (/bin/sh)
+#****
proc $MODULE.bootcmd { node } {
return "/bin/sh"
}
+#****f* pc.tcl/pc.shellcmd
+# NAME
+# pc.shellcmd
+# SYNOPSIS
+# set shell [pc.shellcmd $node_id]
+# FUNCTION
+# Procedure shellcmd returns the shell that will be opened
+# as a default shell for the system.
+# Procedure pc.shellcmd searches the system for bash shell,
+# if it is not found the sh shell is used insted.
+# INPUTS
+# * node_id - id of the node (type of the node is pc)
+# RESULT
+# * shell -- defalut shell for the pc
+#****
proc $MODULE.shellcmd { node } {
set ret [nexec whereis -b bash]
}
}
+#****f* pc.tcl/pc.instantiate
+# NAME
+# pc.instantiate
+# SYNOPSIS
+# pc.instantiate $eid $node_id
+# FUNCTION
+# Procedure instantiate creates a new virtaul node
+# for a given node in imunes.
+# Procedure pc.instantiate cretaes a new virtual node
+# with all the interfaces and CPU parameters as defined
+# in imunes.
+# INPUTS
+# * eid - experiment id
+# * node_id - id of the node (type of the node is pc)
+#****
proc $MODULE.instantiate { eid node } {
l3node.instantiate $eid $node
return
}
+#****f* pc.tcl/pc.nghook
+# NAME
+# pc.nghook
+# SYNOPSIS
+# pc.nghook $eid $node_id $ifc
+# FUNCTION
+# Returns the id of the netgraph node and the name of the
+# netgraph hook which is used for connecting two netgraph
+# nodes. This procedure calls l3node.hook procedure and
+# passes the result of that procedure.
+# INPUTS
+# * eid - experiment id
+# * node_id - node id
+# * ifc - interface name
+# RESULT
+# * nghook - the list containing netgraph node id and the
+# netgraph hook (ngNode ngHook).
+#****
proc $MODULE.nghook { eid node ifc } {
return [l3node.nghook $eid $node $ifc]
# and Technology through the research contract #IP-2003-143.
#
+#****h* imunes/quagga.tcl
+# NAME
+# router.quagga.tcl -- defines specific procedures for router
+# using quagga routing model
+# FUNCTION
+# This module defines all the specific procedures for a router
+# which uses quagga routing model.
+# NOTES
+# Procedures in this module start with the keyword router.quagga and
+# end with function specific part that is the same for all the node
+# types that work on the same layer.
+#****
+
+
set MODULE router.quagga
+#****f* quagga.tcl/router.quagga.layer
+# NAME
+# router.quagga.layer
+# SYNOPSIS
+# set layer [router.quagga.layer]
+# FUNCTION
+# Returns the layer on which the router using quagga model
+# operates, i.e. returns NETWORK.
+# RESULT
+# * layer -- set to NETWORK
+#****
proc $MODULE.layer {} {
return NETWORK
}
+#****f* quagga.tcl/router.quagga.cfggen
+# NAME
+# router.quagga.cfggen
+# SYNOPSIS
+# set config [router.quagga.cfggen $node_id]
+# FUNCTION
+# Generates configuration. This configuration represents
+# the default configuration loaded on the booting time of the
+# virtual nodes and it is closly related to the procedure
+# router.quagga.bootcmd.
+# Generated configuration comprises the ip addresses
+# (both ipv4 and ipv6) and interface states (up or down)
+# for each interface of a given node. Static routes are also
+# included.
+# INPUTS
+# * node_id - id of the node (type of the node is router
+# and routing model is quagga)
+# RESULT
+# * congif -- generated configuration
+#****
proc $MODULE.cfggen { node } {
global $node
return $cfg
}
+#****f* quagga.tcl/router.quagga.bootcmd
+# NAME
+# router.quagga.bootcmd
+# SYNOPSIS
+# set appl [router.quagga.bootcmd $node_id]
+# FUNCTION
+# Procedure bootcmd returns the defaut application that reads and
+# employes the configuration generated in router.quagga.cfggen.
+# In this case (procedure router.quagga.bootcmd) specific application
+# is quaggaboot.sh (in ROOTDIR/LIBDIR folder)
+# INPUTS
+# * node_id - id of the node (type of the node is router and
+# routing model is quagga)
+# RESULT
+# * appl -- application that reads the configuration (quaggaboot.sh)
+#****
proc $MODULE.bootcmd { node } {
global ROOTDIR LIBDIR
return "$ROOTDIR/$LIBDIR/quaggaboot.sh"
}
+#****f* quagga.tcl/router.quagga.shellcmd
+# NAME
+# router.quagga.shellcmd
+# SYNOPSIS
+# set shell [router.quagga.shellcmd $node_id]
+# FUNCTION
+# Procedure shellcmd returns the shell that will be opened
+# as a default shell for the virtual node.
+# Procedure router.quagga.shellcmd returns vtysh.
+# INPUTS
+# * node_id - id of the node (type of the node is router
+# and the routing model is quagga)
+# RESULT
+# * shell -- defalut shell for the router.quagga (vtysh)
+#****
proc $MODULE.shellcmd { node } {
return "vtysh"
}
+#****f* quagga.tcl/router.quagga.instantiate
+# NAME
+# router.quagga.instantiate
+# SYNOPSIS
+# router.quagga.instantiate $eid $node_id
+# FUNCTION
+# Procedure instantiate creates a new virtaul node
+# for a given node in imunes.
+# Procedure router.quagga.instantiate cretaes a new virtual node
+# with all the interfaces and CPU parameters as defined
+# in imunes. It sets the net.inet.ip.forwarding and
+# net.inet6.ip6.forwarding kernel variables to 1.
+# INPUTS
+# * eid - experiment id
+# * node_id - id of the node (type of the node is router
+# and routing model is quagga)
+#****
proc $MODULE.instantiate { eid node } {
set node_id "$eid\_$node"
return
}
+#****f* quagga.tcl/router.quagga.nghook
+# NAME
+# router.quagga.nghook
+# SYNOPSIS
+# router.quagga.nghook $eid $node_id $ifc
+# FUNCTION
+# Returns the id of the netgraph node and the name of the
+# netgraph hook which is used for connecting two netgraph
+# nodes. This procedure calls l3node.hook procedure and
+# passes the result of that procedure.
+# INPUTS
+# * eid - experiment id
+# * node_id - node id
+# * ifc - interface name
+# RESULT
+# * nghook - the list containing netgraph node id and the
+# netgraph hook (ngNode ngHook).
+#****
proc $MODULE.nghook { eid node ifc } {
return [l3node.nghook $eid $node $ifc]
# and Technology through the research contract #IP-2003-143.
#
+#****h* imunes/rj45.tcl
+# NAME
+# rj45.tcl -- defines rj45 specific procedures
+# FUNCTION
+# This module is used to define all the rj45 specific procedures.
+# NOTES
+# Procedures in this module start with the keyword rj45 and
+# end with function specific part that is the same for all the
+# node types that work on the same layer.
+#****
set MODULE rj45
+#****f* rj45.tcl/rj45.layer
+# NAME
+# rj45.layer
+# SYNOPSIS
+# set layer [rj45.layer]
+# FUNCTION
+# Returns the layer on which the rj45 operates
+# i.e. returns LINK.
+# RESULT
+# * layer -- set to LINK
+#****
proc $MODULE.layer {} {
return LINK
}
+#****f* rj45.tcl/rj45.instantiate
+# NAME
+# rj45.instantiate
+# SYNOPSIS
+# rj45.instantiate $eid $node_id
+# FUNCTION
+# Procedure rj45.instantiate puts real interface
+# into promiscues mode.
+# INPUTS
+# * eid - experiment id
+# * node_id - id of the node (type of the node is rj45)
+#****
proc $MODULE.instantiate { eid node } {
set ifname [getNodeName $node]
return
}
+#****f* rj45.tcl/rj45.nghook
+# NAME
+# rj45.nghook
+# SYNOPSIS
+# rj45.nghook $eid $node_id $ifc
+# FUNCTION
+# Returns the id of the netgraph node and the netgraph
+# hook name. In this case netgraph node name correspondes
+# to the name of the physical interface.
+# INPUTS
+# * eid - experiment id
+# * node_id - node id
+# * ifc - interface name
+# RESULT
+# * nghook - the list containing netgraph node name and
+# the netraph hook name (in this case: lower).
+#****
proc $MODULE.nghook { eid node ifc } {
set nodename [getNodeName $node]
# and Technology through the research contract #IP-2003-143.
#
+#****h* imunes/static.tcl
+# NAME
+# router.static.tcl -- defines specific procedures for router
+# using static routing model
+# FUNCTION
+# This module defines all the specific procedures for a router
+# which uses static routing model.
+# NOTES
+# Procedures in this module start with the keyword router.static and
+# end with function specific part that is the same for all the nodes
+# that work on the same layer.
+#****
set MODULE router.static
+#****f* static.tcl/router.static.layer
+# NAME
+# router.static.layer
+# SYNOPSIS
+# set layer [router.static.layer]
+# FUNCTION
+# Returns the layer on which the router using static routing model
+# operates, i.e. returns NETWORK.
+# RESULT
+# * layer -- set to NETWORK
+#****
proc $MODULE.layer {} {
return NETWORK
}
+#****f* static.tcl/router.static.cfggen
+# NAME
+# router.static.cfggen
+# SYNOPSIS
+# set config [router.static.cfggen $node_id]
+# FUNCTION
+# Generates configuration. This configuration represents
+# the default configuration loaded on the booting time of the
+# virtual nodes and it is closly related to the procedure
+# router.static.bootcmd.
+# Generated configuration comprises the ip addresses
+# (both ipv4 and ipv6) for each interface of a given node.
+# Static routes are also included in configuration.
+# INPUTS
+# * node_id - id of the node (type of the node is router
+# and routing model is set to static)
+# RESULT
+# * congif -- generated configuration
+#****
proc $MODULE.cfggen { node } {
global $node
return $cfg
}
+#****f* static.tcl/router.static.bootcmd
+# NAME
+# router.static.bootcmd
+# SYNOPSIS
+# set appl [router.static.bootcmd $node_id]
+# FUNCTION
+# Procedure bootcmd returns the defaut application that reads and
+# employes the configuration generated in router.static.cfggen.
+# In this case (procedure router.static.bootcmd) specific application
+# is /bin/sh
+# INPUTS
+# * node_id - id of the node (type of the node is router and the
+# routing model is set to static)
+# RESULT
+# * appl -- application that reads the configuration (/bin/sh)
+#****
proc $MODULE.bootcmd { node } {
return "/bin/sh"
}
+#****f* static.tcl/router.static.shellcmd
+# NAME
+# router.static.shellcmd
+# SYNOPSIS
+# set shell [router.static.shellcmd $node_id]
+# FUNCTION
+# Procedure shellcmd returns the shell that will be opened
+# as a default shell for the virtual node.
+# Procedure router.static.shellcmd returns the shell as defined
+# in environment variable SHELL.
+# INPUTS
+# * node_id - id of the node (type of the node is router
+# and the routing model is static)
+# RESULT
+# * shell -- defalut shell for the router static model is
+# the shell defined in environment variable SHELL.
+#****
proc $MODULE.shellcmd { node } {
- global env
- return "$env(SHELL)"
+ set ret [nexec whereis -b bash]
+ if { [llength $ret] == 2 } {
+ return [lindex $ret 1]
+ } else {
+ set ret [nexec whereis -b tcsh]
+ if { [llength $ret] == 2 } {
+ return [lindex $ret 1]
+ } else {
+ return "/bin/sh"
+ }
+ }
}
+#****f* static.tcl/router.static.instantiate
+# NAME
+# router.static.instantiate
+# SYNOPSIS
+# router.static.instantiate $eid $node_id
+# FUNCTION
+# Procedure instantiate creates a new virtaul node
+# for a given node in imunes.
+# Procedure router.static.instantiate cretaes a new virtual node
+# with all the interfaces and CPU parameters as defined
+# in imunes. It sets the net.inet.ip.forwarding and
+# net.inet6.ip6.forwarding kernel variables to 1.
+# INPUTS
+# * eid - experiment id
+# * node_id - id of the node (type of the node is router
+# and routing model is static)
+#****
proc $MODULE.instantiate { eid node } {
set node_id "$eid\_$node"
return
}
+#****f* static.tcl/router.static.nghook
+# NAME
+# router.static.nghook
+# SYNOPSIS
+# router.static.nghook $eid $node_id $ifc
+# FUNCTION
+# Returns the id of the netgraph node and the name of the
+# netgraph hook which is used for connecting two netgraph
+# nodes. This procedure calls l3node.hook procedure and
+# passes the result of that procedure.
+# INPUTS
+# * eid - experiment id
+# * node_id - node id
+# * ifc - interface name
+# RESULT
+# * nghook - the list containing netgraph node id and the
+# netgraph hook (ngNode ngHook).
+#****
proc $MODULE.nghook { eid node ifc } {
return [l3node.nghook $eid $node $ifc]
# and Technology through the research contract #IP-2003-143.
#
+#****h* imunes/xorp.tcl
+# NAME
+# router.xorp.tcl -- defines specific procedures for routers
+# using xorp routing model
+# FUNCTION
+# This module defines all the specific procedures for a router
+# which uses xorp routing model.
+# NOTES
+# Procedures in this module start with the keyword router.xorp and
+# end with function specific part that is the same for all the node
+# types that work on the same layer.
+#****
set MODULE router.xorp
+#****f* xorp.tcl/router.xorp.layer
+# NAME
+# router.xorp.layer
+# SYNOPSIS
+# set layer [router.xorp.layer]
+# FUNCTION
+# Returns the layer on which the router using xorp model
+# operates, i.e. returns NETWORK.
+# RESULT
+# * layer -- set to NETWORK
+#****
proc $MODULE.layer {} {
return NETWORK
}
+#****f* xorp.tcl/router.xorp.cfggen
+# NAME
+# router.xorp.cfggen
+# SYNOPSIS
+# set config [router.xorp.cfggen $node_id]
+# FUNCTION
+# Generates configuration. This configuration represents
+# the default configuration loaded on the booting time of the
+# virtual nodes and it is closly related to the procedure
+# router.xorp.bootcmd.
+# Generated configuration comprises the ip addresses
+# (both ipv4 and ipv6) for each interface of a given node.
+# Static routes are also included as well as rip support for
+# ipv4 and ipv6.
+# INPUTS
+# * node_id - id of the node (type of the node is router
+# and the routing model is xorp)
+# RESULT
+# * congif -- generated configuration
+#****
proc $MODULE.cfggen { node } {
global $node
return $cfg
}
+#****f* xorp.tcl/router.xorp.bootcmd
+# NAME
+# router.xorp.bootcmd
+# SYNOPSIS
+# set appl [router.xorp.bootcmd $node_id]
+# FUNCTION
+# Procedure bootcmd returns the defaut application that reads and
+# employes the configuration generated in router.xorp.cfggen.
+# In this case (procedure router.xorp.bootcmd) specific application
+# is xorp_rtrmgr used in batch mode.
+# (in /usr/local/xorp/bin folder)
+# INPUTS
+# * node_id - id of the node (type of the node is router and
+# routing model is xorp)
+# RESULT
+# * appl -- application that reads the configuration (xorp_rtrmgr)
+#****
proc $MODULE.bootcmd { node } {
return "/usr/local/xorp/bin/xorp_rtrmgr -b"
}
+#****f* xorp.tcl/router.xorp.shellcmd
+# NAME
+# router.xorp.shellcmd
+# SYNOPSIS
+# set shell [router.xorp.shellcmd $node_id]
+# FUNCTION
+# Procedure shellcmd returns the shell that will be opened
+# as a default shell for the virtual node.
+# Procedure router.xorp.shellcmd returns xorpsh
+# (in /usr/local/xorp/bin folder).
+# INPUTS
+# * node_id - id of the node (type of the node is router
+# and the routing model is xorp)
+# RESULT
+# * shell -- defalut shell for the router.xorp (xorpsh)
+#****
proc $MODULE.shellcmd { node } {
return "/usr/local/xorp/bin/xorpsh"
}
+#****f* xorp.tcl/router.xorp.instantiate
+# NAME
+# router.xorp.instantiate
+# SYNOPSIS
+# router.xorp.instantiate $eid $node_id
+# FUNCTION
+# Procedure instantiate creates a new virtaul node
+# for a given node in imunes.
+# Procedure router.xorp.instantiate cretaes a new virtual node
+# with all the interfaces and CPU parameters as defined
+# in imunes. It sets the net.inet.ip.forwarding and
+# net.inet6.ip6.forwarding kernel variables to 1.
+# INPUTS
+# * eid - experiment id
+# * node_id - id of the node (type of the node is router
+# and routing model is xorp)
+#****
proc $MODULE.instantiate { eid node } {
set node_id "$eid\_$node"
return
}
+#****f* xorp.tcl/router.xorp.nghook
+# NAME
+# router.xorp.nghook
+# SYNOPSIS
+# router.xorp.nghook $eid $node_id $ifc
+# FUNCTION
+# Returns the id of the netgraph node and the name of the
+# netgraph hook which is used for connecting two netgraph
+# nodes. This procedure calls l3node.hook procedure and
+# passes the result of that procedure.
+# INPUTS
+# * eid - experiment id
+# * node_id - node id
+# * ifc - interface name
+# RESULT
+# * nghook - the list containing netgraph node id and the
+# netgraph hook (ngNode ngHook).
+#****
proc $MODULE.nghook { eid node ifc } {
return [l3node.nghook $eid $node $ifc]