Hello guys, There is a question about
But I just want only the last 30 bits of the last four bytes used for the nsecs, the first 2 bits of the last four bytes used for other purposes. Any ideas? Best Regards! Sam asked 09 Oct '11, 07:42 Sam edited 11 Oct '11, 14:29 multipleinte... |
One Answer:
(Note: questions are not guaranteed to be answered in N hours, for any value of N.) What you need to do is to fetch the two 32-bit fields in the time stamp yourself, use them to fill in an answered 10 Oct '11, 01:44 Guy Harris ♦♦ Thank you, Harris. But I'm sorry, stiil have two questions: 1) How to fill them into an nstime_t structure? 2) How to fetch the two 32-bit fields in the TIME STAMP? tvb_get_ptr or tvb_get_bits32 or others? Note: the TIME STAMP is not the original time stamp, it is just the eight bytes inserted between the payload and CRCs by other tool. (10 Oct '11, 05:50) Sam 1 The answer to "how to fill them into an nstime_t structure?" is: Put the first 32 bits - the seconds value - in the Seriously. You have two 32-bit quantities, and an
(10 Oct '11, 10:58) Guy Harris ♦♦ 1 As for fetching the fields, use (10 Oct '11, 10:59) Guy Harris ♦♦ It works fine. Thanks a lot for your patient help!! Harris. BTW, I have another question. How to use these elements(ts.secs & ts.nsecs) fetched from the packet for some further analysis? such as do some time analysis like 'IO Graphs' in Wireshark statistics menu. I am a beginner on wireshark code, who can give me a thought? thanks. --Sam (11 Oct '11, 04:04) Sam Anyone can give me a hand on this? or you need more information? (11 Oct '11, 17:40) Sam |
What is the precise format, and interpretation, of the time stamp you're dealing with? Is it 32 bits or 64 bits of seconds since some epoch (such as the UN*X epoch), 30 bits of nanoseconds, and 2 bits of other information?
Yes, it is 32bits for seconds, the following 2bit for other information, the last 30bits for nanoseconds.
The time stamp will be read from 8 bytes in nomal state, but now the first 2 bits of the fifth byte need to be defined for special purpose, such as an flag. so how to get the correct time from the rest 62bit? exactly, the first 32bits and the last 30bits of these 8 bytes is for time stamp. how do I get it?