Ethereal-dev: Re: [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: Tomas Kukosa <tomas.kukosa@xxxxxxxxxxx>
Date: Mon, 23 Jun 2003 16:11:30 +0200
Hi,
  I would use little/big-endian as preference value. Than you can parse
both kind on every machine. (Is not there any way how to determine it
with "heuristic" during dissecting time?)
  As I know the little_endian idicator is parameter for
proto_tree_add_item(_hidden) function and it can not be designated
during registartion of field.
  regards,
    Tom

elad lahav wrote:
> 
> 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
> 
> _______________________________________________
> Ethereal-dev mailing list
> Ethereal-dev@xxxxxxxxxxxx
> http://www.ethereal.com/mailman/listinfo/ethereal-dev