diff options
author | robionekenobi <robionekenobi@bluewin.ch> | 2020-12-11 14:25:11 +0100 |
---|---|---|
committer | AndersBroman <a.broman58@gmail.com> | 2020-12-15 13:01:34 +0000 |
commit | 253c49b73e2eabfba5c18b2e05d810e0fb049eda (patch) | |
tree | d1470217562b53c573b4498dca840bd74387621f /epan/dissectors | |
parent | b7cb24c1fdf2f65eaa6fc73a6a2ce2ebeed7817e (diff) |
packet-mq: Improve MQINQ Display
Improve display of Integer value (use standard, no alignement)
Reduce un-needed space in table display for Prm.
Use, where possible, 'xxx: Text (decimal)' display for Integer value
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-mq-base.c | 32 | ||||
-rw-r--r-- | epan/dissectors/packet-mq-pcf.c | 41 | ||||
-rw-r--r-- | epan/dissectors/packet-mq.c | 10 | ||||
-rw-r--r-- | epan/dissectors/packet-mq.h | 29 |
4 files changed, 84 insertions, 28 deletions
diff --git a/epan/dissectors/packet-mq-base.c b/epan/dissectors/packet-mq-base.c index 58c53c10c0..f3b55a78d4 100644 --- a/epan/dissectors/packet-mq-base.c +++ b/epan/dissectors/packet-mq-base.c @@ -4099,6 +4099,9 @@ DEF_VALSB(PrmId) /* 7033*/ DEF_VALS1(MQBACF_XA_XID), /* 7034*/ DEF_VALS1(MQBACF_XQH_CORREL_ID), /* 7035*/ DEF_VALS1(MQBACF_XQH_MSG_ID), +/* 7036*/ DEF_VALS1(MQBACF_REQUEST_ID), +/* 7037*/ DEF_VALS1(MQBACF_PROPERTIES_DATA), +/* 7038*/ DEF_VALS1(MQBACF_CONN_TAG), /* 8001*/ DEF_VALS1(MQGACF_COMMAND_CONTEXT), /* 8002*/ DEF_VALS1(MQGACF_COMMAND_DATA), /* 8003*/ DEF_VALS1(MQGACF_TRACE_ROUTE), @@ -4147,6 +4150,34 @@ DEF_VALSB(PrmTyp) DEF_VALSE; DEF_VALS_EXTBX(PrmTyp); +DEF_VALSB(PrmTyp2) +/* 0*/ DEF_VALS1(MQCFT_NONE), +/* 1*/ DEF_VALS1(MQCFT_CMD), +/* 2*/ DEF_VALS1(MQCFT_RSP), +/* 3*/ DEF_VALS1(MQCFT_INT), +/* 4*/ DEF_VALS1(MQCFT_STR), +/* 5*/ DEF_VALS1(MQCFT_INTL), +/* 6*/ DEF_VALS1(MQCFT_STRL), +/* 7*/ DEF_VALS1(MQCFT_EVT), +/* 8*/ DEF_VALS1(MQCFT_USR), +/* 9*/ DEF_VALS1(MQCFT_BSTR), +/* 10*/ DEF_VALS1(MQCFT_TRC), +/* 12*/ DEF_VALS1(MQCFT_RPT), +/* 13*/ DEF_VALS1(MQCFT_INTF), +/* 14*/ DEF_VALS1(MQCFT_STRF), +/* 15*/ DEF_VALS1(MQCFT_BSTF), +/* 16*/ DEF_VALS1(MQCFT_CMDX), +/* 17*/ DEF_VALS1(MQCFT_XMSG), +/* 18*/ DEF_VALS1(MQCFT_XITM), +/* 19*/ DEF_VALS1(MQCFT_XSUM), +/* 20*/ DEF_VALS1(MQCFT_GRP), +/* 21*/ DEF_VALS1(MQCFT_STAT), +/* 22*/ DEF_VALS1(MQCFT_ACNT), +/* 23*/ DEF_VALS1(MQCFT_I64), +/* 25*/ DEF_VALS1(MQCFT_I64L), +DEF_VALSE; +DEF_VALS_EXTBX(PrmTyp2); + DEF_VALSB(selector) /* 1*/ DEF_VALS1(MQIA_APPL_TYPE), /* 2*/ DEF_VALS1(MQIA_CODED_CHAR_SET_ID), @@ -4700,6 +4731,7 @@ DEF_VALSB(MQCFINT_Parse) /* 1233*/ DEF_VALS2(MQIACF_CMD_SERVER_STATUS, GET_VALSP(MQSVC_STATUS)), /* 1261*/ DEF_VALS2(MQIACF_Q_TYPES, GET_VALSP(MQQT)), /* 1262*/ DEF_VALS2(MQIACF_USER_ID_SUPPORT, GET_VALSP(MQUIDSUPP)), +/* 1264*/ DEF_VALS2(MQIACF_AUTH_SERVICE_ATTRS, GET_VALSP(PrmId)), /* 1265*/ DEF_VALS2(MQIACF_USAGE_EXPAND_TYPE, GET_VALSP(MQUSAGE_EXPAND)), /* 1271*/ DEF_VALS2(MQIACF_PUBSUB_PROPERTIES, GET_VALSP(MQPSPROP)), /* 1274*/ DEF_VALS2(MQIACF_DURABLE_SUBSCRIPTION, GET_VALSP(MQSUB_DURABLE)), diff --git a/epan/dissectors/packet-mq-pcf.c b/epan/dissectors/packet-mq-pcf.c index b3fe22d3f2..9c092a7d04 100644 --- a/epan/dissectors/packet-mq-pcf.c +++ b/epan/dissectors/packet-mq-pcf.c @@ -127,7 +127,7 @@ static void dissect_mqpcf_parm_int(tvbuff_t *tvb, proto_tree *tree, guint offset if (pVal) { proto_tree_add_int_format(tree, hfindex, tvb, offset, 4, uVal, - "%s[%*d]: 0x%08x (%d) %s", hfinfo->name, iDigit, iCnt, uVal, uVal, pVal); + "%s[%*d]: %s (%d)", hfinfo->name, iDigit, iCnt, pVal, uVal); } else { @@ -140,7 +140,7 @@ static void dissect_mqpcf_parm_int(tvbuff_t *tvb, proto_tree *tree, guint offset if (pVal) { proto_tree_add_int_format_value(tree, hfindex, tvb, offset, 4, uVal, - "0x%08x (%d) %s", uVal, uVal, pVal); + "%s (%d) ", pVal, uVal); } else { @@ -217,7 +217,6 @@ guint32 dissect_mqpcf_parm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mq_tre } uDig = dissect_mqpcf_getDigits(uCount); - for (u = 0; u < uCount && u < mq_pcf_maxprm; u++) { tOfs = offset; @@ -243,14 +242,14 @@ guint32 dissect_mqpcf_parm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mq_tre uLenF = 12; if (bParse) - g_snprintf(strPrm, (gulong)sizeof(strPrm) - 1, " %-s[%*u] {%2d-%-15.15s} %8x/%5d-%-30.30s", + g_snprintf(strPrm, (gulong)sizeof(strPrm) - 1, " %-s[%*u] {%2d-%-4.4s} 0x%08x (%4d) %-30.30s", "MQPrm", uDig, u + 1, - uTyp, val_to_str_ext_const(uTyp, GET_VALS_EXTP(PrmTyp), " Unknown") + 6, + uTyp, val_to_str_ext_const(uTyp, GET_VALS_EXTP(PrmTyp2), " Unkn") + 6, uPrm, uPrm, val_to_str_ext_const(uPrm, GET_VALS_EXTP(PrmId), "Unknown")); else - g_snprintf(strPrm, (gulong)sizeof(strPrm) - 1, " %-s[%*u] {%2d-%-15.15s} %8x/%5d", + g_snprintf(strPrm, (gulong)sizeof(strPrm) - 1, " %-s[%*u] {%2d-%-4.4s} 0x%08x (%4d)", "XtraD", uDig, u + 1, - uTyp, val_to_str_ext_const(uTyp, GET_VALS_EXTP(PrmTyp), " Unknown") + 6, + uTyp, val_to_str_ext_const(uTyp, GET_VALS_EXTP(PrmTyp2), " Unkn") + 6, uPrm, uPrm); switch (uTyp) @@ -271,12 +270,12 @@ guint32 dissect_mqpcf_parm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mq_tre if (pVal) { tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, - "%s 0x%08x (%d) %s", strPrm, uVal, uVal, pVal); + "%s: %s (%d)", strPrm, pVal, uVal); } else { tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, - "%s 0x%08x (%d)", strPrm, uVal, uVal); + "%s: 0x%08x (%d)", strPrm, uVal, uVal); } proto_tree_add_item(tree, hf_mq_pcf_prmtyp, tvb, offset, 4, bLittleEndian); @@ -299,7 +298,7 @@ guint32 dissect_mqpcf_parm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mq_tre if (*sStr) sStr = (guint8*)format_text_chr(wmem_packet_scope(), sStr, strlen((const char *)sStr), '.'); - tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, "%s %s", strPrm, sStr); + tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, "%s: %s", strPrm, sStr); proto_tree_add_item(tree, hf_mq_pcf_prmtyp, tvb, offset, 4, bLittleEndian); proto_tree_add_item(tree, hf_mq_pcf_prmlen, tvb, offset + 4, 4, bLittleEndian); @@ -318,7 +317,7 @@ guint32 dissect_mqpcf_parm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mq_tre uCnt = tvb_get_guint32(tvb, offset + uLenF, bLittleEndian); uDigit = dissect_mqpcf_getDigits(uCnt); - tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, &ti, "%s Cnt(%d)", strPrm, uCnt); + tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, &ti, "%s-> contain %d Element(s)", strPrm, uCnt); proto_tree_add_item(tree, hf_mq_pcf_prmtyp, tvb, offset, 4, bLittleEndian); proto_tree_add_item(tree, hf_mq_pcf_prmlen, tvb, offset + 4, 4, bLittleEndian); @@ -351,7 +350,7 @@ guint32 dissect_mqpcf_parm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mq_tre uCnt = tvb_get_guint32(tvb, offset + uLenF + 4, bLittleEndian); uSLn = tvb_get_guint32(tvb, offset + uLenF + 8, bLittleEndian); - tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, "%s Cnt(%d)", strPrm, uCnt); + tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, "%s-> contain %d Element(s)", strPrm, uCnt); proto_tree_add_item(tree, hf_mq_pcf_prmtyp, tvb, offset, 4, bLittleEndian); proto_tree_add_item(tree, hf_mq_pcf_prmlen, tvb, offset + 4, 4, bLittleEndian); @@ -386,7 +385,7 @@ guint32 dissect_mqpcf_parm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mq_tre { uCnt = tvb_get_guint32(tvb, offset + 12, bLittleEndian); - tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, &ti, "%s Cnt(%d)", strPrm, uCnt); + tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, &ti, "%s-> contain %d Element(s)", strPrm, uCnt); proto_tree_add_item(tree, hf_mq_pcf_prmtyp, tvb, offset, 4, bLittleEndian); proto_tree_add_item(tree, hf_mq_pcf_prmlen, tvb, offset + 4, 4, bLittleEndian); @@ -417,12 +416,12 @@ guint32 dissect_mqpcf_parm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mq_tre if (uSLn > 35) { tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, - "%s [Truncated] A(%-.35s) E(%-.35s)", strPrm, sStrA, sStrE); + "%s: [Truncated] A(%-.35s) E(%-.35s)", strPrm, sStrA, sStrE); } else { tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, - "%s A(%s) E(%s)", strPrm, sStrA, sStrE); + "%s: A(%s) E(%s)", strPrm, sStrA, sStrE); } } else @@ -449,7 +448,7 @@ guint32 dissect_mqpcf_parm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mq_tre uOpe = tvb_get_guint32(tvb, offset + uLenF, bLittleEndian); uVal = tvb_get_guint32(tvb, offset + uLenF + 4, bLittleEndian); - tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, "%s %s 0x%08x (%d)", + tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, "%s: %s 0x%08x (%d)", strPrm, val_to_str(uOpe, GET_VALSV(FilterOP), " Unknown (0x%02x)") + 7, uVal, uVal); proto_tree_add_item(tree, hf_mq_pcf_prmtyp, tvb, offset, 4, bLittleEndian); @@ -473,7 +472,7 @@ guint32 dissect_mqpcf_parm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mq_tre uSLn, '.'); strip_trailing_blanks(sStr, uSLn); - tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, "%s %s %s", + tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, "%s: %s %s", strPrm, val_to_str(uOpe, GET_VALSV(FilterOP), " Unknown (0x%02x)") + 7, sStr); proto_tree_add_item(tree, hf_mq_pcf_prmtyp, tvb, offset, 4, bLittleEndian); @@ -495,12 +494,12 @@ guint32 dissect_mqpcf_parm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mq_tre { guint8 *sStrA = (guint8 *)format_text_chr(wmem_packet_scope(), tvb_get_string_enc(wmem_packet_scope(), tvb, offset + uLenF + 8, uSLn, ENC_ASCII), uSLn, '.'); guint8 *sStrE = (guint8 *)format_text_chr(wmem_packet_scope(), tvb_get_string_enc(wmem_packet_scope(), tvb, offset + uLenF + 8, uSLn, ENC_EBCDIC), uSLn, '.'); - tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, "%s %s A(%s) E(%s)", + tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, "%s: %s A(%s) E(%s)", strPrm, val_to_str(uOpe, GET_VALSV(FilterOP), " Unknown (0x%02x)") + 7, sStrA, sStrE); } else { - tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, "%s %s <MISSING>", + tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, "%s: %s <MISSING>", strPrm, val_to_str(uOpe, GET_VALSV(FilterOP), " Unknown (0x%02x)") + 7); } @@ -529,7 +528,7 @@ guint32 dissect_mqpcf_parm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mq_tre { uVal64 = tvb_get_guint64(tvb, offset + uLenF + 4, bLittleEndian); tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, - "%s 0x%" G_GINT64_MODIFIER "x (%" G_GINT64_MODIFIER "d)", strPrm, uVal64, uVal64); + "%s: 0x%" G_GINT64_MODIFIER "x (%" G_GINT64_MODIFIER "d)", strPrm, uVal64, uVal64); proto_tree_add_item(tree, hf_mq_pcf_prmtyp, tvb, offset, 4, bLittleEndian); proto_tree_add_item(tree, hf_mq_pcf_prmlen, tvb, offset + 4, 4, bLittleEndian); @@ -548,7 +547,7 @@ guint32 dissect_mqpcf_parm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mq_tre hfinfo = proto_registrar_get_nth(hf_mq_pcf_int64list); uCnt = tvb_get_guint32(tvb, offset + uLenF, bLittleEndian); - tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, "%s Cnt(%d)", strPrm, uCnt); + tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, "%s-> contain %d Element(s)", strPrm, uCnt); uDigit = dissect_mqpcf_getDigits(uCnt); proto_tree_add_item(tree, hf_mq_pcf_prmtyp, tvb, offset, 4, bLittleEndian); diff --git a/epan/dissectors/packet-mq.c b/epan/dissectors/packet-mq.c index 83cc3f9906..2fec2d2c4c 100644 --- a/epan/dissectors/packet-mq.c +++ b/epan/dissectors/packet-mq.c @@ -2649,11 +2649,7 @@ static void dissect_mq_pdu(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) 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); - 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); + proto_tree_add_item(mq_tree, hf_mq_inq_sel, tvb, offset + iOffsetINQ + iSelector * 4, 4, p_mq_parm->mq_int_enc); } iOffsetINQ += iNbSelectors * 4; if (p_mq_parm->mq_opcode == MQ_TST_MQINQ_REPLY || p_mq_parm->mq_opcode == MQ_TST_MQSET) @@ -2678,7 +2674,7 @@ static void dissect_mq_pdu(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) _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); + "Integer value...: %s (%d)", _pVal, _lVal); else proto_tree_add_item(mq_tree, hf_mq_inq_intvalue, tvb, offset + iOffsetINQ + iInteger * 4, 4, p_mq_parm->mq_int_enc); } @@ -4175,7 +4171,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_HEX_DEC | BASE_EXT_STRING, GET_VALS_EXTP(selector), 0x0, "INQ Selector", 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_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}}, diff --git a/epan/dissectors/packet-mq.h b/epan/dissectors/packet-mq.h index b6b69960ae..f0962b3f0f 100644 --- a/epan/dissectors/packet-mq.h +++ b/epan/dissectors/packet-mq.h @@ -3684,6 +3684,34 @@ typedef struct _mq_parm_t #define MQ_MQCFT_APP_ACTIVITY 26 #define MQ_MQCFT_STATUS 27 +/* Types of Structure reduced name for PrmTyp2 */ +#define MQ_MQCFT_NONE 0 +#define MQ_MQCFT_CMD 1 +#define MQ_MQCFT_RSP 2 +#define MQ_MQCFT_INT 3 +#define MQ_MQCFT_STR 4 +#define MQ_MQCFT_INTL 5 +#define MQ_MQCFT_STRL 6 +#define MQ_MQCFT_EVT 7 +#define MQ_MQCFT_USR 8 +#define MQ_MQCFT_BSTR 9 +#define MQ_MQCFT_TRC 10 +#define MQ_MQCFT_RPT 12 +#define MQ_MQCFT_INTF 13 +#define MQ_MQCFT_STRF 14 +#define MQ_MQCFT_BSTF 15 +#define MQ_MQCFT_CMDX 16 +#define MQ_MQCFT_XMSG 17 +#define MQ_MQCFT_XITM 18 +#define MQ_MQCFT_XSUM 19 +#define MQ_MQCFT_GRP 20 +#define MQ_MQCFT_STAT 21 +#define MQ_MQCFT_ACNT 22 +#define MQ_MQCFT_I64 23 +#define MQ_MQCFT_I64L 25 +#define MQ_MQCFT_APP_ACTIVITY 26 +#define MQ_MQCFT_STATUS 27 + /* Major Release Function */ #define MQ_MQOPMODE_COMPAT 0 #define MQ_MQOPMODE_NEW_FUNCTION 1 @@ -5595,6 +5623,7 @@ DEF_VALS_EXTX(MQRC); DEF_VALS_EXTX(objtype); DEF_VALS_EXTX(PrmId); DEF_VALS_EXTX(PrmTyp); +DEF_VALS_EXTX(PrmTyp2); DEF_VALS_EXTX(selector); DEF_VALS_EXTX(MQCFINT_Parse); |