blob: f80bae8cfa77c3e02bdbd5d5978066a229e755f2 [file] [log] [blame]
Harald Welte9a8f5032017-07-25 08:23:52 +02001///////////////////////////////////////////////////////////////////////////////
2// //
3// Copyright Test Competence Center (TCC) ETH 2008 //
4// //
5// The copyright to the computer program(s) herein is the property of TCC. //
6// The program(s) may be used and/or copied only with the written permission //
7// of TCC or in accordance with the terms and conditions stipulated in the //
8// agreement/contract under which the program(s) has been supplied. //
9// //
10///////////////////////////////////////////////////////////////////////////////
11//
12// File: NS_Types.ttcn
13// Rev: R1A01
14// Prodnr: CNL 113 578
15// Updated: 2008-01-22
16// Contact: http://ttcn.ericsson.se
17// Reference: 3GPP TS 48.016 7.3.0
18
19module NS_Types
20{ // beginning of module
21
22// This module contains the Base Station System (BSS) Serving GPRS Support
23// Node (SGSN) interface Network Sevice protocol
24// 48.016 v7.3.0 with attributes for RAW encoding/decoding.
25//
26
27// History:
28// ********
29
30import from General_Types all;
31
32external function enc_PDU_NS(in PDU_NS pdu) return octetstring
33with { extension "prototype(convert)"
34 extension "encode(RAW)"
35 }
36
37external function dec_PDU_NS(in octetstring stream) return PDU_NS
38with { extension "prototype(convert)"
39 extension "decode(RAW)"
40 }
41
42type record CauseNS
43{
44OCT1 iEI,
45BIT1 ext,
46LIN1_2 lengthIndicator,
47OCT1 cause
48} with {
49 variant (lengthIndicator) "LENGTHTO (cause)";
50 variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B;
51 length2, ext = '0'B;)";
52 variant (ext,lengthIndicator) "FIELDORDER(msb)";
53 }
54
55type record NS_VCI
56{
57OCT1 iEI,
58BIT1 ext,
59LIN1_2 lengthIndicator,
60OCT2 nS_VCI
61} with {
62 variant (lengthIndicator) "LENGTHTO (nS_VCI)";
63 variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B;
64 length2, ext = '0'B;)";
65 variant (ext,lengthIndicator) "FIELDORDER(msb)";
66 }
67
68type record NS_PDU
69{
70OCT1 iEI,
71BIT1 ext,
72LIN1_2 lengthIndicator,
73octetstring ns_PDU
74} with {
75 variant (lengthIndicator) "LENGTHTO (ns_PDU)";
76 variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B;
77 length2, ext = '0'B;)";
78 variant (ext,lengthIndicator) "FIELDORDER(msb)";
79 }
80
81type record BVCI_NS
82{
83OCT1 iEI,
84BIT1 ext,
85LIN1_2 lengthIndicator,
86OCT2 bVCI
87} with {
88 variant (lengthIndicator) "LENGTHTO (bVCI)";
89 variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B;
90 length2, ext = '0'B;)";
91 variant (ext,lengthIndicator) "FIELDORDER(msb)";
92 }
93
94type record ListofIP4Elements
95{
96OCT1 iEI,
97BIT1 ext,
98LIN1_2 lengthIndicator,
99IP4_Elements iP4_Elements
100} with {
101 variant (lengthIndicator) "LENGTHTO (iP4_Elements)";
102 variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B;
103 length2, ext = '0'B;)";
104 variant (ext,lengthIndicator) "FIELDORDER(msb)";
105 }
106
107type record IP4_Element
108{
109OCT4 ipAddress,
110OCT2 uDP_Port,
111OCT1 signallingWeight,
112OCT1 dataWeight
113}
114
115type record of IP4_Element IP4_Elements;
116
117type record ListofIP6Elements
118{
119OCT1 iEI,
120BIT1 ext,
121LIN1_2 lengthIndicator,
122IP6_Elements iP6_Elements
123} with {
124 variant (lengthIndicator) "LENGTHTO (iP6_Elements)";
125 variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B;
126 length2, ext = '0'B;)";
127 variant (ext,lengthIndicator) "FIELDORDER(msb)";
128 }
129
130type record IP6_Element
131{
132OCT16 ipAddress,
133OCT2 uDP_Port,
134OCT1 signallingWeight,
135OCT1 dataWeight
136}
137
138type record of IP6_Element IP6_Elements;
139
140type record IP_Address_NS
141{
142OCT1 iEI,
143OCT1 addressType,
144IPAddress ipAddress
145}with {
146 variant (ipAddress) "CROSSTAG
147 (
148 ip4Address, addressType = '01'O;
149 ip6Address, addressType = '02'O;
150 )"
151};
152
153type union IPAddress
154{
155OCT4 ip4Address,
156OCT16 ip6Address
157}
158
159type record EndFlag
160{
161BIT1 eBIT,
162BIT7 spare
163}
164
165type record ResetFlag
166{
167OCT1 iEI,
168BIT1 resetBIT,
169BIT7 spare
170}
171
172type record MaxNumberOfNSVCs
173{
174OCT1 iEI,
175OCT2 maxNumberOfNSVCs
176}
177
178type record NumberOfIP_Endpoints
179{
180OCT1 iEI,
181OCT2 numberOfIP_Endpoints
182}
183
184
185type record NSEI_NS
186{
187OCT1 iEI,
188BIT1 ext,
189LIN1_2 lengthIndicator,
190OCT2 nSEI
191} with {
192 variant (lengthIndicator) "LENGTHTO (nSEI)";
193 variant (lengthIndicator) "CROSSTAG( length1, ext = '1'B;
194 length2, ext = '0'B;)";
195 variant (ext,lengthIndicator) "FIELDORDER(msb)";
196 }
197
198type record NS_SDU_ControlBits
199{
200BIT1 rBit,
201BIT1 cBit,
202BIT6 spare
203}
204
205//same type def as LIN2_2a in BSSGP but named differently
206type union LIN1_2
207{
208integer length1,
209integer length2
210} with {
211 variant (length1) "FIELDLENGTH(7)";
212 variant (length2) "FIELDLENGTH(15)";
213 variant (length2) "BYTEORDER(last)";
214 variant (length1,length2) "FIELDORDER(msb)"
215 }
216
217
218// PDUs ************************************************************
219
220
221type record PDU_NS_Alive
222{
223OCT1 nsPduType
224}
225
226type record PDU_NS_Alive_Ack
227{
228OCT1 nsPduType
229}
230
231type record PDU_NS_Block
232{
233OCT1 nsPduType,
234CauseNS causeNS, //TLV
235NS_VCI nS_VCI //TLV
236}
237
238type record PDU_NS_Block_Ack
239{
240OCT1 nsPduType,
241NS_VCI nS_VCI //TLV
242}
243
244type record PDU_NS_Reset
245{
246OCT1 nsPduType,
247CauseNS causeNS, //TLV
248NS_VCI nS_VCI, //TLV
249NSEI_NS nSEI_NS //TLV
250}
251
252type record PDU_NS_Reset_Ack
253{
254OCT1 nsPduType,
255NS_VCI nS_VCI, //TLV
256NSEI_NS nSEI_NS //TLV
257}
258
259type record PDU_NS_Status
260{
261OCT1 nsPduType,
262CauseNS causeNS, //TLV
263NS_VCI nS_VCI optional, //TLV
264NS_PDU nS_PDU optional, //TLV
265BVCI_NS bVCI_NS optional, //TLV
266ListofIP4Elements listofIP4Elements optional, //TLV
267ListofIP6Elements listofIP6Elements optional //TLV
268} with {
269 variant "TAG (
270 nS_VCI, iEI = '01'O;
271 nS_PDU, iEI = '02'O;
272 bVCI_NS, iEI = '03'O;
273 listofIP4Elements, iEI = '05'O;
274 listofIP6Elements, iEI = '06'O
275 )"
276}
277
278type record PDU_NS_Unblock
279{
280OCT1 nsPduType
281}
282
283type record PDU_NS_Unblock_Ack
284{
285OCT1 nsPduType
286}
287
288type record PDU_NS_Unitdata
289{
290OCT1 nsPduType,
291NS_SDU_ControlBits nS_SDU_ControlBits, //V
292OCT2 bVCI, //V
293octetstring nS_SDU //V
294// decoder interprets all octets after the
295// first 4 octets as NS SDU
296}
297
298type record PDU_SNS_Ack
299{
300OCT1 nsPduType,
301NSEI_NS nSEI_NS, //TLV
302integer transactionID, //V
303CauseNS causeNS optional, //TLV
304IP_Address_NS iP_Address_NS optional, //TV
305ListofIP4Elements listofIP4Elements optional, //TLV
306ListofIP6Elements listofIP6Elements optional //TLV
307} with {
308 variant (transactionID) "FIELDLENGTH(8)";
309 variant "TAG (
310 causeNS, iEI = '00'O;
311 iP_Address_NS, iEI = '0B'O;
312 listofIP4Elements, iEI = '05'O;
313 listofIP6Elements, iEI = '06'O
314 )"
315}
316
317type record PDU_SNS_Add
318{
319OCT1 nsPduType,
320NSEI_NS nSEI_NS, //TLV
321integer transactionID, //V
322ListofIP4Elements listofIP4Elements optional, //TLV
323ListofIP6Elements listofIP6Elements optional //TLV
324} with {
325 variant (transactionID) "FIELDLENGTH(8)";
326 variant "TAG (
327 listofIP4Elements, iEI = '05'O;
328 listofIP6Elements, iEI = '06'O
329 )"
330}
331
332type record PDU_SNS_ChangeWeight
333{
334OCT1 nsPduType,
335NSEI_NS nSEI_NS, //TLV
336integer transactionID, //V
337ListofIP4Elements listofIP4Elements optional, //TLV
338ListofIP6Elements listofIP6Elements optional //TLV
339} with {
340 variant (transactionID) "FIELDLENGTH(8)";
341 variant "TAG (
342 listofIP4Elements, iEI = '05'O;
343 listofIP6Elements, iEI = '06'O
344 )"
345}
346
347type record PDU_SNS_Config
348{
349OCT1 nsPduType,
350EndFlag endFlag, //V
351NSEI_NS nSEI_NS, //TLV
352ListofIP4Elements listofIP4Elements optional, //TLV
353ListofIP6Elements listofIP6Elements optional //TLV
354} with {
355 variant "TAG (
356 listofIP4Elements, iEI = '05'O;
357 listofIP6Elements, iEI = '06'O
358 )"
359}
360
361
362
363type record PDU_SNS_Config_Ack
364{
365OCT1 nsPduType,
366NSEI_NS nSEI_NS, //TLV
367CauseNS causeNS optional //TLV
368} with {
369 variant "TAG (causeNS, iEI = '00'O;)"
370}
371
372
373
374type record PDU_SNS_Delete
375{
376OCT1 nsPduType,
377NSEI_NS nSEI_NS, //TLV
378integer transactionID, //V
379IP_Address_NS iP_Address_NS optional, //TV
380ListofIP4Elements listofIP4Elements optional, //TLV
381ListofIP6Elements listofIP6Elements optional //TLV
382} with {
383 variant (transactionID) "FIELDLENGTH(8)";
384 variant "TAG (
385 iP_Address_NS, iEI = '0B'O;
386 listofIP4Elements, iEI = '05'O;
387 listofIP6Elements, iEI = '06'O
388 )"
389}
390
391type record PDU_SNS_Size
392{
393OCT1 nsPduType,
394NSEI_NS nSEI_NS, //TLV
395ResetFlag resetFlag, //TV
396MaxNumberOfNSVCs maxNumberOfNSVCs, //TV
397NumberOfIP_Endpoints numberOfIP4_Endpoints optional, //TV
398NumberOfIP_Endpoints numberOfIP6_Endpoints optional //TV
399} with {
400 variant "TAG (
401 numberOfIP4_Endpoints, iEI = '08'O;
402 numberOfIP6_Endpoints, iEI = '09'O;
403 )"
404}
405
406
407type record PDU_SNS_Size_Ack
408{
409OCT1 nsPduType,
410NSEI_NS nSEI_NS,
411CauseNS causeNS optional //TLV
412} with {
413 variant "TAG (causeNS, iEI = '00'O;)"
414}
415
416
417
418type union PDU_NS
419{
420
421PDU_NS_Alive pDU_NS_Alive,
422PDU_NS_Alive_Ack pDU_NS_Alive_Ack,
423PDU_NS_Block pDU_NS_Block,
424PDU_NS_Block_Ack pDU_NS_Block_Ack,
425PDU_NS_Reset pDU_NS_Reset,
426PDU_NS_Reset_Ack pDU_NS_Reset_Ack,
427PDU_NS_Status pDU_NS_Status,
428PDU_NS_Unblock pDU_NS_Unblock,
429PDU_NS_Unblock_Ack pDU_NS_Unblock_Ack,
430PDU_NS_Unitdata pDU_NS_Unitdata,
431PDU_SNS_Ack pDU_SNS_Ack,
432PDU_SNS_Add pDU_SNS_Add,
433PDU_SNS_ChangeWeight pDU_SNS_ChangeWeight,
434PDU_SNS_Config pDU_SNS_Config,
435PDU_SNS_Config_Ack pDU_SNS_Config_Ack,
436PDU_SNS_Delete pDU_SNS_Delete,
437PDU_SNS_Size pDU_SNS_Size,
438PDU_SNS_Size_Ack pDU_SNS_Size_Ack
439
440} with { variant "TAG (
441
442 pDU_NS_Alive, nsPduType ='0A'O;
443 pDU_NS_Alive_Ack, nsPduType ='0B'O;
444 pDU_NS_Block, nsPduType ='04'O;
445 pDU_NS_Block_Ack, nsPduType ='05'O;
446 pDU_NS_Reset, nsPduType ='02'O;
447 pDU_NS_Reset_Ack, nsPduType ='03'O;
448 pDU_NS_Status, nsPduType ='08'O;
449 pDU_NS_Unblock, nsPduType ='06'O;
450 pDU_NS_Unblock_Ack, nsPduType ='07'O;
451 pDU_NS_Unitdata, nsPduType ='00'O;
452 pDU_SNS_Ack, nsPduType ='0C'O;
453 pDU_SNS_Add, nsPduType ='0D'O;
454 pDU_SNS_ChangeWeight, nsPduType ='0E'O;
455 pDU_SNS_Config, nsPduType ='0F'O;
456 pDU_SNS_Config_Ack, nsPduType ='10'O;
457 pDU_SNS_Delete, nsPduType ='11'O;
458 pDU_SNS_Size, nsPduType ='12'O;
459 pDU_SNS_Size_Ack, nsPduType ='13'O
460
461 )"
462}
463
464
465}with{ encode "RAW"} // end of module