aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ranap.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-ranap.c')
-rw-r--r--epan/dissectors/packet-ranap.c60
1 files changed, 34 insertions, 26 deletions
diff --git a/epan/dissectors/packet-ranap.c b/epan/dissectors/packet-ranap.c
index f7fec7e0b5..4a3b2c0323 100644
--- a/epan/dissectors/packet-ranap.c
+++ b/epan/dissectors/packet-ranap.c
@@ -2660,7 +2660,7 @@ dissect_ranap_APN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto
static int
dissect_ranap_PLMNidentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 279 "../../asn1/ranap/ranap.cnf"
+#line 281 "../../asn1/ranap/ranap.cnf"
tvbuff_t *parameter_tvb=NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
@@ -4578,7 +4578,7 @@ dissect_ranap_GlobalRNC_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _
static int
dissect_ranap_GTP_TEI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 330 "../../asn1/ranap/ranap.cnf"
+#line 332 "../../asn1/ranap/ranap.cnf"
tvbuff_t *parameter_tvb=NULL;
int saved_hf;
@@ -4764,7 +4764,7 @@ dissect_ranap_IMSI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, prot
#line 189 "../../asn1/ranap/ranap.cnf"
tvbuff_t* imsi_tvb;
const char *digit_str;
-
+ sccp_msg_info_t *sccp_info;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
3, 8, FALSE, &imsi_tvb);
@@ -4774,11 +4774,13 @@ dissect_ranap_IMSI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, prot
PROTO_ITEM_SET_HIDDEN(actx->created_item);
digit_str = dissect_e212_imsi(imsi_tvb, actx->pinfo, tree, 0, tvb_reported_length(imsi_tvb), FALSE);
- if ( actx->pinfo->sccp_info
- && actx->pinfo->sccp_info->data.co.assoc
- && ! actx->pinfo->sccp_info->data.co.assoc->calling_party ) {
+ sccp_info = (sccp_msg_info_t *)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_ranap, 0);
+
+ if ( sccp_info
+ && sccp_info->data.co.assoc
+ && ! sccp_info->data.co.assoc->calling_party ) {
- actx->pinfo->sccp_info->data.co.assoc->calling_party =
+ sccp_info->data.co.assoc->calling_party =
wmem_strdup_printf(wmem_file_scope(), "IMSI: %s", digit_str );
}
@@ -5610,7 +5612,7 @@ dissect_ranap_LocationReportingTransferInformation(tvbuff_t *tvb _U_, int offset
static int
dissect_ranap_L3_Information(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 267 "../../asn1/ranap/ranap.cnf"
+#line 269 "../../asn1/ranap/ranap.cnf"
tvbuff_t *l3_info_tvb=NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
@@ -6030,7 +6032,7 @@ dissect_ranap_MSISDN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, pr
static int
dissect_ranap_NAS_PDU(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 212 "../../asn1/ranap/ranap.cnf"
+#line 214 "../../asn1/ranap/ranap.cnf"
tvbuff_t *nas_pdu_tvb=NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
@@ -6068,7 +6070,7 @@ dissect_ranap_NAS_SynchronisationIndicator(tvbuff_t *tvb _U_, int offset _U_, as
static int
dissect_ranap_NewBSS_To_OldBSS_Information(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 259 "../../asn1/ranap/ranap.cnf"
+#line 261 "../../asn1/ranap/ranap.cnf"
tvbuff_t *bss_info_tvb=NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
@@ -6157,7 +6159,7 @@ dissect_ranap_Offload_RAB_Parameters(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx
static int
dissect_ranap_OldBSS_ToNewBSS_Information(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 251 "../../asn1/ranap/ranap.cnf"
+#line 253 "../../asn1/ranap/ranap.cnf"
tvbuff_t *bss_info_tvb=NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
@@ -7323,7 +7325,7 @@ dissect_ranap_RNSAPRelocationParameters(tvbuff_t *tvb _U_, int offset _U_, asn1_
static int
dissect_ranap_RRC_Container(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 221 "../../asn1/ranap/ranap.cnf"
+#line 223 "../../asn1/ranap/ranap.cnf"
tvbuff_t *rrc_message_tvb=NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
@@ -7435,7 +7437,7 @@ dissect_ranap_Service_Handover(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *ac
static int
dissect_ranap_Source_ToTarget_TransparentContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 356 "../../asn1/ranap/ranap.cnf"
+#line 358 "../../asn1/ranap/ranap.cnf"
dissect_ranap_SourceRNC_ToTargetRNC_TransparentContainer(tvb , offset, actx ,tree , hf_ranap_ranap_SourceRNC_ToTargetRNC_TransparentContainer_PDU );
@@ -7512,7 +7514,7 @@ static const per_sequence_t SourceRNC_ToTargetRNC_TransparentContainer_sequence[
static int
dissect_ranap_SourceRNC_ToTargetRNC_TransparentContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 342 "../../asn1/ranap/ranap.cnf"
+#line 344 "../../asn1/ranap/ranap.cnf"
/* If SourceRNC-ToTargetRNC-TransparentContainer is called trough
dissect_ranap_SourceRNC_ToTargetRNC_TransparentContainer_PDU
ProtocolIE_ID may be unset
@@ -7751,7 +7753,7 @@ dissect_ranap_SRVCC_Operation_Possible(tvbuff_t *tvb _U_, int offset _U_, asn1_c
static int
dissect_ranap_Target_ToSource_TransparentContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 366 "../../asn1/ranap/ranap.cnf"
+#line 368 "../../asn1/ranap/ranap.cnf"
dissect_ranap_TargetRNC_ToSourceRNC_TransparentContainer(tvb , offset, actx ,tree , hf_ranap_ranap_TargetRNC_ToSourceRNC_TransparentContainer_PDU );
@@ -7882,7 +7884,7 @@ dissect_ranap_TraceType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_,
static int
dissect_ranap_TransportLayerAddress(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 302 "../../asn1/ranap/ranap.cnf"
+#line 304 "../../asn1/ranap/ranap.cnf"
tvbuff_t *parameter_tvb=NULL;
proto_item *item;
proto_tree *subtree, *nsap_tree;
@@ -13150,11 +13152,12 @@ dissect_OutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
return (dissector_try_uint_new(ranap_proc_out_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
-static void
-dissect_ranap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ranap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
proto_item *ranap_item = NULL;
proto_tree *ranap_tree = NULL;
+ sccp_msg_info_t *sccp_msg_lcl = (sccp_msg_info_t *)data;
pdu_type = 0;
ProtocolIE_ID = 0;
@@ -13166,9 +13169,12 @@ dissect_ranap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ranap_item = proto_tree_add_item(tree, proto_ranap, tvb, 0, -1, ENC_NA);
ranap_tree = proto_item_add_subtree(ranap_item, ett_ranap);
+ /* Save the sccp_msg_info_t data (if present) because it can't be passed
+ through function calls */
+ p_add_proto_data(pinfo->pool, pinfo, proto_ranap, 0, data);
+
dissect_RANAP_PDU_PDU(tvb, pinfo, ranap_tree, NULL);
- if (pinfo->sccp_info) {
- sccp_msg_info_t* sccp_msg_lcl = pinfo->sccp_info;
+ if (sccp_msg_lcl) {
if (sccp_msg_lcl->data.co.assoc)
sccp_msg_lcl->data.co.assoc->payload = SCCP_PLOAD_RANAP;
@@ -13178,11 +13184,13 @@ dissect_ranap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
sccp_msg_lcl->data.co.label = wmem_strdup(wmem_file_scope(), str);
}
}
+
+ return tvb_reported_length(tvb);
}
#define RANAP_MSG_MIN_LENGTH 7
static gboolean
-dissect_sccp_ranap_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
+dissect_sccp_ranap_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
guint8 temp;
guint16 word;
@@ -13219,7 +13227,7 @@ dissect_sccp_ranap_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
if(word > 0x1ff){
return FALSE;
}
- dissect_ranap(tvb, pinfo, tree);
+ dissect_ranap(tvb, pinfo, tree, data);
return TRUE;
}
@@ -16114,7 +16122,7 @@ void proto_register_ranap(void) {
NULL, HFILL }},
/*--- End of included file: packet-ranap-hfarr.c ---*/
-#line 320 "../../asn1/ranap/packet-ranap-template.c"
+#line 326 "../../asn1/ranap/packet-ranap-template.c"
};
/* List of subtrees */
@@ -16451,7 +16459,7 @@ void proto_register_ranap(void) {
&ett_ranap_Outcome,
/*--- End of included file: packet-ranap-ettarr.c ---*/
-#line 328 "../../asn1/ranap/packet-ranap-template.c"
+#line 334 "../../asn1/ranap/packet-ranap-template.c"
};
@@ -16462,7 +16470,7 @@ void proto_register_ranap(void) {
proto_register_subtree_array(ett, array_length(ett));
/* Register dissector */
- register_dissector("ranap", dissect_ranap, proto_ranap);
+ new_register_dissector("ranap", dissect_ranap, proto_ranap);
/* Register dissector tables */
ranap_ies_dissector_table = register_dissector_table("ranap.ies", "RANAP-PROTOCOL-IES", FT_UINT32, BASE_DEC);
@@ -16834,7 +16842,7 @@ proto_reg_handoff_ranap(void)
/*--- End of included file: packet-ranap-dis-tab.c ---*/
-#line 378 "../../asn1/ranap/packet-ranap-template.c"
+#line 384 "../../asn1/ranap/packet-ranap-template.c"
} else {
dissector_delete_uint("sccp.ssn", local_ranap_sccp_ssn, ranap_handle);
}