diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2017-03-27 06:42:03 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-04-10 20:31:37 +0000 |
commit | 043df01c5645378bd61318c20cfdbf86c8f73288 (patch) | |
tree | 83cc90c67b765746aed3394ba1d1154e9a433155 /plugins/wimax/msg_reg_req.c | |
parent | ded9ad7017a9b04a9f63c9ea91961d19ff6b395e (diff) |
Add support for BASE_VALS_NO_UNKNOWN
BASE_VALS_NO_UNKNOWN is a special value_string value for only a single
(maybe 2) numerical value(s). If a field has the numerical value
that doesn't match anything in the value_string, just the number
is supplied for the field (no "Unknown")
Dissectors that had this use case have been converted in the patch.
Change-Id: Ie63a36cceec2fe4436938ec7e3d7f9e690d2b8d9
Reviewed-on: https://code.wireshark.org/review/20736
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'plugins/wimax/msg_reg_req.c')
-rw-r--r-- | plugins/wimax/msg_reg_req.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/plugins/wimax/msg_reg_req.c b/plugins/wimax/msg_reg_req.c index 61d2ad80f5..6cd764aab2 100644 --- a/plugins/wimax/msg_reg_req.c +++ b/plugins/wimax/msg_reg_req.c @@ -217,6 +217,11 @@ static const value_string tfs_support[] = { {0, NULL} }; +static const value_string unique_no_limit[] = { + {0, "no limit"}, + {0, NULL} +}; + /* Decode REG-REQ sub-TLV's. */ void dissect_extended_tlv(proto_tree *reg_req_tree, gint tlv_type, tvbuff_t *tvb, guint tlv_offset, guint tlv_len, packet_info *pinfo, guint offset, gint proto_registry) { @@ -314,10 +319,7 @@ void dissect_extended_tlv(proto_tree *reg_req_tree, gint tlv_type, tvbuff_t *tvb add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_arq, tvb, offset, ENC_BIG_ENDIAN); break; case REG_DSX_FLOW_CONTROL: - tlv_item = add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_dsx_flow_control, tvb, offset, ENC_BIG_ENDIAN); - if (tvb_get_guint8(tvb, tlv_offset) == 0) { - proto_item_append_text(tlv_item, " (no limit)"); - } + add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_dsx_flow_control, tvb, offset, ENC_BIG_ENDIAN); break; case REG_MAC_CRC_SUPPORT: if (!include_cor2_changes) { @@ -328,10 +330,7 @@ void dissect_extended_tlv(proto_tree *reg_req_tree, gint tlv_type, tvbuff_t *tvb } break; case REG_MCA_FLOW_CONTROL: - tlv_item = add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_mca_flow_control, tvb, offset, ENC_BIG_ENDIAN); - if (tvb_get_guint8(tvb, tlv_offset) == 0) { - proto_item_append_text(tlv_item, " (no limit)"); - } + add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_mca_flow_control, tvb, offset, ENC_BIG_ENDIAN); break; case REG_MCAST_POLLING_CIDS: add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_mcast_polling_cids, tvb, offset, ENC_BIG_ENDIAN); @@ -741,7 +740,7 @@ void proto_register_mac_mgmt_msg_reg_req(void) &hf_reg_dsx_flow_control, { "DSx flow control", "wmx.reg.dsx_flow_control", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + FT_UINT8, BASE_DEC|BASE_VALS_NO_UNKNOWN, VALS(unique_no_limit), 0x0, NULL, HFILL } }, /* When REG-REQ TLV 7 is length 2 */ @@ -960,7 +959,7 @@ void proto_register_mac_mgmt_msg_reg_req(void) &hf_reg_tlv_t_43_bandwidth_request_ul_tx_power_report_header_support, { "Bandwidth request and UL Tx Power Report header support", - "wimax.reg.bandwidth_request_ul_tx_pwr_report_header_support", + "wmx.reg.bandwidth_request_ul_tx_pwr_report_header_support", FT_UINT24, BASE_DEC, VALS(tfs_support), 0x1, NULL, HFILL } }, @@ -1073,7 +1072,7 @@ void proto_register_mac_mgmt_msg_reg_req(void) &hf_reg_mca_flow_control, { "MCA flow control", "wmx.reg.mca_flow_control", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + FT_UINT8, BASE_DEC|BASE_VALS_NO_UNKNOWN, VALS(unique_no_limit), 0x0, NULL, HFILL } }, { |