From 3c55e120dbe84cece70a40440b27b897fabe0f04 Mon Sep 17 00:00:00 2001 From: Joakim Karlsson Date: Thu, 27 Oct 2016 21:18:13 +0200 Subject: [PATCH] diameter: improvement of AVP 18 Will now show country and operator Change-Id: Ic16623c226228ab0c3e31d33cda81953c80551d6 Reviewed-on: https://code.wireshark.org/review/18512 Petri-Dish: Anders Broman Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- debian/libwireshark0.symbols | 1 + epan/dissectors/packet-diameter_3gpp.c | 17 +++++++++++++++++ epan/dissectors/packet-e212.c | 2 +- epan/dissectors/packet-e212.h | 3 +++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/debian/libwireshark0.symbols b/debian/libwireshark0.symbols index d5750f5905..7721214152 100644 --- a/debian/libwireshark0.symbols +++ b/debian/libwireshark0.symbols @@ -321,6 +321,7 @@ libwireshark.so.0 libwireshark0 #MINVER# dissect_e212_imsi@Base 1.99.0 dissect_e212_mcc_mnc@Base 1.9.1 dissect_e212_mcc_mnc_in_address@Base 1.9.1 + dissect_e212_mcc_mnc_in_utf8_address@Base 2.3.0 dissect_e212_utf8_imsi@Base 1.99.0 dissect_gsm_map_GlobalCellId@Base 1.9.1 dissect_gsm_map_IMSI@Base 1.9.1 diff --git a/epan/dissectors/packet-diameter_3gpp.c b/epan/dissectors/packet-diameter_3gpp.c index a70360f4a0..70de7b3bbc 100644 --- a/epan/dissectors/packet-diameter_3gpp.c +++ b/epan/dissectors/packet-diameter_3gpp.c @@ -402,6 +402,20 @@ dissect_diameter_3gpp_sgsn_ipv6_address(tvbuff_t *tvb, packet_info *pinfo, proto } +/* + * AVP Code: 18 SGSN-MNC-MCC + */ +static int +dissect_diameter_3gpp_sgsn_mnc_mcc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +{ + guint32 str_len; + + str_len = tvb_reported_length(tvb); + dissect_e212_mcc_mnc_in_utf8_address(tvb, pinfo, tree, 0); + + return str_len; +} + /* AVP Code: 20 3GPP-IMEISV * 3GPP TS 29.061 */ @@ -1865,6 +1879,9 @@ proto_reg_handoff_diameter_3gpp(void) /* AVP Code: 15 3GPP-SGSN-IPv6-Address */ dissector_add_uint("diameter.3gpp", 15, create_dissector_handle(dissect_diameter_3gpp_sgsn_ipv6_address, proto_diameter_3gpp)); + /* AVP Code: 18 3GPP-SGSN-MNC-MCC */ + dissector_add_uint("diameter.3gpp", 18, create_dissector_handle(dissect_diameter_3gpp_sgsn_mnc_mcc, proto_diameter_3gpp)); + /* AVP Code: 20 3GPP-IMEISV */ dissector_add_uint("diameter.3gpp", 20, create_dissector_handle(dissect_diameter_3gpp_imeisv, proto_diameter_3gpp)); diff --git a/epan/dissectors/packet-e212.c b/epan/dissectors/packet-e212.c index 8cc31032bc..05fc06feca 100644 --- a/epan/dissectors/packet-e212.c +++ b/epan/dissectors/packet-e212.c @@ -3099,7 +3099,7 @@ dissect_e212_mcc_mnc_high_nibble(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr return 5; } -static int +int dissect_e212_mcc_mnc_in_utf8_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset) { guint16 mcc = 0, mnc = 0; diff --git a/epan/dissectors/packet-e212.h b/epan/dissectors/packet-e212.h index b93e9a6566..f7434cec09 100644 --- a/epan/dissectors/packet-e212.h +++ b/epan/dissectors/packet-e212.h @@ -49,6 +49,9 @@ int dissect_e212_mcc_mnc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in WS_DLL_PUBLIC int dissect_e212_mcc_mnc_in_address(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset); +WS_DLL_PUBLIC +int dissect_e212_mcc_mnc_in_utf8_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset); + /** * * Given a tvbuff, an offset into the tvbuff, and a length that starts