aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bzr.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-09-18 18:48:50 -0700
committerGuy Harris <guy@alum.mit.edu>2016-09-19 02:51:13 +0000
commitd7fe514fc05e95e3a99fd211768de5abdc3f6486 (patch)
tree68b3e2a24ee11c7dd223089bc9a21ac9ccae302b /epan/dissectors/packet-bzr.c
parent630b64613567c268b2b08966707c81d3ec8661a5 (diff)
Improve support for single-character fields and filter expressions.
Add an FT_CHAR type, which is like FT_UINT8 except that the value is displayed as a C-style character constant. Allow use of C-style character constants in filter expressions; they can be used in comparisons with all integral types, and in "contains" operators. Use that type for some fields that appear (based on the way they're displayed, or on the use of C-style character constants in their value_string tables) to be 1-byte characters rather than 8-bit numbers. Change-Id: I39a9f0dda0bd7f4fa02a9ca8373216206f4d7135 Reviewed-on: https://code.wireshark.org/review/17787 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-bzr.c')
-rw-r--r--epan/dissectors/packet-bzr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-bzr.c b/epan/dissectors/packet-bzr.c
index 6f8a5111f5..e1ddb62971 100644
--- a/epan/dissectors/packet-bzr.c
+++ b/epan/dissectors/packet-bzr.c
@@ -176,7 +176,7 @@ dissect_body(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree)
while (tvb_reported_length_remaining(tvb, offset) > 0) {
cmd = tvb_get_guint8(tvb, offset);
- proto_tree_add_item(tree, hf_bzr_packet_kind, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tree, hf_bzr_packet_kind, tvb, offset, 1, ENC_ASCII|ENC_NA);
offset += 1;
switch (cmd) {
@@ -188,7 +188,7 @@ dissect_body(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree)
break;
case 'o':
proto_tree_add_item(tree, hf_bzr_result, tvb, offset, 1,
- ENC_BIG_ENDIAN);
+ ENC_ASCII|ENC_NA);
offset += 1;
break;
case 'e':
@@ -258,7 +258,7 @@ proto_register_bzr(void)
{
static hf_register_info hf[] = {
{ &hf_bzr_packet_kind,
- { "Packet kind", "bzr.kind", FT_UINT8, BASE_DEC,
+ { "Packet kind", "bzr.kind", FT_CHAR, BASE_HEX,
VALS(message_part_kind), 0x0, NULL, HFILL },
},
{ &hf_bzr_packet_protocol_version,
@@ -287,7 +287,7 @@ proto_register_bzr(void)
NULL, 0x0, NULL, HFILL },
},
{ &hf_bzr_result,
- { "Result", "bzr.result", FT_UINT8, BASE_HEX,
+ { "Result", "bzr.result", FT_CHAR, BASE_HEX,
VALS(message_results), 0x0,
"Command result (success or failure with error message)", HFILL
},