Harald Welte | ee09189 | 2015-09-10 10:22:03 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) |
| 3 | * From ASN.1 module "RANAP-IEs" |
| 4 | * found in "../../asn1/ranap/RANAP-IEs.asn" |
| 5 | */ |
| 6 | |
Neels Hofmeyr | b042937 | 2016-01-04 15:30:51 +0100 | [diff] [blame^] | 7 | #include <osmocom/osmo-iuh/ranap/RANAP_DCH-ID.h> |
Harald Welte | ee09189 | 2015-09-10 10:22:03 +0200 | [diff] [blame] | 8 | |
| 9 | int |
| 10 | RANAP_DCH_ID_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
| 11 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 12 | long value; |
| 13 | |
| 14 | if(!sptr) { |
| 15 | _ASN_CTFAIL(app_key, td, sptr, |
| 16 | "%s: value not given (%s:%d)", |
| 17 | td->name, __FILE__, __LINE__); |
| 18 | return -1; |
| 19 | } |
| 20 | |
| 21 | value = *(const long *)sptr; |
| 22 | |
| 23 | if((value >= 0l && value <= 255l)) { |
| 24 | /* Constraint check succeeded */ |
| 25 | return 0; |
| 26 | } else { |
| 27 | _ASN_CTFAIL(app_key, td, sptr, |
| 28 | "%s: constraint failed (%s:%d)", |
| 29 | td->name, __FILE__, __LINE__); |
| 30 | return -1; |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | /* |
| 35 | * This type is implemented using NativeInteger, |
| 36 | * so here we adjust the DEF accordingly. |
| 37 | */ |
| 38 | static void |
| 39 | RANAP_DCH_ID_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 40 | td->free_struct = asn_DEF_NativeInteger.free_struct; |
| 41 | td->print_struct = asn_DEF_NativeInteger.print_struct; |
| 42 | td->check_constraints = asn_DEF_NativeInteger.check_constraints; |
| 43 | td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; |
| 44 | td->der_encoder = asn_DEF_NativeInteger.der_encoder; |
| 45 | td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; |
| 46 | td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; |
| 47 | td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; |
| 48 | td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; |
| 49 | td->aper_decoder = asn_DEF_NativeInteger.aper_decoder; |
| 50 | td->aper_encoder = asn_DEF_NativeInteger.aper_encoder; |
| 51 | if(!td->per_constraints) |
| 52 | td->per_constraints = asn_DEF_NativeInteger.per_constraints; |
| 53 | td->elements = asn_DEF_NativeInteger.elements; |
| 54 | td->elements_count = asn_DEF_NativeInteger.elements_count; |
| 55 | td->specifics = asn_DEF_NativeInteger.specifics; |
| 56 | } |
| 57 | |
| 58 | void |
| 59 | RANAP_DCH_ID_free(asn_TYPE_descriptor_t *td, |
| 60 | void *struct_ptr, int contents_only) { |
| 61 | RANAP_DCH_ID_1_inherit_TYPE_descriptor(td); |
| 62 | td->free_struct(td, struct_ptr, contents_only); |
| 63 | } |
| 64 | |
| 65 | int |
| 66 | RANAP_DCH_ID_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 67 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 68 | RANAP_DCH_ID_1_inherit_TYPE_descriptor(td); |
| 69 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 70 | } |
| 71 | |
| 72 | asn_dec_rval_t |
| 73 | RANAP_DCH_ID_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 74 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 75 | RANAP_DCH_ID_1_inherit_TYPE_descriptor(td); |
| 76 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 77 | } |
| 78 | |
| 79 | asn_enc_rval_t |
| 80 | RANAP_DCH_ID_encode_der(asn_TYPE_descriptor_t *td, |
| 81 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 82 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 83 | RANAP_DCH_ID_1_inherit_TYPE_descriptor(td); |
| 84 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 85 | } |
| 86 | |
| 87 | asn_dec_rval_t |
| 88 | RANAP_DCH_ID_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 89 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 90 | RANAP_DCH_ID_1_inherit_TYPE_descriptor(td); |
| 91 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 92 | } |
| 93 | |
| 94 | asn_enc_rval_t |
| 95 | RANAP_DCH_ID_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 96 | int ilevel, enum xer_encoder_flags_e flags, |
| 97 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 98 | RANAP_DCH_ID_1_inherit_TYPE_descriptor(td); |
| 99 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 100 | } |
| 101 | |
| 102 | asn_dec_rval_t |
| 103 | RANAP_DCH_ID_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 104 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 105 | RANAP_DCH_ID_1_inherit_TYPE_descriptor(td); |
| 106 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 107 | } |
| 108 | |
| 109 | asn_enc_rval_t |
| 110 | RANAP_DCH_ID_encode_uper(asn_TYPE_descriptor_t *td, |
| 111 | asn_per_constraints_t *constraints, |
| 112 | void *structure, asn_per_outp_t *per_out) { |
| 113 | RANAP_DCH_ID_1_inherit_TYPE_descriptor(td); |
| 114 | return td->uper_encoder(td, constraints, structure, per_out); |
| 115 | } |
| 116 | |
| 117 | asn_enc_rval_t |
| 118 | RANAP_DCH_ID_encode_aper(asn_TYPE_descriptor_t *td, |
| 119 | asn_per_constraints_t *constraints, |
| 120 | void *structure, asn_per_outp_t *per_out) { |
| 121 | RANAP_DCH_ID_1_inherit_TYPE_descriptor(td); |
| 122 | return td->aper_encoder(td, constraints, structure, per_out); |
| 123 | } |
| 124 | |
| 125 | asn_dec_rval_t |
| 126 | RANAP_DCH_ID_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 127 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 128 | RANAP_DCH_ID_1_inherit_TYPE_descriptor(td); |
| 129 | return td->aper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 130 | } |
| 131 | |
| 132 | static asn_per_constraints_t asn_PER_type_RANAP_DCH_ID_constr_1 GCC_NOTUSED = { |
| 133 | { APC_CONSTRAINED, 8, 8, 0l, 255l } /* (0..255) */, |
| 134 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 135 | 0, 0 /* No PER value map */ |
| 136 | }; |
| 137 | static const ber_tlv_tag_t asn_DEF_RANAP_DCH_ID_tags_1[] = { |
| 138 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 139 | }; |
| 140 | asn_TYPE_descriptor_t asn_DEF_RANAP_DCH_ID = { |
| 141 | "RANAP_DCH-ID", |
| 142 | "RANAP_DCH-ID", |
| 143 | RANAP_DCH_ID_free, |
| 144 | RANAP_DCH_ID_print, |
| 145 | RANAP_DCH_ID_constraint, |
| 146 | RANAP_DCH_ID_decode_ber, |
| 147 | RANAP_DCH_ID_encode_der, |
| 148 | RANAP_DCH_ID_decode_xer, |
| 149 | RANAP_DCH_ID_encode_xer, |
| 150 | RANAP_DCH_ID_decode_uper, |
| 151 | RANAP_DCH_ID_encode_uper, |
| 152 | RANAP_DCH_ID_decode_aper, |
| 153 | RANAP_DCH_ID_encode_aper, |
| 154 | 0, /* Use generic outmost tag fetcher */ |
| 155 | asn_DEF_RANAP_DCH_ID_tags_1, |
| 156 | sizeof(asn_DEF_RANAP_DCH_ID_tags_1) |
| 157 | /sizeof(asn_DEF_RANAP_DCH_ID_tags_1[0]), /* 1 */ |
| 158 | asn_DEF_RANAP_DCH_ID_tags_1, /* Same as above */ |
| 159 | sizeof(asn_DEF_RANAP_DCH_ID_tags_1) |
| 160 | /sizeof(asn_DEF_RANAP_DCH_ID_tags_1[0]), /* 1 */ |
| 161 | &asn_PER_type_RANAP_DCH_ID_constr_1, |
| 162 | 0, 0, /* No members */ |
| 163 | 0 /* No specifics */ |
| 164 | }; |
| 165 | |