Writing a Non-trivial Wireshark Dissector
问题 I am trying to write a Wireshark dissector (in C) for a custom protocol. The first 3 bits of the packet defines how the rest of the packet is constructed. For example, if these 3 bits are 000, the remainder of the packet is a 5-bit field followed by 2 byte fields. If the leading 3 bit is 001, the remainder of the packet is a 13-bit field followed by a byte field. I can get the leading 3-bit field. In the dissector function, I've tried using this value to tailor the rest of the dissection thus