diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2020-01-06 01:50:11 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2020-01-09 07:57:42 +0000 |
commit | 0db02a89f3cb0bca3a8c6a796e7bd8822e4b3c3f (patch) | |
tree | 6bceb54cd473efadec04751b1c6604fcf8c624ca | |
parent | 1fec43355fb6b4e6da322d701f19403bfefb7056 (diff) |
GSUP/SMS: also dissect ToN/NPI header in SM-RP-DA/OA
Unlike IMSI, both MSISDN and SMSC Address in SM-RP-OA/DA not only
contain the BCD encoded digits, but also a little header with
NPI (Numbering Plan Identification), ToN (Type of Number), and
Extension fields.
IE: SM-RP-DA (Destination Address)
Information Element Identifier: SM-RP-DA (Destination Address) (65)
Information Element Length: 8
Address Type: SMSC Address (3)
1... .... = Extension: No Extension
.001 .... = Nature of number: International Number (0x1)
.... 0001 = Number plan: ISDN/Telephony Numbering (Rec ITU-T E.164) (0x1)
E.164 number (MSISDN): 447785016005
Country Code: United Kingdom of Great Britain and Northern Ireland (44)
Let's dissect that header and following address bytes using the
public API from MAP dissector - dissect_gsm_map_msisdn().
Change-Id: Idc8a098926d38770002ba689efcf2c794c6b18d9
Reviewed-on: https://code.wireshark.org/review/35664
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
Petri-Dish: Pascal Quantin <pascal@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | epan/dissectors/packet-gsm_gsup.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/epan/dissectors/packet-gsm_gsup.c b/epan/dissectors/packet-gsm_gsup.c index 50d7add060..8b8ae4ad59 100644 --- a/epan/dissectors/packet-gsm_gsup.c +++ b/epan/dissectors/packet-gsm_gsup.c @@ -27,8 +27,10 @@ #include <epan/packet.h> #include <epan/expert.h> #include <epan/conversation.h> +#include <epan/asn1.h> #include "packet-gsm_a_common.h" +#include "packet-gsm_map.h" #include "packet-e164.h" #include "packet-e212.h" #include "packet-dns.h" @@ -494,6 +496,7 @@ static void dissect_ss_info_ie(tvbuff_t *tvb, packet_info *pinfo, guint offset, static void dissect_sm_rp_da_ie(tvbuff_t *tvb, packet_info *pinfo, guint offset, guint ie_len, proto_tree *tree) { + tvbuff_t *addr_tvb; proto_item *ti; guint8 id_type; @@ -515,8 +518,8 @@ static void dissect_sm_rp_da_ie(tvbuff_t *tvb, packet_info *pinfo, guint offset, break; case OSMO_GSUP_SMS_SM_RP_ODA_MSISDN: case OSMO_GSUP_SMS_SM_RP_ODA_SMSC_ADDR: - dissect_e164_msisdn(tvb, tree, - offset + 2, ie_len - 2, E164_ENC_BCD); + addr_tvb = tvb_new_subset_length(tvb, offset + 1, ie_len - 1); + dissect_gsm_map_msisdn(addr_tvb, pinfo, tree); break; /* Special case for noSM-RP-DA and noSM-RP-OA */ @@ -539,6 +542,7 @@ static void dissect_sm_rp_da_ie(tvbuff_t *tvb, packet_info *pinfo, guint offset, static void dissect_sm_rp_oa_ie(tvbuff_t *tvb, packet_info *pinfo, guint offset, guint ie_len, proto_tree *tree) { + tvbuff_t *addr_tvb; proto_item *ti; guint8 id_type; @@ -556,8 +560,8 @@ static void dissect_sm_rp_oa_ie(tvbuff_t *tvb, packet_info *pinfo, guint offset, switch (id_type) { case OSMO_GSUP_SMS_SM_RP_ODA_MSISDN: case OSMO_GSUP_SMS_SM_RP_ODA_SMSC_ADDR: - dissect_e164_msisdn(tvb, tree, - offset + 2, ie_len - 2, E164_ENC_BCD); + addr_tvb = tvb_new_subset_length(tvb, offset + 1, ie_len - 1); + dissect_gsm_map_msisdn(addr_tvb, pinfo, tree); break; /* Special case for noSM-RP-DA and noSM-RP-OA */ |