aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-diameter.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2015-05-06 16:03:15 -0400
committerJeff Morriss <jeff.morriss.ws@gmail.com>2015-05-06 20:27:26 +0000
commit80358079fe0a7c620b58d3109bfe1ba7e9bf8e3c (patch)
treee338dd9e3edb552eec75279de8ce0f659bb6aee9 /epan/dissectors/packet-diameter.c
parent0f55a0f54751649bad47b5aff53c020589c8beb9 (diff)
Add/clarify some comments about how the Experimental-Result-Code AVP is handled.
Specifically we put Experimental-Result-Codes specified by 3GPP in the XML file and let other vendors' codes be handled through a dissector table. Change-Id: I2c3977fb959ad84faa5cb90aeb3d191c8b465ede Reviewed-on: https://code.wireshark.org/review/8319 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-diameter.c')
-rw-r--r--epan/dissectors/packet-diameter.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/epan/dissectors/packet-diameter.c b/epan/dissectors/packet-diameter.c
index 9135a52720..2eaef67d22 100644
--- a/epan/dissectors/packet-diameter.c
+++ b/epan/dissectors/packet-diameter.c
@@ -682,7 +682,7 @@ dissect_diameter_avp(diam_ctx_t *c, tvbuff_t *tvb, int offset, diam_sub_dis_t *d
return len+pad_len;
}
/* If we are dissecting a grouped AVP and find a Vendor Id AVP(266), save it */
- if((diam_sub_dis_inf->dis_gouped)&&(!vendor_flag)&&(code==266)){
+ if ((diam_sub_dis_inf->dis_gouped) && (!vendor_flag) && (code==266)) {
diam_sub_dis_inf->vendor_id = tvb_get_ntohl(tvb,offset);
}
@@ -692,22 +692,26 @@ dissect_diameter_avp(diam_ctx_t *c, tvbuff_t *tvb, int offset, diam_sub_dis_t *d
save_tree = c->tree;
c->tree = avp_tree;
- /* If we are dissecting a grouped AVP and find Experimental-Result-Code AVP(298)
- * it might be Vendor defined e.g we can't use the enum from the .xml file.
- * Actually the xml enum is for 3GPP so let the AVP dissector handle that too
+ /* The Experimental-Result-Code AVP (298) comes inside the Experimental-Result
+ * grouped AVP (297). The Vendor-ID AVP in the Experimental-Result specifies the
+ * name space of the Experimental-Result-Code. Unfortunately we don't have a way
+ * to specify, in XML, different Experimental-Result-Code enum values for different
+ * Vendor-IDs so we choose a Vendor-ID whose values get to go in XML (we chose
+ * 3GPP) and handle other Vendor-IDs through the "diameter.vnd_exp_res" dissector
+ * table.
*/
- if((diam_sub_dis_inf->dis_gouped)
- &&(!vendor_flag)
- &&(code==298)
- &&(diam_sub_dis_inf->vendor_id != 0)
- &&(diam_sub_dis_inf->vendor_id != VENDOR_THE3GPP))
+ if ((diam_sub_dis_inf->dis_gouped)
+ && (!vendor_flag)
+ && (code==298)
+ && (diam_sub_dis_inf->vendor_id != 0)
+ && (diam_sub_dis_inf->vendor_id != VENDOR_THE3GPP))
{
/* call subdissector */
dissector_try_uint_new(diameter_expr_result_vnd_table, diam_sub_dis_inf->vendor_id, subtvb, c->pinfo, avp_tree, FALSE, diam_sub_dis_inf);
- if(diam_sub_dis_inf->avp_str){
+ if (diam_sub_dis_inf->avp_str) {
proto_item_append_text(avp_item," val=%s", diam_sub_dis_inf->avp_str);
}
- }else if (c->version_rfc) {
+ } else if (c->version_rfc) {
avp_str = a->dissector_rfc(c,a,subtvb, diam_sub_dis_inf);
} else {
avp_str = a->dissector_v16(c,a,subtvb, diam_sub_dis_inf);