Wednesday, May 26, 2010

disconnected GUI

The notion of Sessions were added to the CORE services, so you can launch a new session using the GUI, exit the GUI while leaving the emulation running, and reconnect at some later time. You can also run multiple sessions simultaneously.



(This only works for Linux network namespaces for now, until FreeBSD and OpenVZ have been ported to using the cored.py Python daemon.)

more images than GIF supported


Use of the Tk::Img library was added to CORE. This allows you to use various image types besides just the GIFs that were supported before -- such as JPG, PNG, TIF, etc. Now the custom node icon and canvas wallpaper dialogs accept various image types.




The Img library is a new dependency for the CORE GUI. You can install it with:

# for RedHat/Fedora
yum install tkimg
or

# for Debian/Ubuntu
sudo apt-get install libtk-img

Friday, May 21, 2010

CORE is now a Python package

The CORE Python code has been reorganized into a Python package. New example scripts are included in the source under core/python/examples/netns/. Here is a snippet from one of the samples, how you would make N nodes connected to a switch:

from core import pycore
from core.misc import ipaddr

def main:
...
# IP subnet
prefix = ipaddr.IPv4Prefix("10.83.0.0/16")
session = pycore.Session()
# emulated ethernet switch
switch = session.addobj(cls = pycore.nodes.SwitchNode)
print "creating %d nodes with addresses from %s" % \
(options.numnodes, prefix)
for i in xrange(1, options.numnodes + 1):
tmp = session.addobj(cls = pycore.nodes.LxcNode, name = "n%d" % i)
tmp.newnetif(switch, ["%s/%s" % (prefix.addr(i), prefix.prefixlen)])
tmp.cmd(["sysctl", "net.ipv4.icmp_echo_ignore_broadcasts=0"])
n.append(tmp)

# start a shell on node 1
n[1].term("bash")