blob: 4ecfa5490aa7eae3b31fa3e91c6499dede696486 [file] [log] [blame]
Harald Weltea814f262017-07-24 13:21:35 +02001///////////////////////////////////////////////////////////////////////////////
2// //
3// Copyright Test Competence Center (TCC) ETH 2016 //
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) has been supplied. //
9// //
10///////////////////////////////////////////////////////////////////////////////
11//
12// File: MobileL3_SMS_Types.ttcn
13// Rev: R1B
14// Prodnr: CNL 113 832
15// Contact: http://ttcn.ericsson.se
16// Reference: 3GPP TS 24.008 v13.4.0, 24.011 v13.0.0, 23.040 v13.0.0
17
18module MobileL3_SMS_Types
19{
20// beginning of module
21
22// This module contains the SMS Messages defined in 24.011 v13.0.0,
23// 23.040 v13.0.0 and 23.038 v7.0.0
24// This includes the C-PDUs, R-PDUs and T-PDUs with attributes for
25// RAW encoding/decoding.
26
27
28import from General_Types all;
29
30external function enc_TPDU_RP_DATA_MS_SGSN_fast(in TPDU_RP_DATA_MS_SGSN pdu, out octetstring stream)
31with { extension "prototype(fast)" extension "encode(RAW)" }
32
33external function dec_TPDU_RP_DATA_MS_SGSN_backtrack(in octetstring stream, out TPDU_RP_DATA_MS_SGSN pdu) return integer
34with { extension "prototype(backtrack)" extension "decode(RAW)" }
35
36external function enc_TPDU_RP_DATA_SGSN_MS_fast(in TPDU_RP_DATA_SGSN_MS pdu, out octetstring stream)
37with { extension "prototype(fast)" extension "encode(RAW)" }
38
39external function dec_TPDU_RP_DATA_SGSN_MS_backtrack(in octetstring stream, out TPDU_RP_DATA_SGSN_MS pdu) return integer
40with { extension "prototype(backtrack)" extension "decode(RAW)" }
41
42external function enc_TPDU_RP_ACK_MS_SGSN_fast(in TPDU_RP_ACK_MS_SGSN pdu, out octetstring stream)
43with { extension "prototype(fast)" extension "encode(RAW)" }
44
45external function dec_TPDU_RP_ACK_MS_SGSN_backtrack(in octetstring stream, out TPDU_RP_ACK_MS_SGSN pdu) return integer
46with { extension "prototype(backtrack)" extension "decode(RAW)" }
47
48external function enc_TPDU_RP_ACK_SGSN_MS_fast(in TPDU_RP_ACK_SGSN_MS pdu, out octetstring stream)
49with { extension "prototype(fast)" extension "encode(RAW)" }
50
51external function dec_TPDU_RP_ACK_SGSN_MS_backtrack(in octetstring stream, out TPDU_RP_ACK_SGSN_MS pdu) return integer
52with { extension "prototype(backtrack)" extension "decode(RAW)" }
53
54external function enc_TPDU_RP_ERROR_MS_SGSN_fast(in TPDU_RP_ERROR_MS_SGSN pdu, out octetstring stream)
55with { extension "prototype(fast)" extension "encode(RAW)" }
56
57external function dec_TPDU_RP_ERROR_MS_SGSN_backtrack(in octetstring stream, out TPDU_RP_ERROR_MS_SGSN pdu) return integer
58with { extension "prototype(backtrack)" extension "decode(RAW)" }
59
60external function enc_TPDU_RP_ERROR_SGSN_MS_fast(in TPDU_RP_ERROR_SGSN_MS pdu, out octetstring stream)
61with { extension "prototype(fast)" extension "encode(RAW)" }
62
63external function dec_TPDU_RP_ERROR_SGSN_MS_backtrack(in octetstring stream, out TPDU_RP_ERROR_SGSN_MS pdu) return integer
64with { extension "prototype(backtrack)" extension "decode(RAW)" }
65
66external function enc_RPDU_SGSN_MS_fast(in RPDU_SGSN_MS pdu, out octetstring stream)
67with { extension "prototype(fast)" extension "encode(RAW)" }
68
69external function dec_RPDU_SGSN_MS_backtrack(in octetstring stream, out RPDU_SGSN_MS pdu) return integer
70with { extension "prototype(backtrack)" extension "decode(RAW)" }
71
72external function enc_RPDU_MS_SGSN_fast(in RPDU_MS_SGSN pdu, out octetstring stream)
73with { extension "prototype(fast)" extension "encode(RAW)" }
74
75external function dec_RPDU_MS_SGSN_backtrack(in octetstring stream, out RPDU_MS_SGSN pdu) return integer
76with { extension "prototype(backtrack)" extension "decode(RAW)" }
77//==============================================================================
78// 24.011 7.2 CP-MESSAGES (CP_DATA, CP_ACK, CP_ERROR)
79//==============================================================================
80
81// 7.2
82type union L3_SMS_MS_SGSN
83{
84 CP_DATA_MS_SGSN cP_DATA,
85 CP_ACK cP_ACK,
86 CP_ERROR cP_ERROR
87};
88
89// 7.2
90type union L3_SMS_SGSN_MS
91{
92 CP_DATA_SGSN_MS cP_DATA,
93 CP_ACK cP_ACK,
94 CP_ERROR cP_ERROR
95};
96
97// 7.2.1 CP-DATA
98type record CP_DATA_MS_SGSN
99{
100 BIT8 cP_messageType,
101 CP_User_DataLV_MS_SGSN cP_User_Data
102} with { variant "PRESENCE(cP_messageType = '00000001'B)"; };
103
104// 7.2.1 CP-DATA
105type record CP_DATA_SGSN_MS
106{
107 BIT8 cP_messageType,
108 CP_User_DataLV_SGSN_MS cP_User_Data
109} with { variant "PRESENCE(cP_messageType = '00000001'B)"; };
110
111// 7.2.2 CP-ACK
112type record CP_ACK
113{
114 BIT8 cP_messageType
115} with { variant "PRESENCE(cP_messageType = '00000100'B)"; };
116
117// 7.2.3 CP-ERROR
118type record CP_ERROR
119{
120 BIT8 cP_messageType,
121 CP_CauseV cP_Cause
122} with { variant "PRESENCE(cP_messageType = '00010000'B)"; };
123
124// 7.2.1 CP-DATA
125type record CP_User_DataLV_SGSN_MS
126{
127 LIN1 lengthIndicator,
128 RPDU_SGSN_MS cP_RPDU
129} with { variant (lengthIndicator) "LENGTHTO (cP_RPDU)"};
130
131// 7.2.1 CP-DATA
132type record CP_User_DataLV_MS_SGSN
133{
134 LIN1 lengthIndicator,
135 RPDU_MS_SGSN cP_RPDU
136} with { variant (lengthIndicator) "LENGTHTO (cP_RPDU)"};
137
138// 7.2.3 CP-ERROR
139type record CP_CauseV
140{
141 OCT1 causeValue
142}
143
144
145//=============================================================================
146// END OF CP-MESSAGES
147//=============================================================================
148
149
150//=============================================================================
151// 24.011 7.3 RP-MESSAGES (RP-DATA, RP-SMMA, RP-ACK, RP-ERROR)
152//=============================================================================
153// 7.3
154type union RPDU_SGSN_MS
155{
156 RP_DATA_SGSN_MS rP_DATA_SGSN_MS,
157 RP_ACK_SGSN_MS rP_ACK_SGSN_MS,
158 RP_ERROR_SGSN_MS rP_ERROR_SGSN_MS,
159 RP_SMMA rP_SMMA // RP_SMMA included for negative testing in SGSN_MS direction
160} with {
161 variant "TAG
162 (
163 rP_DATA_SGSN_MS, rP_MTI = '001'B;
164 rP_ACK_SGSN_MS, rP_MTI = '011'B;
165 rP_ERROR_SGSN_MS, rP_MTI = '101'B;
166 rP_SMMA, rP_MTI = '110'B;
167 )"
168};
169
170// 7.3
171type union RPDU_MS_SGSN
172{
173 RP_DATA_MS_SGSN rP_DATA_MS_SGSN,
174 RP_ACK_MS_SGSN rP_ACK_MS_SGSN,
175 RP_ERROR_MS_SGSN rP_ERROR_MS_SGSN,
176 RP_SMMA rP_SMMA
177} with {
178 variant "TAG
179 (
180 rP_DATA_MS_SGSN, rP_MTI = '000'B;
181 rP_ACK_MS_SGSN, rP_MTI = '010'B;
182 rP_ERROR_MS_SGSN, rP_MTI = '100'B;
183 rP_SMMA, rP_MTI = '110'B;
184 )"
185};
186
187// 7.3.1.2 RP-DATA (Mobile Station to Network)
188type record RP_DATA_MS_SGSN
189{
190 BIT3 rP_MTI,
191 BIT5 rP_Spare, // '00000'B
192 OCT1 rP_MessageReference,
193 RP_OriginatorAddressLV rP_OriginatorAddress,
194 RP_DestinationAddressLV rP_DestinationAddress,
195 RP_DATA_User_DataLV_MS_SGSN rP_User_Data
196} with { variant "PRESENCE(rP_MTI = '000'B)"; };
197
198// 7.3.1.1 RP-DATA (Network to Mobile Station)
199type record RP_DATA_SGSN_MS
200{
201 BIT3 rP_MTI,
202 BIT5 rP_Spare, // '00000'B
203 OCT1 rP_MessageReference,
204 RP_OriginatorAddressLV rP_OriginatorAddress,
205 RP_DestinationAddressLV rP_DestinationAddress,
206 RP_DATA_User_DataLV_SGSN_MS rP_User_Data
207} with { variant "PRESENCE(rP_MTI = '001'B)"; };
208
209// 7.3.2 RP-SMMA
210type record RP_SMMA
211{
212 BIT3 rP_MTI,
213 BIT5 rP_Spare, // '00000'B
214 OCT1 rP_MessageReference
215} with { variant "PRESENCE(rP_MTI = '110'B)"; };
216
217// 7.3.3 RP-ACK
218type record RP_ACK_SGSN_MS
219{
220 BIT3 rP_MTI,
221 BIT5 rP_Spare, // '00000'B
222 OCT1 rP_MessageReference,
223 RP_ACK_User_DataTLV_SGSN_MS rP_User_Data optional
224} with { variant "PRESENCE(rP_MTI = '011'B)"; };
225
226// 7.3.3 RP-ACK
227type record RP_ACK_MS_SGSN
228{
229 BIT3 rP_MTI,
230 BIT5 rP_Spare, // '00000'B
231 OCT1 rP_MessageReference,
232 RP_ACK_User_DataTLV_MS_SGSN rP_User_Data optional
233} with { variant "PRESENCE(rP_MTI = '010'B)"; };
234
235// 7.3.4 RP-ERROR
236type record RP_ERROR_SGSN_MS
237{
238 BIT3 rP_MTI,
239 BIT5 rP_Spare, // '00000'B
240 OCT1 rP_Message_Reference,
241 RP_CauseLV rP_CauseLV,
242 RP_ERROR_User_DataTLV_SGSN_MS rP_User_Data optional
243} with { variant "PRESENCE(rP_MTI = '101'B)"; };
244
245// 7.3.4 RP-ERROR
246type record RP_ERROR_MS_SGSN
247{
248 BIT3 rP_MTI,
249 BIT5 rP_Spare, // '00000'B
250 OCT1 rP_Message_Reference,
251 RP_CauseLV rP_CauseLV,
252 RP_ERROR_User_DataTLV_MS_SGSN rP_User_Data optional
253} with { variant "PRESENCE(rP_MTI = '100'B)"; };
254
255// 8.2.5.1 Originator address element
256type record RP_OriginatorAddressLV
257{
258 LIN1 lengthIndicator,
259 RP_NumberingPlan_and_NumberDigits rP_OriginatorAddress optional
260} with {variant(lengthIndicator)"LENGTHTO (rP_OriginatorAddress)"};
261
262
263// 8.2.5.2 Destination address element
264type record RP_DestinationAddressLV
265{
266 LIN1 lengthIndicator,
267 RP_NumberingPlan_and_NumberDigits rP_DestinationAddress optional
268} with { variant (lengthIndicator)"LENGTHTO (rP_DestinationAddress)"};
269
270// 8.2.5.1 & 8.2.5.2 Originator address element
271type record RP_NumberingPlan_and_NumberDigits
272{
273 BIT4 rP_NumberingPlanIdentification,
274 BIT3 rP_TypeOfNumber,
275 BIT1 rP_Ext,
276 hexstring rP_NumberDigits length (1..20)
277} with { variant "PADDING(yes)";
278 variant "PADDING_PATTERN('1111'B)"};
279
280
281// 8.2.5.4 RP-Cause element
282type record RP_CauseLV
283{
284 LIN1 rP_LengthIndicator,
285 RP_CauseV rP_CauseV,
286 OCT1 rP_diagnisticField optional
287} with { variant (rP_LengthIndicator)"LENGTHTO (rP_CauseV,rP_diagnisticField)"};
288
289// 8.2.5.4 RP-Cause
290type record RP_CauseV
291{
292 BIT7 causeValue,
293 BIT1 ext //'0'B
294}
295
296// 8.2.5.3 RP-User data element
297type record RP_DATA_User_DataLV_SGSN_MS
298{
299 LIN1 rP_LengthIndicator,
300 TPDU_RP_DATA_SGSN_MS rP_TPDU
301} with { variant (rP_LengthIndicator) "LENGTHTO (rP_TPDU)"};
302
303// 8.2.5.3 RP-User data element
304type record RP_DATA_User_DataLV_MS_SGSN
305{
306 LIN1 rP_LengthIndicator,
307 TPDU_RP_DATA_MS_SGSN rP_TPDU
308} with { variant (rP_LengthIndicator) "LENGTHTO (rP_TPDU)"};
309
310// 8.2.5.3 RP-User data element
311type record RP_ACK_User_DataTLV_SGSN_MS
312{
313 BIT1 rP_Spare,
314 BIT7 rP_UserDataIEI,
315 LIN1 rP_LengthIndicator,
316 TPDU_RP_ACK_SGSN_MS rP_TPDU
317} with { variant "PRESENCE(rP_UserDataIEI = '1000001'B)";
318 variant (rP_Spare,rP_UserDataIEI) "FIELDORDER(msb)";
319 variant (rP_LengthIndicator) "LENGTHTO (rP_TPDU)"};
320
321// 8.2.5.3 RP-User data element
322type record RP_ACK_User_DataTLV_MS_SGSN
323{
324 BIT1 rP_Spare,
325 BIT7 rP_UserDataIEI,
326 LIN1 rP_LengthIndicator,
327 TPDU_RP_ACK_MS_SGSN rP_TPDU
328} with { variant "PRESENCE(rP_UserDataIEI = '1000001'B)";
329 variant (rP_Spare,rP_UserDataIEI) "FIELDORDER(msb)";
330 variant (rP_LengthIndicator) "LENGTHTO (rP_TPDU)"};
331
332// 8.2.5.3 RP-User data element
333type record RP_ERROR_User_DataTLV_SGSN_MS
334{
335 BIT1 rP_Spare,
336 BIT7 rP_UserDataIEI,
337 LIN1 rP_LengthIndicator,
338 TPDU_RP_ERROR_SGSN_MS rP_TPDU
339} with { variant "PRESENCE(rP_UserDataIEI = '1000001'B)";
340 variant (rP_Spare,rP_UserDataIEI) "FIELDORDER(msb)";
341 variant (rP_LengthIndicator) "LENGTHTO (rP_TPDU)"};
342
343// 8.2.5.3 RP-User data element
344type record RP_ERROR_User_DataTLV_MS_SGSN
345{
346 BIT1 rP_Spare,
347 BIT7 rP_UserDataIEI,
348 LIN1 rP_LengthIndicator,
349 TPDU_RP_ERROR_MS_SGSN rP_TPDU
350} with { variant "PRESENCE(rP_UserDataIEI = '1000001'B)";
351 variant (rP_Spare,rP_UserDataIEI) "FIELDORDER(msb)";
352 variant (rP_LengthIndicator) "LENGTHTO (rP_TPDU)"};
353
354
355type union TPDU_RP_DATA_MS_SGSN
356{
357 SMS_SUBMIT sMS_SUBMIT,
358 SMS_COMMAND sMS_COMMAND
359} with {
360 variant "TAG
361 (
362 sMS_SUBMIT, tP_MTI = '01'B;
363 sMS_COMMAND, tP_MTI = '10'B;
364 )"
365};
366
367
368type union TPDU_RP_DATA_SGSN_MS
369{
370 SMS_DELIVER sMS_DELIVER,
371 SMS_STATUS_REPORT sMS_STATUS_REPORT
372} with {
373 variant "TAG
374 (
375 sMS_DELIVER, tP_MTI = '00'B;
376 sMS_STATUS_REPORT, tP_MTI = '10'B;
377 )"
378};
379
380
381type union TPDU_RP_ACK_MS_SGSN
382{
383 SMS_DELIVER_REPORT_in_RP_ACK sMS_DELIVER_REPORT
384} with {
385 variant "TAG
386 (
387 sMS_DELIVER_REPORT, tP_MTI = '00'B;
388 )"
389};
390
391
392type union TPDU_RP_ACK_SGSN_MS
393{
394 SMS_SUBMIT_REPORT_in_RP_ACK sMS_SUBMIT_REPORT
395} with {
396 variant "TAG
397 (
398 sMS_SUBMIT_REPORT, tP_MTI = '01'B;
399 )"
400};
401
402
403type union TPDU_RP_ERROR_MS_SGSN
404{
405 SMS_DELIVER_REPORT_in_RP_ERROR sMS_DELIVER_REPORT
406} with {
407 variant "TAG
408 (
409 sMS_DELIVER_REPORT, tP_MTI = '00'B;
410 )"
411};
412
413
414type union TPDU_RP_ERROR_SGSN_MS
415{
416 SMS_SUBMIT_REPORT_in_RP_ERROR sMS_SUBMIT_REPORT
417} with {
418 variant "TAG
419 (
420 sMS_SUBMIT_REPORT, tP_MTI = '01'B;
421 )"
422};
423
424
425//================================================================
426// END OF RP-MESSAGES
427//================================================================
428
429
430//================================================================
431// TPDUs 23.040 9.2.2
432// (SMS_DELIVER, SMS_DELIVER_REPORT, SMS_SUBMIT, SMS_SUBMIT_REPORT,
433// SMS_STATUS_REPORT, SMS_COMMAND)
434//================================================================
435
436// 23.040 9.2.2.1
437type record SMS_DELIVER
438{
439 BIT2 tP_MTI,
440 BIT1 tP_MMS,
441 BIT1 tP_LP,
442 BIT1 tP_Spare, //00
443 BIT1 tP_SRI,
444 BIT1 tP_UDHI,
445 BIT1 tP_RP,
446
447 TP_OA tP_OA,
448
449 OCT1 tP_PID,
450
451 TP_DCS tP_DCS,
452 //See 23.038 Section 4 for encoding tP_DCS
453 OCT7 tP_SCTS,
454
455 TP_UDL_UD tP_UDL_UD
456} with { variant "PRESENCE(tP_MTI = '00'B)"; };
457
458// 23.040 9.2.2.1a(i)
459type record SMS_DELIVER_REPORT_in_RP_ERROR
460{
461 BIT2 tP_MTI,
462 BIT4 tP_Spare1, //'0000'B
463 BIT1 tP_UDHI,
464 BIT1 tP_Spare2, //'0'B
465
466 OCT1 tP_FCS,
467
468 BIT1 tP_PresenceBitTP_PID,
469 BIT1 tP_PresenceBitTP_DCS,
470 BIT1 tP_PresenceBitTP_UDL,
471 BIT4 tP_Reserved,
472 BIT1 tP_ExtensionBit,
473 // note:current implementation PID is 1 octet ->tP_extensionBit=0
474 OCT1 tP_PID optional,
475 //See 23.038 for encoding tP_DCS
476 TP_DCS tP_DCS optional,
477
478 TP_UDL_UD tP_UDL_UD optional
479} with { variant "PRESENCE(tP_MTI = '00'B)";
480 variant (tP_PID) "PRESENCE(tP_PresenceBitTP_PID = '1'B)";
481 variant (tP_DCS) "PRESENCE(tP_PresenceBitTP_DCS = '1'B)";
482 variant (tP_UDL_UD) "PRESENCE(tP_PresenceBitTP_UDL = '1'B)"};
483
484// 23.040 9.2.2.1a(ii)
485type record SMS_DELIVER_REPORT_in_RP_ACK
486{
487 BIT2 tP_MTI,
488 BIT4 tP_Spare1, //'0000'B
489 BIT1 tP_UDHI,
490 BIT1 tP_Spare2, //'0'B
491
492 BIT1 tP_PresenceBitTP_PID,
493 BIT1 tP_PresenceBitTP_DCS,
494 BIT1 tP_PresenceBitTP_UDL,
495 BIT4 tP_Reserved,
496 BIT1 tP_ExtensionBit,
497 // note:current implementation PID is 1 octet ->tP_extensionBit=0
498 OCT1 tP_PID optional,
499 //See 23.038 for encoding tP_DCS
500 TP_DCS tP_DCS optional,
501
502 TP_UDL_UD tP_UDL_UD optional
503} with { variant "PRESENCE(tP_MTI = '00'B)";
504 variant (tP_PID) "PRESENCE(tP_PresenceBitTP_PID = '1'B)";
505 variant (tP_DCS) "PRESENCE(tP_PresenceBitTP_DCS = '1'B)";
506 variant (tP_UDL_UD) "PRESENCE(tP_PresenceBitTP_UDL = '1'B)"};
507
508// 23.040 9.2.2.2
509type record SMS_SUBMIT
510{
511 BIT2 tP_MTI,
512 BIT1 tP_RD,
513 BIT2 tP_VPF,
514 BIT1 tP_SRR,
515 BIT1 tP_UDHI,
516 BIT1 tP_RP,
517 OCT1 tP_MR,
518
519 TP_DA tP_DA,
520
521 OCT1 tP_PID,
522 //See 23.038 for encoding tP_DCS
523 TP_DCS tP_DCS,
524
525 TP_VP tP_VP optional, // depends on tP_VPF
526
527 TP_UDL_UD tP_UDL_UD
528} with { variant "PRESENCE(tP_MTI = '01'B)";
529 variant (tP_VP)"CROSSTAG(
530// tP_VP_not_present, tP_VPF='00'B;
531 tP_VP_relative_format, tP_VPF='10'B;
532 tP_VP_enhanced_format, tP_VPF='01'B;
533 tP_VP_absolute_format, tP_VPF='11'B
534 )";
535 variant (tP_VP) "PRESENCE(tP_VPF='10'B, tP_VPF='01'B, tP_VPF='11'B)"
536 };
537
538// 23.040 9.2.2.2a (i)
539type record SMS_SUBMIT_REPORT_in_RP_ERROR // for RP_Error
540{
541 BIT2 tP_MTI,
542 BIT4 tP_Spare1,
543 BIT1 tP_UDHI,
544 BIT1 tP_Spare2,
545
546 OCT1 tP_FCS,
547
548 BIT1 tP_PresenceBitTP_PID,
549 BIT1 tP_PresenceBitTP_DCS,
550 BIT1 tP_PresenceBitTP_UDL,
551 BIT4 tP_Reserved,
552 BIT1 tP_ExtensionBit,
553 // note:current implementation PID is 1 octet ->tP_extensionBit=0
554
555 OCT7 tP_SCTS,
556
557 OCT1 tP_PID optional,
558 //See 23.038 for encoding tP_DCS
559 TP_DCS tP_DCS optional,
560
561 TP_UDL_UD tP_UDL_UD optional
562} with { variant "PRESENCE(tP_MTI = '01'B)";
563 variant (tP_PID) "PRESENCE(tP_PresenceBitTP_PID = '1'B)";
564 variant (tP_DCS) "PRESENCE(tP_PresenceBitTP_DCS = '1'B)";
565 variant (tP_UDL_UD) "PRESENCE(tP_PresenceBitTP_UDL = '1'B)"}
566
567// 23.040 9.2.2.2a (ii)
568type record SMS_SUBMIT_REPORT_in_RP_ACK // for RP_ACK
569{
570 BIT2 tP_MTI,
571 BIT4 tP_Spare1,
572 BIT1 tP_UDHI,
573 BIT1 tP_Spare2,
574
575 BIT1 tP_PresenceBitTP_PID,
576 BIT1 tP_PresenceBitTP_DCS,
577 BIT1 tP_PresenceBitTP_UDL,
578 BIT4 tP_Reserved,
579 BIT1 tP_ExtensionBit,
580 // note:current implementation PID is 1 octet ->tP_extensionBit=0
581 OCT7 tP_SCTS,
582
583 OCT1 tP_PID optional,
584 //See 23.038 for encoding tP_DCS
585 TP_DCS tP_DCS optional,
586
587 TP_UDL_UD tP_UDL_UD optional
588} with { variant "PRESENCE(tP_MTI = '01'B)";
589 variant (tP_PID) "PRESENCE(tP_PresenceBitTP_PID = '1'B)";
590 variant (tP_DCS) "PRESENCE(tP_PresenceBitTP_DCS = '1'B)";
591 variant (tP_UDL_UD) "PRESENCE(tP_PresenceBitTP_UDL = '1'B)"}
592
593// 23.040 9.2.2.3
594type record SMS_STATUS_REPORT
595{
596 BIT2 tP_MTI,
597 BIT1 tP_MMS,
598 BIT1 tP_LP,
599 BIT1 tP_Spare1,
600 BIT1 tP_SRQ,
601 BIT1 tP_UDHI,
602 BIT1 tP_Spare2,
603
604 OCT1 tP_MR,
605
606 TP_RA tP_RA,
607
608 OCT7 tP_SCTS,
609
610 OCT7 tP_DT,
611
612 OCT1 tP_ST,
613
614 BIT1 tP_PresenceBitTP_PID optional,
615 BIT1 tP_PresenceBitTP_DCS optional,
616 BIT1 tP_PresenceBitTP_UDL optional,
617 BIT4 tP_Reserved optional,
618 BIT1 tP_ExtensionBit optional,
619 // note:current implementation PID is 1 octet ->tP_extensionBit=0
620 OCT1 tP_PID optional,
621
622 TP_DCS tP_DCS optional,
623 //See 23.038 for encoding tP_DCS
624 TP_UDL_UD tP_UDL_UD optional
625} with { variant "PRESENCE(tP_MTI = '10'B)";
626 variant (tP_PID) "PRESENCE(tP_PresenceBitTP_PID = '1'B)";
627 variant (tP_DCS) "PRESENCE(tP_PresenceBitTP_DCS = '1'B)";
628 variant (tP_UDL_UD) "PRESENCE(tP_PresenceBitTP_UDL = '1'B)"}
629
630// 23.040 9.2.2.4
631type record SMS_COMMAND
632{
633 BIT2 tP_MTI,
634 BIT3 tP_Spare1,
635 BIT1 tP_SRR,
636 BIT1 tP_UDHI,
637 BIT1 tP_Spare2,
638
639 OCT1 tP_MR,
640
641 OCT1 tP_PID,
642
643 OCT1 tP_CT,
644
645 OCT1 tP_MN,
646
647 TP_DA tP_DA,
648
649 TP_CDL_CD tP_CDL_CD
650} with { variant "PRESENCE(tP_MTI = '10'B)"; };
651//================================================================
652// END OF TPDUs 23.040 9.2.2
653//================================================================
654
655//================================================================
656// TPDU Parameters 23.040 9.2.3
657//================================================================
658type record TP_OA
659{
660 TP_OA_NoPad tP_OA_NoPad
661} with { variant "PADDING(yes), PADDING_PATTERN('1111'B)"};
662//Note: Padding is handled automatically here.
663
664type record TP_OA_NoPad
665{
666 LIN1 tP_LengthIndicator, //0-20
667 BIT4 tP_NumberingPlanID,
668 BIT3 tP_TypeOfNumber,
669 BIT1 tp_Spare,
670 hexstring tP_OAValue length (0..20)
671 // Note: tP_OAValue does not incude the padding half-octet.
672 // It includes only useful tP_OAValue digits.
673 // Padding after tP_OAValue digits is handled
674 // automatically and the tester does not see it in
675 // the TTCN templates
676} with { variant (tP_LengthIndicator) "LENGTHTO (tP_OAValue)";
677 variant (tP_LengthIndicator) "UNIT(4)";};
678
679type record TP_CDL_CD
680{
681 LIN1 tP_CDL, // length is possible
682 octetstring tP_CD
683} with { variant (tP_CDL) "LENGTHTO (tP_CD)"};
684
685type record TP_RA
686{
687 TP_RA_NoPad tP_RA_NoPad
688} with { variant "PADDING(yes), PADDING_PATTERN('1111'B)"};
689//Note: Padding is handled automatically here.
690
691type record TP_RA_NoPad
692{
693 LIN1 tP_LengthIndicator, //0-20
694 BIT4 tP_NumberingPlanID,
695 BIT3 tP_TypeOfNumber,
696 BIT1 tp_Spare,
697 hexstring tP_RAValue length (0..20)
698 // Note: tP_RAValue does not incude the padding half-octet.
699 // It includes only useful tP_RAValue digits.
700 // Padding after tP_RAValue digits is handled
701 // automatically and the tester does not see it in
702 // the TTCN templates
703} with { variant (tP_LengthIndicator) "LENGTHTO (tP_RAValue)";
704 variant (tP_LengthIndicator) "UNIT(4)";};
705
706type union TP_VP
707{
708// OCT0 tP_VP_not_present,
709 OCT1 tP_VP_relative_format,
710 OCT7 tP_VP_enhanced_format,
711 OCT7 tP_VP_absolute_format
712};
713
714type record TP_DA
715{
716 TP_DA_NoPad tP_DA_NoPad
717} with { variant "PADDING(yes), PADDING_PATTERN('1111'B)"};
718//Note: Padding is handled automatically here.
719
720type record TP_DA_NoPad
721{
722 LIN1 tP_LengthIndicator, //0-20
723 BIT4 tP_NumberingPlanID,
724 BIT3 tP_TypeOfNumber,
725 BIT1 tp_Spare,
726 hexstring tP_DAValue length (0..20)
727 // Note: tP_DAValue does not incude the padding half-octet.
728 // It includes only useful tP_DAValue digits.
729 // Padding after tP_DAValue digits is handled
730 // automatically and the tester does not see it in
731 // the TTCN templates
732} with { variant (tP_LengthIndicator) "LENGTHTO (tP_DAValue)";
733 variant (tP_LengthIndicator) "UNIT(4)"; };
734
735
736// Note that tP_LengthIndicator in TP_UDL_UD gives the data length in septets or
737// octets. Septets are used for uncompressed GSM 7 bit default alphabet coding
738// Octets are used for all other variations.
739// IT IS NOT CALCULATED AUTOMATICALLY BY THE RAW CODER.
740// This will not be a problem during decoding.
741// For encoding correct messages the tester has to enter manually
742// or calculate the correct tP_LengthIndicator with a function.
743// Note also that the septet or octet choice depends on the various
744// bit combinations in field TP_DCS. See 23.038 Section 4.
745type record TP_UDL_UD
746{
747 integer tP_LengthIndicator, // could be zero length
748 octetstring tP_UD
749}
750
751// See 23.038 for encoding TP_DCS
752// The various bit combinations in TP_DCS determine
753// the coding of TP_UDL_UD
754type OCT1 TP_DCS;
755
756//================================================================
757// END of TPDU Parameters 23.040 9.2.3
758//================================================================
759
760}//end of module
761with {
762extension "version R1B"
763encode "RAW"
764}
765