summaryrefslogtreecommitdiff
path: root/epan/proto.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-12-30 12:26:34 -0500
committerMichael Mann <mmann78@netscape.net>2016-12-30 20:03:03 +0000
commit13964595ad09e5d1115f6c5cb604cded27f9f55d (patch)
tree6f1f34c286f9805f7b8ba0539a6a0f627200c6d3 /epan/proto.c
parent2d8615948e06e70eef915085258660c23a5bd771 (diff)
downloadwireshark-13964595ad09e5d1115f6c5cb604cded27f9f55d.tar.gz
Add BASE_NO_DISPLAY_VALUE to allow field value to not be shown.
There are times when byte arrays don't want to show their value in the packet tree or there is a field that is the "header" of a subtree where showing the field value distracts from the tree display. For these cases, BASE_NO_DISPLAY_VALUE can be used to not display the value. Change-Id: I8c9f1f57cd2e663dbee07e2289e7f5e1f22d1e32 Reviewed-on: https://code.wireshark.org/review/19479 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/proto.c')
-rw-r--r--epan/proto.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/epan/proto.c b/epan/proto.c
index fc67163d66..ceb74c6f1e 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -7198,8 +7198,10 @@ label_fill(char *label_str, gsize pos, const header_field_info *hfinfo, const ch
/* "%s: %s", hfinfo->name, text */
name_pos = pos = label_concat(label_str, pos, hfinfo->name);
- pos = label_concat(label_str, pos, ": ");
- pos = label_concat(label_str, pos, text ? text : "(null)");
+ if (!(hfinfo->display & BASE_NO_DISPLAY_VALUE)) {
+ pos = label_concat(label_str, pos, ": ");
+ pos = label_concat(label_str, pos, text ? text : "(null)");
+ }
if (pos >= ITEM_LABEL_LENGTH) {
/* Uh oh, we don't have enough room. Tell the user that the field is truncated. */
@@ -7216,15 +7218,17 @@ label_fill_descr(char *label_str, gsize pos, const header_field_info *hfinfo, co
/* "%s: %s (%s)", hfinfo->name, text, descr */
name_pos = pos = label_concat(label_str, pos, hfinfo->name);
- pos = label_concat(label_str, pos, ": ");
- if (hfinfo->display & BASE_UNIT_STRING) {
- pos = label_concat(label_str, pos, descr ? descr : "(null)");
- pos = label_concat(label_str, pos, text ? text : "(null)");
- } else {
- pos = label_concat(label_str, pos, text ? text : "(null)");
- pos = label_concat(label_str, pos, " (");
- pos = label_concat(label_str, pos, descr ? descr : "(null)");
- pos = label_concat(label_str, pos, ")");
+ if (!(hfinfo->display & BASE_NO_DISPLAY_VALUE)) {
+ pos = label_concat(label_str, pos, ": ");
+ if (hfinfo->display & BASE_UNIT_STRING) {
+ pos = label_concat(label_str, pos, descr ? descr : "(null)");
+ pos = label_concat(label_str, pos, text ? text : "(null)");
+ } else {
+ pos = label_concat(label_str, pos, text ? text : "(null)");
+ pos = label_concat(label_str, pos, " (");
+ pos = label_concat(label_str, pos, descr ? descr : "(null)");
+ pos = label_concat(label_str, pos, ")");
+ }
}
if (pos >= ITEM_LABEL_LENGTH) {