diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2022-05-01 03:36:24 +0300 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2022-05-03 12:52:58 +0000 |
commit | 1567bac64c3a3b76497b527f4ddf6dfab2388114 (patch) | |
tree | 1870565bfb00628c895e110fb425797402de23d4 | |
parent | 189bf1b8c16be0a72bda2c82c7d544a388056b4e (diff) |
library/RSL_Types: allow omitting IEs in ts_RSL_IPA_CRCX
Change-Id: I7c36c3de1716968bccb07b03d2141d9abb3c175f
Related: OS#5242
-rw-r--r-- | library/RSL_Types.ttcn | 43 |
1 files 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) } |