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
c34dc46f
Commit
c34dc46f
authored
20 years ago
by
Lev Walkin
Browse files
Options
Downloads
Patches
Plain Diff
extensions support
parent
2eeeedc2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
skeletons/constr_CHOICE.c
+40
-7
40 additions, 7 deletions
skeletons/constr_CHOICE.c
with
40 additions
and
7 deletions
skeletons/constr_CHOICE.c
+
40
−
7
View file @
c34dc46f
...
...
@@ -590,9 +590,11 @@ CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
* Phase 0: Check that the opening tag matches our expectations.
* Phase 1: Processing body and reacting on closing tag.
* Phase 2: Processing inner type.
* Phase 3: Only waiting for closing tag
* Phase 3: Only waiting for closing tag.
* Phase 4: Skipping unknown extensions.
* Phase 5: PHASED OUT
*/
for
(
edx
=
ctx
->
step
;
ctx
->
phase
<=
3
;)
{
for
(
edx
=
ctx
->
step
;
ctx
->
phase
<=
4
;)
{
pxer_chunk_type_e
ch_type
;
/* XER chunk type */
ssize_t
ch_size
;
/* Chunk size */
xer_check_tag_e
tcv
;
/* Tag check value */
...
...
@@ -653,6 +655,27 @@ CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
}
tcv
=
xer_check_tag
(
buf_ptr
,
ch_size
,
xml_tag
);
/* Skip the extensions section */
if
(
ctx
->
phase
==
4
)
{
ASN_DEBUG
(
"skip_unknown(%d, %ld)"
,
tcv
,
(
long
)
ctx
->
left
);
switch
(
xer_skip_unknown
(
tcv
,
&
ctx
->
left
))
{
case
-
1
:
ctx
->
phase
=
5
;
RETURN
(
RC_FAIL
);
continue
;
case
1
:
ctx
->
phase
=
3
;
case
0
:
XER_ADVANCE
(
ch_size
);
continue
;
case
2
:
ctx
->
phase
=
3
;
break
;
}
}
switch
(
tcv
)
{
case
XCT_BOTH
:
break
;
/* No CHOICE? */
...
...
@@ -660,7 +683,7 @@ CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
if
(
ctx
->
phase
!=
3
)
break
;
XER_ADVANCE
(
ch_size
);
ctx
->
phase
=
4
;
/* Phase out */
ctx
->
phase
=
5
;
/* Phase out */
RETURN
(
RC_OK
);
case
XCT_OPENING
:
if
(
ctx
->
phase
==
0
)
{
...
...
@@ -704,11 +727,21 @@ CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
/* It is expected extension */
if
(
specs
->
extensible
)
{
ASN_DEBUG
(
"Got anticipated extension, "
"but NOT IMPLEMENTED YET"
);
ASN_DEBUG
(
"Got anticipated extension"
);
/*
* TODO: implement skipping of extensions
* Check for (XCT_BOTH or XCT_UNKNOWN_BO)
* By using a mask. Only record a pure
* <opening> tags.
*/
if
(
tcv
&
XCT_CLOSING
)
{
/* Found </extension> without body */
ctx
->
phase
=
3
;
/* Terminating */
}
else
{
ctx
->
left
=
1
;
ctx
->
phase
=
4
;
/* Skip ...'s */
}
XER_ADVANCE
(
ch_size
);
continue
;
}
/* Fall through */
...
...
@@ -720,7 +753,7 @@ CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
break
;
}
ctx
->
phase
=
4
;
/* Phase out, just in case */
ctx
->
phase
=
5
;
/* Phase out, just in case */
RETURN
(
RC_FAIL
);
}
...
...
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