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