From 1567bac64c3a3b76497b527f4ddf6dfab2388114 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Sun, 1 May 2022 03:36:24 +0300 Subject: library/RSL_Types: allow omitting IEs in ts_RSL_IPA_CRCX Change-Id: I7c36c3de1716968bccb07b03d2141d9abb3c175f Related: OS#5242 --- library/RSL_Types.ttcn | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn index ccd43e60..b04a13a1 100644 --- a/library/RSL_Types.ttcn +++ b/library/RSL_Types.ttcn @@ -2092,6 +2092,39 @@ template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifie /* Abis/IP specific messages */ + private function f_ts_RSL_IPA_CRCX_IEs(template (value) RslChannelNr chan_nr, + template (omit) OCT4 remote_ip, + template (omit) uint16_t remote_port) + return RSL_IE_List { + var RSL_IE_List ies; + + /* Channel Number is a mandatory IE */ + ies := { + valueof(RSL_IE:{ + iei := RSL_IE_CHAN_NR, + body := { chan_nr := chan_nr } + }) + }; + /* Remote IP / Port are optional IEs */ + if (not istemplatekind(remote_ip, "omit")) { + ies := ies & { + valueof(RSL_IE:{ + iei := RSL_IE_IPAC_REMOTE_IP, + body := { ipa_remote_ip := remote_ip } + }) + }; + } + if (not istemplatekind(remote_port, "omit")) { + ies := ies & { + valueof(RSL_IE:{ + iei := RSL_IE_IPAC_REMOTE_PORT, + body := { ipa_remote_port := remote_port } + }) + }; + } + + return ies; + } template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := { msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), msg_type := RSL_MT_IPAC_CRCX, @@ -2102,15 +2135,11 @@ template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifie } template (value) RSL_Message ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr, - template (value) OCT4 remote_ip := '7F000001'O, - template (value) uint16_t remote_port := 6766) := { + template (omit) OCT4 remote_ip := omit, + template (omit) uint16_t remote_port := omit) := { msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), msg_type := RSL_MT_IPAC_CRCX, - ies := { - t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), - t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}), - t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}) - } + ies := f_ts_RSL_IPA_CRCX_IEs(chan_nr, remote_ip, remote_port) } -- cgit v1.2.3