Vendored
+1
-3
@@ -9,15 +9,13 @@ Build-Depends:
|
|||||||
help2man,
|
help2man,
|
||||||
python-dev,
|
python-dev,
|
||||||
python-pkg-resources,
|
python-pkg-resources,
|
||||||
python-setuptools,
|
python-setuptools
|
||||||
python-networkx
|
|
||||||
Homepage: http://openflow.org/mininet
|
Homepage: http://openflow.org/mininet
|
||||||
|
|
||||||
Package: mininet
|
Package: mininet
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends:
|
Depends:
|
||||||
openvswitch-switch,
|
openvswitch-switch,
|
||||||
python-networkx,
|
|
||||||
telnet,
|
telnet,
|
||||||
${misc:Depends},
|
${misc:Depends},
|
||||||
${python:Depends},
|
${python:Depends},
|
||||||
|
|||||||
+23
-5
@@ -11,13 +11,31 @@ A Topo object can be a topology database for NOX, can represent a physical
|
|||||||
setup for testing, and can even be emulated with the Mininet package.
|
setup for testing, and can even be emulated with the Mininet package.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
# BL: we may have to fix compatibility here.
|
|
||||||
# networkx is also a fairly heavyweight dependency
|
|
||||||
# from networkx.classes.graph import Graph
|
|
||||||
|
|
||||||
from networkx import Graph
|
|
||||||
from mininet.util import irange, natural, naturalSeq
|
from mininet.util import irange, natural, naturalSeq
|
||||||
|
|
||||||
|
class Graph(object):
|
||||||
|
"Utility class to track nodes and edges "
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.data = {}
|
||||||
|
|
||||||
|
def add_node(self,node):
|
||||||
|
if node not in self.data.keys():
|
||||||
|
self.data[node] = []
|
||||||
|
|
||||||
|
def add_edge(self,src,dest):
|
||||||
|
self.add_node(src)
|
||||||
|
self.add_node(dest)
|
||||||
|
self.data[src].append(dest)
|
||||||
|
|
||||||
|
def nodes(self):
|
||||||
|
return self.data.keys()
|
||||||
|
|
||||||
|
def edges(self):
|
||||||
|
for src in self.data.keys():
|
||||||
|
for dest in self.data[src]:
|
||||||
|
yield (src,dest)
|
||||||
|
|
||||||
class Topo(object):
|
class Topo(object):
|
||||||
"Data center network representation for structured multi-trees."
|
"Data center network representation for structured multi-trees."
|
||||||
|
|
||||||
|
|||||||
@@ -37,8 +37,7 @@ setup(
|
|||||||
keywords='networking emulator protocol Internet OpenFlow SDN',
|
keywords='networking emulator protocol Internet OpenFlow SDN',
|
||||||
license='BSD',
|
license='BSD',
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'setuptools',
|
'setuptools'
|
||||||
'networkx'
|
|
||||||
],
|
],
|
||||||
scripts=scripts,
|
scripts=scripts,
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-6
@@ -123,14 +123,9 @@ function kernel_clean {
|
|||||||
function mn_deps {
|
function mn_deps {
|
||||||
echo "Installing Mininet dependencies"
|
echo "Installing Mininet dependencies"
|
||||||
$install gcc make socat psmisc xterm ssh iperf iproute telnet \
|
$install gcc make socat psmisc xterm ssh iperf iproute telnet \
|
||||||
python-setuptools python-networkx cgroup-bin ethtool help2man \
|
python-setuptools cgroup-bin ethtool help2man \
|
||||||
pyflakes pylint pep8
|
pyflakes pylint pep8
|
||||||
|
|
||||||
if [ "$DIST" = "Ubuntu" ] && [ "$RELEASE" = "10.04" ]; then
|
|
||||||
echo "Upgrading networkx to avoid deprecation warning"
|
|
||||||
sudo easy_install --upgrade networkx
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add sysctl parameters as noted in the INSTALL file to increase kernel
|
# Add sysctl parameters as noted in the INSTALL file to increase kernel
|
||||||
# limits to support larger setups:
|
# limits to support larger setups:
|
||||||
if ! grep Mininet /etc/sysctl.conf; then
|
if ! grep Mininet /etc/sysctl.conf; then
|
||||||
|
|||||||
Reference in New Issue
Block a user