Commit c16c0a7f authored by Pau Espin Pedrol's avatar Pau Espin Pedrol
Browse files

LibNGAP_Templates: Fixes and improvements for UEContextReleaseComplete

The existing templates for UEContextReleaseComplete were completelly
wrong, probably due to copy-paste when introducing them. This commit
fixes all those problems and allows passing optional parameters.

* procedureCode was wrong
* Criticality of several fields was wrong
* Type of resource list was wrong, and marked as mandatory while it was
  optional.
parent d70fb786
Loading
Loading
Loading
Loading
+132 −28
Original line number Diff line number Diff line
@@ -1904,36 +1904,88 @@ module LibNGAP_Templates {
                        /**
                         * @see ETSI TS 138 413 V16.12.0 (2023-05) Clause 9.2.2.6 UE CONTEXT RELEASE COMPLETE
                         */
                        template (value) SuccessfulOutcome m_n2_UEContextReleaseComplete(
                                                                                         in template (value) AMF_UE_NGAP_ID p_amfUeNgapID := PX_AMF_UE_NGAP_ID,
                                                                                         in template (value) RAN_UE_NGAP_ID p_ranUeNgapID := PX_RAN_UE_NGAP_ID,
                                                                                         in template (value) PDUSessionResourceSetupListSURes p_pDUSessionResourceSetupListSURes
                                                                                         ) := {
                            procedureCode := id_InitialContextSetup,
                        template (value) SuccessfulOutcome m_n2_UEContextReleaseComplete(template (value) AMF_UE_NGAP_ID p_amfUeNgapID := PX_AMF_UE_NGAP_ID,
                                                                                         template (value) RAN_UE_NGAP_ID p_ranUeNgapID := PX_RAN_UE_NGAP_ID)
                                                                                         := {
                            procedureCode := id_UEContextRelease,
                            criticality   := reject,
                            value_        := {
                                              PDUSessionResourceSetupResponse := {
                                              UEContextReleaseComplete := {
                                                                                  protocolIEs := {
                                                                                                  {
                                                                                                      id := id_AMF_UE_NGAP_ID,
                                                                                                      criticality := reject,
                                                                                                      criticality := ignore,
                                                                                                      value_ := { AMF_UE_NGAP_ID := p_amfUeNgapID }
                                                                                                  },
                                                                                                  {
                                                                                                      id := id_RAN_UE_NGAP_ID,
                                                                                                      criticality := reject,
                                                                                                      criticality := ignore,
                                                                                                      value_ := { RAN_UE_NGAP_ID := p_ranUeNgapID }
                                                                                                  },
                                                                                                  {
                                                                                                      id := id_PDUSessionResourceSetupListSURes,
                                                                                                      criticality := reject,
                                                                                                      value_ := { PDUSessionResourceSetupListSURes := p_pDUSessionResourceSetupListSURes }
                                                                                                  }
                                                                                                 }
                                                                                 }
                                             }
                         } // End of template m_n2_UEContextReleaseComplete
                        function f_ts_n2_UEContextReleaseComplete(template (value) AMF_UE_NGAP_ID p_amfUeNgapID := PX_AMF_UE_NGAP_ID,
                                                                  template (value) RAN_UE_NGAP_ID p_ranUeNgapID := PX_RAN_UE_NGAP_ID,
                                                                  template (omit) UserLocationInformation p_userLocationInformation := omit,
                                                                  template (omit) InfoOnRecommendedCellsAndRANNodesForPaging p_infoOnRecommendedCellsAndRANNodesForPaging := omit,
                                                                  template (omit) PDUSessionResourceListCxtRelCpl p_pDUSessionResourceListCxtRelCpl := omit,
                                                                  template (omit) CriticalityDiagnostics p_criticalityDiagnostics := omit,
                                                                  template (omit) PagingAssisDataforCEcapabUE p_pagingAssisDataforCEcapabUE := omit)
                        return template (value) SuccessfulOutcome {
                            var template (value) SuccessfulOutcome pdu := m_n2_UEContextReleaseComplete(p_amfUeNgapID, p_ranUeNgapID);
                            var integer idx := lengthof(pdu.value_.UEContextReleaseComplete.protocolIEs);
                            if (isvalue(p_userLocationInformation)) {
                                pdu.value_.UEContextReleaseComplete.protocolIEs[idx] := {
                                        id := id_UserLocationInformation,
                                        criticality := ignore,
                                        value_ := { UserLocationInformation := p_userLocationInformation }
                                    };
                                idx := idx + 1;
                            }
                            if (isvalue(p_infoOnRecommendedCellsAndRANNodesForPaging)) {
                                pdu.value_.UEContextReleaseComplete.protocolIEs[idx] := {
                                        id := id_InfoOnRecommendedCellsAndRANNodesForPaging,
                                        criticality := reject,
                                        value_ := { InfoOnRecommendedCellsAndRANNodesForPaging := p_infoOnRecommendedCellsAndRANNodesForPaging }
                                    };
                                idx := idx + 1;
                            }
                            if (isvalue(p_pDUSessionResourceListCxtRelCpl)) {
                                pdu.value_.UEContextReleaseComplete.protocolIEs[idx] := {
                                        id := id_PDUSessionResourceListCxtRelCpl,
                                        criticality := reject,
                                        value_ := { PDUSessionResourceListCxtRelCpl := p_pDUSessionResourceListCxtRelCpl }
                                    };
                                idx := idx + 1;
                            }
                            if (isvalue(p_criticalityDiagnostics)) {
                                pdu.value_.UEContextReleaseComplete.protocolIEs[idx] := {
                                        id := id_CriticalityDiagnostics,
                                        criticality := ignore,
                                        value_ := { CriticalityDiagnostics := p_criticalityDiagnostics }
                                    };
                                idx := idx + 1;
                            }
                            if (isvalue(p_pagingAssisDataforCEcapabUE)) {
                                pdu.value_.UEContextReleaseComplete.protocolIEs[idx] := {
                                        id             := id_PagingAssisDataforCEcapabUE,
                                        criticality    := ignore,
                                        value_ := { PagingAssisDataforCEcapabUE := p_pagingAssisDataforCEcapabUE }
                                    }
                                idx := idx + 1;
                            }
                            return pdu;
                        }
                    } // End of group Send
                    group Receive {
@@ -1941,36 +1993,88 @@ module LibNGAP_Templates {
                        /**
                         * @see ETSI TS 138 413 V16.12.0 (2023-05) Clause 9.2.2.6 UE CONTEXT RELEASE COMPLETE
                         */
                        template (present) SuccessfulOutcome mw_n2_UEContextReleaseComplete(
                                                                                            template (present) AMF_UE_NGAP_ID p_amfUeNgapID := ?,
                                                                                            template (present) RAN_UE_NGAP_ID p_ranUeNgapID := ?,
                                                                                            template (present) PDUSessionResourceSetupListSURes p_pDUSessionResourceSetupListSURes := ?
                                                                                            ) := {
                            procedureCode := id_InitialContextSetup,
                        template (present) SuccessfulOutcome mw_n2_UEContextReleaseComplete(template (present) AMF_UE_NGAP_ID p_amfUeNgapID := ?,
                                                                                            template (present) RAN_UE_NGAP_ID p_ranUeNgapID := ?)
                                                                                            := {
                            procedureCode := id_UEContextRelease,
                            criticality   := reject,
                            value_        := {
                                              PDUSessionResourceSetupResponse := {
                                              UEContextReleaseComplete := {
                                                                                  protocolIEs := {
                                                                                                  {
                                                                                                      id := id_AMF_UE_NGAP_ID,
                                                                                                      criticality := reject,
                                                                                                      criticality := ignore,
                                                                                                      value_ := { AMF_UE_NGAP_ID := p_amfUeNgapID }
                                                                                                  },
                                                                                                  {
                                                                                                      id := id_RAN_UE_NGAP_ID,
                                                                                                      criticality := reject,
                                                                                                      criticality := ignore,
                                                                                                      value_ := { RAN_UE_NGAP_ID := p_ranUeNgapID }
                                                                                                  },
                                                                                                  {
                                                                                                      id := id_PDUSessionResourceSetupListSURes,
                                                                                                      criticality := reject,
                                                                                                      value_ := { PDUSessionResourceSetupListSURes := p_pDUSessionResourceSetupListSURes }
                                                                                                  }
                                                                                                 }
                                                                                 }
                                             }
                         } // End of template mw_n2_UEContextReleaseComplete
                        function f_tr_n2_UEContextReleaseComplete(template (present) AMF_UE_NGAP_ID p_amfUeNgapID := PX_AMF_UE_NGAP_ID,
                                                                  template (present) RAN_UE_NGAP_ID p_ranUeNgapID := PX_RAN_UE_NGAP_ID,
                                                                  template UserLocationInformation p_userLocationInformation := omit,
                                                                  template InfoOnRecommendedCellsAndRANNodesForPaging p_infoOnRecommendedCellsAndRANNodesForPaging := omit,
                                                                  template PDUSessionResourceListCxtRelCpl p_pDUSessionResourceListCxtRelCpl := omit,
                                                                  template CriticalityDiagnostics p_criticalityDiagnostics := omit,
                                                                  template PagingAssisDataforCEcapabUE p_pagingAssisDataforCEcapabUE := omit)
                        return template (present) SuccessfulOutcome {
                            var template (present) SuccessfulOutcome pdu := m_n2_UEContextReleaseComplete(p_amfUeNgapID, p_ranUeNgapID);
                            var integer idx := lengthof(pdu.value_.UEContextReleaseComplete.protocolIEs);
                            if (not istemplatekind(p_userLocationInformation, "omit")) {
                                pdu.value_.UEContextReleaseComplete.protocolIEs[idx] := {
                                        id := id_UserLocationInformation,
                                        criticality := ignore,
                                        value_ := { UserLocationInformation := p_userLocationInformation }
                                    };
                                idx := idx + 1;
                            }
                            if (not istemplatekind(p_infoOnRecommendedCellsAndRANNodesForPaging, "omit")) {
                                pdu.value_.UEContextReleaseComplete.protocolIEs[idx] := {
                                        id := id_InfoOnRecommendedCellsAndRANNodesForPaging,
                                        criticality := reject,
                                        value_ := { InfoOnRecommendedCellsAndRANNodesForPaging := p_infoOnRecommendedCellsAndRANNodesForPaging }
                                    };
                                idx := idx + 1;
                            }
                            if (not istemplatekind(p_pDUSessionResourceListCxtRelCpl, "omit")) {
                                pdu.value_.UEContextReleaseComplete.protocolIEs[idx] := {
                                        id := id_PDUSessionResourceListCxtRelCpl,
                                        criticality := reject,
                                        value_ := { PDUSessionResourceListCxtRelCpl := p_pDUSessionResourceListCxtRelCpl }
                                    };
                                idx := idx + 1;
                            }
                            if (not istemplatekind(p_criticalityDiagnostics, "omit")) {
                                pdu.value_.UEContextReleaseComplete.protocolIEs[idx] := {
                                        id := id_CriticalityDiagnostics,
                                        criticality := ignore,
                                        value_ := { CriticalityDiagnostics := p_criticalityDiagnostics }
                                    };
                                idx := idx + 1;
                            }
                            if (not istemplatekind(p_pagingAssisDataforCEcapabUE, "omit")) {
                                pdu.value_.UEContextReleaseComplete.protocolIEs[idx] := {
                                        id             := id_PagingAssisDataforCEcapabUE,
                                        criticality    := ignore,
                                        value_ := { PagingAssisDataforCEcapabUE := p_pagingAssisDataforCEcapabUE }
                                    }
                                idx := idx + 1;
                            }
                            return pdu;
                        }
                    } // End of group Receive
                } // End of group UE_CONTEXT_RELEASE_COMPLETE