diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
commit | e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch) | |
tree | 68cb5ef9081156392f1dd62a00c6ccc1451b93df /epan/dissectors/asn1/lcsap/lcsap.cnf | |
parent | Initial commit. (diff) | |
download | wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip |
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/asn1/lcsap/lcsap.cnf')
-rw-r--r-- | epan/dissectors/asn1/lcsap/lcsap.cnf | 382 |
1 files changed, 382 insertions, 0 deletions
diff --git a/epan/dissectors/asn1/lcsap/lcsap.cnf b/epan/dissectors/asn1/lcsap/lcsap.cnf new file mode 100644 index 00000000..e4ae9d4a --- /dev/null +++ b/epan/dissectors/asn1/lcsap/lcsap.cnf @@ -0,0 +1,382 @@ +# lcsap.cnf +# lcsap conformation file + +#.OPT +PER +ALIGNED +#.END + +#.EXPORTS +Correlation-ID_PDU +Positioning-Data_PDU + +#.PDU +LCS-AP-PDU + +#.MAKE_ENUM +ProcedureCode +ProtocolIE-ID + +#.NO_EMIT +TBCD-STRING + +#.OMIT_ASSIGNMENT +# Get rid of unused code warnings +Presence + +TriggeringMessage +ProtocolIE-ContainerList +Message-Identifier +Bearing +#.END + + +#.TYPE_RENAME +InitiatingMessage/value InitiatingMessage_value +SuccessfulOutcome/value SuccessfulOutcome_value +UnsuccessfulOutcome/value UnsuccessfulOutcome_value + +#.FIELD_RENAME +InitiatingMessage/value initiatingMessagevalue +UnsuccessfulOutcome/value unsuccessfulOutcome_value +SuccessfulOutcome/value successfulOutcome_value + +ProtocolExtensionField/id ext_id + +#PrivateIE-Field/value private_value +ProtocolIE-Field/value ie_field_value + +#.FN_PARS ProtocolIE-ID VAL_PTR=&ProtocolIE_ID +#.FN_FTR ProtocolIE-ID + if (tree) { + proto_item_append_text(proto_item_get_parent_nth(actx->created_item, 2), ": %s", val_to_str(ProtocolIE_ID, VALS(lcsap_ProtocolIE_ID_vals), "unknown (%d)")); + } +#.END + + +#.FN_PARS ProtocolIE-Field/value FN_VARIANT=_pdu_new TYPE_REF_FN=dissect_ProtocolIEFieldValue +#.FN_PARS ProtocolExtensionID VAL_PTR=&ProtocolExtensionID +#.FN_PARS ProtocolExtensionField/extensionValue FN_VARIANT=_pdu_new TYPE_REF_FN=dissect_ProtocolExtensionFieldExtensionValue + +#.FN_PARS Payload-Type VAL_PTR=&PayloadType + +# LCSAP connectionless-transfer +# procedures, which according to 3GPP TS 29.171 LCS-AP, can only contain an LPPa +# payload within the APDU IE of the procedure. + +#.FN_HDR Connectionless-Information + + PayloadType = 1; /* LPPa */ + +#.FN_BODY APDU VAL_PTR = ¶meter_tvb + + tvbuff_t *parameter_tvb=NULL; + +%(DEFAULT_BODY)s + + if (parameter_tvb) { + switch (PayloadType) { + case 0: + /* LPP */ + if (lpp_handle) { + call_dissector(lpp_handle, parameter_tvb, %(ACTX)s->pinfo, tree); + } + break; + case 1: + /* LPPa */ + if (lppa_handle) { + call_dissector(lppa_handle, parameter_tvb, %(ACTX)s->pinfo, tree); + } + break; + default: + break; + } + } + PayloadType = -1; + +#.FN_PARS ProcedureCode VAL_PTR = &ProcedureCode +#.FN_FTR ProcedureCode + + { + guint8 tmp = tvb_get_guint8(tvb, 0); + + if (tmp == 0) + col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%sReq", + val_to_str(ProcedureCode, lcsap_ProcedureCode_vals, "unknown message")); + else if (tmp == 32) + col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%sResp", + val_to_str(ProcedureCode, lcsap_ProcedureCode_vals, "unknown message")); + else + col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%s", + val_to_str(ProcedureCode, lcsap_ProcedureCode_vals, "unknown message")); + } + +#.END + +#.FN_PARS InitiatingMessage/value FN_VARIANT=_pdu_new TYPE_REF_FN=dissect_InitiatingMessageValue + +#.FN_PARS SuccessfulOutcome/value FN_VARIANT=_pdu_new TYPE_REF_FN=dissect_SuccessfulOutcomeValue + +#.FN_PARS UnsuccessfulOutcome/value FN_VARIANT=_pdu_new TYPE_REF_FN=dissect_UnsuccessfulOutcomeValue + +#--- Parameterization is not supported in asn2wrs --- + +#ProtocolIE-ContainerList {INTEGER : lowerBound, INTEGER : upperBound, LCS-AP-PROTOCOL-IES : IEsSetParam} ::= +# SEQUENCE (SIZE (lowerBound..upperBound)) OF +# ProtocolIE-Container {{IEsSetParam}} + + +#.END + + +# Currently not used +# FN_PARS ProtocolIE-ContainerPairList +#MIN_VAL = asn1_param_get_integer(%(ACTX)s,"lowerBound") +#MAX_VAL = asn1_param_get_integer(%(ACTX)s,"upperBound") +# FN_HDR ProtocolIE-ContainerPairList +# static const asn1_par_def_t ProtocolIE_ContainerPairList_pars[] = { +# { "lowerBound", ASN1_PAR_INTEGER }, +# { "upperBound", ASN1_PAR_INTEGER }, +# { NULL, 0 } +# }; +# asn1_stack_frame_check(actx, "ProtocolIE-ContainerPairList", ProtocolIE_ContainerPairList_pars); +# END + +# following construction is not supported by asn2wrs +# PLMN-ID ::= TBCD-STRING (SIZE (3)) +# TBCD-STRING ::= OCTET STRING +# 3GPP TS 29.171 version 10.3.0 Release 10 +# 7.4.27 PLMN Identity +#.FN_BODY PLMN-ID VAL_PTR = parameter_tvb + tvbuff_t *parameter_tvb=NULL; + proto_tree *subtree; + offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, + 3, 3, FALSE, ¶meter_tvb); + if(tvb_reported_length(tvb)==0) + return offset; + + if (!parameter_tvb) + return offset; + subtree = proto_item_add_subtree(actx->created_item, ett_lcsap_plmnd_id); + dissect_e212_mcc_mnc(parameter_tvb, actx->pinfo, subtree, 0, E212_NONE, FALSE); +#.END + +#.FN_BODY Positioning-Method-And-Usage VAL_PTR = ¶meter_tvb + tvbuff_t *parameter_tvb=NULL; + +%(DEFAULT_BODY)s + + if (!parameter_tvb) + return offset; + + proto_tree_add_item(tree, hf_lcsap_pos_method, parameter_tvb, 0, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_lcsap_pos_usage, parameter_tvb, 0, 1, ENC_BIG_ENDIAN); + + +#.FN_BODY GNSS-Positioning-Method-And-Usage VAL_PTR = ¶meter_tvb + tvbuff_t *parameter_tvb=NULL; + +%(DEFAULT_BODY)s + + if (!parameter_tvb) + return offset; + + proto_tree_add_item(tree, hf_lcsap_gnss_pos_method, parameter_tvb, 0, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_lcsap_gnss_id, parameter_tvb, 0, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(tree, hf_lcsap_gnss_pos_usage, parameter_tvb, 0, 1, ENC_BIG_ENDIAN); + +# +# Code copied from packet-gsm_a_common.c +#.FN_BODY Uncertainty-Code VAL_PTR = &uncertainty_code + guint32 uncertainty_code; + + offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, + 0U, 127U, &uncertainty_code, FALSE); + + proto_item_append_text(actx->created_item, " (%.1f m)", 10 * (pow(1.1, (double)uncertainty_code) - 1)); + +#.FN_BODY DegreesLatitude VAL_PTR = °rees + gint32 degrees; + + offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, + 0U, 8388607U, °rees, FALSE); + + proto_item_append_text(actx->created_item, " (%.5f degrees)", (((double)degrees/8388607) * 90)); + +#.FN_BODY DegreesLongitude VAL_PTR = °rees + gint32 degrees; + + offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, + -8388608, 8388607U, °rees, FALSE); + + proto_item_append_text(actx->created_item, " (%.5f degrees)", (((double)degrees/16777215) * 360)); + +#.FN_BODY IMSI VAL_PTR=&imsi_tvb + tvbuff_t *imsi_tvb; +%(DEFAULT_BODY)s + if (imsi_tvb) { + proto_tree *subtree; + + subtree = proto_item_add_subtree(actx->created_item, ett_lcsap_imsi); + dissect_e212_imsi(imsi_tvb, actx->pinfo, subtree, 0, tvb_reported_length(imsi_tvb), FALSE); + } + +#.FN_BODY Horizontal-Accuracy VAL_PTR=&uncertainty_code + guint32 uncertainty_code; +%(DEFAULT_BODY)s + +#.FN_FTR Horizontal-Accuracy + proto_item_append_text(actx->created_item, " (%.1f m)", 10 * (pow(1.1, (double)uncertainty_code) - 1)); + +#.FN_BODY Vertical-Accuracy VAL_PTR=&vertical_uncertainty + guint32 vertical_uncertainty; +%(DEFAULT_BODY)s + +#.FN_FTR Vertical-Accuracy + proto_item_append_text(actx->created_item, " (%.1f m)", 45 * (pow(1.025, (double)vertical_uncertainty) - 1)); + + #.FN_BODY Civic-Address VAL_PTR=¶meter_tvb + tvbuff_t *parameter_tvb=NULL; + + %(DEFAULT_BODY)s + if (parameter_tvb && xml_handle) { + proto_tree *subtree; + + subtree = proto_item_add_subtree(actx->created_item, ett_lcsap_civic_address); + if (tvb_strncaseeql(parameter_tvb, 0, "<?xml", 5) == 0) { + call_dissector(xml_handle, parameter_tvb, actx->pinfo, subtree); + } else { + proto_tree_add_expert(tree, actx->pinfo, &ei_lcsap_civic_data_not_xml, parameter_tvb, 0, -1); + } + } + + + + +#.TYPE_ATTR +ProtocolExtensionID TYPE = FT_UINT8 DISPLAY = BASE_DEC STRINGS = VALS(lcsap_ProtocolIE_ID_vals) +#.ASSIGN_VALUE_TO_TYPE # LCSAP does not have constants assigned to types, they are pure INTEGER +# ProcedureCode +id-Location-Service-Request ProcedureCode +id-Connection-Oriented-Information-Transfer ProcedureCode +id-Connectionless-Information-Transfer ProcedureCode +id-Location-Abort ProcedureCode +id-Reset ProcedureCode +id-Ciphering-Key-Data-Delivery ProcedureCode + +# ProtocolIE-ID +id-Correlation-ID ProtocolIE-ID +id-Location-Type ProtocolIE-ID +id-E-UTRAN-Cell-Identifier ProtocolIE-ID +id-LCS-Client-Type ProtocolIE-ID +id-LCS-Priority ProtocolIE-ID +id-LCS-QOS ProtocolIE-ID +id-UE-Positioning-Capability ProtocolIE-ID +id-Include-Velocity ProtocolIE-ID +id-IMSI ProtocolIE-ID +id-IMEI ProtocolIE-ID +id-MultipleAPDUs ProtocolIE-ID +id-Positioning-Data ProtocolIE-ID +id-Velocity-Estimate ProtocolIE-ID +id-Accuracy-Fulfillment-Indicator ProtocolIE-ID +id-LCS-Cause ProtocolIE-ID +id-Payload-Type ProtocolIE-ID +id-Return-Error-Cause ProtocolIE-ID +id-APDU ProtocolIE-ID +id-Return-Error-Request ProtocolIE-ID +id-Location-Estimate ProtocolIE-ID +id-Source-Identity ProtocolIE-ID +id-Destination-ID ProtocolIE-ID +id-LCS-Service-Type-ID ProtocolIE-ID +id-Cell-Portion-ID ProtocolIE-ID +id-Civic-Address ProtocolIE-ID +id-Barometric-Pressure ProtocolIE-ID +id-Additional-PositioningDataSet ProtocolIE-ID +id-RAT-Type ProtocolIE-ID +id-Ciphering-Data ProtocolIE-ID +id-Ciphering-Data-Ack ProtocolIE-ID +id-Ciphering-Data-Error-Report ProtocolIE-ID +id-Coverage-Level ProtocolIE-ID +id-UE-Country-Determination-Indication ProtocolIE-ID +id-UE-Area-Indication ProtocolIE-ID + +#.REGISTER + +#LCS-AP-PROTOCOL-IES +Accuracy-Fulfillment-Indicator N lcsap.ies id-Accuracy-Fulfillment-Indicator +APDU N lcsap.ies id-APDU +Correlation-ID N lcsap.ies id-Correlation-ID +Network-Element N lcsap.ies id-Destination-ID +E-CGI N lcsap.ies id-E-UTRAN-Cell-Identifier +Include-Velocity N lcsap.ies id-Include-Velocity +IMEI N lcsap.ies id-IMEI +IMSI N lcsap.ies id-IMSI +LCS-Client-Type N lcsap.ies id-LCS-Client-Type +LCS-Priority N lcsap.ies id-LCS-Priority +LCS-QoS N lcsap.ies id-LCS-QOS +LCS-Cause N lcsap.ies id-LCS-Cause +Geographical-Area N lcsap.ies id-Location-Estimate +Location-Type N lcsap.ies id-Location-Type +MultipleAPDUs N lcsap.ies id-MultipleAPDUs +Payload-Type N lcsap.ies id-Payload-Type +Positioning-Data N lcsap.ies id-Positioning-Data +Return-Error-Type N lcsap.ies id-Return-Error-Request +Return-Error-Cause N lcsap.ies id-Return-Error-Cause +Network-Element N lcsap.ies id-Source-Identity +UE-Positioning-Capability N lcsap.ies id-UE-Positioning-Capability +Velocity-Estimate N lcsap.ies id-Velocity-Estimate +Barometric-Pressure N lcsap.extension id-Barometric-Pressure +Additional-PositioningDataSet N lcsap.extension id-Additional-PositioningDataSet +RAT-Type N lcsap.ies id-RAT-Type +Ciphering-Data N lcsap.ies id-Ciphering-Data +Ciphering-Data-Ack N lcsap.ies id-Ciphering-Data-Ack +Ciphering-Data-Error-Report N lcsap.ies id-Ciphering-Data-Error-Report +Coverage-Level N lcsap.ies id-Coverage-Level +UE-Country-Determination-Indication N lcsap.ies id-UE-Country-Determination-Indication +UE-Area-Indication N lcsap.ies id-UE-Area-Indication + +#LCS-AP-PROTOCOL-EXTENSION +LCS-Service-Type-ID N lcsap.extension id-LCS-Service-Type-ID +Cell-Portion-ID N lcsap.extension id-Cell-Portion-ID +Civic-Address N lcsap.extension id-Civic-Address +E-CGI N lcsap.extension id-E-UTRAN-Cell-Identifier + + +Location-Request N lcsap.proc.imsg id-Location-Service-Request +Location-Response N lcsap.proc.sout id-Location-Service-Request +Location-Response N lcsap.proc.uout id-Location-Service-Request + +Connection-Oriented-Information N lcsap.proc.imsg id-Connection-Oriented-Information-Transfer + +Connectionless-Information N lcsap.proc.imsg id-Connectionless-Information-Transfer +Connectionless-Information N lcsap.proc.uout id-Connectionless-Information-Transfer + +Location-Abort-Request N lcsap.proc.imsg id-Location-Abort +Location-Response N lcsap.proc.sout id-Location-Abort + +Reset-Request N lcsap.proc.imsg id-Reset +Reset-Acknowledge N lcsap.proc.sout id-Reset + +Ciphering-Key-Data N lcsap.proc.imsg id-Ciphering-Key-Data-Delivery +Ciphering-Key-Data-Result N lcsap.proc.sout id-Ciphering-Key-Data-Delivery +Ciphering-Key-Data-Result N lcsap.proc.uout id-Ciphering-Key-Data-Delivery + + + +#.TYPE_ATTR +BitRate TYPE = FT_UINT64 DISPLAY = BASE_DEC STRINGS = NULL +#.END + + +# +# Editor modelines - https://www.wireshark.org/tools/modelines.html +# +# Local variables: +# c-basic-offset: 2 +# tab-width: 8 +# indent-tabs-mode: nil +# End: +# +# vi: set shiftwidth=2 tabstop=8 expandtab: +# :indentSize=2:tabSize=8:noTabs=true: +# |