blob: 6242725a195be832b920dfe5993118f8c80ce987 [file] [log] [blame]
Lev Walkin171487e2006-03-21 07:25:18 +00001
2/*** <<< INCLUDES [MinMax] >>> ***/
3
4#include <INTEGER.h>
5
6/*** <<< TYPE-DECLS [MinMax] >>> ***/
7
8typedef INTEGER_t MinMax_16P0_t;
9
10/*** <<< FUNC-DECLS [MinMax] >>> ***/
11
12extern asn_TYPE_descriptor_t asn_DEF_MinMax_16P0;
13asn_struct_free_f MinMax_16P0_free;
14asn_struct_print_f MinMax_16P0_print;
15asn_constr_check_f MinMax_16P0_constraint;
16ber_type_decoder_f MinMax_16P0_decode_ber;
17der_type_encoder_f MinMax_16P0_encode_der;
18xer_type_decoder_f MinMax_16P0_decode_xer;
19xer_type_encoder_f MinMax_16P0_encode_xer;
20
21/*** <<< CODE [MinMax] >>> ***/
22
23int
24MinMax_16P0_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 Walkin171487e2006-03-21 07:25:18 +000026 const INTEGER_t *st = (const INTEGER_t *)sptr;
27 long value;
28
29 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -070030 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +000031 "%s: value not given (%s:%d)",
32 td->name, __FILE__, __LINE__);
33 return -1;
34 }
35
36 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -070037 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +000038 "%s: value too large (%s:%d)",
39 td->name, __FILE__, __LINE__);
40 return -1;
41 }
42
43 if((value >= 3)) {
44 /* Constraint check succeeded */
45 return 0;
46 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -070047 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +000048 "%s: constraint failed (%s:%d)",
49 td->name, __FILE__, __LINE__);
50 return -1;
51 }
52}
53
54/*
55 * This type is implemented using INTEGER,
56 * so here we adjust the DEF accordingly.
57 */
58static void
59MinMax_16P0_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
60 td->free_struct = asn_DEF_INTEGER.free_struct;
61 td->print_struct = asn_DEF_INTEGER.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -080062 td->check_constraints = asn_DEF_INTEGER.check_constraints;
Lev Walkin171487e2006-03-21 07:25:18 +000063 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
64 td->der_encoder = asn_DEF_INTEGER.der_encoder;
65 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
66 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
67 td->uper_decoder = asn_DEF_INTEGER.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +000068 td->uper_encoder = asn_DEF_INTEGER.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -070069 td->oer_decoder = asn_DEF_INTEGER.oer_decoder;
70 td->oer_encoder = asn_DEF_INTEGER.oer_encoder;
Lev Walkin171487e2006-03-21 07:25:18 +000071 if(!td->per_constraints)
72 td->per_constraints = asn_DEF_INTEGER.per_constraints;
73 td->elements = asn_DEF_INTEGER.elements;
74 td->elements_count = asn_DEF_INTEGER.elements_count;
75 td->specifics = asn_DEF_INTEGER.specifics;
76}
77
78void
79MinMax_16P0_free(asn_TYPE_descriptor_t *td,
80 void *struct_ptr, int contents_only) {
81 MinMax_16P0_1_inherit_TYPE_descriptor(td);
82 td->free_struct(td, struct_ptr, contents_only);
83}
84
85int
86MinMax_16P0_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
87 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
88 MinMax_16P0_1_inherit_TYPE_descriptor(td);
89 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
90}
91
92asn_dec_rval_t
93MinMax_16P0_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
94 void **structure, const void *bufptr, size_t size, int tag_mode) {
95 MinMax_16P0_1_inherit_TYPE_descriptor(td);
96 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
97}
98
99asn_enc_rval_t
100MinMax_16P0_encode_der(asn_TYPE_descriptor_t *td,
101 void *structure, int tag_mode, ber_tlv_tag_t tag,
102 asn_app_consume_bytes_f *cb, void *app_key) {
103 MinMax_16P0_1_inherit_TYPE_descriptor(td);
104 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
105}
106
107asn_dec_rval_t
108MinMax_16P0_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
109 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
110 MinMax_16P0_1_inherit_TYPE_descriptor(td);
111 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
112}
113
114asn_enc_rval_t
115MinMax_16P0_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
116 int ilevel, enum xer_encoder_flags_e flags,
117 asn_app_consume_bytes_f *cb, void *app_key) {
118 MinMax_16P0_1_inherit_TYPE_descriptor(td);
119 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
120}
121
122
123/*** <<< STAT-DEFS [MinMax] >>> ***/
124
Lev Walkina7591b52014-10-12 18:37:35 -0700125static const ber_tlv_tag_t asn_DEF_MinMax_16P0_tags_1[] = {
Lev Walkin171487e2006-03-21 07:25:18 +0000126 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
127};
128asn_TYPE_descriptor_t asn_DEF_MinMax_16P0 = {
129 "MinMax",
130 "MinMax",
131 MinMax_16P0_free,
132 MinMax_16P0_print,
133 MinMax_16P0_constraint,
134 MinMax_16P0_decode_ber,
135 MinMax_16P0_encode_der,
136 MinMax_16P0_decode_xer,
137 MinMax_16P0_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000138 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinba68c912017-07-06 07:52:39 -0700139 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +0000140 0, /* Use generic outmost tag fetcher */
141 asn_DEF_MinMax_16P0_tags_1,
142 sizeof(asn_DEF_MinMax_16P0_tags_1)
143 /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */
144 asn_DEF_MinMax_16P0_tags_1, /* Same as above */
145 sizeof(asn_DEF_MinMax_16P0_tags_1)
146 /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */
147 0, /* No PER visible constraints */
148 0, 0, /* No members */
149 0 /* No specifics */
150};
151
152
153/*** <<< INCLUDES [ThreePlus] >>> ***/
154
Lev Walkin22b5ed42006-09-13 02:51:20 +0000155#include "MinMax.h"
Lev Walkin171487e2006-03-21 07:25:18 +0000156
157/*** <<< TYPE-DECLS [ThreePlus] >>> ***/
158
159typedef MinMax_16P0_t ThreePlus_t;
160
161/*** <<< FUNC-DECLS [ThreePlus] >>> ***/
162
163extern asn_TYPE_descriptor_t asn_DEF_ThreePlus;
164asn_struct_free_f ThreePlus_free;
165asn_struct_print_f ThreePlus_print;
166asn_constr_check_f ThreePlus_constraint;
167ber_type_decoder_f ThreePlus_decode_ber;
168der_type_encoder_f ThreePlus_encode_der;
169xer_type_decoder_f ThreePlus_decode_xer;
170xer_type_encoder_f ThreePlus_encode_xer;
171
172/*** <<< CODE [ThreePlus] >>> ***/
173
174int
175ThreePlus_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000176 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin171487e2006-03-21 07:25:18 +0000177 const MinMax_16P0_t *st = (const MinMax_16P0_t *)sptr;
178 long value;
179
180 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700181 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000182 "%s: value not given (%s:%d)",
183 td->name, __FILE__, __LINE__);
184 return -1;
185 }
186
187 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700188 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000189 "%s: value too large (%s:%d)",
190 td->name, __FILE__, __LINE__);
191 return -1;
192 }
193
194 if((value >= 3)) {
195 /* Constraint check succeeded */
196 return 0;
197 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700198 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000199 "%s: constraint failed (%s:%d)",
200 td->name, __FILE__, __LINE__);
201 return -1;
202 }
203}
204
205/*
206 * This type is implemented using MinMax_16P0,
207 * so here we adjust the DEF accordingly.
208 */
209static void
210ThreePlus_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
211 td->free_struct = asn_DEF_MinMax_16P0.free_struct;
212 td->print_struct = asn_DEF_MinMax_16P0.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800213 td->check_constraints = asn_DEF_MinMax_16P0.check_constraints;
Lev Walkin171487e2006-03-21 07:25:18 +0000214 td->ber_decoder = asn_DEF_MinMax_16P0.ber_decoder;
215 td->der_encoder = asn_DEF_MinMax_16P0.der_encoder;
216 td->xer_decoder = asn_DEF_MinMax_16P0.xer_decoder;
217 td->xer_encoder = asn_DEF_MinMax_16P0.xer_encoder;
218 td->uper_decoder = asn_DEF_MinMax_16P0.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000219 td->uper_encoder = asn_DEF_MinMax_16P0.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700220 td->oer_decoder = asn_DEF_MinMax_16P0.oer_decoder;
221 td->oer_encoder = asn_DEF_MinMax_16P0.oer_encoder;
Lev Walkin171487e2006-03-21 07:25:18 +0000222 if(!td->per_constraints)
223 td->per_constraints = asn_DEF_MinMax_16P0.per_constraints;
224 td->elements = asn_DEF_MinMax_16P0.elements;
225 td->elements_count = asn_DEF_MinMax_16P0.elements_count;
226 td->specifics = asn_DEF_MinMax_16P0.specifics;
227}
228
229void
230ThreePlus_free(asn_TYPE_descriptor_t *td,
231 void *struct_ptr, int contents_only) {
232 ThreePlus_1_inherit_TYPE_descriptor(td);
233 td->free_struct(td, struct_ptr, contents_only);
234}
235
236int
237ThreePlus_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
238 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
239 ThreePlus_1_inherit_TYPE_descriptor(td);
240 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
241}
242
243asn_dec_rval_t
244ThreePlus_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
245 void **structure, const void *bufptr, size_t size, int tag_mode) {
246 ThreePlus_1_inherit_TYPE_descriptor(td);
247 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
248}
249
250asn_enc_rval_t
251ThreePlus_encode_der(asn_TYPE_descriptor_t *td,
252 void *structure, int tag_mode, ber_tlv_tag_t tag,
253 asn_app_consume_bytes_f *cb, void *app_key) {
254 ThreePlus_1_inherit_TYPE_descriptor(td);
255 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
256}
257
258asn_dec_rval_t
259ThreePlus_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
260 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
261 ThreePlus_1_inherit_TYPE_descriptor(td);
262 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
263}
264
265asn_enc_rval_t
266ThreePlus_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
267 int ilevel, enum xer_encoder_flags_e flags,
268 asn_app_consume_bytes_f *cb, void *app_key) {
269 ThreePlus_1_inherit_TYPE_descriptor(td);
270 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
271}
272
273
274/*** <<< STAT-DEFS [ThreePlus] >>> ***/
275
Lev Walkina7591b52014-10-12 18:37:35 -0700276static const ber_tlv_tag_t asn_DEF_ThreePlus_tags_1[] = {
Lev Walkin171487e2006-03-21 07:25:18 +0000277 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
278};
279asn_TYPE_descriptor_t asn_DEF_ThreePlus = {
280 "ThreePlus",
281 "ThreePlus",
282 ThreePlus_free,
283 ThreePlus_print,
284 ThreePlus_constraint,
285 ThreePlus_decode_ber,
286 ThreePlus_encode_der,
287 ThreePlus_decode_xer,
288 ThreePlus_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000289 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkinba68c912017-07-06 07:52:39 -0700290 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +0000291 0, /* Use generic outmost tag fetcher */
292 asn_DEF_ThreePlus_tags_1,
293 sizeof(asn_DEF_ThreePlus_tags_1)
294 /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */
295 asn_DEF_ThreePlus_tags_1, /* Same as above */
296 sizeof(asn_DEF_ThreePlus_tags_1)
297 /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */
298 0, /* No PER visible constraints */
299 0, 0, /* No members */
300 0 /* No specifics */
301};
302