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

Will enumeration string allow to range the enum value with the string

0

Hi

I have a requirement in which enums are defined from 1 to 225, but the problem of here is 1 to 10 enum strings are different and from 11 to 225 are same.

const value_string Fields_Emun_validate_Errors[] = { { 0, "Port_Error" }, { 1, "IP_Error" }, { 2, "Stack_Error" }, { 3, "Val_Error" }, { 4, "range_Error" },.. .. .. { 11, "Field Error" },.. .. .. { 225, "Field Erro" }, };

Should we need to write for 11 to 225 or else any range is allowed ?

asked 17 May '16, 06:07

Dinesh%20Babu%20Sadu's gravatar image

Dinesh Babu ...
16131517
accept rate: 0%

edited 17 May '16, 07:07

grahamb's gravatar image

grahamb ♦
19.8k330206


One Answer:

0

Hi,

given your description you should use a range_string array instead of value_string array. Please have a look at doc/README.dissector document, more specifically the chapter 1.5 and "ranges" section.

answered 17 May '16, 06:14

Pascal%20Quantin's gravatar image

Pascal Quantin
5.5k1060
accept rate: 30%

Thanks Pascal, It worked for me.

(17 May '16, 07:16) Dinesh Babu ...