diff --git a/util/install.sh b/util/install.sh index b6d94ab..1140695 100755 --- a/util/install.sh +++ b/util/install.sh @@ -145,12 +145,11 @@ function mn_deps { # The following will cause a full OF install, covering: # -user switch -# -dissector # The instructions below are an abbreviated version from # http://www.openflowswitch.org/wk/index.php/Debian_Install # ... modified to use Debian Lenny rather than unstable. function of { - echo "Installing OpenFlow and OpenFlow WireShark dissector..." + echo "Installing OpenFlow reference implementation..." cd ~/ $install git-core autoconf automake autotools-dev pkg-config \ make gcc libtool libc6-dev @@ -166,25 +165,6 @@ function of { make sudo make install - # Install dissector: - $install wireshark libgtk2.0-dev - cd ~/openflow/utilities/wireshark_dissectors/openflow - make - sudo make install - - # The OpenFlow wireshark plugin does not install to the correct dir. - # The correct way would be to fix the install script. - # For now, just copy it to the global WS plugin dir. - # Tested on Ubuntu 11.04. - if [ -e /var/packet-openflow.so ]; then - WS_DIR=`ls -d /usr/lib/wireshark/libwireshark* | head -1` - sudo cp /var/packet-openflow.so $WS_DIR/plugins/ - fi - - # 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: $remove avahi-daemon @@ -199,6 +179,38 @@ function of { cd ~ } +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/onlab/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 { @@ -428,6 +440,7 @@ function all { kernel mn_deps of + wireshark ovs nox oftest @@ -487,6 +500,7 @@ function usage { printf -- ' -r: remove existing Open vSwitch packages\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 @@ -497,7 +511,7 @@ if [ $# -eq 0 ] then all else - while getopts 'abcdfhkmnrtvx' OPTION + while getopts 'abcdfhkmnrtvwx' OPTION do case $OPTION in a) all;; @@ -512,6 +526,7 @@ else r) remove_ovs;; t) other;; v) ovs;; + w) wireshark;; x) nox;; ?) usage;; esac