pespin has uploaded this change for review.

View Change

S1AP_Templates: Fix f_tr_* templates with newer titan following ttcn3 specs

Set the optional fields in inverse order to avoid "*" being converted to
"?", as explained in [1].

This way we can get rid of --legacy-template-subrefs in S1GW_Tests.

[1] https://gitlab.eclipse.org/eclipse/titan/titan.core/-/work_items/798#note_6286546

Change-Id: I4fbee80a7245fa00c8c42ff10a8346691b94a839
---
M library/s1ap/S1AP_Templates.ttcn
M s1gw/regen_makefile.sh
2 files changed, 185 insertions(+), 97 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/19/44219/1
diff --git a/library/s1ap/S1AP_Templates.ttcn b/library/s1ap/S1AP_Templates.ttcn
index 84128c0..5ebe11f 100644
--- a/library/s1ap/S1AP_Templates.ttcn
+++ b/library/s1ap/S1AP_Templates.ttcn
@@ -1013,16 +1013,32 @@
}
}
};
- var integer idx := lengthof(req.protocolIEs);

- if (ispresent(csfb_ind)) {
- req.protocolIEs[idx] := {
- id := id_CSFallbackIndicator,
- criticality := reject,
- value_ := { CSFallbackIndicator := csfb_ind }
- };
+ /* Set optional fields in inverse order to overcome TTCN-3 limitations regarding use of "*":
+ * https://gitlab.eclipse.org/eclipse/titan/titan.core/-/work_items/798 */
+ var integer idx := lengthof(req.protocolIEs);
+ if (ispresent(csfb_ind) or istemplatekind(csfb_ind, "*")) {
idx := idx + 1;
}
+ if (ispresent(registered_lai) or istemplatekind(registered_lai, "*")) {
+ idx := idx + 1;
+ }
+ if (ispresent(add_csfb_ind)) {
+ idx := idx + 1;
+ }
+
+ /* ignore the remaining IEs */
+ req.protocolIEs[idx] := *;
+ idx := idx - 1;
+
+ if (ispresent(add_csfb_ind)) {
+ req.protocolIEs[idx] := {
+ id := id_AdditionalCSFallbackIndicator,
+ criticality := ignore,
+ value_ := { AdditionalCSFallbackIndicator := add_csfb_ind }
+ };
+ idx := idx - 1;
+ }

if (ispresent(registered_lai)) {
req.protocolIEs[idx] := {
@@ -1030,20 +1046,24 @@
criticality := ignore,
value_ := { LAI := registered_lai }
};
- idx := idx + 1;
+ idx := idx - 1;
+ } else if (istemplatekind(registered_lai, "*")) {
+ req.protocolIEs[idx] := *;
+ idx := idx - 1;
}

- if (ispresent(add_csfb_ind)) {
+ if (ispresent(csfb_ind)) {
req.protocolIEs[idx] := {
- id := id_AdditionalCSFallbackIndicator,
- criticality := ignore,
- value_ := { AdditionalCSFallbackIndicator := add_csfb_ind }
+ id := id_CSFallbackIndicator,
+ criticality := reject,
+ value_ := { CSFallbackIndicator := csfb_ind }
};
- idx := idx + 1;
+ idx := idx - 1;
+ } else if (istemplatekind(csfb_ind, "*")) {
+ req.protocolIEs[idx] := *;
+ idx := idx - 1;
}

- /* ignore the remaining IEs */
- req.protocolIEs[idx] := *;
return req;
}

@@ -1402,25 +1422,40 @@
}
};

+ /* Set optional fields in inverse order to overcome TTCN-3 limitations regarding use of "*":
+ * https://gitlab.eclipse.org/eclipse/titan/titan.core/-/work_items/798 */
var integer idx := lengthof(rsp.protocolIEs);
- if (ispresent(rab_setup_items)) {
- rsp.protocolIEs[idx] := {
- id := S1AP_Constants.id_E_RABSetupListBearerSURes,
- criticality := ignore,
- value_ := { e_RABSetupListBearerSURes := rab_setup_items }
- };
+ if (ispresent(rab_setup_items) or istemplatekind(rab_setup_items, "*")) {
idx := idx + 1;
}
if (ispresent(rab_failed_items)) {
+ idx := idx + 1;
+ }
+
+ /* ignore the remaining IEs */
+ rsp.protocolIEs[idx] := *;
+ idx := idx - 1;
+
+ if (ispresent(rab_failed_items)) {
rsp.protocolIEs[idx] := {
id := S1AP_Constants.id_E_RABFailedToSetupListBearerSURes,
criticality := ignore,
value_ := { e_RABList := rab_failed_items }
};
- idx := idx + 1;
+ idx := idx - 1;
}
- /* ignore the remaining IEs */
- rsp.protocolIEs[idx] := *;
+
+ if (ispresent(rab_setup_items)) {
+ rsp.protocolIEs[idx] := {
+ id := S1AP_Constants.id_E_RABSetupListBearerSURes,
+ criticality := ignore,
+ value_ := { e_RABSetupListBearerSURes := rab_setup_items }
+ };
+ idx := idx - 1;
+ } else if (istemplatekind(rab_setup_items, "*")) {
+ rsp.protocolIEs[idx] := *;
+ idx := idx - 1;
+ }

return rsp;
}
@@ -1595,28 +1630,35 @@
}
};

- var integer idx := lengthof(req.protocolIEs);
- if (ispresent(max_br)) {
- req.protocolIEs[idx] := {
- id := S1AP_Constants.id_uEaggregateMaximumBitrate,
- criticality := reject,
- value_ := { UEAggregateMaximumBitrate := max_br }
- };
- idx := idx + 1;
- } else if (istemplatekind(max_br, "*")) {
- req.protocolIEs[idx] := *;
+ /* Set optional fields in inverse order to overcome TTCN-3 limitations regarding use of "*":
+ * https://gitlab.eclipse.org/eclipse/titan/titan.core/-/work_items/798 */
+ var integer idx := lengthof(req.protocolIEs) + 1 /* E_RABToBeModifiedListBearerModReq */;
+ if (ispresent(max_br) or istemplatekind(max_br, "*")) {
idx := idx + 1;
}

+ /* ignore the remaining IEs */
+ req.protocolIEs[idx] := *;
+ idx := idx - 1;
+
req.protocolIEs[idx] := {
id := S1AP_Constants.id_E_RABToBeModifiedListBearerModReq,
criticality := reject,
value_ := { E_RABToBeModifiedListBearerModReq := rab_modify_items }
};
- idx := idx + 1;
+ idx := idx - 1;

- /* ignore the remaining IEs */
- req.protocolIEs[idx] := *;
+ if (ispresent(max_br)) {
+ req.protocolIEs[idx] := {
+ id := S1AP_Constants.id_uEaggregateMaximumBitrate,
+ criticality := reject,
+ value_ := { UEAggregateMaximumBitrate := max_br }
+ };
+ idx := idx - 1;
+ } else if (istemplatekind(max_br, "*")) {
+ req.protocolIEs[idx] := *;
+ idx := idx - 1;
+ }

return req;
}
@@ -1744,15 +1786,19 @@
}
};

+ /* Set optional fields in inverse order to overcome TTCN-3 limitations regarding use of "*":
+ * https://gitlab.eclipse.org/eclipse/titan/titan.core/-/work_items/798 */
var integer idx := lengthof(rsp.protocolIEs);
- if (isvalue(rab_modified_items)) {
- rsp.protocolIEs[idx] := {
- id := S1AP_Constants.id_E_RABModifyListBearerModRes,
- criticality := ignore,
- value_ := { E_RABModifyListBearerModRes := rab_modified_items }
- };
+ if (ispresent(rab_modified_items) or istemplatekind(rab_modified_items, "*")) {
idx := idx + 1;
}
+ if (ispresent(rab_failed_items) or istemplatekind(rab_failed_items, "*")) {
+ idx := idx + 1;
+ }
+
+ /* ignore the remaining IEs */
+ rsp.protocolIEs[idx] := *;
+ idx := idx - 1;

if (ispresent(rab_failed_items)) {
rsp.protocolIEs[idx] := {
@@ -1760,10 +1806,23 @@
criticality := ignore,
value_ := { e_RABList := rab_failed_items }
};
- idx := idx + 1;
+ idx := idx - 1;
+ } else if (istemplatekind(rab_modified_items, "*")) {
+ rsp.protocolIEs[idx] := *;
+ idx := idx - 1;
}
- /* ignore the remaining IEs */
- rsp.protocolIEs[idx] := *;
+
+ if (ispresent(rab_modified_items)) {
+ rsp.protocolIEs[idx] := {
+ id := S1AP_Constants.id_E_RABModifyListBearerModRes,
+ criticality := ignore,
+ value_ := { E_RABModifyListBearerModRes := rab_modified_items }
+ };
+ idx := idx - 1;
+ } else if (istemplatekind(rab_modified_items, "*")) {
+ rsp.protocolIEs[idx] := *;
+ idx := idx - 1;
+ }

return rsp;
}
@@ -2129,19 +2188,26 @@
}
};

+ /* Set optional fields in inverse order to overcome TTCN-3 limitations regarding use of "*":
+ * https://gitlab.eclipse.org/eclipse/titan/titan.core/-/work_items/798 */
var integer idx := lengthof(ind.protocolIEs);
if (ispresent(rab_no_modify_items)) {
+ idx := idx + 1;
+ }
+
+ /* ignore the remaining IEs */
+ ind.protocolIEs[idx] := *;
+ idx := idx - 1;
+
+ if (ispresent(rab_no_modify_items)) {
ind.protocolIEs[idx] := {
id := S1AP_Constants.id_E_RABNotToBeModifiedListBearerModInd,
criticality := reject,
value_ := { e_RABNotToBeModifiedListBearerModInd := rab_no_modify_items }
};
- idx := idx + 1;
+ idx := idx - 1;
}

- /* ignore the remaining IEs */
- ind.protocolIEs[idx] := *;
-
return ind;
}

@@ -2325,17 +2391,30 @@
}
};

+ /* Set optional fields in inverse order to overcome TTCN-3 limitations regarding use of "*":
+ * https://gitlab.eclipse.org/eclipse/titan/titan.core/-/work_items/798 */
var integer idx := lengthof(cnf.protocolIEs);
- if (ispresent(rab_modified_items)) {
+ if (ispresent(rab_modified_items) or istemplatekind(rab_modified_items, "*")) {
+ idx := idx + 1;
+ }
+ if (ispresent(rab_failed_items) or istemplatekind(rab_modified_items, "*")) {
+ idx := idx + 1;
+ }
+ if (ispresent(rab_release_items)) {
+ idx := idx + 1;
+ }
+
+ /* ignore the remaining IEs */
+ cnf.protocolIEs[idx] := *;
+ idx := idx - 1;
+
+ if (ispresent(rab_release_items)) {
cnf.protocolIEs[idx] := {
- id := S1AP_Constants.id_E_RABModifyListBearerModConf,
+ id := S1AP_Constants.id_E_RABToBeReleasedListBearerModConf,
criticality := ignore,
- value_ := { e_RABModifyListBearerModConf := rab_modified_items }
+ value_ := { e_RABList := rab_release_items }
};
- idx := idx + 1;
- } else if (istemplatekind(rab_modified_items, "*")) {
- cnf.protocolIEs[idx] := *;
- idx := idx + 1;
+ idx := idx - 1;
}

if (ispresent(rab_failed_items)) {
@@ -2344,24 +2423,24 @@
criticality := ignore,
value_ := { e_RABList := rab_failed_items }
};
- idx := idx + 1;
+ idx := idx - 1;
} else if (istemplatekind(rab_failed_items, "*")) {
cnf.protocolIEs[idx] := *;
- idx := idx + 1;
+ idx := idx - 1;
}

- if (ispresent(rab_release_items)) {
+ if (ispresent(rab_modified_items)) {
cnf.protocolIEs[idx] := {
- id := S1AP_Constants.id_E_RABToBeReleasedListBearerModConf,
+ id := S1AP_Constants.id_E_RABModifyListBearerModConf,
criticality := ignore,
- value_ := { e_RABList := rab_release_items }
+ value_ := { e_RABModifyListBearerModConf := rab_modified_items }
};
- idx := idx + 1;
+ idx := idx - 1;
+ } else if (istemplatekind(rab_modified_items, "*")) {
+ cnf.protocolIEs[idx] := *;
+ idx := idx - 1;
}

- /* ignore the remaining IEs */
- cnf.protocolIEs[idx] := *;
-
return cnf;
}

@@ -2607,28 +2686,35 @@
}
};

- var integer idx := lengthof(cmd.protocolIEs);
- if (ispresent(rab_release_items)) {
- cmd.protocolIEs[idx] := {
- id := S1AP_Constants.id_E_RABtoReleaseListHOCmd,
- criticality := ignore,
- value_ := { E_RABList := rab_release_items }
- };
- idx := idx + 1;
- } else if (istemplatekind(rab_release_items, "*")) {
- cmd.protocolIEs[idx] := *;
+ /* Set optional fields in inverse order to overcome TTCN-3 limitations regarding use of "*":
+ * https://gitlab.eclipse.org/eclipse/titan/titan.core/-/work_items/798 */
+ var integer idx := lengthof(cmd.protocolIEs) + 1 /* id_Target_ToSource_TransparentContainer */ ;
+ if (ispresent(rab_release_items) or istemplatekind(rab_release_items, "*")) {
idx := idx + 1;
}

+ /* ignore the remaining IEs */
+ cmd.protocolIEs[idx] := *;
+ idx := idx - 1;
+
cmd.protocolIEs[idx] := {
id := S1AP_Constants.id_Target_ToSource_TransparentContainer,
criticality := reject,
value_ := { Target_ToSource_TransparentContainer := container }
};
- idx := idx + 1;
+ idx := idx - 1;

- /* ignore the remaining IEs */
- cmd.protocolIEs[idx] := *;
+ if (ispresent(rab_release_items)) {
+ cmd.protocolIEs[idx] := {
+ id := S1AP_Constants.id_E_RABtoReleaseListHOCmd,
+ criticality := ignore,
+ value_ := { E_RABList := rab_release_items }
+ };
+ idx := idx - 1;
+ } else if (istemplatekind(rab_release_items, "*")) {
+ cmd.protocolIEs[idx] := *;
+ idx := idx - 1;
+ }

return cmd;
}
@@ -2984,28 +3070,35 @@
}
};

- var integer idx := lengthof(ack.protocolIEs);
- if (ispresent(rab_failed_items)) {
- ack.protocolIEs[idx] := {
- id := S1AP_Constants.id_E_RABFailedToSetupListHOReqAck,
- criticality := ignore,
- value_ := { E_RABFailedtoSetupListHOReqAck := rab_failed_items }
- };
- idx := idx + 1;
- } else if (istemplatekind(rab_failed_items, "*")) {
- ack.protocolIEs[idx] := *;
+ /* Set optional fields in inverse order to overcome TTCN-3 limitations regarding use of "*":
+ * https://gitlab.eclipse.org/eclipse/titan/titan.core/-/work_items/798 */
+ var integer idx := lengthof(ack.protocolIEs) + 1 /* id_Target_ToSource_TransparentContainer */;
+ if (ispresent(rab_failed_items) or istemplatekind(rab_failed_items, "*")) {
idx := idx + 1;
}

+ /* ignore the remaining IEs */
+ ack.protocolIEs[idx] := *;
+ idx := idx - 1;
+
ack.protocolIEs[idx] := {
id := S1AP_Constants.id_Target_ToSource_TransparentContainer,
criticality := reject,
value_ := { Target_ToSource_TransparentContainer := container }
};
- idx := idx + 1;
+ idx := idx - 1;

- /* ignore the remaining IEs */
- ack.protocolIEs[idx] := *;
+ if (ispresent(rab_failed_items)) {
+ ack.protocolIEs[idx] := {
+ id := S1AP_Constants.id_E_RABFailedToSetupListHOReqAck,
+ criticality := ignore,
+ value_ := { E_RABFailedtoSetupListHOReqAck := rab_failed_items }
+ };
+ idx := idx - 1;
+ } else if (istemplatekind(rab_failed_items, "*")) {
+ ack.protocolIEs[idx] := *;
+ idx := idx - 1;
+ }

return ack;
}
diff --git a/s1gw/regen_makefile.sh b/s1gw/regen_makefile.sh
index fbcfa43..01f5cd4 100755
--- a/s1gw/regen_makefile.sh
+++ b/s1gw/regen_makefile.sh
@@ -22,9 +22,4 @@
TCCInterface.cc
"

-# https://gitlab.eclipse.org/eclipse/titan/titan.core/-/work_items/798
-REGEN_MAKEFILE_ADD_TTCN3_COMPILER_FLAGS_IF_SUPPORTED="
- --legacy-template-subrefs
-"
-
. ../_buildsystem/regen_makefile.inc.sh

To view, visit change 44219. To unsubscribe, or for help writing mail filters, visit settings.

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