blob: 0da47062fc39c34379d6da5a438f3640765d84d7 [file] [log] [blame]
Harald Weltec76f29f2017-11-22 12:46:46 +01001module L3_Templates {
2
Harald Welte35bb7162018-01-03 21:07:52 +01003/* L3 Templates, building on top of MobileL3*_Types from Ericsson.
4 *
5 * (C) 2017 by Harald Welte <laforge@gnumonks.org>
6 * All rights reserved.
7 *
8 * Released under the terms of GNU General Public License, Version 2 or
9 * (at your option) any later version.
10 */
11
Harald Weltec76f29f2017-11-22 12:46:46 +010012import from General_Types all;
13import from MobileL3_Types all;
14import from MobileL3_CommonIE_Types all;
15import from MobileL3_MM_Types all;
16import from MobileL3_RRM_Types all;
Harald Weltecb6cc332018-01-21 13:59:08 +010017import from MobileL3_CC_Types all;
18//import from MobileL3_GMM_SM_Types all;
19//import from MobileL3_SMS_Types all;
20
Harald Weltec76f29f2017-11-22 12:46:46 +010021
22type enumerated CmServiceType {
23 CM_TYPE_MO_CALL ('0001'B),
24 CM_TYPE_EMERG_CALL ('0010'B),
25 CM_TYPE_MO_SMS ('0100'B),
26 CM_TYPE_SS_ACT ('1000'B)
27}
28
29
30/* send template fro Mobile Identity (TMSI) */
31template MobileIdentityLV ts_MI_TMSI_LV(OCT4 tmsi) := {
32 lengthIndicator := 0, /* overwritten */
33 mobileIdentityV := {
34 typeOfIdentity := '000'B, /* overwritten */
35 oddEvenInd_identity := {
36 tmsi_ptmsi := {
37 oddevenIndicator := '0'B,
38 fillerDigit := '1111'B,
39 octets := tmsi
40 }
41 }
42 }
43}
44
45private function f_enc_IMSI_L3(hexstring digits) return IMSI_L3 {
46 var IMSI_L3 l3;
47 var integer len := lengthof(digits);
48 if (len rem 2 == 1) { /* modulo remainder */
Harald Welte365f4ed2017-11-23 00:00:43 +010049 l3.oddevenIndicator := '1'B;
Harald Weltec76f29f2017-11-22 12:46:46 +010050 l3.fillerDigit := '1111'B;
51 } else {
Harald Welte365f4ed2017-11-23 00:00:43 +010052 l3.oddevenIndicator := '0'B;
Harald Weltec76f29f2017-11-22 12:46:46 +010053 l3.fillerDigit := omit;
54 }
55 l3.digits := digits;
56 return l3;
57}
58
59/* send template fro Mobile Identity (IMSI) */
60template (value) MobileIdentityLV ts_MI_IMSI_LV(hexstring imsi_digits) := {
61 lengthIndicator := 0, /* overwritten */
62 mobileIdentityV := {
63 typeOfIdentity := '000'B, /* overwritten */
64 oddEvenInd_identity := {
65 imsi := f_enc_IMSI_L3(imsi_digits)
66 }
67 }
68}
69
70/* Send template for Classmark 2 */
71template (value) MobileStationClassmark2_LV ts_CM2 := {
72 lengthIndicator := 0,
73 rf_PowerCapability := '000'B,
74 a5_1 := '0'B,
75 esind := '1'B,
76 revisionLevel := '10'B,
77 spare1_1 := '0'B,
78 mobileStationClassmark2_oct4 := omit,
79 mobileStationClassmark2_oct5 := omit
80};
81
82/* Send template for CM SERVICE REQUEST */
83template (value) PDU_ML3_MS_NW ts_CM_SERV_REQ(BIT4 serv_type, MobileIdentityLV mi_lv) := {
84 discriminator := '0000'B, /* overwritten */
85 tiOrSkip := {
86 skipIndicator := '0000'B
87 },
88 msgs := {
89 mm := {
90 cMServiceRequest := {
91 messageType := '000000'B, /* overwritten */
92 nsd := '00'B,
93 cm_ServiceType := serv_type,
94 cipheringKeySequenceNumber := { '000'B, '0'B },
95 mobileStationClassmark2 := ts_CM2,
96 mobileIdentity := mi_lv,
97 priorityLevel := omit,
98 additionalUpdateParameterTV := omit,
99 deviceProperties := omit
100 }
101 }
102 }
103}
104
Harald Welte6ff81902018-01-21 19:09:08 +0100105template PDU_ML3_NW_MS tr_MT_simple(template BIT4 discr := ?) := {
106 discriminator := discr,
107 tiOrSkip := {
108 skipIndicator := '0000'B
109 },
110 msgs := ?
111}
112
113
114template PDU_ML3_NW_MS tr_CM_SERV_ACC := {
115 discriminator := '0101'B,
116 tiOrSkip := {
117 skipIndicator := '0000'B
118 },
119 msgs := {
120 mm := {
121 cMServiceAccept := {
122 messageType := '100001'B,
123 nsd := ?
124 }
125 }
126 }
127}
128
129
Harald Weltecb6cc332018-01-21 13:59:08 +0100130template PDU_ML3_NW_MS tr_CM_SERV_REJ(template OCT1 rej_cause := ?) := {
131 discriminator := '0101'B,
132 tiOrSkip := {
133 skipIndicator := '0000'B
134 },
135 msgs := {
136 mm := {
137 cMServiceReject := {
138 messageType := '100010'B,
139 nsd := ?,
140 rejectCause := rej_cause,
141 t3246_Value := *
142 }
143 }
144 }
145}
146
Harald Weltec76f29f2017-11-22 12:46:46 +0100147/* Send template for PAGING RESPONSE */
148template (value) PDU_ML3_MS_NW ts_PAG_RESP(MobileIdentityLV mi_lv) := {
149 discriminator := '0000'B, /* overwritten */
150 tiOrSkip := {
151 skipIndicator := '0000'B
152 },
153 msgs := {
154 rrm := {
155 pagingResponse := {
156 messageType := '00000000'B, /* overwritten */
157 cipheringKeySequenceNumber := { '000'B, '0'B },
158 spare1_4 := '0000'B,
159 mobileStationClassmark := ts_CM2,
160 mobileIdentity := mi_lv,
161 additionalUpdateParameters := omit
162 }
163 }
164 }
165}
166
Harald Welte15166142017-12-16 23:02:08 +0100167template (value) PDU_ML3_MS_NW ts_RRM_ModeModifyAck(ChannelDescription2_V desc, ChannelMode_V mode) := {
168 discriminator := '0000'B, /* overwritten */
169 tiOrSkip := {
170 skipIndicator := '0000'B
171 },
172 msgs := {
173 rrm := {
174 channelModeModifyAck := {
175 messageType := '00010111'B,
176 channelDescription := desc,
177 channelMode := mode,
178 extendedTSCSet := omit
179 }
180 }
181 }
182}
183
Harald Welte73cd2712017-12-17 00:44:52 +0100184template (value) PDU_ML3_MS_NW ts_RRM_CiphModeCompl := {
185 discriminator := '0000'B, /* overwritten */
186 tiOrSkip := {
187 skipIndicator := '0000'B
188 },
189 msgs := {
190 rrm := {
191 cipheringModeComplete := {
192 messageType := '00110010'B,
193 mobileEquipmentIdentity := omit
194 }
195 }
196 }
197}
198
Harald Welte15166142017-12-16 23:02:08 +0100199
Harald Weltecb6cc332018-01-21 13:59:08 +0100200template PDU_ML3_MS_NW ts_ML3_MO := {
201 discriminator := '0000'B,
202 tiOrSkip := {
203 skipIndicator := '0000'B
204 },
205 msgs := ?
206}
207
208template LocationUpdatingType ts_ML3_IE_LuType := {
209 lut := ?,
210 spare1_1 := '0'B,
211 fop := '0'B
212}
213
214template LocationUpdatingType ts_ML3_IE_LuType_Normal modifies ts_ML3_IE_LuType := {
215 lut := '00'B
216}
217
218template LocationUpdatingType ts_ML3_IE_LuType_Periodic modifies ts_ML3_IE_LuType := {
219 lut := '01'B
220}
221
222template LocationUpdatingType ts_ML3_IE_LuType_Attach modifies ts_ML3_IE_LuType := {
223 lut := '10'B
224}
225
226template CipheringKeySequenceNumberV ts_ML3_IE_CKSN(integer cksn) := {
227 keySequence := int2bit(cksn, 3),
228 spare := '0'B
229}
230
231template PDU_ML3_MS_NW ts_ML3_MO_LU_Req(LocationUpdatingType lu_type, LocationAreaIdentification_V lai,
232 MobileIdentityLV mi, MobileStationClassmark1_V cm1)
233modifies ts_ML3_MO := {
234 msgs := {
235 mm := {
236 locationUpdateRequest := {
237 messageType := '001000'B,
238 nsd := '00'B, /* ? */
239 locationUpdatingType := lu_type,
240 cipheringKeySequenceNumber := ts_ML3_IE_CKSN(0),
241 locationAreaIdentification := lai,
242 mobileStationClassmark1 := cm1,
243 mobileIdentityLV := mi,
244 classmarkInformationType2_forUMTS := omit,
245 additionalUpdateParameterTV := omit,
246 deviceProperties := omit,
247 mS_NetworkFeatureSupport := omit
248 }
249 }
250 }
251}
252
Harald Welte6ff81902018-01-21 19:09:08 +0100253template PDU_ML3_MS_NW ts_ML3_MO_TmsiRealloc_Cmpl modifies ts_ML3_MO := {
254 msgs := {
255 mm := {
256 tmsiReallocComplete := {
257 messageType := '011011'B,
258 nsd := '00'B
259 }
260 }
261 }
262}
263
264template PDU_ML3_NW_MS tr_ML3_MT_LU_Acc := {
265 discriminator := '0101'B,
266 tiOrSkip := {
267 skipIndicator := '0000'B
268 },
269 msgs := {
270 mm := {
271 locationUpdateAccept := {
272 messageType := '000010'B,
273 nsd := '00'B,
274 locationAreaIdentification := ?,
275 mobileIdentityTLV := *,
276 followOnProceed := *,
277 cTS_Permission := *,
278 equivalentPLMNs := *,
279 emergencyNumberList := *,
280 perMS_T3212 := *
281 }
282 }
283 }
284}
285
286template PDU_ML3_NW_MS tr_ML3_MT_LU_Rej(template OCT1 cause := ?) := {
287 discriminator := '0101'B,
288 tiOrSkip := {
289 skipIndicator := '0000'B
290 },
291 msgs := {
292 mm := {
293 locationUpdateReject := {
294 messageType := '000100'B,
295 nsd := '00'B,
296 rejectCause := cause,
297 t3246_Value := *
298 }
299 }
300 }
301}
302
Harald Welted748a052018-01-22 02:59:24 +0100303template PDU_ML3_MS_NW ts_ML3_MO_CC(integer tid) := {
304 discriminator := '0011'B,
305 tiOrSkip := {
306 transactionId := {
307 tio := '000'B,
308 tiFlag := '0'B,
309 tIExtension := omit
310 }
311 }
312}
313
314template (value) CalledPartyBCD_Number ts_Called(hexstring digits) := {
315 elementIdentifier := '5E'O,
316 lengthIndicator := 0, /* overwritten */
317 numberingPlanIdentification := '0000'B,
318 typeOfNumber := '000'B, /* unknown */
319 ext1 := '0'B,
320 digits := digits
321}
322
323template (value) BearerCapability_TLV ts_Bcap_voice := {
324 elementIdentifier := '04'O,
325 lengthIndicator := 0, /* overwritten */
326 octet3 := {
327 informationTransferCapability := '000'B,
328 transferMode := '0'B,
329 codingStandard := '0'B,
330 radioChannelRequirement := '11'B, /* FR preferred */
331 extension_octet_3 := '0'B, /* overwritten */
332 speech_aux_3a_3b := omit
333 },
334 octet4 := omit,
335 octet5 := omit,
336 octet6 := omit,
337 octet7 := omit
338}
339
340template PDU_ML3_MS_NW ts_ML3_MO_CC_SETUP(integer tid, hexstring called, template BearerCapability_TLV bcap := ts_Bcap_voice) := {
341 discriminator := '0011'B,
342 tiOrSkip := {
343 transactionId := {
344 tio := int2bit(tid, 3),
345 tiFlag := '0'B,
346 tIExtension := omit
347 }
348 },
349 msgs := {
350 cc := {
351 setup_MS_NW := {
352 messageType := '000101'B,
353 nsd := '00'B,
354 bcRepeatIndicator := omit,
355 bearerCapability1 := bcap,
356 bearerCapability2 := omit,
357 facility := omit,
358 callingPartySubAddress := omit,
359 calledPartyBCD_Number := ts_Called(called),
360 calledPartySubAddress := omit,
361 llc_RepeatIndicator := omit,
362 lowLayerCompatibility1 := omit,
363 lowLayerCompatibility2 := omit,
364 hlc_RepeatIndicator := omit,
365 highLayerCompatibility1 := omit,
366 highLayerCompatibility2 := omit,
367 user_user := omit,
368 ss_VersionIndicator := omit,
369 clir_Suppression := omit,
370 clir_Invocation := omit,
371 cC_Capabilities := omit,
372 facility_ccbs1 := omit,
373 facility_ccbs2 := omit,
374 streamIdentifier := omit,
375 supportedCodecs := omit,
376 redial := omit
377 }
378 }
379 }
380}
381
382template PDU_ML3_NW_MS tr_ML3_MT_CC_CALL_PROC(integer tid) := {
383 discriminator := '0011'B,
384 tiOrSkip := {
385 transactionId := {
386 tio := int2bit(tid, 3),
387 tiFlag := ?,
388 tIExtension := omit
389 }
390 },
391 msgs := {
392 cc := {
393 callProceeding := {
394 messageType := '000010'B,
395 nsd := '00'B,
396 repeatIndicator := *,
397 bearerCapability1 := *,
398 bearerCapability2 := *,
399 facility := *,
400 progressIndicator := *,
401 priorityGranted := *,
402 networkCCCapabilities := *
403 }
404 }
405 }
406}
407
408template PDU_ML3_NW_MS tr_ML3_MT_CC_ALERTING(integer tid) := {
409 discriminator := '0011'B,
410 tiOrSkip := {
411 transactionId := {
412 tio := int2bit(tid, 3),
413 tiFlag := ?,
414 tIExtension := omit
415 }
416 },
417 msgs := {
418 cc := {
419 alerting_NW_MS := {
420 messageType := '000001'B,
421 nsd := '00'B,
422 facility := *,
423 progressIndicator := *,
424 user_user := *
425 }
426 }
427 }
428}
429
430
Harald Weltecb6cc332018-01-21 13:59:08 +0100431
432
Harald Weltec76f29f2017-11-22 12:46:46 +0100433}