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

When building a dissector: How to declare an error?

0

Hey, I'm building a dissector and I would like to know if it is possible to explicitly declare about errors. for example: If something's length should be 0, but it doesn't, then I want to say "error, something is wrong"

Thanks ahead.

asked 06 Dec '12, 02:15

hudac's gravatar image

hudac
61111317
accept rate: 50%


One Answer:

1

Thanks to "SidR", You should take the following line, and do variations on him. (remember to include epan/expert.h )

expert_add_info_format(pinfo, acp_data_tree, PI_MALFORMED, PI_WARN, "Length > 0");

answered 06 Dec '12, 02:58

hudac's gravatar image

hudac
61111317
accept rate: 50%

You're welcome. :)

(06 Dec '12, 03:06) SidR