diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-09-18 18:48:50 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-09-19 02:51:13 +0000 |
commit | d7fe514fc05e95e3a99fd211768de5abdc3f6486 (patch) | |
tree | 68b3e2a24ee11c7dd223089bc9a21ac9ccae302b /epan/dissectors/packet-telnet.c | |
parent | 630b64613567c268b2b08966707c81d3ec8661a5 (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-telnet.c')
-rw-r--r-- | epan/dissectors/packet-telnet.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/epan/dissectors/packet-telnet.c b/epan/dissectors/packet-telnet.c index 05ab652c97..8fb6d2a791 100644 --- a/epan/dissectors/packet-telnet.c +++ b/epan/dissectors/packet-telnet.c @@ -488,13 +488,13 @@ dissect_starttls_subopt(packet_info *pinfo _U_, const char *optname _U_, tvbuff_ } static const value_string telnet_outmark_subopt_cmd_vals[] = { - { 6, "ACK" }, - { 21, "NAK" }, - { 'D', "Default" }, - { 'T', "Top" }, - { 'B', "Bottom" }, - { 'L', "Left" }, - { 'R', "Right" }, + { '\x06', "ACK" }, + { '\x15', "NAK" }, + { 'D', "Default" }, + { 'T', "Top" }, + { 'B', "Bottom" }, + { 'L', "Left" }, + { 'R', "Right" }, { 0, NULL } }; @@ -505,7 +505,7 @@ dissect_outmark_subopt(packet_info *pinfo _U_, const char *optname _U_, tvbuff_t int gs_offset, datalen; while (len > 0) { - proto_tree_add_item(tree, hf_telnet_outmark_subopt_cmd, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_telnet_outmark_subopt_cmd, tvb, offset, 1, ENC_ASCII | ENC_NA); offset++; len--; @@ -1985,7 +1985,7 @@ proto_register_telnet(void) NULL, 0, NULL, HFILL } }, { &hf_telnet_outmark_subopt_cmd, - { "Command", "telnet.outmark_subopt.cmd", FT_UINT8, BASE_DEC, + { "Command", "telnet.outmark_subopt.cmd", FT_CHAR, BASE_HEX, VALS(telnet_outmark_subopt_cmd_vals), 0, NULL, HFILL } }, { &hf_telnet_outmark_subopt_banner, |