diff options
author | Dr. Lars Völker <lars.voelker@technica-engineering.de> | 2022-02-02 15:49:55 +0100 |
---|---|---|
committer | A Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2022-02-02 15:20:38 +0000 |
commit | c442f180f744e7a8affe4f0721460e0340f69838 (patch) | |
tree | ecc18522a2c750f93e3b3b7627d9bc067443f5b2 /epan/dissectors/packet-tecmp.c | |
parent | d848127c6ecba6023a48b2645d63c58c02ccb8c4 (diff) |
TECMP: Allowing Chassis Temperature to be not available too
Not only the Silicon Temperature can be "not available" but the Chassis
Temperature too.
Diffstat (limited to 'epan/dissectors/packet-tecmp.c')
-rw-r--r-- | epan/dissectors/packet-tecmp.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/epan/dissectors/packet-tecmp.c b/epan/dissectors/packet-tecmp.c index 1b8f4d2ce4..9a1c662a57 100644 --- a/epan/dissectors/packet-tecmp.c +++ b/epan/dissectors/packet-tecmp.c @@ -994,10 +994,15 @@ dissect_tecmp_status_cm_vendor_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto proto_item_append_text(ti, " %s", "Degrees Celsius"); } else if (tvb_captured_length_remaining(tvb, offset) > 1) { /* TECMP 1.5 and later */ - ti = proto_tree_add_item_ret_int(tree, hf_tecmp_payload_status_cm_vendor_technica_temperature_chassis, tvb, offset, 1, ENC_NA, &temperature); - proto_item_append_text(ti, " %s", "Degrees Celsius"); - if (temperature == VENDOR_TECHNICA_TEMP_MAX) { - proto_item_append_text(ti, " %s", "or more"); + temperature = tvb_get_gint8(tvb, offset); + if (temperature == VENDOR_TECHNICA_TEMP_NA) { + proto_tree_add_int_format_value(tree, hf_tecmp_payload_status_cm_vendor_technica_temperature_chassis, tvb, offset, 1, temperature, "%s", "Not Available"); + } else { + ti = proto_tree_add_item(tree, hf_tecmp_payload_status_cm_vendor_technica_temperature_chassis, tvb, offset, 1, ENC_NA); + proto_item_append_text(ti, " %s", "Degrees Celsius"); + if (temperature == VENDOR_TECHNICA_TEMP_MAX) { + proto_item_append_text(ti, " %s", "or more"); + } } offset += 1; @@ -1005,7 +1010,7 @@ dissect_tecmp_status_cm_vendor_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto if ( temperature == VENDOR_TECHNICA_TEMP_NA) { proto_tree_add_int_format_value(tree, hf_tecmp_payload_status_cm_vendor_technica_temperature_silicon, tvb, offset, 1, temperature, "%s", "Not Available"); } else { - ti = proto_tree_add_item_ret_int(tree, hf_tecmp_payload_status_cm_vendor_technica_temperature_silicon, tvb, offset, 1, ENC_NA, &temperature); + ti = proto_tree_add_item(tree, hf_tecmp_payload_status_cm_vendor_technica_temperature_silicon, tvb, offset, 1, ENC_NA); proto_item_append_text(ti, " %s", "Degrees Celsius"); if (temperature == VENDOR_TECHNICA_TEMP_MAX) { proto_item_append_text(ti, " %s", "or more"); |