aboutsummaryrefslogtreecommitdiffstats
path: root/library/M3UA_Templates.ttcn
blob: 1063b501df79e4f76035dfc86aa503c538083bb6 (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
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
module M3UA_Templates {

/* M3UA Templates, building on top of M3UA_Types from Ericsson.
 *
 * (C) 2019 by Harald Welte <laforge@gnumonks.org>
 * All rights reserved.
 *
 * Released under the terms of GNU General Public License, Version 2 or
 * (at your option) any later version.
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

import from M3UA_Types all;
import from General_Types all;
import from Osmocom_Types all;

const OCT1 c_M3UA_VERSION := '01'O;

const OCT2 c_M3UA_ST_T_STATE_CHG := '0001'O;
const OCT2 c_M3UA_ST_I_RESERVED := '0001'O;
const OCT2 c_M3UA_ST_I_AS_INACTIVE := '0002'O;
const OCT2 c_M3UA_ST_I_AS_ACTIVE := '0003'O;
const OCT2 c_M3UA_ST_I_AS_PENDING := '0004'O;

const OCT2 c_M3UA_ST_T_OTHER := '0002'O;
const OCT2 c_M3UA_ST_I_INSUFF_RESRC := '0001'O
const OCT2 c_M3UA_ST_I_ALTERNATE_ASP := '0002'O
const OCT2 c_M3UA_ST_I_ASP_FAILUREP := '0003'O

private function f_aspid_or_omit(template (omit) OCT4 aspid)
return template (omit) M3UA_ASP_Identifier {
	var template (omit) M3UA_ASP_Identifier id;
	if (istemplatekind(aspid, "omit")) {
		return omit;
	} else {
		id.tag := '0011'O;
		id.lengthInd := 8;
		id.aSPIdentifier := aspid;
		return id;
	}
}

function tr_M3UA_asp_id(template OCT4 aspid)
return template M3UA_ASP_Identifier {
	var template M3UA_ASP_Identifier id := {
		tag := '0011'O,
		lengthInd := 8,
		aSPIdentifier := aspid
	};
	if (istemplatekind(aspid, "omit")) {
		return omit;
	} else if (istemplatekind(aspid, "*")) {
		return *;
	} else {
		return id;
	}
}


/***********************************************************************
 * ASPSM Class
 ***********************************************************************/

template (value) PDU_M3UA ts_M3UA_ASPUP(template (omit) OCT4 aspid := omit,
					template (omit) octetstring infostr := omit) := {
	m3UA_ASPUP := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0301'O,
		messageLength := 0, // overwritten
		messageParameters := {
			aSP_Identifier := f_aspid_or_omit(aspid),
			info_String := omit
		}
	}
}
template (present) PDU_M3UA tr_M3UA_ASPUP(template OCT4 aspid := *,
					  template octetstring infostr := omit) := {
	m3UA_ASPUP := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0301'O,
		messageLength := ?, // overwritten
		messageParameters := {
			aSP_Identifier := tr_M3UA_asp_id(aspid),
			info_String := *
		}
	}
}

template (value) PDU_M3UA ts_M3UA_ASPUP_ACK := {
	m3UA_ASPUP_Ack := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0304'O,
		messageLength := 0, // overwritten
		messageParameters := {
			info_String := omit
		}
	}
}
template (present) PDU_M3UA tr_M3UA_ASPUP_ACK := {
	m3UA_ASPUP_Ack := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0304'O,
		messageLength := ?,
		messageParameters := {
			info_String := *
		}
	}
}

template (value) PDU_M3UA ts_M3UA_ASPDN := {
	m3UA_ASPDN := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0302'O,
		messageLength := 0, // overwritten
		messageParameters := {
			info_String := omit
		}
	}
}
template (present) PDU_M3UA tr_M3UA_ASPDN := {
	m3UA_ASPDN := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0302'O,
		messageLength := ?,
		messageParameters := {
			info_String := *
		}
	}
}

template (value) PDU_M3UA ts_M3UA_ASPDN_ACK := {
	m3UA_ASPUP_Ack := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0305'O,
		messageLength := 0, // overwritten
		messageParameters := {
			info_String := omit
		}
	}
}
template (present) PDU_M3UA tr_M3UA_ASPDN_ACK := {
	m3UA_ASPUP_Ack := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0305'O,
		messageLength := ?,
		messageParameters := {
			info_String := *
		}
	}
}

template (value) M3UA_Heartbeat_Data ts_M3UA_hb_data(template (value) octetstring hb_data) := {
	tag := '0009'O,
	lengthInd := 0, // overwritten
	heartbeat_Data := hb_data
}

template (present) M3UA_Heartbeat_Data tr_M3UA_hb_data(template (present) octetstring hb_data) := {
	tag := '0009'O,
	lengthInd := ?,
	heartbeat_Data := hb_data
}

template (value) PDU_M3UA ts_M3UA_BEAT(template (omit) M3UA_Heartbeat_Data hbd := omit) := {
	m3UA_BEAT := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0303'O,
		messageLength := 0, // overwritten
		messageParameters := {
			heartbeat_Data := hbd
		}
	}
}
template (present) PDU_M3UA tr_M3UA_BEAT(template M3UA_Heartbeat_Data hbd := *) := {
	m3UA_BEAT := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0303'O,
		messageLength := ?,
		messageParameters := {
			heartbeat_Data := hbd
		}
	}
}

template (value) PDU_M3UA ts_M3UA_BEAT_ACK(template (omit) M3UA_Heartbeat_Data hb_data)  := {
	m3UA_BEAT_Ack := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0306'O,
		messageLength := 0, // overwritten
		messageParameters := {
			heartbeat_Data := hb_data
		}
	}
}
template (present) PDU_M3UA tr_M3UA_BEAT_ACK(template M3UA_Heartbeat_Data hb_data := *) := {
	m3UA_BEAT_Ack := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0306'O,
		messageLength := ?,
		messageParameters := {
			heartbeat_Data := hb_data
		}
	}
}




/***********************************************************************
 * ASPTM Class
 ***********************************************************************/


const M3UA_Traffic_Mode_Type c_M3UA_TMT_override := {
	tag := '000B'O,
	lengthInd := 8,
	trafficModeType := int2oct(1, 4)
}

const M3UA_Traffic_Mode_Type c_M3UA_TMT_loadshare := {
	tag := '000B'O,
	lengthInd := 8,
	trafficModeType := int2oct(2, 4)
}

const M3UA_Traffic_Mode_Type c_M3UA_TMT_broadcast := {
	tag := '000B'O,
	lengthInd := 8,
	trafficModeType := int2oct(3, 4)
}

function ts_M3UA_routing_ctx(template (omit) octetstring rctx)
return template (omit) M3UA_Routing_Context {
	var template (omit) M3UA_Routing_Context id;
	if (istemplatekind(rctx, "omit")) {
		return omit;
	} else {
		id.tag := '0006'O;
		id.lengthInd := 0; // overwritten
		id.routingContext := rctx;
		return id;
	}
}

function tr_M3UA_routing_ctx(template octetstring rctx)
return template M3UA_Routing_Context {
	var template M3UA_Routing_Context id;
	if (istemplatekind(rctx, "omit")) {
		return omit;
	} else if (istemplatekind(rctx, "*")) {
		return *;
	} else {
		id.tag := '0006'O;
		id.lengthInd := ?;
		id.routingContext := rctx;
		return id;
	}
}

template (value) PDU_M3UA ts_M3UA_ASPAC(template (omit) M3UA_Traffic_Mode_Type tmt,
					template (omit) OCT4 rctx) := {
	m3UA_ASPAC := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0401'O,
		messageLength := 0, // overwritten
		messageParameters := {
			traffic_Mode_Type := tmt,
			routing_Context := ts_M3UA_routing_ctx(rctx),
			info_String := omit
		}
	}
}
template (present) PDU_M3UA tr_M3UA_ASPAC(template M3UA_Traffic_Mode_Type tmt,
					  template OCT4 rctx) := {
	m3UA_ASPAC := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0401'O,
		messageLength := ?,
		messageParameters := {
			traffic_Mode_Type := tmt,
			routing_Context := tr_M3UA_routing_ctx(rctx),
			info_String := *
		}
	}
}

template (value) PDU_M3UA ts_M3UA_ASPAC_ACK(template (omit) M3UA_Traffic_Mode_Type tmt,
					template (omit) OCT4 rctx) := {
	m3UA_ASPAC_Ack := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0403'O,
		messageLength := 0, // overwritten
		messageParameters := {
			traffic_Mode_Type := tmt,
			routing_Context := ts_M3UA_routing_ctx(rctx),
			info_String := omit
		}
	}
}
template (present) PDU_M3UA tr_M3UA_ASPAC_ACK(template M3UA_Traffic_Mode_Type tmt,
					      template OCT4 rctx) := {
	m3UA_ASPAC_Ack := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0403'O,
		messageLength := ?,
		messageParameters := {
			traffic_Mode_Type := tmt,
			routing_Context := tr_M3UA_routing_ctx(rctx),
			info_String := *
		}
	}
}

template (value) PDU_M3UA ts_M3UA_ASPIA(template (omit) OCT4 rctx) := {
	m3UA_ASPIA := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0402'O,
		messageLength := 0, // overwritten
		messageParameters := {
			routing_Context := ts_M3UA_routing_ctx(rctx),
			info_String := omit
		}
	}
}
template (present) PDU_M3UA tr_M3UA_ASPIA(template OCT4 rctx) := {
	m3UA_ASPIA := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0402'O,
		messageLength := ?,
		messageParameters := {
			routing_Context := tr_M3UA_routing_ctx(rctx),
			info_String := *
		}
	}
}


template (value) PDU_M3UA ts_M3UA_ASPIA_ACK(template (omit) OCT4 rctx) := {
	m3UA_ASPIA_Ack := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0404'O,
		messageLength := 0, // overwritten
		messageParameters := {
			routing_Context := ts_M3UA_routing_ctx(rctx),
			info_String := omit
		}
	}
}
template (present) PDU_M3UA tr_M3UA_ASPIA_ACK(template OCT4 rctx) := {
	m3UA_ASPIA_Ack := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0404'O,
		messageLength := ?,
		messageParameters := {
			routing_Context := tr_M3UA_routing_ctx(rctx),
			info_String := *
		}
	}
}


/***********************************************************************
 * MGMT Class
 ***********************************************************************/

template (value) M3UA_Error_Code ts_M3UA_err_code(template (value) OCT4 val) := {
	tag := '000C'O,
	lengthInd := 8,
	errorCode := val
}
template (present) M3UA_Error_Code tr_M3UA_err_code(template (present) OCT4 val) := {
	tag := '000C'O,
	lengthInd := 8,
	errorCode := val
}

template (value) M3UA_Status ts_M3UA_status(template (value) OCT2 status_type,
					    template (value) OCT2 status_info) := {
	tag := '000D'O,
	lengthInd := 8,
	statusType := status_type,
	statusInfo := status_info
}

template (present) M3UA_Status tr_M3UA_status(template (present) OCT2 status_type,
					      template (present) OCT2 status_info) := {
	tag := '000D'O,
	lengthInd := 8,
	statusType := status_type,
	statusInfo := status_info
}


template (value) PDU_M3UA ts_M3UA_ERR(template (value) OCT4 err_code,
				      template (omit) OCT4 rctx) := {
	m3UA_ERR := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0000'O,
		messageLength := 0, // overwritten
		messageParameters := {
			error_Code := ts_M3UA_err_code(err_code),
			routing_Context := ts_M3UA_routing_ctx(rctx),
			affected_Point_Codes := omit,
			network_Appearance := omit,
			diagnostic_information := omit
		}
	}
}
template (present) PDU_M3UA tr_M3UA_ERR(template (present) OCT4 err_code,
				      template OCT4 rctx) := {
	m3UA_ERR := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0000'O,
		messageLength := ?,
		messageParameters := {
			error_Code := tr_M3UA_err_code(err_code),
			routing_Context := tr_M3UA_routing_ctx(rctx),
			affected_Point_Codes := *,
			network_Appearance := *,
			diagnostic_information := *
		}
	}
}


template (value) PDU_M3UA ts_M3UA_NOTIFY(template (value) OCT2 status_type,
					 template (value) OCT2 status_info,
					 template (omit) OCT4 rctx,
					 template (omit) OCT4 aspid := omit,
					 template (omit) octetstring infostr := omit) := {
	m3UA_NOTIFY := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0001'O,
		messageLength := 0, // overwritten
		messageParameters := {
			status := ts_M3UA_status(status_type, status_info),
			aSP_Identifier := f_aspid_or_omit(aspid),
			routing_Context := ts_M3UA_routing_ctx(rctx),
			info_String := omit
		}
	}
}
template (present) PDU_M3UA tr_M3UA_NOTIFY(template (present) OCT2 status_type,
					   template (present) OCT2 status_info,
					   template OCT4 rctx,
					   template OCT4 aspid := *,
					   template octetstring infostr := *) := {
	m3UA_NOTIFY := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0001'O,
		messageLength := ?,
		messageParameters := {
			status := tr_M3UA_status(status_type, status_info),
			aSP_Identifier := *,
			routing_Context := tr_M3UA_routing_ctx(rctx),
			info_String := *
		}
	}
}

/***********************************************************************
 * Message Transfer Class
 ***********************************************************************/

template (value) M3UA_Protocol_Data ts_M3UA_protocol_data(template (value) OCT4 opc,
							  template (value) OCT4 dpc,
							  template (value) OCT1 si,
							  template (value) OCT1 ni,
							  template (value) OCT1 mp,
							  template (value) OCT1 sls,
							  template (value) octetstring data) := {
	tag := '0210'O,
	lengthInd := 0, // overwritten
	oPC := opc,
	dPC := dpc,
	sI := si,
	nI := ni,
	mP := mp,
	sLS := sls,
	userProtocolData := data
}
template (present) M3UA_Protocol_Data tr_M3UA_protocol_data(template (present) OCT4 opc,
							  template (present) OCT4 dpc,
							  template (present) OCT1 si,
							  template (present) OCT1 ni,
							  template (present) OCT1 mp,
							  template (present) OCT1 sls,
							  template (present) octetstring data) := {
	tag := '0210'O,
	lengthInd := ?,
	oPC := opc,
	dPC := dpc,
	sI := si,
	nI := ni,
	mP := mp,
	sLS := sls,
	userProtocolData := data
}


template (value) PDU_M3UA ts_M3UA_DATA(template (omit) OCT4 rctx,
				       template (value) M3UA_Protocol_Data data) := {
	m3UA_DATA := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0101'O,
		messageLength := 0, // overwritten
		messageParameters :={
			network_Appearance := omit,
			routing_Context := ts_M3UA_routing_ctx(rctx),
			protocol_Data := data,
			correlation_ID := omit
		}
	}
}
template (present) PDU_M3UA tr_M3UA_DATA(template OCT4 rctx,
				       template (present) M3UA_Protocol_Data data) := {
	m3UA_DATA := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0101'O,
		messageLength := ?, // overwritten
		messageParameters := {
			network_Appearance := *,
			routing_Context := tr_M3UA_routing_ctx(rctx),
			protocol_Data := data,
			correlation_ID := *
		}
	}
}

/***********************************************************************
 * Routing Key Management
 ***********************************************************************/

template (value) M3UA_Local_Routing_Key_Id ts_M3UA_lrkid(template (value) OCT4 id) := {
	tag := '020a'O,
	lengthInd := 8,
	localRkId := id
}

template (present) M3UA_Local_Routing_Key_Id tr_M3UA_lrkid(template (present) OCT4 id) := {
	tag := '020a'O,
	lengthInd := 8,
	localRkId := id
}


template (value) M3UA_Routing_Key ts_M3UA_rkey(OCT4 id, OCT3 dpc,
						template (omit) M3UA_Traffic_Mode_Type tmt := omit,
						template (omit) OCT4 rctx := omit) := {
	tag := '0207'O,
	lengthInd := 0, // overwritten
	routingKey := {
		local_Routing_Key_Id := ts_M3UA_lrkid(id),
		routing_Context := ts_M3UA_routing_ctx(rctx),
		traffic_Mode_Type := tmt,
		destination_Point_Code := {
			tag := '020b'O,
			lengthInd := 8,
			pointCode := { '00'O, dpc }
		},
		network_Appearance := omit,
		service_Indicators := omit,
		opc_List := omit
	}
}
template (present) M3UA_Routing_Key tr_M3UA_rkey(template (present) OCT4 id, template (present) OCT3 dpc,
						template M3UA_Traffic_Mode_Type tmt := *,
						template OCT4 rctx := *) := {
	tag := '0207'O,
	lengthInd := ?,
	routingKey := {
		local_Routing_Key_Id := tr_M3UA_lrkid(id),
		routing_Context := tr_M3UA_routing_ctx(rctx),
		traffic_Mode_Type := tmt,
		destination_Point_Code := {
			tag := '020b'O,
			lengthInd := 8,
			pointCode := { '00'O, dpc }
		},
		network_Appearance := omit,
		service_Indicators := omit,
		opc_List := omit
	}
}


const OCT4 c_M3UA_REGSTS_SUCCESS := '00000000'O;
const OCT4 c_M3UA_REGSTS_ERR_UNKNOWN := '00000001'O;
const OCT4 c_M3UA_REGSTS_ERR_INVAL_DPC := '00000002'O;
const OCT4 c_M3UA_REGSTS_ERR_INVAL_NA := '00000003'O;
const OCT4 c_M3UA_REGSTS_ERR_INVAL_RKEY := '00000004'O;
const OCT4 c_M3UA_REGSTS_ERR_EPERM := '00000005'O;
// ...

const OCT4 c_m3UA_DEREGSTS_SUCCESS := '00000000'O;
const OCT4 c_m3UA_DEREGSTS_ERR_UNKNOWN := '00000001'O;
const OCT4 c_m3UA_DEREGSTS_ERR_INVAL_RCTX := '00000002'O;
const OCT4 c_m3UA_DEREGSTS_ERR_EPERM := '00000003'O;
const OCT4 c_m3UA_DEREGSTS_ERR_NOT_REG := '00000004'O;
const OCT4 c_m3UA_DEREGSTS_ERR_ASP_ACTIVE := '00000005'O;

template (value) M3UA_Registration_Result ts_M3UA_reg_res(template (value) OCT4 id,
							    template (value) OCT4 status,
							    template (value) OCT4 rctx) := {
	tag := '0208'O,
	lengthInd := 0, // overwritten
	registrationResult := {
		local_Routing_Key_Id := ts_M3UA_lrkid(id),
		registration_Status := {
			tag := '0212'O,
			lengthInd := 8,
			registrationStatus := status
		},
		routing_Context := ts_M3UA_routing_ctx(rctx)
	}
}
template (present) M3UA_Registration_Result tr_M3UA_reg_res(template (present) OCT4 id,
							    template (present) OCT4 status,
							    template (present) OCT4 rctx) := {
	tag := '0208'O,
	lengthInd := ?,
	registrationResult := {
		local_Routing_Key_Id := tr_M3UA_lrkid(id),
		registration_Status := {
			tag := '0212'O,
			lengthInd := 8,
			registrationStatus := status
		},
		routing_Context := tr_M3UA_routing_ctx(rctx)
	}
}

template (value) M3UA_Deregistration_Result ts_M3UA_dereg_res(template (value) OCT4 rctx,
							      template (value) OCT4 status) := {
	tag := '0209'O,
	lengthInd := 0, // overwritten
	deregistrationResult := {
		routing_Context := ts_M3UA_routing_ctx(rctx),
		deregistration_Status := {
			tag := '0213'O,
			lengthInd := 8,
			deregistrationStatus := status
		}
	}
}
template (present) M3UA_Deregistration_Result tr_M3UA_dereg_res(template (present) OCT4 rctx,
								template (present) OCT4 status) := {
	tag := '0209'O,
	lengthInd := ?,
	deregistrationResult := {
		routing_Context := tr_M3UA_routing_ctx(rctx),
		deregistration_Status := {
			tag := '0213'O,
			lengthInd := 8,
			deregistrationStatus := status
		}
	}
}


template (value) PDU_M3UA ts_M3UA_REG_REQ(template (value) M3UA_Routing_Keys rkeys) := {
	m3UA_REG_REQ := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0901'O,
		messageLength := 0, // overwritten
		messageParameters := rkeys
	}
}
template (present) PDU_M3UA tr_M3UA_REG_REQ(template (present) M3UA_Routing_Keys rkeys) := {
	m3UA_REG_REQ := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0901'O,
		messageLength := ?,
		messageParameters := rkeys
	}
}


template (value) PDU_M3UA ts_M3UA_REG_RSP(template (value) M3UA_Registration_Results res) := {
	m3UA_REG_RSP := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0902'O,
		messageLength := 0, // overwritten
		messageParameters := res
	}
}
template (present) PDU_M3UA tr_M3UA_REG_RSP(template (present) M3UA_Registration_Results res) := {
	m3UA_REG_RSP := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0902'O,
		messageLength := ?,
		messageParameters := res
	}
}

template (value) PDU_M3UA ts_M3UA_DEREG_REQ(template (value) M3UA_Routing_Context rctx) := {
	m3UA_DEREG_REQ := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0903'O,
		messageLength := 0, // overwritten
		messageParameters := {
			routing_Context := rctx
		}
	}
}
template (present) PDU_M3UA tr_M3UA_DEREG_REQ(template (present) M3UA_Routing_Context rctx) := {
	m3UA_DEREG_REQ := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0903'O,
		messageLength := ?,
		messageParameters := {
			routing_Context := rctx
		}
	}
}

template (value) PDU_M3UA ts_M3UA_DEREG_RSP(template (value) M3UA_Deregistration_Results res) := {
	m3UA_DEREG_RSP := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0904'O,
		messageLength := 0, // overwritten
		messageParameters := res
	}
}
template (present) PDU_M3UA tr_M3UA_DEREG_RSP(template (present) M3UA_Deregistration_Results res) := {
	m3UA_DEREG_RSP := {
		version := c_M3UA_VERSION,
		reserved := '00'O,
		messageClassAndType := '0904'O,
		messageLength := ?,
		messageParameters := res
	}
}



}