ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] What do you use to get a boolean

From: Jeff Morriss <jeff.morriss@xxxxxxxxxxx>
Date: Mon, 12 Feb 2007 22:05:09 +0800


Hal Lander wrote:
Wireshark has a field type FT_BOOLEAN.
It lets you add the boolean to the tree using
proto_tree_add_boolean(tree, id, tvb, start, length, value);
and is supposed to do all the bit shifting for you to extract the single bit 0 or 1.

I thought it might also provide some way for me to test the bit value?

Actually the last 'value' is, well, the value of the boolean (on the system running Wireshark). You must have already pulled out 'value' using one of the tvb functions (and bit shifted it, if necessary).