summaryrefslogtreecommitdiffstats
path: root/src/isode/pepsy/t1.py
blob: 0380e5e66398016797185d337f02c3135b57052f (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
380
381
382
383
384
385
386
387
388
389
390
391
-- $Header$
--
--
-- $Log$
-- Revision 1.1  1994/06/10 03:31:38  eichin
-- autoconfed isode for kerberos work
--
# Revision 1.1  1994/05/31 20:40:32  eichin
# reduced-isode release from /mit/isode/isode-subset/src
#
-- Revision 8.0  91/07/17  12:43:16  isode
-- Release 7.0
-- 
--

--
--				  NOTICE
--
--    Acquisition, use, and distribution of this module and related
--    materials are subject to the restrictions of a license agreement.
--    Consult the Preface in the User's Manual for the full terms of
--    this agreement.
--
--


T1 { joint-iso-ccitt rubbish(999) modid(1) } DEFINITIONS ::=


BEGIN

IMPORTS
	+ Info,
	+ Sset,
	+ Sseq,
	- Sany,
	+ Soid
		FROM T2
	Pepy-refs,
	Single-type,
	Repeated,
	Defined,
	CodeTest,
	AllSimples,
	UAction
		FROM T3;

-- Embedded Sequences test


    -- Test of Embedded Strings
Emb-Strings ::= SEQUENCE {
	atest INTEGER,
	btest OCTET STRING,
	ctest BIT STRING,
	big-test Strings,
	emb-test SEQUENCE {
	    em-int INTEGER,
	    em-oct OCTET STRING,
	    em-bit BIT STRING
	}
    }


Strings ::= SEQUENCE { -- Test Octet strings, bit strings and character
		       -- Strings in general
	ostring OCTET STRING,
	bstring BIT STRING,
	nstring NumericString,
	pstring PrintableString,
	tstring TeletexString,
	t61string T61String,
	vstring	VideotexString,
	vis-string VisibleString,
	i646string ISO646String,
	ia5string IA5String,
	graphstring GraphicString,
	genstring GeneralString
	}

Embedded ::= SEQUENCE {
	anMPDU MPDU,
	ei INTEGER
	}

MPDU ::=
	SEQUENCE {
	    a-seq SEQUENCE {
		fred [0] IMPLICIT INTEGER,

		    george BOOLEAN
	    }
	}

ServiceMPDU ::=
	SET {
	    a-set SET {
		    a-data [1] IMPLICIT BIT STRING,

		a-more-data [2] IMPLICIT INTEGER
	    },
	    b-set SET {
		    b-data [1] IMPLICIT BIT STRING,

		b-more-data [2] IMPLICIT INTEGER
	    }
	}
-- Implicit tags

Impl-Tags ::= SEQUENCE {
	i-impl [1] IMPLICIT INTEGER,
	o-impl [2] IMPLICIT OCTET STRING,
	b-impl [3] IMPLICIT BIT STRING,
	f-impl [4] IMPLICIT BOOLEAN,
	obj-impl [5] IMPLICIT Emb-Strings,

    -- Test of Embedded Strings
	i-emb-test [APPLICATION 88] IMPLICIT SEQUENCE {
	    i-em-int INTEGER,
	    i-em-oct OCTET STRING,
	    i-em-bit BIT STRING
	}
    }

-- Explicit tags

Expl-Tags ::= SEQUENCE {
	i-expl [1] INTEGER,
	o-expl [2] OCTET STRING,
	b-expl [3] BIT STRING,
	f-expl [4] BOOLEAN,
	obj-expl [5] Emb-Strings,

    -- Test of Embedded Strings
	i-exp-test [APPLICATION 88] SEQUENCE {
	    i-ex-int INTEGER,
	    i-ex-oct OCTET STRING,
	    i-ex-bit BIT STRING
	}
    }

  -- Test of Sequence of
Seqof-Test ::= SEQUENCE {
	sqof-test1 SEQUENCE OF Expl-Tags,
	stof-test1 SET OF Expl-Tags,
	i-test1 INTEGER,
	sqof-test2 SEQUENCE OF SEQUENCE {
	    sqof-in Expl-Tags,
	    sqof-i INTEGER,
	    sqof-o OCTET STRING
	},
	stof-test2 SET OF SEQUENCE {
	    stof-in Expl-Tags,
	    stof-i INTEGER,
	    stof-o OCTET STRING
	},
	i-test2 INTEGER
    }


   -- Test data for the Choice type
Choice-Test ::= SET {
	c1 CHOICE {
	i-c1 [1] IMPLICIT INTEGER,
	o-c1 [2] IMPLICIT OCTET STRING,
	b-c1 [3] IMPLICIT BIT STRING,
	f-c1 [4] IMPLICIT BOOLEAN,
	obj-c1 [5] IMPLICIT Emb-Strings
	},
	c2 CHOICE {
	i-c2 [6] INTEGER,
	o-c2 [7] OCTET STRING,
	b-c2 [8] BIT STRING,
	f-c2 [9] BOOLEAN,
	obj-c2 [10] Emb-Strings
	},
	c3 CHOICE {
	    seq-c3 SEQUENCE {
		seq-c3-in Expl-Tags,
		seq-c3-i INTEGER,
		seq-c3-o OCTET STRING
	    },
	    set-c3 SET {
		set-c3-in Expl-Tags,
		set-c3-i INTEGER,
		set-c3-o OCTET STRING
	    },
	    i-c3 INTEGER
	},
	c4 [12] IMPLICIT SEQUENCE {
	    c4-choice CHOICE {
		c4-i INTEGER,
		c4-obj [2] IMPLICIT Expl-Tags,
		c4-subch CHOICE {
		    sc-a-i [0] IMPLICIT INTEGER,
		    sc-b-i [1] IMPLICIT INTEGER
		}
	    }
	}


    }

  -- Test of Optional fields

Opt-Strings ::= SEQUENCE {
	a-opt INTEGER OPTIONAL,
	b-opt OCTET STRING,
	c-opt BIT STRING OPTIONAL,
	d-opt BOOLEAN OPTIONAL,
	e-opt NULL OPTIONAL,
	big-opt Strings OPTIONAL,
	emb-opt SEQUENCE {
	    oem-int INTEGER OPTIONAL,
	    oem-oct OCTET STRING OPTIONAL,
	    oem-bit BIT STRING OPTIONAL
	}	OPTIONAL,
	st-opt SET {
	    st-int0 [0] IMPLICIT INTEGER OPTIONAL,
	    st-int1 [1] IMPLICIT INTEGER OPTIONAL,
	    st-int2 [2] IMPLICIT INTEGER OPTIONAL
	}	OPTIONAL,
	obj-opt [APPLICATION 1] IMPLICIT  MPDU OPTIONAL,
	etag-opt [APPLICATION 2] INTEGER OPTIONAL,
	ch-opt CHOICE {
	    ch-1 [10] IMPLICIT INTEGER,
	    ch-2 [20] IMPLICIT INTEGER
	} OPTIONAL
    }

  -- Test of Default fields

Def-Strings ::= SEQUENCE {
	a-def INTEGER  { a-def-0 (0), a-def-1(1) } DEFAULT a-def-0,
	-- posy bug does not allow handling of 'xxx'b or 'xx'h notation
	-- so we don't use proper posy notation
	-- b-def OCTET STRING DEFAULT 'ff01ab20'h,
	b-def PrintableString   DEFAULT "hello, world",
	c-def BIT STRING  { c-def-one(3), c-def-two (1)}
		DEFAULT { c-def-one },
	okay BOOLEAN DEFAULT TRUE,
	e-def NULL DEFAULT NULL,
	big-def Strings,
	emb-def SEQUENCE {
	    colour INTEGER { red(1), green(2), yellow(3) } DEFAULT green,
	    oem-oct OCTET STRING OPTIONAL,
	    version BIT STRING { basic(0), patch1(1), patch2(2) }
		DEFAULT { basic }
	}    DEFAULT { red, { basic } },
	st-def SET {
	    wine [0] IMPLICIT INTEGER { claret(1), burgundy(2), moselle(3) }
		DEFAULT claret,
	    beer [1] IMPLICIT INTEGER { vb(0), fosters(1), hieneken(2) }
		DEFAULT vb,
	    spirit [2] IMPLICIT INTEGER { brandy(0), vodka(1), wisky(2) }
		DEFAULT vodka
	}	DEFAULT { vb, vodka }
    }

-- External References
--
E-ref	::= SEQUENCE {
    a-ref T2.Info,
    b-ref [APPLICATION 33] IMPLICIT T2.Info,
    c-ref [1] T1.Choice-Test,
    d-ref [2] T2.Info OPTIONAL,
    e-ref [APPLICATION 33] IMPLICIT T2.Info OPTIONAL
    }


-- Simple type optimisations of POSY/PEPY

 Bstring ::= [APPLICATION 8] BIT STRING

 Ostring ::= [31] IMPLICIT OCTET STRING

 Obj ::= [101] IMPLICIT MPDU

 Sset ::= SET

 Sseq ::= SEQUENCE

 Sany ::= ANY

 Soid ::= OBJECT IDENTIFIER


Optimised ::= SEQUENCE {
    o1 Bstring,
    o2 Ostring,
    o3 Obj,
    o4 [APPLICATION 3] IMPLICIT Sset OPTIONAL,
    [APPLICATION 21] SET {
	o5 [PRIVATE 9] IMPLICIT Sseq,
	o6 [PRIVATE 33] IMPLICIT Sany,
	o7 [PRIVATE 8] IMPLICIT Soid
    }
}

-- Use of External Simple types
Ext-Opt ::= SEQUENCE {
    o1 T2.Bstring,
    o2 T2.Ostring,
    o3 T2.Obj,
    o4 [PRIVATE 38] IMPLICIT T2.Sset OPTIONAL,
    [APPLICATION 21] SET {
	o5 [PRIVATE 1] IMPLICIT T2.Sseq,
	o6 [PRIVATE 2] IMPLICIT T2.Sany,
	o7 [PRIVATE 3] IMPLICIT T2.Soid
    }
}

-- External type and ANY usage

Ext-typ ::= SEQUENCE {
     ext EXTERNAL,
     a-ny	[APPLICATION 32] ANY,
     ext-impl	[PRIVATE 6] IMPLICIT EXTERNAL,
     any-impl	[APPLICATION 7] ANY,
     ext-expl	[PRIVATE 9] EXTERNAL,
     any-expl	[APPLICATION 10] ANY
   }

SExt ::= [PRIVATE 99] IMPLICIT EXTERNAL

-- check of posy's %[ name $ head %] stuff
Names ::=
	SEQUENCE {
	    SEQUENCE %[ seq_str $ ptr %] {
		fred [0] IMPLICIT INTEGER
	    }
	}

-- Test explicit tags as the first field of an object
Etags ::=
	[APPLICATION 3]
	   CHOICE {
		aE [0] IMPLICIT INTEGER,
		bE [1] IMPLICIT INTEGER
	    }

Stest ::=
    [APPLICATION 4] SET {
	    st1 Sint DEFAULT 33,
	    st2 Soctet DEFAULT "goodbye, world"
	}

Sint ::= INTEGER

Soctet ::= OCTET STRING

Simpl-test ::= SEQUENCE { si-t [23] IMPLICIT Sbstring }

Sbstring ::= BIT STRING { bit0(0), bit1(1), bit2(2) }

SStest ::= [101] IMPLICIT Simpl-test

Enum-type ::= ENUMERATED { pork(0), beef(1), chicken(3), lamb(-1) }

T-enum ::= SEQUENCE {
		ae1 Enum-type,
		ae2 [12] Enum-type,
		ae3 [13] IMPLICIT Enum-type,
		ae4 [15] IMPLICIT Enum-type DEFAULT chicken,
		ae5 Enum-type OPTIONAL
	    }
Real ::= REAL

T-real ::= SEQUENCE {
		r1 Real,
		r2 [99] Real,
		r3 [101] IMPLICIT Real,
		r4 [501] IMPLICIT Real DEFAULT { 31415962, 10, -7 },
		r5 Real OPTIONAL
	    }

T-pepy ::= T3.Pepy-refs

T3-Single ::= T3.Single-type

T3-Repeat ::= T3.Repeated

T3-Defined ::= T3.Defined

T3-CodeTest ::= T3.CodeTest

T3-AllSimples ::= T3.AllSimples

T3-UAction ::= T3.UAction

END