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" |
Harald Welte | ff4750f | 2015-08-31 09:55:28 +0200 | [diff] [blame] | 5 | * `asn1c -gen-PER` |
Harald Welte | d523a69 | 2015-08-30 23:11:19 +0200 | [diff] [blame] | 6 | */ |
| 7 | |
Neels Hofmeyr | b042937 | 2016-01-04 15:30:51 +0100 | [diff] [blame] | 8 | #include <osmocom/osmo-iuh/hnbap/GeographicalCoordinates.h> |
Harald Welte | d523a69 | 2015-08-30 23:11:19 +0200 | [diff] [blame] | 9 | |
| 10 | static int |
| 11 | latitudeSign_2_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 | latitudeSign_2_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 | static void |
| 43 | latitudeSign_2_free(asn_TYPE_descriptor_t *td, |
| 44 | void *struct_ptr, int contents_only) { |
| 45 | latitudeSign_2_inherit_TYPE_descriptor(td); |
| 46 | td->free_struct(td, struct_ptr, contents_only); |
| 47 | } |
| 48 | |
| 49 | static int |
| 50 | latitudeSign_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
| 51 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
| 52 | latitudeSign_2_inherit_TYPE_descriptor(td); |
| 53 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
| 54 | } |
| 55 | |
| 56 | static asn_dec_rval_t |
| 57 | latitudeSign_2_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 | latitudeSign_2_inherit_TYPE_descriptor(td); |
| 60 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
| 61 | } |
| 62 | |
| 63 | static asn_enc_rval_t |
| 64 | latitudeSign_2_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 | latitudeSign_2_inherit_TYPE_descriptor(td); |
| 68 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
| 69 | } |
| 70 | |
| 71 | static asn_dec_rval_t |
| 72 | latitudeSign_2_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 | latitudeSign_2_inherit_TYPE_descriptor(td); |
| 75 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
| 76 | } |
| 77 | |
| 78 | static asn_enc_rval_t |
| 79 | latitudeSign_2_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 | latitudeSign_2_inherit_TYPE_descriptor(td); |
| 83 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
| 84 | } |
| 85 | |
| 86 | static asn_dec_rval_t |
| 87 | latitudeSign_2_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 | latitudeSign_2_inherit_TYPE_descriptor(td); |
| 90 | return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 91 | } |
| 92 | |
| 93 | static asn_enc_rval_t |
| 94 | latitudeSign_2_encode_uper(asn_TYPE_descriptor_t *td, |
| 95 | asn_per_constraints_t *constraints, |
| 96 | void *structure, asn_per_outp_t *per_out) { |
| 97 | latitudeSign_2_inherit_TYPE_descriptor(td); |
| 98 | return td->uper_encoder(td, constraints, structure, per_out); |
| 99 | } |
| 100 | |
| 101 | static asn_enc_rval_t |
| 102 | latitudeSign_2_encode_aper(asn_TYPE_descriptor_t *td, |
| 103 | asn_per_constraints_t *constraints, |
| 104 | void *structure, asn_per_outp_t *per_out) { |
| 105 | latitudeSign_2_inherit_TYPE_descriptor(td); |
| 106 | return td->aper_encoder(td, constraints, structure, per_out); |
| 107 | } |
| 108 | |
| 109 | static asn_dec_rval_t |
| 110 | latitudeSign_2_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 | latitudeSign_2_inherit_TYPE_descriptor(td); |
| 113 | return td->aper_decoder(opt_codec_ctx, td, constraints, structure, per_data); |
| 114 | } |
| 115 | |
| 116 | static int |
| 117 | memb_latitude_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
| 118 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 119 | long value; |
| 120 | |
| 121 | if(!sptr) { |
| 122 | _ASN_CTFAIL(app_key, td, sptr, |
| 123 | "%s: value not given (%s:%d)", |
| 124 | td->name, __FILE__, __LINE__); |
| 125 | return -1; |
| 126 | } |
| 127 | |
| 128 | value = *(const long *)sptr; |
| 129 | |
| 130 | if((value >= 0l && value <= 8388607l)) { |
| 131 | /* Constraint check succeeded */ |
| 132 | return 0; |
| 133 | } else { |
| 134 | _ASN_CTFAIL(app_key, td, sptr, |
| 135 | "%s: constraint failed (%s:%d)", |
| 136 | td->name, __FILE__, __LINE__); |
| 137 | return -1; |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | static int |
| 142 | memb_longitude_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
| 143 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 144 | long value; |
| 145 | |
| 146 | if(!sptr) { |
| 147 | _ASN_CTFAIL(app_key, td, sptr, |
| 148 | "%s: value not given (%s:%d)", |
| 149 | td->name, __FILE__, __LINE__); |
| 150 | return -1; |
| 151 | } |
| 152 | |
| 153 | value = *(const long *)sptr; |
| 154 | |
| 155 | if((value >= -8388608ull && value <= 8388607l)) { |
| 156 | /* Constraint check succeeded */ |
| 157 | return 0; |
| 158 | } else { |
| 159 | _ASN_CTFAIL(app_key, td, sptr, |
| 160 | "%s: constraint failed (%s:%d)", |
| 161 | td->name, __FILE__, __LINE__); |
| 162 | return -1; |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | static asn_per_constraints_t asn_PER_type_latitudeSign_constr_2 GCC_NOTUSED = { |
| 167 | { APC_CONSTRAINED, 1, 1, 0l, 1l } /* (0..1) */, |
| 168 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 169 | 0, 0 /* No PER value map */ |
| 170 | }; |
| 171 | static asn_per_constraints_t asn_PER_memb_latitude_constr_5 GCC_NOTUSED = { |
| 172 | { APC_CONSTRAINED, 23, -1, 0l, 8388607l } /* (0..8388607) */, |
| 173 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 174 | 0, 0 /* No PER value map */ |
| 175 | }; |
| 176 | static asn_per_constraints_t asn_PER_memb_longitude_constr_6 GCC_NOTUSED = { |
| 177 | { APC_CONSTRAINED, 24, -1, -8388608ull, 8388607l } /* (-8388608..8388607) */, |
| 178 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 179 | 0, 0 /* No PER value map */ |
| 180 | }; |
| 181 | static const asn_INTEGER_enum_map_t asn_MAP_latitudeSign_value2enum_2[] = { |
| 182 | { 0, 5, "north" }, |
| 183 | { 1, 5, "south" } |
| 184 | }; |
| 185 | static const unsigned int asn_MAP_latitudeSign_enum2value_2[] = { |
| 186 | 0, /* north(0) */ |
| 187 | 1 /* south(1) */ |
| 188 | }; |
| 189 | static const asn_INTEGER_specifics_t asn_SPC_latitudeSign_specs_2 = { |
| 190 | asn_MAP_latitudeSign_value2enum_2, /* "tag" => N; sorted by tag */ |
| 191 | asn_MAP_latitudeSign_enum2value_2, /* N => "tag"; sorted by N */ |
| 192 | 2, /* Number of elements in the maps */ |
| 193 | 0, /* Enumeration is not extensible */ |
| 194 | 1, /* Strict enumeration */ |
| 195 | 0, /* Native long size */ |
| 196 | 0 |
| 197 | }; |
| 198 | static const ber_tlv_tag_t asn_DEF_latitudeSign_tags_2[] = { |
| 199 | (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 200 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) |
| 201 | }; |
| 202 | static /* Use -fall-defs-global to expose */ |
| 203 | asn_TYPE_descriptor_t asn_DEF_latitudeSign_2 = { |
| 204 | "latitudeSign", |
| 205 | "latitudeSign", |
| 206 | latitudeSign_2_free, |
| 207 | latitudeSign_2_print, |
| 208 | latitudeSign_2_constraint, |
| 209 | latitudeSign_2_decode_ber, |
| 210 | latitudeSign_2_encode_der, |
| 211 | latitudeSign_2_decode_xer, |
| 212 | latitudeSign_2_encode_xer, |
| 213 | latitudeSign_2_decode_uper, |
| 214 | latitudeSign_2_encode_uper, |
| 215 | latitudeSign_2_decode_aper, |
| 216 | latitudeSign_2_encode_aper, |
| 217 | 0, /* Use generic outmost tag fetcher */ |
| 218 | asn_DEF_latitudeSign_tags_2, |
| 219 | sizeof(asn_DEF_latitudeSign_tags_2) |
| 220 | /sizeof(asn_DEF_latitudeSign_tags_2[0]) - 1, /* 1 */ |
| 221 | asn_DEF_latitudeSign_tags_2, /* Same as above */ |
| 222 | sizeof(asn_DEF_latitudeSign_tags_2) |
| 223 | /sizeof(asn_DEF_latitudeSign_tags_2[0]), /* 2 */ |
| 224 | &asn_PER_type_latitudeSign_constr_2, |
| 225 | 0, 0, /* Defined elsewhere */ |
| 226 | &asn_SPC_latitudeSign_specs_2 /* Additional specs */ |
| 227 | }; |
| 228 | |
| 229 | static asn_TYPE_member_t asn_MBR_GeographicalCoordinates_1[] = { |
| 230 | { ATF_NOFLAGS, 0, offsetof(struct GeographicalCoordinates, latitudeSign), |
| 231 | (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 232 | -1, /* IMPLICIT tag at current level */ |
| 233 | &asn_DEF_latitudeSign_2, |
| 234 | 0, /* Defer constraints checking to the member type */ |
| 235 | 0, /* No PER visible constraints */ |
| 236 | 0, |
| 237 | "latitudeSign" |
| 238 | }, |
| 239 | { ATF_NOFLAGS, 0, offsetof(struct GeographicalCoordinates, latitude), |
| 240 | (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 241 | -1, /* IMPLICIT tag at current level */ |
| 242 | &asn_DEF_NativeInteger, |
| 243 | memb_latitude_constraint_1, |
| 244 | &asn_PER_memb_latitude_constr_5, |
| 245 | 0, |
| 246 | "latitude" |
| 247 | }, |
| 248 | { ATF_NOFLAGS, 0, offsetof(struct GeographicalCoordinates, longitude), |
| 249 | (ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
| 250 | -1, /* IMPLICIT tag at current level */ |
| 251 | &asn_DEF_NativeInteger, |
| 252 | memb_longitude_constraint_1, |
| 253 | &asn_PER_memb_longitude_constr_6, |
| 254 | 0, |
| 255 | "longitude" |
| 256 | }, |
| 257 | { ATF_POINTER, 1, offsetof(struct GeographicalCoordinates, iE_Extensions), |
| 258 | (ASN_TAG_CLASS_CONTEXT | (3 << 2)), |
| 259 | -1, /* IMPLICIT tag at current level */ |
| 260 | &asn_DEF_IE_Extensions, |
| 261 | 0, /* Defer constraints checking to the member type */ |
| 262 | 0, /* No PER visible constraints */ |
| 263 | 0, |
| 264 | "iE-Extensions" |
| 265 | }, |
| 266 | }; |
| 267 | static const int asn_MAP_GeographicalCoordinates_oms_1[] = { 3 }; |
| 268 | static const ber_tlv_tag_t asn_DEF_GeographicalCoordinates_tags_1[] = { |
| 269 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 270 | }; |
| 271 | static const asn_TYPE_tag2member_t asn_MAP_GeographicalCoordinates_tag2el_1[] = { |
| 272 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* latitudeSign */ |
| 273 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* latitude */ |
| 274 | { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* longitude */ |
| 275 | { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* iE-Extensions */ |
| 276 | }; |
| 277 | static asn_SEQUENCE_specifics_t asn_SPC_GeographicalCoordinates_specs_1 = { |
| 278 | sizeof(struct GeographicalCoordinates), |
| 279 | offsetof(struct GeographicalCoordinates, _asn_ctx), |
| 280 | asn_MAP_GeographicalCoordinates_tag2el_1, |
| 281 | 4, /* Count of tags in the map */ |
| 282 | asn_MAP_GeographicalCoordinates_oms_1, /* Optional members */ |
| 283 | 1, 0, /* Root/Additions */ |
| 284 | 3, /* Start extensions */ |
| 285 | 5 /* Stop extensions */ |
| 286 | }; |
| 287 | asn_TYPE_descriptor_t asn_DEF_GeographicalCoordinates = { |
| 288 | "GeographicalCoordinates", |
| 289 | "GeographicalCoordinates", |
| 290 | SEQUENCE_free, |
| 291 | SEQUENCE_print, |
| 292 | SEQUENCE_constraint, |
| 293 | SEQUENCE_decode_ber, |
| 294 | SEQUENCE_encode_der, |
| 295 | SEQUENCE_decode_xer, |
| 296 | SEQUENCE_encode_xer, |
| 297 | SEQUENCE_decode_uper, |
| 298 | SEQUENCE_encode_uper, |
| 299 | SEQUENCE_decode_aper, |
| 300 | SEQUENCE_encode_aper, |
| 301 | 0, /* Use generic outmost tag fetcher */ |
| 302 | asn_DEF_GeographicalCoordinates_tags_1, |
| 303 | sizeof(asn_DEF_GeographicalCoordinates_tags_1) |
| 304 | /sizeof(asn_DEF_GeographicalCoordinates_tags_1[0]), /* 1 */ |
| 305 | asn_DEF_GeographicalCoordinates_tags_1, /* Same as above */ |
| 306 | sizeof(asn_DEF_GeographicalCoordinates_tags_1) |
| 307 | /sizeof(asn_DEF_GeographicalCoordinates_tags_1[0]), /* 1 */ |
| 308 | 0, /* No PER visible constraints */ |
| 309 | asn_MBR_GeographicalCoordinates_1, |
| 310 | 4, /* Elements count */ |
| 311 | &asn_SPC_GeographicalCoordinates_specs_1 /* Additional specs */ |
| 312 | }; |
| 313 | |