blob: 08f92d4d6cd8f959ee0d9544647bd344b47168fd [file] [log] [blame]
Lev Walkin082cadc2005-08-14 02:18:27 +00001
2/*** <<< INCLUDES [CN-IntegerUnlimited] >>> ***/
3
4#include <INTEGER.h>
5
6/*** <<< TYPE-DECLS [CN-IntegerUnlimited] >>> ***/
7
8typedef INTEGER_t CN_IntegerUnlimited_t;
9
10/*** <<< FUNC-DECLS [CN-IntegerUnlimited] >>> ***/
11
12extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited;
13asn_struct_free_f CN_IntegerUnlimited_free;
14asn_struct_print_f CN_IntegerUnlimited_print;
15asn_constr_check_f CN_IntegerUnlimited_constraint;
16ber_type_decoder_f CN_IntegerUnlimited_decode_ber;
17der_type_encoder_f CN_IntegerUnlimited_encode_der;
18xer_type_decoder_f CN_IntegerUnlimited_decode_xer;
19xer_type_encoder_f CN_IntegerUnlimited_encode_xer;
20
21/*** <<< CODE [CN-IntegerUnlimited] >>> ***/
22
23int
24CN_IntegerUnlimited_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +000025 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin082cadc2005-08-14 02:18:27 +000026 /* Replace with underlying type checker */
27 td->check_constraints = asn_DEF_INTEGER.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +000028 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin082cadc2005-08-14 02:18:27 +000029}
30
31/*
32 * This type is implemented using INTEGER,
33 * so here we adjust the DEF accordingly.
34 */
35static void
36CN_IntegerUnlimited_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
37 td->free_struct = asn_DEF_INTEGER.free_struct;
38 td->print_struct = asn_DEF_INTEGER.print_struct;
39 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
40 td->der_encoder = asn_DEF_INTEGER.der_encoder;
41 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
42 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +000043 td->uper_decoder = asn_DEF_INTEGER.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +000044 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +000045 if(!td->per_constraints)
46 td->per_constraints = asn_DEF_INTEGER.per_constraints;
Lev Walkin082cadc2005-08-14 02:18:27 +000047 td->elements = asn_DEF_INTEGER.elements;
48 td->elements_count = asn_DEF_INTEGER.elements_count;
49 td->specifics = asn_DEF_INTEGER.specifics;
50}
51
52void
53CN_IntegerUnlimited_free(asn_TYPE_descriptor_t *td,
54 void *struct_ptr, int contents_only) {
55 CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td);
56 td->free_struct(td, struct_ptr, contents_only);
57}
58
59int
60CN_IntegerUnlimited_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
61 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
62 CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td);
63 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
64}
65
66asn_dec_rval_t
67CN_IntegerUnlimited_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
68 void **structure, const void *bufptr, size_t size, int tag_mode) {
69 CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td);
70 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
71}
72
73asn_enc_rval_t
74CN_IntegerUnlimited_encode_der(asn_TYPE_descriptor_t *td,
75 void *structure, int tag_mode, ber_tlv_tag_t tag,
76 asn_app_consume_bytes_f *cb, void *app_key) {
77 CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td);
78 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
79}
80
81asn_dec_rval_t
82CN_IntegerUnlimited_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
83 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
84 CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td);
85 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
86}
87
88asn_enc_rval_t
89CN_IntegerUnlimited_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
90 int ilevel, enum xer_encoder_flags_e flags,
91 asn_app_consume_bytes_f *cb, void *app_key) {
92 CN_IntegerUnlimited_1_inherit_TYPE_descriptor(td);
93 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
94}
95
96
97/*** <<< STAT-DEFS [CN-IntegerUnlimited] >>> ***/
98
Lev Walkin59b176e2005-11-26 11:25:14 +000099static ber_tlv_tag_t asn_DEF_CN_IntegerUnlimited_tags_1[] = {
Lev Walkin082cadc2005-08-14 02:18:27 +0000100 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
101};
102asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited = {
103 "CN-IntegerUnlimited",
104 "CN-IntegerUnlimited",
105 CN_IntegerUnlimited_free,
106 CN_IntegerUnlimited_print,
107 CN_IntegerUnlimited_constraint,
108 CN_IntegerUnlimited_decode_ber,
109 CN_IntegerUnlimited_encode_der,
110 CN_IntegerUnlimited_decode_xer,
111 CN_IntegerUnlimited_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000112 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin082cadc2005-08-14 02:18:27 +0000113 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000114 asn_DEF_CN_IntegerUnlimited_tags_1,
115 sizeof(asn_DEF_CN_IntegerUnlimited_tags_1)
116 /sizeof(asn_DEF_CN_IntegerUnlimited_tags_1[0]), /* 1 */
117 asn_DEF_CN_IntegerUnlimited_tags_1, /* Same as above */
118 sizeof(asn_DEF_CN_IntegerUnlimited_tags_1)
119 /sizeof(asn_DEF_CN_IntegerUnlimited_tags_1[0]), /* 1 */
120 0, /* No PER visible constraints */
Lev Walkin082cadc2005-08-14 02:18:27 +0000121 0, 0, /* No members */
122 0 /* No specifics */
123};
124
125
126/*** <<< INCLUDES [CN-IntegerMinMax] >>> ***/
127
128#include <INTEGER.h>
129
130/*** <<< TYPE-DECLS [CN-IntegerMinMax] >>> ***/
131
132typedef INTEGER_t CN_IntegerMinMax_t;
133
134/*** <<< FUNC-DECLS [CN-IntegerMinMax] >>> ***/
135
136extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax;
137asn_struct_free_f CN_IntegerMinMax_free;
138asn_struct_print_f CN_IntegerMinMax_print;
139asn_constr_check_f CN_IntegerMinMax_constraint;
140ber_type_decoder_f CN_IntegerMinMax_decode_ber;
141der_type_encoder_f CN_IntegerMinMax_encode_der;
142xer_type_decoder_f CN_IntegerMinMax_decode_xer;
143xer_type_encoder_f CN_IntegerMinMax_encode_xer;
144
145/*** <<< CODE [CN-IntegerMinMax] >>> ***/
146
147int
148CN_IntegerMinMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000149 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin082cadc2005-08-14 02:18:27 +0000150 const INTEGER_t *st = (const INTEGER_t *)sptr;
151
152 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000153 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +0000154 "%s: value not given (%s:%d)",
155 td->name, __FILE__, __LINE__);
156 return -1;
157 }
158
159
160 if(1 /* No applicable constraints whatsoever */) {
161 /* Nothing is here. See below */
162 }
163
164 /* Replace with underlying type checker */
165 td->check_constraints = asn_DEF_INTEGER.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +0000166 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin082cadc2005-08-14 02:18:27 +0000167}
168
169/*
170 * This type is implemented using INTEGER,
171 * so here we adjust the DEF accordingly.
172 */
173static void
174CN_IntegerMinMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
175 td->free_struct = asn_DEF_INTEGER.free_struct;
176 td->print_struct = asn_DEF_INTEGER.print_struct;
177 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
178 td->der_encoder = asn_DEF_INTEGER.der_encoder;
179 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
180 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000181 td->uper_decoder = asn_DEF_INTEGER.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000182 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000183 if(!td->per_constraints)
184 td->per_constraints = asn_DEF_INTEGER.per_constraints;
Lev Walkin082cadc2005-08-14 02:18:27 +0000185 td->elements = asn_DEF_INTEGER.elements;
186 td->elements_count = asn_DEF_INTEGER.elements_count;
187 td->specifics = asn_DEF_INTEGER.specifics;
188}
189
190void
191CN_IntegerMinMax_free(asn_TYPE_descriptor_t *td,
192 void *struct_ptr, int contents_only) {
193 CN_IntegerMinMax_1_inherit_TYPE_descriptor(td);
194 td->free_struct(td, struct_ptr, contents_only);
195}
196
197int
198CN_IntegerMinMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
199 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
200 CN_IntegerMinMax_1_inherit_TYPE_descriptor(td);
201 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
202}
203
204asn_dec_rval_t
205CN_IntegerMinMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
206 void **structure, const void *bufptr, size_t size, int tag_mode) {
207 CN_IntegerMinMax_1_inherit_TYPE_descriptor(td);
208 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
209}
210
211asn_enc_rval_t
212CN_IntegerMinMax_encode_der(asn_TYPE_descriptor_t *td,
213 void *structure, int tag_mode, ber_tlv_tag_t tag,
214 asn_app_consume_bytes_f *cb, void *app_key) {
215 CN_IntegerMinMax_1_inherit_TYPE_descriptor(td);
216 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
217}
218
219asn_dec_rval_t
220CN_IntegerMinMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
221 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
222 CN_IntegerMinMax_1_inherit_TYPE_descriptor(td);
223 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
224}
225
226asn_enc_rval_t
227CN_IntegerMinMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
228 int ilevel, enum xer_encoder_flags_e flags,
229 asn_app_consume_bytes_f *cb, void *app_key) {
230 CN_IntegerMinMax_1_inherit_TYPE_descriptor(td);
231 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
232}
233
234
235/*** <<< STAT-DEFS [CN-IntegerMinMax] >>> ***/
236
Lev Walkin59b176e2005-11-26 11:25:14 +0000237static ber_tlv_tag_t asn_DEF_CN_IntegerMinMax_tags_1[] = {
Lev Walkin082cadc2005-08-14 02:18:27 +0000238 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
239};
240asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax = {
241 "CN-IntegerMinMax",
242 "CN-IntegerMinMax",
243 CN_IntegerMinMax_free,
244 CN_IntegerMinMax_print,
245 CN_IntegerMinMax_constraint,
246 CN_IntegerMinMax_decode_ber,
247 CN_IntegerMinMax_encode_der,
248 CN_IntegerMinMax_decode_xer,
249 CN_IntegerMinMax_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000250 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin082cadc2005-08-14 02:18:27 +0000251 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000252 asn_DEF_CN_IntegerMinMax_tags_1,
253 sizeof(asn_DEF_CN_IntegerMinMax_tags_1)
254 /sizeof(asn_DEF_CN_IntegerMinMax_tags_1[0]), /* 1 */
255 asn_DEF_CN_IntegerMinMax_tags_1, /* Same as above */
256 sizeof(asn_DEF_CN_IntegerMinMax_tags_1)
257 /sizeof(asn_DEF_CN_IntegerMinMax_tags_1[0]), /* 1 */
258 0, /* No PER visible constraints */
Lev Walkin082cadc2005-08-14 02:18:27 +0000259 0, 0, /* No members */
260 0 /* No specifics */
261};
262
263
264/*** <<< INCLUDES [CN-IntegerMinLow] >>> ***/
265
266#include <INTEGER.h>
267
268/*** <<< TYPE-DECLS [CN-IntegerMinLow] >>> ***/
269
270typedef INTEGER_t CN_IntegerMinLow_t;
271
272/*** <<< FUNC-DECLS [CN-IntegerMinLow] >>> ***/
273
274extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinLow;
275asn_struct_free_f CN_IntegerMinLow_free;
276asn_struct_print_f CN_IntegerMinLow_print;
277asn_constr_check_f CN_IntegerMinLow_constraint;
278ber_type_decoder_f CN_IntegerMinLow_decode_ber;
279der_type_encoder_f CN_IntegerMinLow_encode_der;
280xer_type_decoder_f CN_IntegerMinLow_decode_xer;
281xer_type_encoder_f CN_IntegerMinLow_encode_xer;
282
283/*** <<< CODE [CN-IntegerMinLow] >>> ***/
284
285int
286CN_IntegerMinLow_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000287 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin082cadc2005-08-14 02:18:27 +0000288 const INTEGER_t *st = (const INTEGER_t *)sptr;
289 long value;
290
291 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000292 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +0000293 "%s: value not given (%s:%d)",
294 td->name, __FILE__, __LINE__);
295 return -1;
296 }
297
298 if(asn_INTEGER2long(st, &value)) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000299 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +0000300 "%s: value too large (%s:%d)",
301 td->name, __FILE__, __LINE__);
302 return -1;
303 }
304
305 if((value <= 1)) {
306 /* Constraint check succeeded */
307 return 0;
308 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000309 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +0000310 "%s: constraint failed (%s:%d)",
311 td->name, __FILE__, __LINE__);
312 return -1;
313 }
314}
315
316/*
317 * This type is implemented using INTEGER,
318 * so here we adjust the DEF accordingly.
319 */
320static void
321CN_IntegerMinLow_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
322 td->free_struct = asn_DEF_INTEGER.free_struct;
323 td->print_struct = asn_DEF_INTEGER.print_struct;
324 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
325 td->der_encoder = asn_DEF_INTEGER.der_encoder;
326 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
327 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000328 td->uper_decoder = asn_DEF_INTEGER.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000329 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000330 if(!td->per_constraints)
331 td->per_constraints = asn_DEF_INTEGER.per_constraints;
Lev Walkin082cadc2005-08-14 02:18:27 +0000332 td->elements = asn_DEF_INTEGER.elements;
333 td->elements_count = asn_DEF_INTEGER.elements_count;
334 td->specifics = asn_DEF_INTEGER.specifics;
335}
336
337void
338CN_IntegerMinLow_free(asn_TYPE_descriptor_t *td,
339 void *struct_ptr, int contents_only) {
340 CN_IntegerMinLow_1_inherit_TYPE_descriptor(td);
341 td->free_struct(td, struct_ptr, contents_only);
342}
343
344int
345CN_IntegerMinLow_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
346 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
347 CN_IntegerMinLow_1_inherit_TYPE_descriptor(td);
348 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
349}
350
351asn_dec_rval_t
352CN_IntegerMinLow_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
353 void **structure, const void *bufptr, size_t size, int tag_mode) {
354 CN_IntegerMinLow_1_inherit_TYPE_descriptor(td);
355 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
356}
357
358asn_enc_rval_t
359CN_IntegerMinLow_encode_der(asn_TYPE_descriptor_t *td,
360 void *structure, int tag_mode, ber_tlv_tag_t tag,
361 asn_app_consume_bytes_f *cb, void *app_key) {
362 CN_IntegerMinLow_1_inherit_TYPE_descriptor(td);
363 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
364}
365
366asn_dec_rval_t
367CN_IntegerMinLow_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
368 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
369 CN_IntegerMinLow_1_inherit_TYPE_descriptor(td);
370 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
371}
372
373asn_enc_rval_t
374CN_IntegerMinLow_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
375 int ilevel, enum xer_encoder_flags_e flags,
376 asn_app_consume_bytes_f *cb, void *app_key) {
377 CN_IntegerMinLow_1_inherit_TYPE_descriptor(td);
378 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
379}
380
381
382/*** <<< STAT-DEFS [CN-IntegerMinLow] >>> ***/
383
Lev Walkin59b176e2005-11-26 11:25:14 +0000384static ber_tlv_tag_t asn_DEF_CN_IntegerMinLow_tags_1[] = {
Lev Walkin082cadc2005-08-14 02:18:27 +0000385 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
386};
387asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinLow = {
388 "CN-IntegerMinLow",
389 "CN-IntegerMinLow",
390 CN_IntegerMinLow_free,
391 CN_IntegerMinLow_print,
392 CN_IntegerMinLow_constraint,
393 CN_IntegerMinLow_decode_ber,
394 CN_IntegerMinLow_encode_der,
395 CN_IntegerMinLow_decode_xer,
396 CN_IntegerMinLow_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000397 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin082cadc2005-08-14 02:18:27 +0000398 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000399 asn_DEF_CN_IntegerMinLow_tags_1,
400 sizeof(asn_DEF_CN_IntegerMinLow_tags_1)
401 /sizeof(asn_DEF_CN_IntegerMinLow_tags_1[0]), /* 1 */
402 asn_DEF_CN_IntegerMinLow_tags_1, /* Same as above */
403 sizeof(asn_DEF_CN_IntegerMinLow_tags_1)
404 /sizeof(asn_DEF_CN_IntegerMinLow_tags_1[0]), /* 1 */
405 0, /* No PER visible constraints */
Lev Walkin082cadc2005-08-14 02:18:27 +0000406 0, 0, /* No members */
407 0 /* No specifics */
408};
409
410
411/*** <<< INCLUDES [NO-IntegerMinHigh] >>> ***/
412
413#include <INTEGER.h>
414
415/*** <<< TYPE-DECLS [NO-IntegerMinHigh] >>> ***/
416
417typedef INTEGER_t NO_IntegerMinHigh_t;
418
419/*** <<< FUNC-DECLS [NO-IntegerMinHigh] >>> ***/
420
421extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerMinHigh;
422asn_struct_free_f NO_IntegerMinHigh_free;
423asn_struct_print_f NO_IntegerMinHigh_print;
424asn_constr_check_f NO_IntegerMinHigh_constraint;
425ber_type_decoder_f NO_IntegerMinHigh_decode_ber;
426der_type_encoder_f NO_IntegerMinHigh_encode_der;
427xer_type_decoder_f NO_IntegerMinHigh_decode_xer;
428xer_type_encoder_f NO_IntegerMinHigh_encode_xer;
429
430/*** <<< CODE [NO-IntegerMinHigh] >>> ***/
431
432int
433NO_IntegerMinHigh_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000434 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin082cadc2005-08-14 02:18:27 +0000435 const INTEGER_t *st = (const INTEGER_t *)sptr;
436 long value;
437
438 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000439 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +0000440 "%s: value not given (%s:%d)",
441 td->name, __FILE__, __LINE__);
442 return -1;
443 }
444
445 if(asn_INTEGER2long(st, &value)) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000446 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +0000447 "%s: value too large (%s:%d)",
448 td->name, __FILE__, __LINE__);
449 return -1;
450 }
451
Lev Walkinc3f0b892005-08-14 02:40:04 +0000452 if((value <= 3000000000)) {
Lev Walkin082cadc2005-08-14 02:18:27 +0000453 /* Constraint check succeeded */
454 return 0;
455 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000456 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +0000457 "%s: constraint failed (%s:%d)",
458 td->name, __FILE__, __LINE__);
459 return -1;
460 }
461}
462
463/*
464 * This type is implemented using INTEGER,
465 * so here we adjust the DEF accordingly.
466 */
467static void
468NO_IntegerMinHigh_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
469 td->free_struct = asn_DEF_INTEGER.free_struct;
470 td->print_struct = asn_DEF_INTEGER.print_struct;
471 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
472 td->der_encoder = asn_DEF_INTEGER.der_encoder;
473 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
474 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000475 td->uper_decoder = asn_DEF_INTEGER.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000476 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000477 if(!td->per_constraints)
478 td->per_constraints = asn_DEF_INTEGER.per_constraints;
Lev Walkin082cadc2005-08-14 02:18:27 +0000479 td->elements = asn_DEF_INTEGER.elements;
480 td->elements_count = asn_DEF_INTEGER.elements_count;
481 td->specifics = asn_DEF_INTEGER.specifics;
482}
483
484void
485NO_IntegerMinHigh_free(asn_TYPE_descriptor_t *td,
486 void *struct_ptr, int contents_only) {
487 NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td);
488 td->free_struct(td, struct_ptr, contents_only);
489}
490
491int
492NO_IntegerMinHigh_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
493 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
494 NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td);
495 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
496}
497
498asn_dec_rval_t
499NO_IntegerMinHigh_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
500 void **structure, const void *bufptr, size_t size, int tag_mode) {
501 NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td);
502 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
503}
504
505asn_enc_rval_t
506NO_IntegerMinHigh_encode_der(asn_TYPE_descriptor_t *td,
507 void *structure, int tag_mode, ber_tlv_tag_t tag,
508 asn_app_consume_bytes_f *cb, void *app_key) {
509 NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td);
510 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
511}
512
513asn_dec_rval_t
514NO_IntegerMinHigh_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
515 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
516 NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td);
517 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
518}
519
520asn_enc_rval_t
521NO_IntegerMinHigh_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
522 int ilevel, enum xer_encoder_flags_e flags,
523 asn_app_consume_bytes_f *cb, void *app_key) {
524 NO_IntegerMinHigh_1_inherit_TYPE_descriptor(td);
525 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
526}
527
528
529/*** <<< STAT-DEFS [NO-IntegerMinHigh] >>> ***/
530
Lev Walkin59b176e2005-11-26 11:25:14 +0000531static ber_tlv_tag_t asn_DEF_NO_IntegerMinHigh_tags_1[] = {
Lev Walkin082cadc2005-08-14 02:18:27 +0000532 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
533};
534asn_TYPE_descriptor_t asn_DEF_NO_IntegerMinHigh = {
535 "NO-IntegerMinHigh",
536 "NO-IntegerMinHigh",
537 NO_IntegerMinHigh_free,
538 NO_IntegerMinHigh_print,
539 NO_IntegerMinHigh_constraint,
540 NO_IntegerMinHigh_decode_ber,
541 NO_IntegerMinHigh_encode_der,
542 NO_IntegerMinHigh_decode_xer,
543 NO_IntegerMinHigh_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000544 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin082cadc2005-08-14 02:18:27 +0000545 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000546 asn_DEF_NO_IntegerMinHigh_tags_1,
547 sizeof(asn_DEF_NO_IntegerMinHigh_tags_1)
548 /sizeof(asn_DEF_NO_IntegerMinHigh_tags_1[0]), /* 1 */
549 asn_DEF_NO_IntegerMinHigh_tags_1, /* Same as above */
550 sizeof(asn_DEF_NO_IntegerMinHigh_tags_1)
551 /sizeof(asn_DEF_NO_IntegerMinHigh_tags_1[0]), /* 1 */
552 0, /* No PER visible constraints */
Lev Walkin082cadc2005-08-14 02:18:27 +0000553 0, 0, /* No members */
554 0 /* No specifics */
555};
556
557
558/*** <<< INCLUDES [NO-IntegerLowHigh] >>> ***/
559
Lev Walkin8bb57a22007-12-03 13:41:36 +0000560#include <NativeInteger.h>
Lev Walkin082cadc2005-08-14 02:18:27 +0000561
562/*** <<< TYPE-DECLS [NO-IntegerLowHigh] >>> ***/
563
Lev Walkin8bb57a22007-12-03 13:41:36 +0000564typedef unsigned long NO_IntegerLowHigh_t;
Lev Walkin082cadc2005-08-14 02:18:27 +0000565
566/*** <<< FUNC-DECLS [NO-IntegerLowHigh] >>> ***/
567
568extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh;
569asn_struct_free_f NO_IntegerLowHigh_free;
570asn_struct_print_f NO_IntegerLowHigh_print;
571asn_constr_check_f NO_IntegerLowHigh_constraint;
572ber_type_decoder_f NO_IntegerLowHigh_decode_ber;
573der_type_encoder_f NO_IntegerLowHigh_encode_der;
574xer_type_decoder_f NO_IntegerLowHigh_decode_xer;
575xer_type_encoder_f NO_IntegerLowHigh_encode_xer;
576
577/*** <<< CODE [NO-IntegerLowHigh] >>> ***/
578
579int
580NO_IntegerLowHigh_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000581 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8bb57a22007-12-03 13:41:36 +0000582 unsigned long value;
Lev Walkin082cadc2005-08-14 02:18:27 +0000583
584 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000585 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +0000586 "%s: value not given (%s:%d)",
587 td->name, __FILE__, __LINE__);
588 return -1;
589 }
590
Lev Walkin8bb57a22007-12-03 13:41:36 +0000591 value = *(const unsigned long *)sptr;
Lev Walkin082cadc2005-08-14 02:18:27 +0000592
Lev Walkinc3f0b892005-08-14 02:40:04 +0000593 if((value >= 1 && value <= 3000000000)) {
Lev Walkin082cadc2005-08-14 02:18:27 +0000594 /* Constraint check succeeded */
595 return 0;
596 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000597 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +0000598 "%s: constraint failed (%s:%d)",
599 td->name, __FILE__, __LINE__);
600 return -1;
601 }
602}
603
604/*
Lev Walkin8bb57a22007-12-03 13:41:36 +0000605 * This type is implemented using NativeInteger,
Lev Walkin082cadc2005-08-14 02:18:27 +0000606 * so here we adjust the DEF accordingly.
607 */
608static void
609NO_IntegerLowHigh_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin8bb57a22007-12-03 13:41:36 +0000610 td->free_struct = asn_DEF_NativeInteger.free_struct;
611 td->print_struct = asn_DEF_NativeInteger.print_struct;
612 td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
613 td->der_encoder = asn_DEF_NativeInteger.der_encoder;
614 td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
615 td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
616 td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
617 td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000618 if(!td->per_constraints)
Lev Walkin8bb57a22007-12-03 13:41:36 +0000619 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
620 td->elements = asn_DEF_NativeInteger.elements;
621 td->elements_count = asn_DEF_NativeInteger.elements_count;
622 /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */
Lev Walkin082cadc2005-08-14 02:18:27 +0000623}
624
625void
626NO_IntegerLowHigh_free(asn_TYPE_descriptor_t *td,
627 void *struct_ptr, int contents_only) {
628 NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td);
629 td->free_struct(td, struct_ptr, contents_only);
630}
631
632int
633NO_IntegerLowHigh_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
634 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
635 NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td);
636 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
637}
638
639asn_dec_rval_t
640NO_IntegerLowHigh_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
641 void **structure, const void *bufptr, size_t size, int tag_mode) {
642 NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td);
643 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
644}
645
646asn_enc_rval_t
647NO_IntegerLowHigh_encode_der(asn_TYPE_descriptor_t *td,
648 void *structure, int tag_mode, ber_tlv_tag_t tag,
649 asn_app_consume_bytes_f *cb, void *app_key) {
650 NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td);
651 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
652}
653
654asn_dec_rval_t
655NO_IntegerLowHigh_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
656 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
657 NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td);
658 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
659}
660
661asn_enc_rval_t
662NO_IntegerLowHigh_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
663 int ilevel, enum xer_encoder_flags_e flags,
664 asn_app_consume_bytes_f *cb, void *app_key) {
665 NO_IntegerLowHigh_1_inherit_TYPE_descriptor(td);
666 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
667}
668
669
670/*** <<< STAT-DEFS [NO-IntegerLowHigh] >>> ***/
671
Lev Walkin8bb57a22007-12-03 13:41:36 +0000672static asn_INTEGER_specifics_t asn_SPC_NO_IntegerLowHigh_specs_1 = {
673 0, 0, 0, 0, 0,
674 0, /* Native long size */
675 1 /* Unsigned representation */
676};
Lev Walkin59b176e2005-11-26 11:25:14 +0000677static ber_tlv_tag_t asn_DEF_NO_IntegerLowHigh_tags_1[] = {
Lev Walkin082cadc2005-08-14 02:18:27 +0000678 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
679};
680asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh = {
681 "NO-IntegerLowHigh",
682 "NO-IntegerLowHigh",
683 NO_IntegerLowHigh_free,
684 NO_IntegerLowHigh_print,
685 NO_IntegerLowHigh_constraint,
686 NO_IntegerLowHigh_decode_ber,
687 NO_IntegerLowHigh_encode_der,
688 NO_IntegerLowHigh_decode_xer,
689 NO_IntegerLowHigh_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000690 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin082cadc2005-08-14 02:18:27 +0000691 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000692 asn_DEF_NO_IntegerLowHigh_tags_1,
693 sizeof(asn_DEF_NO_IntegerLowHigh_tags_1)
694 /sizeof(asn_DEF_NO_IntegerLowHigh_tags_1[0]), /* 1 */
695 asn_DEF_NO_IntegerLowHigh_tags_1, /* Same as above */
696 sizeof(asn_DEF_NO_IntegerLowHigh_tags_1)
697 /sizeof(asn_DEF_NO_IntegerLowHigh_tags_1[0]), /* 1 */
698 0, /* No PER visible constraints */
Lev Walkin082cadc2005-08-14 02:18:27 +0000699 0, 0, /* No members */
Lev Walkin8bb57a22007-12-03 13:41:36 +0000700 &asn_SPC_NO_IntegerLowHigh_specs_1 /* Additional specs */
Lev Walkin082cadc2005-08-14 02:18:27 +0000701};
702
703
704/*** <<< INCLUDES [CN-IntegerLowMax] >>> ***/
705
706#include <INTEGER.h>
707
708/*** <<< TYPE-DECLS [CN-IntegerLowMax] >>> ***/
709
710typedef INTEGER_t CN_IntegerLowMax_t;
711
712/*** <<< FUNC-DECLS [CN-IntegerLowMax] >>> ***/
713
714extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerLowMax;
715asn_struct_free_f CN_IntegerLowMax_free;
716asn_struct_print_f CN_IntegerLowMax_print;
717asn_constr_check_f CN_IntegerLowMax_constraint;
718ber_type_decoder_f CN_IntegerLowMax_decode_ber;
719der_type_encoder_f CN_IntegerLowMax_encode_der;
720xer_type_decoder_f CN_IntegerLowMax_decode_xer;
721xer_type_encoder_f CN_IntegerLowMax_encode_xer;
722
723/*** <<< CODE [CN-IntegerLowMax] >>> ***/
724
725int
726CN_IntegerLowMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000727 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin082cadc2005-08-14 02:18:27 +0000728 const INTEGER_t *st = (const INTEGER_t *)sptr;
729 long value;
730
731 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000732 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +0000733 "%s: value not given (%s:%d)",
734 td->name, __FILE__, __LINE__);
735 return -1;
736 }
737
738 if(asn_INTEGER2long(st, &value)) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000739 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +0000740 "%s: value too large (%s:%d)",
741 td->name, __FILE__, __LINE__);
742 return -1;
743 }
744
745 if((value >= 1)) {
746 /* Constraint check succeeded */
747 return 0;
748 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000749 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +0000750 "%s: constraint failed (%s:%d)",
751 td->name, __FILE__, __LINE__);
752 return -1;
753 }
754}
755
756/*
757 * This type is implemented using INTEGER,
758 * so here we adjust the DEF accordingly.
759 */
760static void
761CN_IntegerLowMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
762 td->free_struct = asn_DEF_INTEGER.free_struct;
763 td->print_struct = asn_DEF_INTEGER.print_struct;
764 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
765 td->der_encoder = asn_DEF_INTEGER.der_encoder;
766 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
767 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000768 td->uper_decoder = asn_DEF_INTEGER.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000769 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000770 if(!td->per_constraints)
771 td->per_constraints = asn_DEF_INTEGER.per_constraints;
Lev Walkin082cadc2005-08-14 02:18:27 +0000772 td->elements = asn_DEF_INTEGER.elements;
773 td->elements_count = asn_DEF_INTEGER.elements_count;
774 td->specifics = asn_DEF_INTEGER.specifics;
775}
776
777void
778CN_IntegerLowMax_free(asn_TYPE_descriptor_t *td,
779 void *struct_ptr, int contents_only) {
780 CN_IntegerLowMax_1_inherit_TYPE_descriptor(td);
781 td->free_struct(td, struct_ptr, contents_only);
782}
783
784int
785CN_IntegerLowMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
786 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
787 CN_IntegerLowMax_1_inherit_TYPE_descriptor(td);
788 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
789}
790
791asn_dec_rval_t
792CN_IntegerLowMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
793 void **structure, const void *bufptr, size_t size, int tag_mode) {
794 CN_IntegerLowMax_1_inherit_TYPE_descriptor(td);
795 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
796}
797
798asn_enc_rval_t
799CN_IntegerLowMax_encode_der(asn_TYPE_descriptor_t *td,
800 void *structure, int tag_mode, ber_tlv_tag_t tag,
801 asn_app_consume_bytes_f *cb, void *app_key) {
802 CN_IntegerLowMax_1_inherit_TYPE_descriptor(td);
803 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
804}
805
806asn_dec_rval_t
807CN_IntegerLowMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
808 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
809 CN_IntegerLowMax_1_inherit_TYPE_descriptor(td);
810 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
811}
812
813asn_enc_rval_t
814CN_IntegerLowMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
815 int ilevel, enum xer_encoder_flags_e flags,
816 asn_app_consume_bytes_f *cb, void *app_key) {
817 CN_IntegerLowMax_1_inherit_TYPE_descriptor(td);
818 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
819}
820
821
822/*** <<< STAT-DEFS [CN-IntegerLowMax] >>> ***/
823
Lev Walkin59b176e2005-11-26 11:25:14 +0000824static ber_tlv_tag_t asn_DEF_CN_IntegerLowMax_tags_1[] = {
Lev Walkin082cadc2005-08-14 02:18:27 +0000825 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
826};
827asn_TYPE_descriptor_t asn_DEF_CN_IntegerLowMax = {
828 "CN-IntegerLowMax",
829 "CN-IntegerLowMax",
830 CN_IntegerLowMax_free,
831 CN_IntegerLowMax_print,
832 CN_IntegerLowMax_constraint,
833 CN_IntegerLowMax_decode_ber,
834 CN_IntegerLowMax_encode_der,
835 CN_IntegerLowMax_decode_xer,
836 CN_IntegerLowMax_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000837 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin082cadc2005-08-14 02:18:27 +0000838 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000839 asn_DEF_CN_IntegerLowMax_tags_1,
840 sizeof(asn_DEF_CN_IntegerLowMax_tags_1)
841 /sizeof(asn_DEF_CN_IntegerLowMax_tags_1[0]), /* 1 */
842 asn_DEF_CN_IntegerLowMax_tags_1, /* Same as above */
843 sizeof(asn_DEF_CN_IntegerLowMax_tags_1)
844 /sizeof(asn_DEF_CN_IntegerLowMax_tags_1[0]), /* 1 */
845 0, /* No PER visible constraints */
Lev Walkin082cadc2005-08-14 02:18:27 +0000846 0, 0, /* No members */
847 0 /* No specifics */
848};
849
850
851/*** <<< INCLUDES [NO-IntegerHighMax] >>> ***/
852
853#include <INTEGER.h>
854
855/*** <<< TYPE-DECLS [NO-IntegerHighMax] >>> ***/
856
857typedef INTEGER_t NO_IntegerHighMax_t;
858
859/*** <<< FUNC-DECLS [NO-IntegerHighMax] >>> ***/
860
861extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerHighMax;
862asn_struct_free_f NO_IntegerHighMax_free;
863asn_struct_print_f NO_IntegerHighMax_print;
864asn_constr_check_f NO_IntegerHighMax_constraint;
865ber_type_decoder_f NO_IntegerHighMax_decode_ber;
866der_type_encoder_f NO_IntegerHighMax_encode_der;
867xer_type_decoder_f NO_IntegerHighMax_decode_xer;
868xer_type_encoder_f NO_IntegerHighMax_encode_xer;
869
870/*** <<< CODE [NO-IntegerHighMax] >>> ***/
871
872int
873NO_IntegerHighMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000874 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin082cadc2005-08-14 02:18:27 +0000875 const INTEGER_t *st = (const INTEGER_t *)sptr;
876 long value;
877
878 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000879 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +0000880 "%s: value not given (%s:%d)",
881 td->name, __FILE__, __LINE__);
882 return -1;
883 }
884
885 if(asn_INTEGER2long(st, &value)) {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000886 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +0000887 "%s: value too large (%s:%d)",
888 td->name, __FILE__, __LINE__);
889 return -1;
890 }
891
Lev Walkinc3f0b892005-08-14 02:40:04 +0000892 if((value >= 3000000000)) {
Lev Walkin082cadc2005-08-14 02:18:27 +0000893 /* Constraint check succeeded */
894 return 0;
895 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +0000896 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +0000897 "%s: constraint failed (%s:%d)",
898 td->name, __FILE__, __LINE__);
899 return -1;
900 }
901}
902
903/*
904 * This type is implemented using INTEGER,
905 * so here we adjust the DEF accordingly.
906 */
907static void
908NO_IntegerHighMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
909 td->free_struct = asn_DEF_INTEGER.free_struct;
910 td->print_struct = asn_DEF_INTEGER.print_struct;
911 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
912 td->der_encoder = asn_DEF_INTEGER.der_encoder;
913 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
914 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000915 td->uper_decoder = asn_DEF_INTEGER.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000916 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +0000917 if(!td->per_constraints)
918 td->per_constraints = asn_DEF_INTEGER.per_constraints;
Lev Walkin082cadc2005-08-14 02:18:27 +0000919 td->elements = asn_DEF_INTEGER.elements;
920 td->elements_count = asn_DEF_INTEGER.elements_count;
921 td->specifics = asn_DEF_INTEGER.specifics;
922}
923
924void
925NO_IntegerHighMax_free(asn_TYPE_descriptor_t *td,
926 void *struct_ptr, int contents_only) {
927 NO_IntegerHighMax_1_inherit_TYPE_descriptor(td);
928 td->free_struct(td, struct_ptr, contents_only);
929}
930
931int
932NO_IntegerHighMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
933 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
934 NO_IntegerHighMax_1_inherit_TYPE_descriptor(td);
935 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
936}
937
938asn_dec_rval_t
939NO_IntegerHighMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
940 void **structure, const void *bufptr, size_t size, int tag_mode) {
941 NO_IntegerHighMax_1_inherit_TYPE_descriptor(td);
942 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
943}
944
945asn_enc_rval_t
946NO_IntegerHighMax_encode_der(asn_TYPE_descriptor_t *td,
947 void *structure, int tag_mode, ber_tlv_tag_t tag,
948 asn_app_consume_bytes_f *cb, void *app_key) {
949 NO_IntegerHighMax_1_inherit_TYPE_descriptor(td);
950 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
951}
952
953asn_dec_rval_t
954NO_IntegerHighMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
955 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
956 NO_IntegerHighMax_1_inherit_TYPE_descriptor(td);
957 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
958}
959
960asn_enc_rval_t
961NO_IntegerHighMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
962 int ilevel, enum xer_encoder_flags_e flags,
963 asn_app_consume_bytes_f *cb, void *app_key) {
964 NO_IntegerHighMax_1_inherit_TYPE_descriptor(td);
965 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
966}
967
968
969/*** <<< STAT-DEFS [NO-IntegerHighMax] >>> ***/
970
Lev Walkin59b176e2005-11-26 11:25:14 +0000971static ber_tlv_tag_t asn_DEF_NO_IntegerHighMax_tags_1[] = {
Lev Walkin082cadc2005-08-14 02:18:27 +0000972 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
973};
974asn_TYPE_descriptor_t asn_DEF_NO_IntegerHighMax = {
975 "NO-IntegerHighMax",
976 "NO-IntegerHighMax",
977 NO_IntegerHighMax_free,
978 NO_IntegerHighMax_print,
979 NO_IntegerHighMax_constraint,
980 NO_IntegerHighMax_decode_ber,
981 NO_IntegerHighMax_encode_der,
982 NO_IntegerHighMax_decode_xer,
983 NO_IntegerHighMax_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000984 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin082cadc2005-08-14 02:18:27 +0000985 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +0000986 asn_DEF_NO_IntegerHighMax_tags_1,
987 sizeof(asn_DEF_NO_IntegerHighMax_tags_1)
988 /sizeof(asn_DEF_NO_IntegerHighMax_tags_1[0]), /* 1 */
989 asn_DEF_NO_IntegerHighMax_tags_1, /* Same as above */
990 sizeof(asn_DEF_NO_IntegerHighMax_tags_1)
991 /sizeof(asn_DEF_NO_IntegerHighMax_tags_1[0]), /* 1 */
992 0, /* No PER visible constraints */
Lev Walkin082cadc2005-08-14 02:18:27 +0000993 0, 0, /* No members */
994 0 /* No specifics */
995};
996
997
998/*** <<< INCLUDES [NO-IntegerLowestMax] >>> ***/
999
1000#include <INTEGER.h>
1001
1002/*** <<< TYPE-DECLS [NO-IntegerLowestMax] >>> ***/
1003
1004typedef INTEGER_t NO_IntegerLowestMax_t;
1005
1006/*** <<< FUNC-DECLS [NO-IntegerLowestMax] >>> ***/
1007
1008extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowestMax;
1009asn_struct_free_f NO_IntegerLowestMax_free;
1010asn_struct_print_f NO_IntegerLowestMax_print;
1011asn_constr_check_f NO_IntegerLowestMax_constraint;
1012ber_type_decoder_f NO_IntegerLowestMax_decode_ber;
1013der_type_encoder_f NO_IntegerLowestMax_encode_der;
1014xer_type_decoder_f NO_IntegerLowestMax_decode_xer;
1015xer_type_encoder_f NO_IntegerLowestMax_encode_xer;
1016
1017/*** <<< CODE [NO-IntegerLowestMax] >>> ***/
1018
1019int
1020NO_IntegerLowestMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001021 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin082cadc2005-08-14 02:18:27 +00001022 const INTEGER_t *st = (const INTEGER_t *)sptr;
1023 long value;
1024
1025 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001026 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +00001027 "%s: value not given (%s:%d)",
1028 td->name, __FILE__, __LINE__);
1029 return -1;
1030 }
1031
1032 if(asn_INTEGER2long(st, &value)) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001033 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +00001034 "%s: value too large (%s:%d)",
1035 td->name, __FILE__, __LINE__);
1036 return -1;
1037 }
1038
Lev Walkinc3f0b892005-08-14 02:40:04 +00001039 if((value >= -3000000000)) {
Lev Walkin082cadc2005-08-14 02:18:27 +00001040 /* Constraint check succeeded */
1041 return 0;
1042 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001043 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +00001044 "%s: constraint failed (%s:%d)",
1045 td->name, __FILE__, __LINE__);
1046 return -1;
1047 }
1048}
1049
1050/*
1051 * This type is implemented using INTEGER,
1052 * so here we adjust the DEF accordingly.
1053 */
1054static void
1055NO_IntegerLowestMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
1056 td->free_struct = asn_DEF_INTEGER.free_struct;
1057 td->print_struct = asn_DEF_INTEGER.print_struct;
1058 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
1059 td->der_encoder = asn_DEF_INTEGER.der_encoder;
1060 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
1061 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001062 td->uper_decoder = asn_DEF_INTEGER.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001063 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001064 if(!td->per_constraints)
1065 td->per_constraints = asn_DEF_INTEGER.per_constraints;
Lev Walkin082cadc2005-08-14 02:18:27 +00001066 td->elements = asn_DEF_INTEGER.elements;
1067 td->elements_count = asn_DEF_INTEGER.elements_count;
1068 td->specifics = asn_DEF_INTEGER.specifics;
1069}
1070
1071void
1072NO_IntegerLowestMax_free(asn_TYPE_descriptor_t *td,
1073 void *struct_ptr, int contents_only) {
1074 NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td);
1075 td->free_struct(td, struct_ptr, contents_only);
1076}
1077
1078int
1079NO_IntegerLowestMax_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1080 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1081 NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td);
1082 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1083}
1084
1085asn_dec_rval_t
1086NO_IntegerLowestMax_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1087 void **structure, const void *bufptr, size_t size, int tag_mode) {
1088 NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td);
1089 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1090}
1091
1092asn_enc_rval_t
1093NO_IntegerLowestMax_encode_der(asn_TYPE_descriptor_t *td,
1094 void *structure, int tag_mode, ber_tlv_tag_t tag,
1095 asn_app_consume_bytes_f *cb, void *app_key) {
1096 NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td);
1097 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1098}
1099
1100asn_dec_rval_t
1101NO_IntegerLowestMax_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1102 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1103 NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td);
1104 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1105}
1106
1107asn_enc_rval_t
1108NO_IntegerLowestMax_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1109 int ilevel, enum xer_encoder_flags_e flags,
1110 asn_app_consume_bytes_f *cb, void *app_key) {
1111 NO_IntegerLowestMax_1_inherit_TYPE_descriptor(td);
1112 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1113}
1114
1115
1116/*** <<< STAT-DEFS [NO-IntegerLowestMax] >>> ***/
1117
Lev Walkin59b176e2005-11-26 11:25:14 +00001118static ber_tlv_tag_t asn_DEF_NO_IntegerLowestMax_tags_1[] = {
Lev Walkin082cadc2005-08-14 02:18:27 +00001119 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
1120};
1121asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowestMax = {
1122 "NO-IntegerLowestMax",
1123 "NO-IntegerLowestMax",
1124 NO_IntegerLowestMax_free,
1125 NO_IntegerLowestMax_print,
1126 NO_IntegerLowestMax_constraint,
1127 NO_IntegerLowestMax_decode_ber,
1128 NO_IntegerLowestMax_encode_der,
1129 NO_IntegerLowestMax_decode_xer,
1130 NO_IntegerLowestMax_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001131 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin082cadc2005-08-14 02:18:27 +00001132 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001133 asn_DEF_NO_IntegerLowestMax_tags_1,
1134 sizeof(asn_DEF_NO_IntegerLowestMax_tags_1)
1135 /sizeof(asn_DEF_NO_IntegerLowestMax_tags_1[0]), /* 1 */
1136 asn_DEF_NO_IntegerLowestMax_tags_1, /* Same as above */
1137 sizeof(asn_DEF_NO_IntegerLowestMax_tags_1)
1138 /sizeof(asn_DEF_NO_IntegerLowestMax_tags_1[0]), /* 1 */
1139 0, /* No PER visible constraints */
Lev Walkin082cadc2005-08-14 02:18:27 +00001140 0, 0, /* No members */
1141 0 /* No specifics */
1142};
1143
1144
1145/*** <<< INCLUDES [NO-IntegerOutRange] >>> ***/
1146
Lev Walkin8bb57a22007-12-03 13:41:36 +00001147#include <NativeInteger.h>
Lev Walkin082cadc2005-08-14 02:18:27 +00001148
1149/*** <<< TYPE-DECLS [NO-IntegerOutRange] >>> ***/
1150
Lev Walkin8bb57a22007-12-03 13:41:36 +00001151typedef unsigned long NO_IntegerOutRange_t;
Lev Walkin082cadc2005-08-14 02:18:27 +00001152
1153/*** <<< FUNC-DECLS [NO-IntegerOutRange] >>> ***/
1154
1155extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutRange;
1156asn_struct_free_f NO_IntegerOutRange_free;
1157asn_struct_print_f NO_IntegerOutRange_print;
1158asn_constr_check_f NO_IntegerOutRange_constraint;
1159ber_type_decoder_f NO_IntegerOutRange_decode_ber;
1160der_type_encoder_f NO_IntegerOutRange_encode_der;
1161xer_type_decoder_f NO_IntegerOutRange_decode_xer;
1162xer_type_encoder_f NO_IntegerOutRange_encode_xer;
1163
1164/*** <<< CODE [NO-IntegerOutRange] >>> ***/
1165
1166int
1167NO_IntegerOutRange_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001168 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8bb57a22007-12-03 13:41:36 +00001169 unsigned long value;
Lev Walkin082cadc2005-08-14 02:18:27 +00001170
1171 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001172 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +00001173 "%s: value not given (%s:%d)",
1174 td->name, __FILE__, __LINE__);
1175 return -1;
1176 }
1177
Lev Walkin8bb57a22007-12-03 13:41:36 +00001178 value = *(const unsigned long *)sptr;
Lev Walkin082cadc2005-08-14 02:18:27 +00001179
Lev Walkinc3f0b892005-08-14 02:40:04 +00001180 if((value >= 3000000000 && value <= 3000000001)) {
Lev Walkin082cadc2005-08-14 02:18:27 +00001181 /* Constraint check succeeded */
1182 return 0;
1183 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001184 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +00001185 "%s: constraint failed (%s:%d)",
1186 td->name, __FILE__, __LINE__);
1187 return -1;
1188 }
1189}
1190
1191/*
Lev Walkin8bb57a22007-12-03 13:41:36 +00001192 * This type is implemented using NativeInteger,
Lev Walkin082cadc2005-08-14 02:18:27 +00001193 * so here we adjust the DEF accordingly.
1194 */
1195static void
1196NO_IntegerOutRange_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin8bb57a22007-12-03 13:41:36 +00001197 td->free_struct = asn_DEF_NativeInteger.free_struct;
1198 td->print_struct = asn_DEF_NativeInteger.print_struct;
1199 td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
1200 td->der_encoder = asn_DEF_NativeInteger.der_encoder;
1201 td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
1202 td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
1203 td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
1204 td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001205 if(!td->per_constraints)
Lev Walkin8bb57a22007-12-03 13:41:36 +00001206 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
1207 td->elements = asn_DEF_NativeInteger.elements;
1208 td->elements_count = asn_DEF_NativeInteger.elements_count;
1209 /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */
Lev Walkin082cadc2005-08-14 02:18:27 +00001210}
1211
1212void
1213NO_IntegerOutRange_free(asn_TYPE_descriptor_t *td,
1214 void *struct_ptr, int contents_only) {
1215 NO_IntegerOutRange_1_inherit_TYPE_descriptor(td);
1216 td->free_struct(td, struct_ptr, contents_only);
1217}
1218
1219int
1220NO_IntegerOutRange_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1221 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1222 NO_IntegerOutRange_1_inherit_TYPE_descriptor(td);
1223 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1224}
1225
1226asn_dec_rval_t
1227NO_IntegerOutRange_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1228 void **structure, const void *bufptr, size_t size, int tag_mode) {
1229 NO_IntegerOutRange_1_inherit_TYPE_descriptor(td);
1230 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1231}
1232
1233asn_enc_rval_t
1234NO_IntegerOutRange_encode_der(asn_TYPE_descriptor_t *td,
1235 void *structure, int tag_mode, ber_tlv_tag_t tag,
1236 asn_app_consume_bytes_f *cb, void *app_key) {
1237 NO_IntegerOutRange_1_inherit_TYPE_descriptor(td);
1238 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1239}
1240
1241asn_dec_rval_t
1242NO_IntegerOutRange_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1243 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1244 NO_IntegerOutRange_1_inherit_TYPE_descriptor(td);
1245 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1246}
1247
1248asn_enc_rval_t
1249NO_IntegerOutRange_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1250 int ilevel, enum xer_encoder_flags_e flags,
1251 asn_app_consume_bytes_f *cb, void *app_key) {
1252 NO_IntegerOutRange_1_inherit_TYPE_descriptor(td);
1253 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1254}
1255
1256
1257/*** <<< STAT-DEFS [NO-IntegerOutRange] >>> ***/
1258
Lev Walkin8bb57a22007-12-03 13:41:36 +00001259static asn_INTEGER_specifics_t asn_SPC_NO_IntegerOutRange_specs_1 = {
1260 0, 0, 0, 0, 0,
1261 0, /* Native long size */
1262 1 /* Unsigned representation */
1263};
Lev Walkin59b176e2005-11-26 11:25:14 +00001264static ber_tlv_tag_t asn_DEF_NO_IntegerOutRange_tags_1[] = {
Lev Walkin082cadc2005-08-14 02:18:27 +00001265 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
1266};
1267asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutRange = {
1268 "NO-IntegerOutRange",
1269 "NO-IntegerOutRange",
1270 NO_IntegerOutRange_free,
1271 NO_IntegerOutRange_print,
1272 NO_IntegerOutRange_constraint,
1273 NO_IntegerOutRange_decode_ber,
1274 NO_IntegerOutRange_encode_der,
1275 NO_IntegerOutRange_decode_xer,
1276 NO_IntegerOutRange_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001277 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin082cadc2005-08-14 02:18:27 +00001278 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001279 asn_DEF_NO_IntegerOutRange_tags_1,
1280 sizeof(asn_DEF_NO_IntegerOutRange_tags_1)
1281 /sizeof(asn_DEF_NO_IntegerOutRange_tags_1[0]), /* 1 */
1282 asn_DEF_NO_IntegerOutRange_tags_1, /* Same as above */
1283 sizeof(asn_DEF_NO_IntegerOutRange_tags_1)
1284 /sizeof(asn_DEF_NO_IntegerOutRange_tags_1[0]), /* 1 */
1285 0, /* No PER visible constraints */
Lev Walkin082cadc2005-08-14 02:18:27 +00001286 0, 0, /* No members */
Lev Walkin8bb57a22007-12-03 13:41:36 +00001287 &asn_SPC_NO_IntegerOutRange_specs_1 /* Additional specs */
Lev Walkin082cadc2005-08-14 02:18:27 +00001288};
1289
1290
1291/*** <<< INCLUDES [NO-IntegerOutValue] >>> ***/
1292
Lev Walkin8bb57a22007-12-03 13:41:36 +00001293#include <NativeInteger.h>
Lev Walkin082cadc2005-08-14 02:18:27 +00001294
1295/*** <<< TYPE-DECLS [NO-IntegerOutValue] >>> ***/
1296
Lev Walkin8bb57a22007-12-03 13:41:36 +00001297typedef unsigned long NO_IntegerOutValue_t;
Lev Walkin082cadc2005-08-14 02:18:27 +00001298
1299/*** <<< FUNC-DECLS [NO-IntegerOutValue] >>> ***/
1300
1301extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutValue;
1302asn_struct_free_f NO_IntegerOutValue_free;
1303asn_struct_print_f NO_IntegerOutValue_print;
1304asn_constr_check_f NO_IntegerOutValue_constraint;
1305ber_type_decoder_f NO_IntegerOutValue_decode_ber;
1306der_type_encoder_f NO_IntegerOutValue_encode_der;
1307xer_type_decoder_f NO_IntegerOutValue_decode_xer;
1308xer_type_encoder_f NO_IntegerOutValue_encode_xer;
1309
1310/*** <<< CODE [NO-IntegerOutValue] >>> ***/
1311
1312int
1313NO_IntegerOutValue_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001314 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8bb57a22007-12-03 13:41:36 +00001315 unsigned long value;
Lev Walkin082cadc2005-08-14 02:18:27 +00001316
1317 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001318 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +00001319 "%s: value not given (%s:%d)",
1320 td->name, __FILE__, __LINE__);
1321 return -1;
1322 }
1323
Lev Walkin8bb57a22007-12-03 13:41:36 +00001324 value = *(const unsigned long *)sptr;
Lev Walkin082cadc2005-08-14 02:18:27 +00001325
Lev Walkinc3f0b892005-08-14 02:40:04 +00001326 if((value == 3000000000)) {
Lev Walkin082cadc2005-08-14 02:18:27 +00001327 /* Constraint check succeeded */
1328 return 0;
1329 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001330 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +00001331 "%s: constraint failed (%s:%d)",
1332 td->name, __FILE__, __LINE__);
1333 return -1;
1334 }
1335}
1336
1337/*
Lev Walkin8bb57a22007-12-03 13:41:36 +00001338 * This type is implemented using NativeInteger,
Lev Walkin082cadc2005-08-14 02:18:27 +00001339 * so here we adjust the DEF accordingly.
1340 */
1341static void
1342NO_IntegerOutValue_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin8bb57a22007-12-03 13:41:36 +00001343 td->free_struct = asn_DEF_NativeInteger.free_struct;
1344 td->print_struct = asn_DEF_NativeInteger.print_struct;
1345 td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
1346 td->der_encoder = asn_DEF_NativeInteger.der_encoder;
1347 td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
1348 td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
1349 td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
1350 td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001351 if(!td->per_constraints)
Lev Walkin8bb57a22007-12-03 13:41:36 +00001352 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
1353 td->elements = asn_DEF_NativeInteger.elements;
1354 td->elements_count = asn_DEF_NativeInteger.elements_count;
1355 /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */
Lev Walkin082cadc2005-08-14 02:18:27 +00001356}
1357
1358void
1359NO_IntegerOutValue_free(asn_TYPE_descriptor_t *td,
1360 void *struct_ptr, int contents_only) {
1361 NO_IntegerOutValue_1_inherit_TYPE_descriptor(td);
1362 td->free_struct(td, struct_ptr, contents_only);
1363}
1364
1365int
1366NO_IntegerOutValue_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1367 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1368 NO_IntegerOutValue_1_inherit_TYPE_descriptor(td);
1369 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1370}
1371
1372asn_dec_rval_t
1373NO_IntegerOutValue_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1374 void **structure, const void *bufptr, size_t size, int tag_mode) {
1375 NO_IntegerOutValue_1_inherit_TYPE_descriptor(td);
1376 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1377}
1378
1379asn_enc_rval_t
1380NO_IntegerOutValue_encode_der(asn_TYPE_descriptor_t *td,
1381 void *structure, int tag_mode, ber_tlv_tag_t tag,
1382 asn_app_consume_bytes_f *cb, void *app_key) {
1383 NO_IntegerOutValue_1_inherit_TYPE_descriptor(td);
1384 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1385}
1386
1387asn_dec_rval_t
1388NO_IntegerOutValue_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1389 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1390 NO_IntegerOutValue_1_inherit_TYPE_descriptor(td);
1391 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1392}
1393
1394asn_enc_rval_t
1395NO_IntegerOutValue_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1396 int ilevel, enum xer_encoder_flags_e flags,
1397 asn_app_consume_bytes_f *cb, void *app_key) {
1398 NO_IntegerOutValue_1_inherit_TYPE_descriptor(td);
1399 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1400}
1401
1402
1403/*** <<< STAT-DEFS [NO-IntegerOutValue] >>> ***/
1404
Lev Walkin8bb57a22007-12-03 13:41:36 +00001405static asn_INTEGER_specifics_t asn_SPC_NO_IntegerOutValue_specs_1 = {
1406 0, 0, 0, 0, 0,
1407 0, /* Native long size */
1408 1 /* Unsigned representation */
1409};
Lev Walkin59b176e2005-11-26 11:25:14 +00001410static ber_tlv_tag_t asn_DEF_NO_IntegerOutValue_tags_1[] = {
Lev Walkin082cadc2005-08-14 02:18:27 +00001411 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
1412};
1413asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutValue = {
1414 "NO-IntegerOutValue",
1415 "NO-IntegerOutValue",
1416 NO_IntegerOutValue_free,
1417 NO_IntegerOutValue_print,
1418 NO_IntegerOutValue_constraint,
1419 NO_IntegerOutValue_decode_ber,
1420 NO_IntegerOutValue_encode_der,
1421 NO_IntegerOutValue_decode_xer,
1422 NO_IntegerOutValue_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001423 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin082cadc2005-08-14 02:18:27 +00001424 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001425 asn_DEF_NO_IntegerOutValue_tags_1,
1426 sizeof(asn_DEF_NO_IntegerOutValue_tags_1)
1427 /sizeof(asn_DEF_NO_IntegerOutValue_tags_1[0]), /* 1 */
1428 asn_DEF_NO_IntegerOutValue_tags_1, /* Same as above */
1429 sizeof(asn_DEF_NO_IntegerOutValue_tags_1)
1430 /sizeof(asn_DEF_NO_IntegerOutValue_tags_1[0]), /* 1 */
1431 0, /* No PER visible constraints */
Lev Walkin082cadc2005-08-14 02:18:27 +00001432 0, 0, /* No members */
Lev Walkin8bb57a22007-12-03 13:41:36 +00001433 &asn_SPC_NO_IntegerOutValue_specs_1 /* Additional specs */
Lev Walkin082cadc2005-08-14 02:18:27 +00001434};
1435
1436
1437/*** <<< INCLUDES [OK-IntegerInRange1] >>> ***/
1438
Lev Walkinc3f0b892005-08-14 02:40:04 +00001439#include <NativeInteger.h>
Lev Walkin082cadc2005-08-14 02:18:27 +00001440
1441/*** <<< TYPE-DECLS [OK-IntegerInRange1] >>> ***/
1442
Lev Walkinc3f0b892005-08-14 02:40:04 +00001443typedef long OK_IntegerInRange1_t;
Lev Walkin082cadc2005-08-14 02:18:27 +00001444
1445/*** <<< FUNC-DECLS [OK-IntegerInRange1] >>> ***/
1446
1447extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange1;
1448asn_struct_free_f OK_IntegerInRange1_free;
1449asn_struct_print_f OK_IntegerInRange1_print;
1450asn_constr_check_f OK_IntegerInRange1_constraint;
1451ber_type_decoder_f OK_IntegerInRange1_decode_ber;
1452der_type_encoder_f OK_IntegerInRange1_encode_der;
1453xer_type_decoder_f OK_IntegerInRange1_decode_xer;
1454xer_type_encoder_f OK_IntegerInRange1_encode_xer;
1455
1456/*** <<< CODE [OK-IntegerInRange1] >>> ***/
1457
1458int
1459OK_IntegerInRange1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001460 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin082cadc2005-08-14 02:18:27 +00001461 long value;
1462
1463 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001464 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +00001465 "%s: value not given (%s:%d)",
1466 td->name, __FILE__, __LINE__);
1467 return -1;
1468 }
1469
Lev Walkinc3f0b892005-08-14 02:40:04 +00001470 value = *(const long *)sptr;
Lev Walkin082cadc2005-08-14 02:18:27 +00001471
1472 if((value >= -100 && value <= 100)) {
1473 /* Constraint check succeeded */
1474 return 0;
1475 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001476 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +00001477 "%s: constraint failed (%s:%d)",
1478 td->name, __FILE__, __LINE__);
1479 return -1;
1480 }
1481}
1482
1483/*
Lev Walkinc3f0b892005-08-14 02:40:04 +00001484 * This type is implemented using NativeInteger,
Lev Walkin082cadc2005-08-14 02:18:27 +00001485 * so here we adjust the DEF accordingly.
1486 */
1487static void
1488OK_IntegerInRange1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkinc3f0b892005-08-14 02:40:04 +00001489 td->free_struct = asn_DEF_NativeInteger.free_struct;
1490 td->print_struct = asn_DEF_NativeInteger.print_struct;
1491 td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
1492 td->der_encoder = asn_DEF_NativeInteger.der_encoder;
1493 td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
1494 td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001495 td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001496 td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001497 if(!td->per_constraints)
1498 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
Lev Walkinc3f0b892005-08-14 02:40:04 +00001499 td->elements = asn_DEF_NativeInteger.elements;
1500 td->elements_count = asn_DEF_NativeInteger.elements_count;
1501 td->specifics = asn_DEF_NativeInteger.specifics;
Lev Walkin082cadc2005-08-14 02:18:27 +00001502}
1503
1504void
1505OK_IntegerInRange1_free(asn_TYPE_descriptor_t *td,
1506 void *struct_ptr, int contents_only) {
1507 OK_IntegerInRange1_1_inherit_TYPE_descriptor(td);
1508 td->free_struct(td, struct_ptr, contents_only);
1509}
1510
1511int
1512OK_IntegerInRange1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1513 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1514 OK_IntegerInRange1_1_inherit_TYPE_descriptor(td);
1515 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1516}
1517
1518asn_dec_rval_t
1519OK_IntegerInRange1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1520 void **structure, const void *bufptr, size_t size, int tag_mode) {
1521 OK_IntegerInRange1_1_inherit_TYPE_descriptor(td);
1522 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1523}
1524
1525asn_enc_rval_t
1526OK_IntegerInRange1_encode_der(asn_TYPE_descriptor_t *td,
1527 void *structure, int tag_mode, ber_tlv_tag_t tag,
1528 asn_app_consume_bytes_f *cb, void *app_key) {
1529 OK_IntegerInRange1_1_inherit_TYPE_descriptor(td);
1530 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1531}
1532
1533asn_dec_rval_t
1534OK_IntegerInRange1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1535 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1536 OK_IntegerInRange1_1_inherit_TYPE_descriptor(td);
1537 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1538}
1539
1540asn_enc_rval_t
1541OK_IntegerInRange1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1542 int ilevel, enum xer_encoder_flags_e flags,
1543 asn_app_consume_bytes_f *cb, void *app_key) {
1544 OK_IntegerInRange1_1_inherit_TYPE_descriptor(td);
1545 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1546}
1547
1548
1549/*** <<< STAT-DEFS [OK-IntegerInRange1] >>> ***/
1550
Lev Walkin59b176e2005-11-26 11:25:14 +00001551static ber_tlv_tag_t asn_DEF_OK_IntegerInRange1_tags_1[] = {
Lev Walkin082cadc2005-08-14 02:18:27 +00001552 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
1553};
1554asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange1 = {
1555 "OK-IntegerInRange1",
1556 "OK-IntegerInRange1",
1557 OK_IntegerInRange1_free,
1558 OK_IntegerInRange1_print,
1559 OK_IntegerInRange1_constraint,
1560 OK_IntegerInRange1_decode_ber,
1561 OK_IntegerInRange1_encode_der,
1562 OK_IntegerInRange1_decode_xer,
1563 OK_IntegerInRange1_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001564 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin082cadc2005-08-14 02:18:27 +00001565 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001566 asn_DEF_OK_IntegerInRange1_tags_1,
1567 sizeof(asn_DEF_OK_IntegerInRange1_tags_1)
1568 /sizeof(asn_DEF_OK_IntegerInRange1_tags_1[0]), /* 1 */
1569 asn_DEF_OK_IntegerInRange1_tags_1, /* Same as above */
1570 sizeof(asn_DEF_OK_IntegerInRange1_tags_1)
1571 /sizeof(asn_DEF_OK_IntegerInRange1_tags_1[0]), /* 1 */
1572 0, /* No PER visible constraints */
Lev Walkin082cadc2005-08-14 02:18:27 +00001573 0, 0, /* No members */
1574 0 /* No specifics */
1575};
1576
1577
1578/*** <<< INCLUDES [OK-IntegerInRange2] >>> ***/
1579
Lev Walkinc3f0b892005-08-14 02:40:04 +00001580#include <NativeInteger.h>
Lev Walkin082cadc2005-08-14 02:18:27 +00001581
1582/*** <<< TYPE-DECLS [OK-IntegerInRange2] >>> ***/
1583
Lev Walkinc3f0b892005-08-14 02:40:04 +00001584typedef long OK_IntegerInRange2_t;
Lev Walkin082cadc2005-08-14 02:18:27 +00001585
1586/*** <<< FUNC-DECLS [OK-IntegerInRange2] >>> ***/
1587
1588extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange2;
1589asn_struct_free_f OK_IntegerInRange2_free;
1590asn_struct_print_f OK_IntegerInRange2_print;
1591asn_constr_check_f OK_IntegerInRange2_constraint;
1592ber_type_decoder_f OK_IntegerInRange2_decode_ber;
1593der_type_encoder_f OK_IntegerInRange2_encode_der;
1594xer_type_decoder_f OK_IntegerInRange2_decode_xer;
1595xer_type_encoder_f OK_IntegerInRange2_encode_xer;
1596
1597/*** <<< CODE [OK-IntegerInRange2] >>> ***/
1598
1599int
1600OK_IntegerInRange2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001601 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin082cadc2005-08-14 02:18:27 +00001602 long value;
1603
1604 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001605 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +00001606 "%s: value not given (%s:%d)",
1607 td->name, __FILE__, __LINE__);
1608 return -1;
1609 }
1610
Lev Walkinc3f0b892005-08-14 02:40:04 +00001611 value = *(const long *)sptr;
Lev Walkin082cadc2005-08-14 02:18:27 +00001612
1613 if(((value == -100) || (value == 100))) {
1614 /* Constraint check succeeded */
1615 return 0;
1616 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001617 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +00001618 "%s: constraint failed (%s:%d)",
1619 td->name, __FILE__, __LINE__);
1620 return -1;
1621 }
1622}
1623
1624/*
Lev Walkinc3f0b892005-08-14 02:40:04 +00001625 * This type is implemented using NativeInteger,
Lev Walkin082cadc2005-08-14 02:18:27 +00001626 * so here we adjust the DEF accordingly.
1627 */
1628static void
1629OK_IntegerInRange2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkinc3f0b892005-08-14 02:40:04 +00001630 td->free_struct = asn_DEF_NativeInteger.free_struct;
1631 td->print_struct = asn_DEF_NativeInteger.print_struct;
1632 td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
1633 td->der_encoder = asn_DEF_NativeInteger.der_encoder;
1634 td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
1635 td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001636 td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001637 td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001638 if(!td->per_constraints)
1639 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
Lev Walkinc3f0b892005-08-14 02:40:04 +00001640 td->elements = asn_DEF_NativeInteger.elements;
1641 td->elements_count = asn_DEF_NativeInteger.elements_count;
1642 td->specifics = asn_DEF_NativeInteger.specifics;
Lev Walkin082cadc2005-08-14 02:18:27 +00001643}
1644
1645void
1646OK_IntegerInRange2_free(asn_TYPE_descriptor_t *td,
1647 void *struct_ptr, int contents_only) {
1648 OK_IntegerInRange2_1_inherit_TYPE_descriptor(td);
1649 td->free_struct(td, struct_ptr, contents_only);
1650}
1651
1652int
1653OK_IntegerInRange2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1654 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1655 OK_IntegerInRange2_1_inherit_TYPE_descriptor(td);
1656 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1657}
1658
1659asn_dec_rval_t
1660OK_IntegerInRange2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1661 void **structure, const void *bufptr, size_t size, int tag_mode) {
1662 OK_IntegerInRange2_1_inherit_TYPE_descriptor(td);
1663 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1664}
1665
1666asn_enc_rval_t
1667OK_IntegerInRange2_encode_der(asn_TYPE_descriptor_t *td,
1668 void *structure, int tag_mode, ber_tlv_tag_t tag,
1669 asn_app_consume_bytes_f *cb, void *app_key) {
1670 OK_IntegerInRange2_1_inherit_TYPE_descriptor(td);
1671 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1672}
1673
1674asn_dec_rval_t
1675OK_IntegerInRange2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1676 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1677 OK_IntegerInRange2_1_inherit_TYPE_descriptor(td);
1678 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1679}
1680
1681asn_enc_rval_t
1682OK_IntegerInRange2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1683 int ilevel, enum xer_encoder_flags_e flags,
1684 asn_app_consume_bytes_f *cb, void *app_key) {
1685 OK_IntegerInRange2_1_inherit_TYPE_descriptor(td);
1686 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1687}
1688
1689
1690/*** <<< STAT-DEFS [OK-IntegerInRange2] >>> ***/
1691
Lev Walkin59b176e2005-11-26 11:25:14 +00001692static ber_tlv_tag_t asn_DEF_OK_IntegerInRange2_tags_1[] = {
Lev Walkin082cadc2005-08-14 02:18:27 +00001693 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
1694};
1695asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange2 = {
1696 "OK-IntegerInRange2",
1697 "OK-IntegerInRange2",
1698 OK_IntegerInRange2_free,
1699 OK_IntegerInRange2_print,
1700 OK_IntegerInRange2_constraint,
1701 OK_IntegerInRange2_decode_ber,
1702 OK_IntegerInRange2_encode_der,
1703 OK_IntegerInRange2_decode_xer,
1704 OK_IntegerInRange2_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001705 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin082cadc2005-08-14 02:18:27 +00001706 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001707 asn_DEF_OK_IntegerInRange2_tags_1,
1708 sizeof(asn_DEF_OK_IntegerInRange2_tags_1)
1709 /sizeof(asn_DEF_OK_IntegerInRange2_tags_1[0]), /* 1 */
1710 asn_DEF_OK_IntegerInRange2_tags_1, /* Same as above */
1711 sizeof(asn_DEF_OK_IntegerInRange2_tags_1)
1712 /sizeof(asn_DEF_OK_IntegerInRange2_tags_1[0]), /* 1 */
1713 0, /* No PER visible constraints */
Lev Walkin082cadc2005-08-14 02:18:27 +00001714 0, 0, /* No members */
1715 0 /* No specifics */
1716};
1717
1718
1719/*** <<< INCLUDES [OK-IntegerInRange3] >>> ***/
1720
Lev Walkinc3f0b892005-08-14 02:40:04 +00001721#include <NativeInteger.h>
Lev Walkin082cadc2005-08-14 02:18:27 +00001722
1723/*** <<< TYPE-DECLS [OK-IntegerInRange3] >>> ***/
1724
Lev Walkinc3f0b892005-08-14 02:40:04 +00001725typedef long OK_IntegerInRange3_t;
Lev Walkin082cadc2005-08-14 02:18:27 +00001726
1727/*** <<< FUNC-DECLS [OK-IntegerInRange3] >>> ***/
1728
1729extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange3;
1730asn_struct_free_f OK_IntegerInRange3_free;
1731asn_struct_print_f OK_IntegerInRange3_print;
1732asn_constr_check_f OK_IntegerInRange3_constraint;
1733ber_type_decoder_f OK_IntegerInRange3_decode_ber;
1734der_type_encoder_f OK_IntegerInRange3_encode_der;
1735xer_type_decoder_f OK_IntegerInRange3_decode_xer;
1736xer_type_encoder_f OK_IntegerInRange3_encode_xer;
1737
1738/*** <<< CODE [OK-IntegerInRange3] >>> ***/
1739
1740int
1741OK_IntegerInRange3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001742 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin082cadc2005-08-14 02:18:27 +00001743 long value;
1744
1745 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001746 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +00001747 "%s: value not given (%s:%d)",
1748 td->name, __FILE__, __LINE__);
1749 return -1;
1750 }
1751
Lev Walkinc3f0b892005-08-14 02:40:04 +00001752 value = *(const long *)sptr;
Lev Walkin082cadc2005-08-14 02:18:27 +00001753
Lev Walkin63b41262007-11-06 01:48:46 +00001754 if((value >= (-2147483647L - 1) && value <= 2147483647)) {
Lev Walkin082cadc2005-08-14 02:18:27 +00001755 /* Constraint check succeeded */
1756 return 0;
1757 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001758 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +00001759 "%s: constraint failed (%s:%d)",
1760 td->name, __FILE__, __LINE__);
1761 return -1;
1762 }
1763}
1764
1765/*
Lev Walkinc3f0b892005-08-14 02:40:04 +00001766 * This type is implemented using NativeInteger,
Lev Walkin082cadc2005-08-14 02:18:27 +00001767 * so here we adjust the DEF accordingly.
1768 */
1769static void
1770OK_IntegerInRange3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkinc3f0b892005-08-14 02:40:04 +00001771 td->free_struct = asn_DEF_NativeInteger.free_struct;
1772 td->print_struct = asn_DEF_NativeInteger.print_struct;
1773 td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
1774 td->der_encoder = asn_DEF_NativeInteger.der_encoder;
1775 td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
1776 td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001777 td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001778 td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001779 if(!td->per_constraints)
1780 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
Lev Walkinc3f0b892005-08-14 02:40:04 +00001781 td->elements = asn_DEF_NativeInteger.elements;
1782 td->elements_count = asn_DEF_NativeInteger.elements_count;
1783 td->specifics = asn_DEF_NativeInteger.specifics;
Lev Walkin082cadc2005-08-14 02:18:27 +00001784}
1785
1786void
1787OK_IntegerInRange3_free(asn_TYPE_descriptor_t *td,
1788 void *struct_ptr, int contents_only) {
1789 OK_IntegerInRange3_1_inherit_TYPE_descriptor(td);
1790 td->free_struct(td, struct_ptr, contents_only);
1791}
1792
1793int
1794OK_IntegerInRange3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1795 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1796 OK_IntegerInRange3_1_inherit_TYPE_descriptor(td);
1797 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1798}
1799
1800asn_dec_rval_t
1801OK_IntegerInRange3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1802 void **structure, const void *bufptr, size_t size, int tag_mode) {
1803 OK_IntegerInRange3_1_inherit_TYPE_descriptor(td);
1804 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1805}
1806
1807asn_enc_rval_t
1808OK_IntegerInRange3_encode_der(asn_TYPE_descriptor_t *td,
1809 void *structure, int tag_mode, ber_tlv_tag_t tag,
1810 asn_app_consume_bytes_f *cb, void *app_key) {
1811 OK_IntegerInRange3_1_inherit_TYPE_descriptor(td);
1812 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1813}
1814
1815asn_dec_rval_t
1816OK_IntegerInRange3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1817 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1818 OK_IntegerInRange3_1_inherit_TYPE_descriptor(td);
1819 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1820}
1821
1822asn_enc_rval_t
1823OK_IntegerInRange3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1824 int ilevel, enum xer_encoder_flags_e flags,
1825 asn_app_consume_bytes_f *cb, void *app_key) {
1826 OK_IntegerInRange3_1_inherit_TYPE_descriptor(td);
1827 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1828}
1829
1830
1831/*** <<< STAT-DEFS [OK-IntegerInRange3] >>> ***/
1832
Lev Walkin59b176e2005-11-26 11:25:14 +00001833static ber_tlv_tag_t asn_DEF_OK_IntegerInRange3_tags_1[] = {
Lev Walkin082cadc2005-08-14 02:18:27 +00001834 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
1835};
1836asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange3 = {
1837 "OK-IntegerInRange3",
1838 "OK-IntegerInRange3",
1839 OK_IntegerInRange3_free,
1840 OK_IntegerInRange3_print,
1841 OK_IntegerInRange3_constraint,
1842 OK_IntegerInRange3_decode_ber,
1843 OK_IntegerInRange3_encode_der,
1844 OK_IntegerInRange3_decode_xer,
1845 OK_IntegerInRange3_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001846 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin082cadc2005-08-14 02:18:27 +00001847 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001848 asn_DEF_OK_IntegerInRange3_tags_1,
1849 sizeof(asn_DEF_OK_IntegerInRange3_tags_1)
1850 /sizeof(asn_DEF_OK_IntegerInRange3_tags_1[0]), /* 1 */
1851 asn_DEF_OK_IntegerInRange3_tags_1, /* Same as above */
1852 sizeof(asn_DEF_OK_IntegerInRange3_tags_1)
1853 /sizeof(asn_DEF_OK_IntegerInRange3_tags_1[0]), /* 1 */
1854 0, /* No PER visible constraints */
Lev Walkin082cadc2005-08-14 02:18:27 +00001855 0, 0, /* No members */
1856 0 /* No specifics */
1857};
1858
1859
1860/*** <<< INCLUDES [OK-IntegerInRange4] >>> ***/
1861
Lev Walkinc3f0b892005-08-14 02:40:04 +00001862#include <NativeInteger.h>
Lev Walkin082cadc2005-08-14 02:18:27 +00001863
1864/*** <<< TYPE-DECLS [OK-IntegerInRange4] >>> ***/
1865
Lev Walkinc3f0b892005-08-14 02:40:04 +00001866typedef long OK_IntegerInRange4_t;
Lev Walkin082cadc2005-08-14 02:18:27 +00001867
1868/*** <<< FUNC-DECLS [OK-IntegerInRange4] >>> ***/
1869
1870extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4;
1871asn_struct_free_f OK_IntegerInRange4_free;
1872asn_struct_print_f OK_IntegerInRange4_print;
1873asn_constr_check_f OK_IntegerInRange4_constraint;
1874ber_type_decoder_f OK_IntegerInRange4_decode_ber;
1875der_type_encoder_f OK_IntegerInRange4_encode_der;
1876xer_type_decoder_f OK_IntegerInRange4_decode_xer;
1877xer_type_encoder_f OK_IntegerInRange4_encode_xer;
1878
1879/*** <<< CODE [OK-IntegerInRange4] >>> ***/
1880
1881int
1882OK_IntegerInRange4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00001883 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin082cadc2005-08-14 02:18:27 +00001884 long value;
1885
1886 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001887 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +00001888 "%s: value not given (%s:%d)",
1889 td->name, __FILE__, __LINE__);
1890 return -1;
1891 }
1892
Lev Walkinc3f0b892005-08-14 02:40:04 +00001893 value = *(const long *)sptr;
Lev Walkin082cadc2005-08-14 02:18:27 +00001894
Lev Walkin63b41262007-11-06 01:48:46 +00001895 if(((value == (-2147483647L - 1)) || (value == 2147483647))) {
Lev Walkin082cadc2005-08-14 02:18:27 +00001896 /* Constraint check succeeded */
1897 return 0;
1898 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00001899 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +00001900 "%s: constraint failed (%s:%d)",
1901 td->name, __FILE__, __LINE__);
1902 return -1;
1903 }
1904}
1905
1906/*
Lev Walkinc3f0b892005-08-14 02:40:04 +00001907 * This type is implemented using NativeInteger,
Lev Walkin082cadc2005-08-14 02:18:27 +00001908 * so here we adjust the DEF accordingly.
1909 */
1910static void
1911OK_IntegerInRange4_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkinc3f0b892005-08-14 02:40:04 +00001912 td->free_struct = asn_DEF_NativeInteger.free_struct;
1913 td->print_struct = asn_DEF_NativeInteger.print_struct;
1914 td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
1915 td->der_encoder = asn_DEF_NativeInteger.der_encoder;
1916 td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
1917 td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001918 td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001919 td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00001920 if(!td->per_constraints)
1921 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
Lev Walkinc3f0b892005-08-14 02:40:04 +00001922 td->elements = asn_DEF_NativeInteger.elements;
1923 td->elements_count = asn_DEF_NativeInteger.elements_count;
1924 td->specifics = asn_DEF_NativeInteger.specifics;
Lev Walkin082cadc2005-08-14 02:18:27 +00001925}
1926
1927void
1928OK_IntegerInRange4_free(asn_TYPE_descriptor_t *td,
1929 void *struct_ptr, int contents_only) {
1930 OK_IntegerInRange4_1_inherit_TYPE_descriptor(td);
1931 td->free_struct(td, struct_ptr, contents_only);
1932}
1933
1934int
1935OK_IntegerInRange4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
1936 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
1937 OK_IntegerInRange4_1_inherit_TYPE_descriptor(td);
1938 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1939}
1940
1941asn_dec_rval_t
1942OK_IntegerInRange4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1943 void **structure, const void *bufptr, size_t size, int tag_mode) {
1944 OK_IntegerInRange4_1_inherit_TYPE_descriptor(td);
1945 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
1946}
1947
1948asn_enc_rval_t
1949OK_IntegerInRange4_encode_der(asn_TYPE_descriptor_t *td,
1950 void *structure, int tag_mode, ber_tlv_tag_t tag,
1951 asn_app_consume_bytes_f *cb, void *app_key) {
1952 OK_IntegerInRange4_1_inherit_TYPE_descriptor(td);
1953 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1954}
1955
1956asn_dec_rval_t
1957OK_IntegerInRange4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1958 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
1959 OK_IntegerInRange4_1_inherit_TYPE_descriptor(td);
1960 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1961}
1962
1963asn_enc_rval_t
1964OK_IntegerInRange4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
1965 int ilevel, enum xer_encoder_flags_e flags,
1966 asn_app_consume_bytes_f *cb, void *app_key) {
1967 OK_IntegerInRange4_1_inherit_TYPE_descriptor(td);
1968 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
1969}
1970
1971
1972/*** <<< STAT-DEFS [OK-IntegerInRange4] >>> ***/
1973
Lev Walkin59b176e2005-11-26 11:25:14 +00001974static ber_tlv_tag_t asn_DEF_OK_IntegerInRange4_tags_1[] = {
Lev Walkin082cadc2005-08-14 02:18:27 +00001975 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
1976};
1977asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4 = {
1978 "OK-IntegerInRange4",
1979 "OK-IntegerInRange4",
1980 OK_IntegerInRange4_free,
1981 OK_IntegerInRange4_print,
1982 OK_IntegerInRange4_constraint,
1983 OK_IntegerInRange4_decode_ber,
1984 OK_IntegerInRange4_encode_der,
1985 OK_IntegerInRange4_decode_xer,
1986 OK_IntegerInRange4_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00001987 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin082cadc2005-08-14 02:18:27 +00001988 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00001989 asn_DEF_OK_IntegerInRange4_tags_1,
1990 sizeof(asn_DEF_OK_IntegerInRange4_tags_1)
1991 /sizeof(asn_DEF_OK_IntegerInRange4_tags_1[0]), /* 1 */
1992 asn_DEF_OK_IntegerInRange4_tags_1, /* Same as above */
1993 sizeof(asn_DEF_OK_IntegerInRange4_tags_1)
1994 /sizeof(asn_DEF_OK_IntegerInRange4_tags_1[0]), /* 1 */
1995 0, /* No PER visible constraints */
Lev Walkin082cadc2005-08-14 02:18:27 +00001996 0, 0, /* No members */
1997 0 /* No specifics */
1998};
1999
2000
2001/*** <<< INCLUDES [OK-IntegerInRange5] >>> ***/
2002
2003#include <INTEGER.h>
2004
2005/*** <<< TYPE-DECLS [OK-IntegerInRange5] >>> ***/
2006
2007typedef INTEGER_t OK_IntegerInRange5_t;
2008
2009/*** <<< FUNC-DECLS [OK-IntegerInRange5] >>> ***/
2010
2011extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange5;
2012asn_struct_free_f OK_IntegerInRange5_free;
2013asn_struct_print_f OK_IntegerInRange5_print;
2014asn_constr_check_f OK_IntegerInRange5_constraint;
2015ber_type_decoder_f OK_IntegerInRange5_decode_ber;
2016der_type_encoder_f OK_IntegerInRange5_encode_der;
2017xer_type_decoder_f OK_IntegerInRange5_decode_xer;
2018xer_type_encoder_f OK_IntegerInRange5_encode_xer;
2019
2020/*** <<< CODE [OK-IntegerInRange5] >>> ***/
2021
2022int
2023OK_IntegerInRange5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002024 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin082cadc2005-08-14 02:18:27 +00002025 const INTEGER_t *st = (const INTEGER_t *)sptr;
2026 long value;
2027
2028 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002029 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +00002030 "%s: value not given (%s:%d)",
2031 td->name, __FILE__, __LINE__);
2032 return -1;
2033 }
2034
2035 if(asn_INTEGER2long(st, &value)) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002036 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +00002037 "%s: value too large (%s:%d)",
2038 td->name, __FILE__, __LINE__);
2039 return -1;
2040 }
2041
Lev Walkin63b41262007-11-06 01:48:46 +00002042 if(((value == (-2147483647L - 1)) || (value == 2147483647))) {
Lev Walkin082cadc2005-08-14 02:18:27 +00002043 /* Constraint check succeeded */
2044 return 0;
2045 } else {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002046 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkin082cadc2005-08-14 02:18:27 +00002047 "%s: constraint failed (%s:%d)",
2048 td->name, __FILE__, __LINE__);
2049 return -1;
2050 }
2051}
2052
2053/*
2054 * This type is implemented using INTEGER,
2055 * so here we adjust the DEF accordingly.
2056 */
2057static void
2058OK_IntegerInRange5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2059 td->free_struct = asn_DEF_INTEGER.free_struct;
2060 td->print_struct = asn_DEF_INTEGER.print_struct;
2061 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
2062 td->der_encoder = asn_DEF_INTEGER.der_encoder;
2063 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
2064 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002065 td->uper_decoder = asn_DEF_INTEGER.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002066 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002067 if(!td->per_constraints)
2068 td->per_constraints = asn_DEF_INTEGER.per_constraints;
Lev Walkin082cadc2005-08-14 02:18:27 +00002069 td->elements = asn_DEF_INTEGER.elements;
2070 td->elements_count = asn_DEF_INTEGER.elements_count;
2071 td->specifics = asn_DEF_INTEGER.specifics;
2072}
2073
2074void
2075OK_IntegerInRange5_free(asn_TYPE_descriptor_t *td,
2076 void *struct_ptr, int contents_only) {
2077 OK_IntegerInRange5_1_inherit_TYPE_descriptor(td);
2078 td->free_struct(td, struct_ptr, contents_only);
2079}
2080
2081int
2082OK_IntegerInRange5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2083 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2084 OK_IntegerInRange5_1_inherit_TYPE_descriptor(td);
2085 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2086}
2087
2088asn_dec_rval_t
2089OK_IntegerInRange5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2090 void **structure, const void *bufptr, size_t size, int tag_mode) {
2091 OK_IntegerInRange5_1_inherit_TYPE_descriptor(td);
2092 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2093}
2094
2095asn_enc_rval_t
2096OK_IntegerInRange5_encode_der(asn_TYPE_descriptor_t *td,
2097 void *structure, int tag_mode, ber_tlv_tag_t tag,
2098 asn_app_consume_bytes_f *cb, void *app_key) {
2099 OK_IntegerInRange5_1_inherit_TYPE_descriptor(td);
2100 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2101}
2102
2103asn_dec_rval_t
2104OK_IntegerInRange5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2105 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2106 OK_IntegerInRange5_1_inherit_TYPE_descriptor(td);
2107 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2108}
2109
2110asn_enc_rval_t
2111OK_IntegerInRange5_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2112 int ilevel, enum xer_encoder_flags_e flags,
2113 asn_app_consume_bytes_f *cb, void *app_key) {
2114 OK_IntegerInRange5_1_inherit_TYPE_descriptor(td);
2115 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2116}
2117
2118
2119/*** <<< STAT-DEFS [OK-IntegerInRange5] >>> ***/
2120
Lev Walkin59b176e2005-11-26 11:25:14 +00002121static ber_tlv_tag_t asn_DEF_OK_IntegerInRange5_tags_1[] = {
Lev Walkin082cadc2005-08-14 02:18:27 +00002122 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
2123};
2124asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange5 = {
2125 "OK-IntegerInRange5",
2126 "OK-IntegerInRange5",
2127 OK_IntegerInRange5_free,
2128 OK_IntegerInRange5_print,
2129 OK_IntegerInRange5_constraint,
2130 OK_IntegerInRange5_decode_ber,
2131 OK_IntegerInRange5_encode_der,
2132 OK_IntegerInRange5_decode_xer,
2133 OK_IntegerInRange5_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002134 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin082cadc2005-08-14 02:18:27 +00002135 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00002136 asn_DEF_OK_IntegerInRange5_tags_1,
2137 sizeof(asn_DEF_OK_IntegerInRange5_tags_1)
2138 /sizeof(asn_DEF_OK_IntegerInRange5_tags_1[0]), /* 1 */
2139 asn_DEF_OK_IntegerInRange5_tags_1, /* Same as above */
2140 sizeof(asn_DEF_OK_IntegerInRange5_tags_1)
2141 /sizeof(asn_DEF_OK_IntegerInRange5_tags_1[0]), /* 1 */
2142 0, /* No PER visible constraints */
Lev Walkin082cadc2005-08-14 02:18:27 +00002143 0, 0, /* No members */
2144 0 /* No specifics */
2145};
2146
Lev Walkinc3f0b892005-08-14 02:40:04 +00002147
Lev Walkinfee6f712005-08-27 03:13:51 +00002148/*** <<< INCLUDES [NO-IntegerInRange6] >>> ***/
2149
Lev Walkin8bb57a22007-12-03 13:41:36 +00002150#include <NativeInteger.h>
Lev Walkinfee6f712005-08-27 03:13:51 +00002151
2152/*** <<< TYPE-DECLS [NO-IntegerInRange6] >>> ***/
2153
Lev Walkin8bb57a22007-12-03 13:41:36 +00002154typedef unsigned long NO_IntegerInRange6_t;
Lev Walkinfee6f712005-08-27 03:13:51 +00002155
2156/*** <<< FUNC-DECLS [NO-IntegerInRange6] >>> ***/
2157
2158extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6;
2159asn_struct_free_f NO_IntegerInRange6_free;
2160asn_struct_print_f NO_IntegerInRange6_print;
2161asn_constr_check_f NO_IntegerInRange6_constraint;
2162ber_type_decoder_f NO_IntegerInRange6_decode_ber;
2163der_type_encoder_f NO_IntegerInRange6_encode_der;
2164xer_type_decoder_f NO_IntegerInRange6_decode_xer;
2165xer_type_encoder_f NO_IntegerInRange6_encode_xer;
2166
2167/*** <<< CODE [NO-IntegerInRange6] >>> ***/
2168
2169int
2170NO_IntegerInRange6_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002171 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8bb57a22007-12-03 13:41:36 +00002172 unsigned long value;
Lev Walkinfee6f712005-08-27 03:13:51 +00002173
2174 if(!sptr) {
Lev Walkin739d9bf2006-07-13 13:28:32 +00002175 _ASN_CTFAIL(app_key, td, sptr,
Lev Walkinfee6f712005-08-27 03:13:51 +00002176 "%s: value not given (%s:%d)",
2177 td->name, __FILE__, __LINE__);
2178 return -1;
2179 }
2180
Lev Walkin8bb57a22007-12-03 13:41:36 +00002181 value = *(const unsigned long *)sptr;
Lev Walkinfee6f712005-08-27 03:13:51 +00002182
Lev Walkin8bb57a22007-12-03 13:41:36 +00002183 /* Constraint check succeeded */
2184 return 0;
Lev Walkinfee6f712005-08-27 03:13:51 +00002185}
2186
2187/*
Lev Walkin8bb57a22007-12-03 13:41:36 +00002188 * This type is implemented using NativeInteger,
Lev Walkinfee6f712005-08-27 03:13:51 +00002189 * so here we adjust the DEF accordingly.
2190 */
2191static void
2192NO_IntegerInRange6_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin8bb57a22007-12-03 13:41:36 +00002193 td->free_struct = asn_DEF_NativeInteger.free_struct;
2194 td->print_struct = asn_DEF_NativeInteger.print_struct;
2195 td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
2196 td->der_encoder = asn_DEF_NativeInteger.der_encoder;
2197 td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
2198 td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
2199 td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
2200 td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002201 if(!td->per_constraints)
Lev Walkin8bb57a22007-12-03 13:41:36 +00002202 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
2203 td->elements = asn_DEF_NativeInteger.elements;
2204 td->elements_count = asn_DEF_NativeInteger.elements_count;
2205 /* td->specifics = asn_DEF_NativeInteger.specifics; // Defined explicitly */
Lev Walkinfee6f712005-08-27 03:13:51 +00002206}
2207
2208void
2209NO_IntegerInRange6_free(asn_TYPE_descriptor_t *td,
2210 void *struct_ptr, int contents_only) {
2211 NO_IntegerInRange6_1_inherit_TYPE_descriptor(td);
2212 td->free_struct(td, struct_ptr, contents_only);
2213}
2214
2215int
2216NO_IntegerInRange6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2217 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2218 NO_IntegerInRange6_1_inherit_TYPE_descriptor(td);
2219 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2220}
2221
2222asn_dec_rval_t
2223NO_IntegerInRange6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2224 void **structure, const void *bufptr, size_t size, int tag_mode) {
2225 NO_IntegerInRange6_1_inherit_TYPE_descriptor(td);
2226 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2227}
2228
2229asn_enc_rval_t
2230NO_IntegerInRange6_encode_der(asn_TYPE_descriptor_t *td,
2231 void *structure, int tag_mode, ber_tlv_tag_t tag,
2232 asn_app_consume_bytes_f *cb, void *app_key) {
2233 NO_IntegerInRange6_1_inherit_TYPE_descriptor(td);
2234 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2235}
2236
2237asn_dec_rval_t
2238NO_IntegerInRange6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2239 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2240 NO_IntegerInRange6_1_inherit_TYPE_descriptor(td);
2241 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2242}
2243
2244asn_enc_rval_t
2245NO_IntegerInRange6_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2246 int ilevel, enum xer_encoder_flags_e flags,
2247 asn_app_consume_bytes_f *cb, void *app_key) {
2248 NO_IntegerInRange6_1_inherit_TYPE_descriptor(td);
2249 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2250}
2251
2252
2253/*** <<< STAT-DEFS [NO-IntegerInRange6] >>> ***/
2254
Lev Walkin8bb57a22007-12-03 13:41:36 +00002255static asn_INTEGER_specifics_t asn_SPC_NO_IntegerInRange6_specs_1 = {
2256 0, 0, 0, 0, 0,
2257 0, /* Native long size */
2258 1 /* Unsigned representation */
2259};
Lev Walkin59b176e2005-11-26 11:25:14 +00002260static ber_tlv_tag_t asn_DEF_NO_IntegerInRange6_tags_1[] = {
Lev Walkinfee6f712005-08-27 03:13:51 +00002261 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
2262};
2263asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6 = {
2264 "NO-IntegerInRange6",
2265 "NO-IntegerInRange6",
2266 NO_IntegerInRange6_free,
2267 NO_IntegerInRange6_print,
2268 NO_IntegerInRange6_constraint,
2269 NO_IntegerInRange6_decode_ber,
2270 NO_IntegerInRange6_encode_der,
2271 NO_IntegerInRange6_decode_xer,
2272 NO_IntegerInRange6_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002273 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinfee6f712005-08-27 03:13:51 +00002274 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00002275 asn_DEF_NO_IntegerInRange6_tags_1,
2276 sizeof(asn_DEF_NO_IntegerInRange6_tags_1)
2277 /sizeof(asn_DEF_NO_IntegerInRange6_tags_1[0]), /* 1 */
2278 asn_DEF_NO_IntegerInRange6_tags_1, /* Same as above */
2279 sizeof(asn_DEF_NO_IntegerInRange6_tags_1)
2280 /sizeof(asn_DEF_NO_IntegerInRange6_tags_1[0]), /* 1 */
2281 0, /* No PER visible constraints */
Lev Walkinfee6f712005-08-27 03:13:51 +00002282 0, 0, /* No members */
Lev Walkin8bb57a22007-12-03 13:41:36 +00002283 &asn_SPC_NO_IntegerInRange6_specs_1 /* Additional specs */
Lev Walkinfee6f712005-08-27 03:13:51 +00002284};
2285
2286
Lev Walkinc3f0b892005-08-14 02:40:04 +00002287/*** <<< INCLUDES [CN-IntegerEnumerated1] >>> ***/
2288
2289#include <INTEGER.h>
2290
2291/*** <<< DEPS [CN-IntegerEnumerated1] >>> ***/
2292
2293typedef enum CN_IntegerEnumerated1 {
2294 CN_IntegerEnumerated1_a = 1,
2295 CN_IntegerEnumerated1_b = 2
Lev Walkin171487e2006-03-21 07:25:18 +00002296} e_CN_IntegerEnumerated1;
Lev Walkinc3f0b892005-08-14 02:40:04 +00002297
2298/*** <<< TYPE-DECLS [CN-IntegerEnumerated1] >>> ***/
2299
2300typedef INTEGER_t CN_IntegerEnumerated1_t;
2301
2302/*** <<< FUNC-DECLS [CN-IntegerEnumerated1] >>> ***/
2303
2304extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1;
2305asn_struct_free_f CN_IntegerEnumerated1_free;
2306asn_struct_print_f CN_IntegerEnumerated1_print;
2307asn_constr_check_f CN_IntegerEnumerated1_constraint;
2308ber_type_decoder_f CN_IntegerEnumerated1_decode_ber;
2309der_type_encoder_f CN_IntegerEnumerated1_encode_der;
2310xer_type_decoder_f CN_IntegerEnumerated1_decode_xer;
2311xer_type_encoder_f CN_IntegerEnumerated1_encode_xer;
2312
2313/*** <<< CODE [CN-IntegerEnumerated1] >>> ***/
2314
2315int
2316CN_IntegerEnumerated1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002317 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkinc3f0b892005-08-14 02:40:04 +00002318 /* Replace with underlying type checker */
2319 td->check_constraints = asn_DEF_INTEGER.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00002320 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkinc3f0b892005-08-14 02:40:04 +00002321}
2322
2323/*
2324 * This type is implemented using INTEGER,
2325 * so here we adjust the DEF accordingly.
2326 */
2327static void
2328CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2329 td->free_struct = asn_DEF_INTEGER.free_struct;
2330 td->print_struct = asn_DEF_INTEGER.print_struct;
2331 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
2332 td->der_encoder = asn_DEF_INTEGER.der_encoder;
2333 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
2334 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002335 td->uper_decoder = asn_DEF_INTEGER.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002336 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002337 if(!td->per_constraints)
2338 td->per_constraints = asn_DEF_INTEGER.per_constraints;
Lev Walkinc3f0b892005-08-14 02:40:04 +00002339 td->elements = asn_DEF_INTEGER.elements;
2340 td->elements_count = asn_DEF_INTEGER.elements_count;
2341 td->specifics = asn_DEF_INTEGER.specifics;
2342}
2343
2344void
2345CN_IntegerEnumerated1_free(asn_TYPE_descriptor_t *td,
2346 void *struct_ptr, int contents_only) {
2347 CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td);
2348 td->free_struct(td, struct_ptr, contents_only);
2349}
2350
2351int
2352CN_IntegerEnumerated1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2353 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2354 CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td);
2355 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2356}
2357
2358asn_dec_rval_t
2359CN_IntegerEnumerated1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2360 void **structure, const void *bufptr, size_t size, int tag_mode) {
2361 CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td);
2362 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2363}
2364
2365asn_enc_rval_t
2366CN_IntegerEnumerated1_encode_der(asn_TYPE_descriptor_t *td,
2367 void *structure, int tag_mode, ber_tlv_tag_t tag,
2368 asn_app_consume_bytes_f *cb, void *app_key) {
2369 CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td);
2370 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2371}
2372
2373asn_dec_rval_t
2374CN_IntegerEnumerated1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2375 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2376 CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td);
2377 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2378}
2379
2380asn_enc_rval_t
2381CN_IntegerEnumerated1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2382 int ilevel, enum xer_encoder_flags_e flags,
2383 asn_app_consume_bytes_f *cb, void *app_key) {
2384 CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(td);
2385 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2386}
2387
2388
2389/*** <<< STAT-DEFS [CN-IntegerEnumerated1] >>> ***/
2390
Lev Walkin59b176e2005-11-26 11:25:14 +00002391static ber_tlv_tag_t asn_DEF_CN_IntegerEnumerated1_tags_1[] = {
Lev Walkinc3f0b892005-08-14 02:40:04 +00002392 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
2393};
2394asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1 = {
2395 "CN-IntegerEnumerated1",
2396 "CN-IntegerEnumerated1",
2397 CN_IntegerEnumerated1_free,
2398 CN_IntegerEnumerated1_print,
2399 CN_IntegerEnumerated1_constraint,
2400 CN_IntegerEnumerated1_decode_ber,
2401 CN_IntegerEnumerated1_encode_der,
2402 CN_IntegerEnumerated1_decode_xer,
2403 CN_IntegerEnumerated1_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002404 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinc3f0b892005-08-14 02:40:04 +00002405 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00002406 asn_DEF_CN_IntegerEnumerated1_tags_1,
2407 sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1)
2408 /sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1[0]), /* 1 */
2409 asn_DEF_CN_IntegerEnumerated1_tags_1, /* Same as above */
2410 sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1)
2411 /sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1[0]), /* 1 */
2412 0, /* No PER visible constraints */
Lev Walkinc3f0b892005-08-14 02:40:04 +00002413 0, 0, /* Defined elsewhere */
2414 0 /* No specifics */
2415};
2416
2417
2418/*** <<< INCLUDES [NO-IntegerEnumerated2] >>> ***/
2419
2420#include <INTEGER.h>
2421
2422/*** <<< DEPS [NO-IntegerEnumerated2] >>> ***/
2423
2424typedef enum NO_IntegerEnumerated2 {
2425 NO_IntegerEnumerated2_a = 1,
2426 NO_IntegerEnumerated2_b = 3000000000
Lev Walkin171487e2006-03-21 07:25:18 +00002427} e_NO_IntegerEnumerated2;
Lev Walkinc3f0b892005-08-14 02:40:04 +00002428
2429/*** <<< TYPE-DECLS [NO-IntegerEnumerated2] >>> ***/
2430
2431typedef INTEGER_t NO_IntegerEnumerated2_t;
2432
2433/*** <<< FUNC-DECLS [NO-IntegerEnumerated2] >>> ***/
2434
2435extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerEnumerated2;
2436asn_struct_free_f NO_IntegerEnumerated2_free;
2437asn_struct_print_f NO_IntegerEnumerated2_print;
2438asn_constr_check_f NO_IntegerEnumerated2_constraint;
2439ber_type_decoder_f NO_IntegerEnumerated2_decode_ber;
2440der_type_encoder_f NO_IntegerEnumerated2_encode_der;
2441xer_type_decoder_f NO_IntegerEnumerated2_decode_xer;
2442xer_type_encoder_f NO_IntegerEnumerated2_encode_xer;
2443
2444/*** <<< CODE [NO-IntegerEnumerated2] >>> ***/
2445
2446int
2447NO_IntegerEnumerated2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +00002448 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkinc3f0b892005-08-14 02:40:04 +00002449 /* Replace with underlying type checker */
2450 td->check_constraints = asn_DEF_INTEGER.check_constraints;
Lev Walkin1eded352006-07-13 11:19:01 +00002451 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkinc3f0b892005-08-14 02:40:04 +00002452}
2453
2454/*
2455 * This type is implemented using INTEGER,
2456 * so here we adjust the DEF accordingly.
2457 */
2458static void
2459NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
2460 td->free_struct = asn_DEF_INTEGER.free_struct;
2461 td->print_struct = asn_DEF_INTEGER.print_struct;
2462 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
2463 td->der_encoder = asn_DEF_INTEGER.der_encoder;
2464 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
2465 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002466 td->uper_decoder = asn_DEF_INTEGER.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002467 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
Lev Walkin59b176e2005-11-26 11:25:14 +00002468 if(!td->per_constraints)
2469 td->per_constraints = asn_DEF_INTEGER.per_constraints;
Lev Walkinc3f0b892005-08-14 02:40:04 +00002470 td->elements = asn_DEF_INTEGER.elements;
2471 td->elements_count = asn_DEF_INTEGER.elements_count;
2472 td->specifics = asn_DEF_INTEGER.specifics;
2473}
2474
2475void
2476NO_IntegerEnumerated2_free(asn_TYPE_descriptor_t *td,
2477 void *struct_ptr, int contents_only) {
2478 NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td);
2479 td->free_struct(td, struct_ptr, contents_only);
2480}
2481
2482int
2483NO_IntegerEnumerated2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2484 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
2485 NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td);
2486 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2487}
2488
2489asn_dec_rval_t
2490NO_IntegerEnumerated2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2491 void **structure, const void *bufptr, size_t size, int tag_mode) {
2492 NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td);
2493 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2494}
2495
2496asn_enc_rval_t
2497NO_IntegerEnumerated2_encode_der(asn_TYPE_descriptor_t *td,
2498 void *structure, int tag_mode, ber_tlv_tag_t tag,
2499 asn_app_consume_bytes_f *cb, void *app_key) {
2500 NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td);
2501 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2502}
2503
2504asn_dec_rval_t
2505NO_IntegerEnumerated2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2506 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
2507 NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td);
2508 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2509}
2510
2511asn_enc_rval_t
2512NO_IntegerEnumerated2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2513 int ilevel, enum xer_encoder_flags_e flags,
2514 asn_app_consume_bytes_f *cb, void *app_key) {
2515 NO_IntegerEnumerated2_1_inherit_TYPE_descriptor(td);
2516 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2517}
2518
2519
2520/*** <<< STAT-DEFS [NO-IntegerEnumerated2] >>> ***/
2521
Lev Walkin59b176e2005-11-26 11:25:14 +00002522static ber_tlv_tag_t asn_DEF_NO_IntegerEnumerated2_tags_1[] = {
Lev Walkinc3f0b892005-08-14 02:40:04 +00002523 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
2524};
2525asn_TYPE_descriptor_t asn_DEF_NO_IntegerEnumerated2 = {
2526 "NO-IntegerEnumerated2",
2527 "NO-IntegerEnumerated2",
2528 NO_IntegerEnumerated2_free,
2529 NO_IntegerEnumerated2_print,
2530 NO_IntegerEnumerated2_constraint,
2531 NO_IntegerEnumerated2_decode_ber,
2532 NO_IntegerEnumerated2_encode_der,
2533 NO_IntegerEnumerated2_decode_xer,
2534 NO_IntegerEnumerated2_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +00002535 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinc3f0b892005-08-14 02:40:04 +00002536 0, /* Use generic outmost tag fetcher */
Lev Walkin59b176e2005-11-26 11:25:14 +00002537 asn_DEF_NO_IntegerEnumerated2_tags_1,
2538 sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1)
2539 /sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1[0]), /* 1 */
2540 asn_DEF_NO_IntegerEnumerated2_tags_1, /* Same as above */
2541 sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1)
2542 /sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1[0]), /* 1 */
2543 0, /* No PER visible constraints */
Lev Walkinc3f0b892005-08-14 02:40:04 +00002544 0, 0, /* Defined elsewhere */
2545 0 /* No specifics */
2546};
2547