mirror of https://gerrit.osmocom.org/asn1c
pull extensions for aliased types
This commit is contained in:
parent
0c54f3d05d
commit
135d7dd4e1
|
@ -2338,7 +2338,7 @@ emit_member_OER_constraints(arg_t *arg, asn1p_expr_t *expr, const char *pfx) {
|
||||||
etype = expr_get_type(arg, expr);
|
etype = expr_get_type(arg, expr);
|
||||||
|
|
||||||
if((arg->flags & A1C_GEN_OER)
|
if((arg->flags & A1C_GEN_OER)
|
||||||
&& (expr->constraints || etype == ASN_BASIC_ENUMERATED
|
&& (expr->combined_constraints || etype == ASN_BASIC_ENUMERATED
|
||||||
|| etype == ASN_CONSTR_CHOICE)) {
|
|| etype == ASN_CONSTR_CHOICE)) {
|
||||||
/* Fall through */
|
/* Fall through */
|
||||||
} else {
|
} else {
|
||||||
|
@ -2393,7 +2393,7 @@ emit_member_PER_constraints(arg_t *arg, asn1p_expr_t *expr, const char *pfx) {
|
||||||
etype = expr_get_type(arg, expr);
|
etype = expr_get_type(arg, expr);
|
||||||
|
|
||||||
if((arg->flags & A1C_GEN_PER)
|
if((arg->flags & A1C_GEN_PER)
|
||||||
&& (expr->constraints
|
&& (expr->combined_constraints
|
||||||
|| etype == ASN_BASIC_ENUMERATED
|
|| etype == ASN_BASIC_ENUMERATED
|
||||||
|| etype == ASN_CONSTR_CHOICE)
|
|| etype == ASN_CONSTR_CHOICE)
|
||||||
) {
|
) {
|
||||||
|
@ -3249,7 +3249,7 @@ do { \
|
||||||
}
|
}
|
||||||
|
|
||||||
if(arg->flags & A1C_GEN_OER) {
|
if(arg->flags & A1C_GEN_OER) {
|
||||||
if(expr->constraints
|
if(expr->combined_constraints
|
||||||
|| expr->expr_type == ASN_BASIC_ENUMERATED
|
|| expr->expr_type == ASN_BASIC_ENUMERATED
|
||||||
|| expr->expr_type == ASN_CONSTR_CHOICE) {
|
|| expr->expr_type == ASN_CONSTR_CHOICE) {
|
||||||
OUT("&asn_OER_type_%s_constr_%d,\n",
|
OUT("&asn_OER_type_%s_constr_%d,\n",
|
||||||
|
@ -3262,7 +3262,7 @@ do { \
|
||||||
}
|
}
|
||||||
|
|
||||||
if(arg->flags & A1C_GEN_PER) {
|
if(arg->flags & A1C_GEN_PER) {
|
||||||
if(expr->constraints
|
if(expr->combined_constraints
|
||||||
|| expr->expr_type == ASN_BASIC_ENUMERATED
|
|| expr->expr_type == ASN_BASIC_ENUMERATED
|
||||||
|| expr->expr_type == ASN_CONSTR_CHOICE) {
|
|| expr->expr_type == ASN_CONSTR_CHOICE) {
|
||||||
OUT("&asn_PER_type_%s_constr_%d,\n",
|
OUT("&asn_PER_type_%s_constr_%d,\n",
|
||||||
|
|
|
@ -134,6 +134,12 @@ Alias_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||||
* so here we adjust the DEF accordingly.
|
* so here we adjust the DEF accordingly.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*** <<< CTDEFS [Alias] >>> ***/
|
||||||
|
|
||||||
|
static asn_oer_constraints_t asn_OER_type_Alias_constr_1 GCC_NOTUSED = {
|
||||||
|
{ 2, 1 } /* (0..65535) */,
|
||||||
|
-1};
|
||||||
|
|
||||||
/*** <<< STAT-DEFS [Alias] >>> ***/
|
/*** <<< STAT-DEFS [Alias] >>> ***/
|
||||||
|
|
||||||
static const ber_tlv_tag_t asn_DEF_Alias_tags_1[] = {
|
static const ber_tlv_tag_t asn_DEF_Alias_tags_1[] = {
|
||||||
|
@ -150,7 +156,7 @@ asn_TYPE_descriptor_t asn_DEF_Alias = {
|
||||||
asn_DEF_Alias_tags_1, /* Same as above */
|
asn_DEF_Alias_tags_1, /* Same as above */
|
||||||
sizeof(asn_DEF_Alias_tags_1)
|
sizeof(asn_DEF_Alias_tags_1)
|
||||||
/sizeof(asn_DEF_Alias_tags_1[0]), /* 1 */
|
/sizeof(asn_DEF_Alias_tags_1[0]), /* 1 */
|
||||||
0, /* No OER visible constraints */
|
&asn_OER_type_Alias_constr_1,
|
||||||
0, /* No PER visible constraints */
|
0, /* No PER visible constraints */
|
||||||
0, 0, /* No members */
|
0, 0, /* No members */
|
||||||
0 /* No specifics */
|
0 /* No specifics */
|
||||||
|
|
|
@ -94,6 +94,7 @@ typedef Short_t Alias_t;
|
||||||
|
|
||||||
/*** <<< FUNC-DECLS [Alias] >>> ***/
|
/*** <<< FUNC-DECLS [Alias] >>> ***/
|
||||||
|
|
||||||
|
extern asn_per_constraints_t asn_PER_type_Alias_constr_1;
|
||||||
extern asn_TYPE_descriptor_t asn_DEF_Alias;
|
extern asn_TYPE_descriptor_t asn_DEF_Alias;
|
||||||
asn_struct_free_f Alias_free;
|
asn_struct_free_f Alias_free;
|
||||||
asn_struct_print_f Alias_print;
|
asn_struct_print_f Alias_print;
|
||||||
|
@ -137,6 +138,14 @@ Alias_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||||
* so here we adjust the DEF accordingly.
|
* so here we adjust the DEF accordingly.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*** <<< CTDEFS [Alias] >>> ***/
|
||||||
|
|
||||||
|
asn_per_constraints_t asn_PER_type_Alias_constr_1 GCC_NOTUSED = {
|
||||||
|
{ APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */,
|
||||||
|
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||||
|
0, 0 /* No PER value map */
|
||||||
|
};
|
||||||
|
|
||||||
/*** <<< STAT-DEFS [Alias] >>> ***/
|
/*** <<< STAT-DEFS [Alias] >>> ***/
|
||||||
|
|
||||||
static const ber_tlv_tag_t asn_DEF_Alias_tags_1[] = {
|
static const ber_tlv_tag_t asn_DEF_Alias_tags_1[] = {
|
||||||
|
@ -154,7 +163,7 @@ asn_TYPE_descriptor_t asn_DEF_Alias = {
|
||||||
sizeof(asn_DEF_Alias_tags_1)
|
sizeof(asn_DEF_Alias_tags_1)
|
||||||
/sizeof(asn_DEF_Alias_tags_1[0]), /* 1 */
|
/sizeof(asn_DEF_Alias_tags_1[0]), /* 1 */
|
||||||
0, /* No OER visible constraints */
|
0, /* No OER visible constraints */
|
||||||
0, /* No PER visible constraints */
|
&asn_PER_type_Alias_constr_1,
|
||||||
0, 0, /* No members */
|
0, 0, /* No members */
|
||||||
0 /* No specifics */
|
0 /* No specifics */
|
||||||
};
|
};
|
||||||
|
|
|
@ -2095,11 +2095,30 @@ VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int asn_PER_MAP_VisibleIdentifier_1_v2c(unsigned int value) {
|
||||||
|
if(value >= sizeof(permitted_alphabet_table_1)/sizeof(permitted_alphabet_table_1[0]))
|
||||||
|
return -1;
|
||||||
|
return permitted_alphabet_table_1[value] - 1;
|
||||||
|
}
|
||||||
|
static int asn_PER_MAP_VisibleIdentifier_1_c2v(unsigned int code) {
|
||||||
|
if(code >= sizeof(permitted_alphabet_code2value_1)/sizeof(permitted_alphabet_code2value_1[0]))
|
||||||
|
return -1;
|
||||||
|
return permitted_alphabet_code2value_1[code];
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* This type is implemented using Identifier,
|
* This type is implemented using Identifier,
|
||||||
* so here we adjust the DEF accordingly.
|
* so here we adjust the DEF accordingly.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*** <<< CTDEFS [VisibleIdentifier] >>> ***/
|
||||||
|
|
||||||
|
static asn_per_constraints_t asn_PER_type_VisibleIdentifier_constr_1 GCC_NOTUSED = {
|
||||||
|
{ APC_CONSTRAINED, 6, 6, 36, 122 } /* (36..122) */,
|
||||||
|
{ APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */,
|
||||||
|
asn_PER_MAP_VisibleIdentifier_1_v2c, /* Value to PER code map */
|
||||||
|
asn_PER_MAP_VisibleIdentifier_1_c2v /* PER code to value map */
|
||||||
|
};
|
||||||
|
|
||||||
/*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/
|
/*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/
|
||||||
|
|
||||||
static const ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = {
|
static const ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = {
|
||||||
|
@ -2117,7 +2136,7 @@ asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = {
|
||||||
sizeof(asn_DEF_VisibleIdentifier_tags_1)
|
sizeof(asn_DEF_VisibleIdentifier_tags_1)
|
||||||
/sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
|
/sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */
|
||||||
0, /* No OER visible constraints */
|
0, /* No OER visible constraints */
|
||||||
0, /* No PER visible constraints */
|
&asn_PER_type_VisibleIdentifier_constr_1,
|
||||||
0, 0, /* No members */
|
0, 0, /* No members */
|
||||||
0 /* No specifics */
|
0 /* No specifics */
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue