merge with ns-3-dev
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Wed Jun 17 12:07:25 2009 +0100 (7 months ago)
changeset 456439908c16e620
parent 4563 e883e2df59af
parent 4550 0878cd580565
child 4565 bf3bf038e091
merge with ns-3-dev
     1.1 --- a/bindings/python/wscript	Fri Jun 12 10:31:19 2009 +0100
     1.2 +++ b/bindings/python/wscript	Wed Jun 17 12:07:25 2009 +0100
     1.3 @@ -439,6 +439,8 @@
     1.4          bindgen.name = "pybindgen-command"
     1.5  
     1.6          pymod = bld.new_task_gen('cxx', 'shlib', 'pyext')
     1.7 +        if sys.platform == 'cygwin':
     1.8 +            pymod.features.append('implib') # workaround for WAF bug #472
     1.9          pymod.source = ['ns3module.cc', 'ns3module_helpers.cc']
    1.10          pymod.includes = '.'
    1.11          for module in scanned_modules:
     2.1 --- a/doc/build.txt	Fri Jun 12 10:31:19 2009 +0100
     2.2 +++ b/doc/build.txt	Wed Jun 17 12:07:25 2009 +0100
     2.3 @@ -36,7 +36,7 @@
     2.4  
     2.5  Other waf usages include:
     2.6  
     2.7 - 1. ./waf check
     2.8 + 1. ./waf --check
     2.9      Runs the unit tests
    2.10  
    2.11   2. ./waf --doxygen
     3.1 --- a/doc/main.h	Fri Jun 12 10:31:19 2009 +0100
     3.2 +++ b/doc/main.h	Wed Jun 17 12:07:25 2009 +0100
     3.3 @@ -27,8 +27,8 @@
     3.4   * ns-3 requires Doxygen version 1.5.4 or greater to fully build all items,
     3.5   * although earlier versions of Doxygen will mostly work.
     3.6   * 
     3.7 - * Type "./waf check" followed by "./waf --doxygen" to build the documentation.
     3.8 - * There is a program that runs during "./waf check" that builds pieces of
     3.9 + * Type "./waf --check" followed by "./waf --doxygen" to build the documentation.
    3.10 + * There is a program that runs during "./waf --check" that builds pieces of
    3.11   * the documentation through introspection.  The doc/ directory contains
    3.12   * configuration for Doxygen (doxygen.conf and main.txt).  The Doxygen 
    3.13   * build process puts html files into the doc/html/ directory, and latex 
     4.1 --- a/doc/manual/new-models.texi	Fri Jun 12 10:31:19 2009 +0100
     4.2 +++ b/doc/manual/new-models.texi	Wed Jun 17 12:07:25 2009 +0100
     4.3 @@ -205,7 +205,7 @@
     4.4  of adding the .cc file to the rest of the source files, and the .h
     4.5  file to the list of the header files. 
     4.6  
     4.7 -Now, pop up to the top level directory and type "./waf check".  You
     4.8 +Now, pop up to the top level directory and type "./waf --check".  You
     4.9  shouldn't have broken anything by this operation.
    4.10  @subsection include guards
    4.11  Next, let's add some 
     5.1 --- a/doc/release_steps.txt	Fri Jun 12 10:31:19 2009 +0100
     5.2 +++ b/doc/release_steps.txt	Wed Jun 17 12:07:25 2009 +0100
     5.3 @@ -6,12 +6,12 @@
     5.4     - revise and check in RELEASE_NOTES
     5.5     - DO NOT change VERSION at this time
     5.6     - confirm that Doxygen builds cleanly and without warnings
     5.7 -     (./waf check; ./waf --doxygen), and check in any necessary changes 
     5.8 +     (./waf --check; ./waf --doxygen), and check in any necessary changes 
     5.9     - ensure no regressions (./waf --regression)
    5.10  3. ./waf configure; ./waf dist
    5.11     - this will create an ns-3-dev.tar.bz2 tarball
    5.12     - this will also create a ns-3-dev-ref-traces.tar.bz2 tarball
    5.13 -4. test dev tarball on release platforms (waf check and maybe some other 
    5.14 +4. test dev tarball on release platforms (waf --check and maybe some other 
    5.15     scripts)
    5.16  5. once you are happy with the tarball, tag ns-3-dev and ns-3-dev-ref-traces
    5.17     - hg tag "ns-3.x"
     6.1 --- a/doc/tutorial/building-topologies.texi	Fri Jun 12 10:31:19 2009 +0100
     6.2 +++ b/doc/tutorial/building-topologies.texi	Wed Jun 17 12:07:25 2009 +0100
     6.3 @@ -248,7 +248,7 @@
     6.4  Now we have a topology built, but we need applications.  This section is
     6.5  going to be fundamentally similar to the applications section of 
     6.6  @code{first.cc} but we are going to instantiate the server on one of the 
     6.7 -nodes that has a CSMA node and the client on the node having only a 
     6.8 +nodes that has a CSMA device and the client on the node having only a 
     6.9  point-to-point device.
    6.10  
    6.11  First, we set up the echo server.  We create a @code{UdpEchoServerHelper} and
    6.12 @@ -296,7 +296,7 @@
    6.13  Since we have actually built an internetwork here, we need some form of 
    6.14  internetwork routing.  @command{ns-3} provides what we call a global route 
    6.15  manager to set up the routing tables on nodes.  This route manager has a 
    6.16 -global function that runs though the nodes created for the simulation and does
    6.17 +global function that runs through the nodes created for the simulation and does
    6.18  the hard work of setting up routing for you.  
    6.19  
    6.20  Basically, what happens is that each node behaves as if it were an OSPF router
    6.21 @@ -317,7 +317,7 @@
    6.22  
    6.23  @verbatim
    6.24    PointToPointHelper::EnablePcapAll ("second");
    6.25 -  CsmaHelper::EnablePcap ("second", csmaDevices.Get (0), true);
    6.26 +  CsmaHelper::EnablePcap ("second", csmaDevices.Get (1), true);
    6.27  @end verbatim
    6.28  
    6.29  The CSMA network is a multi-point-to-point network.  This means that there 
    6.30 @@ -336,8 +336,8 @@
    6.31  network and ask it to perform a promiscuous sniff of the network, thereby
    6.32  emulating what @code{tcpdump} would do.  If you were on a Linux machine
    6.33  you might do something like @code{tcpdump -i eth0} to get the trace.  
    6.34 -In this case, we specify the device using @code{csmaDevices.Get(0)}, 
    6.35 -which selects the zeroth device in the container.  Setting the final
    6.36 +In this case, we specify the device using @code{csmaDevices.Get(1)}, 
    6.37 +which selects the first device in the container.  Setting the final
    6.38  parameter to true enables promiscuous captures.
    6.39  
    6.40  The last section of code just runs and cleans up the simulation just like
    6.41 @@ -374,7 +374,7 @@
    6.42  @verbatim
    6.43    export NS_LOG=
    6.44    ./waf --run scratch/mysecond
    6.45 -#end verbatim
    6.46 +@end verbatim
    6.47  
    6.48  Since we have set up the UDP echo applications to log just as we did in 
    6.49  @code{first.cc}, you will see similar output when you run the script.
    6.50 @@ -395,7 +395,7 @@
    6.51  is from the echo client, indicating that it has received its echo back from
    6.52  the server.
    6.53  
    6.54 -If you now go and look in the top level directory, you will find two trace 
    6.55 +If you now go and look in the top level directory, you will find three trace 
    6.56  files:
    6.57  
    6.58  @verbatim
    6.59 @@ -648,7 +648,7 @@
    6.60  
    6.61  To illustrate the difference between promiscuous and non-promiscuous traces, we
    6.62  also requested a non-promiscuous trace for the next-to-last node.  Go ahead and
    6.63 -take a look at the @code{tcpdump} for @code{second-10-0.pcap}.
    6.64 +take a look at the @code{tcpdump} for @code{second-100-0.pcap}.
    6.65  
    6.66  @verbatim
    6.67    tcpdump -nn -tt -r second-100-0.pcap
    6.68 @@ -845,11 +845,11 @@
    6.69  
    6.70  For simplicity, this code uses the default PHY layer configuration and
    6.71  channel models which are documented in the API doxygen documentation for
    6.72 -the @code{YansWifiChannelHelper::Default} and @code{YAnsWifiPhyHelper::Default}
    6.73 +the @code{YansWifiChannelHelper::Default} and @code{YansWifiPhyHelper::Default}
    6.74  methods. Once these objects are created, we create a channel object
    6.75  and associate it to our PHY layer object manager to make sure
    6.76 -that all the PHY objects created layer by the @code{YansWifiPhyHelper}
    6.77 -all share the same underlying channel, that is, they share the same
    6.78 +that all the PHY layer objects created by the @code{YansWifiPhyHelper}
    6.79 +share the same underlying channel, that is, they share the same
    6.80  wireless medium and can communication and interfere:
    6.81  
    6.82  @verbatim
    6.83 @@ -1111,9 +1111,9 @@
    6.84  @end verbatim
    6.85  
    6.86  The file ``third-0-0.pcap'' corresponds to the point-to-point device on node
    6.87 -zero -- the left side of the ``backbone.''  The file ``third-1-0.pcap'' 
    6.88 +zero -- the left side of the ``backbone''.  The file ``third-1-0.pcap'' 
    6.89  corresponds to the point-to-point device on node one -- the right side of the
    6.90 -``backbone.''  The file ``third-0-1.pcap'' will be the promiscuous (monitor
    6.91 +``backbone''.  The file ``third-0-1.pcap'' will be the promiscuous (monitor
    6.92  mode) trace from the Wifi network and the file ``third-1-1.pcap'' will be the
    6.93  promiscuous trace from the CSMA network.  Can you verify this by inspecting
    6.94  the code?
    6.95 @@ -1329,9 +1329,9 @@
    6.96  @uref{http://www.nsnam.org/doxygen-release/index.html,,ns-3 Doxygen}
    6.97  which you can find in the ``Modules'' tab.
    6.98  Under the ``core'' section, you will find a link to ``The list of all trace 
    6.99 -sources.''  You may find it interesting to try and hook some of these 
   6.100 +sources.''.  You may find it interesting to try and hook some of these 
   6.101  traces yourself.  Additionally in the ``Modules'' documentation, there is
   6.102 -a link to ``The list of all attributes.''  You can set the default value of 
   6.103 +a link to ``The list of all attributes.''.  You can set the default value of 
   6.104  any of these @code{Attributes} via the command line as we have previously 
   6.105  discussed.
   6.106  
     7.1 --- a/doc/tutorial/conceptual-overview.texi	Fri Jun 12 10:31:19 2009 +0100
     7.2 +++ b/doc/tutorial/conceptual-overview.texi	Wed Jun 17 12:07:25 2009 +0100
     7.3 @@ -276,7 +276,7 @@
     7.4  @end verbatim
     7.5  
     7.6  to build the project.  So now if you look in the directory 
     7.7 -@code{build/debug/ns-3} you will find the four module include files shown 
     7.8 +@code{build/debug/ns3} you will find the four module include files shown 
     7.9  above.  You can take a look at the contents of these files and find that they
    7.10  do include all of the public include files in their respective modules.
    7.11  
    7.12 @@ -308,8 +308,8 @@
    7.13  
    7.14  We will use this statement as a convenient place to talk about our Doxygen
    7.15  documentation system.  If you look at the project web site, 
    7.16 -@uref{http://www.nsnam.org,,ns-3 project}, you will find a link to ``APIs
    7.17 -(Doxygen)'' in the navigation bar.  If you select this link, you will be
    7.18 +@uref{http://www.nsnam.org,,ns-3 project}, you will find a link to ``Doxygen 
    7.19 +(ns-3-dev)'' in the navigation bar.  If you select this link, you will be
    7.20  taken to our documentation page.
    7.21  
    7.22  Along the left side, you will find a graphical representation of the structure
    7.23 @@ -601,7 +601,7 @@
    7.24  helper.
    7.25  
    7.26  Applications require a time to ``start'' generating traffic and may take an
    7.27 -optional time to ``stop.''  We provide both.  These times are set using  the
    7.28 +optional time to ``stop''.  We provide both.  These times are set using  the
    7.29  @code{ApplicationContainer} methods @code{Start} and @code{Stop}.  These 
    7.30  methods take @code{Time} parameters.  In this case, we use an explicit C++
    7.31  conversion sequence to take the C++ double 1.0 and convert it to an 
    7.32 @@ -815,12 +815,12 @@
    7.33  The source code is mainly in the @code{src} directory.  You can view source
    7.34  code either by clicking on the directory name or by clicking on the @code{files}
    7.35  link to the right of the directory name.  If you click on the @code{src}
    7.36 -directory you be taken to the lising of the @code{src} subdirectories.  If you 
    7.37 +directory, you will be taken to the listing of the @code{src} subdirectories.  If you 
    7.38  click on @code{core} subdirectory, you will find a list of files.  The first file
    7.39  you will find (as of this writing) is @code{abort.h}.  If you 
    7.40  click on @code{abort.h} link, you will be sent to the source file for @code{abort.h}.
    7.41  
    7.42  Our example scripts are in the @code{examples} directory.  The source code for
    7.43  the helpers we have used in this chapter can be found in the 
    7.44 -@code{src/helpers} directory.  Feel free to poke around in the directory tree to
    7.45 +@code{src/helper} directory.  Feel free to poke around in the directory tree to
    7.46  get a feel for what is there and the style of @command{ns-3} programs.
     8.1 --- a/doc/tutorial/getting-started.texi	Fri Jun 12 10:31:19 2009 +0100
     8.2 +++ b/doc/tutorial/getting-started.texi	Wed Jun 17 12:07:25 2009 +0100
     8.3 @@ -44,7 +44,7 @@
     8.4  
     8.5  @cindex tarball
     8.6  The @command{ns-3} code is available in Mercurial repositories on the server
     8.7 -code.nsnam.org.  You can also download a tarball release at
     8.8 +@uref{http://code.nsnam.org}.  You can also download a tarball release at
     8.9  @uref{http://www.nsnam.org/releases/}, or you can work with repositories
    8.10  using Mercurial.  We recommend using Mercurial unless there's a good reason
    8.11  not to.  See the end of this section for instructions on how to get a tarball
    8.12 @@ -53,7 +53,7 @@
    8.13  @cindex repository
    8.14  The simplest way to get started using Mercurial repositories is to use the
    8.15  @code{ns-3-allinone} environment.  This is a set of scripts that manages the 
    8.16 -downloading and building of various subystems of @command{ns-3} for you.  We 
    8.17 +downloading and building of various subsystems of @command{ns-3} for you.  We 
    8.18  recommend that you begin your @command{ns-3} adventures in this environment
    8.19  as it can really simplify your life at this point.
    8.20  
    8.21 @@ -128,12 +128,13 @@
    8.22  the more constant ns-3-dev here in the tutorial, but you can replace the 
    8.23  string ``ns-3-dev'' with your choice of release (e.g., ns-3.4 and 
    8.24  ns-3.4-ref-traces) in the text below.  You can find the latest version  of the
    8.25 -code either by inspection of the repository list or by going to the ``Getting 
    8.26 -Started'' web page and looking for the latest release identifier.
    8.27 +code either by inspection of the repository list or by going to the 
    8.28 +@uref{http://www.nsnam.org/getting_started.html,,``Getting Started''} 
    8.29 +web page and looking for the latest release identifier.
    8.30  
    8.31  Go ahead and change into the @code{ns-3-allinone} directory you created when
    8.32  you cloned that repository.  We are now going to use the @code{download.py} 
    8.33 -script to pull down the various pieces of @command{ns-3} you will be using/
    8.34 +script to pull down the various pieces of @command{ns-3} you will be using.
    8.35  
    8.36  Go ahead and type the following into your shell (remember you can substitute
    8.37  the name of your chosen release number instead of @code{ns-3-dev} -- like
    8.38 @@ -257,15 +258,15 @@
    8.39    mkdir tarballs
    8.40    cd tarballs
    8.41    wget http://www.nsnam.org/releases/ns-allinone-3.4.tar.bz2
    8.42 -  tar xjf ns-3.4.tar.bz2
    8.43 +  tar xjf ns-allinone-3.4.tar.bz2
    8.44  @end verbatim 
    8.45  
    8.46  If you change into the directory @code{ns-allinone-3.4} you should see a
    8.47  number of files:
    8.48  
    8.49  @verbatim
    8.50 -build.py*     ns-3.4-RC2/             nsc-0.5.0/             util.py
    8.51 -constants.py  ns-3.4-RC2-ref-traces/  pybindgen-0.10.0.630/
    8.52 +build.py*     ns-3.4/             nsc-0.5.0/             README
    8.53 +constants.py  ns-3.4-ref-traces/  pybindgen-0.10.0.630/  util.py
    8.54  @end verbatim 
    8.55  
    8.56  You are now ready to build the @command{ns-3} distribution.
    8.57 @@ -404,7 +405,7 @@
    8.58  @end verbatim
    8.59  
    8.60  Note the last part of the above output.  Some ns-3 options are not enabled by
    8.61 -default or require support from the underlying system to work properly
    8.62 +default or require support from the underlying system to work properly.
    8.63  For instance, to enable XmlTo, the library libxml-2.0 must be found on the
    8.64  system.  in the example above, this library was not found and the corresponding
    8.65  feature was not enabled.  There is a feature to use sudo to set the suid bit of
    8.66 @@ -438,7 +439,7 @@
    8.67  available in waf.  To explore these options, type:
    8.68  
    8.69  @verbatim
    8.70 -  ./waf -- help
    8.71 +  ./waf --help
    8.72  @end verbatim
    8.73  
    8.74  We'll use some of the testing-related commands in the next section.
    8.75 @@ -455,10 +456,10 @@
    8.76  
    8.77  @cindex unit tests
    8.78  You can run the unit tests of the @command{ns-3} distribution by running the 
    8.79 -``check'' command,
    8.80 +``--check'' option,
    8.81  
    8.82  @verbatim
    8.83 -  ./waf check
    8.84 +  ./waf --check
    8.85  @end verbatim
    8.86  
    8.87  You should see a report from each unit test that executes indicating that the
    8.88 @@ -488,7 +489,7 @@
    8.89  
    8.90  @cindex regression tests
    8.91  You can also run our regression test suite to ensure that your distribution and
    8.92 -tool chain have produced binaries that generate output that is identical to
    8.93 +toolchain have produced binaries that generate output that is identical to
    8.94  known-good reference output files.  You downloaded these reference traces to 
    8.95  your machine during the download process above.  (Warning:  The @code{ns-3.2} 
    8.96  and @code{ns-3.3} releases do not use the @code{ns-3-allinone} environment
    8.97 @@ -505,7 +506,7 @@
    8.98  has gone awry.  If the error was discovered in a pcap file, it will be useful
    8.99  to convert the pcap files to text using tcpdump prior to comparison.
   8.100  
   8.101 -Some regression tests wmay be SKIPped if the required support
   8.102 +Some regression tests may be SKIPped if the required support
   8.103  is not present.
   8.104  
   8.105  To run the regression tests, you provide Waf with the regression flag.
   8.106 @@ -568,7 +569,7 @@
   8.107  @end verbatim
   8.108  
   8.109  Waf first checks to make sure that the program is built correctly and 
   8.110 -executes a build if required.  Waf then then executes the program, which 
   8.111 +executes a build if required.  Waf then executes the program, which 
   8.112  produces the following output.
   8.113  
   8.114  @verbatim
     9.1 --- a/doc/tutorial/in-process/introduction.texi	Fri Jun 12 10:31:19 2009 +0100
     9.2 +++ b/doc/tutorial/in-process/introduction.texi	Wed Jun 17 12:07:25 2009 +0100
     9.3 @@ -562,7 +562,7 @@
     9.4  the ns-3 programs by simply typing,
     9.5  
     9.6  @verbatim
     9.7 -  ./waf check
     9.8 +  ./waf --check
     9.9  @end verbatim
    9.10  
    9.11  You will see many Waf status messages displayed as the system compiles.  The
    10.1 --- a/doc/tutorial/introduction.texi	Fri Jun 12 10:31:19 2009 +0100
    10.2 +++ b/doc/tutorial/introduction.texi	Wed Jun 17 12:07:25 2009 +0100
    10.3 @@ -226,7 +226,7 @@
    10.4  order to extend the system in most cases.
    10.5  
    10.6  For those interested in the gory details of Waf, the main web site can be 
    10.7 -found at @uref{http://freehackers.org/~tnagy/waf.html}.
    10.8 +found at @uref{http://code.google.com/p/waf/}.
    10.9  
   10.10  @node Development Environment
   10.11  @section Development Environment
   10.12 @@ -275,7 +275,7 @@
   10.13  @cindex MinGW
   10.14  If you do use Cygwin or MinGW; and use Logitech products, we will save you
   10.15  quite a bit of heartburn right off the bat and encourage you to take a look
   10.16 -at the @uref{http://www.mingw.org/MinGWiki/index.php/FAQ,,MinGW FAQ}.
   10.17 +at the @uref{http://oldwiki.mingw.org/index.php/FAQ,,MinGW FAQ}.
   10.18  
   10.19  @cindex Logitech
   10.20  Search for ``Logitech'' and read the FAQ entry, ``why does make often 
   10.21 @@ -295,7 +295,7 @@
   10.22  We will assume a basic facility with the Berkeley Sockets API in the examples
   10.23  used in this tutorial.  If you are new to sockets, we recommend reviewing the
   10.24  API and some common usage cases.  For a good overview of programming TCP/IP
   10.25 -sockets we recommend @uref{http://www.elsevier.com/wps/product/cws_home/680765,,Practical TCP/IP Sockets in C, Donahoo and Calvert}.
   10.26 +sockets we recommend @uref{http://www.elsevier.com/wps/find/bookdescription.cws_home/717656/description#description,,TCP/IP Sockets in C, Donahoo and Calvert}.
   10.27  
   10.28  There is an associated web site that includes source for the examples in the
   10.29  book, which you can find at:
   10.30 @@ -305,6 +305,6 @@
   10.31  not have access to a copy of the book, the echo clients and servers shown in 
   10.32  the website above) you will be in good shape to understand the tutorial.
   10.33  There is a similar book on Multicast Sockets,
   10.34 -@uref{http://www.elsevier.com/wps/product/cws_home/700736,,Multicast Sockets, Makofske and Almeroth}.
   10.35 +@uref{http://www.elsevier.com/wps/find/bookdescription.cws_home/700736/description#description,,Multicast Sockets, Makofske and Almeroth}.
   10.36  that covers material you may need to understand if you look at the multicast 
   10.37  examples in the distribution.
    11.1 --- a/doc/tutorial/tweaking.texi	Fri Jun 12 10:31:19 2009 +0100
    11.2 +++ b/doc/tutorial/tweaking.texi	Wed Jun 17 12:07:25 2009 +0100
    11.3 @@ -112,7 +112,7 @@
    11.4  example, to print more information by setting its logging level via the 
    11.5  NS_LOG environment variable.  
    11.6  
    11.7 -I am going to assume from here on that are using an sh-like shell that uses 
    11.8 +I am going to assume from here on that you are using an sh-like shell that uses 
    11.9  the``VARIABLE=value'' syntax.  If you are using a csh-like shell, then you 
   11.10  will have to convert my examples to the ``setenv VARIABLE value'' syntax 
   11.11  required by those shells.
   11.12 @@ -353,7 +353,7 @@
   11.13  
   11.14  You now know that you can enable all of the logging for this component by
   11.15  setting the @code{NS_LOG} environment variable to the various levels.  Let's
   11.16 -go ahead add some logging to the script.  The macro used to add an 
   11.17 +go ahead and add some logging to the script.  The macro used to add an 
   11.18  informational level log message is @code{NS_LOG_INFO}.  Go ahead and add one 
   11.19  (just before we start creating the nodes) that tells you that the script is 
   11.20  ``Creating Topology.''  This is done as in this code snippet,
   11.21 @@ -439,7 +439,7 @@
   11.22  
   11.23  This simple two line snippet is actually very useful by itself.  It opens the
   11.24  door to the @command{ns-3} global variable and @code{Attribute} systems.  Go 
   11.25 -ahead and add that two lines of code to the @code{scratch/first.cc} script at
   11.26 +ahead and add that two lines of code to the @code{scratch/myfirst.cc} script at
   11.27  the start of @code{main}.  Go ahead and build the script and run it, but ask 
   11.28  the script for help in the following way,
   11.29  
   11.30 @@ -497,7 +497,7 @@
   11.31  setting in the @code{PointToPointHelper} above.  Let's use the default values 
   11.32  for the point-to-point devices and channels by deleting the 
   11.33  @code{SetDeviceAttribute} call and the @code{SetChannelAttribute} call from 
   11.34 -the @code{first.cc} we have in the scratch directory.
   11.35 +the @code{myfirst.cc} we have in the scratch directory.
   11.36  
   11.37  Your script should now just declare the @code{PointToPointHelper} and not do 
   11.38  any @code{set} operations as in the following example,
   11.39 @@ -801,8 +801,8 @@
   11.40    #include <fstream>
   11.41  @end verbatim
   11.42  
   11.43 -Then, right before the before the call to @code{Simulator::Run ()}, add the
   11.44 -following lines of code.
   11.45 +Then, right before the call to @code{Simulator::Run ()}, add the
   11.46 +following lines of code:
   11.47  
   11.48  @verbatim
   11.49    std::ofstream ascii;
   11.50 @@ -811,7 +811,7 @@
   11.51  @end verbatim
   11.52  
   11.53  The first two lines are just vanilla C++ code to open a stream that will be
   11.54 -written to a file named ``myfirst.tr.''  See your favorite C++ tutorial if you
   11.55 +written to a file named ``myfirst.tr''.  See your favorite C++ tutorial if you
   11.56  are unfamiliar with this code.  The last line of code in the snippet above
   11.57  tells @command{ns-3} that you want to enable ASCII tracing on all 
   11.58  point-to-point devices in your simulation; and you want the (provided) trace
   11.59 @@ -900,7 +900,7 @@
   11.60  created in a script.  Just as a filesystem may have directories under the 
   11.61  root, we may have node numbers in the @code{NodeList}.  The string 
   11.62  @code{/NodeList/0} therefore refers to the zeroth node in the @code{NodeList}
   11.63 -which we typically think of as ``node 0.''  In each node there is a list of 
   11.64 +which we typically think of as ``node 0''.  In each node there is a list of 
   11.65  devices that have been installed.  This list appears next in the namespace.
   11.66  You can see that this trace event comes from @code{DeviceList/0} which is the 
   11.67  zeroth device installed in the node. 
   11.68 @@ -928,14 +928,12 @@
   11.69    00 r 
   11.70    01 2.25732 
   11.71    02 /NodeList/1/DeviceList/0/$ns3::PointToPointNetDevice/MacRx 
   11.72 -  03 ns3::PppHeader (
   11.73 -  04   Point-to-Point Protocol: IP (0x0021)) 
   11.74 -  05   ns3::Ipv4Header (
   11.75 -  06     tos 0x0 ttl 64 id 0 offset 0 flags [none] 
   11.76 -  07     length: 1052 10.1.1.1 > 10.1.1.2)
   11.77 -  08     ns3::UdpHeader (
   11.78 -  09       length: 1032 49153 > 9) 
   11.79 -  10       Payload (size=1024)
   11.80 +  03   ns3::Ipv4Header (
   11.81 +  04     tos 0x0 ttl 64 id 0 protocol 17 offset 0 flags [none]
   11.82 +  05     length: 1052 10.1.1.1 > 10.1.1.2)
   11.83 +  06     ns3::UdpHeader (
   11.84 +  07       length: 1032 49153 > 9) 
   11.85 +  08       Payload (size=1024)
   11.86  @end verbatim
   11.87  
   11.88  Notice that the trace operation is now @code{r} and the simulation time has
   11.89 @@ -978,7 +976,7 @@
   11.90   and a ``.pcap'' suffix.
   11.91  
   11.92  In our example script, we will eventually see files named ``myfirst-0-0.pcap'' 
   11.93 -and ``myfirst.1-0.pcap'' which are the pcap traces for node 0-device 0 and 
   11.94 +and ``myfirst-1-0.pcap'' which are the pcap traces for node 0-device 0 and 
   11.95  node 1-device 0, respectively.
   11.96  
   11.97  Once you have added the line of code to enable pcap tracing, you can run the
   11.98 @@ -1010,9 +1008,9 @@
   11.99    2.257324 IP 10.1.1.2.9 > 10.1.1.1.49153: UDP, length 1024
  11.100  @end verbatim
  11.101  
  11.102 -You can see in the dump of @code{myfirst-0.0.pcap} (the client device) that the 
  11.103 +You can see in the dump of @code{myfirst-0-0.pcap} (the client device) that the 
  11.104  echo packet is sent at 2 seconds into the simulation.  If you look at the
  11.105 -second dump (@code{first-1-0.pcap}) you can see that packet being received
  11.106 +second dump (@code{myfirst-1-0.pcap}) you can see that packet being received
  11.107  at 2.257324 seconds.  You see the packet being echoed back at 2.257324 seconds
  11.108  in the second dump, and finally, you see the packet being received back at 
  11.109  the client in the first dump at 2.514648 seconds.
    12.1 --- a/src/contrib/wscript	Fri Jun 12 10:31:19 2009 +0100
    12.2 +++ b/src/contrib/wscript	Wed Jun 17 12:07:25 2009 +0100
    12.3 @@ -16,7 +16,7 @@
    12.4                                   "library 'libxml-2.0 >= 2.7' not found")
    12.5      conf.sub_config('stats')
    12.6  
    12.7 -    conf.write_config_header('ns3/contrib-config.h', project_root_relative=True)
    12.8 +    conf.write_config_header('ns3/contrib-config.h', top=True)
    12.9  
   12.10  def build(bld):
   12.11      module = bld.create_ns3_module('contrib', ['simulator', 'common'])
    13.1 --- a/src/core/test.cc	Fri Jun 12 10:31:19 2009 +0100
    13.2 +++ b/src/core/test.cc	Wed Jun 17 12:07:25 2009 +0100
    13.3 @@ -55,6 +55,18 @@
    13.4  {
    13.5    Get ()->m_verbose = true;
    13.6  }
    13.7 +
    13.8 +void
    13.9 +TestManager::PrintTestNames (std::ostream &os)
   13.10 +{
   13.11 +  for (TestsCI i = Get ()->m_tests.begin (); i != Get ()->m_tests.end (); i++) 
   13.12 +    {
   13.13 +      std::string *testName = (*i).second;
   13.14 +      os << *testName << std::endl;
   13.15 +    }
   13.16 +}
   13.17 +
   13.18 +
   13.19  std::ostream &
   13.20  TestManager::Failure (void)
   13.21  {
   13.22 @@ -95,6 +107,47 @@
   13.23    return isSuccess;
   13.24  }
   13.25  
   13.26 +bool 
   13.27 +TestManager::RunTest (std::string name)
   13.28 +{
   13.29 +  return Get ()->RealRunTest (name);
   13.30 +}
   13.31 +bool 
   13.32 +TestManager::RealRunTest (std::string name)
   13.33 +{
   13.34 +  TestsCI i;
   13.35 +  
   13.36 +  for (i = m_tests.begin (); i != m_tests.end (); i++) 
   13.37 +    {
   13.38 +      std::string *testName = (*i).second;
   13.39 +      if (*testName == name) 
   13.40 +        {
   13.41 +          break;
   13.42 +        }
   13.43 +    }
   13.44 +  if (i == m_tests.end ())
   13.45 +    {
   13.46 +      std::cerr << "Test with name " << name << " not found." << std::endl;
   13.47 +    }
   13.48 +  
   13.49 +  if (!(*i).first->RunTests ()) 
   13.50 +    {
   13.51 +      if (m_verbose) 
   13.52 +        {
   13.53 +          std::cerr << "FAIL " << name << std::endl;
   13.54 +        }
   13.55 +      return false;
   13.56 +    } 
   13.57 +  else 
   13.58 +    {
   13.59 +      if (m_verbose) 
   13.60 +        {
   13.61 +          std::cerr << "PASS "<< name << std::endl;
   13.62 +        }
   13.63 +      return true;
   13.64 +    }
   13.65 +}
   13.66 +
   13.67  Test::Test (char const *name)
   13.68  {
   13.69    TestManager::Add (this, name);
    14.1 --- a/src/core/test.h	Fri Jun 12 10:31:19 2009 +0100
    14.2 +++ b/src/core/test.h	Wed Jun 17 12:07:25 2009 +0100
    14.3 @@ -89,12 +89,17 @@
    14.4     */
    14.5    static bool RunTests (void);
    14.6  
    14.7 +  static bool RunTest (std::string name);
    14.8 +
    14.9 +  static void PrintTestNames (std::ostream &os);
   14.10 +
   14.11  private:
   14.12    friend class Test;
   14.13    static void Add (Test *test, char const *name);
   14.14    static std::ostream &Failure (void);
   14.15    static TestManager *Get (void);
   14.16    bool RealRunTests (void);
   14.17 +  bool RealRunTest (std::string name);
   14.18  
   14.19    TestManager ();
   14.20    ~TestManager ();
    15.1 --- a/src/core/wscript	Fri Jun 12 10:31:19 2009 +0100
    15.2 +++ b/src/core/wscript	Wed Jun 17 12:07:25 2009 +0100
    15.3 @@ -41,7 +41,7 @@
    15.4                                   conf.env['ENABLE_THREADING'],
    15.5                                   "<pthread.h> include not detected")
    15.6  
    15.7 -    conf.write_config_header('ns3/core-config.h', project_root_relative=True)
    15.8 +    conf.write_config_header('ns3/core-config.h', top=True)
    15.9  
   15.10  def build(bld):
   15.11      core = bld.create_ns3_module('core')
    16.1 --- a/src/simulator/wscript	Fri Jun 12 10:31:19 2009 +0100
    16.2 +++ b/src/simulator/wscript	Wed Jun 17 12:07:25 2009 +0100
    16.3 @@ -31,7 +31,7 @@
    16.4  
    16.5      conf.check(header_name='sys/inttypes.h', define_name='HAVE_SYS_INT_TYPES_H')
    16.6  
    16.7 -    conf.write_config_header('ns3/simulator-config.h', project_root_relative=True)
    16.8 +    conf.write_config_header('ns3/simulator-config.h', top=True)
    16.9  
   16.10      if not conf.check(lib='rt', uselib='RT', define_name='HAVE_RT'):
   16.11          conf.report_optional_feature("RealTime", "Real Time Simulator",
    17.1 --- a/utils/run-tests.cc	Fri Jun 12 10:31:19 2009 +0100
    17.2 +++ b/utils/run-tests.cc	Wed Jun 17 12:07:25 2009 +0100
    17.3 @@ -25,13 +25,42 @@
    17.4  
    17.5  int main (int argc, char *argv[])
    17.6  {
    17.7 +  if (argc > 1)
    17.8 +    {
    17.9 +      if (std::string (argv[1]) == "--ListTests")
   17.10 +        {
   17.11  #ifdef RUN_SELF_TESTS
   17.12 -  ns3::PacketMetadata::Enable ();
   17.13 -  ns3::TestManager::EnableVerbose ();
   17.14 -  bool success = ns3::TestManager::RunTests ();
   17.15 -  if (!success)
   17.16 -    return 1;
   17.17 +          ns3::TestManager::PrintTestNames (std::cout);
   17.18 +#endif
   17.19 +        }
   17.20 +      else
   17.21 +        {
   17.22 +          // run the test named by argv[1]
   17.23 +#ifdef RUN_SELF_TESTS
   17.24 +          bool success = ns3::TestManager::RunTest (argv[1]);
   17.25 +          if (!success)
   17.26 +            {
   17.27 +              return 1;
   17.28 +            }
   17.29 +#else
   17.30 +          std::cerr << "Unit tests not enabled" << std::endl;
   17.31 +          return 1;
   17.32 +#endif
   17.33 +        }      
   17.34 +    }
   17.35 +  else
   17.36 +    {
   17.37 +      // run all tests
   17.38 +#ifdef RUN_SELF_TESTS
   17.39 +      ns3::PacketMetadata::Enable ();
   17.40 +      ns3::TestManager::EnableVerbose ();
   17.41 +      bool success = ns3::TestManager::RunTests ();
   17.42 +      if (!success)
   17.43 +        {
   17.44 +          return 1;
   17.45 +        }
   17.46  #endif /* RUN_SELF_TESTS */
   17.47 -
   17.48 +    }
   17.49    return 0;
   17.50  }
   17.51 +
    18.1 Binary file waf has changed
    19.1 --- a/wscript	Fri Jun 12 10:31:19 2009 +0100
    19.2 +++ b/wscript	Wed Jun 17 12:07:25 2009 +0100
    19.3 @@ -146,6 +146,9 @@
    19.4      opt.add_option('--regression',
    19.5                     help=("Enable regression testing; only used for the 'check' target"),
    19.6                     default=False, dest='regression', action="store_true")
    19.7 +    opt.add_option('--check',
    19.8 +                   help=("Enable unit testing"),
    19.9 +                   default=False, dest='check', action="store_true")
   19.10      opt.add_option('--regression-generate',
   19.11                     help=("Generate new regression test traces."),
   19.12                     default=False, dest='regression_generate', action="store_true")
   19.13 @@ -495,6 +498,8 @@
   19.14          lib.target = 'ns3'
   19.15          if lib.env['CXX_NAME'] == 'gcc' and env['WL_SONAME_SUPPORTED']:
   19.16              lib.env.append_value('LINKFLAGS', '-Wl,--soname=%s' % ccroot.get_target_name(lib))
   19.17 +        if sys.platform == 'cygwin':
   19.18 +            lib.features.append('implib') # workaround for WAF bug #472
   19.19  
   19.20      if env['NS3_ENABLED_MODULES']:
   19.21          lib.add_objects = list(modules)
   19.22 @@ -523,6 +528,8 @@
   19.23                                   " (--with-regression-traces configure option)")
   19.24          regression.run_regression(bld, regression_traces)
   19.25  
   19.26 +    if Options.options.check:
   19.27 +        _run_check(bld)
   19.28  
   19.29  
   19.30  def shutdown(ctx):
   19.31 @@ -561,35 +568,163 @@
   19.32  
   19.33  check_context = Build.BuildContext
   19.34  def check(bld):
   19.35 -    "run the NS-3 unit tests"
   19.36 -    Scripting.build(bld)
   19.37 -    ## generate the trace sources list docs
   19.38 -    env = wutils.bld.env
   19.39 -    proc_env = wutils.get_proc_env()
   19.40 -    try:
   19.41 -        program_obj = wutils.find_program('print-introspected-doxygen', env)
   19.42 -    except ValueError: # could happen if print-introspected-doxygen is
   19.43 -                       # not built because of waf configure
   19.44 -                       # --enable-modules=xxx
   19.45 -        pass
   19.46 -    else:
   19.47 -        prog = program_obj.path.find_or_declare(ccroot.get_target_name(program_obj)).abspath(env)
   19.48 -        out = open(os.path.join('doc', 'introspected-doxygen.h'), 'w')
   19.49 -        if subprocess.Popen([prog], stdout=out, env=proc_env).wait():
   19.50 -            raise SystemExit(1)
   19.51 -        out.close()
   19.52 +    """run the NS-3 unit tests (deprecated in favour of --check option)"""
   19.53 +    raise Utils.WafError("Please run `./waf --check' instead.")
   19.54  
   19.55 -    print "-- Running NS-3 C++ core unit tests..."
   19.56 -    wutils.run_program('run-tests', env, wutils.get_command_template(env))
   19.57  
   19.58 -    if env['ENABLE_PYTHON_BINDINGS']:
   19.59 -        print "-- Running NS-3 Python bindings unit tests..."
   19.60 -        wutils.run_argv([env['PYTHON'], os.path.join("utils", "python-unit-tests.py")],
   19.61 -                        env, proc_env, force_no_valgrind=True)
   19.62 -    else:
   19.63 -        print "-- Skipping NS-3 Python bindings unit tests: Python bindings not enabled."
   19.64 +class print_introspected_doxygen_task(Task.TaskBase):
   19.65 +    after = 'cc cxx cc_link cxx_link'
   19.66 +    color = 'BLUE'
   19.67  
   19.68 +    def __init__(self, bld):
   19.69 +        self.bld = bld
   19.70 +        super(print_introspected_doxygen_task, self).__init__(generator=self)
   19.71 +        
   19.72 +    def __str__(self):
   19.73 +        return 'print-introspected-doxygen\n'
   19.74  
   19.75 +    def runnable_status(self):
   19.76 +        return Task.RUN_ME
   19.77 +
   19.78 +    def run(self):
   19.79 +        ## generate the trace sources list docs
   19.80 +        env = wutils.bld.env
   19.81 +        proc_env = wutils.get_proc_env()
   19.82 +        try:
   19.83 +            program_obj = wutils.find_program('print-introspected-doxygen', env)
   19.84 +        except ValueError: # could happen if print-introspected-doxygen is
   19.85 +                           # not built because of waf configure
   19.86 +                           # --enable-modules=xxx
   19.87 +            pass
   19.88 +        else:
   19.89 +            prog = program_obj.path.find_or_declare(ccroot.get_target_name(program_obj)).abspath(env)
   19.90 +            out = open(os.path.join('..', 'doc', 'introspected-doxygen.h'), 'w')
   19.91 +            if subprocess.Popen([prog], stdout=out, env=proc_env).wait():
   19.92 +                raise SystemExit(1)
   19.93 +            out.close()
   19.94 +
   19.95 +class run_python_unit_tests_task(Task.TaskBase):
   19.96 +    after = 'cc cxx cc_link cxx_link'
   19.97 +    color = 'BLUE'
   19.98 +
   19.99 +    def __init__(self, bld):
  19.100 +        self.bld = bld
  19.101 +        super(run_python_unit_tests_task, self).__init__(generator=self)
  19.102 +        
  19.103 +    def __str__(self):
  19.104 +        return 'run-python-unit-tests\n'
  19.105 +
  19.106 +    def runnable_status(self):
  19.107 +        return Task.RUN_ME
  19.108 +
  19.109 +    def run(self):
  19.110 +        proc_env = wutils.get_proc_env()
  19.111 +        wutils.run_argv([self.bld.env['PYTHON'], os.path.join("..", "utils", "python-unit-tests.py")],
  19.112 +                        self.bld.env, proc_env, force_no_valgrind=True)
  19.113 +
  19.114 +
  19.115 +class run_a_unit_test_task(Task.TaskBase):
  19.116 +    after = 'cc cxx cc_link cxx_link'
  19.117 +    color = 'BLUE'
  19.118 +
  19.119 +    def __init__(self, bld, name_of_test):
  19.120 +        self.bld = bld
  19.121 +        super(run_a_unit_test_task, self).__init__(generator=self)
  19.122 +        self.name_of_test = name_of_test
  19.123 +        try:
  19.124 +            program_obj = wutils.find_program("run-tests", self.bld.env)
  19.125 +        except ValueError, ex:
  19.126 +            raise Utils.WafError(str(ex))
  19.127 +        program_node = program_obj.path.find_or_declare(ccroot.get_target_name(program_obj))
  19.128 +        self.program_path = program_node.abspath(self.bld.env)
  19.129 +
  19.130 +    def __str__(self):
  19.131 +        return 'run-unit-test(%s)\n' % self.name_of_test
  19.132 +
  19.133 +    def runnable_status(self):
  19.134 +        return Task.RUN_ME
  19.135 +
  19.136 +    def run(self):
  19.137 +        #print repr([self.program_path, self.name_of_test])
  19.138 +        try:
  19.139 +            self.retval = wutils.run_argv([self.program_path, self.name_of_test], self.bld.env)
  19.140 +        except Utils.WafError:
  19.141 +            self.retval = 1
  19.142 +        #print "running test %s: exit with %i" % (self.name_of_test, retval)
  19.143 +        return 0
  19.144 +
  19.145 +class get_list_of_unit_tests_task(Task.TaskBase):
  19.146 +    after = 'cc cxx cc_link cxx_link'
  19.147 +    color = 'BLUE'
  19.148 +
  19.149 +    def __init__(self, bld):
  19.150 +        self.bld = bld
  19.151 +        super(get_list_of_unit_tests_task, self).__init__(generator=self)
  19.152 +        self.tests = []
  19.153 +
  19.154 +    def __str__(self):
  19.155 +        return 'get-unit-tests-list\n'
  19.156 +
  19.157 +    def runnable_status(self):
  19.158 +        return Task.RUN_ME
  19.159 +
  19.160 +    def run(self):
  19.161 +        try:
  19.162 +            program_obj = wutils.find_program("run-tests", self.bld.env)
  19.163 +        except ValueError, ex:
  19.164 +            raise Utils.WafError(str(ex))
  19.165 +        program_node = program_obj.path.find_or_declare(ccroot.get_target_name(program_obj))
  19.166 +        program_path = program_node.abspath(self.bld.env)
  19.167 +        proc = subprocess.Popen([program_path, "--ListTests"], stdout=subprocess.PIPE,
  19.168 +                                env=wutils.get_proc_env())
  19.169 +        self.tests = [l.rstrip() for l in proc.stdout.readlines()]
  19.170 +        retval = proc.wait()
  19.171 +        if retval:
  19.172 +            return retval
  19.173 +        test_tasks = []
  19.174 +        for name_of_test in self.tests:
  19.175 +            test_tasks.append(run_a_unit_test_task(self.bld, name_of_test))
  19.176 +        collector = collect_unit_test_results_task(self.bld, list(test_tasks))
  19.177 +        collector.run_after = list(test_tasks)
  19.178 +        self.more_tasks = [collector] + test_tasks
  19.179 +        
  19.180 +
  19.181 +class collect_unit_test_results_task(Task.TaskBase):
  19.182 +    after = 'run_a_unit_test_task'
  19.183 +    color = 'BLUE'
  19.184 +
  19.185 +    def __init__(self, bld, test_tasks):
  19.186 +        self.bld = bld
  19.187 +        super(collect_unit_test_results_task, self).__init__(generator=self)
  19.188 +        self.test_tasks = test_tasks
  19.189 +
  19.190 +    def __str__(self):
  19.191 +        return 'collect-unit-tests-results\n'
  19.192 +
  19.193 +    def runnable_status(self):
  19.194 +        for t in self.run_after:
  19.195 +            if not t.hasrun:
  19.196 +                return Task.ASK_LATER
  19.197 +        return Task.RUN_ME
  19.198 +
  19.199 +    def run(self):
  19.200 +        failed = 0
  19.201 +        for task in self.test_tasks:
  19.202 +            if task.retval:
  19.203 +                failed += 1
  19.204 +        if failed:
  19.205 +            print "C++ UNIT TESTS: %i tests passed, %i failed." % (len(self.test_tasks) - failed, failed)
  19.206 +            return 1
  19.207 +        else:
  19.208 +            print "C++ UNIT TESTS: all %i tests passed." % (len(self.test_tasks),)
  19.209 +            return 0
  19.210 +
  19.211 +
  19.212 +def _run_check(bld):
  19.213 +    task = get_list_of_unit_tests_task(bld)
  19.214 +    print_introspected_doxygen_task(bld)
  19.215 +    if bld.env['ENABLE_PYTHON_BINDINGS']:
  19.216 +        run_python_unit_tests_task(bld)
  19.217  
  19.218  
  19.219  def check_shell(bld):