Wireshark mailing list archives

Re: chech_col() was - [Wireshark-commits] rev 39149: /trunk/epan/dissectors/ /trunk/epan/dissectors/: packet-daap.c packet-dcp-etsi.c packet-dec-bpdu.c packet-dec-dnart.c packet-dhcp-failover.c packet-dis.c packet-distcc.c packet-dlm3.c ...


From: Anders Broman <a.broman () bredband net>
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
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
            mailto:wireshark-dev-request () wireshark org?subject=unsubscribe


Current thread: