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
|
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000-2018 Ericsson Telecom AB
//
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v2.0
// which accompanies this distribution, and is available at
// https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
///////////////////////////////////////////////////////////////////////////////
//
// File: NS_Types.ttcn
// Rev: R2B
// Prodnr: CNL 113 578
// Updated: 2008-01-22
// Contact: http://ttcn.ericsson.se
// Reference: 3GPP TS 48.016 7.3.0
module NS_Types
{ // beginning of module
// This module contains the Base Station System (BSS) Serving GPRS Support
// Node (SGSN) interface Network Sevice protocol
// 48.016 v7.3.0 with attributes for RAW encoding/decoding.
//
// History:
// ********
import from General_Types all;
external function enc_PDU_NS(in PDU_NS pdu) return octetstring
with { extension "prototype(convert)"
extension "encode(RAW)"
}
external function dec_PDU_NS(in octetstring stream) return PDU_NS
with { extension "prototype(convert)"
extension "decode(RAW)"
}
type record CauseNS
{
OCT1 iEI,
BIT1 ext,
LIN1_2 lengthIndicator,
OCT1 cause
} with {
variant (lengthIndicator) "LENGTHTO (cause)";
variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B;
length2, ext = '0'B;)";
variant (ext,lengthIndicator) "FIELDORDER(msb)";
}
type record NS_VCI
{
OCT1 iEI,
BIT1 ext,
LIN1_2 lengthIndicator,
OCT2 nS_VCI
} with {
variant (lengthIndicator) "LENGTHTO (nS_VCI)";
variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B;
length2, ext = '0'B;)";
variant (ext,lengthIndicator) "FIELDORDER(msb)";
}
type record NS_PDU
{
OCT1 iEI,
BIT1 ext,
LIN1_2 lengthIndicator,
octetstring ns_PDU
} with {
variant (lengthIndicator) "LENGTHTO (ns_PDU)";
variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B;
length2, ext = '0'B;)";
variant (ext,lengthIndicator) "FIELDORDER(msb)";
}
type record BVCI_NS
{
OCT1 iEI,
BIT1 ext,
LIN1_2 lengthIndicator,
OCT2 bVCI
} with {
variant (lengthIndicator) "LENGTHTO (bVCI)";
variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B;
length2, ext = '0'B;)";
variant (ext,lengthIndicator) "FIELDORDER(msb)";
}
type record ListofIP4Elements
{
OCT1 iEI,
BIT1 ext,
LIN1_2 lengthIndicator,
IP4_Elements iP4_Elements
} with {
variant (lengthIndicator) "LENGTHTO (iP4_Elements)";
variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B;
length2, ext = '0'B;)";
variant (ext,lengthIndicator) "FIELDORDER(msb)";
}
type record IP4_Element
{
OCT4 ipAddress,
OCT2 uDP_Port,
OCT1 signallingWeight,
OCT1 dataWeight
}
type record of IP4_Element IP4_Elements;
type record ListofIP6Elements
{
OCT1 iEI,
BIT1 ext,
LIN1_2 lengthIndicator,
IP6_Elements iP6_Elements
} with {
variant (lengthIndicator) "LENGTHTO (iP6_Elements)";
variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B;
length2, ext = '0'B;)";
variant (ext,lengthIndicator) "FIELDORDER(msb)";
}
type record IP6_Element
{
OCT16 ipAddress,
OCT2 uDP_Port,
OCT1 signallingWeight,
OCT1 dataWeight
}
type record of IP6_Element IP6_Elements;
type record IP_Address_NS
{
OCT1 iEI,
OCT1 addressType,
IPAddress ipAddress
}with {
variant (ipAddress) "CROSSTAG
(
ip4Address, addressType = '01'O;
ip6Address, addressType = '02'O;
)"
};
type union IPAddress
{
OCT4 ip4Address,
OCT16 ip6Address
}
type record EndFlag
{
BIT1 eBIT,
BIT7 spare
}
type record ResetFlag
{
OCT1 iEI,
BIT1 resetBIT,
BIT7 spare
}
type record MaxNumberOfNSVCs
{
OCT1 iEI,
OCT2 maxNumberOfNSVCs
}
type record NumberOfIP_Endpoints
{
OCT1 iEI,
OCT2 numberOfIP_Endpoints
}
type record NSEI_NS
{
OCT1 iEI,
BIT1 ext,
LIN1_2 lengthIndicator,
OCT2 nSEI
} with {
variant (lengthIndicator) "LENGTHTO (nSEI)";
variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B;
length2, ext = '0'B;)";
variant (ext,lengthIndicator) "FIELDORDER(msb)";
}
type record NS_SDU_ControlBits
{
BIT1 rBit,
BIT1 cBit,
BIT6 spare
}
//same type def as LIN2_2a in BSSGP but named differently
type union LIN1_2
{
integer length1,
integer length2
} with {
variant (length1) "FIELDLENGTH(7)";
variant (length2) "FIELDLENGTH(15)";
variant (length2) "BYTEORDER(last)";
variant (length1,length2) "FIELDORDER(msb)"
}
// PDUs ************************************************************
type record PDU_NS_Alive
{
OCT1 nsPduType
}
type record PDU_NS_Alive_Ack
{
OCT1 nsPduType
}
type record PDU_NS_Block
{
OCT1 nsPduType,
CauseNS causeNS, //TLV
NS_VCI nS_VCI //TLV
}
type record PDU_NS_Block_Ack
{
OCT1 nsPduType,
NS_VCI nS_VCI //TLV
}
type record PDU_NS_Reset
{
OCT1 nsPduType,
CauseNS causeNS, //TLV
NS_VCI nS_VCI, //TLV
NSEI_NS nSEI_NS //TLV
}
type record PDU_NS_Reset_Ack
{
OCT1 nsPduType,
NS_VCI nS_VCI, //TLV
NSEI_NS nSEI_NS //TLV
}
type record PDU_NS_Status
{
OCT1 nsPduType,
CauseNS causeNS, //TLV
NS_VCI nS_VCI optional, //TLV
NS_PDU nS_PDU optional, //TLV
BVCI_NS bVCI_NS optional, //TLV
ListofIP4Elements listofIP4Elements optional, //TLV
ListofIP6Elements listofIP6Elements optional //TLV
} with {
variant "TAG (
nS_VCI, iEI = '01'O;
nS_PDU, iEI = '02'O;
bVCI_NS, iEI = '03'O;
listofIP4Elements, iEI = '05'O;
listofIP6Elements, iEI = '06'O
)"
}
type record PDU_NS_Unblock
{
OCT1 nsPduType
}
type record PDU_NS_Unblock_Ack
{
OCT1 nsPduType
}
type record PDU_NS_Unitdata
{
OCT1 nsPduType,
NS_SDU_ControlBits nS_SDU_ControlBits, //V
OCT2 bVCI, //V
octetstring nS_SDU //V
// decoder interprets all octets after the
// first 4 octets as NS SDU
}
type record PDU_SNS_Ack
{
OCT1 nsPduType,
NSEI_NS nSEI_NS, //TLV
integer transactionID, //V
CauseNS causeNS optional, //TLV
IP_Address_NS iP_Address_NS optional, //TV
ListofIP4Elements listofIP4Elements optional, //TLV
ListofIP6Elements listofIP6Elements optional //TLV
} with {
variant (transactionID) "FIELDLENGTH(8)";
variant "TAG (
causeNS, iEI = '00'O;
iP_Address_NS, iEI = '0B'O;
listofIP4Elements, iEI = '05'O;
listofIP6Elements, iEI = '06'O
)"
}
type record PDU_SNS_Add
{
OCT1 nsPduType,
NSEI_NS nSEI_NS, //TLV
integer transactionID, //V
ListofIP4Elements listofIP4Elements optional, //TLV
ListofIP6Elements listofIP6Elements optional //TLV
} with {
variant (transactionID) "FIELDLENGTH(8)";
variant "TAG (
listofIP4Elements, iEI = '05'O;
listofIP6Elements, iEI = '06'O
)"
}
type record PDU_SNS_ChangeWeight
{
OCT1 nsPduType,
NSEI_NS nSEI_NS, //TLV
integer transactionID, //V
ListofIP4Elements listofIP4Elements optional, //TLV
ListofIP6Elements listofIP6Elements optional //TLV
} with {
variant (transactionID) "FIELDLENGTH(8)";
variant "TAG (
listofIP4Elements, iEI = '05'O;
listofIP6Elements, iEI = '06'O
)"
}
type record PDU_SNS_Config
{
OCT1 nsPduType,
EndFlag endFlag, //V
NSEI_NS nSEI_NS, //TLV
ListofIP4Elements listofIP4Elements optional, //TLV
ListofIP6Elements listofIP6Elements optional //TLV
} with {
variant "TAG (
listofIP4Elements, iEI = '05'O;
listofIP6Elements, iEI = '06'O
)"
}
type record PDU_SNS_Config_Ack
{
OCT1 nsPduType,
NSEI_NS nSEI_NS, //TLV
CauseNS causeNS optional //TLV
} with {
variant "TAG (causeNS, iEI = '00'O;)"
}
type record PDU_SNS_Delete
{
OCT1 nsPduType,
NSEI_NS nSEI_NS, //TLV
integer transactionID, //V
IP_Address_NS iP_Address_NS optional, //TV
ListofIP4Elements listofIP4Elements optional, //TLV
ListofIP6Elements listofIP6Elements optional //TLV
} with {
variant (transactionID) "FIELDLENGTH(8)";
variant "TAG (
iP_Address_NS, iEI = '0B'O;
listofIP4Elements, iEI = '05'O;
listofIP6Elements, iEI = '06'O
)"
}
type record PDU_SNS_Size
{
OCT1 nsPduType,
NSEI_NS nSEI_NS, //TLV
ResetFlag resetFlag, //TV
MaxNumberOfNSVCs maxNumberOfNSVCs, //TV
NumberOfIP_Endpoints numberOfIP4_Endpoints optional, //TV
NumberOfIP_Endpoints numberOfIP6_Endpoints optional //TV
} with {
variant "TAG (
numberOfIP4_Endpoints, iEI = '08'O;
numberOfIP6_Endpoints, iEI = '09'O;
)"
}
type record PDU_SNS_Size_Ack
{
OCT1 nsPduType,
NSEI_NS nSEI_NS,
CauseNS causeNS optional //TLV
} with {
variant "TAG (causeNS, iEI = '00'O;)"
}
type union PDU_NS
{
PDU_NS_Alive pDU_NS_Alive,
PDU_NS_Alive_Ack pDU_NS_Alive_Ack,
PDU_NS_Block pDU_NS_Block,
PDU_NS_Block_Ack pDU_NS_Block_Ack,
PDU_NS_Reset pDU_NS_Reset,
PDU_NS_Reset_Ack pDU_NS_Reset_Ack,
PDU_NS_Status pDU_NS_Status,
PDU_NS_Unblock pDU_NS_Unblock,
PDU_NS_Unblock_Ack pDU_NS_Unblock_Ack,
PDU_NS_Unitdata pDU_NS_Unitdata,
PDU_SNS_Ack pDU_SNS_Ack,
PDU_SNS_Add pDU_SNS_Add,
PDU_SNS_ChangeWeight pDU_SNS_ChangeWeight,
PDU_SNS_Config pDU_SNS_Config,
PDU_SNS_Config_Ack pDU_SNS_Config_Ack,
PDU_SNS_Delete pDU_SNS_Delete,
PDU_SNS_Size pDU_SNS_Size,
PDU_SNS_Size_Ack pDU_SNS_Size_Ack
} with { variant "TAG (
pDU_NS_Alive, nsPduType ='0A'O;
pDU_NS_Alive_Ack, nsPduType ='0B'O;
pDU_NS_Block, nsPduType ='04'O;
pDU_NS_Block_Ack, nsPduType ='05'O;
pDU_NS_Reset, nsPduType ='02'O;
pDU_NS_Reset_Ack, nsPduType ='03'O;
pDU_NS_Status, nsPduType ='08'O;
pDU_NS_Unblock, nsPduType ='06'O;
pDU_NS_Unblock_Ack, nsPduType ='07'O;
pDU_NS_Unitdata, nsPduType ='00'O;
pDU_SNS_Ack, nsPduType ='0C'O;
pDU_SNS_Add, nsPduType ='0D'O;
pDU_SNS_ChangeWeight, nsPduType ='0E'O;
pDU_SNS_Config, nsPduType ='0F'O;
pDU_SNS_Config_Ack, nsPduType ='10'O;
pDU_SNS_Delete, nsPduType ='11'O;
pDU_SNS_Size, nsPduType ='12'O;
pDU_SNS_Size_Ack, nsPduType ='13'O
)"
}
}with{ encode "RAW"} // end of module
|