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
dc4376dc
Commit
dc4376dc
authored
Mar 16, 2006
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more advanced stuff with defaults
parent
d370e9f5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
5 deletions
+60
-5
libasn1fix/asn1fix_cws.c
libasn1fix/asn1fix_cws.c
+3
-4
libasn1fix/asn1fix_derefv.c
libasn1fix/asn1fix_derefv.c
+13
-0
libasn1fix/asn1fix_retrieve.c
libasn1fix/asn1fix_retrieve.c
+2
-1
tests/99-class-sample-OK.asn1
tests/99-class-sample-OK.asn1
+42
-0
No files found.
libasn1fix/asn1fix_cws.c
View file @
dc4376dc
...
...
@@ -138,11 +138,9 @@ _asn1f_parse_class_object_data(arg_t *arg, asn1p_expr_t *eclass,
chunk
->
content
.
token
,
buf
,
p
-
buf
);
ret
=
_asn1f_assign_cell_value
(
arg
,
row
,
cell
,
buf
,
p
);
if
(
ret
)
{
if
(
newpos
)
*
newpos
=
buf
;
return
ret
;
}
if
(
ret
)
return
ret
;
buf
=
p
;
if
(
newpos
)
*
newpos
=
buf
;
}
break
;
case
WC_OPTIONALGROUP
:
{
uint8_t
*
np
=
0
;
...
...
@@ -152,6 +150,7 @@ _asn1f_parse_class_object_data(arg_t *arg, asn1p_expr_t *eclass,
if
(
newpos
)
*
newpos
=
np
;
if
(
ret
&&
np
!=
buf
)
return
ret
;
buf
=
np
;
}
break
;
}
}
...
...
libasn1fix/asn1fix_derefv.c
View file @
dc4376dc
...
...
@@ -38,6 +38,19 @@ asn1f_fix_dereference_defaults(arg_t *arg) {
break
;
}
if
(
expr
->
expr_type
==
A1TC_CLASSFIELD_FTVFS
)
{
asn1p_expr_t
*
child
=
TQ_FIRST
(
&
expr
->
members
);
int
ret
;
assert
(
child
);
assert
(
child
->
marker
.
default_value
==
0
);
tmparg
.
expr
=
child
;
child
->
marker
.
default_value
=
expr
->
marker
.
default_value
;
ret
=
asn1f_fix_dereference_defaults
(
&
tmparg
);
expr
->
marker
.
default_value
=
child
->
marker
.
default_value
;
if
(
ret
==
0
)
return
0
;
/* Finished */
}
tmparg
.
expr
=
&
tmpexpr
;
tmpexpr
.
meta_type
=
AMT_VALUE
;
tmpexpr
.
marker
.
default_value
=
0
;
...
...
libasn1fix/asn1fix_retrieve.c
View file @
dc4376dc
...
...
@@ -248,7 +248,8 @@ asn1f_lookup_symbol(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
}
expr
=
asn1f_lookup_symbol
(
arg
,
imports_from
,
&
tmpref
);
if
(
!
expr
&&
!
(
arg
->
expr
->
_mark
&
TM_BROKEN
))
{
if
(
!
expr
&&
!
(
arg
->
expr
->
_mark
&
TM_BROKEN
)
&&
!
(
imports_from
->
_tags
&
MT_STANDARD_MODULE
))
{
arg
->
expr
->
_mark
|=
TM_BROKEN
;
if
(
modulename
)
{
FATAL
(
"Module %s referred by %s in module %s "
...
...
tests/99-class-sample-OK.asn1
0 → 100644
View file @
dc4376dc
-- OK: Everything is fine
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
-- .spelio.software.asn1c.test (9363.1.5.1)
-- .99
ModuleClassSample
{ iso org(3) dod(6) internet (1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 99 }
DEFINITIONS ::=
BEGIN
SAMPLE-CLASS ::= CLASS {
&id RELATIVE-OID UNIQUE,
&code ENUMERATED { request, response, status }
DEFAULT request,
&Type OPTIONAL
} WITH SYNTAX { [TYPE &Type] [WITH CODE &code] IDENTIFIED BY &id }
request-Whatever SAMPLE-CLASS
::= { IDENTIFIED BY request-whatever }
respond-Stuff SAMPLE-CLASS
::= { WITH CODE 1 IDENTIFIED BY response-stuff }
request-Status SAMPLE-CLASS
::= { TYPE SampleType WITH CODE 2 IDENTIFIED BY request-id }
request-Salt SAMPLE-CLASS
::= { TYPE Salt IDENTIFIED BY request-salt }
request-id RELATIVE-OID ::= { 1 1 1 }
request-salt RELATIVE-OID ::= { 1 1 1 }
request-whatever RELATIVE-OID ::= { 1 1 5 }
response-stuff RELATIVE-OID ::= { 2 0 1 }
SampleType ::= SEQUENCE { ... }
Salt ::= SET { ... }
END
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