Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [SIGNED] >>> ***/ |
| 3 | |
| 4 | #include <REAL.h> |
| 5 | #include <constr_SEQUENCE.h> |
| 6 | #include <INTEGER.h> |
| 7 | #include <constr_SET.h> |
| 8 | |
| 9 | /*** <<< DEPS [SIGNED] >>> ***/ |
| 10 | |
| 11 | |
| 12 | /* |
| 13 | * Method of determining the components presence |
| 14 | */ |
| 15 | typedef enum signed_PR { |
| 16 | signed_PR_a, /* Member a is present */ |
| 17 | } signed_PR; |
| 18 | |
| 19 | /*** <<< TYPE-DECLS [SIGNED] >>> ***/ |
| 20 | |
| 21 | typedef struct SIGNED_16P0 { |
| 22 | REAL_t Signed; |
| 23 | |
| 24 | /* Context for parsing across buffer boundaries */ |
| 25 | asn_struct_ctx_t _asn_ctx; |
| 26 | } SIGNED_16P0_t; |
| 27 | typedef struct SIGNED_16P1 { |
| 28 | struct Signed { |
| 29 | INTEGER_t a; |
| 30 | |
| 31 | /* Presence bitmask: ASN_SET_ISPRESENT(psigned, signed_PR_x) */ |
| 32 | unsigned int _presence_map |
| 33 | [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; |
| 34 | |
| 35 | /* Context for parsing across buffer boundaries */ |
| 36 | asn_struct_ctx_t _asn_ctx; |
| 37 | } Signed; |
| 38 | |
| 39 | /* Context for parsing across buffer boundaries */ |
| 40 | asn_struct_ctx_t _asn_ctx; |
| 41 | } SIGNED_16P1_t; |
| 42 | |
| 43 | /*** <<< FUNC-DECLS [SIGNED] >>> ***/ |
| 44 | |
| 45 | extern asn_TYPE_descriptor_t asn_DEF_SIGNED_16P0; |
| 46 | extern asn_TYPE_descriptor_t asn_DEF_SIGNED_16P1; |
| 47 | |
| 48 | /*** <<< STAT-DEFS [SIGNED] >>> ***/ |
| 49 | |
| 50 | static asn_TYPE_member_t asn_MBR_SIGNED_16P0_1[] = { |
| 51 | { ATF_NOFLAGS, 0, offsetof(struct SIGNED_16P0, Signed), |
| 52 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), |
| 53 | .tag_mode = 0, |
| 54 | .type = &asn_DEF_REAL, |
| 55 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 56 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 57 | .default_value = 0, |
| 58 | .name = "signed" |
| 59 | }, |
| 60 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 61 | static const ber_tlv_tag_t asn_DEF_SIGNED_16P0_tags_1[] = { |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 62 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 63 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 64 | static const asn_TYPE_tag2member_t asn_MAP_SIGNED_16P0_tag2el_1[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 65 | { (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), 0, 0, 0 } /* signed */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 66 | }; |
| 67 | static asn_SEQUENCE_specifics_t asn_SPC_SIGNED_16P0_specs_1 = { |
| 68 | sizeof(struct SIGNED_16P0), |
| 69 | offsetof(struct SIGNED_16P0, _asn_ctx), |
| 70 | asn_MAP_SIGNED_16P0_tag2el_1, |
| 71 | 1, /* Count of tags in the map */ |
| 72 | 0, 0, 0, /* Optional elements (not needed) */ |
| 73 | -1, /* Start extensions */ |
| 74 | -1 /* Stop extensions */ |
| 75 | }; |
| 76 | asn_TYPE_descriptor_t asn_DEF_SIGNED_16P0 = { |
| 77 | "SIGNED", |
| 78 | "SIGNED", |
| 79 | SEQUENCE_free, |
| 80 | SEQUENCE_print, |
| 81 | SEQUENCE_constraint, |
| 82 | SEQUENCE_decode_ber, |
| 83 | SEQUENCE_encode_der, |
| 84 | SEQUENCE_decode_xer, |
| 85 | SEQUENCE_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 86 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 87 | 0, /* Use generic outmost tag fetcher */ |
| 88 | asn_DEF_SIGNED_16P0_tags_1, |
| 89 | sizeof(asn_DEF_SIGNED_16P0_tags_1) |
| 90 | /sizeof(asn_DEF_SIGNED_16P0_tags_1[0]), /* 1 */ |
| 91 | asn_DEF_SIGNED_16P0_tags_1, /* Same as above */ |
| 92 | sizeof(asn_DEF_SIGNED_16P0_tags_1) |
| 93 | /sizeof(asn_DEF_SIGNED_16P0_tags_1[0]), /* 1 */ |
| 94 | 0, /* No PER visible constraints */ |
| 95 | asn_MBR_SIGNED_16P0_1, |
| 96 | 1, /* Elements count */ |
| 97 | &asn_SPC_SIGNED_16P0_specs_1 /* Additional specs */ |
| 98 | }; |
| 99 | |
| 100 | static asn_TYPE_member_t asn_MBR_signed_4[] = { |
| 101 | { ATF_NOFLAGS, 0, offsetof(struct Signed, a), |
| 102 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 103 | .tag_mode = 0, |
| 104 | .type = &asn_DEF_INTEGER, |
| 105 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 106 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 107 | .default_value = 0, |
| 108 | .name = "a" |
| 109 | }, |
| 110 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 111 | static const ber_tlv_tag_t asn_DEF_signed_tags_4[] = { |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 112 | (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 113 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 114 | static const asn_TYPE_tag2member_t asn_MAP_signed_tag2el_4[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 115 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* a */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 116 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 117 | static const uint8_t asn_MAP_signed_mmap_4[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = { |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 118 | (1 << 7) |
| 119 | }; |
| 120 | static asn_SET_specifics_t asn_SPC_signed_specs_4 = { |
| 121 | sizeof(struct Signed), |
| 122 | offsetof(struct Signed, _asn_ctx), |
| 123 | offsetof(struct Signed, _presence_map), |
| 124 | asn_MAP_signed_tag2el_4, |
| 125 | 1, /* Count of tags in the map */ |
| 126 | asn_MAP_signed_tag2el_4, /* Same as above */ |
| 127 | 1, /* Count of tags in the CXER map */ |
| 128 | 0, /* Whether extensible */ |
| 129 | (unsigned int *)asn_MAP_signed_mmap_4 /* Mandatory elements map */ |
| 130 | }; |
| 131 | static /* Use -fall-defs-global to expose */ |
| 132 | asn_TYPE_descriptor_t asn_DEF_signed_4 = { |
| 133 | "signed", |
| 134 | "signed", |
| 135 | SET_free, |
| 136 | SET_print, |
| 137 | SET_constraint, |
| 138 | SET_decode_ber, |
| 139 | SET_encode_der, |
| 140 | SET_decode_xer, |
| 141 | SET_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 142 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 143 | 0, /* Use generic outmost tag fetcher */ |
| 144 | asn_DEF_signed_tags_4, |
| 145 | sizeof(asn_DEF_signed_tags_4) |
| 146 | /sizeof(asn_DEF_signed_tags_4[0]), /* 1 */ |
| 147 | asn_DEF_signed_tags_4, /* Same as above */ |
| 148 | sizeof(asn_DEF_signed_tags_4) |
| 149 | /sizeof(asn_DEF_signed_tags_4[0]), /* 1 */ |
| 150 | 0, /* No PER visible constraints */ |
| 151 | asn_MBR_signed_4, |
| 152 | 1, /* Elements count */ |
| 153 | &asn_SPC_signed_specs_4 /* Additional specs */ |
| 154 | }; |
| 155 | |
| 156 | static asn_TYPE_member_t asn_MBR_SIGNED_16P1_3[] = { |
| 157 | { ATF_NOFLAGS, 0, offsetof(struct SIGNED_16P1, Signed), |
| 158 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), |
| 159 | .tag_mode = 0, |
| 160 | .type = &asn_DEF_signed_4, |
| 161 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 162 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 163 | .default_value = 0, |
| 164 | .name = "signed" |
| 165 | }, |
| 166 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 167 | static const ber_tlv_tag_t asn_DEF_SIGNED_16P1_tags_3[] = { |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 168 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 169 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 170 | static const asn_TYPE_tag2member_t asn_MAP_SIGNED_16P1_tag2el_3[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 171 | { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 0 } /* signed */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 172 | }; |
| 173 | static asn_SEQUENCE_specifics_t asn_SPC_SIGNED_16P1_specs_3 = { |
| 174 | sizeof(struct SIGNED_16P1), |
| 175 | offsetof(struct SIGNED_16P1, _asn_ctx), |
| 176 | asn_MAP_SIGNED_16P1_tag2el_3, |
| 177 | 1, /* Count of tags in the map */ |
| 178 | 0, 0, 0, /* Optional elements (not needed) */ |
| 179 | -1, /* Start extensions */ |
| 180 | -1 /* Stop extensions */ |
| 181 | }; |
| 182 | asn_TYPE_descriptor_t asn_DEF_SIGNED_16P1 = { |
| 183 | "SIGNED", |
| 184 | "SIGNED", |
| 185 | SEQUENCE_free, |
| 186 | SEQUENCE_print, |
| 187 | SEQUENCE_constraint, |
| 188 | SEQUENCE_decode_ber, |
| 189 | SEQUENCE_encode_der, |
| 190 | SEQUENCE_decode_xer, |
| 191 | SEQUENCE_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 192 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 193 | 0, /* Use generic outmost tag fetcher */ |
| 194 | asn_DEF_SIGNED_16P1_tags_3, |
| 195 | sizeof(asn_DEF_SIGNED_16P1_tags_3) |
| 196 | /sizeof(asn_DEF_SIGNED_16P1_tags_3[0]), /* 1 */ |
| 197 | asn_DEF_SIGNED_16P1_tags_3, /* Same as above */ |
| 198 | sizeof(asn_DEF_SIGNED_16P1_tags_3) |
| 199 | /sizeof(asn_DEF_SIGNED_16P1_tags_3[0]), /* 1 */ |
| 200 | 0, /* No PER visible constraints */ |
| 201 | asn_MBR_SIGNED_16P1_3, |
| 202 | 1, /* Elements count */ |
| 203 | &asn_SPC_SIGNED_16P1_specs_3 /* Additional specs */ |
| 204 | }; |
| 205 | |
| 206 | |
| 207 | /*** <<< INCLUDES [SignedREAL] >>> ***/ |
| 208 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 209 | #include "SIGNED.h" |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 210 | |
| 211 | /*** <<< TYPE-DECLS [SignedREAL] >>> ***/ |
| 212 | |
| 213 | typedef SIGNED_16P0_t SignedREAL_t; |
| 214 | |
| 215 | /*** <<< FUNC-DECLS [SignedREAL] >>> ***/ |
| 216 | |
| 217 | extern asn_TYPE_descriptor_t asn_DEF_SignedREAL; |
| 218 | asn_struct_free_f SignedREAL_free; |
| 219 | asn_struct_print_f SignedREAL_print; |
| 220 | asn_constr_check_f SignedREAL_constraint; |
| 221 | ber_type_decoder_f SignedREAL_decode_ber; |
| 222 | der_type_encoder_f SignedREAL_encode_der; |
| 223 | xer_type_decoder_f SignedREAL_decode_xer; |
| 224 | xer_type_encoder_f SignedREAL_encode_xer; |
| 225 | |
| 226 | /*** <<< CODE [SignedREAL] >>> ***/ |
| 227 | |
| 228 | int |
| 229 | SignedREAL_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 230 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 231 | /* Replace with underlying type checker */ |
| 232 | td->check_constraints = asn_DEF_SIGNED_16P0.check_constraints; |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 233 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 234 | } |
| 235 | |
| 236 | /* |
| 237 | * This type is implemented using SIGNED_16P0, |
| 238 | * so here we adjust the DEF accordingly. |
| 239 | */ |
| 240 | static void |
| 241 | SignedREAL_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 242 | td->free_struct = asn_DEF_SIGNED_16P0.free_struct; |
| 243 | td->print_struct = asn_DEF_SIGNED_16P0.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 244 | td->check_constraints = asn_DEF_SIGNED_16P0.check_constraints; |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 245 | td->ber_decoder = asn_DEF_SIGNED_16P0.ber_decoder; |
| 246 | td->der_encoder = asn_DEF_SIGNED_16P0.der_encoder; |
| 247 | td->xer_decoder = asn_DEF_SIGNED_16P0.xer_decoder; |
| 248 | td->xer_encoder = asn_DEF_SIGNED_16P0.xer_encoder; |
| 249 | td->uper_decoder = asn_DEF_SIGNED_16P0.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 250 | td->uper_encoder = asn_DEF_SIGNED_16P0.uper_encoder; |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 251 | if(!td->per_constraints) |
| 252 | td->per_constraints = asn_DEF_SIGNED_16P0.per_constraints; |
| 253 | td->elements = asn_DEF_SIGNED_16P0.elements; |
| 254 | td->elements_count = asn_DEF_SIGNED_16P0.elements_count; |
| 255 | td->specifics = asn_DEF_SIGNED_16P0.specifics; |
| 256 | } |
| 257 | |
| 258 | void |
| 259 | SignedREAL_free(asn_TYPE_descriptor_t *td, |
| 260 | void *struct_ptr, int contents_only) { |
| 261 | SignedREAL_1_inherit_TYPE_descriptor(td); |
| 262 | td->free_struct(td, struct_ptr, contents_only); |
| 263 | } |
| 264 | |
| 265 | int |
| 266 | SignedREAL_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 267 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 268 | SignedREAL_1_inherit_TYPE_descriptor(td); |
| 269 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 270 | } |
| 271 | |
| 272 | asn_dec_rval_t |
| 273 | SignedREAL_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 274 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 275 | SignedREAL_1_inherit_TYPE_descriptor(td); |
| 276 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 277 | } |
| 278 | |
| 279 | asn_enc_rval_t |
| 280 | SignedREAL_encode_der(asn_TYPE_descriptor_t *td, |
| 281 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 282 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 283 | SignedREAL_1_inherit_TYPE_descriptor(td); |
| 284 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 285 | } |
| 286 | |
| 287 | asn_dec_rval_t |
| 288 | SignedREAL_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 289 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 290 | SignedREAL_1_inherit_TYPE_descriptor(td); |
| 291 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 292 | } |
| 293 | |
| 294 | asn_enc_rval_t |
| 295 | SignedREAL_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 296 | int ilevel, enum xer_encoder_flags_e flags, |
| 297 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 298 | SignedREAL_1_inherit_TYPE_descriptor(td); |
| 299 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 300 | } |
| 301 | |
| 302 | |
| 303 | /*** <<< STAT-DEFS [SignedREAL] >>> ***/ |
| 304 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 305 | static const ber_tlv_tag_t asn_DEF_SignedREAL_tags_1[] = { |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 306 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 307 | }; |
| 308 | asn_TYPE_descriptor_t asn_DEF_SignedREAL = { |
| 309 | "SignedREAL", |
| 310 | "SignedREAL", |
| 311 | SignedREAL_free, |
| 312 | SignedREAL_print, |
| 313 | SignedREAL_constraint, |
| 314 | SignedREAL_decode_ber, |
| 315 | SignedREAL_encode_der, |
| 316 | SignedREAL_decode_xer, |
| 317 | SignedREAL_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 318 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 319 | 0, /* Use generic outmost tag fetcher */ |
| 320 | asn_DEF_SignedREAL_tags_1, |
| 321 | sizeof(asn_DEF_SignedREAL_tags_1) |
| 322 | /sizeof(asn_DEF_SignedREAL_tags_1[0]), /* 1 */ |
| 323 | asn_DEF_SignedREAL_tags_1, /* Same as above */ |
| 324 | sizeof(asn_DEF_SignedREAL_tags_1) |
| 325 | /sizeof(asn_DEF_SignedREAL_tags_1[0]), /* 1 */ |
| 326 | 0, /* No PER visible constraints */ |
| 327 | 0, 0, /* Defined elsewhere */ |
| 328 | 0 /* No specifics */ |
| 329 | }; |
| 330 | |
| 331 | |
| 332 | /*** <<< INCLUDES [SignedSET] >>> ***/ |
| 333 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 334 | #include "SIGNED.h" |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 335 | |
| 336 | /*** <<< TYPE-DECLS [SignedSET] >>> ***/ |
| 337 | |
| 338 | typedef SIGNED_16P1_t SignedSET_t; |
| 339 | |
| 340 | /*** <<< FUNC-DECLS [SignedSET] >>> ***/ |
| 341 | |
| 342 | extern asn_TYPE_descriptor_t asn_DEF_SignedSET; |
| 343 | asn_struct_free_f SignedSET_free; |
| 344 | asn_struct_print_f SignedSET_print; |
| 345 | asn_constr_check_f SignedSET_constraint; |
| 346 | ber_type_decoder_f SignedSET_decode_ber; |
| 347 | der_type_encoder_f SignedSET_encode_der; |
| 348 | xer_type_decoder_f SignedSET_decode_xer; |
| 349 | xer_type_encoder_f SignedSET_encode_xer; |
| 350 | |
| 351 | /*** <<< CODE [SignedSET] >>> ***/ |
| 352 | |
| 353 | int |
| 354 | SignedSET_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 355 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 356 | /* Replace with underlying type checker */ |
| 357 | td->check_constraints = asn_DEF_SIGNED_16P1.check_constraints; |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 358 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 359 | } |
| 360 | |
| 361 | /* |
| 362 | * This type is implemented using SIGNED_16P1, |
| 363 | * so here we adjust the DEF accordingly. |
| 364 | */ |
| 365 | static void |
| 366 | SignedSET_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 367 | td->free_struct = asn_DEF_SIGNED_16P1.free_struct; |
| 368 | td->print_struct = asn_DEF_SIGNED_16P1.print_struct; |
Lev Walkin | 6169b8d | 2013-12-07 11:02:44 -0800 | [diff] [blame] | 369 | td->check_constraints = asn_DEF_SIGNED_16P1.check_constraints; |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 370 | td->ber_decoder = asn_DEF_SIGNED_16P1.ber_decoder; |
| 371 | td->der_encoder = asn_DEF_SIGNED_16P1.der_encoder; |
| 372 | td->xer_decoder = asn_DEF_SIGNED_16P1.xer_decoder; |
| 373 | td->xer_encoder = asn_DEF_SIGNED_16P1.xer_encoder; |
| 374 | td->uper_decoder = asn_DEF_SIGNED_16P1.uper_decoder; |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 375 | td->uper_encoder = asn_DEF_SIGNED_16P1.uper_encoder; |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 376 | if(!td->per_constraints) |
| 377 | td->per_constraints = asn_DEF_SIGNED_16P1.per_constraints; |
| 378 | td->elements = asn_DEF_SIGNED_16P1.elements; |
| 379 | td->elements_count = asn_DEF_SIGNED_16P1.elements_count; |
| 380 | td->specifics = asn_DEF_SIGNED_16P1.specifics; |
| 381 | } |
| 382 | |
| 383 | void |
| 384 | SignedSET_free(asn_TYPE_descriptor_t *td, |
| 385 | void *struct_ptr, int contents_only) { |
| 386 | SignedSET_1_inherit_TYPE_descriptor(td); |
| 387 | td->free_struct(td, struct_ptr, contents_only); |
| 388 | } |
| 389 | |
| 390 | int |
| 391 | SignedSET_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 392 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 393 | SignedSET_1_inherit_TYPE_descriptor(td); |
| 394 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 395 | } |
| 396 | |
| 397 | asn_dec_rval_t |
| 398 | SignedSET_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 399 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 400 | SignedSET_1_inherit_TYPE_descriptor(td); |
| 401 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 402 | } |
| 403 | |
| 404 | asn_enc_rval_t |
| 405 | SignedSET_encode_der(asn_TYPE_descriptor_t *td, |
| 406 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 407 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 408 | SignedSET_1_inherit_TYPE_descriptor(td); |
| 409 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 410 | } |
| 411 | |
| 412 | asn_dec_rval_t |
| 413 | SignedSET_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 414 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 415 | SignedSET_1_inherit_TYPE_descriptor(td); |
| 416 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 417 | } |
| 418 | |
| 419 | asn_enc_rval_t |
| 420 | SignedSET_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 421 | int ilevel, enum xer_encoder_flags_e flags, |
| 422 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 423 | SignedSET_1_inherit_TYPE_descriptor(td); |
| 424 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 425 | } |
| 426 | |
| 427 | |
| 428 | /*** <<< STAT-DEFS [SignedSET] >>> ***/ |
| 429 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 430 | static const ber_tlv_tag_t asn_DEF_SignedSET_tags_1[] = { |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 431 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 432 | }; |
| 433 | asn_TYPE_descriptor_t asn_DEF_SignedSET = { |
| 434 | "SignedSET", |
| 435 | "SignedSET", |
| 436 | SignedSET_free, |
| 437 | SignedSET_print, |
| 438 | SignedSET_constraint, |
| 439 | SignedSET_decode_ber, |
| 440 | SignedSET_encode_der, |
| 441 | SignedSET_decode_xer, |
| 442 | SignedSET_encode_xer, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 443 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | a00d6b3 | 2006-03-21 03:40:38 +0000 | [diff] [blame] | 444 | 0, /* Use generic outmost tag fetcher */ |
| 445 | asn_DEF_SignedSET_tags_1, |
| 446 | sizeof(asn_DEF_SignedSET_tags_1) |
| 447 | /sizeof(asn_DEF_SignedSET_tags_1[0]), /* 1 */ |
| 448 | asn_DEF_SignedSET_tags_1, /* Same as above */ |
| 449 | sizeof(asn_DEF_SignedSET_tags_1) |
| 450 | /sizeof(asn_DEF_SignedSET_tags_1[0]), /* 1 */ |
| 451 | 0, /* No PER visible constraints */ |
| 452 | 0, 0, /* Defined elsewhere */ |
| 453 | 0 /* No specifics */ |
| 454 | }; |
| 455 | |