aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Karlsson <oakimk@gmail.com>2017-09-23 13:32:10 +0200
committerMichael Mann <mmann78@netscape.net>2017-09-24 03:38:04 +0000
commite345d19b95adf0af37949c866636cd8381451095 (patch)
tree5493eea063a1014376a35ef7a4f6ab052069fe30
parentb13d5eac26db21d3b8682e861575bf5344740f99 (diff)
GPRSCDR: decoding of PDPType
Change-Id: Iec007c5276e30c982e776263ef753c002e2a9c72 Reviewed-on: https://code.wireshark.org/review/23660 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--epan/dissectors/asn1/gprscdr/gprscdr.cnf27
-rw-r--r--epan/dissectors/asn1/gprscdr/packet-gprscdr-template.c3
-rw-r--r--epan/dissectors/packet-gprscdr.c45
-rw-r--r--epan/dissectors/packet-gsm_a_common.h1
-rw-r--r--epan/dissectors/packet-gsm_a_gm.c2
-rw-r--r--epan/dissectors/packet-gtpv2.c2
-rw-r--r--epan/dissectors/packet-gtpv2.h1
7 files changed, 71 insertions, 10 deletions
diff --git a/epan/dissectors/asn1/gprscdr/gprscdr.cnf b/epan/dissectors/asn1/gprscdr/gprscdr.cnf
index 062f6ae6c7..c6bb671ae1 100644
--- a/epan/dissectors/asn1/gprscdr/gprscdr.cnf
+++ b/epan/dissectors/asn1/gprscdr/gprscdr.cnf
@@ -213,6 +213,33 @@ GPRSRecord
offset = dissect_gprscdr_uli(tvb, actx, tree, 2);
+#.FN_BODY PDPType
+ proto_tree *ext_tree_pdp_pdn_type;
+ guint length;
+
+ length = tvb_reported_length(tvb);
+
+ if(length == 1) {
+ /*
+ * PDN/EPS Bearer
+ * TS 29.274
+ * 8.34 PDN Type
+ */
+ ext_tree_pdp_pdn_type = proto_tree_add_subtree(tree, tvb, 0, length, ett_gprscdr_pdp_pdn_type, NULL, "pDNType");
+ dissect_gtpv2_pdn_type(tvb, actx->pinfo, ext_tree_pdp_pdn_type, NULL, length, 0, 0, NULL);
+ offset = length;
+ }
+ else {
+ /* PDP context
+ * TS 29.060
+ * 7.7.27 End User Address
+ * Octet 4-5
+ */
+ ext_tree_pdp_pdn_type = proto_tree_add_subtree(tree, tvb, 0, length, ett_gprscdr_pdp_pdn_type, NULL, "pDPType");
+ offset = de_sm_pdp_addr(tvb, ext_tree_pdp_pdn_type, actx->pinfo, 0, length, NULL, 0);
+ }
+
+
#.FN_BODY GPRSRecord VAL_PTR = &branch_taken
proto_item *item;
gint branch_taken, t_offset = offset;
diff --git a/epan/dissectors/asn1/gprscdr/packet-gprscdr-template.c b/epan/dissectors/asn1/gprscdr/packet-gprscdr-template.c
index c9a59bca49..4aefbcf9bc 100644
--- a/epan/dissectors/asn1/gprscdr/packet-gprscdr-template.c
+++ b/epan/dissectors/asn1/gprscdr/packet-gprscdr-template.c
@@ -29,6 +29,7 @@
#include "packet-ber.h"
#include "packet-gsm_map.h"
+#include "packet-gsm_a_common.h"
#include "packet-e212.h"
#include "packet-gprscdr.h"
#include "packet-gtp.h"
@@ -48,6 +49,7 @@ static int proto_gprscdr = -1;
static int ett_gprscdr = -1;
static int ett_gprscdr_timestamp = -1;
static int ett_gprscdr_plmn_id = -1;
+static int ett_gprscdr_pdp_pdn_type = -1;
static int ett_gprscdr_eps_qos_arp = -1;
static int ett_gprscdr_managementextension_information = -1;
static int ett_gprscdr_userlocationinformation = -1;
@@ -137,6 +139,7 @@ proto_register_gprscdr(void)
&ett_gprscdr,
&ett_gprscdr_timestamp,
&ett_gprscdr_plmn_id,
+ &ett_gprscdr_pdp_pdn_type,
&ett_gprscdr_eps_qos_arp,
&ett_gprscdr_managementextension_information,
&ett_gprscdr_userlocationinformation,
diff --git a/epan/dissectors/packet-gprscdr.c b/epan/dissectors/packet-gprscdr.c
index 1d71c2de5d..8f19e79da2 100644
--- a/epan/dissectors/packet-gprscdr.c
+++ b/epan/dissectors/packet-gprscdr.c
@@ -37,6 +37,7 @@
#include "packet-ber.h"
#include "packet-gsm_map.h"
+#include "packet-gsm_a_common.h"
#include "packet-e212.h"
#include "packet-gprscdr.h"
#include "packet-gtp.h"
@@ -487,11 +488,12 @@ static int hf_gprscdr_ServiceConditionChange_servingPLMNRateControlChange = -1;
static int hf_gprscdr_ServiceConditionChange_aPNRateControlChange = -1;
/*--- End of included file: packet-gprscdr-hf.c ---*/
-#line 47 "./asn1/gprscdr/packet-gprscdr-template.c"
+#line 48 "./asn1/gprscdr/packet-gprscdr-template.c"
static int ett_gprscdr = -1;
static int ett_gprscdr_timestamp = -1;
static int ett_gprscdr_plmn_id = -1;
+static int ett_gprscdr_pdp_pdn_type = -1;
static int ett_gprscdr_eps_qos_arp = -1;
static int ett_gprscdr_managementextension_information = -1;
static int ett_gprscdr_userlocationinformation = -1;
@@ -586,7 +588,7 @@ static gint ett_gprscdr_UserCSGInformation = -1;
static gint ett_gprscdr_UWANUserLocationInfo = -1;
/*--- End of included file: packet-gprscdr-ett.c ---*/
-#line 55 "./asn1/gprscdr/packet-gprscdr-template.c"
+#line 57 "./asn1/gprscdr/packet-gprscdr-template.c"
static expert_field ei_gprscdr_not_dissected = EI_INIT;
static expert_field ei_gprscdr_choice_not_found = EI_INIT;
@@ -1733,8 +1735,34 @@ dissect_gprscdr_AccessPointNameNI(gboolean implicit_tag _U_, tvbuff_t *tvb _U_,
static int
dissect_gprscdr_PDPType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
- offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
- NULL);
+#line 217 "./asn1/gprscdr/gprscdr.cnf"
+ proto_tree *ext_tree_pdp_pdn_type;
+ guint length;
+
+ length = tvb_reported_length(tvb);
+
+ if(length == 1) {
+ /*
+ * PDN/EPS Bearer
+ * TS 29.274
+ * 8.34 PDN Type
+ */
+ ext_tree_pdp_pdn_type = proto_tree_add_subtree(tree, tvb, 0, length, ett_gprscdr_pdp_pdn_type, NULL, "pDNType");
+ dissect_gtpv2_pdn_type(tvb, actx->pinfo, ext_tree_pdp_pdn_type, NULL, length, 0, 0, NULL);
+ offset = length;
+ }
+ else {
+ /* PDP context
+ * TS 29.060
+ * 7.7.27 End User Address
+ * Octet 4-5
+ */
+ ext_tree_pdp_pdn_type = proto_tree_add_subtree(tree, tvb, 0, length, ett_gprscdr_pdp_pdn_type, NULL, "pDPType");
+ offset = de_sm_pdp_addr(tvb, ext_tree_pdp_pdn_type, actx->pinfo, 0, length, NULL, 0);
+ }
+
+
+
return offset;
}
@@ -4653,7 +4681,7 @@ static const ber_choice_t GPRSRecord_choice[] = {
int
dissect_gprscdr_GPRSRecord(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 217 "./asn1/gprscdr/gprscdr.cnf"
+#line 244 "./asn1/gprscdr/gprscdr.cnf"
proto_item *item;
gint branch_taken, t_offset = offset;
gint32 tag;
@@ -4694,7 +4722,7 @@ int dissect_gprscdr_GPRSRecord_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pr
/*--- End of included file: packet-gprscdr-fn.c ---*/
-#line 123 "./asn1/gprscdr/packet-gprscdr-template.c"
+#line 125 "./asn1/gprscdr/packet-gprscdr-template.c"
@@ -6429,7 +6457,7 @@ proto_register_gprscdr(void)
NULL, HFILL }},
/*--- End of included file: packet-gprscdr-hfarr.c ---*/
-#line 133 "./asn1/gprscdr/packet-gprscdr-template.c"
+#line 135 "./asn1/gprscdr/packet-gprscdr-template.c"
};
/* List of subtrees */
@@ -6437,6 +6465,7 @@ proto_register_gprscdr(void)
&ett_gprscdr,
&ett_gprscdr_timestamp,
&ett_gprscdr_plmn_id,
+ &ett_gprscdr_pdp_pdn_type,
&ett_gprscdr_eps_qos_arp,
&ett_gprscdr_managementextension_information,
&ett_gprscdr_userlocationinformation,
@@ -6531,7 +6560,7 @@ proto_register_gprscdr(void)
&ett_gprscdr_UWANUserLocationInfo,
/*--- End of included file: packet-gprscdr-ettarr.c ---*/
-#line 144 "./asn1/gprscdr/packet-gprscdr-template.c"
+#line 147 "./asn1/gprscdr/packet-gprscdr-template.c"
};
static ei_register_info ei[] = {
diff --git a/epan/dissectors/packet-gsm_a_common.h b/epan/dissectors/packet-gsm_a_common.h
index 8092fb4260..9fc96debc8 100644
--- a/epan/dissectors/packet-gsm_a_common.h
+++ b/epan/dissectors/packet-gsm_a_common.h
@@ -699,6 +699,7 @@ guint16 de_serv_cat(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32
WS_DLL_PUBLIC
guint16 de_sm_apn(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len);
guint16 de_sm_pco(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len);
+guint16 de_sm_pdp_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_);
WS_DLL_PUBLIC
guint16 de_sm_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len);
WS_DLL_PUBLIC
diff --git a/epan/dissectors/packet-gsm_a_gm.c b/epan/dissectors/packet-gsm_a_gm.c
index 1f36377a3e..8e4fc57d70 100644
--- a/epan/dissectors/packet-gsm_a_gm.c
+++ b/epan/dissectors/packet-gsm_a_gm.c
@@ -4615,7 +4615,7 @@ static const value_string gsm_a_sm_pdp_type_org_vals[] = {
{ 0, NULL }
};
-static guint16
+guint16
de_sm_pdp_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
{
guint32 curr_offset;
diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c
index 476b115e1f..5ee7cc16de 100644
--- a/epan/dissectors/packet-gtpv2.c
+++ b/epan/dissectors/packet-gtpv2.c
@@ -3034,7 +3034,7 @@ dissect_gtpv2_bearer_flag(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre
/*
* 8.34 PDN Type
*/
-static void
+void
dissect_gtpv2_pdn_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_, session_args_t * args _U_)
{
diff --git a/epan/dissectors/packet-gtpv2.h b/epan/dissectors/packet-gtpv2.h
index 99d9060d44..fc45a60cd6 100644
--- a/epan/dissectors/packet-gtpv2.h
+++ b/epan/dissectors/packet-gtpv2.h
@@ -31,6 +31,7 @@ extern void dissect_gtpv2_twan_identifier(tvbuff_t *tvb, packet_info *pinfo _U_,
/*Used by custom dissector*/
extern gchar* dissect_gtpv2_tai(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset);
extern void dissect_gtpv2_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_, session_args_t * args _U_);
+extern void dissect_gtpv2_pdn_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_, session_args_t * args _U_);
extern value_string_ext gtpv2_cause_vals_ext;