Wireshark-dev: [Wireshark-dev] bitmask handling in wireshark
From: Andrei Emeltchenko <andrei.emeltchenko.news@xxxxxxxxx>
Date: Tue, 28 Dec 2010 15:49:51 +0200
Hi all,

I want to check what is the best way to convert code below to value_string

				proto_tree_add_text(tree, tvb, offset, 1,
						"%s%s%s%s",
						(buf & 0x80)? "16kHz " : "",
						(buf & 0x40)? "32kHz " : "",
						(buf & 0x20)? "44.1kHz " : "",
						(buf & 0x10)? "48kHz " : "");
				proto_tree_add_text(tree, tvb, offset, 1,
						"%s%s%s%s",
						(buf & 0x08)? "Mono " : "",
						(buf & 0x04)? "DualChannel " : "",
						(buf & 0x02)? "Stereo " : "",
						(buf & 0x01)? "JointStereo " : "");
				offset++;

Could you point me to some example?

So far I've seen only lots of boolean values.

Regards,
Andrei