vlm | 0b567bf | 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 | |
vlm | 5feb752 | 2005-03-04 23:50:56 +0000 | [diff] [blame^] | 10 | struct Epyt; |
vlm | 0b567bf | 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 | |
vlm | 1f7df78 | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 32 | #include <EpytRef.h> |
vlm | 0b567bf | 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[] = { |
| 37 | { ATF_NOFLAGS, 0, 0, |
| 38 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 39 | .tag_mode = 0, |
vlm | 1f7df78 | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 40 | .type = (void *)&asn_DEF_EpytRef, |
vlm | 0b567bf | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 41 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 42 | .name = "" |
| 43 | }, |
| 44 | }; |
| 45 | static ber_tlv_tag_t asn_DEF_data_2_tags[] = { |
| 46 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 47 | }; |
| 48 | static asn_SET_OF_specifics_t asn_SPC_data_2_specs = { |
| 49 | sizeof(struct data), |
| 50 | offsetof(struct data, _asn_ctx), |
| 51 | 0, /* XER encoding is XMLDelimitedItemList */ |
| 52 | }; |
| 53 | static /* Use -fall-defs-global to expose */ |
| 54 | asn_TYPE_descriptor_t asn_DEF_data_2 = { |
| 55 | "data", |
| 56 | "data", |
| 57 | SEQUENCE_OF_free, |
| 58 | SEQUENCE_OF_print, |
| 59 | SEQUENCE_OF_constraint, |
| 60 | SEQUENCE_OF_decode_ber, |
| 61 | SEQUENCE_OF_encode_der, |
| 62 | SEQUENCE_OF_decode_xer, |
| 63 | SEQUENCE_OF_encode_xer, |
| 64 | 0, /* Use generic outmost tag fetcher */ |
| 65 | asn_DEF_data_2_tags, |
| 66 | sizeof(asn_DEF_data_2_tags) |
| 67 | /sizeof(asn_DEF_data_2_tags[0]), /* 1 */ |
| 68 | asn_DEF_data_2_tags, /* Same as above */ |
| 69 | sizeof(asn_DEF_data_2_tags) |
| 70 | /sizeof(asn_DEF_data_2_tags[0]), /* 1 */ |
| 71 | asn_MBR_data_2, |
| 72 | 1, /* Single element */ |
| 73 | &asn_SPC_data_2_specs /* Additional specs */ |
| 74 | }; |
| 75 | |
| 76 | static asn_TYPE_member_t asn_MBR_Type_1[] = { |
| 77 | { ATF_NOFLAGS, 0, offsetof(struct Type, data), |
| 78 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 79 | .tag_mode = 0, |
| 80 | .type = (void *)&asn_DEF_data_2, |
| 81 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 82 | .name = "data" |
| 83 | }, |
| 84 | }; |
| 85 | static ber_tlv_tag_t asn_DEF_Type_1_tags[] = { |
| 86 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 87 | }; |
| 88 | static asn_TYPE_tag2member_t asn_MAP_Type_1_tag2el[] = { |
| 89 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* data at 16 */ |
| 90 | }; |
| 91 | static asn_SEQUENCE_specifics_t asn_SPC_Type_1_specs = { |
| 92 | sizeof(struct Type), |
| 93 | offsetof(struct Type, _asn_ctx), |
| 94 | asn_MAP_Type_1_tag2el, |
| 95 | 1, /* Count of tags in the map */ |
| 96 | -1, /* Start extensions */ |
| 97 | -1 /* Stop extensions */ |
| 98 | }; |
| 99 | asn_TYPE_descriptor_t asn_DEF_Type = { |
| 100 | "Type", |
| 101 | "Type", |
| 102 | SEQUENCE_free, |
| 103 | SEQUENCE_print, |
| 104 | SEQUENCE_constraint, |
| 105 | SEQUENCE_decode_ber, |
| 106 | SEQUENCE_encode_der, |
| 107 | SEQUENCE_decode_xer, |
| 108 | SEQUENCE_encode_xer, |
| 109 | 0, /* Use generic outmost tag fetcher */ |
| 110 | asn_DEF_Type_1_tags, |
| 111 | sizeof(asn_DEF_Type_1_tags) |
| 112 | /sizeof(asn_DEF_Type_1_tags[0]), /* 1 */ |
| 113 | asn_DEF_Type_1_tags, /* Same as above */ |
| 114 | sizeof(asn_DEF_Type_1_tags) |
| 115 | /sizeof(asn_DEF_Type_1_tags[0]), /* 1 */ |
| 116 | asn_MBR_Type_1, |
| 117 | 1, /* Elements count */ |
| 118 | &asn_SPC_Type_1_specs /* Additional specs */ |
| 119 | }; |
| 120 | |
| 121 | |
vlm | 1f7df78 | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 122 | /*** <<< INCLUDES [EpytRef] >>> ***/ |
| 123 | |
| 124 | #include <Epyt.h> |
| 125 | |
| 126 | /*** <<< TYPE-DECLS [EpytRef] >>> ***/ |
| 127 | |
| 128 | typedef Epyt_t EpytRef_t; |
| 129 | |
| 130 | /*** <<< FUNC-DECLS [EpytRef] >>> ***/ |
| 131 | |
| 132 | extern asn_TYPE_descriptor_t asn_DEF_EpytRef; |
| 133 | asn_struct_free_f EpytRef_free; |
| 134 | asn_struct_print_f EpytRef_print; |
| 135 | asn_constr_check_f EpytRef_constraint; |
| 136 | ber_type_decoder_f EpytRef_decode_ber; |
| 137 | der_type_encoder_f EpytRef_encode_der; |
| 138 | xer_type_decoder_f EpytRef_decode_xer; |
| 139 | xer_type_encoder_f EpytRef_encode_xer; |
| 140 | |
| 141 | /*** <<< CODE [EpytRef] >>> ***/ |
| 142 | |
| 143 | int |
| 144 | EpytRef_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
| 145 | asn_app_consume_bytes_f *app_errlog, void *app_key) { |
| 146 | /* Replace with underlying type checker */ |
| 147 | td->check_constraints = asn_DEF_Epyt.check_constraints; |
| 148 | return td->check_constraints(td, sptr, app_errlog, app_key); |
| 149 | } |
| 150 | |
| 151 | /* |
| 152 | * This type is implemented using Epyt, |
| 153 | * so here we adjust the DEF accordingly. |
| 154 | */ |
| 155 | static void |
| 156 | EpytRef_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 157 | td->free_struct = asn_DEF_Epyt.free_struct; |
| 158 | td->print_struct = asn_DEF_Epyt.print_struct; |
| 159 | td->ber_decoder = asn_DEF_Epyt.ber_decoder; |
| 160 | td->der_encoder = asn_DEF_Epyt.der_encoder; |
| 161 | td->xer_decoder = asn_DEF_Epyt.xer_decoder; |
| 162 | td->xer_encoder = asn_DEF_Epyt.xer_encoder; |
| 163 | td->elements = asn_DEF_Epyt.elements; |
| 164 | td->elements_count = asn_DEF_Epyt.elements_count; |
| 165 | td->specifics = asn_DEF_Epyt.specifics; |
| 166 | } |
| 167 | |
| 168 | void |
| 169 | EpytRef_free(asn_TYPE_descriptor_t *td, |
| 170 | void *struct_ptr, int contents_only) { |
| 171 | EpytRef_0_inherit_TYPE_descriptor(td); |
| 172 | td->free_struct(td, struct_ptr, contents_only); |
| 173 | } |
| 174 | |
| 175 | int |
| 176 | EpytRef_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 177 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 178 | EpytRef_0_inherit_TYPE_descriptor(td); |
| 179 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 180 | } |
| 181 | |
| 182 | asn_dec_rval_t |
| 183 | EpytRef_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 184 | void **structure, void *bufptr, size_t size, int tag_mode) { |
| 185 | EpytRef_0_inherit_TYPE_descriptor(td); |
| 186 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 187 | } |
| 188 | |
| 189 | asn_enc_rval_t |
| 190 | EpytRef_encode_der(asn_TYPE_descriptor_t *td, |
| 191 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 192 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 193 | EpytRef_0_inherit_TYPE_descriptor(td); |
| 194 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 195 | } |
| 196 | |
| 197 | asn_dec_rval_t |
| 198 | EpytRef_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 199 | void **structure, const char *opt_mname, void *bufptr, size_t size) { |
| 200 | EpytRef_0_inherit_TYPE_descriptor(td); |
| 201 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 202 | } |
| 203 | |
| 204 | asn_enc_rval_t |
| 205 | EpytRef_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 206 | int ilevel, enum xer_encoder_flags_e flags, |
| 207 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 208 | EpytRef_0_inherit_TYPE_descriptor(td); |
| 209 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 210 | } |
| 211 | |
| 212 | |
| 213 | /*** <<< STAT-DEFS [EpytRef] >>> ***/ |
| 214 | |
| 215 | static ber_tlv_tag_t asn_DEF_EpytRef_0_tags[] = { |
| 216 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 217 | }; |
| 218 | asn_TYPE_descriptor_t asn_DEF_EpytRef = { |
| 219 | "EpytRef", |
| 220 | "EpytRef", |
| 221 | EpytRef_free, |
| 222 | EpytRef_print, |
| 223 | EpytRef_constraint, |
| 224 | EpytRef_decode_ber, |
| 225 | EpytRef_encode_der, |
| 226 | EpytRef_decode_xer, |
| 227 | EpytRef_encode_xer, |
| 228 | 0, /* Use generic outmost tag fetcher */ |
| 229 | asn_DEF_EpytRef_0_tags, |
| 230 | sizeof(asn_DEF_EpytRef_0_tags) |
| 231 | /sizeof(asn_DEF_EpytRef_0_tags[0]), /* 1 */ |
| 232 | asn_DEF_EpytRef_0_tags, /* Same as above */ |
| 233 | sizeof(asn_DEF_EpytRef_0_tags) |
| 234 | /sizeof(asn_DEF_EpytRef_0_tags[0]), /* 1 */ |
| 235 | 0, 0, /* Defined elsewhere */ |
| 236 | 0 /* No specifics */ |
| 237 | }; |
| 238 | |
| 239 | |
vlm | 0b567bf | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 240 | /*** <<< INCLUDES [Epyt] >>> ***/ |
| 241 | |
| 242 | #include <asn_SET_OF.h> |
| 243 | #include <constr_SET_OF.h> |
| 244 | #include <constr_SEQUENCE.h> |
| 245 | |
| 246 | /*** <<< FWD-DECLS [Epyt] >>> ***/ |
| 247 | |
vlm | 5feb752 | 2005-03-04 23:50:56 +0000 | [diff] [blame^] | 248 | struct Type; |
| 249 | struct Ypet; |
vlm | 0b567bf | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 250 | |
| 251 | /*** <<< TYPE-DECLS [Epyt] >>> ***/ |
| 252 | |
| 253 | typedef struct Epyt { |
| 254 | struct stype { |
| 255 | A_SET_OF(struct Type) list; |
| 256 | |
| 257 | /* Context for parsing across buffer boundaries */ |
| 258 | asn_struct_ctx_t _asn_ctx; |
| 259 | } stype; |
| 260 | struct Type *type /* OPTIONAL */; |
| 261 | struct Ypet *ypet /* OPTIONAL */; |
| 262 | |
| 263 | /* Context for parsing across buffer boundaries */ |
| 264 | asn_struct_ctx_t _asn_ctx; |
| 265 | } Epyt_t; |
| 266 | |
| 267 | /*** <<< FUNC-DECLS [Epyt] >>> ***/ |
| 268 | |
| 269 | extern asn_TYPE_descriptor_t asn_DEF_Epyt; |
| 270 | |
| 271 | /*** <<< POST-INCLUDE [Epyt] >>> ***/ |
| 272 | |
| 273 | #include <Type.h> |
| 274 | #include <Ypet.h> |
| 275 | |
| 276 | /*** <<< STAT-DEFS [Epyt] >>> ***/ |
| 277 | |
| 278 | static asn_TYPE_member_t asn_MBR_stype_2[] = { |
| 279 | { ATF_NOFLAGS, 0, 0, |
| 280 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 281 | .tag_mode = 0, |
| 282 | .type = (void *)&asn_DEF_Type, |
| 283 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 284 | .name = "" |
| 285 | }, |
| 286 | }; |
| 287 | static ber_tlv_tag_t asn_DEF_stype_2_tags[] = { |
| 288 | (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 289 | }; |
| 290 | static asn_SET_OF_specifics_t asn_SPC_stype_2_specs = { |
| 291 | sizeof(struct stype), |
| 292 | offsetof(struct stype, _asn_ctx), |
| 293 | 0, /* XER encoding is XMLDelimitedItemList */ |
| 294 | }; |
| 295 | static /* Use -fall-defs-global to expose */ |
| 296 | asn_TYPE_descriptor_t asn_DEF_stype_2 = { |
| 297 | "stype", |
| 298 | "stype", |
| 299 | SET_OF_free, |
| 300 | SET_OF_print, |
| 301 | SET_OF_constraint, |
| 302 | SET_OF_decode_ber, |
| 303 | SET_OF_encode_der, |
| 304 | SET_OF_decode_xer, |
| 305 | SET_OF_encode_xer, |
| 306 | 0, /* Use generic outmost tag fetcher */ |
| 307 | asn_DEF_stype_2_tags, |
| 308 | sizeof(asn_DEF_stype_2_tags) |
| 309 | /sizeof(asn_DEF_stype_2_tags[0]), /* 1 */ |
| 310 | asn_DEF_stype_2_tags, /* Same as above */ |
| 311 | sizeof(asn_DEF_stype_2_tags) |
| 312 | /sizeof(asn_DEF_stype_2_tags[0]), /* 1 */ |
| 313 | asn_MBR_stype_2, |
| 314 | 1, /* Single element */ |
| 315 | &asn_SPC_stype_2_specs /* Additional specs */ |
| 316 | }; |
| 317 | |
| 318 | static asn_TYPE_member_t asn_MBR_Epyt_1[] = { |
| 319 | { ATF_NOFLAGS, 0, offsetof(struct Epyt, stype), |
| 320 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), |
| 321 | .tag_mode = 0, |
| 322 | .type = (void *)&asn_DEF_stype_2, |
| 323 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 324 | .name = "stype" |
| 325 | }, |
| 326 | { ATF_POINTER, 2, offsetof(struct Epyt, type), |
| 327 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 328 | .tag_mode = 0, |
| 329 | .type = (void *)&asn_DEF_Type, |
| 330 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 331 | .name = "type" |
| 332 | }, |
| 333 | { ATF_POINTER, 1, offsetof(struct Epyt, ypet), |
| 334 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), |
| 335 | .tag_mode = 0, |
| 336 | .type = (void *)&asn_DEF_Ypet, |
| 337 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 338 | .name = "ypet" |
| 339 | }, |
| 340 | }; |
| 341 | static ber_tlv_tag_t asn_DEF_Epyt_1_tags[] = { |
| 342 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 343 | }; |
| 344 | static asn_TYPE_tag2member_t asn_MAP_Epyt_1_tag2el[] = { |
| 345 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* type at 22 */ |
| 346 | { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 1 }, /* stype at 21 */ |
| 347 | { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, -1, 0 } /* ypet at 23 */ |
| 348 | }; |
| 349 | static asn_SEQUENCE_specifics_t asn_SPC_Epyt_1_specs = { |
| 350 | sizeof(struct Epyt), |
| 351 | offsetof(struct Epyt, _asn_ctx), |
| 352 | asn_MAP_Epyt_1_tag2el, |
| 353 | 3, /* Count of tags in the map */ |
| 354 | -1, /* Start extensions */ |
| 355 | -1 /* Stop extensions */ |
| 356 | }; |
| 357 | asn_TYPE_descriptor_t asn_DEF_Epyt = { |
| 358 | "Epyt", |
| 359 | "Epyt", |
| 360 | SEQUENCE_free, |
| 361 | SEQUENCE_print, |
| 362 | SEQUENCE_constraint, |
| 363 | SEQUENCE_decode_ber, |
| 364 | SEQUENCE_encode_der, |
| 365 | SEQUENCE_decode_xer, |
| 366 | SEQUENCE_encode_xer, |
| 367 | 0, /* Use generic outmost tag fetcher */ |
| 368 | asn_DEF_Epyt_1_tags, |
| 369 | sizeof(asn_DEF_Epyt_1_tags) |
| 370 | /sizeof(asn_DEF_Epyt_1_tags[0]), /* 1 */ |
| 371 | asn_DEF_Epyt_1_tags, /* Same as above */ |
| 372 | sizeof(asn_DEF_Epyt_1_tags) |
| 373 | /sizeof(asn_DEF_Epyt_1_tags[0]), /* 1 */ |
| 374 | asn_MBR_Epyt_1, |
| 375 | 3, /* Elements count */ |
| 376 | &asn_SPC_Epyt_1_specs /* Additional specs */ |
| 377 | }; |
| 378 | |
| 379 | |
| 380 | /*** <<< INCLUDES [Ypet] >>> ***/ |
| 381 | |
| 382 | #include <Epyt.h> |
| 383 | #include <INTEGER.h> |
vlm | 6c5d5e5 | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 384 | #include <EnumType.h> |
| 385 | #include <asn_SET_OF.h> |
| 386 | #include <constr_SET_OF.h> |
vlm | 0b567bf | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 387 | #include <constr_SET.h> |
| 388 | |
| 389 | /*** <<< DEPS [Ypet] >>> ***/ |
| 390 | |
| 391 | |
| 392 | /* |
| 393 | * Method of determining the components presence |
| 394 | */ |
| 395 | typedef enum Ypet_PR { |
| 396 | Ypet_PR_epyt, /* Member epyt is present */ |
| 397 | Ypet_PR_plain, /* Member plain is present */ |
vlm | 6c5d5e5 | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 398 | Ypet_PR_senums, /* Member senums is present */ |
vlm | 0b567bf | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 399 | } Ypet_PR; |
| 400 | |
| 401 | /*** <<< TYPE-DECLS [Ypet] >>> ***/ |
| 402 | |
| 403 | typedef struct Ypet { |
| 404 | Epyt_t epyt; |
| 405 | INTEGER_t *plain /* DEFAULT 7 */; |
vlm | 6c5d5e5 | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 406 | struct senums { |
| 407 | A_SET_OF(EnumType_t) list; |
| 408 | |
| 409 | /* Context for parsing across buffer boundaries */ |
| 410 | asn_struct_ctx_t _asn_ctx; |
| 411 | } senums; |
vlm | 0b567bf | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 412 | |
| 413 | /* Presence bitmask: ASN_SET_ISPRESENT(pYpet, Ypet_PR_x) */ |
| 414 | unsigned int _presence_map |
vlm | 6c5d5e5 | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 415 | [((3+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; |
vlm | 0b567bf | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 416 | |
| 417 | /* Context for parsing across buffer boundaries */ |
| 418 | asn_struct_ctx_t _asn_ctx; |
| 419 | } Ypet_t; |
| 420 | |
| 421 | /*** <<< FUNC-DECLS [Ypet] >>> ***/ |
| 422 | |
| 423 | extern asn_TYPE_descriptor_t asn_DEF_Ypet; |
| 424 | |
| 425 | /*** <<< STAT-DEFS [Ypet] >>> ***/ |
| 426 | |
vlm | 6c5d5e5 | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 427 | static asn_TYPE_member_t asn_MBR_senums_2[] = { |
| 428 | { ATF_NOFLAGS, 0, 0, |
| 429 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), |
| 430 | .tag_mode = 0, |
| 431 | .type = (void *)&asn_DEF_EnumType, |
| 432 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 433 | .name = "" |
| 434 | }, |
| 435 | }; |
| 436 | static ber_tlv_tag_t asn_DEF_senums_2_tags[] = { |
| 437 | (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 438 | }; |
| 439 | static asn_SET_OF_specifics_t asn_SPC_senums_2_specs = { |
| 440 | sizeof(struct senums), |
| 441 | offsetof(struct senums, _asn_ctx), |
| 442 | 1, /* XER encoding is XMLValueList */ |
| 443 | }; |
| 444 | static /* Use -fall-defs-global to expose */ |
| 445 | asn_TYPE_descriptor_t asn_DEF_senums_2 = { |
| 446 | "senums", |
| 447 | "senums", |
| 448 | SET_OF_free, |
| 449 | SET_OF_print, |
| 450 | SET_OF_constraint, |
| 451 | SET_OF_decode_ber, |
| 452 | SET_OF_encode_der, |
| 453 | SET_OF_decode_xer, |
| 454 | SET_OF_encode_xer, |
| 455 | 0, /* Use generic outmost tag fetcher */ |
| 456 | asn_DEF_senums_2_tags, |
| 457 | sizeof(asn_DEF_senums_2_tags) |
| 458 | /sizeof(asn_DEF_senums_2_tags[0]), /* 1 */ |
| 459 | asn_DEF_senums_2_tags, /* Same as above */ |
| 460 | sizeof(asn_DEF_senums_2_tags) |
| 461 | /sizeof(asn_DEF_senums_2_tags[0]), /* 1 */ |
| 462 | asn_MBR_senums_2, |
| 463 | 1, /* Single element */ |
| 464 | &asn_SPC_senums_2_specs /* Additional specs */ |
| 465 | }; |
| 466 | |
vlm | 0b567bf | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 467 | static asn_TYPE_member_t asn_MBR_Ypet_1[] = { |
| 468 | { ATF_NOFLAGS, 0, offsetof(struct Ypet, epyt), |
| 469 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 470 | .tag_mode = 0, |
| 471 | .type = (void *)&asn_DEF_Epyt, |
| 472 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 473 | .name = "epyt" |
| 474 | }, |
| 475 | { ATF_POINTER, 1, offsetof(struct Ypet, plain), |
| 476 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 477 | .tag_mode = 0, |
| 478 | .type = (void *)&asn_DEF_INTEGER, |
| 479 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 480 | .name = "plain" |
| 481 | }, |
vlm | 6c5d5e5 | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 482 | { ATF_NOFLAGS, 0, offsetof(struct Ypet, senums), |
| 483 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), |
| 484 | .tag_mode = 0, |
| 485 | .type = (void *)&asn_DEF_senums_2, |
| 486 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 487 | .name = "senums" |
| 488 | }, |
vlm | 0b567bf | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 489 | }; |
| 490 | static ber_tlv_tag_t asn_DEF_Ypet_1_tags[] = { |
| 491 | (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 492 | }; |
| 493 | static asn_TYPE_tag2member_t asn_MAP_Ypet_1_tag2el[] = { |
| 494 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* plain at 28 */ |
vlm | 6c5d5e5 | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 495 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* epyt at 27 */ |
| 496 | { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 } /* senums at 30 */ |
vlm | 0b567bf | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 497 | }; |
vlm | 6c5d5e5 | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 498 | static uint8_t asn_MAP_Ypet_1_mmap[(3 + (8 * sizeof(unsigned int)) - 1) / 8] = { |
| 499 | (1 << 7) | (0 << 6) | (1 << 5) |
vlm | 0b567bf | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 500 | }; |
| 501 | static asn_SET_specifics_t asn_SPC_Ypet_1_specs = { |
| 502 | sizeof(struct Ypet), |
| 503 | offsetof(struct Ypet, _asn_ctx), |
| 504 | offsetof(struct Ypet, _presence_map), |
| 505 | asn_MAP_Ypet_1_tag2el, |
vlm | 6c5d5e5 | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 506 | 3, /* Count of tags in the map */ |
vlm | 0b567bf | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 507 | asn_MAP_Ypet_1_tag2el, /* Same as above */ |
vlm | 6c5d5e5 | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 508 | 3, /* Count of tags in the CXER map */ |
vlm | 0b567bf | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 509 | 0, /* Whether extensible */ |
| 510 | (unsigned int *)asn_MAP_Ypet_1_mmap /* Mandatory elements map */ |
| 511 | }; |
| 512 | asn_TYPE_descriptor_t asn_DEF_Ypet = { |
| 513 | "Ypet", |
| 514 | "Ypet", |
| 515 | SET_free, |
| 516 | SET_print, |
| 517 | SET_constraint, |
| 518 | SET_decode_ber, |
| 519 | SET_encode_der, |
| 520 | SET_decode_xer, |
| 521 | SET_encode_xer, |
| 522 | 0, /* Use generic outmost tag fetcher */ |
| 523 | asn_DEF_Ypet_1_tags, |
| 524 | sizeof(asn_DEF_Ypet_1_tags) |
| 525 | /sizeof(asn_DEF_Ypet_1_tags[0]), /* 1 */ |
| 526 | asn_DEF_Ypet_1_tags, /* Same as above */ |
| 527 | sizeof(asn_DEF_Ypet_1_tags) |
| 528 | /sizeof(asn_DEF_Ypet_1_tags[0]), /* 1 */ |
| 529 | asn_MBR_Ypet_1, |
vlm | 6c5d5e5 | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 530 | 3, /* Elements count */ |
vlm | 0b567bf | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 531 | &asn_SPC_Ypet_1_specs /* Additional specs */ |
| 532 | }; |
| 533 | |
vlm | 6c5d5e5 | 2005-03-04 22:38:22 +0000 | [diff] [blame] | 534 | |
| 535 | /*** <<< INCLUDES [EnumType] >>> ***/ |
| 536 | |
| 537 | #include <ENUMERATED.h> |
| 538 | |
| 539 | /*** <<< DEPS [EnumType] >>> ***/ |
| 540 | |
| 541 | typedef enum EnumType { |
| 542 | EnumType_one = 0, |
| 543 | EnumType_two = 1 |
| 544 | } EnumType_e; |
| 545 | |
| 546 | /*** <<< TYPE-DECLS [EnumType] >>> ***/ |
| 547 | |
| 548 | typedef ENUMERATED_t EnumType_t; |
| 549 | |
| 550 | /*** <<< FUNC-DECLS [EnumType] >>> ***/ |
| 551 | |
| 552 | extern asn_TYPE_descriptor_t asn_DEF_EnumType; |
| 553 | asn_struct_free_f EnumType_free; |
| 554 | asn_struct_print_f EnumType_print; |
| 555 | asn_constr_check_f EnumType_constraint; |
| 556 | ber_type_decoder_f EnumType_decode_ber; |
| 557 | der_type_encoder_f EnumType_encode_der; |
| 558 | xer_type_decoder_f EnumType_decode_xer; |
| 559 | xer_type_encoder_f EnumType_encode_xer; |
| 560 | |
| 561 | /*** <<< CODE [EnumType] >>> ***/ |
| 562 | |
| 563 | int |
| 564 | EnumType_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
| 565 | asn_app_consume_bytes_f *app_errlog, void *app_key) { |
| 566 | /* Replace with underlying type checker */ |
| 567 | td->check_constraints = asn_DEF_ENUMERATED.check_constraints; |
| 568 | return td->check_constraints(td, sptr, app_errlog, app_key); |
| 569 | } |
| 570 | |
| 571 | /* |
| 572 | * This type is implemented using ENUMERATED, |
| 573 | * so here we adjust the DEF accordingly. |
| 574 | */ |
| 575 | static void |
| 576 | EnumType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 577 | td->free_struct = asn_DEF_ENUMERATED.free_struct; |
| 578 | td->print_struct = asn_DEF_ENUMERATED.print_struct; |
| 579 | td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; |
| 580 | td->der_encoder = asn_DEF_ENUMERATED.der_encoder; |
| 581 | td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; |
| 582 | td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; |
| 583 | td->elements = asn_DEF_ENUMERATED.elements; |
| 584 | td->elements_count = asn_DEF_ENUMERATED.elements_count; |
| 585 | /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ |
| 586 | } |
| 587 | |
| 588 | void |
| 589 | EnumType_free(asn_TYPE_descriptor_t *td, |
| 590 | void *struct_ptr, int contents_only) { |
| 591 | EnumType_1_inherit_TYPE_descriptor(td); |
| 592 | td->free_struct(td, struct_ptr, contents_only); |
| 593 | } |
| 594 | |
| 595 | int |
| 596 | EnumType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 597 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 598 | EnumType_1_inherit_TYPE_descriptor(td); |
| 599 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 600 | } |
| 601 | |
| 602 | asn_dec_rval_t |
| 603 | EnumType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 604 | void **structure, void *bufptr, size_t size, int tag_mode) { |
| 605 | EnumType_1_inherit_TYPE_descriptor(td); |
| 606 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 607 | } |
| 608 | |
| 609 | asn_enc_rval_t |
| 610 | EnumType_encode_der(asn_TYPE_descriptor_t *td, |
| 611 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 612 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 613 | EnumType_1_inherit_TYPE_descriptor(td); |
| 614 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 615 | } |
| 616 | |
| 617 | asn_dec_rval_t |
| 618 | EnumType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 619 | void **structure, const char *opt_mname, void *bufptr, size_t size) { |
| 620 | EnumType_1_inherit_TYPE_descriptor(td); |
| 621 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 622 | } |
| 623 | |
| 624 | asn_enc_rval_t |
| 625 | EnumType_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 626 | int ilevel, enum xer_encoder_flags_e flags, |
| 627 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 628 | EnumType_1_inherit_TYPE_descriptor(td); |
| 629 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 630 | } |
| 631 | |
| 632 | |
| 633 | /*** <<< STAT-DEFS [EnumType] >>> ***/ |
| 634 | |
| 635 | static asn_INTEGER_enum_map_t asn_MAP_EnumType_1_value2enum[] = { |
| 636 | { 0, 3, "one" }, |
| 637 | { 1, 3, "two" } |
| 638 | }; |
| 639 | static unsigned int asn_MAP_EnumType_1_enum2value[] = { |
| 640 | 0, /* one(0) */ |
| 641 | 1 /* two(1) */ |
| 642 | }; |
| 643 | static asn_INTEGER_specifics_t asn_SPC_EnumType_1_specs = { |
| 644 | asn_MAP_EnumType_1_value2enum, /* "tag" => N; sorted by tag */ |
| 645 | asn_MAP_EnumType_1_enum2value, /* N => "tag"; sorted by N */ |
| 646 | 2, /* Number of elements in the maps */ |
| 647 | 0, /* Enumeration is not extensible */ |
| 648 | 1 /* Strict enumeration */ |
| 649 | }; |
| 650 | static ber_tlv_tag_t asn_DEF_EnumType_1_tags[] = { |
| 651 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) |
| 652 | }; |
| 653 | asn_TYPE_descriptor_t asn_DEF_EnumType = { |
| 654 | "EnumType", |
| 655 | "EnumType", |
| 656 | EnumType_free, |
| 657 | EnumType_print, |
| 658 | EnumType_constraint, |
| 659 | EnumType_decode_ber, |
| 660 | EnumType_encode_der, |
| 661 | EnumType_decode_xer, |
| 662 | EnumType_encode_xer, |
| 663 | 0, /* Use generic outmost tag fetcher */ |
| 664 | asn_DEF_EnumType_1_tags, |
| 665 | sizeof(asn_DEF_EnumType_1_tags) |
| 666 | /sizeof(asn_DEF_EnumType_1_tags[0]), /* 1 */ |
| 667 | asn_DEF_EnumType_1_tags, /* Same as above */ |
| 668 | sizeof(asn_DEF_EnumType_1_tags) |
| 669 | /sizeof(asn_DEF_EnumType_1_tags[0]), /* 1 */ |
| 670 | 0, 0, /* Defined elsewhere */ |
| 671 | &asn_SPC_EnumType_1_specs /* Additional specs */ |
| 672 | }; |
| 673 | |