Browse Source

Import upstream version 3.2.4

Aaron Turner 16 years ago
parent
commit
176a8595f1

+ 41 - 1
configure

@@ -2079,7 +2079,7 @@ fi
 
 MAJOR_VERSION=3
 MINOR_VERSION=2
-MICRO_VERSION=3
+MICRO_VERSION=4
 TCPREPLAY_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
 
 TCPREPLAY_RELEASE=1
@@ -21760,6 +21760,46 @@ echo "${ECHO_T}no" >&6; }
 fi
 
 
+# Extract the first word of "echo", so it can be a program name with args.
+set dummy echo; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_ECHO+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $ECHO in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ECHO="$ECHO" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ECHO="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ECHO=$ac_cv_path_ECHO
+if test -n "$ECHO"; then
+  { echo "$as_me:$LINENO: result: $ECHO" >&5
+echo "${ECHO_T}$ECHO" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
 
 if test -n "${AUTOGEN}" ; then
 	{ echo "$as_me:$LINENO: checking for autogen version >= 5.9" >&5

+ 3 - 2
configure.ac

@@ -1,5 +1,5 @@
 
-dnl $Id: configure.ac 1937 2007-11-01 18:53:05Z aturner $
+dnl $Id: configure.ac 1954 2008-01-17 06:10:31Z aturner $
 
 AC_INIT(tcpreplay)
 AC_CONFIG_SRCDIR(src/tcpreplay.c)
@@ -11,7 +11,7 @@ AM_WITH_DMALLOC
 dnl Set version info here!
 MAJOR_VERSION=3
 MINOR_VERSION=2
-MICRO_VERSION=3
+MICRO_VERSION=4
 TCPREPLAY_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
 
 dnl Release is only used for the RPM spec file
@@ -59,6 +59,7 @@ AC_PROG_MAKE_SET
 AC_EXEEXT
 AC_PATH_PROG(PRINTF, printf)
 AC_PATH_PROG(AUTOGEN, autogen)
+AC_PATH_PROG(ECHO, echo)
 
 dnl check autogen version
 if test -n "${AUTOGEN}" ; then

+ 5 - 1
docs/CHANGELOG

@@ -1,4 +1,8 @@
-$Id: CHANGELOG 1936 2007-11-01 18:33:38Z aturner $
+$Id: CHANGELOG 1957 2008-01-17 06:24:18Z aturner $
+
+01/16/2008: Version 3.2.4
+    - Fix crash in tcpreplay when --enable-tcpreplay-edit (#281)
+    - Display if --enable-tcpreplay-edit in -V (#283)
 
 11/01/2007: Version 3.2.3
     - Fix compile issue under Linux and other OS's (#275)

BIN
src/._Makefile.am


BIN
src/._tcpreplay_opts.def


+ 26 - 9
src/Makefile.am

@@ -7,9 +7,10 @@ else
 LIBSTRL = ../lib/libstrl.a
 endif
 
-manpages: tcpprep.1 tcprewrite.1 tcpreplay.1 tcpbridge.1
+manpages: tcpprep.1 tcprewrite.1 tcpreplay.1 tcpbridge.1 tcpreplay-edit.1
 
-autoopts: tcpreplay_opts.c tcprewrite_opts.c tcpbridge_opts.c manpages
+autoopts: tcpreplay_opts.c tcprewrite_opts.c tcpbridge_opts.c manpages \
+	tcpreplay_edit_opts.c
 
 
 # Get AutoOpts search path
@@ -26,24 +27,38 @@ tcpprep.1: tcpprep_opts.def
 tcprewrite.1: tcprewrite_opts.def tcpedit/tcpedit_opts.def
 	@AUTOGEN@ -T agman1.tpl $(opts_list) --base-name tcprewrite tcprewrite_opts.def
 
+tcpreplay-edit.1: tcpreplay_opts.def
+	@AUTOGEN@ -T agman1.tpl $(opts_list) -DTCPREPLAY_EDIT --base-name tcpreplay-edit tcpreplay_opts.def
+
 tcpreplay.1: tcpreplay_opts.def
 	@AUTOGEN@ -T agman1.tpl $(opts_list) --base-name tcpreplay tcpreplay_opts.def
 
 tcpbridge.1: tcpbridge_opts.def tcpedit/tcpedit_opts.def
 	@AUTOGEN@ -T agman1.tpl $(opts_list) --base-name tcpbridge tcpbridge_opts.def
 
-man_MANS = tcpreplay.1 tcpprep.1 tcprewrite.1 tcpbridge.1
-EXTRA_DIST = tcpreplay.1 tcpprep.1 tcprewrite.1 tcpbridge.1
+man_MANS = tcpreplay.1 tcpprep.1 tcprewrite.1 tcpbridge.1 tcpreplay-edit.1
+EXTRA_DIST = tcpreplay.1 tcpprep.1 tcprewrite.1 tcpbridge.1 tcpreplay-edit.1
 bin_PROGRAMS = tcpreplay tcpprep tcprewrite tcpbridge
 
 tcpreplay_CFLAGS = $(LIBOPTS_CFLAGS) -I.. $(LNAV_CFLAGS) -DTCPREPLAY
-tcpreplay_LDADD = ./tcpedit/libtcpedit.a ./common/libcommon.a $(LIBSTRL) \
-		  @LNETLIB@ @LPCAPLIB@ $(LIBOPTS_LDADD)
-tcpreplay_SOURCES = tcpreplay_opts.c send_packets.c signal_handler.c tcpreplay.c
+tcpreplay_LDADD = ./common/libcommon.a $(LIBSTRL) @LNETLIB@ @LPCAPLIB@ $(LIBOPTS_LDADD)
+tcpreplay_SOURCES = send_packets.c signal_handler.c tcpreplay.c
+
+if ENABLE_TCPREPLAY_EDIT
+tcpreplay_LDADD += ./tcpedit/libtcpedit.a
+tcpreplay_SOURCES += tcpreplay_edit_opts.c
+else
+tcpreplay_SOURCES += tcpreplay_opts.c
+endif
+
 tcpreplay_OBJECTS: tcpreplay_opts.h
 tcpreplay_opts.h: tcpreplay_opts.c
+tcpreplay_edit_opts.h: tcpreplay_edit_opts.c
 tcpreplay_opts.c: tcpreplay_opts.def
 	@AUTOGEN@ $(opts_list) tcpreplay_opts.def
+tcpreplay_edit_opts.c: tcpreplay_opts.def
+	@AUTOGEN@ $(opts_list) -DTCPREPLAY_EDIT -b tcpreplay_edit_opts \
+		tcpreplay_opts.def
 
 tcprewrite_CFLAGS = $(LIBOPTS_CFLAGS) -I.. $(LNAV_CFLAGS) -DTCPREWRITE -DHAVE_CACHEFILE_SUPPORT
 tcprewrite_LDADD = ./tcpedit/libtcpedit.a ./common/libcommon.a \
@@ -75,7 +90,7 @@ tcpbridge_opts.c: tcpbridge_opts.def tcpedit/tcpedit_opts.def
 
 noinst_HEADERS = tcpreplay.h tcpprep.h bridge.h defines.h tree.h \
 		 send_packets.h signal_handler.h common.h tcpreplay_opts.h \
-		 tcprewrite.h tcprewrite_opts.h tcpprep_opts.h \
+		 tcpreplay_edit_opts.h tcprewrite.h tcprewrite_opts.h tcpprep_opts.h \
 		 tcpprep_opts.def tcprewrite_opts.def tcpreplay_opts.def \
 		 tcpbridge_opts.def tcpbridge.h tcpbridge_opts.h tcpr.h
 
@@ -85,4 +100,6 @@ MOSTLYCLEANFILES = *~ *.o
 MAINTAINERCLEANFILES = Makefile.in tcpreplay_opts.h tcpreplay_opts.c \
 		       tcprewrite_opts.c tcprewrite_opts.h tcpprep_opts.c \
 		       tcpprep_opts.h tcpprep.1 tcpreplay.1 tcprewrite.1 \
-		       tcpbridge.1 tcpbridge_opts.h tcpbridge_opts.c
+		       tcpbridge.1 tcpbridge_opts.h tcpbridge_opts.c \
+			   tcpreplay_edit_opts.c tcpreplay_edit_opts.h \
+			   tcpreplay-edit.1

+ 63 - 30
src/Makefile.in

@@ -37,6 +37,9 @@ target_triplet = @target@
 @ENABLE_TCPREPLAY_EDIT_TRUE@am__append_1 = -DTCPREPLAY_EDIT
 bin_PROGRAMS = tcpreplay$(EXEEXT) tcpprep$(EXEEXT) tcprewrite$(EXEEXT) \
 	tcpbridge$(EXEEXT)
+@ENABLE_TCPREPLAY_EDIT_TRUE@am__append_2 = ./tcpedit/libtcpedit.a
+@ENABLE_TCPREPLAY_EDIT_TRUE@am__append_3 = tcpreplay_edit_opts.c
+@ENABLE_TCPREPLAY_EDIT_FALSE@am__append_4 = tcpreplay_opts.c
 subdir = src
 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in $(srcdir)/config.h.in \
@@ -70,13 +73,17 @@ tcpprep_DEPENDENCIES = ./common/libcommon.a $(am__DEPENDENCIES_1) \
 tcpprep_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	--mode=link $(CCLD) $(tcpprep_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
 	$(LDFLAGS) -o $@
-am_tcpreplay_OBJECTS = tcpreplay-tcpreplay_opts.$(OBJEXT) \
-	tcpreplay-send_packets.$(OBJEXT) \
+am__tcpreplay_SOURCES_DIST = send_packets.c signal_handler.c \
+	tcpreplay.c tcpreplay_edit_opts.c tcpreplay_opts.c
+@ENABLE_TCPREPLAY_EDIT_TRUE@am__objects_1 = tcpreplay-tcpreplay_edit_opts.$(OBJEXT)
+@ENABLE_TCPREPLAY_EDIT_FALSE@am__objects_2 = tcpreplay-tcpreplay_opts.$(OBJEXT)
+am_tcpreplay_OBJECTS = tcpreplay-send_packets.$(OBJEXT) \
 	tcpreplay-signal_handler.$(OBJEXT) \
-	tcpreplay-tcpreplay.$(OBJEXT)
+	tcpreplay-tcpreplay.$(OBJEXT) $(am__objects_1) \
+	$(am__objects_2)
 tcpreplay_OBJECTS = $(am_tcpreplay_OBJECTS)
-tcpreplay_DEPENDENCIES = ./tcpedit/libtcpedit.a ./common/libcommon.a \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
+tcpreplay_DEPENDENCIES = ./common/libcommon.a $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_2) $(am__append_2)
 tcpreplay_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(tcpreplay_CFLAGS) \
 	$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
@@ -103,7 +110,7 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 SOURCES = $(tcpbridge_SOURCES) $(tcpprep_SOURCES) $(tcpreplay_SOURCES) \
 	$(tcprewrite_SOURCES)
 DIST_SOURCES = $(tcpbridge_SOURCES) $(tcpprep_SOURCES) \
-	$(tcpreplay_SOURCES) $(tcprewrite_SOURCES)
+	$(am__tcpreplay_SOURCES_DIST) $(tcprewrite_SOURCES)
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	html-recursive info-recursive install-data-recursive \
 	install-dvi-recursive install-exec-recursive \
@@ -260,13 +267,13 @@ SUBDIRS = common tcpedit
 # Get AutoOpts search path
 #opts_list=`find tcpedit -type d -not -regex ".*\.svn.*" -not -regex ".*\.deps.*" -exec echo -n "-L {} " \;`
 opts_list = -L tcpedit $(am__append_1)
-man_MANS = tcpreplay.1 tcpprep.1 tcprewrite.1 tcpbridge.1
-EXTRA_DIST = tcpreplay.1 tcpprep.1 tcprewrite.1 tcpbridge.1
+man_MANS = tcpreplay.1 tcpprep.1 tcprewrite.1 tcpbridge.1 tcpreplay-edit.1
+EXTRA_DIST = tcpreplay.1 tcpprep.1 tcprewrite.1 tcpbridge.1 tcpreplay-edit.1
 tcpreplay_CFLAGS = $(LIBOPTS_CFLAGS) -I.. $(LNAV_CFLAGS) -DTCPREPLAY
-tcpreplay_LDADD = ./tcpedit/libtcpedit.a ./common/libcommon.a $(LIBSTRL) \
-		  @LNETLIB@ @LPCAPLIB@ $(LIBOPTS_LDADD)
-
-tcpreplay_SOURCES = tcpreplay_opts.c send_packets.c signal_handler.c tcpreplay.c
+tcpreplay_LDADD = ./common/libcommon.a $(LIBSTRL) @LNETLIB@ @LPCAPLIB@ \
+	$(LIBOPTS_LDADD) $(am__append_2)
+tcpreplay_SOURCES = send_packets.c signal_handler.c tcpreplay.c \
+	$(am__append_3) $(am__append_4)
 tcprewrite_CFLAGS = $(LIBOPTS_CFLAGS) -I.. $(LNAV_CFLAGS) -DTCPREWRITE -DHAVE_CACHEFILE_SUPPORT
 tcprewrite_LDADD = ./tcpedit/libtcpedit.a ./common/libcommon.a \
 	$(LIBSTRL) @LNETLIB@ @LPCAPLIB@ $(LIBOPTS_LDADD)
@@ -284,7 +291,7 @@ tcpbridge_LDADD = ./tcpedit/libtcpedit.a ./common/libcommon.a \
 tcpbridge_SOURCES = tcpbridge_opts.c tcpbridge.c bridge.c send_packets.c 		
 noinst_HEADERS = tcpreplay.h tcpprep.h bridge.h defines.h tree.h \
 		 send_packets.h signal_handler.h common.h tcpreplay_opts.h \
-		 tcprewrite.h tcprewrite_opts.h tcpprep_opts.h \
+		 tcpreplay_edit_opts.h tcprewrite.h tcprewrite_opts.h tcpprep_opts.h \
 		 tcpprep_opts.def tcprewrite_opts.def tcpreplay_opts.def \
 		 tcpbridge_opts.def tcpbridge.h tcpbridge_opts.h tcpr.h
 
@@ -292,7 +299,9 @@ MOSTLYCLEANFILES = *~ *.o
 MAINTAINERCLEANFILES = Makefile.in tcpreplay_opts.h tcpreplay_opts.c \
 		       tcprewrite_opts.c tcprewrite_opts.h tcpprep_opts.c \
 		       tcpprep_opts.h tcpprep.1 tcpreplay.1 tcprewrite.1 \
-		       tcpbridge.1 tcpbridge_opts.h tcpbridge_opts.c
+		       tcpbridge.1 tcpbridge_opts.h tcpbridge_opts.c \
+			   tcpreplay_edit_opts.c tcpreplay_edit_opts.h \
+			   tcpreplay-edit.1
 
 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -404,6 +413,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpreplay-send_packets.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpreplay-signal_handler.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpreplay-tcpreplay.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpreplay-tcpreplay_edit_opts.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpreplay-tcpreplay_opts.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcprewrite-tcprewrite.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcprewrite-tcprewrite_opts.Po@am__quote@
@@ -527,20 +537,6 @@ tcpprep-tree.obj: tree.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tcpprep_CFLAGS) $(CFLAGS) -c -o tcpprep-tree.obj `if test -f 'tree.c'; then $(CYGPATH_W) 'tree.c'; else $(CYGPATH_W) '$(srcdir)/tree.c'; fi`
 
-tcpreplay-tcpreplay_opts.o: tcpreplay_opts.c
-@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tcpreplay_CFLAGS) $(CFLAGS) -MT tcpreplay-tcpreplay_opts.o -MD -MP -MF $(DEPDIR)/tcpreplay-tcpreplay_opts.Tpo -c -o tcpreplay-tcpreplay_opts.o `test -f 'tcpreplay_opts.c' || echo '$(srcdir)/'`tcpreplay_opts.c
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/tcpreplay-tcpreplay_opts.Tpo $(DEPDIR)/tcpreplay-tcpreplay_opts.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='tcpreplay_opts.c' object='tcpreplay-tcpreplay_opts.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tcpreplay_CFLAGS) $(CFLAGS) -c -o tcpreplay-tcpreplay_opts.o `test -f 'tcpreplay_opts.c' || echo '$(srcdir)/'`tcpreplay_opts.c
-
-tcpreplay-tcpreplay_opts.obj: tcpreplay_opts.c
-@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tcpreplay_CFLAGS) $(CFLAGS) -MT tcpreplay-tcpreplay_opts.obj -MD -MP -MF $(DEPDIR)/tcpreplay-tcpreplay_opts.Tpo -c -o tcpreplay-tcpreplay_opts.obj `if test -f 'tcpreplay_opts.c'; then $(CYGPATH_W) 'tcpreplay_opts.c'; else $(CYGPATH_W) '$(srcdir)/tcpreplay_opts.c'; fi`
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/tcpreplay-tcpreplay_opts.Tpo $(DEPDIR)/tcpreplay-tcpreplay_opts.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='tcpreplay_opts.c' object='tcpreplay-tcpreplay_opts.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tcpreplay_CFLAGS) $(CFLAGS) -c -o tcpreplay-tcpreplay_opts.obj `if test -f 'tcpreplay_opts.c'; then $(CYGPATH_W) 'tcpreplay_opts.c'; else $(CYGPATH_W) '$(srcdir)/tcpreplay_opts.c'; fi`
-
 tcpreplay-send_packets.o: send_packets.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tcpreplay_CFLAGS) $(CFLAGS) -MT tcpreplay-send_packets.o -MD -MP -MF $(DEPDIR)/tcpreplay-send_packets.Tpo -c -o tcpreplay-send_packets.o `test -f 'send_packets.c' || echo '$(srcdir)/'`send_packets.c
 @am__fastdepCC_TRUE@	mv -f $(DEPDIR)/tcpreplay-send_packets.Tpo $(DEPDIR)/tcpreplay-send_packets.Po
@@ -583,6 +579,34 @@ tcpreplay-tcpreplay.obj: tcpreplay.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tcpreplay_CFLAGS) $(CFLAGS) -c -o tcpreplay-tcpreplay.obj `if test -f 'tcpreplay.c'; then $(CYGPATH_W) 'tcpreplay.c'; else $(CYGPATH_W) '$(srcdir)/tcpreplay.c'; fi`
 
+tcpreplay-tcpreplay_edit_opts.o: tcpreplay_edit_opts.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tcpreplay_CFLAGS) $(CFLAGS) -MT tcpreplay-tcpreplay_edit_opts.o -MD -MP -MF $(DEPDIR)/tcpreplay-tcpreplay_edit_opts.Tpo -c -o tcpreplay-tcpreplay_edit_opts.o `test -f 'tcpreplay_edit_opts.c' || echo '$(srcdir)/'`tcpreplay_edit_opts.c
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/tcpreplay-tcpreplay_edit_opts.Tpo $(DEPDIR)/tcpreplay-tcpreplay_edit_opts.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='tcpreplay_edit_opts.c' object='tcpreplay-tcpreplay_edit_opts.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tcpreplay_CFLAGS) $(CFLAGS) -c -o tcpreplay-tcpreplay_edit_opts.o `test -f 'tcpreplay_edit_opts.c' || echo '$(srcdir)/'`tcpreplay_edit_opts.c
+
+tcpreplay-tcpreplay_edit_opts.obj: tcpreplay_edit_opts.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tcpreplay_CFLAGS) $(CFLAGS) -MT tcpreplay-tcpreplay_edit_opts.obj -MD -MP -MF $(DEPDIR)/tcpreplay-tcpreplay_edit_opts.Tpo -c -o tcpreplay-tcpreplay_edit_opts.obj `if test -f 'tcpreplay_edit_opts.c'; then $(CYGPATH_W) 'tcpreplay_edit_opts.c'; else $(CYGPATH_W) '$(srcdir)/tcpreplay_edit_opts.c'; fi`
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/tcpreplay-tcpreplay_edit_opts.Tpo $(DEPDIR)/tcpreplay-tcpreplay_edit_opts.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='tcpreplay_edit_opts.c' object='tcpreplay-tcpreplay_edit_opts.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tcpreplay_CFLAGS) $(CFLAGS) -c -o tcpreplay-tcpreplay_edit_opts.obj `if test -f 'tcpreplay_edit_opts.c'; then $(CYGPATH_W) 'tcpreplay_edit_opts.c'; else $(CYGPATH_W) '$(srcdir)/tcpreplay_edit_opts.c'; fi`
+
+tcpreplay-tcpreplay_opts.o: tcpreplay_opts.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tcpreplay_CFLAGS) $(CFLAGS) -MT tcpreplay-tcpreplay_opts.o -MD -MP -MF $(DEPDIR)/tcpreplay-tcpreplay_opts.Tpo -c -o tcpreplay-tcpreplay_opts.o `test -f 'tcpreplay_opts.c' || echo '$(srcdir)/'`tcpreplay_opts.c
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/tcpreplay-tcpreplay_opts.Tpo $(DEPDIR)/tcpreplay-tcpreplay_opts.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='tcpreplay_opts.c' object='tcpreplay-tcpreplay_opts.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tcpreplay_CFLAGS) $(CFLAGS) -c -o tcpreplay-tcpreplay_opts.o `test -f 'tcpreplay_opts.c' || echo '$(srcdir)/'`tcpreplay_opts.c
+
+tcpreplay-tcpreplay_opts.obj: tcpreplay_opts.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tcpreplay_CFLAGS) $(CFLAGS) -MT tcpreplay-tcpreplay_opts.obj -MD -MP -MF $(DEPDIR)/tcpreplay-tcpreplay_opts.Tpo -c -o tcpreplay-tcpreplay_opts.obj `if test -f 'tcpreplay_opts.c'; then $(CYGPATH_W) 'tcpreplay_opts.c'; else $(CYGPATH_W) '$(srcdir)/tcpreplay_opts.c'; fi`
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/tcpreplay-tcpreplay_opts.Tpo $(DEPDIR)/tcpreplay-tcpreplay_opts.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='tcpreplay_opts.c' object='tcpreplay-tcpreplay_opts.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tcpreplay_CFLAGS) $(CFLAGS) -c -o tcpreplay-tcpreplay_opts.obj `if test -f 'tcpreplay_opts.c'; then $(CYGPATH_W) 'tcpreplay_opts.c'; else $(CYGPATH_W) '$(srcdir)/tcpreplay_opts.c'; fi`
+
 tcprewrite-tcprewrite_opts.o: tcprewrite_opts.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tcprewrite_CFLAGS) $(CFLAGS) -MT tcprewrite-tcprewrite_opts.o -MD -MP -MF $(DEPDIR)/tcprewrite-tcprewrite_opts.Tpo -c -o tcprewrite-tcprewrite_opts.o `test -f 'tcprewrite_opts.c' || echo '$(srcdir)/'`tcprewrite_opts.c
 @am__fastdepCC_TRUE@	mv -f $(DEPDIR)/tcprewrite-tcprewrite_opts.Tpo $(DEPDIR)/tcprewrite-tcprewrite_opts.Po
@@ -951,9 +975,10 @@ uninstall-man: uninstall-man1
 	uninstall-man1
 
 
-manpages: tcpprep.1 tcprewrite.1 tcpreplay.1 tcpbridge.1
+manpages: tcpprep.1 tcprewrite.1 tcpreplay.1 tcpbridge.1 tcpreplay-edit.1
 
-autoopts: tcpreplay_opts.c tcprewrite_opts.c tcpbridge_opts.c manpages
+autoopts: tcpreplay_opts.c tcprewrite_opts.c tcpbridge_opts.c manpages \
+	tcpreplay_edit_opts.c
 
 tcpprep.1: tcpprep_opts.def
 	@AUTOGEN@ -T agman1.tpl $(opts_list) --base-name tcpprep tcpprep_opts.def
@@ -961,15 +986,23 @@ tcpprep.1: tcpprep_opts.def
 tcprewrite.1: tcprewrite_opts.def tcpedit/tcpedit_opts.def
 	@AUTOGEN@ -T agman1.tpl $(opts_list) --base-name tcprewrite tcprewrite_opts.def
 
+tcpreplay-edit.1: tcpreplay_opts.def
+	@AUTOGEN@ -T agman1.tpl $(opts_list) -DTCPREPLAY_EDIT --base-name tcpreplay-edit tcpreplay_opts.def
+
 tcpreplay.1: tcpreplay_opts.def
 	@AUTOGEN@ -T agman1.tpl $(opts_list) --base-name tcpreplay tcpreplay_opts.def
 
 tcpbridge.1: tcpbridge_opts.def tcpedit/tcpedit_opts.def
 	@AUTOGEN@ -T agman1.tpl $(opts_list) --base-name tcpbridge tcpbridge_opts.def
+
 tcpreplay_OBJECTS: tcpreplay_opts.h
 tcpreplay_opts.h: tcpreplay_opts.c
+tcpreplay_edit_opts.h: tcpreplay_edit_opts.c
 tcpreplay_opts.c: tcpreplay_opts.def
 	@AUTOGEN@ $(opts_list) tcpreplay_opts.def
+tcpreplay_edit_opts.c: tcpreplay_opts.def
+	@AUTOGEN@ $(opts_list) -DTCPREPLAY_EDIT -b tcpreplay_edit_opts \
+		tcpreplay_opts.def
 tcprewrite_OBJECTS: tcprewrite_opts.h
 tcprewrite_opts.h: tcprewrite_opts.c
 tcprewrite_opts.c: tcprewrite_opts.def tcpedit/tcpedit_opts.def

BIN
src/common/._sendpacket.c


+ 5 - 5
src/common/Makefile.am

@@ -4,12 +4,12 @@ noinst_LIBRARIES = libcommon.a
 BUILT_SOURCES = svn_version.c
 
 svn_version.c:
-	echo -n 'const char SVN_Version[] = "'   > svn_version.c
+	$(ECHO) -n 'const char SVN_Version[] = "'   > svn_version.c
 	svnversion -n ../..                     >> svn_version.c
-	echo '";'								>> svn_version.c
-	echo 'const char *svn_version(void) {'  >> svn_version.c
-	echo '	return SVN_Version;'			>> svn_version.c
-	echo '}' 			      				>> svn_version.c
+	$(ECHO) '";'								>> svn_version.c
+	$(ECHO) 'const char *svn_version(void) {'  >> svn_version.c
+	$(ECHO) '	return SVN_Version;'			>> svn_version.c
+	$(ECHO) '}' 			      				>> svn_version.c
 
 libcommon_a_SOURCES = cidr.c err.c list.c cache.c services.c get.c \
 		      fakepcap.c fakepcapnav.c fakepoll.c xX.c utils.c \

+ 5 - 5
src/common/Makefile.in

@@ -505,12 +505,12 @@ uninstall-am:
 
 
 svn_version.c:
-	echo -n 'const char SVN_Version[] = "'   > svn_version.c
+	$(ECHO) -n 'const char SVN_Version[] = "'   > svn_version.c
 	svnversion -n ../..                     >> svn_version.c
-	echo '";'								>> svn_version.c
-	echo 'const char *svn_version(void) {'  >> svn_version.c
-	echo '	return SVN_Version;'			>> svn_version.c
-	echo '}' 			      				>> svn_version.c
+	$(ECHO) '";'								>> svn_version.c
+	$(ECHO) 'const char *svn_version(void) {'  >> svn_version.c
+	$(ECHO) '	return SVN_Version;'			>> svn_version.c
+	$(ECHO) '}' 			      				>> svn_version.c
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:

+ 1 - 1
src/common/svn_version.c

@@ -1,4 +1,4 @@
-const char SVN_Version[] = "1939";
+const char SVN_Version[] = "1959";
 const char *svn_version(void) {
 	return SVN_Version;
 }

+ 2 - 2
src/tcpbridge.1

@@ -1,7 +1,7 @@
-.TH TCPBRIDGE 1 2007-11-01 "(tcpbridge )" "Programmer's Manual"
+.TH TCPBRIDGE 1 2008-01-16 "(tcpbridge )" "Programmer's Manual"
 .\"  DO NOT EDIT THIS FILE   (tcpbridge.1)
 .\"  
-.\"  It has been AutoGen-ed  Thursday November  1, 2007 at 01:50:25 PM PDT
+.\"  It has been AutoGen-ed  Wednesday January 16, 2008 at 10:09:47 PM PST
 .\"  From the definitions    tcpbridge_opts.def
 .\"  and the template file   agman1.tpl
 .\"

+ 1 - 1
src/tcpbridge_opts.c

@@ -2,7 +2,7 @@
  *  
  *  DO NOT EDIT THIS FILE   (tcpbridge_opts.c)
  *  
- *  It has been AutoGen-ed  Thursday November  1, 2007 at 01:50:24 PM PDT
+ *  It has been AutoGen-ed  Wednesday January 16, 2008 at 10:09:46 PM PST
  *  From the definitions    tcpbridge_opts.def
  *  and the template file   options
  *

+ 1 - 1
src/tcpbridge_opts.h

@@ -2,7 +2,7 @@
  *  
  *  DO NOT EDIT THIS FILE   (tcpbridge_opts.h)
  *  
- *  It has been AutoGen-ed  Thursday November  1, 2007 at 01:50:24 PM PDT
+ *  It has been AutoGen-ed  Wednesday January 16, 2008 at 10:09:46 PM PST
  *  From the definitions    tcpbridge_opts.def
  *  and the template file   options
  *

BIN
src/tcpedit/._dlt.c


BIN
src/tcpedit/._tcpedit.c


BIN
src/tcpedit/plugins/._dlt_plugins.c


BIN
src/tcpedit/plugins/._dlt_plugins.h


+ 1 - 1
src/tcpedit/tcpedit_stub.h

@@ -2,7 +2,7 @@
  *  
  *  DO NOT EDIT THIS FILE   (tcpedit_stub.h)
  *  
- *  It has been AutoGen-ed  Thursday November  1, 2007 at 01:50:26 PM PDT
+ *  It has been AutoGen-ed  Wednesday January 16, 2008 at 10:09:48 PM PST
  *  From the definitions    tcpedit_stub.def
  *  and the template file   options
  *

+ 2 - 2
src/tcpprep.1

@@ -1,7 +1,7 @@
-.TH TCPPREP 1 2007-11-01 "(tcpprep )" "Programmer's Manual"
+.TH TCPPREP 1 2008-01-16 "(tcpprep )" "Programmer's Manual"
 .\"  DO NOT EDIT THIS FILE   (tcpprep.1)
 .\"  
-.\"  It has been AutoGen-ed  Thursday November  1, 2007 at 01:50:24 PM PDT
+.\"  It has been AutoGen-ed  Wednesday January 16, 2008 at 10:09:47 PM PST
 .\"  From the definitions    tcpprep_opts.def
 .\"  and the template file   agman1.tpl
 .\"

+ 1 - 1
src/tcpprep_opts.c

@@ -2,7 +2,7 @@
  *  
  *  DO NOT EDIT THIS FILE   (tcpprep_opts.c)
  *  
- *  It has been AutoGen-ed  Thursday November  1, 2007 at 01:50:23 PM PDT
+ *  It has been AutoGen-ed  Wednesday January 16, 2008 at 10:09:46 PM PST
  *  From the definitions    tcpprep_opts.def
  *  and the template file   options
  *

+ 1 - 1
src/tcpprep_opts.h

@@ -2,7 +2,7 @@
  *  
  *  DO NOT EDIT THIS FILE   (tcpprep_opts.h)
  *  
- *  It has been AutoGen-ed  Thursday November  1, 2007 at 01:50:23 PM PDT
+ *  It has been AutoGen-ed  Wednesday January 16, 2008 at 10:09:46 PM PST
  *  From the definitions    tcpprep_opts.def
  *  and the template file   options
  *

+ 588 - 0
src/tcpreplay-edit.1

@@ -0,0 +1,588 @@
+.TH TCPREPLAY 1 2008-01-16 "(tcpreplay )" "Programmer's Manual"
+.\"  DO NOT EDIT THIS FILE   (tcpreplay-edit.1)
+.\"  
+.\"  It has been AutoGen-ed  Wednesday January 16, 2008 at 10:09:47 PM PST
+.\"  From the definitions    tcpreplay_opts.def
+.\"  and the template file   agman1.tpl
+.\"
+.SH NAME
+tcpreplay \- Replay network traffic stored in pcap files
+.SH SYNOPSIS
+.B tcpreplay
+.\" Mixture of short (flag) options and long options
+.RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \--\fIopt-name\fP " [[=| ]\fIvalue\fP]]..."
+.br
+.in +8
+<pcap_file(s)>
+.PP
+tcpreplay is a tool for replaying network traffic from files saved with
+tcpdump or other tools which write pcap(3) files.
+.SH "DESCRIPTION"
+This manual page documents, briefly, the \fBtcpreplay\fP command.
+The basic operation of tcpreplay is to resend  all  packets  from  the
+input file(s) at the speed at which they were recorded, or a specified 
+data rate, up to as fast as the hardware is capable.
+
+Optionally, the traffic can be split between two interfaces, written to
+files, filtered and edited in various ways, providing the means to test
+firewalls, NIDS and other network devices.
+
+For more details, please see the Tcpreplay Manual at:
+http://tcpreplay.synfin.net/trac/wiki/manual
+.SH OPTIONS
+.SS ""
+.TP
+.BR \-r " \fIstring\fP, " \--portmap "=" \fIstring\fP
+Rewrite TCP/UDP ports.
+This option may appear up to 1 times.
+.sp
+Specify a list of comma delimited port mappingings consisting of 
+colon delimited port number pairs.  Each colon delimited port pair
+consists of the port to match followed by the port number to rewrite.
+
+Example:
+.nf
+    \--portmap=80:8000,8080:80
+.fi
+.TP
+.BR \-s " \fInumber\fP, " \--seed "=" \fInumber\fP
+Randomize src/dst IP addresses w/ given seed.
+This option may appear up to 1 times.
+This option takes an integer number as its argument.
+.sp
+Causes the source and destination IP addresses to be pseudo 
+randomized but still maintain client/server relationships.
+Since the randomization is deterministic based on the seed, 
+you can reuse the same seed value to recreate the traffic.
+.TP
+.BR \-N " \fIstring\fP, " \--pnat "=" \fIstring\fP
+Rewrite IP addresses using pseudo-NAT.
+This option may appear up to 2 times.
+This option must not appear in combination with any of the following options:
+srcipmap.
+.sp
+Takes a comma delimited series of colon delimited CIDR
+netblock pairs.  Each netblock pair is evaluated in order against
+the IP addresses.  If the IP address in the packet matches the
+first netblock, it is rewriten using the second netblock as a
+mask against the high order bits.
+
+Example:
+.nf
+    \--pnat=192.168.0.0/16:10.77.0.0/16,172.16.0.0/12:10.1.0.0/24
+.fi
+.TP
+.BR \-S " \fIstring\fP, " \--srcipmap "=" \fIstring\fP
+Rewrite source IP addresses using pseudo-NAT.
+This option may appear up to 1 times.
+This option must not appear in combination with any of the following options:
+pnat.
+.sp
+Works just like the \--pnat option, but only affects the source IP
+addresses in the IPv4 header.
+.TP
+.BR \-D " \fIstring\fP, " \--dstipmap "=" \fIstring\fP
+Rewrite destination IP addresses using pseudo-NAT.
+This option may appear up to 1 times.
+This option must not appear in combination with any of the following options:
+pnat.
+.sp
+Works just like the \--pnat option, but only affects the destination IP
+addresses in the IPv4 header.
+.TP
+.BR \-e " \fIstring\fP, " \--endpoints "=" \fIstring\fP
+Rewrite IP addresses to be between two endpoints.
+This option may appear up to 1 times.
+This option must appear in combination with the following options:
+cachefile.
+.sp
+Takes a pair of colon delimited IP addresses which will be used to rewrite
+all traffic to appear to be between the two IP's.
+
+Example:
+.nf
+    \--endpoints=172.16.0.1:172.16.0.2
+.fi
+.TP
+.BR \-b ", " \--skipbroadcast
+Skip rewriting broadcast/multicast IP's.
+.sp
+By default \--seed, \--pnat and \--endpoints will rewrite 
+broadcast and multicast IP and MAC addresses.	Setting this flag
+will keep broadcast/multicast IP and MAC addresses from being rewritten.
+.TP
+.BR \-C ", " \--fixcsum
+Force recalculation of IP/TCP/UDP checksums.
+.sp
+Causes each IP packet to have it's checksums recalcualted and
+fixed.  Automatically enabled for packets modified with \fB--seed\fP, 
+\fB--pnat\fP, \fB--endpoints\fP or \fB--fixlen\fP.
+.TP
+.BR \-m " \fInumber\fP, " \--mtu "=" \fInumber\fP
+Override default MTU length (1500 bytes).
+This option may appear up to 1 times.
+This option takes an integer number as its argument.
+The value of \fInumber\fP is constrained to being:
+.in +4
+.nf
+.na
+in the range  1 through MAXPACKET
+.fi
+.in -4
+.sp
+Override the default 1500 byte MTU size for determining the maximum padding length.
+.TP
+.BR \-E ", " \--efcs
+Remove Ethernet checksums (FCS) from end of frames.
+.sp
+Note, this option is pretty dangerous!  We don't actually check to see if a FCS
+actually exists in the frame, we just blindly delete the last two bytes.  Hence,
+you should only use this if you know know that your OS provides the FCS when 
+reading raw packets.
+.TP
+.BR \-F " \fIstring\fP, " \--fixlen "=" \fIstring\fP
+Pad or truncate packet data to match header length.
+This option may appear up to 1 times.
+.sp
+Packets may be truncated during capture if the snaplen is smaller then the
+packet.  This option allows you to modify the packet to pad the packet back
+out to the size stored in the IPv4 header or rewrite the IP header total length
+to reflect the stored packet length.
+.sp 1
+\fBpad\fP
+Truncated packets will be padded out so that the packet length matches the 
+IPv4 total length
+.sp 1
+\fBtrunc\fP
+Truncated packets will have their IPv4 total length field rewritten to match
+the actual packet length
+.sp 1
+\fBdel\fP
+Delete the packet
+.TP
+.BR \--skipl2broadcast
+Skip rewriting broadcast/multicast Layer 2 addresses.
+.sp
+By default, editing Layer 2 addresses will rewrite 
+broadcast and multicast MAC addresses.	Setting this flag
+will keep broadcast/multicast MAC addresses from being rewritten.
+.TP
+.BR \--dlt "=\fIstring\fP"
+Override output DLT encapsulation.
+This option may appear up to 1 times.
+.sp
+By default, no DLT (data link type) conversion will be made.  
+To change the DLT type of the output pcap, select one of the following values:
+.sp 1
+\fBenet\fP
+Ethernet aka DLT_EN10MB
+.sp 1
+\fBhdlc\fP
+Cisco HDLC aka DLT_C_HDLC
+.sp 1
+\fBuser\fP
+User specified Layer 2 header and DLT type
+.br
+.TP
+.BR \--enet-dmac "=\fIstring\fP"
+Override destination ethernet MAC addresses.
+This option may appear up to 1 times.
+.sp
+Takes a pair of comma deliminated ethernet MAC addresses which
+will replace the destination MAC address of outbound packets.
+The first MAC address will be used for the server to client traffic
+and the optional second MAC address will be used for the client
+to server traffic.
+
+Example:
+.nf
+    \--enet-dmac=00:12:13:14:15:16,00:22:33:44:55:66
+.fi
+.TP
+.BR \--enet-smac "=\fIstring\fP"
+Override source ethernet MAC addresses.
+This option may appear up to 1 times.
+.sp
+Takes a pair of comma deliminated ethernet MAC addresses which
+will replace the source MAC address of outbound packets.
+The first MAC address will be used for the server to client traffic
+and the optional second MAC address will be used for the client 
+to server traffic.
+
+Example:
+.nf
+    \--enet-smac=00:12:13:14:15:16,00:22:33:44:55:66
+.fi
+.TP
+.BR \--enet-vlan "=\fIstring\fP"
+Specify ethernet 802.1q VLAN tag mode.
+This option may appear up to 1 times.
+.sp
+Allows you to rewrite ethernet frames to add a 802.1q header to standard 802.3
+ethernet headers or remove the 802.1q VLAN tag information.
+.sp 1
+\fBadd\fP
+Rewrites the existing 802.3 ethernet header as an 802.1q VLAN header
+.sp 1
+\fBdel\fP
+Rewrites the existing 802.1q VLAN header as an 802.3 ethernet header
+.TP
+.BR \--enet-vlan-tag "=\fInumber\fP"
+Specify the new ethernet 802.1q VLAN tag value.
+This option may appear up to 1 times.
+This option must appear in combination with the following options:
+enet-vlan.
+This option takes an integer number as its argument.
+The value of \fInumber\fP is constrained to being:
+.in +4
+.nf
+.na
+in the range  0 through 4095
+.fi
+.in -4
+.sp
+
+.TP
+.BR \--enet-vlan-cfi "=\fInumber\fP"
+Specify the ethernet 802.1q VLAN CFI value.
+This option may appear up to 1 times.
+This option must appear in combination with the following options:
+enet-vlan.
+This option takes an integer number as its argument.
+The value of \fInumber\fP is constrained to being:
+.in +4
+.nf
+.na
+in the range  0 through 1
+.fi
+.in -4
+.sp
+
+.TP
+.BR \--enet-vlan-pri "=\fInumber\fP"
+Specify the ethernet 802.1q VLAN priority.
+This option may appear up to 1 times.
+This option must appear in combination with the following options:
+enet-vlan.
+This option takes an integer number as its argument.
+The value of \fInumber\fP is constrained to being:
+.in +4
+.nf
+.na
+in the range  0 through 7
+.fi
+.in -4
+.sp
+
+.TP
+.BR \--hdlc-control "=\fInumber\fP"
+Specify HDLC control value.
+This option may appear up to 1 times.
+This option takes an integer number as its argument.
+.sp
+The Cisco HDLC header has a 1 byte "control" field.  Apparently this should 
+always be 0, but if you can use any 1 byte value.
+.TP
+.BR \--hdlc-address "=\fInumber\fP"
+Specify HDLC address.
+This option may appear up to 1 times.
+This option takes an integer number as its argument.
+.sp
+The Cisco HDLC header has a 1 byte "address" field which has two valid 
+values:
+.sp 1
+\fB0x0F\fP
+Unicast
+.sp 1
+\fB0xBF\fP
+Broadcast
+.br
+You can however specify any single byte value.
+.TP
+.BR \--user-dlt "=\fInumber\fP"
+Set output file DLT type.
+This option may appear up to 1 times.
+This option takes an integer number as its argument.
+.sp
+Set the DLT value of the output pcap file.
+.TP
+.BR \--user-dlink "=\fIstring\fP"
+Rewrite Data-Link layer with user specified data.
+This option may appear up to 2 times.
+.sp
+Provide a series of comma deliminated hex values which will be
+used to rewrite or create the Layer 2 header of the packets.
+The first instance of this argument will rewrite both server
+and client traffic, but if this argument is specified a second
+time, it will be used for the client traffic.
+
+Example:
+.nf
+    \--user-dlink=01,02,03,04,05,06,00,1A,2B,3C,4D,5E,6F,08,00
+.fi
+.TP
+.BR \-d " \fInumber\fP, " \--dbug "=" \fInumber\fP
+Enable debugging output.
+This option may appear up to 1 times.
+This option takes an integer number as its argument.
+The value of \fInumber\fP is constrained to being:
+.in +4
+.nf
+.na
+in the range  0 through 5
+.fi
+.in -4
+The default \fInumber\fP for this option is:
+.ti +4
+ 0
+.sp
+If configured with \--enable-debug, then you can specify a verbosity 
+level for debugging output.  Higher numbers increase verbosity.
+.TP
+.BR \-q ", " \--quiet
+Quiet mode.
+.sp
+Print nothing except the statistics at the end of the run
+.TP
+.BR \-a ", " \--accurate
+Enable more accurate packet timing.
+This option may appear up to 1 times.
+This option must not appear in combination with any of the following options:
+accurate2.
+.sp
+Enables more accurate timing between packets at the cost of higher
+CPU utilization by using the gettimeofday() system call.  This method
+works better on some systems then others and may have rather non-granular
+resolution which makes it problematic for replaying at high rates of speed.
+.TP
+.BR \--accurate2 "=\fInumber\fP"
+Enable even more accurate packet timing.
+This option may appear up to 1 times.
+This option must not appear in combination with any of the following options:
+accurate.
+This option takes an integer number as its argument.
+.sp
+Enables the "even more" accurate timing at the cost of higher CPU
+utilization by using a tight loop which increments a counter.   This method
+provides the most accurate timing of any option, but requires you to specify
+a cost for each loop.  This cost value is VERY system dependent, so you will
+need to run \--loop-test to get this value.
+.TP
+.BR \-v ", " \--verbose
+Print decoded packets via tcpdump to STDOUT.
+This option may appear up to 1 times.
+.sp
+
+.TP
+.BR \-A " \fIstring\fP, " \--decode "=" \fIstring\fP
+Arguments passed to tcpdump decoder.
+This option may appear up to 1 times.
+This option must appear in combination with the following options:
+verbose.
+.sp
+When enabling verbose mode (\fB-v\fP) you may also specify one or more
+additional  arguments to pass to \fBtcpdump\fP to modify the way packets
+are decoded.  By default, \-n and \-l are used.   Be  sure  to
+quote the arguments like: \-A "-axxx" so that they are not interpreted
+by tcpreplay.   Please see the tcpdump(1) man page for a complete list of 
+options.
+.TP
+.BR \-K ", " \--enable-file-cache
+Enable caching of packets to internal memory.
+This option must appear in combination with the following options:
+loop.
+.sp
+Cache pcap file(s) the first time they are cached in RAM so that subsequent
+loops don't incurr any disk I/O latency in order to increase performance.  Make 
+sure you have enough free RAM to store the entire pcap file(s) in memory or the
+system will swap and performance will suffer.
+.TP
+.BR \-c " \fIstring\fP, " \--cachefile "=" \fIstring\fP
+Split traffic via a tcpprep cache file.
+This option may appear up to 1 times.
+.sp
+
+.TP
+.BR \-i " \fIstring\fP, " \--intf1 "=" \fIstring\fP
+Server/primary traffic output interface.
+This option may appear up to 1 times.
+.sp
+
+.TP
+.BR \-I " \fIstring\fP, " \--intf2 "=" \fIstring\fP
+Client/secondary traffic output interface.
+This option may appear up to 1 times.
+This option must appear in combination with the following options:
+cachefile.
+.sp
+
+.TP
+.BR \--listnics
+List available network interfaces and exit.
+.sp
+
+.TP
+.BR \-l " \fInumber\fP, " \--loop "=" \fInumber\fP
+Loop through the capture file X times.
+This option may appear up to 1 times.
+This option takes an integer number as its argument.
+The value of \fInumber\fP is constrained to being:
+.in +4
+.nf
+.na
+greater than or equal to 0
+.fi
+.in -4
+The default \fInumber\fP for this option is:
+.ti +4
+ 1
+.sp
+
+.TP
+.BR \--pktlen
+Override the snaplen and use the actual packet len.
+This option may appear up to 1 times.
+.sp
+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 may happen if
+you specify this option.
+.TP
+.BR \-L " \fInumber\fP, " \--limit "=" \fInumber\fP
+Limit the number of packets to send.
+This option may appear up to 1 times.
+This option takes an integer number as its argument.
+The value of \fInumber\fP is constrained to being:
+.in +4
+.nf
+.na
+greater than or equal to 1
+.fi
+.in -4
+The default \fInumber\fP for this option is:
+.ti +4
+ \-1
+.sp
+By default, tcpreplay will send all the packets.  Alternatively, you can 
+specify a maximum number of packets to send.  
+.TP
+.BR \-x " \fIstring\fP, " \--multiplier "=" \fIstring\fP
+Modify replay speed to a given multiple.
+This option may appear up to 1 times.
+This option must not appear in combination with any of the following options:
+pps, mbps, oneatatime, topspeed.
+.sp
+Specify a floating point value to modify the packet replay speed.
+Examples:
+.nf
+        2.0 will replay traffic at twice the speed captured
+        0.7 will replay traffic at 70% the speed captured
+.fi
+.TP
+.BR \-p " \fInumber\fP, " \--pps "=" \fInumber\fP
+Replay packets at a given packets/sec.
+This option may appear up to 1 times.
+This option must not appear in combination with any of the following options:
+multiplier, mbps, oneatatime, topspeed.
+This option takes an integer number as its argument.
+.sp
+
+.TP
+.BR \-M " \fIstring\fP, " \--mbps "=" \fIstring\fP
+Replay packets at a given Mbps.
+This option may appear up to 1 times.
+This option must not appear in combination with any of the following options:
+multiplier, pps, oneatatime, topspeed.
+.sp
+Specify a floating point value for the Mbps rate that tcpreplay
+should send packets at.
+.TP
+.BR \-t ", " \--topspeed
+Replay packets as fast as possible.
+This option must not appear in combination with any of the following options:
+mbps, multiplier, pps, oneatatime.
+.sp
+
+.TP
+.BR \-o ", " \--oneatatime
+Replay one packet at a time for each user input.
+This option must not appear in combination with any of the following options:
+mbps, pps, multiplier, topspeed.
+.sp
+Allows you to step through one or more packets at a time.
+.TP
+.BR \-P ", " \--pid
+Print the PID of tcpreplay at startup.
+.sp
+
+.TP
+.BR \-V ", " \--version
+Print version information.
+.sp
+
+.TP
+.BR \-h ", " \--less-help
+Display less usage information and exit.
+.sp
+
+.TP
+.BR \-H , " \--help"
+Display usage information and exit.
+.TP
+.BR \-! , " \--more-help"
+Extended usage information passed thru pager.
+.TP
+.BR \- " [\fIrcfile\fP]," " \--save-opts" "[=\fIrcfile\fP]"
+Save the option state to \fIrcfile\fP.  The default is the \fIlast\fP
+configuration file listed in the \fBOPTION PRESETS\fP section, below.
+.TP
+.BR \- " \fIrcfile\fP," " \--load-opts" "=\fIrcfile\fP," " \--no-load-opts"
+Load options from \fIrcfile\fP.
+The \fIno-load-opts\fP form will disable the loading
+of earlier RC/INI files.  \fI--no-load-opts\fP is handled early,
+out of order.
+.SH OPTION PRESETS
+Any option that is not marked as \fInot presettable\fP may be preset
+by loading values from configuration ("RC" or ".INI") file(s).
+The \fIhomerc\fP file is "\fI$$/\fP", unless that is a directory.
+In that case, the file "\fI.tcpreplayrc\fP"
+is searched for within that directory.
+.SH "SIGNALS"
+tcpreplay understands the following signals:
+.sp
+.IR "\fBSIGUSR1\fP"
+Suspend tcpreplay
+.sp
+.IR "\fBSIGCONT\fP"
+Restart tcpreplay
+.br
+
+.SH "SEE ALSO"
+tcpreplay-edit(1), tcpdump(1), tcpprep(1), tcprewrite(1), libnet(3)
+
+.SH "BUGS"
+tcpreplay can only send packets as fast as your computer's interface,
+processor, disk and system bus will allow.
+
+Replaying captured traffic may simulate odd or broken conditions on your
+network and cause problems.
+
+In most cases, you can not replay traffic back to/at a server.
+
+Some operating systems by default do not allow for forging source MAC
+addresses.  Please consult your operating system's documentation and the
+tcpreplay FAQ if you experiance this issue.
+.SH AUTHOR
+Copyright 2000-2007 Aaron Turner
+
+For support please use the tcpreplay-users@lists.sourceforge.net mailing list.
+
+The latest version of this software is always available from:
+http://tcpreplay.synfin.net/
+.PP
+Released under the Free BSD License.
+.PP
+This manual page was \fIAutoGen\fP-erated from the \fBtcpreplay\fP
+option definitions.

+ 7 - 7
src/tcpreplay.1

@@ -1,7 +1,7 @@
-.TH TCPREPLAY 1 2007-11-01 "(tcpreplay )" "Programmer's Manual"
+.TH TCPREPLAY 1 2008-01-16 "(tcpreplay )" "Programmer's Manual"
 .\"  DO NOT EDIT THIS FILE   (tcpreplay.1)
 .\"  
-.\"  It has been AutoGen-ed  Thursday November  1, 2007 at 01:50:24 PM PDT
+.\"  It has been AutoGen-ed  Wednesday January 16, 2008 at 10:09:46 PM PST
 .\"  From the definitions    tcpreplay_opts.def
 .\"  and the template file   agman1.tpl
 .\"
@@ -97,7 +97,7 @@ quote the arguments like: \-A "-axxx" so that they are not interpreted
 by tcpreplay.   Please see the tcpdump(1) man page for a complete list of 
 options.
 .TP
-.BR \-C ", " \--enable-file-cache
+.BR \-K ", " \--enable-file-cache
 Enable caching of packets to internal memory.
 This option must appear in combination with the following options:
 loop.
@@ -127,7 +127,7 @@ cachefile.
 .sp
 
 .TP
-.BR \-N ", " \--listnics
+.BR \--listnics
 List available network interfaces and exit.
 .sp
 
@@ -149,7 +149,7 @@ The default \fInumber\fP for this option is:
 .sp
 
 .TP
-.BR \-S ", " \--pktlen
+.BR \--pktlen
 Override the snaplen and use the actual packet len.
 This option may appear up to 1 times.
 .sp
@@ -178,7 +178,7 @@ The default \fInumber\fP for this option is:
 By default, tcpreplay will send all the packets.  Alternatively, you can 
 specify a maximum number of packets to send.  
 .TP
-.BR \-m " \fIstring\fP, " \--multiplier "=" \fIstring\fP
+.BR \-x " \fIstring\fP, " \--multiplier "=" \fIstring\fP
 Modify replay speed to a given multiple.
 This option may appear up to 1 times.
 This option must not appear in combination with any of the following options:
@@ -270,7 +270,7 @@ Restart tcpreplay
 .br
 
 .SH "SEE ALSO"
-tcpdump(1), tcpprep(1), tcprewrite(1), libnet(3)
+tcpreplay-edit(1), tcpdump(1), tcpprep(1), tcprewrite(1), libnet(3)
 
 .SH "BUGS"
 tcpreplay can only send packets as fast as your computer's interface,

+ 5 - 1
src/tcpreplay.c

@@ -1,4 +1,4 @@
-/* $Id: tcpreplay.c 1898 2007-08-25 05:10:51Z aturner $ */
+/* $Id: tcpreplay.c 1952 2008-01-17 05:43:20Z aturner $ */
 
 /*
  * Copyright (c) 2001-2007 Aaron Turner.
@@ -44,7 +44,11 @@
 #include <errno.h>
 
 #include "tcpreplay.h"
+#ifdef TCPREPLAY_EDIT
+#include "tcpreplay_edit_opts.h"
+#else
 #include "tcpreplay_opts.h"
+#endif
 #include "send_packets.h"
 #include "signal_handler.h"
 

File diff suppressed because it is too large
+ 1964 - 0
src/tcpreplay_edit_opts.c


+ 278 - 0
src/tcpreplay_edit_opts.h

@@ -0,0 +1,278 @@
+/*   -*- buffer-read-only: t -*- vi: set ro:
+ *  
+ *  DO NOT EDIT THIS FILE   (tcpreplay_edit_opts.h)
+ *  
+ *  It has been AutoGen-ed  Wednesday January 16, 2008 at 10:09:44 PM PST
+ *  From the definitions    tcpreplay_opts.def
+ *  and the template file   options
+ *
+ * Generated from AutoOpts 30:0:5 templates.
+ */
+
+/*
+ *  This file was produced by an AutoOpts template.  AutoOpts is a
+ *  copyrighted work.  This header file is not encumbered by AutoOpts
+ *  licensing, but is provided under the licensing terms chosen by the
+ *  tcpreplay author or copyright holder.  AutoOpts is licensed under
+ *  the terms of the LGPL.  The redistributable library (``libopts'') is
+ *  licensed under the terms of either the LGPL or, at the users discretion,
+ *  the BSD license.  See the AutoOpts and/or libopts sources for details.
+ *
+ * This source file is copyrighted and licensed under the following terms:
+ *
+ * tcpreplay copyright 2000-2007 Aaron Turner - all rights reserved
+ *
+ * tcpreplay is free software copyrighted by Aaron Turner.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name ``Aaron Turner'' nor the name of any other
+ *    contributor may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ * 
+ * tcpreplay IS PROVIDED BY Aaron Turner ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL Aaron Turner OR ANY OTHER CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/*
+ *  This file contains the programmatic interface to the Automated
+ *  Options generated for the tcpreplay program.
+ *  These macros are documented in the AutoGen info file in the
+ *  "AutoOpts" chapter.  Please refer to that doc for usage help.
+ */
+#ifndef AUTOOPTS_TCPREPLAY_EDIT_OPTS_H_GUARD
+#define AUTOOPTS_TCPREPLAY_EDIT_OPTS_H_GUARD 1
+#include "config.h"
+#include <autoopts/options.h>
+
+/*
+ *  Ensure that the library used for compiling this generated header is at
+ *  least as new as the version current when the header template was released
+ *  (not counting patch version increments).  Also ensure that the oldest
+ *  tolerable version is at least as old as what was current when the header
+ *  template was released.
+ */
+#define AO_TEMPLATE_VERSION 122880
+#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
+ || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
+# error option template version mismatches autoopts/options.h header
+  Choke Me.
+#endif
+
+/*
+ *  Enumeration of each option:
+ */
+typedef enum {
+        INDEX_OPT_PORTMAP          =  1,
+        INDEX_OPT_SEED             =  2,
+        INDEX_OPT_PNAT             =  3,
+        INDEX_OPT_SRCIPMAP         =  4,
+        INDEX_OPT_DSTIPMAP         =  5,
+        INDEX_OPT_ENDPOINTS        =  6,
+        INDEX_OPT_SKIPBROADCAST    =  7,
+        INDEX_OPT_FIXCSUM          =  8,
+        INDEX_OPT_MTU              =  9,
+        INDEX_OPT_EFCS             = 10,
+        INDEX_OPT_FIXLEN           = 11,
+        INDEX_OPT_SKIPL2BROADCAST  = 12,
+        INDEX_OPT_DLT              = 13,
+        INDEX_OPT_ENET_DMAC        = 14,
+        INDEX_OPT_ENET_SMAC        = 15,
+        INDEX_OPT_ENET_VLAN        = 16,
+        INDEX_OPT_ENET_VLAN_TAG    = 17,
+        INDEX_OPT_ENET_VLAN_CFI    = 18,
+        INDEX_OPT_ENET_VLAN_PRI    = 19,
+        INDEX_OPT_HDLC_CONTROL     = 20,
+        INDEX_OPT_HDLC_ADDRESS     = 21,
+        INDEX_OPT_USER_DLT         = 22,
+        INDEX_OPT_USER_DLINK       = 23,
+        INDEX_OPT_DBUG             = 24,
+        INDEX_OPT_QUIET            = 25,
+        INDEX_OPT_ACCURATE         = 26,
+        INDEX_OPT_ACCURATE2        = 27,
+        INDEX_OPT_VERBOSE          = 28,
+        INDEX_OPT_DECODE           = 29,
+        INDEX_OPT_ENABLE_FILE_CACHE = 30,
+        INDEX_OPT_CACHEFILE        = 31,
+        INDEX_OPT_INTF1            = 32,
+        INDEX_OPT_INTF2            = 33,
+        INDEX_OPT_LISTNICS         = 34,
+        INDEX_OPT_LOOP             = 35,
+        INDEX_OPT_PKTLEN           = 36,
+        INDEX_OPT_LIMIT            = 37,
+        INDEX_OPT_MULTIPLIER       = 38,
+        INDEX_OPT_PPS              = 39,
+        INDEX_OPT_MBPS             = 40,
+        INDEX_OPT_TOPSPEED         = 41,
+        INDEX_OPT_ONEATATIME       = 42,
+        INDEX_OPT_PID              = 43,
+        INDEX_OPT_VERSION          = 44,
+        INDEX_OPT_LESS_HELP        = 45,
+        INDEX_OPT_HELP             = 46,
+        INDEX_OPT_MORE_HELP        = 47,
+        INDEX_OPT_SAVE_OPTS        = 48,
+        INDEX_OPT_LOAD_OPTS        = 49
+} teOptIndex;
+
+#define OPTION_CT    50
+
+/*
+ *  Interface defines for all options.  Replace "n" with the UPPER_CASED
+ *  option name (as in the teOptIndex enumeration above).
+ *  e.g. HAVE_OPT( TCPEDIT )
+ */
+#define         DESC(n) (tcpreplayOptions.pOptDesc[INDEX_OPT_## n])
+#define     HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
+#define      OPT_ARG(n) (DESC(n).optArg.argString)
+#define    STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
+#define    COUNT_OPT(n) (DESC(n).optOccCt)
+#define    ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
+#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
+#define  ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
+#define  STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
+#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
+#define    CLEAR_OPT(n) STMTS( \
+                DESC(n).fOptState &= OPTST_PERSISTENT_MASK;   \
+                if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
+                    DESC(n).fOptState |= OPTST_DISABLED; \
+                DESC(n).optCookie = NULL )
+
+/*
+ *  Interface defines for specific options.
+ */
+#define VALUE_OPT_PORTMAP        'r'
+#define VALUE_OPT_SEED           's'
+#define OPT_VALUE_SEED           (DESC(SEED).optArg.argInt)
+#define VALUE_OPT_PNAT           'N'
+#define VALUE_OPT_SRCIPMAP       'S'
+#define VALUE_OPT_DSTIPMAP       'D'
+#ifdef HAVE_CACHEFILE_SUPPORT
+#define VALUE_OPT_ENDPOINTS      'e'
+#endif /* HAVE_CACHEFILE_SUPPORT */
+#define VALUE_OPT_SKIPBROADCAST  'b'
+#define VALUE_OPT_FIXCSUM        'C'
+#define VALUE_OPT_MTU            'm'
+#define OPT_VALUE_MTU            (DESC(MTU).optArg.argInt)
+#define VALUE_OPT_EFCS           'E'
+#define VALUE_OPT_FIXLEN         'F'
+#define VALUE_OPT_SKIPL2BROADCAST 12
+#define VALUE_OPT_DLT            13
+#define VALUE_OPT_ENET_DMAC      14
+#define VALUE_OPT_ENET_SMAC      15
+#define VALUE_OPT_ENET_VLAN      16
+#define VALUE_OPT_ENET_VLAN_TAG  17
+#define OPT_VALUE_ENET_VLAN_TAG  (DESC(ENET_VLAN_TAG).optArg.argInt)
+#define VALUE_OPT_ENET_VLAN_CFI  18
+#define OPT_VALUE_ENET_VLAN_CFI  (DESC(ENET_VLAN_CFI).optArg.argInt)
+#define VALUE_OPT_ENET_VLAN_PRI  19
+#define OPT_VALUE_ENET_VLAN_PRI  (DESC(ENET_VLAN_PRI).optArg.argInt)
+#define VALUE_OPT_HDLC_CONTROL   20
+#define OPT_VALUE_HDLC_CONTROL   (DESC(HDLC_CONTROL).optArg.argInt)
+#define VALUE_OPT_HDLC_ADDRESS   21
+#define OPT_VALUE_HDLC_ADDRESS   (DESC(HDLC_ADDRESS).optArg.argInt)
+#define VALUE_OPT_USER_DLT       22
+#define OPT_VALUE_USER_DLT       (DESC(USER_DLT).optArg.argInt)
+#define VALUE_OPT_USER_DLINK     23
+#ifdef DEBUG
+#define VALUE_OPT_DBUG           'd'
+#define OPT_VALUE_DBUG           (DESC(DBUG).optArg.argInt)
+#endif /* DEBUG */
+#define VALUE_OPT_QUIET          'q'
+#define VALUE_OPT_ACCURATE       'a'
+#define VALUE_OPT_ACCURATE2      27
+#define OPT_VALUE_ACCURATE2      (DESC(ACCURATE2).optArg.argInt)
+#ifdef ENABLE_VERBOSE
+#define VALUE_OPT_VERBOSE        'v'
+#define SET_OPT_VERBOSE   STMTS( \
+        DESC(VERBOSE).optActualIndex = 28; \
+        DESC(VERBOSE).optActualValue = VALUE_OPT_VERBOSE; \
+        DESC(VERBOSE).fOptState &= OPTST_PERSISTENT_MASK; \
+        DESC(VERBOSE).fOptState |= OPTST_SET )
+#endif /* ENABLE_VERBOSE */
+#ifdef ENABLE_VERBOSE
+#define VALUE_OPT_DECODE         'A'
+#endif /* ENABLE_VERBOSE */
+#define VALUE_OPT_ENABLE_FILE_CACHE 'K'
+#define VALUE_OPT_CACHEFILE      'c'
+#define VALUE_OPT_INTF1          'i'
+#define VALUE_OPT_INTF2          'I'
+#ifdef ENABLE_PCAP_FINDALLDEVS
+#define VALUE_OPT_LISTNICS       130
+#endif /* ENABLE_PCAP_FINDALLDEVS */
+#define VALUE_OPT_LOOP           'l'
+#define OPT_VALUE_LOOP           (DESC(LOOP).optArg.argInt)
+#define VALUE_OPT_PKTLEN         132
+#define VALUE_OPT_LIMIT          'L'
+#define OPT_VALUE_LIMIT          (DESC(LIMIT).optArg.argInt)
+#define VALUE_OPT_MULTIPLIER     'x'
+#define VALUE_OPT_PPS            'p'
+#define OPT_VALUE_PPS            (DESC(PPS).optArg.argInt)
+#define VALUE_OPT_MBPS           'M'
+#define VALUE_OPT_TOPSPEED       't'
+#define VALUE_OPT_ONEATATIME     'o'
+#define VALUE_OPT_PID            'P'
+#define VALUE_OPT_VERSION        'V'
+#define VALUE_OPT_LESS_HELP      'h'
+
+#define VALUE_OPT_HELP          'H'
+#define VALUE_OPT_MORE_HELP     '!'
+#define VALUE_OPT_SAVE_OPTS     INDEX_OPT_SAVE_OPTS
+#define VALUE_OPT_LOAD_OPTS     INDEX_OPT_LOAD_OPTS
+#define SET_OPT_SAVE_OPTS(a)   STMTS( \
+        DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
+        DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
+        DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
+/*
+ *  Interface defines not associated with particular options
+ */
+#define ERRSKIP_OPTERR  STMTS( tcpreplayOptions.fOptSet &= ~OPTPROC_ERRSTOP )
+#define ERRSTOP_OPTERR  STMTS( tcpreplayOptions.fOptSet |= OPTPROC_ERRSTOP )
+#define RESTART_OPT(n)  STMTS( \
+                tcpreplayOptions.curOptIdx = (n); \
+                tcpreplayOptions.pzCurOpt  = NULL )
+#define START_OPT       RESTART_OPT(1)
+#define USAGE(c)        (*tcpreplayOptions.pUsageProc)( &tcpreplayOptions, c )
+/* extracted from /opt/local/share/autogen/opthead.tpl near line 380 */
+
+/* * * * * *
+ *
+ *  Declare the tcpreplay option descriptor.
+ */
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+extern tOptions   tcpreplayOptions;
+
+#ifndef _
+#  if ENABLE_NLS
+#    include <stdio.h>
+     static inline char* aoGetsText( char const* pz ) {
+         if (pz == NULL) return NULL;
+         return (char*)gettext( pz );
+     }
+#    define _(s)  aoGetsText(s)
+#  else  /* ENABLE_NLS */
+#    define _(s)  s
+#  endif /* ENABLE_NLS */
+#endif
+
+#ifdef  __cplusplus
+}
+#endif
+#endif /* AUTOOPTS_TCPREPLAY_EDIT_OPTS_H_GUARD */
+/* tcpreplay_edit_opts.h ends here */

+ 10 - 5
src/tcpreplay_opts.c

@@ -2,7 +2,7 @@
  *  
  *  DO NOT EDIT THIS FILE   (tcpreplay_opts.c)
  *  
- *  It has been AutoGen-ed  Thursday November  1, 2007 at 01:50:23 PM PDT
+ *  It has been AutoGen-ed  Wednesday January 16, 2008 at 10:09:44 PM PST
  *  From the definitions    tcpreplay_opts.def
  *  and the template file   options
  *
@@ -918,7 +918,7 @@ doOptListnics(
     tOptions*   pOptions,
     tOptDesc*   pOptDesc )
 {
-    /* extracted from tcpreplay_opts.def, line 233 */
+    /* extracted from tcpreplay_opts.def, line 232 */
 
 interface_list_t *list = get_interface_list();
 list_interfaces(list);
@@ -1039,7 +1039,7 @@ doOptPid(
     tOptions*   pOptions,
     tOptDesc*   pOptDesc )
 {
-    /* extracted from tcpreplay_opts.def, line 369 */
+    /* extracted from tcpreplay_opts.def, line 367 */
     
     fprintf(stderr, "PID: %hu\n", getpid());
     
@@ -1054,7 +1054,7 @@ doOptVersion(
     tOptions*   pOptions,
     tOptDesc*   pOptDesc )
 {
-    /* extracted from tcpreplay_opts.def, line 381 */
+    /* extracted from tcpreplay_opts.def, line 379 */
     
     fprintf(stderr, "tcpreplay version: %s (build %s)", VERSION, svn_version());
 #ifdef DEBUG
@@ -1083,6 +1083,11 @@ fprintf(stderr, "Compiled against winpcap: %s\n", get_pcap_version());
 #else
     fprintf(stderr, "Verbose printing via tcpdump: disabled\n");
 #endif
+#ifdef TCPREPLAY_EDIT
+    fprintf(stderr, "Packet editing: enabled\n");
+#else
+    fprintf(stderr, "Packet editing: disabled\n");
+#endif
     exit(0);
     
 }
@@ -1096,7 +1101,7 @@ doOptLess_Help(
     tOptions*   pOptions,
     tOptDesc*   pOptDesc )
 {
-    /* extracted from tcpreplay_opts.def, line 421 */
+    /* extracted from tcpreplay_opts.def, line 424 */
   
     USAGE(EXIT_FAILURE);
 

+ 8 - 5
src/tcpreplay_opts.def

@@ -72,7 +72,7 @@ Restart tcpreplay
 @end enumerate
 
 .SH "SEE ALSO"
-tcpdump(1), tcpprep(1), tcprewrite(1), libnet(3)
+tcpreplay-edit(1), tcpdump(1), tcpprep(1), tcprewrite(1), libnet(3)
 
 .SH "BUGS"
 tcpreplay can only send packets as fast as your computer's interface,
@@ -174,7 +174,7 @@ EOText;
 /* Cache files to internal memory */
 flag = {
 	name		= enable_file_cache;
-	value		= C;
+	value		= K;
 	flags-must	= loop;
 	descrip		= "Enable caching of packets to internal memory";
 	doc			= <<- EOText
@@ -225,7 +225,6 @@ flag = {
 flag = {
 	ifdef		= ENABLE_PCAP_FINDALLDEVS;
 	name		= listnics;
-	value		= N;
 	descrip		= "List available network interfaces and exit";
 	immediate;
 	doc			= "";
@@ -256,7 +255,6 @@ flag = {
 
 flag = {
     name        = pktlen;
-    value       = S;
     max         = 1;
     descrip     = "Override the snaplen and use the actual packet len";
     doc         = <<- EOText
@@ -294,7 +292,7 @@ flag = {
     flags-cant  = mbps;
     flags-cant  = oneatatime;
     flags-cant  = topspeed;
-    value       = m;
+    value       = x;
     arg-type    = string;
     max         = 1;
     descrip     = "Modify replay speed to a given multiple";
@@ -406,6 +404,11 @@ flag = {
 #else
     fprintf(stderr, "Verbose printing via tcpdump: disabled\n");
 #endif
+#ifdef TCPREPLAY_EDIT
+    fprintf(stderr, "Packet editing: enabled\n");
+#else
+    fprintf(stderr, "Packet editing: disabled\n");
+#endif
     exit(0);
     
 EOVersion;

+ 5 - 5
src/tcpreplay_opts.h

@@ -2,7 +2,7 @@
  *  
  *  DO NOT EDIT THIS FILE   (tcpreplay_opts.h)
  *  
- *  It has been AutoGen-ed  Thursday November  1, 2007 at 01:50:22 PM PDT
+ *  It has been AutoGen-ed  Wednesday January 16, 2008 at 10:09:44 PM PST
  *  From the definitions    tcpreplay_opts.def
  *  and the template file   options
  *
@@ -150,19 +150,19 @@ typedef enum {
 #ifdef ENABLE_VERBOSE
 #define VALUE_OPT_DECODE         'A'
 #endif /* ENABLE_VERBOSE */
-#define VALUE_OPT_ENABLE_FILE_CACHE 'C'
+#define VALUE_OPT_ENABLE_FILE_CACHE 'K'
 #define VALUE_OPT_CACHEFILE      'c'
 #define VALUE_OPT_INTF1          'i'
 #define VALUE_OPT_INTF2          'I'
 #ifdef ENABLE_PCAP_FINDALLDEVS
-#define VALUE_OPT_LISTNICS       'N'
+#define VALUE_OPT_LISTNICS       10
 #endif /* ENABLE_PCAP_FINDALLDEVS */
 #define VALUE_OPT_LOOP           'l'
 #define OPT_VALUE_LOOP           (DESC(LOOP).optArg.argInt)
-#define VALUE_OPT_PKTLEN         'S'
+#define VALUE_OPT_PKTLEN         12
 #define VALUE_OPT_LIMIT          'L'
 #define OPT_VALUE_LIMIT          (DESC(LIMIT).optArg.argInt)
-#define VALUE_OPT_MULTIPLIER     'm'
+#define VALUE_OPT_MULTIPLIER     'x'
 #define VALUE_OPT_PPS            'p'
 #define OPT_VALUE_PPS            (DESC(PPS).optArg.argInt)
 #define VALUE_OPT_MBPS           'M'

+ 2 - 2
src/tcprewrite.1

@@ -1,7 +1,7 @@
-.TH TCPREWRITE 1 2007-11-01 "(tcprewrite )" "Programmer's Manual"
+.TH TCPREWRITE 1 2008-01-16 "(tcprewrite )" "Programmer's Manual"
 .\"  DO NOT EDIT THIS FILE   (tcprewrite.1)
 .\"  
-.\"  It has been AutoGen-ed  Thursday November  1, 2007 at 01:50:25 PM PDT
+.\"  It has been AutoGen-ed  Wednesday January 16, 2008 at 10:09:47 PM PST
 .\"  From the definitions    tcprewrite_opts.def
 .\"  and the template file   agman1.tpl
 .\"

+ 1 - 1
src/tcprewrite_opts.c

@@ -2,7 +2,7 @@
  *  
  *  DO NOT EDIT THIS FILE   (tcprewrite_opts.c)
  *  
- *  It has been AutoGen-ed  Thursday November  1, 2007 at 01:50:23 PM PDT
+ *  It has been AutoGen-ed  Wednesday January 16, 2008 at 10:09:45 PM PST
  *  From the definitions    tcprewrite_opts.def
  *  and the template file   options
  *

+ 1 - 1
src/tcprewrite_opts.h

@@ -2,7 +2,7 @@
  *  
  *  DO NOT EDIT THIS FILE   (tcprewrite_opts.h)
  *  
- *  It has been AutoGen-ed  Thursday November  1, 2007 at 01:50:23 PM PDT
+ *  It has been AutoGen-ed  Wednesday January 16, 2008 at 10:09:45 PM PST
  *  From the definitions    tcprewrite_opts.def
  *  and the template file   options
  *

BIN
test/._Makefile.am


+ 1 - 1
test/Makefile.am

@@ -393,7 +393,7 @@ replay_rate:
 replay_multi:
 	$(PRINTF) "%s" "[tcpreplay] Multiplier test: "
 	$(PRINTF) "%s\n" "*** [tcpreplay] Multiplier test: " >>test.log
-	$(TCPREPLAY) $(ENABLE_DEBUG) -i $(nic1) -m 25.0 test.pcap >>test.log 2>&1
+	$(TCPREPLAY) $(ENABLE_DEBUG) -i $(nic1) -x 25.0 test.pcap >>test.log 2>&1
 	if [ $? ] ; then $(PRINTF) "\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t%s\n" "OK"; fi
 
 replay_top:

+ 1 - 1
test/Makefile.in

@@ -686,7 +686,7 @@ replay_rate:
 replay_multi:
 	$(PRINTF) "%s" "[tcpreplay] Multiplier test: "
 	$(PRINTF) "%s\n" "*** [tcpreplay] Multiplier test: " >>test.log
-	$(TCPREPLAY) $(ENABLE_DEBUG) -i $(nic1) -m 25.0 test.pcap >>test.log 2>&1
+	$(TCPREPLAY) $(ENABLE_DEBUG) -i $(nic1) -x 25.0 test.pcap >>test.log 2>&1
 	if [ $? ] ; then $(PRINTF) "\t\t%s\n" "FAILED"; else $(PRINTF) "\t\t%s\n" "OK"; fi
 
 replay_top: