Compare commits

...
10 Commits
Author SHA1 Message Date
Godopu d9c8f86889 Fix OpenFlow compilation with modern GCC/glibc and improve install.sh -fw support
code-check / Mininet Code Check (push) Waiting to run
mininet-tests / Mininet Tests (ubuntu-20.04, python2) (push) Waiting to run
mininet-tests / Mininet Tests (ubuntu-20.04, python3) (push) Waiting to run
mininet-tests / Mininet Tests (ubuntu-22.04, python2) (push) Waiting to run
mininet-tests / Mininet Tests (ubuntu-22.04, python3) (push) Waiting to run
2026-08-27 14:09:11 +00:00
Renato Monteiro 6eb8973c0b Fix typo in test_switchdpidassignment.py (#1195)
* Fix typo in test_switchdpidassignment.py

* Fix another typo in test_switchdpidassignment.py
2023-09-16 18:50:27 -07:00
Renato Monteiro 0848c5f3c1 Fix typo in test_hifi.py (#1194) 2023-09-16 18:48:51 -07:00
Renato Monteiro 41ac7c4a6e Remove unused import setup.py (#1203) 2023-09-16 18:48:21 -07:00
Renato Monteiro 5ae59fdbc9 Add missing option to usage string install.sh (#1207)
Also reordered the x and y options to be in alphabetical order.
2023-09-16 16:12:33 -07:00
Renato Monteiro ac7c68089b Fix typo in node.py (#1199)
* Fix typo in node.py

* Fix another typo in node.py
2023-09-16 16:11:46 -07:00
Renato Monteiro ba569f4d82 Fix typo in net.py (#1198) 2023-09-16 16:11:21 -07:00
Renato Monteiro 615f37dbbe Fix typo in build.py (#1204)
* Fix typo in build.py

* Fix another typo in build.py
2023-09-16 16:10:37 -07:00
Renato Monteiro aaa8886328 Fix typo in clustersetup.sh (#1205) 2023-09-16 16:10:11 -07:00
Renato Monteiro 05ee42ee3c Fix typo in install.sh (#1206)
* Fix typo in install.sh

* Fix another typo in install.sh
2023-09-16 16:09:38 -07:00
9 changed files with 131 additions and 28 deletions
+1 -1
View File
@@ -443,7 +443,7 @@ class Mininet( object ):
host.configDefault( ip=None, mac=None )
# You're low priority, dude!
# BL: do we want to do this here or not?
# May not make sense if we have CPU lmiting...
# May not make sense if we have CPU limiting...
# quietRun( 'renice +18 -p ' + repr( host.pid ) )
# This may not be the right place to do this, but
# it needs to be done somewhere.
+2 -2
View File
@@ -99,7 +99,7 @@ class Node( object ):
# Stash configuration parameters for future reference
self.params = params
# dict of port numbers to interfacse
# dict of port numbers to interfaces
self.intfs = {}
# dict of interfaces to port numbers
@@ -689,7 +689,7 @@ class CPULimitedHost( Host ):
Host.__init__( self, name, **params )
# BL: Setting the correct period/quota is tricky, particularly
# for RT. RT allows very small quotas, but the overhead
# seems to be high. CFS has a mininimum quota of 1 ms, but
# seems to be high. CFS has a minimum quota of 1 ms, but
# still does better with larger period values.
self.period_us = params.get( 'period_us', 100000 )
self.sched = sched
+1 -1
View File
@@ -131,7 +131,7 @@ class testOptionsTopoCommon( object ):
BW_TOLERANCE = 0.8 # BW fraction below which test should fail
# Verify ability to create limited-link topo first;
lopts = { 'bw': BW, 'use_htb': True }
# Also verify correctness of limit limitng within a bound.
# Also verify correctness of limit limiting within a bound.
mn = Mininet( SingleSwitchOptionsTopo( n=N, lopts=lopts ),
link=TCLink, switch=self.switchClass,
waitConnected=True )
+2 -2
View File
@@ -51,7 +51,7 @@ class TestSwitchDpidAssignmentOVS( unittest.TestCase ):
def testDefaultDpidAssignmentFailure( self ):
"""Verify that Default dpid assignment raises an Exception if the
name of the switch does not contin a digit. Also verify the
name of the switch does not contain a digit. Also verify the
exception message."""
net = Mininet( Topo(), self.switchClass, Host, Controller )
with self.assertRaises( Exception ) as raises_cm:
@@ -80,7 +80,7 @@ class OVSUser( OVSSwitch):
OVSSwitch.__init__( self, *args, **kwargs )
class testSwitchOVSUser( TestSwitchDpidAssignmentOVS ):
"Test dpid assignnment of OVS User Switch."
"Test dpid assignment of OVS User Switch."
switchClass = OVSUser
@unittest.skipUnless( quietRun( 'which ivs-ctl' ),
+1 -1
View File
@@ -2,7 +2,7 @@
"Setuptools params"
from setuptools import setup, find_packages
from setuptools import setup
from os.path import join
# Get version number from source tree
+1 -1
View File
@@ -169,7 +169,7 @@ echo
if $persistent; then
echo '***Setting up persistent SSH configuration between all nodes'
persistentSetup
echo $'\n*** Sucessfully set up ssh throughout the cluster!'
echo $'\n*** Successfully set up ssh throughout the cluster!'
else
echo '*** Setting up temporary SSH configuration between all nodes'
+33 -18
View File
@@ -17,7 +17,7 @@ MININET_DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd -P )"
# in which case we use the directory containing mininet
BUILD_DIR="$(pwd -P)"
case $BUILD_DIR in
$MININET_DIR/*) BUILD_DIR=$MININET_DIR;; # currect directory is a subdirectory
$MININET_DIR/*) BUILD_DIR=$MININET_DIR;; # current directory is a subdirectory
*) BUILD_DIR=$BUILD_DIR;;
esac
@@ -242,15 +242,22 @@ function of {
fi
# was: git clone git://openflowswitch.org/openflow.git
# Use our own fork on github for now:
git clone https://github.com/mininet/openflow
if [ ! -d "openflow" ]; then
git clone https://github.com/mininet/openflow
fi
cd $BUILD_DIR/openflow
# Patch controller to handle more than 16 switches
patch -p1 < $MININET_DIR/mininet/util/openflow-patches/controller.patch
# Patch controller to handle more than 16 switches and fix modern gcc/glibc issues
if [ -f "$MININET_DIR/mininet/util/openflow-patches/controller.patch" ]; then
patch -p1 -N -r - < "$MININET_DIR/mininet/util/openflow-patches/controller.patch" || true
fi
if [ -f "$MININET_DIR/mininet/util/openflow-patches/gcc-glibc.patch" ]; then
patch -p1 -N -r - < "$MININET_DIR/mininet/util/openflow-patches/gcc-glibc.patch" || true
fi
# Resume the install:
./boot.sh
./configure
CFLAGS="-g -O2 -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -Wno-error=format -Wno-error=implicit-function-declaration -Wno-error=address-of-packed-member -Wno-error=discarded-qualifiers" ./configure
make
sudo make install
cd $BUILD_DIR
@@ -300,7 +307,7 @@ function of13 {
function install_wireshark {
if ! which wireshark; then
if ! which wireshark &>/dev/null && ! which tshark &>/dev/null; then
echo "Installing Wireshark"
if [ "$DIST" = "Fedora" -o "$DIST" = "RedHatEnterpriseServer" ]; then
$install wireshark wireshark-gnome
@@ -313,29 +320,37 @@ function install_wireshark {
# Copy coloring rules: OF is white-on-blue:
echo "Optionally installing wireshark color filters"
mkdir -p $HOME/.wireshark
cp -n $MININET_DIR/mininet/util/colorfilters $HOME/.wireshark
mkdir -p $HOME/.wireshark $HOME/.config/wireshark
[ -f $MININET_DIR/mininet/util/colorfilters ] && cp -n $MININET_DIR/mininet/util/colorfilters $HOME/.wireshark/ || true
[ -f $MININET_DIR/mininet/util/colorfilters ] && cp -n $MININET_DIR/mininet/util/colorfilters $HOME/.config/wireshark/ || true
echo "Checking Wireshark version"
WSVER=`wireshark -v | egrep -o '[0-9\.]+' | head -1`
if version_ge $WSVER 1.12; then
WSVER=`(wireshark -v 2>/dev/null || tshark -v 2>/dev/null || true) | grep -i -E 'wireshark|tshark' | egrep -o '[0-9\.]+' | head -1`
if [ -n "$WSVER" ] && version_ge "$WSVER" 1.12; then
echo "Wireshark version $WSVER >= 1.12 - returning"
return
elif which wireshark &>/dev/null || which tshark &>/dev/null; then
echo "Wireshark/TShark is already installed and modern versions include OpenFlow dissectors natively - returning"
return
fi
echo "Cloning LoxiGen and building openflow.lua dissector"
cd $BUILD_DIR
git clone https://github.com/floodlight/loxigen.git
if [ ! -d "loxigen" ]; then
git clone https://github.com/floodlight/loxigen.git
fi
cd loxigen
make wireshark
# Copy into plugin directory
# libwireshark0/ on 11.04; libwireshark1/ on later
WSDIR=`find /usr/lib -type d -name 'libwireshark*' | head -1`
WSPLUGDIR=$WSDIR/plugins/
PLUGIN=loxi_output/wireshark/openflow.lua
sudo cp $PLUGIN $WSPLUGDIR
echo "Copied openflow plugin $PLUGIN to $WSPLUGDIR"
if [ -n "$WSDIR" ]; then
WSPLUGDIR=$WSDIR/plugins/
PLUGIN=loxi_output/wireshark/openflow.lua
sudo cp $PLUGIN $WSPLUGDIR
echo "Copied openflow plugin $PLUGIN to $WSPLUGDIR"
fi
cd $BUILD_DIR
}
@@ -798,7 +813,7 @@ function vm_clean {
sudo rm -rf /tmp/*
sudo rm -rf openvswitch*.tar.gz
# Remove sensistive files
# Remove sensitive files
history -c # note this won't work if you have multiple bash sessions
rm -f ~/.bash_history # need to clear in memory and remove on disk
rm -f ~/.ssh/id_rsa* ~/.ssh/known_hosts
@@ -842,7 +857,7 @@ exit 0
}
function usage {
printf '\nUsage: %s [-abcdfhikmnprtvVwxy03]\n\n' $(basename $0) >&2
printf '\nUsage: %s [-abcdefhikmnprtvVwxy03]\n\n' $(basename $0) >&2
printf 'This install script attempts to install useful packages\n' >&2
printf 'for Mininet. It should (hopefully) work on Ubuntu 11.10+\n' >&2
@@ -869,8 +884,8 @@ function usage {
printf -- ' -v: install Open (V)switch\n' >&2
printf -- ' -V <version>: install a particular version of Open (V)switch on Ubuntu\n' >&2
printf -- ' -w: install OpenFlow (W)ireshark dissector\n' >&2
printf -- ' -x: install NO(X) Classic OpenFlow controller\n' >&2
printf -- ' -y: install R(y)u Controller\n' >&2
printf -- ' -x: install NO(X) Classic OpenFlow controller\n' >&2
printf -- ' -0: (default) -0[fx] installs OpenFlow 1.0 versions\n' >&2
printf -- ' -3: -3[fx] installs OpenFlow 1.3 versions\n' >&2
exit 2
+88
View File
@@ -0,0 +1,88 @@
diff --git a/lib/backtrace.c b/lib/backtrace.c
index 5b61ffe..f77e489 100644
--- a/lib/backtrace.c
+++ b/lib/backtrace.c
@@ -123,6 +123,6 @@ backtrace_capture(struct backtrace *bt)
}
bt->n_frames = n;
#else
- bt->n_frames = backtrace(bt->frames, BACKTRACE_MAX_FRAMES);
+ bt->n_frames = backtrace((void **)bt->frames, BACKTRACE_MAX_FRAMES);
#endif
}
diff --git a/lib/flow.c b/lib/flow.c
index 523eff0..4a1bf7b 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -44,11 +44,10 @@
#include "vlog.h"
#define THIS_MODULE VLM_flow
-static struct arp_header *
+static struct arp_eth_header *
pull_arp(struct ofpbuf *packet)
{
if (packet->size >= ARP_ETH_HEADER_LEN) {
- struct arp_eth_header *arp = packet->data;
return ofpbuf_pull(packet, ARP_ETH_HEADER_LEN);
}
return NULL;
diff --git a/lib/socket-util.c b/lib/socket-util.c
index c7b5d6d..5b3d602 100644
--- a/lib/socket-util.c
+++ b/lib/socket-util.c
@@ -42,6 +42,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/resource.h>
+#include <sys/stat.h>
#include <sys/un.h>
#include <unistd.h>
#include "fatal-signal.h"
diff --git a/lib/stp.c b/lib/stp.c
index b638311..b81ae53 100644
--- a/lib/stp.c
+++ b/lib/stp.c
@@ -34,6 +34,7 @@
/* Based on sample implementation in 802.1D-1998. Above copyright and license
* applies to all modifications. */
+#include <config.h>
#include "stp.h"
#include <arpa/inet.h>
#include <assert.h>
diff --git a/lib/util.c b/lib/util.c
index 21cc28d..1f341b1 100644
--- a/lib/util.c
+++ b/lib/util.c
@@ -138,6 +138,7 @@ xasprintf(const char *format, ...)
return s;
}
+#ifndef HAVE_STRLCPY
void
strlcpy(char *dst, const char *src, size_t size)
{
@@ -148,6 +149,7 @@ strlcpy(char *dst, const char *src, size_t size)
dst[n_copy] = '\0';
}
}
+#endif
void
ofp_fatal(int err_no, const char *format, ...)
diff --git a/lib/util.h b/lib/util.h
index fde681f..dc4e71f 100644
--- a/lib/util.h
+++ b/lib/util.h
@@ -34,6 +34,10 @@
#ifndef UTIL_H
#define UTIL_H 1
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
+2 -2
View File
@@ -64,7 +64,7 @@ VMImageDir = os.environ[ 'HOME' ] + '/vm-images'
Prompt = '\$ ' # Shell prompt that pexpect will wait for
# URLs for Ubunto .iso images
# URLs for Ubuntu .iso images
def serverURL( version, arch ):
"Return .iso URL for Ubuntu version and arch"
@@ -227,7 +227,7 @@ def attachNBD( cow, flags='' ):
def detachNBD( nbd ):
"Detatch an nbd device"
"Detach an nbd device"
srun( 'qemu-nbd -d ' + nbd )