Commit 59b9e705 authored by Bi-Ruei, Chiu's avatar Bi-Ruei, Chiu

Use comprehensible names for instances of parameterized types

With previous commit, the following data types are generated in ProtocolIE-Field.h
for S1AP's ASN.1 :

```
typedef enum ProtocolIE_Field_6564P0__value_PR {
    ProtocolIE_Field_6564P0__value_PR_NOTHING, /* No components present */
    ProtocolIE_Field_6564P0__value_PR_E_RABToBeSetupItemBearerSUReq
} ProtocolIE_Field_6564P0__value_PR;

typedef struct ProtocolIE_Field_6564P0 {
    ProtocolIE_ID_t      id;
    Criticality_t        criticality;
    struct ProtocolIE_Field_6564P0__value {
        ProtocolIE_Field_6564P0__value_PR        present;
        union ProtocolIE_Field_6564P0__value_u {
            E_RABToBeSetupItemBearerSUReq_t      E_RABToBeSetupItemBearerSUReq;
        } choice;

        /* Context for parsing across buffer boundaries */
        asn_struct_ctx_t _asn_ctx;
    } value;

    /* Context for parsing across buffer boundaries */
    asn_struct_ctx_t _asn_ctx;
} ProtocolIE_Field_6564P0_t;

```

It's difficult for developer to recognize to which ASN.1 type they are linked.
They all start with 'ProtocolIE_Field_'. It will be error-prone.

With this commit, more human comprehensible data types are generated :

```

typedef enum E_RABToBeSetupItemBearerSUReqIEs__value_PR {
    E_RABToBeSetupItemBearerSUReqIEs__value_PR_NOTHING, /* No components present */
    E_RABToBeSetupItemBearerSUReqIEs__value_PR_E_RABToBeSetupItemBearerSUReq
} E_RABToBeSetupItemBearerSUReqIEs__value_PR;

typedef struct E_RABToBeSetupItemBearerSUReqIEs {
    ProtocolIE_ID_t      id;
    Criticality_t        criticality;
    struct E_RABToBeSetupItemBearerSUReqIEs__value {
        E_RABToBeSetupItemBearerSUReqIEs__value_PR present;
        union E_RABToBeSetupItemBearerSUReqIEs__value_u {
            E_RABToBeSetupItemBearerSUReq_t               E_RABToBeSetupItemBearerSUReq;
        } choice;

        /* Context for parsing across buffer boundaries */
        asn_struct_ctx_t _asn_ctx;
    } value;

    /* Context for parsing across buffer boundaries */
    asn_struct_ctx_t _asn_ctx;
} E_RABToBeSetupItemBearerSUReqIEs_t;

```

Developers can understand they are generated from :

```

E-RABToBeSetupItemBearerSUReqIEs S1AP-PROTOCOL-IES ::= {
    { ID id-E-RABToBeSetupItemBearerSUReq CRITICALITY reject TYPE E-RABToBeSetupItemBearerSUReq PRESENCE mandatory },
    ...
}

```
parent c7fa184c
......@@ -1304,7 +1304,7 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
}
} else {
GEN_INCLUDE(asn1c_type_name(arg, expr, TNF_INCLUDE));
GEN_POS_INCLUDE_BASE(OT_INCLUDES, expr);
REDIR(OT_TYPE_DECLS);
......@@ -3236,13 +3236,8 @@ emit_include_dependencies(arg_t *arg) {
if((!(memb->expr_type & ASN_CONSTR_MASK)
&& memb->expr_type > ASN_CONSTR_MASK)
|| memb->meta_type == AMT_TYPEREF) {
if(memb->marker.flags & EM_UNRECURSE) {
GEN_POSTINCLUDE(asn1c_type_name(arg,
memb, TNF_INCLUDE));
} else {
GEN_INCLUDE(asn1c_type_name(arg,
memb, TNF_INCLUDE));
}
GEN_POS_INCLUDE_BASE((memb->marker.flags & EM_UNRECURSE) ?
OT_POST_INCLUDE : OT_INCLUDES, memb);
}
}
......
......@@ -73,7 +73,7 @@ asn1c_make_identifier(enum ami_flags_e flags, asn1p_expr_t *expr, ...) {
sptr[sptr_cnt++] = expr->Identifier;
size += strlen(expr->Identifier);
if(expr->spec_index != -1) {
if(expr->spec_index != -1 && expr->_lineno) {
static char buf[32];
size += 1 + snprintf(buf, sizeof buf, "%dP%d",
expr->_lineno, expr->spec_index);
......@@ -297,6 +297,20 @@ asn1c_type_name(arg_t *arg, asn1p_expr_t *expr, enum tnfmt _format) {
_format = TNF_CTYPE;
stdname = 1;
typename = ASN_EXPR_TYPE2STR(expr->expr_type);
if(_format == TNF_INCLUDE) {
if(expr->expr_type == ASN_CONSTR_SEQUENCE)
typename = "constr_SEQUENCE";
else if(expr->expr_type == ASN_CONSTR_CHOICE)
typename = "constr_CHOICE";
else if(expr->expr_type == ASN_CONSTR_SET)
typename = "constr_SET";
else if(expr->expr_type == ASN_CONSTR_SEQUENCE_OF)
typename = "constr_SEQUENCE_OF";
else if(expr->expr_type == ASN_CONSTR_SET_OF)
typename = "constr_SET_OF";
else if(expr->expr_type == ASN_CONSTR_OPEN_TYPE)
typename = "OPEN_TYPE";
}
} else {
_format = TNF_RSAFE;
typename = expr->Identifier;
......
......@@ -99,18 +99,25 @@ int asn1c_compiled_output(arg_t *arg, const char *file, int lineno,
} else { \
GEN_INCLUDE("<" typename ".h>"); \
} } while(0)
#define GEN_INCLUDE(filename) do { \
#define GEN_INCLUDE(filename) \
GEN_POS_INCLUDE(OT_INCLUDES, filename)
#define GEN_POSTINCLUDE(filename) \
GEN_POS_INCLUDE(OT_POST_INCLUDE, filename)
#define GEN_POS_INCLUDE(pos, filename) do { \
int saved_target = arg->target->target; \
if(!filename) break; \
REDIR(OT_INCLUDES); \
REDIR(pos); \
OUT_NOINDENT("#include %s\n", filename); \
REDIR(saved_target); \
} while(0)
#define GEN_POSTINCLUDE(filename) do { \
#define GEN_POS_INCLUDE_BASE(pos, expr) do { \
asn1p_expr_t *rhs_pspecs = expr->rhs_pspecs; \
expr->rhs_pspecs = (asn1p_expr_t *)0; \
int saved_target = arg->target->target; \
if(!filename) break; \
REDIR(OT_POST_INCLUDE); \
OUT_NOINDENT("#include %s\n", filename); \
REDIR(pos); \
OUT_NOINDENT("#include %s\n", \
asn1c_type_name(arg, expr, TNF_INCLUDE)); \
expr->rhs_pspecs = rhs_pspecs; \
REDIR(saved_target); \
} while(0)
......
......@@ -6,6 +6,7 @@ typedef struct resolver_arg {
asn1p_expr_t *original_expr;
asn1p_paramlist_t *lhs_params;
asn1p_expr_t *rhs_pspecs;
char *resolved_name;
} resolver_arg_t;
static asn1p_expr_t *resolve_expr(asn1p_expr_t *, void *resolver_arg);
......@@ -52,8 +53,14 @@ asn1f_parameterization_fork(arg_t *arg, asn1p_expr_t *expr, asn1p_expr_t *rhs_ps
rarg.original_expr = expr;
rarg.lhs_params = expr->lhs_params;
rarg.rhs_pspecs = rhs_pspecs;
rarg.resolved_name = NULL;
exc = asn1p_expr_clone_with_resolver(expr, resolve_expr, &rarg);
if(!exc) return NULL;
if(rarg.resolved_name) {
free(exc->Identifier);
exc->Identifier = strdup(rarg.resolved_name);
exc->_lineno = 0;
}
rpc = asn1p_expr_clone(rhs_pspecs, 0);
assert(rpc);
......@@ -138,6 +145,16 @@ resolve_expr(asn1p_expr_t *expr_to_resolve, void *resolver_arg) {
free(nex->Identifier);
nex->Identifier = expr_to_resolve->Identifier
? strdup(expr_to_resolve->Identifier) : 0;
if(expr->meta_type == AMT_TYPEREF) {
asn1p_ref_t *ref = expr->reference;
rarg->resolved_name = ref->components[ref->comp_count - 1].name;
} else if(expr->meta_type == AMT_VALUESET) {
asn1p_constraint_t *ct = expr->constraints;
if(ct->type == ACT_EL_TYPE) {
asn1p_ref_t *ref = ct->containedSubtype->value.v_type->reference;
rarg->resolved_name = ref->components[ref->comp_count - 1].name;
}
}
return nex;
} else {
FATAL("Feature not implemented for %s (%d/%x), "
......
......@@ -7,7 +7,7 @@
/*** <<< TYPE-DECLS [Message] >>> ***/
typedef struct Message {
SpecializedContent_30P0_t content;
RegionalExtension_30P0_t content;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
......@@ -23,7 +23,7 @@ static asn_TYPE_member_t asn_MBR_Message_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct Message, content),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
.tag_mode = 0,
.type = &asn_DEF_SpecializedContent_30P0,
.type = &asn_DEF_RegionalExtension_30P0,
.type_selector = 0,
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
0, 0, /* No default value */
......@@ -81,11 +81,11 @@ typedef enum value_PR {
/*** <<< TYPE-DECLS [SpecializedContent] >>> ***/
typedef struct SpecializedContent_30P0 {
typedef struct RegionalExtension_30P0 {
long id;
struct value {
value_PR present;
union SpecializedContent_30P0__value_u {
union RegionalExtension_30P0__value_u {
long INTEGER;
BOOLEAN_t BOOLEAN;
} choice;
......@@ -96,13 +96,13 @@ typedef struct SpecializedContent_30P0 {
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} SpecializedContent_30P0_t;
} RegionalExtension_30P0_t;
/*** <<< FUNC-DECLS [SpecializedContent] >>> ***/
extern asn_TYPE_descriptor_t asn_DEF_SpecializedContent_30P0;
extern asn_SEQUENCE_specifics_t asn_SPC_SpecializedContent_30P0_specs_1;
extern asn_TYPE_member_t asn_MBR_SpecializedContent_30P0_1[2];
extern asn_TYPE_descriptor_t asn_DEF_RegionalExtension_30P0;
extern asn_SEQUENCE_specifics_t asn_SPC_RegionalExtension_30P0_specs_1;
extern asn_TYPE_member_t asn_MBR_RegionalExtension_30P0_1[2];
/*** <<< IOC-TABLES [SpecializedContent] >>> ***/
......@@ -140,13 +140,13 @@ memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
}
static asn_type_selector_result_t
select_SpecializedContent_30P0_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
select_RegionalExtension_30P0_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
asn_type_selector_result_t result = {0, 0};
const asn_ioc_set_t *itable = asn_IOS_RegionalExtension_1;
size_t constraining_column = 0; /* &id */
size_t for_column = 1; /* &Type */
size_t row;
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct SpecializedContent_30P0, id));
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RegionalExtension_30P0, id));
for(row=0; row < itable->rows_count; row++) {
const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
......@@ -233,8 +233,8 @@ asn_TYPE_descriptor_t asn_DEF_value_3 = {
&asn_SPC_value_specs_3 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_SpecializedContent_30P0_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct SpecializedContent_30P0, id),
asn_TYPE_member_t asn_MBR_RegionalExtension_30P0_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct RegionalExtension_30P0, id),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
.tag_mode = 0,
.type = &asn_DEF_NativeInteger,
......@@ -243,43 +243,43 @@ asn_TYPE_member_t asn_MBR_SpecializedContent_30P0_1[] = {
0, 0, /* No default value */
.name = "id"
},
{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct SpecializedContent_30P0, value),
{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RegionalExtension_30P0, value),
.tag = -1 /* Ambiguous tag (ANY?) */,
.tag_mode = 0,
.type = &asn_DEF_value_3,
.type_selector = select_SpecializedContent_30P0_value_type,
.type_selector = select_RegionalExtension_30P0_value_type,
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_value_constraint_1 },
0, 0, /* No default value */
.name = "value"
},
};
static const ber_tlv_tag_t asn_DEF_SpecializedContent_30P0_tags_1[] = {
static const ber_tlv_tag_t asn_DEF_RegionalExtension_30P0_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_SpecializedContent_30P0_tag2el_1[] = {
static const asn_TYPE_tag2member_t asn_MAP_RegionalExtension_30P0_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* id */
};
asn_SEQUENCE_specifics_t asn_SPC_SpecializedContent_30P0_specs_1 = {
sizeof(struct SpecializedContent_30P0),
offsetof(struct SpecializedContent_30P0, _asn_ctx),
.tag2el = asn_MAP_SpecializedContent_30P0_tag2el_1,
asn_SEQUENCE_specifics_t asn_SPC_RegionalExtension_30P0_specs_1 = {
sizeof(struct RegionalExtension_30P0),
offsetof(struct RegionalExtension_30P0, _asn_ctx),
.tag2el = asn_MAP_RegionalExtension_30P0_tag2el_1,
.tag2el_count = 1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_SpecializedContent_30P0 = {
"SpecializedContent",
"SpecializedContent",
asn_TYPE_descriptor_t asn_DEF_RegionalExtension_30P0 = {
"RegionalExtension",
"RegionalExtension",
&asn_OP_SEQUENCE,
asn_DEF_SpecializedContent_30P0_tags_1,
sizeof(asn_DEF_SpecializedContent_30P0_tags_1)
/sizeof(asn_DEF_SpecializedContent_30P0_tags_1[0]), /* 1 */
asn_DEF_SpecializedContent_30P0_tags_1, /* Same as above */
sizeof(asn_DEF_SpecializedContent_30P0_tags_1)
/sizeof(asn_DEF_SpecializedContent_30P0_tags_1[0]), /* 1 */
asn_DEF_RegionalExtension_30P0_tags_1,
sizeof(asn_DEF_RegionalExtension_30P0_tags_1)
/sizeof(asn_DEF_RegionalExtension_30P0_tags_1[0]), /* 1 */
asn_DEF_RegionalExtension_30P0_tags_1, /* Same as above */
sizeof(asn_DEF_RegionalExtension_30P0_tags_1)
/sizeof(asn_DEF_RegionalExtension_30P0_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_SpecializedContent_30P0_1,
asn_MBR_RegionalExtension_30P0_1,
2, /* Elements count */
&asn_SPC_SpecializedContent_30P0_specs_1 /* Additional specs */
&asn_SPC_RegionalExtension_30P0_specs_1 /* Additional specs */
};
......@@ -7,7 +7,7 @@
/*** <<< TYPE-DECLS [Message] >>> ***/
typedef struct Message {
SpecializedContent_30P0_t content;
RegionalExtension_30P0_t content;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
......@@ -23,7 +23,7 @@ static asn_TYPE_member_t asn_MBR_Message_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct Message, content),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
.tag_mode = 0,
.type = &asn_DEF_SpecializedContent_30P0,
.type = &asn_DEF_RegionalExtension_30P0,
.type_selector = 0,
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
0, 0, /* No default value */
......@@ -81,11 +81,11 @@ typedef enum value_PR {
/*** <<< TYPE-DECLS [SpecializedContent] >>> ***/
typedef struct SpecializedContent_30P0 {
typedef struct RegionalExtension_30P0 {
long id;
struct value {
value_PR present;
union SpecializedContent_30P0__value_u {
union RegionalExtension_30P0__value_u {
long INTEGER;
BOOLEAN_t BOOLEAN;
} choice;
......@@ -96,13 +96,13 @@ typedef struct SpecializedContent_30P0 {
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} SpecializedContent_30P0_t;
} RegionalExtension_30P0_t;
/*** <<< FUNC-DECLS [SpecializedContent] >>> ***/
extern asn_TYPE_descriptor_t asn_DEF_SpecializedContent_30P0;
extern asn_SEQUENCE_specifics_t asn_SPC_SpecializedContent_30P0_specs_1;
extern asn_TYPE_member_t asn_MBR_SpecializedContent_30P0_1[2];
extern asn_TYPE_descriptor_t asn_DEF_RegionalExtension_30P0;
extern asn_SEQUENCE_specifics_t asn_SPC_RegionalExtension_30P0_specs_1;
extern asn_TYPE_member_t asn_MBR_RegionalExtension_30P0_1[2];
/*** <<< IOC-TABLES [SpecializedContent] >>> ***/
......@@ -140,13 +140,13 @@ memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
}
static asn_type_selector_result_t
select_SpecializedContent_30P0_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
select_RegionalExtension_30P0_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
asn_type_selector_result_t result = {0, 0};
const asn_ioc_set_t *itable = asn_IOS_RegionalExtension_1;
size_t constraining_column = 0; /* &id */
size_t for_column = 1; /* &Type */
size_t row;
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct SpecializedContent_30P0, id));
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct RegionalExtension_30P0, id));
for(row=0; row < itable->rows_count; row++) {
const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
......@@ -249,8 +249,8 @@ asn_TYPE_descriptor_t asn_DEF_value_3 = {
&asn_SPC_value_specs_3 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_SpecializedContent_30P0_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct SpecializedContent_30P0, id),
asn_TYPE_member_t asn_MBR_RegionalExtension_30P0_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct RegionalExtension_30P0, id),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
.tag_mode = 0,
.type = &asn_DEF_NativeInteger,
......@@ -259,43 +259,43 @@ asn_TYPE_member_t asn_MBR_SpecializedContent_30P0_1[] = {
0, 0, /* No default value */
.name = "id"
},
{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct SpecializedContent_30P0, value),
{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct RegionalExtension_30P0, value),
.tag = -1 /* Ambiguous tag (ANY?) */,
.tag_mode = 0,
.type = &asn_DEF_value_3,
.type_selector = select_SpecializedContent_30P0_value_type,
.type_selector = select_RegionalExtension_30P0_value_type,
{ .oer_constraints = 0, .per_constraints = &asn_PER_memb_value_constr_3, .general_constraints = memb_value_constraint_1 },
0, 0, /* No default value */
.name = "value"
},
};
static const ber_tlv_tag_t asn_DEF_SpecializedContent_30P0_tags_1[] = {
static const ber_tlv_tag_t asn_DEF_RegionalExtension_30P0_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_SpecializedContent_30P0_tag2el_1[] = {
static const asn_TYPE_tag2member_t asn_MAP_RegionalExtension_30P0_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* id */
};
asn_SEQUENCE_specifics_t asn_SPC_SpecializedContent_30P0_specs_1 = {
sizeof(struct SpecializedContent_30P0),
offsetof(struct SpecializedContent_30P0, _asn_ctx),
.tag2el = asn_MAP_SpecializedContent_30P0_tag2el_1,
asn_SEQUENCE_specifics_t asn_SPC_RegionalExtension_30P0_specs_1 = {
sizeof(struct RegionalExtension_30P0),
offsetof(struct RegionalExtension_30P0, _asn_ctx),
.tag2el = asn_MAP_RegionalExtension_30P0_tag2el_1,
.tag2el_count = 1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_SpecializedContent_30P0 = {
"SpecializedContent",
"SpecializedContent",
asn_TYPE_descriptor_t asn_DEF_RegionalExtension_30P0 = {
"RegionalExtension",
"RegionalExtension",
&asn_OP_SEQUENCE,
asn_DEF_SpecializedContent_30P0_tags_1,
sizeof(asn_DEF_SpecializedContent_30P0_tags_1)
/sizeof(asn_DEF_SpecializedContent_30P0_tags_1[0]), /* 1 */
asn_DEF_SpecializedContent_30P0_tags_1, /* Same as above */
sizeof(asn_DEF_SpecializedContent_30P0_tags_1)
/sizeof(asn_DEF_SpecializedContent_30P0_tags_1[0]), /* 1 */
asn_DEF_RegionalExtension_30P0_tags_1,
sizeof(asn_DEF_RegionalExtension_30P0_tags_1)
/sizeof(asn_DEF_RegionalExtension_30P0_tags_1[0]), /* 1 */
asn_DEF_RegionalExtension_30P0_tags_1, /* Same as above */
sizeof(asn_DEF_RegionalExtension_30P0_tags_1)
/sizeof(asn_DEF_RegionalExtension_30P0_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_SpecializedContent_30P0_1,
asn_MBR_RegionalExtension_30P0_1,
2, /* Elements count */
&asn_SPC_SpecializedContent_30P0_specs_1 /* Additional specs */
&asn_SPC_RegionalExtension_30P0_specs_1 /* Additional specs */
};
......@@ -501,7 +501,7 @@ asn_TYPE_descriptor_t asn_DEF_LowerLayer_List_45P0 = {
/*** <<< TYPE-DECLS [SinglePacket] >>> ***/
typedef Packet_51P0_t SinglePacket_48P0_t;
typedef ClassItem_51P0_t SinglePacket_48P0_t;
/*** <<< FUNC-DECLS [SinglePacket] >>> ***/
......@@ -519,7 +519,7 @@ per_type_encoder_f SinglePacket_48P0_encode_uper;
/*** <<< CODE [SinglePacket] >>> ***/
/*
* This type is implemented using Packet_51P0,
* This type is implemented using ClassItem_51P0,
* so here we adjust the DEF accordingly.
*/
......@@ -539,9 +539,9 @@ asn_TYPE_descriptor_t asn_DEF_SinglePacket_48P0 = {
sizeof(asn_DEF_SinglePacket_48P0_tags_1)
/sizeof(asn_DEF_SinglePacket_48P0_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_Packet_51P0_1,
asn_MBR_ClassItem_51P0_1,
3, /* Elements count */
&asn_SPC_Packet_51P0_specs_1 /* Additional specs */
&asn_SPC_ClassItem_51P0_specs_1 /* Additional specs */
};
......@@ -566,12 +566,12 @@ typedef enum value_PR {
/*** <<< TYPE-DECLS [Packet] >>> ***/
typedef struct Packet_51P0 {
typedef struct ClassItem_51P0 {
PacketId_t id;
Color_t color;
struct value {
value_PR present;
union Packet_51P0__value_u {
union ClassItem_51P0__value_u {
OCTET_STRING_t OCTET_STRING;
} choice;
......@@ -581,13 +581,13 @@ typedef struct Packet_51P0 {
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} Packet_51P0_t;
} ClassItem_51P0_t;
/*** <<< FUNC-DECLS [Packet] >>> ***/
extern asn_TYPE_descriptor_t asn_DEF_Packet_51P0;
extern asn_SEQUENCE_specifics_t asn_SPC_Packet_51P0_specs_1;
extern asn_TYPE_member_t asn_MBR_Packet_51P0_1[3];
extern asn_TYPE_descriptor_t asn_DEF_ClassItem_51P0;
extern asn_SEQUENCE_specifics_t asn_SPC_ClassItem_51P0_specs_1;
extern asn_TYPE_member_t asn_MBR_ClassItem_51P0_1[3];
/*** <<< IOC-TABLES [Packet] >>> ***/
......@@ -632,13 +632,13 @@ memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
}
static asn_type_selector_result_t
select_Packet_51P0_color_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
select_ClassItem_51P0_color_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
asn_type_selector_result_t result = {0, 0};
const asn_ioc_set_t *itable = asn_IOS_ClassItem_1;
size_t constraining_column = 0; /* &id */
size_t for_column = 1; /* &color */
size_t row;
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct Packet_51P0, id));
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct ClassItem_51P0, id));
for(row=0; row < itable->rows_count; row++) {
const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
......@@ -674,13 +674,13 @@ memb_color_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
}
static asn_type_selector_result_t
select_Packet_51P0_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
select_ClassItem_51P0_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
asn_type_selector_result_t result = {0, 0};
const asn_ioc_set_t *itable = asn_IOS_ClassItem_1;
size_t constraining_column = 0; /* &id */
size_t for_column = 2; /* &Value */
size_t row;
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct Packet_51P0, id));
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct ClassItem_51P0, id));
for(row=0; row < itable->rows_count; row++) {
const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
......@@ -775,8 +775,8 @@ asn_TYPE_descriptor_t asn_DEF_value_4 = {
&asn_SPC_value_specs_4 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_Packet_51P0_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct Packet_51P0, id),
asn_TYPE_member_t asn_MBR_ClassItem_51P0_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct ClassItem_51P0, id),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
.tag_mode = 0,
.type = &asn_DEF_PacketId,
......@@ -785,53 +785,53 @@ asn_TYPE_member_t asn_MBR_Packet_51P0_1[] = {
0, 0, /* No default value */
.name = "id"
},
{ ATF_NOFLAGS, 0, offsetof(struct Packet_51P0, color),
{ ATF_NOFLAGS, 0, offsetof(struct ClassItem_51P0, color),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
.tag_mode = 0,
.type = &asn_DEF_Color,
.type_selector = select_Packet_51P0_color_type,
.type_selector = select_ClassItem_51P0_color_type,
{ .oer_constraints = 0, .per_constraints = &asn_PER_memb_color_constr_3, .general_constraints = memb_color_constraint_1 },
0, 0, /* No default value */
.name = "color"
},
{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct Packet_51P0, value),
{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct ClassItem_51P0, value),
.tag = -1 /* Ambiguous tag (ANY?) */,
.tag_mode = 0,
.type = &asn_DEF_value_4,
.type_selector = select_Packet_51P0_value_type,
.type_selector = select_ClassItem_51P0_value_type,
{ .oer_constraints = 0, .per_constraints = &asn_PER_memb_value_constr_4, .general_constraints = memb_value_constraint_1 },
0, 0, /* No default value */
.name = "value"
},
};
static const ber_tlv_tag_t asn_DEF_Packet_51P0_tags_1[] = {
static const ber_tlv_tag_t asn_DEF_ClassItem_51P0_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_Packet_51P0_tag2el_1[] = {
static const asn_TYPE_tag2member_t asn_MAP_ClassItem_51P0_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* id */
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 1, 0, 0 } /* color */
};
asn_SEQUENCE_specifics_t asn_SPC_Packet_51P0_specs_1 = {
sizeof(struct Packet_51P0),
offsetof(struct Packet_51P0, _asn_ctx),
.tag2el = asn_MAP_Packet_51P0_tag2el_1,
asn_SEQUENCE_specifics_t asn_SPC_ClassItem_51P0_specs_1 = {
sizeof(struct ClassItem_51P0),
offsetof(struct ClassItem_51P0, _asn_ctx),
.tag2el = asn_MAP_ClassItem_51P0_tag2el_1,
.tag2el_count = 2, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_Packet_51P0 = {
"Packet",
"Packet",
asn_TYPE_descriptor_t asn_DEF_ClassItem_51P0 = {
"ClassItem",
"ClassItem",
&asn_OP_SEQUENCE,
asn_DEF_Packet_51P0_tags_1,
sizeof(asn_DEF_Packet_51P0_tags_1)
/sizeof(asn_DEF_Packet_51P0_tags_1[0]), /* 1 */
asn_DEF_Packet_51P0_tags_1, /* Same as above */
sizeof(asn_DEF_Packet_51P0_tags_1)
/sizeof(asn_DEF_Packet_51P0_tags_1[0]), /* 1 */
asn_DEF_ClassItem_51P0_tags_1,
sizeof(asn_DEF_ClassItem_51P0_tags_1)
/sizeof(asn_DEF_ClassItem_51P0_tags_1[0]), /* 1 */
asn_DEF_ClassItem_51P0_tags_1, /* Same as above */
sizeof(asn_DEF_ClassItem_51P0_tags_1)
/sizeof(asn_DEF_ClassItem_51P0_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_Packet_51P0_1,
asn_MBR_ClassItem_51P0_1,
3, /* Elements count */
&asn_SPC_Packet_51P0_specs_1 /* Additional specs */
&asn_SPC_ClassItem_51P0_specs_1 /* Additional specs */
};
......@@ -7,7 +7,7 @@
/*** <<< TYPE-DECLS [Message] >>> ***/
typedef struct Message {
SpecializedContent_42P0_t content;
TotalRegionExtension_42P0_t content;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
......@@ -23,7 +23,7 @@ static asn_TYPE_member_t asn_MBR_Message_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct Message, content),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
.tag_mode = 0,
.type = &asn_DEF_SpecializedContent_42P0,
.type = &asn_DEF_TotalRegionExtension_42P0,
.type_selector = 0,
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
0, 0, /* No default value */
......@@ -83,11 +83,11 @@ typedef enum value_PR {
/*** <<< TYPE-DECLS [SpecializedContent] >>> ***/
typedef struct SpecializedContent_42P0 {
typedef struct TotalRegionExtension_42P0 {
long id;
struct value {
value_PR present;
union SpecializedContent_42P0__value_u {
union TotalRegionExtension_42P0__value_u {
long INTEGER;
BOOLEAN_t BOOLEAN;
OCTET_STRING_t OCTET_STRING;
......@@ -99,13 +99,13 @@ typedef struct SpecializedContent_42P0 {
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} SpecializedContent_42P0_t;
} TotalRegionExtension_42P0_t;
/*** <<< FUNC-DECLS [SpecializedContent] >>> ***/
extern asn_TYPE_descriptor_t asn_DEF_SpecializedContent_42P0;
extern asn_SEQUENCE_specifics_t asn_SPC_SpecializedContent_42P0_specs_1;
extern asn_TYPE_member_t asn_MBR_SpecializedContent_42P0_1[2];
extern asn_TYPE_descriptor_t asn_DEF_TotalRegionExtension_42P0;
extern asn_SEQUENCE_specifics_t asn_SPC_TotalRegionExtension_42P0_specs_1;
extern asn_TYPE_member_t asn_MBR_TotalRegionExtension_42P0_1[2];
/*** <<< IOC-TABLES [SpecializedContent] >>> ***/
......@@ -155,13 +155,13 @@ memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
}
static asn_type_selector_result_t
select_SpecializedContent_42P0_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
select_TotalRegionExtension_42P0_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
asn_type_selector_result_t result = {0, 0};
const asn_ioc_set_t *itable = asn_IOS_TotalRegionExtension_1;
size_t constraining_column = 0; /* &id */
size_t for_column = 1; /* &Type */
size_t row;
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct SpecializedContent_42P0, id));
const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct TotalRegionExtension_42P0, id));
for(row=0; row < itable->rows_count; row++) {
const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
......@@ -274,8 +274,8 @@ asn_TYPE_descriptor_t asn_DEF_value_3 = {
&asn_SPC_value_specs_3 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_SpecializedContent_42P0_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct SpecializedContent_42P0, id),
asn_TYPE_member_t asn_MBR_TotalRegionExtension_42P0_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct TotalRegionExtension_42P0, id),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
.tag_mode = 0,
.type = &asn_DEF_NativeInteger,
......@@ -284,43 +284,43 @@ asn_TYPE_member_t asn_MBR_SpecializedContent_42P0_1[] = {
0, 0, /* No default value */
.name = "id"
},
{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct SpecializedContent_42P0, value),
{ ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct TotalRegionExtension_42P0, value),
.tag = -1 /* Ambiguous tag (ANY?) */,
.tag_mode = 0,
.type = &asn_DEF_value_3,
.type_selector = select_SpecializedContent_42P0_value_type,
.type_selector = select_TotalRegionExtension_42P0_value_type,
{ .oer_constraints = 0, .per_constraints = &asn_PER_memb_value_constr_3, .general_constraints = memb_value_constraint_1 },
0, 0, /* No default value */
.name = "value"
},
};
static const ber_tlv_tag_t asn_DEF_SpecializedContent_42P0_tags_1[] = {
static const ber_tlv_tag_t asn_DEF_TotalRegionExtension_42P0_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_SpecializedContent_42P0_tag2el_1[] = {
static const asn_TYPE_tag2member_t asn_MAP_TotalRegionExtension_42P0_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* id */
};
asn_SEQUENCE_specifics_t asn_SPC_SpecializedContent_42P0_specs_1 = {
sizeof(struct SpecializedContent_42P0),
offsetof(struct SpecializedContent_42P0, _asn_ctx),
.tag2el = asn_MAP_SpecializedContent_42P0_tag2el_1,
asn_SEQUENCE_specifics_t asn_SPC_TotalRegionExtension_42P0_specs_1 = {
sizeof(struct TotalRegionExtension_42P0),
offsetof(struct TotalRegionExtension_42P0, _asn_ctx),
.tag2el = asn_MAP_TotalRegionExtension_42P0_tag2el_1,
.tag2el_count = 1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_SpecializedContent_42P0 = {
"SpecializedContent",
"SpecializedContent",
asn_TYPE_descriptor_t asn_DEF_TotalRegionExtension_42P0 = {
"TotalRegionExtension",
"TotalRegionExtension",
&asn_OP_SEQUENCE,
asn_DEF_SpecializedContent_42P0_tags_1,
sizeof(asn_DEF_SpecializedContent_42P0_tags_1)
/sizeof(asn_DEF_SpecializedContent_42P0_tags_1[0]), /* 1 */
asn_DEF_SpecializedContent_42P0_tags_1, /* Same as above */
sizeof(asn_DEF_SpecializedContent_42P0_tags_1)
/sizeof(asn_DEF_SpecializedContent_42P0_tags_1[0]), /* 1 */
asn_DEF_TotalRegionExtension_42P0_tags_1,
sizeof(asn_DEF_TotalRegionExtension_42P0_tags_1)
/sizeof(asn_DEF_TotalRegionExtension_42P0_tags_1[0]), /* 1 */
asn_DEF_TotalRegionExtension_42P0_tags_1, /* Same as above */
sizeof(asn_DEF_TotalRegionExtension_42P0_tags_1)
/sizeof(asn_DEF_TotalRegionExtension_42P0_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_SpecializedContent_42P0_1,
asn_MBR_TotalRegionExtension_42P0_1,
2, /* Elements count */
&asn_SPC_SpecializedContent_42P0_specs_1 /* Additional specs */
&asn_SPC_TotalRegionExtension_42P0_specs_1 /* Additional specs */
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment