Harald Welte | 9a8f503 | 2017-07-25 08:23:52 +0200 | [diff] [blame] | 1 | /////////////////////////////////////////////////////////////////////////////// |
| 2 | // |
| 3 | // Copyright Test Competence Center (TCC) ETH 2006 |
| 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: ISUP_Mapping.ttcn |
| 12 | // Rev: R7D |
| 13 | // Prodnr: CNL 113 365 |
| 14 | // Updated: 2006-05-10 |
| 15 | // Contact: http://ttcn.ericsson.se |
| 16 | /////////////////////////////////////////////////////////////////////////////// |
| 17 | module ISUP_Mapping |
| 18 | { |
| 19 | import from MTP3asp_PortType all; |
| 20 | import from MTP3asp_Types all; |
| 21 | import from ISUP_Types all; |
| 22 | |
| 23 | group Types |
| 24 | { |
| 25 | type record MSC_ISUP_MTP3_parameters |
| 26 | { |
| 27 | MTP3_Field_sio sio, |
| 28 | integer opc, |
| 29 | integer dpc, |
| 30 | integer sls |
| 31 | } |
| 32 | |
| 33 | group PortTypes |
| 34 | { |
| 35 | //************************************************************************* |
| 36 | //* ISUP port types * |
| 37 | //************************************************************************* |
| 38 | type port MTP3asp_ISUP_PT message |
| 39 | { |
| 40 | inout PDU_ISUP; |
| 41 | } with {extension "internal"} |
| 42 | |
| 43 | type port MTC_ISUP_PT message // Coordination message |
| 44 | { |
| 45 | inout charstring; |
| 46 | inout octetstring; |
| 47 | } with {extension "internal"} |
| 48 | }//end group PortTypes |
| 49 | |
| 50 | |
| 51 | group ComponentTypes |
| 52 | { |
| 53 | //************************************************************************* |
| 54 | //* ISUP Component types * |
| 55 | //************************************************************************* |
| 56 | type component ISUP_CT |
| 57 | { |
| 58 | //========================Component constants=========================== |
| 59 | |
| 60 | //========================Component variables=========================== |
| 61 | var PDU_ISUP v_PDU_ISUP; |
| 62 | |
| 63 | //========================Component Timers-============================= |
| 64 | |
| 65 | //========================Component Port Declarations==================== |
| 66 | port MTC_ISUP_PT MTC_ISUP_PORT; //up |
| 67 | port MTP3asp_ISUP_PT MTP3_ISUP_PORT; //down |
| 68 | } // end component type definition |
| 69 | |
| 70 | //************************************************************************* |
| 71 | //* ISUP EncDec component * |
| 72 | //************************************************************************* |
| 73 | type component ISUP_EncDec_CT |
| 74 | { |
| 75 | //========================Component Port Declarations==================== |
| 76 | port MTP3asp_ISUP_PT MTP3_ISUP_PORT; //<= SP_PT=_PT |
| 77 | port MTP3asp_PT MTP3_PORT; |
| 78 | } // end component type definition |
| 79 | }//end group ComponentTypes |
| 80 | |
| 81 | }//end group Types |
| 82 | |
| 83 | |
| 84 | //************************************************************************* |
| 85 | //* ISUP EncDec component behaviour * |
| 86 | //************************************************************************* |
| 87 | function f_ISUP_EncDecComp_Behaviour |
| 88 | ( MSC_ISUP_MTP3_parameters pl_address_ISUP ) runs on ISUP_EncDec_CT |
| 89 | { |
| 90 | var ASP_MTP3_TRANSFERind vl_ASP_MTP3_TRANSFERind; |
| 91 | var PDU_ISUP vl_PDU_ISUP; |
| 92 | pl_address_ISUP.sio.si := '0101'B; |
| 93 | |
| 94 | while (true) |
| 95 | { |
| 96 | alt |
| 97 | { |
| 98 | [] MTP3_ISUP_PORT.receive ( PDU_ISUP : ?) -> value vl_PDU_ISUP |
| 99 | { |
| 100 | MTP3_PORT.send (t_ASP_MTP3_TRANSFERreq |
| 101 | (pl_address_ISUP.sio, |
| 102 | pl_address_ISUP.opc, |
| 103 | pl_address_ISUP.dpc, |
| 104 | pl_address_ISUP.sls, |
| 105 | enc_PDU_ISUP(vl_PDU_ISUP))); |
| 106 | repeat; |
| 107 | } |
| 108 | |
| 109 | // receive message from below (to be decoded) |
| 110 | [] MTP3_PORT.receive (tr_ASP_MTP3_TRANSFERind_sio |
| 111 | (pl_address_ISUP.sio.ni, |
| 112 | ?, //priority: no filtering |
| 113 | pl_address_ISUP.sio.si, |
| 114 | ?, |
| 115 | ?, |
| 116 | ?, |
| 117 | ? )) -> value vl_ASP_MTP3_TRANSFERind |
| 118 | { |
| 119 | MTP3_ISUP_PORT.send (dec_PDU_ISUP(vl_ASP_MTP3_TRANSFERind.data)); |
| 120 | repeat; |
| 121 | } |
| 122 | |
| 123 | [] MTP3_PORT.receive (t_ASP_MTP3_TRANSFERind( ?, ?, ?, ?, ? )) |
| 124 | { log("Invalid SIO: MESSAGE dropped!!!"); } |
| 125 | } //end of alt |
| 126 | } // end while |
| 127 | } // end of f_ISUP_EncDecComp_Behaviour |
| 128 | } |