daniel has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27300 )


Change subject: ranap: Allow RAB ReleaseList inside RabAssReq template
......................................................................

ranap: Allow RAB ReleaseList inside RabAssReq template

Related: OS#5152
Change-Id: If5dabf24ab410ef95f92be1cb865ac06330b495e
---
M hnbgw/HNBGW_Tests.ttcn
M library/ranap/RANAP_Templates.ttcn
2 files changed, 125 insertions(+), 103 deletions(-)



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

diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn
index 7b9a49c..745e333 100644
--- a/hnbgw/HNBGW_Tests.ttcn
+++ b/hnbgw/HNBGW_Tests.ttcn
@@ -947,7 +947,7 @@
        f_create_rab(pars.mgcp_pars);

        /* Send RAB Release */
-       tx := valueof(ts_RANAP_RabAssignmentReqRabRel(ts_RAB_RL(t_RAB_id(23), 
ts_RanapCause_om_intervention)));
+       tx := valueof(ts_RANAP_RabAssReq(rab_rl := ts_RAB_RL(t_RAB_id(23), 
ts_RanapCause_om_intervention)));
        BSSAP.send(tx);

        T.start;
diff --git a/library/ranap/RANAP_Templates.ttcn 
b/library/ranap/RANAP_Templates.ttcn
index caccdc7..11947d9 100644
--- a/library/ranap/RANAP_Templates.ttcn
+++ b/library/ranap/RANAP_Templates.ttcn
@@ -1361,49 +1361,147 @@
        }
 } }

-template (value) RANAP_PDU
-ts_RANAP_RabAssReq(template (value) RAB_SetupOrModifyList rab_sml,
-                  template (omit) RAB_AssignmentRequest.protocolExtensions 
exts := omit) := {
-       initiatingMessage := {
+template (value) RAB_ReleaseList ts_RAB_RL(template (value) RAB_ID rab_id,
+                                          template (value) Cause cause) := { {
+       {
+               id := id_RAB_ReleaseItem,
+               criticality := ignore,
+               value_ := {
+                       rAB_ReleaseItem := {
+                               rAB_ID := rab_id,
+                               cause := cause,
+                               iE_Extensions := omit
+                       }
+               }
+       }
+} }
+
+template RAB_ReleaseList tr_RAB_RL(template (present) RAB_ID rab_id,
+                                  template Cause cause := ?) := { {
+       {
+               id := id_RAB_ReleaseItem,
+               criticality := ignore,
+               value_ := {
+                       rAB_ReleaseItem := {
+                               rAB_ID := rab_id,
+                               cause := cause,
+                               iE_Extensions := *
+                       }
+               }
+       }
+} }
+
+
+function
+ts_RANAP_RabAssReq(template (omit) RAB_SetupOrModifyList rab_sml := omit,
+                  template (omit) RAB_ReleaseList rab_rl := omit,
+                  template (omit) RAB_AssignmentRequest.protocolExtensions 
exts := omit) return template RANAP_PDU {
+       var template RANAP_PDU ret;
+       var template RAB_AssignmentRequest.protocolIEs protocolIEs := {};
+       var integer ie_pos := 0;
+
+       var template RAB_AssignmentRequest.protocolIEs protocolIEs_rab_sml;
+       var template RAB_AssignmentRequest.protocolIEs protocolIEs_rab_rl;
+
+       /* RAB-SetupOrModifyList */
+       if (istemplatekind(rab_sml, "value")) {
+               protocolIEs_rab_sml := {
+                       {
+                               id := id_RAB_SetupOrModifyList,
+                               criticality := ignore,
+                               value_ := {
+                                       rAB_SetupOrModifyList := rab_sml
+                               }
+                       }
+               };
+               protocolIEs[ie_pos] := protocolIEs_rab_sml[0];
+               ie_pos := ie_pos + 1;
+       }
+
+       /* RAB-ReleaseList */
+       if (istemplatekind(rab_rl, "value")) {
+               protocolIEs_rab_rl := {
+                       {
+                               id := id_RAB_ReleaseList,
+                               criticality := ignore,
+                               value_ := {
+                                       rAB_ReleaseList := rab_rl
+                               }
+                       }
+               };
+               protocolIEs[ie_pos] := protocolIEs_rab_rl[0];
+               ie_pos := ie_pos + 1;
+       }
+
+
+       ret.initiatingMessage := {
                procedureCode := id_RAB_Assignment,
                criticality := reject,
                value_ := {
                        rAB_AssignmentRequest := {
-                               protocolIEs := {
-                                       {
-                                               id := id_RAB_SetupOrModifyList,
-                                               criticality := ignore,
-                                               value_ := {
-                                                       rAB_SetupOrModifyList 
:= rab_sml
-                                               }
-                                       }
-                               },
+                               protocolIEs := protocolIEs,
                                protocolExtensions := exts
                        }
                }
        }
+
+       return ret;
 }
-template RANAP_PDU
-tr_RANAP_RabAssReq(template RAB_SetupOrModifyList rab_sml,
-                  template RAB_AssignmentRequest.protocolExtensions exts := *) 
:= {
-       initiatingMessage := {
+
+function
+tr_RANAP_RabAssReq(template RAB_SetupOrModifyList rab_sml := omit,
+                  template RAB_ReleaseList rab_rl := omit,
+                  template RAB_AssignmentRequest.protocolExtensions exts := *) 
return template RANAP_PDU {
+       var template RANAP_PDU ret;
+       var template RAB_AssignmentRequest.protocolIEs protocolIEs := {};
+       var integer ie_pos := 0;
+
+       var template RAB_AssignmentRequest.protocolIEs protocolIEs_rab_sml;
+       var template RAB_AssignmentRequest.protocolIEs protocolIEs_rab_rl;
+
+       /* RAB-SetupOrModifyList */
+       if (not istemplatekind(rab_sml, "omit")) {
+               protocolIEs_rab_sml := {
+                       {
+                               id := id_RAB_SetupOrModifyList,
+                               criticality := ignore,
+                               value_ := {
+                                       rAB_SetupOrModifyList := rab_sml
+                               }
+                       }
+               };
+               protocolIEs[ie_pos] := protocolIEs_rab_sml[0];
+               ie_pos := ie_pos + 1;
+       }
+
+       /* RAB-ReleaseList */
+       if (not istemplatekind(rab_rl, "omit")) {
+               protocolIEs_rab_rl := {
+                       {
+                               id := id_RAB_ReleaseList,
+                               criticality := ignore,
+                               value_ := {
+                                       rAB_ReleaseList := rab_rl
+                               }
+                       }
+               };
+               protocolIEs[ie_pos] := protocolIEs_rab_rl[0];
+               ie_pos := ie_pos + 1;
+       }
+
+
+       ret.initiatingMessage := {
                procedureCode := id_RAB_Assignment,
                criticality := reject,
                value_ := {
                        rAB_AssignmentRequest := {
-                               protocolIEs := {
-                                       {
-                                               id := id_RAB_SetupOrModifyList,
-                                               criticality := ignore,
-                                               value_ := {
-                                                       rAB_SetupOrModifyList 
:= rab_sml
-                                               }
-                                       }
-                               },
+                               protocolIEs := protocolIEs,
                                protocolExtensions := exts
                        }
                }
        }
+
+       return ret;
 }

 function
@@ -1532,82 +1630,6 @@
        return ret;
 }

-template (value) RAB_ReleaseList ts_RAB_RL(template (value) RAB_ID rab_id,
-                                          template (value) Cause cause) := { {
-       {
-               id := id_RAB_ReleaseItem,
-               criticality := ignore,
-               value_ := {
-                       rAB_ReleaseItem := {
-                               rAB_ID := rab_id,
-                               cause := cause,
-                               iE_Extensions := omit
-                       }
-               }
-       }
-} }
-
-template RAB_ReleaseList tr_RAB_RL(template (present) RAB_ID rab_id,
-                                  template Cause cause := ?) := { {
-       {
-               id := id_RAB_ReleaseItem,
-               criticality := ignore,
-               value_ := {
-                       rAB_ReleaseItem := {
-                               rAB_ID := rab_id,
-                               cause := cause,
-                               iE_Extensions := *
-                       }
-               }
-       }
-} }
-
-template (value) RANAP_PDU
-ts_RANAP_RabAssignmentReqRabRel(template (value) RAB_ReleaseList rab_rl,
-                      template (omit) RAB_AssignmentRequest.protocolExtensions 
exts := omit) := {
-       initiatingMessage := {
-               procedureCode := id_RAB_Assignment,
-               criticality := reject,
-               value_ := {
-                       rAB_AssignmentRequest := {
-                               protocolIEs := {
-                                       {
-                                               id := id_RAB_ReleaseList,
-                                               criticality := ignore,
-                                               value_ := {
-                                                       rAB_ReleaseList := 
rab_rl
-                                               }
-                                       }
-                               },
-                               protocolExtensions := exts
-                       }
-               }
-       }
-}
-
-template RANAP_PDU
-tr_RANAP_RabAssignmentReqRabRel(template RAB_ReleaseList rab_rl,
-                      template RAB_AssignmentRequest.protocolExtensions exts 
:= *) := {
-       initiatingMessage := {
-               procedureCode := id_RAB_Assignment,
-               criticality := reject,
-               value_ := {
-                       rAB_AssignmentRequest := {
-                               protocolIEs := {
-                                       {
-                                               id := id_RAB_ReleaseList,
-                                               criticality := ignore,
-                                               value_ := {
-                                                       rAB_ReleaseList := 
rab_rl
-                                               }
-                                       }
-                               },
-                               protocolExtensions := exts
-                       }
-               }
-       }
-}
-
 
/*****************************************************************************************************
  *
  
*****************************************************************************************************/

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If5dabf24ab410ef95f92be1cb865ac06330b495e
Gerrit-Change-Number: 27300
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <[email protected]>
Gerrit-MessageType: newchange

Reply via email to