[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] patches for ns 2.1b8 and nam



Hi to all.

I have found some *possible* errors in both ns and nam. Any feedback
about these problems and about the patches I provide as an attachment
with this email will be greatly appreciated.

About the network simulator:

I found that some changes are useful when building this powerful simulator.
These changes works at least in Solaris and a lot of them (for example to
change the friendness between classes from `friend' to `friend class' are
recommended by standards. By the way, this change is required when compiling
with the latest gcc releases (in my workstation I have gcc 3.0.2). The new
gcc design has made the compiler more strict about the standards and it is
good for all of us (there are a lot of incompatibilities because some standards
are not followed in the right way).

Other changes are recommended by the experience and the time (not so much)
spent compiling the LBL network simulator. The differences history, provided
as a reference, are:

-------------------------------------------------------------------------------
file                line(s)   change
-------------------------------------------------------------------------------
drr.cc              37        changed `friend' to `friend class'
imep/rxmit_queue.h  61        changed `friend' to `friend class'
route.h             81        elements_in_level(int *,int) should not be inline
sfq.cc              52        changed `friend' to `friend class'
snoop.h             114, 115  changed `friend' to `friend class'
tcp-full.h          131       changed `friend' to `friend class'
tcp-rbp.cc          72, 234   changed `friend' to `friend class'
tfrc-sink.h         74        changed `friend' to `friend class'
tfrc.h              116, 117  changed `friend' to `friend class'
-------------------------------------------------------------------------------

With this email, I provide these changes as patches to the source code.
To apply these patches you can try something like:

   patch -i file.txt.patch file.txt

These patches were made with diff(1), in normal mode.  Should be easy to
apply by hand too.

When building `setdest' and `calcdest' the Makefile should call the C++
compiler instead of the C one.  These files seems to use the C++
operators `new' and `delete' instead of the C operators `malloc' and
`free'.  I compiled these binaries using:

   c++ -o setdest setdest.o rng.o -Dstand_alone -lsocket -lnsl -lintl
     -ldl -lm -ldl
   c++ -o calcdest calcdest.o rng.o -Dstand_alone -lsocket -lnsl -lintl
     -ldl -lm -ldl

A fix to it can be to change CC=gcc to CPP=c++ and make the compiler
calls shown above to the C++ compiler.  The file to change is:

   indep-utils/cmu-scen-gen/setdest/Makefile

When using g++ instead of the platform native compilers there is a
problem with the C++ library (that is called `libstdc++.so' instead of,
for example, `libC' (Solaris)).  If the binaries are dinamically linked
against the functions provided by that library it is required to provide
information to the linker about where that library can be found in the
workstation (using -R).  For example, adding:

   -R/opt/gnu/lib

to the Makefile's LIB variable. Makefiles that require this change are:

   indep-utils/cmu-scen-gen/setdest/Makefile
   indep-utils/webtrace-conv/*/Makefile

I found that both aodv/aodv.h and aodv/aodv.cc use a `struct bcache'.
There is not a possible overload of it (it is a struct not a function)
and operating systems like Solaris provide a `struct bcache' now.
I think that change the name of that structure to, for example, bcache2,
is not so bad idea, if the one provided by these operating systems do not
work as expected (why not?).

I have installed tclcl in an /opt/<vendor> directory (Solaris now is a
SVr4.x).  It is now in /opt/ucb.  The problem I found is that the binary
is looked in /opt/ucb instead of /opt/ucb/bin (other packages works just
fine).  To have tcl2c++ in the path do not solves the problem (should
the configure script be fixed?).

About the network animator:

It requires three changes to compile on Solaris.  First of all, it needs
a -R/opt/gnu/lib in the Makefile LIB.  Another change is related with
the file queue.h.  In the line 48 of this file the `friend' declaration
must be changed to `friend class' (again).  And, at last, rng.cc
requires atoi() and gettimeofday() to be removed (sorry, I have not
provided patches for these files).  The operating system provides these
functions and, at present, seems to work just fine even in Solaris.

Cheers,
Igor.

-- 
Igor Sobrado, UK34436 - [email protected]

ns-2.1b8.tar.Z