blob: 5e269cc51e5ff91dbffb5715ea5437a43bbf0e36 [file] [log] [blame]
Harald Welteac359802017-04-12 12:13:44 +02001///////////////////////////////////////////////////////////////////////////////
2// //
3// Copyright Test Competence Center (TCC) ETH 2008 //
4// //
5// The copyright to the computer program(s) herein is the property of TCC. //
6// The program(s) may be used and/or copied only with the written permission //
7// of TCC or in accordance with the terms and conditions stipulated in the //
8// agreement/contract under which the program(s) have been supplied //
9// //
10///////////////////////////////////////////////////////////////////////////////
11// File: SCCP_Emulation.ttcn
12// Description: SS7 SCCP definitions and dynamic part according to
13// specification ITU-T SS7 SCCP, ANSI ..., ttc ...
14// References: ITU-T: Recommendation Q.711-Q.714,
15// ANSI : T1.111-2001 (MTP) and T1.112-2001 (SCCP)
16// TTC : JT-Q711
17// Rev: R6A05
18// Prodnr: CNL 113 341
19// Updated: 2009-01-26
20// Contact: http://ttcn.ericsson.se
21
22module SCCP_Emulation
23{//startmodule
24
25modulepar
26{
27 float tsp_maxLocalReference := 16777216.0; //loc ref= 0...tsp_maxLocalReference-1
28 float tsp_max_ConnectionId := 16777216.0; //max connection id = 0..tsp_max_ConnectionId -1
29 integer tsp_force_xudt := 0;
30 integer tsp_SIF_MaxLength := 272
31}
32
33import from General_Types all;
34import from MTP3asp_Types all;
35import from MTP3asp_PortType all;
36import from SCCP_Types all;
37import from SCCPasp_Types all;
38import from SCCP_Mapping all;
39
40group SCCPConstants
41{//startgroup SCCPConstants
42
43//------------------------------------------------------------------------------
44// Subsystem Numbers
45//------------------------------------------------------------------------------
46
47const integer cg_SSN_notKnown:=0;
48const integer cg_SSN_sCCPmanagement:=1;
49const integer cg_SSN_reservedForITU:=2;
50const integer cg_SSN_iSUP:=3;
51const integer cg_SSN_oMAP:=4;
52const integer cg_SSN_mAP:=5;
53const integer cg_SSN_hLR:=6;
54const integer cg_SSN_vLR:=7;
55const integer cg_SSN_mSC:=8;
56const integer cg_SSN_eIC:=9;
57const integer cg_SSN_aUC:=10;
58const integer cg_SSN_isdnSS:=11;
59const integer cg_SSN_reservedForIntUse:=12;
60const integer cg_SSN_bISDNe2e:=13;
61const integer cg_SSN_tCtestResponder:=14;
62const integer cg_SSN_rANAP:=142;
63const integer cg_SSN_bSSAP:=254;
64// TCAP has not SSN
65
66//------------------------------------------------------------------------------
67// Routing Indicator values ITU: 3.4.1/Q713.
68//------------------------------------------------------------------------------
69const BIT1n cg_route_on_SSN := '1'B;
70const BIT1n cg_route_on_GT := '0'B;
71
72//------------------------------------------------------------------------------
73// Release Cause
74//------------------------------------------------------------------------------
75
76
77const integer cg_Rel_endUserOrig:=0;
78const integer cg_Rel_endUserCong:=1;
79const integer cg_Rel_endUserFailure:=2;
80const integer cg_Rel_sCCPUserOrig:=3;
81const integer cg_Rel_remProcError:=4;
82const integer cg_Rel_inconsConnData:=5;
83const integer cg_Rel_accessFailure:=6;
84const integer cg_Rel_accessCongestion:=7;
85const integer cg_Rel_subsystFailure:=8;
86const integer cg_Rel_subsystCongest:=9;
87const integer cg_Rel_mTPFailure:=10;
88const integer cg_Rel_networkCongest:=11;
89const integer cg_Rel_expResetTimer:=12;
90const integer cg_Rel_expRecInacTimer:=13;
91const integer cg_Rel_reserved:=14;
92const integer cg_Rel_unqualified:=15;
93const integer cg_Rel_sCCPFailure:=16;
94
95//------------------------------------------------------------------------------
96// Return Cause
97//------------------------------------------------------------------------------
98
99const integer cg_Ret_noTransl4AddrNature:=0;
100const integer cg_Ret_noTransl4SpecifAddr:=1;
101const integer cg_Ret_subsystemCongestion:=2;
102const integer cg_Ret_subsystemFailure:=3;
103const integer cg_Ret_unequippedUser:=4;
104const integer cg_Ret_mTPFailure:=5;
105const integer cg_Ret_networkCongestion:=6;
106const integer cg_Ret_unqualified:=7;
107const integer cg_Ret_errorMessageTransport:=8;
108const integer cg_Ret_errorLocalProcessing:=9;
109const integer cg_Ret_destNoReassembly:=10;
110const integer cg_Ret_sCCPFailure:=11;
111const integer cg_Ret_hopCounterViolation:=12;
112const integer cg_Ret_segmeNotSupported:=13;
113const integer cg_Ret_segmentationFailure:=14;
114
115//------------------------------------------------------------------------------
116// Reset Cause
117//------------------------------------------------------------------------------
118
119
120const integer cg_Res_endUserOrig:=0;
121const integer cg_Res_sCCPUserOrig:=1;
122const integer cg_Res_messOutOfOrder_incPs:=2;
123const integer cg_Res_messOutOfOrder_incPr:=3;
124const integer cg_Res_remProcErr_messOutOfWindow:=4;
125const integer cg_Res_remProcErr_IncPsAfterReinit:=5;
126const integer cg_Res_remProcErr_general:=6;
127const integer cg_Res_remEndUserOperational:=7;
128const integer cg_Res_networkOperational:=8;
129const integer cg_Res_accessOperational:=9;
130const integer cg_Res_networkCongestion:=10;
131const integer cg_Res_reserved:=11;
132const integer cg_Res_unqualified:=12;
133
134//------------------------------------------------------------------------------
135//Error Cause
136//------------------------------------------------------------------------------
137
138const integer cg_Err_unassignedDestinationLRN:=0 ;
139const integer cg_Err_inconsistentSourceLRN:=1 ;
140const integer cg_Err_pointCodeMismatch:=2 ;
141const integer cg_Err_serviceClassMismatch:=3 ;
142const integer cg_Err_unqualified:=4 ;
143
144//------------------------------------------------------------------------------
145//Refusal Cause
146//------------------------------------------------------------------------------
147
148const integer cg_Ref_endUserOrigin:=0;
149const integer cg_Ref_endUserConges:=1;
150const integer cg_Ref_endUserFailure:=2;
151const integer cg_Ref_sCCPUserOrigin:=3;
152const integer cg_Ref_destAddrUnkn:=4;
153const integer cg_Ref_destInaccess:=5;
154const integer cg_Ref_qOSNotAvail_nonTransient:=6;
155const integer cg_Ref_qOSNotAvail_transient:=7;
156const integer cg_Ref_accessFailure:=8;
157const integer cg_Ref_accessCongestion:=9;
158const integer cg_Ref_subsystemFailure:=10;
159const integer cg_Ref_subsystemCongest:=11;
160const integer cg_Ref_expConnEstTimer:=12;
161const integer cg_Ref_incomUserData:=13;
162const integer cg_Ref_reserved:=14;
163const integer cg_Ref_unqualified:=15;
164const integer cg_Ref_hopCounterViol:=16;
165const integer cg_Ref_sCCPFailure:=17;
166const integer cg_Ref_noTransl4address:=18;
167const integer cg_Ref_unequippedUser:=19;
168
169//------------------------------------------------------------------------------
170// Originator
171//------------------------------------------------------------------------------
172
173const integer cg_Undefined:=0;
174const integer cg_NSU:=1;
175const integer cg_NSP:=2;
176
177
178//------------------------------------------------------------------------------
179// CREF Reason
180//------------------------------------------------------------------------------
181
182const integer cg_CREF_endUserOrig:=0;
183const integer cg_CREF_endUserCong:=1;
184const integer cg_CREF_endUserFailure:=2;
185const integer cg_CREF_SCCPUserOrig:=3;
186const integer cg_CREF_destAddrUnknwn_NT:=4;
187const integer cg_CREF_destInaccg_T:=5;
188const integer cg_CREF_QOSUnavail_NT:=6;
189const integer cg_CREF_QOSUnavail_T:=7;
190const integer cg_CREF_accessFailure:=8;
191const integer cg_CREF_accessCong:=9;
192const integer cg_CREF_destInaccg_NT:=10;
193const integer cg_CREF_subsystCong:=11;
194const integer cg_CREF_unspec_T:=12;
195const integer cg_CREF_incompInfo:=13;
196const integer cg_CREF_unspec_NT:=15;
197const integer cg_CREF_undef:=16;
198const integer cg_CREF_hopCntrViolation:=18;
199
200//------------------------------------------------------------------------------
201// DISC Reason
202//------------------------------------------------------------------------------
203
204const integer cg_DISC_normal:=20;
205const integer cg_DISC_endUserCong:=21;
206const integer cg_DISC_endUserFailure:=22;
207const integer cg_DISC_SCCPUserOrig:=23;
208const integer cg_DISC_abnormal_T:=24;
209const integer cg_DISC_accessFailure:=28;
210const integer cg_DISC_accessCong:=29;
211const integer cg_DISC_abnormal_NT:=30;
212const integer cg_DISC_subsystCong:=31;
213const integer cg_DISC_undef:=32;
214const integer cg_DISC_incompInfo:=33;
215const integer cg_DISC_abnormal:=35;
216
217//------------------------------------------------------------------------------
218// RESET Reason
219//------------------------------------------------------------------------------
220const integer cg_RESET_userSynch:= 40 ;
221const integer cg_RESET_unspec:= 41 ;
222const integer cg_RESET_netCong:= 42 ;
223const integer cg_RESET_undef:= 43 ;
224
225//------------------------------------------------------------------------------
226//Mapping Refusal Cause to Reason and Originator A.1/Q.713
227//------------------------------------------------------------------------------
228
229const integer cg_Mapping_RefCause_Orig[19]:=
230{
231 cg_NSU,
232 cg_NSU,
233 cg_NSU,
234 cg_NSU,
235 cg_NSP,
236 cg_NSP,
237 cg_NSP,
238 cg_NSP,
239 cg_NSU,
240 cg_NSU,
241 cg_NSP,
242 cg_NSU,
243 cg_NSP,
244 cg_NSU,
245 cg_NSP,
246 cg_Undefined,
247 cg_NSP,
248 cg_NSP,
249 cg_NSP
250};
251
252
253const integer cg_Mapping_RefCause_Reason[19]:=
254{
255 cg_CREF_endUserOrig,
256 cg_CREF_endUserCong,
257 cg_CREF_endUserFailure,
258 cg_CREF_SCCPUserOrig,
259 cg_CREF_destAddrUnknwn_NT,
260 cg_CREF_destInaccg_T,
261 cg_CREF_QOSUnavail_NT,
262 cg_CREF_QOSUnavail_T,
263 cg_CREF_accessFailure,
264 cg_CREF_accessCong,
265 cg_CREF_destInaccg_NT,
266 cg_CREF_subsystCong,
267 cg_CREF_unspec_T,
268 cg_CREF_incompInfo,
269 cg_CREF_unspec_T,
270 cg_CREF_undef,
271 cg_CREF_hopCntrViolation,
272 cg_CREF_destAddrUnknwn_NT,
273 cg_CREF_destInaccg_NT
274};
275
276//------------------------------------------------------------------------------
277//Mapping Release Cause to Reason and Originator A.2/Q.713
278//------------------------------------------------------------------------------
279
280const integer cg_Mapping_RelCause_Orig[17]:=
281{
282 cg_NSU,
283 cg_NSU,
284 cg_NSU,
285 cg_NSU,
286 cg_NSP,
287 cg_NSP,
288 cg_NSU,
289 cg_NSU,
290 cg_NSP,
291 cg_NSU,
292 cg_NSP,
293 cg_NSP,
294 cg_NSP,
295 cg_NSP,
296 cg_Undefined,
297 cg_Undefined,
298 cg_NSP
299};
300
301//mapping CREF-> ASP_SCCP_N_DISCONNECT_ind:
302//Reason:=cg_Mapping_RefCause_Reason[RefCause];
303//Originator:=cg_Mapping_RefCause_Orig[RefCause];
304
305
306//mapping ASP_SCCP_N_DISCONNECT_req-> CREF:
307//
308
309const integer cg_Mapping_RelCause_Reason[17]:= {
310 cg_DISC_normal,
311 cg_DISC_endUserCong,
312 cg_DISC_endUserFailure,
313 cg_DISC_SCCPUserOrig,
314 cg_DISC_abnormal_T,
315 cg_DISC_abnormal_T,
316 cg_DISC_accessFailure,
317 cg_DISC_accessCong,
318 cg_DISC_abnormal_NT,
319 cg_DISC_subsystCong,
320 cg_DISC_abnormal_NT,
321 cg_DISC_abnormal_T,
322 cg_DISC_abnormal_T,
323 cg_DISC_abnormal_T,
324 cg_DISC_undef,
325 cg_DISC_undef,
326 cg_DISC_abnormal_NT
327};
328
329
330
331//mapping RLSD-> ASP_SCCP_N_DISCONNECT_ind:
332//Reason:=cg_Mapping_RelCause_Reason[RelCause];
333//Originator:=cg_Mapping_RelCause_Orig[RelCause];
334
335//mapping ASP_SCCP_N_DISCONNECT_req-> RLSD:
336//
337
338
339//------------------------------------------------------------------------------
340//Mapping Reset Cause to Reason and Originator A.2/Q.713
341//------------------------------------------------------------------------------
342
343
344const integer cg_Mapping_ResCause_Orig[12]:= {
345 cg_NSU,
346 cg_NSU,
347 cg_NSP,
348 cg_NSP,
349 cg_NSP,
350 cg_NSP,
351 cg_NSP,
352 cg_NSU,
353 cg_NSP,
354 cg_NSU,
355 cg_NSP,
356 cg_Undefined
357};
358
359
360const integer cg_Mapping_ResCause_Reason[12]:= {
361 cg_RESET_userSynch,
362 cg_RESET_userSynch,
363 cg_RESET_unspec,
364 cg_RESET_unspec,
365 cg_RESET_unspec,
366 cg_RESET_unspec,
367 cg_RESET_unspec,
368 cg_RESET_userSynch,
369 cg_RESET_unspec,
370 cg_RESET_userSynch,
371 cg_RESET_netCong,
372 cg_RESET_undef
373};
374
375//mapping RSR-> ASP_SCCP_N_DISCONNECT_ind:
376//Reason:=cg_Mapping_ResCause_Reason[ResCause];
377//Originator:=cg_Mapping_ResCause_Orig[ResCause];
378
379//mapping ASP_SCCP_N_DISCONNECT_req-> RSR:
380//
381
382const integer cg_TimerArraySize := 16;
383
384}//endgroup SCCPConstants
385
386//******************************************************************************
387// PDU templates
388//******************************************************************************
389
390
391group PDUTemplateDefinitionsSending
392{
393
394
395
396//******************************************************************************
397// Message Connection Request (CR) (Q713 $4.2)
398//******************************************************************************
399
400//------------------------------------------------------------------------------
401// Message definition
402//------------------------------------------------------------------------------
403template PDU_SCCP_ConnectionRequest t_PDU_SCCP_ConnectionRequest
404(
405 SCCP_param_SourceLocalReference pl_SLR,
406 SCCP_param_ProtocolClass pl_Proto_Class,
407 SCCP_param_CPartyAddressEnc pl_CalledAddress,
408template SCCP_param_Credit_opt pl_credit,
409template SCCP_param_CPartyAddressEnc_opt pl_CallingAddress ,
410template SCCP_param_Data_opt pl_Data,
411template SCCP_param_HopCounter_opt pl_HopCntr,
412template SCCP_param_Importance_opt pl_Imp,
413template SCCP_param_EndOfOptionalParams pl_eop
414
415):=
416 {
417 messageType:=cr,
418 sourceLocRef:=pl_SLR,
419 protClass:=pl_Proto_Class,
420 pointer1:=2,
421 pointer2:=0,
422 calledPAddress:=pl_CalledAddress,
423 optionalPart:= {
424 credit:=pl_credit,
425 callingPAddress:=pl_CallingAddress,
426 data:=pl_Data,
427 hopCounter:=pl_HopCntr,
428 importance:=pl_Imp
429 },
430 eop:=pl_eop
431 }
432
433
434
435//******************************************************************************
436// Message Connection Confirm (CC) (Q713 $4.3)
437//******************************************************************************
438
439//------------------------------------------------------------------------------
440// Message definition
441//------------------------------------------------------------------------------
442template PDU_SCCP_ConnectionConfirm t_PDU_SCCP_ConnectionConfirm
443(
444 SCCP_param_DestLocalReference pl_DLR,
445 SCCP_param_SourceLocalReference pl_SLR,
446 SCCP_param_ProtocolClass pl_Proto_Class,
447template SCCP_param_Credit_opt pl_credit,
448template SCCP_param_CPartyAddressEnc_opt pl_CalledAddress,
449template SCCP_param_Data_opt pl_Data,
450template SCCP_param_Importance_opt pl_Imp,
451template SCCP_param_EndOfOptionalParams pl_eop
452):=
453 {
454 messageType:=cc,
455 destLocRef:=pl_DLR,
456 sourceLocRef:=pl_SLR,
457 protClass:=pl_Proto_Class,
458 pointer1:=1,
459 optionalPart:= {
460 credit:=pl_credit,
461 calledPAddress:=pl_CalledAddress,
462 data:=pl_Data,
463 importance:=pl_Imp
464 },
465 eop:=pl_eop
466 }
467
468
469//******************************************************************************
470// Message Connection Refused (CREF) (Q713 $4.4)
471//******************************************************************************
472
473//------------------------------------------------------------------------------
474// Message definition
475//------------------------------------------------------------------------------
476template PDU_SCCP_ConnectionRefused t_PDU_SCCP_ConnectionRefused
477(
478 SCCP_param_DestLocalReference pl_DLR,
479 SCCP_param_RefusalCause pl_RefCause,
480template SCCP_param_CPartyAddressEnc_opt pl_CalledAddress,
481template SCCP_param_Data_opt pl_Data,
482template SCCP_param_Importance_opt pl_Imp,
483template SCCP_param_EndOfOptionalParams pl_eop
484):=
485 {
486 messageType:=cref,
487 destLocRef:=pl_DLR,
488 refusalCause:=pl_RefCause,
489 pointer1:=1,
490 optionalPart:= {
491 calledPAddress:=pl_CalledAddress,
492 data:=pl_Data,
493 importance:=pl_Imp
494 },
495 eop:=pl_eop
496 }
497
498
499//******************************************************************************
500// Message Released (RLSD) (Q713 $4.5)
501//******************************************************************************
502
503
504//------------------------------------------------------------------------------
505// Message definition
506//------------------------------------------------------------------------------
507template PDU_SCCP_Released t_PDU_SCCP_Released
508(
509 OCT3 pl_DLR,
510 OCT3 pl_SLR,
511 SCCP_param_ReleaseCause pl_RelCause,
512template SCCP_param_Data_opt pl_Data,
513template SCCP_param_Importance_opt pl_Imp,
514template SCCP_param_EndOfOptionalParams pl_eop
515):=
516 {
517 messageType:=rlsd,
518 destLocRef:=pl_DLR,
519 sourceLocRef:=pl_SLR,
520 releaseCause:=pl_RelCause,
521 pointer1:=1,
522 optionalPart:= {
523 data:=pl_Data,
524 importance:=pl_Imp
525 },
526 eop:=pl_eop
527 }
528
529//******************************************************************************
530// Message Release Complete (RLC) (Q713 $4.6)
531//******************************************************************************
532//------------------------------------------------------------------------------
533// Message definition
534//------------------------------------------------------------------------------
535template PDU_SCCP_ReleaseComplete t_PDU_SCCP_ReleaseComplete
536(
537 OCT3 pl_DLR,
538 OCT3 pl_SLR
539):=
540 {
541 messageType:=rlc,
542 destLocRef:=pl_DLR,
543 sourceLocRef:=pl_SLR
544 }
545
546
547
548//******************************************************************************
549// Message Data form 1 (DT1) (Q713 $4.7)
550//******************************************************************************
551//------------------------------------------------------------------------------
552// Message definition
553//------------------------------------------------------------------------------
554template PDU_SCCP_DataForm1 t_PDU_SCCP_DataForm1
555(
556 OCT3 pl_DLR,
557 SCCP_param_SegmentingReassembl pl_SegmReasm,
558 SCCP_param_Data pl_Data
559):=
560 {
561 messageType:=dt1,
562 destLocRef:=pl_DLR,
563 segmentingReassembl:=pl_SegmReasm,
564 pointer1:=1,
565 data:=pl_Data
566 }
567
568
569
570//******************************************************************************
571// Message Data form 2 (DT2) (Q713 $4.8)
572//******************************************************************************
573//------------------------------------------------------------------------------
574// Not supported
575//------------------------------------------------------------------------------
576
577//******************************************************************************
578// Message Data Acknowledgement (AK) (Q713 $4.9)
579//******************************************************************************
580//------------------------------------------------------------------------------
581// Not supported
582//------------------------------------------------------------------------------
583
584
585//******************************************************************************
586// Message Unitdata (UDT) (Q713 $4.10)
587//******************************************************************************
588//------------------------------------------------------------------------------
589// Message definition
590//------------------------------------------------------------------------------
591template PDU_SCCP_Unitdata t_PDU_SCCP_Unitdata
592(
593 SCCP_param_ProtocolClass pl_Proto_Class,
594 SCCP_param_CPartyAddressEnc pl_CalledAddress,
595 SCCP_param_CPartyAddressEnc pl_CallingAddress,
596 SCCP_param_Data pl_Data
597):=
598 {
599 messageType :=udt,
600 protClass :=pl_Proto_Class,
601 pointer1:=3,
602 pointer2:=0,
603 pointer3:=0,
604 calledPAddress := pl_CalledAddress,
605 callingPAddress := pl_CallingAddress,
606 data:=pl_Data
607 }
608
609
610
611//******************************************************************************
612// Message Unitdata service (UDTS) (Q713 $4.11)
613//******************************************************************************
614//------------------------------------------------------------------------------
615// Message definition
616//------------------------------------------------------------------------------
617template PDU_SCCP_UnitdataService t_PDU_SCCP_UnitdataService
618(
619 SCCP_param_ReturnCause pl_RetCause,
620 SCCP_param_CPartyAddressEnc pl_CalledAddress,
621 SCCP_param_CPartyAddressEnc pl_CallingAddress,
622 SCCP_param_Data pl_Data
623):=
624 {
625 messageType:=udts,
626 returnCause:=pl_RetCause,
627 pointer1:=3,
628 pointer2:=0,
629 pointer3:=0,
630 calledPAddress:=pl_CalledAddress,
631 callingPAddress:=pl_CallingAddress,
632 data:=pl_Data
633 }
634
635//******************************************************************************
636// Message Expedited Data (ED) (Q713 $4.12)
637//******************************************************************************
638//------------------------------------------------------------------------------
639// Not supported
640//------------------------------------------------------------------------------
641
642
643//******************************************************************************
644// Message Expedited Data Acknowledgement (EA) (Q713 $4.13)
645//******************************************************************************
646//------------------------------------------------------------------------------
647// Not supported
648//------------------------------------------------------------------------------
649
650//******************************************************************************
651// Message Reset Request (RSR) (Q713 $4.14)
652//******************************************************************************
653//------------------------------------------------------------------------------
654// Message definition
655//------------------------------------------------------------------------------
656template PDU_SCCP_ResetRequest t_PDU_SCCP_ResetRequest
657(
658 SCCP_param_DestLocalReference pl_DLR,
659 SCCP_param_SourceLocalReference pl_SLR,
660 SCCP_param_ResetCause pl_ResCause
661):=
662 {
663 messageType:=rsr,
664 destLocRef:=pl_DLR,
665 sourceLocRef:=pl_SLR,
666 resetCause:=pl_ResCause
667 }
668
669
670//******************************************************************************
671// Message Reset Confirmation (RSC) (Q713 $4.15)
672//******************************************************************************
673//------------------------------------------------------------------------------
674// Message definition
675//------------------------------------------------------------------------------
676 template PDU_SCCP_ResetConfirm t_PDU_SCCP_ResetConfirm
677 (
678 SCCP_param_DestLocalReference pl_DLR,
679 SCCP_param_SourceLocalReference pl_SLR
680 ):=
681 {
682 messageType:=rsr,
683 destLocRef:=pl_DLR,
684 sourceLocRef:=pl_SLR
685 }
686
687//******************************************************************************
688// Message Protocol data unit error (ERR) (Q713 $4.16)
689//******************************************************************************
690//------------------------------------------------------------------------------
691// Message definition
692//------------------------------------------------------------------------------
693template PDU_SCCP_ProtDataUnitError t_PDU_SCCP_ProtDataUnitError
694(
695 SCCP_param_DestLocalReference pl_DLR,
696 SCCP_param_ErrorCause pl_ErrCause
697):=
698 {
699 messageType:=rsr,
700 destLocRef:=pl_DLR,
701 errorCause:=pl_ErrCause
702 }
703
704
705//******************************************************************************
706// Message Inactivity test (IT) (Q713 $4.17)
707//******************************************************************************
708//------------------------------------------------------------------------------
709// Message definition
710//------------------------------------------------------------------------------
711template PDU_SCCP_InactivityTest t_PDU_SCCP_InactivityTest
712(
713 SCCP_param_DestLocalReference pl_DLR,
714 SCCP_param_SourceLocalReference pl_SLR,
715 SCCP_param_ProtocolClass pl_Proto_Class,
716 SCCP_param_SequencingSegmenting pl_SeqSegm,
717 SCCP_param_Credit pl_credit
718):=
719 {
720 messageType:=it,
721 destLocRef:=pl_DLR,
722 sourceLocRef:=pl_SLR,
723 protClass:=pl_Proto_Class,
724 sequencingSegmenting:=pl_SeqSegm,
725 credit:=pl_credit
726 }
727
728
729//******************************************************************************
730// Message Extended Unitdata (XUDT) (Q713 $4.18)
731//******************************************************************************
732//------------------------------------------------------------------------------
733
734template PDU_SCCP_ExtUnitdata t_PDU_SCCP_ExtUnitdata
735(
736 SCCP_param_ProtocolClass pl_Proto_Class,
737 SCCP_param_HopCounter pl_hopCounter,
738 SCCP_param_CPartyAddressEnc pl_calledPAddress,
739 SCCP_param_CPartyAddressEnc pl_callingPAddress,
740 SCCP_param_Data pl_data,
741template SCCP_param_Segmentation_opt pl_segm,
742template SCCP_param_Importance_opt pl_imp
743):=
744 {
745 messageType:= xudt,
746 protClass:=pl_Proto_Class,
747 hopCounter:=pl_hopCounter,
748 pointer1:=0,
749 pointer2:=0,
750 pointer3:=0,
751 pointer4:=0,
752 calledPAddress:=pl_calledPAddress,
753 callingPAddress:=pl_callingPAddress,
754 data := pl_data,
755 optionalPart:= {
756 segmentation:=pl_segm,
757 importance := pl_imp
758 },
759 eop:= { paramName:=con_SCCP_eop }
760 }
761
762
763//******************************************************************************
764// Message Extended Unitdata Service(XUDTS) (Q713 $4.19)
765//******************************************************************************
766//------------------------------------------------------------------------------
767
768//------------------------------------------------------------------------------
769// Not supported
770//------------------------------------------------------------------------------
771
772
773
774//******************************************************************************
775// Message Long Unitdata (LUDT) (Q713 $4.20)
776//******************************************************************************
777//------------------------------------------------------------------------------
778
779//------------------------------------------------------------------------------
780// Not supported
781//------------------------------------------------------------------------------
782
783
784//******************************************************************************
785// Message Long Unitdata Service (LUDTS) (Q713 $4.21)
786//******************************************************************************
787
788//------------------------------------------------------------------------------
789// Not supported
790//------------------------------------------------------------------------------
791
792
793//******************************************************************************
794// SCCP management messages (Q713 $5.3)
795//******************************************************************************
796//------------------------------------------------------------------------------
797// Not supported
798//------------------------------------------------------------------------------
799
800
801
802}//endgroup PDUTemplateDefinitionsSending
803
804//******************************************************************************
805
806group PDUTemplateDefinitionsReceiving
807{
808
809
810
811//******************************************************************************
812// Message Connection Request (CR) (Q713 $4.2)
813//******************************************************************************
814
815//------------------------------------------------------------------------------
816// Message definition
817//------------------------------------------------------------------------------
818 template PDU_SCCP_ConnectionRequest tr_PDU_SCCP_ConnectionRequest:=
819 {
820 messageType:=cr,
821 sourceLocRef:=?,
822 protClass:=?,
823 pointer1:=?,
824 pointer2:=?,
825 calledPAddress:=?,
826 optionalPart:= {
827 credit:=*,
828 callingPAddress:=*,
829 data:=*,
830 hopCounter:=*,
831 importance:=*
832 },
833 eop:=*
834 }
835
836
837
838//******************************************************************************
839// Message Connection Confirm (CC) (Q713 $4.3)
840//******************************************************************************
841
842
843
844//------------------------------------------------------------------------------
845// Message definition
846//------------------------------------------------------------------------------
847template PDU_SCCP_ConnectionConfirm tr_PDU_SCCP_ConnectionConfirm:=
848{
849 messageType:=cc,
850 destLocRef:=?,
851 sourceLocRef:=?,
852 protClass:=?,
853 pointer1:=?,
854 optionalPart:= {
855 credit:=*,
856 calledPAddress:=*,
857 data:=*,
858 importance:=*
859 },
860 eop:=*
861}
862
863
864//******************************************************************************
865// Message Connection Refused (CREF) (Q713 $4.4)
866//******************************************************************************
867
868//------------------------------------------------------------------------------
869// Message definition
870//------------------------------------------------------------------------------
871template PDU_SCCP_ConnectionRefused tr_PDU_SCCP_ConnectionRefused:=
872{
873 messageType:=cref,
874 destLocRef:=?,
875 refusalCause:=?,
876 pointer1:=?,
877 optionalPart:= {
878 calledPAddress:=*,
879 data:=*,
880 importance:=*
881 },
882 eop:=*
883}
884
885
886//******************************************************************************
887// Message Released (RLSD) (Q713 $4.5)
888//******************************************************************************
889
890//------------------------------------------------------------------------------
891// Message definition
892//------------------------------------------------------------------------------
893template PDU_SCCP_Released tr_PDU_SCCP_Released:=
894{
895 messageType:=rlsd,
896 destLocRef:=?,
897 sourceLocRef:=?,
898 releaseCause:=?,
899 pointer1:=?,
900 optionalPart:= {
901 data:=*,
902 importance:=*
903 },
904 eop:=*
905}
906
907
908
909//******************************************************************************
910// Message Release Complete (RLC) (Q713 $4.6)
911//******************************************************************************
912//------------------------------------------------------------------------------
913// Message definition
914//------------------------------------------------------------------------------
915
916template PDU_SCCP_ReleaseComplete tr_PDU_SCCP_ReleaseComplete:=
917{
918 messageType:=rlc,
919 destLocRef:=?,
920 sourceLocRef:=?
921}
922
923
924
925//******************************************************************************
926// Message Data form 1 (DT1) (Q713 $4.7)
927//******************************************************************************
928//------------------------------------------------------------------------------
929// Message definition
930//------------------------------------------------------------------------------
931template PDU_SCCP_DataForm1 tr_PDU_SCCP_DataForm1:=
932{
933 messageType:=dt1,
934 destLocRef:=?,
935 segmentingReassembl:=?,
936 pointer1:=?,
937 data:=?
938}
939
940//******************************************************************************
941// Message Data form 2 (DT2) (Q713 $4.8)
942//******************************************************************************
943//------------------------------------------------------------------------------
944// Not supported
945//------------------------------------------------------------------------------
946
947//******************************************************************************
948// Message Data Acknowledgement (AK) (Q713 $4.9)
949//******************************************************************************
950//------------------------------------------------------------------------------
951// Not supported
952//------------------------------------------------------------------------------
953
954
955//******************************************************************************
956// Message Unitdata (UDT) (Q713 $4.10)
957//******************************************************************************
958//------------------------------------------------------------------------------
959// Message definition
960//------------------------------------------------------------------------------
961
962template PDU_SCCP_Unitdata tr_PDU_SCCP_Unitdata:=
963{
964 messageType:=udt,
965 protClass:=?,
966 pointer1:=?,
967 pointer2:=?,
968 pointer3:=?,
969 calledPAddress:=?,
970 callingPAddress:=?,
971 data:=?
972}
973
974//******************************************************************************
975// Message Unitdata service (UDTS) (Q713 $4.11)
976//******************************************************************************
977//------------------------------------------------------------------------------
978// Message definition
979//------------------------------------------------------------------------------
980
981template PDU_SCCP_UnitdataService tr_PDU_SCCP_UnitdataService:=
982{
983 messageType:=udts,
984 returnCause:=?,
985 pointer1:=?,
986 pointer2:=?,
987 pointer3:=?,
988 calledPAddress:=?,
989 callingPAddress:=?,
990 data:=?
991}
992
993//******************************************************************************
994// Message Expedited Data (ED) (Q713 $4.12)
995//******************************************************************************
996//------------------------------------------------------------------------------
997// Not supported
998//------------------------------------------------------------------------------
999
1000
1001//******************************************************************************
1002// Message Expedited Data Acknowledgement (EA) (Q713 $4.13)
1003//******************************************************************************
1004//------------------------------------------------------------------------------
1005// Not supported
1006//------------------------------------------------------------------------------
1007
1008//******************************************************************************
1009// Message Reset Request (RSR) (Q713 $4.14)
1010//******************************************************************************
1011
1012template PDU_SCCP_ResetRequest tr_PDU_SCCP_ResetRequest:=
1013{
1014 messageType:=rsr,
1015 destLocRef:=?,
1016 sourceLocRef:=?,
1017 resetCause:=?
1018}
1019
1020//******************************************************************************
1021// Message Reset Confirmation (RSC) (Q713 $4.15)
1022//******************************************************************************
1023
1024template PDU_SCCP_ResetConfirm tr_PDU_SCCP_ResetConfirm:=
1025{
1026 messageType:=rsr,
1027 destLocRef:=?,
1028 sourceLocRef:=?
1029}
1030
1031//******************************************************************************
1032// Message Protocol data unit error (ERR) (Q713 $4.16)
1033//******************************************************************************
1034
1035template PDU_SCCP_ProtDataUnitError tr_PDU_SCCP_ProtDataUnitError:=
1036{
1037 messageType:=rsr,
1038 destLocRef:=?,
1039 errorCause:=?
1040}
1041
1042//******************************************************************************
1043// Message Inactivity test (IT) (Q713 $4.17)
1044//******************************************************************************
1045
1046template PDU_SCCP_InactivityTest tr_PDU_SCCP_InactivityTest:=
1047{
1048 messageType:=it,
1049 destLocRef:=?,
1050 sourceLocRef:=?,
1051 protClass:=?,
1052 sequencingSegmenting:=?,
1053 credit:=?
1054}
1055
1056//******************************************************************************
1057// Message Extended Unitdata (XUDT) (Q713 $4.18)
1058//******************************************************************************
1059
1060
1061template PDU_SCCP_ExtUnitdata tr_PDU_SCCP_ExtUnitdata :=
1062{
1063 messageType:=xudt,
1064 protClass:= ?, //connection oriented but no flow control
1065 hopCounter:=?,
1066 pointer1:=?,
1067 pointer2:=?,
1068 pointer3:=?,
1069 pointer4:=?,
1070 calledPAddress:=?,
1071 callingPAddress:=?,
1072 data := ?,
1073 optionalPart:= {
1074 segmentation:=*,
1075 importance := *
1076 },
1077 eop:= *
1078}
1079
1080//------------------------------------------------------------------------------
1081
1082//******************************************************************************
1083// Message Extended Unitdata Service(XUDTS) (Q713 $4.19)
1084//******************************************************************************
1085//------------------------------------------------------------------------------
1086
1087//------------------------------------------------------------------------------
1088// Not supported
1089//------------------------------------------------------------------------------
1090
1091//******************************************************************************
1092// Message Long Unitdata (LUDT) (Q713 $4.20)
1093//******************************************************************************
1094//------------------------------------------------------------------------------
1095
1096//------------------------------------------------------------------------------
1097// Not supported
1098//------------------------------------------------------------------------------
1099
1100
1101//******************************************************************************
1102// Message Long Unitdata Service (LUDTS) (Q713 $4.21)
1103//******************************************************************************
1104
1105//------------------------------------------------------------------------------
1106// Not supported
1107//------------------------------------------------------------------------------
1108
1109
1110//******************************************************************************
1111// SCCP management messages (Q713 $5.3)
1112//******************************************************************************
1113//------------------------------------------------------------------------------
1114// Not supported
1115//------------------------------------------------------------------------------
1116
1117
1118
1119}//endgroup PDUTemplateDefinitionsReceiving
1120
1121type record of boolean Timer_Snapshot;
1122type enumerated TimerIdentifierType {conn_est, ias, iar, rel, repeat_rel, int, reset,internal_reset, t_guard};
1123
1124
1125type component SCCP_CT
1126{ //startcomponent SCCP_CT
1127
1128 //Component variables
1129 //***************************************************************
1130 // Connection Oriented Signalling:
1131 // StateTransition-> ConnectionData;
1132 var ConnectionData ConnectionTable[16]; //16 connections 0 to 15
1133 var integer v_session; // actual conn. oriented session index
1134
1135 // Connectioenless Signalling:
1136 //== sending ==
1137 var OCT3 segmLocRefTable[16];
1138 var integer v_segmLocRefIndex; // last index in segmLocRefTable, cyclical incremented
1139 //==receiving==
1140 var ClessRcvBuff ClessRcvBuffTable[16];
1141
1142 var integer v_reference; // not used ???
1143
1144 var hexstring v_own_GT;
1145 var hexstring v_remote_GT;
1146 var integer v_SSN;
1147 var OCT1 v_SIO;
1148 var integer v_NI; //network indicator, if NI<2 => international
1149 var integer v_own_SPC;
1150 var integer v_remote_SPC;
1151 var integer v_SLS;
1152
1153 var SCCP_ServiceType v_SCCPServiceType; //enum: itu, ansi, ttc or mpt
1154 //var v_maxLocalReference; // Local Reference max. value, see in SCCP.ttcn
1155 var integer v_PC_length; //length of point code, calculated at start! NOT USED
1156 var integer v_RoutingLabelLen; //in bytes
1157 var integer v_sccp_data_maxlen; // dt1 payload length upper limit
1158 var integer v_sccp_pdu_maxlen; // SIF len -routing label len
1159
1160 var Timer_Snapshot v_T_conn_est;
1161 var Timer_Snapshot v_T_ias;
1162 var Timer_Snapshot v_T_iar;
1163 var Timer_Snapshot v_T_rel;
1164 var Timer_Snapshot v_T_repeat_rel;
1165 var Timer_Snapshot v_T_int;
1166 var Timer_Snapshot v_T_reset;
1167 var Timer_Snapshot v_T_internal_reset;
1168 var Timer_Snapshot v_T_guard;
1169 //var Timer_Snapshot v_T_T_guard;
1170 //***************************************************************
1171
1172 port SCCPasp_SP_PT SCCP_SP_PORT;//port type defined in SCCP_ASPs
1173 port MTP3asp_SCCP_PT MTP3_SCCP_PORT;
1174
1175 //component timers
1176
1177 timer T_conn_est[cg_TimerArraySize]:= { tspc_timer_T_conn_est,tspc_timer_T_conn_est,
1178 tspc_timer_T_conn_est,tspc_timer_T_conn_est,
1179 tspc_timer_T_conn_est,tspc_timer_T_conn_est,
1180 tspc_timer_T_conn_est,tspc_timer_T_conn_est,
1181 tspc_timer_T_conn_est,tspc_timer_T_conn_est,
1182 tspc_timer_T_conn_est,tspc_timer_T_conn_est,
1183 tspc_timer_T_conn_est,tspc_timer_T_conn_est,
1184 tspc_timer_T_conn_est,tspc_timer_T_conn_est };
1185
1186 timer T_ias[cg_TimerArraySize]:= { tspc_timer_T_ias,tspc_timer_T_ias,
1187 tspc_timer_T_ias,tspc_timer_T_ias,
1188 tspc_timer_T_ias,tspc_timer_T_ias,
1189 tspc_timer_T_ias,tspc_timer_T_ias,
1190 tspc_timer_T_ias,tspc_timer_T_ias,
1191 tspc_timer_T_ias,tspc_timer_T_ias,
1192 tspc_timer_T_ias,tspc_timer_T_ias,
1193 tspc_timer_T_ias,tspc_timer_T_ias };
1194
1195 timer T_iar[cg_TimerArraySize]:= { tspc_timer_T_iar,tspc_timer_T_iar,
1196 tspc_timer_T_iar,tspc_timer_T_iar,
1197 tspc_timer_T_iar,tspc_timer_T_iar,
1198 tspc_timer_T_iar,tspc_timer_T_iar,
1199 tspc_timer_T_iar,tspc_timer_T_iar,
1200 tspc_timer_T_iar,tspc_timer_T_iar,
1201 tspc_timer_T_iar,tspc_timer_T_iar,
1202 tspc_timer_T_iar,tspc_timer_T_iar };
1203
1204 timer T_rel[cg_TimerArraySize]:= { tspc_timer_T_rel,tspc_timer_T_rel,
1205 tspc_timer_T_rel,tspc_timer_T_rel,
1206 tspc_timer_T_rel,tspc_timer_T_rel,
1207 tspc_timer_T_rel,tspc_timer_T_rel,
1208 tspc_timer_T_rel,tspc_timer_T_rel,
1209 tspc_timer_T_rel,tspc_timer_T_rel,
1210 tspc_timer_T_rel,tspc_timer_T_rel,
1211 tspc_timer_T_rel,tspc_timer_T_rel };
1212
1213 timer T_repeat_rel[cg_TimerArraySize]:= { tspc_timer_T_repeat_rel,tspc_timer_T_repeat_rel,
1214 tspc_timer_T_repeat_rel,tspc_timer_T_repeat_rel,
1215 tspc_timer_T_repeat_rel,tspc_timer_T_repeat_rel,
1216 tspc_timer_T_repeat_rel,tspc_timer_T_repeat_rel,
1217 tspc_timer_T_repeat_rel,tspc_timer_T_repeat_rel,
1218 tspc_timer_T_repeat_rel,tspc_timer_T_repeat_rel,
1219 tspc_timer_T_repeat_rel,tspc_timer_T_repeat_rel,
1220 tspc_timer_T_repeat_rel,tspc_timer_T_repeat_rel };
1221
1222 timer T_int[cg_TimerArraySize]:= { tspc_timer_T_int,tspc_timer_T_int,
1223 tspc_timer_T_int,tspc_timer_T_int,
1224 tspc_timer_T_int,tspc_timer_T_int,
1225 tspc_timer_T_int,tspc_timer_T_int,
1226 tspc_timer_T_int,tspc_timer_T_int,
1227 tspc_timer_T_int,tspc_timer_T_int,
1228 tspc_timer_T_int,tspc_timer_T_int,
1229 tspc_timer_T_int,tspc_timer_T_int };
1230
1231
1232/* timer T_T_guard[cg_TimerArraySize]:= { tspc_timer_T_guard,tspc_timer_T_guard,
1233 tspc_timer_T_guard,tspc_timer_T_guard,
1234 tspc_timer_T_guard,tspc_timer_T_guard,
1235 tspc_timer_T_guard,tspc_timer_T_guard,
1236 tspc_timer_T_guard,tspc_timer_T_guard,
1237 tspc_timer_T_guard,tspc_timer_T_guard,
1238 tspc_timer_T_guard,tspc_timer_T_guard,
1239 tspc_timer_T_guard,tspc_timer_T_guard };
1240*/
1241
1242 timer T_reset[cg_TimerArraySize]:= { tspc_timer_T_reset,tspc_timer_T_reset,
1243 tspc_timer_T_reset,tspc_timer_T_reset,
1244 tspc_timer_T_reset,tspc_timer_T_reset,
1245 tspc_timer_T_reset,tspc_timer_T_reset,
1246 tspc_timer_T_reset,tspc_timer_T_reset,
1247 tspc_timer_T_reset,tspc_timer_T_reset,
1248 tspc_timer_T_reset,tspc_timer_T_reset,
1249 tspc_timer_T_reset,tspc_timer_T_reset };
1250
1251
1252 timer T_internal_reset[cg_TimerArraySize]:= { tspc_timer_T_internal_reset,tspc_timer_T_internal_reset,
1253 tspc_timer_T_internal_reset,tspc_timer_T_internal_reset,
1254 tspc_timer_T_internal_reset,tspc_timer_T_internal_reset,
1255 tspc_timer_T_internal_reset,tspc_timer_T_internal_reset,
1256 tspc_timer_T_internal_reset,tspc_timer_T_internal_reset,
1257 tspc_timer_T_internal_reset,tspc_timer_T_internal_reset,
1258 tspc_timer_T_internal_reset,tspc_timer_T_internal_reset,
1259 tspc_timer_T_internal_reset,tspc_timer_T_internal_reset };
1260
1261
1262 timer T_guard[cg_TimerArraySize]:= { tspc_timer_guard,tspc_timer_guard,
1263 tspc_timer_guard,tspc_timer_guard,
1264 tspc_timer_guard,tspc_timer_guard,
1265 tspc_timer_guard,tspc_timer_guard,
1266 tspc_timer_guard,tspc_timer_guard,
1267 tspc_timer_guard,tspc_timer_guard,
1268 tspc_timer_guard,tspc_timer_guard,
1269 tspc_timer_guard,tspc_timer_guard };
1270
1271}//endcomponent SCCP_CT
1272
1273
1274group SCCPFunctions
1275{//startgroup SCCPFunctions
1276 //******************************************************************
1277 function f_StartTimer(TimerIdentifierType pl_TimerIdentifier,integer pl_TimerIndex,float pl_duration := -1.0) runs on SCCP_CT
1278 //******************************************************************
1279 {
1280 select (pl_TimerIdentifier)
1281 {
1282 case(conn_est)
1283 {
1284 if(pl_duration < 0.0){
1285 T_conn_est[pl_TimerIndex].start;
1286 v_T_conn_est[pl_TimerIndex] := true;
1287 }
1288 else{
1289 T_conn_est[pl_TimerIndex].start(pl_duration);
1290 v_T_conn_est[pl_TimerIndex] := true;
1291 }
1292 }
1293 case(ias)
1294 {
1295 if(pl_duration < 0.0){
1296 T_ias[pl_TimerIndex].start;
1297 v_T_ias[pl_TimerIndex] := true;
1298 }
1299 else{
1300 T_ias[pl_TimerIndex].start(pl_duration);
1301 v_T_ias[pl_TimerIndex] := true;
1302 }
1303 }
1304 case(iar)
1305 {
1306 if(pl_duration < 0.0){
1307 T_iar[pl_TimerIndex].start;
1308 v_T_iar[pl_TimerIndex] := true;
1309 }
1310 else{
1311 T_iar[pl_TimerIndex].start(pl_duration);
1312 v_T_iar[pl_TimerIndex] := true;
1313 }
1314 }
1315 case(rel)
1316 {
1317 if(pl_duration < 0.0){
1318 T_rel[pl_TimerIndex].start;
1319 v_T_rel[pl_TimerIndex] := true;
1320 }
1321 else{
1322 T_rel[pl_TimerIndex].start(pl_duration);
1323 v_T_rel[pl_TimerIndex] := true;
1324 }
1325 }
1326 case(repeat_rel)
1327 {
1328 if(pl_duration < 0.0){
1329 T_repeat_rel[pl_TimerIndex].start;
1330 v_T_repeat_rel[pl_TimerIndex] := true;
1331 }
1332 else{
1333 T_repeat_rel[pl_TimerIndex].start(pl_duration);
1334 v_T_repeat_rel[pl_TimerIndex] := true;
1335 }
1336 }
1337 case(int)
1338 {
1339 if(pl_duration < 0.0){
1340 T_int[pl_TimerIndex].start;
1341 v_T_int[pl_TimerIndex] := true;
1342 }
1343 else{
1344 T_int[pl_TimerIndex].start(pl_duration);
1345 v_T_int[pl_TimerIndex] := true;
1346 }
1347 }
1348 case(reset)
1349 {
1350 if(pl_duration < 0.0){
1351 T_reset[pl_TimerIndex].start;
1352 v_T_reset[pl_TimerIndex] := true;
1353 }
1354 else{
1355 T_reset[pl_TimerIndex].start(pl_duration);
1356 v_T_reset[pl_TimerIndex] := true;
1357 }
1358 }
1359 case(internal_reset)
1360 {
1361 if(pl_duration < 0.0){
1362 T_internal_reset[pl_TimerIndex].start;
1363 v_T_internal_reset[pl_TimerIndex] := true;
1364 }
1365 else{
1366 T_internal_reset[pl_TimerIndex].start(pl_duration);
1367 v_T_internal_reset[pl_TimerIndex] := true;
1368 }
1369 }
1370 case(t_guard)
1371 {
1372 if(pl_duration < 0.0){
1373 T_guard[pl_TimerIndex].start;
1374 v_T_guard[pl_TimerIndex] := true;
1375 }
1376 else{
1377 T_guard[pl_TimerIndex].start(pl_duration);
1378 v_T_guard[pl_TimerIndex] := true;
1379 }
1380 }
1381 case else
1382 {log("Warning: Incorrect Timer!")}
1383 }
1384 }
1385 //******************************************************************
1386 function f_StopTimer(TimerIdentifierType pl_TimerIdentifier,integer pl_TimerIndex) runs on SCCP_CT
1387 //******************************************************************
1388 {
1389 select (pl_TimerIdentifier)
1390 {
1391 case(conn_est)
1392 {
1393 T_conn_est[pl_TimerIndex].stop;
1394 v_T_conn_est[pl_TimerIndex] := false;
1395 }
1396 case(ias)
1397 {
1398 T_ias[pl_TimerIndex].stop;
1399 v_T_ias[pl_TimerIndex] := false;
1400 }
1401 case(iar)
1402 {
1403 T_iar[pl_TimerIndex].stop;
1404 v_T_iar[pl_TimerIndex] := false;
1405 }
1406 case(rel)
1407 {
1408 T_rel[pl_TimerIndex].stop;
1409 v_T_rel[pl_TimerIndex] := false;
1410 }
1411 case(repeat_rel)
1412 {
1413 T_repeat_rel[pl_TimerIndex].stop;
1414 v_T_repeat_rel[pl_TimerIndex] := false;
1415 }
1416 case(int)
1417 {
1418 T_int[pl_TimerIndex].stop;
1419 v_T_int[pl_TimerIndex] := false;
1420 }
1421 case(reset)
1422 {
1423 T_reset[pl_TimerIndex].stop;
1424 v_T_reset[pl_TimerIndex] := false;
1425 }
1426 case(internal_reset)
1427 {
1428 T_internal_reset[pl_TimerIndex].stop;
1429 v_T_internal_reset[pl_TimerIndex] := false;
1430 }
1431 case(t_guard)
1432 {
1433 T_guard[pl_TimerIndex].stop;
1434 v_T_guard[pl_TimerIndex] := false;
1435 }
1436 case else
1437 {log("Warning: Incorrect Timer!")}
1438 }
1439 }
1440
1441 //******************************************************************
1442 function f_initialize_timer_states() runs on SCCP_CT
1443 //******************************************************************
1444 {
1445 var integer i;
1446 for (i:=0; i<cg_TimerArraySize;i:=i+1) {
1447 v_T_conn_est[i] := false;
1448 v_T_ias[i] := false;
1449 v_T_iar[i] := false;
1450 v_T_rel[i] := false;
1451 v_T_repeat_rel[i] := false;
1452 v_T_int[i] := false;
1453 v_T_reset[i] := false;
1454 v_T_internal_reset[i] := false;
1455 v_T_guard[i] := false;
1456 }
1457 }
1458
1459 //******************************************************************
1460 function SCCPStart(MSC_SCCP_MTP3_parameters pl_Boot) runs on SCCP_CT
1461 //******************************************************************
1462 {
1463 //local declarations
1464 var integer vl_j;
1465
1466 //initializes variables with 'SCCP_CT' visibility/scope
1467 v_segmLocRefIndex := 0;
1468 v_reference:=0;
1469 v_SIO:= bit2oct(pl_Boot.sio.ni & pl_Boot.sio.prio & pl_Boot.sio.si);
1470 v_NI := oct2int(v_SIO)/64;
1471 v_own_SPC:=pl_Boot.opc;
1472 v_remote_SPC:=pl_Boot.dpc;
1473 v_SLS:=pl_Boot.sls;
1474 v_SCCPServiceType := pl_Boot.sccp_serviceType;
1475
1476 if (ispresent(pl_Boot.ssn))
1477 {
1478 v_SSN:=pl_Boot.ssn;
1479 }
1480 else
1481 {
1482 v_SSN:=0;
1483 }
1484 if( (v_SCCPServiceType == mtp3_itu) or
1485 (v_SCCPServiceType == mtp3b_itu) )
1486 {
1487 v_RoutingLabelLen := 4;
1488 }
1489 else if( (v_SCCPServiceType == mtp3_ansi) or
1490 (v_SCCPServiceType == mtp3b_ansi) )
1491 {
1492 v_RoutingLabelLen := 7;
1493 }
1494 else if ( (v_SCCPServiceType == mtp3_ttc) or
1495 (v_SCCPServiceType == mtp3b_ttc) )
1496 {
1497 if(v_NI>= 2) { v_RoutingLabelLen := 5; }
1498 else { v_RoutingLabelLen := 4; }
1499 }
1500 else if( v_SCCPServiceType == m3ua )
1501 {
1502 v_RoutingLabelLen := 4; // not really...
1503 //v_sccp_data_maxlen := 261;
1504 }
1505 else if ( (v_SCCPServiceType == mtp3_mpt))
1506 {
1507 if(v_NI== 2) { v_RoutingLabelLen := 7; }
1508 else { v_RoutingLabelLen := 4; }
1509 }
1510 else
1511 {
1512 log( "Wrong SCCPServiceType value was selected in the config file");
1513 log("Modified for default value 'mtp3_itu'.");
1514 v_SCCPServiceType := mtp3_itu;
1515 v_RoutingLabelLen := 4; //itu
1516
1517 }
1518
1519 // mtp3_itu_b i.e. itu mtp3b
1520 // SCCP_ansi_b i.e ansi mtp3b settings ???
1521 //272= max length of SIF, see Fig3-3B/T1.111.4-2001
1522 //temp for test: 10 ?
1523 //tsp_SIF_MaxLength = 272
1524 v_sccp_pdu_maxlen := tsp_SIF_MaxLength - v_RoutingLabelLen; // -; //7: msg_type+locref+ptr+len
1525 log("v_sccp_pdu_maxlen:",v_sccp_pdu_maxlen);
1526 v_sccp_data_maxlen := v_sccp_pdu_maxlen-7; // dt1 payload // -7: msg_type+locref+ptr+len
1527
1528 for (vl_j:=0;vl_j<16;vl_j:=vl_j+1)
1529 {
1530 ConnectionTable[vl_j].localReference :='000000'O;
1531 ConnectionTable[vl_j].remoteReference:='000000'O;
1532 ConnectionTable[vl_j].state :=idle;
1533 ConnectionTable[vl_j].connectionId :=0;
1534 ConnectionTable[vl_j].reassembler_buffer.buffer :=''O;
1535 ConnectionTable[vl_j].reassembler_buffer.actlen := 0;
1536 ConnectionTable[vl_j].reassembler_buffer.maxlen := 16*v_sccp_data_maxlen; //????
1537 segmLocRefTable[vl_j] := '000000'O;
1538 reallocate_ClessRcvBuff(vl_j);
1539
1540 }//endfor
1541
1542 //starts SCCP execution
1543 ScanEvents();
1544 }//endfunction of SCCPStart
1545
1546
1547 //******************************************************************
1548 function ReleaseResources(in integer pl_session) runs on SCCP_CT
1549 //******************************************************************
1550 {//startfunction
1551
1552 //release resources
1553 ConnectionTable[pl_session].remoteReference:='000000'O;
1554 ConnectionTable[pl_session].localReference:='000000'O;
1555 ConnectionTable[pl_session].connectionId:=0;
1556 Stop_sessionTimers(pl_session);
1557 ConnectionTable[pl_session].state:=idle;
1558 ConnectionTable[pl_session].reassembler_buffer.buffer:=''O;
1559 ConnectionTable[pl_session].reassembler_buffer.actlen:=0;
1560 }//endfunction ReleaseResources
1561
1562 //******************************************************************
1563 function GuardTimer_Expired(in integer pl_session) runs on SCCP_CT
1564 //no answer to ASP_SCCP_N_CONNECT_ind received
1565 //******************************************************************
1566 {//startfunction
1567
1568 //local declarations
1569 var PDU_SCCP vl_PDU_SCCP;
1570
1571 //Action Table follows
1572
1573 if (ConnectionTable[pl_session].state==connection_pending_IC)
1574 {//startif
1575
1576 //send Released-this should disconnect the other end
1577 vl_PDU_SCCP.released.messageType:=rlsd;
1578 vl_PDU_SCCP.released.destLocRef:=ConnectionTable[pl_session].remoteReference;
1579 vl_PDU_SCCP.released.sourceLocRef:=ConnectionTable[pl_session].localReference;
1580 vl_PDU_SCCP.released.releaseCause:=cg_Rel_endUserOrig;
1581 vl_PDU_SCCP.released.pointer1:=0;
1582 vl_PDU_SCCP.released.optionalPart:=omit;
1583 vl_PDU_SCCP.released.eop:=omit;
1584
1585 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
1586 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP));//send Released
1587
1588 //release resources, return to idle
1589 ReleaseResources(pl_session);
1590
1591 }//endif
1592
1593 }//endfunction GuardTimer_Expired
1594
1595
1596 //******************************************************************
1597 function InternalResetTimer_Expired(integer pl_session) runs on SCCP_CT
1598 //******************************************************************
1599 {//startfunction
1600
1601 //local declarations
1602 var PDU_SCCP vl_PDU_SCCP;
1603 var ASP_SCCP_N_RESET_ind vl_N_RESET_ind;
1604
1605 //Action Table follows
1606
1607 if (ConnectionTable[pl_session].state==active)
1608 {//startif
1609 //send ASP_SCCP_N_RESET_ind
1610 //assemble ASP_SCCP_N_ASP
1611 vl_N_RESET_ind.originator:=cg_NSP;
1612 vl_N_RESET_ind.reason:=cg_DISC_abnormal_T;
1613 vl_N_RESET_ind.connectionId:=ConnectionTable[pl_session].connectionId;
1614
1615 SCCP_SP_PORT.send( t_ASP_N_RESET_ind(
1616 vl_N_RESET_ind.originator,
1617 vl_N_RESET_ind.reason,
1618 vl_N_RESET_ind.connectionId
1619 ));//send ASP_SCCP_N_RESET_ind
1620 //send Reset Request
1621
1622 vl_PDU_SCCP.resetreq.messageType:=rsr;
1623 vl_PDU_SCCP.resetreq.destLocRef:=ConnectionTable[pl_session].remoteReference;
1624 vl_PDU_SCCP.resetreq.sourceLocRef:=ConnectionTable[pl_session].localReference;
1625 vl_PDU_SCCP.resetreq.resetCause:=cg_Res_endUserOrig;
1626
1627 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
1628 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP));//send Reset Request
1629
1630 //start reset timer
1631
1632 f_StartTimer(reset,pl_session);
1633 //restart send inactivity timer
1634 f_StopTimer(ias,pl_session);//to avoid warnings
1635 f_StartTimer(ias,pl_session);
1636 //reset variables etc.
1637 //change state
1638 ConnectionTable[pl_session].state:=reset_bothway;
1639
1640 }//endif
1641 }//InternalResetTimer_Expired
1642
1643 //******************************************************************
1644 function Reset_Timer_Expired(integer pl_session) runs on SCCP_CT
1645 //******************************************************************
1646 {//startfunction
1647
1648 //local declarations
1649 var ASP_SCCP_N_DISCONNECT_ind vl_N_DISCONNECT_ind;
1650
1651 //Action Table follows
1652 if (ConnectionTable[pl_session].state==reset_bothway)
1653 {//startif
1654
1655 //assemble ASP_SCCP_N_
1656 vl_N_DISCONNECT_ind.originator:=cg_NSP;
1657 vl_N_DISCONNECT_ind.reason:=cg_DISC_abnormal_T;
1658 vl_N_DISCONNECT_ind.connectionId:=ConnectionTable[pl_session].connectionId;
1659
1660 SCCP_SP_PORT.send( t_ASP_N_DISCONNECT_ind(
1661 vl_N_DISCONNECT_ind.originator,
1662 omit,
1663 vl_N_DISCONNECT_ind.reason,
1664 omit,
1665 vl_N_DISCONNECT_ind.connectionId,
1666 omit
1667 ));//send ASP_SCCP_N_DISCONNECT_ind
1668
1669 //release resources, stop inactivity timers, change state to idle
1670 ReleaseResources(pl_session);
1671 }//endif
1672
1673 }//Reset_Timer_Expired
1674
1675 //******************************************************************
1676 function Interval_Timer_Expired(integer pl_session) runs on SCCP_CT
1677 //******************************************************************
1678 {//startfunction
1679
1680 //Action Table follows
1681 if (ConnectionTable[pl_session].state==disconnect_pending)
1682 {
1683 log ("Interval timer expired");
1684 //release resources
1685 ReleaseResources(pl_session);
1686 }
1687
1688 }//Interval_Timer_Expired
1689
1690
1691
1692 //******************************************************************
1693 function RepeatRelease_Timer_Expired(integer pl_session) runs on SCCP_CT
1694 //******************************************************************
1695 {
1696
1697 //local declarations
1698 var PDU_SCCP vl_PDU_SCCP;
1699
1700 //Action Table follows
1701 if (ConnectionTable[pl_session].state==disconnect_pending)
1702 {
1703 //assemble and route MTP3_ASP
1704 vl_PDU_SCCP.released.messageType:=rlsd;
1705 vl_PDU_SCCP.released.destLocRef:=ConnectionTable[pl_session].remoteReference;
1706 vl_PDU_SCCP.released.sourceLocRef:=ConnectionTable[pl_session].localReference;
1707 vl_PDU_SCCP.released.releaseCause:=cg_Res_endUserOrig;
1708 vl_PDU_SCCP.released.pointer1:=0;
1709 vl_PDU_SCCP.released.optionalPart:=omit;
1710 vl_PDU_SCCP.released.eop:=omit;
1711
1712 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
1713 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP));//send Released
1714
1715 //restart repeat release timer
1716 f_StopTimer(repeat_rel,pl_session);//to avoid warnings
1717 f_StartTimer(repeat_rel,pl_session);
1718 //no state change, return
1719 }
1720
1721 }//RepeatRelease_Timer_Expired
1722
1723
1724 //******************************************************************
1725 function Release_Timer_Expired(integer pl_session) runs on SCCP_CT
1726 //******************************************************************
1727 {
1728
1729 //local declarations
1730 var PDU_SCCP vl_PDU_SCCP;
1731
1732 //Action Table follows
1733 if (ConnectionTable[pl_session].state==disconnect_pending)
1734 {
1735 //assemble and route MTP3_ASP
1736 vl_PDU_SCCP.released.messageType:=rlsd;
1737 vl_PDU_SCCP.released.destLocRef:=ConnectionTable[pl_session].remoteReference;
1738 vl_PDU_SCCP.released.sourceLocRef:=ConnectionTable[pl_session].localReference;
1739 vl_PDU_SCCP.released.releaseCause:=cg_Res_endUserOrig;//?
1740 vl_PDU_SCCP.released.pointer1:=0;
1741 vl_PDU_SCCP.released.optionalPart:=omit;
1742 vl_PDU_SCCP.released.eop:=omit;
1743
1744 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
1745 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP));//send Released
1746
1747 f_StartTimer(repeat_rel,pl_session);
1748 f_StartTimer(int,pl_session);
1749 //no state change, return
1750
1751 }//endif
1752
1753 }//Release_Timer_Expired
1754
1755
1756 //******************************************************************
1757 function ReceiveInactivity_Timer_Expired(integer pl_session) runs on SCCP_CT
1758 //******************************************************************
1759 {
1760 //local declarations
1761 var PDU_SCCP vl_PDU_SCCP;
1762 var ASP_SCCP_N_DISCONNECT_ind vl_N_DISCONNECT_ind;
1763
1764 //Action Table follows
1765 if (ConnectionTable[pl_session].state==idle){}
1766 else if (ConnectionTable[pl_session].state==active)
1767 {
1768 //assemble ASP_SCCP_N_
1769 vl_N_DISCONNECT_ind.originator:=cg_NSP;
1770 vl_N_DISCONNECT_ind.reason:=cg_DISC_endUserFailure;//?
1771 vl_N_DISCONNECT_ind.connectionId:=ConnectionTable[pl_session].connectionId;
1772
1773 SCCP_SP_PORT.send( t_ASP_N_DISCONNECT_ind(
1774 vl_N_DISCONNECT_ind.originator,
1775 omit,
1776 vl_N_DISCONNECT_ind.reason,
1777 omit,
1778 vl_N_DISCONNECT_ind.connectionId,
1779 omit
1780 ));//send ASP_SCCP_N_DISCONNECT_ind
1781
1782 //stop inactivity timers
1783 f_StopTimer(ias,pl_session);
1784 f_StopTimer(iar,pl_session);
1785
1786 //assemble and route MTP3_ASP
1787
1788 vl_PDU_SCCP.released.messageType:=rlsd;
1789 vl_PDU_SCCP.released.destLocRef:=ConnectionTable[pl_session].remoteReference;
1790 vl_PDU_SCCP.released.sourceLocRef:=ConnectionTable[pl_session].localReference;
1791 vl_PDU_SCCP.released.releaseCause:=cg_Rel_expRecInacTimer;
1792 vl_PDU_SCCP.released.pointer1:=0;// No options
1793 vl_PDU_SCCP.released.optionalPart:=omit;
1794 vl_PDU_SCCP.released.eop:=omit;
1795
1796 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
1797 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP));//send Released
1798
1799 //start release timer
1800 f_StartTimer(rel,pl_session);
1801 ConnectionTable[pl_session].state:=disconnect_pending;
1802
1803 }//endif
1804
1805 }//ReceiveInactivity_Timer_Expired
1806
1807
1808 //******************************************************************
1809 function SendInactivity_Timer_Expired(integer pl_session) runs on SCCP_CT
1810 //******************************************************************
1811 {
1812
1813 //local declarations
1814 var PDU_SCCP vl_PDU_SCCP;
1815
1816 //Action Table follows
1817
1818 if (ConnectionTable[pl_session].state==active)
1819 {
1820
1821 //assemble and route MTP3_ASP
1822 vl_PDU_SCCP.inacttest.messageType :=it;
1823 vl_PDU_SCCP.inacttest.destLocRef :=ConnectionTable[pl_session].remoteReference;
1824 vl_PDU_SCCP.inacttest.sourceLocRef:=ConnectionTable[pl_session].localReference;
1825
1826 vl_PDU_SCCP.inacttest.protClass:={
1827 class:='0010'B,
1828 messageHandling:='0000'B
1829 };//protocol class 2
1830
1831 vl_PDU_SCCP.inacttest.sequencingSegmenting:={
1832 reserved:='0'B,
1833 p_s:='0000000'B,
1834 more:='0'B,
1835 pr:='0000000'B
1836 };//it will be ignored
1837
1838 vl_PDU_SCCP.inacttest.credit:='00'O;
1839 //Param name credit(9), length 1, credit 0 -it will be mercifully ignored anyhow
1840
1841 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
1842 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP));//send inactivity test
1843
1844 //restart send inactivity timer
1845 f_StopTimer(ias,pl_session);//to avoid warnings
1846 f_StartTimer(ias,pl_session);
1847
1848 }//endif
1849
1850 }//endfunction
1851
1852 //******************************************************************
1853 function Conn_Timer_Expired(integer pl_session) runs on SCCP_CT
1854 //******************************************************************
1855 {
1856
1857 //local declarations
1858 var ASP_SCCP_N_DISCONNECT_ind vl_N_DISCONNECT_ind;
1859
1860 if (ConnectionTable[pl_session].state==connection_pending_OG)
1861 {
1862 //assemble ASP_SCCP_N_
1863 vl_N_DISCONNECT_ind.originator:=cg_NSP;
1864 vl_N_DISCONNECT_ind.reason:=cg_DISC_abnormal_T;
1865 vl_N_DISCONNECT_ind.connectionId:=ConnectionTable[pl_session].connectionId;
1866
1867 SCCP_SP_PORT.send( t_ASP_N_DISCONNECT_ind(
1868 vl_N_DISCONNECT_ind.originator,
1869 omit,
1870 vl_N_DISCONNECT_ind.reason,
1871 omit,
1872 vl_N_DISCONNECT_ind.connectionId,
1873 omit
1874 ));//send ASP_SCCP_N_DISCONNECT_ind
1875
1876 //release resources
1877 ReleaseResources(pl_session);
1878 }
1879 else if (ConnectionTable[pl_session].state==wait_conn_confirm)
1880 {
1881 ReleaseResources(pl_session);
1882 }
1883
1884 }//Conn_Timer_Expired
1885
1886 //******************************************************************
1887 function GenerateLocalReference() runs on SCCP_CT return OCT3
1888 //******************************************************************
1889 {
1890 var OCT3 vl_LocalReference;
1891
1892 do
1893 {
1894 vl_LocalReference := int2oct(float2int(rnd()*tsp_maxLocalReference), 3 );
1895 }
1896 while ( Retrieve_session( vl_LocalReference ) != -1 );
1897 return vl_LocalReference;
1898
1899 }//GenerateLocalReference
1900
1901 //******************************************************************
1902 function GenerateConnectionId() runs on SCCP_CT return integer
1903 //******************************************************************
1904 {
1905 var integer vl_ConnectionId;
1906
1907 do { vl_ConnectionId := float2int(rnd()*tsp_max_ConnectionId); }
1908 while ( Retrieve_session_connectionId( vl_ConnectionId ) != -1 );
1909
1910 return vl_ConnectionId;
1911 }//GenerateConnectionId
1912
1913 //******************************************************************
1914 function Stop_sessionTimers ( integer pl_session) runs on SCCP_CT
1915 //******************************************************************
1916 {
1917 if (T_conn_est[pl_session].running)
1918 { f_StopTimer(conn_est,pl_session);}
1919 if (T_ias[pl_session].running)
1920 { f_StopTimer(ias,pl_session);}
1921 if (T_iar[pl_session].running)
1922 { f_StopTimer(iar,pl_session);}
1923 if (T_rel[pl_session].running)
1924 { f_StopTimer(rel,pl_session);}
1925 if (T_repeat_rel[pl_session].running)
1926 { f_StopTimer(repeat_rel,pl_session);}
1927 if (T_int[pl_session].running)
1928 { f_StopTimer(int,pl_session);}
1929 // if (T_T_guard[pl_session].running)
1930 // { f_StopTimer(t_t_guard,pl_session);}
1931 if (T_reset[pl_session].running)
1932 { f_StopTimer(reset,pl_session);}
1933 //T_reassembly[pl_session].stop;
1934
1935 }//Stop_sessionTimers
1936
1937 //******************************************************************
1938 function CheckIdleIndividuals() runs on SCCP_CT return integer
1939 //******************************************************************
1940 {
1941 var integer vl_j;
1942 for (vl_j:=0;vl_j<16;vl_j:=vl_j+1)
1943 {
1944 if (ConnectionTable[vl_j].state==idle)
1945 {
1946 log("First idle individual index:",vl_j);
1947 return vl_j;
1948 }
1949 }
1950
1951 return -1;
1952
1953 }//CheckIdleIndividuals
1954
1955 //******************************************************************
1956 function ConnectionAlreadyEstablished( OCT3 pl_LocRef) runs on SCCP_CT return boolean
1957 //******************************************************************
1958 {
1959 var integer vl_j;
1960 for (vl_j:=0;vl_j<16;vl_j:=vl_j+1)
1961 {
1962 if (ConnectionTable[vl_j].localReference==pl_LocRef)
1963 {
1964 return true;
1965 }
1966 }
1967 return false;
1968
1969 } //ConnectionAlreadyEstablished
1970
1971 //******************************************************************
1972 function ConnectionAlreadyEstablished_remote( OCT3 pl_LocRef) runs on SCCP_CT return boolean
1973 //******************************************************************
1974 {
1975 var integer vl_j;
1976
1977 for (vl_j:=0;vl_j<16;vl_j:=vl_j+1)
1978 {
1979 if (ConnectionTable[vl_j].remoteReference==pl_LocRef)
1980 {
1981 return true;
1982 }
1983 }
1984 return false;
1985
1986 } //ConnectionAlreadyEstablished_remote
1987
1988 //******************************************************************
1989 function ConnectionAlreadyEstablished_connectionId(integer pl_ConnId) runs on SCCP_CT return boolean
1990 //******************************************************************
1991 {
1992 var integer vl_j;
1993 for (vl_j:=0;vl_j<16;vl_j:=vl_j+1)
1994 {
1995 if (ConnectionTable[vl_j].connectionId==pl_ConnId)
1996 {
1997 return true;
1998 }
1999 }
2000
2001 return false;
2002
2003 } //ConnectionAlreadyEstablished_connectionId
2004
2005 //******************************************************************
2006 function Retrieve_session( OCT3 pl_LocRef ) runs on SCCP_CT return integer
2007 //******************************************************************
2008 {
2009 var integer vl_j;
2010 for (vl_j:=0;vl_j<16;vl_j:=vl_j+1)
2011 {
2012
2013 if (ConnectionTable[vl_j].localReference==pl_LocRef)
2014 {
2015 log("Session index based on local reference:",vl_j);
2016 return vl_j;
2017 }
2018 }
2019
2020 return -1;
2021
2022 } //Retrieve_session
2023
2024 //******************************************************************
2025 function Retrieve_session_remote( OCT3 pl_LocRef )
2026 runs on SCCP_CT return integer
2027 //******************************************************************
2028 {
2029 var integer vl_j;
2030 for (vl_j:=0;vl_j<16;vl_j:=vl_j+1)
2031 {
2032 if (ConnectionTable[vl_j].remoteReference==pl_LocRef)
2033 {
2034 log("Session index based on remote reference:",vl_j);
2035 return vl_j;
2036 }
2037 }
2038 return -1;
2039
2040 } //Retrieve_session_remote
2041
2042 //******************************************************************
2043 function Retrieve_session_connectionId( integer pl_ConnId )
2044 runs on SCCP_CT return integer
2045 //******************************************************************
2046 {
2047 var integer vl_j;
2048 for (vl_j:=0;vl_j<16;vl_j:=vl_j+1)
2049 {
2050 if (ConnectionTable[vl_j].connectionId==pl_ConnId)
2051 {
2052 log("Session index based on connection ID:",vl_j);
2053 return vl_j;
2054 }
2055 }
2056 return -1;
2057
2058 } //Retrieve_session_connectionId
2059
2060 //==================================================================
2061 // Connectionless Segmented Data Handling/
2062 //==================================================================
2063 //==================================================================
2064 // SENDING: SCCP->MTP3 Segmentation Local Reference Handling
2065 // Handles segmLocRefTable,v_segmLocRefIndex,
2066 // which are defined in SCCP_typedefs.ttcn
2067 //==================================================================
2068
2069 //******************************************************************
2070 //function exist_segmLocalRef
2071 //******************************************************************
2072
2073 function exist_segmLocalRef( in OCT3 pl_segLocRef)
2074 runs on SCCP_CT return boolean
2075 {
2076 if( get_segmLocalRefIndex(pl_segLocRef) == -1 ) { return false;}
2077 else { return true; };
2078 } //exist_segmLocalRef
2079
2080 //******************************************************************
2081 //function get_segLocalRefIndex
2082 //******************************************************************
2083
2084 function get_segmLocalRefIndex(in OCT3 pl_segmLocRef)
2085 runs on SCCP_CT return integer
2086 {
2087 var integer vl_j;
2088 for (vl_j:=0;vl_j<16;vl_j:=vl_j+1)
2089 {
2090 if( segmLocRefTable[vl_j] == pl_segmLocRef ) { return vl_j;}
2091 }
2092 return -1;
2093 }//get_segLocalRefIndex
2094
2095 //******************************************************************
2096 //function reset_segmLocalRef
2097 //******************************************************************
2098 function reset_segmLocalRef(in OCT3 pl_segmLocRef)
2099 runs on SCCP_CT
2100 {
2101 var integer vl_j;
2102 vl_j:= get_segmLocalRefIndex( pl_segmLocRef )
2103 segmLocRefTable[vl_j] := '000000'O;
2104 }
2105
2106 //******************************************************************
2107 // function create_segmLocalRef
2108 //******************************************************************
2109
2110 function create_segmLocalRef()
2111 runs on SCCP_CT return OCT3
2112 {
2113 var OCT3 vl_segmLocRef;
2114 v_segmLocRefIndex := (v_segmLocRefIndex +1) mod 16;
2115 do
2116 {
2117 vl_segmLocRef := int2oct(float2int( rnd() *tsp_maxLocalReference), 3 );
2118 }
2119 while ( exist_segmLocalRef( vl_segmLocRef ) );
2120
2121 return vl_segmLocRef;
2122 }//create_segmLocalRef
2123
2124 //==================================================================
2125 // RECEIVING CONNECTIONLESS PDUs BY SCCP
2126 //==================================================================
2127
2128 //******************************************************************
2129 //function exist_ClessRcvBuff
2130 //******************************************************************
2131 function exist_ClessRcvBuff( in OCT3 pl_segmRemRef)
2132 runs on SCCP_CT return boolean
2133 {
2134 if( get_ClessRcvBuffIndex(pl_segmRemRef) == -1 ) { return false;}
2135 else { return true; };
2136 } //exist_ClessRcvBuff
2137
2138 //******************************************************************
2139 //function get_segRemoteRefIndex
2140 //******************************************************************
2141 function get_ClessRcvBuffIndex(in OCT3 pl_segmRemRef)
2142 runs on SCCP_CT return integer
2143 {
2144 var integer vl_j;
2145 for (vl_j:=0;vl_j<16;vl_j:=vl_j+1)
2146 {
2147 if( ClessRcvBuffTable[vl_j].segmRemoteRef == pl_segmRemRef )
2148 { return vl_j;}
2149 }
2150 return -1;
2151 }//get_ClessRcvBuffIndex
2152
2153 //******************************************************************
2154 //function get_idle_ClessRcvBuffIndex
2155 //******************************************************************
2156 function get_idle_ClessRcvBuffIndex( )
2157 runs on SCCP_CT return integer
2158 {
2159 var integer vl_j;
2160 for (vl_j:=0;vl_j<16;vl_j:=vl_j+1)
2161 {
2162 if( ClessRcvBuffTable[vl_j].state == segmLocRef_idle ) { return vl_j;}
2163 }
2164 return -1;
2165 }//get_idle_ClessRcvBuffIndex
2166
2167 //******************************************************************
2168 //function allocate_ClessRcvBuff
2169 //******************************************************************
2170 function allocate_ClessRcvBuff(in OCT3 pl_segmRemRef)
2171 runs on SCCP_CT return integer
2172 {
2173 var OCT3 vl_segmRemRef;
2174 var integer vl_j;
2175
2176 if( exist_ClessRcvBuff(pl_segmRemRef) ){ return -1;};
2177
2178 vl_j := get_idle_ClessRcvBuffIndex();
2179 ClessRcvBuffTable[vl_j].state := segmLocRef_busy;
2180 ClessRcvBuffTable[vl_j].segmRemoteRef := pl_segmRemRef;
2181 ClessRcvBuffTable[vl_j].reassembler_buffer.buffer:=''O;
2182 ClessRcvBuffTable[vl_j].reassembler_buffer.actlen:=0;
2183 return vl_j;
2184
2185 }//allocate_ClessRcvBuff
2186 //******************************************************************
2187 //function reallocate_ClessRcvBuff
2188 //******************************************************************
2189 function reallocate_ClessRcvBuff(in integer pl_index )
2190 runs on SCCP_CT
2191 {
2192 ClessRcvBuffTable[pl_index].state := segmLocRef_idle;
2193 // maybe unnecessaryy
2194 ClessRcvBuffTable[pl_index].segmRemoteRef := '000000'O;
2195 ClessRcvBuffTable[pl_index].reassembler_buffer.buffer:=''O;
2196 ClessRcvBuffTable[pl_index].reassembler_buffer.actlen:=0;
2197 return;
2198 }
2199
2200 //******************************************************************
2201 //function store_segmData
2202 //******************************************************************
2203 function store_segmData(in integer pl_index, in PDU_SCCP_ExtUnitdata pl_PDU_SCCP_ExtUnitdata)
2204 runs on SCCP_CT
2205 {
2206 ClessRcvBuffTable[pl_index].reassembler_buffer.buffer:=
2207 ClessRcvBuffTable[pl_index].reassembler_buffer.buffer&
2208 pl_PDU_SCCP_ExtUnitdata.data.data;
2209 ClessRcvBuffTable[pl_index].reassembler_buffer.actlen:=
2210 ClessRcvBuffTable[pl_index].reassembler_buffer.actlen+
2211 pl_PDU_SCCP_ExtUnitdata.data.paramLength;
2212 } //store_segmData
2213
2214 //******************************************************************
2215 //function send_ClessRcvBuff_in_N_UNITDATAind
2216 //******************************************************************
2217 function send_ClessRcvBuff_in_N_UNITDATAind (
2218 in integer pl_index,
2219 in PDU_SCCP_ExtUnitdata pl_PDU_SCCP_ExtUnitdata)
2220 runs on SCCP_CT
2221 {
2222 var ASP_SCCP_N_UNITDATA_ind vl_N_UNITDATA_ind;
2223
2224 vl_N_UNITDATA_ind.calledAddress :=
2225 ConvertPDUEncodedAddressToASPAddress( pl_PDU_SCCP_ExtUnitdata.calledPAddress );
2226
2227 vl_N_UNITDATA_ind.callingAddress :=
2228 ConvertPDUEncodedAddressToASPAddress( pl_PDU_SCCP_ExtUnitdata.callingPAddress );
2229
2230 vl_N_UNITDATA_ind.sequenceControl:=
2231 '0000000'B&pl_PDU_SCCP_ExtUnitdata.protClass.class[3];
2232 if( pl_PDU_SCCP_ExtUnitdata.protClass.messageHandling == '1000'B )
2233 { vl_N_UNITDATA_ind.returnOption := '00000001'B; }
2234 else
2235 { vl_N_UNITDATA_ind.returnOption := '00000000'B; }
2236
2237 vl_N_UNITDATA_ind.userData := ClessRcvBuffTable[pl_index].reassembler_buffer.buffer;
2238
2239 vl_N_UNITDATA_ind.importance := omit;
2240
2241 SCCP_SP_PORT.send( vl_N_UNITDATA_ind );
2242
2243 return;
2244 }//send_ClessRcvBuff_in_N_UNITDATAind
2245
2246 //******************************************************************
2247 //function send_ClessData_in_N_UNITDATAind
2248 // unbuffered data sending
2249 //******************************************************************
2250
2251 function send_ClessData_in_N_UNITDATAind (
2252 in PDU_SCCP_ExtUnitdata pl_PDU_SCCP_ExtUnitdata)
2253 runs on SCCP_CT
2254 {
2255 var ASP_SCCP_N_UNITDATA_ind vl_N_UNITDATA_ind;
2256
2257 vl_N_UNITDATA_ind.calledAddress :=
2258 ConvertPDUEncodedAddressToASPAddress( pl_PDU_SCCP_ExtUnitdata.calledPAddress );
2259
2260 vl_N_UNITDATA_ind.callingAddress :=
2261 ConvertPDUEncodedAddressToASPAddress( pl_PDU_SCCP_ExtUnitdata.callingPAddress );
2262
2263 vl_N_UNITDATA_ind.sequenceControl:=
2264 '0000000'B&pl_PDU_SCCP_ExtUnitdata.protClass.class[3];
2265 if( pl_PDU_SCCP_ExtUnitdata.protClass.messageHandling == '1000'B )
2266 { vl_N_UNITDATA_ind.returnOption := '00000001'B; }
2267 else
2268 { vl_N_UNITDATA_ind.returnOption := '00000000'B; }
2269
2270 vl_N_UNITDATA_ind.userData := pl_PDU_SCCP_ExtUnitdata.data.data;
2271
2272 vl_N_UNITDATA_ind.importance := omit;
2273
2274 SCCP_SP_PORT.send( vl_N_UNITDATA_ind );
2275 return;
2276 }//send_ClessData_in_N_UNITDATAind
2277
2278 //******************************************************************
2279 // CONN.ORIENTED SEGMENTING/REASSEMBLING
2280 //******************************************************************
2281
2282 //******************************************************************
2283 // SEGMENTING
2284 //******************************************************************
2285
2286 //******************************************************************
2287 // function sending_dataform1s_in_ASP_MTP_TRANSFERreqs
2288 // segmentates data and sends segments in dataform1 messages
2289 // included in asp_MTP3_TRANSFERreq PDUs
2290 // == segmentation - connection oriented case ==
2291 // counterpair: buffered_sending_ASP_N_DATA_ind
2292 //******************************************************************
2293 function sending_dataform1s_in_ASP_MTP_TRANSFERreqs( in ASP_SCCP_N_DATA_req pl_N_DATA_req )
2294 runs on SCCP_CT
2295 {
2296 var PDU_SCCP vl_PDU_SCCP;
2297 var integer vl_len;
2298 var integer vl_actdatalen;
2299 var SCCP_PAR_UserData vl_data;
2300 var integer vl_from; // first position in vl_data to be sent
2301 vl_data := pl_N_DATA_req.userData;
2302 vl_from := 0;
2303 // fixed part of messages:
2304 vl_PDU_SCCP.dataform1.messageType:=dt1;
2305 vl_PDU_SCCP.dataform1.destLocRef:=ConnectionTable[v_session].remoteReference;
2306 vl_PDU_SCCP.dataform1.segmentingReassembl:={
2307 more:='1'B,
2308 reserved:='0000000'B
2309 };
2310 vl_PDU_SCCP.dataform1.pointer1:=1;
2311 // variable part of messages:
2312 vl_len := lengthof(vl_data);
2313
2314 while ( vl_len > 0 )
2315 {
2316
2317 log("vl_len:",vl_len);
2318 log("vl_from",vl_from);
2319 if(vl_len > v_sccp_data_maxlen)
2320 {
2321 vl_actdatalen := v_sccp_data_maxlen;
2322 vl_PDU_SCCP.dataform1.segmentingReassembl.more :='1'B;
2323 }
2324 else
2325 {
2326 vl_actdatalen := vl_len;
2327 vl_PDU_SCCP.dataform1.segmentingReassembl.more :='0'B;
2328 };
2329
2330 vl_PDU_SCCP.dataform1.data.data:= substr( vl_data, vl_from, vl_actdatalen);
2331 vl_PDU_SCCP.dataform1.data.paramLength:= vl_actdatalen;
2332
2333 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
2334 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP));//send Data Form1
2335
2336 log( "data sent by MTP3_SCCP_PORT: ",vl_PDU_SCCP.dataform1.data.data);
2337
2338 //restart send inactivity timer
2339 f_StopTimer(ias,v_session);//to avoid warnings
2340 f_StartTimer(ias,v_session);
2341
2342 vl_from := vl_from + vl_actdatalen;
2343 vl_len := vl_len - vl_actdatalen;
2344
2345 }//while
2346 } //sending_dataform1s_in_ASP_MTP_TRANSFERreqs
2347
2348 //******************************************************************
2349 // REASSEMBLING
2350 //******************************************************************
2351
2352 //******************************************************************
2353 // function buffered_sending_ASP_N_DATA_ind
2354 // counterpair of sending_dataform1s_in_ASP_MTP_TRANSFERreqs
2355 //******************************************************************
2356
2357 function buffered_sending_ASP_N_DATA_ind( in PDU_SCCP_DataForm1 pl_PDU_SCCP_DataForm1 )
2358 runs on SCCP_CT
2359 {
2360 // Investigate this shorcut (not implemented):
2361 // if actlen==0 and more==0=> send immediately
2362
2363 // DT1 should be put to the reassembly buffer
2364 var integer vl_newbufflen;
2365 log("DT1 will be put to the reassembly buffer");
2366 //log( ConnectionTable[v_session].connectionId );
2367 vl_newbufflen := ConnectionTable[v_session].reassembler_buffer.actlen +
2368 pl_PDU_SCCP_DataForm1.data.paramLength;
2369
2370 if( vl_newbufflen <= ConnectionTable[v_session].reassembler_buffer.maxlen)
2371 {
2372 ConnectionTable[v_session].reassembler_buffer.buffer :=
2373 ConnectionTable[v_session].reassembler_buffer.buffer &
2374 pl_PDU_SCCP_DataForm1.data.data;
2375 ConnectionTable[v_session].reassembler_buffer.actlen := vl_newbufflen;
2376 log("DT1 data has been put to the reassembly buffer");
2377 }
2378 else
2379 {
2380 //send as much as possible OR error ???? NOT READY YET !!!!
2381 //CONT HERE, ask LAFA
2382 log("Unexpected/unimplemented program branch");
2383 }
2384
2385 // sending:
2386 if( pl_PDU_SCCP_DataForm1.segmentingReassembl.more == '0'B )
2387 {
2388 log("DT1/segmentingReassembl/more==0 received=> send ASP_SCCP_N_DATA comes");
2389 //send:
2390 SCCP_SP_PORT.send( t_ASP_N_DATA_ind(
2391 ConnectionTable[v_session].reassembler_buffer.buffer,
2392 ConnectionTable[v_session].connectionId,
2393 omit));
2394
2395 //restart send inactivity timer
2396 f_StopTimer(ias,v_session);//to avoid warnings
2397 f_StartTimer(ias,v_session);
2398
2399 // clear the buffer:
2400 ConnectionTable[v_session].reassembler_buffer.buffer :=''O;
2401 ConnectionTable[v_session].reassembler_buffer.actlen := 0;
2402 }
2403 else
2404 {
2405 log("DT1/segmentingReassembl/more==1 received=> sent to buffer only");
2406 }
2407 }//buffered_sending_ASP_N_DATA_ind
2408
2409
2410 //******************************************************************
2411 // CONVERSIONS
2412 //******************************************************************
2413 //
2414 // Differences between standards are hidden here !!!!
2415 //
2416 // 3 different functions working on different structures with the
2417 // virtually indentical code
2418
2419 //******************************************************************
2420 // Functions coding ASP address into octetstream
2421 //******************************************************************
2422
2423 // ITU
2424
2425 function ConvertASPAddressToEncodedAddress_itu( in SCCP_PAR_Address pl_ASPAddress)
2426 runs on SCCP_CT
2427 return SCCP_param_CPartyAddressEnc
2428 {
2429
2430 var SCCP_param_CPartyAddress_itu vl_PDUAddress; //structured fit to encoding
2431 var SCCP_param_CPartyAddressEnc vl_PDUAddressEncoded;
2432
2433 vl_PDUAddress.addressIndicator.pointCodeIndic:=
2434 pl_ASPAddress.addressIndicator.pointCodeIndic;
2435
2436 vl_PDUAddress.addressIndicator.ssnIndicator:=
2437 pl_ASPAddress.addressIndicator.ssnIndicator;
2438
2439 vl_PDUAddress.addressIndicator.globalTitleIndic:=
2440 pl_ASPAddress.addressIndicator.globalTitleIndic;
2441
2442 vl_PDUAddress.addressIndicator.routingIndicator:=
2443 pl_ASPAddress.addressIndicator.routingIndicator;
2444
2445 vl_PDUAddress.addressIndicator.reserved:='0'B;
2446 // if (ischosen(pl_ASPAddress.signPointCode) ) not used because it is mandatory field (???)
2447
2448 //----signPointCode handling
2449 if ( ispresent( pl_ASPAddress.signPointCode )) {
2450 vl_PDUAddress.signPointCode :=
2451 '00'B&pl_ASPAddress.signPointCode;
2452 } else {
2453 vl_PDUAddress.signPointCode := omit;
2454 };
2455
2456 //----subsystemNumber handling
2457 if ( ispresent( pl_ASPAddress.subsystemNumber ) ){
2458 vl_PDUAddress.subsystemNumber := pl_ASPAddress.subsystemNumber;
2459 } else {
2460 vl_PDUAddress.subsystemNumber :=omit;
2461 };
2462
2463 // --- globalTitle handling--
2464 if ( ispresent(pl_ASPAddress.globalTitle))
2465 {//startif1
2466
2467 var SCCP_ASPfield_GlobalTitle tmpGT ;
2468 tmpGT := pl_ASPAddress.globalTitle;
2469
2470 if (ischosen(tmpGT.gti0001))
2471 {
2472 vl_PDUAddress.globalTitle.gti0001.natureOfAddress:=tmpGT.gti0001.natureOfAddress;
2473 vl_PDUAddress.globalTitle.gti0001.oddeven:=tmpGT.gti0001.oddeven;
2474 vl_PDUAddress.globalTitle.gti0001.globalTitleAddress:=tmpGT.gti0001.globalTitleAddress;
2475 }
2476 else if (ischosen(tmpGT.gti0010))
2477 {
2478 vl_PDUAddress.globalTitle.gti0010.translationType:=tmpGT.gti0010.translationType;
2479 vl_PDUAddress.globalTitle.gti0010.globalTitleAddress:=tmpGT.gti0010.globalTitleAddress;
2480 }
2481 else if (ischosen(tmpGT.gti0011))
2482 {
2483 vl_PDUAddress.globalTitle.gti0011.translationType:=tmpGT.gti0011.translationType;
2484 vl_PDUAddress.globalTitle.gti0011.encodingScheme:=tmpGT.gti0011.encodingScheme;
2485 vl_PDUAddress.globalTitle.gti0011.numberingPlan:=tmpGT.gti0011.numberingPlan;
2486 vl_PDUAddress.globalTitle.gti0011.globalTitleAddress:=tmpGT.gti0011.globalTitleAddress;
2487 }
2488 else if (ischosen(tmpGT.gti0100))
2489 {
2490 vl_PDUAddress.globalTitle.gti0100.translationType:=tmpGT.gti0100.translationType;
2491 vl_PDUAddress.globalTitle.gti0100.encodingScheme:=tmpGT.gti0100.encodingScheme;
2492 vl_PDUAddress.globalTitle.gti0100.numberingPlan:=tmpGT.gti0100.numberingPlan;
2493 vl_PDUAddress.globalTitle.gti0100.natureOfAddress:=tmpGT.gti0100.natureOfAddress;
2494 vl_PDUAddress.globalTitle.gti0100.reserved:='0'B;
2495 vl_PDUAddress.globalTitle.gti0100.globalTitleAddress:=tmpGT.gti0100.globalTitleAddress;
2496 }
2497 }
2498 else
2499 {
2500 vl_PDUAddress.globalTitle := omit;
2501 };
2502
2503 vl_PDUAddressEncoded.addr:= enc_PDU_SCCP_Address_itu( vl_PDUAddress);
2504 vl_PDUAddressEncoded.paramLength:= lengthof(vl_PDUAddressEncoded.addr);
2505
2506 return vl_PDUAddressEncoded;
2507
2508 } //ConvertASPAddressToEncodedAddress_itu
2509
2510 //******************************************************************
2511
2512 // ANSI
2513 function ConvertASPAddressToEncodedAddress_ansi(in SCCP_PAR_Address pl_ASPAddress)
2514 runs on SCCP_CT return SCCP_param_CPartyAddressEnc
2515 {
2516
2517 var SCCP_param_CPartyAddress_ansi vl_PDUAddress; //structured fit to encoding
2518 var SCCP_param_CPartyAddressEnc vl_PDUAddressEncoded;
2519
2520 vl_PDUAddress.addressIndicator.pointCodeIndic:=
2521 pl_ASPAddress.addressIndicator.pointCodeIndic;
2522
2523 vl_PDUAddress.addressIndicator.ssnIndicator:=
2524 pl_ASPAddress.addressIndicator.ssnIndicator;
2525
2526 vl_PDUAddress.addressIndicator.globalTitleIndic:=
2527 pl_ASPAddress.addressIndicator.globalTitleIndic;
2528
2529 vl_PDUAddress.addressIndicator.routingIndicator:=
2530 pl_ASPAddress.addressIndicator.routingIndicator;
2531
2532 vl_PDUAddress.addressIndicator.reserved:='1'B;
2533
2534 //----signPointCode handling
2535 if ( ispresent( pl_ASPAddress.signPointCode )){
2536 vl_PDUAddress.signPointCode := pl_ASPAddress.signPointCode;
2537 } else {
2538 vl_PDUAddress.signPointCode := omit;
2539 };
2540
2541 //----subsystemNumber handling
2542 if ( ispresent( pl_ASPAddress.subsystemNumber )) {
2543 vl_PDUAddress.subsystemNumber:=pl_ASPAddress.subsystemNumber;
2544 } else {
2545 vl_PDUAddress.subsystemNumber :=omit;
2546 };
2547
2548 if (ispresent(pl_ASPAddress.globalTitle))
2549 {//startif1
2550
2551 var SCCP_ASPfield_GlobalTitle tmpGT := pl_ASPAddress.globalTitle;
2552
2553
2554 if (ischosen(tmpGT.gti0010))
2555 {
2556 vl_PDUAddress.globalTitle.gti0010.translationType:=tmpGT.gti0010.translationType;
2557 vl_PDUAddress.globalTitle.gti0010.globalTitleAddress:=tmpGT.gti0010.globalTitleAddress;
2558 }
2559 else if (ischosen(tmpGT.gti0011)) //ansi gti001, meaning:
2560 //used GT: SCCP_field_GlobalTitle_TT_NP_ES
2561 {
2562 //the left side is ANSI!!!:
2563 vl_PDUAddress.globalTitle.gti0001.translationType:=tmpGT.gti0011.translationType;
2564 vl_PDUAddress.globalTitle.gti0001.encodingScheme:=tmpGT.gti0011.encodingScheme;
2565 vl_PDUAddress.globalTitle.gti0001.numberingPlan:=tmpGT.gti0011.numberingPlan;
2566 vl_PDUAddress.globalTitle.gti0001.globalTitleAddress:=tmpGT.gti0011.globalTitleAddress;
2567 };
2568
2569 }
2570 else
2571 {
2572 vl_PDUAddress.globalTitle := omit;
2573 };
2574
2575 // SCCP_param_CPartyAddress_ansi -> octetstring
2576 vl_PDUAddressEncoded.addr:= enc_PDU_SCCP_Address_ansi( vl_PDUAddress);
2577 vl_PDUAddressEncoded.paramLength:= lengthof(vl_PDUAddressEncoded.addr);
2578
2579 return vl_PDUAddressEncoded
2580
2581 } //ConvertASPAddressToEncodedAddress_ansi
2582
2583 // ttc national:
2584
2585 function ConvertASPAddressToEncodedAddress_ttc( in SCCP_PAR_Address pl_ASPAddress)
2586 runs on SCCP_CT
2587 return SCCP_param_CPartyAddressEnc
2588 {
2589
2590 var SCCP_param_CPartyAddress_ttc vl_PDUAddress; //structured fit to encoding
2591 var SCCP_param_CPartyAddressEnc vl_PDUAddressEncoded;
2592
2593 vl_PDUAddress.addressIndicator.pointCodeIndic:=
2594 pl_ASPAddress.addressIndicator.pointCodeIndic;
2595
2596 vl_PDUAddress.addressIndicator.ssnIndicator:=
2597 pl_ASPAddress.addressIndicator.ssnIndicator;
2598
2599 vl_PDUAddress.addressIndicator.globalTitleIndic:=
2600 pl_ASPAddress.addressIndicator.globalTitleIndic;
2601
2602 vl_PDUAddress.addressIndicator.routingIndicator:=
2603 pl_ASPAddress.addressIndicator.routingIndicator;
2604
2605 vl_PDUAddress.addressIndicator.reserved:='1'B;
2606
2607 //----signPointCode handling
2608 if ( ispresent( pl_ASPAddress.signPointCode )) {
2609 vl_PDUAddress.signPointCode := pl_ASPAddress.signPointCode;
2610 } else {
2611 vl_PDUAddress.signPointCode := omit;
2612 };
2613
2614 //----subsystemNumber handling
2615 if ( ispresent( pl_ASPAddress.subsystemNumber ) ){
2616 vl_PDUAddress.subsystemNumber:= pl_ASPAddress.subsystemNumber;
2617 } else {
2618 vl_PDUAddress.subsystemNumber :=omit;
2619 };
2620
2621 // --- globalTitle handling--
2622 if ( ispresent(pl_ASPAddress.globalTitle))
2623 {//startif1
2624
2625 var SCCP_ASPfield_GlobalTitle tmpGT ;
2626 tmpGT := pl_ASPAddress.globalTitle;
2627
2628 if (ischosen(tmpGT.gti0001))
2629 {
2630 vl_PDUAddress.globalTitle.gti0001.natureOfAddress:=tmpGT.gti0001.natureOfAddress;
2631 vl_PDUAddress.globalTitle.gti0001.oddeven:=tmpGT.gti0001.oddeven;
2632 vl_PDUAddress.globalTitle.gti0001.globalTitleAddress:=tmpGT.gti0001.globalTitleAddress;
2633 }
2634 else if (ischosen(tmpGT.gti0010))
2635 {
2636 vl_PDUAddress.globalTitle.gti0010.translationType:=tmpGT.gti0010.translationType;
2637 vl_PDUAddress.globalTitle.gti0010.globalTitleAddress:=tmpGT.gti0010.globalTitleAddress;
2638 }
2639 else if (ischosen(tmpGT.gti0011))
2640 {
2641 vl_PDUAddress.globalTitle.gti0011.translationType:=tmpGT.gti0011.translationType;
2642 vl_PDUAddress.globalTitle.gti0011.encodingScheme:=tmpGT.gti0011.encodingScheme;
2643 vl_PDUAddress.globalTitle.gti0011.numberingPlan:=tmpGT.gti0011.numberingPlan;
2644 vl_PDUAddress.globalTitle.gti0011.globalTitleAddress:=tmpGT.gti0011.globalTitleAddress;
2645 }
2646 else if (ischosen(tmpGT.gti0100))
2647 {
2648 vl_PDUAddress.globalTitle.gti0100.translationType:=tmpGT.gti0100.translationType;
2649 vl_PDUAddress.globalTitle.gti0100.encodingScheme:=tmpGT.gti0100.encodingScheme;
2650 vl_PDUAddress.globalTitle.gti0100.numberingPlan:=tmpGT.gti0100.numberingPlan;
2651 vl_PDUAddress.globalTitle.gti0100.natureOfAddress:=tmpGT.gti0100.natureOfAddress;
2652 vl_PDUAddress.globalTitle.gti0100.reserved:='0'B;
2653 vl_PDUAddress.globalTitle.gti0100.globalTitleAddress:=tmpGT.gti0100.globalTitleAddress;
2654 };
2655 }
2656 else
2657 {
2658 vl_PDUAddress.globalTitle := omit;
2659 };
2660
2661 vl_PDUAddressEncoded.addr:= enc_PDU_SCCP_Address_ttc( vl_PDUAddress);
2662 vl_PDUAddressEncoded.paramLength:= lengthof(vl_PDUAddressEncoded.addr);
2663
2664 return vl_PDUAddressEncoded;
2665
2666 } //ConvertASPAddressToEncodedAddress_ttc
2667
2668 // mpt national:
2669
2670 function ConvertASPAddressToEncodedAddress_mpt( in SCCP_PAR_Address pl_ASPAddress)
2671 runs on SCCP_CT
2672 return SCCP_param_CPartyAddressEnc
2673 {
2674
2675 var SCCP_param_CPartyAddress_mpt vl_PDUAddress; //structured fit to encoding
2676 var SCCP_param_CPartyAddressEnc vl_PDUAddressEncoded;
2677
2678 vl_PDUAddress.addressIndicator.pointCodeIndic:=
2679 pl_ASPAddress.addressIndicator.pointCodeIndic;
2680
2681 vl_PDUAddress.addressIndicator.ssnIndicator:=
2682 pl_ASPAddress.addressIndicator.ssnIndicator;
2683
2684 vl_PDUAddress.addressIndicator.globalTitleIndic:=
2685 pl_ASPAddress.addressIndicator.globalTitleIndic;
2686
2687 vl_PDUAddress.addressIndicator.routingIndicator:=
2688 pl_ASPAddress.addressIndicator.routingIndicator;
2689
2690 vl_PDUAddress.addressIndicator.reserved:='1'B;
2691
2692 //----signPointCode handling
2693 if ( ispresent( pl_ASPAddress.signPointCode )) {
2694 vl_PDUAddress.signPointCode := pl_ASPAddress.signPointCode;
2695 } else {
2696 vl_PDUAddress.signPointCode := omit;
2697 };
2698
2699 //----subsystemNumber handling
2700 if ( ispresent( pl_ASPAddress.subsystemNumber ) ){
2701 vl_PDUAddress.subsystemNumber:= pl_ASPAddress.subsystemNumber;
2702 } else {
2703 vl_PDUAddress.subsystemNumber :=omit;
2704 };
2705
2706 // --- globalTitle handling--
2707 if ( ispresent(pl_ASPAddress.globalTitle))
2708 {//startif1
2709
2710 var SCCP_ASPfield_GlobalTitle tmpGT ;
2711 tmpGT := pl_ASPAddress.globalTitle;
2712
2713 if (ischosen(tmpGT.gti0001))
2714 {
2715 vl_PDUAddress.globalTitle.gti0001.natureOfAddress:=tmpGT.gti0001.natureOfAddress;
2716 vl_PDUAddress.globalTitle.gti0001.oddeven:=tmpGT.gti0001.oddeven;
2717 vl_PDUAddress.globalTitle.gti0001.globalTitleAddress:=tmpGT.gti0001.globalTitleAddress;
2718 }
2719 else if (ischosen(tmpGT.gti0010))
2720 {
2721 vl_PDUAddress.globalTitle.gti0010.translationType:=tmpGT.gti0010.translationType;
2722 vl_PDUAddress.globalTitle.gti0010.globalTitleAddress:=tmpGT.gti0010.globalTitleAddress;
2723 }
2724 else if (ischosen(tmpGT.gti0011))
2725 {
2726 vl_PDUAddress.globalTitle.gti0011.translationType:=tmpGT.gti0011.translationType;
2727 vl_PDUAddress.globalTitle.gti0011.encodingScheme:=tmpGT.gti0011.encodingScheme;
2728 vl_PDUAddress.globalTitle.gti0011.numberingPlan:=tmpGT.gti0011.numberingPlan;
2729 vl_PDUAddress.globalTitle.gti0011.globalTitleAddress:=tmpGT.gti0011.globalTitleAddress;
2730 }
2731 else if (ischosen(tmpGT.gti0100))
2732 {
2733 vl_PDUAddress.globalTitle.gti0100.translationType:=tmpGT.gti0100.translationType;
2734 vl_PDUAddress.globalTitle.gti0100.encodingScheme:=tmpGT.gti0100.encodingScheme;
2735 vl_PDUAddress.globalTitle.gti0100.numberingPlan:=tmpGT.gti0100.numberingPlan;
2736 vl_PDUAddress.globalTitle.gti0100.natureOfAddress:=tmpGT.gti0100.natureOfAddress;
2737 vl_PDUAddress.globalTitle.gti0100.reserved:='0'B;
2738 vl_PDUAddress.globalTitle.gti0100.globalTitleAddress:=tmpGT.gti0100.globalTitleAddress;
2739 };
2740 }
2741 else
2742 {
2743 vl_PDUAddress.globalTitle := omit;
2744 };
2745
2746 vl_PDUAddressEncoded.addr:= enc_PDU_SCCP_Address_mpt( vl_PDUAddress);
2747 vl_PDUAddressEncoded.paramLength:= lengthof(vl_PDUAddressEncoded.addr);
2748
2749 return vl_PDUAddressEncoded;
2750
2751 } //ConvertASPAddressToEncodedAddress_mpt
2752
2753 //******************************************************************
2754
2755 //******************************************************************
2756 // CONVERSION / DECODING
2757 //******************************************************************
2758
2759 //******************************************************************
2760 // function ConvertPDUEncodedAddressToASPAddress_itu
2761 // converts Encoded PDU Address into sturctured ASP Address
2762 // according to ITU
2763 //******************************************************************
2764 function ConvertPDUEncodedAddressToASPAddress_itu( in SCCP_param_CPartyAddressEnc pl_PDUAddress)
2765 runs on SCCP_CT return SCCP_PAR_Address
2766 {
2767 var SCCP_PAR_Address vl_ASPAddress;
2768 var SCCP_ASPfield_GlobalTitle tmpGT; // the same for itu, ansi and ttc
2769 var SCCP_param_CPartyAddress_itu vl_PDUAddress;
2770
2771 //new code detail (ethbaat 2003.11.04:
2772 // decoding from octetstring to structure "SCCP_param_CPartyAddress_itu":
2773 vl_PDUAddress := dec_PDU_SCCP_Address_itu( pl_PDUAddress.addr );
2774
2775 vl_ASPAddress.addressIndicator.pointCodeIndic :=
2776 vl_PDUAddress.addressIndicator.pointCodeIndic;
2777
2778 vl_ASPAddress.addressIndicator.ssnIndicator :=
2779 vl_PDUAddress.addressIndicator.ssnIndicator;
2780
2781 vl_ASPAddress.addressIndicator.globalTitleIndic :=
2782 vl_PDUAddress.addressIndicator.globalTitleIndic;
2783
2784 vl_ASPAddress.addressIndicator.routingIndicator :=
2785 vl_PDUAddress.addressIndicator.routingIndicator;
2786
2787 if (ispresent ( vl_PDUAddress.signPointCode)) {
2788 vl_ASPAddress.signPointCode:= substr(vl_PDUAddress.signPointCode,2,14);
2789 }
2790 else {
2791 vl_ASPAddress.signPointCode := omit; //ethbaat 2003.11.04
2792 }
2793
2794 if (ispresent (vl_PDUAddress.subsystemNumber )) { //always suggested ...
2795 vl_ASPAddress.subsystemNumber:= vl_PDUAddress.subsystemNumber;
2796 }
2797 else {
2798 vl_ASPAddress.subsystemNumber:=omit; //ethbaat 2003.11.04
2799 }
2800
2801 if( ispresent( vl_PDUAddress.globalTitle ) ){
2802 if (ischosen (vl_PDUAddress.globalTitle.gti0001))
2803 {
2804 tmpGT.gti0001.natureOfAddress:=vl_PDUAddress.globalTitle.gti0001.natureOfAddress;
2805 tmpGT.gti0001.oddeven:=vl_PDUAddress.globalTitle.gti0001.oddeven;
2806 tmpGT.gti0001.globalTitleAddress:=vl_PDUAddress.globalTitle.gti0001.globalTitleAddress;
2807 vl_ASPAddress.globalTitle:=tmpGT;
2808 }
2809 else if (ischosen (vl_PDUAddress.globalTitle.gti0010))
2810 {
2811 tmpGT.gti0010.translationType:=vl_PDUAddress.globalTitle.gti0010.translationType;
2812 tmpGT.gti0010.globalTitleAddress:=vl_PDUAddress.globalTitle.gti0010.globalTitleAddress;
2813 vl_ASPAddress.globalTitle:=tmpGT;
2814 }
2815 else if (ischosen (vl_PDUAddress.globalTitle.gti0011))
2816 {
2817 tmpGT.gti0011.translationType :=vl_PDUAddress.globalTitle.gti0011.translationType;
2818 tmpGT.gti0011.encodingScheme :=vl_PDUAddress.globalTitle.gti0011.encodingScheme;
2819 tmpGT.gti0011.numberingPlan :=vl_PDUAddress.globalTitle.gti0011.numberingPlan;
2820 tmpGT.gti0011.globalTitleAddress:=vl_PDUAddress.globalTitle.gti0011.globalTitleAddress;
2821 vl_ASPAddress.globalTitle :=tmpGT;
2822 }
2823 else if (ischosen (vl_PDUAddress.globalTitle.gti0100))
2824 {
2825 tmpGT.gti0100.translationType :=vl_PDUAddress.globalTitle.gti0100.translationType;
2826 tmpGT.gti0100.encodingScheme :=vl_PDUAddress.globalTitle.gti0100.encodingScheme;
2827 tmpGT.gti0100.numberingPlan :=vl_PDUAddress.globalTitle.gti0100.numberingPlan;
2828 tmpGT.gti0100.natureOfAddress :=vl_PDUAddress.globalTitle.gti0100.natureOfAddress
2829 //tmpGT.gti0100.reserved:='00'B;
2830 tmpGT.gti0100.globalTitleAddress:=vl_PDUAddress.globalTitle.gti0100.globalTitleAddress;
2831 vl_ASPAddress.globalTitle :=tmpGT;
2832 }
2833 }
2834 else
2835 {
2836 vl_ASPAddress.globalTitle:= omit;
2837 };
2838
2839 return vl_ASPAddress;
2840 } //ConvertPDUEncodedAddressToASPAddress_itu
2841
2842 //******************************************************************
2843 // function ConvertPDUEncodedAddressToASPAddress_ansi
2844 // converts Encoded PDU Address into sturctured ASP Address
2845 // according to ANSI
2846 //******************************************************************
2847
2848 function ConvertPDUEncodedAddressToASPAddress_ansi( in SCCP_param_CPartyAddressEnc pl_PDUAddress)
2849 runs on SCCP_CT return SCCP_PAR_Address
2850 {
2851 var SCCP_PAR_Address vl_ASPAddress;
2852 var SCCP_ASPfield_GlobalTitle tmpGT; // the same for itu, ansi and ttc
2853 var SCCP_param_CPartyAddress_ansi vl_PDUAddress;
2854
2855 //new code detail (ethbaat 2003.11.04:
2856 // decoding from octetstring to structure "SCCP_param_CPartyAddress_itu":
2857 vl_PDUAddress := dec_PDU_SCCP_Address_ansi( pl_PDUAddress.addr );
2858
2859 vl_ASPAddress.addressIndicator.pointCodeIndic :=
2860 vl_PDUAddress.addressIndicator.pointCodeIndic;
2861
2862 vl_ASPAddress.addressIndicator.ssnIndicator :=
2863 vl_PDUAddress.addressIndicator.ssnIndicator;
2864
2865 vl_ASPAddress.addressIndicator.globalTitleIndic :=
2866 vl_PDUAddress.addressIndicator.globalTitleIndic;
2867
2868 vl_ASPAddress.addressIndicator.routingIndicator :=
2869 vl_PDUAddress.addressIndicator.routingIndicator;
2870
2871 if (ispresent (vl_PDUAddress.signPointCode )) {
2872 vl_ASPAddress.signPointCode:= vl_PDUAddress.signPointCode;
2873 }
2874 else {
2875 //vl_ASPAddress.signPointCode.pointCode:='0000000000000000'B; //or empty??? ( 16len bitstring
2876 vl_ASPAddress.signPointCode:= omit; //ethbaat 2003.11.11
2877 }
2878
2879 if (ispresent (vl_PDUAddress.subsystemNumber)) { //always suggested ...
2880 vl_ASPAddress.subsystemNumber:= vl_PDUAddress.subsystemNumber;
2881 }
2882 else {
2883 vl_ASPAddress.subsystemNumber:=omit; //ethbaat 2003.11.04
2884 //vl_ASPAddress.subsystemNumber:= 0;
2885 };
2886
2887 if( ispresent( vl_PDUAddress.globalTitle ) ){
2888 if (ischosen (vl_PDUAddress.globalTitle.gti0001))
2889 {
2890 tmpGT.gti0011.translationType :=vl_PDUAddress.globalTitle.gti0001.translationType;
2891 tmpGT.gti0011.encodingScheme :=vl_PDUAddress.globalTitle.gti0001.encodingScheme;
2892 tmpGT.gti0011.numberingPlan :=vl_PDUAddress.globalTitle.gti0001.numberingPlan;
2893 tmpGT.gti0011.globalTitleAddress:=vl_PDUAddress.globalTitle.gti0001.globalTitleAddress;
2894 vl_ASPAddress.globalTitle :=tmpGT;
2895 }
2896 if (ischosen (vl_PDUAddress.globalTitle.gti0010))
2897 {
2898 tmpGT.gti0010.translationType:=vl_PDUAddress.globalTitle.gti0010.translationType;
2899 tmpGT.gti0010.globalTitleAddress:=vl_PDUAddress.globalTitle.gti0010.globalTitleAddress;
2900 vl_ASPAddress.globalTitle:=tmpGT;
2901 };
2902 }
2903 else
2904 {
2905 vl_ASPAddress.globalTitle:= omit;
2906 };
2907
2908 return vl_ASPAddress;
2909 } //ConvertPDUEncodedAddressToASPAddress_ansi
2910
2911 //******************************************************************
2912 // function ConvertPDUEncodedAddressToASPAddress_ttc
2913 // converts Encoded PDU Address into sturctured ASP Address
2914 // according to ttc
2915 //******************************************************************
2916 function ConvertPDUEncodedAddressToASPAddress_ttc( in SCCP_param_CPartyAddressEnc pl_PDUAddress)
2917 runs on SCCP_CT return SCCP_PAR_Address
2918 {
2919 var SCCP_PAR_Address vl_ASPAddress;
2920 var SCCP_ASPfield_GlobalTitle tmpGT; // the same for itu, ansi and ttc
2921 var SCCP_param_CPartyAddress_ttc vl_PDUAddress;
2922
2923 //new code detail (ethbaat 2003.11.04:
2924 // decoding from octetstring to structure "SCCP_param_CPartyAddress_itu":
2925 vl_PDUAddress := dec_PDU_SCCP_Address_ttc( pl_PDUAddress.addr );
2926
2927 vl_ASPAddress.addressIndicator.pointCodeIndic :=
2928 vl_PDUAddress.addressIndicator.pointCodeIndic;
2929
2930 vl_ASPAddress.addressIndicator.ssnIndicator :=
2931 vl_PDUAddress.addressIndicator.ssnIndicator;
2932
2933 vl_ASPAddress.addressIndicator.globalTitleIndic :=
2934 vl_PDUAddress.addressIndicator.globalTitleIndic;
2935
2936 vl_ASPAddress.addressIndicator.routingIndicator :=
2937 vl_PDUAddress.addressIndicator.routingIndicator;
2938
2939 if (ispresent ( vl_PDUAddress.signPointCode)) {
2940 vl_ASPAddress.signPointCode:= vl_PDUAddress.signPointCode; //old:substr(vl_PDUAddress.signPointCode,2,16);
2941 }
2942 else {
2943 vl_ASPAddress.signPointCode := omit; //ethbaat 2003.11.04
2944 }
2945
2946 if (ispresent (vl_PDUAddress.subsystemNumber )) { //always suggested ...
2947 vl_ASPAddress.subsystemNumber:= vl_PDUAddress.subsystemNumber;
2948 }
2949 else {
2950 vl_ASPAddress.subsystemNumber:=omit; //ethbaat 2003.11.04
2951 }
2952
2953 if( ispresent( vl_PDUAddress.globalTitle)){
2954 if (ischosen (vl_PDUAddress.globalTitle.gti0001))
2955 {
2956 tmpGT.gti0001.natureOfAddress:=vl_PDUAddress.globalTitle.gti0001.natureOfAddress;
2957 tmpGT.gti0001.oddeven:=vl_PDUAddress.globalTitle.gti0001.oddeven;
2958 tmpGT.gti0001.globalTitleAddress:=vl_PDUAddress.globalTitle.gti0001.globalTitleAddress;
2959 vl_ASPAddress.globalTitle:=tmpGT;
2960 }
2961 else if (ischosen (vl_PDUAddress.globalTitle.gti0010))
2962 {
2963 tmpGT.gti0010.translationType:=vl_PDUAddress.globalTitle.gti0010.translationType;
2964 tmpGT.gti0010.globalTitleAddress:=vl_PDUAddress.globalTitle.gti0010.globalTitleAddress;
2965 vl_ASPAddress.globalTitle:=tmpGT;
2966 }
2967 else if (ischosen (vl_PDUAddress.globalTitle.gti0011))
2968 {
2969 tmpGT.gti0011.translationType :=vl_PDUAddress.globalTitle.gti0011.translationType;
2970 tmpGT.gti0011.encodingScheme :=vl_PDUAddress.globalTitle.gti0011.encodingScheme;
2971 tmpGT.gti0011.numberingPlan :=vl_PDUAddress.globalTitle.gti0011.numberingPlan;
2972 tmpGT.gti0011.globalTitleAddress:=vl_PDUAddress.globalTitle.gti0011.globalTitleAddress;
2973 vl_ASPAddress.globalTitle :=tmpGT;
2974 }
2975 else if (ischosen (vl_PDUAddress.globalTitle.gti0100))
2976 {
2977 tmpGT.gti0100.translationType :=vl_PDUAddress.globalTitle.gti0100.translationType;
2978 tmpGT.gti0100.encodingScheme :=vl_PDUAddress.globalTitle.gti0100.encodingScheme;
2979 tmpGT.gti0100.numberingPlan :=vl_PDUAddress.globalTitle.gti0100.numberingPlan;
2980 tmpGT.gti0100.natureOfAddress :=vl_PDUAddress.globalTitle.gti0100.natureOfAddress;
2981 //tmpGT.gti0100.reserved:='00'B;
2982 tmpGT.gti0100.globalTitleAddress:=vl_PDUAddress.globalTitle.gti0100.globalTitleAddress;
2983 vl_ASPAddress.globalTitle :=tmpGT;
2984 };
2985 }
2986 else
2987 {
2988 vl_ASPAddress.globalTitle:= omit;
2989 };
2990
2991 return vl_ASPAddress;
2992 } //ConvertPDUEncodedAddressToASPAddress_ttc
2993
2994 //******************************************************************
2995 // function ConvertPDUEncodedAddressToASPAddress_mpt
2996 // converts Encoded PDU Address into sturctured ASP Address
2997 // according to mpt
2998 //******************************************************************
2999 function ConvertPDUEncodedAddressToASPAddress_mpt( in SCCP_param_CPartyAddressEnc pl_PDUAddress)
3000 runs on SCCP_CT return SCCP_PAR_Address
3001 {
3002 var SCCP_PAR_Address vl_ASPAddress;
3003 var SCCP_ASPfield_GlobalTitle tmpGT; // the same for itu, ansi and ttc
3004 var SCCP_param_CPartyAddress_mpt vl_PDUAddress;
3005
3006 vl_PDUAddress := dec_PDU_SCCP_Address_mpt( pl_PDUAddress.addr );
3007
3008 vl_ASPAddress.addressIndicator.pointCodeIndic :=
3009 vl_PDUAddress.addressIndicator.pointCodeIndic;
3010
3011 vl_ASPAddress.addressIndicator.ssnIndicator :=
3012 vl_PDUAddress.addressIndicator.ssnIndicator;
3013
3014 vl_ASPAddress.addressIndicator.globalTitleIndic :=
3015 vl_PDUAddress.addressIndicator.globalTitleIndic;
3016
3017 vl_ASPAddress.addressIndicator.routingIndicator :=
3018 vl_PDUAddress.addressIndicator.routingIndicator;
3019
3020 if (ispresent ( vl_PDUAddress.signPointCode)) {
3021 vl_ASPAddress.signPointCode:= vl_PDUAddress.signPointCode;
3022 }
3023 else {
3024 vl_ASPAddress.signPointCode := omit;
3025 }
3026
3027 if (ispresent (vl_PDUAddress.subsystemNumber )) { //always suggested ...
3028 vl_ASPAddress.subsystemNumber:= vl_PDUAddress.subsystemNumber;
3029 }
3030 else {
3031 vl_ASPAddress.subsystemNumber:=omit;
3032 }
3033
3034 if( ispresent( vl_PDUAddress.globalTitle)){
3035 if (ischosen (vl_PDUAddress.globalTitle.gti0001))
3036 {
3037 tmpGT.gti0001.natureOfAddress:=vl_PDUAddress.globalTitle.gti0001.natureOfAddress;
3038 tmpGT.gti0001.oddeven:=vl_PDUAddress.globalTitle.gti0001.oddeven;
3039 tmpGT.gti0001.globalTitleAddress:=vl_PDUAddress.globalTitle.gti0001.globalTitleAddress;
3040 vl_ASPAddress.globalTitle:=tmpGT;
3041 }
3042 else if (ischosen (vl_PDUAddress.globalTitle.gti0010))
3043 {
3044 tmpGT.gti0010.translationType:=vl_PDUAddress.globalTitle.gti0010.translationType;
3045 tmpGT.gti0010.globalTitleAddress:=vl_PDUAddress.globalTitle.gti0010.globalTitleAddress;
3046 vl_ASPAddress.globalTitle:=tmpGT;
3047 }
3048 else if (ischosen (vl_PDUAddress.globalTitle.gti0011))
3049 {
3050 tmpGT.gti0011.translationType :=vl_PDUAddress.globalTitle.gti0011.translationType;
3051 tmpGT.gti0011.encodingScheme :=vl_PDUAddress.globalTitle.gti0011.encodingScheme;
3052 tmpGT.gti0011.numberingPlan :=vl_PDUAddress.globalTitle.gti0011.numberingPlan;
3053 tmpGT.gti0011.globalTitleAddress:=vl_PDUAddress.globalTitle.gti0011.globalTitleAddress;
3054 vl_ASPAddress.globalTitle :=tmpGT;
3055 }
3056 else if (ischosen (vl_PDUAddress.globalTitle.gti0100))
3057 {
3058 tmpGT.gti0100.translationType :=vl_PDUAddress.globalTitle.gti0100.translationType;
3059 tmpGT.gti0100.encodingScheme :=vl_PDUAddress.globalTitle.gti0100.encodingScheme;
3060 tmpGT.gti0100.numberingPlan :=vl_PDUAddress.globalTitle.gti0100.numberingPlan;
3061 tmpGT.gti0100.natureOfAddress :=vl_PDUAddress.globalTitle.gti0100.natureOfAddress;
3062 //tmpGT.gti0100.reserved:='00'B;
3063 tmpGT.gti0100.globalTitleAddress:=vl_PDUAddress.globalTitle.gti0100.globalTitleAddress;
3064 vl_ASPAddress.globalTitle :=tmpGT;
3065 };
3066 }
3067 else
3068 {
3069 vl_ASPAddress.globalTitle:= omit;
3070 };
3071
3072 return vl_ASPAddress;
3073 } //ConvertPDUEncodedAddressToASPAddress_mpt
3074
3075 //==================================================================
3076 // MAIN CONVERSION FUNCTIONS:
3077 //==================================================================
3078
3079 //******************************************************************
3080 // function ConvertASPAddressToEncodedAddress
3081 // converts ASP address structure to PDU address structure
3082 // THIS IS THE MAIN ENCODE FUNCTION (coordinator)
3083 //******************************************************************
3084
3085 function ConvertASPAddressToEncodedAddress( in SCCP_PAR_Address pl_ASPAddress)
3086 runs on SCCP_CT return SCCP_param_CPartyAddressEnc
3087 {
3088 var SCCP_param_CPartyAddressEnc vl_PDUAddressEncoded;
3089 if( ( v_SCCPServiceType == mtp3_itu) or
3090 ( v_SCCPServiceType == mtp3b_itu))
3091 {
3092 return ConvertASPAddressToEncodedAddress_itu( pl_ASPAddress );
3093 }
3094 else if( (v_SCCPServiceType == mtp3_ansi) or
3095 (v_SCCPServiceType == mtp3b_ansi))
3096 {
3097 return ConvertASPAddressToEncodedAddress_ansi( pl_ASPAddress );
3098 }
3099 else if((v_SCCPServiceType == mtp3_ttc) or
3100 (v_SCCPServiceType == mtp3b_ttc))
3101 {
3102 if( (v_SIO == '83'O) or (v_SIO == '43'O) or (v_SIO == 'C3'O) ) //ttc national
3103 {
3104 return ConvertASPAddressToEncodedAddress_ttc( pl_ASPAddress );
3105 }
3106 else
3107 { //international == itu
3108 return ConvertASPAddressToEncodedAddress_itu( pl_ASPAddress );
3109 }
3110 }//if1
3111 else if((v_SCCPServiceType == mtp3_mpt))
3112 {
3113 if( v_NI == 2 ) //mpt national
3114 {
3115 return ConvertASPAddressToEncodedAddress_mpt( pl_ASPAddress );
3116 }
3117 else
3118 { //international == itu
3119 return ConvertASPAddressToEncodedAddress_itu( pl_ASPAddress );
3120 }
3121 }//if1
3122 else {
3123 log("Error in ConvertASPAddressToEncodedAddress: Unknown SCCPServiceType");
3124 stop;
3125 }
3126 return vl_PDUAddressEncoded; // error!!!
3127 }
3128
3129 //******************************************************************
3130 // function ConvertPDUEncodedAddressToASPAddress
3131 // converts Encoded PDU Address into sturctured ASP Address
3132 // THIS IS THE MAIN DECODE FUNCTION (coordinator)
3133 //******************************************************************
3134
3135
3136 function ConvertPDUEncodedAddressToASPAddress( in SCCP_param_CPartyAddressEnc pl_PDUAddress)
3137 runs on SCCP_CT return SCCP_PAR_Address
3138 {
3139 var SCCP_PAR_Address vl_dummyretval;
3140
3141 if( (v_SCCPServiceType == mtp3_itu) or
3142 (v_SCCPServiceType == mtp3b_itu) )
3143 {
3144 return ConvertPDUEncodedAddressToASPAddress_itu( pl_PDUAddress );
3145 }
3146 else if( (v_SCCPServiceType == mtp3_ansi) or
3147 (v_SCCPServiceType == mtp3b_ansi) )
3148 {
3149 return ConvertPDUEncodedAddressToASPAddress_ansi( pl_PDUAddress );
3150 }
3151 else if( (v_SCCPServiceType == mtp3_ttc) or
3152 (v_SCCPServiceType == mtp3b_ttc)){
3153 if( (v_SIO == '83'O) or (v_SIO == '43'O) or (v_SIO == 'C3'O) )
3154 {
3155 //ttc national
3156 return ConvertPDUEncodedAddressToASPAddress_ttc( pl_PDUAddress );
3157 }
3158 else {
3159 return ConvertPDUEncodedAddressToASPAddress_itu( pl_PDUAddress );
3160 }
3161 }
3162 else if((v_SCCPServiceType == mtp3_mpt))
3163 {
3164 if( v_NI == 2 ) //mpt national
3165 {
3166 return ConvertPDUEncodedAddressToASPAddress_mpt( pl_PDUAddress );
3167 }
3168 else
3169 { //international == itu
3170 return ConvertPDUEncodedAddressToASPAddress_itu( pl_PDUAddress );
3171 }
3172 }
3173 else {
3174 log("Error in function ConvertPDUEncodedAddressToASPAddress, Unknown SCCPSCCPType");
3175 stop;
3176 }
3177 return vl_dummyretval;
3178 }//ConvertPDUEncodedAddressToASPAddress
3179/*
3180//*************************************************************************
3181//*************************************************************************
3182//EncDec ComponentBehaviour
3183//*************************************************************************
3184//*************************************************************************
3185
3186 // TO DO:Desk check it! As I see, it's OK, but the meaning has been changed\
3187 // because structure of PDU_SCCP has been changed
3188
3189 //*************************************************************************
3190 function ScanRAWPorts() runs on SCCP_EncDec_CT
3191 //*************************************************************************
3192 {
3193 //local declarations
3194 var ASP_MTP3_TRANSFERind vl_ASP_MTP3_TRANSFERind;
3195 var ASP_MTP3_TRANSFERreq vl_ASP_MTP3_TRANSFERreq;
3196 var ASP_MTP3_TRANSFERreq_sccp vl_ASP_MTP3_TRANSFERreq_sccp
3197
3198 var PDU_SCCP vl_PDU_SCCP;
3199 var integer vl_msg_type;
3200
3201 while (true)
3202 {
3203 alt
3204 {
3205
3206 //********************************************************************
3207 //message received from SCCP , containing a PDU to be encoded
3208 //********************************************************************
3209
3210 []MTP3_SCCP_SP_PORT.receive( tr_ASP_MTP3_TRANSFERreq_sccp) -> value vl_ASP_MTP3_TRANSFERreq_sccp
3211 {
3212 var bitstring vl_sio_bit := oct2bit(vl_ASP_MTP3_TRANSFERreq_sccp.sio);
3213 var MTP3_Field_sio vl_sio_struct;
3214 vl_sio_struct.ni := substr(vl_sio_bit,0,2);
3215 vl_sio_struct.prio := substr(vl_sio_bit,2,2);
3216 vl_sio_struct.si := substr(vl_sio_bit,4,4);
3217
3218 MTP3_PORT.send(t_ASP_MTP3_TRANSFERreq(
3219 vl_sio_struct,
3220 vl_ASP_MTP3_TRANSFERreq_sccp.opc,
3221 vl_ASP_MTP3_TRANSFERreq_sccp.dpc,
3222 vl_ASP_MTP3_TRANSFERreq_sccp.sls,
3223 enc_PDU_SCCP(vl_ASP_MTP3_TRANSFERreq_sccp.data)
3224 ));
3225 }
3226
3227 //********************************************************************
3228 //message received from MTP3 , containing an octetstring to be decoded:
3229 //********************************************************************
3230
3231 []MTP3_PORT.receive(tr_ASP_MTP3_TRANSFERind) -> value vl_ASP_MTP3_TRANSFERind
3232 {//startStatementBlock
3233 if (vl_ASP_MTP3_TRANSFERind.sio.si != '0011'B)
3234 {
3235 log("The received message is not SCCP. Ignored.");
3236 repeat;
3237 }
3238 vl_msg_type:= oct2int( vl_ASP_MTP3_TRANSFERind.data[0] );
3239
3240 select(vl_msg_type)
3241 {
3242 case (xudt) // '11'O
3243 {
3244 vl_PDU_SCCP:=dec_PDU_SCCP(vl_ASP_MTP3_TRANSFERind.data);
3245 MTP3_SCCP_SP_PORT.send( vl_PDU_SCCP.extudata );
3246 }
3247 case (udt) //'09'O
3248 {
3249 //decode octetstring
3250 vl_PDU_SCCP:=dec_PDU_SCCP(vl_ASP_MTP3_TRANSFERind.data);
3251
3252 MTP3_SCCP_SP_PORT.send( t_PDU_SCCP_Unitdata(
3253 vl_PDU_SCCP.unitdata.protClass,
3254 vl_PDU_SCCP.unitdata.calledPAddress,
3255 vl_PDU_SCCP.unitdata.callingPAddress,
3256 vl_PDU_SCCP.unitdata.data));
3257
3258 }//endif
3259 case (dt1)//'06'O
3260 {
3261 vl_PDU_SCCP:=dec_PDU_SCCP(vl_ASP_MTP3_TRANSFERind.data);
3262
3263 MTP3_SCCP_SP_PORT.send( t_PDU_SCCP_DataForm1(
3264 vl_PDU_SCCP.dataform1.destLocRef,
3265 vl_PDU_SCCP.dataform1.segmentingReassembl,
3266 vl_PDU_SCCP.dataform1.data
3267 ));
3268 }
3269 case (cr) //'01'O
3270 {//startif
3271 vl_PDU_SCCP:=dec_PDU_SCCP(vl_ASP_MTP3_TRANSFERind.data);
3272
3273 if (ispresent(vl_PDU_SCCP.connrequest.eop))
3274 {
3275 MTP3_SCCP_SP_PORT.send( t_PDU_SCCP_ConnectionRequest(
3276 vl_PDU_SCCP.connrequest.sourceLocRef,
3277 vl_PDU_SCCP.connrequest.protClass,
3278 vl_PDU_SCCP.connrequest.calledPAddress,
3279 vl_PDU_SCCP.connrequest.optionalPart.credit,
3280 vl_PDU_SCCP.connrequest.optionalPart.callingPAddress,
3281 vl_PDU_SCCP.connrequest.optionalPart.data,
3282 vl_PDU_SCCP.connrequest.optionalPart.hopCounter,
3283 vl_PDU_SCCP.connrequest.optionalPart.importance,
3284 vl_PDU_SCCP.connrequest.eop
3285 ));
3286 }
3287 else
3288 {
3289 MTP3_SCCP_SP_PORT.send( t_PDU_SCCP_ConnectionRequest(
3290 vl_PDU_SCCP.connrequest.sourceLocRef,
3291 vl_PDU_SCCP.connrequest.protClass,
3292 vl_PDU_SCCP.connrequest.calledPAddress,
3293 vl_PDU_SCCP.connrequest.optionalPart.credit,
3294 vl_PDU_SCCP.connrequest.optionalPart.callingPAddress,
3295 vl_PDU_SCCP.connrequest.optionalPart.data,
3296 vl_PDU_SCCP.connrequest.optionalPart.hopCounter,
3297 vl_PDU_SCCP.connrequest.optionalPart.importance,
3298 omit
3299 ));
3300 }
3301
3302 }
3303 case (cc) //'02'O
3304 {
3305 vl_PDU_SCCP:=dec_PDU_SCCP(vl_ASP_MTP3_TRANSFERind.data);
3306
3307 if (ispresent(vl_PDU_SCCP.connconfirm.eop))
3308 {
3309 MTP3_SCCP_SP_PORT.send( t_PDU_SCCP_ConnectionConfirm(
3310 vl_PDU_SCCP.connconfirm.destLocRef,
3311 vl_PDU_SCCP.connconfirm.sourceLocRef,
3312 vl_PDU_SCCP.connconfirm.protClass,
3313 vl_PDU_SCCP.connconfirm.optionalPart.credit,
3314 vl_PDU_SCCP.connconfirm.optionalPart.calledPAddress,
3315 vl_PDU_SCCP.connconfirm.optionalPart.data,
3316 vl_PDU_SCCP.connconfirm.optionalPart.importance,
3317 vl_PDU_SCCP.connconfirm.eop ));
3318 }
3319 else
3320 {
3321 MTP3_SCCP_SP_PORT.send( t_PDU_SCCP_ConnectionConfirm(
3322 vl_PDU_SCCP.connconfirm.destLocRef,
3323 vl_PDU_SCCP.connconfirm.sourceLocRef,
3324 vl_PDU_SCCP.connconfirm.protClass,
3325 vl_PDU_SCCP.connconfirm.optionalPart.credit,
3326 vl_PDU_SCCP.connconfirm.optionalPart.calledPAddress,
3327 vl_PDU_SCCP.connconfirm.optionalPart.data,
3328 vl_PDU_SCCP.connconfirm.optionalPart.importance,
3329 omit));
3330 }
3331
3332 }
3333 case (udts) //'0A'O
3334 {//startif
3335 vl_PDU_SCCP:=dec_PDU_SCCP(vl_ASP_MTP3_TRANSFERind.data);
3336
3337 MTP3_SCCP_SP_PORT.send( t_PDU_SCCP_UnitdataService(
3338 vl_PDU_SCCP.udataserv.returnCause,
3339 vl_PDU_SCCP.udataserv.calledPAddress,
3340 vl_PDU_SCCP.udataserv.callingPAddress,
3341 vl_PDU_SCCP.udataserv.data));
3342
3343 }//endif
3344 case (rlsd) //'04'O
3345 {
3346 vl_PDU_SCCP:=dec_PDU_SCCP(vl_ASP_MTP3_TRANSFERind.data);
3347
3348 if (ispresent(vl_PDU_SCCP.released.eop))
3349 {
3350 MTP3_SCCP_SP_PORT.send( t_PDU_SCCP_Released(
3351 vl_PDU_SCCP.released.destLocRef,
3352 vl_PDU_SCCP.released.sourceLocRef,
3353 vl_PDU_SCCP.released.releaseCause,
3354 vl_PDU_SCCP.released.optionalPart.data,
3355 vl_PDU_SCCP.released.optionalPart.importance,
3356 vl_PDU_SCCP.released.eop
3357 ));
3358 }
3359 else
3360 {
3361 MTP3_SCCP_SP_PORT.send( t_PDU_SCCP_Released(
3362 vl_PDU_SCCP.released.destLocRef,
3363 vl_PDU_SCCP.released.sourceLocRef,
3364 vl_PDU_SCCP.released.releaseCause,
3365 vl_PDU_SCCP.released.optionalPart.data,
3366 vl_PDU_SCCP.released.optionalPart.importance,
3367 omit
3368 ));
3369 }
3370
3371 }
3372 case (err)//'0F'O
3373 {
3374 vl_PDU_SCCP:=dec_PDU_SCCP(vl_ASP_MTP3_TRANSFERind.data);
3375
3376 MTP3_SCCP_SP_PORT.send( t_PDU_SCCP_ProtDataUnitError(
3377 vl_PDU_SCCP.pduerror.destLocRef,
3378 vl_PDU_SCCP.pduerror.errorCause
3379 ));
3380 }
3381 case (rlc)//'05'O
3382 {
3383 vl_PDU_SCCP:=dec_PDU_SCCP(vl_ASP_MTP3_TRANSFERind.data);
3384
3385 MTP3_SCCP_SP_PORT.send( t_PDU_SCCP_ReleaseComplete(
3386 vl_PDU_SCCP.relcomp.destLocRef,
3387 vl_PDU_SCCP.relcomp.sourceLocRef
3388 ));
3389 }
3390 case (it)//'10'O
3391 {
3392 vl_PDU_SCCP:=dec_PDU_SCCP(vl_ASP_MTP3_TRANSFERind.data);
3393
3394 MTP3_SCCP_SP_PORT.send( t_PDU_SCCP_InactivityTest(
3395 vl_PDU_SCCP.inacttest.destLocRef,
3396 vl_PDU_SCCP.inacttest.sourceLocRef,
3397 vl_PDU_SCCP.inacttest.protClass,
3398 vl_PDU_SCCP.inacttest.sequencingSegmenting,
3399 vl_PDU_SCCP.inacttest.credit
3400 ));
3401 }
3402 case (rsr)//'0D'O
3403 {
3404 vl_PDU_SCCP:=dec_PDU_SCCP(vl_ASP_MTP3_TRANSFERind.data);
3405
3406 MTP3_SCCP_SP_PORT.send( t_PDU_SCCP_ResetRequest(
3407 vl_PDU_SCCP.resetreq.destLocRef,
3408 vl_PDU_SCCP.resetreq.sourceLocRef,
3409 vl_PDU_SCCP.resetreq.resetCause
3410 ));
3411 }
3412 case (rsc)//'0E'O
3413 {
3414
3415 vl_PDU_SCCP:=dec_PDU_SCCP(vl_ASP_MTP3_TRANSFERind.data);
3416
3417 MTP3_SCCP_SP_PORT.send( t_PDU_SCCP_ResetConfirm(
3418 vl_PDU_SCCP.resconf.destLocRef,
3419 vl_PDU_SCCP.resconf.sourceLocRef
3420 ));
3421 }//endif
3422 case (cref)//'03'O
3423 {
3424 vl_PDU_SCCP:=dec_PDU_SCCP(vl_ASP_MTP3_TRANSFERind.data);
3425
3426 if (ispresent(vl_PDU_SCCP.connrefused.eop))
3427 {
3428 MTP3_SCCP_SP_PORT.send( t_PDU_SCCP_ConnectionRefused(
3429 vl_PDU_SCCP.connrefused.destLocRef,
3430 vl_PDU_SCCP.connrefused.refusalCause,
3431 vl_PDU_SCCP.connrefused.optionalPart.calledPAddress,
3432 vl_PDU_SCCP.connrefused.optionalPart.data,
3433 vl_PDU_SCCP.connrefused.optionalPart.importance,
3434 vl_PDU_SCCP.connrefused.eop
3435 ));
3436 }
3437 else
3438 {
3439 MTP3_SCCP_SP_PORT.send( t_PDU_SCCP_ConnectionRefused(
3440 vl_PDU_SCCP.connrefused.destLocRef,
3441 vl_PDU_SCCP.connrefused.refusalCause,
3442 vl_PDU_SCCP.connrefused.optionalPart.calledPAddress,
3443 vl_PDU_SCCP.connrefused.optionalPart.data,
3444 vl_PDU_SCCP.connrefused.optionalPart.importance,
3445 omit
3446 ));
3447 }
3448 }
3449 case (xudts,ludt,ludts)
3450 {
3451 log ("Unsupported connectionless message ((-XUDT or)) XUDTS or LUDT or LUDTS - received and discarded");
3452 }
3453 case (dt2,ak,ed,ea )
3454 {
3455 log ("Unsupported connection-oriented message -DT2 or AK or ED or EA - received and discarded");
3456 }
3457 case else { log ("Unrecognized message received and discarded"); }
3458 }
3459 }//endStatementBlock
3460
3461 }//endalt
3462
3463 }//endwhile
3464
3465 }//endfunction
3466*/
3467
3468//******************************************************************
3469//
3470// working functions for ScanEvents
3471//
3472//******************************************************************
3473
3474//******************************************************************
3475// Part 1 : Receiving msg on port "MTP3_SCCP_PORT"
3476//******************************************************************
3477
3478
3479 //******************************************************************
3480 // processing_PDU_SCCP_Unitdata
3481 //******************************************************************
3482 function processing_PDU_SCCP_Unitdata( in PDU_SCCP_Unitdata pl_PDU_SCCP_Unitdata)
3483 runs on SCCP_CT
3484 {
3485 //var PDU_SCCP_Unitdata vl_PDU_SCCP_Unitdata;
3486 var PDU_SCCP vl_PDU_SCCP;
3487 var ASP_SCCP_N_UNITDATA_ind vl_N_UNITDATA_ind;
3488
3489 vl_PDU_SCCP.unitdata:= pl_PDU_SCCP_Unitdata;
3490
3491 // it should be decoded to structure to read if it is a mgmt message or not
3492 vl_N_UNITDATA_ind.calledAddress :=
3493 ConvertPDUEncodedAddressToASPAddress(pl_PDU_SCCP_Unitdata.calledPAddress);
3494
3495 if ( ispresent(vl_N_UNITDATA_ind.calledAddress.subsystemNumber) and
3496 vl_N_UNITDATA_ind.calledAddress.subsystemNumber != cg_SSN_sCCPmanagement)
3497 //SCCP mgmt message
3498 {//startif1
3499
3500 //no SCCP or node congestion assumed
3501 //'route on SSN' assumed
3502
3503 //subsystems are assumed equipped and available
3504 //as the message is received from MTP3 , DPC is assumed to be matching the PC of the own node without
3505 // any further checks
3506
3507 //assemble ASP_SCCP_N_
3508 vl_N_UNITDATA_ind.callingAddress:=
3509 ConvertPDUEncodedAddressToASPAddress(pl_PDU_SCCP_Unitdata.callingPAddress);
3510
3511 // Wrong old:
3512 //vl_N_UNITDATA_ind.sequenceControl:=
3513 // '0000000'B&pl_PDU_SCCP_Unitdata.protClass.class[0]; // Q.713/3.6 0.bit=1=>seq msb???
3514
3515 vl_N_UNITDATA_ind.sequenceControl:=
3516 '0000000'B&pl_PDU_SCCP_Unitdata.protClass.class[3];
3517
3518 if( pl_PDU_SCCP_Unitdata.protClass.messageHandling == '1000'B )
3519 { vl_N_UNITDATA_ind.returnOption := '00000001'B; }
3520 else
3521 { vl_N_UNITDATA_ind.returnOption := '00000000'B; }
3522
3523 //connectionless-class 0 or 1
3524 //protocol class 0- SCCP_sequence_ctrl_off
3525 //protocol class 1- SCCP_sequence_ctrl_on
3526 // wrong: vl_N_UNITDATA_ind.returnOption :='0000000'B&pl_PDU_SCCP_Unitdata.protClass.messageHandling[3];
3527
3528 //only two values( '0000'B -no special options
3529 //and '1000'B -return message on error) assumed
3530 //octetstring vs. length+octetstring
3531 vl_N_UNITDATA_ind.userData :=pl_PDU_SCCP_Unitdata.data.data;
3532 vl_N_UNITDATA_ind.importance := omit;
3533 SCCP_SP_PORT.send( vl_N_UNITDATA_ind );
3534
3535
3536 }//endif1
3537 else { //startelse1-SCCPmanagement message
3538
3539 log ("SCCP management message received");
3540 var octetstring vl_data;
3541 vl_data:=pl_PDU_SCCP_Unitdata.data.data;
3542
3543 vl_PDU_SCCP.unitdata.messageType:=udt ;
3544 vl_PDU_SCCP.unitdata.calledPAddress:=pl_PDU_SCCP_Unitdata.callingPAddress;
3545 vl_PDU_SCCP.unitdata.callingPAddress:=pl_PDU_SCCP_Unitdata.calledPAddress;
3546
3547 if ((vl_data[0]=='03'O) and //SST message
3548 ((v_SSN==0) or (oct2int(vl_data[1])==v_SSN))) //right SSN
3549 {//startif2
3550
3551 //send Unitdata with SSA
3552 vl_PDU_SCCP.unitdata.data.data[0]:='01'O;//Change to SSA
3553 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
3554 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP));//send Unitdata_SSA
3555
3556 }//endif2
3557 else if ((vl_data[0]=='02'O) and //SSP message
3558 ((v_SSN==0) or (oct2int(vl_data[1])==v_SSN))) //right SSN
3559 {//startif2
3560
3561 //send Unitdata with SST
3562 vl_PDU_SCCP.unitdata.data.data[0]:='03'O;//Change to SST
3563 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
3564 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP));//send Unitdata_SST
3565
3566 }//endif2
3567 else if ((vl_data[0]=='01'O) and //SSA message
3568 ((v_SSN==0) or (oct2int(vl_data[1])==v_SSN))) //right SSN
3569 {//startif2
3570
3571 //send Unitdata with SS
3572 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
3573 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP ));//send Unitdata_SSA
3574
3575 }//endif2
3576 else
3577 {
3578 log("Unsupported (or containing inconsistent SSN)SCCP management message received and discarded")
3579 }
3580 }//endelse1
3581 return;
3582 } // processing_PDU_SCCP_Unitdata()
3583
3584 //******************************************************************
3585 // processing_PDU_SCCP_UnitdataService
3586 //******************************************************************
3587 function processing_PDU_SCCP_UnitdataService( in PDU_SCCP_UnitdataService pl_PDU_SCCP_UnitdataService )
3588 runs on SCCP_CT
3589 {
3590
3591 var ASP_SCCP_N_NOTICE_ind vl_N_NOTICE_ind;
3592
3593 //no SCCP or node congestion assumed
3594 //'route on SSN' assumed
3595
3596 //subsystems are assumed equipped and available
3597 //as the message is received from MTP3 , DPC is assumed to be the PC of the own node without
3598 // any further checks
3599
3600 //assemble ASP_SCCP_N_
3601
3602 vl_N_NOTICE_ind.calledAddress :=ConvertPDUEncodedAddressToASPAddress(pl_PDU_SCCP_UnitdataService.calledPAddress );
3603 vl_N_NOTICE_ind.callingAddress:=ConvertPDUEncodedAddressToASPAddress(pl_PDU_SCCP_UnitdataService.callingPAddress);
3604 //one to one mapping between reasonForReturn and returnCause -Q713 A5
3605 vl_N_NOTICE_ind.reasonForReturn := pl_PDU_SCCP_UnitdataService.returnCause ;
3606 vl_N_NOTICE_ind.userData := pl_PDU_SCCP_UnitdataService.data.data ;
3607
3608 SCCP_SP_PORT.send( t_ASP_N_NOTICE_ind(
3609 vl_N_NOTICE_ind.calledAddress ,
3610 vl_N_NOTICE_ind.callingAddress,
3611 vl_N_NOTICE_ind.reasonForReturn,
3612 vl_N_NOTICE_ind.userData ,
3613 omit));
3614
3615 }// processing_PDU_SCCP_UnitdataService
3616
3617
3618 //******************************************************************
3619 // processing_PDU_SCCP_ConnectionRequest
3620 //******************************************************************
3621 function processing_PDU_SCCP_ConnectionRequest( in PDU_SCCP_ConnectionRequest pl_PDU_SCCP_ConnectionRequest)
3622 runs on SCCP_CT
3623 {
3624 //no SCCP or node congestion assumed
3625 //we assume that routing is done on SSN; we are in the dest.node
3626 //SS is equipped and available
3627
3628 //check if connection already established
3629 //local reference not assigned yet; search has to be done based on remote reference,
3630 // to prevent erroneous situations
3631 //for all other MTP3_ASPs, search is done based on destLocRef, containing the local
3632 //reference sent to the neighbouring node
3633
3634 if (ConnectionAlreadyEstablished_remote(pl_PDU_SCCP_ConnectionRequest.sourceLocRef))
3635 {//startif3
3636 v_session :=Retrieve_session_remote(pl_PDU_SCCP_ConnectionRequest.sourceLocRef);
3637 //Action Table follows
3638
3639 if (ConnectionTable[v_session].state==idle)
3640 { log("CR received with reference for an already established conn. in state:idle");}//no source ref known
3641 else if (ConnectionTable[v_session].state==active)
3642 { log("CR received with reference for an already established conn. in state:active");}
3643 else if (ConnectionTable[v_session].state==reset_bothway)
3644 { log("CR received with reference for an already established conn. in state:reset_bothway");}
3645 else if (ConnectionTable[v_session].state==connection_pending_IC)
3646 { log("CR received with reference for an already established conn. in state:connection_pending_IC");}
3647 //discard message, return
3648 else if (ConnectionTable[v_session].state==disconnect_pending)
3649 { log("CR received with reference for an already established conn. in state:disconnect_pending");}//discard message, return
3650 else if (ConnectionTable[v_session].state==reset_IC) {//startif4
3651 //discard received message
3652 f_StartTimer(internal_reset,v_session,0.0);//the dummy timer times out immediately
3653 //state changed to active
3654 ConnectionTable[v_session].state:=active;
3655
3656 }//endif4
3657 else if (ConnectionTable[v_session].state==wait_conn_confirm)
3658 {//startif4
3659 //stop connection timer
3660 f_StopTimer(conn_est,v_session);
3661 //release resources
3662 ReleaseResources(v_session);
3663 }//endif4
3664 }//endif3
3665 else {//startelse
3666
3667 //*************************************************************************
3668 //connection not yet established - new v_session
3669 //check if resources available
3670 v_session:=CheckIdleIndividuals()
3671
3672 //idle individual found , resources available, 0<=v_session<=15
3673 if ( v_session!=-1 )
3674 {//startif3
3675 //
3676 ConnectionTable[v_session].localReference := GenerateLocalReference();
3677 ConnectionTable[v_session].remoteReference:= pl_PDU_SCCP_ConnectionRequest.sourceLocRef;
3678 //local reference assigned here!!(see Fig. C.3/Q714)
3679
3680 ConnectionTable[v_session].connectionId := GenerateConnectionId();
3681
3682 //once local reference is assigned , a session is considered established
3683 //determine protocol class
3684 //assemble ASP_SCCP_N_
3685 //start guard timer T_guard ;if no answer to ASP_SCCP_N_CONNECT_ind is received, timer will release
3686
3687 var ASP_SCCP_N_CONNECT_ind vl_N_CONNECT_ind;
3688 f_StartTimer(t_guard,v_session);
3689
3690 vl_N_CONNECT_ind.calledAddress:=ConvertPDUEncodedAddressToASPAddress(pl_PDU_SCCP_ConnectionRequest.calledPAddress);
3691
3692 if (ispresent(pl_PDU_SCCP_ConnectionRequest.optionalPart))
3693 {
3694 if (ispresent(pl_PDU_SCCP_ConnectionRequest.optionalPart.callingPAddress))
3695 {//startif4
3696
3697 //temporary variable to avoid type conversion problems
3698 var SCCP_param_CPartyAddressEnc vl_PDUAddress;
3699 vl_PDUAddress.addr := pl_PDU_SCCP_ConnectionRequest.optionalPart.callingPAddress.addr;
3700 vl_PDUAddress.paramLength := pl_PDU_SCCP_ConnectionRequest.optionalPart.callingPAddress.paramLength;
3701 vl_N_CONNECT_ind.callingAddress:= ConvertPDUEncodedAddressToASPAddress(vl_PDUAddress);
3702
3703 }//endif4
3704 else {vl_N_CONNECT_ind.callingAddress:=omit}
3705
3706 if (ispresent(pl_PDU_SCCP_ConnectionRequest.optionalPart.data))
3707 {//startif4
3708 //temporary variable to avoid type conversion problems
3709 var SCCP_param_Data_opt vl_SCCP_param_Data_opt;
3710
3711 vl_SCCP_param_Data_opt:=pl_PDU_SCCP_ConnectionRequest.optionalPart.data;
3712 vl_N_CONNECT_ind.userData:=vl_SCCP_param_Data_opt.data;
3713
3714 }//endif4
3715 else {vl_N_CONNECT_ind.userData:=omit}
3716 }
3717 else
3718 {
3719 vl_N_CONNECT_ind.callingAddress:=omit;
3720 vl_N_CONNECT_ind.userData:=omit;
3721 }
3722
3723 vl_N_CONNECT_ind.connectionId:=ConnectionTable[v_session].connectionId;
3724
3725 SCCP_SP_PORT.send( t_ASP_N_CONNECT_ind(
3726 vl_N_CONNECT_ind.calledAddress,
3727 vl_N_CONNECT_ind.callingAddress,
3728 omit,
3729 vl_N_CONNECT_ind.userData, //ethcky
3730 vl_N_CONNECT_ind.connectionId,
3731 omit));//send ASP_SCCP_N_CONNECT_ind
3732
3733 //restart send inactivity timer (baat)
3734 f_StopTimer(ias,v_session);//to avoid warnings
3735 f_StartTimer(ias,v_session);
3736 ConnectionTable[v_session].state:=connection_pending_IC;
3737
3738 }//endif3
3739
3740 //no idle individual found , no resources available , v_session=-1
3741 if (v_session==-1)
3742 {//startif3
3743
3744 var PDU_SCCP vl_PDU_SCCP;
3745 //assemble and route MTP3 ASP
3746 vl_PDU_SCCP.connrefused.messageType:=cref;
3747 vl_PDU_SCCP.connrefused.destLocRef:=pl_PDU_SCCP_ConnectionRequest.sourceLocRef;
3748 vl_PDU_SCCP.connrefused.refusalCause:=1;//End user congestion
3749 vl_PDU_SCCP.connrefused.pointer1:=0;// No options
3750 vl_PDU_SCCP.connrefused.optionalPart:=omit;
3751 vl_PDU_SCCP.connrefused.eop:=omit;
3752 MTP3_SCCP_PORT.send ( t_ASP_MTP3_TRANSFERreq_sccp
3753 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP)); //Connection refused, no idle individuals
3754 //return to idle
3755 }//endif3
3756 }//endelse
3757
3758 }//processing_PDU_SCCP_ConnectionRequest
3759
3760//******************************************************************
3761// processing_PDU_SCCP_ConnectionConfirm
3762//******************************************************************
3763 function processing_PDU_SCCP_ConnectionConfirm( in PDU_SCCP_ConnectionConfirm pl_PDU_SCCP_ConnectionConfirm)
3764 runs on SCCP_CT
3765 {
3766 var PDU_SCCP vl_PDU_SCCP;
3767 var ASP_SCCP_N_CONNECT_cfm vl_N_CONNECT_cfm;
3768
3769 log(pl_PDU_SCCP_ConnectionConfirm);
3770
3771 //check if connection already established
3772 if (ConnectionAlreadyEstablished(pl_PDU_SCCP_ConnectionConfirm.destLocRef))
3773 {//startif2
3774 v_session :=Retrieve_session(pl_PDU_SCCP_ConnectionConfirm.destLocRef);
3775 //Action Table follows
3776 if (ConnectionTable[v_session].state==idle)
3777 {
3778 //assemble and route MTP3_ASP
3779
3780 vl_PDU_SCCP.pduerror.messageType:=err;
3781 vl_PDU_SCCP.pduerror.destLocRef:=ConnectionTable[v_session].remoteReference;
3782 vl_PDU_SCCP.pduerror.errorCause:=cg_Err_unassignedDestinationLRN;
3783
3784 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
3785 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP)); //Send Error
3786 //then return to idle
3787 }
3788 else if (ConnectionTable[v_session].state==connection_pending_IC)
3789 { log("CC received in state:connection_pending_IC"); }//discard message, return
3790 else if (ConnectionTable[v_session].state==disconnect_pending)
3791 { log("CC received in state:disconnect_pending"); }//discard message, return
3792 else if (ConnectionTable[v_session].state==active)
3793 { log("CC received in state:active"); }//do nothing, return
3794 else if (ConnectionTable[v_session].state==reset_bothway)
3795 { log("CC received in state:reset_bothway"); }//
3796 else if (ConnectionTable[v_session].state==connection_pending_OG)
3797 {//startif3
3798 //stop connection timer
3799 f_StopTimer(conn_est,v_session);
3800 //start inactivity timers
3801 f_StartTimer(ias,v_session);
3802 f_StartTimer(iar,v_session);
3803 //assign protocol class:=2, associate remote reference
3804 ConnectionTable[v_session].remoteReference:=pl_PDU_SCCP_ConnectionConfirm.sourceLocRef;
3805 //assemble ASP_SCCP_N_
3806 vl_N_CONNECT_cfm.connectionId:=ConnectionTable[v_session].connectionId;
3807
3808 SCCP_SP_PORT.send( t_ASP_N_CONNECT_cfm(
3809 omit,
3810 omit,
3811 omit,
3812 vl_N_CONNECT_cfm.connectionId,
3813 omit
3814 ));//send ASP_SCCP_N_CONNECT_confirm
3815
3816 ConnectionTable[v_session].state:=active;
3817 }//endif3
3818 else if (ConnectionTable[v_session].state==wait_conn_confirm)//connection is confirmed ,
3819 // but it has meanwhile been disconnected by the user
3820 {//startif3
3821 //stop connection timer
3822 f_StopTimer(conn_est,v_session);
3823 //associate remote reference to connection
3824 ConnectionTable[v_session].remoteReference:=pl_PDU_SCCP_ConnectionConfirm.sourceLocRef;
3825 //assemble and route MTP3_ASP
3826 vl_PDU_SCCP.released.messageType:=rlsd;
3827 vl_PDU_SCCP.released.destLocRef:=ConnectionTable[v_session].remoteReference;
3828 vl_PDU_SCCP.released.sourceLocRef:=ConnectionTable[v_session].localReference;
3829 vl_PDU_SCCP.released.releaseCause:=cg_DISC_normal;
3830 vl_PDU_SCCP.released.pointer1:=0;//No options
3831 vl_PDU_SCCP.released.optionalPart:=omit;
3832 vl_PDU_SCCP.released.eop:=omit;
3833
3834 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
3835 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP));//send Released
3836 //start release timer
3837 f_StartTimer(rel,v_session);
3838 ConnectionTable[v_session].state:=disconnect_pending;
3839 }//endif3
3840 else if (ConnectionTable[v_session].state==reset_IC)
3841 {//startif3
3842 //discard received message
3843 f_StartTimer(internal_reset,v_session,0.0);//the timer times out immediately
3844 //state changed to active
3845 ConnectionTable[v_session].state:=active;
3846
3847 }//endif3
3848 else { log("CC received in an unexpected state"); }
3849 }//endif2
3850 else {//startelse -Connection confirm received with destLocRef not in ConnectionTable
3851 //send ERR
3852
3853 vl_PDU_SCCP.pduerror.messageType:=err;
3854 vl_PDU_SCCP.pduerror.destLocRef:=pl_PDU_SCCP_ConnectionConfirm.sourceLocRef;
3855 vl_PDU_SCCP.pduerror.errorCause:=cg_Err_unassignedDestinationLRN;
3856
3857 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
3858 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP)); //Send Error
3859 }//endelse
3860
3861 }//processing_PDU_SCCP_ConnectionConfirm
3862
3863 //******************************************************************
3864 // processing_PDU_SCCP_Released
3865 //******************************************************************
3866 function processing_PDU_SCCP_Released( in PDU_SCCP_Released pl_PDU_SCCP_Released)
3867 runs on SCCP_CT
3868 {
3869 var PDU_SCCP vl_PDU_SCCP;
3870 var ASP_SCCP_N_DISCONNECT_ind vl_N_DISCONNECT_ind;
3871
3872 //Store data parameter
3873 var template SCCP_PAR_UserData tl_data := omit;
3874 if (ispresent(pl_PDU_SCCP_Released.optionalPart))
3875 {
3876 if (ispresent(pl_PDU_SCCP_Released.optionalPart.data))
3877 {
3878 tl_data := pl_PDU_SCCP_Released.optionalPart.data.data;
3879 }
3880 }
3881
3882 //check if connection already established
3883 if (ConnectionAlreadyEstablished(pl_PDU_SCCP_Released.destLocRef))
3884 {//startif1
3885 v_session :=Retrieve_session(pl_PDU_SCCP_Released.destLocRef);
3886 //check if remote reference is correct -Table B.2 /Q.714
3887 if (ConnectionTable[v_session].remoteReference==pl_PDU_SCCP_Released.sourceLocRef)
3888 {//startif2
3889 //Action Table follows
3890 if (ConnectionTable[v_session].state==idle)//C.3- 1/6 ????nem valoszinu hogy ez eloallhat
3891 {//startif3
3892
3893 //assemble and route MTP3_ASP
3894 vl_PDU_SCCP.relcomp.messageType:=rlc;
3895 vl_PDU_SCCP.relcomp.destLocRef:=ConnectionTable[v_session].remoteReference;
3896 vl_PDU_SCCP.relcomp.sourceLocRef:=ConnectionTable[v_session].localReference;
3897
3898 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
3899 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP)); //Send Release complete
3900 //then return to idle
3901 }//endif3
3902 else if (ConnectionTable[v_session].state==connection_pending_IC)
3903 { log("RLSD received in state:connection_pending_IC");}//discard message, return
3904 else if (ConnectionTable[v_session].state==disconnect_pending)
3905 { log("RLSD received in state:disconnect_pending");}//discard message, return
3906 else if (ConnectionTable[v_session].state==active)
3907 {//startif3
3908 //assemble ASP_SCCP_N_
3909 vl_N_DISCONNECT_ind.originator:=cg_Mapping_RelCause_Orig[pl_PDU_SCCP_Released.releaseCause];
3910 vl_N_DISCONNECT_ind.reason:=cg_Mapping_RelCause_Reason[pl_PDU_SCCP_Released.releaseCause];
3911 vl_N_DISCONNECT_ind.connectionId:=ConnectionTable[v_session].connectionId;
3912
3913 SCCP_SP_PORT.send( t_ASP_N_DISCONNECT_ind(
3914 vl_N_DISCONNECT_ind.originator,
3915 omit,
3916 vl_N_DISCONNECT_ind.reason,
3917 tl_data,
3918 vl_N_DISCONNECT_ind.connectionId,
3919 omit
3920 ));//send ASP_SCCP_N_DISCONNECT_ind
3921 //assemble and route MTP3_ASP
3922
3923 vl_PDU_SCCP.relcomp.messageType :=rlc;
3924 vl_PDU_SCCP.relcomp.destLocRef :=pl_PDU_SCCP_Released.sourceLocRef;
3925 vl_PDU_SCCP.relcomp.sourceLocRef:=pl_PDU_SCCP_Released.destLocRef;
3926
3927 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
3928 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP));//send Release complete
3929
3930 //release resources
3931 ReleaseResources(v_session);
3932 }//endif3
3933 else if (ConnectionTable[v_session].state==connection_pending_OG)
3934 {//startif3
3935 //assemble and route MTP3_ASP
3936 vl_PDU_SCCP.relcomp.messageType :=rlc;
3937 vl_PDU_SCCP.relcomp.destLocRef :=pl_PDU_SCCP_Released.sourceLocRef;
3938 vl_PDU_SCCP.relcomp.sourceLocRef:=pl_PDU_SCCP_Released.destLocRef;
3939 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
3940 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP)); //Send Release complete
3941
3942 //stop connection timer
3943 f_StopTimer(conn_est,v_session);
3944 //assemble ASP_SCCP_N_
3945
3946 vl_N_DISCONNECT_ind.originator :=cg_Mapping_RelCause_Orig[pl_PDU_SCCP_Released.releaseCause];
3947 vl_N_DISCONNECT_ind.reason :=cg_Mapping_RelCause_Reason[pl_PDU_SCCP_Released.releaseCause];
3948 vl_N_DISCONNECT_ind.connectionId:=ConnectionTable[v_session].connectionId;
3949
3950 SCCP_SP_PORT.send( t_ASP_N_DISCONNECT_ind(
3951 vl_N_DISCONNECT_ind.originator,
3952 omit,
3953 vl_N_DISCONNECT_ind.reason,
3954 tl_data,
3955 vl_N_DISCONNECT_ind.connectionId,
3956 omit
3957 ));//send ASP_SCCP_N_DISCONNECT_ind
3958 //release resources
3959 ReleaseResources(v_session);
3960
3961 }//endif3
3962 else if (ConnectionTable[v_session].state==wait_conn_confirm)
3963 {//startif3
3964 //assemble and route MTP3_ASP
3965 vl_PDU_SCCP.relcomp.messageType :=rlc;
3966 vl_PDU_SCCP.relcomp.destLocRef :=pl_PDU_SCCP_Released.sourceLocRef;
3967 vl_PDU_SCCP.relcomp.sourceLocRef :=pl_PDU_SCCP_Released.destLocRef;
3968 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
3969 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP)); //Send Release complete
3970 //stop connection timer
3971 f_StopTimer(conn_est,v_session);
3972 //release resources
3973 ReleaseResources(v_session);
3974 }//endif3
3975 else if (ConnectionTable[v_session].state==reset_IC)
3976 {//startif3
3977 //assemble ASP_SCCP_N_
3978 vl_N_DISCONNECT_ind.originator:=cg_Mapping_RelCause_Orig[pl_PDU_SCCP_Released.releaseCause];
3979 vl_N_DISCONNECT_ind.reason :=cg_Mapping_RelCause_Reason[pl_PDU_SCCP_Released.releaseCause];
3980 vl_N_DISCONNECT_ind.connectionId:=ConnectionTable[v_session].connectionId;
3981 SCCP_SP_PORT.send( t_ASP_N_DISCONNECT_ind(
3982 vl_N_DISCONNECT_ind.originator,
3983 omit,
3984 vl_N_DISCONNECT_ind.reason,
3985 tl_data,
3986 vl_N_DISCONNECT_ind.connectionId,
3987 omit
3988 ));//send ASP_SCCP_N_DISCONNECT_ind
3989
3990 //release resources, stop inactivity timers, change state to idle
3991 ReleaseResources(v_session);
3992 }//endif3
3993 else if (ConnectionTable[v_session].state==reset_bothway)
3994 {//startif3
3995 //assemble ASP_SCCP_N_
3996
3997 vl_N_DISCONNECT_ind.originator:=cg_Mapping_RelCause_Orig[pl_PDU_SCCP_Released.releaseCause];
3998 vl_N_DISCONNECT_ind.reason :=cg_Mapping_RelCause_Reason[pl_PDU_SCCP_Released.releaseCause];
3999 vl_N_DISCONNECT_ind.connectionId:=ConnectionTable[v_session].connectionId;
4000
4001 SCCP_SP_PORT.send( t_ASP_N_DISCONNECT_ind(
4002 vl_N_DISCONNECT_ind.originator,
4003 omit,
4004 vl_N_DISCONNECT_ind.reason,
4005 tl_data,
4006 vl_N_DISCONNECT_ind.connectionId,
4007 omit
4008 ));//send ASP_SCCP_N_DISCONNECT_ind
4009
4010 //release resources, stop inactivity timers, change state to idle
4011 ReleaseResources(v_session);
4012
4013 }//endif3
4014 else { log("RLSD received in an unexpected state"); }
4015 }//endif2
4016 else {//remote reference inconsistent, error action follows
4017
4018 vl_PDU_SCCP.pduerror.messageType:=err;
4019 vl_PDU_SCCP.pduerror.destLocRef :=pl_PDU_SCCP_Released.sourceLocRef;
4020 vl_PDU_SCCP.pduerror.errorCause :=cg_Err_inconsistentSourceLRN;
4021
4022 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
4023 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP)); //Send Error
4024 }//endelse
4025 }//endif1
4026 else {//Released(Y,X) received with destLocRef not in ConnectionTable
4027 //send RLC(X,Y)
4028
4029 vl_PDU_SCCP.relcomp.messageType :=rlc;
4030 vl_PDU_SCCP.relcomp.destLocRef :=pl_PDU_SCCP_Released.sourceLocRef;
4031 vl_PDU_SCCP.relcomp.sourceLocRef:=pl_PDU_SCCP_Released.destLocRef;
4032
4033 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
4034 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP)); //Send Release complete
4035
4036 }//endelse
4037 }//processing_PDU_SCCP_Released
4038
4039 //******************************************************************
4040 // processing_PDU_SCCP_ProtDataUnitError
4041 //******************************************************************
4042 function processing_PDU_SCCP_ProtDataUnitError( in PDU_SCCP_ProtDataUnitError pl_PDU_SCCP_ProtDataUnitError)
4043 runs on SCCP_CT
4044 {
4045 var PDU_SCCP vl_PDU_SCCP;
4046 var ASP_SCCP_N_DISCONNECT_ind vl_N_DISCONNECT_ind;
4047
4048 //check if connection already established
4049 if (ConnectionAlreadyEstablished(pl_PDU_SCCP_ProtDataUnitError.destLocRef))
4050 {//startif2
4051 v_session :=Retrieve_session(pl_PDU_SCCP_ProtDataUnitError.destLocRef);
4052 //Action Table follows
4053
4054 if (ConnectionTable[v_session].state==idle)
4055 {//startif3
4056 //assemble and route MTP3_ASP
4057
4058 vl_PDU_SCCP.pduerror.messageType:=err;
4059 vl_PDU_SCCP.pduerror.destLocRef:=ConnectionTable[v_session].remoteReference;
4060 vl_PDU_SCCP.pduerror.errorCause:=cg_Err_unassignedDestinationLRN;
4061 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
4062 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP)); //Send Error
4063 //then return to idle
4064
4065 }//endif3
4066 else if (ConnectionTable[v_session].state==disconnect_pending)
4067 { log("PDUError received in state:disconnect_pending ");}//discard message, return
4068 else if (ConnectionTable[v_session].state==connection_pending_IC)
4069 { log("PDUError received in state:connection_pending_IC ");}//discard message, return
4070 else if (ConnectionTable[v_session].state==reset_bothway)
4071 {//startif3
4072 //assemble ASP_SCCP_N_
4073 vl_N_DISCONNECT_ind.originator :=cg_Undefined;
4074 vl_N_DISCONNECT_ind.reason :=pl_PDU_SCCP_ProtDataUnitError.errorCause;//?
4075 vl_N_DISCONNECT_ind.connectionId:=ConnectionTable[v_session].connectionId;
4076 SCCP_SP_PORT.send( t_ASP_N_DISCONNECT_ind(
4077 vl_N_DISCONNECT_ind.originator,
4078 omit,
4079 vl_N_DISCONNECT_ind.reason,
4080 omit,
4081 vl_N_DISCONNECT_ind.connectionId,
4082 omit
4083 ));//send ASP_SCCP_N_DISCONNECT_ind
4084
4085 //release resources, stop inactivity timers, change state to idle
4086 ReleaseResources(v_session);
4087 }//endif3
4088 else if (ConnectionTable[v_session].state==active)
4089 {//startif3
4090 if (pl_PDU_SCCP_ProtDataUnitError.errorCause!=cg_Err_serviceClassMismatch)
4091 {//startif4
4092
4093 //assemble ASP_SCCP_N_
4094 vl_N_DISCONNECT_ind.originator:=cg_Undefined;
4095 vl_N_DISCONNECT_ind.reason:=pl_PDU_SCCP_ProtDataUnitError.errorCause;//?
4096 vl_N_DISCONNECT_ind.connectionId:=ConnectionTable[v_session].connectionId;
4097
4098 SCCP_SP_PORT.send( t_ASP_N_DISCONNECT_ind(
4099 vl_N_DISCONNECT_ind.originator,
4100 omit,
4101 vl_N_DISCONNECT_ind.reason,
4102 omit,
4103 vl_N_DISCONNECT_ind.connectionId,
4104 omit
4105 ));//send ASP_SCCP_N_DISCONNECT_ind
4106 //release resources
4107 ReleaseResources(v_session);
4108
4109 }//endif4
4110 else {//startelse -Service class mismatch
4111
4112 //assemble ASP_SCCP_N_
4113
4114 vl_N_DISCONNECT_ind.originator :=cg_Undefined;
4115 vl_N_DISCONNECT_ind.reason :=pl_PDU_SCCP_ProtDataUnitError.errorCause;
4116 vl_N_DISCONNECT_ind.connectionId:=ConnectionTable[v_session].connectionId;
4117
4118 SCCP_SP_PORT.send( t_ASP_N_DISCONNECT_ind(
4119 vl_N_DISCONNECT_ind.originator,
4120 omit,
4121 vl_N_DISCONNECT_ind.reason,
4122 omit,
4123 vl_N_DISCONNECT_ind.connectionId,
4124 omit
4125 ));//send ASP_SCCP_N_DISCONNECT_ind
4126
4127 //stop inactivity timers
4128 f_StopTimer(iar,v_session);
4129 f_StopTimer(ias,v_session);
4130 //send Released
4131 //assemble and route MTP3_ASP
4132
4133 vl_PDU_SCCP.released.messageType:=rlsd;
4134 vl_PDU_SCCP.released.destLocRef:=ConnectionTable[v_session].remoteReference;
4135 vl_PDU_SCCP.released.sourceLocRef:=ConnectionTable[v_session].localReference;
4136 vl_PDU_SCCP.released.releaseCause:=cg_Rel_inconsConnData;
4137 vl_PDU_SCCP.released.pointer1:=0;//No optional part
4138 vl_PDU_SCCP.released.optionalPart:=omit;
4139 vl_PDU_SCCP.released.eop:=omit;
4140
4141 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
4142 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP));//send Released
4143
4144 //start release timer
4145 f_StartTimer(rel,v_session);
4146 //change state to diconnect pending
4147 ConnectionTable[v_session].state:=disconnect_pending;
4148
4149 }//endelse
4150
4151 }//endif3
4152 else if (ConnectionTable[v_session].state==connection_pending_OG)
4153 {//startif3
4154 //stop connection timer
4155 f_StopTimer(conn_est,v_session);
4156 //assemble ASP_SCCP_N_
4157
4158 vl_N_DISCONNECT_ind.originator :=cg_Undefined;
4159 vl_N_DISCONNECT_ind.reason :=pl_PDU_SCCP_ProtDataUnitError.errorCause;
4160 vl_N_DISCONNECT_ind.connectionId:=ConnectionTable[v_session].connectionId;
4161
4162 SCCP_SP_PORT.send( t_ASP_N_DISCONNECT_ind(
4163 vl_N_DISCONNECT_ind.originator,
4164 omit,
4165 vl_N_DISCONNECT_ind.reason,
4166 omit,
4167 vl_N_DISCONNECT_ind.connectionId,
4168 omit
4169 ));//send ASP_SCCP_N_DISCONNECT_ind
4170 //release resources
4171 ReleaseResources(v_session);
4172 }//endif3
4173 else if (ConnectionTable[v_session].state==wait_conn_confirm)
4174 {//startif3
4175
4176 //stop connection timer
4177 f_StopTimer(conn_est,v_session);
4178 //release resources
4179 ReleaseResources(v_session);
4180
4181
4182 }//endif3
4183 else if (ConnectionTable[v_session].state==reset_IC)
4184 {//startif3
4185 //assemble ASP_SCCP_N_
4186 vl_N_DISCONNECT_ind.originator:=cg_Undefined;
4187 vl_N_DISCONNECT_ind.reason:=pl_PDU_SCCP_ProtDataUnitError.errorCause;
4188 vl_N_DISCONNECT_ind.connectionId:=ConnectionTable[v_session].connectionId;
4189 SCCP_SP_PORT.send( t_ASP_N_DISCONNECT_ind(
4190 vl_N_DISCONNECT_ind.originator,
4191 omit,
4192 vl_N_DISCONNECT_ind.reason,
4193 omit,
4194 vl_N_DISCONNECT_ind.connectionId,
4195 omit
4196 ));//send ASP_SCCP_N_DISCONNECT_ind
4197
4198 //release resources, stop inactivity timers, change state to idle
4199 ReleaseResources(v_session);
4200
4201 }//endif3
4202 else { log("PDUError received in an unexpected state"); }
4203 }//endif2
4204 else {}//PDU_Error received with destLocRef not in ConnectionTable
4205
4206 }//processing_PDU_SCCP_ProtDataUnitError
4207
4208 //******************************************************************
4209 // processing_PDU_SCCP_ReleaseComplete
4210 //******************************************************************
4211 function processing_PDU_SCCP_ReleaseComplete(in PDU_SCCP_ReleaseComplete pl_PDU_SCCP_ReleaseComplete)
4212 runs on SCCP_CT
4213 {
4214 var ASP_SCCP_N_DISCONNECT_ind vl_N_DISCONNECT_ind;
4215
4216 //check if connection already established
4217 if (ConnectionAlreadyEstablished(pl_PDU_SCCP_ReleaseComplete.destLocRef))
4218 {//startif1
4219
4220 v_session :=Retrieve_session(pl_PDU_SCCP_ReleaseComplete.destLocRef);
4221 //check if remote reference is correct -Table B.2 /Q.714
4222 if (ConnectionTable[v_session].remoteReference==pl_PDU_SCCP_ReleaseComplete.sourceLocRef)
4223 {//startif2
4224
4225 //Action Table follows
4226 if (ConnectionTable[v_session].state==idle)
4227 { log("RLC received in state: idle"); }//C.3 1/6-do nothing-return to idle state
4228 else if (ConnectionTable[v_session].state==connection_pending_IC)
4229 { log("RLC received in state: connection_pending_IC"); }//discard message, return
4230 else if (ConnectionTable[v_session].state==active)
4231 { log("RLC received in state: active"); }//do nothing, return
4232 else if (ConnectionTable[v_session].state==reset_bothway)
4233 { log("RLC received in state:reset_bothway "); }//
4234 else if (ConnectionTable[v_session].state==disconnect_pending)
4235 {//startif3
4236 log("RLC received in state:disconnect_pending ");
4237 //log("release resources");
4238 ReleaseResources(v_session);
4239 }//endif3
4240 else if (ConnectionTable[v_session].state==connection_pending_OG)
4241 {//startif3
4242 f_StopTimer(conn_est,v_session);
4243 //assemble ASP_SCCP_N_
4244 vl_N_DISCONNECT_ind.originator:=cg_NSU;
4245 vl_N_DISCONNECT_ind.reason:=cg_DISC_normal;
4246 vl_N_DISCONNECT_ind.connectionId:=ConnectionTable[v_session].connectionId;
4247
4248 SCCP_SP_PORT.send( t_ASP_N_DISCONNECT_ind(
4249 vl_N_DISCONNECT_ind.originator,
4250 omit,
4251 vl_N_DISCONNECT_ind.reason,
4252 omit,
4253 vl_N_DISCONNECT_ind.connectionId,
4254 omit
4255 ));//send ASP_SCCP_N_DISCONNECT_ind
4256 //release resources
4257 ReleaseResources(v_session);
4258 }//endif3
4259 else if (ConnectionTable[v_session].state==wait_conn_confirm)
4260 {//startif3
4261 log("RLC received in state:wait_conn_confirm");
4262 //stop connection timer
4263 f_StopTimer(conn_est,v_session);
4264 //release resources
4265 ReleaseResources(v_session);
4266 }//endif3
4267 else if (ConnectionTable[v_session].state==reset_IC)
4268 {//startif3
4269 log("RLC received in state:reset_IC");
4270 //discard received message
4271 f_StartTimer(internal_reset,v_session,0.0);//the timer times out immediately
4272 //state changed to active
4273 ConnectionTable[v_session].state:=active;
4274 }//endif3
4275 else { log("RLC received in an unexpected state"); }
4276
4277 }//endif2
4278 else {}//remote reference inconsistent, discard
4279
4280 }//endif1
4281 else {}//Release complete received with destLocRef not in ConnectionTable
4282 //discard
4283
4284 }//processing_PDU_SCCP_ReleaseComplete
4285
4286 //******************************************************************
4287 // processing_PDU_SCCP_InactivityTest
4288 //******************************************************************
4289 function processing_PDU_SCCP_InactivityTest( in PDU_SCCP_InactivityTest pl_PDU_SCCP_InactivityTest)
4290 runs on SCCP_CT
4291 {
4292 var PDU_SCCP vl_PDU_SCCP;
4293 var ASP_SCCP_N_DISCONNECT_ind vl_N_DISCONNECT_ind;
4294
4295 //check if connection already established
4296 if (ConnectionAlreadyEstablished(pl_PDU_SCCP_InactivityTest.destLocRef))
4297 {//startif1
4298 v_session :=Retrieve_session(pl_PDU_SCCP_InactivityTest.destLocRef);
4299
4300 //check if remote reference is correct -Table B.2 /Q.714
4301 if (ConnectionTable[v_session].remoteReference==pl_PDU_SCCP_InactivityTest.sourceLocRef)
4302 {//startif2
4303
4304 //Action Table follows
4305 if (ConnectionTable[v_session].state==idle)
4306 { log("IT received in state :idle "); }//C.3 1/6-do nothing-return to idle state
4307 else if (ConnectionTable[v_session].state==connection_pending_IC)
4308 { log("IT received in state : connection_pending_IC"); }//discard message, return
4309 else if (ConnectionTable[v_session].state==connection_pending_OG)
4310 {//startif3
4311
4312 //stop connection timer
4313 f_StopTimer(conn_est,v_session);
4314 //assemble ASP_SCCP_N_
4315 vl_N_DISCONNECT_ind.originator := cg_NSU;
4316 vl_N_DISCONNECT_ind.reason := cg_DISC_normal;
4317 vl_N_DISCONNECT_ind.connectionId := ConnectionTable[v_session].connectionId;
4318
4319 SCCP_SP_PORT.send( t_ASP_N_DISCONNECT_ind(
4320 vl_N_DISCONNECT_ind.originator,
4321 omit,
4322 vl_N_DISCONNECT_ind.reason,
4323 omit,
4324 vl_N_DISCONNECT_ind.connectionId,
4325 omit
4326 ));//send ASP_SCCP_N_DISCONNECT_ind
4327 //release resources
4328 ReleaseResources(v_session);
4329
4330 }//endif3
4331 else if (ConnectionTable[v_session].state==disconnect_pending) {}
4332 else if (ConnectionTable[v_session].state==reset_bothway) {}//
4333 else if (ConnectionTable[v_session].state==active)
4334 {//startif3
4335 //source reference number assumed OK
4336 //or:
4337 //if (ConnectionTable[v_session].remoteReference!=pl_PDU_SCCP_InactivityTest.sourceLocRef)
4338 // release connection
4339 //protocol class assumed 2
4340 //restart receive inactivity timer
4341 f_StopTimer(iar,v_session);//to avoid warnings
4342 f_StartTimer(iar,v_session);
4343 }//endif3
4344 else if (ConnectionTable[v_session].state==reset_IC)
4345 {//startif3
4346 //discard received message
4347 f_StartTimer(internal_reset,v_session,0.0);//the timer times out immediately
4348 //state changed to active
4349 ConnectionTable[v_session].state:=active;
4350 }//endif3
4351 else if (ConnectionTable[v_session].state==wait_conn_confirm)
4352 {//startif3
4353
4354 //stop connection timer
4355 f_StopTimer(conn_est,v_session);
4356 //release resources
4357 ReleaseResources(v_session);
4358
4359 }//endif3
4360 else { log("IT received in an unexpected state"); }
4361 }//endif2
4362 else {//remote reference inconsistent, error action follows
4363 //message received with remote reference not the same as stored
4364 // two RLSD messages are sent back, one to the sored and to the received remote reference
4365 //sent first RLSD-see B.2/Q.714
4366
4367 vl_PDU_SCCP.released.messageType :=rlsd;
4368 vl_PDU_SCCP.released.destLocRef :=pl_PDU_SCCP_InactivityTest.sourceLocRef;
4369 vl_PDU_SCCP.released.sourceLocRef:=pl_PDU_SCCP_InactivityTest.destLocRef;
4370 vl_PDU_SCCP.released.releaseCause:=cg_Rel_inconsConnData;
4371 vl_PDU_SCCP.released.pointer1:=0;
4372 vl_PDU_SCCP.released.optionalPart:=omit;
4373 vl_PDU_SCCP.released.eop:=omit;
4374
4375 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
4376 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP));//send Released
4377
4378 //sent second RLSD-see B.2/Q.714
4379 vl_PDU_SCCP.released.destLocRef :=ConnectionTable[v_session].remoteReference;
4380
4381 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
4382 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP));//send Released
4383
4384 }//endelse
4385
4386 }//endif1
4387 else {}//Inactivity test received with destLocRef not in ConnectionTable
4388 //discard
4389
4390 }//processing_PDU_SCCP_InactivityTest
4391
4392 //******************************************************************
4393 // processing_PDU_SCCP_ResetRequest
4394 //******************************************************************
4395 function processing_PDU_SCCP_ResetRequest ( in PDU_SCCP_ResetRequest pl_PDU_SCCP_ResetRequest)
4396 runs on SCCP_CT
4397 {
4398 var PDU_SCCP vl_PDU_SCCP;
4399
4400 //check if connection already established
4401 if (ConnectionAlreadyEstablished(pl_PDU_SCCP_ResetRequest.destLocRef))
4402 {//startif1
4403 v_session :=Retrieve_session(pl_PDU_SCCP_ResetRequest.destLocRef);
4404 //check if remote reference is correct -Table B.2 /Q.714
4405
4406 if (ConnectionTable[v_session].remoteReference==pl_PDU_SCCP_ResetRequest.sourceLocRef)
4407 {//startif2
4408 //Action Table follows
4409 if (ConnectionTable[v_session].state==idle)
4410 {//startif3
4411
4412 //assemble and route MTP3_ASP
4413 vl_PDU_SCCP.pduerror.messageType:=err;
4414 vl_PDU_SCCP.pduerror.destLocRef:=ConnectionTable[v_session].remoteReference;
4415 vl_PDU_SCCP.pduerror.errorCause:=cg_Err_unassignedDestinationLRN;
4416 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
4417 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP)); //Send Error
4418 //then return to idle
4419
4420 }//endif3
4421 else if (ConnectionTable[v_session].state==connection_pending_IC) {}//discard message, return
4422 else if (ConnectionTable[v_session].state==connection_pending_OG)
4423 {//startif3
4424 //stop connection timer
4425 f_StopTimer(conn_est,v_session);
4426 //assemble ASP_SCCP_N_
4427 var ASP_SCCP_N_DISCONNECT_ind vl_N_DISCONNECT_ind;
4428 vl_N_DISCONNECT_ind.originator:=cg_NSU;
4429 vl_N_DISCONNECT_ind.reason:=cg_DISC_normal;
4430 vl_N_DISCONNECT_ind.connectionId:=ConnectionTable[v_session].connectionId;
4431 SCCP_SP_PORT.send( t_ASP_N_DISCONNECT_ind(
4432 vl_N_DISCONNECT_ind.originator,
4433 omit,
4434 vl_N_DISCONNECT_ind.reason,
4435 omit,
4436 vl_N_DISCONNECT_ind.connectionId,
4437 omit
4438 ));//send ASP_SCCP_N_DISCONNECT_ind
4439 //release resources
4440 ReleaseResources(v_session);
4441 }//endif3
4442 else if (ConnectionTable[v_session].state==disconnect_pending) {}
4443 else if (ConnectionTable[v_session].state==reset_bothway)
4444 {//startif3
4445
4446 //assemble ASP_SCCP_N_
4447 var ASP_SCCP_N_RESET_cfm vl_N_RESET_cfm;
4448 vl_N_RESET_cfm.connectionId:=ConnectionTable[v_session].connectionId;
4449 SCCP_SP_PORT.send( t_ASP_N_RESET_cfm(vl_N_RESET_cfm.connectionId));//send ASP_SCCP_N_RESET_cfm
4450
4451 //stop reset timer
4452 f_StopTimer(reset,v_session);
4453
4454 //restart receive inactivity timer
4455 f_StopTimer(iar,v_session);//to avoid warnings
4456 f_StartTimer(iar,v_session);
4457 //change state
4458 ConnectionTable[v_session].state:=reset_IC;
4459 }//endif3
4460 else if (ConnectionTable[v_session].state==active)
4461 {//startif3
4462 //restart receive inactivity timer
4463 f_StopTimer(iar,v_session);//to avoid warnings
4464 f_StartTimer(iar,v_session);
4465 //send ASP_SCCP_N_RESET_ind
4466 //assemble ASP_SCCP_N_
4467 var ASP_SCCP_N_RESET_ind vl_N_RESET_ind;
4468 vl_N_RESET_ind.originator:=cg_NSU;
4469 vl_N_RESET_ind.reason:=cg_RESET_unspec;
4470 vl_N_RESET_ind.connectionId:=ConnectionTable[v_session].connectionId;
4471
4472 SCCP_SP_PORT.send( t_ASP_N_RESET_ind(
4473 vl_N_RESET_ind.originator,
4474 vl_N_RESET_ind.reason,
4475 vl_N_RESET_ind.connectionId
4476 ));//send ASP_SCCP_N_RESET_ind
4477
4478 //reset variables
4479 ConnectionTable[v_session].state:=reset_IC;
4480 }//endif3
4481 else if (ConnectionTable[v_session].state==wait_conn_confirm)
4482 {//startif3
4483
4484 //stop connection timer
4485 f_StopTimer(conn_est,v_session);
4486 //release resources
4487 ReleaseResources(v_session);
4488 }//endif3
4489 else { log("RESREQ received in an unexpected state"); }
4490 }//endif2
4491 else {//remote reference inconsistent, error action follows
4492
4493 vl_PDU_SCCP.pduerror.messageType:=err;
4494 vl_PDU_SCCP.pduerror.destLocRef:=pl_PDU_SCCP_ResetRequest.sourceLocRef;
4495 vl_PDU_SCCP.pduerror.errorCause:=cg_Err_inconsistentSourceLRN;
4496 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
4497 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP)); //Send Error
4498
4499 }//endelse
4500 }//endif1
4501 else {//startelse-Reset request received with destLocRef not in ConnectionTable
4502
4503 //send ERR
4504 vl_PDU_SCCP.pduerror.messageType:=err;
4505 vl_PDU_SCCP.pduerror.destLocRef:=pl_PDU_SCCP_ResetRequest.sourceLocRef;
4506 vl_PDU_SCCP.pduerror.errorCause:=cg_Err_unassignedDestinationLRN;
4507
4508 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
4509 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP)); //Send Error
4510
4511 }//endelse
4512
4513 }//processing_PDU_SCCP_ResetRequest
4514
4515 //******************************************************************
4516 // processing_PDU_SCCP_ResetConfirm
4517 //******************************************************************
4518 function processing_PDU_SCCP_ResetConfirm ( in PDU_SCCP_ResetConfirm pl_PDU_SCCP_ResetConfirm)
4519 runs on SCCP_CT
4520 {
4521 var PDU_SCCP vl_PDU_SCCP;
4522
4523 //check if connection already established
4524 if (ConnectionAlreadyEstablished(pl_PDU_SCCP_ResetConfirm.destLocRef))
4525 {//startif1
4526 v_session :=Retrieve_session(pl_PDU_SCCP_ResetConfirm.destLocRef);
4527
4528 //check if remote reference is correct -Table B.2 /Q.714
4529 if (ConnectionTable[v_session].remoteReference==pl_PDU_SCCP_ResetConfirm.sourceLocRef)
4530 {//startif2
4531 //Action Table follows
4532
4533 if (ConnectionTable[v_session].state==idle)
4534 { log("RSC received in state:idle ");}//do nothing-return to idle state, no source ref known
4535 else if (ConnectionTable[v_session].state==connection_pending_IC)
4536 { log("RSC received in state:connection_pending_IC ");}//discard message, return
4537 else if (ConnectionTable[v_session].state==connection_pending_OG)
4538 {//startif3
4539
4540 var ASP_SCCP_N_DISCONNECT_ind vl_N_DISCONNECT_ind;
4541 //stop connection timer
4542 f_StopTimer(conn_est,v_session);
4543 //assemble ASP_SCCP_N_ASP
4544
4545 vl_N_DISCONNECT_ind.originator:=cg_NSU;
4546 vl_N_DISCONNECT_ind.reason:=cg_DISC_normal;
4547 vl_N_DISCONNECT_ind.connectionId:=ConnectionTable[v_session].connectionId;
4548 SCCP_SP_PORT.send( t_ASP_N_DISCONNECT_ind(
4549 vl_N_DISCONNECT_ind.originator,
4550 omit,
4551 vl_N_DISCONNECT_ind.reason,
4552 omit,
4553 vl_N_DISCONNECT_ind.connectionId,
4554 omit
4555 ));//send ASP_SCCP_N_DISCONNECT_ind
4556 //release resources
4557 ReleaseResources(v_session);
4558 }//endif3
4559 else if (ConnectionTable[v_session].state==disconnect_pending)
4560 { log("RSC received in state:disconnect_pending");}
4561 else if (ConnectionTable[v_session].state==reset_bothway)
4562 {//startif3
4563 //assemble ASP_SCCP_N_
4564 var ASP_SCCP_N_RESET_cfm vl_N_RESET_cfm;
4565 vl_N_RESET_cfm.connectionId:=ConnectionTable[v_session].connectionId;
4566 SCCP_SP_PORT.send( t_ASP_N_RESET_cfm(
4567 vl_N_RESET_cfm.connectionId
4568 ));//send ASP_SCCP_N_RESET_cfm
4569
4570 //stop reset timer
4571 f_StopTimer(reset,v_session);
4572
4573 //restart receive inactivity timer
4574 f_StopTimer(iar,v_session);//to avoid warnings
4575 f_StartTimer(iar,v_session);
4576 //change state
4577 ConnectionTable[v_session].state:=reset_IC;
4578 }//endif3
4579 else if (ConnectionTable[v_session].state==active)
4580 {//startif3
4581 //do nothing-return to idle state
4582 log("RSC received in state:active");
4583 }//endif3
4584 else if (ConnectionTable[v_session].state==reset_IC)
4585 {//startif3
4586 //discard received message
4587 f_StartTimer(internal_reset,v_session,0.0);//the timer times out immediately
4588 //state changed to active
4589 ConnectionTable[v_session].state:=active;
4590 }//endif3
4591 else if (ConnectionTable[v_session].state==wait_conn_confirm)
4592 {//startif3
4593 //stop connection timer
4594 f_StopTimer(conn_est,v_session);
4595 //release resources
4596 ReleaseResources(v_session);
4597 }//endif3
4598 else { log("ResConf received in an unexpected state"); }
4599 }//endif2
4600 else {//remote reference inconsistent, error action follows
4601
4602 vl_PDU_SCCP.pduerror.messageType:=err;
4603 vl_PDU_SCCP.pduerror.destLocRef :=pl_PDU_SCCP_ResetConfirm.sourceLocRef;
4604 vl_PDU_SCCP.pduerror.errorCause :=cg_Err_inconsistentSourceLRN;
4605
4606 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
4607 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP)); //Send Error
4608
4609 }//endelse
4610 }//endif1
4611 else {//startelse-Reset confirm received with destLocRef not in ConnectionTable
4612
4613 //send ERR
4614 vl_PDU_SCCP.pduerror.messageType:=err;
4615 vl_PDU_SCCP.pduerror.destLocRef :=pl_PDU_SCCP_ResetConfirm.sourceLocRef;
4616 vl_PDU_SCCP.pduerror.errorCause :=cg_Err_unassignedDestinationLRN;
4617
4618 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
4619 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP)); //Send Error
4620 }//endelse
4621 }//processing_PDU_SCCP_ResetConfirm
4622
4623 //******************************************************************
4624 // processing_PDU_SCCP_ConnectionRefused
4625 //******************************************************************
4626 function processing_PDU_SCCP_ConnectionRefused ( in PDU_SCCP_ConnectionRefused pl_PDU_SCCP_ConnectionRefused)
4627 runs on SCCP_CT
4628 {
4629 //Store data parameter
4630 var template SCCP_PAR_UserData tl_data := omit;
4631 if (ispresent(pl_PDU_SCCP_ConnectionRefused.optionalPart))
4632 {
4633 if (ispresent(pl_PDU_SCCP_ConnectionRefused.optionalPart.data))
4634 {
4635 tl_data := pl_PDU_SCCP_ConnectionRefused.optionalPart.data.data;
4636 }
4637 }
4638
4639 //check if connection already established
4640 if (ConnectionAlreadyEstablished(pl_PDU_SCCP_ConnectionRefused.destLocRef))
4641 {//startif2
4642 v_session :=Retrieve_session(pl_PDU_SCCP_ConnectionRefused.destLocRef);
4643 //Action Table follows
4644
4645 if (ConnectionTable[v_session].state==idle)
4646 { log ("CREF received in state:idle");} //do nothing , return to idle, source ref unknown
4647 else if (ConnectionTable[v_session].state==connection_pending_IC)
4648 { log ("CREF received in state:connection_pending_IC");}
4649 else if (ConnectionTable[v_session].state==active)
4650 { log ("CREF received in state:active");}//do nothing, return
4651 else if (ConnectionTable[v_session].state==disconnect_pending)
4652 { log ("CREF received in state:disconnect_pending");}//discard message, return
4653 else if (ConnectionTable[v_session].state==reset_bothway)
4654 { log ("CREF received in state:reset_bothway");}//
4655 else if (ConnectionTable[v_session].state==connection_pending_OG)
4656 {//startif3
4657 var ASP_SCCP_N_DISCONNECT_ind vl_N_DISCONNECT_ind;
4658 //stop connection timer
4659 f_StopTimer(conn_est,v_session);
4660 //assemble ASP_SCCP_N_
4661 vl_N_DISCONNECT_ind.originator:=cg_Mapping_RefCause_Orig[pl_PDU_SCCP_ConnectionRefused.refusalCause];
4662 vl_N_DISCONNECT_ind.reason:=cg_Mapping_RefCause_Reason[pl_PDU_SCCP_ConnectionRefused.refusalCause];
4663 vl_N_DISCONNECT_ind.connectionId:=ConnectionTable[v_session].connectionId;
4664
4665 SCCP_SP_PORT.send( t_ASP_N_DISCONNECT_ind(
4666 vl_N_DISCONNECT_ind.originator,
4667 omit,
4668 vl_N_DISCONNECT_ind.reason,
4669 tl_data,
4670 vl_N_DISCONNECT_ind.connectionId,
4671 omit
4672 ));//send ASP_SCCP_N_DISCONNECT_ind
4673 //release resources
4674 ReleaseResources(v_session);
4675 }//endif3
4676 else if (ConnectionTable[v_session].state==wait_conn_confirm)
4677 {//startif3
4678
4679 //stop connection timer
4680 f_StopTimer(conn_est,v_session);
4681 //release resources
4682 ReleaseResources(v_session);
4683
4684 }//endif3
4685 else if (ConnectionTable[v_session].state==reset_IC)
4686 {//startif3
4687
4688 //discard received message
4689 f_StartTimer(internal_reset,v_session,0.0);//the timer times out immediately
4690 //state changed to active
4691 ConnectionTable[v_session].state:=active;
4692
4693 }//endif3
4694 else { log("CREF received in an unexpected state"); }
4695
4696 }//endif2
4697 else { log("CREF received with destLocRef not in state table"); }
4698 //Connection refused with destLocRef not in ConnectionTable
4699 //discard
4700
4701 } //processing_PDU_SCCP_ConnectionRefused
4702
4703 //******************************************************************
4704 // processing_PDU_SCCP_DataForm1
4705 //******************************************************************
4706 function processing_PDU_SCCP_DataForm1 ( in PDU_SCCP_DataForm1 pl_PDU_SCCP_DataForm1)
4707 runs on SCCP_CT
4708 {
4709
4710 //check if connection already established
4711 if (ConnectionAlreadyEstablished(pl_PDU_SCCP_DataForm1.destLocRef))
4712 {//startif2
4713 v_session :=Retrieve_session(pl_PDU_SCCP_DataForm1.destLocRef);
4714 //Action Table follows
4715
4716 if (ConnectionTable[v_session].state==idle)
4717 {//startif3
4718 var PDU_SCCP vl_PDU_SCCP;
4719 //assemble and route MTP3_ASP
4720 vl_PDU_SCCP.pduerror.messageType:=err;
4721 vl_PDU_SCCP.pduerror.destLocRef:=ConnectionTable[v_session].remoteReference;
4722 vl_PDU_SCCP.pduerror.errorCause:=cg_Err_unassignedDestinationLRN;
4723
4724 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
4725 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP)); //Send Error
4726
4727 //then return to idle
4728 }//endif3
4729 else if (ConnectionTable[v_session].state==connection_pending_IC)
4730 { log ("DT1 received in state:connection_pending_IC");}//discard message, return
4731 else if (ConnectionTable[v_session].state==disconnect_pending)
4732 { log ("DT1 received in state:disconnect_pending");}//discard message, return
4733 else if (ConnectionTable[v_session].state==reset_bothway)
4734 { log ("DT1 received in state:reset_bothway");}//
4735 else if (ConnectionTable[v_session].state==connection_pending_OG)
4736 {//startif3
4737 var ASP_SCCP_N_DISCONNECT_ind vl_N_DISCONNECT_ind;
4738 f_StopTimer(conn_est,v_session);
4739 //assemble ASP_SCCP_N_
4740 vl_N_DISCONNECT_ind.originator:=cg_NSU;
4741 vl_N_DISCONNECT_ind.reason:=cg_DISC_normal;
4742 vl_N_DISCONNECT_ind.connectionId:=ConnectionTable[v_session].connectionId;
4743
4744 SCCP_SP_PORT.send( t_ASP_N_DISCONNECT_ind(
4745 vl_N_DISCONNECT_ind.originator,
4746 omit,
4747 vl_N_DISCONNECT_ind.reason,
4748 omit,
4749 vl_N_DISCONNECT_ind.connectionId,
4750 omit
4751 ));//send ASP_SCCP_N_DISCONNECT_ind
4752 //release resources
4753 ReleaseResources(v_session);
4754 }//endif3
4755 else if (ConnectionTable[v_session].state==wait_conn_confirm)
4756 {//startif3
4757
4758 //stop connection timer
4759 f_StopTimer(conn_est,v_session);
4760 //release resources
4761 ReleaseResources(v_session);
4762 }//endif3
4763 else if (ConnectionTable[v_session].state==active)
4764 {//startif3
4765
4766 var ASP_SCCP_N_DATA_ind vl_N_DATA_ind;
4767 //restart receive inactivity timer
4768 f_StopTimer(iar,v_session);//to avoid warnings
4769 f_StartTimer(iar,v_session);
4770
4771 buffered_sending_ASP_N_DATA_ind( pl_PDU_SCCP_DataForm1 )
4772 //MODIFY-> protocol class assumed 2; M bit assumed 0 (no segm/reassembly)
4773
4774 }//endif3
4775 else if (ConnectionTable[v_session].state==reset_IC)
4776 {//startif3
4777
4778 //discard received message
4779 f_StartTimer(internal_reset,v_session,0.0);//the timer times out immediately
4780 //state changed to active
4781 ConnectionTable[v_session].state:=active;
4782
4783 }//endif3
4784 else { log("DT1 received in an unexpected state"); }
4785
4786 }//endif2
4787 else { log("DT1 received with destLocRef not in ConnectionTable"); }
4788 //DT1 received with destLocRef not in ConnectionTable
4789 //discard
4790
4791 }//processing_PDU_SCCP_DataForm1
4792
4793
4794 //******************************************************************
4795 // processing_PDU_SCCP_ExtUnitdata
4796 //******************************************************************
4797 function processing_PDU_SCCP_ExtUnitdata ( in PDU_SCCP_ExtUnitdata pl_PDU_SCCP_ExtUnitdata)
4798 runs on SCCP_CT
4799 {
4800 var integer vl_index;
4801 var OCT3 vl_segmRemoteRef;
4802 if( ispresent( pl_PDU_SCCP_ExtUnitdata.optionalPart) and
4803 ispresent( pl_PDU_SCCP_ExtUnitdata.optionalPart.segmentation) )
4804 {
4805 vl_segmRemoteRef:= pl_PDU_SCCP_ExtUnitdata.optionalPart.segmentation.segmLocalRef;
4806 if( pl_PDU_SCCP_ExtUnitdata.optionalPart.segmentation.firstSegm =='1'B )
4807 {
4808 vl_index:=allocate_ClessRcvBuff( vl_segmRemoteRef);
4809 }
4810 else
4811 {
4812 vl_index:=get_ClessRcvBuffIndex( vl_segmRemoteRef );
4813 };
4814 if (vl_index == -1)
4815 {
4816 log("Buffer allocation failed, message ignored.");
4817 return;
4818 }
4819
4820 store_segmData(vl_index,pl_PDU_SCCP_ExtUnitdata);
4821 if( pl_PDU_SCCP_ExtUnitdata.optionalPart.segmentation.remainingSegment == '0000'B )
4822 {
4823 send_ClessRcvBuff_in_N_UNITDATAind( vl_index,pl_PDU_SCCP_ExtUnitdata );
4824 reallocate_ClessRcvBuff( vl_index );
4825 }
4826 }
4827 else
4828 { // not segmented case:
4829 send_ClessData_in_N_UNITDATAind( pl_PDU_SCCP_ExtUnitdata );
4830 }
4831 return;
4832
4833 }//processing_PDU_SCCP_ExtUnitdata
4834
4835//******************************************************************
4836// Part 2 Receiving msg on port "SCCP_PORT" (User Part)
4837//******************************************************************
4838
4839//******************************************************************
4840// processing_ASP_N_CONNECT_req
4841// / ASP_SCCP_N_CONNECT_req , originating node /
4842//******************************************************************
4843 function processing_ASP_N_CONNECT_req( in ASP_SCCP_N_CONNECT_req pl_N_CONNECT_req )
4844 runs on SCCP_CT
4845 {
4846 var PDU_SCCP vl_PDU_SCCP;
4847 var ASP_SCCP_N_DISCONNECT_ind vl_N_DISCONNECT_ind;
4848
4849 if (ConnectionAlreadyEstablished_connectionId(pl_N_CONNECT_req.connectionId))
4850 // assume connectionId present
4851 {//startif1
4852
4853 //something went wrong, we already have a session with the same connection Id
4854 v_session :=Retrieve_session_connectionId(pl_N_CONNECT_req.connectionId);
4855 //table of error actions
4856
4857 }//endif1
4858 else
4859 {//startelse1
4860
4861 //check if resources available
4862 v_session:=CheckIdleIndividuals();
4863 if (v_session==-1) //No idle individual found
4864 {//startif2
4865
4866 //assemble ASP_SCCP_N_ASP
4867 vl_N_DISCONNECT_ind.originator:=cg_NSP; // network service provider
4868 vl_N_DISCONNECT_ind.reason:=cg_CREF_unspec_T;
4869 vl_N_DISCONNECT_ind.connectionId:=pl_N_CONNECT_req.connectionId;
4870
4871 SCCP_SP_PORT.send( t_ASP_N_DISCONNECT_ind(
4872 vl_N_DISCONNECT_ind.originator,
4873 omit,
4874 vl_N_DISCONNECT_ind.reason,
4875 omit,
4876 vl_N_DISCONNECT_ind.connectionId,
4877 omit
4878 ));//send ASP_SCCP_N_DISCONNECT_ind
4879 //return to idle
4880 }//endif2
4881
4882 if ((v_session<=15)and (v_session>=0))
4883 {//startif2
4884
4885 //assign local reference, SLS:=tsp_MTP3_SLS, protocol class:=2
4886 ConnectionTable[v_session].localReference:=int2oct(pl_N_CONNECT_req.connectionId,3);
4887 ConnectionTable[v_session].connectionId :=pl_N_CONNECT_req.connectionId;
4888
4889 //to simplify generation of local reference, connectionID received from user is sent as such
4890 //only local reference is assigned at this point
4891 //send connection request, no coupling
4892 //DPC :remote node
4893 //no coupling reqrd.
4894 //compatibility OK
4895 //no restriction
4896 //assemble and route MTP3_ASP
4897 vl_PDU_SCCP.connrequest.messageType:=cr;
4898 vl_PDU_SCCP.connrequest.sourceLocRef:=ConnectionTable[v_session].localReference;
4899 // send local reference just assigned!
4900 vl_PDU_SCCP.connrequest.protClass:={
4901 class:='0010'B,
4902 messageHandling:='0000'B
4903 };//class 2
4904 vl_PDU_SCCP.connrequest.pointer1:=2;
4905 vl_PDU_SCCP.connrequest.calledPAddress:=ConvertASPAddressToEncodedAddress(pl_N_CONNECT_req.calledAddress); //new!
4906 vl_PDU_SCCP.connrequest.pointer2:=vl_PDU_SCCP.connrequest.calledPAddress.paramLength+2; //automatic?
4907
4908 if(ispresent(pl_N_CONNECT_req.callingAddress))
4909 {//startif3
4910
4911 //temporary variable to avoid type conversion problems
4912 var SCCP_param_CPartyAddressEnc_opt vl_SCCP_param_CPartyAddressEnc_opt;
4913 var SCCP_param_CPartyAddressEnc vl_SCCP_param_CPartyAddressEnc;
4914
4915 vl_SCCP_param_CPartyAddressEnc:=
4916 ConvertASPAddressToEncodedAddress(pl_N_CONNECT_req.callingAddress);
4917
4918 vl_SCCP_param_CPartyAddressEnc_opt.paramName :=con_SCCP_cgPA;
4919 vl_SCCP_param_CPartyAddressEnc_opt.paramLength:=vl_SCCP_param_CPartyAddressEnc.paramLength;
4920 vl_SCCP_param_CPartyAddressEnc_opt.addr :=vl_SCCP_param_CPartyAddressEnc.addr;
4921
4922 vl_PDU_SCCP.connrequest.optionalPart.callingPAddress:=vl_SCCP_param_CPartyAddressEnc_opt;
4923
4924 }//endif3
4925 else { vl_PDU_SCCP.connrequest.optionalPart.callingPAddress:=omit }
4926
4927 if(ispresent(pl_N_CONNECT_req.userData))
4928 {//startif3
4929
4930 //temporary variable to avoid type conversion problems
4931 var SCCP_param_Data_opt vl_SCCP_param_Data_opt;
4932
4933 vl_SCCP_param_Data_opt.paramName:=con_SCCP_data;
4934 vl_SCCP_param_Data_opt.data:=pl_N_CONNECT_req.userData;
4935 vl_SCCP_param_Data_opt.paramLength:=lengthof(vl_SCCP_param_Data_opt.data);
4936 vl_PDU_SCCP.connrequest.optionalPart.data:=vl_SCCP_param_Data_opt;
4937
4938 }//endif3
4939 else { vl_PDU_SCCP.connrequest.optionalPart.data:=omit}
4940
4941 if(ispresent(pl_N_CONNECT_req.callingAddress) or
4942 ispresent(pl_N_CONNECT_req.userData))
4943 {
4944 vl_PDU_SCCP.connrequest.optionalPart.credit:=omit;
4945 vl_PDU_SCCP.connrequest.optionalPart.hopCounter:=omit;
4946 vl_PDU_SCCP.connrequest.optionalPart.importance:=omit;
4947
4948 vl_PDU_SCCP.connrequest.eop:= {paramName:=con_SCCP_eop};
4949 }
4950 else
4951 {
4952 vl_PDU_SCCP.connrequest.optionalPart := omit;
4953 vl_PDU_SCCP.connrequest.eop := omit;
4954 }
4955
4956 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
4957 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP));//send Connection request
4958
4959 //start connection timer
4960 f_StartTimer(conn_est,v_session);
4961 ConnectionTable[v_session].state:=connection_pending_OG;
4962 }//endif2
4963
4964 }//endelse
4965
4966 }//processing_ASP_N_CONNECT_req
4967 //******************************************************************
4968 //End ASP_SCCP_N_CONNECT_req , originating node
4969 //******************************************************************
4970
4971 //******************************************************************
4972 // processing_ASP_N_CONNECT_resp
4973 //******************************************************************
4974 function processing_ASP_N_CONNECT_res( in ASP_SCCP_N_CONNECT_res pl_N_CONNECT_res )
4975 runs on SCCP_CT
4976 {
4977 var PDU_SCCP vl_PDU_SCCP;
4978
4979 // first see if session exists in the ConnectionTable
4980 //search done based on Connection ID
4981
4982 if (ConnectionAlreadyEstablished_connectionId(pl_N_CONNECT_res.connectionId))
4983 //assume connectionId present
4984 {//startif1
4985 //retrieve session
4986 v_session :=Retrieve_session_connectionId(pl_N_CONNECT_res.connectionId);
4987
4988 //Action Table follows
4989
4990 if (ConnectionTable[v_session].state==idle)
4991 {
4992 log("N_CONNECT_resp received in state:idle");
4993 //do nothing-return to idle state
4994 }
4995 else if (ConnectionTable[v_session].state==connection_pending_IC)
4996 {//startif2
4997
4998 //assign SLS:=tsp_MTP3_SLS, assign protocol class=2 (CO, no flow ctrl.)
4999
5000 //assemble and route MTP3_ASP
5001
5002 vl_PDU_SCCP.connconfirm.messageType:=cc;
5003 vl_PDU_SCCP.connconfirm.sourceLocRef:=ConnectionTable[v_session].localReference;
5004 vl_PDU_SCCP.connconfirm.destLocRef:=ConnectionTable[v_session].remoteReference;
5005 vl_PDU_SCCP.connconfirm.protClass.class:='0010'B;//protocol class 2
5006 vl_PDU_SCCP.connconfirm.protClass.messageHandling:='0000'B;//no special treatment
5007
5008 if(ispresent(pl_N_CONNECT_res.respondingAddress))
5009 {//startif3
5010
5011 //temporary variable to avoid type conversion problems
5012 var SCCP_param_CPartyAddressEnc_opt vl_SCCP_param_CPartyAddressEnc_opt;
5013 var SCCP_param_CPartyAddressEnc vl_SCCP_param_CPartyAddressEnc;
5014
5015 vl_SCCP_param_CPartyAddressEnc:=
5016 ConvertASPAddressToEncodedAddress(pl_N_CONNECT_res.respondingAddress);
5017
5018 vl_SCCP_param_CPartyAddressEnc_opt.paramName := con_SCCP_cdPA; // cgPA->cdPA ethbaat, 2003.11.06
5019 vl_SCCP_param_CPartyAddressEnc_opt.paramLength:= vl_SCCP_param_CPartyAddressEnc.paramLength;
5020 vl_SCCP_param_CPartyAddressEnc_opt.addr := vl_SCCP_param_CPartyAddressEnc.addr;
5021
5022 vl_PDU_SCCP.connconfirm.optionalPart.calledPAddress:= vl_SCCP_param_CPartyAddressEnc_opt;
5023 }//endif3
5024 else { vl_PDU_SCCP.connconfirm.optionalPart.calledPAddress:=omit }
5025
5026 if(ispresent(pl_N_CONNECT_res.userData))
5027 {//startif3
5028
5029 //temporary variable to avoid type conversion problems
5030 var SCCP_param_Data_opt vl_SCCP_param_Data_opt;
5031
5032 vl_SCCP_param_Data_opt.paramName:=con_SCCP_data;
5033 vl_SCCP_param_Data_opt.data:=pl_N_CONNECT_res.userData; // corrected by ethbaat 2003.10.16
5034 vl_SCCP_param_Data_opt.paramLength:=lengthof(vl_SCCP_param_Data_opt.data);
5035
5036 vl_PDU_SCCP.connconfirm.optionalPart.data:=vl_SCCP_param_Data_opt;
5037 }//endif3
5038 else {vl_PDU_SCCP.connconfirm.optionalPart.data:=omit}
5039
5040 if(ispresent(pl_N_CONNECT_res.respondingAddress) or
5041 ispresent(pl_N_CONNECT_res.userData))
5042 {
5043 vl_PDU_SCCP.connconfirm.pointer1:=1;
5044 vl_PDU_SCCP.connconfirm.optionalPart.credit:=omit;
5045 vl_PDU_SCCP.connconfirm.optionalPart.importance:=omit;
5046 vl_PDU_SCCP.connconfirm.eop:= {paramName:=con_SCCP_eop};
5047 }
5048 else
5049 {
5050 vl_PDU_SCCP.connconfirm.pointer1:=0;
5051 vl_PDU_SCCP.connconfirm.optionalPart := omit;
5052 vl_PDU_SCCP.connconfirm.eop:=omit;
5053 }
5054
5055 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
5056 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP));//send connection confirm
5057
5058 f_StartTimer(ias,v_session); // ??? check them!!!
5059 f_StartTimer(iar,v_session); //start inactivity timers
5060 ConnectionTable[v_session].state:=active;//state change
5061
5062 }//endif2
5063 else { log("N_CONNECT_resp received in an unexpected state");}
5064
5065 }//endif1
5066
5067 }//processing_ASP_N_CONNECT_resp
5068
5069 //******************************************************************
5070 // processing_ASP_N_DATA_req
5071 //******************************************************************
5072
5073 function processing_ASP_N_DATA_req( in ASP_SCCP_N_DATA_req pl_N_DATA_req )
5074 runs on SCCP_CT
5075 {
5076 var PDU_SCCP vl_PDU_SCCP;
5077
5078 // first see if session exists in the ConnectionTable
5079
5080 if (ConnectionAlreadyEstablished_connectionId(pl_N_DATA_req.connectionId))
5081 //assume connectionId present
5082 {//startif1
5083
5084 //retrieve v_session
5085 v_session :=Retrieve_session_connectionId(pl_N_DATA_req.connectionId);
5086
5087 //Action Table follows
5088 if (ConnectionTable[v_session].state==idle)
5089 { log ("N_DATA_req received in idle state");}
5090 else if (ConnectionTable[v_session].state==reset_bothway)
5091 { log ("N_DATA_req received in reset_bothway state");}
5092 else if (ConnectionTable[v_session].state==active)
5093 {//startif2
5094 sending_dataform1s_in_ASP_MTP_TRANSFERreqs(pl_N_DATA_req);
5095 //no change of state, remains active
5096 }//endif2
5097 else { log ("N_DATA_req received in an unexpected state"); }
5098
5099 }//endif1
5100 else { log("N_DATA_req with Connection ID not in the state table -- illegal request"); }
5101
5102 }//processing_ASP_N_DATA_req
5103
5104 //******************************************************************
5105 // processing_ASP_N_DISCONNECT_req
5106 //******************************************************************
5107
5108 function processing_ASP_N_DISCONNECT_req( in ASP_SCCP_N_DISCONNECT_req pl_N_DISCONNECT_req )
5109 runs on SCCP_CT
5110 {
5111 var PDU_SCCP vl_PDU_SCCP;
5112 var boolean vl_opt_part_present:=false;
5113
5114 // first see if session exists in the ConnectionTable
5115
5116 if (ConnectionAlreadyEstablished_connectionId(pl_N_DISCONNECT_req.connectionId))
5117 //assume connectionId present
5118 {//startif1
5119
5120 //retrieve v_session
5121 v_session :=Retrieve_session_connectionId(pl_N_DISCONNECT_req.connectionId);
5122
5123 //Action Table follows
5124 if (ConnectionTable[v_session].state==idle)
5125 { log ("N_DISCONNECT_req received in state:idle");}
5126 else if (ConnectionTable[v_session].state==connection_pending_IC)
5127 {//startif2
5128
5129 //assemble and route MTP3_ASP
5130 vl_PDU_SCCP.connrefused.messageType:=cref;
5131 vl_PDU_SCCP.connrefused.destLocRef:=ConnectionTable[v_session].remoteReference;
5132 vl_PDU_SCCP.connrefused.refusalCause:=pl_N_DISCONNECT_req.reason;
5133 vl_PDU_SCCP.connrefused.pointer1:=0; //No optional part
5134 vl_PDU_SCCP.connrefused.optionalPart:=omit;
5135 vl_PDU_SCCP.connrefused.eop:=omit;
5136
5137 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
5138 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP));//send connection refused
5139
5140 //release resources
5141 ReleaseResources(v_session);
5142
5143 }//endif2
5144 else if (ConnectionTable[v_session].state==active)
5145 {//startif2
5146
5147 //stop inactivity timers
5148 f_StopTimer(ias,v_session);
5149 f_StopTimer(iar,v_session);
5150
5151 //assemble and route MTP3_ASP
5152
5153 vl_PDU_SCCP.released.messageType:=rlsd;
5154 vl_PDU_SCCP.released.destLocRef:=ConnectionTable[v_session].remoteReference;
5155 vl_PDU_SCCP.released.sourceLocRef:=ConnectionTable[v_session].localReference;
5156 vl_PDU_SCCP.released.releaseCause:=pl_N_DISCONNECT_req.reason;
5157 if(ispresent(pl_N_DISCONNECT_req.userData)){
5158 vl_opt_part_present:=true;
5159 vl_PDU_SCCP.released.optionalPart.data.paramName:=con_SCCP_data;
5160 vl_PDU_SCCP.released.optionalPart.data.paramLength:=lengthof(pl_N_DISCONNECT_req.userData);
5161 vl_PDU_SCCP.released.optionalPart.data.data:=pl_N_DISCONNECT_req.userData;
5162 } else {
5163 vl_PDU_SCCP.released.optionalPart.data:=omit;
5164 }
5165 if(ispresent(pl_N_DISCONNECT_req.importance)){
5166 vl_opt_part_present:=true;
5167 vl_PDU_SCCP.released.optionalPart.importance.paramName:=con_SCCP_imp
5168 vl_PDU_SCCP.released.optionalPart.importance.paramLength:=1
5169 vl_PDU_SCCP.released.optionalPart.importance.importance:=pl_N_DISCONNECT_req.importance
5170 vl_PDU_SCCP.released.optionalPart.importance.reserved:='00000'B
5171 } else {
5172 vl_PDU_SCCP.released.optionalPart.importance:=omit;
5173 }
5174 if(vl_opt_part_present){
5175 vl_PDU_SCCP.released.pointer1:=1;
5176 vl_PDU_SCCP.released.eop.paramName:=con_SCCP_eop;
5177 } else {
5178 vl_PDU_SCCP.released.pointer1:=0;//No optional part
5179 vl_PDU_SCCP.released.optionalPart:=omit;
5180 vl_PDU_SCCP.released.eop:=omit;
5181 }
5182
5183 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
5184 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP));//send released
5185
5186 //start release timer
5187 f_StartTimer(rel,v_session);
5188
5189 ConnectionTable[v_session].state:=disconnect_pending;
5190
5191 }//endif2
5192 else if (ConnectionTable[v_session].state==connection_pending_OG)
5193 {//startif2
5194
5195 //change state to "wait connection confirm "
5196 ConnectionTable[v_session].state:=wait_conn_confirm;
5197 //and return
5198
5199 }//endif2
5200 else { log("N_DISCONNECT_req received in an unexpected state");}
5201
5202 }//endif1
5203
5204 }//processing_ASP_N_DISCONNECT_req
5205
5206
5207 //******************************************************************
5208 // function SCCP_SPC_int2bit - working function to processing_ASP_N_UNITDATA_req
5209 // v_sio is local to SCCP_CT
5210 // SCCPServiceType
5211 //******************************************************************
5212 function SCCP_SPC_int2bit( in integer pl_SPC, in SCCP_ServiceType pl_SCCP_ServiceType, in octetstring pl_SIO )
5213 return SCCP_ASPfield_SignallingPointCode
5214 {
5215 var SCCP_ASPfield_SignallingPointCode vl_SPC; //bitstring
5216 vl_SPC :='0000000000000000'B;
5217
5218 if( (pl_SCCP_ServiceType == mtp3_itu) or (pl_SCCP_ServiceType == mtp3b_itu))
5219 {
5220 //vl_SPC := '00'B&int2bit( pl_SPC, 14);
5221 vl_SPC := int2bit( pl_SPC, 14);
5222 }
5223 else if ( (pl_SCCP_ServiceType == mtp3_ansi) or (pl_SCCP_ServiceType == mtp3b_ansi) )
5224 {
5225 vl_SPC := int2bit( pl_SPC, 24);
5226 }
5227 else if( (pl_SCCP_ServiceType == mtp3_ttc) or (pl_SCCP_ServiceType == mtp3b_ttc) )
5228 {
5229 if( (pl_SIO == '83'O) or (pl_SIO == '43'O) or (pl_SIO == 'C3'O) ) //ttc national
5230 {
5231 vl_SPC := int2bit( pl_SPC, 16);
5232 }
5233 else if( pl_SIO == '03'O ) //ttc international
5234 {
5235 //vl_SPC := '00'B&int2bit( pl_SPC, 14);
5236 vl_SPC := int2bit( pl_SPC, 14);
5237 }
5238 else { log ( "SIO setting error"); }
5239 }
5240 else if( pl_SCCP_ServiceType == mtp3_mpt )
5241 {
5242 var integer vl_NI := oct2int(pl_SIO)/64;
5243 if( vl_NI == 2 ) //mpt national
5244 {
5245 vl_SPC := int2bit( pl_SPC, 24);
5246 }
5247 else //mpt international
5248 {
5249 vl_SPC := int2bit( pl_SPC, 14);
5250 }
5251 }
5252 else
5253 { log ( "ServiceType setting error. Use values",
5254 "mtp3_itu, mtp3b_itu, mtp3_ansi, mtp3b_ansi,",
5255 " mtp3_ttc, mtp3b_ttc, mtp3_mpt or m3ua");
5256 }
5257
5258 return vl_SPC;
5259
5260 }// SCCP_SPC_int2bit
5261
5262 //******************************************************************
5263 // sending_udt_in_ASP_MTP_TRANSFERreqs
5264 // sends data in one step
5265 //******************************************************************
5266 function sending_udt_in_ASP_MTP_TRANSFERreqs( in SCCP_param_ProtocolClass pl_protClass,
5267 in SCCP_param_CPartyAddressEnc pl_CalledPAddress,
5268 in SCCP_param_CPartyAddressEnc pl_CallingPAddress,
5269 in SCCP_param_Data pl_data)
5270 runs on SCCP_CT
5271 {
5272 var PDU_SCCP vl_PDU_SCCP;
5273 vl_PDU_SCCP.unitdata.messageType := udt ;
5274 vl_PDU_SCCP.unitdata.protClass := pl_protClass;
5275 vl_PDU_SCCP.unitdata.calledPAddress := pl_CalledPAddress;
5276 vl_PDU_SCCP.unitdata.callingPAddress:= pl_CallingPAddress;
5277 vl_PDU_SCCP.unitdata.data := pl_data;
5278 vl_PDU_SCCP.unitdata.pointer1 := 0;
5279 vl_PDU_SCCP.unitdata.pointer2 := 0;
5280 vl_PDU_SCCP.unitdata.pointer3 := 0;
5281
5282 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
5283 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP));//send Unitdata
5284 return;
5285
5286 }//sending_udt_in_ASP_MTP_TRANSFERreqs
5287
5288 //******************************************************************
5289 // sending_xudt_in_ASP_MTP_TRANSFERreqs
5290 // segmentates and sends data to the encoder
5291 //******************************************************************
5292 function sending_xudt_in_ASP_MTP_TRANSFERreqs(in SCCP_param_ProtocolClass pl_protClass,
5293 in SCCP_param_CPartyAddressEnc pl_CalledPAddress,
5294 in SCCP_param_CPartyAddressEnc pl_CallingPAddress,
5295 in SCCP_param_Data pl_data)
5296 runs on SCCP_CT
5297 {
5298 var PDU_SCCP vl_PDU_SCCP;
5299 var integer vl_actdatalen; //without length of paramLength field
5300 var integer vl_len; // remaining data length without length of paramLength field
5301 var integer vl_from;
5302 var integer vl_overhead;
5303 var integer vl_maxdatalen;
5304 var integer vl_numberofPDUs; // ... to be sent
5305
5306 vl_PDU_SCCP.extudata.messageType := xudt ; //len:1
5307 vl_PDU_SCCP.extudata.hopCounter := 15; // check it in spec. //len:1
5308 vl_PDU_SCCP.extudata.protClass := pl_protClass; //len:1
5309 vl_PDU_SCCP.extudata.pointer1 := 0; //len:4
5310 vl_PDU_SCCP.extudata.pointer2 := 0;
5311 vl_PDU_SCCP.extudata.pointer3 := 0;
5312 vl_PDU_SCCP.extudata.pointer4 := 0;
5313 vl_PDU_SCCP.extudata.calledPAddress := pl_CalledPAddress;
5314 vl_PDU_SCCP.extudata.callingPAddress := pl_CallingPAddress;
5315
5316 vl_overhead := 15 +
5317 (vl_PDU_SCCP.extudata.calledPAddress.paramLength+1) +
5318 (vl_PDU_SCCP.extudata.callingPAddress.paramLength+1);
5319
5320 vl_len := pl_data.paramLength;
5321 vl_maxdatalen := v_sccp_pdu_maxlen - vl_overhead -1; // -1:paramLength
5322 vl_numberofPDUs := vl_len/vl_maxdatalen; // 0 if 1 PDU exists
5323
5324 // init segmentation:
5325 vl_PDU_SCCP.extudata.optionalPart.segmentation.segmLocalRef:= create_segmLocalRef();
5326 vl_PDU_SCCP.extudata.optionalPart.segmentation.firstSegm := '1'B; //'yes'
5327 vl_PDU_SCCP.extudata.optionalPart.segmentation.paramName := con_SCCP_segm;
5328 vl_PDU_SCCP.extudata.optionalPart.segmentation.paramLength := 4;
5329 vl_PDU_SCCP.extudata.optionalPart.segmentation.remainingSegment := int2bit(vl_numberofPDUs,4);
5330 vl_PDU_SCCP.extudata.optionalPart.segmentation.reserved := '00'B;
5331
5332 if( pl_protClass.class == '0001'B )
5333 { vl_PDU_SCCP.extudata.optionalPart.segmentation.class := '1'B; }
5334 else
5335 { vl_PDU_SCCP.extudata.optionalPart.segmentation.class := '0'B; };
5336
5337 vl_PDU_SCCP.extudata.optionalPart.importance:= omit; //len:0
5338 vl_PDU_SCCP.extudata.eop.paramName := con_SCCP_eop; //len:0
5339
5340 vl_from := 0;
5341
5342 while ( vl_len > 0 )
5343 {
5344 vl_PDU_SCCP.extudata.optionalPart.segmentation.remainingSegment := int2bit(vl_numberofPDUs,4);
5345
5346 if ( vl_len > vl_maxdatalen )
5347 { vl_actdatalen := vl_maxdatalen; }
5348 else
5349 { vl_actdatalen := vl_len; };
5350
5351 vl_PDU_SCCP.extudata.data.data := substr( pl_data.data, vl_from, vl_actdatalen );
5352 vl_PDU_SCCP.extudata.data.paramLength := vl_actdatalen;
5353
5354 MTP3_SCCP_PORT.send( t_ASP_MTP3_TRANSFERreq_sccp
5355 (v_SIO,v_own_SPC,v_remote_SPC,v_SLS,vl_PDU_SCCP)); //send PDU_SCCP_ExtUnitdata
5356
5357 vl_PDU_SCCP.extudata.optionalPart.segmentation.firstSegm := '0'B; //'no'
5358
5359 vl_numberofPDUs := vl_numberofPDUs -1 ;
5360 vl_from := vl_from + vl_actdatalen;
5361 vl_len := vl_len - vl_actdatalen;
5362 }//while
5363
5364 log("Last remaining Segment:", vl_PDU_SCCP.extudata.optionalPart.segmentation.remainingSegment );
5365
5366 // not necessary, remove it:
5367 //reset_segmLocalRef(vl_PDU_SCCP.extudata.optionalPart.segmentation.segmLocalRef);
5368 return;
5369 }//sending_xudt_in_ASP_MTP_TRANSFERreqs
5370
5371 //******************************************************************
5372 // processing_ASP_N_UNITDATA_req
5373 //******************************************************************
5374
5375 function processing_ASP_N_UNITDATA_req( in ASP_SCCP_N_UNITDATA_req pl_N_UNITDATA_req )
5376 runs on SCCP_CT
5377 {
5378 var PDU_SCCP vl_PDU_SCCP;
5379 var SCCP_param_ProtocolClass vl_protClass;
5380 var SCCP_param_CPartyAddressEnc vl_CalledPAddress, vl_CallingPAddress;
5381 var integer vl_overhead_length;
5382 var SCCP_param_Data vl_data;
5383
5384 // Protocol class mapping :
5385 // old: vl_protClass.messageHandling:='0000'B;//no special options
5386
5387 // 3.6/ Q.713: bit1-4
5388 if ( ispresent(pl_N_UNITDATA_req.sequenceControl) and
5389 (substr(pl_N_UNITDATA_req.sequenceControl,7,1) == '1'B) ) //least significant bit!
5390 { vl_protClass.class:='0001'B; }
5391 else
5392 { vl_protClass.class:='0000'B; } //changed to 0000 from 0001 ethbaat 2003-11-13
5393
5394 // 3.6/ Q.713: bit 5-8:
5395 if ( ispresent(pl_N_UNITDATA_req.returnOption) and
5396 (substr(pl_N_UNITDATA_req.returnOption,7,1) == '1'B) ) //least significant bit!
5397 { vl_protClass.messageHandling:='1000'B}
5398 else
5399 { vl_protClass.messageHandling:='0000'B}
5400
5401 //Called Address mapping:
5402 if (pl_N_UNITDATA_req.calledAddress.addressIndicator.pointCodeIndic=='1'B) //DPC included
5403 {//startif1
5404
5405 if (bit2int(pl_N_UNITDATA_req.calledAddress.signPointCode) == v_remote_SPC ) // remote SPC
5406 {//startif2
5407 vl_CalledPAddress:=
5408 ConvertASPAddressToEncodedAddress(pl_N_UNITDATA_req.calledAddress);
5409 }
5410 else
5411 {
5412 log("The remote SPC in ASP_SCCP_N_UNITDATA_req is not the same as the one you called by StartSCCP.ASP dropped")
5413 return;
5414 }
5415
5416 }//endif1
5417 else
5418 { //DPC not present, use values local for component
5419
5420 var SCCP_PAR_Address vl_SCCP_PAR_Address;
5421 vl_SCCP_PAR_Address := pl_N_UNITDATA_req.calledAddress;
5422
5423 if ( v_remote_SPC > 0)
5424 {
5425 vl_SCCP_PAR_Address.addressIndicator.pointCodeIndic :='1'B; // 3.4.1/Q713.
5426 vl_SCCP_PAR_Address.addressIndicator.routingIndicator := cg_route_on_SSN;
5427 // 14,24 or 16 bits:
5428 vl_SCCP_PAR_Address.signPointCode := SCCP_SPC_int2bit( v_remote_SPC, v_SCCPServiceType, v_SIO);
5429 }
5430 // vl_SCCP_PAR_Address.addressIndicator.ssnIndicator unchanged
5431 // vl_SCCP_PAR_Address.addressIndicator.globalTitleIndic unchanged
5432 // vl_SCCP_PAR_Address.subsystemNumber unchanged
5433 // vl_SCCP_PAR_Address.globalTitle unchanged
5434
5435 vl_CalledPAddress :=
5436 ConvertASPAddressToEncodedAddress(vl_SCCP_PAR_Address);
5437
5438 }//endif1
5439
5440 vl_CallingPAddress :=
5441 ConvertASPAddressToEncodedAddress(pl_N_UNITDATA_req.callingAddress);
5442
5443 vl_data.data := pl_N_UNITDATA_req.userData;
5444 vl_data.paramLength:= lengthof( pl_N_UNITDATA_req.userData);
5445
5446 // unitdata overhead calculation:
5447 // msg type: 1; prot class: 2; 3 pointers: 3=> total:6
5448 vl_overhead_length := (vl_CalledPAddress.paramLength+1) +
5449 (vl_CallingPAddress.paramLength +1)+ 6 ;
5450
5451 if( (tsp_force_xudt==0) and
5452 (vl_overhead_length + vl_data.paramLength + 1) <= v_sccp_pdu_maxlen )
5453 {
5454 sending_udt_in_ASP_MTP_TRANSFERreqs(vl_protClass,
5455 vl_CalledPAddress,
5456 vl_CallingPAddress,
5457 vl_data );
5458 }
5459 else
5460 {
5461 sending_xudt_in_ASP_MTP_TRANSFERreqs(vl_protClass,
5462 vl_CalledPAddress,
5463 vl_CallingPAddress,
5464 vl_data );
5465 }
5466
5467 }//processing_ASP_N_UNITDATA_req
5468
5469//******************************************************************
5470//******************************************************************
5471function ScanEvents() runs on SCCP_CT
5472//******************************************************************
5473//******************************************************************
5474{//startfunction
5475
5476 var PDU_SCCP vl_PDU_SCCP;
5477
5478 var ASP_SCCP_N_CONNECT_req vl_N_CONNECT_req;
5479 var ASP_SCCP_N_CONNECT_ind vl_N_CONNECT_ind;
5480 var ASP_SCCP_N_CONNECT_res vl_N_CONNECT_res;
5481 var ASP_SCCP_N_CONNECT_cfm vl_N_CONNECT_cfm;
5482 var ASP_SCCP_N_DATA_req vl_N_DATA_req;
5483 var ASP_SCCP_N_DATA_ind vl_N_DATA_ind;
5484 var ASP_SCCP_N_DISCONNECT_req vl_N_DISCONNECT_req;
5485 var ASP_SCCP_N_DISCONNECT_ind vl_N_DISCONNECT_ind;
5486 var ASP_SCCP_N_UNITDATA_req vl_N_UNITDATA_req;
5487 var ASP_SCCP_N_UNITDATA_ind vl_N_UNITDATA_ind;
5488 var ASP_SCCP_N_NOTICE_ind vl_N_NOTICE_ind;
5489
5490 var integer i;
5491 //this function scans the MTP3 and user port for incoming messages and checks timers for timeout
5492
5493 f_initialize_timer_states();
5494
5495 while (true)
5496 {//startwhile
5497
5498 alt
5499 //******************************************************************
5500 {//startalt0
5501 //******************************************************************
5502 [] MTP3_SCCP_PORT.receive(PDU_SCCP : ? ) -> value vl_PDU_SCCP
5503 {
5504 //******************************************************************
5505 //Unitdata received at destination node
5506 //******************************************************************
5507 if (ischosen(vl_PDU_SCCP.unitdata))
5508 {
5509 // vl_PDU_SCCP.unitdata.pointer1 :=3;
5510 // vl_PDU_SCCP.unitdata.pointer2 :=0;
5511 // vl_PDU_SCCP.unitdata.pointer3 :=0;
5512 processing_PDU_SCCP_Unitdata( vl_PDU_SCCP.unitdata );
5513 }
5514
5515 //******************************************************************
5516 //Data received at destination node
5517 //******************************************************************
5518 else if (ischosen(vl_PDU_SCCP.dataform1))
5519 {
5520 // vl_PDU_SCCP.dataform1.pointer1 :=1;
5521 processing_PDU_SCCP_DataForm1( vl_PDU_SCCP.dataform1 );
5522 }
5523
5524 //******************************************************************
5525 //Extended unitdata received at destination node
5526 //******************************************************************
5527 else if (ischosen(vl_PDU_SCCP.extudata))
5528 {
5529 // vl_PDU_SCCP.extudata.pointer1 :=0;
5530 // vl_PDU_SCCP.extudata.pointer2 :=0;
5531 // vl_PDU_SCCP.extudata.pointer3 :=0;
5532 // vl_PDU_SCCP.extudata.pointer4 :=0;
5533 processing_PDU_SCCP_ExtUnitdata( vl_PDU_SCCP.extudata );
5534 }
5535
5536 //******************************************************************
5537 //Connection request received
5538 //******************************************************************
5539 else if (ischosen(vl_PDU_SCCP.connrequest))
5540 {
5541 // vl_PDU_SCCP.connrequest.pointer1 :=2;
5542 // vl_PDU_SCCP.connrequest.pointer2 :=0;
5543 processing_PDU_SCCP_ConnectionRequest( vl_PDU_SCCP.connrequest );
5544 }
5545
5546 //******************************************************************
5547 //Connection confirm received
5548 //******************************************************************
5549 else if (ischosen(vl_PDU_SCCP.connconfirm))
5550 {
5551 // vl_PDU_SCCP.connconfirm.pointer1 :=1;
5552 processing_PDU_SCCP_ConnectionConfirm( vl_PDU_SCCP.connconfirm );
5553 }
5554
5555 //******************************************************************
5556 //Released received
5557 //******************************************************************
5558 else if (ischosen(vl_PDU_SCCP.released))
5559 {
5560 // vl_PDU_SCCP.released.pointer1 :=1;
5561 processing_PDU_SCCP_Released( vl_PDU_SCCP.released );
5562 }
5563
5564 //******************************************************************
5565 //Release complete received
5566 //******************************************************************
5567 else if (ischosen(vl_PDU_SCCP.relcomp))
5568 {
5569 processing_PDU_SCCP_ReleaseComplete( vl_PDU_SCCP.relcomp );
5570 }
5571
5572 //******************************************************************
5573 //Unitdata service received
5574 //******************************************************************
5575 else if (ischosen(vl_PDU_SCCP.udataserv))
5576 {
5577 // vl_PDU_SCCP.udataserv.pointer1 :=3;
5578 // vl_PDU_SCCP.udataserv.pointer2 :=0;
5579 // vl_PDU_SCCP.udataserv.pointer3 :=0;
5580 processing_PDU_SCCP_UnitdataService( vl_PDU_SCCP.udataserv );
5581 }
5582
5583 //******************************************************************
5584 //PDU_Error received
5585 //******************************************************************
5586 else if (ischosen(vl_PDU_SCCP.pduerror))
5587 {
5588 processing_PDU_SCCP_ProtDataUnitError( vl_PDU_SCCP.pduerror );
5589 }
5590
5591 //******************************************************************
5592 //Inactivity test received
5593 //******************************************************************
5594 else if (ischosen(vl_PDU_SCCP.inacttest))
5595 {
5596 processing_PDU_SCCP_InactivityTest( vl_PDU_SCCP.inacttest );
5597 }
5598
5599 //******************************************************************
5600 //Reset request received
5601 //******************************************************************
5602 else if (ischosen(vl_PDU_SCCP.resetreq))
5603 {
5604 processing_PDU_SCCP_ResetRequest( vl_PDU_SCCP.resetreq );
5605 }
5606
5607 //******************************************************************
5608 //Reset confirm received
5609 //******************************************************************
5610 else if (ischosen(vl_PDU_SCCP.resconf))
5611 {
5612 processing_PDU_SCCP_ResetConfirm( vl_PDU_SCCP.resconf );
5613 }
5614
5615 //******************************************************************
5616 //Connection refused received
5617 //******************************************************************
5618 else if (ischosen(vl_PDU_SCCP.connrefused))
5619 {
5620 // vl_PDU_SCCP.connrefused.pointer1 :=1;
5621 processing_PDU_SCCP_ConnectionRefused( vl_PDU_SCCP.connrefused );
5622 }
5623 else
5624 { log ("Unsupported message received and discarded"); }
5625 }
5626
5627 []MTP3_SCCP_PORT.receive
5628 { log("Unsupported or unrecognized message discarded after reception") }
5629
5630 //******************************************************************
5631 //******************************************************************
5632 ////start second alternative-message received on user port
5633 //******************************************************************
5634 //******************************************************************
5635
5636 [] SCCP_SP_PORT.check
5637 {//start second alternative
5638
5639 alt { //startalt1-subalternatives vill follow
5640
5641 //******************************************************************
5642 //N_DATA_req
5643 //******************************************************************
5644 [] SCCP_SP_PORT.receive( tr_ASP_N_DATA_req)-> value vl_N_DATA_req
5645 { processing_ASP_N_DATA_req(vl_N_DATA_req); }
5646
5647 //******************************************************************
5648 //N_UNITDATA_req at originating node
5649 //******************************************************************
5650 [] SCCP_SP_PORT.receive( tr_ASP_N_UNITDATA_req ) -> value vl_N_UNITDATA_req
5651 { processing_ASP_N_UNITDATA_req(vl_N_UNITDATA_req); }
5652
5653 //******************************************************************
5654 //N_CONNECT_req , originating node
5655 //******************************************************************
5656 [] SCCP_SP_PORT.receive( tr_ASP_N_CONNECT_req) -> value vl_N_CONNECT_req
5657 { processing_ASP_N_CONNECT_req( vl_N_CONNECT_req);}
5658
5659 //******************************************************************
5660 //N_CONNECT_resp
5661 //******************************************************************
5662 [] SCCP_SP_PORT.receive( tr_ASP_N_CONNECT_res)-> value vl_N_CONNECT_res
5663 { processing_ASP_N_CONNECT_res(vl_N_CONNECT_res); }
5664
5665 //******************************************************************
5666 //N_DISCONNECT_req
5667 //******************************************************************
5668 [] SCCP_SP_PORT.receive( tr_ASP_N_DISCONNECT_req)-> value vl_N_DISCONNECT_req
5669 { processing_ASP_N_DISCONNECT_req(vl_N_DISCONNECT_req); }
5670
5671 //******************************************************************
5672 //N_RESET_resp //will not be received!!
5673 //******************************************************************
5674 //[] SCCP_SP_PORT.receive( tr_ASP_N_RESET_resp)-> value vl_N_RESET_resp;
5675
5676 //******************************************************************
5677 //N_RESET_req //will not be received!!
5678 //******************************************************************
5679 //[] SCCP_SP_PORT.receive( tr_ASP_N_RESET_req)-> value vl_N_RESET_req;
5680
5681 //******************************************************************
5682 //If none of the above , then message is removed from the top of the
5683 //stack and discarded
5684 //******************************************************************
5685 [] SCCP_SP_PORT.receive
5686 { }
5687
5688 }//endalt1
5689
5690 }//end second alternative-message received on user port
5691
5692 //******************************************************************
5693 //connection timer expired
5694 //******************************************************************
5695 [v_T_conn_est[0]] T_conn_est[0].timeout {Conn_Timer_Expired(0);
5696 v_T_conn_est[0] := false;}
5697 [v_T_conn_est[1]] T_conn_est[1].timeout {Conn_Timer_Expired(1);
5698 v_T_conn_est[1] := false;}
5699 [v_T_conn_est[2]] T_conn_est[2].timeout {Conn_Timer_Expired(2);
5700 v_T_conn_est[2] := false;}
5701 [v_T_conn_est[3]] T_conn_est[3].timeout {Conn_Timer_Expired(3);
5702 v_T_conn_est[3] := false;}
5703 [v_T_conn_est[4]] T_conn_est[4].timeout {Conn_Timer_Expired(4);
5704 v_T_conn_est[4] := false;}
5705 [v_T_conn_est[5]] T_conn_est[5].timeout {Conn_Timer_Expired(5);
5706 v_T_conn_est[5] := false;}
5707 [v_T_conn_est[6]] T_conn_est[6].timeout {Conn_Timer_Expired(6);
5708 v_T_conn_est[6] := false;}
5709 [v_T_conn_est[7]] T_conn_est[7].timeout {Conn_Timer_Expired(7);
5710 v_T_conn_est[7] := false;}
5711 [v_T_conn_est[8]] T_conn_est[8].timeout {Conn_Timer_Expired(8);
5712 v_T_conn_est[8] := false;}
5713 [v_T_conn_est[9]] T_conn_est[9].timeout {Conn_Timer_Expired(9);
5714 v_T_conn_est[9] := false;}
5715 [v_T_conn_est[10]] T_conn_est[10].timeout {Conn_Timer_Expired(10);
5716 v_T_conn_est[10] := false;}
5717 [v_T_conn_est[11]] T_conn_est[11].timeout {Conn_Timer_Expired(11);
5718 v_T_conn_est[11] := false;}
5719 [v_T_conn_est[12]] T_conn_est[12].timeout {Conn_Timer_Expired(12);
5720 v_T_conn_est[12] := false;}
5721 [v_T_conn_est[13]] T_conn_est[13].timeout {Conn_Timer_Expired(13);
5722 v_T_conn_est[13] := false;}
5723 [v_T_conn_est[14]] T_conn_est[14].timeout {Conn_Timer_Expired(14);
5724 v_T_conn_est[14] := false;}
5725 [v_T_conn_est[15]] T_conn_est[15].timeout {Conn_Timer_Expired(15);
5726 v_T_conn_est[15] := false;}
5727
5728 //******************************************************************
5729 //send inactivity timer expired
5730 //******************************************************************
5731
5732 [v_T_ias[0]] T_ias[0].timeout {SendInactivity_Timer_Expired(0);
5733 v_T_ias[0] := false;}
5734 [v_T_ias[1]] T_ias[1].timeout {SendInactivity_Timer_Expired(1);
5735 v_T_ias[1] := false;}
5736 [v_T_ias[2]] T_ias[2].timeout {SendInactivity_Timer_Expired(2);
5737 v_T_ias[2] := false;}
5738 [v_T_ias[3]] T_ias[3].timeout {SendInactivity_Timer_Expired(3);
5739 v_T_ias[3] := false;}
5740 [v_T_ias[4]] T_ias[4].timeout {SendInactivity_Timer_Expired(4);
5741 v_T_ias[4] := false;}
5742 [v_T_ias[5]] T_ias[5].timeout {SendInactivity_Timer_Expired(5);
5743 v_T_ias[5] := false;}
5744 [v_T_ias[6]] T_ias[6].timeout {SendInactivity_Timer_Expired(6);
5745 v_T_ias[6] := false;}
5746 [v_T_ias[7]] T_ias[7].timeout {SendInactivity_Timer_Expired(7);
5747 v_T_ias[7] := false;}
5748 [v_T_ias[8]] T_ias[8].timeout {SendInactivity_Timer_Expired(8);
5749 v_T_ias[8] := false;}
5750 [v_T_ias[9]] T_ias[9].timeout {SendInactivity_Timer_Expired(9);
5751 v_T_ias[i] := false;}
5752 [v_T_ias[10]] T_ias[10].timeout {SendInactivity_Timer_Expired(10);
5753 v_T_ias[10] := false;}
5754 [v_T_ias[11]] T_ias[11].timeout {SendInactivity_Timer_Expired(11);
5755 v_T_ias[11] := false;}
5756 [v_T_ias[12]] T_ias[12].timeout {SendInactivity_Timer_Expired(12);
5757 v_T_ias[12] := false;}
5758 [v_T_ias[13]] T_ias[13].timeout {SendInactivity_Timer_Expired(13);
5759 v_T_ias[13] := false;}
5760 [v_T_ias[14]] T_ias[14].timeout {SendInactivity_Timer_Expired(14);
5761 v_T_ias[14] := false;}
5762 [v_T_ias[15]] T_ias[15].timeout {SendInactivity_Timer_Expired(15);
5763 v_T_ias[15] := false;}
5764
5765 //******************************************************************
5766 //receive inactivity timer expired
5767 //******************************************************************
5768 [v_T_iar[0]] T_iar[0].timeout {ReceiveInactivity_Timer_Expired(0);
5769 v_T_iar[0] := false;}
5770 [v_T_iar[1]] T_iar[1].timeout {ReceiveInactivity_Timer_Expired(1);
5771 v_T_iar[1] := false;}
5772 [v_T_iar[2]] T_iar[2].timeout {ReceiveInactivity_Timer_Expired(2);
5773 v_T_iar[2] := false;}
5774 [v_T_iar[3]] T_iar[3].timeout {ReceiveInactivity_Timer_Expired(3);
5775 v_T_iar[3] := false;}
5776 [v_T_iar[4]] T_iar[4].timeout {ReceiveInactivity_Timer_Expired(4);
5777 v_T_iar[4] := false;}
5778 [v_T_iar[5]] T_iar[5].timeout {ReceiveInactivity_Timer_Expired(5);
5779 v_T_iar[5] := false;}
5780 [v_T_iar[6]] T_iar[6].timeout {ReceiveInactivity_Timer_Expired(6);
5781 v_T_iar[6] := false;}
5782 [v_T_iar[7]] T_iar[7].timeout {ReceiveInactivity_Timer_Expired(7);
5783 v_T_iar[7] := false;}
5784 [v_T_iar[8]] T_iar[8].timeout {ReceiveInactivity_Timer_Expired(8);
5785 v_T_iar[8] := false;}
5786 [v_T_iar[9]] T_iar[9].timeout {ReceiveInactivity_Timer_Expired(9);
5787 v_T_iar[9] := false;}
5788 [v_T_iar[10]] T_iar[10].timeout {ReceiveInactivity_Timer_Expired(10);
5789 v_T_iar[10] := false;}
5790 [v_T_iar[11]] T_iar[11].timeout {ReceiveInactivity_Timer_Expired(11);
5791 v_T_iar[11] := false;}
5792 [v_T_iar[12]] T_iar[12].timeout {ReceiveInactivity_Timer_Expired(12);
5793 v_T_iar[12] := false;}
5794 [v_T_iar[13]] T_iar[13].timeout {ReceiveInactivity_Timer_Expired(13);
5795 v_T_iar[13] := false;}
5796 [v_T_iar[14]] T_iar[14].timeout {ReceiveInactivity_Timer_Expired(14);
5797 v_T_iar[14] := false;}
5798 [v_T_iar[15]] T_iar[15].timeout {ReceiveInactivity_Timer_Expired(15);
5799 v_T_iar[15] := false;}
5800
5801 //******************************************************************
5802 //release timer expired
5803 //******************************************************************
5804 [v_T_rel[0]] T_rel[0].timeout {Release_Timer_Expired(0);
5805 v_T_rel[0] := false;}
5806 [v_T_rel[1]] T_rel[1].timeout {Release_Timer_Expired(1);
5807 v_T_rel[1] := false;}
5808 [v_T_rel[2]] T_rel[2].timeout {Release_Timer_Expired(2);
5809 v_T_rel[2] := false;}
5810 [v_T_rel[3]] T_rel[3].timeout {Release_Timer_Expired(3);
5811 v_T_rel[3] := false;}
5812 [v_T_rel[4]] T_rel[4].timeout {Release_Timer_Expired(4);
5813 v_T_rel[4] := false;}
5814 [v_T_rel[5]] T_rel[5].timeout {Release_Timer_Expired(5);
5815 v_T_rel[5] := false;}
5816 [v_T_rel[6]] T_rel[6].timeout {Release_Timer_Expired(6);
5817 v_T_rel[6] := false;}
5818 [v_T_rel[7]] T_rel[7].timeout {Release_Timer_Expired(7);
5819 v_T_rel[7] := false;}
5820 [v_T_rel[8]] T_rel[8].timeout {Release_Timer_Expired(8);
5821 v_T_rel[8] := false;}
5822 [v_T_rel[9]] T_rel[9].timeout {Release_Timer_Expired(9);
5823 v_T_rel[9] := false;}
5824 [v_T_rel[10]] T_rel[10].timeout {Release_Timer_Expired(10);
5825 v_T_rel[10] := false;}
5826 [v_T_rel[11]] T_rel[11].timeout {Release_Timer_Expired(11);
5827 v_T_rel[11] := false;}
5828 [v_T_rel[12]] T_rel[12].timeout {Release_Timer_Expired(12);
5829 v_T_rel[12] := false;}
5830 [v_T_rel[13]] T_rel[13].timeout {Release_Timer_Expired(13);
5831 v_T_rel[13] := false;}
5832 [v_T_rel[14]] T_rel[14].timeout {Release_Timer_Expired(14);
5833 v_T_rel[14] := false;}
5834 [v_T_rel[15]] T_rel[15].timeout {Release_Timer_Expired(15);
5835 v_T_rel[15] := false;}
5836
5837 //******************************************************************
5838 //repeat release timer expired
5839 //******************************************************************
5840
5841 [v_T_repeat_rel[0]] T_repeat_rel[0].timeout {RepeatRelease_Timer_Expired(0);
5842 v_T_repeat_rel[0] := false;}
5843 [v_T_repeat_rel[1]] T_repeat_rel[1].timeout {RepeatRelease_Timer_Expired(1);
5844 v_T_repeat_rel[1] := false;}
5845 [v_T_repeat_rel[2]] T_repeat_rel[2].timeout {RepeatRelease_Timer_Expired(2);
5846 v_T_repeat_rel[2] := false;}
5847 [v_T_repeat_rel[3]] T_repeat_rel[3].timeout {RepeatRelease_Timer_Expired(3);
5848 v_T_repeat_rel[3] := false;}
5849 [v_T_repeat_rel[4]] T_repeat_rel[4].timeout {RepeatRelease_Timer_Expired(4);
5850 v_T_repeat_rel[4] := false;}
5851 [v_T_repeat_rel[5]] T_repeat_rel[5].timeout {RepeatRelease_Timer_Expired(5);
5852 v_T_repeat_rel[5] := false;}
5853 [v_T_repeat_rel[6]] T_repeat_rel[6].timeout {RepeatRelease_Timer_Expired(6);
5854 v_T_repeat_rel[6] := false;}
5855 [v_T_repeat_rel[7]] T_repeat_rel[7].timeout {RepeatRelease_Timer_Expired(7);
5856 v_T_repeat_rel[7] := false;}
5857 [v_T_repeat_rel[8]] T_repeat_rel[8].timeout {RepeatRelease_Timer_Expired(8);
5858 v_T_repeat_rel[8] := false;}
5859 [v_T_repeat_rel[9]] T_repeat_rel[9].timeout {RepeatRelease_Timer_Expired(9);
5860 v_T_repeat_rel[9] := false;}
5861 [v_T_repeat_rel[10]] T_repeat_rel[10].timeout {RepeatRelease_Timer_Expired(10);
5862 v_T_repeat_rel[10] := false;}
5863 [v_T_repeat_rel[11]] T_repeat_rel[11].timeout {RepeatRelease_Timer_Expired(11);
5864 v_T_repeat_rel[11] := false;}
5865 [v_T_repeat_rel[12]] T_repeat_rel[12].timeout {RepeatRelease_Timer_Expired(12);
5866 v_T_repeat_rel[12] := false;}
5867 [v_T_repeat_rel[13]] T_repeat_rel[13].timeout {RepeatRelease_Timer_Expired(13);
5868 v_T_repeat_rel[13] := false;}
5869 [v_T_repeat_rel[14]] T_repeat_rel[14].timeout {RepeatRelease_Timer_Expired(14);
5870 v_T_repeat_rel[14] := false;}
5871 [v_T_repeat_rel[15]] T_repeat_rel[15].timeout {RepeatRelease_Timer_Expired(15);
5872 v_T_repeat_rel[15] := false;}
5873
5874 //******************************************************************
5875 //interval timer expired
5876 //******************************************************************
5877 [v_T_int[0]] T_int[0].timeout {Interval_Timer_Expired(0);
5878 v_T_int[0] := false;}
5879 [v_T_int[1]] T_int[1].timeout {Interval_Timer_Expired(1);
5880 v_T_int[1] := false;}
5881 [v_T_int[2]] T_int[2].timeout {Interval_Timer_Expired(2);
5882 v_T_int[2] := false;}
5883 [v_T_int[3]] T_int[3].timeout {Interval_Timer_Expired(3);
5884 v_T_int[3] := false;}
5885 [v_T_int[4]] T_int[4].timeout {Interval_Timer_Expired(4);
5886 v_T_int[4] := false;}
5887 [v_T_int[5]] T_int[5].timeout {Interval_Timer_Expired(5);
5888 v_T_int[5] := false;}
5889 [v_T_int[6]] T_int[6].timeout {Interval_Timer_Expired(6);
5890 v_T_int[6] := false;}
5891 [v_T_int[7]] T_int[7].timeout {Interval_Timer_Expired(7);
5892 v_T_int[7] := false;}
5893 [v_T_int[8]] T_int[8].timeout {Interval_Timer_Expired(8);
5894 v_T_int[8] := false;}
5895 [v_T_int[9]] T_int[9].timeout {Interval_Timer_Expired(9);
5896 v_T_int[9] := false;}
5897 [v_T_int[10]] T_int[10].timeout {Interval_Timer_Expired(10);
5898 v_T_int[10] := false;}
5899 [v_T_int[11]] T_int[11].timeout {Interval_Timer_Expired(11);
5900 v_T_int[11] := false;}
5901 [v_T_int[12]] T_int[12].timeout {Interval_Timer_Expired(12);
5902 v_T_int[12] := false;}
5903 [v_T_int[13]] T_int[13].timeout {Interval_Timer_Expired(13);
5904 v_T_int[13] := false;}
5905 [v_T_int[14]] T_int[14].timeout {Interval_Timer_Expired(14);
5906 v_T_int[14] := false;}
5907 [v_T_int[15]] T_int[15].timeout {Interval_Timer_Expired(15);
5908 v_T_int[15] := false;}
5909
5910 //******************************************************************
5911 //reset timer expired
5912 //******************************************************************
5913 [v_T_reset[0]] T_reset[0].timeout {Reset_Timer_Expired(0);
5914 v_T_reset[0] := false;}
5915 [v_T_reset[1]] T_reset[1].timeout {Reset_Timer_Expired(1);
5916 v_T_reset[1] := false;}
5917 [v_T_reset[2]] T_reset[2].timeout {Reset_Timer_Expired(2);
5918 v_T_reset[2] := false;}
5919 [v_T_reset[3]] T_reset[3].timeout {Reset_Timer_Expired(3);
5920 v_T_reset[3] := false;}
5921 [v_T_reset[4]] T_reset[4].timeout {Reset_Timer_Expired(4);
5922 v_T_reset[4] := false;}
5923 [v_T_reset[5]] T_reset[5].timeout {Reset_Timer_Expired(5);
5924 v_T_reset[5] := false;}
5925 [v_T_reset[6]] T_reset[6].timeout {Reset_Timer_Expired(6);
5926 v_T_reset[6] := false;}
5927 [v_T_reset[7]] T_reset[7].timeout {Reset_Timer_Expired(7);
5928 v_T_reset[7] := false;}
5929 [v_T_reset[8]] T_reset[8].timeout {Reset_Timer_Expired(8);
5930 v_T_reset[8] := false;}
5931 [v_T_reset[9]] T_reset[9].timeout {Reset_Timer_Expired(9);
5932 v_T_reset[9] := false;}
5933 [v_T_reset[10]] T_reset[10].timeout {Reset_Timer_Expired(10);
5934 v_T_reset[10] := false;}
5935 [v_T_reset[11]] T_reset[11].timeout {Reset_Timer_Expired(11);
5936 v_T_reset[11] := false;}
5937 [v_T_reset[12]] T_reset[12].timeout {Reset_Timer_Expired(12);
5938 v_T_reset[12] := false;}
5939 [v_T_reset[13]] T_reset[13].timeout {Reset_Timer_Expired(13);
5940 v_T_reset[13] := false;}
5941 [v_T_reset[14]] T_reset[14].timeout {Reset_Timer_Expired(14);
5942 v_T_reset[14] := false;}
5943 [v_T_reset[15]] T_reset[15].timeout {Reset_Timer_Expired(15);
5944 v_T_reset[15] := false;}
5945
5946 //******************************************************************
5947 //internal_reset timer expired-sending internal signals!
5948 //******************************************************************
5949 [v_T_internal_reset[0]] T_internal_reset[0].timeout {InternalResetTimer_Expired(0);
5950 v_T_internal_reset[0] := false;}
5951 [v_T_internal_reset[1]] T_internal_reset[1].timeout {InternalResetTimer_Expired(1);
5952 v_T_internal_reset[1] := false;}
5953 [v_T_internal_reset[2]] T_internal_reset[2].timeout {InternalResetTimer_Expired(2);
5954 v_T_internal_reset[2] := false;}
5955 [v_T_internal_reset[3]] T_internal_reset[3].timeout {InternalResetTimer_Expired(3);
5956 v_T_internal_reset[3] := false;}
5957 [v_T_internal_reset[4]] T_internal_reset[4].timeout {InternalResetTimer_Expired(4);
5958 v_T_internal_reset[4] := false;}
5959 [v_T_internal_reset[5]] T_internal_reset[5].timeout {InternalResetTimer_Expired(5);
5960 v_T_internal_reset[5] := false;}
5961 [v_T_internal_reset[6]] T_internal_reset[6].timeout {InternalResetTimer_Expired(6);
5962 v_T_internal_reset[6] := false;}
5963 [v_T_internal_reset[7]] T_internal_reset[7].timeout {InternalResetTimer_Expired(7);
5964 v_T_internal_reset[7] := false;}
5965 [v_T_internal_reset[8]] T_internal_reset[8].timeout {InternalResetTimer_Expired(8);
5966 v_T_internal_reset[8] := false;}
5967 [v_T_internal_reset[9]] T_internal_reset[9].timeout {InternalResetTimer_Expired(9);
5968 v_T_internal_reset[9] := false;}
5969 [v_T_internal_reset[10]] T_internal_reset[10].timeout {InternalResetTimer_Expired(10);
5970 v_T_internal_reset[10] := false;}
5971 [v_T_internal_reset[11]] T_internal_reset[11].timeout {InternalResetTimer_Expired(11);
5972 v_T_internal_reset[11] := false;}
5973 [v_T_internal_reset[12]] T_internal_reset[12].timeout {InternalResetTimer_Expired(12);
5974 v_T_internal_reset[12] := false;}
5975 [v_T_internal_reset[13]] T_internal_reset[13].timeout {InternalResetTimer_Expired(13);
5976 v_T_internal_reset[13] := false;}
5977 [v_T_internal_reset[14]] T_internal_reset[14].timeout {InternalResetTimer_Expired(14);
5978 v_T_internal_reset[14] := false;}
5979 [v_T_internal_reset[15]] T_internal_reset[15].timeout {InternalResetTimer_Expired(15);
5980 v_T_internal_reset[15] := false;}
5981
5982 //******************************************************************
5983 //guard timer expired - no answer to ASP_SCCP_N_CONNECT_ind received
5984 //******************************************************************
5985 [v_T_guard[0]] T_guard[0].timeout {GuardTimer_Expired(0);
5986 v_T_guard[0] := false;}
5987 [v_T_guard[1]] T_guard[1].timeout {GuardTimer_Expired(1);
5988 v_T_guard[1] := false;}
5989 [v_T_guard[2]] T_guard[2].timeout {GuardTimer_Expired(2);
5990 v_T_guard[2] := false;}
5991 [v_T_guard[3]] T_guard[3].timeout {GuardTimer_Expired(3);
5992 v_T_guard[3] := false;}
5993 [v_T_guard[4]] T_guard[4].timeout {GuardTimer_Expired(4);
5994 v_T_guard[4] := false;}
5995 [v_T_guard[5]] T_guard[5].timeout {GuardTimer_Expired(5);
5996 v_T_guard[5] := false;}
5997 [v_T_guard[6]] T_guard[6].timeout {GuardTimer_Expired(6);
5998 v_T_guard[6] := false;}
5999 [v_T_guard[7]] T_guard[7].timeout {GuardTimer_Expired(7);
6000 v_T_guard[7] := false;}
6001 [v_T_guard[8]] T_guard[8].timeout {GuardTimer_Expired(8);
6002 v_T_guard[8] := false;}
6003 [v_T_guard[9]] T_guard[9].timeout {GuardTimer_Expired(9);
6004 v_T_guard[9] := false;}
6005 [v_T_guard[10]] T_guard[10].timeout {GuardTimer_Expired(10);
6006 v_T_guard[10] := false;}
6007 [v_T_guard[11]] T_guard[11].timeout {GuardTimer_Expired(11);
6008 v_T_guard[11] := false;}
6009 [v_T_guard[12]] T_guard[12].timeout {GuardTimer_Expired(12);
6010 v_T_guard[12] := false;}
6011 [v_T_guard[13]] T_guard[13].timeout {GuardTimer_Expired(13);
6012 v_T_guard[13] := false;}
6013 [v_T_guard[14]] T_guard[14].timeout {GuardTimer_Expired(14);
6014 v_T_guard[14] := false;}
6015 [v_T_guard[15]] T_guard[15].timeout {GuardTimer_Expired(15);
6016 v_T_guard[15] := false;}
6017
6018
6019 }//endalt0
6020
6021 //******************************************************************
6022 }//endwhile
6023 //******************************************************************
6024
6025}//endfunction ScanEvents
6026
6027//******************************************************************
6028}//endgroup SCCPFunctions
6029//******************************************************************
6030
6031}//endmodule