This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Using bitmask with user defined value and length

0

Hi,

I'm working on a protocol dissector which uses a variable-length quantity encoding. So I've written functions like:

guint32 tvb_get_varuint32(tvbuff_t *tvb, guint8 *octet_count, guint32 offset)

to peek the values from the buffer.

For all other proto_tree_add_XXX functions I can pass my own value and length, but for adding bitmask there is no such option. There is a proto_tree_add_bitmask_len() function where I can pass my length, but not my own value.

In proto.c there are non-exported functions like proto_tree_add_bitmask_value() where I could pass a value, but not the length.

Is there any solution to realize this without any changes to proto.c?

There is at least one existing dissector (packet-wap.c) which uses a similar VLQ encoding, but has no bitmasks in it.

Thanks for help, Thomas

asked 28 Feb '16, 04:15

th-wiens's gravatar image

th-wiens
1111
accept rate: 0%