Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asn1c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
qwebaby3
asn1c
Commits
1411d05e
Commit
1411d05e
authored
20 years ago
by
Lev Walkin
Browse files
Options
Downloads
Patches
Plain Diff
fixes
parent
dee61785
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/asn1c-usage.html
+33
-27
33 additions, 27 deletions
doc/asn1c-usage.html
doc/asn1c-usage.lyx
+21
-0
21 additions, 0 deletions
doc/asn1c-usage.lyx
doc/asn1c-usage.pdf
+0
-0
0 additions, 0 deletions
doc/asn1c-usage.pdf
with
54 additions
and
27 deletions
doc/asn1c-usage.html
+
33
−
27
View file @
1411d05e
...
@@ -8,7 +8,7 @@ original version by: Nikos Drakos, CBLU, University of Leeds
...
@@ -8,7 +8,7 @@ original version by: Nikos Drakos, CBLU, University of Leeds
<HEAD>
<HEAD>
<TITLE>
Using the Open Source ASN.1 Compiler
</TITLE>
<TITLE>
Using the Open Source ASN.1 Compiler
</TITLE>
<META
NAME=
"description"
CONTENT=
"Using the Open Source ASN.1 Compiler"
>
<META
NAME=
"description"
CONTENT=
"Using the Open Source ASN.1 Compiler"
>
<META
NAME=
"ASN.1, asn1c, compiler, BER, DER, XER
\
"
>
<META
NAME=
"
keywords"
CONTENT=
"
ASN.1, asn1c, compiler, BER, DER, XER"
>
...
@@ -586,7 +586,7 @@ language structures and surrounding maintenance code. For example,
...
@@ -586,7 +586,7 @@ language structures and surrounding maintenance code. For example,
the C structure which may be created by compiler to represent the
the C structure which may be created by compiler to represent the
simple
<I>
Rectangle
</I>
specification defined earlier in this document,
simple
<I>
Rectangle
</I>
specification defined earlier in this document,
may look like this
<A
NAME=
"tex2html2"
may look like this
<A
NAME=
"tex2html2"
HREF=
"#foot80
1
"
><SUP>
2.2
</SUP></A>
:
HREF=
"#foot80
3
"
><SUP>
2.2
</SUP></A>
:
<P>
<P>
...
@@ -612,8 +612,8 @@ Quick start</A>
...
@@ -612,8 +612,8 @@ Quick start</A>
<P>
<P>
After building and installing the compiler, the
<I>
asn1c
</I><A
NAME=
"tex2html4"
After building and installing the compiler, the
<I>
asn1c
</I><A
NAME=
"tex2html4"
HREF=
"#foot80
2
"
><SUP>
3.1
</SUP></A>
command may be used to compile the ASN.1 specification
<A
NAME=
"tex2html5"
HREF=
"#foot80
4
"
><SUP>
3.1
</SUP></A>
command may be used to compile the ASN.1 specification
<A
NAME=
"tex2html5"
HREF=
"#foot80
3
"
><SUP>
3.2
</SUP></A>
:
HREF=
"#foot80
5
"
><SUP>
3.2
</SUP></A>
:
<P>
<P>
...
@@ -679,7 +679,7 @@ the compiler's behavior.
...
@@ -679,7 +679,7 @@ the compiler's behavior.
<P>
<P>
<BR><P></P>
<BR><P></P>
<DIV
ALIGN=
"CENTER"
><A
NAME=
"80
6
"
></A>
<DIV
ALIGN=
"CENTER"
><A
NAME=
"80
8
"
></A>
<TABLE>
<TABLE>
<CAPTION><STRONG><A
NAME=
Table1
>
Table 1:
</A></STRONG>
<CAPTION><STRONG><A
NAME=
Table1
>
Table 1:
</A></STRONG>
The list of asn1c command line options
</CAPTION>
The list of asn1c command line options
</CAPTION>
...
@@ -823,7 +823,7 @@ be possible to compile everything with the single instruction:
...
@@ -823,7 +823,7 @@ be possible to compile everything with the single instruction:
<BLOCKQUOTE><PRE>
<BLOCKQUOTE><PRE>
cc
-o
rectangle
*.c
#
It
could
be
<I>
that
</I>
simple
<A
NAME=
"tex2html7"
cc
-o
rectangle
*.c
#
It
could
be
<I>
that
</I>
simple
<A
NAME=
"tex2html7"
HREF=
"#foot8
09
"
><SUP>
4.1
</SUP></A>
HREF=
"#foot8
11
"
><SUP>
4.1
</SUP></A>
</PRE>
</PRE>
</BLOCKQUOTE>
</BLOCKQUOTE>
...
@@ -874,37 +874,37 @@ There are several generic functions available:
...
@@ -874,37 +874,37 @@ There are several generic functions available:
<DD>
This is the generic
<I>
restartable
</I><A
NAME=
"tex2html8"
<DD>
This is the generic
<I>
restartable
</I><A
NAME=
"tex2html8"
HREF=
"#foot253"
><SUP>
4.2
</SUP></A>
BER decoder (Basic Encoding Rules). This decoder would create
HREF=
"#foot253"
><SUP>
4.2
</SUP></A>
BER decoder (Basic Encoding Rules). This decoder would create
and/or fill the target structure for you. Please refer to Section
and/or fill the target structure for you. Please refer to Section
[
<A
HREF=
"#sub:Decoding-BER"
>
Decoding
-
BER
</A>
].
[
<A
HREF=
"#sub:Decoding-BER"
>
Decoding
BER
</A>
].
</DD>
</DD>
<DT><STRONG>
der_encoder
</STRONG></DT>
<DT><STRONG>
der_encoder
</STRONG></DT>
<DD>
This is the generic DER encoder (Distinguished Encoding
<DD>
This is the generic DER encoder (Distinguished Encoding
Rules). This encoder will take the target structure and encode it
Rules). This encoder will take the target structure and encode it
into a series of bytes. Please refer to Section [
<A
HREF=
"#sub:Encoding-DER"
>
Encoding
-
DER
</A>
].
into a series of bytes. Please refer to Section [
<A
HREF=
"#sub:Encoding-DER"
>
Encoding
DER
</A>
].
</DD>
</DD>
<DT><STRONG>
xer_encoder
</STRONG></DT>
<DT><STRONG>
xer_encoder
</STRONG></DT>
<DD>
This is the generic XER encoder (XML Encoding Rules).
<DD>
This is the generic XER encoder (XML Encoding Rules).
This encoder will take the target structure and represent it as an
This encoder will take the target structure and represent it as an
XML (text) document. Please refer to Section [
<A
HREF=
"#sub:Encoding-XER"
>
Encoding
-
XER
</A>
].
XML (text) document. Please refer to Section [
<A
HREF=
"#sub:Encoding-XER"
>
Encoding
XER
</A>
].
</DD>
</DD>
<DT><STRONG>
check_constraints
</STRONG></DT>
<DT><STRONG>
check_constraints
</STRONG></DT>
<DD>
Check that the contents of the target structure
<DD>
Check that the contents of the target structure
are semantically valid and constrained to appropriate implicit or
are semantically valid and constrained to appropriate implicit or
explicit subtype constraints. Please refer to Section sub:Validating-the-target.
explicit subtype constraints. Please refer to Section
<A
HREF=
"#
sub:Validating-the-target
"
>
Validating the target
</A>
.
</DD>
</DD>
<DT><STRONG>
print_struct
</STRONG></DT>
<DT><STRONG>
print_struct
</STRONG></DT>
<DD>
This function convert the contents of the passed target
<DD>
This function convert the contents of the passed target
structure into human readable form. This form is not formal and cannot
structure into human readable form. This form is not formal and cannot
be converted back into the structure, but it may turn out to be useful
be converted back into the structure, but it may turn out to be useful
for debugging or quick-n-dirty printing. Please refer to Section [
<A
HREF=
"#sub:Printing-the-target"
>
Printing
-
the
-
target
</A>
].
for debugging or quick-n-dirty printing. Please refer to Section [
<A
HREF=
"#sub:Printing-the-target"
>
Printing
the
target
</A>
].
</DD>
</DD>
<DT><STRONG>
free_struct
</STRONG></DT>
<DT><STRONG>
free_struct
</STRONG></DT>
<DD>
This is a generic disposal which frees the target structure.
<DD>
This is a generic disposal which frees the target structure.
Please refer to Section [
<A
HREF=
"#sub:Freeing-the-target"
>
Freeing
-
the
-
target
</A>
].
Please refer to Section [
<A
HREF=
"#sub:Freeing-the-target"
>
Freeing
the
target
</A>
].
</DD>
</DD>
</DL>
</DL>
check_constraints Check that the contents of the target structure
check_constraints Check that the contents of the target structure
are semantically valid and constrained to appropriate implicit or
are semantically valid and constrained to appropriate implicit or
explicit subtype constraints. Please refer to Section sub:Validating-the-target.
explicit subtype constraints. Please refer to Section
<A
HREF=
"#
sub:Validating-the-target
"
>
Validating the target
</A>
.
<P>
<P>
Each of the above function takes the type descriptor (
<I>
asn_DEF_...
</I>
)
Each of the above function takes the type descriptor (
<I>
asn_DEF_...
</I>
)
...
@@ -958,7 +958,7 @@ decoded into the structure by the time something goes wrong.
...
@@ -958,7 +958,7 @@ decoded into the structure by the time something goes wrong.
Restartable decoding is a little bit trickier: you need to provide
Restartable decoding is a little bit trickier: you need to provide
the old target structure pointer (which might be already half-decoded)
the old target structure pointer (which might be already half-decoded)
and react on RC_WMORE return code. This will be explained later in
and react on RC_WMORE return code. This will be explained later in
Section sub:Decoding-BER
Section
<A
HREF=
"#
sub:Decoding-BER
"
>
Decoding BER
</A>
<P>
<P>
...
@@ -1132,7 +1132,7 @@ The XER stands for XML Encoding Rules, where XML, in turn, is eXtensible
...
@@ -1132,7 +1132,7 @@ The XER stands for XML Encoding Rules, where XML, in turn, is eXtensible
Markup Language, a text-based format for information exchange. The
Markup Language, a text-based format for information exchange. The
encoder routine API comes in two flavors: stdio-based and callback-based.
encoder routine API comes in two flavors: stdio-based and callback-based.
With the callback-based encoder, the encoding process is very similar
With the callback-based encoder, the encoding process is very similar
to the DER one, described in Section sub:Encoding-DER. The
to the DER one, described in Section
<A
HREF=
"#
sub:Encoding-DER
"
>
Encoding DER
</A>
. The
following example uses the definition of write_stream() from up there.
following example uses the definition of write_stream() from up there.
<P>
<P>
...
@@ -1144,7 +1144,7 @@ following example uses the definition of write_stream() from up there.
...
@@ -1144,7 +1144,7 @@ following example uses the definition of write_stream() from up there.
*
NOTE:
Do
not
copy
this
code
verbatim!
*
NOTE:
Do
not
copy
this
code
verbatim!
*
If
the
stdio
output
is
necessary,
*
If
the
stdio
output
is
necessary,
*
use
the
xer_fprint()
procedure
instead.
*
use
the
xer_fprint()
procedure
instead.
*
See
Section
sub:Printing-the-target.
*
See
Section
<A
HREF=
"#
sub:Printing-the-target
"
>
Printing the target
</A>
.
*/
*/
int
int
print_as_XML(FILE
*ostream,
Rectangle_t
*rect)
{
print_as_XML(FILE
*ostream,
Rectangle_t
*rect)
{
...
@@ -1162,7 +1162,7 @@ Please look into xer_encoder.h for the precise definition of xer_encode()
...
@@ -1162,7 +1162,7 @@ Please look into xer_encoder.h for the precise definition of xer_encode()
and related types.
and related types.
<P>
<P>
See Section [
<A
HREF=
"#sub:Printing-the-target"
>
Printing
-
the
-
target
</A>
] for the example of stdio-based
See Section [
<A
HREF=
"#sub:Printing-the-target"
>
Printing
the
target
</A>
] for the example of stdio-based
XML encoder and other pretty-printing suggestions.
XML encoder and other pretty-printing suggestions.
<P>
<P>
...
@@ -1226,7 +1226,7 @@ call:
...
@@ -1226,7 +1226,7 @@ call:
xer_fprint(stdout,
&
asn_DEF_Rectangle,
rect);
xer_fprint(stdout,
&
asn_DEF_Rectangle,
rect);
</PRE>
</PRE>
</BLOCKQUOTE>
</BLOCKQUOTE>
See Section sub:Encoding-XER for XML-related details.
See Section
<A
HREF=
"#
sub:Encoding-XER
"
>
Encoding XER
</A>
for XML-related details.
<P>
<P>
...
@@ -1617,10 +1617,10 @@ END
...
@@ -1617,10 +1617,10 @@ END
<LI>
Compile the file according to procedures shown in the previous chapter.
<LI>
Compile the file according to procedures shown in the previous chapter.
</LI>
</LI>
<LI>
Modify the Rectangle type processing routine (you can start with the
<LI>
Modify the Rectangle type processing routine (you can start with the
main() routine shown in the Section sec:A-Rectangle-Decoder)
main() routine shown in the Section
<A
HREF=
"#
sec:A-Rectangle-Decoder
"
>
A Rectangle Decoder
</A>
)
by placing the following snippet of code
<I>
before
</I>
encoding and/or
by placing the following snippet of code
<I>
before
</I>
encoding and/or
<I>
after
</I>
decoding the Rectangle type
<A
NAME=
"tex2html10"
<I>
after
</I>
decoding the Rectangle type
<A
NAME=
"tex2html10"
HREF=
"#foot87
4
"
><SUP>
6.1
</SUP></A>
:
HREF=
"#foot87
6
"
><SUP>
6.1
</SUP></A>
:
<P>
<P>
...
@@ -1648,15 +1648,21 @@ by placing the following snippet of code <I>before</I> encoding and/or
...
@@ -1648,15 +1648,21 @@ by placing the following snippet of code <I>before</I> encoding and/or
</LI>
</LI>
<LI>
Compile the resulting C code as shown in the previous chapters.
<LI>
Compile the resulting C code as shown in the previous chapters.
</LI>
</LI>
<LI>
Try to test the constraints checking code by assigning integer value
101 to the
<B>
.height
</B>
member of the Rectangle structure, or
a negative value to the
<B>
.width
</B>
member. In either case, the
program should print ''Constraint validation failed'' message, followed
by the short explanation why validation did not succeed.
</LI>
<LI>
Done.
<LI>
Done.
</LI>
</LI>
</OL>
</OL>
<H2><A
NAME=
"SECTION05000000000000000000"
>
<H2><A
NAME=
"SECTION05000000000000000000"
>
Bibliography
</A>
Bibliography
</A>
</H2><DL
COMPACT
><DD><P></P><DT><A
NAME=
"ASN1C"
>
ASN1C
</A>
</H2><DL
COMPACT
><DD><P></P><DT><A
NAME=
"ASN1C"
>
ASN1C
</A>
<DD>
The Open Source ASN.1 Compiler.
<A
HREF=
http://lionet.info/
>
http://lionet.info/
</A>
asn1c
<DD>
The Open Source ASN.1 Compiler.
<A
HREF=
http://lionet.info/
asn1c
>
http://lionet.info/asn1c
</A>
<P></P><DT><A
NAME=
"AONL"
>
AONL
</A>
<P></P><DT><A
NAME=
"AONL"
>
AONL
</A>
<DD>
Online ASN.1 Compiler.
<A
HREF=
http://lionet.info/asn1c/
>
http://lionet.info/asn1c/
</A>
asn1c.cgi
<DD>
Online ASN.1 Compiler.
<A
HREF=
http://lionet.info/asn1c/
asn1c.cgi
>
http://lionet.info/asn1c/asn1c.cgi
</A>
<P></P><DT><A
NAME=
"Dub00"
>
Dub00
</A>
<P></P><DT><A
NAME=
"Dub00"
>
Dub00
</A>
<DD>
Olivier Dubuisson --
<I>
ASN.1 Communication between heterogeneous
<DD>
Olivier Dubuisson --
<I>
ASN.1 Communication between heterogeneous
systems
</I>
-- Morgan Kaufmann Publishers, 2000.
<A
HREF=
http://asn1.elibel.tm.fr/en/book/
>
http://asn1.elibel.tm.fr/en/book/
</A>
.
systems
</I>
-- Morgan Kaufmann Publishers, 2000.
<A
HREF=
http://asn1.elibel.tm.fr/en/book/
>
http://asn1.elibel.tm.fr/en/book/
</A>
.
...
@@ -1674,7 +1680,7 @@ ISBN:0-12-6333361-0.
...
@@ -1674,7 +1680,7 @@ ISBN:0-12-6333361-0.
not a definitive factor.
not a definitive factor.
</DD>
</DD>
<DT><A
NAME=
"foot80
1
"
>
... this
</A><A
<DT><A
NAME=
"foot80
3
"
>
... this
</A><A
HREF=
"asn1c-usage.html#tex2html2"
><SUP>
2.2
</SUP></A></DT>
HREF=
"asn1c-usage.html#tex2html2"
><SUP>
2.2
</SUP></A></DT>
<DD><I>
-fnative-types
</I>
compiler option is used to produce basic C
<I>
int
</I>
<DD><I>
-fnative-types
</I>
compiler option is used to produce basic C
<I>
int
</I>
types instead of infinite width INTEGER_t structures. See
<A
HREF=
#Table1
>
Table 1
</A>
.
types instead of infinite width INTEGER_t structures. See
<A
HREF=
#Table1
>
Table 1
</A>
.
...
@@ -1686,19 +1692,19 @@ types instead of infinite width INTEGER_t structures. See <A HREF=#Table1>Table
...
@@ -1686,19 +1692,19 @@ types instead of infinite width INTEGER_t structures. See <A HREF=#Table1>Table
text (XML) based.
text (XML) based.
</DD>
</DD>
<DT><A
NAME=
"foot80
2
"
>
...asn1c
</A><A
<DT><A
NAME=
"foot80
4
"
>
...asn1c
</A><A
HREF=
"asn1c-usage.html#tex2html4"
><SUP>
3.1
</SUP></A></DT>
HREF=
"asn1c-usage.html#tex2html4"
><SUP>
3.1
</SUP></A></DT>
<DD>
The 1 symbol in asn
<B>
1
</B>
c is a digit, not an ''ell'' letter.
<DD>
The 1 symbol in asn
<B>
1
</B>
c is a digit, not an ''ell'' letter.
</DD>
</DD>
<DT><A
NAME=
"foot80
3
"
>
... specification
</A><A
<DT><A
NAME=
"foot80
5
"
>
... specification
</A><A
HREF=
"asn1c-usage.html#tex2html5"
><SUP>
3.2
</SUP></A></DT>
HREF=
"asn1c-usage.html#tex2html5"
><SUP>
3.2
</SUP></A></DT>
<DD>
This is probably
<B>
not
</B>
what you want to try out right now -
<DD>
This is probably
<B>
not
</B>
what you want to try out right now -
read through the rest of this chapter to find out about
<B>
-P
</B>
read through the rest of this chapter to find out about
<B>
-P
</B>
and
<B>
-R
</B>
options.
and
<B>
-R
</B>
options.
</DD>
</DD>
<DT><A
NAME=
"foot8
09
"
>
...that
simple
</A><A
<DT><A
NAME=
"foot8
11
"
>
...that
simple
</A><A
HREF=
"asn1c-usage.html#tex2html7"
><SUP>
4.1
</SUP></A></DT>
HREF=
"asn1c-usage.html#tex2html7"
><SUP>
4.1
</SUP></A></DT>
<DD>
Provided that you've also created a .c file with the
<I>
int main()
</I>
<DD>
Provided that you've also created a .c file with the
<I>
int main()
</I>
routine.
routine.
...
@@ -1717,7 +1723,7 @@ buffer to continue decoding.
...
@@ -1717,7 +1723,7 @@ buffer to continue decoding.
which aren't important for the size determination.
which aren't important for the size determination.
</DD>
</DD>
<DT><A
NAME=
"foot87
4
"
>
... type
</A><A
<DT><A
NAME=
"foot87
6
"
>
... type
</A><A
HREF=
"asn1c-usage.html#tex2html10"
><SUP>
6.1
</SUP></A></DT>
HREF=
"asn1c-usage.html#tex2html10"
><SUP>
6.1
</SUP></A></DT>
<DD>
Placing the constraint checking code
<I>
before
</I>
encoding helps
<DD>
Placing the constraint checking code
<I>
before
</I>
encoding helps
to make sure you know the data is correct and within constraints before
to make sure you know the data is correct and within constraints before
...
...
This diff is collapsed.
Click to expand it.
doc/asn1c-usage.lyx
+
21
−
0
View file @
1411d05e
...
@@ -3931,6 +3931,27 @@ n
...
@@ -3931,6 +3931,27 @@ n
Compile the resulting C code as shown in the previous chapters.
Compile the resulting C code as shown in the previous chapters.
\layout Enumerate
\layout Enumerate
Try to test the constraints checking code by assigning integer value 101
to the
\series bold
.height
\series default
member of the Rectangle structure, or a negative value to the
\series bold
.width
\series default
member.
In either case, the program should print
\begin_inset Quotes sld
\end_inset
Constraint validation failed
\begin_inset Quotes srd
\end_inset
message, followed by the short explanation why validation did not succeed.
\layout Enumerate
Done.
Done.
\layout Bibliography
\layout Bibliography
\bibitem [ASN1C]{ASN1C}
\bibitem [ASN1C]{ASN1C}
...
...
This diff is collapsed.
Click to expand it.
doc/asn1c-usage.pdf
+
0
−
0
View file @
1411d05e
No preview for this file type
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment