Harald Welte | 1733a38 | 2017-07-23 17:26:17 +0200 | [diff] [blame] | 1 | module BSSGP_Emulation { |
Harald Welte | 1733a38 | 2017-07-23 17:26:17 +0200 | [diff] [blame] | 2 | |
Harald Welte | 34b5a95 | 2019-05-27 11:54:11 +0200 | [diff] [blame] | 3 | /* BSSGP Emulation in TTCN-3 |
| 4 | * (C) 2018-2019 Harald Welte <laforge@gnumonks.org> |
| 5 | * All rights reserved. |
| 6 | * |
| 7 | * Released under the terms of GNU General Public License, Version 2 or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 11 | */ |
| 12 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 13 | import from General_Types all; |
| 14 | import from Osmocom_Types all; |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 15 | import from NS_Types all; |
| 16 | import from NS_Emulation all; |
| 17 | import from BSSGP_Types all; |
| 18 | import from Osmocom_Gb_Types all; |
| 19 | import from IPL4asp_Types all; |
Harald Welte | 1733a38 | 2017-07-23 17:26:17 +0200 | [diff] [blame] | 20 | |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 21 | #ifdef BSSGP_EM_L3 |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 22 | import from MobileL3_GMM_SM_Types all; |
| 23 | import from MobileL3_Types all; |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 24 | #endif |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 25 | |
| 26 | import from LLC_Types all; |
| 27 | import from LLC_Templates all; |
| 28 | |
Harald Welte | a2526a8 | 2018-02-18 19:03:36 +0100 | [diff] [blame] | 29 | import from SNDCP_Types all; |
| 30 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 31 | /*********************************************************************** |
| 32 | * Communication between Client Components and Main Component |
| 33 | ***********************************************************************/ |
| 34 | |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 35 | type record BssgpStatusIndication { |
| 36 | Nsei nsei, |
| 37 | BssgpBvci bvci, |
| 38 | BvcState state |
| 39 | } |
| 40 | |
| 41 | template BssgpStatusIndication t_BssgpStsInd(template Nsei nsei, template BssgpBvci bvci, template BvcState state) := { |
| 42 | nsei := nsei, |
| 43 | bvci := bvci, |
| 44 | state := state |
| 45 | } |
| 46 | |
| 47 | type enumerated BvcState { |
| 48 | BVC_S_BLOCKED, |
| 49 | BVC_S_UNBLOCKED |
| 50 | }; |
| 51 | |
| 52 | /* port from our (internal) point of view */ |
| 53 | type port BSSGP_SP_PT message { |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 54 | in PDU_BSSGP, |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 55 | PDU_LLC |
| 56 | #ifdef BSSGP_EM_L3 |
| 57 | , |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 58 | PDU_L3_MS_SGSN, |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 59 | PDU_L3_SGSN_MS |
| 60 | #endif |
| 61 | ; |
Harald Welte | 955aa94 | 2019-05-03 01:29:29 +0200 | [diff] [blame] | 62 | out PDU_BSSGP, |
| 63 | PDU_LLC, |
| 64 | PDU_SN, |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 65 | NsStatusIndication, |
| 66 | BssgpStatusIndication, |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 67 | ASP_Event |
| 68 | #ifdef BSSGP_EM_L3 |
| 69 | , |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 70 | PDU_L3_MS_SGSN, |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 71 | PDU_L3_SGSN_MS |
| 72 | #endif |
| 73 | ; |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 74 | } with { extension "internal" }; |
| 75 | |
| 76 | /* port from the user point of view */ |
| 77 | type port BSSGP_PT message { |
| 78 | in ASP_Event, |
| 79 | NsStatusIndication, |
| 80 | BssgpStatusIndication, |
Harald Welte | 955aa94 | 2019-05-03 01:29:29 +0200 | [diff] [blame] | 81 | PDU_BSSGP, |
| 82 | PDU_LLC, |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 83 | PDU_SN |
| 84 | #ifdef BSSGP_EM_L3 |
| 85 | , |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 86 | PDU_L3_MS_SGSN, |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 87 | PDU_L3_SGSN_MS |
| 88 | #endif |
| 89 | ; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 90 | out PDU_BSSGP, |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 91 | PDU_LLC |
| 92 | #ifdef BSSGP_EM_L3 |
| 93 | , |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 94 | PDU_L3_SGSN_MS, |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 95 | PDU_L3_MS_SGSN |
| 96 | #endif |
| 97 | ; |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 98 | } with { extension "internal" }; |
| 99 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 100 | signature BSSGP_register_client(hexstring imsi, OCT4 tlli, BssgpCellId cell_id); |
| 101 | signature BSSGP_unregister_client(hexstring imsi); |
Harald Welte | f70997d | 2018-02-17 10:11:19 +0100 | [diff] [blame] | 102 | signature BSSGP_llgmm_assign(OCT4 tlli_old, OCT4 tlli); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 103 | |
| 104 | type port BSSGP_PROC_PT procedure { |
Harald Welte | f70997d | 2018-02-17 10:11:19 +0100 | [diff] [blame] | 105 | inout BSSGP_register_client, BSSGP_unregister_client, BSSGP_llgmm_assign; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 106 | } with { extension "internal" }; |
| 107 | |
| 108 | |
| 109 | /*********************************************************************** |
| 110 | * Client Component for a single MS/TLLI |
| 111 | ***********************************************************************/ |
| 112 | |
| 113 | type component BSSGP_Client_CT { |
Alexander Couzens | 0e510e6 | 2018-07-28 23:06:00 +0200 | [diff] [blame] | 114 | port BSSGP_PT BSSGP[3]; |
| 115 | port BSSGP_PT BSSGP_SIG[3]; |
| 116 | port BSSGP_PROC_PT BSSGP_PROC[3]; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 117 | }; |
| 118 | |
| 119 | /*********************************************************************** |
| 120 | * Main Component |
| 121 | ***********************************************************************/ |
| 122 | |
| 123 | function BssgpStart(BssgpConfig cfg) runs on BSSGP_CT { |
| 124 | g_cfg := cfg; |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 125 | f_init(); |
| 126 | f_ScanEvents(); |
| 127 | } |
| 128 | |
| 129 | private function f_init() runs on BSSGP_CT { |
| 130 | /* Connect the UDP socket */ |
| 131 | f_change_state(BVC_S_BLOCKED); |
| 132 | } |
| 133 | |
| 134 | type component BSSGP_CT { |
Stefan Sperling | f82bbb6 | 2018-05-03 19:14:28 +0200 | [diff] [blame] | 135 | /* UDP ports towards the bottom (IUT) */ |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 136 | port NS_PT BSCP; |
| 137 | /* NS-User SAP towards the user */ |
| 138 | port BSSGP_SP_PT BSSGP_SP; |
Stefan Sperling | f82bbb6 | 2018-05-03 19:14:28 +0200 | [diff] [blame] | 139 | port BSSGP_SP_PT BSSGP_SP_SIG; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 140 | port BSSGP_PROC_PT BSSGP_PROC; |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 141 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 142 | var BssgpConfig g_cfg; |
| 143 | |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 144 | var BvcState g_ptp_bvc_state := BVC_S_BLOCKED; |
| 145 | timer g_T1 := 15.0; |
| 146 | timer g_T2 := 60.0; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 147 | |
| 148 | var ClientEntity ClientTable[16]; |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 149 | } |
| 150 | |
Alexander Couzens | 6b449fb | 2018-07-31 14:19:36 +0200 | [diff] [blame] | 151 | type record length(16) of LLC_Entity LLC_Entities; |
| 152 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 153 | type record ClientEntity { |
| 154 | OCT4 tlli, |
| 155 | OCT4 tlli_old optional, |
| 156 | hexstring imsi, |
| 157 | BssgpCellId cell_id, |
| 158 | BSSGP_Client_CT comp_ref, |
| 159 | /* LLC entities, one for each SAPI */ |
| 160 | LLC_Entity llc[16] |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 161 | }; |
| 162 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 163 | type record LLC_Entity { |
| 164 | boolean sgsn_role, |
| 165 | /* N(U) on transmit side for next PDU */ |
| 166 | uint9_t n_u_tx_next, |
| 167 | /* N(U) on receive side, last PDU */ |
| 168 | uint9_t n_u_rx_last optional |
| 169 | }; |
| 170 | |
Alexander Couzens | cdfb751 | 2018-07-31 15:37:14 +0200 | [diff] [blame] | 171 | function f_llc_create(boolean sgsn_role := false) return LLC_Entities { |
| 172 | var LLC_Entities llc; |
| 173 | for (var integer i := 0; i < 16; i := i+1) { |
| 174 | llc[i] := valueof(t_LLC_init(sgsn_role)); |
| 175 | } |
| 176 | return llc; |
| 177 | } |
| 178 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 179 | private template LLC_Entity t_LLC_init(boolean sgsn_role := false) := { |
| 180 | sgsn_role := sgsn_role, |
| 181 | n_u_tx_next := 0, |
| 182 | n_u_rx_last := - |
| 183 | } |
| 184 | |
Oliver Smith | aac9b9c | 2019-09-02 08:36:36 +0200 | [diff] [blame] | 185 | type enumerated BssgpDecodeDepth { |
| 186 | BSSGP_DECODE_DEPTH_BSSGP, |
| 187 | BSSGP_DECODE_DEPTH_LLC, |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 188 | BSSGP_DECODE_DEPTH_SNDCP |
| 189 | #ifdef BSSGP_EM_L3 |
| 190 | , |
Oliver Smith | aac9b9c | 2019-09-02 08:36:36 +0200 | [diff] [blame] | 191 | BSSGP_DECODE_DEPTH_L3 |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 192 | #endif |
Oliver Smith | aac9b9c | 2019-09-02 08:36:36 +0200 | [diff] [blame] | 193 | }; |
| 194 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 195 | type record BssgpConfig { |
| 196 | Nsvci nsei, |
| 197 | Nsvci bvci, |
| 198 | BssgpCellId cell_id, |
Oliver Smith | aac9b9c | 2019-09-02 08:36:36 +0200 | [diff] [blame] | 199 | boolean sgsn_role, |
| 200 | BssgpDecodeDepth depth |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 201 | }; |
| 202 | |
| 203 | function f_BnsUdReq(template PDU_BSSGP pdu, BssgpBvci bvci) |
| 204 | runs on BSSGP_CT return NsUnitdataRequest { |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 205 | var NsUnitdataRequest udr := { |
Harald Welte | 1733a38 | 2017-07-23 17:26:17 +0200 | [diff] [blame] | 206 | bvci := bvci, |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 207 | nsei := g_cfg.nsei, |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 208 | /* for some weird reason we get "Dynamic test case error: Text encoder: Encoding an |
| 209 | * unbound integer value." when trying to send the reocrd rather than the octetstring */ |
| 210 | //sdu := omit, |
| 211 | //bssgp := valueof(pdu) |
| 212 | sdu := enc_PDU_BSSGP(valueof(pdu)), |
| 213 | bssgp := omit |
| 214 | } |
| 215 | return udr; |
| 216 | } |
| 217 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 218 | function f_BnsUdInd(template PDU_BSSGP pdu, template BssgpBvci bvci) |
| 219 | runs on BSSGP_CT return template NsUnitdataIndication { |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 220 | var template NsUnitdataIndication udi := { |
| 221 | bvci := bvci, |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 222 | nsei := g_cfg.nsei, |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 223 | sdu := *, |
| 224 | bssgp := pdu |
| 225 | } |
| 226 | return udi; |
| 227 | } |
| 228 | |
| 229 | private function f_change_state(BvcState new_state) runs on BSSGP_CT { |
| 230 | log("BSSGP State Transition: ", g_ptp_bvc_state, " -> ", new_state); |
| 231 | g_ptp_bvc_state := new_state; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 232 | for (var integer i := 0; i < sizeof(ClientTable); i := i+1) { |
| 233 | if (isbound(ClientTable[i].comp_ref)) { |
| 234 | BSSGP_SP.send(t_BssgpStsInd(g_cfg.nsei, g_cfg.bvci, g_ptp_bvc_state)) to ClientTable[i].comp_ref; |
| 235 | } |
| 236 | } |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 237 | } |
| 238 | |
Harald Welte | c967d0e | 2020-09-14 16:07:26 +0200 | [diff] [blame^] | 239 | private function f_sendReset(BssgpBvci bvci) runs on BSSGP_CT { |
| 240 | var PDU_BSSGP pdu; |
| 241 | |
| 242 | /* The Cell Identifier IE is mandatory in the BVC-RESET PDU sent from BSS to |
| 243 | * SGSN in order to reset a BVC corresponding to a PTP functional entity. The |
| 244 | * Cell Identifier IE shall not be used in any other BVC-RESET PDU. */ |
| 245 | if (g_cfg.sgsn_role) { |
| 246 | pdu := valueof(ts_BVC_RESET(BSSGP_CAUSE_OM_INTERVENTION, bvci, omit)); |
| 247 | } else { |
| 248 | pdu := valueof(ts_BVC_RESET(BSSGP_CAUSE_OM_INTERVENTION, bvci, g_cfg.cell_id)); |
| 249 | } |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 250 | log("PDU: ", pdu); |
| 251 | log("ENC: ", enc_PDU_BSSGP(pdu)); |
| 252 | |
| 253 | /* BVC-RESET is always sent via the SIGNALLING BVCI, see Table 5.4.1 */ |
| 254 | BSCP.send(f_BnsUdReq(pdu, 0)); |
| 255 | g_T2.start; |
| 256 | //f_change_state(BVC_S_WAIT_RESET); |
| 257 | } |
| 258 | |
| 259 | private function f_sendUnblock() runs on BSSGP_CT { |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 260 | BSCP.send(f_BnsUdReq(t_BVC_UNBLOCK(g_cfg.bvci), 0)); |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 261 | g_T1.start; |
| 262 | } |
| 263 | |
| 264 | private function f_sendBlock(BssgpCause cause) runs on BSSGP_CT { |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 265 | BSCP.send(f_BnsUdReq(t_BVC_BLOCK(g_cfg.bvci, cause), 0)); |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 266 | g_T1.start; |
| 267 | } |
| 268 | |
| 269 | private function f_sendStatus(BssgpCause cause, PDU_BSSGP pdu) runs on BSSGP_CT { |
| 270 | /* FIXME: Make sure correct Signaling or PTP BVCI is used! */ |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 271 | BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(g_cfg.bvci, cause, pdu), g_cfg.bvci)); |
| 272 | } |
| 273 | |
| 274 | /* attempt to extract the TLLI from a BSSGP PDU */ |
| 275 | function f_bssgp_get_tlli(PDU_BSSGP bssgp) return template OCT4 { |
| 276 | if (ischosen(bssgp.pDU_BSSGP_DL_UNITDATA)) { |
| 277 | return bssgp.pDU_BSSGP_DL_UNITDATA.tLLI_current; |
| 278 | } else if (ischosen(bssgp.pDU_BSSGP_UL_UNITDATA)) { |
| 279 | return bssgp.pDU_BSSGP_UL_UNITDATA.tLLI; |
| 280 | } else if (ischosen(bssgp.pDU_BSSGP_RA_CAPABILITY)) { |
| 281 | return bssgp.pDU_BSSGP_RA_CAPABILITY.tLLI.tLLI_Value; |
| 282 | } else if (ischosen(bssgp.pDU_BSSGP_RA_CAPABILITY_UPDATE)) { |
| 283 | return bssgp.pDU_BSSGP_RA_CAPABILITY_UPDATE.tLLI.tLLI_Value; |
| 284 | } else if (ischosen(bssgp.pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK)) { |
| 285 | return bssgp.pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK.tLLI.tLLI_Value; |
| 286 | } else if (ischosen(bssgp.pDU_BSSGP_RADIO_STATUS)) { |
| 287 | return bssgp.pDU_BSSGP_RADIO_STATUS.tLLI.tLLI_Value; |
| 288 | } else if (ischosen(bssgp.pDU_BSSGP_SUSPEND)) { |
| 289 | return bssgp.pDU_BSSGP_SUSPEND.tLLI.tLLI_Value; |
| 290 | } else if (ischosen(bssgp.pDU_BSSGP_SUSPEND_ACK)) { |
| 291 | return bssgp.pDU_BSSGP_SUSPEND_ACK.tLLI.tLLI_Value; |
| 292 | } else if (ischosen(bssgp.pDU_BSSGP_SUSPEND_NACK)) { |
| 293 | return bssgp.pDU_BSSGP_SUSPEND_NACK.tLLI.tLLI_Value; |
| 294 | } else if (ischosen(bssgp.pDU_BSSGP_RESUME)) { |
| 295 | return bssgp.pDU_BSSGP_RESUME.tLLI.tLLI_Value; |
| 296 | } else if (ischosen(bssgp.pDU_BSSGP_RESUME_ACK)) { |
| 297 | return bssgp.pDU_BSSGP_RESUME_ACK.tLLI.tLLI_Value; |
| 298 | } else if (ischosen(bssgp.pDU_BSSGP_RESUME_NACK)) { |
| 299 | return bssgp.pDU_BSSGP_RESUME_NACK.tLLI.tLLI_Value; |
| 300 | } else if (ischosen(bssgp.pDU_BSSGP_FLUSH_LL)) { |
| 301 | return bssgp.pDU_BSSGP_FLUSH_LL.tLLI.tLLI_Value; |
| 302 | } else if (ischosen(bssgp.pDU_BSSGP_FLUSH_LL_ACK)) { |
| 303 | return bssgp.pDU_BSSGP_FLUSH_LL_ACK.tLLI.tLLI_Value; |
| 304 | } else if (ischosen(bssgp.pDU_BSSGP_LLC_DISCARDED)) { |
| 305 | return bssgp.pDU_BSSGP_LLC_DISCARDED.tLLI.tLLI_Value; |
| 306 | } else if (ischosen(bssgp.pDU_BSSGP_LLC_DISCARDED)) { |
| 307 | return bssgp.pDU_BSSGP_LLC_DISCARDED.tLLI.tLLI_Value; |
| 308 | } else if (ischosen(bssgp.pDU_BSSGP_PAGING_CS) and |
| 309 | isvalue(bssgp.pDU_BSSGP_PAGING_CS.tLLI)) { |
| 310 | return bssgp.pDU_BSSGP_PAGING_CS.tLLI.tLLI_Value; |
| 311 | } else if (ischosen(bssgp.pDU_BSSGP_FLOW_CONTROL_MS)) { |
| 312 | return bssgp.pDU_BSSGP_FLOW_CONTROL_MS.tLLI.tLLI_Value; |
| 313 | } else if (ischosen(bssgp.pDU_BSSGP_FLOW_CONTROL_MS_ACK)) { |
| 314 | return bssgp.pDU_BSSGP_FLOW_CONTROL_MS_ACK.tLLI.tLLI_Value; |
| 315 | } |
| 316 | /* TODO: Handover, PFC, LCS */ |
| 317 | return omit; |
| 318 | } |
| 319 | |
| 320 | /* |
| 321 | private function f_tbl_init() runs on BSSGP_CT { |
| 322 | var integer i; |
| 323 | for (i := 0; i < sizeof(ImsiTable); i := i+1) { |
| 324 | ImsiTable[i] := -; |
| 325 | } |
| 326 | |
| 327 | for (i := 0; i < sizeof(TlliTable); i := i+1) { |
| 328 | TlliTable[i] := -; |
| 329 | } |
| 330 | } |
| 331 | */ |
| 332 | |
| 333 | private function f_tbl_client_add(hexstring imsi, OCT4 tlli, BssgpCellId cell_id, BSSGP_Client_CT vc_conn) |
| 334 | runs on BSSGP_CT { |
| 335 | var integer i; |
| 336 | for (i := 0; i < sizeof(ClientTable); i := i+1) { |
Harald Welte | c7872fa | 2018-02-18 14:06:12 +0100 | [diff] [blame] | 337 | if (not isvalue(ClientTable[i].comp_ref)) { |
| 338 | log("Adding Client=", vc_conn, ", IMSI=", imsi, ", TLLI=", tlli, ", index=", i); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 339 | ClientTable[i] := { |
| 340 | tlli := tlli, |
| 341 | tlli_old := omit, |
| 342 | imsi := imsi, |
| 343 | cell_id := cell_id, |
| 344 | comp_ref := vc_conn, |
| 345 | llc := - |
| 346 | }; |
| 347 | for (var integer j := 0; j < sizeof(ClientTable[i].llc); j := j+1) { |
| 348 | ClientTable[i].llc[j] := valueof(t_LLC_init(g_cfg.sgsn_role)); |
| 349 | } |
| 350 | return; |
| 351 | } |
| 352 | } |
Daniel Willmann | e4ff537 | 2018-07-05 17:35:03 +0200 | [diff] [blame] | 353 | testcase.stop("Client Table full"); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 354 | } |
| 355 | |
| 356 | private function f_tbl_client_del(hexstring imsi, BSSGP_Client_CT vc_conn) runs on BSSGP_CT { |
| 357 | var integer i; |
| 358 | for (i := 0; i < sizeof(ClientTable); i := i+1) { |
Harald Welte | c7872fa | 2018-02-18 14:06:12 +0100 | [diff] [blame] | 359 | if (isvalue(ClientTable[i].imsi) and ClientTable[i].imsi == imsi) { |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 360 | if (ClientTable[i].comp_ref != vc_conn) { |
Alexander Couzens | 2c15342 | 2018-06-12 18:10:30 +0200 | [diff] [blame] | 361 | setverdict(fail, "Cannot unregister index=", i, " IMSI ", imsi, " registred to ", |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 362 | ClientTable[i].comp_ref, " from ", vc_conn); |
Daniel Willmann | e4ff537 | 2018-07-05 17:35:03 +0200 | [diff] [blame] | 363 | mtc.stop; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 364 | } |
| 365 | log("Removing Client IMSI=", imsi, ", index=", i); |
Alexander Couzens | 2c15342 | 2018-06-12 18:10:30 +0200 | [diff] [blame] | 366 | ClientTable[i] := { |
| 367 | tlli := -, |
| 368 | tlli_old := omit, |
| 369 | imsi := ''H, |
| 370 | cell_id := -, |
| 371 | comp_ref := null, |
| 372 | llc := - }; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 373 | return; |
| 374 | } |
| 375 | } |
Alexander Couzens | 56101c9 | 2018-07-31 15:55:34 +0200 | [diff] [blame] | 376 | log("Warning: Could not find client for IMSI ", imsi); |
| 377 | return; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 378 | } |
| 379 | |
Harald Welte | f70997d | 2018-02-17 10:11:19 +0100 | [diff] [blame] | 380 | /* TS 44.064 7.2.1.1 LLGMM-ASSIGN */ |
| 381 | private function f_tbl_client_llgmm_assign(OCT4 tlli_old, OCT4 tlli_new, BSSGP_Client_CT vc_conn) |
| 382 | runs on BSSGP_CT { |
| 383 | var integer i := f_tbl_idx_by_comp(vc_conn); |
| 384 | |
| 385 | if (tlli_old == 'FFFFFFFF'O and tlli_new != 'FFFFFFFF'O) { |
| 386 | /* TLLI assignment */ |
| 387 | ClientTable[i].tlli := tlli_new; |
| 388 | ClientTable[i].tlli_old := omit; |
| 389 | } else if (tlli_old != 'FFFFFFFF'O and tlli_new != 'FFFFFFFF'O) { |
| 390 | /* TLLI change: both active */ |
| 391 | ClientTable[i].tlli := tlli_new; |
| 392 | ClientTable[i].tlli_old := tlli_old; |
| 393 | } else if (tlli_old != 'FFFFFFFF'O and tlli_new == 'FFFFFFFF'O) { |
| 394 | /* TLLI unassignment: old shall be unassigned; new stays */ |
| 395 | ClientTable[i].tlli_old := omit; |
| 396 | } |
| 397 | } |
| 398 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 399 | private function f_tbl_comp_by_imsi(hexstring imsi) runs on BSSGP_CT return BSSGP_Client_CT { |
| 400 | var integer i; |
| 401 | for (i := 0; i < sizeof(ClientTable); i := i+1) { |
Harald Welte | c7872fa | 2018-02-18 14:06:12 +0100 | [diff] [blame] | 402 | if (isvalue(ClientTable[i].imsi) and isvalue(ClientTable[i].comp_ref) |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 403 | and ClientTable[i].imsi == imsi) { |
| 404 | return ClientTable[i].comp_ref; |
| 405 | } |
| 406 | } |
| 407 | setverdict(fail, "Couldn't find Component for IMSI ", imsi); |
Daniel Willmann | e4ff537 | 2018-07-05 17:35:03 +0200 | [diff] [blame] | 408 | mtc.stop; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 409 | } |
| 410 | |
| 411 | private function f_tbl_comp_by_tlli(OCT4 tlli) runs on BSSGP_CT return BSSGP_Client_CT { |
| 412 | var integer i; |
| 413 | for (i := 0; i < sizeof(ClientTable); i := i+1) { |
Harald Welte | c7872fa | 2018-02-18 14:06:12 +0100 | [diff] [blame] | 414 | if (isvalue(ClientTable[i].comp_ref) and |
| 415 | (isvalue(ClientTable[i].tlli) and (ClientTable[i].tlli == tlli or |
| 416 | isvalue(ClientTable[i].tlli_old) and ClientTable[i].tlli_old == tlli) )) { |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 417 | return ClientTable[i].comp_ref; |
| 418 | } |
| 419 | } |
| 420 | setverdict(fail, "Couldn't find Component for TLLI ", tlli); |
Daniel Willmann | e4ff537 | 2018-07-05 17:35:03 +0200 | [diff] [blame] | 421 | mtc.stop; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 422 | } |
| 423 | |
| 424 | private function f_tbl_idx_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT return integer { |
| 425 | var integer i; |
| 426 | for (i := 0; i < sizeof(ClientTable); i := i+1) { |
Harald Welte | c7872fa | 2018-02-18 14:06:12 +0100 | [diff] [blame] | 427 | if (isvalue(ClientTable[i].comp_ref) and ClientTable[i].comp_ref == comp_ref) { |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 428 | return i; |
| 429 | } |
| 430 | } |
| 431 | setverdict(fail, "Couldn't find Client for Component ", comp_ref); |
Daniel Willmann | e4ff537 | 2018-07-05 17:35:03 +0200 | [diff] [blame] | 432 | mtc.stop; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 433 | } |
| 434 | |
| 435 | private function f_tbl_tlli_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT return OCT4 { |
| 436 | var integer i; |
| 437 | for (i := 0; i < sizeof(ClientTable); i := i+1) { |
Harald Welte | c7872fa | 2018-02-18 14:06:12 +0100 | [diff] [blame] | 438 | if (isvalue(ClientTable[i].tlli) and isvalue(ClientTable[i].comp_ref) |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 439 | and ClientTable[i].comp_ref == comp_ref) { |
| 440 | return ClientTable[i].tlli; |
| 441 | } |
| 442 | } |
| 443 | setverdict(fail, "Couldn't find TLLI for Component ", comp_ref); |
Daniel Willmann | e4ff537 | 2018-07-05 17:35:03 +0200 | [diff] [blame] | 444 | mtc.stop; |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 445 | } |
| 446 | |
Harald Welte | c967d0e | 2020-09-14 16:07:26 +0200 | [diff] [blame^] | 447 | private function f_send_bvc_reset_ack(BssgpBvci bvci) runs on BSSGP_CT { |
| 448 | /* The Cell Identifier IE is mandatory in the BVC-RESET-ACK PDU sent from BSS to |
| 449 | * SGSN in response to reset a BVC corresponding to a PTP functional entity. The Cell |
| 450 | * Identifier IE shall not be used in any other BVC-RESET-ACK PDU */ |
| 451 | if (g_cfg.sgsn_role) { |
| 452 | BSCP.send(f_BnsUdReq(ts_BVC_RESET_ACK(bvci, omit), 0)); |
| 453 | } else { |
| 454 | BSCP.send(f_BnsUdReq(ts_BVC_RESET_ACK(bvci, g_cfg.cell_id), 0)); |
| 455 | } |
| 456 | } |
| 457 | |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 458 | altstep as_allstate() runs on BSSGP_CT { |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 459 | var BSSGP_Client_CT vc_conn; |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 460 | var NsUnitdataIndication udi; |
| 461 | var NsStatusIndication nsi; |
| 462 | var ASP_Event evt; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 463 | var hexstring imsi; |
Harald Welte | f70997d | 2018-02-17 10:11:19 +0100 | [diff] [blame] | 464 | var OCT4 tlli, tlli_old; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 465 | var BssgpCellId cell_id; |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 466 | |
| 467 | /* Respond to BLOCK for wrong NSVCI */ |
| 468 | [] BSCP.receive(f_BnsUdInd(t_BVC_BLOCK(?, ?), 0)) -> value udi { |
| 469 | log("Rx BVC-BLOCK for unknown BVCI"); |
| 470 | f_sendStatus(BSSGP_CAUSE_BVCI_UNKNOWN, udi.bssgp); |
Harald Welte | 1733a38 | 2017-07-23 17:26:17 +0200 | [diff] [blame] | 471 | } |
| 472 | |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 473 | /* Respond to RESET with correct BVCI/CellID */ |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 474 | [] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, g_cfg.bvci, g_cfg.cell_id), 0)) -> value udi { |
| 475 | log("Rx BVC-RESET for Our BVCI=", g_cfg.bvci); |
Harald Welte | c967d0e | 2020-09-14 16:07:26 +0200 | [diff] [blame^] | 476 | f_send_bvc_reset_ack(g_cfg.bvci); |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 477 | f_change_state(BVC_S_UNBLOCKED); |
Harald Welte | 1733a38 | 2017-07-23 17:26:17 +0200 | [diff] [blame] | 478 | } |
| 479 | |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 480 | /* Respond to RESET for signalling BVCI 0 */ |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 481 | [] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, 0, g_cfg.cell_id), 0)) -> value udi { |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 482 | log("Rx BVC-RESET for Signaling BVCI=0"); |
Harald Welte | c967d0e | 2020-09-14 16:07:26 +0200 | [diff] [blame^] | 483 | f_send_bvc_reset_ack(0); |
Harald Welte | 1733a38 | 2017-07-23 17:26:17 +0200 | [diff] [blame] | 484 | } |
| 485 | |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 486 | /* Respond to RESET with wrong NSEI/NSVCI */ |
| 487 | [] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, ?, ?), 0)) -> value udi { |
| 488 | log("Rx BVC-RESET for unknown BVCI"); |
| 489 | f_sendStatus(BSSGP_CAUSE_BVCI_UNKNOWN, udi.bssgp); |
Harald Welte | 1733a38 | 2017-07-23 17:26:17 +0200 | [diff] [blame] | 490 | } |
| 491 | |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 492 | /* default case of handling unknown PDUs */ |
| 493 | [] BSCP.receive(f_BnsUdInd(?, ?)) -> value udi { |
| 494 | log("Rx Unexpected BSSGP PDU ", udi.bssgp," in state ", g_ptp_bvc_state); |
| 495 | f_sendStatus(BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE, udi.bssgp); |
Harald Welte | 1733a38 | 2017-07-23 17:26:17 +0200 | [diff] [blame] | 496 | } |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 497 | /* Forwarding of ASP_Event and NsStatusIndication to user */ |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 498 | [] BSCP.receive(ASP_Event:?) -> value evt { |
| 499 | for (var integer i := 0; i < sizeof(ClientTable); i := i+1) { |
| 500 | if (isbound(ClientTable[i].comp_ref)) { |
| 501 | BSSGP_SP.send(evt) to ClientTable[i].comp_ref; |
| 502 | } |
| 503 | } |
| 504 | } |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 505 | [] BSCP.receive(NsStatusIndication:?) -> value nsi { |
| 506 | /* if we just became NS-unblocked, send a BCC-RESET */ |
| 507 | if (nsi.old_state != NSE_S_ALIVE_UNBLOCKED and nsi.new_state == NSE_S_ALIVE_UNBLOCKED) { |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 508 | if (g_cfg.sgsn_role == false) { |
Harald Welte | c967d0e | 2020-09-14 16:07:26 +0200 | [diff] [blame^] | 509 | f_sendReset(g_cfg.bvci); |
Harald Welte | 1733a38 | 2017-07-23 17:26:17 +0200 | [diff] [blame] | 510 | } |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 511 | /* Idea: We could send BVC-UNBLOCK here like some SGSN do */ |
Harald Welte | 1733a38 | 2017-07-23 17:26:17 +0200 | [diff] [blame] | 512 | } |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 513 | for (var integer i := 0; i < sizeof(ClientTable); i := i+1) { |
| 514 | if (isbound(ClientTable[i].comp_ref)) { |
| 515 | BSSGP_SP.send(nsi) to ClientTable[i].comp_ref; |
| 516 | } |
| 517 | } |
| 518 | } |
| 519 | |
| 520 | [] BSSGP_PROC.getcall(BSSGP_register_client:{?,?,?}) -> param(imsi, tlli, cell_id) sender vc_conn { |
| 521 | f_tbl_client_add(imsi, tlli, cell_id, vc_conn); |
Harald Welte | e32ad99 | 2018-05-31 22:17:46 +0200 | [diff] [blame] | 522 | BSSGP_PROC.reply(BSSGP_register_client:{imsi, tlli, cell_id}) to vc_conn; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 523 | } |
| 524 | [] BSSGP_PROC.getcall(BSSGP_unregister_client:{?}) -> param(imsi) sender vc_conn { |
| 525 | f_tbl_client_del(imsi, vc_conn); |
Harald Welte | e32ad99 | 2018-05-31 22:17:46 +0200 | [diff] [blame] | 526 | BSSGP_PROC.reply(BSSGP_unregister_client:{imsi}) to vc_conn; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 527 | } |
Harald Welte | f70997d | 2018-02-17 10:11:19 +0100 | [diff] [blame] | 528 | [] BSSGP_PROC.getcall(BSSGP_llgmm_assign:{?,?}) -> param(tlli_old, tlli) sender vc_conn { |
| 529 | f_tbl_client_llgmm_assign(tlli_old, tlli, vc_conn); |
Harald Welte | e32ad99 | 2018-05-31 22:17:46 +0200 | [diff] [blame] | 530 | BSSGP_PROC.reply(BSSGP_llgmm_assign:{tlli_old, tlli}) to vc_conn; |
Harald Welte | f70997d | 2018-02-17 10:11:19 +0100 | [diff] [blame] | 531 | } |
| 532 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 533 | } |
| 534 | |
| 535 | altstep as_blocked() runs on BSSGP_CT { |
Harald Welte | c27f684 | 2018-03-02 21:40:03 +0100 | [diff] [blame] | 536 | [g_T1.running] g_T1.timeout { |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 537 | f_sendUnblock(); |
| 538 | } |
| 539 | [] BSCP.receive(f_BnsUdInd(t_BVC_UNBLOCK_ACK(g_cfg.bvci), 0)) { |
| 540 | g_T1.stop; |
| 541 | f_change_state(BVC_S_UNBLOCKED); |
| 542 | } |
| 543 | [not g_cfg.sgsn_role] BSCP.receive(f_BnsUdInd(tr_BVC_RESET_ACK(g_cfg.bvci, omit), 0)) { |
| 544 | f_sendUnblock(); |
Harald Welte | 1733a38 | 2017-07-23 17:26:17 +0200 | [diff] [blame] | 545 | } |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 546 | } |
Harald Welte | 1733a38 | 2017-07-23 17:26:17 +0200 | [diff] [blame] | 547 | |
Harald Welte | 955aa94 | 2019-05-03 01:29:29 +0200 | [diff] [blame] | 548 | private function f_send_bssgp_dec(BssgpDecoded dec, BSSGP_Client_CT vc_conn, BSSGP_SP_PT pt := BSSGP_SP) runs on BSSGP_CT { |
Harald Welte | 07cb87a | 2020-09-13 18:38:02 +0200 | [diff] [blame] | 549 | #ifdef BSSGP_EM_L3 |
Harald Welte | 955aa94 | 2019-05-03 01:29:29 +0200 | [diff] [blame] | 550 | if (ispresent(dec.l3_mt)) { |
| 551 | pt.send(dec.l3_mt) to vc_conn; |
| 552 | } else if (ispresent(dec.l3_mo)) { |
| 553 | pt.send(dec.l3_mo) to vc_conn; |
Harald Welte | 07cb87a | 2020-09-13 18:38:02 +0200 | [diff] [blame] | 554 | } else |
| 555 | #endif |
| 556 | if (ispresent(dec.sndcp)) { |
Harald Welte | 955aa94 | 2019-05-03 01:29:29 +0200 | [diff] [blame] | 557 | pt.send(dec.sndcp) to vc_conn; |
| 558 | } else if (ispresent(dec.llc)) { |
| 559 | pt.send(dec.llc) to vc_conn; |
| 560 | } else { |
| 561 | pt.send(dec.bssgp) to vc_conn; |
| 562 | } |
| 563 | } |
| 564 | |
| 565 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 566 | altstep as_unblocked() runs on BSSGP_CT { |
| 567 | var BSSGP_Client_CT vc_conn; |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 568 | var NsUnitdataIndication udi; |
| 569 | var PDU_BSSGP bs_pdu; |
Harald Welte | 752abba | 2018-02-18 19:42:17 +0100 | [diff] [blame] | 570 | var PDU_LLC llc; |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 571 | #ifdef BSSGP_EM_L3 |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 572 | var PDU_L3_MS_SGSN l3_mo; |
| 573 | var PDU_L3_SGSN_MS l3_mt; |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 574 | #endif |
Harald Welte | 1733a38 | 2017-07-23 17:26:17 +0200 | [diff] [blame] | 575 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 576 | /* bogus unblock, just respond with ACK */ |
| 577 | [] BSCP.receive(f_BnsUdInd(t_BVC_UNBLOCK(g_cfg.bvci), 0)) -> value udi { |
| 578 | BSCP.send(f_BnsUdReq(t_BVC_UNBLOCK_ACK(g_cfg.bvci), 0)); |
| 579 | } |
| 580 | /* Respond to BLOCK with BLOCK-ACK + change state */ |
| 581 | [] BSCP.receive(f_BnsUdInd(t_BVC_BLOCK(g_cfg.bvci, ?), 0)) -> value udi { |
| 582 | BSCP.send(f_BnsUdReq(t_BVC_BLOCK_ACK(g_cfg.bvci), 0)); |
| 583 | g_T1.stop; |
| 584 | f_change_state(BVC_S_BLOCKED); |
| 585 | } |
Harald Welte | c27f684 | 2018-03-02 21:40:03 +0100 | [diff] [blame] | 586 | [g_T1.running] g_T1.timeout { |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 587 | f_sendBlock(BSSGP_CAUSE_OM_INTERVENTION); |
| 588 | } |
| 589 | [] BSCP.receive(f_BnsUdInd(t_BVC_BLOCK_ACK(g_cfg.bvci), 0)) -> value udi { |
| 590 | g_T1.stop; |
| 591 | f_change_state(BVC_S_BLOCKED); |
| 592 | } |
| 593 | [] BSCP.receive(f_BnsUdInd(tr_BVC_RESET_ACK(g_cfg.bvci, g_cfg.cell_id), 0)) -> value udi { |
| 594 | g_T2.stop; |
| 595 | f_change_state(BVC_S_UNBLOCKED); |
| 596 | } |
Harald Welte | 13d391e | 2017-07-23 19:52:33 +0200 | [diff] [blame] | 597 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 598 | /* simply acknowledge all Flow Control Messages */ |
Harald Welte | edcdd90 | 2018-03-02 22:04:54 +0100 | [diff] [blame] | 599 | [g_cfg.sgsn_role] BSCP.receive(f_BnsUdInd(tr_BVC_FC_BVC, g_cfg.bvci)) -> value udi { |
| 600 | var OCT1 tag := udi.bssgp.pDU_BSSGP_FLOW_CONTROL_BVC.tag.unstructured_Value; |
| 601 | BSCP.send(f_BnsUdReq(t_BVC_FC_BVC_ACK(tag), g_cfg.bvci)); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 602 | } |
Harald Welte | edcdd90 | 2018-03-02 22:04:54 +0100 | [diff] [blame] | 603 | /* |
| 604 | [g_cfg.sgsn_role] BSCP.receive(f_BnsUdInd(t_BVC_FC_MS, g_cfg.bvci)) { |
| 605 | BSCP.send(f_BnsUdReq(t_BVC_FC_MS_ACK, g_cfg.bvci)); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 606 | } |
Harald Welte | e0abc47 | 2018-02-05 09:13:31 +0100 | [diff] [blame] | 607 | */ |
Harald Welte | 13d391e | 2017-07-23 19:52:33 +0200 | [diff] [blame] | 608 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 609 | /* FIXME: CS PAGING: dispatch by IMSI */ |
Harald Welte | 1733a38 | 2017-07-23 17:26:17 +0200 | [diff] [blame] | 610 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 611 | /* PS PAGING: dispatch by IMSI */ |
| 612 | [] BSCP.receive(f_BnsUdInd(tr_BSSGP_PS_PAGING(g_cfg.bvci), g_cfg.bvci)) -> value udi { |
| 613 | var hexstring imsi := udi.bssgp.pDU_BSSGP_PAGING_PS.iMSI.digits |
| 614 | vc_conn := f_tbl_comp_by_imsi(imsi); |
Harald Welte | 955aa94 | 2019-05-03 01:29:29 +0200 | [diff] [blame] | 615 | f_send_bssgp_dec(f_dec_bssgp(udi.bssgp), vc_conn); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 616 | } |
| 617 | |
Harald Welte | 001b0da | 2019-03-21 21:30:47 +0100 | [diff] [blame] | 618 | /* Any other PTP BSSGP message: If it has TLLi, route to component; otherwise broadcast */ |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 619 | [] BSCP.receive(f_BnsUdInd(?, g_cfg.bvci)) -> value udi { |
| 620 | var BssgpDecoded dec := f_dec_bssgp(udi.bssgp); |
| 621 | var template OCT4 tlli := f_bssgp_get_tlli(udi.bssgp); |
| 622 | if (isvalue(tlli)) { |
| 623 | vc_conn := f_tbl_comp_by_tlli(valueof(tlli)); |
Harald Welte | 955aa94 | 2019-05-03 01:29:29 +0200 | [diff] [blame] | 624 | f_send_bssgp_dec(dec, vc_conn); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 625 | } else { |
| 626 | log("No TLLI: Broadcasting ", dec); |
| 627 | /* broadcast this message to all components */ |
| 628 | // TITAN DOESN'T DO THIS, *SIGH*: "BSSGP_SP.send(dec) to all component;" |
| 629 | for (var integer i := 0; i < sizeof(ClientTable); i := i+1) { |
| 630 | if (isbound(ClientTable[i].comp_ref)) { |
Harald Welte | 955aa94 | 2019-05-03 01:29:29 +0200 | [diff] [blame] | 631 | f_send_bssgp_dec(dec, ClientTable[i].comp_ref); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 632 | } |
| 633 | } |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 634 | } |
Harald Welte | 1733a38 | 2017-07-23 17:26:17 +0200 | [diff] [blame] | 635 | } |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 636 | |
Harald Welte | 001b0da | 2019-03-21 21:30:47 +0100 | [diff] [blame] | 637 | /* Any other SIG BSSGP message: If it has TLLi, route to component; otherwise broadcast */ |
| 638 | [] BSCP.receive(f_BnsUdInd(?, 0)) -> value udi { |
| 639 | var BssgpDecoded dec := f_dec_bssgp(udi.bssgp); |
| 640 | var template OCT4 tlli := f_bssgp_get_tlli(udi.bssgp); |
| 641 | if (isvalue(tlli)) { |
| 642 | vc_conn := f_tbl_comp_by_tlli(valueof(tlli)); |
Harald Welte | 955aa94 | 2019-05-03 01:29:29 +0200 | [diff] [blame] | 643 | f_send_bssgp_dec(dec, vc_conn, BSSGP_SP_SIG); |
Harald Welte | 001b0da | 2019-03-21 21:30:47 +0100 | [diff] [blame] | 644 | } else { |
| 645 | log("No TLLI: Broadcasting ", dec); |
| 646 | /* broadcast this message to all components */ |
| 647 | // TITAN DOESN'T DO THIS, *SIGH*: "BSSGP_SP.send(dec) to all component;" |
| 648 | for (var integer i := 0; i < sizeof(ClientTable); i := i+1) { |
| 649 | if (isbound(ClientTable[i].comp_ref)) { |
Oliver Smith | a2cf8bd | 2019-08-30 11:48:00 +0200 | [diff] [blame] | 650 | f_send_bssgp_dec(dec, ClientTable[i].comp_ref, BSSGP_SP_SIG); |
Harald Welte | 001b0da | 2019-03-21 21:30:47 +0100 | [diff] [blame] | 651 | } |
| 652 | } |
| 653 | } |
| 654 | } |
| 655 | |
| 656 | |
Harald Welte | 1e5a02d | 2019-05-03 00:50:48 +0200 | [diff] [blame] | 657 | /* ConnHdlr sends BSSGP on BVCI=0 port: forward it to BSSGP Codec Port */ |
Stefan Sperling | f82bbb6 | 2018-05-03 19:14:28 +0200 | [diff] [blame] | 658 | [] BSSGP_SP_SIG.receive(PDU_BSSGP:?)-> value bs_pdu sender vc_conn { |
| 659 | BSCP.send(f_BnsUdReq(bs_pdu, 0)); |
| 660 | } |
| 661 | |
Harald Welte | 1e5a02d | 2019-05-03 00:50:48 +0200 | [diff] [blame] | 662 | /* ConnHdlr sends BSSGP on BVCI=PTP port: forward it to BSSGP Codec Port */ |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 663 | [] BSSGP_SP.receive(PDU_BSSGP:?) -> value bs_pdu sender vc_conn { |
| 664 | BSCP.send(f_BnsUdReq(bs_pdu, g_cfg.bvci)); |
| 665 | } |
| 666 | |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 667 | #ifdef BSSGP_EM_L3 |
Harald Welte | 1e5a02d | 2019-05-03 00:50:48 +0200 | [diff] [blame] | 668 | /* ConnHdlr sends L3: Encode and send as UL_UD / DL_UD */ |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 669 | [g_cfg.sgsn_role] BSSGP_SP.receive(PDU_L3_SGSN_MS:?) -> value l3_mt sender vc_conn { |
| 670 | var integer idx := f_tbl_idx_by_comp(vc_conn); |
| 671 | var octetstring l3_enc := enc_PDU_L3_SGSN_MS(l3_mt); |
| 672 | var BIT4 sapi := f_llc_sapi_by_l3_mt(l3_mt); |
| 673 | var integer n_u := f_llc_get_n_u_tx(ClientTable[idx].llc[bit2int(sapi)]); |
| 674 | var octetstring llc_enc := enc_PDU_LLC(valueof(ts_LLC_UI(l3_enc, sapi, '1'B, n_u))); |
Harald Welte | 8d1d893 | 2019-05-03 00:41:41 +0200 | [diff] [blame] | 675 | BSCP.send(f_BnsUdReq(ts_BSSGP_DL_UD(ClientTable[idx].tlli, llc_enc), g_cfg.bvci)); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 676 | } |
Harald Welte | 425f782 | 2019-05-03 00:48:46 +0200 | [diff] [blame] | 677 | [not g_cfg.sgsn_role] BSSGP_SP.receive(PDU_L3_MS_SGSN:?) -> value l3_mo sender vc_conn { |
| 678 | var integer idx := f_tbl_idx_by_comp(vc_conn); |
| 679 | var octetstring l3_enc := enc_PDU_L3_MS_SGSN(l3_mo); |
| 680 | var BIT4 sapi := f_llc_sapi_by_l3_mo(l3_mo); |
| 681 | var integer n_u := f_llc_get_n_u_tx(ClientTable[idx].llc[bit2int(sapi)]); |
| 682 | var octetstring llc_enc := enc_PDU_LLC(valueof(ts_LLC_UI(l3_enc, sapi, '1'B, n_u))); |
| 683 | BSCP.send(f_BnsUdReq(ts_BSSGP_UL_UD(ClientTable[idx].tlli, ClientTable[idx].cell_id, llc_enc), g_cfg.bvci)); |
| 684 | } |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 685 | #endif |
Harald Welte | 752abba | 2018-02-18 19:42:17 +0100 | [diff] [blame] | 686 | |
Harald Welte | 1b85bf3 | 2019-05-03 00:49:25 +0200 | [diff] [blame] | 687 | /* ConnHdlr sends raw LLC: Encode and send as UL_UD / DL_UD */ |
| 688 | [not g_cfg.sgsn_role] BSSGP_SP.receive(PDU_LLC:?) -> value llc sender vc_conn { |
Harald Welte | 752abba | 2018-02-18 19:42:17 +0100 | [diff] [blame] | 689 | var integer idx := f_tbl_idx_by_comp(vc_conn); |
| 690 | var octetstring llc_enc := enc_PDU_LLC(llc); |
| 691 | BSCP.send(f_BnsUdReq(ts_BSSGP_UL_UD(ClientTable[idx].tlli, ClientTable[idx].cell_id, llc_enc), g_cfg.bvci)); |
| 692 | } |
Harald Welte | 1b85bf3 | 2019-05-03 00:49:25 +0200 | [diff] [blame] | 693 | [g_cfg.sgsn_role] BSSGP_SP.receive(PDU_LLC:?) -> value llc sender vc_conn { |
| 694 | var integer idx := f_tbl_idx_by_comp(vc_conn); |
| 695 | var octetstring llc_enc := enc_PDU_LLC(llc); |
| 696 | BSCP.send(f_BnsUdReq(ts_BSSGP_DL_UD(ClientTable[idx].tlli, llc_enc), g_cfg.bvci)); |
| 697 | } |
| 698 | |
Harald Welte | 853c0ad | 2018-02-15 17:45:29 +0100 | [diff] [blame] | 699 | } |
| 700 | |
Alexander Couzens | cdfb751 | 2018-07-31 15:37:14 +0200 | [diff] [blame] | 701 | function f_llc_get_n_u_tx(inout LLC_Entity llc) return uint9_t { |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 702 | var uint9_t ret := llc.n_u_tx_next; |
| 703 | llc.n_u_tx_next := llc.n_u_tx_next + 1; |
| 704 | return ret; |
| 705 | } |
| 706 | |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 707 | #ifdef BSSGP_EM_L3 |
Alexander Couzens | cdfb751 | 2018-07-31 15:37:14 +0200 | [diff] [blame] | 708 | function f_llc_sapi_by_l3_mo(PDU_L3_MS_SGSN l3_mo) return BIT4 { |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 709 | if (ischosen(l3_mo.msgs.gprs_mm)) { |
| 710 | return c_LLC_SAPI_LLGMM; |
| 711 | } else if (ischosen(l3_mo.msgs.gprs_sm)) { |
Harald Welte | d471901 | 2018-02-17 16:45:06 +0100 | [diff] [blame] | 712 | return c_LLC_SAPI_LLGMM; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 713 | } else if (ischosen(l3_mo.msgs.sms)) { |
| 714 | return c_LLC_SAPI_LLSMS; |
| 715 | } |
| 716 | setverdict(fail, "No LLC SAPI for ", l3_mo); |
Daniel Willmann | e4ff537 | 2018-07-05 17:35:03 +0200 | [diff] [blame] | 717 | mtc.stop; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 718 | } |
| 719 | |
| 720 | private function f_llc_sapi_by_l3_mt(PDU_L3_SGSN_MS l3_mt) return BIT4 { |
| 721 | if (ischosen(l3_mt.msgs.gprs_mm)) { |
| 722 | return c_LLC_SAPI_LLGMM; |
| 723 | } else if (ischosen(l3_mt.msgs.gprs_sm)) { |
Harald Welte | d471901 | 2018-02-17 16:45:06 +0100 | [diff] [blame] | 724 | return c_LLC_SAPI_LLGMM; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 725 | } else if (ischosen(l3_mt.msgs.sms)) { |
| 726 | return c_LLC_SAPI_LLSMS; |
| 727 | } |
| 728 | setverdict(fail, "No LLC SAPI for ", l3_mt); |
Daniel Willmann | e4ff537 | 2018-07-05 17:35:03 +0200 | [diff] [blame] | 729 | mtc.stop; |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 730 | } |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 731 | #endif |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 732 | |
| 733 | |
| 734 | |
| 735 | private function f_ScanEvents() runs on BSSGP_CT { |
| 736 | log("matching against ", tr_BVC_RESET(?, g_cfg.bvci, g_cfg.cell_id)); |
| 737 | |
| 738 | while (true) { |
| 739 | alt { |
| 740 | [g_ptp_bvc_state == BVC_S_BLOCKED] as_blocked(); |
| 741 | [g_ptp_bvc_state == BVC_S_UNBLOCKED] as_unblocked(); |
| 742 | [] as_allstate(); |
| 743 | } |
| 744 | } /* while */ |
| 745 | } |
| 746 | |
| 747 | /* PDU_BSSGP enhanced with LLC and possibly L3 decoded payloads */ |
| 748 | type record BssgpDecoded { |
| 749 | PDU_BSSGP bssgp, |
| 750 | PDU_LLC llc optional, |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 751 | #ifdef BSSGP_EM_L3 |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 752 | PDU_L3_MS_SGSN l3_mo optional, |
Harald Welte | a2526a8 | 2018-02-18 19:03:36 +0100 | [diff] [blame] | 753 | PDU_L3_SGSN_MS l3_mt optional, |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 754 | #endif |
Harald Welte | a2526a8 | 2018-02-18 19:03:36 +0100 | [diff] [blame] | 755 | PDU_SN sndcp optional |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 756 | } |
| 757 | |
| 758 | /* Decode a PDU_BSSGP into a BssgpDecoded (i.e. with LLC/L3 decoded, as applicable) */ |
| 759 | private function f_dec_bssgp(PDU_BSSGP bssgp) runs on BSSGP_CT return BssgpDecoded { |
| 760 | var BssgpDecoded dec := { |
| 761 | bssgp := bssgp, |
| 762 | llc := omit, |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 763 | #ifdef BSSGP_EM_L3 |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 764 | l3_mo := omit, |
Harald Welte | a2526a8 | 2018-02-18 19:03:36 +0100 | [diff] [blame] | 765 | l3_mt := omit, |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 766 | #endif |
Harald Welte | a2526a8 | 2018-02-18 19:03:36 +0100 | [diff] [blame] | 767 | sndcp := omit |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 768 | }; |
| 769 | |
| 770 | /* Decode LLC, if it is a PDU that contains LLC */ |
Oliver Smith | aac9b9c | 2019-09-02 08:36:36 +0200 | [diff] [blame] | 771 | if (g_cfg.depth >= BSSGP_DECODE_DEPTH_LLC) { |
| 772 | if (ischosen(bssgp.pDU_BSSGP_DL_UNITDATA)) { |
| 773 | dec.llc := dec_PDU_LLC(bssgp.pDU_BSSGP_DL_UNITDATA.lLC_PDU.lLC_PDU); |
| 774 | } else if (ischosen(bssgp.pDU_BSSGP_UL_UNITDATA)) { |
| 775 | dec.llc := dec_PDU_LLC(bssgp.pDU_BSSGP_UL_UNITDATA.lLC_PDU.lLC_PDU); |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 776 | } |
| 777 | } |
Harald Welte | a2526a8 | 2018-02-18 19:03:36 +0100 | [diff] [blame] | 778 | |
| 779 | /* Decode SNDCP, if it is a LLC PDU containing user plane data */ |
Oliver Smith | aac9b9c | 2019-09-02 08:36:36 +0200 | [diff] [blame] | 780 | if (g_cfg.depth >= BSSGP_DECODE_DEPTH_SNDCP) { |
| 781 | if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_USER)) { |
| 782 | dec.sndcp := dec_PDU_SN(dec.llc.pDU_LLC_UI.information_field_UI); |
| 783 | } |
Harald Welte | a2526a8 | 2018-02-18 19:03:36 +0100 | [diff] [blame] | 784 | } |
Oliver Smith | aac9b9c | 2019-09-02 08:36:36 +0200 | [diff] [blame] | 785 | |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 786 | #ifdef BSSGP_EM_L3 |
Oliver Smith | aac9b9c | 2019-09-02 08:36:36 +0200 | [diff] [blame] | 787 | /* Decode L3, if it is a LLC PDU containing L3 */ |
| 788 | if (g_cfg.depth >= BSSGP_DECODE_DEPTH_L3) { |
| 789 | if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_L3)) { |
| 790 | if (g_cfg.sgsn_role) { |
| 791 | dec.l3_mo := dec_PDU_L3_MS_SGSN(dec.llc.pDU_LLC_UI.information_field_UI); |
| 792 | } else { |
| 793 | dec.l3_mt := dec_PDU_L3_SGSN_MS(dec.llc.pDU_LLC_UI.information_field_UI); |
| 794 | } |
| 795 | } |
| 796 | } |
Harald Welte | 93331e7 | 2020-09-12 20:51:05 +0200 | [diff] [blame] | 797 | #endif |
Oliver Smith | aac9b9c | 2019-09-02 08:36:36 +0200 | [diff] [blame] | 798 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 799 | return dec; |
| 800 | } |
| 801 | |
Alexander Couzens | 0e510e6 | 2018-07-28 23:06:00 +0200 | [diff] [blame] | 802 | function f_bssgp_client_register(hexstring imsi, OCT4 tlli, BssgpCellId cell_id, BSSGP_PROC_PT PT := BSSGP_PROC[0]) |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 803 | runs on BSSGP_Client_CT { |
| 804 | PT.call(BSSGP_register_client:{imsi, tlli, cell_id}) { |
| 805 | [] PT.getreply(BSSGP_register_client:{imsi, tlli, cell_id}) {}; |
| 806 | } |
| 807 | } |
| 808 | |
Alexander Couzens | 0e510e6 | 2018-07-28 23:06:00 +0200 | [diff] [blame] | 809 | function f_bssgp_client_unregister(hexstring imsi, BSSGP_PROC_PT PT := BSSGP_PROC[0]) |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 810 | runs on BSSGP_Client_CT { |
| 811 | PT.call(BSSGP_unregister_client:{imsi}) { |
| 812 | [] PT.getreply(BSSGP_unregister_client:{imsi}) {}; |
| 813 | } |
| 814 | } |
| 815 | |
Harald Welte | f70997d | 2018-02-17 10:11:19 +0100 | [diff] [blame] | 816 | /* TS 44.064 7.2.1.1 LLGMM-ASSIGN */ |
Alexander Couzens | 0e510e6 | 2018-07-28 23:06:00 +0200 | [diff] [blame] | 817 | function f_bssgp_client_llgmm_assign(OCT4 tlli_old, OCT4 tlli_new, BSSGP_PROC_PT PT := BSSGP_PROC[0]) |
Harald Welte | f70997d | 2018-02-17 10:11:19 +0100 | [diff] [blame] | 818 | runs on BSSGP_Client_CT { |
| 819 | PT.call(BSSGP_llgmm_assign:{tlli_old, tlli_new}) { |
| 820 | [] PT.getreply(BSSGP_llgmm_assign:{tlli_old, tlli_new}) {}; |
| 821 | } |
| 822 | } |
| 823 | |
Harald Welte | 5ac3149 | 2018-02-15 20:39:13 +0100 | [diff] [blame] | 824 | |
Harald Welte | 1733a38 | 2017-07-23 17:26:17 +0200 | [diff] [blame] | 825 | } |