remark release date
[Net-Radio-Location-SUPL-Test.git] / asn1 / CommonGANSSAssistance.c
blob2589c3ae37b5a19bc5e5c7bc20f9533101fd85f8
1 /*
2 * Generated by asn1c-0.9.23 (http://lionet.info/asn1c)
3 * From ASN.1 module "RRLP-Components"
4 * found in "../asn1src/RRLP-Components.asn"
5 * `asn1c -gen-PER -fskeletons-copy -fnative-types`
6 */
8 #include "CommonGANSSAssistance.h"
10 int
11 CommonGANSSAssistance_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
12 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13 const BIT_STRING_t *st = (const BIT_STRING_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 if(st->size > 0) {
24 /* Size in bits */
25 size = 8 * st->size - (st->bits_unused & 0x07);
26 } else {
27 size = 0;
30 if((size >= 1 && size <= 8)) {
31 /* Constraint check succeeded */
32 return 0;
33 } else {
34 _ASN_CTFAIL(app_key, td, sptr,
35 "%s: constraint failed (%s:%d)",
36 td->name, __FILE__, __LINE__);
37 return -1;
42 * This type is implemented using BIT_STRING,
43 * so here we adjust the DEF accordingly.
45 static void
46 CommonGANSSAssistance_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
47 td->free_struct = asn_DEF_BIT_STRING.free_struct;
48 td->print_struct = asn_DEF_BIT_STRING.print_struct;
49 td->ber_decoder = asn_DEF_BIT_STRING.ber_decoder;
50 td->der_encoder = asn_DEF_BIT_STRING.der_encoder;
51 td->xer_decoder = asn_DEF_BIT_STRING.xer_decoder;
52 td->xer_encoder = asn_DEF_BIT_STRING.xer_encoder;
53 td->uper_decoder = asn_DEF_BIT_STRING.uper_decoder;
54 td->uper_encoder = asn_DEF_BIT_STRING.uper_encoder;
55 if(!td->per_constraints)
56 td->per_constraints = asn_DEF_BIT_STRING.per_constraints;
57 td->elements = asn_DEF_BIT_STRING.elements;
58 td->elements_count = asn_DEF_BIT_STRING.elements_count;
59 td->specifics = asn_DEF_BIT_STRING.specifics;
62 void
63 CommonGANSSAssistance_free(asn_TYPE_descriptor_t *td,
64 void *struct_ptr, int contents_only) {
65 CommonGANSSAssistance_1_inherit_TYPE_descriptor(td);
66 td->free_struct(td, struct_ptr, contents_only);
69 int
70 CommonGANSSAssistance_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
71 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
72 CommonGANSSAssistance_1_inherit_TYPE_descriptor(td);
73 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
76 asn_dec_rval_t
77 CommonGANSSAssistance_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
78 void **structure, const void *bufptr, size_t size, int tag_mode) {
79 CommonGANSSAssistance_1_inherit_TYPE_descriptor(td);
80 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
83 asn_enc_rval_t
84 CommonGANSSAssistance_encode_der(asn_TYPE_descriptor_t *td,
85 void *structure, int tag_mode, ber_tlv_tag_t tag,
86 asn_app_consume_bytes_f *cb, void *app_key) {
87 CommonGANSSAssistance_1_inherit_TYPE_descriptor(td);
88 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
91 asn_dec_rval_t
92 CommonGANSSAssistance_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
93 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
94 CommonGANSSAssistance_1_inherit_TYPE_descriptor(td);
95 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
98 asn_enc_rval_t
99 CommonGANSSAssistance_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
100 int ilevel, enum xer_encoder_flags_e flags,
101 asn_app_consume_bytes_f *cb, void *app_key) {
102 CommonGANSSAssistance_1_inherit_TYPE_descriptor(td);
103 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
106 asn_dec_rval_t
107 CommonGANSSAssistance_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
108 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
109 CommonGANSSAssistance_1_inherit_TYPE_descriptor(td);
110 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
113 asn_enc_rval_t
114 CommonGANSSAssistance_encode_uper(asn_TYPE_descriptor_t *td,
115 asn_per_constraints_t *constraints,
116 void *structure, asn_per_outp_t *per_out) {
117 CommonGANSSAssistance_1_inherit_TYPE_descriptor(td);
118 return td->uper_encoder(td, constraints, structure, per_out);
121 static asn_per_constraints_t asn_PER_type_CommonGANSSAssistance_constr_1 = {
122 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
123 { APC_CONSTRAINED, 3, 3, 1, 8 } /* (SIZE(1..8)) */,
124 0, 0 /* No PER value map */
126 static ber_tlv_tag_t asn_DEF_CommonGANSSAssistance_tags_1[] = {
127 (ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
129 asn_TYPE_descriptor_t asn_DEF_CommonGANSSAssistance = {
130 "CommonGANSSAssistance",
131 "CommonGANSSAssistance",
132 CommonGANSSAssistance_free,
133 CommonGANSSAssistance_print,
134 CommonGANSSAssistance_constraint,
135 CommonGANSSAssistance_decode_ber,
136 CommonGANSSAssistance_encode_der,
137 CommonGANSSAssistance_decode_xer,
138 CommonGANSSAssistance_encode_xer,
139 CommonGANSSAssistance_decode_uper,
140 CommonGANSSAssistance_encode_uper,
141 0, /* Use generic outmost tag fetcher */
142 asn_DEF_CommonGANSSAssistance_tags_1,
143 sizeof(asn_DEF_CommonGANSSAssistance_tags_1)
144 /sizeof(asn_DEF_CommonGANSSAssistance_tags_1[0]), /* 1 */
145 asn_DEF_CommonGANSSAssistance_tags_1, /* Same as above */
146 sizeof(asn_DEF_CommonGANSSAssistance_tags_1)
147 /sizeof(asn_DEF_CommonGANSSAssistance_tags_1[0]), /* 1 */
148 &asn_PER_type_CommonGANSSAssistance_constr_1,
149 0, 0, /* Defined elsewhere */
150 0 /* No specifics */