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
b36317c2
Commit
b36317c2
authored
Aug 12, 2005
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restructured member variable names
parent
2c14a696
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1032 additions
and
1008 deletions
+1032
-1008
libasn1compiler/asn1c_save.c
libasn1compiler/asn1c_save.c
+2
-2
libasn1fix/asn1fix.c
libasn1fix/asn1fix.c
+10
-10
libasn1fix/asn1fix_constr.c
libasn1fix/asn1fix_constr.c
+1
-1
libasn1fix/asn1fix_retrieve.c
libasn1fix/asn1fix_retrieve.c
+12
-12
libasn1parser/asn1p_module.c
libasn1parser/asn1p_module.c
+2
-2
libasn1parser/asn1p_module.h
libasn1parser/asn1p_module.h
+2
-2
libasn1parser/asn1p_xports.c
libasn1parser/asn1p_xports.c
+4
-4
libasn1parser/asn1p_xports.h
libasn1parser/asn1p_xports.h
+5
-2
libasn1parser/asn1p_y.c
libasn1parser/asn1p_y.c
+991
-971
libasn1parser/asn1p_y.h
libasn1parser/asn1p_y.h
+1
-0
libasn1print/asn1print.c
libasn1print/asn1print.c
+2
-2
No files found.
libasn1compiler/asn1c_save.c
View file @
b36317c2
...
@@ -208,7 +208,7 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps) {
...
@@ -208,7 +208,7 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps) {
" * From ASN.1 module
\"
%s
\"\n
"
" * From ASN.1 module
\"
%s
\"\n
"
" *
\t
found in
\"
%s
\"\n
"
" *
\t
found in
\"
%s
\"\n
"
" */
\n\n
"
,
" */
\n\n
"
,
arg
->
mod
->
Identifier
,
arg
->
mod
->
ModuleName
,
arg
->
mod
->
source_file_name
arg
->
mod
->
source_file_name
);
);
fprintf
(
fp_h
,
fprintf
(
fp_h
,
...
@@ -217,7 +217,7 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps) {
...
@@ -217,7 +217,7 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps) {
" * From ASN.1 module
\"
%s
\"\n
"
" * From ASN.1 module
\"
%s
\"\n
"
" *
\t
found in
\"
%s
\"\n
"
" *
\t
found in
\"
%s
\"\n
"
" */
\n\n
"
,
" */
\n\n
"
,
arg
->
mod
->
Identifier
,
arg
->
mod
->
ModuleName
,
arg
->
mod
->
source_file_name
arg
->
mod
->
source_file_name
);
);
...
...
libasn1fix/asn1fix.c
View file @
b36317c2
...
@@ -118,7 +118,7 @@ asn1f_fix_module__phase_1(arg_t *arg) {
...
@@ -118,7 +118,7 @@ asn1f_fix_module__phase_1(arg_t *arg) {
TQ_FOR
(
omod
,
&
arg
->
asn
->
modules
,
mod_next
)
{
TQ_FOR
(
omod
,
&
arg
->
asn
->
modules
,
mod_next
)
{
int
sameNames
;
int
sameNames
;
if
(
omod
==
arg
->
mod
)
break
;
if
(
omod
==
arg
->
mod
)
break
;
sameNames
=
strcmp
(
omod
->
Identifier
,
arg
->
mod
->
Identifier
)
?
0
:
1
;
sameNames
=
strcmp
(
omod
->
ModuleName
,
arg
->
mod
->
ModuleName
)
?
0
:
1
;
if
(
omod
->
module_oid
&&
arg
->
mod
->
module_oid
)
{
if
(
omod
->
module_oid
&&
arg
->
mod
->
module_oid
)
{
/* Compare only the OID. */
/* Compare only the OID. */
if
(
asn1p_oid_compare
(
omod
->
module_oid
,
if
(
asn1p_oid_compare
(
omod
->
module_oid
,
...
@@ -126,18 +126,18 @@ asn1f_fix_module__phase_1(arg_t *arg) {
...
@@ -126,18 +126,18 @@ asn1f_fix_module__phase_1(arg_t *arg) {
FATAL
(
"ASN.1 module %s in %s "
FATAL
(
"ASN.1 module %s in %s "
"has the same OBJECT IDENTIFIER"
"has the same OBJECT IDENTIFIER"
" as module %s"
,
" as module %s"
,
omod
->
Identifier
,
omod
->
ModuleName
,
omod
->
source_file_name
,
omod
->
source_file_name
,
arg
->
mod
->
Identifier
arg
->
mod
->
ModuleName
);
);
RET2RVAL
(
-
1
,
rvalue
);
RET2RVAL
(
-
1
,
rvalue
);
}
else
if
(
sameNames
)
{
}
else
if
(
sameNames
)
{
WARNING
(
"ASN.1 module %s is defined more than once, with different OIDs"
,
omod
->
Identifier
);
WARNING
(
"ASN.1 module %s is defined more than once, with different OIDs"
,
omod
->
ModuleName
);
RET2RVAL
(
1
,
rvalue
);
RET2RVAL
(
1
,
rvalue
);
}
}
}
else
if
(
sameNames
)
{
}
else
if
(
sameNames
)
{
FATAL
(
"ASN.1 module %s is defined more than once"
,
FATAL
(
"ASN.1 module %s is defined more than once"
,
omod
->
Identifier
);
omod
->
ModuleName
);
RET2RVAL
(
-
1
,
rvalue
);
RET2RVAL
(
-
1
,
rvalue
);
}
}
}
}
...
@@ -150,7 +150,7 @@ asn1f_fix_module__phase_1(arg_t *arg) {
...
@@ -150,7 +150,7 @@ asn1f_fix_module__phase_1(arg_t *arg) {
break
;
break
;
default:
default:
FATAL
(
"Module %s defined with ambiguous global tagging mode"
,
FATAL
(
"Module %s defined with ambiguous global tagging mode"
,
arg
->
mod
->
Identifier
);
arg
->
mod
->
ModuleName
);
RET2RVAL
(
-
1
,
rvalue
);
RET2RVAL
(
-
1
,
rvalue
);
}
}
...
@@ -162,7 +162,7 @@ asn1f_fix_module__phase_1(arg_t *arg) {
...
@@ -162,7 +162,7 @@ asn1f_fix_module__phase_1(arg_t *arg) {
break
;
break
;
case
MSF_unk_INSTRUCTIONS
:
case
MSF_unk_INSTRUCTIONS
:
WARNING
(
"Module %s defined with unrecognized "
WARNING
(
"Module %s defined with unrecognized "
"encoding reference"
,
arg
->
mod
->
Identifier
);
"encoding reference"
,
arg
->
mod
->
ModuleName
);
RET2RVAL
(
1
,
rvalue
);
RET2RVAL
(
1
,
rvalue
);
/* Fall through */
/* Fall through */
case
MSF_TAG_INSTRUCTIONS
:
case
MSF_TAG_INSTRUCTIONS
:
...
@@ -170,7 +170,7 @@ asn1f_fix_module__phase_1(arg_t *arg) {
...
@@ -170,7 +170,7 @@ asn1f_fix_module__phase_1(arg_t *arg) {
break
;
break
;
default:
default:
FATAL
(
"Module %s defined with ambiguous encoding reference"
,
FATAL
(
"Module %s defined with ambiguous encoding reference"
,
arg
->
mod
->
Identifier
);
arg
->
mod
->
ModuleName
);
RET2RVAL
(
-
1
,
rvalue
);
RET2RVAL
(
-
1
,
rvalue
);
}
}
...
@@ -452,10 +452,10 @@ asn1f_check_duplicate(arg_t *arg) {
...
@@ -452,10 +452,10 @@ asn1f_check_duplicate(arg_t *arg) {
"Please rename either instance to resolve the conflict"
,
"Please rename either instance to resolve the conflict"
,
arg
->
expr
->
Identifier
,
arg
->
expr
->
Identifier
,
arg
->
expr
->
_lineno
,
arg
->
expr
->
_lineno
,
arg
->
mod
->
Identifier
,
arg
->
mod
->
ModuleName
,
tmparg
.
expr
->
Identifier
,
tmparg
.
expr
->
Identifier
,
tmparg
.
expr
->
_lineno
,
tmparg
.
expr
->
_lineno
,
tmparg
.
mod
->
Identifier
,
tmparg
.
mod
->
ModuleName
,
diff_files
?
" ("
:
""
,
diff_files
?
" ("
:
""
,
diff_files
?
tmparg
.
mod
->
source_file_name
:
""
,
diff_files
?
tmparg
.
mod
->
source_file_name
:
""
,
diff_files
?
")"
:
""
diff_files
?
")"
:
""
...
...
libasn1fix/asn1fix_constr.c
View file @
b36317c2
...
@@ -446,7 +446,7 @@ _asn1f_compare_tags(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b) {
...
@@ -446,7 +446,7 @@ _asn1f_compare_tags(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b) {
"improper use of "
"improper use of "
"EXTENSIBILITY IMPLIED flag "
"EXTENSIBILITY IMPLIED flag "
"of module %s"
,
"of module %s"
,
arg
->
mod
->
Identifier
);
arg
->
mod
->
ModuleName
);
}
}
return
-
1
;
return
-
1
;
}
else
{
}
else
{
...
...
libasn1fix/asn1fix_retrieve.c
View file @
b36317c2
...
@@ -51,7 +51,7 @@ asn1f_lookup_in_imports(arg_t *arg, asn1p_module_t *mod, const char *name) {
...
@@ -51,7 +51,7 @@ asn1f_lookup_in_imports(arg_t *arg, asn1p_module_t *mod, const char *name) {
* Okay, right now we have a module name and, hopefully, an OID.
* Okay, right now we have a module name and, hopefully, an OID.
* Search the arg->asn for the specified module.
* Search the arg->asn for the specified module.
*/
*/
mod
=
asn1f_lookup_module
(
arg
,
xp
->
from
,
xp
->
from_
oid
);
mod
=
asn1f_lookup_module
(
arg
,
xp
->
from
ModuleName
,
xp
->
identifier
.
oid
);
if
(
mod
==
NULL
)
{
if
(
mod
==
NULL
)
{
/* Conditional debug */
/* Conditional debug */
if
(
!
(
arg
->
expr
->
_mark
&
TM_BROKEN
))
{
if
(
!
(
arg
->
expr
->
_mark
&
TM_BROKEN
))
{
...
@@ -59,7 +59,7 @@ asn1f_lookup_in_imports(arg_t *arg, asn1p_module_t *mod, const char *name) {
...
@@ -59,7 +59,7 @@ asn1f_lookup_in_imports(arg_t *arg, asn1p_module_t *mod, const char *name) {
FATAL
(
"Cannot find external module
\"
%s
\"
"
FATAL
(
"Cannot find external module
\"
%s
\"
"
"mentioned for "
"mentioned for "
"
\"
%s
\"
at line %d"
,
"
\"
%s
\"
at line %d"
,
xp
->
from
,
name
,
arg
->
expr
->
_lineno
);
xp
->
from
ModuleName
,
name
,
arg
->
expr
->
_lineno
);
}
}
/* ENOENT/ETOOMANYREFS */
/* ENOENT/ETOOMANYREFS */
return
NULL
;
return
NULL
;
...
@@ -97,7 +97,7 @@ asn1f_lookup_module(arg_t *arg, const char *module_name, asn1p_oid_t *oid) {
...
@@ -97,7 +97,7 @@ asn1f_lookup_module(arg_t *arg, const char *module_name, asn1p_oid_t *oid) {
* somewhere in the IMPORTS section AND OID is given.
* somewhere in the IMPORTS section AND OID is given.
*/
*/
TQ_FOR
(
xp
,
&
(
arg
->
mod
->
imports
),
xp_next
)
{
TQ_FOR
(
xp
,
&
(
arg
->
mod
->
imports
),
xp_next
)
{
if
(
strcmp
(
module_name
,
xp
->
from
))
if
(
strcmp
(
module_name
,
xp
->
from
ModuleName
))
continue
;
continue
;
if
(
oid
)
{
if
(
oid
)
{
FATAL
(
"Ambiguous reference: "
FATAL
(
"Ambiguous reference: "
...
@@ -111,7 +111,7 @@ asn1f_lookup_module(arg_t *arg, const char *module_name, asn1p_oid_t *oid) {
...
@@ -111,7 +111,7 @@ asn1f_lookup_module(arg_t *arg, const char *module_name, asn1p_oid_t *oid) {
* Yes, there is a renaming.
* Yes, there is a renaming.
* Make lookup use OID instead.
* Make lookup use OID instead.
*/
*/
oid
=
xp
->
from_
oid
;
oid
=
xp
->
identifier
.
oid
;
}
}
}
}
...
@@ -134,7 +134,7 @@ asn1f_lookup_module(arg_t *arg, const char *module_name, asn1p_oid_t *oid) {
...
@@ -134,7 +134,7 @@ asn1f_lookup_module(arg_t *arg, const char *module_name, asn1p_oid_t *oid) {
}
}
}
}
if
(
strcmp
(
module_name
,
mod
->
Identifier
)
==
0
)
if
(
strcmp
(
module_name
,
mod
->
ModuleName
)
==
0
)
return
mod
;
return
mod
;
}
}
...
@@ -167,7 +167,7 @@ asn1f_lookup_symbol(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
...
@@ -167,7 +167,7 @@ asn1f_lookup_symbol(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
DEBUG
(
"(%s) in %s for line %d"
,
DEBUG
(
"(%s) in %s for line %d"
,
asn1f_printable_reference
(
ref
),
asn1f_printable_reference
(
ref
),
mod
->
Identifier
,
mod
->
ModuleName
,
ref
->
_lineno
);
ref
->
_lineno
);
if
(
ref
->
comp_count
==
1
)
{
if
(
ref
->
comp_count
==
1
)
{
...
@@ -251,16 +251,16 @@ asn1f_lookup_symbol(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
...
@@ -251,16 +251,16 @@ asn1f_lookup_symbol(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
if
(
modulename
)
{
if
(
modulename
)
{
FATAL
(
"Module %s referred by %s in module %s "
FATAL
(
"Module %s referred by %s in module %s "
"does not contain the requested symbol"
,
"does not contain the requested symbol"
,
imports_from
->
Identifier
,
imports_from
->
ModuleName
,
asn1f_printable_reference
(
ref
),
asn1f_printable_reference
(
ref
),
mod
->
Identifier
);
mod
->
ModuleName
);
}
else
{
}
else
{
FATAL
(
"Module %s referred in IMPORTS section "
FATAL
(
"Module %s referred in IMPORTS section "
"for %s of module %s does not contain "
"for %s of module %s does not contain "
"the requested symbol"
,
"the requested symbol"
,
imports_from
->
Identifier
,
imports_from
->
ModuleName
,
asn1f_printable_reference
(
ref
),
asn1f_printable_reference
(
ref
),
mod
->
Identifier
);
mod
->
ModuleName
);
}
}
}
}
return
expr
;
return
expr
;
...
@@ -277,7 +277,7 @@ asn1f_lookup_symbol(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
...
@@ -277,7 +277,7 @@ asn1f_lookup_symbol(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
if
(
ref_tc
==
NULL
)
{
if
(
ref_tc
==
NULL
)
{
DEBUG
(
"Module
\"
%s
\"
does not contain
\"
%s
\"
"
DEBUG
(
"Module
\"
%s
\"
does not contain
\"
%s
\"
"
"mentioned at line %d: %s"
,
"mentioned at line %d: %s"
,
mod
->
Identifier
,
mod
->
ModuleName
,
identifier
,
identifier
,
ref
->
_lineno
,
ref
->
_lineno
,
strerror
(
errno
)
strerror
(
errno
)
...
@@ -406,7 +406,7 @@ asn1f_compatible_with_exports(arg_t *arg, asn1p_module_t *mod, const char *name)
...
@@ -406,7 +406,7 @@ asn1f_compatible_with_exports(arg_t *arg, asn1p_module_t *mod, const char *name)
arg
->
expr
->
_mark
|=
TM_BROKEN
;
arg
->
expr
->
_mark
|=
TM_BROKEN
;
FATAL
(
"EXPORTS section of module %s in %s "
FATAL
(
"EXPORTS section of module %s in %s "
"does not mention %s at line %d"
,
"does not mention %s at line %d"
,
mod
->
Identifier
,
mod
->
source_file_name
,
name
,
mod
->
ModuleName
,
mod
->
source_file_name
,
name
,
arg
->
expr
->
_lineno
);
arg
->
expr
->
_lineno
);
}
}
...
...
libasn1parser/asn1p_module.c
View file @
b36317c2
...
@@ -27,8 +27,8 @@ asn1p_module_free(asn1p_module_t *mod) {
...
@@ -27,8 +27,8 @@ asn1p_module_free(asn1p_module_t *mod) {
if
(
mod
)
{
if
(
mod
)
{
asn1p_expr_t
*
expr
;
asn1p_expr_t
*
expr
;
if
(
mod
->
Identifier
)
if
(
mod
->
ModuleName
)
free
(
mod
->
Identifier
);
free
(
mod
->
ModuleName
);
if
(
mod
->
module_oid
)
if
(
mod
->
module_oid
)
asn1p_oid_free
(
mod
->
module_oid
);
asn1p_oid_free
(
mod
->
module_oid
);
...
...
libasn1parser/asn1p_module.h
View file @
b36317c2
...
@@ -36,9 +36,9 @@ typedef struct asn1p_module_s {
...
@@ -36,9 +36,9 @@ typedef struct asn1p_module_s {
char
*
source_file_name
;
char
*
source_file_name
;
/*
/*
* Human-readable module
identifier
.
* Human-readable module
reference
.
*/
*/
char
*
Identifier
;
/* Module name */
char
*
ModuleName
;
/*
/*
* Unique module identifier, OID.
* Unique module identifier, OID.
...
...
libasn1parser/asn1p_xports.c
View file @
b36317c2
...
@@ -25,10 +25,10 @@ asn1p_xports_new() {
...
@@ -25,10 +25,10 @@ asn1p_xports_new() {
void
void
asn1p_xports_free
(
asn1p_xports_t
*
xp
)
{
asn1p_xports_free
(
asn1p_xports_t
*
xp
)
{
if
(
xp
)
{
if
(
xp
)
{
if
(
xp
->
from
)
if
(
xp
->
from
ModuleName
)
free
(
xp
->
from
);
free
(
xp
->
from
ModuleName
);
if
(
xp
->
from_
oid
)
if
(
xp
->
identifier
.
oid
)
asn1p_oid_free
(
xp
->
from_
oid
);
asn1p_oid_free
(
xp
->
identifier
.
oid
);
free
(
xp
);
free
(
xp
);
}
}
}
}
libasn1parser/asn1p_xports.h
View file @
b36317c2
...
@@ -17,8 +17,11 @@ typedef struct asn1p_xports_s {
...
@@ -17,8 +17,11 @@ typedef struct asn1p_xports_s {
/*
/*
* Module name and optional OID, occur after FROM.
* Module name and optional OID, occur after FROM.
*/
*/
char
*
from
;
/* Name of the module */
char
*
fromModuleName
;
/* Name of the module */
asn1p_oid_t
*
from_oid
;
/* Optional OID of the module */
struct
AssignedIdentifier
{
asn1p_oid_t
*
oid
;
/* Optional OID of the module */
asn1p_value_t
*
value
;
/* DefinedValue */
}
identifier
;
/*
/*
* Number of entities to import.
* Number of entities to import.
...
...
libasn1parser/asn1p_y.c
View file @
b36317c2
This source diff could not be displayed because it is too large. You can
view the blob
instead.
libasn1parser/asn1p_y.h
View file @
b36317c2
...
@@ -7,6 +7,7 @@ typedef union {
...
@@ -7,6 +7,7 @@ typedef union {
asn1p_constraint_t
*
a_constr
;
/* Constraint */
asn1p_constraint_t
*
a_constr
;
/* Constraint */
enum
asn1p_constraint_type_e
a_ctype
;
/* Constraint type */
enum
asn1p_constraint_type_e
a_ctype
;
/* Constraint type */
asn1p_xports_t
*
a_xports
;
/* IMports/EXports */
asn1p_xports_t
*
a_xports
;
/* IMports/EXports */
struct
AssignedIdentifier
a_aid
;
/* Assigned Identifier */
asn1p_oid_t
*
a_oid
;
/* Object Identifier */
asn1p_oid_t
*
a_oid
;
/* Object Identifier */
asn1p_oid_arc_t
a_oid_arc
;
/* Single OID's arc */
asn1p_oid_arc_t
a_oid_arc
;
/* Single OID's arc */
struct
asn1p_type_tag_s
a_tag
;
/* A tag */
struct
asn1p_type_tag_s
a_tag
;
/* A tag */
...
...
libasn1print/asn1print.c
View file @
b36317c2
...
@@ -65,9 +65,9 @@ asn1print_module(asn1p_t *asn, asn1p_module_t *mod, enum asn1print_flags flags)
...
@@ -65,9 +65,9 @@ asn1print_module(asn1p_t *asn, asn1p_module_t *mod, enum asn1print_flags flags)
if
(
flags
&
APF_PRINT_XML_DTD
)
if
(
flags
&
APF_PRINT_XML_DTD
)
printf
(
"<!-- ASN.1 module
\n
"
);
printf
(
"<!-- ASN.1 module
\n
"
);
printf
(
"%s "
,
mod
->
Identifier
);
printf
(
"%s "
,
mod
->
ModuleName
);
if
(
mod
->
module_oid
)
{
if
(
mod
->
module_oid
)
{
asn1print_oid
(
strlen
(
mod
->
Identifier
),
mod
->
module_oid
,
flags
);
asn1print_oid
(
strlen
(
mod
->
ModuleName
),
mod
->
module_oid
,
flags
);
printf
(
"
\n
"
);
printf
(
"
\n
"
);
}
}
...
...
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