Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
06b8d7aa
Commit
06b8d7aa
authored
Sep 23, 2004
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implemented unber - the ASN.1 BER Decoder
parent
60a1403a
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
511 additions
and
44 deletions
+511
-44
asn1c/Makefile.am
asn1c/Makefile.am
+3
-6
asn1c/Makefile.in
asn1c/Makefile.in
+16
-15
asn1c/README
asn1c/README
+2
-1
asn1c/asn1c.1
asn1c/asn1c.1
+4
-7
asn1c/asn1c.c
asn1c/asn1c.c
+5
-15
asn1c/unber.c
asn1c/unber.c
+481
-0
No files found.
asn1c/Makefile.am
View file @
06b8d7aa
...
...
@@ -10,18 +10,15 @@ AM_CPPFLAGS = \
-I
${top_srcdir}
/skeletons
\
-DDATADIR
=
\"
$(pkgdatadir)
\"
LDADD
=
\
asn1c_
LDADD
=
\
$(top_builddir)
/libasn1parser/libasn1parser.la
\
$(top_builddir)
/libasn1print/libasn1print.la
\
$(top_builddir)
/libasn1fix/libasn1fix.la
\
$(top_builddir)
/libasn1compiler/libasn1compiler.la
asn1c_SOURCES
=
asn1c.c
\
tlv_decoder.c tlv_decoder.h
bin_PROGRAMS
=
asn1c unber
bin_PROGRAMS
=
asn1c
dist_man1_MANS
=
asn1c.1
dist_man1_MANS
=
asn1c.1 unber.1
check_SCRIPTS
=
check-parsing.sh
TESTS
=
check-parsing.sh
...
...
asn1c/Makefile.in
View file @
06b8d7aa
...
...
@@ -14,7 +14,7 @@
@SET_MAKE@
SOURCES
=
$(asn1c_SOURCES)
SOURCES
=
asn1c.c unber.c
srcdir
=
@srcdir@
top_srcdir
=
@top_srcdir@
...
...
@@ -37,7 +37,7 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL
=
:
POST_UNINSTALL
=
:
host_triplet
=
@host@
bin_PROGRAMS
=
asn1c
$(EXEEXT)
bin_PROGRAMS
=
asn1c
$(EXEEXT)
unber
$(EXEEXT)
subdir
=
asn1c
DIST_COMMON
=
README
$(dist_man1_MANS)
$(srcdir)
/Makefile.am
\
$(srcdir)
/Makefile.in
...
...
@@ -51,18 +51,19 @@ CONFIG_CLEAN_FILES =
am__installdirs
=
"
$(DESTDIR)$(bindir)
"
"
$(DESTDIR)$(man1dir)
"
binPROGRAMS_INSTALL
=
$(INSTALL_PROGRAM)
PROGRAMS
=
$(bin_PROGRAMS)
am_asn1c_OBJECTS
=
asn1c.
$(OBJEXT)
tlv_decoder.
$(OBJEXT)
asn1c_OBJECTS
=
$(am_asn1c_OBJECTS)
asn1c_LDADD
=
$(LDADD)
asn1c_SOURCES
=
asn1c.c
asn1c_OBJECTS
=
asn1c.
$(OBJEXT)
asn1c_DEPENDENCIES
=
$(top_builddir)
/libasn1parser/libasn1parser.la
\
$(top_builddir)
/libasn1print/libasn1print.la
\
$(top_builddir)
/libasn1fix/libasn1fix.la
\
$(top_builddir)
/libasn1compiler/libasn1compiler.la
unber_SOURCES
=
unber.c
unber_OBJECTS
=
unber.
$(OBJEXT)
unber_LDADD
=
$(LDADD)
DEFAULT_INCLUDES
=
-I
.
-I
$(srcdir)
-I
$(top_builddir)
depcomp
=
$(SHELL)
$(top_srcdir)
/depcomp
am__depfiles_maybe
=
depfiles
@AMDEP_TRUE@
DEP_FILES
=
./
$(DEPDIR)
/asn1c.Po
\
@AMDEP_TRUE@ ./
$(DEPDIR)
/tlv_decoder.Po
@AMDEP_TRUE@
DEP_FILES
=
./
$(DEPDIR)
/asn1c.Po ./
$(DEPDIR)
/unber.Po
COMPILE
=
$(CC)
$(DEFS)
$(DEFAULT_INCLUDES)
$(INCLUDES)
$(AM_CPPFLAGS)
\
$(CPPFLAGS)
$(AM_CFLAGS)
$(CFLAGS)
LTCOMPILE
=
$(LIBTOOL)
--mode
=
compile
$(CC)
$(DEFS)
\
...
...
@@ -71,8 +72,8 @@ LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
CCLD
=
$(CC)
LINK
=
$(LIBTOOL)
--mode
=
link
$(CCLD)
$(AM_CFLAGS)
$(CFLAGS)
\
$(AM_LDFLAGS)
$(LDFLAGS)
-o
$@
SOURCES
=
$(asn1c_SOURCES)
DIST_SOURCES
=
$(asn1c_SOURCES)
SOURCES
=
asn1c.c unber.c
DIST_SOURCES
=
asn1c.c unber.c
RECURSIVE_TARGETS
=
all-recursive check-recursive dvi-recursive
\
html-recursive info-recursive install-data-recursive
\
install-exec-recursive install-info-recursive
\
...
...
@@ -205,16 +206,13 @@ AM_CPPFLAGS = \
-I
${top_srcdir}
/skeletons
\
-DDATADIR
=
\"
$(pkgdatadir)
\"
LDADD
=
\
asn1c_
LDADD
=
\
$(top_builddir)
/libasn1parser/libasn1parser.la
\
$(top_builddir)
/libasn1print/libasn1print.la
\
$(top_builddir)
/libasn1fix/libasn1fix.la
\
$(top_builddir)
/libasn1compiler/libasn1compiler.la
asn1c_SOURCES
=
asn1c.c
\
tlv_decoder.c tlv_decoder.h
dist_man1_MANS
=
asn1c.1
dist_man1_MANS
=
asn1c.1 unber.1
check_SCRIPTS
=
check-parsing.sh
TESTS
=
check-parsing.sh
EXTRA_DIST
=
check-parsing.sh
...
...
@@ -283,6 +281,9 @@ clean-binPROGRAMS:
asn1c$(EXEEXT)
:
$(asn1c_OBJECTS) $(asn1c_DEPENDENCIES)
@
rm
-f
asn1c
$(EXEEXT)
$(LINK)
$(asn1c_LDFLAGS)
$(asn1c_OBJECTS)
$(asn1c_LDADD)
$(LIBS)
unber$(EXEEXT)
:
$(unber_OBJECTS) $(unber_DEPENDENCIES)
@
rm
-f
unber
$(EXEEXT)
$(LINK)
$(unber_LDFLAGS)
$(unber_OBJECTS)
$(unber_LDADD)
$(LIBS)
mostlyclean-compile
:
-
rm
-f
*
.
$(OBJEXT)
...
...
@@ -291,7 +292,7 @@ distclean-compile:
-
rm
-f
*
.tab.c
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/asn1c.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/
tlv_decod
er.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/
unb
er.Po@am__quote@
.c.o
:
@am__fastdepCC_TRUE@
if
$(COMPILE)
-MT
$@
-MD
-MP
-MF
"$(DEPDIR)/$*.Tpo"
-c
-o
$@
$<;
\
...
...
asn1c/README
View file @
06b8d7aa
The ASN.1 Compiler
asn1c - The ASN.1 Compiler
unber - The ASN.1 BER Decoder
asn1c/asn1c.1
View file @
06b8d7aa
...
...
@@ -4,9 +4,8 @@
.TH ASN1C 1 "\*(Dt" "ASN.1 Compiler" "ASN.1 Compiler"
.SH NAME
asn1c \- ASN.1 Compiler
.ND ASN.1 compiler
.SH SYNOPSIS
asn1c [\fB\-E\fR [\fB-F\fR] | \fB\-P\fR | \fB\-R\fR
| \fB\-t\fR\fIdata-string\fR
]
asn1c [\fB\-E\fR [\fB-F\fR] | \fB\-P\fR | \fB\-R\fR]
[\fB\-S\fR\fIdir\fR]
[\fB\-W\fR\fIdebug-\fR...] [\fB\-f\fR\fIoption\fR...] [\fB\-p\fR\fIrint-\fR...]
\fIinfile\fR...
...
...
@@ -19,7 +18,6 @@ and other encoding standards.
\fIOverall Options\fR
\fB\-E \-F \-P \-R\fR
.BI "\-S " directory
.BI "\-t " data-string
.TP
\fIWarning Options\fR
.br
...
...
@@ -55,10 +53,6 @@ omitting the usual support code.
.TP
\fB\-S\fR \fIdirectory\fR
Use the specified directory with ASN.1 skeleton files.
.TP
\fB\-t\fR \fIdata-string\fR
Interpret the data-string as a sequence of hexadecimal values representing
the start of BER TLV encoding. Print the human readable explanation.
.SH WARNING OPTIONS
.TP
.B \-Werror
...
...
@@ -104,5 +98,8 @@ its internal understanding of subtype constraints.
.TP
.B \-print-lines
Generate "-- #line" comments in \fB-E\fR output.
.SH SEE ALSO
.TP
\&\fIunber\fR\|(1)
.SH AUTHORS
Lev Walkin <vlm@lionet.info>
asn1c/asn1c.c
View file @
06b8d7aa
...
...
@@ -19,9 +19,7 @@
#include <asn1c_compat.h>
/* Portable basename(3) and dirname(3) */
#include "tlv_decoder.h"
/* -t: decode TL[V?] string */
static
void
usage
(
char
*
av0
);
/* Print the Usage screen and exit(EX_USAGE) */
static
void
usage
(
const
char
*
av0
);
/* Print the Usage screen and exit */
#undef COPYRIGHT
#define COPYRIGHT \
...
...
@@ -45,7 +43,7 @@ main(int ac, char **av) {
/*
* Process command-line options.
*/
while
((
ch
=
getopt
(
ac
,
av
,
"EFf:hLPp:RS:
t:
vW:"
))
!=
-
1
)
while
((
ch
=
getopt
(
ac
,
av
,
"EFf:hLPp:RS:vW:"
))
!=
-
1
)
switch
(
ch
)
{
case
'E'
:
print_arg__print_out
=
1
;
...
...
@@ -97,10 +95,6 @@ main(int ac, char **av) {
case
'S'
:
skeletons_dir
=
optarg
;
break
;
case
't'
:
if
(
decode_tlv_from_string
(
optarg
))
exit
(
EX_DATAERR
);
exit
(
0
);
case
'v'
:
fprintf
(
stderr
,
"ASN.1 Compiler, v"
VERSION
"
\n
"
COPYRIGHT
);
exit
(
0
);
...
...
@@ -264,11 +258,11 @@ main(int ac, char **av) {
* Print the usage screen and exit(EX_USAGE).
*/
static
void
usage
(
char
*
av0
)
{
usage
(
c
onst
c
har
*
av0
)
{
fprintf
(
stderr
,
"ASN.1 Compiler, v"
VERSION
"
\n
"
COPYRIGHT
"Usage: %s [options]
infile
...
\n
"
"
Where [options] are
:
\n
"
"Usage: %s [options]
file
...
\n
"
"
Options
:
\n
"
" -E Run only the ASN.1 parser and print out the tree
\n
"
" -F During -E operation, also perform tree fixing
\n
"
"
\n
"
...
...
@@ -278,10 +272,6 @@ usage(char *av0) {
" (Default is
\"
%s
\"
)
\n
"
"
\n
"
" -t <data-string> Decode the given tag[/length] sequence
\n
"
" (e.g. -t
\"
bf 20
\"
)
\n
"
"
\n
"
" -Werror Treat warnings as errors; abort if any warning
\n
"
" -Wdebug-lexer Enable verbose debugging output from lexer
\n
"
" -Wdebug-fixer --//-- semantics processor
\n
"
...
...
asn1c/unber.c
0 → 100644
View file @
06b8d7aa
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment