1 (RCS control information is at the end of this file.)
4 Table encoder/decoder example README - MS 93
5 ------------------------------------
7 This directory contains an example that shows:
9 1. the process of creating and using tables.
10 2. examples of decoding, printing, and encoding.
13 To dive right in just type "make" in this directory. That will
14 create the "example" executable (you should have previously installed
15 the snacc and mkchdr progs and the table library).
21 and see what happens. Look in example.c and makefile to see how things
29 Q. What is a table? (also refered to a type table or type tree)
31 A. A table is simply a data structure that holds a description of
32 the types from an ASN.1 module. This table can then be used
33 by a number of "generic" routines to do ASN.1 related (BER
34 encoding/decoding) or other useful things such as printing
35 values, freeing values and whatever else you can dream up.
38 Q. How do I create a table from my ASN.1 source files?
40 A. Run snacc with the -T option, e.g.:
42 snacc -T mytbls.tt myMod1.asn1 myMod2.asn1
44 the above command will create the "mytbls.tt" file that
45 holds the descriptions of the ASN.1 types in the "myMod1.asn1"
46 and "myMod2.asn1" files. (look in the makefile in this directory)
49 Q. Why is there only a C interface to tables?
51 A. Time. Tables drivers create/read/free these types
52 without having seen a typedef for them. The C implementation
53 uses some assumptions about how structures etc. are allocated
54 and accessed. With C++ this is much more difficult. It can
55 be done but required more time than I had.
58 Q. Ok, tables sound great, what's the catch?
62 1. table driven encoding and decoding is something like
63 4 times slower than the C or C++ version.
64 (but tables are *way* smaller than the .o's for the compiled approach)
65 2. the ANY DEFINED BY stuff is not supported at all.
66 3. subtype information is not included in the tables (time crunch again)
67 (PER encoders/decoders will need the subtype info)
68 4. Values from the ASN.1 source are not included in the table.
70 If you have the time and skills, you can fix 2, 3 and 4. 1 is harder.
76 A. Look at the manual. (in .../doc/)
78 #-------------------------------------------------------------------------------
79 # $Header: /cvs/Darwin/Security/SecuritySNACCRuntime/tbl-example/README,v 1.1.1.1 2001/05/18 23:14:10 mb Exp $
81 # Revision 1.1.1.1 2001/05/18 23:14:10 mb
82 # Move from private repository to open source repository
84 # Revision 1.1.1.1 1999/03/16 18:06:54 aram
85 # Originals from SMIME Free Library.
87 # Revision 1.1 1997/02/15 19:33:24 rj