All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 063b2e02 authored by Mike Hibler's avatar Mike Hibler

Update NS version used by nsverify from 2.29 to 2.34.

This allows nsverify to be built on FreeBSD 7+.  Based on patches from John
Hickey <jhickey@isi.edu> and Serge van Ginderachter <serge@vanginderachter.be>,
thanks guys!

I also moved all the logic for downloading/patching the tarball from the
GNUmakefile into ns-patch.sh to bring this in line with our other third-party
packages that do the same.  This is in pursuit of one day having a GUDS
(Grand Unified Download Script).
parent c45d8a9c
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group.
# Copyright (c) 2006-2010 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -12,12 +12,12 @@ TESTBED_SRCDIR = @top_srcdir@
OBJDIR = ../..
SUBDIR = tbsetup/nsverify
NS_VERSION=2.29
NS_TAR_VERSION=2.29.2
TCLCL_VERSION=1.17
NS_SRC_TARBALL=ns-allinone-$(NS_TAR_VERSION).tar.gz
# XXX these need to be in synch with ns-fetch.sh
NS_VERSION=2.34
TCLCL_VERSION=1.19
NS_SRC_TARBALL=ns-allinone-$(NS_VERSION).tar.gz
LOCALPKGHOST = @OUTERBOSS_NODENAME@
PKGHOST = www.emulab.net
FETCH = fetch -m
include $(OBJDIR)/Makeconf
......@@ -46,31 +46,9 @@ post-install:
chmod u+s $(INSTALL_LIBEXECDIR)/verify-ns
ns-allinone-$(NS_VERSION):
@if test -f /share/tarballs/$(NS_SRC_TARBALL); then \
echo "Unpacking $(NS_SRC_TARBALL)"; \
tar xfz /share/tarballs/$(NS_SRC_TARBALL); \
else \
( echo "Downloading $(NS_SRC_TARBALL)"; \
if [ -n "$(LOCALPKGHOST)" ]; then \
$(FETCH) http://$(LOCALPKGHOST)/downloads/$(NS_SRC_TARBALL);\
fi ; \
if [ ! -s $(NS_SRC_TARBALL) ]; then \
$(FETCH) http://$(PKGHOST)/downloads/$(NS_SRC_TARBALL); \
fi ;\
echo "Unpacking $(NS_SRC_TARBALL)"; \
tar xfz $(NS_SRC_TARBALL); ) \
fi
patch-ns-$(NS_VERSION):
patch -d ns-allinone-$(NS_VERSION)/ns-$(NS_VERSION) \
< $(SRCDIR)/ns-$(NS_VERSION).patch
if test -e $(SRCDIR)/tclcl-$(TCLCL_VERSION).patch; then \
patch -d ns-allinone-$(NS_VERSION)/tclcl-$(TCLCL_VERSION) \
< $(SRCDIR)/tclcl-$(TCLCL_VERSION).patch; \
fi
touch $@
nstb: ns-allinone-$(NS_VERSION) patch-ns-$(NS_VERSION)
$(SRCDIR)/ns-fetch.sh $(SRCDIR) $(NS_SRC_TARBALL) $(LOCALPKGHOST)
nstb: ns-allinone-$(NS_VERSION)
@cd $</tclcl-$(TCLCL_VERSION); \
./configure --with-tcl=/usr/local; \
$(MAKE)
......@@ -79,7 +57,7 @@ nstb: ns-allinone-$(NS_VERSION) patch-ns-$(NS_VERSION)
$(MAKE)
cp $</ns-$(NS_VERSION)/ns $@
control-install: nstb \
control-install: $(LIB_STUFF) $(LIBEXEC_STUFF) nstb \
$(addprefix $(INSTALL_LIBDIR)/nsverify/, $(LIB_STUFF)) \
$(addprefix $(INSTALL_LIBEXECDIR)/nsverify/, $(LIBEXEC_STUFF) nstb)
......@@ -104,3 +82,7 @@ $(INSTALL_DIR)/opsdir/libexec/nsverify/%: %
$(INSTALL) $< $@
clean:
rm -f $(LIB_STUFF) $(LIBEXEC_STUFF) $(BOSSLIBEXEC)
reallyclean:
rm -rf ns-allinone-$(NS_VERSION) $(NS_SRC_TARBALL)
diff -ur ./aomdv/aomdv.cc ../../ns-allinone-2.34-patched/ns-2.34/aomdv/aomdv.cc
--- ./aomdv/aomdv.cc 2009-06-14 10:35:44.000000000 -0700
+++ ../../ns-allinone-2.34-patched/ns-2.34/aomdv/aomdv.cc 2009-12-21 18:59:34.000000000 -0800
@@ -86,6 +86,7 @@
#include <aomdv/aomdv_packet.h>
#include <random.h>
#include <cmu-trace.h>
+#include <sys/socket.h>
//#include <energy-model.h>
#define max(a,b) ( (a) > (b) ? (a) : (b) )
diff -ur ./tcl/lan/vlan.tcl ../../ns-allinone-2.34-patched/ns-2.34/tcl/lan/vlan.tcl
--- ./tcl/lan/vlan.tcl 2009-06-14 10:35:40.000000000 -0700
+++ ../../ns-allinone-2.34-patched/ns-2.34/tcl/lan/vlan.tcl 2009-12-21 18:56:42.000000000 -0800
@@ -143,8 +143,12 @@
$src add-neighbor $self
set sid [$src id]
- set link_($sid:$id_) [new Vlink $ns_ $self $src $self $bw 0]
- set link_($id_:$sid) [new Vlink $ns_ $self $self $src $bw 0]
+ set link_($sid:$id_) [new Vlink $ns_ $self $src $self $bw $delay]
+ set link_($id_:$sid) [new Vlink $ns_ $self $self $src $bw $delay]
+
+ # linktest: add to the linktest set of links.
+ $ns_ addLTLink $sid:$id_
+ $ns_ addLTLink $id_:$sid
$src add-oif [$link_($sid:$id_) head] $link_($sid:$id_)
$src add-iif [[$nif set iface_] label] $link_($id_:$sid)
@@ -520,6 +524,12 @@
$lan addNode $nodelist $bw $delay $llType $ifqType $macType \
$phyType $mactrace $ifqLen
+ # linktest renaming
+ $self instvar id_counter
+ $lan set tbaltname_ tblan-lan[incr id_counter]
+ global last_lan
+ real_set last_lan $lan
+
return $lan
}
diff -ur ./tcl/lib/ns-lib.tcl ../../ns-allinone-2.34-patched/ns-2.34/tcl/lib/ns-lib.tcl
--- ./tcl/lib/ns-lib.tcl 2009-06-14 10:35:41.000000000 -0700
+++ ../../ns-allinone-2.34-patched/ns-2.34/tcl/lib/ns-lib.tcl 2009-12-21 18:56:42.000000000 -0800
@@ -261,6 +261,11 @@
$self multicast $args
}
eval $self next $args
+
+ # linktest renaming
+ $self set id_counter 0
+ global last_sim
+ real_set last_sim $self
}
Simulator instproc nullagent {} {
@@ -587,6 +592,13 @@
$node set ns_ $self
$self check-node-num
+
+ # linktest renaming
+ $self instvar id_counter
+ $node set tbaltname_ tbnode-n[incr id_counter]
+ global last_host
+ real_set last_host $node
+
return $node
}
@@ -1232,6 +1244,28 @@
$n1 set-neighbor [$n2 id]
$n2 set-neighbor [$n1 id]
}
+
+ ### linktest -- set up DupLink class to return
+ set dup [new Duplink]
+ $dup set from $link_($i1:$i2)
+ $dup set to $link_($i2:$i1)
+
+ # add the duplink ref to the simplex links.
+ $link_($i1:$i2) set linkRef_ $dup
+ $link_($i2:$i1) set linkRef_ $dup
+
+ # and add to the linktest list of links.
+ $self addLTLink $i1:$i2 $type
+ $self addLTLink $i2:$i1 $type
+
+ $self instvar id_counter
+ $dup set tbaltname_ tblink-l[incr id_counter]
+
+ # naming
+ global last_link
+ real_set last_link $dup
+
+ return $dup
}
Simulator instproc duplex-intserv-link { n1 n2 bw pd sched signal adc args } {
#!/bin/sh
version=2.34
tclversion=1.19
srcurl="http://heanet.dl.sourceforge.net/project/nsnam/allinone/ns-allinone-$version"
tarball="ns-allinone-$version.tar.gz"
if [ -x /usr/bin/fetch ]; then
fetch=/usr/bin/fetch
elif [ -x /usr/bin/wget ]; then
fetch=/usr/bin/wget
else
echo "ERROR: ns-fetch.sh: need either 'fetch' or 'wget' installed"
exit 1
fi
if [ -n "$1" ]; then srcdir=$1; else srcdir=$PWD ; fi
if [ -n "$2" ]; then tarball=$2; fi
if [ -n "$3" ]; then host=$3; else host=www.emulab.net ; fi
dir=$PWD
if [ ! -d $dir/ns-allinone-$version ]; then
if [ ! -f "$tarball" ]; then
cd $dir
# since this is such a big bubba, grab from /share rather than http
if [ -f /share/tarballs/$tarball ]; then
echo "Using NFS cached version ..."
tarball=/share/tarballs/$tarball
else
echo "Downloading ns source from $host to $dir ..."
$fetch http://$host/$tarball
if [ $? -ne 0 ]; then
echo "Failed..."
echo "Downloading ns source from $srcurl to $dir ..."
$fetch $srcurl/$tarball || {
echo "ERROR: ns-fetch: $fetch failed"
exit 1
}
fi
fi
fi
echo "Unpacking/patching ns-$version source ..."
tar xzof $tarball || {
echo "ERROR: ns-fetch.sh: tar failed"
exit 1
}
patch -d ns-allinone-$version/ns-$version < $srcdir/ns-$version.patch || {
echo "ERROR: ns-fetch.sh: patch failed"
exit 1
}
if [ -e $srcdir/tclcl-$tclversion.patch ]; then \
echo "Patching tclcl-$tclversion ..."
patch -d ns-allinone-$version/tclcl-$tclversion \
< $srcdir/tclcl-$tclversion.patch; \
fi
find . -name '*.orig' -exec rm -f '{}' \;
fi
exit 0
diff -ur ./conf/configure.in.tcl ../../ns-allinone-2.34-patched/tclcl-1.19/conf/configure.in.tcl
--- ./conf/configure.in.tcl 2009-06-14 10:35:03.000000000 -0700
+++ ../../ns-allinone-2.34-patched/tclcl-1.19/conf/configure.in.tcl 2009-12-21 18:10:39.000000000 -0800
@@ -99,6 +99,9 @@
$d/include/tcl$TCL_HI_VERS \
$d/include/tcl$TCL_VERS \
$d/include/tcl$TCL_ALT_VERS \
+ $d/include/tcl$TCL_HI_VERS/generic \
+ $d/include/tcl$TCL_VERS/generic \
+ $d/include/tcl$TCL_ALT_VERS/generic \
$d/include \
/usr/local/include \
"
diff -ur ./configure ../../ns-allinone-2.34-patched/tclcl-1.19/configure
--- ./configure 2009-06-14 10:35:03.000000000 -0700
+++ ../../ns-allinone-2.34-patched/tclcl-1.19/configure 2009-12-21 18:15:38.000000000 -0800
@@ -6014,6 +6014,9 @@
$d/include/tcl$TCL_HI_VERS \
$d/include/tcl$TCL_VERS \
$d/include/tcl$TCL_ALT_VERS \
+ $d/include/tcl$TCL_HI_VERS/generic \
+ $d/include/tcl$TCL_VERS/generic \
+ $d/include/tcl$TCL_ALT_VERS/generic \
$d/include \
/usr/local/include \
"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment