pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40443?usp=email )


Change subject: NGAP_Emulation: Fix match on DownlinkNASTransport with 
different list of IEs
......................................................................

NGAP_Emulation: Fix match on DownlinkNASTransport with different list of IEs

The existing receive templates match only a given set of parameters.
Some of them are optional, so they wouldn't match the template if added.
Match based on procedureCode instead.

Change-Id: Iaec861f8c0d55a2897896d695b9f70bca64af339
---
M library/NGAP_Emulation.ttcn
M library/NGAP_Functions.ttcn
2 files changed, 21 insertions(+), 16 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/43/40443/1

diff --git a/library/NGAP_Emulation.ttcn b/library/NGAP_Emulation.ttcn
index 1dcae70..178d6cd 100644
--- a/library/NGAP_Emulation.ttcn
+++ b/library/NGAP_Emulation.ttcn
@@ -426,6 +426,11 @@
                        mw_ngap_unsuccMsg({procedureCode := 
tr_NGAP_ProcedureCode_non_UErelated,
                                           criticality   := ?,
                                           value_        := ?}));
+template (present) NGAP_PDU
+tr_NGAP_DownlinkNASTransport := mw_ngap_initMsg({procedureCode := 
id_DownlinkNASTransport,
+                                                criticality   := ?,
+                                                value_        := { 
DownlinkNASTransport := ? }
+                                               });

 function main(NGAPOps ops, NGAP_conn_parameters p, charstring id) runs on 
NGAP_Emulation_CT {
        var Result res;
@@ -557,7 +562,7 @@
                                                                dl_nas := 
f_NG_NAS_try_decaps_dl(NGapAssociationTable[assoc_id].nus, dl_nas);
                                                        }
                                                        /* DL/UlNasTransport 
are not interesting, don't send them */
-                                                       if (not match(mrf.msg, 
mw_ngap_initMsg(mw_n2_DownlinkNASTransport))) {
+                                                       if (not match(mrf.msg, 
tr_NGAP_DownlinkNASTransport)) {
                                                                /* send raw 
NGAP */
                                                                
NGAP_CLIENT.send(mrf.msg) to vc_conn;
                                                        }
diff --git a/library/NGAP_Functions.ttcn b/library/NGAP_Functions.ttcn
index 70d8941..523754e 100644
--- a/library/NGAP_Functions.ttcn
+++ b/library/NGAP_Functions.ttcn
@@ -21,18 +21,18 @@
 {
        if (ischosen(ngap.initiatingMessage)) {
                var InitiatingMessage im := ngap.initiatingMessage;
-               select (im) {
-               case (mw_n2_DownlinkNASTransport) {
+               select (im.procedureCode) {
+               case (id_DownlinkNASTransport) {
                        return 
im.value_.downlinkNASTransport.protocolIEs[0].value_.aMF_UE_NGAP_ID;
                        }
-               case (mw_n2_UEContextReleaseCommand) {
+               case (id_UEContextRelease) {
                        return 
im.value_.uEContextReleaseCommand.protocolIEs[0].value_.uE_NGAP_IDs.uE_NGAP_ID_pair.aMF_UE_NGAP_ID;
                        }
                /* TODO */
                }
        } else if (ischosen(ngap.successfulOutcome)) {
                var SuccessfulOutcome so := ngap.successfulOutcome;
-               select (so) {
+               select (so.procedureCode) {
                case (?) {
                        return omit;
                        /* TODO */
@@ -42,7 +42,7 @@
                }
        } else if (ischosen(ngap.unsuccessfulOutcome)) {
                var UnsuccessfulOutcome uo := ngap.unsuccessfulOutcome;
-               select (uo) {
+               select (uo.procedureCode) {
                case (?) {
                        return omit;
                        /* TODO */
@@ -58,21 +58,21 @@
 {
        if (ischosen(ngap.initiatingMessage)) {
                var InitiatingMessage im := ngap.initiatingMessage;
-               select (im) {
-               case (mw_n2_initialUeMessage) {
+               select (im.procedureCode) {
+               case (id_InitialUEMessage) {
                        return 
im.value_.InitialUEMessage.protocolIEs[0].value_.RAN_UE_NGAP_ID;
                        }
-               case (mw_n2_DownlinkNASTransport) {
+               case (id_DownlinkNASTransport) {
                        return 
im.value_.downlinkNASTransport.protocolIEs[1].value_.RAN_UE_NGAP_ID;
                        }
-               case (mw_n2_UEContextReleaseCommand) {
+               case (id_UEContextRelease) {
                        return 
im.value_.uEContextReleaseCommand.protocolIEs[0].value_.uE_NGAP_IDs.uE_NGAP_ID_pair.rAN_UE_NGAP_ID;
                        }
                /* TODO */
                }
        } else if (ischosen(ngap.successfulOutcome)) {
                var SuccessfulOutcome so := ngap.successfulOutcome;
-               select (so) {
+               select (so.procedureCode) {
                case (?) {
                        return omit;
                        /* TODO */
@@ -82,7 +82,7 @@
                }
        } else if (ischosen(ngap.unsuccessfulOutcome)) {
                var UnsuccessfulOutcome uo := ngap.unsuccessfulOutcome;
-               select (uo) {
+               select (uo.procedureCode) {
                case (?) {
                        return omit;
                        /* TODO */
@@ -100,8 +100,8 @@

        if (ischosen(ngap.initiatingMessage)) {
                var InitiatingMessage im := ngap.initiatingMessage;
-               select (im) {
-               case (mw_n2_DownlinkNASTransport) {
+               select (im.procedureCode) {
+               case (id_DownlinkNASTransport) {
                        var DownlinkNASTransport msg := 
im.value_.DownlinkNASTransport;
                        for (i := 0; i < lengthof(msg.protocolIEs); i := i+1) {
                                if (msg.protocolIEs[i].id == id_NAS_PDU) {
@@ -109,7 +109,7 @@
                                }
                        }
                        }
-               case (mw_n2_UplinkNASTransport) {
+               case (id_UplinkNASTransport) {
                        var UplinkNASTransport msg := 
im.value_.UplinkNASTransport;
                        for (i := 0; i < lengthof(msg.protocolIEs); i := i+1) {
                                if (msg.protocolIEs[i].id == id_NAS_PDU) {
@@ -117,7 +117,7 @@
                                }
                        }
                        }
-               case (mw_n2_initialUeMessage) {
+               case (id_InitialUEMessage) {
                        var InitialUEMessage msg := im.value_.InitialUEMessage;
                        for (i := 0; i < lengthof(msg.protocolIEs); i := i+1) {
                                if (msg.protocolIEs[i].id == id_NAS_PDU) {

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40443?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iaec861f8c0d55a2897896d695b9f70bca64af339
Gerrit-Change-Number: 40443
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pes...@sysmocom.de>

Reply via email to