aboutsummaryrefslogtreecommitdiffstats
path: root/library/BSSMAP_Templates.ttcn
blob: 2fd497dfdb740b356f1d2bff549d12e8bd6b1ed4 (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
module BSSMAP_Templates {

import from General_Types all;
import from Osmocom_Types all;
import from BSSAP_Types all;

type integer BssmapCause;

template PDU_BSSAP ts_BSSAP_BSSMAP := {
	discriminator := '0'B,
	spare := '0000000'B,
	dlci := omit,
	lengthIndicator := 0,	/* overwritten by codec */
	pdu := {
		bssmap := ?
	}
}

template PDU_BSSAP tr_BSSAP_BSSMAP := {
	discriminator := '0'B,
	spare := '0000000'B,
	dlci := omit,
	lengthIndicator := ?,
	pdu := {
		bssmap := ?
	}
}

template PDU_BSSAP ts_BSSAP_DTAP := {
	discriminator := '1'B,
	spare := '0000000'B,
	dlci := omit,
	lengthIndicator := 0,	/* overwritten by codec */
	pdu := {
		dtap := ?
	}
}

template PDU_BSSAP tr_BSSAP_DTAP := {
	discriminator := '1'B,
	spare := '0000000'B,
	dlci := omit,
	lengthIndicator := ?,
	pdu := {
		dtap := ?
	}
}


template (value) BSSMAP_IE_Cause ts_BSSMAP_IE_Cause(BssmapCause val) := {
	elementIdentifier := '04'O,
	lengthIndicator := 0,
	causeValue := int2bit(val, 7),
	extensionCauseValue := '0'B,
	spare1 := omit
}

template (value) PDU_BSSAP ts_BSSMAP_Reset(BssmapCause cause) modifies ts_BSSAP_BSSMAP := {
	pdu := {
		bssmap := {
			reset := {
				messageType := '30'O,
				cause := ts_BSSMAP_IE_Cause(cause),
				a_InterfaceSelectorForReset := omit
			}
		}
	}
}

template PDU_BSSAP tr_BSSMAP_Reset modifies tr_BSSAP_BSSMAP := {
	pdu := {
		bssmap := {
			reset := {
				messageType := '30'O,
				cause := ?,
				a_InterfaceSelectorForReset := *
			}
		}
	}
}

template (value) PDU_BSSAP ts_BSSMAP_ResetAck modifies ts_BSSAP_BSSMAP := {
	pdu := {
		bssmap := {
			resetAck := {
				messageType := '31'O,
				a_InterfaceSelectorForReset := omit
			}
		}
	}
}

template PDU_BSSAP tr_BSSMAP_ResetAck modifies tr_BSSAP_BSSMAP := {
	pdu := {
		bssmap := {
			resetAck := {
				messageType := '31'O,
				a_InterfaceSelectorForReset := *
			}
		}
	}
}

template BSSMAP_IE_CellIdentifier ts_BSSMAP_IE_CellID := {
	elementIdentifier := '05'O,
	lengthIndicator := 0,
	cellIdentifierDiscriminator := '0000'B,
	spare1_4 := '0000'B,
	cellIdentification := ?
}

type uint16_t BssmapLAC;
type uint16_t BssmapCI;

/*
template BSSMAP_IE_CellIdentifier ts_CellId_CGI(mcc, mnc, lac, ci)
modifies ts_BSSMAP_IE_CellID := {
	cellIdentification := {
		cI_LAC_CGI := {
			mnc_mcc := FIXME,
			lac := int2oct(lac, 2),
			ci := int2oct(ci, 2)
		}
	}
}
*/

template BSSMAP_IE_CellIdentifier ts_CellID_LAC_CI(BssmapLAC lac, BssmapCI ci)
modifies ts_BSSMAP_IE_CellID := {
	cellIdentification := {
		cI_LAC_CI := {
			lac := int2oct(lac, 2),
			ci := int2oct(ci, 2)
		}
	}
}

template BSSMAP_IE_CellIdentifier ts_CellId_CI(BssmapCI ci)
modifies ts_BSSMAP_IE_CellID := {
	cellIdentification := {
		cI_CI := int2oct(ci, 2)
	}
}

template BSSMAP_IE_CellIdentifier ts_CellId_none
modifies ts_BSSMAP_IE_CellID := {
	cellIdentification := {
		cI_noCell := ''O
	}
}


template BSSMAP_IE_Layer3Information ts_BSSMAP_IE_L3Info(octetstring l3info) := {
	elementIdentifier := '17'O,
	lengthIndicator := 0,
	layer3info := l3info
}

template PDU_BSSAP ts_BSSMAP_ComplL3(BSSMAP_IE_CellIdentifier cell_id, octetstring l3_info)
modifies ts_BSSAP_BSSMAP := {
	pdu := {
		bssmap := {
			completeLayer3Information := {
				messageType := '57'O,
				cellIdentifier := cell_id,
				layer3Information := ts_BSSMAP_IE_L3Info(l3_info),
				chosenChannel := omit,
				lSAIdentifier := omit,
				aPDU := omit,
				codecList := omit,
				redirectAttemptFlag := omit,
				sendSequenceNumber := omit,
				iMSI := omit
			}
		}
	}
}

template PDU_BSSAP tr_BSSMAP_ComplL3 modifies tr_BSSAP_BSSMAP := {
	pdu := {
		bssmap := {
			completeLayer3Information := ?
		}
	}
}


template PDU_BSSAP ts_BSSMAP_HandoReq(BssmapCause cause, BSSMAP_IE_CellIdentifierList cid_list)
modifies ts_BSSAP_BSSMAP := {
	pdu := {
		bssmap := {
			handoverRequired := {
				messageType := '11'O,
				cause := ts_BSSMAP_IE_Cause(cause),
				responseRequest := omit,
				cellIdentifierList := cid_list,
				circuitPoolList := omit,
				currentChannelType1 := omit,
				speechVersion := omit,
				queueingIndicator := omit,
				oldToNewBSSInfo := omit,
				sourceToTargetRNCTransparentInfo := omit,
				sourceToTargetRNCTransparentInfoCDMA := omit,
				gERANClassmark := omit,
				talkerPriority := omit,
				speechCodec := omit,
				cSG_Identifier := omit
			}
		}
	}
}

const OCT1 ChRate_TCHF	:= '08'O;
const OCT1 ChRate_TCHH	:= '09'O;

template (value) BSSMAP_IE_ChannelType ts_BSSMAP_IE_ChannelType := {
	elementIdentifier := '0B'O,	/* overwritten */
	lengthIndicator := 0,		/* overwritten */
	speechOrDataIndicator := '0001'B,	/* speech */
	spare1_4 := '0000'B,
	channelRateAndType := ChRate_TCHF,
	speechId_DataIndicator := '01'O	/* FRv1 */
}

template (value) BSSMAP_IE_CircuitIdentityCode ts_BSSMAP_IE_CIC(uint11_t span, uint5_t ts) := {
	elementIdentifier := '01'O,	/* overwritten */
	cicHigh := bit2oct(substr(int2bit(span, 11) << 5, 0, 8)),
	cicLow := bit2oct((substr(int2bit(span, 11), 8, 3) << 5) & int2bit(ts, 5))
}

template (value) PDU_BSSAP ts_BSSMAP_AssignmentReq(uint11_t span, uint5_t ts)
modifies ts_BSSAP_BSSMAP := {
	pdu := {
		bssmap := {
			assignmentRequest := {
				messageType :='01'O,	/* overwritten */
				channelType := ts_BSSMAP_IE_ChannelType,
				layer3HeaderInfo := omit,
				priority := omit,
				circuitIdentityCode := ts_BSSMAP_IE_CIC(span, ts),
				downLinkDTX_Flag := omit,
				interferenceBandToBeUsed := omit,
				classmarkInformationType2 := omit,
				groupCallReference := omit,
				talkerFlag := omit,
				configurationEvolutionIndication := omit,
				lsaAccesControlSuppression := omit,
				serviceHandover := omit,
				encryptionInformation := omit,
				talkerPriority := omit,
				aoIPTransportLayer := omit,
				codecList := omit,
				callIdentifier := omit,
				kC128 := omit,
				globalCallReference := omit,
				lCLS_Configuration := omit,
				lCLS_ConnectionStatusControl := omit,
				lCLS_CorrelationNotNeeded := omit
			}
		}
	}
}

template PDU_BSSAP tr_BSSMAP_AssignmentReq modifies tr_BSSAP_BSSMAP := {
	pdu := {
		bssmap := {
			assignmentRequest := {
				messageType :='01'O,	/* overwritten */
				channelType := ?,
				layer3HeaderInfo := *,
				priority := *,
				circuitIdentityCode := ?,
				downLinkDTX_Flag := *,
				interferenceBandToBeUsed := *,
				classmarkInformationType2 := *,
				groupCallReference := *,
				talkerFlag := *,
				configurationEvolutionIndication := *,
				lsaAccesControlSuppression := *,
				serviceHandover := *,
				encryptionInformation := *,
				talkerPriority := *,
				aoIPTransportLayer := *,
				codecList := *,
				callIdentifier := *,
				kC128 := *,
				globalCallReference := *,
				lCLS_Configuration := *,
				lCLS_ConnectionStatusControl := *,
				lCLS_CorrelationNotNeeded := *
			}
		}
	}
}

template (value) PDU_BSSAP ts_BSSMAP_AssignmentComplete(BSSMAP_IE_CircuitIdentityCode cic)
modifies ts_BSSAP_BSSMAP := {
	pdu := {
		bssmap := {
			assignmentComplete := {
				messageType :='02'O,	/* overwritten */
				circuitIdentityCode := cic,
				cellIdentifier := omit,
				chosenChannel := omit,
				chosenEncryptionAlgorithm := omit,
				circuitPool := omit,
				speechVersion := omit,
				lSAIdentifier := omit,
				talkerPriority := omit,
				aoIPTransportLayer := omit,
				speechCodec := omit,
				codecList := omit,
				lCLS_BSS_Status := omit
			}
		}
	}
}

template PDU_BSSAP tr_BSSMAP_AssignmentComplete modifies tr_BSSAP_BSSMAP := {
	pdu := {
		bssmap := {
			assignmentComplete := {
				messageType := '02'O,	/* overwritten */
				circuitIdentityCode := ?,
				cellIdentifier := *,
				chosenChannel := *,
				chosenEncryptionAlgorithm := *,
				circuitPool := *,
				speechVersion := *,
				lSAIdentifier := *,
				talkerPriority := *,
				aoIPTransportLayer := *,
				speechCodec := *,
				codecList := *,
				lCLS_BSS_Status := *
			}
		}
	}
}

template (value) PDU_BSSAP ts_BSSMAP_ClearCommand(BssmapCause cause)
modifies ts_BSSAP_BSSMAP := {
	pdu := {
		bssmap := {
			clearCommand := {
				messageType := '20'O,	/* overwritten */
				layer3HeaderInfo := omit,
				cause := ts_BSSMAP_IE_Cause(cause),
				cSFB_Indication := omit
			}
		}
	}
}

template PDU_BSSAP tr_BSSMAP_ClearCommand modifies tr_BSSAP_BSSMAP := {
	pdu := {
		bssmap := {
			clearCommand := {
				messageType := '20'O,	/* overwritten */
				layer3HeaderInfo := *,
				cause := ?,
				cSFB_Indication := *
			}
		}
	}
}

template (value) PDU_BSSAP ts_BSSMAP_ClearComplete
modifies ts_BSSAP_BSSMAP := {
	pdu := {
		bssmap := {
			clearComplete := {
				messageType := '21'O	/* overwritten */
			}
		}
	}
}

}