On Mon, 8 Apr 2002, Zhu Ying Jie wrote:

> Hi,
>    I am currently working on a network simulator (working under
> Linux 2.4.2) in which tcpdump can work. But the tcpdump uses the real
> system time instead of the virtual time of the simulated network. Can
> anyone tell me how to associate the tcpdump with the virtual clock of the
> simulated system?
> 

I have developed a similar simulator, thats why i am trying to reply.
But i am not an expert here at all.

The time-stamp is assigned by the libpcap library. 

Are you taking traffic online or offline? Because if it is offline,
already timestamp is written to dump-file. In that case after every packet
is read from that file, you can change the time with your simulator time.
The actual code is in pcap_offline_read() function of savefile.c file
which will be in libpcap directory.

In case of online traffic you have to bypass an ioctl in pcap_read()
function of pcap-linux.c file in libpcap directory.
The actual ioctl is: (ioctl(p->fd, SIOCGSTAMP, &h.ts)

Instead of this, you assign your simulated time into "h.ts".

Cheers,
Saif


-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe

Reply via email to