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> |
Lev Walkin | ad0d637 | 2017-08-08 02:02:42 -0700 | [diff] [blame] | 6 | #include <asn_ioc.h> |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 7 | #include <constr_SEQUENCE.h> |
| 8 | |
| 9 | /*** <<< TYPE-DECLS [Attribute] >>> ***/ |
| 10 | |
| 11 | typedef struct Attribute { |
| 12 | RELATIVE_OID_t identifier; |
| 13 | IA5String_t siAttributeValue; |
| 14 | |
| 15 | /* Context for parsing across buffer boundaries */ |
| 16 | asn_struct_ctx_t _asn_ctx; |
| 17 | } Attribute_t; |
| 18 | |
| 19 | /*** <<< FUNC-DECLS [Attribute] >>> ***/ |
| 20 | |
| 21 | extern asn_TYPE_descriptor_t asn_DEF_Attribute; |
| 22 | |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 23 | /*** <<< IOC-TABLES [Attribute] >>> ***/ |
| 24 | |
Lev Walkin | d357f3d | 2017-08-10 17:40:37 -0700 | [diff] [blame] | 25 | static const RELATIVE_OID_t asn_VAL_1_raf = { "not supported", 0 }; |
| 26 | static const RELATIVE_OID_t asn_VAL_2_rcf = { "not supported", 0 }; |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 27 | static const asn_ioc_cell_t asn_IOS_Attributes_1_rows[] = { |
Lev Walkin | d357f3d | 2017-08-10 17:40:37 -0700 | [diff] [blame] | 28 | { "&id", aioc__value, &asn_DEF_RELATIVE_OID, &asn_VAL_1_raf }, |
| 29 | { "&id", aioc__value, &asn_DEF_RELATIVE_OID, &asn_VAL_2_rcf } |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 30 | }; |
Lev Walkin | 18660d2 | 2017-08-12 20:45:23 -0700 | [diff] [blame] | 31 | static const asn_ioc_set_t asn_IOS_Attributes_1[] = { |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 32 | 2, 1, asn_IOS_Attributes_1_rows |
| 33 | }; |
| 34 | |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 35 | /*** <<< CODE [Attribute] >>> ***/ |
| 36 | |
| 37 | static int |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 38 | memb_identifier_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 39 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 40 | |
| 41 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 42 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 43 | "%s: value not given (%s:%d)", |
| 44 | td->name, __FILE__, __LINE__); |
| 45 | return -1; |
| 46 | } |
| 47 | |
| 48 | |
| 49 | if(1 /* No applicable constraints whatsoever */) { |
| 50 | /* Nothing is here. See below */ |
| 51 | } |
| 52 | |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 53 | return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | |
| 57 | /*** <<< STAT-DEFS [Attribute] >>> ***/ |
| 58 | |
| 59 | static asn_TYPE_member_t asn_MBR_Attribute_1[] = { |
| 60 | { ATF_NOFLAGS, 0, offsetof(struct Attribute, identifier), |
| 61 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), |
| 62 | .tag_mode = 0, |
| 63 | .type = &asn_DEF_RELATIVE_OID, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 64 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 65 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_identifier_constraint_1 }, |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 66 | 0, 0, /* No default value */ |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 67 | .name = "identifier" |
| 68 | }, |
| 69 | { ATF_NOFLAGS, 0, offsetof(struct Attribute, siAttributeValue), |
| 70 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), |
| 71 | .tag_mode = 0, |
| 72 | .type = &asn_DEF_IA5String, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 73 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 74 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 75 | 0, 0, /* No default value */ |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 76 | .name = "siAttributeValue" |
| 77 | }, |
| 78 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 79 | static const ber_tlv_tag_t asn_DEF_Attribute_tags_1[] = { |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 80 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 81 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 82 | static const asn_TYPE_tag2member_t asn_MAP_Attribute_tag2el_1[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 83 | { (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), 0, 0, 0 }, /* identifier */ |
| 84 | { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 1, 0, 0 } /* siAttributeValue */ |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 85 | }; |
| 86 | static asn_SEQUENCE_specifics_t asn_SPC_Attribute_specs_1 = { |
| 87 | sizeof(struct Attribute), |
| 88 | offsetof(struct Attribute, _asn_ctx), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 89 | .tag2el = asn_MAP_Attribute_tag2el_1, |
| 90 | .tag2el_count = 2, /* Count of tags in the map */ |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 91 | 0, 0, 0, /* Optional elements (not needed) */ |
Lev Walkin | df2edbb | 2017-10-21 13:40:07 -0700 | [diff] [blame] | 92 | -1, /* First extension addition */ |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 93 | }; |
| 94 | asn_TYPE_descriptor_t asn_DEF_Attribute = { |
| 95 | "Attribute", |
| 96 | "Attribute", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 97 | &asn_OP_SEQUENCE, |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 98 | asn_DEF_Attribute_tags_1, |
| 99 | sizeof(asn_DEF_Attribute_tags_1) |
| 100 | /sizeof(asn_DEF_Attribute_tags_1[0]), /* 1 */ |
| 101 | asn_DEF_Attribute_tags_1, /* Same as above */ |
| 102 | sizeof(asn_DEF_Attribute_tags_1) |
| 103 | /sizeof(asn_DEF_Attribute_tags_1[0]), /* 1 */ |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 104 | { 0, 0, SEQUENCE_constraint }, |
Lev Walkin | 6ec1032 | 2006-03-14 11:48:01 +0000 | [diff] [blame] | 105 | asn_MBR_Attribute_1, |
| 106 | 2, /* Elements count */ |
| 107 | &asn_SPC_Attribute_specs_1 /* Additional specs */ |
| 108 | }; |
| 109 | |