VTA User's Guide: V1.0 for VTA 1.0

Chapter 4. Using VTA wrapper (vtaWrapper.a)



VTA provides a wrapper library (vtaWrapper.a) for the socket system calls.  If an application is linked against vtaWrapper.a instead of libc functions, all TCP/UDP socket information in that application will be saved to a temporary file. VTA will use that file to filter packets and capture only those associated with the specific application.

To capture packets from a specific application, the user should choose "Specific Application" in the data specification window (See section 3.2.1). He also need to link his own application programs to the VTA wrapper library -- vtaWrapper.a.

The following section provides an example for using vtaWrapper.a. This example is also included in the VTA source code distribution (vtaWrapper.tar.gz).

4.1 An example of using vtaWrapper.a

Assume the user has written two socket programs tcp-client.c and tcp-server.c. To capture only packets from tcp-client and tcp-server, he needs to link his program to vtaWrapper.a using the following command(assume vtaWrapper.a is in the same directory as his applications):

gcc -g tcp-client.c ./vtaWrapper.a -o tcp-client
gcc -g tcp-server.c ./vtaWrapper.a -o tcp-server

Before the user runs his applications, he needs to start up VTA. In the data specification window (See section 3.2.1), choose the "Specific Application" mode. Follow the rest of the user wizard and start capturing. Then he can starts his application by typing in ./tcp-client and ./tcp-server. All packets related to these applications would then be captured and shown in VTA views.
 
 

Next Topic   Miscellaneous Topics