merged latest code from rodolfos merge from the latest github pull
This commit is contained in:
commit
613e550e8a
32 changed files with 267 additions and 276 deletions
61
README
61
README
|
@ -1,61 +0,0 @@
|
||||||
|
|
||||||
CORE: Common Open Research Emulator
|
|
||||||
Copyright (c)2005-2013 the Boeing Company.
|
|
||||||
See the LICENSE file included in this distribution.
|
|
||||||
|
|
||||||
== ABOUT =======================================================================
|
|
||||||
CORE is a tool for emulating networks using a GUI or Python scripts. The CORE
|
|
||||||
project site (1) is a good source of introductory information, with a manual,
|
|
||||||
screenshots, and demos about this software. Also a supplemental
|
|
||||||
Google Code page (2) hosts a wiki, blog, bug tracker, and quickstart guide.
|
|
||||||
|
|
||||||
1. http://www.nrl.navy.mil/itd/ncs/products/core
|
|
||||||
2. http://code.google.com/p/coreemu/
|
|
||||||
|
|
||||||
|
|
||||||
== BUILDING CORE ===============================================================
|
|
||||||
|
|
||||||
To build this software you should use:
|
|
||||||
|
|
||||||
./bootstrap.sh
|
|
||||||
./configure
|
|
||||||
make
|
|
||||||
sudo make install
|
|
||||||
|
|
||||||
Here is what is installed with 'make install':
|
|
||||||
|
|
||||||
/usr/local/bin/core-gui
|
|
||||||
/usr/local/sbin/core-daemon
|
|
||||||
/usr/local/sbin/[vcmd, vnoded, coresendmsg, core-cleanup.sh]
|
|
||||||
/usr/local/lib/core/*
|
|
||||||
/usr/local/share/core/*
|
|
||||||
/usr/local/lib/python2.6/dist-packages/core/*
|
|
||||||
/usr/local/lib/python2.6/dist-packages/[netns,vcmd].so
|
|
||||||
/etc/core/*
|
|
||||||
/etc/init.d/core
|
|
||||||
|
|
||||||
See the manual for the software required for building CORE.
|
|
||||||
|
|
||||||
|
|
||||||
== RUNNING CORE ================================================================
|
|
||||||
|
|
||||||
First start the CORE services:
|
|
||||||
|
|
||||||
sudo /etc/init.d/core-daemon start
|
|
||||||
|
|
||||||
This automatically runs the core-daemon program.
|
|
||||||
Assuming the GUI is in your PATH, run the CORE GUI by typing the following:
|
|
||||||
|
|
||||||
core-gui
|
|
||||||
|
|
||||||
This launches the CORE GUI. You do not need to run the GUI as root.
|
|
||||||
|
|
||||||
== SUPPORT =====================================================================
|
|
||||||
|
|
||||||
If you have questions, comments, or trouble, please use the CORE mailing lists:
|
|
||||||
- core-users for general comments and questions
|
|
||||||
http://pf.itd.nrl.navy.mil/mailman/listinfo/core-users
|
|
||||||
- core-dev for bugs, compile errors, and other development issues
|
|
||||||
http://pf.itd.nrl.navy.mil/mailman/listinfo/core-dev
|
|
||||||
|
|
||||||
|
|
87
README.rst
Normal file
87
README.rst
Normal file
|
@ -0,0 +1,87 @@
|
||||||
|
====
|
||||||
|
CORE
|
||||||
|
====
|
||||||
|
|
||||||
|
CORE: Common Open Research Emulator
|
||||||
|
|
||||||
|
Copyright (c)2005-2013 the Boeing Company.
|
||||||
|
|
||||||
|
See the LICENSE file included in this distribution.
|
||||||
|
|
||||||
|
About
|
||||||
|
=====
|
||||||
|
|
||||||
|
CORE is a tool for emulating networks using a GUI or Python scripts. The CORE
|
||||||
|
project site (1) is a good source of introductory information, with a manual,
|
||||||
|
screenshots, and demos about this software. The GitHub project (2) hosts the
|
||||||
|
source repos, wiki, and bug tracker. There is a deprecated
|
||||||
|
Google Code page (3) with the old wiki, blog, bug tracker, and quickstart guide.
|
||||||
|
|
||||||
|
1. http://www.nrl.navy.mil/itd/ncs/products/core
|
||||||
|
|
||||||
|
2. https://github.com/coreemu/core
|
||||||
|
|
||||||
|
3. http://code.google.com/p/coreemu/
|
||||||
|
|
||||||
|
4. `Official Documentation`_
|
||||||
|
|
||||||
|
.. _Official Documentation: https://downloads.pf.itd.nrl.navy.mil/docs/core/core-html/index.html
|
||||||
|
|
||||||
|
|
||||||
|
Building CORE
|
||||||
|
=============
|
||||||
|
|
||||||
|
To build this software you should use:
|
||||||
|
|
||||||
|
./bootstrap.sh
|
||||||
|
./configure
|
||||||
|
make
|
||||||
|
sudo make install
|
||||||
|
|
||||||
|
Note: You may need to pass the proxy settings to sudo make install:
|
||||||
|
sudo make install HTTP_PROXY=<proxy>
|
||||||
|
|
||||||
|
Here is what is installed with 'make install':
|
||||||
|
|
||||||
|
/usr/local/bin/core-gui
|
||||||
|
/usr/local/sbin/core-daemon
|
||||||
|
/usr/local/sbin/[vcmd, vnoded, coresendmsg, core-cleanup.sh]
|
||||||
|
/usr/local/lib/core/*
|
||||||
|
/usr/local/share/core/*
|
||||||
|
/usr/local/lib/python2.6/dist-packages/core/*
|
||||||
|
/usr/local/lib/python2.6/dist-packages/[netns,vcmd].so
|
||||||
|
/etc/core/*
|
||||||
|
/etc/init.d/core
|
||||||
|
|
||||||
|
See the manual for the software required for building CORE.
|
||||||
|
|
||||||
|
|
||||||
|
Running CORE
|
||||||
|
============
|
||||||
|
|
||||||
|
First start the CORE services:
|
||||||
|
|
||||||
|
sudo /etc/init.d/core-daemon start
|
||||||
|
|
||||||
|
This automatically runs the core-daemon program.
|
||||||
|
Assuming the GUI is in your PATH, run the CORE GUI by typing the following:
|
||||||
|
|
||||||
|
core-gui
|
||||||
|
|
||||||
|
This launches the CORE GUI. You do not need to run the GUI as root.
|
||||||
|
|
||||||
|
|
||||||
|
Support
|
||||||
|
=======
|
||||||
|
|
||||||
|
If you have questions, comments, or trouble, please use the CORE mailing lists:
|
||||||
|
|
||||||
|
- `core-users`_ for general comments and questions
|
||||||
|
|
||||||
|
- `core-dev`_ for bugs, compile errors, and other development issues
|
||||||
|
|
||||||
|
|
||||||
|
.. _core-users: https://pf.itd.nrl.navy.mil/mailman/listinfo/core-users
|
||||||
|
.. _core-dev: https://pf.itd.nrl.navy.mil/mailman/listinfo/core-dev
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,5 @@ Pieces can be imported individually, for example
|
||||||
from core.netns import vnode
|
from core.netns import vnode
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__all__ = []
|
|
||||||
|
|
||||||
# Automatically import all add-ons listed in addons.__all__
|
# Automatically import all add-ons listed in addons.__all__
|
||||||
from addons import *
|
from addons import *
|
||||||
|
|
|
@ -246,7 +246,9 @@ class EmaneManager(ConfigurableManager):
|
||||||
# Adamson change: first check for iface config keyed by "node:ifc.name"
|
# Adamson change: first check for iface config keyed by "node:ifc.name"
|
||||||
# (so that nodes w/ multiple interfaces of same conftype can have
|
# (so that nodes w/ multiple interfaces of same conftype can have
|
||||||
# different configs for each separate interface)
|
# different configs for each separate interface)
|
||||||
key = 1000 * ifc.node.objid + ifc.netindex
|
key = 1000*ifc.node.objid
|
||||||
|
if ifc.netindex is not None:
|
||||||
|
key += ifc.netindex
|
||||||
values = self.getconfig(key, conftype, None)[1]
|
values = self.getconfig(key, conftype, None)[1]
|
||||||
if not values:
|
if not values:
|
||||||
values = self.getconfig(ifc.node.objid, conftype, None)[1]
|
values = self.getconfig(ifc.node.objid, conftype, None)[1]
|
||||||
|
|
|
@ -301,12 +301,6 @@ class LxBrNet(PyCoreNet):
|
||||||
snoop = "/sys/devices/virtual/net/%s/bridge/multicast_snooping" % self.brname
|
snoop = "/sys/devices/virtual/net/%s/bridge/multicast_snooping" % self.brname
|
||||||
if os.path.exists(snoop):
|
if os.path.exists(snoop):
|
||||||
open(snoop, "w").write('0')
|
open(snoop, "w").write('0')
|
||||||
|
|
||||||
# turn on LLDP forwarding (disabled by default in linux)
|
|
||||||
lldpfile = "/sys/class/net/%s/bridge/group_fwd_mask" % self.brname
|
|
||||||
if os.path.exists(lldpfile):
|
|
||||||
open(lldpfile, "w").write('0x4000')
|
|
||||||
|
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
logger.exception("Error setting bridge parameters")
|
logger.exception("Error setting bridge parameters")
|
||||||
|
|
||||||
|
|
|
@ -389,8 +389,12 @@ class SimpleLxcNode(PyCoreNode):
|
||||||
:return: nothing
|
:return: nothing
|
||||||
"""
|
"""
|
||||||
if self.up:
|
if self.up:
|
||||||
self.cmd([constants.IP_BIN, "addr", "add", str(addr),
|
if ":" in str(addr): # check if addr is ipv6
|
||||||
"dev", self.ifname(ifindex)])
|
self.cmd([constants.IP_BIN, "addr", "add", str(addr),
|
||||||
|
"dev", self.ifname(ifindex)])
|
||||||
|
else:
|
||||||
|
self.cmd([constants.IP_BIN, "addr", "add", str(addr), "broadcast", "+",
|
||||||
|
"dev", self.ifname(ifindex)])
|
||||||
self._netif[ifindex].addaddr(addr)
|
self._netif[ifindex].addaddr(addr)
|
||||||
|
|
||||||
def deladdr(self, ifindex, addr):
|
def deladdr(self, ifindex, addr):
|
||||||
|
|
|
@ -106,6 +106,10 @@ class CoreServices(ConfigurableManager):
|
||||||
from core.services import startup
|
from core.services import startup
|
||||||
self.is_startup_service = startup.Startup.is_startup_service
|
self.is_startup_service = startup.Startup.is_startup_service
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def add_service_path(cls, path):
|
||||||
|
cls.service_path.add(path)
|
||||||
|
|
||||||
def importcustom(self, path):
|
def importcustom(self, path):
|
||||||
"""
|
"""
|
||||||
Import services from a myservices directory.
|
Import services from a myservices directory.
|
||||||
|
@ -975,7 +979,7 @@ class CoreService(object):
|
||||||
:return: nothing
|
:return: nothing
|
||||||
"""
|
"""
|
||||||
if key not in self.keys:
|
if key not in self.keys:
|
||||||
raise ValueError
|
raise ValueError('key `%s` not in `%s`' % (key, self.keys))
|
||||||
# this handles data conversion to int, string, and tuples
|
# this handles data conversion to int, string, and tuples
|
||||||
if value:
|
if value:
|
||||||
if key == "startidx":
|
if key == "startidx":
|
||||||
|
|
|
@ -4,4 +4,17 @@ Services
|
||||||
Services available to nodes can be put in this directory. Everything listed in
|
Services available to nodes can be put in this directory. Everything listed in
|
||||||
__all__ is automatically loaded by the main core module.
|
__all__ is automatically loaded by the main core module.
|
||||||
"""
|
"""
|
||||||
__all__ = ["quagga", "nrl", "xorp", "bird", "utility", "security", "ucarp", "dockersvc", "OvsService" , "ryuService" , 'startup' ]
|
|
||||||
|
__all__ = [
|
||||||
|
"quagga",
|
||||||
|
"nrl",
|
||||||
|
"xorp",
|
||||||
|
"bird",
|
||||||
|
"utility",
|
||||||
|
"security",
|
||||||
|
"ucarp",
|
||||||
|
"dockersvc",
|
||||||
|
"OvsService",
|
||||||
|
"RyuService",
|
||||||
|
"startup"
|
||||||
|
]
|
||||||
|
|
|
@ -603,7 +603,7 @@ class MgenActor(NrlService):
|
||||||
cfg = "#!/bin/sh\n"
|
cfg = "#!/bin/sh\n"
|
||||||
cfg += "# auto-generated by nrl.py:MgenActor.generateconfig()\n"
|
cfg += "# auto-generated by nrl.py:MgenActor.generateconfig()\n"
|
||||||
comments = ""
|
comments = ""
|
||||||
cmd = "python /usr/local/bin/mgenBasicActor.py -n %s -a 0.0.0.0 -p 5555" % (node.name)
|
cmd = "mgenBasicActor.py -n %s -a 0.0.0.0" % node.name
|
||||||
|
|
||||||
servicenames = map(lambda x: x._name, services)
|
servicenames = map(lambda x: x._name, services)
|
||||||
netifs = filter(lambda x: not getattr(x, 'control', False), node.netifs())
|
netifs = filter(lambda x: not getattr(x, 'control', False), node.netifs())
|
||||||
|
|
|
@ -12,16 +12,11 @@ from core.misc import nodeutils
|
||||||
from core.service import CoreService
|
from core.service import CoreService
|
||||||
from core.service import ServiceManager
|
from core.service import ServiceManager
|
||||||
|
|
||||||
QUAGGA_USER = "root"
|
|
||||||
QUAGGA_GROUP = "root"
|
|
||||||
if os.uname()[0] == "FreeBSD":
|
|
||||||
QUAGGA_GROUP = "wheel"
|
|
||||||
|
|
||||||
|
|
||||||
class Zebra(CoreService):
|
class Zebra(CoreService):
|
||||||
_name = "zebra"
|
_name = "zebra"
|
||||||
_group = "Quagga"
|
_group = "Quagga"
|
||||||
_depends = ("vtysh",)
|
|
||||||
_dirs = ("/usr/local/etc/quagga", "/var/run/quagga")
|
_dirs = ("/usr/local/etc/quagga", "/var/run/quagga")
|
||||||
_configs = ("/usr/local/etc/quagga/Quagga.conf",
|
_configs = ("/usr/local/etc/quagga/Quagga.conf",
|
||||||
"quaggaboot.sh", "/usr/local/etc/quagga/vtysh.conf")
|
"quaggaboot.sh", "/usr/local/etc/quagga/vtysh.conf")
|
||||||
|
@ -53,16 +48,11 @@ class Zebra(CoreService):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def generateQuaggaConf(cls, node, services):
|
def generateQuaggaConf(cls, node, services):
|
||||||
""" Returns configuration file text. Other services that depend on zebra
|
|
||||||
will have generatequaggaifcconfig() and generatequaggaconfig()
|
|
||||||
hooks that are invoked here.
|
|
||||||
"""
|
"""
|
||||||
# Check whether the node is running OVS
|
Returns configuration file text. Other services that depend on zebra
|
||||||
has_ovs = 0
|
will have generatequaggaifcconfig() and generatequaggaconfig()
|
||||||
for s in services:
|
hooks that are invoked here.
|
||||||
if s._name == "OvsService":
|
"""
|
||||||
has_ovs =1
|
|
||||||
|
|
||||||
# we could verify here that filename == Quagga.conf
|
# we could verify here that filename == Quagga.conf
|
||||||
cfg = ""
|
cfg = ""
|
||||||
for ifc in node.netifs():
|
for ifc in node.netifs():
|
||||||
|
@ -72,7 +62,7 @@ class Zebra(CoreService):
|
||||||
ifnumstr = re.findall(r"\d+", ifc.name)
|
ifnumstr = re.findall(r"\d+", ifc.name)
|
||||||
ifnum = ifnumstr[0]
|
ifnum = ifnumstr[0]
|
||||||
ifname = "rtr%s" % ifnum
|
ifname = "rtr%s" % ifnum
|
||||||
|
|
||||||
cfg += "interface %s\n" % ifname
|
cfg += "interface %s\n" % ifname
|
||||||
#cfg += "interface %s\n" % ifc.name
|
#cfg += "interface %s\n" % ifc.name
|
||||||
# include control interfaces in addressing but not routing daemons
|
# include control interfaces in addressing but not routing daemons
|
||||||
|
@ -147,8 +137,6 @@ QUAGGA_CONF=%s
|
||||||
QUAGGA_SBIN_SEARCH=%s
|
QUAGGA_SBIN_SEARCH=%s
|
||||||
QUAGGA_BIN_SEARCH=%s
|
QUAGGA_BIN_SEARCH=%s
|
||||||
QUAGGA_STATE_DIR=%s
|
QUAGGA_STATE_DIR=%s
|
||||||
QUAGGA_USER=%s
|
|
||||||
QUAGGA_GROUP=%s
|
|
||||||
|
|
||||||
searchforprog()
|
searchforprog()
|
||||||
{
|
{
|
||||||
|
@ -177,21 +165,6 @@ confcheck()
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
waitforvtyfiles()
|
|
||||||
{
|
|
||||||
for f in "$@"; do
|
|
||||||
count=1
|
|
||||||
until [ -e $QUAGGA_STATE_DIR/$f ]; do
|
|
||||||
if [ $count -eq 10 ]; then
|
|
||||||
echo "ERROR: vty file not found: $QUAGGA_STATE_DIR/$f" >&2
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
sleep 0.1
|
|
||||||
count=$(($count + 1))
|
|
||||||
done
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
bootdaemon()
|
bootdaemon()
|
||||||
{
|
{
|
||||||
QUAGGA_SBIN_DIR=$(searchforprog $1 $QUAGGA_SBIN_SEARCH)
|
QUAGGA_SBIN_DIR=$(searchforprog $1 $QUAGGA_SBIN_SEARCH)
|
||||||
|
@ -203,54 +176,54 @@ bootdaemon()
|
||||||
|
|
||||||
flags=""
|
flags=""
|
||||||
|
|
||||||
if [ "$1" != "zebra" ]; then
|
|
||||||
waitforvtyfiles zebra.vty
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$1" = "xpimd" ] && \\
|
if [ "$1" = "xpimd" ] && \\
|
||||||
grep -E -q '^[[:space:]]*router[[:space:]]+pim6[[:space:]]*$' $QUAGGA_CONF; then
|
grep -E -q '^[[:space:]]*router[[:space:]]+pim6[[:space:]]*$' $QUAGGA_CONF; then
|
||||||
flags="$flags -6"
|
flags="$flags -6"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$QUAGGA_SBIN_DIR/$1 $flags -u $QUAGGA_USER -g $QUAGGA_GROUP -d
|
$QUAGGA_SBIN_DIR/$1 $flags -d
|
||||||
|
if [ "$?" != "0" ]; then
|
||||||
|
echo "ERROR: Quagga's '$1' daemon failed to start!:"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
bootvtysh()
|
bootquagga()
|
||||||
{
|
{
|
||||||
QUAGGA_BIN_DIR=$(searchforprog $1 $QUAGGA_BIN_SEARCH)
|
QUAGGA_BIN_DIR=$(searchforprog 'vtysh' $QUAGGA_BIN_SEARCH)
|
||||||
if [ "z$QUAGGA_BIN_DIR" = "z" ]; then
|
if [ "z$QUAGGA_BIN_DIR" = "z" ]; then
|
||||||
echo "ERROR: Quagga's '$1' daemon not found in search path:"
|
echo "ERROR: Quagga's 'vtysh' program not found in search path:"
|
||||||
echo " $QUAGGA_SBIN_SEARCH"
|
echo " $QUAGGA_BIN_SEARCH"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
vtyfiles="zebra.vty"
|
# fix /var/run/quagga permissions
|
||||||
|
id -u quagga 2>/dev/null >/dev/null
|
||||||
|
if [ "$?" = "0" ]; then
|
||||||
|
chown quagga $QUAGGA_STATE_DIR
|
||||||
|
fi
|
||||||
|
|
||||||
|
bootdaemon "zebra"
|
||||||
for r in rip ripng ospf6 ospf bgp babel; do
|
for r in rip ripng ospf6 ospf bgp babel; do
|
||||||
if grep -q "^router \<${r}\>" $QUAGGA_CONF; then
|
if grep -q "^router \<${r}\>" $QUAGGA_CONF; then
|
||||||
vtyfiles="$vtyfiles ${r}d.vty"
|
bootdaemon "${r}d"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if grep -E -q '^[[:space:]]*router[[:space:]]+pim6?[[:space:]]*$' $QUAGGA_CONF; then
|
if grep -E -q '^[[:space:]]*router[[:space:]]+pim6?[[:space:]]*$' $QUAGGA_CONF; then
|
||||||
vtyfiles="$vtyfiles xpimd.vty"
|
bootdaemon "xpimd"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# wait for Quagga daemon vty files to appear before invoking vtysh
|
|
||||||
waitforvtyfiles $vtyfiles
|
|
||||||
|
|
||||||
$QUAGGA_BIN_DIR/vtysh -b
|
$QUAGGA_BIN_DIR/vtysh -b
|
||||||
}
|
}
|
||||||
|
|
||||||
confcheck
|
if [ "$1" != "zebra" ]; then
|
||||||
if [ "x$1" = "x" ]; then
|
echo "WARNING: '$1': all Quagga daemons are launched by the 'zebra' service!"
|
||||||
echo "ERROR: missing the name of the Quagga daemon to boot"
|
|
||||||
exit 1
|
exit 1
|
||||||
elif [ "$1" = "vtysh" ]; then
|
|
||||||
bootvtysh $1
|
|
||||||
else
|
|
||||||
bootdaemon $1
|
|
||||||
fi
|
fi
|
||||||
""" % (cls._configs[0], quagga_sbin_search, quagga_bin_search, constants.QUAGGA_STATE_DIR, QUAGGA_USER, QUAGGA_GROUP)
|
confcheck
|
||||||
|
bootquagga
|
||||||
|
""" % (cls._configs[0], quagga_sbin_search, quagga_bin_search, constants.QUAGGA_STATE_DIR)
|
||||||
|
|
||||||
|
|
||||||
class QuaggaService(CoreService):
|
class QuaggaService(CoreService):
|
||||||
|
@ -308,7 +281,7 @@ class QuaggaService(CoreService):
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def generatequaggaconfig(cls, node, services):
|
def generatequaggaconfig(cls, node):
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
|
@ -319,9 +292,9 @@ class Ospfv2(QuaggaService):
|
||||||
unified Quagga.conf file.
|
unified Quagga.conf file.
|
||||||
"""
|
"""
|
||||||
_name = "OSPFv2"
|
_name = "OSPFv2"
|
||||||
_startup = ("sh quaggaboot.sh ospfd",)
|
_startup = ()
|
||||||
_shutdown = ("killall ospfd",)
|
_shutdown = ("killall ospfd", )
|
||||||
_validate = ("pidof ospfd",)
|
_validate = ("pidof ospfd", )
|
||||||
_ipv4_routing = True
|
_ipv4_routing = True
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -353,7 +326,7 @@ class Ospfv2(QuaggaService):
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def generatequaggaconfig(cls, node, services):
|
def generatequaggaconfig(cls, node):
|
||||||
cfg = "router ospf\n"
|
cfg = "router ospf\n"
|
||||||
rtrid = cls.routerid(node)
|
rtrid = cls.routerid(node)
|
||||||
cfg += " router-id %s\n" % rtrid
|
cfg += " router-id %s\n" % rtrid
|
||||||
|
@ -394,9 +367,9 @@ class Ospfv3(QuaggaService):
|
||||||
unified Quagga.conf file.
|
unified Quagga.conf file.
|
||||||
"""
|
"""
|
||||||
_name = "OSPFv3"
|
_name = "OSPFv3"
|
||||||
_startup = ("sh quaggaboot.sh ospf6d",)
|
_startup = ()
|
||||||
_shutdown = ("killall ospf6d",)
|
_shutdown = ("killall ospf6d", )
|
||||||
_validate = ("pidof ospf6d",)
|
_validate = ("pidof ospf6d", )
|
||||||
_ipv4_routing = True
|
_ipv4_routing = True
|
||||||
_ipv6_routing = True
|
_ipv6_routing = True
|
||||||
|
|
||||||
|
@ -438,13 +411,7 @@ class Ospfv3(QuaggaService):
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def generatequaggaconfig(cls, node, services):
|
def generatequaggaconfig(cls, node):
|
||||||
# Check whether the node is running OVS
|
|
||||||
has_ovs = 0
|
|
||||||
for s in services:
|
|
||||||
if s._name == "OvsService":
|
|
||||||
has_ovs =1
|
|
||||||
|
|
||||||
cfg = "router ospf6\n"
|
cfg = "router ospf6\n"
|
||||||
rtrid = cls.routerid(node)
|
rtrid = cls.routerid(node)
|
||||||
cfg += " router-id %s\n" % rtrid
|
cfg += " router-id %s\n" % rtrid
|
||||||
|
@ -457,7 +424,7 @@ class Ospfv3(QuaggaService):
|
||||||
ifnumstr = re.findall(r"\d+", ifc.name)
|
ifnumstr = re.findall(r"\d+", ifc.name)
|
||||||
ifnum = ifnumstr[0]
|
ifnum = ifnumstr[0]
|
||||||
ifname = "rtr%s" % ifnum
|
ifname = "rtr%s" % ifnum
|
||||||
|
|
||||||
cfg += " interface %s area 0.0.0.0\n" % ifc.name
|
cfg += " interface %s area 0.0.0.0\n" % ifc.name
|
||||||
cfg += "!\n"
|
cfg += "!\n"
|
||||||
return cfg
|
return cfg
|
||||||
|
@ -508,6 +475,7 @@ class Ospfv3mdr(Ospfv3):
|
||||||
else:
|
else:
|
||||||
return cfg
|
return cfg
|
||||||
|
|
||||||
|
|
||||||
class Bgp(QuaggaService):
|
class Bgp(QuaggaService):
|
||||||
"""
|
"""
|
||||||
The BGP service provides interdomain routing.
|
The BGP service provides interdomain routing.
|
||||||
|
@ -515,15 +483,15 @@ class Bgp(QuaggaService):
|
||||||
having the same AS number.
|
having the same AS number.
|
||||||
"""
|
"""
|
||||||
_name = "BGP"
|
_name = "BGP"
|
||||||
_startup = ("sh quaggaboot.sh bgpd",)
|
_startup = ()
|
||||||
_shutdown = ("killall bgpd",)
|
_shutdown = ("killall bgpd", )
|
||||||
_validate = ("pidof bgpd",)
|
_validate = ("pidof bgpd", )
|
||||||
_custom_needed = True
|
_custom_needed = True
|
||||||
_ipv4_routing = True
|
_ipv4_routing = True
|
||||||
_ipv6_routing = True
|
_ipv6_routing = True
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def generatequaggaconfig(cls, node, services):
|
def generatequaggaconfig(cls, node):
|
||||||
cfg = "!\n! BGP configuration\n!\n"
|
cfg = "!\n! BGP configuration\n!\n"
|
||||||
cfg += "! You should configure the AS number below,\n"
|
cfg += "! You should configure the AS number below,\n"
|
||||||
cfg += "! along with this router's peers.\n!\n"
|
cfg += "! along with this router's peers.\n!\n"
|
||||||
|
@ -534,18 +502,19 @@ class Bgp(QuaggaService):
|
||||||
cfg += "! neighbor 1.2.3.4 remote-as 555\n!\n"
|
cfg += "! neighbor 1.2.3.4 remote-as 555\n!\n"
|
||||||
return cfg
|
return cfg
|
||||||
|
|
||||||
|
|
||||||
class Rip(QuaggaService):
|
class Rip(QuaggaService):
|
||||||
"""
|
"""
|
||||||
The RIP service provides IPv4 routing for wired networks.
|
The RIP service provides IPv4 routing for wired networks.
|
||||||
"""
|
"""
|
||||||
_name = "RIP"
|
_name = "RIP"
|
||||||
_startup = ("sh quaggaboot.sh ripd",)
|
_startup = ()
|
||||||
_shutdown = ("killall ripd",)
|
_shutdown = ("killall ripd", )
|
||||||
_validate = ("pidof ripd",)
|
_validate = ("pidof ripd", )
|
||||||
_ipv4_routing = True
|
_ipv4_routing = True
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def generatequaggaconfig(cls, node, services):
|
def generatequaggaconfig(cls, node):
|
||||||
cfg = """\
|
cfg = """\
|
||||||
router rip
|
router rip
|
||||||
redistribute static
|
redistribute static
|
||||||
|
@ -556,18 +525,19 @@ router rip
|
||||||
"""
|
"""
|
||||||
return cfg
|
return cfg
|
||||||
|
|
||||||
|
|
||||||
class Ripng(QuaggaService):
|
class Ripng(QuaggaService):
|
||||||
"""
|
"""
|
||||||
The RIP NG service provides IPv6 routing for wired networks.
|
The RIP NG service provides IPv6 routing for wired networks.
|
||||||
"""
|
"""
|
||||||
_name = "RIPNG"
|
_name = "RIPNG"
|
||||||
_startup = ("sh quaggaboot.sh ripngd",)
|
_startup = ()
|
||||||
_shutdown = ("killall ripngd",)
|
_shutdown = ("killall ripngd", )
|
||||||
_validate = ("pidof ripngd",)
|
_validate = ("pidof ripngd", )
|
||||||
_ipv6_routing = True
|
_ipv6_routing = True
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def generatequaggaconfig(cls, node, services):
|
def generatequaggaconfig(cls, node):
|
||||||
cfg = """\
|
cfg = """\
|
||||||
router ripng
|
router ripng
|
||||||
redistribute static
|
redistribute static
|
||||||
|
@ -578,36 +548,24 @@ router ripng
|
||||||
"""
|
"""
|
||||||
return cfg
|
return cfg
|
||||||
|
|
||||||
|
|
||||||
class Babel(QuaggaService):
|
class Babel(QuaggaService):
|
||||||
"""
|
"""
|
||||||
The Babel service provides a loop-avoiding distance-vector routing
|
The Babel service provides a loop-avoiding distance-vector routing
|
||||||
protocol for IPv6 and IPv4 with fast convergence properties.
|
protocol for IPv6 and IPv4 with fast convergence properties.
|
||||||
"""
|
"""
|
||||||
_name = "Babel"
|
_name = "Babel"
|
||||||
_startup = ("sh quaggaboot.sh babeld",)
|
_startup = ()
|
||||||
_shutdown = ("killall babeld",)
|
_shutdown = ("killall babeld", )
|
||||||
_validate = ("pidof babeld",)
|
_validate = ("pidof babeld", )
|
||||||
_ipv6_routing = True
|
_ipv6_routing = True
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def generatequaggaconfig(cls, node, services):
|
def generatequaggaconfig(cls, node):
|
||||||
# Check whether the node is running OVS
|
|
||||||
has_ovs = 0
|
|
||||||
for s in services:
|
|
||||||
if s._name == "OvsService":
|
|
||||||
has_ovs =1
|
|
||||||
|
|
||||||
cfg = "router babel\n"
|
cfg = "router babel\n"
|
||||||
for ifc in node.netifs():
|
for ifc in node.netifs():
|
||||||
if hasattr(ifc, 'control') and ifc.control is True:
|
if hasattr(ifc, "control") and ifc.control is True:
|
||||||
continue
|
continue
|
||||||
if has_ovs == 0:
|
|
||||||
ifname = ifc.name
|
|
||||||
else:
|
|
||||||
ifnumstr = re.findall(r"\d+", ifc.name)
|
|
||||||
ifnum = ifnumstr[0]
|
|
||||||
ifname = "rtr%s" % ifnum
|
|
||||||
|
|
||||||
cfg += " network %s\n" % ifc.name
|
cfg += " network %s\n" % ifc.name
|
||||||
cfg += " redistribute static\n redistribute connected\n"
|
cfg += " redistribute static\n redistribute connected\n"
|
||||||
return cfg
|
return cfg
|
||||||
|
@ -620,37 +578,23 @@ class Babel(QuaggaService):
|
||||||
else:
|
else:
|
||||||
return " babel wired\n babel split-horizon\n"
|
return " babel wired\n babel split-horizon\n"
|
||||||
|
|
||||||
|
|
||||||
class Xpimd(QuaggaService):
|
class Xpimd(QuaggaService):
|
||||||
"""
|
"""
|
||||||
PIM multicast routing based on XORP.
|
PIM multicast routing based on XORP.
|
||||||
"""
|
"""
|
||||||
_name = 'Xpimd'
|
_name = 'Xpimd'
|
||||||
_startup = ('sh quaggaboot.sh xpimd',)
|
_startup = ()
|
||||||
_shutdown = ('killall xpimd',)
|
_shutdown = ('killall xpimd', )
|
||||||
_validate = ('pidof xpimd',)
|
_validate = ('pidof xpimd', )
|
||||||
_ipv4_routing = True
|
_ipv4_routing = True
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def generatequaggaconfig(cls, node, services):
|
def generatequaggaconfig(cls, node):
|
||||||
# Check whether the node is running OVS
|
ifname = 'eth0'
|
||||||
has_ovs = 0
|
|
||||||
for s in services:
|
|
||||||
if s._name == "OvsService":
|
|
||||||
has_ovs =1
|
|
||||||
if has_ovs == 0:
|
|
||||||
ifname = 'eth0'
|
|
||||||
else:
|
|
||||||
ifname = 'rtr0'
|
|
||||||
|
|
||||||
for ifc in node.netifs():
|
for ifc in node.netifs():
|
||||||
if ifc.name != 'lo':
|
if ifc.name != 'lo':
|
||||||
if has_ovs == 0:
|
ifname = ifc.name
|
||||||
ifname = ifc.name
|
|
||||||
else:
|
|
||||||
ifnumstr = re.findall(r"\d+", ifc.name)
|
|
||||||
ifnum = ifnumstr[0]
|
|
||||||
ifname = "rtr%s" % ifnum
|
|
||||||
|
|
||||||
break
|
break
|
||||||
cfg = 'router mfea\n!\n'
|
cfg = 'router mfea\n!\n'
|
||||||
cfg += 'router igmp\n!\n'
|
cfg += 'router igmp\n!\n'
|
||||||
|
@ -665,20 +609,6 @@ class Xpimd(QuaggaService):
|
||||||
def generatequaggaifcconfig(cls, node, ifc):
|
def generatequaggaifcconfig(cls, node, ifc):
|
||||||
return ' ip mfea\n ip igmp\n ip pim\n'
|
return ' ip mfea\n ip igmp\n ip pim\n'
|
||||||
|
|
||||||
class Vtysh(CoreService):
|
|
||||||
"""
|
|
||||||
Simple service to run vtysh -b (boot) after all Quagga daemons have
|
|
||||||
started.
|
|
||||||
"""
|
|
||||||
_name = "vtysh"
|
|
||||||
_group = "Quagga"
|
|
||||||
_startindex = 45
|
|
||||||
_startup = ("sh quaggaboot.sh vtysh",)
|
|
||||||
_shutdown = ()
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def generateconfig(cls, node, filename, services):
|
|
||||||
return ""
|
|
||||||
|
|
||||||
def load_services():
|
def load_services():
|
||||||
ServiceManager.add(Zebra)
|
ServiceManager.add(Zebra)
|
||||||
|
@ -690,4 +620,3 @@ def load_services():
|
||||||
ServiceManager.add(Ripng)
|
ServiceManager.add(Ripng)
|
||||||
ServiceManager.add(Babel)
|
ServiceManager.add(Babel)
|
||||||
ServiceManager.add(Xpimd)
|
ServiceManager.add(Xpimd)
|
||||||
ServiceManager.add(Vtysh)
|
|
||||||
|
|
|
@ -102,7 +102,6 @@ class XenNode(PyCoreNode):
|
||||||
# 'sh quaggaboot.sh zebra',
|
# 'sh quaggaboot.sh zebra',
|
||||||
# 'sh quaggaboot.sh ospfd',
|
# 'sh quaggaboot.sh ospfd',
|
||||||
# 'sh quaggaboot.sh ospf6d',
|
# 'sh quaggaboot.sh ospf6d',
|
||||||
'sh quaggaboot.sh vtysh',
|
|
||||||
'killall zebra',
|
'killall zebra',
|
||||||
'killall ospfd',
|
'killall ospfd',
|
||||||
'killall ospf6d',
|
'killall ospf6d',
|
||||||
|
|
|
@ -851,12 +851,10 @@ class CoreDocumentParser1(object):
|
||||||
def parse_default_services(self):
|
def parse_default_services(self):
|
||||||
# defaults from the CORE GUI
|
# defaults from the CORE GUI
|
||||||
self.default_services = {
|
self.default_services = {
|
||||||
'router': ['zebra', 'OSPFv2', 'OSPFv3', 'vtysh', 'IPForward'],
|
'router': ['zebra', 'OSPFv2', 'OSPFv3', 'IPForward'],
|
||||||
'host': ['DefaultRoute', 'SSH'],
|
'host': ['DefaultRoute', 'SSH'],
|
||||||
'PC': ['DefaultRoute', ],
|
'PC': ['DefaultRoute', ],
|
||||||
'mdr': ['zebra', 'OSPFv3MDR', 'vtysh', 'IPForward'],
|
'mdr': ['zebra', 'OSPFv3MDR', 'IPForward'],
|
||||||
# 'prouter': ['zebra', 'OSPFv2', 'OSPFv3', 'vtysh', 'IPForward'],
|
|
||||||
# 'xen': ['zebra', 'OSPFv2', 'OSPFv3', 'vtysh', 'IPForward'],
|
|
||||||
}
|
}
|
||||||
default_services = xmlutils.get_first_child_by_tag_name(self.scenario, 'CORE:defaultservices')
|
default_services = xmlutils.get_first_child_by_tag_name(self.scenario, 'CORE:defaultservices')
|
||||||
if not default_services:
|
if not default_services:
|
||||||
|
|
|
@ -603,7 +603,7 @@ class DeviceElement(NamedXmlElement):
|
||||||
device_type = DevType.HOST
|
device_type = DevType.HOST
|
||||||
|
|
||||||
if device_type is None:
|
if device_type is None:
|
||||||
raise Exception
|
raise ValueError("unknown device type: %s" % core_device_type)
|
||||||
|
|
||||||
NamedXmlElement.__init__(self, scen_plan, parent, device_type, device_object.name)
|
NamedXmlElement.__init__(self, scen_plan, parent, device_type, device_object.name)
|
||||||
|
|
||||||
|
|
|
@ -29,12 +29,12 @@ quagga_sbin_search = "/usr/local/sbin /usr/sbin /usr/lib/quagga"
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# uncomment and edit to establish a distributed control backchannel
|
# uncomment and edit to establish a distributed control backchannel
|
||||||
#controlnet = core1:172.16.1.0/24 core2:172.16.2.0/24 core3:172.16.3.0/24 core4 :172.16.4.0/24 core5:172.16.5.0/24
|
#controlnet = core1:172.16.1.0/24 core:172.16.2.0/24 core3:172.16.3.0/24 core4 :172.16.4.0/24 core5:172.16.5.0/24
|
||||||
|
|
||||||
# uncomment and edit to establish distributed auxiliary control channels.
|
# uncomment and edit to establish distributed auxiliary control channels.
|
||||||
#controlnet1 = core1:172.17.1.0/24 core2:172.17.2.0/24 core3:172.17.3.0/24 core4 :172.17.4.0/24 core5:172.17.5.0/24
|
#controlnet1 = core1:172.17.1.0/24 core:172.17.2.0/24 core3:172.17.3.0/24 core4 :172.17.4.0/24 core5:172.17.5.0/24
|
||||||
#controlnet2 = core1:172.18.1.0/24 core2:172.18.2.0/24 core3:172.18.3.0/24 core4 :172.18.4.0/24 core5:172.18.5.0/24
|
#controlnet2 = core1:172.18.1.0/24 core:172.18.2.0/24 core3:172.18.3.0/24 core4 :172.18.4.0/24 core5:172.18.5.0/24
|
||||||
#controlnet3 = core1:172.19.1.0/24 core2:172.19.2.0/24 core3:172.19.3.0/24 core4 :172.19.4.0/24 core5:172.19.5.0/24
|
#controlnet3 = core1:172.19.1.0/24 core:172.19.2.0/24 core3:172.19.3.0/24 core4 :172.19.4.0/24 core5:172.19.5.0/24
|
||||||
|
|
||||||
# uncomment and edit to assign host interfaces to auxilary control channels
|
# uncomment and edit to assign host interfaces to auxilary control channels
|
||||||
# for use in connecting with other servers in a distributed environments.
|
# for use in connecting with other servers in a distributed environments.
|
||||||
|
@ -57,7 +57,7 @@ emane_platform_port = 8101
|
||||||
emane_transform_port = 8201
|
emane_transform_port = 8201
|
||||||
emane_event_generate = True
|
emane_event_generate = True
|
||||||
emane_event_monitor = False
|
emane_event_monitor = False
|
||||||
emane_models = RfPipe, Ieee80211abg, CommEffect, Bypass
|
emane_models = RfPipe, Ieee80211abg, CommEffect, Bypass, Tdma
|
||||||
# EMANE log level range [0,4] default: 2
|
# EMANE log level range [0,4] default: 2
|
||||||
#emane_log_level = 2
|
#emane_log_level = 2
|
||||||
emane_realtime = True
|
emane_realtime = True
|
||||||
|
|
|
@ -76,7 +76,7 @@ def main():
|
||||||
values[names.index('propagationmodel')] = '2ray'
|
values[names.index('propagationmodel')] = '2ray'
|
||||||
|
|
||||||
session.emane.setconfig(wlan.objid, EmaneIeee80211abgModel.name, values)
|
session.emane.setconfig(wlan.objid, EmaneIeee80211abgModel.name, values)
|
||||||
services_str = "zebra|OSPFv3MDR|vtysh|IPForward"
|
services_str = "zebra|OSPFv3MDR|IPForward"
|
||||||
|
|
||||||
print "creating %d nodes with addresses from %s" % \
|
print "creating %d nodes with addresses from %s" % \
|
||||||
(options.numnodes, prefix)
|
(options.numnodes, prefix)
|
||||||
|
|
|
@ -97,7 +97,7 @@ def main():
|
||||||
parser.add_option("-s", "--services", dest="services", type=str,
|
parser.add_option("-s", "--services", dest="services", type=str,
|
||||||
help="pipe-delimited list of services added to each "
|
help="pipe-delimited list of services added to each "
|
||||||
"node (default = %s)\n(Example: zebra|OSPFv2|OSPFv3|"
|
"node (default = %s)\n(Example: zebra|OSPFv2|OSPFv3|"
|
||||||
"vtysh|IPForward)" % parser.defaults["services"])
|
"IPForward)" % parser.defaults["services"])
|
||||||
|
|
||||||
def usage(msg=None, err=0):
|
def usage(msg=None, err=0):
|
||||||
sys.stdout.write("\n")
|
sys.stdout.write("\n")
|
||||||
|
|
|
@ -66,7 +66,7 @@ def wifisession(opt):
|
||||||
wifi.phy.Set("RxGain", ns.core.DoubleValue(18.0))
|
wifi.phy.Set("RxGain", ns.core.DoubleValue(18.0))
|
||||||
|
|
||||||
prefix = ipaddr.IPv4Prefix("10.0.0.0/16")
|
prefix = ipaddr.IPv4Prefix("10.0.0.0/16")
|
||||||
services_str = "zebra|OSPFv3MDR|vtysh|IPForward"
|
services_str = "zebra|OSPFv3MDR|IPForward"
|
||||||
nodes = []
|
nodes = []
|
||||||
for i in xrange(1, opt.numnodes + 1):
|
for i in xrange(1, opt.numnodes + 1):
|
||||||
node = session.addnode(name = "n%d" % i)
|
node = session.addnode(name = "n%d" % i)
|
||||||
|
|
|
@ -163,7 +163,6 @@ def sighandler(signum, stackframe):
|
||||||
|
|
||||||
signal.signal(signal.SIGHUP, sighandler)
|
signal.signal(signal.SIGHUP, sighandler)
|
||||||
signal.signal(signal.SIGINT, sighandler)
|
signal.signal(signal.SIGINT, sighandler)
|
||||||
signal.signal(signal.SIGPIPE, sighandler)
|
|
||||||
signal.signal(signal.SIGTERM, sighandler)
|
signal.signal(signal.SIGTERM, sighandler)
|
||||||
signal.signal(signal.SIGUSR1, sighandler)
|
signal.signal(signal.SIGUSR1, sighandler)
|
||||||
signal.signal(signal.SIGUSR2, sighandler)
|
signal.signal(signal.SIGUSR2, sighandler)
|
||||||
|
|
|
@ -111,7 +111,7 @@ Here are quick instructions for installing all EMANE packages:
|
||||||
::
|
::
|
||||||
|
|
||||||
# install dependencies
|
# install dependencies
|
||||||
sudo apt-get install libssl-dev libxml-lixbml-perl libxml-simple-perl
|
sudo apt-get install libssl-dev libxml-libxml-perl libxml-simple-perl
|
||||||
# download and install EMANE 0.8.1
|
# download and install EMANE 0.8.1
|
||||||
export URL=http://downloads.pf.itd.nrl.navy.mil/emane/0.8.1-r2
|
export URL=http://downloads.pf.itd.nrl.navy.mil/emane/0.8.1-r2
|
||||||
wget $URL/emane-0.8.1-release-2.ubuntu-12_04.amd64.tgz
|
wget $URL/emane-0.8.1-release-2.ubuntu-12_04.amd64.tgz
|
||||||
|
|
|
@ -1448,13 +1448,13 @@ Here are the default node types and their services:
|
||||||
.. index:: Xen
|
.. index:: Xen
|
||||||
.. index:: physical nodes
|
.. index:: physical nodes
|
||||||
|
|
||||||
* *router* - zebra, OSFPv2, OSPFv3, vtysh, and IPForward services for IGP
|
* *router* - zebra, OSFPv2, OSPFv3, and IPForward services for IGP
|
||||||
link-state routing.
|
link-state routing.
|
||||||
* *host* - DefaultRoute and SSH services, representing an SSH server having a
|
* *host* - DefaultRoute and SSH services, representing an SSH server having a
|
||||||
default route when connected directly to a router.
|
default route when connected directly to a router.
|
||||||
* *PC* - DefaultRoute service for having a default route when connected
|
* *PC* - DefaultRoute service for having a default route when connected
|
||||||
directly to a router.
|
directly to a router.
|
||||||
* *mdr* - zebra, OSPFv3MDR, vtysh, and IPForward services for
|
* *mdr* - zebra, OSPFv3MDR, and IPForward services for
|
||||||
wireless-optimized MANET Designated Router routing.
|
wireless-optimized MANET Designated Router routing.
|
||||||
* *prouter* - a physical router, having the same default services as the
|
* *prouter* - a physical router, having the same default services as the
|
||||||
*router* node type; for incorporating Linux testbed machines into an
|
*router* node type; for incorporating Linux testbed machines into an
|
||||||
|
|
|
@ -105,7 +105,7 @@ node n5 {
|
||||||
labelcoords {540.0 376.0}
|
labelcoords {540.0 376.0}
|
||||||
interface-peer {eth0 n10}
|
interface-peer {eth0 n10}
|
||||||
interface-peer {eth1 n15}
|
interface-peer {eth1 n15}
|
||||||
services {zebra OSPFv2 OSPFv3MDR vtysh IPForward}
|
services {zebra OSPFv2 OSPFv3MDR IPForward}
|
||||||
custom-config {
|
custom-config {
|
||||||
custom-config-id service:zebra
|
custom-config-id service:zebra
|
||||||
custom-command zebra
|
custom-command zebra
|
||||||
|
|
|
@ -283,7 +283,7 @@ node n11 {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
services {zebra OSPFv2 OSPFv3MDR vtysh IPForward}
|
services {zebra OSPFv2 OSPFv3MDR IPForward}
|
||||||
}
|
}
|
||||||
|
|
||||||
node n12 {
|
node n12 {
|
||||||
|
@ -517,7 +517,7 @@ node n20 {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
services {zebra OSPFv2 OSPFv3MDR vtysh IPForward}
|
services {zebra OSPFv2 OSPFv3MDR IPForward}
|
||||||
}
|
}
|
||||||
|
|
||||||
node n21 {
|
node n21 {
|
||||||
|
|
|
@ -20,7 +20,7 @@ node n1 {
|
||||||
interface-peer {eth1 n2}
|
interface-peer {eth1 n2}
|
||||||
interface-peer {eth2 n3}
|
interface-peer {eth2 n3}
|
||||||
canvas c1
|
canvas c1
|
||||||
services {zebra BGP vtysh IPForward}
|
services {zebra BGP IPForward}
|
||||||
custom-config {
|
custom-config {
|
||||||
custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf
|
custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf
|
||||||
custom-command /usr/local/etc/quagga/Quagga.conf
|
custom-command /usr/local/etc/quagga/Quagga.conf
|
||||||
|
@ -82,7 +82,7 @@ node n2 {
|
||||||
interface-peer {eth1 n16}
|
interface-peer {eth1 n16}
|
||||||
interface-peer {eth2 n6}
|
interface-peer {eth2 n6}
|
||||||
canvas c1
|
canvas c1
|
||||||
services {zebra BGP vtysh IPForward}
|
services {zebra BGP IPForward}
|
||||||
custom-config {
|
custom-config {
|
||||||
custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf
|
custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf
|
||||||
custom-command /usr/local/etc/quagga/Quagga.conf
|
custom-command /usr/local/etc/quagga/Quagga.conf
|
||||||
|
@ -140,7 +140,7 @@ node n3 {
|
||||||
interface-peer {eth0 n4}
|
interface-peer {eth0 n4}
|
||||||
interface-peer {eth1 n1}
|
interface-peer {eth1 n1}
|
||||||
canvas c1
|
canvas c1
|
||||||
services {zebra BGP vtysh IPForward}
|
services {zebra BGP IPForward}
|
||||||
custom-config {
|
custom-config {
|
||||||
custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf
|
custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf
|
||||||
custom-command /usr/local/etc/quagga/Quagga.conf
|
custom-command /usr/local/etc/quagga/Quagga.conf
|
||||||
|
@ -197,7 +197,7 @@ node n4 {
|
||||||
interface-peer {eth0 n3}
|
interface-peer {eth0 n3}
|
||||||
interface-peer {eth1 n7}
|
interface-peer {eth1 n7}
|
||||||
canvas c1
|
canvas c1
|
||||||
services {zebra BGP vtysh IPForward}
|
services {zebra BGP IPForward}
|
||||||
custom-config {
|
custom-config {
|
||||||
custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf
|
custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf
|
||||||
custom-command /usr/local/etc/quagga/Quagga.conf
|
custom-command /usr/local/etc/quagga/Quagga.conf
|
||||||
|
@ -258,7 +258,7 @@ node n5 {
|
||||||
interface-peer {eth0 n7}
|
interface-peer {eth0 n7}
|
||||||
interface-peer {eth1 n6}
|
interface-peer {eth1 n6}
|
||||||
canvas c1
|
canvas c1
|
||||||
services {zebra BGP vtysh IPForward}
|
services {zebra BGP IPForward}
|
||||||
custom-config {
|
custom-config {
|
||||||
custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf
|
custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf
|
||||||
custom-command /usr/local/etc/quagga/Quagga.conf
|
custom-command /usr/local/etc/quagga/Quagga.conf
|
||||||
|
@ -323,7 +323,7 @@ node n6 {
|
||||||
interface-peer {eth0 n5}
|
interface-peer {eth0 n5}
|
||||||
interface-peer {eth1 n2}
|
interface-peer {eth1 n2}
|
||||||
canvas c1
|
canvas c1
|
||||||
services {zebra BGP vtysh IPForward}
|
services {zebra BGP IPForward}
|
||||||
custom-config {
|
custom-config {
|
||||||
custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf
|
custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf
|
||||||
custom-command /usr/local/etc/quagga/Quagga.conf
|
custom-command /usr/local/etc/quagga/Quagga.conf
|
||||||
|
@ -376,7 +376,7 @@ node n7 {
|
||||||
interface-peer {eth0 n5}
|
interface-peer {eth0 n5}
|
||||||
interface-peer {eth1 n4}
|
interface-peer {eth1 n4}
|
||||||
canvas c1
|
canvas c1
|
||||||
services {zebra BGP vtysh IPForward}
|
services {zebra BGP IPForward}
|
||||||
custom-config {
|
custom-config {
|
||||||
custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf
|
custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf
|
||||||
custom-command /usr/local/etc/quagga/Quagga.conf
|
custom-command /usr/local/etc/quagga/Quagga.conf
|
||||||
|
@ -555,7 +555,7 @@ node n16 {
|
||||||
interface-peer {eth0 n1}
|
interface-peer {eth0 n1}
|
||||||
interface-peer {eth1 n2}
|
interface-peer {eth1 n2}
|
||||||
canvas c1
|
canvas c1
|
||||||
services {zebra BGP vtysh IPForward}
|
services {zebra BGP IPForward}
|
||||||
custom-config {
|
custom-config {
|
||||||
custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf
|
custom-config-id service:zebra:/usr/local/etc/quagga/Quagga.conf
|
||||||
custom-command /usr/local/etc/quagga/Quagga.conf
|
custom-command /usr/local/etc/quagga/Quagga.conf
|
||||||
|
|
|
@ -65,7 +65,7 @@ node n1 {
|
||||||
canvas c1
|
canvas c1
|
||||||
interface-peer {eth0 n11}
|
interface-peer {eth0 n11}
|
||||||
custom-image $CORE_DATA_DIR/icons/normal/router_green.gif
|
custom-image $CORE_DATA_DIR/icons/normal/router_green.gif
|
||||||
services {zebra OSPFv3MDR vtysh SMF IPForward UserDefined}
|
services {zebra OSPFv3MDR SMF IPForward UserDefined}
|
||||||
custom-config {
|
custom-config {
|
||||||
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
||||||
custom-command custom-post-config-commands.sh
|
custom-command custom-post-config-commands.sh
|
||||||
|
@ -101,7 +101,7 @@ node n2 {
|
||||||
canvas c1
|
canvas c1
|
||||||
interface-peer {eth0 n11}
|
interface-peer {eth0 n11}
|
||||||
custom-image $CORE_DATA_DIR/icons/normal/router_green.gif
|
custom-image $CORE_DATA_DIR/icons/normal/router_green.gif
|
||||||
services {zebra OSPFv3MDR vtysh SMF IPForward UserDefined}
|
services {zebra OSPFv3MDR SMF IPForward UserDefined}
|
||||||
custom-config {
|
custom-config {
|
||||||
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
||||||
custom-command custom-post-config-commands.sh
|
custom-command custom-post-config-commands.sh
|
||||||
|
@ -137,7 +137,7 @@ node n3 {
|
||||||
canvas c1
|
canvas c1
|
||||||
interface-peer {eth0 n11}
|
interface-peer {eth0 n11}
|
||||||
custom-image $CORE_DATA_DIR/icons/normal/router_green.gif
|
custom-image $CORE_DATA_DIR/icons/normal/router_green.gif
|
||||||
services {zebra OSPFv3MDR vtysh SMF IPForward UserDefined}
|
services {zebra OSPFv3MDR SMF IPForward UserDefined}
|
||||||
custom-config {
|
custom-config {
|
||||||
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
||||||
custom-command custom-post-config-commands.sh
|
custom-command custom-post-config-commands.sh
|
||||||
|
@ -173,7 +173,7 @@ node n4 {
|
||||||
canvas c1
|
canvas c1
|
||||||
interface-peer {eth0 n11}
|
interface-peer {eth0 n11}
|
||||||
custom-image $CORE_DATA_DIR/icons/normal/router_green.gif
|
custom-image $CORE_DATA_DIR/icons/normal/router_green.gif
|
||||||
services {zebra OSPFv3MDR vtysh SMF IPForward UserDefined}
|
services {zebra OSPFv3MDR SMF IPForward UserDefined}
|
||||||
custom-config {
|
custom-config {
|
||||||
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
||||||
custom-command custom-post-config-commands.sh
|
custom-command custom-post-config-commands.sh
|
||||||
|
@ -209,7 +209,7 @@ node n5 {
|
||||||
canvas c1
|
canvas c1
|
||||||
interface-peer {eth0 n11}
|
interface-peer {eth0 n11}
|
||||||
custom-image $CORE_DATA_DIR/icons/normal/router_green.gif
|
custom-image $CORE_DATA_DIR/icons/normal/router_green.gif
|
||||||
services {zebra OSPFv3MDR vtysh SMF IPForward UserDefined}
|
services {zebra OSPFv3MDR SMF IPForward UserDefined}
|
||||||
custom-config {
|
custom-config {
|
||||||
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
||||||
custom-command custom-post-config-commands.sh
|
custom-command custom-post-config-commands.sh
|
||||||
|
@ -245,7 +245,7 @@ node n6 {
|
||||||
canvas c1
|
canvas c1
|
||||||
interface-peer {eth0 n11}
|
interface-peer {eth0 n11}
|
||||||
custom-image $CORE_DATA_DIR/icons/normal/router_red.gif
|
custom-image $CORE_DATA_DIR/icons/normal/router_red.gif
|
||||||
services {zebra OSPFv3MDR vtysh SMF IPForward UserDefined}
|
services {zebra OSPFv3MDR SMF IPForward UserDefined}
|
||||||
custom-config {
|
custom-config {
|
||||||
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
||||||
custom-command custom-post-config-commands.sh
|
custom-command custom-post-config-commands.sh
|
||||||
|
@ -281,7 +281,7 @@ node n7 {
|
||||||
canvas c1
|
canvas c1
|
||||||
interface-peer {eth0 n11}
|
interface-peer {eth0 n11}
|
||||||
custom-image $CORE_DATA_DIR/icons/normal/router_red.gif
|
custom-image $CORE_DATA_DIR/icons/normal/router_red.gif
|
||||||
services {zebra OSPFv3MDR vtysh SMF IPForward UserDefined}
|
services {zebra OSPFv3MDR SMF IPForward UserDefined}
|
||||||
custom-config {
|
custom-config {
|
||||||
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
||||||
custom-command custom-post-config-commands.sh
|
custom-command custom-post-config-commands.sh
|
||||||
|
@ -317,7 +317,7 @@ node n8 {
|
||||||
canvas c1
|
canvas c1
|
||||||
interface-peer {eth0 n11}
|
interface-peer {eth0 n11}
|
||||||
custom-image $CORE_DATA_DIR/icons/normal/router_red.gif
|
custom-image $CORE_DATA_DIR/icons/normal/router_red.gif
|
||||||
services {zebra OSPFv3MDR vtysh SMF IPForward UserDefined}
|
services {zebra OSPFv3MDR SMF IPForward UserDefined}
|
||||||
custom-config {
|
custom-config {
|
||||||
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
||||||
custom-command custom-post-config-commands.sh
|
custom-command custom-post-config-commands.sh
|
||||||
|
@ -353,7 +353,7 @@ node n9 {
|
||||||
canvas c1
|
canvas c1
|
||||||
interface-peer {eth0 n11}
|
interface-peer {eth0 n11}
|
||||||
custom-image $CORE_DATA_DIR/icons/normal/router_red.gif
|
custom-image $CORE_DATA_DIR/icons/normal/router_red.gif
|
||||||
services {zebra OSPFv3MDR vtysh SMF IPForward UserDefined}
|
services {zebra OSPFv3MDR SMF IPForward UserDefined}
|
||||||
custom-config {
|
custom-config {
|
||||||
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
||||||
custom-command custom-post-config-commands.sh
|
custom-command custom-post-config-commands.sh
|
||||||
|
@ -389,7 +389,7 @@ node n10 {
|
||||||
canvas c1
|
canvas c1
|
||||||
interface-peer {eth0 n11}
|
interface-peer {eth0 n11}
|
||||||
custom-image $CORE_DATA_DIR/icons/normal/router_red.gif
|
custom-image $CORE_DATA_DIR/icons/normal/router_red.gif
|
||||||
services {zebra OSPFv3MDR vtysh SMF IPForward UserDefined}
|
services {zebra OSPFv3MDR SMF IPForward UserDefined}
|
||||||
custom-config {
|
custom-config {
|
||||||
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
custom-config-id service:UserDefined:custom-post-config-commands.sh
|
||||||
custom-command custom-post-config-commands.sh
|
custom-command custom-post-config-commands.sh
|
||||||
|
|
|
@ -51,7 +51,7 @@ node n1 {
|
||||||
cmdup=('sh mgen.sh', )
|
cmdup=('sh mgen.sh', )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
services {zebra OSPFv2 OSPFv3 vtysh IPForward UserDefined}
|
services {zebra OSPFv2 OSPFv3 IPForward UserDefined}
|
||||||
}
|
}
|
||||||
|
|
||||||
node n2 {
|
node n2 {
|
||||||
|
@ -101,7 +101,7 @@ node n2 {
|
||||||
mgen input send_$HN.mgn output $LOGDIR/mgen_$HN.log > /dev/null 2> /dev/null < /dev/null &
|
mgen input send_$HN.mgn output $LOGDIR/mgen_$HN.log > /dev/null 2> /dev/null < /dev/null &
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
services {zebra OSPFv2 OSPFv3 vtysh IPForward UserDefined}
|
services {zebra OSPFv2 OSPFv3 IPForward UserDefined}
|
||||||
}
|
}
|
||||||
|
|
||||||
link l1 {
|
link l1 {
|
||||||
|
|
|
@ -354,7 +354,7 @@ node n1 {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
services {zebra OSPFv2 OSPFv3 vtysh IPForward IPsec}
|
services {zebra OSPFv2 OSPFv3 IPForward IPsec}
|
||||||
custom-image $CORE_DATA_DIR/icons/normal/router_red.gif
|
custom-image $CORE_DATA_DIR/icons/normal/router_red.gif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -528,7 +528,7 @@ node n2 {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
services {zebra OSPFv2 OSPFv3 vtysh IPForward IPsec}
|
services {zebra OSPFv2 OSPFv3 IPForward IPsec}
|
||||||
custom-image $CORE_DATA_DIR/icons/normal/router_red.gif
|
custom-image $CORE_DATA_DIR/icons/normal/router_red.gif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -697,7 +697,7 @@ node n3 {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
services {zebra OSPFv2 OSPFv3 vtysh IPForward IPsec}
|
services {zebra OSPFv2 OSPFv3 IPForward IPsec}
|
||||||
custom-image $CORE_DATA_DIR/icons/normal/router_red.gif
|
custom-image $CORE_DATA_DIR/icons/normal/router_red.gif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1484,7 +1484,7 @@ proc addInterfaceCommand { node parentmenu txt cmd state isnodecmd } {
|
||||||
$parentmenu add cascade -label $txt -menu $childmenu -state $state
|
$parentmenu add cascade -label $txt -menu $childmenu -state $state
|
||||||
if { ! $isnodecmd } {
|
if { ! $isnodecmd } {
|
||||||
if { $g_current_session == 0 } { set state disabled }
|
if { $g_current_session == 0 } { set state disabled }
|
||||||
set ssid [shortSessionID $g_current_session]
|
set ssid [shortSessionID $g_current_session]
|
||||||
}
|
}
|
||||||
foreach ifc [ifcList $node] {
|
foreach ifc [ifcList $node] {
|
||||||
set addr [lindex [getIfcIPv4addr $node $ifc] 0]
|
set addr [lindex [getIfcIPv4addr $node $ifc] 0]
|
||||||
|
@ -1492,10 +1492,11 @@ proc addInterfaceCommand { node parentmenu txt cmd state isnodecmd } {
|
||||||
if { $isnodecmd } { ;# run command in a node
|
if { $isnodecmd } { ;# run command in a node
|
||||||
set icmd "spawnShell $node \"$cmd $ifc\""
|
set icmd "spawnShell $node \"$cmd $ifc\""
|
||||||
} else { ;# exec a command directly
|
} else { ;# exec a command directly
|
||||||
set nodenum [string range $node 1 end]
|
set node_num [string range $node 1 end]
|
||||||
|
set hex [format "%x" $node_num]
|
||||||
set ifnum [string range $ifc 3 end]
|
set ifnum [string range $ifc 3 end]
|
||||||
set localifc veth$nodenum.$ifnum.$ssid
|
set ifname "veth$hex\\.$ifnum\\.$ssid"
|
||||||
set icmd "exec $cmd $localifc &"
|
set icmd "exec $cmd $ifname &"
|
||||||
}
|
}
|
||||||
$childmenu add command -label "$ifc$addr" -state $state -command $icmd
|
$childmenu add command -label "$ifc$addr" -state $state -command $icmd
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,18 +15,18 @@ if { $execMode == "interactive" } {
|
||||||
# these are the default node types when nodes.conf does not exist
|
# these are the default node types when nodes.conf does not exist
|
||||||
# index {name normal-icon tiny-icon services type metadata}
|
# index {name normal-icon tiny-icon services type metadata}
|
||||||
array set g_node_types_default {
|
array set g_node_types_default {
|
||||||
1 {router router.gif router.gif {zebra OSPFv2 OSPFv3 vtysh IPForward} \
|
1 {router router.gif router.gif {zebra OSPFv2 OSPFv3 IPForward} \
|
||||||
netns {built-in type for routing}}
|
netns {built-in type for routing}}
|
||||||
2 {host host.gif host.gif {DefaultRoute SSH} \
|
2 {host host.gif host.gif {DefaultRoute SSH} \
|
||||||
netns {built-in type for servers}}
|
netns {built-in type for servers}}
|
||||||
3 {PC pc.gif pc.gif {DefaultRoute} \
|
3 {PC pc.gif pc.gif {DefaultRoute} \
|
||||||
netns {built-in type for end hosts}}
|
netns {built-in type for end hosts}}
|
||||||
4 {mdr mdr.gif mdr.gif {zebra OSPFv3MDR vtysh IPForward} \
|
4 {mdr mdr.gif mdr.gif {zebra OSPFv3MDR IPForward} \
|
||||||
netns {built-in type for wireless routers}}
|
netns {built-in type for wireless routers}}
|
||||||
5 {prouter router_green.gif router_green.gif \
|
5 {prouter router_green.gif router_green.gif \
|
||||||
{zebra OSPFv2 OSPFv3 vtysh IPForward} \
|
{zebra OSPFv2 OSPFv3 IPForward} \
|
||||||
physical {built-in type for physical nodes}}
|
physical {built-in type for physical nodes}}
|
||||||
6 {xen xen.gif xen.gif {zebra OSPFv2 OSPFv3 vtysh IPForward} \
|
6 {xen xen.gif xen.gif {zebra OSPFv2 OSPFv3 IPForward} \
|
||||||
xen {built-in type for Xen PVM domU router}}
|
xen {built-in type for Xen PVM domU router}}
|
||||||
7 {OVS lanswitch.gif lanswitch.gif {DefaultRoute SSH OvsService} OVS {} }
|
7 {OVS lanswitch.gif lanswitch.gif {DefaultRoute SSH OvsService} OVS {} }
|
||||||
|
|
||||||
|
|
13
gui/util.tcl
13
gui/util.tcl
|
@ -160,7 +160,7 @@ proc upgradeNetworkConfigToServices { } {
|
||||||
set bgp [netconfFetchSection $node "router bgp"]
|
set bgp [netconfFetchSection $node "router bgp"]
|
||||||
if { $ospfv2 != "" || $ospfv3 != "" || $rip != "" || $ripng != "" } {
|
if { $ospfv2 != "" || $ospfv3 != "" || $rip != "" || $ripng != "" } {
|
||||||
set cfg ""
|
set cfg ""
|
||||||
set services "zebra vtysh IPForward"
|
set services "zebra IPForward"
|
||||||
foreach ifc [ifcList $node] {
|
foreach ifc [ifcList $node] {
|
||||||
lappend cfg "interface $ifc"
|
lappend cfg "interface $ifc"
|
||||||
set ifccfg [netconfFetchSection $node "interface $ifc"]
|
set ifccfg [netconfFetchSection $node "interface $ifc"]
|
||||||
|
@ -1113,7 +1113,7 @@ proc get_text_editor { want_default } {
|
||||||
# variable, then find the first in the list of terminals that exists on the
|
# variable, then find the first in the list of terminals that exists on the
|
||||||
# system
|
# system
|
||||||
set TERMS "{gnome-terminal -x} {lxterminal -e} {konsole -e} {xterm -e}"
|
set TERMS "{gnome-terminal -x} {lxterminal -e} {konsole -e} {xterm -e}"
|
||||||
set TERMS "$TERMS {aterm -e} {eterm -e} {rxvt -e} {xfce4-terminal -e}"
|
set TERMS "$TERMS {aterm -e} {eterm -e} {rxvt -e} {xfce4-terminal -x}"
|
||||||
|
|
||||||
proc get_term_prog { want_default } {
|
proc get_term_prog { want_default } {
|
||||||
global g_prefs env TERMS
|
global g_prefs env TERMS
|
||||||
|
@ -1130,8 +1130,13 @@ proc get_term_prog { want_default } {
|
||||||
}
|
}
|
||||||
if { $term != "" } {
|
if { $term != "" } {
|
||||||
set arg "-e"
|
set arg "-e"
|
||||||
# gnome-terminal has problem w/subsequent arguments after -e, needs -x
|
# gnome-terminal and xfce4-terminal have problems w/subsequent
|
||||||
if { [file tail $term] == "gnome-terminal" } { set arg "-x" }
|
# arguments after -e, needs -x
|
||||||
|
set basename [file tail $term]
|
||||||
|
if {[lsearch -exact \
|
||||||
|
{"gnome-terminal" "xfce4-terminal"} $basename] >= 0} {
|
||||||
|
set arg "-x"
|
||||||
|
}
|
||||||
set term "$term $arg"
|
set term "$term $arg"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -572,7 +572,7 @@ proc exec_observer_callback { node execnum cmd result status } {
|
||||||
##### #####
|
##### #####
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
array set thruConfig { show 1 avg 1 thresh 250.0 width 10 color #FF0000 }
|
array set thruConfig { show 1 up 1 down 1 avg 1 thresh 250.0 width 10 color #FF0000 }
|
||||||
|
|
||||||
# netgraph names of pipe nodes
|
# netgraph names of pipe nodes
|
||||||
array set throughput_cache { }
|
array set throughput_cache { }
|
||||||
|
@ -597,7 +597,12 @@ proc widget_thru_config {} {
|
||||||
checkbutton $wi.tlab.avg \
|
checkbutton $wi.tlab.avg \
|
||||||
-text "Use exponentially weighted moving average" \
|
-text "Use exponentially weighted moving average" \
|
||||||
-variable thruConfig(avg)
|
-variable thruConfig(avg)
|
||||||
pack $wi.tlab.show_thru $wi.tlab.avg -side top -anchor w -padx 4
|
checkbutton $wi.tlab.down \
|
||||||
|
-text "Include transmissions" -variable thruConfig(down)
|
||||||
|
checkbutton $wi.tlab.up \
|
||||||
|
-text "Include receptions" -variable thruConfig(up)
|
||||||
|
pack $wi.tlab.show_thru $wi.tlab.avg $wi.tlab.down \
|
||||||
|
$wi.tlab.up -side top -anchor w -padx 4
|
||||||
pack $wi.tlab -side top
|
pack $wi.tlab -side top
|
||||||
|
|
||||||
frame $wi.msg -borderwidth 4
|
frame $wi.msg -borderwidth 4
|
||||||
|
@ -807,7 +812,14 @@ proc widget_thru_periodic { now } {
|
||||||
set div [expr { (1000.0 / 8.0) * $dt }]
|
set div [expr { (1000.0 / 8.0) * $dt }]
|
||||||
set kbps_down [expr { ([lindex $bytes 0]-[lindex $bytes2 0]) / $div }]
|
set kbps_down [expr { ([lindex $bytes 0]-[lindex $bytes2 0]) / $div }]
|
||||||
set kbps_up [expr { ([lindex $bytes 1]-[lindex $bytes2 1]) / $div }]
|
set kbps_up [expr { ([lindex $bytes 1]-[lindex $bytes2 1]) / $div }]
|
||||||
set kbps [expr {$kbps_down + $kbps_up}]
|
set kbps 0.0
|
||||||
|
if { $thruConfig(up) } {
|
||||||
|
set kbps [expr {$kbps + $kbps_up}]
|
||||||
|
}
|
||||||
|
if { $thruConfig(down) } {
|
||||||
|
set kbps [expr {$kbps + $kbps_down}]
|
||||||
|
}
|
||||||
|
#set kbps [expr {$kbps_down + $kbps_up}]
|
||||||
|
|
||||||
if { $thruConfig(avg) } {
|
if { $thruConfig(avg) } {
|
||||||
if { ![info exists link_thru_avg_stats($key)] } {
|
if { ![info exists link_thru_avg_stats($key)] } {
|
||||||
|
@ -907,6 +919,7 @@ proc getstats_bytes_netgraph { raw_input } {
|
||||||
}
|
}
|
||||||
|
|
||||||
proc getstats_link_ifname { link } {
|
proc getstats_link_ifname { link } {
|
||||||
|
global g_current_session
|
||||||
set lnode1 [lindex [linkPeers $link] 0]
|
set lnode1 [lindex [linkPeers $link] 0]
|
||||||
set lnode2 [lindex [linkPeers $link] 1]
|
set lnode2 [lindex [linkPeers $link] 1]
|
||||||
|
|
||||||
|
@ -920,11 +933,10 @@ proc getstats_link_ifname { link } {
|
||||||
set ifname [ifcByPeer $lnode2 $lnode1]
|
set ifname [ifcByPeer $lnode2 $lnode1]
|
||||||
}
|
}
|
||||||
if { $node_num < 0 } { return "" }
|
if { $node_num < 0 } { return "" }
|
||||||
|
set ssid [shortSessionID $g_current_session]
|
||||||
# TODO: need to determine session number used by daemon
|
set hex [format "%x" $node_num]
|
||||||
# instead this uses a '*' character for a regexp match against
|
set ifnum [string range $ifname 3 end]
|
||||||
# the interfaces in /proc/net/dev
|
set ifname "veth$hex.$ifnum.$ssid"
|
||||||
set ifname "veth$node_num\\.[string range $ifname 3 end]\\.*"
|
|
||||||
return $ifname
|
return $ifname
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,12 +32,18 @@ Requires: procps-ng
|
||||||
%if %{with_kernel_modules_extra}
|
%if %{with_kernel_modules_extra}
|
||||||
Requires: kernel-modules-extra
|
Requires: kernel-modules-extra
|
||||||
%endif
|
%endif
|
||||||
|
%if 0%{?fedora} >= 25
|
||||||
|
Requires: iproute-tc
|
||||||
|
%endif
|
||||||
BuildRequires: make automake autoconf libev-devel python-devel bridge-utils ebtables iproute net-tools ImageMagick help2man
|
BuildRequires: make automake autoconf libev-devel python-devel bridge-utils ebtables iproute net-tools ImageMagick help2man
|
||||||
%if 0%{?el6}
|
%if 0%{?el6}
|
||||||
BuildRequires: procps
|
BuildRequires: procps
|
||||||
%else
|
%else
|
||||||
BuildRequires: procps-ng
|
BuildRequires: procps-ng
|
||||||
%endif
|
%endif
|
||||||
|
%if 0%{?fedora} >= 25
|
||||||
|
BuildRequires: iproute-tc
|
||||||
|
%endif
|
||||||
Provides: core-daemon
|
Provides: core-daemon
|
||||||
# python-sphinx
|
# python-sphinx
|
||||||
%description daemon
|
%description daemon
|
||||||
|
|
|
@ -6,6 +6,7 @@ After=network.target
|
||||||
Type=forking
|
Type=forking
|
||||||
PIDFile=/var/run/core-daemon.pid
|
PIDFile=/var/run/core-daemon.pid
|
||||||
ExecStart=@PYTHON@ @SBINDIR@/core-daemon -d
|
ExecStart=@PYTHON@ @SBINDIR@/core-daemon -d
|
||||||
|
TasksMax=infinity
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
Loading…
Add table
Reference in a new issue