[Winpcap-users] Re: header->ts.tv_usec

Mark Pizzolato winpcap-users-20031003 at reg.pizzolato.net
Fri Jun 9 02:45:44 GMT 2006


On Thursday, June 08, 2006 at 6:45 AM, Marcel wrote:
>

> Why I (think I) need it:
>
> I am working on a simulator. This simulator simulates ethernet embedded 
> chips. It "sits" between a simulated microcontroller and the live network. 
> As such, it receives and sends packets. As an additional debugging 
> facility (after all, that is what simulation is all about), I want to 
> pcap_dump the received and transmitted packets into a file. That way they 
> can be analysed with Etherreal (sorry: WireShark). To pcap_dump the 
> packets, I need a pkt_header. The received packets already have this, but 
> I need to create some valid header for the packets I send.
>
> Setting the time in this header to zeroes would be the easiest, but how 
> does WireShark react on this? I can/will sort this out myself, but when 
> the question about timeval went by, I decided to attach my question to it.

Well, this sounds sort of complicated and messy for what is likely to be an 
ocaisionally used debugging feature.

My suggestion:

       1) remove the code in your app which is trying to do this.

and

       2) use Ethereal (WireShark) (or tcpdump, or WinDump), when necessary 
to debug things, with a filter that only selects the contrived MAC address 
of your virtual NIC.

Note:  I've implemented a similar virtual NIC for a simulated system and the 
suggested method has worked quite well for direct observation and/or 
recording packet sets for subsequent analysis.

Good Luck

- Mark Pizzolato

----- Original Message ----- 
From: Vasily Borovyak <mailto:vbor at isd.dp.ua>
To: winpcap-users at winpcap.org
Sent: Thursday, June 08, 2006 1:52 PM
Subject: Re: [Winpcap-users] Re: header->ts.tv_usec

I do not understand why do you need that. Could you please explain?
As far as I know timeval is used not for the time representing but for the 
short period of time representing.


So I can only assume the answer for your question.
I made a quick look at the wpcap sources and found these lines:
      timeout.tv_sec = to_ms / 1000;
      timeout.tv_usec = (to_ms * 1000) % 1000000;
Where to_ms is the some microseconds value.


Marcel van Lieshout wrote:

yes and

When generating packets to be saved to disk using pcap_dump(), what is the 
easiest way to generate the timestamp from the current time?

Marcel

----- Original Message ----- 
From: joe kibz <mailto:chikabanga2005 at yahoo.com>
To: winpcap-users at winpcap.org
Sent: Thursday, June 08, 2006 12:08 PM
Subject: [Winpcap-users] Re: header->ts.tv_usec

Problem:

The timeval ts for the generic header for each packet captured .
What exactly does the second value ts 
<file:///C:/joekibz/WpdPack/docs/html/structpcap__pkthdr.html#o0> .tv_usec 
represent ?


joe

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com



  _____

_______________________________________________
Winpcap-users mailing list
Winpcap-users at winpcap.org
https://www.winpcap.org/mailman/listinfo/winpcap-users



  _____


_______________________________________________
Winpcap-users mailing list
Winpcap-users at winpcap.org
https://www.winpcap.org/mailman/listinfo/winpcap-users



-- 
Best regards. Vasily Borovyak <vbor at isd.dp.ua> <mailto:vbor at isd.dp.ua>


  _____




_______________________________________________
Winpcap-users mailing list
Winpcap-users at winpcap.org
https://www.winpcap.org/mailman/listinfo/winpcap-users





--------------------------------------------------------------------------------


> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users
> 




More information about the Winpcap-users mailing list