diff options
author | robionekenobi <robionekenobi@bluewin.ch> | 2020-11-27 09:05:45 +0100 |
---|---|---|
committer | AndersBroman <a.broman58@gmail.com> | 2020-12-03 12:26:03 +0000 |
commit | e131717d83432c79309bfb0b9c4ff578b48f8703 (patch) | |
tree | 39ee9354a76c8b5be724e6a931de6fa7ba0194be /epan/dissectors/packet-mq.c | |
parent | ac0cf10ab08755797e7484f487cf76c8264a1f22 (diff) |
packet-mq: Improve MQINQ Display
Improve the display of MQINQ Segment, by adding dec/hex/Name
of selector in MQINQ/MQINQ_REPLY and trying to display
dec/hex/Name value of Integer Value when possible in MQINQ_REPLY
Diffstat (limited to 'epan/dissectors/packet-mq.c')
-rw-r--r-- | epan/dissectors/packet-mq.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/epan/dissectors/packet-mq.c b/epan/dissectors/packet-mq.c index 865d1673dd..83cc3f9906 100644 --- a/epan/dissectors/packet-mq.c +++ b/epan/dissectors/packet-mq.c @@ -2644,9 +2644,16 @@ static void dissect_mq_pdu(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) iOffsetINQ = 12; if (tvb_reported_length_remaining(tvb, offset + iOffsetINQ) >= iNbSelectors * 4) { + guint _posSel = offset + iOffsetINQ; + guint _posSelE = _posSel + iNbSelectors * 4 + 4; + const guint8* _pVal = NULL; for (iSelector = 0; iSelector < iNbSelectors; iSelector++) { - proto_tree_add_item(mq_tree, hf_mq_inq_sel, tvb, offset + iOffsetINQ + iSelector * 4, 4, p_mq_parm->mq_int_enc); + //proto_tree_add_item(mq_tree, hf_mq_inq_sel, tvb, offset + iOffsetINQ + iSelector * 4, 4, p_mq_parm->mq_int_enc); + guint _Val = tvb_get_guint32(tvb, offset + iOffsetINQ + iSelector* 4, p_mq_parm->mq_int_enc); + _pVal = (const guint8*)try_val_to_str_ext(_Val, GET_VALS_EXTP(selector)); + proto_tree_add_uint_format(mq_tree, hf_mq_inq_sel, tvb, offset + iOffsetINQ + iSelector * 4, 4, 0, + "Selector........: 0x%08x (%d) %s", _Val, _Val, _pVal); } iOffsetINQ += iNbSelectors * 4; if (p_mq_parm->mq_opcode == MQ_TST_MQINQ_REPLY || p_mq_parm->mq_opcode == MQ_TST_MQSET) @@ -2656,9 +2663,24 @@ static void dissect_mq_pdu(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) if (tvb_reported_length_remaining(tvb, offset + iOffsetINQ) >= iSizeINQValues) { gint iInteger; + guint _lVal; + guint _lSel; for (iInteger = 0; iInteger < iNbIntegers; iInteger++) { - proto_tree_add_item(mq_tree, hf_mq_inq_intvalue, tvb, offset + iOffsetINQ + iInteger * 4, 4, p_mq_parm->mq_int_enc); + _lSel = tvb_get_guint32(tvb, _posSel, p_mq_parm->mq_int_enc); + while (_posSel < _posSelE && (_lSel < MQ_MQIA_FIRST || _lSel > MQ_MQIA_LAST)) + { + _posSel += 4; + _lSel = tvb_get_guint32(tvb, _posSel, p_mq_parm->mq_int_enc); + } + _lVal = tvb_get_guint32(tvb, offset + iOffsetINQ + iInteger * 4, p_mq_parm->mq_int_enc); + _pVal = dissect_mqpcf_parm_getintval(_lSel, _lVal); + _posSel += 4; + if (_pVal) + proto_tree_add_uint_format(mq_tree, hf_mq_inq_intvalue, tvb, offset + iOffsetINQ + iInteger * 4, 4, 0, + "Integer value...: 0x%08x (%d) %s", _lVal, _lVal, _pVal); + else + proto_tree_add_item(mq_tree, hf_mq_inq_intvalue, tvb, offset + iOffsetINQ + iInteger * 4, 4, p_mq_parm->mq_int_enc); } iOffsetINQ += iNbIntegers * 4; if (iCharLen != 0) @@ -4153,7 +4175,7 @@ void proto_register_mq(void) {&hf_mq_inq_nbsel, {"Selector count..", "mq.inq.nbsel", FT_UINT32, BASE_DEC, NULL, 0x0, "INQ Selector count", HFILL}}, {&hf_mq_inq_nbint, {"Integer count...", "mq.inq.nbint", FT_UINT32, BASE_DEC, NULL, 0x0, "INQ Integer count", HFILL}}, {&hf_mq_inq_charlen, {"Character length", "mq.inq.charlen", FT_UINT32, BASE_DEC, NULL, 0x0, "INQ Character length", HFILL}}, - {&hf_mq_inq_sel, {"Selector........", "mq.inq.sel", FT_UINT32, BASE_DEC | BASE_EXT_STRING, GET_VALS_EXTP(selector), 0x0, "INQ Selector", HFILL}}, + {&hf_mq_inq_sel, {"Selector........", "mq.inq.sel", FT_UINT32, BASE_HEX_DEC | BASE_EXT_STRING, GET_VALS_EXTP(selector), 0x0, "INQ Selector", HFILL}}, {&hf_mq_inq_intvalue, {"Integer value...", "mq.inq.intvalue", FT_UINT32, BASE_DEC, NULL, 0x0, "INQ Integer value", HFILL}}, {&hf_mq_inq_charvalues, {"Char values.....", "mq.inq.charvalues", FT_STRING, STR_UNICODE, NULL, 0x0, "INQ Character values", HFILL}}, |