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


Change subject: library/s1ap: rework {ts,tr}_S1AP_RABSetupRsp templates
......................................................................

library/s1ap: rework {ts,tr}_S1AP_RABSetupRsp templates

3GPP TS 36.413, section 9.1.3.2 "E-RAB SETUP RESPONSE" defines
the following two IEs as optional:

* E-RAB Setup List IE: 0..1 in the Range column means that
  it can either be omitted (0) or included only once (1);
* E-RAB Failed to Setup List: 'O' in the Presence column.

Our templates for this S1AP PDU require the former to be a value
(as if it was mandatory) and do not allow passing the later.

Change-Id: Ic369ae720179483a19383af2bddf56186965eae3
Related: SYS#6772
---
M library/s1ap/S1AP_Templates.ttcn
1 file changed, 95 insertions(+), 36 deletions(-)



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

diff --git a/library/s1ap/S1AP_Templates.ttcn b/library/s1ap/S1AP_Templates.ttcn
index cf9b81c..0a91935 100644
--- a/library/s1ap/S1AP_Templates.ttcn
+++ b/library/s1ap/S1AP_Templates.ttcn
@@ -1238,59 +1238,118 @@
        }
 }

+private function
+f_ts_S1AP_RABSetupRsp(template (value) MME_UE_S1AP_ID mme_id,
+                     template (value) ENB_UE_S1AP_ID enb_id,
+                     template (omit) E_RABSetupListBearerSURes rab_setup_items 
:= omit,
+                     template (omit) E_RABList rab_failed_items := omit)
+return template (value) E_RABSetupResponse
+{
+       var template (value) E_RABSetupResponse rsp := {
+               protocolIEs := {
+                       {
+                               id := S1AP_Constants.id_MME_UE_S1AP_ID,
+                               criticality := ignore,
+                               value_ := { MME_UE_S1AP_ID := mme_id }
+                       }, {
+                               id := S1AP_Constants.id_eNB_UE_S1AP_ID,
+                               criticality := ignore,
+                               value_ := { ENB_UE_S1AP_ID := enb_id }
+                       }
+               }
+       };
+
+       var integer idx := lengthof(rsp.protocolIEs);
+       if (isvalue(rab_setup_items)) {
+               rsp.protocolIEs[idx] := {
+                       id := S1AP_Constants.id_E_RABSetupListBearerSURes,
+                       criticality := ignore,
+                       value_ := { e_RABSetupListBearerSURes := 
rab_setup_items }
+               };
+               idx := idx + 1;
+       }
+       if (isvalue(rab_failed_items)) {
+               rsp.protocolIEs[idx] := {
+                       id := 
S1AP_Constants.id_E_RABFailedToSetupListBearerSURes,
+                       criticality := ignore,
+                       value_ := { e_RABList := rab_failed_items }
+               };
+               idx := idx + 1;
+       }
+
+       return rsp;
+}
+private function
+f_tr_S1AP_RABSetupRsp(template (present) MME_UE_S1AP_ID mme_id,
+                     template (present) ENB_UE_S1AP_ID enb_id,
+                     template E_RABSetupListBearerSURes rab_setup_items := *,
+                     template E_RABList rab_failed_items := *)
+return template E_RABSetupResponse
+{
+       var template E_RABSetupResponse rsp := {
+               protocolIEs := {
+                       {
+                               id := S1AP_Constants.id_MME_UE_S1AP_ID,
+                               criticality := ignore,
+                               value_ := { MME_UE_S1AP_ID := mme_id }
+                       }, {
+                               id := S1AP_Constants.id_eNB_UE_S1AP_ID,
+                               criticality := ignore,
+                               value_ := { ENB_UE_S1AP_ID := enb_id }
+                       }
+               }
+       };
+
+       var integer idx := lengthof(rsp.protocolIEs);
+       if (isvalue(rab_setup_items) or istemplatekind(rab_setup_items, "?")) {
+               rsp.protocolIEs[idx] := {
+                       id := S1AP_Constants.id_E_RABSetupListBearerSURes,
+                       criticality := ignore,
+                       value_ := { e_RABSetupListBearerSURes := 
rab_setup_items }
+               };
+               idx := idx + 1;
+       }
+       if (isvalue(rab_failed_items) or istemplatekind(rab_failed_items, "?")) 
{
+               rsp.protocolIEs[idx] := {
+                       id := 
S1AP_Constants.id_E_RABFailedToSetupListBearerSURes,
+                       criticality := ignore,
+                       value_ := { e_RABList := rab_failed_items }
+               };
+               idx := idx + 1;
+       }
+       /* ignore the remaining IEs */
+       rsp.protocolIEs[idx] := *;
+
+       return rsp;
+}
+
 template (value) S1AP_PDU
 ts_S1AP_RABSetupRsp(template (value) MME_UE_S1AP_ID mme_id,
                    template (value) ENB_UE_S1AP_ID enb_id,
-                   template (value) E_RABSetupListBearerSURes rab_setup_items) 
:= {
+                   template (omit) E_RABSetupListBearerSURes rab_setup_items 
:= omit,
+                   template (omit) E_RABList rab_failed_items := omit) := {
        successfulOutcome := {
                procedureCode := S1AP_Constants.id_E_RABSetup,
                criticality := reject,
                value_ := {
-                       e_RABSetupResponse := {
-                               protocolIEs := {
-                                       {
-                                               id := 
S1AP_Constants.id_MME_UE_S1AP_ID,
-                                               criticality := ignore,
-                                               value_ := { MME_UE_S1AP_ID := 
mme_id }
-                                       }, {
-                                               id := 
S1AP_Constants.id_eNB_UE_S1AP_ID,
-                                               criticality := ignore,
-                                               value_ := { ENB_UE_S1AP_ID := 
enb_id }
-                                       }, {
-                                               id := 
S1AP_Constants.id_E_RABSetupListBearerSURes,
-                                               criticality := ignore,
-                                               value_ := { 
e_RABSetupListBearerSURes := rab_setup_items }
-                                       }
-                               }
-                       }
+                       e_RABSetupResponse := f_ts_S1AP_RABSetupRsp(mme_id, 
enb_id,
+                                                                   
rab_setup_items,
+                                                                   
rab_failed_items)
                }
        }
 }
 template (present) S1AP_PDU
 tr_S1AP_RABSetupRsp(template (present) MME_UE_S1AP_ID mme_id := ?,
                    template (present) ENB_UE_S1AP_ID enb_id := ?,
-                   template (present) E_RABSetupListBearerSURes 
rab_setup_items := ?) := {
+                   template E_RABSetupListBearerSURes rab_setup_items := *,
+                   template E_RABList rab_failed_items := *) := {
        successfulOutcome := {
                procedureCode := S1AP_Constants.id_E_RABSetup,
                criticality := reject,
                value_ := {
-                       e_RABSetupResponse := {
-                               protocolIEs := {
-                                       {
-                                               id := 
S1AP_Constants.id_MME_UE_S1AP_ID,
-                                               criticality := ignore,
-                                               value_ := { MME_UE_S1AP_ID := 
mme_id }
-                                       }, {
-                                               id := 
S1AP_Constants.id_eNB_UE_S1AP_ID,
-                                               criticality := ignore,
-                                               value_ := { ENB_UE_S1AP_ID := 
enb_id }
-                                       }, {
-                                               id := 
S1AP_Constants.id_E_RABSetupListBearerSURes,
-                                               criticality := ignore,
-                                               value_ := { 
e_RABSetupListBearerSURes := rab_setup_items }
-                                       }, *
-                               }
-                       }
+                       e_RABSetupResponse := f_tr_S1AP_RABSetupRsp(mme_id, 
enb_id,
+                                                                   
rab_setup_items,
+                                                                   
rab_failed_items)
                }
        }
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38578?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: Ic369ae720179483a19383af2bddf56186965eae3
Gerrit-Change-Number: 38578
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>

Reply via email to