blob: e96f4201676ad043151602886816910c3fedf604 [file] [log] [blame]
Harald Welteac359802017-04-12 12:13:44 +02001///////////////////////////////////////////////////////////////////////////////
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//
12// File: MTP3asp_Types.ttcn
13// Description: CCSS7 Message Transfer Part primitive (ASP) definitions
14// according to specification ITU-T SS7 MTP3,
15// Reference: ITU-T Recommendation Q.704, RFC3332, ANSI T.1.111.1-2001, TCC
16// Rev: R11A01
17// Prodnr: CNL 113 337
18// Updated: 2007-09-17
19// Contact: http://ttcn.ericsson.se
20//
21module MTP3asp_Types.objid
22 {
23 itu_t(0) identified_organization (4) etsi(0) reserved(127)
24 etsi_identified_organization(0) ericsson(5) testing (0)
25 generic(0) mtp3(0) v96(3) aspDefinitions(3) patchNo(0)
26 }
27
28{//start of the module
29
30// *************************************************************************
31// External encoding/decoding functions
32// *************************************************************************
33
34external function enc_MTP3_to_M3UAserver_msg (in MTP3_to_M3UAserver_msg pdu)
35 return octetstring
36 with { extension "prototype(convert)"
37 extension "encode(RAW)"
38 };
39
40external function dec_MTP3_to_M3UAserver_msg(in octetstring stream)
41 return MTP3_to_M3UAserver_msg
42 with { extension "prototype(convert)"
43 extension "decode(RAW)"
44 };
45
46
47// *************************************************************************
48// * Type Definitions Part *
49// *************************************************************************
50group Types
51{
52 group MessageTypes
53 {
54 group ASPs
55 {
56 //***********************************************************************
57 //* ASP type definitions *
58 //* Note, that ASP types shall be TTCN-3 definitions to allow *
59 //* the use of anytype in the data field *
60 //***********************************************************************
61
62 type record MTP3_Field_sio
63 {
64 bitstring ni length(2),
65 bitstring prio length(2),
66 bitstring si length(4)
67 } with { variant "FIELDORDER(msb)";
68 };
69
70 type record ASP_MTP3_TRANSFERind
71 {
72 MTP3_Field_sio sio,
73 integer opc,
74 integer dpc,
75 integer sls,
76 octetstring data
77 } with { variant (opc) "BYTEORDER(last), FIELDLENGTH(32)";
78 variant (dpc) "BYTEORDER(last), FIELDLENGTH(32)";
79 variant (sls) "FIELDLENGTH(8)"
80 };
81
82 type record ASP_MTP3_PAUSE {};
83
84 type record ASP_MTP3_RESUME {};
85
86 type record ASP_MTP3_STATUS {};
87
88 type record ASP_MTP3_TRANSFERreq
89 {
90 MTP3_Field_sio sio,
91 integer opc,
92 integer dpc,
93 integer sls,
94 octetstring data
95 } with { variant (opc) "BYTEORDER(last), FIELDLENGTH(32)";
96 variant (dpc) "BYTEORDER(last), FIELDLENGTH(32)";
97 variant (sls) "FIELDLENGTH(8)"
98 };
99 }//end group ASPs
100
101 //***********************************************************************
102 //* Type definition of the message which is sent between MTP3 test port *
103 //* and SCTP server over TCP. *
104 //***********************************************************************
105 group MTP3_SCTPserver
106 {
107 type record ASP_REGISTER_M3UA
108 {
109 integer ni (0..3),
110 integer sut_pc,
111 integer tester_pc,
112 integer m3ua_version,
113 charstring entity
114 } with { variant (ni) "FIELDLENGTH(8)";
115 variant (sut_pc) "BYTEORDER(last), FIELDLENGTH(32)";
116 variant (tester_pc) "BYTEORDER(last), FIELDLENGTH(32)";
117 variant (m3ua_version) "FIELDLENGTH(8)"
118 };
119
120
121 // Possible values:
122 // MTP3_to_SCTPserver_data/status:
123 const integer reg_ok_status := 0;
124 const integer reg_error_status := 1;
125 const integer unreg_ok_status := 2;
126 const integer unreg_error_status := 3;
127
128 const integer send_error_status := 5;
129 const integer kill_status := 255;
130
131 // MTP3_to_SCTPserver_data/pause:
132 const integer SCTP_COMLOST_pause := 0;
133 const integer M3UA_ASPDN_pause := 1;
134 const integer M3UA_ASPIA_pause := 2;
135
136 // MTP3_to_SCTPserver_data/resume:
137 const integer ok_resume := 0;
138
139 type union MTP3_to_SCTPserver_data
140 {
141 ASP_MTP3_TRANSFERind transfer_ind,
142 ASP_MTP3_TRANSFERreq transfer_req,
143 ASP_REGISTER_M3UA register,
144 integer unregister (0..255),
145 integer status (0..255),
146 integer pause (0..255),
147 integer resume (0..255)
148 }
149
150 // MTP3_to_M3UAserver_msg/msgType:
151 const integer transfer_ind_msgType := 0;
152 const integer transfer_req_msgType := 1;
153 const integer register_msgType := 2;
154 const integer unregister_msgType := 3;
155 const integer status_msgType := 4;
156 const integer pause_msgType := 5;
157 const integer resume_msgType := 6;
158
159 type record MTP3_to_M3UAserver_msg
160 {
161 integer msgType (0..255),
162 integer msgLength,
163 MTP3_to_SCTPserver_data data
164 } with { variant (data) "CROSSTAG(
165 transfer_ind, msgType = transfer_ind_msgType;
166 transfer_req, msgType = transfer_req_msgType;
167 register, msgType = register_msgType;
168 unregister, msgType = unregister_msgType;
169 status, msgType = status_msgType;
170 pause, msgType = pause_msgType;
171 resume, msgType = resume_msgType )";
172 variant (msgLength) "FIELDLENGTH(32)";
173 variant (msgLength) "LENGTHTO(msgType,msgLength,data)";
174 variant (msgLength) "BYTEORDER(last)"
175 };
176 }//end group MTP3_SCTPserver
177 }//end group Messagetypes
178} with {encode "RAW"}//Types
179
180group Templates
181{
182 group MessageTemplates
183 {
184 group ASPtemplates
185 {
186 // *******************************************************************
187 // * ASP template definitions *
188 // *******************************************************************
189
190 // Base templates
191 // These general templates can be used as an example or as a base
192 // template for other templates.
193 template ASP_MTP3_TRANSFERind t_ASP_MTP3_TRANSFERind
194 (
195 template MTP3_Field_sio pl_SIO,
196 template integer pl_OPC,
197 template integer pl_DPC,
198 template integer pl_SLS,
199 template octetstring pl_data
200 ):=
201 {
202 sio := pl_SIO,
203 opc := pl_OPC,
204 dpc := pl_DPC,
205 sls := pl_SLS,
206 data := pl_data
207 }
208
209 template ASP_MTP3_TRANSFERind tr_ASP_MTP3_TRANSFERind_sio
210 (
211 template bitstring pl_NI,
212 template bitstring pl_PRIO,
213 template bitstring pl_SI,
214 template integer pl_OPC,
215 template integer pl_DPC,
216 template integer pl_SLS,
217 template octetstring pl_data
218 ):=
219 {
220 sio :=
221 {
222 ni := pl_NI,
223 prio := pl_PRIO,
224 si := pl_SI
225 },
226 opc := pl_OPC,
227 dpc := pl_DPC,
228 sls := pl_SLS,
229 data := pl_data
230 }
231
232 template ASP_MTP3_TRANSFERind tr_ASP_MTP3_TRANSFERind :=
233 {
234 sio := ?,
235 opc := ?,
236 dpc := ?,
237 sls := ?,
238 data := ?
239 }
240
241 template ASP_MTP3_TRANSFERreq t_ASP_MTP3_TRANSFERreq
242 (
243 MTP3_Field_sio pl_SIO,
244 integer pl_OPC,
245 integer pl_DPC,
246 integer pl_SLS,
247 octetstring pl_data
248 ):=
249 {
250 sio := pl_SIO,
251 opc := pl_OPC,
252 dpc := pl_DPC,
253 sls := pl_SLS,
254 data := pl_data
255 }
256
257 template ASP_MTP3_TRANSFERreq tr_ASP_MTP3_TRANSFERreq_sio
258 (
259 template bitstring pl_NI,
260 template bitstring pl_PRIO,
261 template bitstring pl_SI,
262 template integer pl_OPC,
263 template integer pl_DPC,
264 template integer pl_SLS,
265 template octetstring pl_data
266 ):=
267 {
268 sio :=
269 {
270 ni := pl_NI,
271 prio := pl_PRIO,
272 si := pl_SI
273 },
274 opc := pl_OPC,
275 dpc := pl_DPC,
276 sls := pl_SLS,
277 data := pl_data
278 }
279
280 template ASP_MTP3_TRANSFERreq tr_ASP_MTP3_TRANSFERreq :=
281 {
282 sio := ?,
283 opc := ?,
284 dpc := ?,
285 sls := ?,
286 data := ?
287 }
288
289 template ASP_MTP3_TRANSFERind tr_ASP_MTP3_TRANSFERind_stc :=
290 {
291 sio :=
292 {
293 ni := '00'B,
294 prio := '00'B,
295 si := '0000'B
296 },
297 opc := 0,
298 dpc := 0,
299 sls := 0,
300 data := ?
301 }
302
303 template ASP_MTP3_TRANSFERreq t_ASP_MTP3_TRANSFERreq_stc
304 ( template octetstring pl_data ):=
305 {
306 sio :=
307 {
308 ni := '00'B,
309 prio := '00'B,
310 si := '0000'B
311 },
312 opc := 0,
313 dpc := 0,
314 sls := 0,
315 data := pl_data
316 }
317
318 }//end group ASPtemplates
319 }//end group Messagetemplates
320}//end group Templates
321
322}//end module
323
324