aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/asn1_SUITE_data/InfObjExtract.asn1
blob: c70303831ecd3cb96daf2d96da82dca5dc351a8a (plain) (blame)
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
InfObjExtract DEFINITIONS AUTOMATIC TAGS ::=
BEGIN

DATA-CLASS ::= CLASS {
  &id INTEGER UNIQUE,
  &Type
} WITH SYNTAX {
  ID &id
  TYPE &Type
}

data-object-1 DATA-CLASS ::= { ID 1 TYPE BOOLEAN }
data-object-2 DATA-CLASS ::= { ID 2 TYPE OCTET STRING }
data-object-3 DATA-CLASS ::= { ID 3 TYPE BIT STRING }

ObjSet DATA-CLASS ::= {
  holder-object-1.&obj |
  data-object-2 |
  data-object-3,
  ...
}

OBJ-SET DATA-CLASS ::= {
  holder-object-1.&obj |
  data-object-2 |
  data-object-3,
  ...
}

holder-object-1 HOLDER-CLASS ::= {
  OBJ data-object-1
}

holder-object-2 HOLDER-CLASS ::= {
  OBJ-SET {data-object-1}
}

holder-object-3 HOLDER-CLASS ::= {
  OBJ-SET {holder-object-2.&ObjSet}
}

-- Note: References to object sets with names in all uppercase/hyphens
-- may be represented differently compared to object sets with names
-- that contain lowercase letters. CAVEAT TESTOR.

HOLDER-OBJECTS HOLDER-CLASS ::= { holder-object-2 }
HolderObjects HOLDER-CLASS ::= { holder-object-3 }

holder-object-4 HOLDER-CLASS ::= {
  OBJ-SET { HOLDER-OBJECTS.&ObjSet }
}

holder-object-5 HOLDER-CLASS ::= {
  OBJ-SET { HolderObjects.&ObjSet }
}

holder-object-6 HOLDER-CLASS ::= {
  OBJ-SET { OBJ-SET }
}

holder-object-7 HOLDER-CLASS ::= {
  OBJ-SET { ObjSet  }
}

HOLDER-CLASS ::= CLASS {
  &obj DATA-CLASS OPTIONAL,
  &ObjSet DATA-CLASS OPTIONAL
} WITH SYNTAX {
  [OBJ &obj]
  [OBJ-SET &ObjSet]
}

TestSeq{DATA-CLASS:ObjectSet} ::= SEQUENCE {
  id DATA-CLASS.&id ({ObjectSet}),
  data DATA-CLASS.&Type ({ObjectSet}{@id})
}

DataSeq-1 ::= TestSeq{ {ObjSet} }
DataSeq-2 ::= TestSeq{ {holder-object-3.&ObjSet} }

DataSeq-3 ::= TestSeq{ {holder-object-4.&ObjSet} }
DataSeq-4 ::= TestSeq{ {holder-object-5.&ObjSet} }
DataSeq-5 ::= TestSeq{ {holder-object-6.&ObjSet} }
DataSeq-6 ::= TestSeq{ {holder-object-7.&ObjSet} }

--
-- Test ObjectSetFromObjects.
--

OBJ-CLASS ::= CLASS {
  &id INTEGER UNIQUE,
  &Data OPTIONAL,
  &Obj OBJ-CLASS OPTIONAL,
  &obj OBJ-CLASS OPTIONAL
}

obj-class-obj-1 OBJ-CLASS ::= { &id 1, &Data BOOLEAN }

obj-class-obj-2 OBJ-CLASS ::= { &id 2, &Data BOOLEAN,
			         &Obj {obj-class-obj-1} }

obj-class-obj-3 OBJ-CLASS ::= { &id 3, &Data BOOLEAN,
			         &obj {&id 99, &Obj {obj-class-obj-1}} }

obj-class-obj-4 OBJ-CLASS ::= { &id 4, &Data BOOLEAN, &obj obj-class-obj-2 }

obj-class-obj-5 OBJ-CLASS ::= { &id 5, &Data BOOLEAN,
		                &Obj {obj-class-obj-4.&obj} }

ObjClassSet OBJ-CLASS ::= { obj-class-obj-3.&obj.&Obj |
			    obj-class-obj-4.&Obj | -- Non-existing field
			    obj-class-obj-5.&Obj
			   }

TestObjClassSeq{OBJ-CLASS:ObjectSet} ::= SEQUENCE {
  id OBJ-CLASS.&id ({ObjectSet}),
  data OBJ-CLASS.&Data ({ObjectSet}{@id})
}

ObjClassSeq-1 ::= TestObjClassSeq{{ObjClassSet}}

--
-- Test several levels of inlined definitions.
--

obj-class-obj-6 OBJ-CLASS ::= { &id 6, &Obj {{&id 100, &Data INTEGER}},
		                &Data INTEGER }

END