Re: [Wireshark-dev] bitmask handling in wireshark

2010-12-29 Thread Dirk Jagdmann
> #define MYPROTO_FLAG_SAMPLING 0xf0 A better name would be #define MYPROTO_MASK_SAMPLING 0xf0 since it is a bitmask you're defining here. -- ---> Dirk Jagdmann > http://cubic.org/~doj -> http://llg.cubic.org ___ Sen

Re: [Wireshark-dev] bitmask handling in wireshark

2010-12-28 Thread Andreas
Am 28.12.2010 20:35, schrieb Ed Beroset: > Andreas wrote: So far I've seen only lots of boolean values. >>> >>> You might want to take a look at proto_tree_add_bitmask(). See >>> doc/README.developer, which describes it and illustrates its use by taking >>> an >>> example from the SCSI disse

Re: [Wireshark-dev] bitmask handling in wireshark

2010-12-28 Thread Christopher Maynard
Andreas writes: > Where can I get a sample capture file to see how this will look like? There are several sample capture files posted here: http://wiki.wireshark.org/SampleCaptures But the bit tree produced by the function will pretty much look like any other bit tree, such as IP's "Differentia

Re: [Wireshark-dev] bitmask handling in wireshark

2010-12-28 Thread Ed Beroset
Andreas wrote: >>> So far I've seen only lots of boolean values. >> >> You might want to take a look at proto_tree_add_bitmask(). See >> doc/README.developer, which describes it and illustrates its use by taking an >> example from the SCSI dissector. > >Where can I get a sample capture file to see

Re: [Wireshark-dev] bitmask handling in wireshark

2010-12-28 Thread Andreas
Am 28.12.2010 16:14, schrieb Christopher Maynard: > Andrei Emeltchenko writes: > >> Could you point me to some example? >> >> So far I've seen only lots of boolean values. > > You might want to take a look at proto_tree_add_bitmask(). See > doc/README.developer, which describes it and illustrates

Re: [Wireshark-dev] bitmask handling in wireshark

2010-12-28 Thread Andrei Emeltchenko
Hi Ed On Tue, Dec 28, 2010 at 4:56 PM, Ed Beroset wrote: > Andrei Emeltchenko wrote: >>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%

Re: [Wireshark-dev] bitmask handling in wireshark

2010-12-28 Thread Christopher Maynard
Andrei Emeltchenko writes: > Could you point me to some example? > > So far I've seen only lots of boolean values. You might want to take a look at proto_tree_add_bitmask(). See doc/README.developer, which describes it and illustrates its use by taking an example from the SCSI dissector. ___

Re: [Wireshark-dev] bitmask handling in wireshark

2010-12-28 Thread Ed Beroset
Andrei Emeltchenko wrote: >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)

[Wireshark-dev] bitmask handling in wireshark

2010-12-28 Thread Andrei Emeltchenko
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 " : "",