Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [Attribute] >>> ***/ |
| 3 | |
| 4 | #include <RELATIVE-OID.h> |
| 5 | #include <IA5String.h> |
| 6 | #include <constr_SEQUENCE.h> |
| 7 | |
| 8 | /*** <<< TYPE-DECLS [Attribute] >>> ***/ |
| 9 | |
| 10 | typedef struct Attribute { |
| 11 | RELATIVE_OID_t identifier; |
| 12 | IA5String_t siAttributeValue; |
| 13 | |
| 14 | /* Context for parsing across buffer boundaries */ |
| 15 | asn_struct_ctx_t _asn_ctx; |
| 16 | } Attribute_t; |
| 17 | |
| 18 | /*** <<< FUNC-DECLS [Attribute] >>> ***/ |
| 19 | |
| 20 | extern asn_TYPE_descriptor_t asn_DEF_Attribute; |
| 21 | |
| 22 | /*** <<< CODE [Attribute] >>> ***/ |
| 23 | |
| 24 | static int |
| 25 | memb_identifier_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 26 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 27 | |
| 28 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 29 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 30 | "%s: value not given (%s:%d)", |
| 31 | td->name, __FILE__, __LINE__); |
| 32 | return -1; |
| 33 | } |
| 34 | |
| 35 | |
| 36 | if(1 /* No applicable constraints whatsoever */) { |
| 37 | /* Nothing is here. See below */ |
| 38 | } |
| 39 | |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 40 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | |
| 44 | /*** <<< STAT-DEFS [Attribute] >>> ***/ |
| 45 | |
| 46 | static asn_TYPE_member_t asn_MBR_Attribute_1[] = { |
| 47 | { ATF_NOFLAGS, 0, offsetof(struct Attribute, identifier), |
| 48 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), |
| 49 | .tag_mode = 0, |
| 50 | .type = &asn_DEF_RELATIVE_OID, |
| 51 | .memb_constraints = memb_identifier_constraint_1, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 52 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 53 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 54 | .default_value = 0, |
| 55 | .name = "identifier" |
| 56 | }, |
| 57 | { ATF_NOFLAGS, 0, offsetof(struct Attribute, siAttributeValue), |
| 58 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), |
| 59 | .tag_mode = 0, |
| 60 | .type = &asn_DEF_IA5String, |
| 61 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 62 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 63 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 64 | .default_value = 0, |
| 65 | .name = "siAttributeValue" |
| 66 | }, |
| 67 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 68 | static const ber_tlv_tag_t asn_DEF_Attribute_tags_1[] = { |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 69 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 70 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 71 | static const asn_TYPE_tag2member_t asn_MAP_Attribute_tag2el_1[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 72 | { (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), 0, 0, 0 }, /* identifier */ |
| 73 | { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 1, 0, 0 } /* siAttributeValue */ |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 74 | }; |
| 75 | static asn_SEQUENCE_specifics_t asn_SPC_Attribute_specs_1 = { |
| 76 | sizeof(struct Attribute), |
| 77 | offsetof(struct Attribute, _asn_ctx), |
| 78 | asn_MAP_Attribute_tag2el_1, |
| 79 | 2, /* Count of tags in the map */ |
| 80 | 0, 0, 0, /* Optional elements (not needed) */ |
| 81 | -1, /* Start extensions */ |
| 82 | -1 /* Stop extensions */ |
| 83 | }; |
| 84 | asn_TYPE_descriptor_t asn_DEF_Attribute = { |
| 85 | "Attribute", |
| 86 | "Attribute", |
| 87 | SEQUENCE_free, |
| 88 | SEQUENCE_print, |
| 89 | SEQUENCE_constraint, |
| 90 | SEQUENCE_decode_ber, |
| 91 | SEQUENCE_encode_der, |
| 92 | SEQUENCE_decode_xer, |
| 93 | SEQUENCE_encode_xer, |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 94 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 95 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 96 | 0, /* Use generic outmost tag fetcher */ |
| 97 | asn_DEF_Attribute_tags_1, |
| 98 | sizeof(asn_DEF_Attribute_tags_1) |
| 99 | /sizeof(asn_DEF_Attribute_tags_1[0]), /* 1 */ |
| 100 | asn_DEF_Attribute_tags_1, /* Same as above */ |
| 101 | sizeof(asn_DEF_Attribute_tags_1) |
| 102 | /sizeof(asn_DEF_Attribute_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 103 | 0, /* No OER visible constraints */ |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 104 | 0, /* No PER visible constraints */ |
| 105 | asn_MBR_Attribute_1, |
| 106 | 2, /* Elements count */ |
| 107 | &asn_SPC_Attribute_specs_1 /* Additional specs */ |
| 108 | }; |
| 109 | |