1 -- .../asn1specs/tbl.asn1
3 -- TBL types describe ASN.1 data structures.
4 -- These can be used in generic, interpretive encoders/decoders.
5 -- Interpretive decoders are typically slower, but don't eat memory
6 -- with type-specific encoding and decoding code.
7 -- The tbl types can also be sent over the network
8 -- and allow dynamic re-configuration of encoders/decoders.
10 -- To understand how this type table structure is used
12 -- 1. .../compiler/core/gen-tbls.c
13 -- this will show you how various things are generated
14 -- from the big parse tree (asn1module.asn1).
15 -- Pay particular attention to the typeDefId use
17 -- 2. look in .../c-lib/makefile for an example of how you can
18 -- modify the tbl.h file generated from this module to suit
21 -- 3. look in .../tbl-tools/ptbl/pasn1.c to see how the
22 -- TBL data struct relates to the original ASN.1
26 -- Mike Sample, April 11, 1992
29 -- $Header: /cvs/Darwin/src/live/Security/SecuritySNACCRuntime/asn1specs/tbl.asn1,v 1.1.1.1 2001/05/18 23:14:05 mb Exp $
31 -- Revision 1.1.1.1 2001/05/18 23:14:05 mb
32 -- Move from private repository to open source repository
34 -- Revision 1.1.1.1 1999/03/16 18:05:56 aram
35 -- Originals from SMIME Free Library.
37 -- Revision 1.5 1997/06/19 09:17:13 wan
38 -- Added isPdu flag to tables. Added value range checks during parsing.
40 -- Revision 1.4 1997/05/07 15:18:33 wan
41 -- Added (limited) size constraints, bitstring and enumeration names to tables
43 -- Revision 1.3 1995/07/25 19:56:00 rj
44 -- introductory comments adjusted to match changed file names.
46 -- changed `_' to `-' in file names.
48 -- Revision 1.2 1994/08/28 09:54:18 rj
49 -- comment leader fixed.
51 -- Revision 1.1 1994/08/28 09:51:14 rj
61 TBL ::= --snacc isPdu:"TRUE" -- SEQUENCE
63 totalNumModules INTEGER, -- these totals can help allocation
64 totalNumTypeDefs INTEGER, -- when decoding (ie use arrays)
65 totalNumTypes INTEGER,
67 totalNumStrings INTEGER,
68 totalLenStrings INTEGER,
69 modules SEQUENCE OF TBLModule
72 TBLModule ::= SEQUENCE
74 name [0] IMPLICIT PrintableString,
75 id [1] IMPLICIT OBJECT IDENTIFIER OPTIONAL,
76 isUseful [2] IMPLICIT BOOLEAN, -- true if useful types module
77 typeDefs [3] IMPLICIT SEQUENCE OF TBLTypeDef
81 -- The typedefId is just an integer that uniquely identifies
82 -- each TBLTypeDef (type references use these as "pointers").
83 -- The typeDefId's in each module will have consecutive type ids.
84 -- The first typedef in a module will have the lowest Id and the
85 -- last typedef will have the highest. Thus if the first typedef
86 -- in a module has the id of 12 and the last typedef in that module
87 -- has the id of 27, the module contains the typdefs in the range
88 -- 12..27 (inclusive). This can be used to re-compute the
89 -- IMPORT information for modules in a type table.
91 -- (The LoadTBL routine hides this integer/ptr crap from the user
92 -- by adding real pointers to the tbl.h data structures where useful.
93 -- When loading, the typeDefIds are converted into these real ptrs)
95 TBLTypeDef ::= SEQUENCE
97 typeDefId TBLTypeDefId,
98 typeName PrintableString, -- OPTIONAL, I have forgotten why this is opt!
99 -- I can see no good reason for it
106 typeId [0] IMPLICIT TBLTypeId,
107 optional [1] IMPLICIT BOOLEAN,
108 tagList [2] IMPLICIT SEQUENCE OF TBLTag OPTIONAL,
109 content [3] TBLTypeContent,
110 fieldName [4] IMPLICIT PrintableString OPTIONAL,
111 constraint[5] IMPLICIT TBLRange OPTIONAL,
112 values [6] IMPLICIT TBLNamedNumberList OPTIONAL
115 TBLRange ::= SEQUENCE
117 from [0] IMPLICIT INTEGER,
118 to [1] IMPLICIT INTEGER
121 TBLNamedNumberList ::= SEQUENCE OF TBLNamedNumber
123 TBLNamedNumber ::= SEQUENCE
125 name [0] IMPLICIT PrintableString,
126 value [1] IMPLICIT INTEGER
129 TBLTypeContent ::= CHOICE
131 primType [0] IMPLICIT NULL,
132 elmts [1] IMPLICIT SEQUENCE OF TBLType,
133 typeRef [2] IMPLICIT TBLTypeRef
136 TBLTypeRef ::= SEQUENCE
138 typeDef TBLTypeDefId,
142 TBLTypeId ::= ENUMERATED
160 TBLTypeDefId ::= INTEGER
165 code INTEGER (0..MAX)
168 TBLTagClass ::= ENUMERATED { universal (0), application (1),
169 context (2), private (3) }