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
c3f0b89c
Commit
c3f0b89c
authored
Aug 14, 2005
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PER visible constraints are used to select the native representation for INTEGER types
parent
082cadca
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
720 additions
and
272 deletions
+720
-272
tests/84-param-tags-OK.asn1.-P
tests/84-param-tags-OK.asn1.-P
+8
-20
tests/90-cond-int-type-OK.asn1
tests/90-cond-int-type-OK.asn1
+7
-7
tests/90-cond-int-type-OK.asn1.-EFprint-constraints
tests/90-cond-int-type-OK.asn1.-EFprint-constraints
+50
-24
tests/90-cond-int-type-OK.asn1.-P
tests/90-cond-int-type-OK.asn1.-P
+308
-82
tests/90-cond-int-type-OK.asn1.-Pfnative-types
tests/90-cond-int-type-OK.asn1.-Pfnative-types
+347
-139
No files found.
tests/84-param-tags-OK.asn1.-P
View file @
c3f0b89c
/*** <<< INCLUDES [TestChoice] >>> ***/
#include <
INTEGER
.h>
#include <
NativeInteger
.h>
#include <constr_SEQUENCE.h>
#include <BOOLEAN.h>
#include <constr_CHOICE.h>
...
...
@@ -20,7 +20,7 @@ typedef struct TestChoice {
TestChoice_PR present;
union {
struct type1 {
INTEGER_t
*common /* DEFAULT 0 */;
long
*common /* DEFAULT 0 */;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
...
...
@@ -46,7 +46,6 @@ extern asn_TYPE_descriptor_t asn_DEF_TestChoice;
static int
memb_common_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_consume_bytes_f *app_errlog, void *app_key) {
const INTEGER_t *st = (const INTEGER_t *)sptr;
long value;
if(!sptr) {
...
...
@@ -56,12 +55,7 @@ memb_common_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
return -1;
}
if(asn_INTEGER2long(st, &value)) {
_ASN_ERRLOG(app_errlog, app_key,
"%s: value too large (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value >= 1 && value <= 10)) {
/* Constraint check succeeded */
...
...
@@ -81,7 +75,7 @@ static asn_TYPE_member_t asn_MBR_type1_2[] = {
{ ATF_POINTER, 1, offsetof(struct type1, common),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
.tag_mode = 0,
.type = (void *)&asn_DEF_
INTEGER
,
.type = (void *)&asn_DEF_
NativeInteger
,
.memb_constraints = memb_common_2_constraint,
.name = "common"
},
...
...
@@ -222,7 +216,7 @@ asn_TYPE_descriptor_t asn_DEF_TestChoice = {
/*** <<< INCLUDES [AutoChoice] >>> ***/
#include <
INTEGER
.h>
#include <
NativeInteger
.h>
#include <constr_SEQUENCE.h>
#include <BOOLEAN.h>
#include <constr_CHOICE.h>
...
...
@@ -241,7 +235,7 @@ typedef struct AutoChoice {
AutoChoice_PR present;
union {
struct type1 {
INTEGER_t
common;
long
common;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
...
...
@@ -267,7 +261,6 @@ extern asn_TYPE_descriptor_t asn_DEF_AutoChoice;
static int
memb_common_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_consume_bytes_f *app_errlog, void *app_key) {
const INTEGER_t *st = (const INTEGER_t *)sptr;
long value;
if(!sptr) {
...
...
@@ -277,12 +270,7 @@ memb_common_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
return -1;
}
if(asn_INTEGER2long(st, &value)) {
_ASN_ERRLOG(app_errlog, app_key,
"%s: value too large (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
value = *(const long *)sptr;
if((value == 0)) {
/* Constraint check succeeded */
...
...
@@ -327,7 +315,7 @@ static asn_TYPE_member_t asn_MBR_type1_2[] = {
{ ATF_NOFLAGS, 0, offsetof(struct type1, common),
.tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
.tag_mode = -1, /* IMPLICIT tag at current level */
.type = (void *)&asn_DEF_
INTEGER
,
.type = (void *)&asn_DEF_
NativeInteger
,
.memb_constraints = memb_common_2_constraint,
.name = "common"
},
...
...
tests/90-cond-int-type-OK.asn1
View file @
c3f0b89c
...
...
@@ -14,19 +14,19 @@ BEGIN
CN-IntegerUnlimited ::= INTEGER
CN-IntegerMinMax ::= INTEGER (MIN..MAX)
CN-IntegerMinLow ::= INTEGER (MIN..1)
NO-IntegerMinHigh ::= INTEGER (MIN..
5
000000000)
NO-IntegerLowHigh ::= INTEGER (1..
5
000000000)
NO-IntegerMinHigh ::= INTEGER (MIN..
3
000000000)
NO-IntegerLowHigh ::= INTEGER (1..
3
000000000)
CN-IntegerLowMax ::= INTEGER (1..MAX)
NO-IntegerHighMax ::= INTEGER (
5
000000000..MAX)
NO-IntegerLowestMax ::= INTEGER (-
5
000000000..MAX)
NO-IntegerOutRange ::= INTEGER (
5000000000..5
000000001)
NO-IntegerOutValue ::= INTEGER (
5
000000000)
NO-IntegerHighMax ::= INTEGER (
3
000000000..MAX)
NO-IntegerLowestMax ::= INTEGER (-
3
000000000..MAX)
NO-IntegerOutRange ::= INTEGER (
3000000000..3
000000001)
NO-IntegerOutValue ::= INTEGER (
3
000000000)
OK-IntegerInRange1 ::= INTEGER (-100..100)
OK-IntegerInRange2 ::= INTEGER (-100|100)
OK-IntegerInRange3 ::= INTEGER (-2147483648..2147483647)
OK-IntegerInRange4 ::= INTEGER (-2147483648|2147483647)
OK-IntegerInRange5 ::= INTEGER (-2147483648|2147483647,...)
CN-IntegerEnumerated1 ::= INTEGER { a(1), b(2) }
NO-IntegerEnumerated2 ::= INTEGER { a(1), b(
5
000000000) }
NO-IntegerEnumerated2 ::= INTEGER { a(1), b(
3
000000000) }
END
tests/90-cond-int-type-OK.asn1.-EFprint-constraints
View file @
c3f0b89c
...
...
@@ -17,40 +17,40 @@ CN-IntegerMinLow ::= INTEGER (MIN..1)
-- Practical constraints (CN-IntegerMinLow): (MIN..1)
-- PER-visible constraints (CN-IntegerMinLow): (MIN..1)
NO-IntegerMinHigh ::= INTEGER (MIN..
5
000000000)
-- Combined constraints: (MIN..
5
000000000)
-- Practical constraints (NO-IntegerMinHigh): (MIN..
5
000000000)
-- PER-visible constraints (NO-IntegerMinHigh): (MIN..
5
000000000)
NO-IntegerMinHigh ::= INTEGER (MIN..
3
000000000)
-- Combined constraints: (MIN..
3
000000000)
-- Practical constraints (NO-IntegerMinHigh): (MIN..
3
000000000)
-- PER-visible constraints (NO-IntegerMinHigh): (MIN..
3
000000000)
NO-IntegerLowHigh ::= INTEGER (1..
5
000000000)
-- Combined constraints: (1..
5
000000000)
-- Practical constraints (NO-IntegerLowHigh): (1..
5
000000000)
-- PER-visible constraints (NO-IntegerLowHigh): (1..
5
000000000)
NO-IntegerLowHigh ::= INTEGER (1..
3
000000000)
-- Combined constraints: (1..
3
000000000)
-- Practical constraints (NO-IntegerLowHigh): (1..
3
000000000)
-- PER-visible constraints (NO-IntegerLowHigh): (1..
3
000000000)
CN-IntegerLowMax ::= INTEGER (1..MAX)
-- Combined constraints: (1..MAX)
-- Practical constraints (CN-IntegerLowMax): (1..MAX)
-- PER-visible constraints (CN-IntegerLowMax): (1..MAX)
NO-IntegerHighMax ::= INTEGER (
5
000000000..MAX)
-- Combined constraints: (
5
000000000..MAX)
-- Practical constraints (NO-IntegerHighMax): (
5
000000000..MAX)
-- PER-visible constraints (NO-IntegerHighMax): (
5
000000000..MAX)
NO-IntegerHighMax ::= INTEGER (
3
000000000..MAX)
-- Combined constraints: (
3
000000000..MAX)
-- Practical constraints (NO-IntegerHighMax): (
3
000000000..MAX)
-- PER-visible constraints (NO-IntegerHighMax): (
3
000000000..MAX)
NO-IntegerLowestMax ::= INTEGER (-
5
000000000..MAX)
-- Combined constraints: (-
5
000000000..MAX)
-- Practical constraints (NO-IntegerLowestMax): (-
5
000000000..MAX)
-- PER-visible constraints (NO-IntegerLowestMax): (-
5
000000000..MAX)
NO-IntegerLowestMax ::= INTEGER (-
3
000000000..MAX)
-- Combined constraints: (-
3
000000000..MAX)
-- Practical constraints (NO-IntegerLowestMax): (-
3
000000000..MAX)
-- PER-visible constraints (NO-IntegerLowestMax): (-
3
000000000..MAX)
NO-IntegerOutRange ::= INTEGER (
5000000000..5
000000001)
-- Combined constraints: (
5000000000..5
000000001)
-- Practical constraints (NO-IntegerOutRange): (
5000000000..5
000000001)
-- PER-visible constraints (NO-IntegerOutRange): (
5000000000..5
000000001)
NO-IntegerOutRange ::= INTEGER (
3000000000..3
000000001)
-- Combined constraints: (
3000000000..3
000000001)
-- Practical constraints (NO-IntegerOutRange): (
3000000000..3
000000001)
-- PER-visible constraints (NO-IntegerOutRange): (
3000000000..3
000000001)
NO-IntegerOutValue ::= INTEGER (
5
000000000)
-- Combined constraints: (
5
000000000)
-- Practical constraints (NO-IntegerOutValue): (
5
000000000)
-- PER-visible constraints (NO-IntegerOutValue): (
5
000000000)
NO-IntegerOutValue ::= INTEGER (
3
000000000)
-- Combined constraints: (
3
000000000)
-- Practical constraints (NO-IntegerOutValue): (
3
000000000)
-- PER-visible constraints (NO-IntegerOutValue): (
3
000000000)
OK-IntegerInRange1 ::= INTEGER (-100..100)
-- Combined constraints: (-100..100)
...
...
@@ -77,4 +77,30 @@ OK-IntegerInRange5 ::= INTEGER (-2147483648 | 2147483647,...)
-- Practical constraints (OK-IntegerInRange5): (-2147483648 | 2147483647,...)
-- PER-visible constraints (OK-IntegerInRange5): (-2147483648 | 2147483647,...)
CN-IntegerEnumerated1 ::= INTEGER {
a(1)
-- Practical constraints (a):
-- PER-visible constraints (a):
,
b(2)
-- Practical constraints (b):
-- PER-visible constraints (b):
}
-- Practical constraints (CN-IntegerEnumerated1): (MIN..MAX)
-- PER-visible constraints (CN-IntegerEnumerated1): (MIN..MAX)
NO-IntegerEnumerated2 ::= INTEGER {
a(1)
-- Practical constraints (a):
-- PER-visible constraints (a):
,
b(3000000000)
-- Practical constraints (b):
-- PER-visible constraints (b):
}
-- Practical constraints (NO-IntegerEnumerated2): (MIN..MAX)
-- PER-visible constraints (NO-IntegerEnumerated2): (MIN..MAX)
END
tests/90-cond-int-type-OK.asn1.-P
View file @
c3f0b89c
This diff is collapsed.
Click to expand it.
tests/90-cond-int-type-OK.asn1.-Pfnative-types
View file @
c3f0b89c
This diff is collapsed.
Click to expand it.
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