remark release date
[Net-Radio-Location-SUPL-Test.git] / asn1 / HLR-Id.c
blobee0624224803ce1947ac6389298e6d13fd4a1698
1 /*
2 * Generated by asn1c-0.9.23 (http://lionet.info/asn1c)
3 * From ASN.1 module "MAP-CommonDataTypes"
4 * found in "../asn1src/MAP-CommonDataTypes.asn"
5 * `asn1c -gen-PER -fskeletons-copy -fnative-types`
6 */
8 #include "HLR-Id.h"
10 int
11 HLR_Id_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
12 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13 const IMSI_t *st = (const IMSI_t *)sptr;
14 size_t size;
16 if(!sptr) {
17 _ASN_CTFAIL(app_key, td, sptr,
18 "%s: value not given (%s:%d)",
19 td->name, __FILE__, __LINE__);
20 return -1;
23 size = st->size;
25 if((size >= 3 && size <= 8)) {
26 /* Constraint check succeeded */
27 return 0;
28 } else {
29 _ASN_CTFAIL(app_key, td, sptr,
30 "%s: constraint failed (%s:%d)",
31 td->name, __FILE__, __LINE__);
32 return -1;
37 * This type is implemented using IMSI,
38 * so here we adjust the DEF accordingly.
40 static void
41 HLR_Id_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
42 td->free_struct = asn_DEF_IMSI.free_struct;
43 td->print_struct = asn_DEF_IMSI.print_struct;
44 td->ber_decoder = asn_DEF_IMSI.ber_decoder;
45 td->der_encoder = asn_DEF_IMSI.der_encoder;
46 td->xer_decoder = asn_DEF_IMSI.xer_decoder;
47 td->xer_encoder = asn_DEF_IMSI.xer_encoder;
48 td->uper_decoder = asn_DEF_IMSI.uper_decoder;
49 td->uper_encoder = asn_DEF_IMSI.uper_encoder;
50 if(!td->per_constraints)
51 td->per_constraints = asn_DEF_IMSI.per_constraints;
52 td->elements = asn_DEF_IMSI.elements;
53 td->elements_count = asn_DEF_IMSI.elements_count;
54 td->specifics = asn_DEF_IMSI.specifics;
57 void
58 HLR_Id_free(asn_TYPE_descriptor_t *td,
59 void *struct_ptr, int contents_only) {
60 HLR_Id_1_inherit_TYPE_descriptor(td);
61 td->free_struct(td, struct_ptr, contents_only);
64 int
65 HLR_Id_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
66 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
67 HLR_Id_1_inherit_TYPE_descriptor(td);
68 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
71 asn_dec_rval_t
72 HLR_Id_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
73 void **structure, const void *bufptr, size_t size, int tag_mode) {
74 HLR_Id_1_inherit_TYPE_descriptor(td);
75 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
78 asn_enc_rval_t
79 HLR_Id_encode_der(asn_TYPE_descriptor_t *td,
80 void *structure, int tag_mode, ber_tlv_tag_t tag,
81 asn_app_consume_bytes_f *cb, void *app_key) {
82 HLR_Id_1_inherit_TYPE_descriptor(td);
83 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
86 asn_dec_rval_t
87 HLR_Id_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
88 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
89 HLR_Id_1_inherit_TYPE_descriptor(td);
90 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
93 asn_enc_rval_t
94 HLR_Id_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
95 int ilevel, enum xer_encoder_flags_e flags,
96 asn_app_consume_bytes_f *cb, void *app_key) {
97 HLR_Id_1_inherit_TYPE_descriptor(td);
98 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
101 asn_dec_rval_t
102 HLR_Id_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
103 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
104 HLR_Id_1_inherit_TYPE_descriptor(td);
105 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
108 asn_enc_rval_t
109 HLR_Id_encode_uper(asn_TYPE_descriptor_t *td,
110 asn_per_constraints_t *constraints,
111 void *structure, asn_per_outp_t *per_out) {
112 HLR_Id_1_inherit_TYPE_descriptor(td);
113 return td->uper_encoder(td, constraints, structure, per_out);
116 static ber_tlv_tag_t asn_DEF_HLR_Id_tags_1[] = {
117 (ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
119 asn_TYPE_descriptor_t asn_DEF_HLR_Id = {
120 "HLR-Id",
121 "HLR-Id",
122 HLR_Id_free,
123 HLR_Id_print,
124 HLR_Id_constraint,
125 HLR_Id_decode_ber,
126 HLR_Id_encode_der,
127 HLR_Id_decode_xer,
128 HLR_Id_encode_xer,
129 HLR_Id_decode_uper,
130 HLR_Id_encode_uper,
131 0, /* Use generic outmost tag fetcher */
132 asn_DEF_HLR_Id_tags_1,
133 sizeof(asn_DEF_HLR_Id_tags_1)
134 /sizeof(asn_DEF_HLR_Id_tags_1[0]), /* 1 */
135 asn_DEF_HLR_Id_tags_1, /* Same as above */
136 sizeof(asn_DEF_HLR_Id_tags_1)
137 /sizeof(asn_DEF_HLR_Id_tags_1[0]), /* 1 */
138 0, /* No PER visible constraints */
139 0, 0, /* No members */
140 0 /* No specifics */