2007-12-16 13:34:33 +00:00
/* packet-s1ap.c
2008-01-03 14:35:45 +00:00
* Routines for E - UTRAN S1 Application Protocol ( S1AP ) packet dissection
2016-09-03 17:59:26 +00:00
* Copyright 2007 - 2016 , Anders Broman < anders . broman @ ericsson . com >
2007-12-16 13:34:33 +00:00
*
* Wireshark - Network traffic analyzer
* By Gerald Combs < gerald @ wireshark . org >
* Copyright 1998 Gerald Combs
*
* This program is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation ; either version 2
* of the License , or ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
2012-06-28 22:56:06 +00:00
* Foundation , Inc . , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 USA .
2007-12-16 13:34:33 +00:00
*
* Based on the RANAP dissector
*
2016-09-03 17:59:26 +00:00
* References : 3 GPP TS 36.413 V13 .3 .0 ( 2016 - 06 )
2007-12-16 13:34:33 +00:00
*/
2012-09-20 01:29:52 +00:00
# include "config.h"
2007-12-16 13:34:33 +00:00
# include <epan/packet.h>
# include <epan/strutil.h>
# include <epan/asn1.h>
2008-06-20 16:20:10 +00:00
# include <epan/prefs.h>
2009-03-03 18:25:25 +00:00
# include <epan/sctpppids.h>
2016-09-09 21:37:46 +00:00
# include <epan/expert.h>
2007-12-16 13:34:33 +00:00
# include "packet-ber.h"
# include "packet-per.h"
# include "packet-e212.h"
# include "packet-sccp.h"
2009-11-08 19:59:21 +00:00
# include "packet-lte-rrc.h"
2011-12-08 19:32:51 +00:00
# include "packet-ranap.h"
2011-12-08 21:17:03 +00:00
# include "packet-bssgp.h"
# include "packet-s1ap.h"
2014-11-14 13:53:02 +00:00
# include "packet-a21.h"
2016-09-09 21:37:46 +00:00
# include "packet-gsm_map.h"
# include "packet-cell_broadcast.h"
# include "packet-gsm_a_common.h"
2007-12-16 13:34:33 +00:00
2009-07-07 11:37:15 +00:00
# define PNAME "S1 Application Protocol"
2007-12-16 13:34:33 +00:00
# define PSNAME "S1AP"
# define PFNAME "s1ap"
2010-03-31 08:51:29 +00:00
/* Dissector will use SCTP PPID 18 or SCTP port. IANA assigned port = 36412 */
2016-07-26 10:08:20 +00:00
# define SCTP_PORT_S1AP 36412
2008-06-20 16:20:10 +00:00
2013-03-28 07:34:13 +00:00
void proto_register_s1ap ( void ) ;
void proto_reg_handoff_s1ap ( void ) ;
2009-01-13 18:34:49 +00:00
static dissector_handle_t nas_eps_handle ;
2011-10-23 18:05:07 +00:00
static dissector_handle_t lppa_handle ;
2011-11-04 17:37:38 +00:00
static dissector_handle_t bssgp_handle ;
2008-11-16 12:35:42 +00:00
2007-12-16 13:34:33 +00:00
# include "packet-s1ap-val.h"
/* Initialize the protocol and registered fields */
static int proto_s1ap = - 1 ;
2009-03-23 17:31:50 +00:00
static int hf_s1ap_transportLayerAddressIPv4 = - 1 ;
static int hf_s1ap_transportLayerAddressIPv6 = - 1 ;
2016-09-09 21:37:46 +00:00
static int hf_s1ap_E_UTRAN_Trace_ID_TraceID = - 1 ;
static int hf_s1ap_E_UTRAN_Trace_ID_TraceRecordingSessionReference = - 1 ;
static int hf_s1ap_interfacesToTrace_S1_MME = - 1 ;
static int hf_s1ap_interfacesToTrace_X2 = - 1 ;
static int hf_s1ap_interfacesToTrace_Uu = - 1 ;
static int hf_s1ap_interfacesToTrace_Reserved = - 1 ;
static int hf_s1ap_encryptionAlgorithms_EEA1 = - 1 ;
static int hf_s1ap_encryptionAlgorithms_EEA2 = - 1 ;
static int hf_s1ap_encryptionAlgorithms_EEA3 = - 1 ;
static int hf_s1ap_encryptionAlgorithms_Reserved = - 1 ;
static int hf_s1ap_integrityProtectionAlgorithms_EIA1 = - 1 ;
static int hf_s1ap_integrityProtectionAlgorithms_EIA2 = - 1 ;
static int hf_s1ap_integrityProtectionAlgorithms_EIA3 = - 1 ;
static int hf_s1ap_integrityProtectionAlgorithms_Reserved = - 1 ;
static int hf_s1ap_SerialNumber_gs = - 1 ;
static int hf_s1ap_SerialNumber_msg_code = - 1 ;
static int hf_s1ap_SerialNumber_upd_nb = - 1 ;
static int hf_s1ap_WarningType_value = - 1 ;
static int hf_s1ap_WarningType_emergency_user_alert = - 1 ;
static int hf_s1ap_WarningType_popup = - 1 ;
static int hf_s1ap_WarningMessageContents_nb_pages = - 1 ;
static int hf_s1ap_WarningMessageContents_decoded_page = - 1 ;
static int hf_s1ap_measurementsToActivate_M1 = - 1 ;
static int hf_s1ap_measurementsToActivate_M2 = - 1 ;
static int hf_s1ap_measurementsToActivate_M3 = - 1 ;
static int hf_s1ap_measurementsToActivate_M4 = - 1 ;
static int hf_s1ap_measurementsToActivate_M5 = - 1 ;
static int hf_s1ap_measurementsToActivate_LoggingM1FromEventTriggered = - 1 ;
static int hf_s1ap_measurementsToActivate_M6 = - 1 ;
static int hf_s1ap_measurementsToActivate_M7 = - 1 ;
static int hf_s1ap_MDT_Location_Info_GNSS = - 1 ;
static int hf_s1ap_MDT_Location_Info_E_CID = - 1 ;
static int hf_s1ap_MDT_Location_Info_Reserved = - 1 ;
2007-12-16 13:34:33 +00:00
# include "packet-s1ap-hf.c"
/* Initialize the subtree pointers */
static int ett_s1ap = - 1 ;
2009-03-23 17:31:50 +00:00
static int ett_s1ap_TransportLayerAddress = - 1 ;
2009-11-08 19:59:21 +00:00
static int ett_s1ap_ToTargetTransparentContainer = - 1 ;
static int ett_s1ap_ToSourceTransparentContainer = - 1 ;
static int ett_s1ap_RRCContainer = - 1 ;
2010-06-23 04:50:52 +00:00
static int ett_s1ap_UERadioCapability = - 1 ;
2011-11-04 17:37:38 +00:00
static int ett_s1ap_RIMInformation = - 1 ;
2014-10-17 11:57:56 +00:00
static int ett_s1ap_Cdma2000PDU = - 1 ;
2014-11-14 13:53:02 +00:00
static int ett_s1ap_Cdma2000SectorID = - 1 ;
2016-07-25 09:34:22 +00:00
static int ett_s1ap_UERadioPagingInformation = - 1 ;
2016-09-03 17:59:26 +00:00
static int ett_s1ap_UE_HistoryInformationFromTheUE = - 1 ;
static int ett_s1ap_CELevel = - 1 ;
static int ett_s1ap_UE_RLF_Report_Container = - 1 ;
static int ett_s1ap_UE_RLF_Report_Container_for_extended_bands = - 1 ;
2016-09-09 21:37:46 +00:00
static int ett_s1ap_S1_Message = - 1 ;
static int ett_s1ap_E_UTRAN_Trace_ID = - 1 ;
static int ett_s1ap_InterfacesToTrace = - 1 ;
static int ett_s1ap_EncryptionAlgorithms = - 1 ;
static int ett_s1ap_IntegrityProtectionAlgorithms = - 1 ;
static int ett_s1ap_LastVisitedUTRANCellInformation = - 1 ;
static int ett_s1ap_SerialNumber = - 1 ;
static int ett_s1ap_WarningType = - 1 ;
static int ett_s1ap_DataCodingScheme = - 1 ;
static int ett_s1ap_WarningMessageContents = - 1 ;
static int ett_s1ap_MSClassmark = - 1 ;
static int ett_s1ap_MeasurementsToActivate = - 1 ;
static int ett_s1ap_MDT_Location_Info = - 1 ;
static int ett_s1ap_IMSI = - 1 ;
static int ett_s1ap_NASSecurityParameters = - 1 ;
2007-12-16 13:34:33 +00:00
# include "packet-s1ap-ett.c"
2016-09-09 21:37:46 +00:00
static expert_field ei_s1ap_number_pages_le15 = EI_INIT ;
2009-11-08 19:59:21 +00:00
enum {
2016-07-26 10:08:20 +00:00
INITIATING_MESSAGE ,
SUCCESSFUL_OUTCOME ,
UNSUCCESSFUL_OUTCOME
2009-11-08 19:59:21 +00:00
} ;
2007-12-16 13:34:33 +00:00
/* Global variables */
static guint32 ProcedureCode ;
static guint32 ProtocolIE_ID ;
static guint32 ProtocolExtensionID ;
2008-06-20 16:20:10 +00:00
static guint gbl_s1apSctpPort = SCTP_PORT_S1AP ;
2009-11-05 20:34:56 +00:00
static guint32 handover_type_value ;
2009-11-08 19:59:21 +00:00
static guint32 message_type ;
2012-02-09 22:17:42 +00:00
static gboolean g_s1ap_dissect_container = TRUE ;
2014-10-21 09:00:40 +00:00
static const char * obj_id = NULL ;
2016-09-09 21:37:46 +00:00
static guint8 dataCodingScheme = SMS_ENCODING_NOT_SET ;
2007-12-16 13:34:33 +00:00
2014-10-17 11:57:56 +00:00
static dissector_handle_t gcsna_handle = NULL ;
2016-07-01 00:41:45 +00:00
static dissector_handle_t s1ap_handle ;
2014-10-17 11:57:56 +00:00
2007-12-16 13:34:33 +00:00
/* Dissector tables */
static dissector_table_t s1ap_ies_dissector_table ;
static dissector_table_t s1ap_ies_p1_dissector_table ;
static dissector_table_t s1ap_ies_p2_dissector_table ;
static dissector_table_t s1ap_extension_dissector_table ;
static dissector_table_t s1ap_proc_imsg_dissector_table ;
static dissector_table_t s1ap_proc_sout_dissector_table ;
static dissector_table_t s1ap_proc_uout_dissector_table ;
2012-09-10 21:40:21 +00:00
static int dissect_ProtocolIEFieldValue ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * ) ;
2008-10-14 19:07:26 +00:00
/* Currently not used
2007-12-16 13:34:33 +00:00
static int dissect_ProtocolIEFieldPairFirstValue ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree ) ;
static int dissect_ProtocolIEFieldPairSecondValue ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree ) ;
2008-10-14 19:07:26 +00:00
*/
2012-09-10 21:40:21 +00:00
static int dissect_ProtocolExtensionFieldExtensionValue ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * ) ;
static int dissect_InitiatingMessageValue ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * ) ;
static int dissect_SuccessfulOutcomeValue ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * ) ;
static int dissect_UnsuccessfulOutcomeValue ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * ) ;
2007-12-16 13:34:33 +00:00
2012-09-10 21:40:21 +00:00
static int dissect_SourceeNB_ToTargeteNB_TransparentContainer_PDU ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * ) ;
static int dissect_TargeteNB_ToSourceeNB_TransparentContainer_PDU ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * ) ;
2016-09-09 21:37:46 +00:00
static int dissect_InitialUEMessage_PDU ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , void * data ) ;
2011-12-09 03:00:56 +00:00
#if 0
2009-11-08 19:59:21 +00:00
static int dissect_SourceRNC_ToTargetRNC_TransparentContainer_PDU ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree ) ;
static int dissect_TargetRNC_ToSourceRNC_TransparentContainer_PDU ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree ) ;
static int dissect_SourceBSS_ToTargetBSS_TransparentContainer_PDU ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree ) ;
static int dissect_TargetBSS_ToSourceBSS_TransparentContainer_PDU ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree ) ;
2011-12-09 03:00:56 +00:00
# endif
2009-11-05 20:34:56 +00:00
2016-09-03 17:59:26 +00:00
static void
s1ap_Threshold_RSRP_fmt ( gchar * s , guint32 v )
{
g_snprintf ( s , ITEM_LABEL_LENGTH , " %ddBm (%u) " , ( gint32 ) v - 140 , v ) ;
}
static void
s1ap_Threshold_RSRQ_fmt ( gchar * s , guint32 v )
{
g_snprintf ( s , ITEM_LABEL_LENGTH , " %.1fdB (%u) " , ( ( float ) v / 2 ) - 20 , v ) ;
}
2016-09-09 21:37:46 +00:00
static const true_false_string s1ap_tfs_interfacesToTrace = {
" Should be traced " ,
" Should not be traced "
} ;
static void
s1ap_Time_UE_StayedInCell_EnhancedGranularity_fmt ( gchar * s , guint32 v )
{
g_snprintf ( s , ITEM_LABEL_LENGTH , " %.1fs " , ( ( float ) v ) / 10 ) ;
}
static const value_string s1ap_serialNumber_gs_vals [ ] = {
{ 0 , " Display mode immediate, cell wide " } ,
{ 1 , " Display mode normal, PLMN wide " } ,
{ 2 , " Display mode normal, tracking area wide " } ,
{ 3 , " Display mode normal, cell wide " } ,
{ 0 , NULL } ,
} ;
static const value_string s1ap_warningType_vals [ ] = {
{ 0 , " Earthquake " } ,
{ 1 , " Tsunami " } ,
{ 2 , " Earthquake and Tsunami " } ,
{ 3 , " Test " } ,
{ 4 , " Other " } ,
{ 0 , NULL } ,
} ;
static void
dissect_s1ap_warningMessageContents ( tvbuff_t * warning_msg_tvb , proto_tree * tree , packet_info * pinfo , guint8 dcs )
{
guint32 offset ;
guint8 nb_of_pages , length , * str ;
proto_item * ti ;
tvbuff_t * cb_data_page_tvb , * cb_data_tvb ;
int i ;
nb_of_pages = tvb_get_guint8 ( warning_msg_tvb , 0 ) ;
ti = proto_tree_add_uint ( tree , hf_s1ap_WarningMessageContents_nb_pages , warning_msg_tvb , 0 , 1 , nb_of_pages ) ;
if ( nb_of_pages > 15 ) {
expert_add_info_format ( pinfo , ti , & ei_s1ap_number_pages_le15 ,
" Number of pages should be <=15 (found %u) " , nb_of_pages ) ;
nb_of_pages = 15 ;
}
for ( i = 0 , offset = 1 ; i < nb_of_pages ; i + + ) {
length = tvb_get_guint8 ( warning_msg_tvb , offset + 82 ) ;
cb_data_page_tvb = tvb_new_subset_length ( warning_msg_tvb , offset , length ) ;
cb_data_tvb = dissect_cbs_data ( dcs , cb_data_page_tvb , tree , pinfo , 0 ) ;
if ( cb_data_tvb ) {
str = tvb_get_string_enc ( wmem_packet_scope ( ) , cb_data_tvb , 0 , tvb_reported_length ( cb_data_tvb ) , ENC_UTF_8 | ENC_NA ) ;
proto_tree_add_string_format ( tree , hf_s1ap_WarningMessageContents_decoded_page , warning_msg_tvb , offset , 83 ,
str , " Decoded Page %u: %s " , i + 1 , str ) ;
}
offset + = 83 ;
}
}
static void
s1ap_EUTRANRoundTripDelayEstimationInfo_fmt ( gchar * s , guint32 v )
{
g_snprintf ( s , ITEM_LABEL_LENGTH , " %uTs (%u) " , 16 * v , v ) ;
}
static const true_false_string s1ap_tfs_activate_do_not_activate = {
" Activate " ,
" Do not activate "
} ;
2007-12-16 13:34:33 +00:00
# include "packet-s1ap-fn.c"
2012-09-10 21:40:21 +00:00
static int dissect_ProtocolIEFieldValue ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * data _U_ )
2007-12-16 13:34:33 +00:00
{
2014-10-22 14:14:03 +00:00
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 ;
2007-12-16 13:34:33 +00:00
}
2008-10-14 19:07:26 +00:00
/* Currently not used
2007-12-16 13:34:33 +00:00
static int dissect_ProtocolIEFieldPairFirstValue ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree )
{
2014-06-21 00:36:59 +00:00
return ( dissector_try_uint ( s1ap_ies_p1_dissector_table , ProtocolIE_ID , tvb , pinfo , tree ) ) ? tvb_captured_length ( tvb ) : 0 ;
2007-12-16 13:34:33 +00:00
}
static int dissect_ProtocolIEFieldPairSecondValue ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree )
{
2014-06-21 00:36:59 +00:00
return ( dissector_try_uint ( s1ap_ies_p2_dissector_table , ProtocolIE_ID , tvb , pinfo , tree ) ) ? tvb_captured_length ( tvb ) : 0 ;
2007-12-16 13:34:33 +00:00
}
2008-10-14 19:07:26 +00:00
*/
2007-12-16 13:34:33 +00:00
2012-09-10 21:40:21 +00:00
static int dissect_ProtocolExtensionFieldExtensionValue ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * data _U_ )
2007-12-16 13:34:33 +00:00
{
2014-10-22 14:14:03 +00:00
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 ;
2007-12-16 13:34:33 +00:00
}
2014-10-22 14:14:03 +00:00
static int dissect_InitiatingMessageValue ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * data )
2007-12-16 13:34:33 +00:00
{
2014-10-22 14:14:03 +00:00
return ( dissector_try_uint_new ( s1ap_proc_imsg_dissector_table , ProcedureCode , tvb , pinfo , tree , TRUE , data ) ) ? tvb_captured_length ( tvb ) : 0 ;
2007-12-16 13:34:33 +00:00
}
2014-10-22 14:14:03 +00:00
static int dissect_SuccessfulOutcomeValue ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * data )
2007-12-16 13:34:33 +00:00
{
2014-10-22 14:14:03 +00:00
return ( dissector_try_uint_new ( s1ap_proc_sout_dissector_table , ProcedureCode , tvb , pinfo , tree , TRUE , data ) ) ? tvb_captured_length ( tvb ) : 0 ;
2007-12-16 13:34:33 +00:00
}
2014-10-22 14:14:03 +00:00
static int dissect_UnsuccessfulOutcomeValue ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * data )
2007-12-16 13:34:33 +00:00
{
2014-10-22 14:14:03 +00:00
return ( dissector_try_uint_new ( s1ap_proc_uout_dissector_table , ProcedureCode , tvb , pinfo , tree , TRUE , data ) ) ? tvb_captured_length ( tvb ) : 0 ;
2007-12-16 13:34:33 +00:00
}
2015-11-22 03:03:26 +00:00
static int
dissect_s1ap ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * data _U_ )
2007-12-16 13:34:33 +00:00
{
2016-07-26 10:08:20 +00:00
proto_item * s1ap_item = NULL ;
proto_tree * s1ap_tree = NULL ;
2007-12-16 13:34:33 +00:00
2016-07-26 10:08:20 +00:00
/* make entry in the Protocol column on summary display */
col_set_str ( pinfo - > cinfo , COL_PROTOCOL , " S1AP " ) ;
2016-09-13 20:36:30 +00:00
col_clear_fence ( pinfo - > cinfo , COL_INFO ) ;
col_clear ( pinfo - > cinfo , COL_INFO ) ;
2007-12-16 13:34:33 +00:00
2016-07-26 10:08:20 +00:00
/* create the s1ap protocol tree */
s1ap_item = proto_tree_add_item ( tree , proto_s1ap , tvb , 0 , - 1 , ENC_NA ) ;
s1ap_tree = proto_item_add_subtree ( s1ap_item , ett_s1ap ) ;
2011-10-21 02:10:19 +00:00
2016-07-26 10:08:20 +00:00
dissect_S1AP_PDU_PDU ( tvb , pinfo , s1ap_tree , NULL ) ;
return tvb_captured_length ( tvb ) ;
2007-12-16 13:34:33 +00:00
}
2008-06-20 16:20:10 +00:00
/*--- proto_reg_handoff_s1ap ---------------------------------------*/
void
proto_reg_handoff_s1ap ( void )
{
2016-07-26 10:08:20 +00:00
static gboolean Initialized = FALSE ;
static guint SctpPort ;
gcsna_handle = find_dissector_add_dependency ( " gcsna " , proto_s1ap ) ;
if ( ! Initialized ) {
nas_eps_handle = find_dissector_add_dependency ( " nas-eps " , proto_s1ap ) ;
lppa_handle = find_dissector_add_dependency ( " lppa " , proto_s1ap ) ;
bssgp_handle = find_dissector_add_dependency ( " bssgp " , proto_s1ap ) ;
dissector_add_for_decode_as ( " sctp.port " , s1ap_handle ) ;
dissector_add_uint ( " sctp.ppi " , S1AP_PAYLOAD_PROTOCOL_ID , s1ap_handle ) ;
Initialized = TRUE ;
2008-11-04 22:01:35 +00:00
# include "packet-s1ap-dis-tab.c"
2016-07-26 10:08:20 +00:00
} else {
if ( SctpPort ! = 0 ) {
dissector_delete_uint ( " sctp.port " , SctpPort , s1ap_handle ) ;
}
}
SctpPort = gbl_s1apSctpPort ;
if ( SctpPort ! = 0 ) {
dissector_add_uint ( " sctp.port " , SctpPort , s1ap_handle ) ;
}
2008-06-20 16:20:10 +00:00
}
2007-12-16 13:34:33 +00:00
/*--- proto_register_s1ap -------------------------------------------*/
void proto_register_s1ap ( void ) {
/* List of fields */
static hf_register_info hf [ ] = {
2009-03-23 17:31:50 +00:00
{ & hf_s1ap_transportLayerAddressIPv4 ,
{ " transportLayerAddress(IPv4) " , " s1ap.transportLayerAddressIPv4 " ,
2009-06-23 06:02:12 +00:00
FT_IPv4 , BASE_NONE , NULL , 0 ,
2009-03-23 17:31:50 +00:00
NULL , HFILL } } ,
{ & hf_s1ap_transportLayerAddressIPv6 ,
{ " transportLayerAddress(IPv6) " , " s1ap.transportLayerAddressIPv6 " ,
2011-10-06 19:07:26 +00:00
FT_IPv6 , BASE_NONE , NULL , 0 ,
2009-03-23 17:31:50 +00:00
NULL , HFILL } } ,
2016-09-09 21:37:46 +00:00
{ & hf_s1ap_E_UTRAN_Trace_ID_TraceID ,
{ " TraceID " , " s1ap.E_UTRAN_Trace_ID.TraceID " ,
FT_UINT24 , BASE_HEX , NULL , 0 ,
NULL , HFILL } } ,
{ & hf_s1ap_E_UTRAN_Trace_ID_TraceRecordingSessionReference ,
{ " TraceRecordingSessionReference " , " s1ap.E_UTRAN_Trace_ID.TraceRecordingSessionReference " ,
FT_UINT16 , BASE_HEX , NULL , 0 ,
NULL , HFILL } } ,
{ & hf_s1ap_interfacesToTrace_S1_MME ,
{ " S1-MME " , " s1ap.interfacesToTrace.S1_MME " ,
FT_BOOLEAN , 8 , TFS ( & s1ap_tfs_interfacesToTrace ) , 0x80 ,
NULL , HFILL } } ,
{ & hf_s1ap_interfacesToTrace_X2 ,
{ " X2 " , " s1ap.interfacesToTrace.X2 " ,
FT_BOOLEAN , 8 , TFS ( & s1ap_tfs_interfacesToTrace ) , 0x40 ,
NULL , HFILL } } ,
{ & hf_s1ap_interfacesToTrace_Uu ,
{ " Uu " , " s1ap.interfacesToTrace.Uu " ,
FT_BOOLEAN , 8 , TFS ( & s1ap_tfs_interfacesToTrace ) , 0x20 ,
NULL , HFILL } } ,
{ & hf_s1ap_interfacesToTrace_Reserved ,
{ " Reserved " , " s1ap.interfacesToTrace.Reserved " ,
FT_UINT8 , BASE_HEX , NULL , 0x1f ,
NULL , HFILL } } ,
{ & hf_s1ap_encryptionAlgorithms_EEA1 ,
{ " 128-EEA1 " , " s1ap.encryptionAlgorithms.EEA1 " ,
FT_BOOLEAN , 16 , TFS ( & tfs_supported_not_supported ) , 0x8000 ,
NULL , HFILL } } ,
{ & hf_s1ap_encryptionAlgorithms_EEA2 ,
{ " 128-EEA2 " , " s1ap.encryptionAlgorithms.EEA2 " ,
FT_BOOLEAN , 16 , TFS ( & tfs_supported_not_supported ) , 0x4000 ,
NULL , HFILL } } ,
{ & hf_s1ap_encryptionAlgorithms_EEA3 ,
{ " 128-EEA3 " , " s1ap.encryptionAlgorithms.EEA3 " ,
FT_BOOLEAN , 16 , TFS ( & tfs_supported_not_supported ) , 0x2000 ,
NULL , HFILL } } ,
{ & hf_s1ap_encryptionAlgorithms_Reserved ,
{ " Reserved " , " s1ap.encryptionAlgorithms.Reserved " ,
FT_UINT16 , BASE_HEX , NULL , 0x1fff ,
NULL , HFILL } } ,
{ & hf_s1ap_integrityProtectionAlgorithms_EIA1 ,
{ " 128-EIA1 " , " s1ap.integrityProtectionAlgorithms.EIA1 " ,
FT_BOOLEAN , 16 , TFS ( & tfs_supported_not_supported ) , 0x8000 ,
NULL , HFILL } } ,
{ & hf_s1ap_integrityProtectionAlgorithms_EIA2 ,
{ " 128-EIA2 " , " s1ap.integrityProtectionAlgorithms.EIA2 " ,
FT_BOOLEAN , 16 , TFS ( & tfs_supported_not_supported ) , 0x4000 ,
NULL , HFILL } } ,
{ & hf_s1ap_integrityProtectionAlgorithms_EIA3 ,
{ " 128-EIA3 " , " s1ap.integrityProtectionAlgorithms.EIA3 " ,
FT_BOOLEAN , 16 , TFS ( & tfs_supported_not_supported ) , 0x2000 ,
NULL , HFILL } } ,
{ & hf_s1ap_integrityProtectionAlgorithms_Reserved ,
{ " Reserved " , " s1ap.integrityProtectionAlgorithms.Reserved " ,
FT_UINT16 , BASE_HEX , NULL , 0x1fff ,
NULL , HFILL } } ,
{ & hf_s1ap_SerialNumber_gs ,
{ " Geographical Scope " , " s1ap.SerialNumber.gs " ,
FT_UINT16 , BASE_DEC , VALS ( s1ap_serialNumber_gs_vals ) , 0xc000 ,
NULL , HFILL } } ,
{ & hf_s1ap_SerialNumber_msg_code ,
{ " Message Code " , " s1ap.SerialNumber.msg_code " ,
FT_UINT16 , BASE_DEC , NULL , 0x3ff0 ,
NULL , HFILL } } ,
{ & hf_s1ap_SerialNumber_upd_nb ,
{ " Update Number " , " s1ap.SerialNumber.upd_nb " ,
FT_UINT16 , BASE_DEC , NULL , 0x000f ,
NULL , HFILL } } ,
{ & hf_s1ap_WarningType_value ,
{ " Warning Type Value " , " s1ap.WarningType.value " ,
FT_UINT16 , BASE_DEC , VALS ( s1ap_warningType_vals ) , 0xfe00 ,
NULL , HFILL } } ,
{ & hf_s1ap_WarningType_emergency_user_alert ,
{ " Emergency User Alert " , " s1ap.WarningType.emergency_user_alert " ,
FT_BOOLEAN , 16 , TFS ( & tfs_yes_no ) , 0x0100 ,
NULL , HFILL } } ,
{ & hf_s1ap_WarningType_popup ,
{ " Popup " , " s1ap.WarningType.popup " ,
FT_BOOLEAN , 16 , TFS ( & tfs_yes_no ) , 0x0080 ,
NULL , HFILL } } ,
{ & hf_s1ap_WarningMessageContents_nb_pages ,
{ " Number of Pages " , " s1ap.WarningMessageContents.nb_pages " ,
FT_UINT8 , BASE_DEC , NULL , 0 ,
NULL , HFILL } } ,
{ & hf_s1ap_WarningMessageContents_decoded_page ,
{ " Decoded Page " , " lte-rrc.WarningMessageContents.decoded_page " ,
FT_STRING , STR_UNICODE , NULL , 0 ,
NULL , HFILL } } ,
{ & hf_s1ap_measurementsToActivate_M1 ,
{ " M1 " , " s1ap.measurementsToActivate.M1 " ,
FT_BOOLEAN , 8 , TFS ( & s1ap_tfs_activate_do_not_activate ) , 0x80 ,
NULL , HFILL } } ,
{ & hf_s1ap_measurementsToActivate_M2 ,
{ " M2 " , " s1ap.measurementsToActivate.M2 " ,
FT_BOOLEAN , 8 , TFS ( & s1ap_tfs_activate_do_not_activate ) , 0x40 ,
NULL , HFILL } } ,
{ & hf_s1ap_measurementsToActivate_M3 ,
{ " M3 " , " s1ap.measurementsToActivate.M3 " ,
FT_BOOLEAN , 8 , TFS ( & s1ap_tfs_activate_do_not_activate ) , 0x20 ,
NULL , HFILL } } ,
{ & hf_s1ap_measurementsToActivate_M4 ,
{ " M4 " , " s1ap.measurementsToActivate.M4 " ,
FT_BOOLEAN , 8 , TFS ( & s1ap_tfs_activate_do_not_activate ) , 0x10 ,
NULL , HFILL } } ,
{ & hf_s1ap_measurementsToActivate_M5 ,
{ " M5 " , " s1ap.measurementsToActivate.M5 " ,
FT_BOOLEAN , 8 , TFS ( & s1ap_tfs_activate_do_not_activate ) , 0x08 ,
NULL , HFILL } } ,
{ & hf_s1ap_measurementsToActivate_LoggingM1FromEventTriggered ,
{ " LoggingOfM1FromEventTriggeredMeasurementReports " , " s1ap.measurementsToActivate.LoggingM1FromEventTriggered " ,
FT_BOOLEAN , 8 , TFS ( & s1ap_tfs_activate_do_not_activate ) , 0x04 ,
NULL , HFILL } } ,
{ & hf_s1ap_measurementsToActivate_M6 ,
{ " M6 " , " s1ap.measurementsToActivate.M6 " ,
FT_BOOLEAN , 8 , TFS ( & s1ap_tfs_activate_do_not_activate ) , 0x02 ,
NULL , HFILL } } ,
{ & hf_s1ap_measurementsToActivate_M7 ,
{ " M7 " , " s1ap.measurementsToActivate.M7 " ,
FT_BOOLEAN , 8 , TFS ( & s1ap_tfs_activate_do_not_activate ) , 0x01 ,
NULL , HFILL } } ,
{ & hf_s1ap_MDT_Location_Info_GNSS ,
{ " GNSS " , " s1ap.MDT_Location_Info.GNSS " ,
FT_BOOLEAN , 8 , TFS ( & s1ap_tfs_activate_do_not_activate ) , 0x80 ,
NULL , HFILL } } ,
{ & hf_s1ap_MDT_Location_Info_E_CID ,
{ " E-CID " , " s1ap.MDT_Location_Info.E_CID " ,
FT_BOOLEAN , 8 , TFS ( & s1ap_tfs_activate_do_not_activate ) , 0x40 ,
NULL , HFILL } } ,
{ & hf_s1ap_MDT_Location_Info_Reserved ,
{ " Reserved " , " s1ap.MDT_Location_Info.Reserved " ,
FT_UINT8 , BASE_HEX , NULL , 0x3f ,
NULL , HFILL } } ,
2007-12-16 13:34:33 +00:00
# include "packet-s1ap-hfarr.c"
} ;
/* List of subtrees */
static gint * ett [ ] = {
2016-07-26 10:08:20 +00:00
& ett_s1ap ,
& ett_s1ap_TransportLayerAddress ,
& ett_s1ap_ToTargetTransparentContainer ,
& ett_s1ap_ToSourceTransparentContainer ,
& ett_s1ap_RRCContainer ,
& ett_s1ap_UERadioCapability ,
& ett_s1ap_RIMInformation ,
& ett_s1ap_Cdma2000PDU ,
& ett_s1ap_Cdma2000SectorID ,
& ett_s1ap_UERadioPagingInformation ,
2016-09-03 17:59:26 +00:00
& ett_s1ap_UE_HistoryInformationFromTheUE ,
& ett_s1ap_CELevel ,
& ett_s1ap_UE_RLF_Report_Container ,
& ett_s1ap_UE_RLF_Report_Container_for_extended_bands ,
2016-09-09 21:37:46 +00:00
& ett_s1ap_S1_Message ,
& ett_s1ap_E_UTRAN_Trace_ID ,
& ett_s1ap_InterfacesToTrace ,
& ett_s1ap_EncryptionAlgorithms ,
& ett_s1ap_IntegrityProtectionAlgorithms ,
& ett_s1ap_LastVisitedUTRANCellInformation ,
& ett_s1ap_SerialNumber ,
& ett_s1ap_WarningType ,
& ett_s1ap_DataCodingScheme ,
& ett_s1ap_WarningMessageContents ,
& ett_s1ap_MSClassmark ,
& ett_s1ap_MeasurementsToActivate ,
& ett_s1ap_MDT_Location_Info ,
& ett_s1ap_IMSI ,
& ett_s1ap_NASSecurityParameters ,
2007-12-16 13:34:33 +00:00
# include "packet-s1ap-ettarr.c"
} ;
2016-09-09 21:37:46 +00:00
static ei_register_info ei [ ] = {
{ & ei_s1ap_number_pages_le15 , { " s1ap.number_pages_le15 " , PI_MALFORMED , PI_ERROR , " Number of pages should be <=15 " , EXPFILL } }
} ;
2008-06-20 16:20:10 +00:00
module_t * s1ap_module ;
2016-09-09 21:37:46 +00:00
expert_module_t * expert_s1ap ;
2007-12-16 13:34:33 +00:00
/* Register protocol */
proto_s1ap = proto_register_protocol ( PNAME , PSNAME , PFNAME ) ;
/* Register fields and subtrees */
proto_register_field_array ( proto_s1ap , hf , array_length ( hf ) ) ;
proto_register_subtree_array ( ett , array_length ( ett ) ) ;
2016-09-09 21:37:46 +00:00
expert_s1ap = expert_register_protocol ( proto_s1ap ) ;
expert_register_field_array ( expert_s1ap , ei , array_length ( ei ) ) ;
2011-10-21 02:10:19 +00:00
2007-12-16 13:34:33 +00:00
/* Register dissector */
2016-07-01 00:41:45 +00:00
s1ap_handle = register_dissector ( " s1ap " , dissect_s1ap , proto_s1ap ) ;
2007-12-16 13:34:33 +00:00
/* Register dissector tables */
2016-08-30 22:51:54 +00:00
s1ap_ies_dissector_table = register_dissector_table ( " s1ap.ies " , " S1AP-PROTOCOL-IES " , proto_s1ap , FT_UINT32 , BASE_DEC ) ;
s1ap_ies_p1_dissector_table = register_dissector_table ( " s1ap.ies.pair.first " , " S1AP-PROTOCOL-IES-PAIR FirstValue " , proto_s1ap , FT_UINT32 , BASE_DEC ) ;
s1ap_ies_p2_dissector_table = register_dissector_table ( " s1ap.ies.pair.second " , " S1AP-PROTOCOL-IES-PAIR SecondValue " , proto_s1ap , FT_UINT32 , BASE_DEC ) ;
s1ap_extension_dissector_table = register_dissector_table ( " s1ap.extension " , " S1AP-PROTOCOL-EXTENSION " , proto_s1ap , FT_UINT32 , BASE_DEC ) ;
s1ap_proc_imsg_dissector_table = register_dissector_table ( " s1ap.proc.imsg " , " S1AP-ELEMENTARY-PROCEDURE InitiatingMessage " , proto_s1ap , FT_UINT32 , BASE_DEC ) ;
s1ap_proc_sout_dissector_table = register_dissector_table ( " s1ap.proc.sout " , " S1AP-ELEMENTARY-PROCEDURE SuccessfulOutcome " , proto_s1ap , FT_UINT32 , BASE_DEC ) ;
s1ap_proc_uout_dissector_table = register_dissector_table ( " s1ap.proc.uout " , " S1AP-ELEMENTARY-PROCEDURE UnsuccessfulOutcome " , proto_s1ap , FT_UINT32 , BASE_DEC ) ;
2011-10-21 02:10:19 +00:00
2008-11-04 22:01:35 +00:00
/* Register configuration options for ports */
s1ap_module = prefs_register_protocol ( proto_s1ap , proto_reg_handoff_s1ap ) ;
prefs_register_uint_preference ( s1ap_module , " sctp.port " ,
" S1AP SCTP Port " ,
" Set the SCTP port for S1AP messages " ,
10 ,
& gbl_s1apSctpPort ) ;
2012-02-09 22:17:42 +00:00
prefs_register_bool_preference ( s1ap_module , " dissect_container " , " Dissect TransparentContainer " , " Dissect TransparentContainers that are opaque to S1AP " , & g_s1ap_dissect_container ) ;
2007-12-16 13:34:33 +00:00
}
2016-07-26 10:08:20 +00:00
/*
* Editor modelines
*
* Local Variables :
* c - basic - offset : 2
* tab - width : 8
* indent - tabs - mode : nil
* End :
*
* ex : set shiftwidth = 2 tabstop = 8 expandtab :
* : indentSize = 2 : tabSize = 8 : noTabs = true :
*/