diff options
author | Bill Meier <wmeier@newsguy.com> | 2014-02-26 12:40:51 -0500 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2014-02-26 18:29:15 +0000 |
commit | 0d2f290d48d903ac5b64656770cece0ca7ae30ff (patch) | |
tree | 499c1ae76ca682aba3581890277a76e64f32bc21 /epan/dissectors | |
parent | 15a3a4436e30c7dc62b946f77a147074c9416cd6 (diff) |
Create/use an extended value_string.
Change-Id: I1cd20d68ebb50d11ecfa00bf76e9be7c47a45860
Reviewed-on: https://code.wireshark.org/review/410
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-acr122.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/epan/dissectors/packet-acr122.c b/epan/dissectors/packet-acr122.c index 00cfc248e0..1b623bba22 100644 --- a/epan/dissectors/packet-acr122.c +++ b/epan/dissectors/packet-acr122.c @@ -149,6 +149,7 @@ static const value_string command_vals[] = { { CMD_SET_BUZZER_OUTPUT_FOR_CARD_DETECTION, "Set Buzzer Output for Card Detection" }, { 0, NULL } }; +static value_string_ext command_vals_ext = VALUE_STRING_EXT_INIT(command_vals); static const range_string status_word_rvals[] = { { 0x6300, 0x6300, "Operation Fail" }, @@ -323,7 +324,7 @@ dissect_acr122(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) if (command == CMD_UNKNOWN) proto_tree_add_expert(sub_item, pinfo, &ei_unknown_command_or_invalid_parameters, tvb, offset, 4 + length); - col_add_fstr(pinfo->cinfo, COL_INFO, "Command: %s", val_to_str_const(command, command_vals, "Unknown")); + col_add_fstr(pinfo->cinfo, COL_INFO, "Command: %s", val_to_str_ext_const(command, &command_vals_ext, "Unknown")); proto_tree_add_item(main_tree, hf_class, tvb, offset, 1, ENC_NA); offset += 1; @@ -507,7 +508,7 @@ dissect_acr122(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) sub_item = proto_tree_add_uint(main_tree, hf_response, tvb, offset, tvb_length_remaining(tvb, offset), command); PROTO_ITEM_SET_GENERATED(sub_item); - col_add_fstr(pinfo->cinfo, COL_INFO, "Response: %s", val_to_str_const(command, command_vals, "Unknown")); + col_add_fstr(pinfo->cinfo, COL_INFO, "Response: %s", val_to_str_ext_const(command, &command_vals_ext, "Unknown")); if (command != CMD_UNKNOWN) { sub_item = proto_tree_add_uint(main_tree, hf_response_for, tvb, offset, tvb_length_remaining(tvb, offset), command_frame_number); @@ -658,12 +659,12 @@ proto_register_acr122(void) }, { &hf_command, { "Command", "acr122.command", - FT_UINT8, BASE_HEX, VALS(command_vals), 0x00, + FT_UINT8, BASE_HEX | BASE_EXT_STRING, &command_vals_ext, 0x00, NULL, HFILL } }, { &hf_response, { "Response", "acr122.response", - FT_UINT8, BASE_HEX, VALS(command_vals), 0x00, + FT_UINT8, BASE_HEX | BASE_EXT_STRING, &command_vals_ext, 0x00, NULL, HFILL } }, { &hf_response_for, |