Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [T] >>> ***/ |
| 3 | |
| 4 | #include <INTEGER.h> |
| 5 | #include <OCTET_STRING.h> |
| 6 | #include <REAL.h> |
| 7 | #include <constr_SET.h> |
| 8 | #include <constr_SEQUENCE.h> |
| 9 | |
| 10 | /*** <<< DEPS [T] >>> ***/ |
| 11 | |
| 12 | |
| 13 | /* |
| 14 | * Method of determining the components presence |
| 15 | */ |
| 16 | typedef enum class_PR { |
| 17 | } class_PR; |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 18 | |
| 19 | /*** <<< TYPE-DECLS [T] >>> ***/ |
| 20 | |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 21 | typedef struct T { |
| 22 | INTEGER_t Int; |
| 23 | OCTET_STRING_t Char; |
| 24 | struct Class { |
| 25 | /* |
| 26 | * This type is extensible, |
| 27 | * possible extensions are below. |
| 28 | */ |
| 29 | |
| 30 | /* Presence bitmask: ASN_SET_ISPRESENT(pclass, class_PR_x) */ |
| 31 | unsigned int _presence_map |
| 32 | [((0+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; |
| 33 | |
| 34 | /* Context for parsing across buffer boundaries */ |
| 35 | asn_struct_ctx_t _asn_ctx; |
| 36 | } Class; |
| 37 | REAL_t Double; |
| 38 | |
| 39 | /* Context for parsing across buffer boundaries */ |
| 40 | asn_struct_ctx_t _asn_ctx; |
| 41 | } T_t; |
| 42 | |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 43 | /*** <<< FUNC-DECLS [T] >>> ***/ |
| 44 | |
| 45 | extern asn_TYPE_descriptor_t asn_DEF_T; |
| 46 | |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 47 | /*** <<< CODE [T] >>> ***/ |
| 48 | |
| 49 | static int |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 50 | memb_char_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 51 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 52 | const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 53 | size_t size; |
| 54 | |
| 55 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 56 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 57 | "%s: value not given (%s:%d)", |
| 58 | td->name, __FILE__, __LINE__); |
| 59 | return -1; |
| 60 | } |
| 61 | |
| 62 | size = st->size; |
| 63 | |
| 64 | if((size == 1)) { |
| 65 | /* Constraint check succeeded */ |
| 66 | return 0; |
| 67 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 68 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 69 | "%s: constraint failed (%s:%d)", |
| 70 | td->name, __FILE__, __LINE__); |
| 71 | return -1; |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | |
| 76 | /*** <<< STAT-DEFS [T] >>> ***/ |
| 77 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 78 | static const ber_tlv_tag_t asn_DEF_class_tags_4[] = { |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 79 | (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 80 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 81 | static const uint8_t asn_MAP_class_mmap_4[(0 + (8 * sizeof(unsigned int)) - 1) / 8] = { |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 82 | 0 |
| 83 | }; |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 84 | static |
| 85 | asn_SET_specifics_t asn_SPC_class_specs_4 = { |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 86 | sizeof(struct Class), |
| 87 | offsetof(struct Class, _asn_ctx), |
| 88 | offsetof(struct Class, _presence_map), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 89 | 0, /* No top level tags */ |
| 90 | 0, /* No tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 91 | asn_MAP_class_tag2el_4, /* Same as above */ |
Lev Walkin | f82138b | 2005-02-25 08:20:32 +0000 | [diff] [blame] | 92 | 0, /* Count of tags in the CXER map */ |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 93 | 1, /* Whether extensible */ |
Lev Walkin | 46ef3f3 | 2017-07-06 08:47:53 -0700 | [diff] [blame] | 94 | (const unsigned int *)asn_MAP_class_mmap_4 /* Mandatory elements map */ |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 95 | }; |
| 96 | static /* Use -fall-defs-global to expose */ |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 97 | asn_TYPE_descriptor_t asn_DEF_class_4 = { |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 98 | "class", |
| 99 | "class", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 100 | &asn_OP_SET, |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 101 | SET_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 102 | asn_DEF_class_tags_4, |
| 103 | sizeof(asn_DEF_class_tags_4) |
| 104 | /sizeof(asn_DEF_class_tags_4[0]), /* 1 */ |
| 105 | asn_DEF_class_tags_4, /* Same as above */ |
| 106 | sizeof(asn_DEF_class_tags_4) |
| 107 | /sizeof(asn_DEF_class_tags_4[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 108 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 109 | 0, /* No PER visible constraints */ |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 110 | 0, 0, /* No members */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 111 | &asn_SPC_class_specs_4 /* Additional specs */ |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 112 | }; |
| 113 | |
Lev Walkin | e0272aa | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 114 | static asn_TYPE_member_t asn_MBR_T_1[] = { |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 115 | { ATF_NOFLAGS, 0, offsetof(struct T, Int), |
| 116 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 117 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 118 | .type = &asn_DEF_INTEGER, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 119 | .type_selector = 0, |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 120 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 121 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 122 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 123 | .default_value = 0, |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 124 | .name = "int" |
| 125 | }, |
| 126 | { ATF_NOFLAGS, 0, offsetof(struct T, Char), |
| 127 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), |
| 128 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 129 | .type = &asn_DEF_OCTET_STRING, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 130 | .type_selector = 0, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 131 | .memb_constraints = memb_char_constraint_1, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 132 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 133 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 134 | .default_value = 0, |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 135 | .name = "char" |
| 136 | }, |
| 137 | { ATF_NOFLAGS, 0, offsetof(struct T, Class), |
| 138 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), |
| 139 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 140 | .type = &asn_DEF_class_4, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 141 | .type_selector = 0, |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 142 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 143 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 144 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 145 | .default_value = 0, |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 146 | .name = "class" |
| 147 | }, |
| 148 | { ATF_NOFLAGS, 0, offsetof(struct T, Double), |
| 149 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), |
| 150 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 151 | .type = &asn_DEF_REAL, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 152 | .type_selector = 0, |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 153 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 154 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 155 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 156 | .default_value = 0, |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 157 | .name = "double" |
| 158 | }, |
| 159 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 160 | static const ber_tlv_tag_t asn_DEF_T_tags_1[] = { |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 161 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 162 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 163 | static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 164 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* int */ |
| 165 | { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 }, /* char */ |
| 166 | { (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), 3, 0, 0 }, /* double */ |
| 167 | { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 } /* class */ |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 168 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 169 | static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = { |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 170 | sizeof(struct T), |
| 171 | offsetof(struct T, _asn_ctx), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 172 | .tag2el = asn_MAP_T_tag2el_1, |
| 173 | .tag2el_count = 4, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 174 | 0, 0, 0, /* Optional elements (not needed) */ |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 175 | -1, /* Start extensions */ |
| 176 | -1 /* Stop extensions */ |
| 177 | }; |
| 178 | asn_TYPE_descriptor_t asn_DEF_T = { |
| 179 | "T", |
| 180 | "T", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 181 | &asn_OP_SEQUENCE, |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 182 | SEQUENCE_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 183 | asn_DEF_T_tags_1, |
| 184 | sizeof(asn_DEF_T_tags_1) |
| 185 | /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ |
| 186 | asn_DEF_T_tags_1, /* Same as above */ |
| 187 | sizeof(asn_DEF_T_tags_1) |
| 188 | /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 189 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 190 | 0, /* No PER visible constraints */ |
Lev Walkin | e0272aa | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 191 | asn_MBR_T_1, |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 192 | 4, /* Elements count */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 193 | &asn_SPC_T_specs_1 /* Additional specs */ |
Lev Walkin | 64d99e9 | 2005-01-30 18:34:07 +0000 | [diff] [blame] | 194 | }; |
| 195 | |