Harald Welte | 36975c8 | 2017-12-09 21:39:57 +0100 | [diff] [blame] | 1 | module BSSAP_CodecPort { |
| 2 | |
| 3 | import from General_Types all; |
| 4 | import from Osmocom_Types all; |
| 5 | |
| 6 | import from SCCPasp_Types all; |
| 7 | import from SCCP_Types all; |
| 8 | |
| 9 | import from BSSAP_Types all; |
| 10 | |
| 11 | type record BSSAP_N_CONNECT_req |
| 12 | { |
| 13 | SCCP_PAR_Address calledAddress, |
| 14 | SCCP_PAR_Address callingAddress optional, |
| 15 | SCCP_PAR_Expedited_Data_Sel expeditedDataSel optional, |
| 16 | SCCP_PAR_Quality_Of_Service qualityOfService optional, |
| 17 | PDU_BSSAP userData optional, |
| 18 | SCCP_PAR_Connection_Id connectionId optional, |
| 19 | SCCP_PAR_Importance importance optional |
| 20 | } |
| 21 | |
| 22 | template BSSAP_N_CONNECT_req ts_BSSAP_CONNECT_req(SCCP_PAR_Address called, |
| 23 | SCCP_PAR_Address calling, |
| 24 | template PDU_BSSAP bssap := *) := { |
| 25 | calledAddress := called, |
| 26 | callingAddress := calling, |
| 27 | expeditedDataSel := omit, |
| 28 | qualityOfService := omit, |
| 29 | userData := bssap, |
| 30 | connectionId := omit, |
| 31 | importance := omit |
| 32 | } |
| 33 | |
| 34 | type record BSSAP_N_CONNECT_ind |
| 35 | { |
| 36 | SCCP_PAR_Address calledAddress, |
| 37 | SCCP_PAR_Address callingAddress optional, |
| 38 | SCCP_PAR_Quality_Of_Service qualityOfService optional, |
| 39 | PDU_BSSAP userData optional, |
| 40 | SCCP_PAR_Connection_Id connectionId optional, |
| 41 | SCCP_PAR_Importance importance optional |
| 42 | } |
| 43 | |
| 44 | template BSSAP_N_CONNECT_ind tr_BSSAP_CONNECT_ind(template SCCP_PAR_Address called, |
| 45 | template SCCP_PAR_Address calling, |
| 46 | template PDU_BSSAP payload := *) := { |
| 47 | calledAddress := called, |
| 48 | callingAddress := calling, |
| 49 | qualityOfService := *, |
| 50 | userData := payload, |
| 51 | connectionId := *, |
| 52 | importance := * |
| 53 | } |
| 54 | |
| 55 | type record BSSAP_N_CONNECT_res |
| 56 | { |
| 57 | SCCP_PAR_Address respondingAddress optional, |
| 58 | SCCP_PAR_Expedited_Data_Sel expeditedDataSel optional, |
| 59 | SCCP_PAR_Quality_Of_Service qualityOfService optional, |
| 60 | PDU_BSSAP userData optional, |
| 61 | SCCP_PAR_Connection_Id connectionId optional, |
| 62 | SCCP_PAR_Importance importance optional |
| 63 | } |
| 64 | |
| 65 | template BSSAP_N_CONNECT_res ts_BSSAP_CONNECT_res(SCCP_PAR_Connection_Id conn_id, |
| 66 | template PDU_BSSAP bssap := omit) := { |
| 67 | respondingAddress := omit, |
| 68 | expeditedDataSel := omit, |
| 69 | qualityOfService := omit, |
| 70 | userData := bssap, |
| 71 | connectionId := conn_id, |
| 72 | importance := omit |
| 73 | } |
| 74 | |
| 75 | type record BSSAP_N_CONNECT_cfm |
| 76 | { |
| 77 | SCCP_PAR_Address respondingAddress optional, |
| 78 | SCCP_PAR_Quality_Of_Service qualityOfService optional, |
| 79 | PDU_BSSAP userData optional, |
| 80 | SCCP_PAR_Connection_Id connectionId optional, |
| 81 | SCCP_PAR_Importance importance optional |
| 82 | } |
| 83 | |
| 84 | template BSSAP_N_CONNECT_cfm tr_BSSAP_CONNECT_cfm(template SCCP_PAR_Connection_Id conn_id, |
| 85 | template PDU_BSSAP bssap := *) := { |
| 86 | respondingAddress := *, |
| 87 | qualityOfService := *, |
| 88 | userData := bssap, |
| 89 | connectionId := conn_id, |
| 90 | importance := * |
| 91 | } |
| 92 | |
| 93 | type record BSSAP_N_DATA_req |
| 94 | { |
| 95 | PDU_BSSAP userData , |
| 96 | SCCP_PAR_Connection_Id connectionId optional , |
| 97 | SCCP_PAR_Importance importance optional |
| 98 | } |
| 99 | |
| 100 | template BSSAP_N_DATA_req ts_BSSAP_DATA_req(SCCP_PAR_Connection_Id conn_id, |
| 101 | template PDU_BSSAP bssap) := { |
| 102 | userData := bssap, |
| 103 | connectionId := conn_id, |
| 104 | importance := omit |
| 105 | } |
| 106 | |
| 107 | |
| 108 | type record BSSAP_N_DATA_ind |
| 109 | { |
| 110 | PDU_BSSAP userData , |
| 111 | SCCP_PAR_Connection_Id connectionId optional , |
| 112 | SCCP_PAR_Importance importance optional |
| 113 | } |
| 114 | |
| 115 | template BSSAP_N_DATA_ind tr_BSSAP_DATA_ind(SCCP_PAR_Connection_Id conn_id, |
| 116 | template PDU_BSSAP bssap := *) := { |
| 117 | userData := bssap, |
| 118 | connectionId := conn_id, |
| 119 | importance := * |
| 120 | } |
| 121 | |
| 122 | |
| 123 | type record BSSAP_N_DISCONNECT_req |
| 124 | { |
| 125 | SCCP_PAR_Address respondingAddress optional, |
| 126 | SCCP_PAR_Reason reason , |
| 127 | PDU_BSSAP userData optional , |
| 128 | SCCP_PAR_Connection_Id connectionId optional , |
| 129 | SCCP_PAR_Importance importance optional |
| 130 | } |
| 131 | |
| 132 | template BSSAP_N_DISCONNECT_req ts_BSSAP_DISC_req(SCCP_PAR_Connection_Id conn_id, |
| 133 | template SCCP_PAR_Reason reason, |
| 134 | template PDU_BSSAP bssap := omit) := { |
| 135 | respondingAddress := omit, |
| 136 | reason := reason, |
| 137 | userData := bssap, |
| 138 | connectionId := conn_id, |
| 139 | importance := omit |
| 140 | } |
| 141 | |
| 142 | |
| 143 | type record BSSAP_N_DISCONNECT_ind |
| 144 | { |
| 145 | SCCP_PAR_Originator originator , |
| 146 | SCCP_PAR_Address respondingAddress optional , |
| 147 | SCCP_PAR_Reason reason , |
| 148 | PDU_BSSAP userData optional , |
| 149 | SCCP_PAR_Connection_Id connectionId optional , |
| 150 | SCCP_PAR_Importance importance optional |
| 151 | } |
| 152 | |
| 153 | template BSSAP_N_DISCONNECT_ind tr_BSSAP_DISC_ind(template SCCP_PAR_Connection_Id conn_id, |
| 154 | template SCCP_PAR_Originator originator, |
| 155 | template SCCP_PAR_Reason reason, |
| 156 | template PDU_BSSAP bssap := *) := { |
| 157 | originator := originator, |
Harald Welte | 346658d | 2017-12-10 14:10:25 +0100 | [diff] [blame] | 158 | respondingAddress:= *, |
Harald Welte | 36975c8 | 2017-12-09 21:39:57 +0100 | [diff] [blame] | 159 | reason := reason, |
| 160 | userData := bssap, |
| 161 | connectionId := conn_id, |
| 162 | importance := * |
| 163 | } |
| 164 | |
| 165 | type record BSSAP_N_UNITDATA_req |
| 166 | { |
| 167 | SCCP_PAR_Address calledAddress , |
| 168 | SCCP_PAR_Address callingAddress , |
| 169 | SCCP_PAR_Sequence_Control sequenceControl optional , |
| 170 | SCCP_PAR_Return_Option returnOption optional , |
| 171 | PDU_BSSAP userData , |
| 172 | SCCP_PAR_Importance importance optional |
| 173 | } |
| 174 | |
| 175 | template BSSAP_N_UNITDATA_req ts_BSSAP_UNITDATA_req(SCCP_PAR_Address called, SCCP_PAR_Address calling, template PDU_BSSAP payload) := { |
| 176 | calledAddress := called, |
| 177 | callingAddress := calling, |
| 178 | sequenceControl := omit, |
| 179 | returnOption := omit, |
| 180 | userData := payload, |
| 181 | importance := omit |
| 182 | } |
| 183 | |
| 184 | type record BSSAP_N_UNITDATA_ind |
| 185 | { |
| 186 | SCCP_PAR_Address calledAddress , |
| 187 | SCCP_PAR_Address callingAddress , |
| 188 | SCCP_PAR_Sequence_Control sequenceControl optional , |
| 189 | SCCP_PAR_Return_Option returnOption optional , |
| 190 | PDU_BSSAP userData , |
| 191 | SCCP_PAR_Importance importance optional |
| 192 | } |
| 193 | |
| 194 | template BSSAP_N_UNITDATA_ind tr_BSSAP_UNITDATA_ind(template SCCP_PAR_Address called, template SCCP_PAR_Address calling, template PDU_BSSAP payload) := { |
| 195 | calledAddress := called, |
| 196 | callingAddress := calling, |
| 197 | sequenceControl := *, |
| 198 | returnOption := *, |
| 199 | userData := payload, |
| 200 | importance := * |
| 201 | } |
| 202 | |
| 203 | type record BSSAP_N_NOTICE_ind |
| 204 | { |
| 205 | SCCP_PAR_Address calledAddress , |
| 206 | SCCP_PAR_Address callingAddress , |
| 207 | SCCP_PAR_Reason_For_Return reasonForReturn , |
| 208 | PDU_BSSAP userData , |
| 209 | SCCP_PAR_Importance importance optional |
| 210 | } |
| 211 | |
| 212 | |
| 213 | |
| 214 | private function f_dec_ConnectInd(in ASP_SCCP_N_CONNECT_ind pin, out BSSAP_N_CONNECT_ind pout) { |
| 215 | pout.calledAddress := pin.calledAddress; |
| 216 | pout.callingAddress := pin.callingAddress; |
| 217 | pout.qualityOfService := pin.qualityOfService; |
Harald Welte | 510a287 | 2017-12-10 13:48:17 +0100 | [diff] [blame] | 218 | if (ispresent(pin.userData)) { |
| 219 | pout.userData := dec_PDU_BSSAP(pin.userData); |
| 220 | } else { |
| 221 | pout.userData := omit; |
| 222 | } |
Harald Welte | 36975c8 | 2017-12-09 21:39:57 +0100 | [diff] [blame] | 223 | pout.connectionId := pin.connectionId; |
| 224 | pout.importance := pin.importance; |
| 225 | //port.setstate(0); |
| 226 | } with {extension "prototype(fast)" } |
| 227 | |
| 228 | private function f_dec_ConnectCfm(in ASP_SCCP_N_CONNECT_cfm pin, out BSSAP_N_CONNECT_cfm pout) { |
| 229 | pout.respondingAddress := pin.respondingAddress; |
| 230 | pout.qualityOfService := pin.qualityOfService; |
Harald Welte | 510a287 | 2017-12-10 13:48:17 +0100 | [diff] [blame] | 231 | if (ispresent(pin.userData)) { |
| 232 | pout.userData := dec_PDU_BSSAP(pin.userData); |
| 233 | } else { |
| 234 | pout.userData := omit; |
| 235 | } |
Harald Welte | 36975c8 | 2017-12-09 21:39:57 +0100 | [diff] [blame] | 236 | pout.connectionId := pin.connectionId; |
| 237 | pout.importance := pin.importance; |
| 238 | //port.setstate(0); |
| 239 | } with {extension "prototype(fast)" } |
| 240 | |
| 241 | private function f_dec_DataInd(in ASP_SCCP_N_DATA_ind pin, out BSSAP_N_DATA_ind pout) { |
| 242 | pout.userData := dec_PDU_BSSAP(pin.userData); |
| 243 | pout.connectionId := pin.connectionId; |
| 244 | pout.importance := pin.importance; |
| 245 | //port.setstate(0); |
| 246 | } with {extension "prototype(fast)" } |
| 247 | |
| 248 | private function f_dec_DisconnectInd(in ASP_SCCP_N_DISCONNECT_ind pin, out BSSAP_N_DISCONNECT_ind pout) { |
| 249 | pout.originator := pin.originator; |
| 250 | pout.respondingAddress := pin.respondingAddress; |
| 251 | pout.reason := pin.reason; |
Harald Welte | 510a287 | 2017-12-10 13:48:17 +0100 | [diff] [blame] | 252 | if (ispresent(pin.userData)) { |
| 253 | pout.userData := dec_PDU_BSSAP(pin.userData); |
| 254 | } else { |
| 255 | pout.userData := omit; |
| 256 | } |
Harald Welte | 36975c8 | 2017-12-09 21:39:57 +0100 | [diff] [blame] | 257 | pout.connectionId := pin.connectionId; |
| 258 | pout.importance := pin.importance; |
| 259 | //port.setstate(0); |
| 260 | } with {extension "prototype(fast)" } |
| 261 | |
| 262 | private function f_dec_UnitdataInd(in ASP_SCCP_N_UNITDATA_ind pin, out BSSAP_N_UNITDATA_ind pout) { |
| 263 | pout.calledAddress := pin.calledAddress; |
| 264 | pout.callingAddress := pin.callingAddress; |
| 265 | pout.sequenceControl := pin.sequenceControl; |
| 266 | pout.returnOption := pin.returnOption; |
| 267 | pout.userData := dec_PDU_BSSAP(pin.userData); |
| 268 | pout.importance := pin.importance; |
| 269 | //port.setstate(0); |
| 270 | } with {extension "prototype(fast)" } |
| 271 | |
| 272 | private function f_dec_NoticeInd(in ASP_SCCP_N_NOTICE_ind pin, out BSSAP_N_NOTICE_ind pout) { |
| 273 | pout.calledAddress := pin.calledAddress; |
| 274 | pout.callingAddress := pin.callingAddress; |
| 275 | pout.reasonForReturn := pin.reasonForReturn; |
| 276 | pout.userData := dec_PDU_BSSAP(pin.userData); |
| 277 | pout.importance := pin.importance; |
| 278 | //port.setstate(0); |
| 279 | } with {extension "prototype(fast)" } |
| 280 | |
| 281 | |
| 282 | |
| 283 | private function f_enc_ConnectReq(in BSSAP_N_CONNECT_req pin, out ASP_SCCP_N_CONNECT_req pout) { |
| 284 | pout.calledAddress := pin.calledAddress; |
| 285 | pout.callingAddress := pin.callingAddress; |
| 286 | pout.expeditedDataSel := pin.expeditedDataSel; |
| 287 | pout.qualityOfService := pin.qualityOfService; |
Harald Welte | 510a287 | 2017-12-10 13:48:17 +0100 | [diff] [blame] | 288 | if (ispresent(pin.userData)) { |
| 289 | pout.userData := enc_PDU_BSSAP(pin.userData); |
| 290 | } else { |
| 291 | pout.userData := omit; |
| 292 | } |
Harald Welte | 36975c8 | 2017-12-09 21:39:57 +0100 | [diff] [blame] | 293 | pout.connectionId := pin.connectionId; |
| 294 | pout.importance := pin.importance; |
| 295 | //port.setstate(0); |
| 296 | } with {extension "prototype(fast)" } |
| 297 | |
| 298 | private function f_enc_ConnectRes(in BSSAP_N_CONNECT_res pin, out ASP_SCCP_N_CONNECT_res pout) { |
| 299 | pout.respondingAddress := pin.respondingAddress; |
| 300 | pout.expeditedDataSel := pin.expeditedDataSel; |
| 301 | pout.qualityOfService := pin.qualityOfService; |
| 302 | if (ispresent(pin.userData)) { |
| 303 | pout.userData := enc_PDU_BSSAP(pin.userData); |
| 304 | } else { |
| 305 | pout.userData := omit; |
| 306 | } |
| 307 | pout.connectionId := pin.connectionId; |
| 308 | pout.importance := pin.importance; |
| 309 | //port.setstate(0); |
| 310 | } with {extension "prototype(fast)" } |
| 311 | |
| 312 | private function f_enc_DataReq(in BSSAP_N_DATA_req pin, out ASP_SCCP_N_DATA_req pout) { |
| 313 | pout.userData := enc_PDU_BSSAP(pin.userData); |
| 314 | pout.connectionId := pin.connectionId; |
| 315 | pout.importance := pin.importance; |
| 316 | //port.setstate(0); |
| 317 | } with {extension "prototype(fast)" } |
| 318 | |
| 319 | private function f_enc_DisconnectReq(in BSSAP_N_DISCONNECT_req pin, out ASP_SCCP_N_DISCONNECT_req pout) { |
| 320 | pout.respondingAddress := pin.respondingAddress; |
| 321 | pout.reason := pin.reason; |
| 322 | if (ispresent(pin.userData)) { |
| 323 | pout.userData := enc_PDU_BSSAP(pin.userData); |
| 324 | } else { |
| 325 | pout.userData := omit; |
| 326 | } |
| 327 | pout.connectionId := pin.connectionId; |
| 328 | pout.importance := pin.importance; |
| 329 | //port.setstate(0); |
| 330 | } with {extension "prototype(fast)" } |
| 331 | |
| 332 | private function f_enc_UnitdataReq(in BSSAP_N_UNITDATA_req pin, out ASP_SCCP_N_UNITDATA_req pout) { |
| 333 | pout.calledAddress := pin.calledAddress; |
| 334 | pout.callingAddress := pin.callingAddress; |
| 335 | pout.userData := enc_PDU_BSSAP(pin.userData); |
| 336 | pout.sequenceControl := pin.sequenceControl; |
| 337 | pout.returnOption := pin.returnOption; |
| 338 | pout.importance := pin.importance; |
| 339 | //port.setstate(0); |
| 340 | } with {extension "prototype(fast)" } |
| 341 | |
| 342 | |
| 343 | /* |
| 344 | type port BSSAP_CODEC_PT message map to SCCPasp_PT { |
| 345 | out BSSAP_N_CONNECT_req to ASP_SCCP_N_CONNECT_req with f_enc_ConnectReq(), |
| 346 | BSSAP_N_CONNECT_res to ASP_SCCP_N_CONNECT_res with f_enc_ConnectRes(), |
| 347 | BSSAP_N_DATA_req to ASP_SCCP_N_DATA_req with f_enc_DataReq(), |
| 348 | BSSAP_N_DISCONNECT_req to ASP_SCCP_N_DISCONNECT_req with f_enc_DisconnectReq(), |
| 349 | BSSAP_N_UNITDATA_req to ASP_SCCP_N_UNITDATA_req with f_enc_UnitdataReq(), |
| 350 | ASP_SCCP_N_RESET_req, ASP_SCCP_N_RESET_resp; |
| 351 | |
| 352 | in BSSAP_N_CONNECT_ind from ASP_SCCP_N_CONNECT_ind with f_dec_ConnectInd(), |
| 353 | BSSAP_N_CONNECT_cfm from ASP_SCCP_N_CONNECT_cfm with f_dec_ConnectCfm(), |
| 354 | BSSAP_N_DATA_ind from ASP_SCCP_N_DATA_ind with f_dec_DataInd(), |
| 355 | BSSAP_N_DISCONNECT_ind from ASP_SCCP_N_DISCONNECT_ind with f_dec_DisconnectInd(), |
| 356 | BSSAP_N_UNITDATA_ind from ASP_SCCP_N_UNITDATA_ind with f_dec_UnitdataInd(), |
| 357 | BSSAP_N_NOTICE_ind from ASP_SCCP_N_NOTICE_ind with f_dec_NoticeInd(), |
| 358 | ASP_SCCP_N_STATE_ind, ASP_SCCP_N_RESET_ind, ASP_SCCP_N_RESET_cfm; |
| 359 | } with {extension "internal"} |
| 360 | */ |
| 361 | |
| 362 | type port BSSAP_CODEC_PT message { |
| 363 | out BSSAP_N_CONNECT_req, |
| 364 | BSSAP_N_CONNECT_res, |
| 365 | BSSAP_N_DATA_req, |
| 366 | BSSAP_N_DISCONNECT_req, |
| 367 | BSSAP_N_UNITDATA_req, |
| 368 | ASP_SCCP_N_RESET_req; |
| 369 | in BSSAP_N_CONNECT_ind, |
| 370 | BSSAP_N_CONNECT_cfm, |
| 371 | BSSAP_N_DATA_ind, |
| 372 | BSSAP_N_DISCONNECT_ind, |
| 373 | BSSAP_N_UNITDATA_ind, |
| 374 | BSSAP_N_NOTICE_ind, |
| 375 | ASP_SCCP_N_RESET_ind, |
| 376 | ASP_SCCP_N_RESET_cfm, |
| 377 | ASP_SCCP_N_STATE_ind; |
| 378 | } with { extension "internal user SCCPasp_PT |
| 379 | out(BSSAP_N_CONNECT_req -> ASP_SCCP_N_CONNECT_req: function(f_enc_ConnectReq); |
| 380 | BSSAP_N_CONNECT_res -> ASP_SCCP_N_CONNECT_res: function(f_enc_ConnectRes); |
| 381 | BSSAP_N_DATA_req -> ASP_SCCP_N_DATA_req: function(f_enc_DataReq); |
| 382 | BSSAP_N_DISCONNECT_req -> ASP_SCCP_N_DISCONNECT_req: function(f_enc_DisconnectReq); |
| 383 | BSSAP_N_UNITDATA_req -> ASP_SCCP_N_UNITDATA_req: function(f_enc_UnitdataReq); |
| 384 | ASP_SCCP_N_RESET_req -> ASP_SCCP_N_RESET_req: simple) |
| 385 | in(ASP_SCCP_N_CONNECT_ind -> BSSAP_N_CONNECT_ind: function(f_dec_ConnectInd); |
| 386 | ASP_SCCP_N_CONNECT_cfm -> BSSAP_N_CONNECT_cfm: function(f_dec_ConnectCfm); |
| 387 | ASP_SCCP_N_DATA_ind -> BSSAP_N_DATA_ind: function(f_dec_DataInd); |
| 388 | ASP_SCCP_N_DISCONNECT_ind -> BSSAP_N_DISCONNECT_ind: function(f_dec_DisconnectInd); |
| 389 | ASP_SCCP_N_UNITDATA_ind -> BSSAP_N_UNITDATA_ind: function(f_dec_UnitdataInd); |
| 390 | ASP_SCCP_N_NOTICE_ind -> BSSAP_N_NOTICE_ind: function(f_dec_NoticeInd); |
| 391 | ASP_SCCP_N_RESET_ind -> ASP_SCCP_N_RESET_ind: simple; |
| 392 | ASP_SCCP_N_RESET_cfm -> ASP_SCCP_N_RESET_cfm: simple; |
| 393 | ASP_SCCP_N_STATE_ind -> ASP_SCCP_N_STATE_ind: simple)" |
| 394 | } |
| 395 | |
| 396 | |
| 397 | } |