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

Problem with static const value_string xxx[]

0

Hi all, I have protocol where few of my header fields can have many types but my problem is: Type: Octet String (4) Values: • (hex) 01xxxxxx : sth • (hex) 02xxxxxx : sth
where x is any hex. How should I write value_string?

asked 29 Sep '10, 07:40

Wania's gravatar image

Wania
1111
accept rate: 0%

Sounds like a asn1 ber encoded protocol, are you using asn2wrs to create your dissector? Isn't it the case that the rest of the bits/bytes have a different meaning and you should only have a value string for part of that octet string? If not have a look at range_strings.

(29 Sep '10, 09:25) Anders ♦

Hi Anders,

It's not asn1, normal tcp big endian and so on. The thing is I have for example field: version with values 01xxxxxx - sth, 02xxxxxx - sth but xx08xxxx - is another version as well. It's not range_string unfortunatelly. Any ideas how i should handle this?

Wania

(29 Sep '10, 13:08) Wania

Shouldn't that be dissected like Byte 1 0000 0010 X Version 2 Byte 2 0000 1000 Y Version 8 or 0000 0010 .... .... .... .... .... .... X Version 2 .... .... 0000 1000 .... .... .... .... X Version 2 e.g as subfields of the 4 octests

(01 Oct '10, 08:33) Anders ♦