S1AP: Add an S1AP context to be able to determine which message and

message type an IE was sent in. Needed to dissect proprietarry data.

Change-Id: Ie75a2f6a544cb33e22c42457b0edd83e6456bfe5
Reviewed-on: https://code.wireshark.org/review/4910
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
AndersBroman 2014-10-22 16:14:03 +02:00 committed by Anders Broman
parent 589db1c35b
commit 58304b9e3e
4 changed files with 64 additions and 20 deletions

View File

@ -136,7 +136,14 @@ static int dissect_TargetBSS_ToSourceBSS_TransparentContainer_PDU(tvbuff_t *tvb,
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
return (dissector_try_uint(s1ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
s1ap_ctx_t s1ap_ctx;
s1ap_ctx.message_type = message_type;
s1ap_ctx.ProcedureCode = ProcedureCode;
s1ap_ctx.ProtocolIE_ID = ProtocolIE_ID;
s1ap_ctx.ProtocolExtensionID = ProtocolExtensionID;
return (dissector_try_uint_new(s1ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, TRUE, &s1ap_ctx)) ? tvb_captured_length(tvb) : 0;
}
/* Currently not used
static int dissect_ProtocolIEFieldPairFirstValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
@ -152,22 +159,29 @@ static int dissect_ProtocolIEFieldPairSecondValue(tvbuff_t *tvb, packet_info *pi
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
return (dissector_try_uint(s1ap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
s1ap_ctx_t s1ap_ctx;
s1ap_ctx.message_type = message_type;
s1ap_ctx.ProcedureCode = ProcedureCode;
s1ap_ctx.ProtocolIE_ID = ProtocolIE_ID;
s1ap_ctx.ProtocolExtensionID = ProtocolExtensionID;
return (dissector_try_uint_new(s1ap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree, TRUE, &s1ap_ctx)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
return (dissector_try_uint(s1ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
return (dissector_try_uint_new(s1ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree, TRUE, data)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
return (dissector_try_uint(s1ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
return (dissector_try_uint_new(s1ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree, TRUE, data)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
return (dissector_try_uint(s1ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
return (dissector_try_uint_new(s1ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, TRUE, data)) ? tvb_captured_length(tvb) : 0;
}

View File

@ -23,6 +23,14 @@
#ifndef PACKET_S1AP_H
#define PACKET_S1AP_H
typedef struct _s1ap_ctx_t {
guint32 message_type;
guint32 ProcedureCode;
guint32 ProtocolIE_ID;
guint32 ProtocolExtensionID;
} s1ap_ctx_t;
#include "packet-s1ap-exp.h"
#endif /* PACKET_S1AP_H */

View File

@ -10477,7 +10477,14 @@ int dissect_s1ap_SONtransferCause_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_,
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
return (dissector_try_uint(s1ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
s1ap_ctx_t s1ap_ctx;
s1ap_ctx.message_type = message_type;
s1ap_ctx.ProcedureCode = ProcedureCode;
s1ap_ctx.ProtocolIE_ID = ProtocolIE_ID;
s1ap_ctx.ProtocolExtensionID = ProtocolExtensionID;
return (dissector_try_uint_new(s1ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, TRUE, &s1ap_ctx)) ? tvb_captured_length(tvb) : 0;
}
/* Currently not used
static int dissect_ProtocolIEFieldPairFirstValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
@ -10493,22 +10500,29 @@ static int dissect_ProtocolIEFieldPairSecondValue(tvbuff_t *tvb, packet_info *pi
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
return (dissector_try_uint(s1ap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
s1ap_ctx_t s1ap_ctx;
s1ap_ctx.message_type = message_type;
s1ap_ctx.ProcedureCode = ProcedureCode;
s1ap_ctx.ProtocolIE_ID = ProtocolIE_ID;
s1ap_ctx.ProtocolExtensionID = ProtocolExtensionID;
return (dissector_try_uint_new(s1ap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree, TRUE, &s1ap_ctx)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
return (dissector_try_uint(s1ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
return (dissector_try_uint_new(s1ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree, TRUE, data)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
return (dissector_try_uint(s1ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
return (dissector_try_uint_new(s1ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree, TRUE, data)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
return (dissector_try_uint(s1ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
return (dissector_try_uint_new(s1ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, TRUE, data)) ? tvb_captured_length(tvb) : 0;
}
@ -10796,7 +10810,7 @@ proto_reg_handoff_s1ap(void)
/*--- End of included file: packet-s1ap-dis-tab.c ---*/
#line 209 "../../asn1/s1ap/packet-s1ap-template.c"
#line 223 "../../asn1/s1ap/packet-s1ap-template.c"
} else {
if (SctpPort != 0) {
dissector_delete_uint("sctp.port", SctpPort, s1ap_handle);
@ -13013,7 +13027,7 @@ void proto_register_s1ap(void) {
NULL, HFILL }},
/*--- End of included file: packet-s1ap-hfarr.c ---*/
#line 237 "../../asn1/s1ap/packet-s1ap-template.c"
#line 251 "../../asn1/s1ap/packet-s1ap-template.c"
};
/* List of subtrees */
@ -13303,7 +13317,7 @@ void proto_register_s1ap(void) {
&ett_s1ap_EHRPDMultiSectorLoadReportingResponseItem,
/*--- End of included file: packet-s1ap-ettarr.c ---*/
#line 250 "../../asn1/s1ap/packet-s1ap-template.c"
#line 264 "../../asn1/s1ap/packet-s1ap-template.c"
};
module_t *s1ap_module;

View File

@ -31,6 +31,14 @@
#ifndef PACKET_S1AP_H
#define PACKET_S1AP_H
typedef struct _s1ap_ctx_t {
guint32 message_type;
guint32 ProcedureCode;
guint32 ProtocolIE_ID;
guint32 ProtocolExtensionID;
} s1ap_ctx_t;
/*--- Included file: packet-s1ap-exp.h ---*/
#line 1 "../../asn1/s1ap/packet-s1ap-exp.h"
@ -52,6 +60,6 @@ int dissect_s1ap_SONtransferResponseContainer_PDU(tvbuff_t *tvb _U_, packet_info
int dissect_s1ap_SONtransferCause_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_);
/*--- End of included file: packet-s1ap-exp.h ---*/
#line 27 "../../asn1/s1ap/packet-s1ap-template.h"
#line 35 "../../asn1/s1ap/packet-s1ap-template.h"
#endif /* PACKET_S1AP_H */