diff options
author | AndersBroman <a.broman@bredband.net> | 2014-03-16 18:57:18 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-03-16 19:15:54 +0000 |
commit | fcf1c44b501f1d3fb807d276d8b11f57f2746b7f (patch) | |
tree | da39946b865b87034d4e1443cd6ee8138bb5ffcd /epan/dissectors/packet-diameter.c | |
parent | 5f508e8b29e99a3c2049a2b8912ae07e5cce21c6 (diff) |
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>
Diffstat (limited to 'epan/dissectors/packet-diameter.c')
-rw-r--r-- | epan/dissectors/packet-diameter.c | 14 |
1 files changed, 12 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; |