aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/asn1_SUITE_data/ValueTest.asn
blob: 156d23ee626d1296e97062c7498267f220e8ed99 (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
ValueTest DEFINITIONS AUTOMATIC TAGS ::=

BEGIN

--Criticality    ::= ENUMERATED { reject, ignore, notify }(reject)

--Ignore         ::= Criticality(ignore)

--SubCriticality ::= Criticality(reject|notify)

INNL ::= INTEGER {zero(0),one(1),ten(10)}
BSNNL ::= BIT STRING {zero(0),one(1),two(2)}
RadioButton ::= ENUMERATED {button1(0),button2(1),button3(2)}

-- OTP-6695
vANY ANY ::= INTEGER:12

-- basic type value test for coverage
vBOOLEAN BOOLEAN ::= TRUE
vINTEGER INTEGER ::= 12
vINTEGERNNL INNL ::= zero
vENUMERATED RadioButton ::= button1
vBS BSNNL ::= {zero,two}
vNULL NULL ::= NULL
vOS OCTET STRING ::= '313233'H

-- OBJECT IDENTIFIER
vOD OBJECT IDENTIFIER ::= {2 1 1}
one INTEGER ::= 1
integer-first OBJECT IDENTIFIER ::= {one 2}
rel-oid-1 RELATIVE-OID ::= {2 4 5}
include-roid OBJECT IDENTIFIER ::= {0 rel-oid-1}
include-oid OBJECT IDENTIFIER ::= {integer-first 1}
include-all OBJECT IDENTIFIER ::= {integer-first 1 rel-oid-1 42}

--Character strings
numericstring NumericString ::= "01234567"
printablestring PrintableString ::= "PrintableString"
visiblestring VisibleString ::= "VisibleString"
cr IA5String ::= {0,13}
ia5string1 IA5String ::= {"First line",cr, "Second line"}
ia5string2 IA5String ::= {{5,5},{4,4},{6,6}}
teletexstring TeletexString ::= "TeletexString"
videotexstring VideotexString ::= "VideotexString"
utctime UTCTime ::= "97100211-0500"
generalizedtime GeneralizedTime ::= "19971002103130.5"
objectdescriptor ObjectDescriptor ::= "ObjectDescriptor"
graphicstring GraphicString ::= "GraphicString"
generalstring GeneralString ::= "GeneralString"
bmpstring1 BMPString ::= "BMPString"
latinCapitalLetterA UniversalString ::= {0,0,0,65}
greekCapitalLetterSigma UniversalString ::= {0,0,3,145}
my-universalstring UniversalString ::= {"This is a capital A: ",
					latinCapitalLetterA,
					", and a capital sigma: ",
					greekCapitalLetterSigma,
					"; try and spot the difference!"}

-- Useful parameterized SEQUENCE.
ParamSeq{Type} ::= SEQUENCE {
    a Type
}

-- Integer values.
IntegerSeq ::= ParamSeq{INTEGER}
someInteger INTEGER ::= 42
integerSeq1 IntegerSeq ::= { a otherInteger }
otherInteger INTEGER ::= someInteger

--
-- Values from objects.
--
int-from-object-1 INTEGER ::= int-holder-2.&obj.&id
int-from-object-2 INTEGER ::= int-holder-2.&id

INT-HOLDER ::= CLASS {
  &id INTEGER UNIQUE,
  &obj INT-HOLDER OPTIONAL
} WITH SYNTAX {
  ID &id
  [OBJ &obj]
}

int-holder-1 INT-HOLDER ::= { ID 2 }
int-holder-2 INT-HOLDER ::= { ID 4 OBJ int-holder-1 }

II ::= INTEGER (int-from-object-1..int-from-object-2)

-- Recursive OCTET STRING definitions.

OS-HOLDER ::= CLASS {
  &id INTEGER UNIQUE,
  &os OCTET STRING
} WITH SYNTAX {
  ID &id OS &os
}

os-holder-1 OS-HOLDER ::= { ID 1 OS '4041FF'H }

OctetStringSeq ::= ParamSeq{OCTET STRING}

someOctetString OCTET STRING ::= '404142'H

octetStringSeq1 OctetStringSeq ::= { a someOctetString }
octetStringSeq2 OctetStringSeq ::= { a otherOctetString }
octetStringSeq3 OctetStringSeq ::= { a os-holder-1.&os }

otherOctetString OCTET STRING ::= someOctetString

os-1 OCTET STRING ::= os-2
os-2 OCTET STRING ::= os-holder-1.&os

END