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