diff options
author | John Thacker <johnthacker@gmail.com> | 2022-10-30 08:03:07 -0400 |
---|---|---|
committer | AndersBroman <a.broman58@gmail.com> | 2022-10-31 16:06:27 +0000 |
commit | fe4b0639541243a6d5664c36ff85813106d1d04a (patch) | |
tree | 2156327ece4160887580596092ee8ed20d0eb3ca /epan | |
parent | 8d17d1fe7ac6576aca72eeb5eb520afe9b834746 (diff) |
IPP: Add the charstring value so it is filterable
For a string, add the value from the packet normally so that the
value is filterable, shows up in JSON, etc. Prepend the tag
description to the item so the formatting is displayed in the
tree with the name like it has been.
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-ipp.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ipp.c b/epan/dissectors/packet-ipp.c index b896da5ac1..76416e6100 100644 --- a/epan/dissectors/packet-ipp.c +++ b/epan/dissectors/packet-ipp.c @@ -1419,6 +1419,7 @@ static void add_charstring_value(const gchar *tag_desc, proto_tree *tree, tvbuff_t *tvb, int offset, int name_length, const gchar *name _U_, int value_length, guint8 tag) { + proto_item *ti; int valoffset = offset + 1 + 2 + name_length + 2; if (name_length > 0) @@ -1426,8 +1427,14 @@ add_charstring_value(const gchar *tag_desc, proto_tree *tree, tvbuff_t *tvb, if (tag == TAG_MEMBERATTRNAME) proto_tree_add_item(tree, hf_ipp_memberattrname, tvb, valoffset, value_length, ENC_ASCII); - else - proto_tree_add_string_format(tree, hf_ipp_charstring_value, tvb, valoffset, value_length, NULL, "%s value: '%s'", tag_desc, tvb_format_text(wmem_packet_scope(), tvb, valoffset, value_length)); + else { + ti = proto_tree_add_item(tree, hf_ipp_charstring_value, tvb, valoffset, value_length, ENC_ASCII); + if (strcmp(tag_desc, "") == 0) { + proto_item_prepend_text(ti, "string "); + } else { + proto_item_prepend_text(ti, "%s ", tag_desc); + } + } } static int @@ -1527,7 +1534,7 @@ proto_register_ipp(void) { &hf_ipp_enum_value_print_quality, { "print-quality", "ipp.enum_value", FT_INT32, BASE_DEC, VALS(quality_vals), 0x0, NULL, HFILL }}, { &hf_ipp_enum_value_transmission_status, { "transmission-status", "ipp.enum_value", FT_INT32, BASE_DEC, VALS(transmission_status_vals), 0x0, NULL, HFILL }}, { &hf_ipp_outofband_value, { "out-of-band value", "ipp.outofband_value", FT_UINT8, BASE_HEX, VALS(tag_vals), 0x0, NULL, HFILL }}, - { &hf_ipp_charstring_value, { "string value", "ipp.charstring_value", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ipp_charstring_value, { "value", "ipp.charstring_value", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_ipp_octetstring_value, { "octetString value", "ipp.octetstring_value", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_ipp_datetime_value, { "dateTime value", "ipp.datetime_value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_ipp_resolution_value, { "resolution value", "ipp.resolution_value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, |