Aaron Turner wrote:
On Wed, Dec 31, 2008 at 12:58 AM, Abdelrazak Younes
<younes.ab...@gmail.com> wrote:
Hello,

I am not much a commandline guy and my coworkers are Windows people; so
I was thinking of creating a simple GUI for tcpreplay and tcprewrite. Is
there anything like this planned or in the work already? I am willing to
contribute to this project if it exists. If nothing is decided yet, I am
quite proficient with C++ and Qt4 (I wrote the initial Qt4 port of LyX*)
so if that could be taken in the balance...

Abdel.

* www.lyx.org

Hi Abdel,

I'm actually quite familar with LyX- a lot of the early tcpreplay
documentation was written using it and it's my preferred tool for
technical writing.

I am always amazed to see that LyX is so well known :-)

  I've occasionally toyed with the idea of creating
a GUI, but frankly if you've ever seen a GUI I've created you'd know
to never ask me to create one again. :)

Never say never ;-)

Long story short, I know some C++ (not my favorite language, but I get
by) and zero QT.
I have to admit that C++ is my favorite language. But the good thing about the C++/Qt combination is that you can pretty much let C++ advanced feature out of the way (i.e. boost and stl). And we can decide to not use advanced C++ in a first step: just C-like functions and small, very focused, classes. My experience is that if you keep the classes small and focused the C++ source code remain very flexible and understandable.

Anyways, I can't really offer much in the way of actual coding help,
but I'd be more then happy to work with you on the design/testing/etc
of the GUI.   Honestly, I'd love to see a tcpreplay GUI- I'm sure it
would really help a lot of people who have issues with command line
tools with dozens of options like it has.

Depending on how much free time and motivation you have maybe that's
enough, if so great- if not, I understand.

I'd like to make more use of tcpreplay in my new day-job, instead of chariot. So I can justify working a bit on this GUI during my working hours :-)

As for the design, initially I plan to just offer some edit boxes and push buttons for main commands. In a first step, the GUI will manage external command-line process and communicate with tcpprep/tcprwrite/tcpreplay thanks to pipes (stdin/out). That's how we manage LateX and external python script within LyX and it work just fine.

In a second step, if needed and if tcpreplay evolves toward creating a library, we can replace some of the instantaneous commands with library function calling. Do you have any plan for such a library? This will for sure facilitate the porting to Windows/MSVC.

For the command definitions, in order to be flexible, I was thinking of a simple INI like file format that will define the needed command. For example:

# TCP commands:
rw = /usr/local/bin/tcprewrite
pp = /usr/local/bin/tcpprep
rp = /usr/local/bin/tcpreplay

# Rewrite TCP/UDP ports
rw_port = -r %1

# Rewrite source IP addresses using pseudo-NAT
rw_src_ip =  -S %1

# Rewrite destination IP addresses using pseudo-NAT
rw_dst_ip =  -D %1

# rewrite pcap file %1 into file %2
rw_file =  -i %1 -o %2

# Replay pcap file %2 on interface %1
rp_play_file = -i %1 %2

The idea is to let the GUI construct the command line in an easy and explicit way. What do you think? If you have a better idea or comments, please don't hesitate.

As for the GUI proper, I was thinking of hiding the initial temporary file generated by tcprewrite. I can work a minimal demo app with the following example. Three edit boxes for port, destination IP and MAC, one edit box for pcap input file. The source IP and mac addresses will be directly decided by the GUI. As a picture is worth a thousand words, I attach a screenshot of a designer file that I just created. Obviously, I decided on which controls make sense based on my pretty dumb specific use case but nothing is set in stone of course.

Abdel.

<<inline: example-tcpreplay-gui.png>>

------------------------------------------------------------------------------
_______________________________________________
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