asn1c/tests/tests-asn1c-compiler/98-attribute-class-OK.asn1.-P

110 lines
3.2 KiB
Plaintext
Raw Normal View History

2006-03-14 11:48:01 +00:00
/*** <<< INCLUDES [Attribute] >>> ***/
#include <RELATIVE-OID.h>
#include <IA5String.h>
#include <asn_ioc.h>
2006-03-14 11:48:01 +00:00
#include <constr_SEQUENCE.h>
/*** <<< TYPE-DECLS [Attribute] >>> ***/
typedef struct Attribute {
RELATIVE_OID_t identifier;
IA5String_t siAttributeValue;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} Attribute_t;
/*** <<< FUNC-DECLS [Attribute] >>> ***/
extern asn_TYPE_descriptor_t asn_DEF_Attribute;
2017-08-10 12:48:54 +00:00
/*** <<< IOC-TABLES [Attribute] >>> ***/
2017-08-11 00:40:37 +00:00
static const RELATIVE_OID_t asn_VAL_1_raf = { "not supported", 0 };
static const RELATIVE_OID_t asn_VAL_2_rcf = { "not supported", 0 };
2017-08-10 12:48:54 +00:00
static const asn_ioc_cell_t asn_IOS_Attributes_1_rows[] = {
2017-08-11 00:40:37 +00:00
{ "&id", aioc__value, &asn_DEF_RELATIVE_OID, &asn_VAL_1_raf },
{ "&id", aioc__value, &asn_DEF_RELATIVE_OID, &asn_VAL_2_rcf }
2017-08-10 12:48:54 +00:00
};
2017-08-13 03:45:23 +00:00
static const asn_ioc_set_t asn_IOS_Attributes_1[] = {
2017-08-10 12:48:54 +00:00
2, 1, asn_IOS_Attributes_1_rows
};
2006-03-14 11:48:01 +00:00
/*** <<< CODE [Attribute] >>> ***/
static int
memb_identifier_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
2006-07-13 11:19:01 +00:00
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
2006-03-14 11:48:01 +00:00
if(!sptr) {
2016-03-14 10:08:15 +00:00
ASN__CTFAIL(app_key, td, sptr,
2006-03-14 11:48:01 +00:00
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
if(1 /* No applicable constraints whatsoever */) {
/* Nothing is here. See below */
}
2017-09-30 06:16:48 +00:00
return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
2006-03-14 11:48:01 +00:00
}
/*** <<< STAT-DEFS [Attribute] >>> ***/
static asn_TYPE_member_t asn_MBR_Attribute_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct Attribute, identifier),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)),
.tag_mode = 0,
.type = &asn_DEF_RELATIVE_OID,
2017-08-10 12:48:54 +00:00
.type_selector = 0,
2017-09-30 06:16:48 +00:00
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_identifier_constraint_1 },
0, 0, /* No default value */
2006-03-14 11:48:01 +00:00
.name = "identifier"
},
{ ATF_NOFLAGS, 0, offsetof(struct Attribute, siAttributeValue),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)),
.tag_mode = 0,
.type = &asn_DEF_IA5String,
2017-08-10 12:48:54 +00:00
.type_selector = 0,
2017-09-30 06:16:48 +00:00
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 },
0, 0, /* No default value */
2006-03-14 11:48:01 +00:00
.name = "siAttributeValue"
},
};
2014-10-13 01:37:35 +00:00
static const ber_tlv_tag_t asn_DEF_Attribute_tags_1[] = {
2006-03-14 11:48:01 +00:00
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
2014-10-13 01:37:35 +00:00
static const asn_TYPE_tag2member_t asn_MAP_Attribute_tag2el_1[] = {
2013-10-11 21:29:38 +00:00
{ (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), 0, 0, 0 }, /* identifier */
{ (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 1, 0, 0 } /* siAttributeValue */
2006-03-14 11:48:01 +00:00
};
static asn_SEQUENCE_specifics_t asn_SPC_Attribute_specs_1 = {
sizeof(struct Attribute),
offsetof(struct Attribute, _asn_ctx),
2017-08-23 17:29:38 +00:00
.tag2el = asn_MAP_Attribute_tag2el_1,
.tag2el_count = 2, /* Count of tags in the map */
2006-03-14 11:48:01 +00:00
0, 0, 0, /* Optional elements (not needed) */
2017-10-21 20:40:07 +00:00
-1, /* First extension addition */
2006-03-14 11:48:01 +00:00
};
asn_TYPE_descriptor_t asn_DEF_Attribute = {
"Attribute",
"Attribute",
&asn_OP_SEQUENCE,
2006-03-14 11:48:01 +00:00
asn_DEF_Attribute_tags_1,
sizeof(asn_DEF_Attribute_tags_1)
/sizeof(asn_DEF_Attribute_tags_1[0]), /* 1 */
asn_DEF_Attribute_tags_1, /* Same as above */
sizeof(asn_DEF_Attribute_tags_1)
/sizeof(asn_DEF_Attribute_tags_1[0]), /* 1 */
2017-09-30 06:16:48 +00:00
{ 0, 0, SEQUENCE_constraint },
2006-03-14 11:48:01 +00:00
asn_MBR_Attribute_1,
2, /* Elements count */
&asn_SPC_Attribute_specs_1 /* Additional specs */
};