summaryrefslogtreecommitdiffstats
path: root/MTP3asp_CNL113337/src/MTP3asp_Types.ttcn
blob: e96f4201676ad043151602886816910c3fedf604 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Copyright Test Competence Center (TCC) ETH 2006                           //
//                                                                           //
// The copyright to the computer  program(s) herein  is the property of TCC. //
// The program(s) may be used and/or copied only with the written permission //
// of TCC or in accordance with  the terms and conditions  stipulated in the //
// agreement/contract under which the program(s) have been supplied          //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
//
//  File:         MTP3asp_Types.ttcn
//  Description:  CCSS7 Message Transfer Part primitive (ASP) definitions
//                according to specification ITU-T SS7 MTP3,
//  Reference:    ITU-T Recommendation Q.704, RFC3332, ANSI T.1.111.1-2001, TCC 
//  Rev:          R11A01
//  Prodnr:       CNL 113 337
//  Updated:      2007-09-17
//  Contact:      http://ttcn.ericsson.se
//
module MTP3asp_Types.objid 
  { 
    itu_t(0) identified_organization (4) etsi(0) reserved(127)
    etsi_identified_organization(0) ericsson(5) testing (0)
    generic(0) mtp3(0) v96(3) aspDefinitions(3) patchNo(0)
  }

{//start of the module

// *************************************************************************
//  External encoding/decoding functions
// *************************************************************************

external function enc_MTP3_to_M3UAserver_msg (in MTP3_to_M3UAserver_msg pdu)
  return octetstring
  with { extension "prototype(convert)"
         extension "encode(RAW)"
       };

external function dec_MTP3_to_M3UAserver_msg(in octetstring stream)
   return MTP3_to_M3UAserver_msg
  with { extension "prototype(convert)"
         extension "decode(RAW)"
       };


// *************************************************************************
// *  Type Definitions Part                                                *
// *************************************************************************
group Types
{
  group MessageTypes
  {
    group ASPs
    {
    //***********************************************************************
    //*  ASP type definitions                                               *
    //*          Note, that ASP types shall be TTCN-3 definitions to allow  *
    //*          the use of anytype in the data field                       *
    //***********************************************************************

      type record MTP3_Field_sio
      {
        bitstring ni   length(2),
        bitstring prio length(2),
        bitstring si   length(4)
      } with { variant "FIELDORDER(msb)";
             };
      
      type record ASP_MTP3_TRANSFERind
      {
        MTP3_Field_sio    sio,
        integer           opc,
        integer           dpc,
        integer           sls,
        octetstring       data
      } with { variant (opc) "BYTEORDER(last), FIELDLENGTH(32)";
               variant (dpc) "BYTEORDER(last), FIELDLENGTH(32)";
               variant (sls) "FIELDLENGTH(8)"
             };

      type record ASP_MTP3_PAUSE {};

      type record ASP_MTP3_RESUME {};

      type record ASP_MTP3_STATUS {};

      type record ASP_MTP3_TRANSFERreq
      {
        MTP3_Field_sio    sio,
        integer           opc,
        integer           dpc,
        integer           sls,
        octetstring       data
      } with { variant (opc) "BYTEORDER(last), FIELDLENGTH(32)";
               variant (dpc) "BYTEORDER(last), FIELDLENGTH(32)";
               variant (sls) "FIELDLENGTH(8)"
             };
    }//end group ASPs

    //***********************************************************************
    //* Type definition of the message which is sent between MTP3 test port *
    //*  and SCTP server over TCP.                                          *
    //***********************************************************************
    group MTP3_SCTPserver
    {
      type record ASP_REGISTER_M3UA
      {
        integer     ni (0..3),
        integer     sut_pc,
        integer     tester_pc,
        integer     m3ua_version,
        charstring  entity
      } with { variant (ni) "FIELDLENGTH(8)";
               variant (sut_pc) "BYTEORDER(last), FIELDLENGTH(32)";
               variant (tester_pc) "BYTEORDER(last), FIELDLENGTH(32)";
               variant (m3ua_version) "FIELDLENGTH(8)"
      };
      
      
      // Possible values:
      // MTP3_to_SCTPserver_data/status:
      const integer reg_ok_status      := 0;
      const integer reg_error_status   := 1;
      const integer unreg_ok_status    := 2;
      const integer unreg_error_status := 3;

      const integer send_error_status  := 5;
      const integer kill_status        := 255;
      
      // MTP3_to_SCTPserver_data/pause:
      const integer SCTP_COMLOST_pause := 0;
      const integer M3UA_ASPDN_pause   := 1;
      const integer M3UA_ASPIA_pause   := 2;
      
      // MTP3_to_SCTPserver_data/resume:
      const integer ok_resume := 0;
      
      type union MTP3_to_SCTPserver_data
      {
        ASP_MTP3_TRANSFERind transfer_ind,
        ASP_MTP3_TRANSFERreq transfer_req,
        ASP_REGISTER_M3UA    register,
        integer              unregister (0..255),
        integer              status (0..255),
        integer              pause (0..255),
        integer              resume (0..255)
      }
      
      // MTP3_to_M3UAserver_msg/msgType:
      const integer transfer_ind_msgType := 0;
      const integer transfer_req_msgType := 1;
      const integer register_msgType     := 2;
      const integer unregister_msgType   := 3;
      const integer status_msgType       := 4;
      const integer pause_msgType        := 5;
      const integer resume_msgType       := 6;
      
      type record MTP3_to_M3UAserver_msg
      {
        integer                 msgType (0..255),
        integer                 msgLength,
        MTP3_to_SCTPserver_data data
      } with { variant (data) "CROSSTAG(
                              transfer_ind, msgType = transfer_ind_msgType;
                              transfer_req, msgType = transfer_req_msgType;
                              register,     msgType = register_msgType;
                              unregister,   msgType = unregister_msgType;
                              status,       msgType = status_msgType;
                              pause,        msgType = pause_msgType;
                              resume,       msgType = resume_msgType )";
               variant (msgLength) "FIELDLENGTH(32)";
               variant (msgLength) "LENGTHTO(msgType,msgLength,data)";
               variant (msgLength) "BYTEORDER(last)"
             };
    }//end group MTP3_SCTPserver
  }//end group Messagetypes
} with {encode "RAW"}//Types

group Templates
{
  group MessageTemplates
  {
    group ASPtemplates
    {
    // *******************************************************************
    // *   ASP template definitions                                      *
    // *******************************************************************

    // Base templates 
    // These general templates can be used as an example or as a base
    // template for other templates.
      template ASP_MTP3_TRANSFERind t_ASP_MTP3_TRANSFERind
      ( 
        template MTP3_Field_sio pl_SIO,
        template integer        pl_OPC,
        template integer        pl_DPC,
        template integer        pl_SLS,
        template octetstring    pl_data
      ):=
      {
        sio  := pl_SIO,
        opc  := pl_OPC,
        dpc  := pl_DPC,
        sls  := pl_SLS,
        data := pl_data 
      }
    
      template ASP_MTP3_TRANSFERind tr_ASP_MTP3_TRANSFERind_sio
      ( 
       template bitstring      pl_NI,
       template bitstring      pl_PRIO,
       template bitstring      pl_SI,
       template integer        pl_OPC,
       template integer        pl_DPC,
       template integer        pl_SLS,
       template octetstring    pl_data
      ):=
      {
        sio  := 
        {
          ni := pl_NI,
          prio := pl_PRIO,
          si := pl_SI
        },
        opc  := pl_OPC,
        dpc  := pl_DPC,
        sls  := pl_SLS,
        data := pl_data 
      }
    
      template ASP_MTP3_TRANSFERind tr_ASP_MTP3_TRANSFERind :=
      {
        sio  := ?,
        opc  := ?,
        dpc  := ?,
        sls  := ?,
        data := ?
      }

      template ASP_MTP3_TRANSFERreq t_ASP_MTP3_TRANSFERreq
      ( 
        MTP3_Field_sio pl_SIO,
        integer        pl_OPC,
        integer        pl_DPC,
        integer        pl_SLS,
        octetstring    pl_data
      ):=
      {
        sio  := pl_SIO,
        opc  := pl_OPC,
        dpc  := pl_DPC,
        sls  := pl_SLS,
        data := pl_data 
      }

      template ASP_MTP3_TRANSFERreq tr_ASP_MTP3_TRANSFERreq_sio
      ( 
       template bitstring      pl_NI,
       template bitstring      pl_PRIO,
       template bitstring      pl_SI,
       template integer        pl_OPC,
       template integer        pl_DPC,
       template integer        pl_SLS,
       template octetstring    pl_data
      ):=
      {
        sio  := 
        {
          ni := pl_NI,
          prio := pl_PRIO,
          si := pl_SI
        },
        opc  := pl_OPC,
        dpc  := pl_DPC,
        sls  := pl_SLS,
        data := pl_data 
      }

      template ASP_MTP3_TRANSFERreq tr_ASP_MTP3_TRANSFERreq :=
      {
        sio  := ?,
        opc  := ?,
        dpc  := ?,
        sls  := ?,
        data := ? 
      }
    
      template ASP_MTP3_TRANSFERind tr_ASP_MTP3_TRANSFERind_stc :=
      {
        sio  := 
        {
          ni := '00'B,
          prio := '00'B,
          si := '0000'B
        },
        opc  := 0,
        dpc  := 0,
        sls  := 0,
        data := ? 
      }
    
      template ASP_MTP3_TRANSFERreq t_ASP_MTP3_TRANSFERreq_stc
      ( template octetstring    pl_data ):=
      {
        sio  := 
        {
          ni := '00'B,
          prio := '00'B,
          si := '0000'B
        },
        opc  := 0,
        dpc  := 0,
        sls  := 0,
        data := pl_data 
      }
    
    }//end group ASPtemplates
  }//end group Messagetemplates
}//end group Templates

}//end module