Hello,
I'm currently developing a new dissector plugin.
Because the protocol is LittleEndian and not BigEndian I cannot use
ntohX().
I need to convert when ntoh does nothing and vice versa.
To be portable I'm using such a code fragment:
#ifdef BigEndian
# define ua_ntohs(x) (((x & 0xff) << 8) || ((x & 0xff00)
>> 8))
# define ua_ntohl(x) (((x & 0xff) << 24) || ((x & 0xff00)
<< 8) || ((x & 0xff0000) >> 8) || ((x & 0xff000000)
>> 24))
#else
# define ua_ntohs(x) x
# define ua_ntohl(x) x
#endif
Is there any Little/Big-Endian define in wireshark that I can use for
that?
_______________________________________________
Wireshark-dev mailing list
Wireshark-dev@xxxxxxxxxxxxx
http://www.wireshark.org/mailman/listinfo/wireshark-dev