aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndersBroman <anders.broman@ericsson.com>2017-10-10 10:24:28 +0200
committerMichael Mann <mmann78@netscape.net>2017-10-10 11:20:10 +0000
commit3444d41fd0d425aca79c9eeaadff1a7f647e7b13 (patch)
treef659f566fc185b9195bd81540e2e56b758420011
parent698aa24165d0a51b06117d6d9133c04839fbe40e (diff)
[GSM SMS] If the digits are E164 International number add an E.164
filter. Change-Id: Idcfa53d1db9e9f7b5501ca92592fb0fa0790ffe9 Reviewed-on: https://code.wireshark.org/review/23873 Reviewed-by: Anders Broman <a.broman58@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--epan/dissectors/packet-gsm_sms.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/epan/dissectors/packet-gsm_sms.c b/epan/dissectors/packet-gsm_sms.c
index aa11769..56d7efa 100644
--- a/epan/dissectors/packet-gsm_sms.c
+++ b/epan/dissectors/packet-gsm_sms.c
@@ -42,6 +42,7 @@
#include <epan/reassemble.h>
#include <epan/charsets.h>
#include <epan/proto_data.h>
+#include "packet-e164.h"
#include <epan/asn1.h>
#include "packet-gsm_sms.h"
#include "packet-gsm_map.h"
@@ -601,7 +602,7 @@ dis_field_addr(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, guint32 *off
static gchar digit_table[] = {"0123456789*#abc\0"};
proto_item *item;
proto_tree *subtree;
- guint8 oct;
+ guint8 oct, nt_mp;
guint32 offset;
guint32 numdigocts;
guint32 length, addrlength;
@@ -633,6 +634,7 @@ dis_field_addr(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, guint32 *off
offset++;
oct = tvb_get_guint8(tvb, offset);
+ nt_mp = oct & 0x7f;
proto_tree_add_item(subtree, hf_gsm_sms_dis_field_addr_extension, tvb, offset, 1, ENC_NA);
proto_tree_add_item(subtree, hf_gsm_sms_dis_field_addr_num_type, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -663,11 +665,19 @@ dis_field_addr(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, guint32 *off
if (g_ascii_strncasecmp(title, "TP-O", 4) == 0) {
proto_tree_add_string(subtree, hf_gsm_sms_tp_oa, tvb,
offset, numdigocts, addrstr);
+ if (((nt_mp >> 4) == 1) && ((nt_mp & 0x0f) == 1)) {
+ /* if Type of number international and number plan is E.164*/
+ dissect_e164_msisdn(tvb, subtree, offset, numdigocts, E164_ENC_BCD);
+ }
p_add_proto_data(pinfo->pool, pinfo, proto_gsm_sms, 0,
wmem_strdup(pinfo->pool, addrstr));
} else if (g_ascii_strncasecmp(title, "TP-D", 4) == 0) {
proto_tree_add_string(subtree, hf_gsm_sms_tp_da, tvb,
offset, numdigocts, addrstr);
+ if (((nt_mp >> 4) == 1) && ((nt_mp & 0x0f) == 1)) {
+ /* if Type of number international and number plan is E.164*/
+ dissect_e164_msisdn(tvb, subtree, offset, numdigocts, E164_ENC_BCD);
+ }
p_add_proto_data(pinfo->pool, pinfo, proto_gsm_sms, 0,
wmem_strdup(pinfo->pool, addrstr));
} else if (g_ascii_strncasecmp(title, "TP-R", 4) == 0) {