On Thu, Aug 20, 2009 at 10:51 AM, yassine antir<[email protected]> wrote:
> Hi every body,
>
> i am Yassine, i am student and i am writing an application that uses
> tcprewrite and tcpreplay what i have done till now is a system call for
> these 2 binaries  system("tcpreplay...")
> but this method is not sufficient for me (not efficient: the processing time
> is very important for my application and i want not lost time with this
> system calls, and another reason is that's not elegant too).
> so instead of going through the source code (which is huge) to take only
> what i need, i thought that creating a static library will be more better.
> but unfortunately i could not do it
> what i have done is:
>
> !/bin/sh
> AR="ar"
> ARFLAGS="cru"
> libtcprewrite_a_AR="$AR $ARFLAGS"
> libtcpreplay_a_AR="$AR $ARFLAGS"
> libtcprewrite_a_LIBADD=
> libtcpreplay_a_LIBADD=
> LIBTOOL="libtool"
> RANLIB="ranlib"
> OBJEXT=" o"
>
> am_libtcprewrite_a_OBJECTS="tcpreplay-tcpreplay.o \
>     tcprewrite-tcprewrite_opts.o"
>
> am_libtcpreplay_a_OBJECTS="tcpreplay-send_packets.o \
>     tcpreplay-signal_handler.o \
>     tcpreplay-sleep.o \
>     tcpreplay-tcpreplay_opts.o"
>
> libtcprewrite_a_OBJECTS="$am_libtcprewrite_a_OBJECTS"
> libtcpreplay_a_OBJECTS="$am_libtcpreplay_a_OBJECTS"
>
> rm -f libtcprewrite.a
> rm -f libtcpreplay.a
>
> $libtcprewrite_a_AR libtcprewrite.a $libtcprewrite_a_OBJECTS
> $libtcprewrite_a_LIBADD
> $RANLIB libtcprewrite.a
> $libtcpreplay_a_AR libtcpreplay.a $libtcpreplay_a_OBJECTS
> $libtcpreplay_a_LIBADD
> $RANLIB libtcpreplay.a
>
> and i have rewrite the main of tcpreplay in my application as a function
> that i will use it there (i thought that i have added all headers files and
> libraries that i need  libopts.a libcommon.a libsrtl.a libtcpreplay.a ...)
> but i failed to do it.
>
> so if somebody have an idea or can give me a tip i will be very grateful. i
> hope that i get a quick answer :)
> and sorry for my english :D

Without any errors & more details I can't really be much of a help.
You should look at the existing Makefile.am files to know what needs
to be linked and the appropriate orders.

Alternatively, you can try the source code in trunk (the future 4.0
release) which supports building libraries and a full API to all the
tcpreplay/edit functionality.  The caveat with that though, is that
4.0 uses cmake (www.cmake.org) rather then Autotools for building.
Unfortunately, 4.0 is is still a work in progress so not everything is
complete, but a large part of the librarization effort is complete and
I'm more then happy to accept patches which complete the work. :)

-- 
Aaron Turner
http://synfin.net/
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

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Tcpreplay-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tcpreplay-users
Support Information: http://tcpreplay.synfin.net/trac/wiki/Support

Reply via email to