[Winpcap-users] Re: calculating number of bits per second whengathering statistics

Gianluca Varenni gianluca.varenni at cacetech.com
Thu May 18 13:44:32 GMT 2006


----- Original Message ----- 
From: joe kibz
To: winpcap-users at winpcap.org
Sent: Wednesday, May 17, 2006 11:32 PM
Subject: [Winpcap-users] Re: calculating number of bits per second 
whengathering statistics



Problem:

//this is how calculating bits per second is shown in the winpcap docs...

Bps.QuadPart=(((*(LONGLONG*)(pkt_data + 8)) * 8 * 1000000) / (delay));
I don't understand the (pkt_data + 8) part ; why is 8 being added ?

--GV--

The statistics are returned as two 64bit values inside the packet data, so

- packet_data   is a pointer to the first 64bit integer (containing the 
number of packets)
- packet_data+8 is a pointer to the second 64bit integer (containing the 
number of bytes)

I agree that the code in the sample is not so elegant.

Have a nice day
GV


--GV--

joe



Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ 
countries) for 2¢/min or less.



_______________________________________________
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