Browse Source

Import upstream version 2.99+3.0.beta7

Aaron Turner 19 years ago
parent
commit
3e0122128c
65 changed files with 1878 additions and 473 deletions
  1. 4 2
      Makefile.am
  2. 12 8
      Makefile.in
  3. 3 2
      configure
  4. 12 11
      configure.in
  5. 11 1
      docs/CHANGELOG
  6. BIN
      docs/FAQ.pdf
  7. 8 1
      docs/INSTALL
  8. 2 0
      docs/TODO
  9. BIN
      docs/flowreplay.pdf
  10. 210 216
      docs/manual.pdf
  11. 1 1
      docs/web/FAQ/FAQ.html
  12. 1 1
      docs/web/FAQ/index.html
  13. 1 1
      docs/web/FAQ/node1.html
  14. 1 1
      docs/web/FAQ/node2.html
  15. 1 1
      docs/web/FAQ/node3.html
  16. 1 1
      docs/web/FAQ/node4.html
  17. 1 1
      docs/web/FAQ/node5.html
  18. 1 1
      docs/web/FAQ/node6.html
  19. 1 1
      docs/web/FAQ/node7.html
  20. 1 1
      docs/web/FAQ/node8.html
  21. 1 1
      docs/web/flowreplay/flowreplay.html
  22. 1 1
      docs/web/flowreplay/images.log
  23. BIN
      docs/web/flowreplay/img1.old
  24. 1 1
      docs/web/flowreplay/index.html
  25. 1 1
      docs/web/flowreplay/node1.html
  26. 1 1
      docs/web/flowreplay/node2.html
  27. 1 1
      docs/web/flowreplay/node3.html
  28. 1 1
      docs/web/flowreplay/node4.html
  29. 1 1
      docs/web/flowreplay/node5.html
  30. 1 1
      docs/web/flowreplay/node6.html
  31. 29 23
      docs/web/index.html
  32. 12 1
      docs/web/man/tcpreplay.html
  33. 1 1
      docs/web/manual/images.log
  34. BIN
      docs/web/manual/img1.old
  35. 1 1
      docs/web/manual/index.html
  36. 1 1
      docs/web/manual/manual.css
  37. 1 1
      docs/web/manual/manual.html
  38. 1 1
      docs/web/manual/node1.html
  39. 105 105
      docs/web/tcpreplay-2-faq.html
  40. 1336 0
      doxygen.cfg.in
  41. 15 11
      src/common/cidr.c
  42. 2 2
      src/common/cidr.h
  43. 1 6
      src/common/get.c
  44. 1 1
      src/common/svn_version.c
  45. 4 4
      src/common/utils.c
  46. 2 2
      src/flowreplay.1
  47. 2 2
      src/flowreplay.c
  48. 1 1
      src/flowreplay_opts.c
  49. 1 1
      src/flowreplay_opts.h
  50. 2 2
      src/tcpbridge.1
  51. 1 1
      src/tcpbridge_opts.c
  52. 1 1
      src/tcpbridge_opts.h
  53. 2 2
      src/tcpprep.1
  54. 18 3
      src/tcpprep.c
  55. 1 1
      src/tcpprep_opts.c
  56. 1 1
      src/tcpprep_opts.h
  57. 2 2
      src/tcpreplay.1
  58. 1 1
      src/tcpreplay_opts.c
  59. 1 1
      src/tcpreplay_opts.h
  60. 2 2
      src/tcprewrite.1
  61. 1 1
      src/tcprewrite_opts.c
  62. 1 1
      src/tcprewrite_opts.h
  63. 44 29
      src/tree.c
  64. 3 1
      src/tree.h
  65. BIN
      test/test.auto_router

+ 4 - 2
Makefile.am

@@ -21,10 +21,10 @@ docs: manpages
 clean-docs:
 clean-docs:
 	cd $(DOCS_DIR) && make clean-docs
 	cd $(DOCS_DIR) && make clean-docs
 
 
-postweb: manpages
+postweb: manpages doxygen
 	cd $(DOCS_DIR) && make postweb
 	cd $(DOCS_DIR) && make postweb
 
 
-postwebsf: manpages
+postwebsf: manpages doxygen
 	cd $(DOCS_DIR) && make postwebsf
 	cd $(DOCS_DIR) && make postwebsf
 
 
 manpages: man2html
 manpages: man2html
@@ -54,3 +54,5 @@ MOSTLYCLEANFILES = tcpreplay.spec *~
 DISTCLEANFILES = .tm_project.cache stamp-h1 *.tar.*
 DISTCLEANFILES = .tm_project.cache stamp-h1 *.tar.*
 
 
 MAINTAINERCLEANFILES = Makefile.in configure *.bak
 MAINTAINERCLEANFILES = Makefile.in configure *.bak
+
+EXTRA_DIST = doxygen.cfg.in

+ 12 - 8
Makefile.in

@@ -37,11 +37,12 @@ build_triplet = @build@
 host_triplet = @host@
 host_triplet = @host@
 target_triplet = @target@
 target_triplet = @target@
 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
-	$(srcdir)/Makefile.in $(srcdir)/tcpreplay.spec.in \
-	$(top_srcdir)/configure $(top_srcdir)/libopts/MakeDefs.inc \
-	config/compile config/config.guess config/config.sub \
-	config/depcomp config/install-sh config/ltmain.sh \
-	config/missing config/mkinstalldirs
+	$(srcdir)/Makefile.in $(srcdir)/doxygen.cfg.in \
+	$(srcdir)/tcpreplay.spec.in $(top_srcdir)/configure \
+	$(top_srcdir)/libopts/MakeDefs.inc config/compile \
+	config/config.guess config/config.sub config/depcomp \
+	config/install-sh config/ltmain.sh config/missing \
+	config/mkinstalldirs
 subdir = .
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.in
 am__aclocal_m4_deps = $(top_srcdir)/configure.in
@@ -51,7 +52,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno configure.status.lineno
  configure.lineno configure.status.lineno
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/src/config.h
 CONFIG_HEADER = $(top_builddir)/src/config.h
-CONFIG_CLEAN_FILES = tcpreplay.spec
+CONFIG_CLEAN_FILES = doxygen.cfg tcpreplay.spec
 SOURCES =
 SOURCES =
 DIST_SOURCES =
 DIST_SOURCES =
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@@ -220,6 +221,7 @@ TEST_DIR = $(top_builddir)/test
 MOSTLYCLEANFILES = tcpreplay.spec *~
 MOSTLYCLEANFILES = tcpreplay.spec *~
 DISTCLEANFILES = .tm_project.cache stamp-h1 *.tar.*
 DISTCLEANFILES = .tm_project.cache stamp-h1 *.tar.*
 MAINTAINERCLEANFILES = Makefile.in configure *.bak
 MAINTAINERCLEANFILES = Makefile.in configure *.bak
+EXTRA_DIST = doxygen.cfg.in
 all: all-recursive
 all: all-recursive
 
 
 .SUFFIXES:
 .SUFFIXES:
@@ -256,6 +258,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 	cd $(srcdir) && $(AUTOCONF)
 	cd $(srcdir) && $(AUTOCONF)
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
 	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+doxygen.cfg: $(top_builddir)/config.status $(srcdir)/doxygen.cfg.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
 tcpreplay.spec: $(top_builddir)/config.status $(srcdir)/tcpreplay.spec.in
 tcpreplay.spec: $(top_builddir)/config.status $(srcdir)/tcpreplay.spec.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
 	cd $(top_builddir) && $(SHELL) ./config.status $@
 
 
@@ -659,10 +663,10 @@ docs: manpages
 clean-docs:
 clean-docs:
 	cd $(DOCS_DIR) && make clean-docs
 	cd $(DOCS_DIR) && make clean-docs
 
 
-postweb: manpages
+postweb: manpages doxygen
 	cd $(DOCS_DIR) && make postweb
 	cd $(DOCS_DIR) && make postweb
 
 
-postwebsf: manpages
+postwebsf: manpages doxygen
 	cd $(DOCS_DIR) && make postwebsf
 	cd $(DOCS_DIR) && make postwebsf
 
 
 manpages: man2html
 manpages: man2html

+ 3 - 2
configure

@@ -18926,7 +18926,7 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
 
 MAJOR_VERSION=3
 MAJOR_VERSION=3
 MINOR_VERSION=0
 MINOR_VERSION=0
-MICRO_VERSION=beta6
+MICRO_VERSION=beta7
 TCPREPLAY_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
 TCPREPLAY_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
 
 
 TCPREPLAY_RELEASE=1
 TCPREPLAY_RELEASE=1
@@ -30506,7 +30506,7 @@ fi
 
 
 
 
 
 
-                                                                                                    ac_config_files="$ac_config_files Makefile lib/Makefile docs/Makefile src/Makefile src/common/Makefile src/defines.h test/Makefile test/config scripts/Makefile tcpreplay.spec"
+                                                                                                              ac_config_files="$ac_config_files Makefile doxygen.cfg lib/Makefile docs/Makefile src/Makefile src/common/Makefile src/defines.h test/Makefile test/config scripts/Makefile tcpreplay.spec"
 cat >confcache <<\_ACEOF
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
 # tests run on this system so they can be shared between configure
@@ -31100,6 +31100,7 @@ do
   # Handling of arguments.
   # Handling of arguments.
   "libopts/Makefile" ) CONFIG_FILES="$CONFIG_FILES libopts/Makefile" ;;
   "libopts/Makefile" ) CONFIG_FILES="$CONFIG_FILES libopts/Makefile" ;;
   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  "doxygen.cfg" ) CONFIG_FILES="$CONFIG_FILES doxygen.cfg" ;;
   "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
   "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
   "docs/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;;
   "docs/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;;
   "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
   "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;

+ 12 - 11
configure.in

@@ -1,5 +1,5 @@
 
 
-dnl $Id: configure.in 1362 2005-06-19 22:11:50Z aturner $
+dnl $Id: configure.in 1380 2005-06-30 05:54:26Z aturner $
 
 
 AC_INIT(tcpreplay)
 AC_INIT(tcpreplay)
 AC_CONFIG_SRCDIR(src/tcpreplay.c)
 AC_CONFIG_SRCDIR(src/tcpreplay.c)
@@ -12,7 +12,7 @@ AC_PROG_LIBTOOL
 dnl Set version info here!
 dnl Set version info here!
 MAJOR_VERSION=3
 MAJOR_VERSION=3
 MINOR_VERSION=0
 MINOR_VERSION=0
-MICRO_VERSION=beta6
+MICRO_VERSION=beta7
 TCPREPLAY_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
 TCPREPLAY_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
 
 
 dnl Release is only used for the RPM spec file
 dnl Release is only used for the RPM spec file
@@ -741,12 +741,13 @@ AC_SUBST(nic2)
 LIBOPTS_CHECK
 LIBOPTS_CHECK
 
 
 AC_OUTPUT([Makefile
 AC_OUTPUT([Makefile
-            lib/Makefile
-            docs/Makefile
-            src/Makefile
-            src/common/Makefile
-            src/defines.h
-            test/Makefile
-            test/config
-            scripts/Makefile
-            tcpreplay.spec])
+           doxygen.cfg
+           lib/Makefile
+           docs/Makefile
+           src/Makefile
+           src/common/Makefile
+           src/defines.h
+           test/Makefile
+           test/config
+           scripts/Makefile
+           tcpreplay.spec])

+ 11 - 1
docs/CHANGELOG

@@ -1,4 +1,14 @@
-$Id: CHANGELOG 1373 2005-06-28 17:13:30Z aturner $
+$Id: CHANGELOG 1400 2005-08-07 16:38:46Z aturner $
+
+08/07/2005: Version 3.0.beta7
+    - New 'make doxygen' target builds pretty source code docs in
+          docs/web/doxygen/html
+    - Fix tcpprep auto/router mode which was sending all packets out the
+          secondary interface
+    - Fix endian issue on little-endian systems which made tcpprep think all
+          packets were not IP
+    - Improve debugability of tcpprep
+    - Fix UDP header offset bug in flowreplay
 
 
 06/28/2005: Version 3.0.beta6
 06/28/2005: Version 3.0.beta6
     - Fix rpm .spec file which was still based on tcpreplay 2.x (untested)
     - Fix rpm .spec file which was still based on tcpreplay 2.x (untested)

BIN
docs/FAQ.pdf


+ 8 - 1
docs/INSTALL

@@ -1,4 +1,4 @@
-$Id: INSTALL 1313 2005-05-28 23:19:40Z aturner $
+$Id: INSTALL 1389 2005-07-03 19:34:12Z aturner $
 
 
 You'll need:
 You'll need:
 
 
@@ -28,6 +28,13 @@ http://www.tcpdump.org/
 - tcpdump (Optional. If you want packet decoding of sent packets)
 - tcpdump (Optional. If you want packet decoding of sent packets)
 http://www.tcpdump.org/
 http://www.tcpdump.org/
 
 
+- autogen >= 5.7.0 (Only necessary if you are building tcpreplay from 
+      subversion)
+http://autogen.sourceforge.net/
+
+If building from subversion:
+./autogen.sh
+
 Run:
 Run:
 ./configure ; make
 ./configure ; make
 
 

+ 2 - 0
docs/TODO

@@ -14,6 +14,8 @@ Legend:
     - others non-vanilla types?
     - others non-vanilla types?
     + Add tags?  Remove tags?  Change tags?
     + Add tags?  Remove tags?  Change tags?
     - Tag only one side of the connection
     - Tag only one side of the connection
+    - Support Q-in-Q tags:
+          http://www.informit.com/articles/article.asp?p=101367&rl=1
     - Cisco's ISL trunking?
     - Cisco's ISL trunking?
 
 
 - Add support for MPLS
 - Add support for MPLS

BIN
docs/flowreplay.pdf


File diff suppressed because it is too large
+ 210 - 216
docs/manual.pdf


+ 1 - 1
docs/web/FAQ/FAQ.html

@@ -183,7 +183,7 @@ original version by:  Nikos Drakos, CBLU, University of Leeds
 <BR><HR>
 <BR><HR>
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 1 - 1
docs/web/FAQ/index.html

@@ -183,7 +183,7 @@ original version by:  Nikos Drakos, CBLU, University of Leeds
 <BR><HR>
 <BR><HR>
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 1 - 1
docs/web/FAQ/node1.html

@@ -179,7 +179,7 @@ Contents</A>
 <BR><HR>
 <BR><HR>
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 1 - 1
docs/web/FAQ/node2.html

@@ -356,7 +356,7 @@ multiple connections.
 <!--End of Navigation Panel-->
 <!--End of Navigation Panel-->
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 1 - 1
docs/web/FAQ/node3.html

@@ -206,7 +206,7 @@ some or all of your submission to maintain a consistent coding style.
 <!--End of Navigation Panel-->
 <!--End of Navigation Panel-->
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 1 - 1
docs/web/FAQ/node4.html

@@ -207,7 +207,7 @@ was only 150K.
 <!--End of Navigation Panel-->
 <!--End of Navigation Panel-->
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 1 - 1
docs/web/FAQ/node5.html

@@ -230,7 +230,7 @@ it.
 <!--End of Navigation Panel-->
 <!--End of Navigation Panel-->
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 1 - 1
docs/web/FAQ/node6.html

@@ -202,7 +202,7 @@ seek), amount of RAM and system bus speed are all important.
 <!--End of Navigation Panel-->
 <!--End of Navigation Panel-->
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 1 - 1
docs/web/FAQ/node7.html

@@ -171,7 +171,7 @@ will become disabled.
 <!--End of Navigation Panel-->
 <!--End of Navigation Panel-->
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 1 - 1
docs/web/FAQ/node8.html

@@ -163,7 +163,7 @@ http://www.circlemud.org/&nbsp;jelson/software/tcpflow/
 <BR><HR>
 <BR><HR>
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 1 - 1
docs/web/flowreplay/flowreplay.html

@@ -109,7 +109,7 @@ original version by:  Nikos Drakos, CBLU, University of Leeds
 <BR><HR>
 <BR><HR>
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 1 - 1
docs/web/flowreplay/images.log

@@ -1,4 +1,4 @@
-This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) (format=latex 2005.5.19)  28 JUN 2005 08:52
+This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) (format=latex 2005.5.19)  7 AUG 2005 09:49
 entering extended mode
 entering extended mode
 **./images.tex
 **./images.tex
 (./images.tex
 (./images.tex

BIN
docs/web/flowreplay/img1.old


+ 1 - 1
docs/web/flowreplay/index.html

@@ -109,7 +109,7 @@ original version by:  Nikos Drakos, CBLU, University of Leeds
 <BR><HR>
 <BR><HR>
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 1 - 1
docs/web/flowreplay/node1.html

@@ -81,7 +81,7 @@ then passive devices. </SPAN>
 <BR><HR>
 <BR><HR>
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 1 - 1
docs/web/flowreplay/node2.html

@@ -152,7 +152,7 @@ of RAM.</SPAN>
 <!--End of Navigation Panel-->
 <!--End of Navigation Panel-->
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 1 - 1
docs/web/flowreplay/node3.html

@@ -190,7 +190,7 @@ from Open/Net/FreeBSD or writing our own custom stack from scratch.</SPAN>
 <!--End of Navigation Panel-->
 <!--End of Navigation Panel-->
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 1 - 1
docs/web/flowreplay/node4.html

@@ -276,7 +276,7 @@ of eof, connect fails. You must poll for both.</SPAN>
 <!--End of Navigation Panel-->
 <!--End of Navigation Panel-->
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 1 - 1
docs/web/flowreplay/node5.html

@@ -124,7 +124,7 @@ response or message.</SPAN>
 <!--End of Navigation Panel-->
 <!--End of Navigation Panel-->
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 1 - 1
docs/web/flowreplay/node6.html

@@ -213,7 +213,7 @@ and neither the socket was ready or the node timed out </SPAN>
 <!--End of Navigation Panel-->
 <!--End of Navigation Panel-->
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 29 - 23
docs/web/index.html

@@ -20,7 +20,7 @@
 <a href="manual.html">Manual</a> | 
 <a href="manual.html">Manual</a> | 
             <a href="faq.html">FAQ</a> |
             <a href="faq.html">FAQ</a> |
             <a href="http://sourceforge.net/mail/?group_id=48862">Mailing Lists</a> |
             <a href="http://sourceforge.net/mail/?group_id=48862">Mailing Lists</a> |
-            <a href="https://www.synfin.net:444/cgi-bin/viewcvs.cgi/tcpreplay/">SVN
+            <a href="https://www.synfin.net/cgi-bin/viewcvs.cgi/tcpreplay/">SVN
             Repository</a>
             Repository</a>
             -->
             -->
             <a href="#about">About</a> |
             <a href="#about">About</a> |
@@ -95,6 +95,24 @@ onto the network to do the test.
         <tr><td class=sechdr>News</td></tr>
         <tr><td class=sechdr>News</td></tr>
         <tr>
         <tr>
             <td class=section>
             <td class=section>
+                2005-07-03<br>
+                Tcpreplay 2.3.5 is released which fixes a long standing bug
+                in tcpprep with auto/router mode.  Note that *all* tcpprep
+                releases up to now in all three branches of code (1.x, 2.x
+                and 3.x) have this bug.  3.0.beta7 will have the fix, but
+                1.x is EOL.
+                <P>
+                2005-06-29<br>
+                Many thanks to <a href="http://www.cse.scu.edu/send.cgi?Z&people/parttime/DorrClark.htm">Dorr
+                    Clark</a> of Santa Clara University who provided me a
+                really nice <a href="http://www.doxygen.org">doxygen</a>
+                file for documenting the 3.0 source code.
+                <P>
+                2005-06-28<br>
+                Beta6 is out.  Fixes a number of user reported bugs.  Thanks
+                to all the beta testers who have been giving me such great
+                feedback.  Keep it comming!
+                <P>
                 2005-06-14<br>
                 2005-06-14<br>
                 Well I got a lot of good feedback on the beta4 release, so
                 Well I got a lot of good feedback on the beta4 release, so
                 beta5 fixes a number of key bugs and adds a few enhancements
                 beta5 fixes a number of key bugs and adds a few enhancements
@@ -129,16 +147,6 @@ onto the network to do the test.
                 <pre>
                 <pre>
 #include "dlt_names.h"
 #include "dlt_names.h"
                 </pre>
                 </pre>
-                2005-05-04<br>
-                3.0.beta3 has just been released which fixes some major 
-                configure and compile problems.  Users who had problems
-                building 3.0.beta2 are encouraged to try 3.0.beta3.
-                <P>
-                2005-04-20<br>
-                Just released tcpreplay 3.0.beta2!   A metric ton of bug
-                fixes and some new features as well.  First release with
-                "tcpbridge" which re-introduces the network bridge
-                functionality originally added to the 2.x tree.
                 <P>
                 <P>
                 2005-03-09<br>
                 2005-03-09<br>
                 Just re-posted a <a
                 Just re-posted a <a
@@ -148,12 +156,6 @@ onto the network to do the test.
                 getting some good tech writing experiance in the
                 getting some good tech writing experiance in the
                 networking/security space, then this might just be the
                 networking/security space, then this might just be the
                 opportunity for you!
                 opportunity for you!
-                <P>
-                2005-02-28<br>
-                New website design. Not nearly as ugly as the last one.
-                <P>
-                2005-02-27<br>
-                First 3.0 BETA released!
             </td>
             </td>
         </tr>
         </tr>
         <a name="download"></a>
         <a name="download"></a>
@@ -164,21 +166,23 @@ onto the network to do the test.
                 <ul>
                 <ul>
                     <li>Latest development release:
                     <li>Latest development release:
                     <a
                     <a
-                        href="http://prdownloads.sourceforge.net/tcpreplay/tcpreplay-3.0.beta5.tar.gz">tcpreplay-3.0.beta5.tar.gz</a>
+                        href="http://prdownloads.sourceforge.net/tcpreplay/tcpreplay-3.0.beta6.tar.gz">tcpreplay-3.0.beta6.tar.gz</a>
                     (<a
                     (<a
                         href="CHANGELOG">Changelog</a>)
                         href="CHANGELOG">Changelog</a>)
                     </li>
                     </li>
               <li>
               <li>
                 Latest stable release: 
                 Latest stable release: 
-            <a href="http://prdownloads.sourceforge.net/tcpreplay/tcpreplay-2.3.4.tar.gz">tcpreplay-2.3.4.tar.gz</a>
+            <a href="http://prdownloads.sourceforge.net/tcpreplay/tcpreplay-2.3.5.tar.gz">tcpreplay-2.3.5.tar.gz</a>
             (<a
             (<a
-                href="http://sourceforge.net/project/shownotes.php?release_id=332796">release notes</a>)
+                href="http://sourceforge.net/project/shownotes.php?release_id=339538">release notes</a>)
               </li>
               </li>
 
 
               <li>
               <li>
                 Last release supporting Libnet 1.0.x:
                 Last release supporting Libnet 1.0.x:
                 <a href="http://prdownloads.sourceforge.net/tcpreplay/tcpreplay-1.3.3.tar.gz">tcpreplay-1.3.3.tar.gz</a>
                 <a href="http://prdownloads.sourceforge.net/tcpreplay/tcpreplay-1.3.3.tar.gz">tcpreplay-1.3.3.tar.gz</a>
-                (<a href="http://sourceforge.net/project/shownotes.php?release_id=156906">release notes</a>)
+                (<a
+                    href="http://sourceforge.net/project/shownotes.php?release_id=156906">release
+                    notes</a>) Note that the 1.x series is EOL.
                 </li>
                 </li>
               <li><a
               <li><a
                   href="http://sourceforge.net/project/showfiles.php?group_id=48862">
                   href="http://sourceforge.net/project/showfiles.php?group_id=48862">
@@ -188,9 +192,9 @@ onto the network to do the test.
               <P>
               <P>
               
               
               Source via Subversion:<br>
               Source via Subversion:<br>
-              svn co https://www.synfin.net:444/svn/tcpreplay/trunk tcpreplay-trunk<br>
+              svn co https://www.synfin.net/svn/tcpreplay/trunk tcpreplay-trunk<br>
               or view it online using
               or view it online using
-              <a href="https://www.synfin.net:444/cgi-bin/viewcvs.cgi/tcpreplay/">
+              <a href="https://www.synfin.net/cgi-bin/viewcvs.cgi/tcpreplay/">
                 the web interface</a>
                 the web interface</a>
             <P>
             <P>
             Packages:
             Packages:
@@ -219,6 +223,8 @@ onto the network to do the test.
           <ul>
           <ul>
             <li><a href="manual/index.html">Manual</a></li>
             <li><a href="manual/index.html">Manual</a></li>
             <li><a href="FAQ/index.html">Frequently Asked Questions</a></li>
             <li><a href="FAQ/index.html">Frequently Asked Questions</a></li>
+            <li><a href="doxygen/html/index.html">Source code documentation via
+                Doxygen</a></li>
           </ul>
           </ul>
             3.x Man Pages:
             3.x Man Pages:
             <ul>
             <ul>

+ 12 - 1
docs/web/man/tcpreplay.html

@@ -88,7 +88,18 @@ The default <i>number</i> for this option is:
 
 
 <p>
 <p>
 
 
-<p><p><dl compact><dt><b>-m</b> <i>string</i>, <b>--multiplier</b>=<b><i>string</i></b>
+<p><p><dl compact><dt><b>-L</b>, <b>--pktlen</b>
+<dd>Override the snaplen and use the actual packet len.
+This option may appear up to 1 times.
+</dl>
+<p>
+By default, tcpreplay will send packets based on the size of the "snaplen"
+stored in the pcap file which is usually the correct thing to do.  However,
+occasionally, tools will store more bytes then told to.  By specifying this
+option, tcpreplay will ignore the snaplen field and instead try to send
+packets based on the original packet length.  Bad things (TM) may happen if
+you specify this option.
+<p><dl compact><dt><b>-m</b> <i>string</i>, <b>--multiplier</b>=<b><i>string</i></b>
 <dd>Modify replay speed to a given multiple.
 <dd>Modify replay speed to a given multiple.
 This option may appear up to 1 times.
 This option may appear up to 1 times.
 This option must not appear in combination with any of the following options:
 This option must not appear in combination with any of the following options:

+ 1 - 1
docs/web/manual/images.log

@@ -1,4 +1,4 @@
-This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) (format=latex 2005.5.19)  28 JUN 2005 08:52
+This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) (format=latex 2005.5.19)  7 AUG 2005 09:49
 entering extended mode
 entering extended mode
 **./images.tex
 **./images.tex
 (./images.tex
 (./images.tex

BIN
docs/web/manual/img1.old


+ 1 - 1
docs/web/manual/index.html

@@ -2055,7 +2055,7 @@ client
 <!--End of Navigation Panel-->
 <!--End of Navigation Panel-->
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 1 - 1
docs/web/manual/manual.css

@@ -30,6 +30,6 @@ TD.eqno			{ }	/* equation-number cells */
 /* document-specific styles come next */
 /* document-specific styles come next */
 DIV.navigation		{   }
 DIV.navigation		{   }
 DIV.center		{   }
 DIV.center		{   }
-SPAN.textit		{ font-style: italic  }
 SPAN.arabic		{   }
 SPAN.arabic		{   }
+SPAN.textit		{ font-style: italic  }
 SPAN.textbf		{ font-weight: bold  }
 SPAN.textbf		{ font-weight: bold  }

+ 1 - 1
docs/web/manual/manual.html

@@ -2055,7 +2055,7 @@ client
 <!--End of Navigation Panel-->
 <!--End of Navigation Panel-->
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 1 - 1
docs/web/manual/node1.html

@@ -162,7 +162,7 @@ http://www.circlemud.org/&nbsp;jelson/software/tcpflow/
 <BR><HR>
 <BR><HR>
 <ADDRESS>
 <ADDRESS>
 Aaron Turner
 Aaron Turner
-2005-06-28
+2005-08-07
 </ADDRESS>
 </ADDRESS>
 </BODY>
 </BODY>
 </HTML>
 </HTML>

+ 105 - 105
docs/web/tcpreplay-2-faq.html

@@ -49,221 +49,221 @@ Contents</A>
 
 
 <UL>
 <UL>
 <LI><A NAME="tex2html109"
 <LI><A NAME="tex2html109"
-  HREF="FAQ.html#SECTION02000000000000000000">1 Before You Start</A>
+  HREF="tcpreplay-2-faq.html#SECTION02000000000000000000">1 Before You Start</A>
 <UL>
 <UL>
 <LI><A NAME="tex2html110"
 <LI><A NAME="tex2html110"
-  HREF="FAQ.html#SECTION02010000000000000000">1 General Info</A>
+  HREF="tcpreplay-2-faq.html#SECTION02010000000000000000">1 General Info</A>
 <UL>
 <UL>
 <LI><A NAME="tex2html111"
 <LI><A NAME="tex2html111"
-  HREF="FAQ.html#SECTION02011000000000000000">1.1 What is this FAQ for?</A>
+  HREF="tcpreplay-2-faq.html#SECTION02011000000000000000">1.1 What is this FAQ for?</A>
 <LI><A NAME="tex2html112"
 <LI><A NAME="tex2html112"
-  HREF="FAQ.html#SECTION02012000000000000000">1.2 What tools come with tcpreplay?</A>
+  HREF="tcpreplay-2-faq.html#SECTION02012000000000000000">1.2 What tools come with tcpreplay?</A>
 <LI><A NAME="tex2html113"
 <LI><A NAME="tex2html113"
-  HREF="FAQ.html#SECTION02013000000000000000">1.3 How can I get tcpreplay's source?</A>
+  HREF="tcpreplay-2-faq.html#SECTION02013000000000000000">1.3 How can I get tcpreplay's source?</A>
 <LI><A NAME="tex2html114"
 <LI><A NAME="tex2html114"
-  HREF="FAQ.html#SECTION02014000000000000000">1.4 What requirements does tcpreplay have?</A>
+  HREF="tcpreplay-2-faq.html#SECTION02014000000000000000">1.4 What requirements does tcpreplay have?</A>
 <LI><A NAME="tex2html115"
 <LI><A NAME="tex2html115"
-  HREF="FAQ.html#SECTION02015000000000000000">1.5 How do I compile tcpreplay?</A>
+  HREF="tcpreplay-2-faq.html#SECTION02015000000000000000">1.5 How do I compile tcpreplay?</A>
 <LI><A NAME="tex2html116"
 <LI><A NAME="tex2html116"
-  HREF="FAQ.html#SECTION02016000000000000000">1.6 Are there binaries available?</A>
+  HREF="tcpreplay-2-faq.html#SECTION02016000000000000000">1.6 Are there binaries available?</A>
 <LI><A NAME="tex2html117"
 <LI><A NAME="tex2html117"
-  HREF="FAQ.html#SECTION02017000000000000000">1.7 Is there a Microsoft Windows port?</A>
+  HREF="tcpreplay-2-faq.html#SECTION02017000000000000000">1.7 Is there a Microsoft Windows port?</A>
 <LI><A NAME="tex2html118"
 <LI><A NAME="tex2html118"
-  HREF="FAQ.html#SECTION02018000000000000000">1.8 How is tcpreplay licensed?</A>
+  HREF="tcpreplay-2-faq.html#SECTION02018000000000000000">1.8 How is tcpreplay licensed?</A>
 <LI><A NAME="tex2html119"
 <LI><A NAME="tex2html119"
-  HREF="FAQ.html#SECTION02019000000000000000">1.9 What is tcpreplay?</A>
+  HREF="tcpreplay-2-faq.html#SECTION02019000000000000000">1.9 What is tcpreplay?</A>
 <LI><A NAME="tex2html120"
 <LI><A NAME="tex2html120"
-  HREF="FAQ.html#SECTION020110000000000000000">1.10 What isn't tcpreplay?</A>
+  HREF="tcpreplay-2-faq.html#SECTION020110000000000000000">1.10 What isn't tcpreplay?</A>
 <LI><A NAME="tex2html121"
 <LI><A NAME="tex2html121"
-  HREF="FAQ.html#SECTION020111000000000000000">1.11 What are some uses for tcpreplay?</A>
+  HREF="tcpreplay-2-faq.html#SECTION020111000000000000000">1.11 What are some uses for tcpreplay?</A>
 <LI><A NAME="tex2html122"
 <LI><A NAME="tex2html122"
-  HREF="FAQ.html#SECTION020112000000000000000">1.12 What are some uses for flowreplay?</A>
+  HREF="tcpreplay-2-faq.html#SECTION020112000000000000000">1.12 What are some uses for flowreplay?</A>
 <LI><A NAME="tex2html123"
 <LI><A NAME="tex2html123"
-  HREF="FAQ.html#SECTION020113000000000000000">1.13 What happened to version 1.5?</A>
+  HREF="tcpreplay-2-faq.html#SECTION020113000000000000000">1.13 What happened to version 1.5?</A>
 <LI><A NAME="tex2html124"
 <LI><A NAME="tex2html124"
-  HREF="FAQ.html#SECTION020114000000000000000">1.14 What is the history of tcpreplay?</A>
+  HREF="tcpreplay-2-faq.html#SECTION020114000000000000000">1.14 What is the history of tcpreplay?</A>
 </UL>
 </UL>
 <LI><A NAME="tex2html125"
 <LI><A NAME="tex2html125"
-  HREF="FAQ.html#SECTION02020000000000000000">2 Bugs, Feature Requests, and Patches</A>
+  HREF="tcpreplay-2-faq.html#SECTION02020000000000000000">2 Bugs, Feature Requests, and Patches</A>
 <UL>
 <UL>
 <LI><A NAME="tex2html126"
 <LI><A NAME="tex2html126"
-  HREF="FAQ.html#SECTION02021000000000000000">2.1 Where can I get help, report bugs or contact the developers?</A>
+  HREF="tcpreplay-2-faq.html#SECTION02021000000000000000">2.1 Where can I get help, report bugs or contact the developers?</A>
 <LI><A NAME="tex2html127"
 <LI><A NAME="tex2html127"
-  HREF="FAQ.html#SECTION02022000000000000000">2.2 What information should I provide when I report a bug?</A>
+  HREF="tcpreplay-2-faq.html#SECTION02022000000000000000">2.2 What information should I provide when I report a bug?</A>
 <LI><A NAME="tex2html128"
 <LI><A NAME="tex2html128"
-  HREF="FAQ.html#SECTION02023000000000000000">2.3 I have a feature request, what should I do?</A>
+  HREF="tcpreplay-2-faq.html#SECTION02023000000000000000">2.3 I have a feature request, what should I do?</A>
 <LI><A NAME="tex2html129"
 <LI><A NAME="tex2html129"
-  HREF="FAQ.html#SECTION02024000000000000000">2.4 I've written a patch for tcpreplay, how can I submit it?</A>
+  HREF="tcpreplay-2-faq.html#SECTION02024000000000000000">2.4 I've written a patch for tcpreplay, how can I submit it?</A>
 <LI><A NAME="tex2html130"
 <LI><A NAME="tex2html130"
-  HREF="FAQ.html#SECTION02025000000000000000">2.5 Patch requirements</A>
+  HREF="tcpreplay-2-faq.html#SECTION02025000000000000000">2.5 Patch requirements</A>
 </UL>
 </UL>
 </UL>
 </UL>
 <BR>
 <BR>
 <LI><A NAME="tex2html131"
 <LI><A NAME="tex2html131"
-  HREF="FAQ.html#SECTION03000000000000000000">2 Basics</A>
+  HREF="tcpreplay-2-faq.html#SECTION03000000000000000000">2 Basics</A>
 <UL>
 <UL>
 <LI><A NAME="tex2html132"
 <LI><A NAME="tex2html132"
-  HREF="FAQ.html#SECTION03010000000000000000">3 Basic Tcpreplay Usage</A>
+  HREF="tcpreplay-2-faq.html#SECTION03010000000000000000">3 Basic Tcpreplay Usage</A>
 <UL>
 <UL>
 <LI><A NAME="tex2html133"
 <LI><A NAME="tex2html133"
-  HREF="FAQ.html#SECTION03011000000000000000">3.1 Replaying the traffic</A>
+  HREF="tcpreplay-2-faq.html#SECTION03011000000000000000">3.1 Replaying the traffic</A>
 <LI><A NAME="tex2html134"
 <LI><A NAME="tex2html134"
-  HREF="FAQ.html#SECTION03012000000000000000">3.2 Replaying at different speeds</A>
+  HREF="tcpreplay-2-faq.html#SECTION03012000000000000000">3.2 Replaying at different speeds</A>
 <LI><A NAME="tex2html135"
 <LI><A NAME="tex2html135"
-  HREF="FAQ.html#SECTION03013000000000000000">3.3 Replaying the same file over and over again</A>
+  HREF="tcpreplay-2-faq.html#SECTION03013000000000000000">3.3 Replaying the same file over and over again</A>
 <LI><A NAME="tex2html136"
 <LI><A NAME="tex2html136"
-  HREF="FAQ.html#SECTION03014000000000000000">3.4 Using Configuration Files</A>
+  HREF="tcpreplay-2-faq.html#SECTION03014000000000000000">3.4 Using Configuration Files</A>
 </UL>
 </UL>
 </UL>
 </UL>
 <BR>
 <BR>
 <LI><A NAME="tex2html137"
 <LI><A NAME="tex2html137"
-  HREF="FAQ.html#SECTION04000000000000000000">3 Advanced Usage</A>
+  HREF="tcpreplay-2-faq.html#SECTION04000000000000000000">3 Advanced Usage</A>
 <UL>
 <UL>
 <LI><A NAME="tex2html138"
 <LI><A NAME="tex2html138"
-  HREF="FAQ.html#SECTION04010000000000000000">4 Output: Interfaces, Packets &amp; Files</A>
+  HREF="tcpreplay-2-faq.html#SECTION04010000000000000000">4 Output: Interfaces, Packets &amp; Files</A>
 <UL>
 <UL>
 <LI><A NAME="tex2html139"
 <LI><A NAME="tex2html139"
-  HREF="FAQ.html#SECTION04011000000000000000">4.1 Replaying on multiple interfaces</A>
+  HREF="tcpreplay-2-faq.html#SECTION04011000000000000000">4.1 Replaying on multiple interfaces</A>
 <LI><A NAME="tex2html140"
 <LI><A NAME="tex2html140"
-  HREF="FAQ.html#SECTION04012000000000000000">4.2 Selectively sending or dropping packets</A>
+  HREF="tcpreplay-2-faq.html#SECTION04012000000000000000">4.2 Selectively sending or dropping packets</A>
 <LI><A NAME="tex2html141"
 <LI><A NAME="tex2html141"
-  HREF="FAQ.html#SECTION04013000000000000000">4.3 Replaying only a few packets</A>
+  HREF="tcpreplay-2-faq.html#SECTION04013000000000000000">4.3 Replaying only a few packets</A>
 <LI><A NAME="tex2html142"
 <LI><A NAME="tex2html142"
-  HREF="FAQ.html#SECTION04014000000000000000">4.4 Skipping the first bytes in a pcap file</A>
+  HREF="tcpreplay-2-faq.html#SECTION04014000000000000000">4.4 Skipping the first bytes in a pcap file</A>
 <LI><A NAME="tex2html143"
 <LI><A NAME="tex2html143"
-  HREF="FAQ.html#SECTION04015000000000000000">4.5 Replaying packets which are bigger then the MTU</A>
+  HREF="tcpreplay-2-faq.html#SECTION04015000000000000000">4.5 Replaying packets which are bigger then the MTU</A>
 <LI><A NAME="tex2html144"
 <LI><A NAME="tex2html144"
-  HREF="FAQ.html#SECTION04016000000000000000">4.6 Writing packets to a file</A>
+  HREF="tcpreplay-2-faq.html#SECTION04016000000000000000">4.6 Writing packets to a file</A>
 <LI><A NAME="tex2html145"
 <LI><A NAME="tex2html145"
-  HREF="FAQ.html#SECTION04017000000000000000">4.7 Extracting Application Data (Layer 7)</A>
+  HREF="tcpreplay-2-faq.html#SECTION04017000000000000000">4.7 Extracting Application Data (Layer 7)</A>
 <LI><A NAME="tex2html146"
 <LI><A NAME="tex2html146"
-  HREF="FAQ.html#SECTION04018000000000000000">4.8 Replaying Live Traffic</A>
+  HREF="tcpreplay-2-faq.html#SECTION04018000000000000000">4.8 Replaying Live Traffic</A>
 <LI><A NAME="tex2html147"
 <LI><A NAME="tex2html147"
-  HREF="FAQ.html#SECTION04019000000000000000">4.9 Replaying Packet Capture Formats Other Than Libpcap</A>
+  HREF="tcpreplay-2-faq.html#SECTION04019000000000000000">4.9 Replaying Packet Capture Formats Other Than Libpcap</A>
 <LI><A NAME="tex2html148"
 <LI><A NAME="tex2html148"
-  HREF="FAQ.html#SECTION040110000000000000000">4.10 Replaying Client Traffic to a Server</A>
+  HREF="tcpreplay-2-faq.html#SECTION040110000000000000000">4.10 Replaying Client Traffic to a Server</A>
 <LI><A NAME="tex2html149"
 <LI><A NAME="tex2html149"
-  HREF="FAQ.html#SECTION040111000000000000000">4.11 Decoding Packets</A>
+  HREF="tcpreplay-2-faq.html#SECTION040111000000000000000">4.11 Decoding Packets</A>
 </UL>
 </UL>
 <LI><A NAME="tex2html150"
 <LI><A NAME="tex2html150"
-  HREF="FAQ.html#SECTION04020000000000000000">5 Packet Editing</A>
+  HREF="tcpreplay-2-faq.html#SECTION04020000000000000000">5 Packet Editing</A>
 <UL>
 <UL>
 <LI><A NAME="tex2html151"
 <LI><A NAME="tex2html151"
-  HREF="FAQ.html#SECTION04021000000000000000">5.1 Rewriting MAC addresses</A>
+  HREF="tcpreplay-2-faq.html#SECTION04021000000000000000">5.1 Rewriting MAC addresses</A>
 <LI><A NAME="tex2html152"
 <LI><A NAME="tex2html152"
-  HREF="FAQ.html#SECTION04022000000000000000">5.2 Randomizing IP addresses</A>
+  HREF="tcpreplay-2-faq.html#SECTION04022000000000000000">5.2 Randomizing IP addresses</A>
 <LI><A NAME="tex2html153"
 <LI><A NAME="tex2html153"
-  HREF="FAQ.html#SECTION04023000000000000000">5.3 Replaying (de)truncated packets</A>
+  HREF="tcpreplay-2-faq.html#SECTION04023000000000000000">5.3 Replaying (de)truncated packets</A>
 <LI><A NAME="tex2html154"
 <LI><A NAME="tex2html154"
-  HREF="FAQ.html#SECTION04024000000000000000">5.4 Rewriting Layer 2 with -2</A>
+  HREF="tcpreplay-2-faq.html#SECTION04024000000000000000">5.4 Rewriting Layer 2 with -2</A>
 <LI><A NAME="tex2html155"
 <LI><A NAME="tex2html155"
-  HREF="FAQ.html#SECTION04025000000000000000">5.5 Rewriting DLT_LINUX_SLL (Linux Cooked Socket) captures</A>
+  HREF="tcpreplay-2-faq.html#SECTION04025000000000000000">5.5 Rewriting DLT_LINUX_SLL (Linux Cooked Socket) captures</A>
 <LI><A NAME="tex2html156"
 <LI><A NAME="tex2html156"
-  HREF="FAQ.html#SECTION04026000000000000000">5.6 Rewriting IP Addresses (pseudo-NAT)</A>
+  HREF="tcpreplay-2-faq.html#SECTION04026000000000000000">5.6 Rewriting IP Addresses (pseudo-NAT)</A>
 <LI><A NAME="tex2html157"
 <LI><A NAME="tex2html157"
-  HREF="FAQ.html#SECTION04027000000000000000">5.7 Advanced pseudo-NAT</A>
+  HREF="tcpreplay-2-faq.html#SECTION04027000000000000000">5.7 Advanced pseudo-NAT</A>
 <LI><A NAME="tex2html158"
 <LI><A NAME="tex2html158"
-  HREF="FAQ.html#SECTION04028000000000000000">5.8 IP Endpoints</A>
+  HREF="tcpreplay-2-faq.html#SECTION04028000000000000000">5.8 IP Endpoints</A>
 <LI><A NAME="tex2html159"
 <LI><A NAME="tex2html159"
-  HREF="FAQ.html#SECTION04029000000000000000">5.9 Unifying Dual-Outputs</A>
+  HREF="tcpreplay-2-faq.html#SECTION04029000000000000000">5.9 Unifying Dual-Outputs</A>
 </UL>
 </UL>
 <LI><A NAME="tex2html160"
 <LI><A NAME="tex2html160"
-  HREF="FAQ.html#SECTION04030000000000000000">6 Tcpprep Usage</A>
+  HREF="tcpreplay-2-faq.html#SECTION04030000000000000000">6 Tcpprep Usage</A>
 <UL>
 <UL>
 <LI><A NAME="tex2html161"
 <LI><A NAME="tex2html161"
-  HREF="FAQ.html#SECTION04031000000000000000">6.1 What is tcpprep?</A>
+  HREF="tcpreplay-2-faq.html#SECTION04031000000000000000">6.1 What is tcpprep?</A>
 <LI><A NAME="tex2html162"
 <LI><A NAME="tex2html162"
-  HREF="FAQ.html#SECTION04032000000000000000">6.2 How does tcpprep work? </A>
+  HREF="tcpreplay-2-faq.html#SECTION04032000000000000000">6.2 How does tcpprep work? </A>
 <LI><A NAME="tex2html163"
 <LI><A NAME="tex2html163"
-  HREF="FAQ.html#SECTION04033000000000000000">6.3 Does tcpprep modify my libpcap file?</A>
+  HREF="tcpreplay-2-faq.html#SECTION04033000000000000000">6.3 Does tcpprep modify my libpcap file?</A>
 <LI><A NAME="tex2html164"
 <LI><A NAME="tex2html164"
-  HREF="FAQ.html#SECTION04034000000000000000">6.4 Why use tcpprep?</A>
+  HREF="tcpreplay-2-faq.html#SECTION04034000000000000000">6.4 Why use tcpprep?</A>
 <LI><A NAME="tex2html165"
 <LI><A NAME="tex2html165"
-  HREF="FAQ.html#SECTION04035000000000000000">6.5 Can a cache file be used for multiple (different) libpcap files? </A>
+  HREF="tcpreplay-2-faq.html#SECTION04035000000000000000">6.5 Can a cache file be used for multiple (different) libpcap files? </A>
 <LI><A NAME="tex2html166"
 <LI><A NAME="tex2html166"
-  HREF="FAQ.html#SECTION04036000000000000000">6.6 Why would I want to use tcpreplay with two network cards? </A>
+  HREF="tcpreplay-2-faq.html#SECTION04036000000000000000">6.6 Why would I want to use tcpreplay with two network cards? </A>
 <LI><A NAME="tex2html167"
 <LI><A NAME="tex2html167"
-  HREF="FAQ.html#SECTION04037000000000000000">6.7 How big are the cache files?</A>
+  HREF="tcpreplay-2-faq.html#SECTION04037000000000000000">6.7 How big are the cache files?</A>
 <LI><A NAME="tex2html168"
 <LI><A NAME="tex2html168"
-  HREF="FAQ.html#SECTION04038000000000000000">6.8 What are these 'modes' tcpprep has? </A>
+  HREF="tcpreplay-2-faq.html#SECTION04038000000000000000">6.8 What are these 'modes' tcpprep has? </A>
 <LI><A NAME="tex2html169"
 <LI><A NAME="tex2html169"
-  HREF="FAQ.html#SECTION04039000000000000000">6.9 Splitting traffic based upon IP address</A>
+  HREF="tcpreplay-2-faq.html#SECTION04039000000000000000">6.9 Splitting traffic based upon IP address</A>
 <LI><A NAME="tex2html170"
 <LI><A NAME="tex2html170"
-  HREF="FAQ.html#SECTION040310000000000000000">6.10 Auto Mode</A>
+  HREF="tcpreplay-2-faq.html#SECTION040310000000000000000">6.10 Auto Mode</A>
 <LI><A NAME="tex2html171"
 <LI><A NAME="tex2html171"
-  HREF="FAQ.html#SECTION040311000000000000000">6.11 Selectively sending/dropping packets</A>
+  HREF="tcpreplay-2-faq.html#SECTION040311000000000000000">6.11 Selectively sending/dropping packets</A>
 <LI><A NAME="tex2html172"
 <LI><A NAME="tex2html172"
-  HREF="FAQ.html#SECTION040312000000000000000">6.12 Using tcpprep cache files with tcpreplay</A>
+  HREF="tcpreplay-2-faq.html#SECTION040312000000000000000">6.12 Using tcpprep cache files with tcpreplay</A>
 <LI><A NAME="tex2html173"
 <LI><A NAME="tex2html173"
-  HREF="FAQ.html#SECTION040313000000000000000">6.13 Commenting tcpprep cache files</A>
+  HREF="tcpreplay-2-faq.html#SECTION040313000000000000000">6.13 Commenting tcpprep cache files</A>
 </UL>
 </UL>
 <LI><A NAME="tex2html174"
 <LI><A NAME="tex2html174"
-  HREF="FAQ.html#SECTION04040000000000000000">7 Flowreplay Usage</A>
+  HREF="tcpreplay-2-faq.html#SECTION04040000000000000000">7 Flowreplay Usage</A>
 <UL>
 <UL>
 <LI><A NAME="tex2html175"
 <LI><A NAME="tex2html175"
-  HREF="FAQ.html#SECTION04041000000000000000">7.1 How flowreplay works</A>
+  HREF="tcpreplay-2-faq.html#SECTION04041000000000000000">7.1 How flowreplay works</A>
 <LI><A NAME="tex2html176"
 <LI><A NAME="tex2html176"
-  HREF="FAQ.html#SECTION04042000000000000000">7.2 Running flowreplay</A>
+  HREF="tcpreplay-2-faq.html#SECTION04042000000000000000">7.2 Running flowreplay</A>
 </UL>
 </UL>
 <LI><A NAME="tex2html177"
 <LI><A NAME="tex2html177"
-  HREF="FAQ.html#SECTION04050000000000000000">8 Tuning OS's for high performance</A>
+  HREF="tcpreplay-2-faq.html#SECTION04050000000000000000">8 Tuning OS's for high performance</A>
 <UL>
 <UL>
 <LI><A NAME="tex2html178"
 <LI><A NAME="tex2html178"
-  HREF="FAQ.html#SECTION04051000000000000000">8.1 Linux 2.4.x</A>
+  HREF="tcpreplay-2-faq.html#SECTION04051000000000000000">8.1 Linux 2.4.x</A>
 <LI><A NAME="tex2html179"
 <LI><A NAME="tex2html179"
-  HREF="FAQ.html#SECTION04052000000000000000">8.2 *BSD</A>
+  HREF="tcpreplay-2-faq.html#SECTION04052000000000000000">8.2 *BSD</A>
 </UL>
 </UL>
 <LI><A NAME="tex2html180"
 <LI><A NAME="tex2html180"
-  HREF="FAQ.html#SECTION04060000000000000000">9 Understanding Common Error and Warning Messages</A>
+  HREF="tcpreplay-2-faq.html#SECTION04060000000000000000">9 Understanding Common Error and Warning Messages</A>
 <UL>
 <UL>
 <LI><A NAME="tex2html181"
 <LI><A NAME="tex2html181"
-  HREF="FAQ.html#SECTION04061000000000000000">9.1 Can't open eth0: libnet_select_device(): Can't find interface eth0</A>
+  HREF="tcpreplay-2-faq.html#SECTION04061000000000000000">9.1 Can't open eth0: libnet_select_device(): Can't find interface eth0</A>
 <LI><A NAME="tex2html182"
 <LI><A NAME="tex2html182"
-  HREF="FAQ.html#SECTION04062000000000000000">9.2 Can't open lo: libnet_select_device(): Can't find interface lo</A>
+  HREF="tcpreplay-2-faq.html#SECTION04062000000000000000">9.2 Can't open lo: libnet_select_device(): Can't find interface lo</A>
 <LI><A NAME="tex2html183"
 <LI><A NAME="tex2html183"
-  HREF="FAQ.html#SECTION04063000000000000000">9.3 Can't open eth0: UID != 0</A>
+  HREF="tcpreplay-2-faq.html#SECTION04063000000000000000">9.3 Can't open eth0: UID != 0</A>
 <LI><A NAME="tex2html184"
 <LI><A NAME="tex2html184"
-  HREF="FAQ.html#SECTION04064000000000000000">9.4 100000 write attempts failed from full buffers and were repeated</A>
+  HREF="tcpreplay-2-faq.html#SECTION04064000000000000000">9.4 100000 write attempts failed from full buffers and were repeated</A>
 <LI><A NAME="tex2html185"
 <LI><A NAME="tex2html185"
-  HREF="FAQ.html#SECTION04065000000000000000">9.5 Invalid mac address: 00:00:00:00:00:00</A>
+  HREF="tcpreplay-2-faq.html#SECTION04065000000000000000">9.5 Invalid mac address: 00:00:00:00:00:00</A>
 <LI><A NAME="tex2html186"
 <LI><A NAME="tex2html186"
-  HREF="FAQ.html#SECTION04066000000000000000">9.6 Unable to process test.cache: cache file version missmatch</A>
+  HREF="tcpreplay-2-faq.html#SECTION04066000000000000000">9.6 Unable to process test.cache: cache file version missmatch</A>
 <LI><A NAME="tex2html187"
 <LI><A NAME="tex2html187"
-  HREF="FAQ.html#SECTION04067000000000000000">9.7 Skipping SLL loopback packet.</A>
+  HREF="tcpreplay-2-faq.html#SECTION04067000000000000000">9.7 Skipping SLL loopback packet.</A>
 <LI><A NAME="tex2html188"
 <LI><A NAME="tex2html188"
-  HREF="FAQ.html#SECTION04068000000000000000">9.8 Packet length (8892) is greater then MTU; skipping packet.</A>
+  HREF="tcpreplay-2-faq.html#SECTION04068000000000000000">9.8 Packet length (8892) is greater then MTU; skipping packet.</A>
 <LI><A NAME="tex2html189"
 <LI><A NAME="tex2html189"
-  HREF="FAQ.html#SECTION04069000000000000000">9.9 Why is tcpreplay not sending all the packets?</A>
+  HREF="tcpreplay-2-faq.html#SECTION04069000000000000000">9.9 Why is tcpreplay not sending all the packets?</A>
 </UL>
 </UL>
 <LI><A NAME="tex2html190"
 <LI><A NAME="tex2html190"
-  HREF="FAQ.html#SECTION04070000000000000000">10 Required Libraries and Tools</A>
+  HREF="tcpreplay-2-faq.html#SECTION04070000000000000000">10 Required Libraries and Tools</A>
 <UL>
 <UL>
 <LI><A NAME="tex2html191"
 <LI><A NAME="tex2html191"
-  HREF="FAQ.html#SECTION04071000000000000000">10.1 Libpcap</A>
+  HREF="tcpreplay-2-faq.html#SECTION04071000000000000000">10.1 Libpcap</A>
 <LI><A NAME="tex2html192"
 <LI><A NAME="tex2html192"
-  HREF="FAQ.html#SECTION04072000000000000000">10.2 Libnet</A>
+  HREF="tcpreplay-2-faq.html#SECTION04072000000000000000">10.2 Libnet</A>
 <LI><A NAME="tex2html193"
 <LI><A NAME="tex2html193"
-  HREF="FAQ.html#SECTION04073000000000000000">10.3 Libpcapnav</A>
+  HREF="tcpreplay-2-faq.html#SECTION04073000000000000000">10.3 Libpcapnav</A>
 <LI><A NAME="tex2html194"
 <LI><A NAME="tex2html194"
-  HREF="FAQ.html#SECTION04074000000000000000">10.4 Tcpdump</A>
+  HREF="tcpreplay-2-faq.html#SECTION04074000000000000000">10.4 Tcpdump</A>
 </UL>
 </UL>
 </UL>
 </UL>
 <BR>
 <BR>
 <LI><A NAME="tex2html195"
 <LI><A NAME="tex2html195"
-  HREF="FAQ.html#SECTION05000000000000000000">4 Other Resources</A>
+  HREF="tcpreplay-2-faq.html#SECTION05000000000000000000">4 Other Resources</A>
 <UL>
 <UL>
 <LI><A NAME="tex2html196"
 <LI><A NAME="tex2html196"
-  HREF="FAQ.html#SECTION05010000000000000000">11 Other pcap tools available</A>
+  HREF="tcpreplay-2-faq.html#SECTION05010000000000000000">11 Other pcap tools available</A>
 <UL>
 <UL>
 <LI><A NAME="tex2html197"
 <LI><A NAME="tex2html197"
-  HREF="FAQ.html#SECTION05011000000000000000">11.1 Tools to capture network traffic or decode pcap files</A>
+  HREF="tcpreplay-2-faq.html#SECTION05011000000000000000">11.1 Tools to capture network traffic or decode pcap files</A>
 <LI><A NAME="tex2html198"
 <LI><A NAME="tex2html198"
-  HREF="FAQ.html#SECTION05012000000000000000">11.2 Tools to edit pcap files</A>
+  HREF="tcpreplay-2-faq.html#SECTION05012000000000000000">11.2 Tools to edit pcap files</A>
 <LI><A NAME="tex2html199"
 <LI><A NAME="tex2html199"
-  HREF="FAQ.html#SECTION05013000000000000000">11.3 Other useful tools</A>
+  HREF="tcpreplay-2-faq.html#SECTION05013000000000000000">11.3 Other useful tools</A>
 </UL>
 </UL>
 <LI><A NAME="tex2html200"
 <LI><A NAME="tex2html200"
-  HREF="FAQ.html#SECTION06010000000000000000">1 BSD License</A>
+  HREF="tcpreplay-2-faq.html#SECTION06010000000000000000">1 BSD License</A>
 </UL></UL>
 </UL></UL>
 <!--End of Table of Contents-->
 <!--End of Table of Contents-->
 
 
@@ -2257,25 +2257,25 @@ The translation was initiated by Aaron Turner on 2005-02-24
 <BR><HR><H4>Footnotes</H4>
 <BR><HR><H4>Footnotes</H4>
 <DL>
 <DL>
 <DT><A NAME="foot310">... flowreplay</A><A
 <DT><A NAME="foot310">... flowreplay</A><A
- HREF="FAQ.html#tex2html1"><SUP>1</SUP></A></DT>
+ HREF="tcpreplay-2-faq.html#tex2html1"><SUP>1</SUP></A></DT>
 <DD>Flowreplay is still ``alpha'' quality and is not usable for most
 <DD>Flowreplay is still ``alpha'' quality and is not usable for most
 situations. Anyone interested in helping me develop flowreplay is
 situations. Anyone interested in helping me develop flowreplay is
 encouraged to contact me.
 encouraged to contact me.
 
 
 </DD>
 </DD>
 <DT><A NAME="foot38">... libpcapnav</A><A
 <DT><A NAME="foot38">... libpcapnav</A><A
- HREF="FAQ.html#tex2html2"><SUP>2</SUP></A></DT>
+ HREF="tcpreplay-2-faq.html#tex2html2"><SUP>2</SUP></A></DT>
 <DD>http://netdude.sourceforge.net/
 <DD>http://netdude.sourceforge.net/
 
 
 </DD>
 </DD>
 <DT><A NAME="foot39">... tcpdump</A><A
 <DT><A NAME="foot39">... tcpdump</A><A
- HREF="FAQ.html#tex2html3"><SUP>3</SUP></A></DT>
+ HREF="tcpreplay-2-faq.html#tex2html3"><SUP>3</SUP></A></DT>
 <DD>http://www.tcpdump.org/
 <DD>http://www.tcpdump.org/
 
 
 </DD>
 </DD>
 <DT><A NAME="foot311">...
 <DT><A NAME="foot311">...
 captured</A><A
 captured</A><A
- HREF="FAQ.html#tex2html4"><SUP>4</SUP></A></DT>
+ HREF="tcpreplay-2-faq.html#tex2html4"><SUP>4</SUP></A></DT>
 <DD>Tcpreplay makes a &#34;best&#34; effort to replay traffic
 <DD>Tcpreplay makes a &#34;best&#34; effort to replay traffic
 at the given rate, but due to limitations in hardware or the pcap
 at the given rate, but due to limitations in hardware or the pcap
 file itself, it may not be possible. Capture files with only a few
 file itself, it may not be possible. Capture files with only a few
@@ -2283,56 +2283,56 @@ packets in them are especially susceptible to this.
 
 
 </DD>
 </DD>
 <DT><A NAME="foot93">... times</A><A
 <DT><A NAME="foot93">... times</A><A
- HREF="FAQ.html#tex2html5"><SUP>5</SUP></A></DT>
+ HREF="tcpreplay-2-faq.html#tex2html5"><SUP>5</SUP></A></DT>
 <DD>Looping files resets internal counters which control the speed that
 <DD>Looping files resets internal counters which control the speed that
 the file is replayed. Also because the file has to be closed and re-opened,
 the file is replayed. Also because the file has to be closed and re-opened,
 an added delay between the last and first packet may occur.
 an added delay between the last and first packet may occur.
 
 
 </DD>
 </DD>
 <DT><A NAME="foot103">... interface</A><A
 <DT><A NAME="foot103">... interface</A><A
- HREF="FAQ.html#tex2html6"><SUP>6</SUP></A></DT>
+ HREF="tcpreplay-2-faq.html#tex2html6"><SUP>6</SUP></A></DT>
 <DD>Note that you can also use the following options to split traffic
 <DD>Note that you can also use the following options to split traffic
 into two files using -w and -W which are described later on in this
 into two files using -w and -W which are described later on in this
 FAQ.
 FAQ.
 
 
 </DD>
 </DD>
 <DT><A NAME="foot105">... cachefile</A><A
 <DT><A NAME="foot105">... cachefile</A><A
- HREF="FAQ.html#tex2html7"><SUP>7</SUP></A></DT>
+ HREF="tcpreplay-2-faq.html#tex2html7"><SUP>7</SUP></A></DT>
 <DD>For information on generating tcpprep cache files, see the section
 <DD>For information on generating tcpprep cache files, see the section
 on tcpprep.
 on tcpprep.
 
 
 </DD>
 </DD>
 <DT><A NAME="foot116">... -x</A><A
 <DT><A NAME="foot116">... -x</A><A
- HREF="FAQ.html#tex2html8"><SUP>8</SUP></A></DT>
+ HREF="tcpreplay-2-faq.html#tex2html8"><SUP>8</SUP></A></DT>
 <DD>Note that if you want to send all the packets which do not match a
 <DD>Note that if you want to send all the packets which do not match a
 bpf filter, all you have to do is negate the bpf filter. See the tcpdump(1)
 bpf filter, all you have to do is negate the bpf filter. See the tcpdump(1)
 man page for more info.
 man page for more info.
 
 
 </DD>
 </DD>
 <DT><A NAME="foot149">... libpcap</A><A
 <DT><A NAME="foot149">... libpcap</A><A
- HREF="FAQ.html#tex2html9"><SUP>9</SUP></A></DT>
+ HREF="tcpreplay-2-faq.html#tex2html9"><SUP>9</SUP></A></DT>
 <DD>Note that some versions of tcpreplay prior to 1.4 also supported the
 <DD>Note that some versions of tcpreplay prior to 1.4 also supported the
 Solaris snoop format.
 Solaris snoop format.
 
 
 </DD>
 </DD>
 <DT><A NAME="foot237">... side</A><A
 <DT><A NAME="foot237">... side</A><A
- HREF="FAQ.html#tex2html10"><SUP>10</SUP></A></DT>
+ HREF="tcpreplay-2-faq.html#tex2html10"><SUP>10</SUP></A></DT>
 <DD>Flowreplay assumes the first UDP packet on a given 4-tuple is the
 <DD>Flowreplay assumes the first UDP packet on a given 4-tuple is the
 client
 client
 
 
 </DD>
 </DD>
 <DT><A NAME="foot317">... homepage</A><A
 <DT><A NAME="foot317">... homepage</A><A
- HREF="FAQ.html#tex2html11"><SUP>11</SUP></A></DT>
+ HREF="tcpreplay-2-faq.html#tex2html11"><SUP>11</SUP></A></DT>
 <DD>http://www.tcpdump.org/
 <DD>http://www.tcpdump.org/
 
 
 </DD>
 </DD>
 <DT><A NAME="foot318">... homepage</A><A
 <DT><A NAME="foot318">... homepage</A><A
- HREF="FAQ.html#tex2html12"><SUP>12</SUP></A></DT>
+ HREF="tcpreplay-2-faq.html#tex2html12"><SUP>12</SUP></A></DT>
 <DD>http://www.packetfactory.net/Projects/Libnet/
 <DD>http://www.packetfactory.net/Projects/Libnet/
 
 
 </DD>
 </DD>
 <DT><A NAME="foot319">... homepage</A><A
 <DT><A NAME="foot319">... homepage</A><A
- HREF="FAQ.html#tex2html13"><SUP>13</SUP></A></DT>
+ HREF="tcpreplay-2-faq.html#tex2html13"><SUP>13</SUP></A></DT>
 <DD>http://netdude.sourceforge.net/
 <DD>http://netdude.sourceforge.net/
 
 
 </DD>
 </DD>

File diff suppressed because it is too large
+ 1336 - 0
doxygen.cfg.in


+ 15 - 11
src/common/cidr.c

@@ -1,4 +1,4 @@
-/* $Id: cidr.c 1003 2004-11-24 04:49:53Z aturner $ */
+/* $Id: cidr.c 1384 2005-07-03 19:26:24Z aturner $ */
 
 
 /*
 /*
  * Copyright (c) 2001-2004 Aaron Turner.
  * Copyright (c) 2001-2004 Aaron Turner.
@@ -99,15 +99,16 @@ destroy_cidr(cidr_t * cidr)
  * adds a new cidr_t entry to cidrdata
  * adds a new cidr_t entry to cidrdata
  */
  */
 void
 void
-add_cidr(cidr_t * cidrdata, cidr_t ** newcidr)
+add_cidr(cidr_t ** cidrdata, cidr_t ** newcidr)
 {
 {
     cidr_t *cidr_ptr;
     cidr_t *cidr_ptr;
+    dbg(1, "Running new_cidr()");
 
 
-    if (cidrdata == NULL) {
-        cidrdata = *newcidr;
+    if (*cidrdata == NULL) {
+        *cidrdata = *newcidr;
     }
     }
     else {
     else {
-        cidr_ptr = cidrdata;
+        cidr_ptr = *cidrdata;
 
 
         while (cidr_ptr->next != NULL) {
         while (cidr_ptr->next != NULL) {
             cidr_ptr = cidr_ptr->next;
             cidr_ptr = cidr_ptr->next;
@@ -127,8 +128,7 @@ ip2cidr(const unsigned long ip, const int masklen)
     u_char *network;
     u_char *network;
     char mask[3];
     char mask[3];
 
 
-    if ((network = (u_char *) malloc(20)) == NULL)
-        errx(1, "malloc(): %s", strerror(errno));
+    network = (u_char *)safe_malloc(20);
 
 
     strlcpy((char *)network, (char *)libnet_addr2name4(ip, LIBNET_DONT_RESOLVE),
     strlcpy((char *)network, (char *)libnet_addr2name4(ip, LIBNET_DONT_RESOLVE),
             sizeof(network));
             sizeof(network));
@@ -428,9 +428,12 @@ check_ip_cidr(cidr_t * cidrdata, const unsigned long ip)
 {
 {
     cidr_t *mycidr;
     cidr_t *mycidr;
 
 
-    /* if we have no cidrdata, of course it isn't in there */
-    if (cidrdata == NULL)
+    /* if we have no cidrdata, of course it isn't in there 
+     * this actually should happen occasionally, so don't put an assert here
+     */
+    if (cidrdata == NULL) {
         return 0;
         return 0;
+    }
 
 
     mycidr = cidrdata;
     mycidr = cidrdata;
 
 
@@ -439,6 +442,7 @@ check_ip_cidr(cidr_t * cidrdata, const unsigned long ip)
 
 
         /* if match, return 1 */
         /* if match, return 1 */
         if (ip_in_cidr(mycidr, ip)) {
         if (ip_in_cidr(mycidr, ip)) {
+            dbg(3, "Found %s in cidr", libnet_addr2name4(ip, RESOLVE));
             return 1;
             return 1;
         }
         }
         /* check for next record */
         /* check for next record */
@@ -451,6 +455,7 @@ check_ip_cidr(cidr_t * cidrdata, const unsigned long ip)
     }
     }
 
 
     /* if we get here, no match */
     /* if we get here, no match */
+    dbg(3, "Didn't find %s in cidr", libnet_addr2name4(ip, RESOLVE));
     return 0;
     return 0;
 }
 }
 
 
@@ -479,8 +484,7 @@ cidr2iplist(cidr_t * cidr, char delim)
     }
     }
     size = 16 * numips;
     size = 16 * numips;
 
 
-    if ((list = (char *)malloc(size)) == NULL)
-        errx(1, "Unable to malloc %d bytes!  Aborting...", size);
+    list = (char *)safe_malloc(size);
 
 
     memset(list, 0, size);
     memset(list, 0, size);
 
 

+ 2 - 2
src/common/cidr.h

@@ -1,4 +1,4 @@
-/* $Id: cidr.h 987 2004-11-17 00:24:57Z aturner $ */
+/* $Id: cidr.h 1384 2005-07-03 19:26:24Z aturner $ */
 
 
 /*
 /*
  * Copyright (c) 2001-2004 Aaron Turner.
  * Copyright (c) 2001-2004 Aaron Turner.
@@ -54,7 +54,7 @@ int parse_cidr(cidr_t **, char *, char *delim);
 int parse_cidr_map(cidrmap_t **, const char *);
 int parse_cidr_map(cidrmap_t **, const char *);
 int parse_endpoints(cidrmap_t **, cidrmap_t **, const char *);
 int parse_endpoints(cidrmap_t **, cidrmap_t **, const char *);
 u_char *ip2cidr(const unsigned long, const int);
 u_char *ip2cidr(const unsigned long, const int);
-void add_cidr(cidr_t *, cidr_t **);
+void add_cidr(cidr_t **, cidr_t **);
 cidr_t *new_cidr(void);
 cidr_t *new_cidr(void);
 cidrmap_t *new_cidr_map(void);
 cidrmap_t *new_cidr_map(void);
 void destroy_cidr(cidr_t *);
 void destroy_cidr(cidr_t *);

+ 1 - 6
src/common/get.c

@@ -165,12 +165,7 @@ get_ipv4(const u_char *pktdata, int datalen, int datalink, u_char **newbuff)
 
 
     proto = get_l2protocol(pktdata, datalen, datalink);
     proto = get_l2protocol(pktdata, datalen, datalink);
 
 
-    /*
-     * ARG!  Why on Intel do I have to htons(proto)?  
-     * I'm returning the eth_hdr->ether_type, but it's coming across
-     * in little endian format... WTF?
-     */
-    if (htons(proto) != ETHERTYPE_IP)
+    if (proto != ETHERTYPE_IP)
         return NULL;
         return NULL;
 
 
 #ifdef FORCE_ALIGN
 #ifdef FORCE_ALIGN

+ 1 - 1
src/common/svn_version.c

@@ -1,4 +1,4 @@
-const char SVN_Version[] = "1371";
+const char SVN_Version[] = "1397:1399M";
 const char *svn_version(void) {
 const char *svn_version(void) {
 	return SVN_Version;
 	return SVN_Version;
 }
 }

+ 4 - 4
src/common/utils.c

@@ -1,4 +1,4 @@
-/* $Id: utils.c 1159 2005-02-27 00:25:20Z aturner $ */
+/* $Id: utils.c 1385 2005-07-03 19:28:38Z aturner $ */
 
 
 /*
 /*
  * Copyright (c) 2001-2005 Aaron Turner.
  * Copyright (c) 2001-2005 Aaron Turner.
@@ -57,7 +57,7 @@ _our_safe_malloc(size_t len, const char *funcname, const int line, const char *f
     
     
 #ifdef DEBUG
 #ifdef DEBUG
     /* wrapped inside an #ifdef for better performance */
     /* wrapped inside an #ifdef for better performance */
-    dbg(4, "Malloc'd %d bytes in %s:%s() line %d", len, file, funcname, line);
+    dbg(5, "Malloc'd %d bytes in %s:%s() line %d", len, file, funcname, line);
 #endif
 #endif
     
     
     return (void *)ptr;
     return (void *)ptr;
@@ -77,7 +77,7 @@ _our_safe_realloc(void *ptr, size_t len, const char *funcname, const int line, c
             funcname, line, file, len);
             funcname, line, file, len);
 
 
 #ifdef DEBUG
 #ifdef DEBUG
-    dbg(4, "Remalloc'd buffer to %d bytes in %s:%s() line %d", len, file, funcname, line);
+    dbg(5, "Remalloc'd buffer to %d bytes in %s:%s() line %d", len, file, funcname, line);
 #endif
 #endif
 
 
     return ptr;
     return ptr;
@@ -184,7 +184,7 @@ read_hexstring(const char *l2string, u_char *hex, const int hexlen)
 
 
     free(string);
     free(string);
 
 
-    dbg(1, "Read %d bytes of layer 2 data", numbytes);
+    dbg(1, "Read %d bytes of hex data", numbytes);
     return (numbytes);
     return (numbytes);
 }
 }
 
 

+ 2 - 2
src/flowreplay.1

@@ -1,7 +1,7 @@
-.TH FLOWREPLAY 1 2005-06-12 "" "Programmer's Manual"
+.TH FLOWREPLAY 1 2005-07-28 "" "Programmer's Manual"
 .\"  DO NOT EDIT THIS FILE   (flowreplay.1)
 .\"  DO NOT EDIT THIS FILE   (flowreplay.1)
 .\"  
 .\"  
-.\"  It has been AutoGen-ed  Sunday June 12, 2005 at 10:24:36 PM PDT
+.\"  It has been AutoGen-ed  Thursday July 28, 2005 at 09:53:37 PM PDT
 .\"  From the definitions    flowreplay_opts.def
 .\"  From the definitions    flowreplay_opts.def
 .\"  and the template file   agman1.tpl
 .\"  and the template file   agman1.tpl
 .\"
 .\"

+ 2 - 2
src/flowreplay.c

@@ -1,4 +1,4 @@
-/* $Id: flowreplay.c 1366 2005-06-23 17:22:48Z aturner $ */
+/* $Id: flowreplay.c 1398 2005-07-29 04:34:10Z aturner $ */
 
 
 /*
 /*
  * Copyright (c) 2001-2004 Aaron Turner.
  * Copyright (c) 2001-2004 Aaron Turner.
@@ -317,7 +317,7 @@ process_packet(struct session_t *node, ip_hdr_t * ip_hdr, void *l4)
     else if (node->proto == IPPROTO_UDP) {
     else if (node->proto == IPPROTO_UDP) {
         /* packet is UDP */
         /* packet is UDP */
         udp_hdr = (udp_hdr_t *) l4;
         udp_hdr = (udp_hdr_t *) l4;
-        len = ntohs(ip_hdr->ip_len) - (ip_hdr->ip_hl * 4) - sizeof(tcp_hdr_t);
+        len = ntohs(ip_hdr->ip_len) - (ip_hdr->ip_hl * 4) - sizeof(udp_hdr_t);
 
 
         /* check client to server */
         /* check client to server */
         if ((ip_hdr->ip_dst.s_addr == node->server_ip) &&
         if ((ip_hdr->ip_dst.s_addr == node->server_ip) &&

+ 1 - 1
src/flowreplay_opts.c

@@ -2,7 +2,7 @@
  *  
  *  
  *  DO NOT EDIT THIS FILE   (flowreplay_opts.c)
  *  DO NOT EDIT THIS FILE   (flowreplay_opts.c)
  *  
  *  
- *  It has been AutoGen-ed  Sunday June 12, 2005 at 10:24:31 PM PDT
+ *  It has been AutoGen-ed  Thursday July 28, 2005 at 09:54:29 PM PDT
  *  From the definitions    flowreplay_opts.def
  *  From the definitions    flowreplay_opts.def
  *  and the template file   options
  *  and the template file   options
  */
  */

+ 1 - 1
src/flowreplay_opts.h

@@ -2,7 +2,7 @@
  *  
  *  
  *  DO NOT EDIT THIS FILE   (flowreplay_opts.h)
  *  DO NOT EDIT THIS FILE   (flowreplay_opts.h)
  *  
  *  
- *  It has been AutoGen-ed  Sunday June 12, 2005 at 10:24:31 PM PDT
+ *  It has been AutoGen-ed  Thursday July 28, 2005 at 09:54:29 PM PDT
  *  From the definitions    flowreplay_opts.def
  *  From the definitions    flowreplay_opts.def
  *  and the template file   options
  *  and the template file   options
  */
  */

+ 2 - 2
src/tcpbridge.1

@@ -1,7 +1,7 @@
-.TH TCPBRIDGE 1 2005-06-12 "" "Programmer's Manual"
+.TH TCPBRIDGE 1 2005-07-28 "" "Programmer's Manual"
 .\"  DO NOT EDIT THIS FILE   (tcpbridge.1)
 .\"  DO NOT EDIT THIS FILE   (tcpbridge.1)
 .\"  
 .\"  
-.\"  It has been AutoGen-ed  Sunday June 12, 2005 at 10:24:35 PM PDT
+.\"  It has been AutoGen-ed  Thursday July 28, 2005 at 09:53:37 PM PDT
 .\"  From the definitions    tcpbridge_opts.def
 .\"  From the definitions    tcpbridge_opts.def
 .\"  and the template file   agman1.tpl
 .\"  and the template file   agman1.tpl
 .\"
 .\"

+ 1 - 1
src/tcpbridge_opts.c

@@ -2,7 +2,7 @@
  *  
  *  
  *  DO NOT EDIT THIS FILE   (tcpbridge_opts.c)
  *  DO NOT EDIT THIS FILE   (tcpbridge_opts.c)
  *  
  *  
- *  It has been AutoGen-ed  Sunday June 12, 2005 at 10:24:27 PM PDT
+ *  It has been AutoGen-ed  Thursday July 28, 2005 at 09:57:20 PM PDT
  *  From the definitions    tcpbridge_opts.def
  *  From the definitions    tcpbridge_opts.def
  *  and the template file   options
  *  and the template file   options
  */
  */

+ 1 - 1
src/tcpbridge_opts.h

@@ -2,7 +2,7 @@
  *  
  *  
  *  DO NOT EDIT THIS FILE   (tcpbridge_opts.h)
  *  DO NOT EDIT THIS FILE   (tcpbridge_opts.h)
  *  
  *  
- *  It has been AutoGen-ed  Sunday June 12, 2005 at 10:24:26 PM PDT
+ *  It has been AutoGen-ed  Thursday July 28, 2005 at 09:57:20 PM PDT
  *  From the definitions    tcpbridge_opts.def
  *  From the definitions    tcpbridge_opts.def
  *  and the template file   options
  *  and the template file   options
  */
  */

+ 2 - 2
src/tcpprep.1

@@ -1,7 +1,7 @@
-.TH TCPPREP 1 2005-06-28 "" "Programmer's Manual"
+.TH TCPPREP 1 2005-07-28 "" "Programmer's Manual"
 .\"  DO NOT EDIT THIS FILE   (tcpprep.1)
 .\"  DO NOT EDIT THIS FILE   (tcpprep.1)
 .\"  
 .\"  
-.\"  It has been AutoGen-ed  Tuesday June 28, 2005 at 10:04:45 AM PDT
+.\"  It has been AutoGen-ed  Thursday July 28, 2005 at 09:53:36 PM PDT
 .\"  From the definitions    tcpprep_opts.def
 .\"  From the definitions    tcpprep_opts.def
 .\"  and the template file   agman1.tpl
 .\"  and the template file   agman1.tpl
 .\"
 .\"

+ 18 - 3
src/tcpprep.c

@@ -1,4 +1,4 @@
-/* $Id: tcpprep.c 1331 2005-06-07 04:06:33Z aturner $ */
+/* $Id: tcpprep.c 1383 2005-07-03 19:21:06Z aturner $ */
 
 
 /*
 /*
  * Copyright (c) 2001-2005 Aaron Turner.
  * Copyright (c) 2001-2005 Aaron Turner.
@@ -309,14 +309,17 @@ process_raw_packets(pcap_t * pcap)
 
 
         /* get the IP header (if any) */
         /* get the IP header (if any) */
         buffptr = ipbuff;
         buffptr = ipbuff;
-        ip_hdr = (ip_hdr_t *)get_ipv4(pktdata, pkthdr.caplen, pcap_datalink(pcap), &buffptr);
+        ip_hdr = (ip_hdr_t *)get_ipv4(pktdata, pkthdr.caplen, 
+                pcap_datalink(pcap), &buffptr);
         
         
         if (ip_hdr == NULL) {
         if (ip_hdr == NULL) {
             dbg(2, "Packet isn't IP");
             dbg(2, "Packet isn't IP");
 
 
             /* we don't want to cache these packets twice */
             /* we don't want to cache these packets twice */
-            if (options.mode != AUTO_MODE)
+            if (options.mode != AUTO_MODE) {
+                dbg(3, "Adding to cache using options for Non-IP packets");
                 add_cache(&options.cachedata, SEND, options.nonip);
                 add_cache(&options.cachedata, SEND, options.nonip);
+            }
 
 
             continue;
             continue;
         }
         }
@@ -333,18 +336,26 @@ process_raw_packets(pcap_t * pcap)
 
 
         switch (options.mode) {
         switch (options.mode) {
         case REGEX_MODE:
         case REGEX_MODE:
+            dbg(2, "processing regex mode...");
             cache_result = add_cache(&options.cachedata, SEND, 
             cache_result = add_cache(&options.cachedata, SEND, 
                 check_ip_regex(ip_hdr->ip_src.s_addr));
                 check_ip_regex(ip_hdr->ip_src.s_addr));
             break;
             break;
         case CIDR_MODE:
         case CIDR_MODE:
+            dbg(2, "processing cidr mode...");
             cache_result = add_cache(&options.cachedata, SEND,
             cache_result = add_cache(&options.cachedata, SEND,
                       check_ip_cidr(options.cidrdata, ip_hdr->ip_src.s_addr));
                       check_ip_cidr(options.cidrdata, ip_hdr->ip_src.s_addr));
             break;
             break;
         case AUTO_MODE:
         case AUTO_MODE:
+            dbg(2, "processing first pass of auto mode...");
             /* first run through in auto mode: create tree */
             /* first run through in auto mode: create tree */
             add_tree(ip_hdr->ip_src.s_addr, pktdata);
             add_tree(ip_hdr->ip_src.s_addr, pktdata);
             break;
             break;
         case ROUTER_MODE:
         case ROUTER_MODE:
+            /* 
+             * second run through in auto mode: create route
+             * based cache
+             */
+            dbg(2, "processing second pass of auto: router mode...");
             cache_result = add_cache(&options.cachedata, SEND,
             cache_result = add_cache(&options.cachedata, SEND,
                       check_ip_cidr(options.cidrdata, ip_hdr->ip_src.s_addr));
                       check_ip_cidr(options.cidrdata, ip_hdr->ip_src.s_addr));
             break;
             break;
@@ -353,6 +364,7 @@ process_raw_packets(pcap_t * pcap)
              * second run through in auto mode: create bridge
              * second run through in auto mode: create bridge
              * based cache
              * based cache
              */
              */
+            dbg(2, "processing second pass of auto: bridge mode...");
             cache_result = add_cache(&options.cachedata, SEND,
             cache_result = add_cache(&options.cachedata, SEND,
                       check_ip_tree(UNKNOWN, ip_hdr->ip_src.s_addr));
                       check_ip_tree(UNKNOWN, ip_hdr->ip_src.s_addr));
             break;
             break;
@@ -361,6 +373,7 @@ process_raw_packets(pcap_t * pcap)
              * second run through in auto mode: create bridge
              * second run through in auto mode: create bridge
              * where unknowns are servers
              * where unknowns are servers
              */
              */
+            dbg(2, "processing second pass of auto: server mode...");
             cache_result = add_cache(&options.cachedata, SEND,
             cache_result = add_cache(&options.cachedata, SEND,
                       check_ip_tree(SERVER, ip_hdr->ip_src.s_addr));
                       check_ip_tree(SERVER, ip_hdr->ip_src.s_addr));
             break;
             break;
@@ -369,6 +382,7 @@ process_raw_packets(pcap_t * pcap)
              * second run through in auto mode: create bridge
              * second run through in auto mode: create bridge
              * where unknowns are clients
              * where unknowns are clients
              */
              */
+            dbg(2, "processing second pass of auto: client mode...");
             cache_result = add_cache(&options.cachedata, SEND,
             cache_result = add_cache(&options.cachedata, SEND,
                       check_ip_tree(CLIENT, ip_hdr->ip_src.s_addr));
                       check_ip_tree(CLIENT, ip_hdr->ip_src.s_addr));
             break;
             break;
@@ -376,6 +390,7 @@ process_raw_packets(pcap_t * pcap)
             /*
             /*
              * process ports based on their destination port
              * process ports based on their destination port
              */
              */
+            dbg(2, "processing port mode...");
             cache_result = add_cache(&options.cachedata, SEND, 
             cache_result = add_cache(&options.cachedata, SEND, 
                       check_dst_port(ip_hdr, (pkthdr.caplen - l2len)));
                       check_dst_port(ip_hdr, (pkthdr.caplen - l2len)));
             break;
             break;

+ 1 - 1
src/tcpprep_opts.c

@@ -2,7 +2,7 @@
  *  
  *  
  *  DO NOT EDIT THIS FILE   (tcpprep_opts.c)
  *  DO NOT EDIT THIS FILE   (tcpprep_opts.c)
  *  
  *  
- *  It has been AutoGen-ed  Tuesday June 28, 2005 at 10:04:41 AM PDT
+ *  It has been AutoGen-ed  Thursday July 28, 2005 at 09:57:15 PM PDT
  *  From the definitions    tcpprep_opts.def
  *  From the definitions    tcpprep_opts.def
  *  and the template file   options
  *  and the template file   options
  */
  */

+ 1 - 1
src/tcpprep_opts.h

@@ -2,7 +2,7 @@
  *  
  *  
  *  DO NOT EDIT THIS FILE   (tcpprep_opts.h)
  *  DO NOT EDIT THIS FILE   (tcpprep_opts.h)
  *  
  *  
- *  It has been AutoGen-ed  Tuesday June 28, 2005 at 10:04:40 AM PDT
+ *  It has been AutoGen-ed  Thursday July 28, 2005 at 09:57:15 PM PDT
  *  From the definitions    tcpprep_opts.def
  *  From the definitions    tcpprep_opts.def
  *  and the template file   options
  *  and the template file   options
  */
  */

+ 2 - 2
src/tcpreplay.1

@@ -1,7 +1,7 @@
-.TH TCPREPLAY 1 2005-06-12 "" "Programmer's Manual"
+.TH TCPREPLAY 1 2005-07-28 "" "Programmer's Manual"
 .\"  DO NOT EDIT THIS FILE   (tcpreplay.1)
 .\"  DO NOT EDIT THIS FILE   (tcpreplay.1)
 .\"  
 .\"  
-.\"  It has been AutoGen-ed  Sunday June 12, 2005 at 10:24:34 PM PDT
+.\"  It has been AutoGen-ed  Thursday July 28, 2005 at 09:53:37 PM PDT
 .\"  From the definitions    tcpreplay_opts.def
 .\"  From the definitions    tcpreplay_opts.def
 .\"  and the template file   agman1.tpl
 .\"  and the template file   agman1.tpl
 .\"
 .\"

+ 1 - 1
src/tcpreplay_opts.c

@@ -2,7 +2,7 @@
  *  
  *  
  *  DO NOT EDIT THIS FILE   (tcpreplay_opts.c)
  *  DO NOT EDIT THIS FILE   (tcpreplay_opts.c)
  *  
  *  
- *  It has been AutoGen-ed  Sunday June 12, 2005 at 10:24:13 PM PDT
+ *  It has been AutoGen-ed  Thursday July 28, 2005 at 09:57:13 PM PDT
  *  From the definitions    tcpreplay_opts.def
  *  From the definitions    tcpreplay_opts.def
  *  and the template file   options
  *  and the template file   options
  */
  */

+ 1 - 1
src/tcpreplay_opts.h

@@ -2,7 +2,7 @@
  *  
  *  
  *  DO NOT EDIT THIS FILE   (tcpreplay_opts.h)
  *  DO NOT EDIT THIS FILE   (tcpreplay_opts.h)
  *  
  *  
- *  It has been AutoGen-ed  Sunday June 12, 2005 at 10:24:12 PM PDT
+ *  It has been AutoGen-ed  Thursday July 28, 2005 at 09:57:13 PM PDT
  *  From the definitions    tcpreplay_opts.def
  *  From the definitions    tcpreplay_opts.def
  *  and the template file   options
  *  and the template file   options
  */
  */

+ 2 - 2
src/tcprewrite.1

@@ -1,7 +1,7 @@
-.TH TCPREWRITE 1 2005-06-12 "" "Programmer's Manual"
+.TH TCPREWRITE 1 2005-07-28 "" "Programmer's Manual"
 .\"  DO NOT EDIT THIS FILE   (tcprewrite.1)
 .\"  DO NOT EDIT THIS FILE   (tcprewrite.1)
 .\"  
 .\"  
-.\"  It has been AutoGen-ed  Sunday June 12, 2005 at 10:24:35 PM PDT
+.\"  It has been AutoGen-ed  Thursday July 28, 2005 at 09:53:37 PM PDT
 .\"  From the definitions    tcprewrite_opts.def
 .\"  From the definitions    tcprewrite_opts.def
 .\"  and the template file   agman1.tpl
 .\"  and the template file   agman1.tpl
 .\"
 .\"

+ 1 - 1
src/tcprewrite_opts.c

@@ -2,7 +2,7 @@
  *  
  *  
  *  DO NOT EDIT THIS FILE   (tcprewrite_opts.c)
  *  DO NOT EDIT THIS FILE   (tcprewrite_opts.c)
  *  
  *  
- *  It has been AutoGen-ed  Sunday June 12, 2005 at 10:24:21 PM PDT
+ *  It has been AutoGen-ed  Thursday July 28, 2005 at 09:57:17 PM PDT
  *  From the definitions    tcprewrite_opts.def
  *  From the definitions    tcprewrite_opts.def
  *  and the template file   options
  *  and the template file   options
  */
  */

+ 1 - 1
src/tcprewrite_opts.h

@@ -2,7 +2,7 @@
  *  
  *  
  *  DO NOT EDIT THIS FILE   (tcprewrite_opts.h)
  *  DO NOT EDIT THIS FILE   (tcprewrite_opts.h)
  *  
  *  
- *  It has been AutoGen-ed  Sunday June 12, 2005 at 10:24:20 PM PDT
+ *  It has been AutoGen-ed  Thursday July 28, 2005 at 09:57:17 PM PDT
  *  From the definitions    tcprewrite_opts.def
  *  From the definitions    tcprewrite_opts.def
  *  and the template file   options
  *  and the template file   options
  */
  */

+ 44 - 29
src/tree.c

@@ -1,4 +1,4 @@
-/* $Id: tree.c 1368 2005-06-28 05:25:16Z aturner $ */
+/* $Id: tree.c 1386 2005-07-03 19:29:26Z aturner $ */
 
 
 /*
 /*
  * Copyright (c) 2001-2005 Aaron Turner.
  * Copyright (c) 2001-2005 Aaron Turner.
@@ -47,14 +47,15 @@ extern tcpprep_opt_t options;
 extern int debug;
 extern int debug;
 #endif
 #endif
 
 
-int checkincidr;
+/* static buffer used by tree_print*() functions */
+char tree_print_buff[TREEPRINTBUFFLEN]; 
 
 
 static tree_t *new_tree();
 static tree_t *new_tree();
 static tree_t *packet2tree(const u_char *);
 static tree_t *packet2tree(const u_char *);
-static void tree_print(data_tree_t *);
-static void tree_printnode(const char *, const tree_t *);
+static char *tree_print(data_tree_t *);
+static char *tree_printnode(const char *, const tree_t *);
 static void tree_buildcidr(data_tree_t *, buildcidr_t *);
 static void tree_buildcidr(data_tree_t *, buildcidr_t *);
-static void tree_checkincidr(data_tree_t *, buildcidr_t *);
+static int tree_checkincidr(data_tree_t *, buildcidr_t *);
 
 
 RB_PROTOTYPE(data_tree_s, tree_s, node, tree_comp)
 RB_PROTOTYPE(data_tree_s, tree_s, node, tree_comp)
 RB_GENERATE(data_tree_s, tree_s, node, tree_comp)
 RB_GENERATE(data_tree_s, tree_s, node, tree_comp)
@@ -71,6 +72,7 @@ tree_buildcidr(data_tree_t *treeroot, buildcidr_t * bcdata)
     unsigned long network = 0;
     unsigned long network = 0;
     unsigned long mask = ~0;    /* turn on all bits */
     unsigned long mask = ~0;    /* turn on all bits */
 
 
+    dbg(1, "Running: tree_buildcidr()");
 
 
     RB_FOREACH(node, data_tree_s, treeroot) {
     RB_FOREACH(node, data_tree_s, treeroot) {
 
 
@@ -82,12 +84,17 @@ tree_buildcidr(data_tree_t *treeroot, buildcidr_t * bcdata)
          * in cases of leaves and last visit add to cidrdata if
          * in cases of leaves and last visit add to cidrdata if
          * necessary
          * necessary
          */
          */
+        dbg(4, "Checking if node exists...");
         if (!check_ip_cidr(options.cidrdata, node->ip)) {   /* if we exist, abort */
         if (!check_ip_cidr(options.cidrdata, node->ip)) {   /* if we exist, abort */
+            dbg(3, "Node %s doesn't exist... creating.", 
+                    libnet_addr2name4(node->ip, RESOLVE));
             newcidr = new_cidr();
             newcidr = new_cidr();
             newcidr->masklen = bcdata->masklen;
             newcidr->masklen = bcdata->masklen;
-            network = node->ip & (mask >> (32 - bcdata->masklen));
+            network = node->ip & (mask << (32 - bcdata->masklen));
+            dbg(3, "Using network: %s", 
+                    libnet_addr2name4(network, LIBNET_DONT_RESOLVE));
             newcidr->network = network;
             newcidr->network = network;
-            add_cidr(options.cidrdata, &newcidr);
+            add_cidr(&options.cidrdata, &newcidr);
         }
         }
     }
     }
 }
 }
@@ -97,9 +104,8 @@ tree_buildcidr(data_tree_t *treeroot, buildcidr_t * bcdata)
  * uses rbwalk to check to see if a given ip address of a given type in the
  * uses rbwalk to check to see if a given ip address of a given type in the
  * tree is inside any of the cidrdata
  * tree is inside any of the cidrdata
  *
  *
- * since this is void, we return via the global int checkincidr
  */
  */
-void
+static int
 tree_checkincidr(data_tree_t *treeroot, buildcidr_t * bcdata)
 tree_checkincidr(data_tree_t *treeroot, buildcidr_t * bcdata)
 {
 {
     tree_t *node = NULL;
     tree_t *node = NULL;
@@ -110,16 +116,17 @@ tree_checkincidr(data_tree_t *treeroot, buildcidr_t * bcdata)
         /* we only check types that are vaild */
         /* we only check types that are vaild */
         if (bcdata->type != ANY)    /* don't check if we're adding ANY */
         if (bcdata->type != ANY)    /* don't check if we're adding ANY */
             if (bcdata->type != node->type) /* no match, exit early */
             if (bcdata->type != node->type) /* no match, exit early */
-                return;
+                return 0;
 
 
         /*
         /*
          * in cases of leaves and last visit add to cidrdata if
          * in cases of leaves and last visit add to cidrdata if
          * necessary
          * necessary
          */
          */
         if (check_ip_cidr(options.cidrdata, node->ip)) {    /* if we exist, abort */
         if (check_ip_cidr(options.cidrdata, node->ip)) {    /* if we exist, abort */
-            checkincidr = 1;
+            return 1;
         }
         }
     }
     }
+    return 0;
 }
 }
 
 
 /*
 /*
@@ -136,6 +143,8 @@ process_tree()
     buildcidr_t *bcdata;
     buildcidr_t *bcdata;
 
 
 
 
+    dbg(1, "Running: process_tree()");
+
     bcdata = (buildcidr_t *)safe_malloc(sizeof(buildcidr_t));
     bcdata = (buildcidr_t *)safe_malloc(sizeof(buildcidr_t));
 
 
     for (mymask = options.max_mask; mymask <= options.min_mask; mymask++) {
     for (mymask = options.max_mask; mymask <= options.min_mask; mymask++) {
@@ -152,11 +161,9 @@ process_tree()
         tree_calculate(&treeroot);
         tree_calculate(&treeroot);
 
 
         /* try to find clients in cidrdata */
         /* try to find clients in cidrdata */
-        checkincidr = 0;
         bcdata->type = CLIENT;
         bcdata->type = CLIENT;
-        tree_checkincidr(&treeroot, bcdata);
 
 
-        if (checkincidr == 0) { /* didn't find any clients in cidrdata */
+        if (! tree_checkincidr(&treeroot, bcdata)) { /* didn't find any clients in cidrdata */
             return (mymask);    /* success! */
             return (mymask);    /* success! */
         }
         }
         else {
         else {
@@ -246,8 +253,7 @@ add_tree(const unsigned long ip, const u_char * data)
     node = RB_FIND(data_tree_s, &treeroot, newnode);
     node = RB_FIND(data_tree_s, &treeroot, newnode);
 
 
 #ifdef DEBUG
 #ifdef DEBUG
-    if (debug > 2)
-        tree_printnode("add_tree", node);
+    dbg(3, "%s", tree_printnode("add_tree", node));
 #endif
 #endif
 
 
     /* new entry required */
     /* new entry required */
@@ -267,8 +273,7 @@ add_tree(const unsigned long ip, const u_char * data)
         /* we found something, so update it */
         /* we found something, so update it */
         dbg(2, "   node: %p\nnewnode: %p", node, newnode);
         dbg(2, "   node: %p\nnewnode: %p", node, newnode);
 #ifdef DEBUG
 #ifdef DEBUG
-        if (debug > 2)
-            tree_printnode("update node", node);
+        dbg(3, "%s", tree_printnode("update node", node));
 #endif
 #endif
         /* increment counter */
         /* increment counter */
         if (newnode->type == SERVER) {
         if (newnode->type == SERVER) {
@@ -284,8 +289,7 @@ add_tree(const unsigned long ip, const u_char * data)
 
 
     dbg(2, "------- START NEXT -------");
     dbg(2, "------- START NEXT -------");
 #ifdef DEBUG
 #ifdef DEBUG
-    if (debug > 2)
-        tree_print(&treeroot);
+    dbg(3, "%s", tree_print(&treeroot));
 #endif
 #endif
 }
 }
 
 
@@ -299,18 +303,27 @@ tree_calculate(data_tree_t *treeroot)
 {
 {
     tree_t *node;
     tree_t *node;
 
 
+    dbg(1, "Running tree_calculate()");
+
     RB_FOREACH(node, data_tree_s, treeroot) {
     RB_FOREACH(node, data_tree_s, treeroot) {
+        dbg(4, "Processing %s", libnet_addr2name4(node->ip, RESOLVE));
         if ((node->server_cnt > 0) || (node->client_cnt > 0)) {
         if ((node->server_cnt > 0) || (node->client_cnt > 0)) {
             /* type based on: server >= (client*ratio) */
             /* type based on: server >= (client*ratio) */
             if ((double)node->server_cnt >= (double)node->client_cnt * options.ratio) {
             if ((double)node->server_cnt >= (double)node->client_cnt * options.ratio) {
                 node->type = SERVER;
                 node->type = SERVER;
+                dbg(3, "Setting %s to server", 
+                        libnet_addr2name4(node->ip, RESOLVE));
             }
             }
             else {
             else {
                 node->type = CLIENT;
                 node->type = CLIENT;
+                dbg(3, "Setting %s to client", 
+                        libnet_addr2name4(node->ip, RESOLVE));
             }
             }
         }
         }
         else {                  /* IP had no client or server connections */
         else {                  /* IP had no client or server connections */
             node->type = UNKNOWN;
             node->type = UNKNOWN;
+            dbg(3, "Setting %s to unknown", 
+                    libnet_addr2name4(node->ip, RESOLVE));
         }
         }
     }
     }
 }
 }
@@ -524,42 +537,44 @@ packet2tree(const u_char * data)
  * prints out a node of the tree to stderr
  * prints out a node of the tree to stderr
  */
  */
 
 
-static void
+static char *
 tree_printnode(const char *name, const tree_t *node)
 tree_printnode(const char *name, const tree_t *node)
 {
 {
 
 
+    memset(&tree_print_buff, '\0', TREEPRINTBUFFLEN);
     if (node == NULL) {
     if (node == NULL) {
-        fprintf(stderr, "%s node is null\n", name);
+        snprintf(tree_print_buff, TREEPRINTBUFFLEN, "%s node is null\n", name);
     }
     }
 
 
     else {
     else {
-        fprintf(stderr, "-- %s: %p\nIP: %s\nMask: %d\nSrvr: %d\nClnt: %d\n",
+        snprintf(tree_print_buff, TREEPRINTBUFFLEN,
+                "-- %s: %p\nIP: %s\nMask: %d\nSrvr: %d\nClnt: %d\n",
                 name, (void *)node, libnet_addr2name4(node->ip, RESOLVE),
                 name, (void *)node, libnet_addr2name4(node->ip, RESOLVE),
                 node->masklen, node->server_cnt, node->client_cnt);
                 node->masklen, node->server_cnt, node->client_cnt);
         if (node->type == SERVER) {
         if (node->type == SERVER) {
-            fprintf(stderr, "Type: Server\n--\n");
+            strlcat(tree_print_buff, "Type: Server\n--\n", TREEPRINTBUFFLEN);
         }
         }
         else {
         else {
-            fprintf(stderr, "Type: Client\n--\n");
+            strlcat(tree_print_buff, "Type: Client\n--\n", TREEPRINTBUFFLEN);
         }
         }
 
 
     }
     }
-
+    return (tree_print_buff);
 }
 }
 
 
 /*
 /*
  * prints out the entire tree
  * prints out the entire tree
  */
  */
 
 
-static void
+static char *
 tree_print(data_tree_t *treeroot)
 tree_print(data_tree_t *treeroot)
 {
 {
     tree_t *node = NULL;
     tree_t *node = NULL;
-
+    memset(&tree_print_buff, '\0', TREEPRINTBUFFLEN);
     RB_FOREACH(node, data_tree_s, treeroot) {
     RB_FOREACH(node, data_tree_s, treeroot) {
         tree_printnode("my node", node);
         tree_printnode("my node", node);
     }
     }
-    return;
+    return (tree_print_buff);
 
 
 }
 }
 
 

+ 3 - 1
src/tree.h

@@ -1,4 +1,4 @@
-/* $Id: tree.h 1368 2005-06-28 05:25:16Z aturner $ */
+/* $Id: tree.h 1386 2005-07-03 19:29:26Z aturner $ */
 
 
 /*
 /*
  * Copyright (c) 2001-2005 Aaron Turner.
  * Copyright (c) 2001-2005 Aaron Turner.
@@ -35,6 +35,8 @@
 
 
 #include "lib/tree.h"
 #include "lib/tree.h"
 
 
+#define TREEPRINTBUFFLEN 2048
+
 struct tree_s {
 struct tree_s {
     RB_ENTRY(tree_s) node;
     RB_ENTRY(tree_s) node;
     unsigned long ip;           /* ip/network address in network byte order */
     unsigned long ip;           /* ip/network address in network byte order */

BIN
test/test.auto_router