Wireshark-dev: Re: [Wireshark-dev] How to dissect bits

From: Roland Knall <rknall@xxxxxxxxx>
Date: Thu, 28 Apr 2022 09:22:50 +0200
The best way to learn such a thing is, to take a look at existing dissectors and their implementation. ip.frag_offset for example. Just search for the hf definition and its use in the source code

kind regards, Roland

Am Do., 28. Apr. 2022 um 08:33 Uhr schrieb Manojkiran Eda <manojkiran.eda@xxxxxxxxx>:
Hi All,

I am a wireshark newbie & I am trying to write a new dissector from scratch and I am looking for the best way to dissect the presence bits in a bit field based on position.

My problem is :
I have 64 bit data represented in the form of a bitfield, where the presence of b1 at a particular position tells if a particular command is supported. This 64 bit data is used for conveying how many commands(max supported is 64) are implemented.

I am trying to look at https://github.com/wireshark/wireshark/blob/master/doc/README.developer to understand what API's that i can use to acheive this - and also the best way to show this information in wireshark GUI, but haven't got any success so far.

Can anyone help point me to any leads/examples of how I can do this.


Thanks,
Manoj
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe