summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndersBroman <a.broman@bredband.net>2014-03-16 18:57:18 +0100
committerAnders Broman <a.broman58@gmail.com>2014-03-16 19:15:54 +0000
commitfcf1c44b501f1d3fb807d276d8b11f57f2746b7f (patch)
treeda39946b865b87034d4e1443cd6ee8138bb5ffcd
parent5f508e8b29e99a3c2049a2b8912ae07e5cce21c6 (diff)
downloadwireshark-fcf1c44b501f1d3fb807d276d8b11f57f2746b7f.tar.gz
Make the avp_str available to sub dissectors and Let the subdissector have
precedence filling in the avp_item string. Use that in a couple of places. Change-Id: I1af7a1ca4c14fb56ddeaab336202e6c2a18e556b Reviewed-on: https://code.wireshark.org/review/699 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/dissectors/packet-diameter.c14
-rw-r--r--epan/dissectors/packet-diameter_3gpp.c7
2 files changed, 19 insertions, 2 deletions
diff --git a/epan/dissectors/packet-diameter.c b/epan/dissectors/packet-diameter.c
index 3b3f6fb49a..29f6cd61b5 100644
--- a/epan/dissectors/packet-diameter.c
+++ b/epan/dissectors/packet-diameter.c
@@ -61,6 +61,7 @@
#include <epan/diam_dict.h>
#include <epan/sctpppids.h>
#include <epan/show_exception.h>
+#include <epan/to_str.h>
#include "packet-tcp.h"
#include "packet-diameter.h"
@@ -420,6 +421,7 @@ dissect_diameter_3gpp2_exp_res(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
static int
dissect_diameter_base_framed_ipv6_prefix(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
+ diam_sub_dis_t *diam_sub_dis = (diam_sub_dis_t*)data;
guint8 prefix_len, prefix_len_bytes;
/*diam_sub_dis_t *diam_sub_dis_inf = (diam_sub_dis_t*)data;*/
@@ -443,6 +445,7 @@ dissect_diameter_base_framed_ipv6_prefix(tvbuff_t *tvb, packet_info *pinfo _U_,
tvb_memcpy(tvb, (guint8 *)&value.bytes, 2, prefix_len_bytes);
value.bytes[prefix_len_bytes] = value.bytes[prefix_len_bytes] & (0xff<<(prefix_len % 8));
proto_tree_add_ipv6(tree, hf_framed_ipv6_prefix_ipv6, tvb, 2, prefix_len_bytes, value.bytes);
+ diam_sub_dis->avp_str = wmem_strdup_printf(wmem_packet_scope(), "%s/%u", ip6_to_str((const struct e_in6_addr *)&value),prefix_len);
}
return(prefix_len_bytes+2);
@@ -642,10 +645,17 @@ dissect_diameter_avp(diam_ctx_t *c, tvbuff_t *tvb, int offset, diam_sub_dis_t *d
}
c->tree = save_tree;
- if (avp_str) proto_item_append_text(avp_item," val=%s", avp_str);
-
+ diam_sub_dis_inf->avp_str = NULL;
call_avp_subdissector(vendorid, code, subtvb, c->pinfo, avp_tree, diam_sub_dis_inf);
+ /* Let the subdissector have precedence filling in the avp_item string */
+ if(diam_sub_dis_inf->avp_str){
+ proto_item_append_text(avp_item," val=%s", diam_sub_dis_inf->avp_str);
+ }else if (avp_str){
+ proto_item_append_text(avp_item," val=%s", avp_str);
+ }
+
+
if (pad_len) {
guint8 i;
diff --git a/epan/dissectors/packet-diameter_3gpp.c b/epan/dissectors/packet-diameter_3gpp.c
index 00e5dd7aa1..303d3a4218 100644
--- a/epan/dissectors/packet-diameter_3gpp.c
+++ b/epan/dissectors/packet-diameter_3gpp.c
@@ -187,6 +187,7 @@ dissect_diameter_3gpp_ms_timezone(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
int offset = 0;
guint8 oct;
char sign;
+ diam_sub_dis_t *diam_sub_dis = (diam_sub_dis_t*)data;
/* 3GPP TS 23.040 version 6.6.0 Release 6
* 9.2.3.11 TP-Service-Centre-Time-Stamp (TP-SCTS)
@@ -208,6 +209,12 @@ dissect_diameter_3gpp_ms_timezone(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
proto_tree_add_text(tree, tvb, offset, 1, "%s", val_to_str_const(oct, daylight_saving_time_vals, "Unknown"));
offset++;
+ diam_sub_dis->avp_str = wmem_strdup_printf(wmem_packet_scope(), "Timezone: GMT %c %d hours %d minutes %s",
+ sign,
+ oct / 4,
+ oct % 4 * 15,
+ val_to_str_const(oct, daylight_saving_time_vals, "Unknown"));
+
return offset;
}