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
a2abcaab
Commit
a2abcaab
authored
Jul 23, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add OER to -print-constraints
parent
4a06e6a8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
22 deletions
+34
-22
libasn1print/asn1print.c
libasn1print/asn1print.c
+19
-10
tests/135-oer-long-OK.asn1
tests/135-oer-long-OK.asn1
+15
-12
No files found.
libasn1print/asn1print.c
View file @
a2abcaab
...
...
@@ -483,17 +483,22 @@ asn1print_crange_value(asn1cnst_edge_t *edge, int as_char) {
}
static
int
asn1print_constraint_explain_type
(
asn1p_expr_type_e
expr_type
,
asn1p_constraint_t
*
ct
,
enum
asn1p_constraint_type_e
type
,
int
strict_PER_visible
)
{
asn1print_constraint_explain_type
(
asn1p_expr_type_e
expr_type
,
asn1p_constraint_t
*
ct
,
enum
asn1p_constraint_type_e
type
,
enum
cpr_flags
cpr
)
{
asn1cnst_range_t
*
range
;
int
as_char
=
(
type
==
ACT_CT_FROM
);
int
i
;
range
=
asn1constraint_compute_PER_range
(
expr_type
,
ct
,
type
,
0
,
0
,
strict_PER_visible
?
CPR_strict_PER_visibility
:
0
);
range
=
asn1constraint_compute_constraint_range
(
expr_type
,
ct
,
type
,
0
,
0
,
cpr
);
if
(
!
range
)
return
-
1
;
if
(
range
->
incompatible
||
(
strict_PER_visible
&&
range
->
not_PER_visible
))
{
if
(
range
->
incompatible
)
return
0
;
if
((
cpr
&
CPR_strict_OER_visibility
)
&&
range
->
not_OER_visible
)
{
asn1constraint_range_free
(
range
);
return
0
;
}
if
((
cpr
&
CPR_strict_PER_visibility
)
&&
range
->
not_PER_visible
)
{
asn1constraint_range_free
(
range
);
return
0
;
}
...
...
@@ -534,13 +539,13 @@ asn1print_constraint_explain_type(asn1p_expr_type_e expr_type, asn1p_constraint_
static
int
asn1print_constraint_explain
(
asn1p_expr_type_e
expr_type
,
asn1p_constraint_t
*
ct
,
int
s_PV
)
{
asn1p_constraint_t
*
ct
,
enum
cpr_flags
cpr
)
{
asn1print_constraint_explain_type
(
expr_type
,
ct
,
ACT_EL_RANGE
,
s_PV
);
asn1print_constraint_explain_type
(
expr_type
,
ct
,
ACT_EL_RANGE
,
cpr
);
safe_printf
(
" "
);
asn1print_constraint_explain_type
(
expr_type
,
ct
,
ACT_CT_SIZE
,
s_PV
);
asn1print_constraint_explain_type
(
expr_type
,
ct
,
ACT_CT_SIZE
,
cpr
);
safe_printf
(
" "
);
asn1print_constraint_explain_type
(
expr_type
,
ct
,
ACT_CT_FROM
,
s_PV
);
asn1print_constraint_explain_type
(
expr_type
,
ct
,
ACT_CT_FROM
,
cpr
);
return
0
;
}
...
...
@@ -755,10 +760,14 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
top_parent
->
Identifier
);
asn1print_constraint_explain
(
top_parent
->
expr_type
,
tc
->
combined_constraints
,
0
);
safe_printf
(
"
\n
-- OER-visible constraints (%s): "
,
top_parent
->
Identifier
);
asn1print_constraint_explain
(
top_parent
->
expr_type
,
tc
->
combined_constraints
,
CPR_strict_OER_visibility
);
safe_printf
(
"
\n
-- PER-visible constraints (%s): "
,
top_parent
->
Identifier
);
asn1print_constraint_explain
(
top_parent
->
expr_type
,
tc
->
combined_constraints
,
1
);
tc
->
combined_constraints
,
CPR_strict_PER_visibility
);
}
safe_printf
(
"
\n
"
);
}
...
...
tests/135-oer-long-OK.asn1
View file @
a2abcaab
...
...
@@ -9,22 +9,25 @@
ModuleOERLong
{ iso org(3) dod(6) internet (1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 135 }
DEFINITIONS
AUTOMATIC
TAGS ::=
DEFINITIONS
IMPLICIT
TAGS ::=
BEGIN
-- Supported only on 64-bit platforms.
T ::= SEQUENCE {
unsigned8 INTEGER (0..255), -- OER 1 byte
unsigned16 INTEGER (0..65535), -- OER 2 bytes
unsigned16stack INTEGER (0..32767)(0..255), -- OER 1 byte
unsigned16stack-ext INTEGER (0..32767)(0..255,...), -- OER 2 bytes
unsigned33 INTEGER (0..5000000000), -- OER 8 bytes
signed8 INTEGER (-128..127), -- OER 1 byte
signed16 INTEGER (-32768..32767), -- OER 2 bytes
signed16stack INTEGER (-32768..32767)(-128..127), -- OER 1 byte
signed16stack-ext INTEGER (-32768..32767)(-128..127,...), -- OER 2 b
signed32 INTEGER (-2000000000..2000000000), -- OER 4 bytes
signed33ext INTEGER (-4000000000..4000000000,...) -- OER vrble
unsigned8 [0] INTEGER (0..255), -- OER 1 byte
unsigned16 [1] INTEGER (0..65535), -- OER 2 bytes
unsigned16stack [2] INTEGER (0..32767)(0..255), -- OER 1 byte
unsigned16stack-ext [15] INTEGER (0..32767)(0..255,...), -- OER 2 bytes
unsigned33 [3] INTEGER (0..5000000000), -- OER 8 bytes
...,
signed8 [10] INTEGER (-128..127), -- OER 1 byte
signed16 [11] INTEGER (-32768..32767), -- OER 2 bytes
signed16stack [12] INTEGER (-32768..32767)(-128..127), -- OER 1 byte
signed16stack-ext [5] INTEGER (-32768..32767)(-128..127,...), -- OER 2 b
signed32 [7] INTEGER (-2000000000..2000000000), -- OER 4 bytes
signed33ext [8] INTEGER (-4000000000..4000000000,...),-- OER vrble
...,
minmax [6] INTEGER (MIN..MAX)
}
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