Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [Type] >>> ***/ |
| 3 | |
| 4 | #include <asn_SEQUENCE_OF.h> |
| 5 | #include <constr_SEQUENCE_OF.h> |
| 6 | #include <constr_SEQUENCE.h> |
| 7 | |
| 8 | /*** <<< FWD-DECLS [Type] >>> ***/ |
| 9 | |
Lev Walkin | bf56d54 | 2005-03-04 23:50:56 +0000 | [diff] [blame] | 10 | struct Epyt; |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 11 | |
| 12 | /*** <<< TYPE-DECLS [Type] >>> ***/ |
| 13 | |
| 14 | typedef struct Type { |
| 15 | struct data { |
| 16 | A_SEQUENCE_OF(struct Epyt) list; |
| 17 | |
| 18 | /* Context for parsing across buffer boundaries */ |
| 19 | asn_struct_ctx_t _asn_ctx; |
| 20 | } data; |
| 21 | |
| 22 | /* Context for parsing across buffer boundaries */ |
| 23 | asn_struct_ctx_t _asn_ctx; |
| 24 | } Type_t; |
| 25 | |
| 26 | /*** <<< FUNC-DECLS [Type] >>> ***/ |
| 27 | |
| 28 | extern asn_TYPE_descriptor_t asn_DEF_Type; |
| 29 | |
| 30 | /*** <<< POST-INCLUDE [Type] >>> ***/ |
| 31 | |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 32 | #include <EpytRef.h> |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 33 | |
| 34 | /*** <<< STAT-DEFS [Type] >>> ***/ |
| 35 | |
| 36 | static asn_TYPE_member_t asn_MBR_data_2[] = { |
Lev Walkin | 8eb4b57 | 2005-08-16 16:57:17 +0000 | [diff] [blame] | 37 | { ATF_POINTER, 0, 0, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 38 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 39 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 40 | .type = &asn_DEF_EpytRef, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 41 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 42 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 43 | .default_value = 0, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 44 | .name = "" |
| 45 | }, |
| 46 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 47 | static ber_tlv_tag_t asn_DEF_data_tags_2[] = { |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 48 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 49 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 50 | static asn_SET_OF_specifics_t asn_SPC_data_specs_2 = { |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 51 | sizeof(struct data), |
| 52 | offsetof(struct data, _asn_ctx), |
| 53 | 0, /* XER encoding is XMLDelimitedItemList */ |
| 54 | }; |
| 55 | static /* Use -fall-defs-global to expose */ |
| 56 | asn_TYPE_descriptor_t asn_DEF_data_2 = { |
| 57 | "data", |
| 58 | "data", |
| 59 | SEQUENCE_OF_free, |
| 60 | SEQUENCE_OF_print, |
| 61 | SEQUENCE_OF_constraint, |
| 62 | SEQUENCE_OF_decode_ber, |
| 63 | SEQUENCE_OF_encode_der, |
| 64 | SEQUENCE_OF_decode_xer, |
| 65 | SEQUENCE_OF_encode_xer, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 66 | 0, /* No PER decoder, -gen-PER to enable */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 67 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 68 | asn_DEF_data_tags_2, |
| 69 | sizeof(asn_DEF_data_tags_2) |
| 70 | /sizeof(asn_DEF_data_tags_2[0]), /* 1 */ |
| 71 | asn_DEF_data_tags_2, /* Same as above */ |
| 72 | sizeof(asn_DEF_data_tags_2) |
| 73 | /sizeof(asn_DEF_data_tags_2[0]), /* 1 */ |
| 74 | 0, /* No PER visible constraints */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 75 | asn_MBR_data_2, |
| 76 | 1, /* Single element */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 77 | &asn_SPC_data_specs_2 /* Additional specs */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 78 | }; |
| 79 | |
| 80 | static asn_TYPE_member_t asn_MBR_Type_1[] = { |
| 81 | { ATF_NOFLAGS, 0, offsetof(struct Type, data), |
| 82 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 83 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 84 | .type = &asn_DEF_data_2, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 85 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 86 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 87 | .default_value = 0, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 88 | .name = "data" |
| 89 | }, |
| 90 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 91 | static ber_tlv_tag_t asn_DEF_Type_tags_1[] = { |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 92 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 93 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 94 | static asn_TYPE_tag2member_t asn_MAP_Type_tag2el_1[] = { |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 95 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* data at 16 */ |
| 96 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 97 | static asn_SEQUENCE_specifics_t asn_SPC_Type_specs_1 = { |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 98 | sizeof(struct Type), |
| 99 | offsetof(struct Type, _asn_ctx), |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 100 | asn_MAP_Type_tag2el_1, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 101 | 1, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 102 | 0, 0, 0, /* Optional elements (not needed) */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 103 | -1, /* Start extensions */ |
| 104 | -1 /* Stop extensions */ |
| 105 | }; |
| 106 | asn_TYPE_descriptor_t asn_DEF_Type = { |
| 107 | "Type", |
| 108 | "Type", |
| 109 | SEQUENCE_free, |
| 110 | SEQUENCE_print, |
| 111 | SEQUENCE_constraint, |
| 112 | SEQUENCE_decode_ber, |
| 113 | SEQUENCE_encode_der, |
| 114 | SEQUENCE_decode_xer, |
| 115 | SEQUENCE_encode_xer, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 116 | 0, /* No PER decoder, -gen-PER to enable */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 117 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 118 | asn_DEF_Type_tags_1, |
| 119 | sizeof(asn_DEF_Type_tags_1) |
| 120 | /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */ |
| 121 | asn_DEF_Type_tags_1, /* Same as above */ |
| 122 | sizeof(asn_DEF_Type_tags_1) |
| 123 | /sizeof(asn_DEF_Type_tags_1[0]), /* 1 */ |
| 124 | 0, /* No PER visible constraints */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 125 | asn_MBR_Type_1, |
| 126 | 1, /* Elements count */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 127 | &asn_SPC_Type_specs_1 /* Additional specs */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 128 | }; |
| 129 | |
| 130 | |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 131 | /*** <<< INCLUDES [EpytRef] >>> ***/ |
| 132 | |
| 133 | #include <Epyt.h> |
| 134 | |
| 135 | /*** <<< TYPE-DECLS [EpytRef] >>> ***/ |
| 136 | |
| 137 | typedef Epyt_t EpytRef_t; |
| 138 | |
| 139 | /*** <<< FUNC-DECLS [EpytRef] >>> ***/ |
| 140 | |
| 141 | extern asn_TYPE_descriptor_t asn_DEF_EpytRef; |
| 142 | asn_struct_free_f EpytRef_free; |
| 143 | asn_struct_print_f EpytRef_print; |
| 144 | asn_constr_check_f EpytRef_constraint; |
| 145 | ber_type_decoder_f EpytRef_decode_ber; |
| 146 | der_type_encoder_f EpytRef_encode_der; |
| 147 | xer_type_decoder_f EpytRef_decode_xer; |
| 148 | xer_type_encoder_f EpytRef_encode_xer; |
| 149 | |
| 150 | /*** <<< CODE [EpytRef] >>> ***/ |
| 151 | |
| 152 | int |
| 153 | EpytRef_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 154 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 155 | /* Replace with underlying type checker */ |
| 156 | td->check_constraints = asn_DEF_Epyt.check_constraints; |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 157 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 158 | } |
| 159 | |
| 160 | /* |
| 161 | * This type is implemented using Epyt, |
| 162 | * so here we adjust the DEF accordingly. |
| 163 | */ |
| 164 | static void |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 165 | EpytRef_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 166 | td->free_struct = asn_DEF_Epyt.free_struct; |
| 167 | td->print_struct = asn_DEF_Epyt.print_struct; |
| 168 | td->ber_decoder = asn_DEF_Epyt.ber_decoder; |
| 169 | td->der_encoder = asn_DEF_Epyt.der_encoder; |
| 170 | td->xer_decoder = asn_DEF_Epyt.xer_decoder; |
| 171 | td->xer_encoder = asn_DEF_Epyt.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 172 | td->uper_decoder = asn_DEF_Epyt.uper_decoder; |
| 173 | if(!td->per_constraints) |
| 174 | td->per_constraints = asn_DEF_Epyt.per_constraints; |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 175 | td->elements = asn_DEF_Epyt.elements; |
| 176 | td->elements_count = asn_DEF_Epyt.elements_count; |
| 177 | td->specifics = asn_DEF_Epyt.specifics; |
| 178 | } |
| 179 | |
| 180 | void |
| 181 | EpytRef_free(asn_TYPE_descriptor_t *td, |
| 182 | void *struct_ptr, int contents_only) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 183 | EpytRef_1_inherit_TYPE_descriptor(td); |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 184 | td->free_struct(td, struct_ptr, contents_only); |
| 185 | } |
| 186 | |
| 187 | int |
| 188 | EpytRef_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 189 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 190 | EpytRef_1_inherit_TYPE_descriptor(td); |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 191 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 192 | } |
| 193 | |
| 194 | asn_dec_rval_t |
| 195 | EpytRef_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
Lev Walkin | 3ebc65a | 2005-03-17 21:57:19 +0000 | [diff] [blame] | 196 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 197 | EpytRef_1_inherit_TYPE_descriptor(td); |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 198 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 199 | } |
| 200 | |
| 201 | asn_enc_rval_t |
| 202 | EpytRef_encode_der(asn_TYPE_descriptor_t *td, |
| 203 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 204 | asn_app_consume_bytes_f *cb, void *app_key) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 205 | EpytRef_1_inherit_TYPE_descriptor(td); |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 206 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 207 | } |
| 208 | |
| 209 | asn_dec_rval_t |
| 210 | EpytRef_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
Lev Walkin | 3ebc65a | 2005-03-17 21:57:19 +0000 | [diff] [blame] | 211 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 212 | EpytRef_1_inherit_TYPE_descriptor(td); |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 213 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 214 | } |
| 215 | |
| 216 | asn_enc_rval_t |
| 217 | EpytRef_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 218 | int ilevel, enum xer_encoder_flags_e flags, |
| 219 | asn_app_consume_bytes_f *cb, void *app_key) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 220 | EpytRef_1_inherit_TYPE_descriptor(td); |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 221 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 222 | } |
| 223 | |
| 224 | |
| 225 | /*** <<< STAT-DEFS [EpytRef] >>> ***/ |
| 226 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 227 | static ber_tlv_tag_t asn_DEF_EpytRef_tags_1[] = { |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 228 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 229 | }; |
| 230 | asn_TYPE_descriptor_t asn_DEF_EpytRef = { |
| 231 | "EpytRef", |
| 232 | "EpytRef", |
| 233 | EpytRef_free, |
| 234 | EpytRef_print, |
| 235 | EpytRef_constraint, |
| 236 | EpytRef_decode_ber, |
| 237 | EpytRef_encode_der, |
| 238 | EpytRef_decode_xer, |
| 239 | EpytRef_encode_xer, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 240 | 0, /* No PER decoder, -gen-PER to enable */ |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 241 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 242 | asn_DEF_EpytRef_tags_1, |
| 243 | sizeof(asn_DEF_EpytRef_tags_1) |
| 244 | /sizeof(asn_DEF_EpytRef_tags_1[0]), /* 1 */ |
| 245 | asn_DEF_EpytRef_tags_1, /* Same as above */ |
| 246 | sizeof(asn_DEF_EpytRef_tags_1) |
| 247 | /sizeof(asn_DEF_EpytRef_tags_1[0]), /* 1 */ |
| 248 | 0, /* No PER visible constraints */ |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 249 | 0, 0, /* Defined elsewhere */ |
| 250 | 0 /* No specifics */ |
| 251 | }; |
| 252 | |
| 253 | |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 254 | /*** <<< INCLUDES [Epyt] >>> ***/ |
| 255 | |
| 256 | #include <asn_SET_OF.h> |
| 257 | #include <constr_SET_OF.h> |
| 258 | #include <constr_SEQUENCE.h> |
| 259 | |
| 260 | /*** <<< FWD-DECLS [Epyt] >>> ***/ |
| 261 | |
Lev Walkin | bf56d54 | 2005-03-04 23:50:56 +0000 | [diff] [blame] | 262 | struct Type; |
| 263 | struct Ypet; |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 264 | |
| 265 | /*** <<< TYPE-DECLS [Epyt] >>> ***/ |
| 266 | |
| 267 | typedef struct Epyt { |
| 268 | struct stype { |
| 269 | A_SET_OF(struct Type) list; |
| 270 | |
| 271 | /* Context for parsing across buffer boundaries */ |
| 272 | asn_struct_ctx_t _asn_ctx; |
| 273 | } stype; |
| 274 | struct Type *type /* OPTIONAL */; |
| 275 | struct Ypet *ypet /* OPTIONAL */; |
| 276 | |
| 277 | /* Context for parsing across buffer boundaries */ |
| 278 | asn_struct_ctx_t _asn_ctx; |
| 279 | } Epyt_t; |
| 280 | |
| 281 | /*** <<< FUNC-DECLS [Epyt] >>> ***/ |
| 282 | |
| 283 | extern asn_TYPE_descriptor_t asn_DEF_Epyt; |
| 284 | |
| 285 | /*** <<< POST-INCLUDE [Epyt] >>> ***/ |
| 286 | |
| 287 | #include <Type.h> |
| 288 | #include <Ypet.h> |
| 289 | |
| 290 | /*** <<< STAT-DEFS [Epyt] >>> ***/ |
| 291 | |
| 292 | static asn_TYPE_member_t asn_MBR_stype_2[] = { |
Lev Walkin | 8eb4b57 | 2005-08-16 16:57:17 +0000 | [diff] [blame] | 293 | { ATF_POINTER, 0, 0, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 294 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 295 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 296 | .type = &asn_DEF_Type, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 297 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 298 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 299 | .default_value = 0, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 300 | .name = "" |
| 301 | }, |
| 302 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 303 | static ber_tlv_tag_t asn_DEF_stype_tags_2[] = { |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 304 | (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 305 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 306 | static asn_SET_OF_specifics_t asn_SPC_stype_specs_2 = { |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 307 | sizeof(struct stype), |
| 308 | offsetof(struct stype, _asn_ctx), |
| 309 | 0, /* XER encoding is XMLDelimitedItemList */ |
| 310 | }; |
| 311 | static /* Use -fall-defs-global to expose */ |
| 312 | asn_TYPE_descriptor_t asn_DEF_stype_2 = { |
| 313 | "stype", |
| 314 | "stype", |
| 315 | SET_OF_free, |
| 316 | SET_OF_print, |
| 317 | SET_OF_constraint, |
| 318 | SET_OF_decode_ber, |
| 319 | SET_OF_encode_der, |
| 320 | SET_OF_decode_xer, |
| 321 | SET_OF_encode_xer, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 322 | 0, /* No PER decoder, -gen-PER to enable */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 323 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 324 | asn_DEF_stype_tags_2, |
| 325 | sizeof(asn_DEF_stype_tags_2) |
| 326 | /sizeof(asn_DEF_stype_tags_2[0]), /* 1 */ |
| 327 | asn_DEF_stype_tags_2, /* Same as above */ |
| 328 | sizeof(asn_DEF_stype_tags_2) |
| 329 | /sizeof(asn_DEF_stype_tags_2[0]), /* 1 */ |
| 330 | 0, /* No PER visible constraints */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 331 | asn_MBR_stype_2, |
| 332 | 1, /* Single element */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 333 | &asn_SPC_stype_specs_2 /* Additional specs */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 334 | }; |
| 335 | |
| 336 | static asn_TYPE_member_t asn_MBR_Epyt_1[] = { |
| 337 | { ATF_NOFLAGS, 0, offsetof(struct Epyt, stype), |
| 338 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), |
| 339 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 340 | .type = &asn_DEF_stype_2, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 341 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 342 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 343 | .default_value = 0, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 344 | .name = "stype" |
| 345 | }, |
| 346 | { ATF_POINTER, 2, offsetof(struct Epyt, type), |
| 347 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 348 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 349 | .type = &asn_DEF_Type, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 350 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 351 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 352 | .default_value = 0, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 353 | .name = "type" |
| 354 | }, |
| 355 | { ATF_POINTER, 1, offsetof(struct Epyt, ypet), |
| 356 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), |
| 357 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 358 | .type = &asn_DEF_Ypet, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 359 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 360 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 361 | .default_value = 0, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 362 | .name = "ypet" |
| 363 | }, |
| 364 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 365 | static ber_tlv_tag_t asn_DEF_Epyt_tags_1[] = { |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 366 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 367 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 368 | static asn_TYPE_tag2member_t asn_MAP_Epyt_tag2el_1[] = { |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 369 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* type at 22 */ |
| 370 | { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 1 }, /* stype at 21 */ |
| 371 | { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, -1, 0 } /* ypet at 23 */ |
| 372 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 373 | static asn_SEQUENCE_specifics_t asn_SPC_Epyt_specs_1 = { |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 374 | sizeof(struct Epyt), |
| 375 | offsetof(struct Epyt, _asn_ctx), |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 376 | asn_MAP_Epyt_tag2el_1, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 377 | 3, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 378 | 0, 0, 0, /* Optional elements (not needed) */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 379 | -1, /* Start extensions */ |
| 380 | -1 /* Stop extensions */ |
| 381 | }; |
| 382 | asn_TYPE_descriptor_t asn_DEF_Epyt = { |
| 383 | "Epyt", |
| 384 | "Epyt", |
| 385 | SEQUENCE_free, |
| 386 | SEQUENCE_print, |
| 387 | SEQUENCE_constraint, |
| 388 | SEQUENCE_decode_ber, |
| 389 | SEQUENCE_encode_der, |
| 390 | SEQUENCE_decode_xer, |
| 391 | SEQUENCE_encode_xer, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 392 | 0, /* No PER decoder, -gen-PER to enable */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 393 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 394 | asn_DEF_Epyt_tags_1, |
| 395 | sizeof(asn_DEF_Epyt_tags_1) |
| 396 | /sizeof(asn_DEF_Epyt_tags_1[0]), /* 1 */ |
| 397 | asn_DEF_Epyt_tags_1, /* Same as above */ |
| 398 | sizeof(asn_DEF_Epyt_tags_1) |
| 399 | /sizeof(asn_DEF_Epyt_tags_1[0]), /* 1 */ |
| 400 | 0, /* No PER visible constraints */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 401 | asn_MBR_Epyt_1, |
| 402 | 3, /* Elements count */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 403 | &asn_SPC_Epyt_specs_1 /* Additional specs */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 404 | }; |
| 405 | |
| 406 | |
| 407 | /*** <<< INCLUDES [Ypet] >>> ***/ |
| 408 | |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 409 | #include <INTEGER.h> |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 410 | #include <IA5String.h> |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 411 | #include <EnumType.h> |
| 412 | #include <asn_SET_OF.h> |
| 413 | #include <constr_SET_OF.h> |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 414 | #include <constr_SET.h> |
| 415 | |
| 416 | /*** <<< DEPS [Ypet] >>> ***/ |
| 417 | |
| 418 | |
| 419 | /* |
| 420 | * Method of determining the components presence |
| 421 | */ |
| 422 | typedef enum Ypet_PR { |
| 423 | Ypet_PR_epyt, /* Member epyt is present */ |
| 424 | Ypet_PR_plain, /* Member plain is present */ |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 425 | Ypet_PR_senums, /* Member senums is present */ |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 426 | Ypet_PR_patest1, /* Member patest1 is present */ |
| 427 | Ypet_PR_patest2, /* Member patest2 is present */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 428 | } Ypet_PR; |
| 429 | |
Lev Walkin | b85a813 | 2005-08-18 13:38:19 +0000 | [diff] [blame] | 430 | /*** <<< FWD-DECLS [Ypet] >>> ***/ |
| 431 | |
| 432 | struct Epyt; |
| 433 | |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 434 | /*** <<< TYPE-DECLS [Ypet] >>> ***/ |
| 435 | |
| 436 | typedef struct Ypet { |
Lev Walkin | b85a813 | 2005-08-18 13:38:19 +0000 | [diff] [blame] | 437 | struct Epyt *epyt; |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 438 | INTEGER_t *plain /* DEFAULT 7 */; |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 439 | struct senums { |
| 440 | A_SET_OF(EnumType_t) list; |
| 441 | |
| 442 | /* Context for parsing across buffer boundaries */ |
| 443 | asn_struct_ctx_t _asn_ctx; |
| 444 | } senums; |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 445 | IA5String_t patest1; |
| 446 | IA5String_t patest2; |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 447 | |
| 448 | /* Presence bitmask: ASN_SET_ISPRESENT(pYpet, Ypet_PR_x) */ |
| 449 | unsigned int _presence_map |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 450 | [((5+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 451 | |
| 452 | /* Context for parsing across buffer boundaries */ |
| 453 | asn_struct_ctx_t _asn_ctx; |
| 454 | } Ypet_t; |
| 455 | |
| 456 | /*** <<< FUNC-DECLS [Ypet] >>> ***/ |
| 457 | |
| 458 | extern asn_TYPE_descriptor_t asn_DEF_Ypet; |
| 459 | |
Lev Walkin | b85a813 | 2005-08-18 13:38:19 +0000 | [diff] [blame] | 460 | /*** <<< POST-INCLUDE [Ypet] >>> ***/ |
| 461 | |
| 462 | #include <Epyt.h> |
| 463 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 464 | /*** <<< CTABLES [Ypet] >>> ***/ |
| 465 | |
| 466 | static int check_permitted_alphabet_6(const void *sptr) { |
| 467 | /* The underlying type is IA5String */ |
| 468 | const IA5String_t *st = (const IA5String_t *)sptr; |
| 469 | const uint8_t *ch = st->buf; |
| 470 | const uint8_t *end = ch + st->size; |
| 471 | |
| 472 | for(; ch < end; ch++) { |
| 473 | uint8_t cv = *ch; |
| 474 | if(!(cv >= 65 && cv <= 90)) return -1; |
| 475 | } |
| 476 | return 0; |
| 477 | } |
| 478 | |
| 479 | static int check_permitted_alphabet_7(const void *sptr) { |
| 480 | /* The underlying type is IA5String */ |
| 481 | const IA5String_t *st = (const IA5String_t *)sptr; |
| 482 | const uint8_t *ch = st->buf; |
| 483 | const uint8_t *end = ch + st->size; |
| 484 | |
| 485 | for(; ch < end; ch++) { |
| 486 | uint8_t cv = *ch; |
| 487 | if(!(cv >= 97 && cv <= 122)) return -1; |
| 488 | } |
| 489 | return 0; |
| 490 | } |
| 491 | |
| 492 | |
| 493 | /*** <<< CODE [Ypet] >>> ***/ |
| 494 | |
| 495 | static int |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 496 | memb_patest1_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 497 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 498 | const IA5String_t *st = (const IA5String_t *)sptr; |
| 499 | |
| 500 | if(!sptr) { |
| 501 | _ASN_ERRLOG(app_errlog, app_key, |
| 502 | "%s: value not given (%s:%d)", |
| 503 | td->name, __FILE__, __LINE__); |
| 504 | return -1; |
| 505 | } |
| 506 | |
| 507 | |
| 508 | if(!check_permitted_alphabet_6(st)) { |
| 509 | /* Constraint check succeeded */ |
| 510 | return 0; |
| 511 | } else { |
| 512 | _ASN_ERRLOG(app_errlog, app_key, |
| 513 | "%s: constraint failed (%s:%d)", |
| 514 | td->name, __FILE__, __LINE__); |
| 515 | return -1; |
| 516 | } |
| 517 | } |
| 518 | |
| 519 | static int |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 520 | memb_patest2_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 521 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 522 | const IA5String_t *st = (const IA5String_t *)sptr; |
| 523 | |
| 524 | if(!sptr) { |
| 525 | _ASN_ERRLOG(app_errlog, app_key, |
| 526 | "%s: value not given (%s:%d)", |
| 527 | td->name, __FILE__, __LINE__); |
| 528 | return -1; |
| 529 | } |
| 530 | |
| 531 | |
| 532 | if(!check_permitted_alphabet_7(st)) { |
| 533 | /* Constraint check succeeded */ |
| 534 | return 0; |
| 535 | } else { |
| 536 | _ASN_ERRLOG(app_errlog, app_key, |
| 537 | "%s: constraint failed (%s:%d)", |
| 538 | td->name, __FILE__, __LINE__); |
| 539 | return -1; |
| 540 | } |
| 541 | } |
| 542 | |
| 543 | |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 544 | /*** <<< STAT-DEFS [Ypet] >>> ***/ |
| 545 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 546 | static int asn_DFL_3_set_7(void **sptr) { |
| 547 | INTEGER_t *st = *sptr; |
| 548 | |
| 549 | if(!st) { |
| 550 | st = (*sptr = CALLOC(1, sizeof(*st))); |
| 551 | if(!st) return -1; |
| 552 | } |
| 553 | |
| 554 | /* Install default value 7 */ |
| 555 | return asn_long2INTEGER(st, 7); |
| 556 | } |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 557 | static asn_TYPE_member_t asn_MBR_senums_4[] = { |
Lev Walkin | 8eb4b57 | 2005-08-16 16:57:17 +0000 | [diff] [blame] | 558 | { ATF_POINTER, 0, 0, |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 559 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), |
| 560 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 561 | .type = &asn_DEF_EnumType, |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 562 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 563 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 564 | .default_value = 0, |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 565 | .name = "" |
| 566 | }, |
| 567 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 568 | static ber_tlv_tag_t asn_DEF_senums_tags_4[] = { |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 569 | (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 570 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 571 | static asn_SET_OF_specifics_t asn_SPC_senums_specs_4 = { |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 572 | sizeof(struct senums), |
| 573 | offsetof(struct senums, _asn_ctx), |
| 574 | 1, /* XER encoding is XMLValueList */ |
| 575 | }; |
| 576 | static /* Use -fall-defs-global to expose */ |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 577 | asn_TYPE_descriptor_t asn_DEF_senums_4 = { |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 578 | "senums", |
| 579 | "senums", |
| 580 | SET_OF_free, |
| 581 | SET_OF_print, |
| 582 | SET_OF_constraint, |
| 583 | SET_OF_decode_ber, |
| 584 | SET_OF_encode_der, |
| 585 | SET_OF_decode_xer, |
| 586 | SET_OF_encode_xer, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 587 | 0, /* No PER decoder, -gen-PER to enable */ |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 588 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 589 | asn_DEF_senums_tags_4, |
| 590 | sizeof(asn_DEF_senums_tags_4) |
| 591 | /sizeof(asn_DEF_senums_tags_4[0]), /* 1 */ |
| 592 | asn_DEF_senums_tags_4, /* Same as above */ |
| 593 | sizeof(asn_DEF_senums_tags_4) |
| 594 | /sizeof(asn_DEF_senums_tags_4[0]), /* 1 */ |
| 595 | 0, /* No PER visible constraints */ |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 596 | asn_MBR_senums_4, |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 597 | 1, /* Single element */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 598 | &asn_SPC_senums_specs_4 /* Additional specs */ |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 599 | }; |
| 600 | |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 601 | static asn_TYPE_member_t asn_MBR_Ypet_1[] = { |
Lev Walkin | b85a813 | 2005-08-18 13:38:19 +0000 | [diff] [blame] | 602 | { ATF_POINTER, 0, offsetof(struct Ypet, epyt), |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 603 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 604 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 605 | .type = &asn_DEF_Epyt, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 606 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 607 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 608 | .default_value = 0, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 609 | .name = "epyt" |
| 610 | }, |
| 611 | { ATF_POINTER, 1, offsetof(struct Ypet, plain), |
| 612 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 613 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 614 | .type = &asn_DEF_INTEGER, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 615 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 616 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 617 | .default_value = asn_DFL_3_set_7, /* DEFAULT 7 */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 618 | .name = "plain" |
| 619 | }, |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 620 | { ATF_NOFLAGS, 0, offsetof(struct Ypet, senums), |
| 621 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), |
| 622 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 623 | .type = &asn_DEF_senums_4, |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 624 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 625 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 626 | .default_value = 0, |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 627 | .name = "senums" |
| 628 | }, |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 629 | { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest1), |
| 630 | .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 631 | .tag_mode = +1, /* EXPLICIT tag at current level */ |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 632 | .type = &asn_DEF_IA5String, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 633 | .memb_constraints = memb_patest1_constraint_1, |
| 634 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 635 | .default_value = 0, |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 636 | .name = "patest1" |
| 637 | }, |
| 638 | { ATF_NOFLAGS, 0, offsetof(struct Ypet, patest2), |
| 639 | .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
| 640 | .tag_mode = +1, /* EXPLICIT tag at current level */ |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 641 | .type = &asn_DEF_IA5String, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 642 | .memb_constraints = memb_patest2_constraint_1, |
| 643 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 644 | .default_value = 0, |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 645 | .name = "patest2" |
| 646 | }, |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 647 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 648 | static ber_tlv_tag_t asn_DEF_Ypet_tags_1[] = { |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 649 | (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 650 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 651 | static asn_TYPE_tag2member_t asn_MAP_Ypet_tag2el_1[] = { |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 652 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* plain at 28 */ |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 653 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* epyt at 27 */ |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 654 | { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 }, /* senums at 29 */ |
| 655 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 }, /* patest1 at 30 */ |
| 656 | { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 4, 0, 0 } /* patest2 at 31 */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 657 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 658 | static uint8_t asn_MAP_Ypet_mmap_1[(5 + (8 * sizeof(unsigned int)) - 1) / 8] = { |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 659 | (1 << 7) | (0 << 6) | (1 << 5) | (1 << 4) | (1 << 3) |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 660 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 661 | static asn_SET_specifics_t asn_SPC_Ypet_specs_1 = { |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 662 | sizeof(struct Ypet), |
| 663 | offsetof(struct Ypet, _asn_ctx), |
| 664 | offsetof(struct Ypet, _presence_map), |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 665 | asn_MAP_Ypet_tag2el_1, |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 666 | 5, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 667 | asn_MAP_Ypet_tag2el_1, /* Same as above */ |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 668 | 5, /* Count of tags in the CXER map */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 669 | 0, /* Whether extensible */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 670 | (unsigned int *)asn_MAP_Ypet_mmap_1 /* Mandatory elements map */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 671 | }; |
| 672 | asn_TYPE_descriptor_t asn_DEF_Ypet = { |
| 673 | "Ypet", |
| 674 | "Ypet", |
| 675 | SET_free, |
| 676 | SET_print, |
| 677 | SET_constraint, |
| 678 | SET_decode_ber, |
| 679 | SET_encode_der, |
| 680 | SET_decode_xer, |
| 681 | SET_encode_xer, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 682 | 0, /* No PER decoder, -gen-PER to enable */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 683 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 684 | asn_DEF_Ypet_tags_1, |
| 685 | sizeof(asn_DEF_Ypet_tags_1) |
| 686 | /sizeof(asn_DEF_Ypet_tags_1[0]), /* 1 */ |
| 687 | asn_DEF_Ypet_tags_1, /* Same as above */ |
| 688 | sizeof(asn_DEF_Ypet_tags_1) |
| 689 | /sizeof(asn_DEF_Ypet_tags_1[0]), /* 1 */ |
| 690 | 0, /* No PER visible constraints */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 691 | asn_MBR_Ypet_1, |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 692 | 5, /* Elements count */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 693 | &asn_SPC_Ypet_specs_1 /* Additional specs */ |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 694 | }; |
| 695 | |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 696 | |
| 697 | /*** <<< INCLUDES [EnumType] >>> ***/ |
| 698 | |
| 699 | #include <ENUMERATED.h> |
| 700 | |
| 701 | /*** <<< DEPS [EnumType] >>> ***/ |
| 702 | |
| 703 | typedef enum EnumType { |
| 704 | EnumType_one = 0, |
| 705 | EnumType_two = 1 |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 706 | } e_EnumType; |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 707 | |
| 708 | /*** <<< TYPE-DECLS [EnumType] >>> ***/ |
| 709 | |
| 710 | typedef ENUMERATED_t EnumType_t; |
| 711 | |
| 712 | /*** <<< FUNC-DECLS [EnumType] >>> ***/ |
| 713 | |
| 714 | extern asn_TYPE_descriptor_t asn_DEF_EnumType; |
| 715 | asn_struct_free_f EnumType_free; |
| 716 | asn_struct_print_f EnumType_print; |
| 717 | asn_constr_check_f EnumType_constraint; |
| 718 | ber_type_decoder_f EnumType_decode_ber; |
| 719 | der_type_encoder_f EnumType_encode_der; |
| 720 | xer_type_decoder_f EnumType_decode_xer; |
| 721 | xer_type_encoder_f EnumType_encode_xer; |
| 722 | |
| 723 | /*** <<< CODE [EnumType] >>> ***/ |
| 724 | |
| 725 | int |
| 726 | EnumType_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 727 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 728 | /* Replace with underlying type checker */ |
| 729 | td->check_constraints = asn_DEF_ENUMERATED.check_constraints; |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 730 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 731 | } |
| 732 | |
| 733 | /* |
| 734 | * This type is implemented using ENUMERATED, |
| 735 | * so here we adjust the DEF accordingly. |
| 736 | */ |
| 737 | static void |
| 738 | EnumType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 739 | td->free_struct = asn_DEF_ENUMERATED.free_struct; |
| 740 | td->print_struct = asn_DEF_ENUMERATED.print_struct; |
| 741 | td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; |
| 742 | td->der_encoder = asn_DEF_ENUMERATED.der_encoder; |
| 743 | td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; |
| 744 | td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 745 | td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; |
| 746 | if(!td->per_constraints) |
| 747 | td->per_constraints = asn_DEF_ENUMERATED.per_constraints; |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 748 | td->elements = asn_DEF_ENUMERATED.elements; |
| 749 | td->elements_count = asn_DEF_ENUMERATED.elements_count; |
Lev Walkin | 29a8219 | 2005-03-29 19:05:37 +0000 | [diff] [blame] | 750 | /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 751 | } |
| 752 | |
| 753 | void |
| 754 | EnumType_free(asn_TYPE_descriptor_t *td, |
| 755 | void *struct_ptr, int contents_only) { |
| 756 | EnumType_1_inherit_TYPE_descriptor(td); |
| 757 | td->free_struct(td, struct_ptr, contents_only); |
| 758 | } |
| 759 | |
| 760 | int |
| 761 | EnumType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 762 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 763 | EnumType_1_inherit_TYPE_descriptor(td); |
| 764 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 765 | } |
| 766 | |
| 767 | asn_dec_rval_t |
| 768 | EnumType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
Lev Walkin | 3ebc65a | 2005-03-17 21:57:19 +0000 | [diff] [blame] | 769 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 770 | EnumType_1_inherit_TYPE_descriptor(td); |
| 771 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 772 | } |
| 773 | |
| 774 | asn_enc_rval_t |
| 775 | EnumType_encode_der(asn_TYPE_descriptor_t *td, |
| 776 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 777 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 778 | EnumType_1_inherit_TYPE_descriptor(td); |
| 779 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 780 | } |
| 781 | |
| 782 | asn_dec_rval_t |
| 783 | EnumType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
Lev Walkin | 3ebc65a | 2005-03-17 21:57:19 +0000 | [diff] [blame] | 784 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 785 | EnumType_1_inherit_TYPE_descriptor(td); |
| 786 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 787 | } |
| 788 | |
| 789 | asn_enc_rval_t |
| 790 | EnumType_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 791 | int ilevel, enum xer_encoder_flags_e flags, |
| 792 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 793 | EnumType_1_inherit_TYPE_descriptor(td); |
| 794 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 795 | } |
| 796 | |
| 797 | |
| 798 | /*** <<< STAT-DEFS [EnumType] >>> ***/ |
| 799 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 800 | static asn_INTEGER_enum_map_t asn_MAP_EnumType_value2enum_1[] = { |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 801 | { 0, 3, "one" }, |
| 802 | { 1, 3, "two" } |
| 803 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 804 | static unsigned int asn_MAP_EnumType_enum2value_1[] = { |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 805 | 0, /* one(0) */ |
| 806 | 1 /* two(1) */ |
| 807 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 808 | static asn_INTEGER_specifics_t asn_SPC_EnumType_specs_1 = { |
| 809 | asn_MAP_EnumType_value2enum_1, /* "tag" => N; sorted by tag */ |
| 810 | asn_MAP_EnumType_enum2value_1, /* N => "tag"; sorted by N */ |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 811 | 2, /* Number of elements in the maps */ |
| 812 | 0, /* Enumeration is not extensible */ |
| 813 | 1 /* Strict enumeration */ |
| 814 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 815 | static ber_tlv_tag_t asn_DEF_EnumType_tags_1[] = { |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 816 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) |
| 817 | }; |
| 818 | asn_TYPE_descriptor_t asn_DEF_EnumType = { |
| 819 | "EnumType", |
| 820 | "EnumType", |
| 821 | EnumType_free, |
| 822 | EnumType_print, |
| 823 | EnumType_constraint, |
| 824 | EnumType_decode_ber, |
| 825 | EnumType_encode_der, |
| 826 | EnumType_decode_xer, |
| 827 | EnumType_encode_xer, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 828 | 0, /* No PER decoder, -gen-PER to enable */ |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 829 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 830 | asn_DEF_EnumType_tags_1, |
| 831 | sizeof(asn_DEF_EnumType_tags_1) |
| 832 | /sizeof(asn_DEF_EnumType_tags_1[0]), /* 1 */ |
| 833 | asn_DEF_EnumType_tags_1, /* Same as above */ |
| 834 | sizeof(asn_DEF_EnumType_tags_1) |
| 835 | /sizeof(asn_DEF_EnumType_tags_1[0]), /* 1 */ |
| 836 | 0, /* No PER visible constraints */ |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 837 | 0, 0, /* Defined elsewhere */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 838 | &asn_SPC_EnumType_specs_1 /* Additional specs */ |
Lev Walkin | fe7f6ec | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 839 | }; |
| 840 | |