Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Imported Upstream version 2.35~RC6

  • Loading branch information...
commit 719bcba193847a6cb70e7b1e9825e38babcf82d0 0 parents
@wzssyqa wzssyqa authored
Showing with 44,059 additions and 0 deletions.
  1. +23 −0 .cvsignore
  2. +1 −0  BASE-VERSION
  3. +6,869 −0 CHANGES.html
  4. +42 −0 COPYRIGHTS
  5. +3,346 −0 FILES
  6. +37 −0 HOWTO-CONTRIBUTE
  7. +81 −0 INSTALL.WIN32
  8. +68 −0 LICENSES
  9. +622 −0 Makefile.in
  10. +44 −0 README
  11. +513 −0 TODO.html
  12. +1 −0  VERSION
  13. +103 −0 adc/acto-adc.cc
  14. +119 −0 adc/actp-adc.cc
  15. +80 −0 adc/adaptive-receiver.cc
  16. +62 −0 adc/adaptive-receiver.h
  17. +115 −0 adc/adc.cc
  18. +78 −0 adc/adc.h
  19. +101 −0 adc/consrcvr.cc
  20. +164 −0 adc/estimator.cc
  21. +95 −0 adc/estimator.h
  22. +74 −0 adc/expavg-est.cc
  23. +114 −0 adc/hb-adc.cc
  24. +113 −0 adc/ms-adc.cc
  25. +76 −0 adc/null-estimator.cc
  26. +142 −0 adc/param-adc.cc
  27. +72 −0 adc/pointsample-est.cc
  28. +59 −0 adc/resv.cc
  29. +74 −0 adc/resv.h
  30. +299 −0 adc/sa.cc
  31. +93 −0 adc/sa.h
  32. +239 −0 adc/salink.cc
  33. +75 −0 adc/salink.h
  34. +148 −0 adc/simple-intserv-sched.cc
  35. +166 −0 adc/tbf.cc
  36. +78 −0 adc/tbf.h
  37. +89 −0 adc/timewindow-est.cc
  38. +46 −0 adc/ump.cc
  39. +57 −0 adc/ump.h
  40. +9 −0 allinone/INSTALL.WIN32
  41. +57 −0 allinone/README
  42. +702 −0 allinone/install
  43. +1,391 −0 aodv/aodv.cc
  44. +329 −0 aodv/aodv.h
  45. +106 −0 aodv/aodv_logs.cc
  46. +179 −0 aodv/aodv_packet.h
  47. +261 −0 aodv/aodv_rqueue.cc
  48. +92 −0 aodv/aodv_rqueue.h
  49. +212 −0 aodv/aodv_rtable.cc
  50. +161 −0 aodv/aodv_rtable.h
  51. +1,857 −0 aomdv/aomdv.cc
  52. +479 −0 aomdv/aomdv.h
  53. +157 −0 aomdv/aomdv_logs.cc
  54. +243 −0 aomdv/aomdv_packet.h
  55. +313 −0 aomdv/aomdv_rqueue.cc
  56. +144 −0 aomdv/aomdv_rqueue.h
  57. +535 −0 aomdv/aomdv_rtable.cc
  58. +284 −0 aomdv/aomdv_rtable.h
  59. +130 −0 apps/app.cc
  60. +65 −0 apps/app.h
  61. +41 −0 apps/bitops.h
  62. +254 −0 apps/pbc.cc
  63. +116 −0 apps/pbc.h
  64. +213 −0 apps/ping.cc
  65. +94 −0 apps/ping.h
  66. +232 −0 apps/rtp.cc
  67. +142 −0 apps/rtp.h
  68. +110 −0 apps/sctp_app1.cc
  69. +80 −0 apps/sctp_app1.h
  70. +94 −0 apps/telnet.cc
  71. +70 −0 apps/telnet.h
  72. +170 −0 apps/udp.cc
  73. +70 −0 apps/udp.h
  74. +40 −0 apps/vat.h
  75. +290 −0 apps/vatrcvr.cc
  76. +365 −0 apps/worm.cc
  77. +121 −0 apps/worm.h
  78. +1,020 −0 asim/asim.cc
  79. +121 −0 asim/asim.h
  80. +751 −0 asim/asimstd.cc
  81. +92 −0 autoconf-win32.h
  82. +97 −0 autoconf.h.in
  83. +81 −0 baytcp/ftp.h
  84. +136 −0 baytcp/ftpc.cc
  85. +102 −0 baytcp/ftps.cc
  86. +1,404 −0 baytcp/tcp-full-bay.cc
  87. +255 −0 baytcp/tcp-full-bay.h
  88. +256 −0 bin/NS/TraceFileEvent.pm
  89. +78 −0 bin/NS/TraceFileReader.pm
  90. +71 −0 bin/NS/TraceFileWriter.pm
  91. +72 −0 bin/check-diff.pl
  92. +369 −0 bin/color-event.pl
  93. +121 −0 bin/cplot.tcl
  94. +44 −0 bin/dynamics.pl
  95. +40 −0 bin/gen-files
  96. +105 −0 bin/gen-vcmake.pl
  97. +65 −0 bin/getrc
  98. +92 −0 bin/gnuplot.pl
  99. +165 −0 bin/ktest-all
  100. +37 −0 bin/nam2ns.pl
  101. +18 −0 bin/ns2nam.pl
  102. +31 −0 bin/ns2oldns.pl
  103. +38 −0 bin/oldns2ns.pl
  104. +130 −0 bin/raw2gp
  105. +279 −0 bin/raw2xg
  106. +271 −0 bin/raw2xg-sctp
  107. +26 −0 bin/rt
  108. +88 −0 bin/set_flow_id
  109. +6 −0 bin/string2c.tcl
  110. +76 −0 bin/tcl-expand.tcl
  111. +61 −0 bin/tcpf2xgr
  112. +275 −0 bin/tcpfull-summarize.tcl
  113. +126 −0 bin/trsplit
  114. +67 −0 bin/xgraph.pl
  115. +5 −0 bitmap/ff.xbm
  116. +5 −0 bitmap/play.xbm
  117. +5 −0 bitmap/rewind.xbm
  118. +5 −0 bitmap/stop.xbm
  119. +149 −0 classifier/classifier-addr.cc
  120. +67 −0 classifier/classifier-addr.h
  121. +308 −0 classifier/classifier-bst.cc
  122. +223 −0 classifier/classifier-hash.cc
  123. +183 −0 classifier/classifier-hash.h
  124. +121 −0 classifier/classifier-hier.cc
  125. +76 −0 classifier/classifier-hier.h
  126. +87 −0 classifier/classifier-mac.cc
  127. +271 −0 classifier/classifier-mcast.cc
  128. +95 −0 classifier/classifier-mcast.h
  129. +76 −0 classifier/classifier-mpath.cc
  130. +110 −0 classifier/classifier-port.cc
  131. +78 −0 classifier/classifier-port.h
  132. +79 −0 classifier/classifier-qs.cc
  133. +72 −0 classifier/classifier-qs.h
  134. +134 −0 classifier/classifier-virtual.cc
  135. +293 −0 classifier/classifier.cc
  136. +92 −0 classifier/classifier.h
  137. +188 −0 classifier/filter.cc
  138. +97 −0 classifier/filter.h
  139. +84 −0 common/Decapsulator.cc
  140. +55 −0 common/Decapsulator.h
  141. +112 −0 common/Encapsulator.cc
  142. +65 −0 common/Encapsulator.h
  143. +539 −0 common/agent.cc
  144. +156 −0 common/agent.h
  145. +150 −0 common/bi-connector.cc
  146. +74 −0 common/bi-connector.h
  147. +120 −0 common/connector.cc
  148. +62 −0 common/connector.h
  149. +8 −0 common/doc-hdr.html
  150. +49 −0 common/encap.cc
  151. +56 −0 common/encap.h
  152. +91 −0 common/flags.h
  153. +2,374 −0 common/fsm.cc
  154. +157 −0 common/fsm.h
  155. +181 −0 common/heap.h
  156. +59 −0 common/ip.cc
  157. +92 −0 common/ip.h
  158. +480 −0 common/ivs.cc
  159. +69 −0 common/location.h
  160. +79 −0 common/main-modular.cc
  161. +47 −0 common/main-monolithic.cc
  162. +110 −0 common/message.cc
  163. +56 −0 common/message.h
  164. +176 −0 common/messpass.cc
  165. +33 −0 common/messpass.h
  166. +241 −0 common/misc.cc
  167. +608 −0 common/mobilenode.cc
  168. +255 −0 common/mobilenode.h
  169. +90 −0 common/net-interface.cc
  170. +80 −0 common/net-interface.h
  171. +324 −0 common/node.cc
  172. +202 −0 common/node.h
  173. +98 −0 common/ns-process.cc
  174. +137 −0 common/ns-process.h
  175. +109 −0 common/object.cc
  176. +69 −0 common/object.h
  177. +65 −0 common/packet-stamp.h
  178. +161 −0 common/packet.cc
  179. +845 −0 common/packet.h
  180. +140 −0 common/parentnode.cc
  181. +120 −0 common/parentnode.h
  182. +94 −0 common/pkt-counter.cc
  183. +93 −0 common/ptypes2tcl.cc
  184. +123 −0 common/scheduler-map.cc
Sorry, we could not display the entire diff because too many files (3,474) changed.
23 .cvsignore
@@ -0,0 +1,23 @@
+Makefile
+Makefile-*
+makefile.vc
+.depend
+TAGS
+config.cache
+config.log
+config.status
+embedded-tclobj.cc
+embedded-tk.cc
+gen
+ns
+ns-src*.tar.gz
+*.ps
+*.tr
+*.dat
+out*
+*-bw
+*-tcpstat.*
+temp.rands
+autoconf.h
+ptypes2tcl
+.configure
1  BASE-VERSION
@@ -0,0 +1 @@
+2.34
6,869 CHANGES.html
6,869 additions, 0 deletions not shown
42 COPYRIGHTS
@@ -0,0 +1,42 @@
+The source files in NS contain a number of different copyrights and
+software licenses from various individuals and institutions. In 2005,
+the code base was relicensed to a collection of GNU GPL compatible,
+free software licenses. See
+http://www.gnu.org/philosophy/license-list.html
+for a collection of definitions of these terms.
+
+Note: See also the LICENSES file in this directory regarding the
+software licenses..
+
+To find copyright types:
+
+find . -print | xargs grep Copyright | \
+ awk '{print $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12;}' | \
+ sed -e 's/199./XXXX/g' -e 's/200./XXXX/g' | sort | uniq
+
+Copyright holders include:
+- Free Software Foundation,
+- Regents of the University of California,
+- Intel Corporation,
+- Sun Microsystems, Inc.,
+- Xerox Corporation,
+- Gaeil Ahn,
+- Mingzhou Sun,
+- Protocol Engineering Lab, University of Delaware,
+- University of Southern California
+- USC/ISI
+- International Computer Science Institute
+- Nortel Networks
+- Pierre L'Ecuyer,
+- Samsung/CUNY,
+- Tom Kelly, University of Cambridge
+- Trustees of Boston University,
+- John Heidemann,
+- University of Virginia,
+- Samsung Advanced Institute of Technology,
+- Gray Watson,
+- Digital Equipment Corporation,
+- Carnegie Mellon University,
+- University of North Carolina at Chapel Hill
+- StarBurst Communications, Inc.
+
3,346 FILES
3,346 additions, 0 deletions not shown
37 HOWTO-CONTRIBUTE
@@ -0,0 +1,37 @@
+We support two methods to advertise your contributed code for ns:
+
+First, we need the following in order to add a pointer to your
+code in the ns contributed code web page
+(http://mash.cs.berkeley.edu/ns/ns-contributed.html):
+
+(1) which version of ns was the code written for;
+(2) a pointer to C/C++/OTcl code as well as simulation scripts on
+ your web server;
+
+and hopefully also:
+
+(3) a simple README explaining special setups needed to run the
+ simulations or tests.
+(4) an example script illustrating the use of your protocol.
+
+Second, we're also happy to work with developers to integrate their
+code into the ns distribution. To do this, we need (in addition
+to 1-4 above):
+
+(5) code which works with the most recently released version of ns
+(6) a test script exercising most important points of your protocol
+ (see the sample tests in tcl/test of the ns directory)
+(7) documentation comparable to the Agent/SRM chapter of ``ns notes
+ and documentation''
+
+(We realize that 5-7 are more work than simply 1-4. Without a test
+suite we cannot insure that your code will work in future ns releases;
+without documentation your code won't be very useful to others. The
+advantage is that with these it will be much easier for other
+researchers to build on your hard work.)
+
+Please send your pointers to the ns-users mailing list
+(ns-users@mash.cs.berkeley.edu). Suggestions and
+comments are also welcome.
+
+- The ns Team
81 INSTALL.WIN32
@@ -0,0 +1,81 @@
+Neither ns-2 nor nam-1 is developed on (nor for) the win32
+platform. We can only guarantee that they compile on windows, but not
+their correct functioning. If you have anything to contribute in this
+respect, we would like to hear from you.
+
+Before you build, notice that you can get nam and ns binaries for
+windows at http://www.isi.edu/nsnam/dist/binary/. If you only want to
+do tcl scripting in ns, they were probably what you want.
+
+Procedures to compile on windows. For more information, whose details
+about ns might be obsolete but others apply, see
+http://www.isi.edu/nsnam/ns/ns-win32-build.html
+
+- Make sure your msvc works (and your environment variables are setup
+ correctly)
+
+- Get Cygwin and perl
+
+- IMPORTANT: otcl/tclcl/ns can be built and work with supplied tcl/tk
+ 8.3.2, but nam will not (it builds, but does not run). To solve this
+ problem one has to use a hacked tcl/tk 8.0p2 that supports static
+ lib instead of DLLs. See the following discussion in nam for
+ detail. For this reason, there is a switch in otcl/makefile.vc and
+ conf/makefile.win in tclcl/ns/nam that controls using static build
+ or DLLs. It is a macro STATIC_LIB, which is turned on by
+ default. You must download the hacked tcl/tk 8.0p2 to compile the
+ default ns-allinone on windows. Alternatively, if you do not use nam
+ at all, comment that macro and you'll be able to compile with tcl/tk
+ 8.3.2
+
+ NOTE: none of the indep-utils/ are tested (nor known to be compiled)
+ on windows. If you did, please submit a patch/report to ns-users
+ mailing list (ns-users@isi.edu). Thank you.
+
+- After compilation, you should do (1) copy the DLLs (if you are using
+ tcl/tk 8.3.2) to one of yours paths (you can see it in the system
+ applet from your control panel, or autoexec.bat if you are using
+ win98/95, or you can open a tcsh (dos prompt) and do echo $PATH
+ (%PATH%)); (2) copy the tcl library files (~tcl/library) to one of
+ the default paths (somehow setenv TCL_LIBRARY did not work for me on
+ windows, but you can certainly try). If you don't know the default
+ paths, run ns and you'll see it in its complaints.
+
+ IMPORTANT: you should avoid both these two steps if you are using
+ the hacked tcl/tk 8.0p2.
+
+- Tcl8.3.2
+ - go into win, do nmake -f makefile.vc
+ - result binaries/libraries should be in win/Release
+ - you can also import makefile.vc into you ide and go from there
+
+- Tk8.3.2
+ - pretty much the same as tcl8.3.2
+
+- otcl
+ - correct the paths to your vc, tcl, and tk in makefile.vc, then do
+ nmake -f makefile.vc
+
+- tclcl
+ - correct the paths to your vc, tcl, tk, and otcl in conf/makefile.win
+ (do NOT touch makefile.vc), then do nmake -f makefile.vc
+
+- ns-2
+ - same as tclcl, except you need to correct paths to tclcl and tclsh as well.
+ - about validate, see
+ http://www.isi.edu/nsnam/ns/ns-win32-build.html for detail. Notice
+ that many test suites will fail on windows platform, and you are
+ on your own to make sure the simulator works for your purpose.
+
+- nam-1
+ - IMPORTANT: nam-1 will NOT work when compiled with tcl8.3.2 and
+ tk8.3.2. It requires that a STATIC build of tcl/tk, which the
+ current release does not support. To solve the problem, you can
+ download a patched tcl/tk 8.0.2 that can be compiled into static
+ libraries (i.e., not DLLs) from this pointer:
+ http://www.isi.edu/nsnam/dist/tcltk/tcl80p2-win32-static.zip and
+ http://www.isi.edu/nsnam/dist/tcltk/tk80p2-win32-static.zip Then
+ you should uncomment the STATIC_LIB macro in
+ ~nam/conf/makefile.win, and correct other paths to your vc, otcl,
+ tclcl, tclsh, then compile.
+
68 LICENSES
@@ -0,0 +1,68 @@
+The source files in NS contain a number of different copyrights and
+software licenses from various individuals and institutions. In 2005,
+the code base was relicensed to a collection of GNU GPL compatible,
+free software licenses. See
+http://www.gnu.org/philosophy/license-list.html
+for a collection of definitions of these terms.
+
+Note: See also the COPYRIGHTS file in this directory regarding the
+copyrights on the ns-2 software.
+
+The majority of software licenses use following types of licenses:
+i) GNU GPL, with specific exception allowing the linking of the GPL
+covered software with other software licensed with clauses in conflict with
+the GPL (see below)
+ii) original Berkeley-style licenses with advertising clauses
+iii) modified Berkeley-style licenses (w/o advertising clause)
+
+Other software licenses (e.g., Apache 2.0) also exist.
+
+If you are considering the contribution of code to ns-2, please pick
+a GNU GPL-compatible software license. If you prefer GNU GPL, please
+add the specific exception text listed below.
+
+If you are considering the use of ns-2, consider that derivative
+works or redistribution may be governed by the terms of the software
+licenses used herein, including the GNU GPL and Berkeley-style
+licenses with advertising clauses.
+
+
+GNU GPL license with specific exception (for use on ns-2 project):
+-------------------------------------------------------------------
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License,
+version 2, as published by the Free Software Foundation.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+
+The copyright of this module includes the following
+linking-with-specific-other-licenses addition:
+
+In addition, as a special exception, the copyright holders of
+this module give you permission to combine (via static or
+dynamic linking) this module with free software programs or
+libraries that are released under the GNU LGPL and with code
+included in the standard release of ns-2 under the Apache 2.0
+license or under otherwise-compatible licenses with advertising
+requirements (or modified versions of such code, with unchanged
+license). You may copy and distribute such a system following the
+terms of the GNU GPL for this module and the licenses of the
+other code concerned, provided that you include the source code of
+that other code when and as the GNU GPL requires distribution of
+source code.
+
+Note that people who make modified versions of this module
+are not obligated to grant this special exception for their
+modified versions; it is their choice whether to do so. The GNU
+General Public License gives permission to release a modified
+version without this exception; this exception also makes it
+possible to release a modified version which carries forward this
+exception.
+
622 Makefile.in
@@ -0,0 +1,622 @@
+# Copyright (c) 1994, 1995, 1996
+# The Regents of the University of California. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that: (1) source code distributions
+# retain the above copyright notice and this paragraph in its entirety, (2)
+# distributions including binary code include the above copyright notice and
+# this paragraph in its entirety in the documentation or other materials
+# provided with the distribution, and (3) all advertising materials mentioning
+# features or use of this software display the following acknowledgement:
+# ``This product includes software developed by the University of California,
+# Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
+# the University nor the names of its contributors may be used to endorse
+# or promote products derived from this software without specific prior
+# written permission.
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+# @(#) $Header: 2002/10/09 15:34:11
+
+#
+# Various configurable paths (remember to edit Makefile.in, not Makefile)
+#
+
+# Top level hierarchy
+prefix = @prefix@
+# Pathname of directory to install the binary
+BINDEST = @prefix@/bin
+# Pathname of directory to install the man page
+MANDEST = @prefix@/man
+
+BLANK = # make a blank space. DO NOT add anything to this line
+
+# The following will be redefined under Windows (see WIN32 lable below)
+CC = @CC@
+CPP = @CXX@
+LINK = $(CPP)
+LINK_SHLIB = @SHLIB_LD@
+MKDEP = ./conf/mkdep
+TCLSH = @V_TCLSH@
+TCL2C = @V_TCL2CPP@
+AR = ar rc $(BLANK)
+
+RANLIB = @V_RANLIB@
+INSTALL = @INSTALL@
+LN = ln
+TEST = test
+RM = rm -f
+MV = mv
+PERL = @PERL@
+
+# for diffusion
+#DIFF_INCLUDES = "./diffusion3/main ./diffusion3/lib ./diffusion3/nr ./diffusion3/ns"
+
+CCOPT = @V_CCOPT@
+STATIC = @V_STATIC@
+#LDFLAGS = $(STATIC)
+LDFLAGS = @LDFLAGS@
+LDOUT = -o $(BLANK)
+
+DEFINE = -DTCP_DELAY_BIND_ALL -DNO_TK @V_DEFINE@ @V_DEFINES@ @DEFS@ -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=@CPP_NAMESPACE@ -DUSE_SINGLE_ADDRESS_SPACE -Drng_test
+
+INCLUDES = \
+ -I. @V_INCLUDE_X11@ \
+ -I. \
+ @V_INCLUDES@ \
+ -I./tcp -I./sctp -I./common -I./link -I./queue \
+ -I./adc -I./apps -I./mac -I./mobile -I./trace \
+ -I./routing -I./tools -I./classifier -I./mcast \
+ -I./diffusion3/lib/main -I./diffusion3/lib \
+ -I./diffusion3/lib/nr -I./diffusion3/ns \
+ -I./diffusion3/filter_core -I./asim/ -I./qs \
+ -I./diffserv -I./satellite \
+ -I./wpan
+
+
+LIB = \
+ @V_LIBS@ \
+ @V_LIB_X11@ \
+ @V_LIB@ \
+ -lm @LIBS@
+# -L@libdir@ \
+
+CFLAGS += $(CCOPT) $(DEFINE)
+
+# Explicitly define compilation rules since SunOS 4's make doesn't like gcc.
+# Also, gcc does not remove the .o before forking 'as', which can be a
+# problem if you don't own the file but can write to the directory.
+.SUFFIXES: .cc # $(.SUFFIXES)
+
+.cc.o:
+ @rm -f $@
+ $(CPP) -c $(CFLAGS) $(INCLUDES) -o $@ $*.cc
+
+.c.o:
+ @rm -f $@
+ $(CC) -c $(CFLAGS) $(INCLUDES) -o $@ $*.c
+
+
+GEN_DIR = gen/
+LIB_DIR = lib/
+NS = ns
+NSLIB = @NSLIB@
+NSX = nsx
+NSE = nse
+NSTK = nstk
+
+# To allow conf/makefile.win overwrite this macro
+# We will set these two macros to empty in conf/makefile.win since VC6.0
+# does not seem to support the STL in gcc 2.8 and up.
+OBJ_STL = diffusion3/lib/nr/nr.o diffusion3/lib/dr.o \
+ diffusion3/filters/diffusion/one_phase_pull.o \
+ diffusion3/filters/diffusion/two_phase_pull.o \
+ diffusion3/lib/diffapp.o \
+ diffusion3/ns/diffagent.o diffusion3/ns/diffrtg.o \
+ diffusion3/ns/difftimer.o \
+ diffusion3/filter_core/filter_core.o \
+ diffusion3/filter_core/iolog.o \
+ diffusion3/filter_core/iostats.o \
+ diffusion3/lib/main/attrs.o \
+ diffusion3/lib/main/events.o \
+ diffusion3/lib/main/iodev.o \
+ diffusion3/lib/main/iohook.o \
+ diffusion3/lib/main/timers.o \
+ diffusion3/lib/main/message.o \
+ diffusion3/lib/main/tools.o \
+ diffusion3/apps/gear_examples/gear_common.o \
+ diffusion3/apps/gear_examples/gear_receiver.o \
+ diffusion3/apps/gear_examples/gear_sender.o \
+ diffusion3/apps/rmst_examples/rmst_sink.o \
+ diffusion3/apps/rmst_examples/rmst_source.o \
+ diffusion3/apps/ping/1pp_ping_sender.o \
+ diffusion3/apps/ping/1pp_ping_receiver.o \
+ diffusion3/apps/ping/2pp_ping_sender.o \
+ diffusion3/apps/ping/2pp_ping_receiver.o \
+ diffusion3/apps/ping/ping_common.o \
+ diffusion3/apps/ping/push_receiver.o \
+ diffusion3/apps/ping/push_sender.o \
+ diffusion3/filters/gear/gear_attr.o \
+ diffusion3/filters/gear/gear.o \
+ diffusion3/filters/gear/gear_tools.o \
+ diffusion3/filters/misc/log.o \
+ diffusion3/filters/misc/srcrt.o \
+ diffusion3/filters/misc/tag.o \
+ diffusion3/filters/rmst/rmst.o \
+ diffusion3/filters/rmst/rmst_filter.o \
+ delaybox/delaybox.o \
+ packmime/packmime_HTTP.o packmime/packmime_HTTP_rng.o \
+ packmime/packmime_OL.o packmime/packmime_OL_ranvar.o\
+ packmime/packmime_ranvar.o \
+ tmix/tmix.o tmix/tmixAgent.o tmix/tmix_delaybox.o
+
+NS_TCL_LIB_STL = tcl/lib/ns-diffusion.tcl \
+ tcl/delaybox/delaybox.tcl \
+ tcl/packmime/packmime.tcl \
+ tcl/tmix/tmix.tcl \
+ tcl/tmix/tmix_delaybox.tcl
+
+
+# WIN32: uncomment the following line to include specific make for VC++
+# !include <conf/makefile.win>
+
+OBJ_CC = \
+ tools/random.o tools/rng.o tools/ranvar.o common/misc.o common/timer-handler.o \
+ common/scheduler.o common/object.o common/packet.o \
+ common/ip.o routing/route.o common/connector.o common/ttl.o \
+ trace/trace.o trace/trace-ip.o \
+ classifier/classifier.o classifier/classifier-addr.o \
+ classifier/classifier-hash.o \
+ classifier/classifier-virtual.o \
+ classifier/classifier-mcast.o \
+ classifier/classifier-bst.o \
+ classifier/classifier-mpath.o mcast/replicator.o \
+ classifier/classifier-mac.o \
+ classifier/classifier-qs.o \
+ classifier/classifier-port.o src_rtg/classifier-sr.o \
+ src_rtg/sragent.o src_rtg/hdr_src.o adc/ump.o \
+ qs/qsagent.o qs/hdr_qs.o \
+ apps/app.o apps/telnet.o tcp/tcplib-telnet.o \
+ tools/trafgen.o trace/traffictrace.o tools/pareto.o \
+ tools/expoo.o tools/cbr_traffic.o \
+ adc/tbf.o adc/resv.o adc/sa.o tcp/saack.o \
+ tools/measuremod.o adc/estimator.o adc/adc.o adc/ms-adc.o \
+ adc/timewindow-est.o adc/acto-adc.o \
+ adc/pointsample-est.o adc/salink.o adc/actp-adc.o \
+ adc/hb-adc.o adc/expavg-est.o\
+ adc/param-adc.o adc/null-estimator.o \
+ adc/adaptive-receiver.o apps/vatrcvr.o adc/consrcvr.o \
+ common/agent.o common/message.o apps/udp.o \
+ common/session-rtp.o apps/rtp.o tcp/rtcp.o \
+ common/ivs.o \
+ common/messpass.o common/tp.o common/tpm.o apps/worm.o \
+ tcp/tcp.o tcp/tcp-sink.o tcp/tcp-reno.o \
+ tcp/tcp-newreno.o \
+ tcp/tcp-vegas.o tcp/tcp-rbp.o tcp/tcp-full.o tcp/rq.o \
+ baytcp/tcp-full-bay.o baytcp/ftpc.o baytcp/ftps.o \
+ tcp/scoreboard.o tcp/scoreboard-rq.o tcp/tcp-sack1.o tcp/tcp-fack.o \
+ tcp/scoreboard1.o tcp/tcp-linux.o tcp/linux/ns-linux-util.o \
+ tcp/tcp-asym.o tcp/tcp-asym-sink.o tcp/tcp-fs.o \
+ tcp/tcp-asym-fs.o \
+ tcp/tcp-int.o tcp/chost.o tcp/tcp-session.o \
+ tcp/nilist.o \
+ sctp/sctp.o apps/sctp_app1.o\
+ sctp/sctp-timestamp.o sctp/sctp-hbAfterRto.o \
+ sctp/sctp-multipleFastRtx.o sctp/sctp-mfrHbAfterRto.o \
+ sctp/sctp-mfrTimestamp.o \
+ sctp/sctp-cmt.o \
+ sctp/sctpDebug.o \
+ dccp/dccp_sb.o \
+ dccp/dccp_opt.o \
+ dccp/dccp_ackv.o \
+ dccp/dccp_packets.o \
+ dccp/dccp.o \
+ dccp/dccp_tcplike.o \
+ dccp/dccp_tfrc.o \
+ tools/integrator.o tools/queue-monitor.o \
+ tools/flowmon.o tools/loss-monitor.o \
+ queue/queue.o queue/drop-tail.o \
+ adc/simple-intserv-sched.o queue/red.o \
+ queue/semantic-packetqueue.o queue/semantic-red.o \
+ tcp/ack-recons.o \
+ queue/sfq.o queue/fq.o queue/drr.o queue/srr.o queue/cbq.o \
+ queue/jobs.o queue/marker.o queue/demarker.o \
+ link/hackloss.o queue/errmodel.o queue/fec.o\
+ link/delay.o tcp/snoop.o \
+ gaf/gaf.o \
+ link/dynalink.o routing/rtProtoDV.o common/net-interface.o \
+ mcast/ctrMcast.o mcast/mcast_ctrl.o mcast/srm.o \
+ common/sessionhelper.o queue/delaymodel.o \
+ mcast/srm-ssm.o mcast/srm-topo.o \
+ routing/alloc-address.o routing/address.o \
+ $(LIB_DIR)int.Vec.o $(LIB_DIR)int.RVec.o \
+ $(LIB_DIR)dmalloc_support.o \
+ webcache/http.o webcache/tcp-simple.o webcache/pagepool.o \
+ webcache/inval-agent.o webcache/tcpapp.o webcache/http-aux.o \
+ webcache/mcache.o webcache/webtraf.o \
+ webcache/webserver.o \
+ webcache/logweb.o \
+ empweb/empweb.o \
+ empweb/empftp.o \
+ realaudio/realaudio.o \
+ mac/lanRouter.o classifier/filter.o \
+ common/pkt-counter.o \
+ common/Decapsulator.o common/Encapsulator.o \
+ common/encap.o \
+ mac/channel.o mac/mac.o mac/ll.o mac/mac-802_11.o \
+ mac/mac-802_11Ext.o \
+ mac/mac-802_3.o mac/mac-tdma.o mac/smac.o \
+ mobile/mip.o mobile/mip-reg.o mobile/gridkeeper.o \
+ mobile/propagation.o mobile/tworayground.o \
+ mobile/nakagami.o \
+ mobile/antenna.o mobile/omni-antenna.o \
+ mobile/shadowing.o mobile/shadowing-vis.o mobile/dumb-agent.o \
+ common/bi-connector.o common/node.o \
+ common/mobilenode.o \
+ mac/arp.o mobile/god.o mobile/dem.o \
+ mobile/topography.o mobile/modulation.o \
+ queue/priqueue.o queue/dsr-priqueue.o \
+ mac/phy.o mac/wired-phy.o mac/wireless-phy.o \
+ mac/wireless-phyExt.o \
+ mac/mac-timers.o trace/cmu-trace.o mac/varp.o \
+ mac/mac-simple.o \
+ satellite/sat-hdlc.o \
+ dsdv/dsdv.o dsdv/rtable.o queue/rtqueue.o \
+ routing/rttable.o \
+ imep/imep.o imep/dest_queue.o imep/imep_api.o \
+ imep/imep_rt.o imep/rxmit_queue.o imep/imep_timers.o \
+ imep/imep_util.o imep/imep_io.o \
+ tora/tora.o tora/tora_api.o tora/tora_dest.o \
+ tora/tora_io.o tora/tora_logs.o tora/tora_neighbor.o \
+ dsr/dsragent.o dsr/hdr_sr.o dsr/mobicache.o dsr/path.o \
+ dsr/requesttable.o dsr/routecache.o dsr/add_sr.o \
+ dsr/dsr_proto.o dsr/flowstruct.o dsr/linkcache.o \
+ dsr/simplecache.o dsr/sr_forwarder.o \
+ aodv/aodv_logs.o aodv/aodv.o \
+ aodv/aodv_rtable.o aodv/aodv_rqueue.o \
+ aomdv/aomdv_logs.o aomdv/aomdv.o \
+ aomdv/aomdv_rtable.o aomdv/aomdv_rqueue.o \
+ puma/puma.o \
+ mdart/mdart_adp.o mdart/mdart_dht.o mdart/mdart_ndp.o \
+ mdart/mdart_neighbor.o mdart/mdart_queue.o mdart/mdart_table.o \
+ mdart/mdart.o \
+ common/ns-process.o \
+ satellite/satgeometry.o satellite/sathandoff.o \
+ satellite/satlink.o satellite/satnode.o \
+ satellite/satposition.o satellite/satroute.o \
+ satellite/sattrace.o \
+ rap/raplist.o rap/rap.o rap/media-app.o rap/utilities.o \
+ common/fsm.o tcp/tcp-abs.o \
+ diffusion/diffusion.o diffusion/diff_rate.o diffusion/diff_prob.o \
+ diffusion/diff_sink.o diffusion/flooding.o diffusion/omni_mcast.o \
+ diffusion/hash_table.o diffusion/routing_table.o diffusion/iflist.o \
+ tcp/tfrc.o tcp/tfrc-sink.o mobile/energy-model.o apps/ping.o tcp/tcp-rfc793edu.o \
+ queue/rio.o queue/semantic-rio.o tcp/tcp-sack-rh.o tcp/scoreboard-rh.o \
+ plm/loss-monitor-plm.o plm/cbr-traffic-PP.o \
+ linkstate/hdr-ls.o \
+ mpls/classifier-addr-mpls.o mpls/ldp.o mpls/mpls-module.o \
+ routing/rtmodule.o classifier/classifier-hier.o \
+ routing/addr-params.o \
+ nix/hdr_nv.o nix/classifier-nix.o \
+ nix/nixnode.o \
+ routealgo/rnode.o \
+ routealgo/bfs.o \
+ routealgo/rbitmap.o \
+ routealgo/rlookup.o \
+ routealgo/routealgo.o \
+ nix/nixvec.o \
+ nix/nixroute.o \
+ diffserv/dsred.o diffserv/dsredq.o \
+ diffserv/dsEdge.o diffserv/dsCore.o \
+ diffserv/dsPolicy.o diffserv/ew.o diffserv/dewp.o \
+ queue/red-pd.o queue/pi.o queue/vq.o queue/rem.o \
+ queue/gk.o \
+ pushback/rate-limit.o pushback/rate-limit-strategy.o \
+ pushback/ident-tree.o pushback/agg-spec.o \
+ pushback/logging-data-struct.o \
+ pushback/rate-estimator.o \
+ pushback/pushback-queue.o pushback/pushback.o \
+ common/parentnode.o trace/basetrace.o \
+ common/simulator.o asim/asim.o \
+ common/scheduler-map.o common/splay-scheduler.o \
+ linkstate/ls.o linkstate/rtProtoLS.o \
+ pgm/classifier-pgm.o pgm/pgm-agent.o pgm/pgm-sender.o \
+ pgm/pgm-receiver.o mcast/rcvbuf.o \
+ mcast/classifier-lms.o mcast/lms-agent.o mcast/lms-receiver.o \
+ mcast/lms-sender.o \
+ queue/delayer.o \
+ xcp/xcpq.o xcp/xcp.o xcp/xcp-end-sys.o \
+ wpan/p802_15_4csmaca.o wpan/p802_15_4fail.o \
+ wpan/p802_15_4hlist.o wpan/p802_15_4mac.o \
+ wpan/p802_15_4nam.o wpan/p802_15_4phy.o \
+ wpan/p802_15_4sscs.o wpan/p802_15_4timer.o \
+ wpan/p802_15_4trace.o wpan/p802_15_4transac.o \
+ apps/pbc.o \
+ @V_STLOBJ@
+
+
+# don't allow comments to follow continuation lines
+
+# mac-csma.o mac-multihop.o\
+# sensor-nets/landmark.o mac-simple-wireless.o \
+# sensor-nets/tags.o sensor-nets/sensor-query.o \
+# sensor-nets/flood-agent.o \
+
+# what was here before is now in emulate/
+OBJ_C = \
+ tcp/linux/tcp_naivereno.o\
+ tcp/linux/src/tcp_cong.o\
+ tcp/linux/src/tcp_highspeed.o tcp/linux/src/tcp_bic.o tcp/linux/src/tcp_htcp.o tcp/linux/src/tcp_scalable.o tcp/linux/src/tcp_cubic.o\
+ tcp/linux/src/tcp_westwood.o tcp/linux/src/tcp_vegas.o tcp/linux/src/tcp_hybla.o\
+ tcp/linux/src/tcp_illinois.o tcp/linux/src/tcp_yeah.o \
+ tcp/linux/src/tcp_veno.o tcp/linux/src/tcp_compound.o tcp/linux/src/tcp_lp.o\
+ tcp/linux/ns-linux-c.o tcp/linux/ns-linux-param.o
+
+OBJ_COMPAT = $(OBJ_GETOPT) common/win32.o
+#XXX compat/win32x.o compat/tkConsole.o
+
+OBJ_EMULATE_CC = \
+ emulate/net-ip.o \
+ emulate/net.o \
+ emulate/tap.o \
+ emulate/ether.o \
+ emulate/internet.o \
+ emulate/ping_responder.o \
+ emulate/arp.o \
+ emulate/icmp.o \
+ emulate/net-pcap.o \
+ emulate/nat.o \
+ emulate/iptap.o \
+ emulate/tcptap.o
+
+OBJ_EMULATE_C = \
+ emulate/inet.o
+
+OBJ_GEN = $(GEN_DIR)version.o $(GEN_DIR)ns_tcl.o $(GEN_DIR)ptypes.o
+
+SRC = $(OBJ_C:.o=.c) $(OBJ_CC:.o=.cc) \
+ $(OBJ_EMULATE_C:.o=.c) $(OBJ_EMULATE_CC:.o=.cc) \
+ common/tclAppInit.cc common/tkAppInit.cc
+
+OBJ = $(OBJ_C) $(OBJ_CC) $(OBJ_GEN) $(OBJ_COMPAT)
+
+CLEANFILES = ns nse nsx ns.dyn $(OBJ) $(OBJ_EMULATE_CC) \
+ $(OBJ_EMULATE_C) common/tclAppInit.o \
+ common/tkAppInit.o nstk \
+ $(GEN_DIR)* $(NS).core core core.$(NS) core.$(NSX) core.$(NSE) \
+ common/ptypes2tcl common/ptypes2tcl.o
+
+SUBDIRS=\
+ indep-utils/cmu-scen-gen/setdest \
+ indep-utils/webtrace-conv/dec \
+ indep-utils/webtrace-conv/epa \
+ indep-utils/webtrace-conv/nlanr \
+ indep-utils/webtrace-conv/ucb
+
+BUILD_NSE = @build_nse@
+
+all: $(NS) $(BUILD_NSE) $(NSTK) all-recursive Makefile
+
+
+all-recursive:
+ for i in $(SUBDIRS); do ( cd $$i; $(MAKE) all; ) done
+
+
+
+
+ifeq ($(NSLIB),libns.dll)
+
+# This is for cygwin
+
+NS_CPPFLAGS = -DNSLIBNAME=\"$(NSLIB)\"
+NS_LIBS = @DL_LIBS@
+
+$(NSLIB): $(OBJ) common/tclAppInit.o
+ $(LINK) -shared $(LDFLAGS) \
+ $(LDOUT)$@ \
+ -Wl,--export-all-symbols \
+ -Wl,--enable-auto-import \
+ -Wl,--out-implib=$@.a \
+ -Wl,--whole-archive $^ \
+ -Wl,--no-whole-archive @V_IMPORT_LIBS@
+
+$(NS): $(NSLIB) common/main-modular.cc
+ $(LINK) $(NS_CPPFLAGS) $(LDFLAGS) $(LDOUT)$@ common/main-modular.cc $(NS_LIBS)
+
+else
+
+# default for all systems but cygwin
+
+$(NS): $(OBJ) common/tclAppInit.o common/main-monolithic.o
+ $(LINK) $(LDFLAGS) $(LDOUT)$@ $^ $(LIB)
+
+endif
+
+
+
+Makefile: Makefile.in
+ @echo "Makefile.in is newer than Makefile."
+ @echo "You need to re-run configure."
+ false
+
+$(NSE): $(OBJ) common/tclAppInit.o common/main-monolithic.o $(OBJ_EMULATE_CC) $(OBJ_EMULATE_C)
+ $(LINK) $(LDFLAGS) $(LDOUT)$@ $^ $(LIB)
+
+$(NSTK): $(OBJ) common/tkAppInit.o
+ $(LINK) $(LDFLAGS) $(LDOUT)$@ $^ $(LIB)
+
+ns.dyn: $(OBJ) common/tclAppInit.o common/main-monolithic.o
+ $(LINK) $(LDFLAGS) -o $@ $^ $(LIB)
+
+PURIFY = purify -cache-dir=/tmp
+ns-pure: $(OBJ) common/tclAppInit.o common/main-monolithic.o
+ $(PURIFY) $(LINK) $(LDFLAGS) -o $@ $^ $(LIB)
+
+NS_TCL_LIB = \
+ tcl/lib/ns-compat.tcl \
+ tcl/lib/ns-default.tcl \
+ tcl/lib/ns-errmodel.tcl \
+ tcl/lib/ns-lib.tcl \
+ tcl/lib/ns-link.tcl \
+ tcl/lib/ns-mobilenode.tcl \
+ tcl/lib/ns-sat.tcl \
+ tcl/lib/ns-cmutrace.tcl \
+ tcl/lib/ns-node.tcl \
+ tcl/lib/ns-rtmodule.tcl \
+ tcl/lib/ns-hiernode.tcl \
+ tcl/lib/ns-packet.tcl \
+ tcl/lib/ns-queue.tcl \
+ tcl/lib/ns-source.tcl \
+ tcl/lib/ns-nam.tcl \
+ tcl/lib/ns-trace.tcl \
+ tcl/lib/ns-agent.tcl \
+ tcl/lib/ns-random.tcl \
+ tcl/lib/ns-namsupp.tcl \
+ tcl/lib/ns-address.tcl \
+ tcl/lib/ns-intserv.tcl \
+ tcl/lib/ns-autoconf.tcl \
+ tcl/rtp/session-rtp.tcl \
+ tcl/lib/ns-mip.tcl \
+ tcl/rtglib/dynamics.tcl \
+ tcl/rtglib/route-proto.tcl \
+ tcl/rtglib/algo-route-proto.tcl \
+ tcl/rtglib/ns-rtProtoLS.tcl \
+ tcl/interface/ns-iface.tcl \
+ tcl/mcast/BST.tcl \
+ tcl/mcast/ns-mcast.tcl \
+ tcl/mcast/McastProto.tcl \
+ tcl/mcast/DM.tcl \
+ tcl/mcast/srm.tcl \
+ tcl/mcast/srm-adaptive.tcl \
+ tcl/mcast/srm-ssm.tcl \
+ tcl/mcast/timer.tcl \
+ tcl/mcast/McastMonitor.tcl \
+ tcl/mobility/dsdv.tcl \
+ tcl/mobility/dsr.tcl \
+ tcl/ctr-mcast/CtrMcast.tcl \
+ tcl/ctr-mcast/CtrMcastComp.tcl \
+ tcl/ctr-mcast/CtrRPComp.tcl \
+ tcl/rlm/rlm.tcl \
+ tcl/rlm/rlm-ns.tcl \
+ tcl/session/session.tcl \
+ tcl/lib/ns-route.tcl \
+ tcl/emulate/ns-emulate.tcl \
+ tcl/lan/vlan.tcl \
+ tcl/lan/abslan.tcl \
+ tcl/lan/ns-ll.tcl \
+ tcl/lan/ns-mac.tcl \
+ tcl/webcache/http-agent.tcl \
+ tcl/webcache/http-server.tcl \
+ tcl/webcache/http-cache.tcl \
+ tcl/webcache/http-mcache.tcl \
+ tcl/webcache/webtraf.tcl \
+ tcl/webcache/empweb.tcl \
+ tcl/webcache/empftp.tcl \
+ tcl/plm/plm.tcl \
+ tcl/plm/plm-ns.tcl \
+ tcl/plm/plm-topo.tcl \
+ tcl/mpls/ns-mpls-classifier.tcl \
+ tcl/mpls/ns-mpls-ldpagent.tcl \
+ tcl/mpls/ns-mpls-node.tcl \
+ tcl/mpls/ns-mpls-simulator.tcl \
+ tcl/lib/ns-pushback.tcl \
+ tcl/lib/ns-srcrt.tcl \
+ tcl/mcast/ns-lms.tcl \
+ tcl/lib/ns-qsnode.tcl \
+ @V_NS_TCL_LIB_STL@
+
+$(GEN_DIR)ns_tcl.cc: $(NS_TCL_LIB)
+ $(TCLSH) bin/tcl-expand.tcl tcl/lib/ns-lib.tcl @V_NS_TCL_LIB_STL@ | $(TCL2C) et_ns_lib > $@
+
+$(GEN_DIR)version.c: VERSION
+ $(RM) $@
+ $(TCLSH) bin/string2c.tcl version_string < VERSION > $@
+
+$(GEN_DIR)ptypes.cc: common/ptypes2tcl common/packet.h
+ ./common/ptypes2tcl > $@
+
+common/ptypes2tcl: common/ptypes2tcl.o
+ $(LINK) $(LDFLAGS) $(LDOUT)$@ common/ptypes2tcl.o
+
+common/ptypes2tcl.o: common/ptypes2tcl.cc common/packet.h
+
+dirs:
+ for d in $(DESTDIR)$(MANDEST)/man1; do \
+ if [ ! -d $$d ]; then \
+ mkdir -p $$d ;\
+ fi;\
+ done
+
+
+install: dirs force install-ns install-man
+
+install-ns: force
+ $(INSTALL) -m 755 ns $(DESTDIR)$(BINDEST)
+
+install-man: force
+ $(INSTALL) -m 644 ns.1 $(DESTDIR)$(MANDEST)/man1
+
+install-recursive: force
+ for i in $(SUBDIRS); do ( cd $$i; $(MAKE) install; ) done
+
+clean:
+ $(RM) $(CLEANFILES)
+
+AUTOCONF_GEN = tcl/lib/ns-autoconf.tcl
+distclean: distclean-recursive
+ $(RM) $(CLEANFILES) Makefile config.cache config.log config.status \
+ autoconf.h gnuc.h os-proto.h $(AUTOCONF_GEN); \
+ $(MV) .configure .configure- ;\
+ echo "Moved .configure to .configure-"
+
+distclean-recursive:
+ for i in $(SUBDIRS); do ( cd $$i; $(MAKE) clean; $(RM) Makefile; ) done
+
+tags: force
+ ctags -wtd *.cc *.h webcache/*.cc webcache/*.h dsdv/*.cc dsdv/*.h \
+ dsr/*.cc dsr/*.h webcache/*.cc webcache/*.h lib/*.cc lib/*.h \
+ ../Tcl/*.cc ../Tcl/*.h
+
+TAGS: force
+ etags *.cc *.h webcache/*.cc webcache/*.h dsdv/*.cc dsdv/*.h \
+ dsr/*.cc dsr/*.h webcache/*.cc webcache/*.h lib/*.cc lib/*.h \
+ ../Tcl/*.cc ../Tcl/*.h
+
+tcl/lib/TAGS: force
+ ( \
+ cd tcl/lib; \
+ $(TCLSH) ../../bin/tcl-expand.tcl ns-lib.tcl | grep '^### tcl-expand.tcl: begin' | awk '{print $$5}' >.tcl_files; \
+ etags --lang=none -r '/^[ \t]*proc[ \t]+\([^ \t]+\)/\1/' `cat .tcl_files`; \
+ etags --append --lang=none -r '/^\([A-Z][^ \t]+\)[ \t]+\(instproc\|proc\)[ \t]+\([^ \t]+\)[ \t]+/\1::\3/' `cat .tcl_files`; \
+ )
+
+depend: $(SRC)
+ $(MKDEP) $(CFLAGS) $(INCLUDES) $(SRC) 2>&1 > /dev/null
+
+srctar:
+ @cwd=`pwd` ; dir=`basename $$cwd` ; \
+ name=ns-`cat VERSION | tr A-Z a-z` ; \
+ tar=ns-src-`cat VERSION`.tar.gz ; \
+ list="" ; \
+ for i in `cat FILES` ; do list="$$list $$name/$$i" ; done; \
+ echo \
+ "(rm -f $$tar; cd .. ; ln -s $$dir $$name)" ; \
+ (rm -f $$tar; cd .. ; ln -s $$dir $$name) ; \
+ echo \
+ "(cd .. ; tar cfhz $$tar [lots of files])" ; \
+ (cd .. ; tar cfhz - $$list) > $$tar ; \
+ echo \
+ "rm ../$$name; chmod 444 $$tar" ; \
+ rm ../$$name; chmod 444 $$tar
+
+force:
+
+test: force
+ ./validate
+
+# Create makefile.vc for Win32 development by replacing:
+# "# !include ..." -> "!include ..."
+makefile.vc: Makefile.in
+ $(PERL) bin/gen-vcmake.pl < Makefile.in > makefile.vc
+# $(PERL) -pe 's/^# (\!include)/\!include/o' < Makefile.in > makefile.vc
44 README
@@ -0,0 +1,44 @@
+@(#) $Header: /cvsroot/nsnam/ns-2/README,v 1.5 2000/11/02 22:46:37 johnh Exp $
+
+ns has been maintained by the
+
+MASH Research Group (University of California, Berkeley,
+<http://www-mash.cs.berkeley.edu/ns/>)
+
+the VINT project (a collaboration among USC/ISI, Xerox PARC, LBNL,
+and UCB, <http://www.isi.edu/nsnam/vint>)
+
+and the CONSER project <http://www.isi.edu/conser/>.
+
+
+This directory contains a source code or binary distribution of
+the ns-2 Network Simulator.
+
+Ns should configure and build on Unix systems with GNU autoconfigure.
+It should also build on MS-Windows systems; see INSTALL.WIN32 for details.
+
+Additional information:
+
+QUICK START: try
+ ./configure; make; ./validate
+
+DOWNLOADING AND BUILDING NS:
+ <http://www.isi.edu/nsnam/ns/ns-build.html>
+
+INSTALLATION PROBLEMS AND BUG FIXES:
+ <http://www.isi.edu/nsnam/ns/ns-problems.html>
+
+DOCUMENTATION:
+ ns maual: <http://www.isi.edu/nsnam/ns/doc>
+
+ <http://www.isi.edu/nsnam/ns>
+ (includes notes about the limitations of model, debugging tips,
+ and a >50 page design overview/tutorial)
+
+LATEST INFORMATION:
+ <http://www.isi.edu/nsnam/ns>
+
+
+If you find ns useful, you may also wish to look at nam, the network
+animator <http://www.isi.edu/nsnam/nam>.
+
513 TODO.html
@@ -0,0 +1,513 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<HEAD>
+ <TITLE>ns TODO list</TITLE>
+<!-- Changed by: Sandeep Bajaj, 24-Apr-1998 -->
+ <META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; U; SunOS 4.1.3_U1 sun4m) [Netscape]">
+</HEAD>
+<BODY>
+
+<P><!-- @(#) $Header: /cvsroot/nsnam/ns-2/TODO.html,v 1.32 2003/08/06 18:21:53 haldar Exp $--><!-- Changed by: Sandeep Bajaj, 31-Mar-1997 --></P>
+
+<H1>ns: TODO list</H1>
+
+<P><!--
+ This ChangeLog is updated in the reverse order
+ with the most recent changes coming first.
+ --></P>
+<p><i>
+The person who recommends the todo work does not necessarily do them
+by him/herself.
+<p></i>
+
+<p>
+List of topics:
+Using hash classifier in hierarchical nodes
+introduction,
+code cleanup,
+interfaces,
+queueing,
+full-tcp,
+validation,
+documentation,
+research results,
+release,
+logging,
+test suite for error models
+<hr>
+
+<ul>
+ <hr>
+
+ <p>
+ <li>
+ <b>introduction</b>
+ Here's the format: a boldface set of keywords about what
+ part of ns is relevant,
+ text describing what's going on,
+ then a signature and date.
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>
+ Thu Jun 17 18:04:37 PDT 1999)</em>
+
+ <hr>
+<!-----add stuff AFTER here----------------------------->
+
+<p><li>
+<b>Tcp-int</b>
+<br>Need to fix tcp-int. see tcp-int.tcl under tcl/ex. Also need to add a test-suite for same. Currently no testcase which is not good for code that got merged into ns way back in '97.
+
+<p><li>
+<b>Documentation</b>
+<br>Add doc for event-tracing.
+<br>Convert README file in PGM into doc for PGM for ns-manual.
+<em>(<a href="http://www.isi.edu/~haldar">[haldar]</a>
+Mon Jul 22 11:51:54 PDT 2002</em>
+
+<p><li>
+<b>wireless code</b>
+<br> Cleanup of wireless code; move out from ns-lib into under mobility.
+move aodv.tcl from ~ns/aodv to tcl/mobility. cleanup for rtg-module much in the same way it 's been done for wired nodes. remove redundant codes in ns-mobilenode.tcl.
+<em>(<a href="http://www.isi.edu/~haldar">[haldar]</a>
+Wed Jun 12 09:08:41 PDT 2002</em>
+
+<p><li>
+ <B>Port mac/null</B>
+ <BR>Look at the <A HREF="http://www.isi.edu/nsnam/archive/ns-users/webarch/2000/msg05314.html">mailing list archive</A> for porting information. Basically the code needs to be added to the current ns version and a test script needs to be written for it.
+ <EM>(<A HREF="mailto:mehringe@isi.edu">[John Mehringer]</A>
+ Thu Nov 9 17:27:57 EST 2000)
+ </EM>
+ <p><li>
+ <b>Node Structure:</b>
+ <ul>
+ <li> New node structure should be documented.
+
+ <li> For this purpose, Node::*[nodetype_] instprocs
+ should be cleaned up: the base Node should provide a set of
+ customization interfaces, and each add-on routing module
+ be an independent object which uses these interfaces to
+ customize classifier settings inside the node;
+ <br>
+ Also, numerous Simulator condition checks should be moved to
+ the initialization process of individual modules instead of
+ staying in the Simulator;
+
+ <li> We should get rid of all wireless code that is _really_
+ for backward compatibility only, and move them to a separate
+ directory instead of polluting tcl/lib and so on.
+ </ul>
+ <em>(<a href="http://catarina.usc.edu/~haoboy/">[haoboy]</a>
+ Thu Aug 24 14:25:08 PDT 2000)</em>
+
+ <p>
+ <li>
+ <b>Queueing:</b>
+ Change the Drop-Tail queue size so that it includes the
+ packet currently being transmitted, and add a
+ backward-compatibility mode so that we don't break all of the
+ validation tests. This will result in Drop-Tail and RED
+ queues having the same size in packets (now they are off by one
+ packet).
+ <em> (<a href="http://www.aciri.org/floyd/">[floyd]</a>
+ Tue Jul 4 15:13:34 PDT 2000</em>
+ <p>
+ <li>
+ <b> Test suite for error models</b>: Currently we have 8+ different
+ error models in ns. They seem to be used frequently but there is no
+ test suite to guarantee that they function correctly in every release.
+ What's more, there is little documentation about their expected behavior,
+ especially for the newer error models, e.g. two state. What we need is
+ first a test suite for all error models, then a fairly detailed doc on
+ their expected behavior. This will save users' time and help them
+ customize
+ these models for their own purpose.
+ <em>(<a href="http://www.isi.edu/~haoboy">[haoboy]</a>
+ Mon Nov 29 16:31:59 PST 1999)</em>
+ <p>
+ <li>
+ <b>Using hash classifier in hierarchical node</b>
+ The classifier cannot be used because of some strange problem
+ with the hash table. It seems like there is either a bug
+ with the Tcl hash function or the way we use it.
+ <em>(<a href="http://www.isi.edu/~salehi/">[salehi]</a>
+ Thu Sep 30 15:30:37 PDT 1999)</em>
+ <p>
+
+ <p>
+ <li>
+ <b>gen-map update</b>
+ $ns gen-map needs a cleanup + adding lan support.
+ <em>(<a href="mailto:yuri@isi.edu">[yuri]</a>
+ Thu Sep 9 12:13:41 PDT 1999)</em>
+
+ <p>
+ <li>
+ <b>This looks like a bug to look into</b>
+ After I edited mobility/scene/cbr-50-20-4-512 to replace all
+ <pre>
+ $cbr_(xx) set packetSize_ 512
+ </pre>
+ with
+ <pre>
+ $cbr_(xx) set packetSize_ 210
+ </pre>
+ and tried to re-run the test-suite-wireless-gridkeeper/dsdv,
+ ns got into a dead loop in DSDV_Agent::processUpdate() right
+ where the XXX-ed comment says it might:
+ <pre>
+ while ((queued_p = rte.q->deque()))
+ // XXX possible loop here
+ // while ((queued_p = rte.q->deque()))
+ // Only retry once to avoid looping
+ // for (int jj = 0; jj < rte.q->length(); jj++){
+ // queued_p = rte.q->deque();
+ recv(queued_p, 0); // give the packets to ourselves to forward
+ // }
+ delete rte.q;
+ rte.q = 0;
+ table_->AddEntry(rte); // record the now zero'd queue
+ </pre>
+ Yet it works with packetSize_ set to 512.
+ <em>(<a href="mailto:yuri@isi.edu">[yuri]</a>
+ Thu Aug 5 15:58:36 PDT 1999)</em>
+
+ <p>
+ <li> <strong>code cleanup, interfaces</strong>
+ <b>Aligning bound variable names</b>
+ [ns3?]
+ Aligning bound variable names in OTcl and C++, where possible
+ (change the C++ name, not the OTcl name).
+ <em>(<a href="http://www.cs.berkeley.edu/~tomh">[tomh]</a>
+ Jul 1 19:19:00 PDT 1999)</em>
+
+ <p>
+ <li>
+ <b>queueing</b>
+ Adding FRED, from the contributed code web page, into the
+ main NS distribution.
+ <em>(<a href="http://www.aciri.org/floyd/">[floyd]</a>
+ Thu May 13 14:34:00 PDT 1999)</em>
+
+ <p>
+ <li>
+ <b>queueuing?</b>
+ Adding RIO into the main NS distribution. (The original authors
+ of RIO did many simulations in NS, so I would assume that they
+ have an implementation somewhere...)
+ <em>(<a href="http://www.aciri.org/floyd/">[floyd]</a>
+ Thu May 13 14:34:00 PDT 1999)</em>
+
+ <p>
+ <li>
+ <b>one-way-tcp, full-tcp</b>
+ Implement the "careful" variant of bug-fix as
+ described in rfc2582.
+ See ns-users messages subject "Bug in TCPReno ?..."
+ posted September 1999.
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>
+ Fri Sep 24 10:00:10 PDT 1999)</em>
+
+ <p>
+ <li>
+ <b>full-tcp, validation</b>
+ Validating ECN functionality for full-TCP (and, in the process,
+ updating full-TCP to make sure that ECN functions the same in full-TCP
+ as in one-way TCP).
+ <em>(<a href="http://www.aciri.org/floyd/">[floyd]</a>
+ Thu May 13 14:34:00 PDT 1999)</em>
+
+ <p>
+ <li>
+ <b>full-tcp, validation</b>
+ Replicating all of the TCP validation tests to make sure that
+ they work as we would like with full-TCP also. (There are a number
+ of things that are tested in the one-way validation tests, but that
+ are not verified in two-way (i.e., full-TCP) validation tests.
+ <em>(<a href="http://www.aciri.org/floyd/">[floyd]</a>
+ Thu May 13 14:34:00 PDT 1999)</em>
+
+ <p>
+ <li>
+ <b>validation</b>
+ Adding either short *.txt files, or longer documents, for each
+ validation test that does not now have one, so that users can
+ tell reasonably easily what is and is not tested in each validation
+ test.
+ <em>(<a href="http://www.aciri.org/floyd/">[floyd]</a>
+ Thu May 13 14:34:00 PDT 1999)</em>
+
+ <p>
+ <li>
+ <b>documentation, validation</b>
+ Standardize documentation for valdation tests.
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>
+ Thu Jun 17 18:04:37 PDT 1999)</em>
+
+ <p>
+ <li>
+ <b>validation</b>
+ Expanding the validation tests for all of the various scheduling
+ algorithms.
+ <em>(<a href="http://www.aciri.org/floyd/">[floyd]</a>
+ Thu May 13 14:34:00 PDT 1999)</em>
+
+ <p>
+ <li>
+ <b>research results, validation</b>
+ More simulation scripts on-line somewhere. (Has everyone in the
+ VINT project made all of the simulation scripts for all of the
+ simulations that they have writted papers about publically available,
+ so that readers can easily reproduce those simulations themselves?)
+ <em>(<a href="http://www.aciri.org/floyd/">[floyd]</a>
+ Thu May 13 14:34:00 PDT 1999)</em>
+
+ <p>
+ <li>
+ <b>documentation</b>
+ Better document trace file format
+ (both ns output trace)
+ and the 32-bit integer thing.
+ (A very FAQ.)
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>
+ Thu Jun 17 18:04:37 PDT 1999)</em>
+
+ <p>
+ <li>
+ <b>documentation</b>
+ Describe the ns programming model (event driven and the IO model).
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>Wed Sep 8 13:38:19 PDT 1999)</em>
+
+ <p>
+ <li>
+ <b>release, allinone</b>
+ Allinone should add tcl-debug
+ and update dmalloc.
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>Thu Nov 9 10:01:41 PST 2000)</em>
+
+ <p>
+ <li>
+ <b>logging</b>
+ Trace output is a mess. There are currently two different formats
+ (wired and wireless), neither of which is easily extnesible.
+ Switching to something like what nam uses seems like a win.
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>Fri Aug 27 17:24:44 PDT 1999)</em>
+
+ <p>
+ <li>
+ <b>full-tcp, application APIs</b>
+ We need to compare the ns full-tcp with the south-bay full-tcp
+ in terms of corner cases and APIs (i.e., with the cisco http models).
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>Mon Aug 30 15:17:59 PDT 1999)</em>
+
+ <p>
+ <li>
+ <b>queueing</b>
+ Make sure that all ns constructs (1-way and full-tcp, queueing protocols)
+ have both packet and byte-oriented modes and that they are selected consistently.
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>Mon Aug 30 15:20:00 PDT 1999)</em>
+
+ <p>
+ <li>
+ <b>emulation</b>
+ merge nse into ns, have emulation controled by a configure option
+ (--with-emulation or something).
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>Thu Oct 14 10:25:47 PDT 1999)</em>
+
+ <p>
+ <li>
+ <b>debugging</b>
+ Insure that gen-map works correctly with lans and wireless.
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>
+ Fri Sep 3 21:26:38 PDT 1999)</em>
+
+ <p>
+ <li>
+ <b>test suites, error models</b>
+ Create tests suites for the error models.
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>
+ Wed Nov 24 13:20:55 PST 1999)</em>
+
+
+ <p>
+ <li>
+ <b>routing</b>
+ Add source routing to ns.
+ Suggested by several people, including ashish.
+ Could possibly start with MPLS contributed code?
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>
+ Mon Dec 20 15:57:11 PST 1999)</em>
+
+ <p>
+ <li>
+ <b>optimization, routing, classifiers</b>
+ An optimization in classifier sizing:
+ When Polly mentioned that Classifiers just double their routing
+ tables when the currently allocated space is exceeded, I thought it
+ was a bug: Classifiers normally are populated when all nodes are
+ created, which means that we know what the routing size will be and
+ can give Classifiers a hint, so we don't need to double.
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>
+ Tue Dec 21 10:25:56 PST 1999
+)</em>
+
+ <p>
+ <li>
+ <b>topology generation</b>
+ Contributed topology generators to possibly integrate
+ from Graham Phillips &lt;graham@ISI.EDU&gt;:
+ I've written some topology generator programs that the ns
+community is more than welcome to use. These programs are
+reasonably mature and I've used them over the past year
+while preparing a sigcomm paper about multicast trees.
+
+<p>
+ The programs essentially create and manipulate Standford Graph
+Base topology files, but there are also programs for converting from
+1) tiers to SGB, and
+2) ISI's mbone collection format to SGB.
+Obviously the ns community would use the existing SGB to ns
+converter to create the appropriate ns topologies.
+
+<p>
+The basic idea was to widen the range of real and artificial
+topologies that might be constructed. All utilities and
+documentation are available
+from <a href="http://www-scf.usc.edu/~grahamph/contrib/index.html">http://www-scf.usc.edu/~grahamph/contrib/index.html</a>.
+ <p>
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>
+ Tue Dec 21 10:30:47 PST 1999)</em>
+
+
+ <p>
+ <li>
+ <b>tracing, visualization</b>
+ Need to review MAC-layer tracing, support tracing at multiple levels.
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>
+ Tue Dec 21 10:50:34 PST 1999)</em>
+
+ <p>
+ <li>
+ <b>binding</b> [ns3?]
+ We need to clean up inconsistent binding of variables
+ (but this is hard to do while keeping backwards compatibility).
+ <pre>
+Date: Fri, 23 Jul 1999 17:37:04 +0100 (BST)
+From: Lloyd Wood <L.Wood@surrey.ac.uk>
+In:
+
+http://www-mash.cs.berkeley.edu/dist/archive/ns-users/9906/0304.html
+http://www-mash.cs.berkeley.edu/dist/archive/ns-users/9906/0313.html
+
+I grumbled about consistent use of bind, so that OTcl and C++ users
+can talk about the same variables and you don't have to go hunting for
+the bind statement to see what maps to what when you're working across
+the divide.
+
+The thing is, once you start going a bit deeper into the ns code,
+however reluctantly, there's a second level of confusion. A search on
+'return ' in headers for member functions returning variables produces
+rather similar results for bind; almost all are obvious and sensibly
+mapped: blah() to blah_, but the odd thing like:
+
+tcp.h: int& flags() { return (tcp_flags_); }
+rtp.h: u_int16_t& flags() { return (flags_); }
+
+(or
+ip.h: int& flowid() { return (fid_); }
+address.h: inline int portshift() {return PortShift_;}
+address.h: inline int portmask() {return PortMask_;}
+packet.h: inline double& timestamp() { return (ts_); } )
+
+can really throw you for a loop and complicate digging up responsible
+bits of code affected by changes.
+</pre>
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>
+ Tue Jan 4 10:55:56 PST 2000)</em>
+
+
+ <p>
+ <li>
+ <b>routing, scaling</b>
+ Should reimplement algorithm routing solely in C++.
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>
+ Wed Jan 19 07:42:32 PST 2000)</em>
+ <p>
+
+ <li>
+ <b>mixed-mode, scaling</b>
+ Should check, change code so that packets can stay completely
+ in C++ when being forwarded between regions in mixed-model simulations.
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>
+ Wed Jan 19 07:46:49 PST 2000)</em>
+
+ <p>
+ <li> <b>TCP</b> Check the TCP reset function.
+ From email with "Subject: Re: TCP reset bug" and
+ "Subject: question about TCPAgent reset()" on the
+ ns-users mailing list.
+ <em> (<a href="http://www.aciri.org/floyd/">[floyd]</a>
+ Fri Feb 25 09:06:59 PST 2000) </em>
+
+ <p>
+ <li> <b>one-way TCP</b> Deal with the issue of segment size vs.
+ header size. From email on the ns-users mailing list.
+ <em> (<a href="http://www.aciri.org/floyd/">[floyd]</a>
+ Fri Feb 25 09:06:59 PST 2000) </em>
+
+ <p>
+ <li> <b>documentation</b> Make sure that documentation includes
+ all variables in ns-default.tcl.
+ <em> (<a href="http://www.aciri.org/floyd/">[floyd]</a>
+ Fri Feb 25 09:06:59 PST 2000) </em>
+
+ <p>
+ <li> <b>validation</b> Suppress "using backward
+ compatibility mode" message during *-v1.tcl validation tests?
+ Correct procedures for V1 validation tests that are not run:
+ e.g., test cbqForOld in "./test-all-cbq-v1".
+ From email on "Subject: Re: a validation question" on the ns-users
+ mailing list.
+ <em> (<a href="http://www.aciri.org/floyd/">[floyd]</a>
+ Fri Feb 25 09:06:59 PST 2000) </em>
+
+ <p>
+ <li> <b>probability distributions</b> Add validation tests.
+ <em> (<a href="http://www.aciri.org/floyd/">[floyd]</a>
+ Fri Feb 25 09:06:59 PST 2000) </em>
+
+
+ <p>
+ <li>
+ <b>LANs</b>
+ Make LAN nodes be generated with [$ns node] and node-config
+ rather than special APIs.
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>
+ Tue Jun 20 17:19:27 PDT 2000)</em>
+
+ <p>
+ <li>
+ <b>SRM/event tracing</b>
+ SRM's tcl tracing code should use real event tracing
+ (which should include tcl support),
+ not the current hack (see srm.tcl for commands "$self evTrace Q NTIMER").
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>
+ Wed Jul 24 10:41:06 PDT 2002)</em>
+</ul>
+
+
+
+
+
+<H1>DONE list</H1>
+
+These things have been completed:
+<ul>
+
+ <p>
+ <li>
+ <b>hier addressing</b>
+ str2addr in address.cc should do some error checking
+ to insure that fields are not larger than they should be.
+ <em>(<a href="http://www.isi.edu/~johnh/">[johnh]</a>
+ Mon Oct 30 22:52:32 PST 2000); completed by Padma in 2001</em>
+
+</ul>
1  VERSION
@@ -0,0 +1 @@
+2.35-RC6
103 adc/acto-adc.cc
@@ -0,0 +1,103 @@
+/* -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */
+/*
+ * Copyright (c) Xerox Corporation 1997. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linking this file statically or dynamically with other modules is making
+ * a combined work based on this file. Thus, the terms and conditions of
+ * the GNU General Public License cover the whole combination.
+ *
+ * In addition, as a special exception, the copyright holders of this file
+ * give you permission to combine this file with free software programs or
+ * libraries that are released under the GNU LGPL and with code included in
+ * the standard release of ns-2 under the Apache 2.0 license or under
+ * otherwise-compatible licenses with advertising requirements (or modified
+ * versions of such code, with unchanged license). You may copy and
+ * distribute such a system following the terms of the GNU GPL for this
+ * file and the licenses of the other code concerned, provided that you
+ * include the source code of that other code when and as the GNU GPL
+ * requires distribution of source code.
+ *
+ * Note that people who make modified versions of this file are not
+ * obligated to grant this special exception for their modified versions;
+ * it is their choice whether to do so. The GNU General Public License
+ * gives permission to release a modified version without this exception;
+ * this exception also makes it possible to release a modified version
+ * which carries forward this exception.
+ */
+#ifndef lint
+static const char rcsid[] =
+ "@(#) $Header: /cvsroot/nsnam/ns-2/adc/acto-adc.cc,v 1.7 2005/08/26 05:05:27 tomh Exp $";
+#endif
+
+
+//Acceptance region Tangent at Origin Admission Control
+
+#include "adc.h"
+#include <stdlib.h>
+#include <math.h>
+
+class ACTO_ADC : public ADC {
+public:
+ ACTO_ADC();
+ void teardown_action(int,double,int);
+protected:
+ int admit_flow(int,double,int);
+ int rejected_;
+ double s_;
+};
+
+ACTO_ADC::ACTO_ADC() : rejected_(0)
+{
+ bind("s_", &s_);
+ type_ = new char[5];
+ strcpy(type_, "ACTO");
+
+}
+
+
+int ACTO_ADC::admit_flow(int cl,double r,int b)
+{
+ double p=peak_rate(cl,r,b);
+ if (backoff_) {
+ if (rejected_)
+ return 0;
+ }
+
+ if (exp(p*s_)*est_[cl]->avload() <= bandwidth_) {
+ if (dobump_) {
+ est_[cl]->change_avload(p);
+ }
+ return 1;
+ }
+ else {
+ rejected_=1;
+ return 0;
+ }
+}
+
+void ACTO_ADC::teardown_action(int /*cl*/,double /*r*/,int /*b*/)
+{
+ rejected_=0;
+}
+
+static class ACTO_ADCClass : public TclClass {
+ public :
+ ACTO_ADCClass() : TclClass("ADC/ACTO") {}
+ TclObject* create(int,const char*const*) {
+ return (new ACTO_ADC());
+ }
+}class_acto_adc;
119 adc/actp-adc.cc
@@ -0,0 +1,119 @@
+/* -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */
+/*
+ * Copyright (c) Xerox Corporation 1997. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linking this file statically or dynamically with other modules is making
+ * a combined work based on this file. Thus, the terms and conditions of
+ * the GNU General Public License cover the whole combination.
+ *
+ * In addition, as a special exception, the copyright holders of this file
+ * give you permission to combine this file with free software programs or
+ * libraries that are released under the GNU LGPL and with code included in
+ * the standard release of ns-2 under the Apache 2.0 license or under
+ * otherwise-compatible licenses with advertising requirements (or modified
+ * versions of such code, with unchanged license). You may copy and
+ * distribute such a system following the terms of the GNU GPL for this
+ * file and the licenses of the other code concerned, provided that you
+ * include the source code of that other code when and as the GNU GPL
+ * requires distribution of source code.
+ *
+ * Note that people who make modified versions of this file are not
+ * obligated to grant this special exception for their modified versions;
+ * it is their choice whether to do so. The GNU General Public License
+ * gives permission to release a modified version without this exception;
+ * this exception also makes it possible to release a modified version
+ * which carries forward this exception.
+ */
+#ifndef lint
+static const char rcsid[] =
+ "@(#) $Header: /cvsroot/nsnam/ns-2/adc/actp-adc.cc,v 1.6 2005/08/26 05:05:27 tomh Exp $";
+#endif
+
+
+//Acceptance region Tangent at Peak Admission Control
+
+#include "adc.h"
+#include <stdlib.h>
+#include <math.h>
+
+class ACTP_ADC : public ADC {
+public:
+ ACTP_ADC();
+ void teardown_action(int,double,int);
+ void rej_action(int,double,int);
+protected:
+ int admit_flow(int,double,int);
+ int rejected_;
+ double s_;
+ double sump_;
+};
+
+ACTP_ADC::ACTP_ADC() : rejected_(0), sump_(0)
+{
+ bind("s_", &s_);
+ type_ = new char[5];
+ strcpy(type_, "ACTP");
+}
+
+
+
+int ACTP_ADC::admit_flow(int cl,double r,int b)
+{
+ //get peak rate this class of flow
+ double p=peak_rate(cl,r,b);
+
+ if (backoff_) {
+ if (rejected_)
+ return 0;
+ }
+
+ //fprintf (stderr,"%f %f %f\n",sump_*(1-exp(-p*s_)),exp(-p*s_)*est_[cl]->avload(),est_[cl]->avload());
+ if (sump_*(1-exp(-p*s_))+exp(-p*s_)*est_[cl]->avload() <= bandwidth_) {
+ sump_+= p;
+ if (dobump_) {
+ est_[cl]->change_avload(p);
+ }
+ return 1;
+ }
+ else {
+ rejected_=1;
+ return 0;
+ }
+}
+
+
+void ACTP_ADC::rej_action(int cl,double r,int b)
+{
+ double p=peak_rate(cl,r,b);
+ sump_ -= p;
+}
+
+
+void ACTP_ADC::teardown_action(int cl,double r,int b)
+{
+ rejected_=0;
+ double p=peak_rate(cl,r,b);
+ sump_ -= p;
+}
+
+static class ACTP_ADCClass : public TclClass {
+public:
+ ACTP_ADCClass() : TclClass("ADC/ACTP") {}
+ TclObject* create(int,const char*const*) {
+ return (new ACTP_ADC());
+ }
+}class_actp_adc;
80 adc/adaptive-receiver.cc
@@ -0,0 +1,80 @@
+/* -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*-
+ *
+ * Copyright (c) Xerox Corporation 1997. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linking this file statically or dynamically with other modules is making
+ * a combined work based on this file. Thus, the terms and conditions of
+ * the GNU General Public License cover the whole combination.
+ *
+ * In addition, as a special exception, the copyright holders of this file
+ * give you permission to combine this file with free software programs or
+ * libraries that are released under the GNU LGPL and with code included in
+ * the standard release of ns-2 under the Apache 2.0 license or under
+ * otherwise-compatible licenses with advertising requirements (or modified
+ * versions of such code, with unchanged license). You may copy and
+ * distribute such a system following the terms of the GNU GPL for this
+ * file and the licenses of the other code concerned, provided that you
+ * include the source code of that other code when and as the GNU GPL
+ * requires distribution of source code.
+ *
+ * Note that people who make modified versions of this file are not
+ * obligated to grant this special exception for their modified versions;
+ * it is their choice whether to do so. The GNU General Public License
+ * gives permission to release a modified version without this exception;
+ * this exception also makes it possible to release a modified version
+ * which carries forward this exception.
+ */
+
+#ifndef lint
+static const char rcsid[] =
+ "@(#) $Header: /cvsroot/nsnam/ns-2/adc/adaptive-receiver.cc,v 1.8 2005/08/26 05:05:27 tomh Exp $";
+#endif
+
+#include "config.h"
+#include "agent.h"
+#include "tclcl.h"
+#include "packet.h"
+#include "ip.h"
+#include "rtp.h"
+#include "adaptive-receiver.h"
+#include <math.h>
+
+#define myabs(r) (r<0)?-r:r
+
+AdaptiveRcvr::AdaptiveRcvr() : Agent(PT_NTYPE)
+{
+ //bind("npkts_",&npkts_);
+ //bind("ndelay_",&ndelay_);
+ //bind("nvar_",&nvar_);
+}
+
+void AdaptiveRcvr::recv(Packet *pkt,Handler*)
+{
+ int delay;
+ int seq_no;
+ hdr_cmn* ch= hdr_cmn::access(pkt);
+ hdr_rtp *rh = hdr_rtp::access(pkt);
+
+ seq_no= rh->seqno();
+ register u_int32_t send_time = (int)ch->timestamp();
+
+ u_int32_t local_time= (u_int32_t)(Scheduler::instance().clock() * SAMPLERATE);
+ delay=adapt(pkt,local_time);
+ Tcl::instance().evalf("%s print-delay-stats %f %f %f",name(),send_time/SAMPLERATE,local_time/SAMPLERATE,(local_time+delay)/SAMPLERATE);
+ Packet::free(pkt);
+}
+
62 adc/adaptive-receiver.h
@@ -0,0 +1,62 @@
+/* -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */
+/*
+ * Copyright (c) Xerox Corporation 1997. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linking this file statically or dynamically with other modules is making
+ * a combined work based on this file. Thus, the terms and conditions of
+ * the GNU General Public License cover the whole combination.
+ *
+ * In addition, as a special exception, the copyright holders of this file
+ * give you permission to combine this file with free software programs or
+ * libraries that are released under the GNU LGPL and with code included in
+ * the standard release of ns-2 under the Apache 2.0 license or under
+ * otherwise-compatible licenses with advertising requirements (or modified
+ * versions of such code, with unchanged license). You may copy and
+ * distribute such a system following the terms of the GNU GPL for this
+ * file and the licenses of the other code concerned, provided that you
+ * include the source code of that other code when and as the GNU GPL
+ * requires distribution of source code.
+ *
+ * Note that people who make modified versions of this file are not
+ * obligated to grant this special exception for their modified versions;
+ * it is their choice whether to do so. The GNU General Public License
+ * gives permission to release a modified version without this exception;
+ * this exception also makes it possible to release a modified version
+ * which carries forward this exception.
+ *
+ * @(#) $Header: /cvsroot/nsnam/ns-2/adc/adaptive-receiver.h,v 1.4 2005/08/26 05:05:27 tomh Exp $
+ */
+
+#ifndef ns_adaptivercvr_h
+#define ns_adaptivercvr_h
+
+class AdaptiveRcvr : public Agent {
+public :
+ AdaptiveRcvr();
+ void recv(Packet* pkt, Handler*);
+protected :
+ virtual int adapt(Packet *pkt,u_int32_t time)=0;
+};
+
+/*
+ XXX
+ Samplerate defined here in receiver as well so that the delay stats can be printed
+ in real time */
+
+#define SAMPLERATE 8000.0
+
+#endif
115 adc/adc.cc
@@ -0,0 +1,115 @@
+/* -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */
+/*
+ * Copyright (c) Xerox Corporation 1997. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linking this file statically or dynamically with other modules is making
+ * a combined work based on this file. Thus, the terms and conditions of
+ * the GNU General Public License cover the whole combination.
+ *
+ * In addition, as a special exception, the copyright holders of this file
+ * give you permission to combine this file with free software programs or
+ * libraries that are released under the GNU LGPL and with code included in
+ * the standard release of ns-2 under the Apache 2.0 license or under
+ * otherwise-compatible licenses with advertising requirements (or modified
+ * versions of such code, with unchanged license). You may copy and
+ * distribute such a system following the terms of the GNU GPL for this
+ * file and the licenses of the other code concerned, provided that you
+ * include the source code of that other code when and as the GNU GPL
+ * requires distribution of source code.
+ *
+ * Note that people who make modified versions of this file are not
+ * obligated to grant this special exception for their modified versions;
+ * it is their choice whether to do so. The GNU General Public License
+ * gives permission to release a modified version without this exception;
+ * this exception also makes it possible to release a modified version
+ * which carries forward this exception.
+ */
+#ifndef lint
+static const char rcsid[] =
+ "@(#) $Header: /cvsroot/nsnam/ns-2/adc/adc.cc,v 1.8 2005/08/26 05:05:27 tomh Exp $";
+#endif
+
+#include "adc.h"
+#include <stdlib.h>
+
+ADC::ADC() :bandwidth_(0), tchan_(0)
+{
+ bind_bw("bandwidth_",&bandwidth_);
+ bind_bool("backoff_",&backoff_);
+ bind("src_", &src_);
+ bind("dst_", &dst_);
+ bind_bool("dobump_", &dobump_);
+}
+
+int ADC::command(int argc,const char*const*argv)
+{
+
+ Tcl& tcl = Tcl::instance();
+ if (argc==2) {
+ if (strcmp(argv[1],"start") ==0) {
+ /* $adc start */
+ est_[1]->start();
+ return (TCL_OK);
+ }
+ } else if (argc==4) {
+ if (strcmp(argv[1],"attach-measmod") == 0) {
+ /* $adc attach-measmod $meas $cl */
+ MeasureMod *meas_mod = (MeasureMod *)TclObject::lookup(argv[2]);
+ if (meas_mod== 0) {
+ tcl.resultf("no measuremod found");
+ return(TCL_ERROR);
+ }
+ int cl=atoi(argv[3]);
+ est_[cl]->setmeasmod(meas_mod);
+ return(TCL_OK);
+ } else if (strcmp(argv[1],"attach-est") == 0 ) {
+ /* $adc attach-est $est $cl */
+ Estimator *est_mod = (Estimator *)TclObject::lookup(argv[2]);
+ if (est_mod== 0) {
+ tcl.resultf("no estmod found");
+ return(TCL_ERROR);
+ }
+ int cl=atoi(argv[3]);
+ setest(cl,est_mod);
+ return(TCL_OK);
+ }
+ }
+ else if (argc == 3) {
+ if (strcmp(argv[1], "attach") == 0) {
+ int mode;
+ const char* id = argv[2];
+ tchan_ = Tcl_GetChannel(tcl.interp(), (char*)id, &mode);
+ if (tchan_ == 0) {
+ tcl.resultf("ADC: trace: can't attach %s for writing", id);
+ return (TCL_ERROR);
+ }
+ return (TCL_OK);
+
+ }
+ if (strcmp(argv[1], "setbuf") == 0) {
+ /* some sub classes actually do something here */
+ return(TCL_OK);
+ }
+
+
+ }
+ return (NsObject::command(argc,argv));
+}
+
+
+
+
78 adc/adc.h
@@ -0,0 +1,78 @@
+/* -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */
+/*
+ * Copyright (c) Xerox Corporation 1997. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linking this file statically or dynamically with other modules is making
+ * a combined work based on this file. Thus, the terms and conditions of
+ * the GNU General Public License cover the whole combination.
+ *
+ * In addition, as a special exception, the copyright holders of this file
+ * give you permission to combine this file with free software programs or
+ * libraries that are released under the GNU LGPL and with code included in
+ * the standard release of ns-2 under the Apache 2.0 license or under
+ * otherwise-compatible licenses with advertising requirements (or modified
+ * versions of such code, with unchanged license). You may copy and
+ * distribute such a system following the terms of the GNU GPL for this
+ * file and the licenses of the other code concerned, provided that you
+ * include the source code of that other code when and as the GNU GPL
+ * requires distribution of source code.
+ *
+ * Note that people who make modified versions of this file are not
+ * obligated to grant this special exception for their modified versions;
+ * it is their choice whether to do so. The GNU General Public License
+ * gives permission to release a modified version without this exception;
+ * this exception also makes it possible to release a modified version
+ * which carries forward this exception.
+ *
+ * @(#) $Header: /cvsroot/nsnam/ns-2/adc/adc.h,v 1.6 2005/08/26 05:05:27 tomh Exp $
+ */
+
+#ifndef ns_adc_h
+#define ns_adc_h
+
+#include "estimator.h"
+
+#define CLASS 10
+class ADC : public NsObject {
+public:
+ ADC();
+ int command(int,const char*const*);
+ virtual int admit_flow(int cl,double r, int b)=0;
+ virtual void rej_action(int,double,int){};
+ virtual void teardown_action(int,double,int){};
+ inline void recv(Packet*, Handler *){}
+ inline void setest(int cl,Estimator *est) {est_[cl]=est;
+ est_[cl]->setactype(type_);}
+ double peak_rate(int cl,double r,int b) {return r+b/est_[cl]->period();}
+ char *type() {return type_;}
+protected:
+ Estimator *est_[CLASS];
+ double bandwidth_;
+ char *type_;
+ Tcl_Channel tchan_;
+ int src_;
+ int dst_;
+ int backoff_;
+ int dobump_;
+};
+
+#endif
+
+
+
+
+
101 adc/consrcvr.cc
@@ -0,0 +1,101 @@
+/* -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */
+/*
+ * Copyright (c) Xerox Corporation 1997. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linking this file statically or dynamically with other modules is making
+ * a combined work based on this file. Thus, the terms and conditions of
+ * the GNU General Public License cover the whole combination.
+ *
+ * In addition, as a special exception, the copyright holders of this file
+ * give you permission to combine this file with free software programs or
+ * libraries that are released under the GNU LGPL and with code included in
+ * the standard release of ns-2 under the Apache 2.0 license or under
+ * otherwise-compatible licenses with advertising requirements (or modified
+ * versions of such code, with unchanged license). You may copy and
+ * distribute such a system following the terms of the GNU GPL for this
+ * file and the licenses of the other code concerned, provided that you
+ * include the source code of that other code when and as the GNU GPL
+ * requires distribution of source code.
+ *
+ * Note that people who make modified versions of this file are not
+ * obligated to grant this special exception for their modified versions;
+ * it is their choice whether to do so. The GNU General Public License
+ * gives permission to release a modified version without this exception;
+ * this exception also makes it possible to release a modified version
+ * which carries forward this exception.
+ */
+#ifndef lint
+static const char rcsid[] =
+ "@(#) $Header: /cvsroot/nsnam/ns-2/adc/consrcvr.cc,v 1.8 2005/08/26 05:05:27 tomh Exp $";
+#endif
+
+
+#include "agent.h"
+#include "config.h"
+#include "tclcl.h"
+#include "packet.h"
+#include "rtp.h"
+#include "adaptive-receiver.h"
+#ifndef WIN32
+// VC 5.0 doesn't have this
+#include <sys/time.h>
+#endif
+
+//#define CONS_OFFSET 0.025*SAMPLERATE
+#define CONS_OFFSET 200
+
+class ConsRcvr : public AdaptiveRcvr {
+public:
+ ConsRcvr();
+protected:
+ int adapt(Packet *pkt, u_int32_t time);
+ int offset_;
+};
+
+static class ConsRcvrClass : public TclClass {
+public:
+ ConsRcvrClass() : TclClass("Agent/ConsRcvr") {}
+ TclObject* create(int, const char*const*) {
+ return (new ConsRcvr());
+
+ }
+} class_cons_rcvr;
+
+
+ConsRcvr::ConsRcvr() : offset_(CONS_OFFSET)
+{
+}
+
+int ConsRcvr::adapt(Packet *pkt, u_int32_t local_clock)
+{
+
+ int delay;
+ hdr_cmn* ch = hdr_cmn::access(pkt);
+ register u_int32_t tstamp = (int)ch->timestamp();
+
+ if (((tstamp+offset_) < local_clock) || (offset_ == -1)) {
+ /*increase the offset */
+ if (offset_ < (int)(local_clock-(tstamp+offset_)))
+ offset_ += local_clock -(tstamp+offset_);
+ else
+ offset_ += offset_;
+ }
+
+ delay=offset_-(local_clock-tstamp);
+
+ return delay;
+}
164 adc/estimator.cc
@@ -0,0 +1,164 @@
+/* -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */
+/*
+ * Copyright (c) Xerox Corporation 1997. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linking this file statically or dynamically with other modules is making
+ * a combined work based on this file. Thus, the terms and conditions of
+ * the GNU General Public License cover the whole combination.
+ *
+ * In addition, as a special exception, the copyright holders of this file
+ * give you permission to combine this file with free software programs or
+ * libraries that are released under the GNU LGPL and with code included in
+ * the standard release of ns-2 under the Apache 2.0 license or under
+ * otherwise-compatible licenses with advertising requirements (or modified
+ * versions of such code, with unchanged license). You may copy and
+ * distribute such a system following the terms of the GNU GPL for this
+ * file and the licenses of the other code concerned, provided that you
+ * include the source code of that other code when and as the GNU GPL
+ * requires distribution of source code.
+ *
+ * Note that people who make modified versions of this file are not
+ * obligated to grant this special exception for their modified versions;
+ * it is their choice whether to do so. The GNU General Public License
+ * gives permission to release a modified version without this exception;
+ * this exception also makes it possible to release a modified version
+ * which carries forward this exception.
+ */
+#ifndef lint
+static const char rcsid[] =
+ "@(#) $Header: /cvsroot/nsnam/ns-2/adc/estimator.cc,v 1.8 2005/08/26 05:05:27 tomh Exp $";
+#endif
+
+#include "estimator.h"
+
+Estimator::Estimator() : meas_mod_(0),avload_(0.0),est_timer_(this), measload_(0.0), tchan_(0), omeasload_(0), oavload_(0)
+{
+ bind("period_",&period_);
+ bind("src_", &src_);
+ bind("dst_", &dst_);
+
+ avload_.tracer(this);
+ avload_.name("\"Estimated Util.\"");
+ measload_.tracer(this);
+ measload_.name("\"Measured Util.\"");
+}
+
+int Estimator::command(int argc, const char*const* argv)
+{
+ Tcl& tcl = Tcl::instance();
+ if (argc==2) {
+ if (strcmp(argv[1],"load-est") == 0) {
+ tcl.resultf("%.3f",double(avload_));
+ return(TCL_OK);
+ } else if (strcmp(argv[1],"link-utlzn") == 0) {
+ tcl.resultf("%.3f",meas_mod_->bitcnt()/period_);
+ return(TCL_OK);
+ }
+ }
+ if (argc == 3) {
+ if (strcmp(argv[1], "attach") == 0) {
+ int mode;
+ const char* id = argv[2];
+ tchan_ = Tcl_GetChannel(tcl.interp(), (char*)id, &mode);
+ if (tchan_ == 0) {
+ tcl.resultf("Estimator: trace: can't attach %s for writing", id);
+ return (TCL_ERROR);
+ }
+ return (TCL_OK);
+ }
+ if (strcmp(argv[1], "setbuf") == 0) {
+ /* some sub classes actually do something here */
+ return(TCL_OK);
+ }
+ }
+ return NsObject::command(argc,argv);
+}
+
+void Estimator::setmeasmod (MeasureMod *measmod)
+{
+ meas_mod_=measmod;
+}
+
+void Estimator::start()
+{
+ avload_=0;
+ measload_ = 0;
+ est_timer_.resched(period_);
+}
+
+void Estimator::stop()
+{
+ est_timer_.cancel();
+}
+
+void Estimator::timeout(int)
+{
+ estimate();
+ est_timer_.resched(period_);
+}
+
+void Estimator_Timer::expire(Event* /*e*/)
+{
+ est_->timeout(0);
+}
+
+void Estimator::trace(TracedVar* v)
+{
+ char wrk[500];
+ double *p, newval;
+
+ /* check for right variable */
+ if (strcmp(v->name(), "\"Estimated Util.\"") == 0) {
+ p = &oavload_;