I haven't tested this, other then to make sure it compiles, but I
think it should do what you want:

--- src/tcpreplay.c     (revision 2540)
+++ src/tcpreplay.c     (working copy)
@@ -152,8 +152,10 @@
     /* main loop for non-bridge mode */
     if (options.loop > 0) {
         while (options.loop--) {  /* limited loop */
-
-
+#ifdef TCPREPLAY_EDIT
+            OPT_VALUE_SEED += options.loop;
+            tcpedit_post_args(&tcpedit);
+#endif
             if (options.dualfile) {
                 /* process two files at a time for network taps */
                 for (i = 0; i < argc; i += 2) {



On Fri, Jun 17, 2011 at 10:29 AM, Dileep Simha <dsi...@gmail.com> wrote:
> Thanks for the quick response.  I appreciate it.
> I'm using the loopback interface because a co-worker is working on the same
> linux box as me and is doing tests on the other interfaces.
> Would there be a simple way for me to modify the source code in order to
> re-randomize the ip address before each iteration or not?
> - Dileep
>
> On Fri, Jun 17, 2011 at 12:23 PM, Aaron Turner <synfina...@gmail.com> wrote:
>>
>> On Fri, Jun 17, 2011 at 9:57 AM, Dileep Simha <dsi...@gmail.com> wrote:
>> > I have a question about the randomizing ip address function of
>> > tcpreplay-edit.
>> > When I run the following: ./tcpreplay-edit --intf1=lo --topspeed
>> > --seed=10
>> > --loop=3 capture.pcap,
>> > is the ip address randomized before every single loop or is it just done
>> > once and then the same ip address sent over and over.  I was going to
>> > check
>> > this with --verbose flag but that keeps giving me an error
>>
>> Sorry about the verbose flag issue... been driving me nuts that one.
>>
>> As for seed & loop, basically you'll end up with the same IP addresses
>> 3 times.  Basically randomization is done by combining the seed +
>> original IP to generate the new IP.   In order for sessions not to
>> break, the code makes sure that a given seed + IP always results in
>> the same "randomized IP".
>>
>> FWIW, replaying over loopback is almost always the wrong thing to do.
>>
>>
>> --
>> Aaron Turner
>> http://synfin.net/         Twitter: @synfinatic
>> http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix &
>> Windows
>> Those who would give up essential Liberty, to purchase a little temporary
>> Safety, deserve neither Liberty nor Safety.
>>     -- Benjamin Franklin
>> "carpe diem quam minimum credula postero"
>>
>>
>> ------------------------------------------------------------------------------
>> EditLive Enterprise is the world's most technically advanced content
>> authoring tool. Experience the power of Track Changes, Inline Image
>> Editing and ensure content is compliant with Accessibility Checking.
>> http://p.sf.net/sfu/ephox-dev2dev
>> _______________________________________________
>> Tcpreplay-users mailing list
>> Tcpreplay-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/tcpreplay-users
>> Support Information: http://tcpreplay.synfin.net/trac/wiki/Support
>
>
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
> _______________________________________________
> Tcpreplay-users mailing list
> Tcpreplay-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tcpreplay-users
> Support Information: http://tcpreplay.synfin.net/trac/wiki/Support
>



-- 
Aaron Turner
http://synfin.net/         Twitter: @synfinatic
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
    -- Benjamin Franklin
"carpe diem quam minimum credula postero"

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Tcpreplay-users mailing list
Tcpreplay-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcpreplay-users
Support Information: http://tcpreplay.synfin.net/trac/wiki/Support

Reply via email to