[Winpcap-users] Getting timestamp while waiting for packets

Gianluca Varenni gianluca.varenni at cacetech.com
Fri Dec 12 16:32:32 GMT 2008


----- Original Message ----- 
From: "Merello Andrea" <andrea.merello at iit.it>
To: <winpcap-users at winpcap.org>
Sent: Friday, December 12, 2008 12:20 AM
Subject: [Winpcap-users] Getting timestamp while waiting for packets


>
> Hi,
> We are developing an application (win32) that needs getting raw packets 
> from ethernet NICs, and we thought immediately to winpcap, however reading 
> the API documentation I couldn't solve a couple of doubt about winpcap...
>
> We would like to have an accurate timestamp on each received packet, and 
> we see winpcap tag effectively each packet with the timestamp, but we need 
> also to know the value of the timestamp clock even when no packet is 
> arriving (to keep in sync, and detect drift and latency, with other 
> sources of packets on different medias, like CAN-BUS).
>
> Is there any way to do this?

Not directly from WinPcap (i.e. there's no API for that). However you can 
get timestamps directly from the OS using the win32 functions 
QueryPerformanceCounter and/or QuerySystemTime (by default WinPcap uses the 
kernel counterpart of QueryPerformanceCounter to timestamp the packets).

>
> Also how the timestamping is done? Is it simply a software tagging from 
> the system clock?

It's done in software as soon as the miniport driver controlling your NIC 
notifies the above layers (including WinPcap) that some packets are 
available.

Have a nice day
GV

>
>
> Thank you
> Andrea
>
> _______________________________________________
> 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