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

how to give offset of 24 bits in dissector code

0

proto_tree_add_uint(tree, hf_id,tvb,offset,4,(tvb_get_ntoh24( tvb,offset & 0xFFFFF000)));

This is the function i gave for dissecting 24 bits in my dissector code.But it not giving the correct result.

asked 08 Apr '15, 06:06

lucky15's gravatar image

lucky15
6558
accept rate: 0%

edited 08 Apr '15, 06:21


One Answer:

0

Wrong.

Use proto_tree_add_item() and setup your hf entry using FT_UINT24 or FT_INT24.

answered 08 Apr '15, 06:29

Jaap's gravatar image

Jaap ♦
11.7k16101
accept rate: 14%

thanks, it worked.

(08 Apr '15, 22:21) lucky15

If an answer has solved your issue, please accept the answer for the benefit of other users by clicking the checkmark icon next to the answer. Please read the FAQ for more information.

(09 Apr '15, 12:44) Jaap ♦