Compare commits

..
6 changed files with 45 additions and 89 deletions

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
include mnexec.c
exclude bin/mnexec
+4 -2
View File
@@ -21,10 +21,12 @@ test: $(MININET) $(TEST)
-echo "Running tests"
mininet/test/test_nets.py
install: mnexec
cp mnexec bin/
install:
python setup.py install
develop:
python setup.py develop
doc:
doxygen doxygen.cfg
+2 -2
View File
@@ -319,8 +319,8 @@ class CLI( Cmd ):
nodePoller = poll()
nodePoller.register( node.stdout )
bothPoller = poll()
bothPoller.register( self.stdin, POLLIN )
bothPoller.register( node.stdout, POLLIN )
bothPoller.register( self.stdin )
bothPoller.register( node.stdout )
if self.isatty():
# Buffer by character, so that interactive
# commands sort of work
+24 -12
View File
@@ -2,26 +2,33 @@
"Setuptools params"
from setuptools import setup, find_packages
from os.path import join
scripts = [ join( 'bin', filename ) for filename in [
'mn', 'mnexec' ] ]
import os, setuptools
import distutils.command.build_scripts
import distutils.command.clean
import distutils.ccompiler
modname = distname = 'mininet'
setup(
class build_scripts(distutils.command.build_scripts.build_scripts):
def run(self):
distutils.ccompiler.new_compiler().link_executable(["mnexec.c"], "bin/mnexec")
distutils.command.build_scripts.build_scripts.run(self)
class clean(distutils.command.clean.clean):
def run(self):
if os.path.exists("bin/mnexec"):
os.unlink("bin/mnexec")
distutils.command.clean.clean.run(self)
setuptools.setup(
name=distname,
version='0.0.0',
description='Process-based OpenFlow emulator',
author='Bob Lantz',
author_email='rlantz@cs.stanford.edu',
packages=find_packages(exclude='test'),
long_description="""
Insert longer description here.
""",
packages=setuptools.find_packages(exclude='test'),
classifiers=[
"License :: OSI Approved :: GNU General Public License (GPL)",
"License :: OSI Approved :: BSD",
"Programming Language :: Python",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
@@ -33,5 +40,10 @@ Insert longer description here.
'setuptools',
'networkx'
],
scripts=scripts,
scripts=[
'bin/mn',
'bin/mnexec'
],
cmdclass={"build_scripts": build_scripts,
"clean": clean}
)
+13 -39
View File
@@ -146,6 +146,16 @@ function of {
make
sudo make install
# Install dissector:
sudo apt-get install -y wireshark libgtk2.0-dev
cd ~/openflow/utilities/wireshark_dissectors/openflow
make
sudo make install
# Copy coloring rules: OF is white-on-blue:
mkdir -p ~/.wireshark
cp ~/mininet/util/colorfilters ~/.wireshark
# Remove avahi-daemon, which may cause unwanted discovery packets to be
# sent during tests, near link status changes:
sudo apt-get remove -y avahi-daemon
@@ -159,39 +169,6 @@ function of {
sudo sh -c "echo 'blacklist net-pf-10\nblacklist ipv6' >> $BLACKLIST"
}
function wireshark {
echo "Installing Wireshark dissector..."
sudo apt-get install -y wireshark libgtk2.0-dev
if [ "$DIST" = "Ubuntu" ] && [ "$RELEASE" != "10.04" ]; then
# Install newer version
sudo apt-get install -y scons mercurial libglib2.0-dev
sudo apt-get install -y libwiretap-dev libwireshark-dev
cd ~
hg clone https://bitbucket.org/barnstorm/of-dissector
cd of-dissector/src
export WIRESHARK=/usr/include/wireshark
scons
# libwireshark0/ on 11.04; libwireshark1/ on later
WSDIR=`ls -d /usr/lib/wireshark/libwireshark* | head -1`
WSPLUGDIR=$WSDIR/plugins/
sudo cp openflow.so $WSPLUGDIR
echo "Copied openflow plugin to $WSPLUGDIR"
else
# Install older version from reference source
cd ~/openflow/utilities/wireshark_dissectors/openflow
make
sudo make install
fi
# Copy coloring rules: OF is white-on-blue:
mkdir -p ~/.wireshark
cp ~/mininet/util/colorfilters ~/.wireshark
}
# Install Open vSwitch
# Instructions derived from OVS INSTALL, INSTALL.OpenFlow and README files.
function ovs {
@@ -284,7 +261,7 @@ function oftest {
# Install oftest:
cd ~/
git clone git://github.com/floodlight/oftest
git clone git://openflow.org/oftest
cd oftest
cd tools/munger
sudo make install
@@ -294,7 +271,7 @@ function oftest {
function cbench {
echo "Installing cbench..."
sudo apt-get install -y libsnmp-dev libpcap-dev libconfig-dev
sudo apt-get install -y libsnmp-dev libpcap-dev
cd ~/
git clone git://openflow.org/oflops.git
cd oflops
@@ -354,7 +331,6 @@ function all {
kernel
mn_deps
of
wireshark
ovs
modprobe
nox
@@ -414,7 +390,6 @@ function usage {
printf -- ' -n: install mini(N)et dependencies + core files\n' >&2
printf -- ' -t: install o(T)her stuff\n' >&2
printf -- ' -v: install open (V)switch\n' >&2
printf -- ' -w: install OpenFlow (w)ireshark dissector\n' >&2
printf -- ' -x: install NO(X) OpenFlow controller\n' >&2
printf -- ' -y: install (A)ll packages\n' >&2
@@ -425,7 +400,7 @@ if [ $# -eq 0 ]
then
all
else
while getopts 'abcdfhkmntvwx' OPTION
while getopts 'abcdfhkmntvx' OPTION
do
case $OPTION in
a) all;;
@@ -439,7 +414,6 @@ else
n) mn_deps;;
t) other;;
v) ovs;;
w) wireshark;;
x) nox;;
?) usage;;
esac
-34
View File
@@ -1,34 +0,0 @@
#!/bin/bash
# This script is intended to install Mininet into
# a brand-new Ubuntu (10.04 or 11.10) virtual machine,
# to create a fully usable "tutorial" VM.
set -e
sudo sh -c 'cat >> /etc/sudoers' <<EOF
openflow ALL=NOPASSWD: ALL
EOF
sudo sed -i -e 's/Default/#Default/' /etc/sudoers
sudo sed -i -e 's/ubuntu/mininet-vm/' /etc/hostname
sudo sed -i -e 's/ubuntu/mininet-vm/g' /etc/hosts
sudo hostname `cat /etc/hostname`
sudo sed -i -e 's/quiet splash/text/' /etc/default/grub
sudo update-grub
sudo sed -i -e 's/us.archive.ubuntu.com/mirrors.kernel.org/' \
/etc/apt/sources.list
sudo apt-get update
sudo apt-get -y install git-core openssh-server
git clone git://github.com/mininet/mininet
cd mininet
cd
time mininet/util/install.sh
if ! grep NOX_CORE_DIR .bashrc; then
echo "export NOX_CORE_DIR=~/noxcore/build/src/" >> .bashrc
fi
echo <<EOF
You may need to reboot and then:
sudo dpkg-reconfigure openvswitch-datapath-dkms
sudo service openvswitch-switch start
EOF