remark release date
[Net-Radio-Location-SUPL-Test.git] / asn1 / AltitudeInfo.c
blob88fce9a0f0395ff3f014be0328cf1aca0f231e40
1 /*
2 * Generated by asn1c-0.9.23 (http://lionet.info/asn1c)
3 * From ASN.1 module "ULP-Components"
4 * found in "../asn1src/ULP-Components.asn"
5 * `asn1c -gen-PER -fskeletons-copy -fnative-types`
6 */
8 #include "AltitudeInfo.h"
10 static int
11 altitudeDirection_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);
19 * This type is implemented using NativeEnumerated,
20 * so here we adjust the DEF accordingly.
22 static void
23 altitudeDirection_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->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
27 td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
28 td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
29 td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
30 td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
31 td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
32 if(!td->per_constraints)
33 td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
34 td->elements = asn_DEF_NativeEnumerated.elements;
35 td->elements_count = asn_DEF_NativeEnumerated.elements_count;
36 /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
39 static void
40 altitudeDirection_2_free(asn_TYPE_descriptor_t *td,
41 void *struct_ptr, int contents_only) {
42 altitudeDirection_2_inherit_TYPE_descriptor(td);
43 td->free_struct(td, struct_ptr, contents_only);
46 static int
47 altitudeDirection_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
48 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
49 altitudeDirection_2_inherit_TYPE_descriptor(td);
50 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
53 static asn_dec_rval_t
54 altitudeDirection_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
55 void **structure, const void *bufptr, size_t size, int tag_mode) {
56 altitudeDirection_2_inherit_TYPE_descriptor(td);
57 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
60 static asn_enc_rval_t
61 altitudeDirection_2_encode_der(asn_TYPE_descriptor_t *td,
62 void *structure, int tag_mode, ber_tlv_tag_t tag,
63 asn_app_consume_bytes_f *cb, void *app_key) {
64 altitudeDirection_2_inherit_TYPE_descriptor(td);
65 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
68 static asn_dec_rval_t
69 altitudeDirection_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
70 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
71 altitudeDirection_2_inherit_TYPE_descriptor(td);
72 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
75 static asn_enc_rval_t
76 altitudeDirection_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
77 int ilevel, enum xer_encoder_flags_e flags,
78 asn_app_consume_bytes_f *cb, void *app_key) {
79 altitudeDirection_2_inherit_TYPE_descriptor(td);
80 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
83 static asn_dec_rval_t
84 altitudeDirection_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
85 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
86 altitudeDirection_2_inherit_TYPE_descriptor(td);
87 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
90 static asn_enc_rval_t
91 altitudeDirection_2_encode_uper(asn_TYPE_descriptor_t *td,
92 asn_per_constraints_t *constraints,
93 void *structure, asn_per_outp_t *per_out) {
94 altitudeDirection_2_inherit_TYPE_descriptor(td);
95 return td->uper_encoder(td, constraints, structure, per_out);
98 static int
99 memb_altitude_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
100 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
101 long value;
103 if(!sptr) {
104 _ASN_CTFAIL(app_key, td, sptr,
105 "%s: value not given (%s:%d)",
106 td->name, __FILE__, __LINE__);
107 return -1;
110 value = *(const long *)sptr;
112 if((value >= 0 && value <= 32767)) {
113 /* Constraint check succeeded */
114 return 0;
115 } else {
116 _ASN_CTFAIL(app_key, td, sptr,
117 "%s: constraint failed (%s:%d)",
118 td->name, __FILE__, __LINE__);
119 return -1;
123 static int
124 memb_altUncertainty_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
125 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
126 long value;
128 if(!sptr) {
129 _ASN_CTFAIL(app_key, td, sptr,
130 "%s: value not given (%s:%d)",
131 td->name, __FILE__, __LINE__);
132 return -1;
135 value = *(const long *)sptr;
137 if((value >= 0 && value <= 127)) {
138 /* Constraint check succeeded */
139 return 0;
140 } else {
141 _ASN_CTFAIL(app_key, td, sptr,
142 "%s: constraint failed (%s:%d)",
143 td->name, __FILE__, __LINE__);
144 return -1;
148 static asn_per_constraints_t asn_PER_type_altitudeDirection_constr_2 = {
149 { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
150 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
151 0, 0 /* No PER value map */
153 static asn_per_constraints_t asn_PER_memb_altitude_constr_5 = {
154 { APC_CONSTRAINED, 15, 15, 0, 32767 } /* (0..32767) */,
155 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
156 0, 0 /* No PER value map */
158 static asn_per_constraints_t asn_PER_memb_altUncertainty_constr_6 = {
159 { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
160 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
161 0, 0 /* No PER value map */
163 static asn_INTEGER_enum_map_t asn_MAP_altitudeDirection_value2enum_2[] = {
164 { 0, 6, "height" },
165 { 1, 5, "depth" }
167 static unsigned int asn_MAP_altitudeDirection_enum2value_2[] = {
168 1, /* depth(1) */
169 0 /* height(0) */
171 static asn_INTEGER_specifics_t asn_SPC_altitudeDirection_specs_2 = {
172 asn_MAP_altitudeDirection_value2enum_2, /* "tag" => N; sorted by tag */
173 asn_MAP_altitudeDirection_enum2value_2, /* N => "tag"; sorted by N */
174 2, /* Number of elements in the maps */
175 0, /* Enumeration is not extensible */
176 1, /* Strict enumeration */
177 0, /* Native long size */
180 static ber_tlv_tag_t asn_DEF_altitudeDirection_tags_2[] = {
181 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
182 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
184 static /* Use -fall-defs-global to expose */
185 asn_TYPE_descriptor_t asn_DEF_altitudeDirection_2 = {
186 "altitudeDirection",
187 "altitudeDirection",
188 altitudeDirection_2_free,
189 altitudeDirection_2_print,
190 altitudeDirection_2_constraint,
191 altitudeDirection_2_decode_ber,
192 altitudeDirection_2_encode_der,
193 altitudeDirection_2_decode_xer,
194 altitudeDirection_2_encode_xer,
195 altitudeDirection_2_decode_uper,
196 altitudeDirection_2_encode_uper,
197 0, /* Use generic outmost tag fetcher */
198 asn_DEF_altitudeDirection_tags_2,
199 sizeof(asn_DEF_altitudeDirection_tags_2)
200 /sizeof(asn_DEF_altitudeDirection_tags_2[0]) - 1, /* 1 */
201 asn_DEF_altitudeDirection_tags_2, /* Same as above */
202 sizeof(asn_DEF_altitudeDirection_tags_2)
203 /sizeof(asn_DEF_altitudeDirection_tags_2[0]), /* 2 */
204 &asn_PER_type_altitudeDirection_constr_2,
205 0, 0, /* Defined elsewhere */
206 &asn_SPC_altitudeDirection_specs_2 /* Additional specs */
209 static asn_TYPE_member_t asn_MBR_AltitudeInfo_1[] = {
210 { ATF_NOFLAGS, 0, offsetof(struct AltitudeInfo, altitudeDirection),
211 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
212 -1, /* IMPLICIT tag at current level */
213 &asn_DEF_altitudeDirection_2,
214 0, /* Defer constraints checking to the member type */
215 0, /* No PER visible constraints */
217 "altitudeDirection"
219 { ATF_NOFLAGS, 0, offsetof(struct AltitudeInfo, altitude),
220 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
221 -1, /* IMPLICIT tag at current level */
222 &asn_DEF_NativeInteger,
223 memb_altitude_constraint_1,
224 &asn_PER_memb_altitude_constr_5,
226 "altitude"
228 { ATF_NOFLAGS, 0, offsetof(struct AltitudeInfo, altUncertainty),
229 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
230 -1, /* IMPLICIT tag at current level */
231 &asn_DEF_NativeInteger,
232 memb_altUncertainty_constraint_1,
233 &asn_PER_memb_altUncertainty_constr_6,
235 "altUncertainty"
238 static ber_tlv_tag_t asn_DEF_AltitudeInfo_tags_1[] = {
239 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
241 static asn_TYPE_tag2member_t asn_MAP_AltitudeInfo_tag2el_1[] = {
242 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* altitudeDirection at 84 */
243 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* altitude at 85 */
244 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* altUncertainty at 86 */
246 static asn_SEQUENCE_specifics_t asn_SPC_AltitudeInfo_specs_1 = {
247 sizeof(struct AltitudeInfo),
248 offsetof(struct AltitudeInfo, _asn_ctx),
249 asn_MAP_AltitudeInfo_tag2el_1,
250 3, /* Count of tags in the map */
251 0, 0, 0, /* Optional elements (not needed) */
252 2, /* Start extensions */
253 4 /* Stop extensions */
255 asn_TYPE_descriptor_t asn_DEF_AltitudeInfo = {
256 "AltitudeInfo",
257 "AltitudeInfo",
258 SEQUENCE_free,
259 SEQUENCE_print,
260 SEQUENCE_constraint,
261 SEQUENCE_decode_ber,
262 SEQUENCE_encode_der,
263 SEQUENCE_decode_xer,
264 SEQUENCE_encode_xer,
265 SEQUENCE_decode_uper,
266 SEQUENCE_encode_uper,
267 0, /* Use generic outmost tag fetcher */
268 asn_DEF_AltitudeInfo_tags_1,
269 sizeof(asn_DEF_AltitudeInfo_tags_1)
270 /sizeof(asn_DEF_AltitudeInfo_tags_1[0]), /* 1 */
271 asn_DEF_AltitudeInfo_tags_1, /* Same as above */
272 sizeof(asn_DEF_AltitudeInfo_tags_1)
273 /sizeof(asn_DEF_AltitudeInfo_tags_1[0]), /* 1 */
274 0, /* No PER visible constraints */
275 asn_MBR_AltitudeInfo_1,
276 3, /* Elements count */
277 &asn_SPC_AltitudeInfo_specs_1 /* Additional specs */