Harald Welte | d523a69 | 2015-08-30 23:11:19 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) |
| 3 | * From ASN.1 module "HNBAP-IEs" |
| 4 | * found in "../../asn1/hnbap/HNBAP-IEs.asn" |
| 5 | * `asn1c -gen-PER -fnative-types` |
| 6 | */ |
| 7 | |
| 8 | #include "Registration-Cause.h" |
| 9 | |
| 10 | int |
| 11 | Registration_Cause_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
| 12 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 13 | /* Replace with underlying type checker */ |
| 14 | td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; |
| 15 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
| 16 | } |
| 17 | |
| 18 | /* |
| 19 | * This type is implemented using NativeEnumerated, |
| 20 | * so here we adjust the DEF accordingly. |
| 21 | */ |
| 22 | static void |
| 23 | Registration_Cause_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
| 24 | td->free_struct = asn_DEF_NativeEnumerated.free_struct; |
| 25 | td->print_struct = asn_DEF_NativeEnumerated.print_struct; |
| 26 | td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; |
| 27 | td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder; |
| 28 | td->der_encoder = asn_DEF_NativeEnumerated.der_encoder; |
| 29 | td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder; |
| 30 | td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder; |
| 31 | td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder; |
| 32 | td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder; |
| 33 | td->aper_decoder = asn_DEF_NativeEnumerated.aper_decoder; |
| 34 | td->aper_encoder = asn_DEF_NativeEnumerated.aper_encoder; |
| 35 | if(!td->per_constraints) |
| 36 | td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; |
| 37 | td->elements = asn_DEF_NativeEnumerated.elements; |
| 38 | td->elements_count = asn_DEF_NativeEnumerated.elements_count; |
| 39 | /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ |
| 40 | } |
| 41 | |
| 42 | void |
| 43 | Registration_Cause_free(asn_TYPE_descriptor_t *td, |
| 44 | void *struct_ptr, int contents_only) { |
| 45 | Registration_Cause_1_inherit_TYPE_descriptor(td); |
| 46 | td->free_struct(td, struct_ptr, contents_only); |
| 47 | } |
| 48 | |
| 49 | int |
| 50 | Registration_Cause_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 51 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 52 | Registration_Cause_1_inherit_TYPE_descriptor(td); |
| 53 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 54 | } |
| 55 | |
| 56 | asn_dec_rval_t |
| 57 | Registration_Cause_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 58 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
| 59 | Registration_Cause_1_inherit_TYPE_descriptor(td); |
| 60 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 61 | } |
| 62 | |
| 63 | asn_enc_rval_t |
| 64 | Registration_Cause_encode_der(asn_TYPE_descriptor_t *td, |
| 65 | void *structure, int tag_mode, ber_tlv_tag_t tag, |
| 66 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 67 | Registration_Cause_1_inherit_TYPE_descriptor(td); |
| 68 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 69 | } |
| 70 | |
| 71 | asn_dec_rval_t |
| 72 | Registration_Cause_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 73 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
| 74 | Registration_Cause_1_inherit_TYPE_descriptor(td); |
| 75 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 76 | } |
| 77 | |
| 78 | asn_enc_rval_t |
| 79 | Registration_Cause_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
| 80 | int ilevel, enum xer_encoder_flags_e flags, |
| 81 | asn_app_consume_bytes_f *cb, void *app_key) { |
| 82 | Registration_Cause_1_inherit_TYPE_descriptor(td); |
| 83 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 84 | } |
| 85 | |
| 86 | asn_dec_rval_t |
| 87 | Registration_Cause_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 88 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 89 | Registration_Cause_1_inherit_TYPE_descriptor(td); |
| 90 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 91 | } |
| 92 | |
| 93 | asn_enc_rval_t |
| 94 | Registration_Cause_encode_uper(asn_TYPE_descriptor_t *td, |
| 95 | asn_per_constraints_t *constraints, |
| 96 | void *structure, asn_per_outp_t *per_out) { |
| 97 | Registration_Cause_1_inherit_TYPE_descriptor(td); |
| 98 | return td->uper_encoder(td, constraints, structure, per_out); |
| 99 | } |
| 100 | |
| 101 | asn_enc_rval_t |
| 102 | Registration_Cause_encode_aper(asn_TYPE_descriptor_t *td, |
| 103 | asn_per_constraints_t *constraints, |
| 104 | void *structure, asn_per_outp_t *per_out) { |
| 105 | Registration_Cause_1_inherit_TYPE_descriptor(td); |
| 106 | return td->aper_encoder(td, constraints, structure, per_out); |
| 107 | } |
| 108 | |
| 109 | asn_dec_rval_t |
| 110 | Registration_Cause_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
| 111 | asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { |
| 112 | Registration_Cause_1_inherit_TYPE_descriptor(td); |
| 113 | return td->aper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 114 | } |
| 115 | |
| 116 | static asn_per_constraints_t asn_PER_type_Registration_Cause_constr_1 GCC_NOTUSED = { |
| 117 | { APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0l, 1l } /* (0..1,...) */, |
| 118 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 119 | 0, 0 /* No PER value map */ |
| 120 | }; |
| 121 | static const asn_INTEGER_enum_map_t asn_MAP_Registration_Cause_value2enum_1[] = { |
| 122 | { 0, 14, "emergency-call" }, |
| 123 | { 1, 6, "normal" }, |
| 124 | { 2, 13, "ue-relocation" } |
| 125 | /* This list is extensible */ |
| 126 | }; |
| 127 | static const unsigned int asn_MAP_Registration_Cause_enum2value_1[] = { |
| 128 | 0, /* emergency-call(0) */ |
| 129 | 1, /* normal(1) */ |
| 130 | 2 /* ue-relocation(2) */ |
| 131 | /* This list is extensible */ |
| 132 | }; |
| 133 | static const asn_INTEGER_specifics_t asn_SPC_Registration_Cause_specs_1 = { |
| 134 | asn_MAP_Registration_Cause_value2enum_1, /* "tag" => N; sorted by tag */ |
| 135 | asn_MAP_Registration_Cause_enum2value_1, /* N => "tag"; sorted by N */ |
| 136 | 3, /* Number of elements in the maps */ |
| 137 | 3, /* Extensions before this member */ |
| 138 | 1, /* Strict enumeration */ |
| 139 | 0, /* Native long size */ |
| 140 | 0 |
| 141 | }; |
| 142 | static const ber_tlv_tag_t asn_DEF_Registration_Cause_tags_1[] = { |
| 143 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) |
| 144 | }; |
| 145 | asn_TYPE_descriptor_t asn_DEF_Registration_Cause = { |
| 146 | "Registration-Cause", |
| 147 | "Registration-Cause", |
| 148 | Registration_Cause_free, |
| 149 | Registration_Cause_print, |
| 150 | Registration_Cause_constraint, |
| 151 | Registration_Cause_decode_ber, |
| 152 | Registration_Cause_encode_der, |
| 153 | Registration_Cause_decode_xer, |
| 154 | Registration_Cause_encode_xer, |
| 155 | Registration_Cause_decode_uper, |
| 156 | Registration_Cause_encode_uper, |
| 157 | Registration_Cause_decode_aper, |
| 158 | Registration_Cause_encode_aper, |
| 159 | 0, /* Use generic outmost tag fetcher */ |
| 160 | asn_DEF_Registration_Cause_tags_1, |
| 161 | sizeof(asn_DEF_Registration_Cause_tags_1) |
| 162 | /sizeof(asn_DEF_Registration_Cause_tags_1[0]), /* 1 */ |
| 163 | asn_DEF_Registration_Cause_tags_1, /* Same as above */ |
| 164 | sizeof(asn_DEF_Registration_Cause_tags_1) |
| 165 | /sizeof(asn_DEF_Registration_Cause_tags_1[0]), /* 1 */ |
| 166 | &asn_PER_type_Registration_Cause_constr_1, |
| 167 | 0, 0, /* Defined elsewhere */ |
| 168 | &asn_SPC_Registration_Cause_specs_1 /* Additional specs */ |
| 169 | }; |
| 170 | |