Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 496cd25d37 | |||
| d9fd4ea245 | |||
| 88dd4f7329 | |||
| 49d84f7cfc | |||
| 7676c17f27 | |||
| 6143bb1395 | |||
| a8c1965b90 | |||
| 4bd1a61353 | |||
| edd1d0f3a4 | |||
| 0919b7ca67 | |||
| 1902dd2e3a |
@@ -1,2 +0,0 @@
|
||||
include mnexec.c
|
||||
exclude bin/mnexec
|
||||
@@ -21,12 +21,10 @@ test: $(MININET) $(TEST)
|
||||
-echo "Running tests"
|
||||
mininet/test/test_nets.py
|
||||
|
||||
install:
|
||||
install: mnexec
|
||||
cp mnexec bin/
|
||||
python setup.py install
|
||||
|
||||
develop:
|
||||
python setup.py develop
|
||||
|
||||
doc:
|
||||
doxygen doxygen.cfg
|
||||
|
||||
|
||||
+2
-2
@@ -319,8 +319,8 @@ class CLI( Cmd ):
|
||||
nodePoller = poll()
|
||||
nodePoller.register( node.stdout )
|
||||
bothPoller = poll()
|
||||
bothPoller.register( self.stdin )
|
||||
bothPoller.register( node.stdout )
|
||||
bothPoller.register( self.stdin, POLLIN )
|
||||
bothPoller.register( node.stdout, POLLIN )
|
||||
if self.isatty():
|
||||
# Buffer by character, so that interactive
|
||||
# commands sort of work
|
||||
|
||||
@@ -2,33 +2,26 @@
|
||||
|
||||
"Setuptools params"
|
||||
|
||||
import os, setuptools
|
||||
import distutils.command.build_scripts
|
||||
import distutils.command.clean
|
||||
import distutils.ccompiler
|
||||
from setuptools import setup, find_packages
|
||||
from os.path import join
|
||||
|
||||
scripts = [ join( 'bin', filename ) for filename in [
|
||||
'mn', 'mnexec' ] ]
|
||||
|
||||
modname = distname = 'mininet'
|
||||
|
||||
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(
|
||||
setup(
|
||||
name=distname,
|
||||
version='0.0.0',
|
||||
description='Process-based OpenFlow emulator',
|
||||
author='Bob Lantz',
|
||||
author_email='rlantz@cs.stanford.edu',
|
||||
packages=setuptools.find_packages(exclude='test'),
|
||||
packages=find_packages(exclude='test'),
|
||||
long_description="""
|
||||
Insert longer description here.
|
||||
""",
|
||||
classifiers=[
|
||||
"License :: OSI Approved :: BSD",
|
||||
"License :: OSI Approved :: GNU General Public License (GPL)",
|
||||
"Programming Language :: Python",
|
||||
"Development Status :: 4 - Beta",
|
||||
"Intended Audience :: Developers",
|
||||
@@ -40,10 +33,5 @@ setuptools.setup(
|
||||
'setuptools',
|
||||
'networkx'
|
||||
],
|
||||
scripts=[
|
||||
'bin/mn',
|
||||
'bin/mnexec'
|
||||
],
|
||||
cmdclass={"build_scripts": build_scripts,
|
||||
"clean": clean}
|
||||
scripts=scripts,
|
||||
)
|
||||
|
||||
+39
-13
@@ -146,16 +146,6 @@ 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
|
||||
@@ -169,6 +159,39 @@ 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 {
|
||||
@@ -261,7 +284,7 @@ function oftest {
|
||||
|
||||
# Install oftest:
|
||||
cd ~/
|
||||
git clone git://openflow.org/oftest
|
||||
git clone git://github.com/floodlight/oftest
|
||||
cd oftest
|
||||
cd tools/munger
|
||||
sudo make install
|
||||
@@ -271,7 +294,7 @@ function oftest {
|
||||
function cbench {
|
||||
echo "Installing cbench..."
|
||||
|
||||
sudo apt-get install -y libsnmp-dev libpcap-dev
|
||||
sudo apt-get install -y libsnmp-dev libpcap-dev libconfig-dev
|
||||
cd ~/
|
||||
git clone git://openflow.org/oflops.git
|
||||
cd oflops
|
||||
@@ -331,6 +354,7 @@ function all {
|
||||
kernel
|
||||
mn_deps
|
||||
of
|
||||
wireshark
|
||||
ovs
|
||||
modprobe
|
||||
nox
|
||||
@@ -390,6 +414,7 @@ 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
|
||||
|
||||
@@ -400,7 +425,7 @@ if [ $# -eq 0 ]
|
||||
then
|
||||
all
|
||||
else
|
||||
while getopts 'abcdfhkmntvx' OPTION
|
||||
while getopts 'abcdfhkmntvwx' OPTION
|
||||
do
|
||||
case $OPTION in
|
||||
a) all;;
|
||||
@@ -414,6 +439,7 @@ else
|
||||
n) mn_deps;;
|
||||
t) other;;
|
||||
v) ovs;;
|
||||
w) wireshark;;
|
||||
x) nox;;
|
||||
?) usage;;
|
||||
esac
|
||||
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user