Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] chech_col() was - [Wireshark-commits] rev 39149: /trunk/epan

From: Anders Broman <a.broman@xxxxxxxxxxxx>
Date: Thu, 29 Sep 2011 07:36:22 +0200

Hi,
Trying to summarize:
check_col() should NOT be deprecated. As val_to_str() always does work, even if col_add_fstr() immediately bails out because the column isn't being built. We should always use check_col() even if its really not needed in cases like col_set_str(pinfo->cinfo, COL_INFO, "Unknown "); ( It's better to cave consistent usage in my opinion).

In cases like this try to always use
        col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
val_to_str_const(h1, chm_h1_message_type_acro_values, "Unknown"));

or If the value string is large use val_to_str_ext_const(), for extended value strings try to have all values present

        col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
val_to_str_const_ext(h1, chm_h1_message_type_acro_values, "Unknown"));

Regards
Anders