Ethereal-dev: [Ethereal-dev] Dissecting a host order protocol

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "elad lahav" <elad@xxxxxxxxxxxxxx>
Date: Mon, 23 Jun 2003 16:47:14 +0200
Hi,

I need to write a dissector for a protocol that sends some of its data in
host order (the protocol only works between machines of the same kind).
Neither tvb_get_ntohl() nor tvb_get_letohl() will work in this case, and
the only option I found is to use tvb_memcpy() to copy the data into a
guint32. However, this rules out any automated parsing with the
pre-registered information.
Am I missing a standard way of accomplishing this task? If not, is it
possible to add an indication during protocol registration of which fields
are in network order and which are in host order?

Thanks,
Elad