blob: 274f42e5ea5ae1944d89c346b86afe3447edd646 [file] [log] [blame]
Harald Weltec76f29f2017-11-22 12:46:46 +01001module BSSMAP_Templates {
2
3import from General_Types all;
4import from Osmocom_Types all;
5import from BSSAP_Types all;
6
7type integer BssmapCause;
8
9template PDU_BSSAP ts_BSSAP_BSSMAP := {
10 discriminator := '0'B,
11 spare := '0000000'B,
12 dlci := omit,
13 lengthIndicator := 0, /* overwritten by codec */
Harald Welteb3414b22017-11-23 18:22:10 +010014 pdu := {
15 bssmap := ?
16 }
Harald Weltec76f29f2017-11-22 12:46:46 +010017}
18
19template PDU_BSSAP tr_BSSAP_BSSMAP := {
20 discriminator := '0'B,
21 spare := '0000000'B,
22 dlci := omit,
23 lengthIndicator := ?,
24 pdu := {
25 bssmap := ?
26 }
27}
28
Harald Welteb3414b22017-11-23 18:22:10 +010029template PDU_BSSAP ts_BSSAP_DTAP := {
30 discriminator := '1'B,
31 spare := '0000000'B,
32 dlci := omit,
33 lengthIndicator := 0, /* overwritten by codec */
34 pdu := {
35 dtap := ?
36 }
37}
38
39template PDU_BSSAP tr_BSSAP_DTAP := {
40 discriminator := '1'B,
41 spare := '0000000'B,
42 dlci := omit,
43 lengthIndicator := ?,
44 pdu := {
45 dtap := ?
46 }
47}
48
49
Harald Weltec76f29f2017-11-22 12:46:46 +010050template (value) BSSMAP_IE_Cause ts_BSSMAP_IE_Cause(BssmapCause val) := {
51 elementIdentifier := '04'O,
52 lengthIndicator := 0,
53 causeValue := int2bit(val, 7),
54 extensionCauseValue := '0'B,
55 spare1 := omit
56}
57
58template (value) PDU_BSSAP ts_BSSMAP_Reset(BssmapCause cause) modifies ts_BSSAP_BSSMAP := {
59 pdu := {
60 bssmap := {
61 reset := {
62 messageType := '30'O,
63 cause := ts_BSSMAP_IE_Cause(cause),
64 a_InterfaceSelectorForReset := omit
65 }
66 }
67 }
68}
69
Harald Welte365f4ed2017-11-23 00:00:43 +010070template PDU_BSSAP tr_BSSMAP_Reset modifies tr_BSSAP_BSSMAP := {
71 pdu := {
72 bssmap := {
73 reset := {
74 messageType := '30'O,
75 cause := ?,
76 a_InterfaceSelectorForReset := *
77 }
78 }
79 }
80}
81
Harald Weltec76f29f2017-11-22 12:46:46 +010082template (value) PDU_BSSAP ts_BSSMAP_ResetAck modifies ts_BSSAP_BSSMAP := {
83 pdu := {
84 bssmap := {
85 resetAck := {
86 messageType := '31'O,
87 a_InterfaceSelectorForReset := omit
88 }
89 }
90 }
91}
92
93template PDU_BSSAP tr_BSSMAP_ResetAck modifies tr_BSSAP_BSSMAP := {
94 pdu := {
95 bssmap := {
96 resetAck := {
97 messageType := '31'O,
98 a_InterfaceSelectorForReset := *
99 }
100 }
101 }
102}
103
104template BSSMAP_IE_CellIdentifier ts_BSSMAP_IE_CellID := {
105 elementIdentifier := '05'O,
106 lengthIndicator := 0,
107 cellIdentifierDiscriminator := '0000'B,
108 spare1_4 := '0000'B,
109 cellIdentification := ?
110}
111
112type uint16_t BssmapLAC;
113type uint16_t BssmapCI;
114
115/*
116template BSSMAP_IE_CellIdentifier ts_CellId_CGI(mcc, mnc, lac, ci)
117modifies ts_BSSMAP_IE_CellID := {
118 cellIdentification := {
119 cI_LAC_CGI := {
120 mnc_mcc := FIXME,
121 lac := int2oct(lac, 2),
122 ci := int2oct(ci, 2)
123 }
124 }
125}
126*/
127
128template BSSMAP_IE_CellIdentifier ts_CellID_LAC_CI(BssmapLAC lac, BssmapCI ci)
129modifies ts_BSSMAP_IE_CellID := {
130 cellIdentification := {
131 cI_LAC_CI := {
132 lac := int2oct(lac, 2),
133 ci := int2oct(ci, 2)
134 }
135 }
136}
137
138template BSSMAP_IE_CellIdentifier ts_CellId_CI(BssmapCI ci)
139modifies ts_BSSMAP_IE_CellID := {
140 cellIdentification := {
141 cI_CI := int2oct(ci, 2)
142 }
143}
144
145template BSSMAP_IE_CellIdentifier ts_CellId_none
146modifies ts_BSSMAP_IE_CellID := {
147 cellIdentification := {
148 cI_noCell := ''O
149 }
150}
151
152
153template BSSMAP_IE_Layer3Information ts_BSSMAP_IE_L3Info(octetstring l3info) := {
154 elementIdentifier := '17'O,
155 lengthIndicator := 0,
156 layer3info := l3info
157}
158
159template PDU_BSSAP ts_BSSMAP_ComplL3(BSSMAP_IE_CellIdentifier cell_id, octetstring l3_info)
160modifies ts_BSSAP_BSSMAP := {
161 pdu := {
162 bssmap := {
163 completeLayer3Information := {
164 messageType := '57'O,
165 cellIdentifier := cell_id,
166 layer3Information := ts_BSSMAP_IE_L3Info(l3_info),
167 chosenChannel := omit,
168 lSAIdentifier := omit,
169 aPDU := omit,
170 codecList := omit,
171 redirectAttemptFlag := omit,
172 sendSequenceNumber := omit,
173 iMSI := omit
174 }
175 }
176 }
177}
178
Harald Welte365f4ed2017-11-23 00:00:43 +0100179template PDU_BSSAP tr_BSSMAP_ComplL3 modifies tr_BSSAP_BSSMAP := {
180 pdu := {
181 bssmap := {
182 completeLayer3Information := ?
183 }
184 }
185}
186
187
Harald Weltec76f29f2017-11-22 12:46:46 +0100188template PDU_BSSAP ts_BSSMAP_HandoReq(BssmapCause cause, BSSMAP_IE_CellIdentifierList cid_list)
189modifies ts_BSSAP_BSSMAP := {
190 pdu := {
191 bssmap := {
192 handoverRequired := {
193 messageType := '11'O,
194 cause := ts_BSSMAP_IE_Cause(cause),
195 responseRequest := omit,
196 cellIdentifierList := cid_list,
197 circuitPoolList := omit,
198 currentChannelType1 := omit,
199 speechVersion := omit,
200 queueingIndicator := omit,
201 oldToNewBSSInfo := omit,
202 sourceToTargetRNCTransparentInfo := omit,
203 sourceToTargetRNCTransparentInfoCDMA := omit,
204 gERANClassmark := omit,
205 talkerPriority := omit,
206 speechCodec := omit,
207 cSG_Identifier := omit
208 }
209 }
210 }
211}
212
Harald Welte365f4ed2017-11-23 00:00:43 +0100213const OCT1 ChRate_TCHF := '08'O;
214const OCT1 ChRate_TCHH := '09'O;
215
216template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelType := {
217 elementIdentifier := '0B'O, /* overwritten */
218 lengthIndicator := 0, /* overwritten */
219 speechOrDataIndicator := '0001'B, /* speech */
220 spare1_4 := '0000'B,
221 channelRateAndType := ChRate_TCHF,
222 speechId_DataIndicator := '01'O /* FRv1 */
223}
224
225template (value) BSSMAP_IE_CircuitIdentityCode ts_BSSMAP_IE_CIC(uint11_t span, uint5_t ts) := {
226 elementIdentifier := '01'O, /* overwritten */
227 cicHigh := bit2oct(substr(int2bit(span, 11) << 5, 0, 8)),
228 cicLow := bit2oct((substr(int2bit(span, 11), 8, 3) << 5) & int2bit(ts, 5))
229}
230
231template (value) PDU_BSSAP ts_BSSMAP_AssignmentCmd(uint11_t span, uint5_t ts)
232modifies ts_BSSAP_BSSMAP := {
233 pdu := {
234 bssmap := {
235 assignmentRequest := {
236 messageType :='01'O, /* overwritten */
237 channelType := ts_BSSMAP_IE_ChannelType,
238 layer3HeaderInfo := omit,
239 priority := omit,
240 circuitIdentityCode := ts_BSSMAP_IE_CIC(span, ts),
241 downLinkDTX_Flag := omit,
242 interferenceBandToBeUsed := omit,
243 classmarkInformationType2 := omit,
244 groupCallReference := omit,
245 talkerFlag := omit,
246 configurationEvolutionIndication := omit,
247 lsaAccesControlSuppression := omit,
248 serviceHandover := omit,
249 encryptionInformation := omit,
250 talkerPriority := omit,
251 aoIPTransportLayer := omit,
252 codecList := omit,
253 callIdentifier := omit,
254 kC128 := omit,
255 globalCallReference := omit,
256 lCLS_Configuration := omit,
257 lCLS_ConnectionStatusControl := omit,
258 lCLS_CorrelationNotNeeded := omit
259 }
260 }
261 }
262}
Harald Weltec76f29f2017-11-22 12:46:46 +0100263
Harald Welteb3414b22017-11-23 18:22:10 +0100264template PDU_BSSAP tr_BSSMAP_AssignmentCmd modifies tr_BSSAP_BSSMAP := {
265 pdu := {
266 bssmap := {
267 assignmentRequest := {
268 messageType :='01'O, /* overwritten */
269 channelType := ?,
270 layer3HeaderInfo := *,
271 priority := *,
272 circuitIdentityCode := ?,
273 downLinkDTX_Flag := *,
274 interferenceBandToBeUsed := *,
275 classmarkInformationType2 := *,
276 groupCallReference := *,
277 talkerFlag := *,
278 configurationEvolutionIndication := *,
279 lsaAccesControlSuppression := *,
280 serviceHandover := *,
281 encryptionInformation := *,
282 talkerPriority := *,
283 aoIPTransportLayer := *,
284 codecList := *,
285 callIdentifier := *,
286 kC128 := *,
287 globalCallReference := *,
288 lCLS_Configuration := *,
289 lCLS_ConnectionStatusControl := *,
290 lCLS_CorrelationNotNeeded := *
291 }
292 }
293 }
294}
295
296template (value) PDU_BSSAP ts_BSSMAP_AssignmentComplete(BSSMAP_IE_CircuitIdentityCode cic)
297modifies ts_BSSAP_BSSMAP := {
298 pdu := {
299 bssmap := {
300 assignmentComplete := {
301 messageType :='02'O, /* overwritten */
302 circuitIdentityCode := cic,
303 cellIdentifier := omit,
304 chosenChannel := omit,
305 chosenEncryptionAlgorithm := omit,
306 circuitPool := omit,
307 speechVersion := omit,
308 lSAIdentifier := omit,
309 talkerPriority := omit,
310 aoIPTransportLayer := omit,
311 speechCodec := omit,
312 codecList := omit,
313 lCLS_BSS_Status := omit
314 }
315 }
316 }
317}
318
319template PDU_BSSAP tr_BSSMAP_AssignmentComplete modifies tr_BSSAP_BSSMAP := {
320 pdu := {
321 bssmap := {
322 assignmentComplete := {
323 messageType := '02'O, /* overwritten */
324 circuitIdentityCode := ?,
325 cellIdentifier := *,
326 chosenChannel := *,
327 chosenEncryptionAlgorithm := *,
328 circuitPool := *,
329 speechVersion := *,
330 lSAIdentifier := *,
331 talkerPriority := *,
332 aoIPTransportLayer := *,
333 speechCodec := *,
334 codecList := *,
335 lCLS_BSS_Status := *
336 }
337 }
338 }
339}
340
341template (value) PDU_BSSAP ts_BSSMAP_ClearCommand(BssmapCause cause)
342modifies ts_BSSAP_BSSMAP := {
343 pdu := {
344 bssmap := {
345 clearCommand := {
346 messageType := '20'O, /* overwritten */
347 layer3HeaderInfo := omit,
348 cause := ts_BSSMAP_IE_Cause(cause),
349 cSFB_Indication := omit
350 }
351 }
352 }
353}
354
355template PDU_BSSAP tr_BSSMAP_ClearCommand modifies tr_BSSAP_BSSMAP := {
356 pdu := {
357 bssmap := {
358 clearCommand := {
359 messageType := '20'O, /* overwritten */
360 layer3HeaderInfo := *,
361 cause := ?,
362 cSFB_Indication := *
363 }
364 }
365 }
366}
367
368template (value) PDU_BSSAP ts_BSSMAP_ClearComplete
369modifies ts_BSSAP_BSSMAP := {
370 pdu := {
371 bssmap := {
372 clearComplete := {
373 messageType := '21'O /* overwritten */
374 }
375 }
376 }
377}
378
Harald Weltec76f29f2017-11-22 12:46:46 +0100379}