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

Marcel van Lieshout marcel at hmcs.nl
Thu Jun 8 13:45:46 GMT 2006


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.

Marcel


  ----- Original Message ----- 
  From: Vasily Borovyak 
  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 
      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.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>

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


  _______________________________________________
  Winpcap-users mailing list
  Winpcap-users at winpcap.org
  https://www.winpcap.org/mailman/listinfo/winpcap-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20060608/c955acfa/attachment.htm


More information about the Winpcap-users mailing list