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
1893ddfb
Commit
1893ddfb
authored
Mar 20, 2005
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parsing support for CONSTRAINED BY
parent
6ffb0141
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
1486 additions
and
1421 deletions
+1486
-1421
ChangeLog
ChangeLog
+1
-0
TODO
TODO
+3
-3
libasn1fix/asn1fix_constraint_compat.c
libasn1fix/asn1fix_constraint_compat.c
+2
-0
libasn1parser/asn1p_constr.c
libasn1parser/asn1p_constr.c
+2
-0
libasn1parser/asn1p_constr.h
libasn1parser/asn1p_constr.h
+1
-0
libasn1parser/asn1p_l.c
libasn1parser/asn1p_l.c
+888
-883
libasn1parser/asn1p_l.l
libasn1parser/asn1p_l.l
+1
-1
libasn1parser/asn1p_y.c
libasn1parser/asn1p_y.c
+552
-530
libasn1parser/asn1p_y.y
libasn1parser/asn1p_y.y
+11
-3
libasn1print/asn1print.c
libasn1print/asn1print.c
+5
-0
tests/34-class-OK.asn1.-EF
tests/34-class-OK.asn1.-EF
+1
-1
tests/79-constrained-by-OK.asn1
tests/79-constrained-by-OK.asn1
+19
-0
No files found.
ChangeLog
View file @
1893ddfb
...
...
@@ -5,6 +5,7 @@
* More RFC variations supported in crfc2asn1.pl.
* Refined string values compatibility. (Test cases 77, 78).
* Support for ContainedSubtype constraints. (Test case 16).
* Parsing support for CONSTRAINED BY. (Test case 79).
0.9.12: 2005-Mar-10
...
...
TODO
View file @
1893ddfb
...
...
@@ -10,9 +10,9 @@ which is already completed. Also see #3.2.
2. MEDIUM:
2.1 Support for
DEFAULT encoding and decoding, at least in INTEGER/ENUMERATED
types.
2.2 Support for EXTERNAL, EMBEDDED-PDV and CHARACTER STRING types
.
2.1 Support for
EXTERNAL, EMBEDDED-PDV and CHARACTER STRING
types.
Requires something from 1.2 (Information Object Classes)
.
3. MINOR:
3.1
Parsing of CONSTRAINED BY clauses
3.1
Support for DEFAULT encoding and decoding, at least in INTEGER/ENUMERATED types.
libasn1fix/asn1fix_constraint_compat.c
View file @
1893ddfb
...
...
@@ -77,6 +77,8 @@ asn1constraint_compatible(asn1p_expr_type_e expr_type,
default:
break
;
}
return
0
;
case
ACT_CT_CTDBY
:
return
1
;
case
ACT_CA_SET
:
case
ACT_CA_CRC
:
case
ACT_CA_CSV
:
...
...
libasn1parser/asn1p_constr.c
View file @
1893ddfb
...
...
@@ -137,6 +137,8 @@ asn1p_constraint_type2str(enum asn1p_constraint_type_e type) {
return
"SingleTypeConstraint"
;
case
ACT_CT_WCOMPS
:
return
"MultipleTypeConstraints"
;
case
ACT_CT_CTDBY
:
return
"UserDefinedConstraint"
;
case
ACT_CA_SET
:
return
"SET"
;
case
ACT_CA_CRC
:
...
...
libasn1parser/asn1p_constr.h
View file @
1893ddfb
...
...
@@ -25,6 +25,7 @@ typedef struct asn1p_constraint_s {
ACT_CT_FROM
,
/* FROM constraint type */
ACT_CT_WCOMP
,
/* WITH COMPONENT */
ACT_CT_WCOMPS
,
/* WITH COMPONENTS */
ACT_CT_CTDBY
,
/* CONSTRAINED BY */
/*
* Arrays of constraints.
*/
...
...
libasn1parser/asn1p_l.c
View file @
1893ddfb
This source diff could not be displayed because it is too large. You can
view the blob
instead.
libasn1parser/asn1p_l.l
View file @
1893ddfb
...
...
@@ -269,7 +269,7 @@ CHOICE return TOK_CHOICE;
CLASS return TOK_CLASS;
COMPONENT return TOK_COMPONENT;
COMPONENTS return TOK_COMPONENTS;
CONSRAINED return TOK_CONSTRAINED;
CONS
T
RAINED return TOK_CONSTRAINED;
CONTAINING return TOK_CONTAINING;
DEFAULT return TOK_DEFAULT;
DEFINED {
...
...
libasn1parser/asn1p_y.c
View file @
1893ddfb
This diff is collapsed.
Click to expand it.
libasn1parser/asn1p_y.y
View file @
1893ddfb
...
...
@@ -1388,12 +1388,11 @@ DefinedValue:
Opaque:
TOK_opaque {
$$.len = $1.len +
2
;
$$.len = $1.len +
1
;
$$.buf = malloc($$.len + 1);
checkmem($$.buf);
$$.buf[0] = '{';
$$.buf[1] = ' ';
memcpy($$.buf + 2, $1.buf, $1.len);
memcpy($$.buf + 1, $1.buf, $1.len);
$$.buf[$$.len] = '\0';
free($1.buf);
}
...
...
@@ -1623,6 +1622,15 @@ ConstraintSubtypeElement:
| WithComponents {
$$ = $1;
}
| TOK_CONSTRAINED TOK_BY '{'
{ asn1p_lexer_hack_push_opaque_state(); } Opaque /* '}' */ {
$$ = asn1p_constraint_new(yylineno);
checkmem($$);
$$->type = ACT_CT_CTDBY;
$$->value = asn1p_value_frombuf($5.buf, $5.len, 0);
checkmem($$->value);
$$->value->type = ATV_UNPARSED;
}
;
ConstraintRangeSpec:
...
...
libasn1print/asn1print.c
View file @
1893ddfb
...
...
@@ -322,6 +322,11 @@ asn1print_constraint(asn1p_constraint_t *ct, enum asn1print_flags flags) {
case
ACT_CT_WCOMP
:
case
ACT_CT_WCOMPS
:
printf
(
"???"
);
case
ACT_CT_CTDBY
:
printf
(
"CONSTRAINED BY "
);
assert
(
ct
->
value
->
type
==
ATV_UNPARSED
);
fwrite
(
ct
->
value
->
value
.
string
.
buf
,
1
,
ct
->
value
->
value
.
string
.
size
,
stdout
);
break
;
case
ACT_CA_SET
:
symno
++
;
case
ACT_CA_CRC
:
symno
++
;
...
...
tests/34-class-OK.asn1.-EF
View file @
1893ddfb
...
...
@@ -22,7 +22,7 @@ EXTENSION-ATTRIBUTE ::= CLASS {
} WITH SYNTAX {&Type IDENTIFIED BY &id}
terminal-type EXTENSION-ATTRIBUTE ::= {
TerminalType IDENTIFIED BY 23}
terminal-type EXTENSION-ATTRIBUTE ::= {TerminalType IDENTIFIED BY 23}
ExtensionAttribute ::= SEQUENCE {
extension-attribute-type [0] IMPLICIT EXTENSION-ATTRIBUTE.&id ({ExtensionAttributeTable}),
...
...
tests/79-constrained-by-OK.asn1
0 → 100644
View file @
1893ddfb
-- OK: Everything is fine
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
-- .spelio.software.asn1c.test (9363.1.5.1)
-- .79
ModuleTestConstrainedBy
{ iso org(3) dod(6) internet(1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 79 }
DEFINITIONS ::=
BEGIN
Type ::= SEQUENCE {
int INTEGER,
...
} (CONSTRAINED BY { -- nothing -- })
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