Wireshark mailing list archives

tvb_get_ntohl with reversed data


From: Yegor Yefremov <yegorslists () googlemail com>
Date: Tue, 6 Dec 2011 09:21:44 +0100

In CANOpen protocol there is a packet type TIME_STAMP. It is
constructed in the following way:

1. first 4 bytes are milliseconds since midnight, but in LSB first
form (0x10 0x20 0x30 0x40 is actually 0x40 0x30 0x20 0x10)
2. next 2 bytes are days since 01.01.1984

Is there some build-in method to get milliseconds without changing the
byte order?

What is the OS independent way to get UTC date from milliseconds (I
guess I'll also need to make correction related to 1970)?

Yegor
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe


Current thread: