This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Unable to display IP addresses correctly..!!

0

I have created a dissector for cluster heartbeat messages. Everything works okay except the IP addresses. An IP of 10.102.1.71 is displayed by the dissector as 71.1.102.10.

How correct this? Do i need to apply host to network transformation or the other way around??

And most importantly, how to apply that transformation??

Regards, Sidharth

asked 13 Jul '11, 04:53

sid's gravatar image

sid
45192021
accept rate: 0%

What is the exact code you're using to fetch the IP address and put it into the protocol tree?

You're not supposed to apply any byte-order transformation to IP addresses.

(13 Jul '11, 10:41) Guy Harris ♦♦

One Answer:

0

Set the final parameter of proto_tree_add_item() for adding the IP addresses to ENC_LITTLE_ENDIAN (or TRUE if you're working with trunk-1.4 based code).

answered 13 Jul '11, 06:21

Jaap's gravatar image

Jaap ♦
11.7k16101
accept rate: 14%

edited 14 Jul '11, 01:43