blob: ca9ce532a50adeba7804278f129325051ecb287c [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 Walkinb33425f2017-07-14 14:59:52 +040071 if(!td->oer_constraints)
72 td->oer_constraints = asn_DEF_INTEGER.oer_constraints;
Lev Walkin171487e2006-03-21 07:25:18 +000073 if(!td->per_constraints)
74 td->per_constraints = asn_DEF_INTEGER.per_constraints;
75 td->elements = asn_DEF_INTEGER.elements;
76 td->elements_count = asn_DEF_INTEGER.elements_count;
77 td->specifics = asn_DEF_INTEGER.specifics;
78}
79
80void
81MinMax_16P0_free(asn_TYPE_descriptor_t *td,
82 void *struct_ptr, int contents_only) {
83 MinMax_16P0_1_inherit_TYPE_descriptor(td);
84 td->free_struct(td, struct_ptr, contents_only);
85}
86
87int
88MinMax_16P0_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
89 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
90 MinMax_16P0_1_inherit_TYPE_descriptor(td);
91 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
92}
93
94asn_dec_rval_t
95MinMax_16P0_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
96 void **structure, const void *bufptr, size_t size, int tag_mode) {
97 MinMax_16P0_1_inherit_TYPE_descriptor(td);
98 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
99}
100
101asn_enc_rval_t
102MinMax_16P0_encode_der(asn_TYPE_descriptor_t *td,
103 void *structure, int tag_mode, ber_tlv_tag_t tag,
104 asn_app_consume_bytes_f *cb, void *app_key) {
105 MinMax_16P0_1_inherit_TYPE_descriptor(td);
106 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
107}
108
109asn_dec_rval_t
110MinMax_16P0_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
111 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
112 MinMax_16P0_1_inherit_TYPE_descriptor(td);
113 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
114}
115
116asn_enc_rval_t
117MinMax_16P0_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
118 int ilevel, enum xer_encoder_flags_e flags,
119 asn_app_consume_bytes_f *cb, void *app_key) {
120 MinMax_16P0_1_inherit_TYPE_descriptor(td);
121 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
122}
123
124
125/*** <<< STAT-DEFS [MinMax] >>> ***/
126
Lev Walkina7591b52014-10-12 18:37:35 -0700127static const ber_tlv_tag_t asn_DEF_MinMax_16P0_tags_1[] = {
Lev Walkin171487e2006-03-21 07:25:18 +0000128 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
129};
130asn_TYPE_descriptor_t asn_DEF_MinMax_16P0 = {
131 "MinMax",
132 "MinMax",
133 MinMax_16P0_free,
134 MinMax_16P0_print,
135 MinMax_16P0_constraint,
136 MinMax_16P0_decode_ber,
137 MinMax_16P0_encode_der,
138 MinMax_16P0_decode_xer,
139 MinMax_16P0_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700140 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400141 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +0000142 0, /* Use generic outmost tag fetcher */
143 asn_DEF_MinMax_16P0_tags_1,
144 sizeof(asn_DEF_MinMax_16P0_tags_1)
145 /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */
146 asn_DEF_MinMax_16P0_tags_1, /* Same as above */
147 sizeof(asn_DEF_MinMax_16P0_tags_1)
148 /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400149 0, /* No OER visible constraints */
Lev Walkin171487e2006-03-21 07:25:18 +0000150 0, /* No PER visible constraints */
151 0, 0, /* No members */
152 0 /* No specifics */
153};
154
155
156/*** <<< INCLUDES [ThreePlus] >>> ***/
157
Lev Walkin22b5ed42006-09-13 02:51:20 +0000158#include "MinMax.h"
Lev Walkin171487e2006-03-21 07:25:18 +0000159
160/*** <<< TYPE-DECLS [ThreePlus] >>> ***/
161
162typedef MinMax_16P0_t ThreePlus_t;
163
164/*** <<< FUNC-DECLS [ThreePlus] >>> ***/
165
166extern asn_TYPE_descriptor_t asn_DEF_ThreePlus;
167asn_struct_free_f ThreePlus_free;
168asn_struct_print_f ThreePlus_print;
169asn_constr_check_f ThreePlus_constraint;
170ber_type_decoder_f ThreePlus_decode_ber;
171der_type_encoder_f ThreePlus_encode_der;
172xer_type_decoder_f ThreePlus_decode_xer;
173xer_type_encoder_f ThreePlus_encode_xer;
174
175/*** <<< CODE [ThreePlus] >>> ***/
176
177int
178ThreePlus_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000179 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin171487e2006-03-21 07:25:18 +0000180 const MinMax_16P0_t *st = (const MinMax_16P0_t *)sptr;
181 long value;
182
183 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700184 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000185 "%s: value not given (%s:%d)",
186 td->name, __FILE__, __LINE__);
187 return -1;
188 }
189
190 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700191 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000192 "%s: value too large (%s:%d)",
193 td->name, __FILE__, __LINE__);
194 return -1;
195 }
196
197 if((value >= 3)) {
198 /* Constraint check succeeded */
199 return 0;
200 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700201 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000202 "%s: constraint failed (%s:%d)",
203 td->name, __FILE__, __LINE__);
204 return -1;
205 }
206}
207
208/*
209 * This type is implemented using MinMax_16P0,
210 * so here we adjust the DEF accordingly.
211 */
212static void
213ThreePlus_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
214 td->free_struct = asn_DEF_MinMax_16P0.free_struct;
215 td->print_struct = asn_DEF_MinMax_16P0.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800216 td->check_constraints = asn_DEF_MinMax_16P0.check_constraints;
Lev Walkin171487e2006-03-21 07:25:18 +0000217 td->ber_decoder = asn_DEF_MinMax_16P0.ber_decoder;
218 td->der_encoder = asn_DEF_MinMax_16P0.der_encoder;
219 td->xer_decoder = asn_DEF_MinMax_16P0.xer_decoder;
220 td->xer_encoder = asn_DEF_MinMax_16P0.xer_encoder;
221 td->uper_decoder = asn_DEF_MinMax_16P0.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000222 td->uper_encoder = asn_DEF_MinMax_16P0.uper_encoder;
Lev Walkinba68c912017-07-06 07:52:39 -0700223 td->oer_decoder = asn_DEF_MinMax_16P0.oer_decoder;
224 td->oer_encoder = asn_DEF_MinMax_16P0.oer_encoder;
Lev Walkinb33425f2017-07-14 14:59:52 +0400225 if(!td->oer_constraints)
226 td->oer_constraints = asn_DEF_MinMax_16P0.oer_constraints;
Lev Walkin171487e2006-03-21 07:25:18 +0000227 if(!td->per_constraints)
228 td->per_constraints = asn_DEF_MinMax_16P0.per_constraints;
229 td->elements = asn_DEF_MinMax_16P0.elements;
230 td->elements_count = asn_DEF_MinMax_16P0.elements_count;
231 td->specifics = asn_DEF_MinMax_16P0.specifics;
232}
233
234void
235ThreePlus_free(asn_TYPE_descriptor_t *td,
236 void *struct_ptr, int contents_only) {
237 ThreePlus_1_inherit_TYPE_descriptor(td);
238 td->free_struct(td, struct_ptr, contents_only);
239}
240
241int
242ThreePlus_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
243 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
244 ThreePlus_1_inherit_TYPE_descriptor(td);
245 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
246}
247
248asn_dec_rval_t
249ThreePlus_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
250 void **structure, const void *bufptr, size_t size, int tag_mode) {
251 ThreePlus_1_inherit_TYPE_descriptor(td);
252 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
253}
254
255asn_enc_rval_t
256ThreePlus_encode_der(asn_TYPE_descriptor_t *td,
257 void *structure, int tag_mode, ber_tlv_tag_t tag,
258 asn_app_consume_bytes_f *cb, void *app_key) {
259 ThreePlus_1_inherit_TYPE_descriptor(td);
260 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
261}
262
263asn_dec_rval_t
264ThreePlus_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
265 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
266 ThreePlus_1_inherit_TYPE_descriptor(td);
267 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
268}
269
270asn_enc_rval_t
271ThreePlus_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
272 int ilevel, enum xer_encoder_flags_e flags,
273 asn_app_consume_bytes_f *cb, void *app_key) {
274 ThreePlus_1_inherit_TYPE_descriptor(td);
275 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
276}
277
278
279/*** <<< STAT-DEFS [ThreePlus] >>> ***/
280
Lev Walkina7591b52014-10-12 18:37:35 -0700281static const ber_tlv_tag_t asn_DEF_ThreePlus_tags_1[] = {
Lev Walkin171487e2006-03-21 07:25:18 +0000282 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
283};
284asn_TYPE_descriptor_t asn_DEF_ThreePlus = {
285 "ThreePlus",
286 "ThreePlus",
287 ThreePlus_free,
288 ThreePlus_print,
289 ThreePlus_constraint,
290 ThreePlus_decode_ber,
291 ThreePlus_encode_der,
292 ThreePlus_decode_xer,
293 ThreePlus_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700294 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400295 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +0000296 0, /* Use generic outmost tag fetcher */
297 asn_DEF_ThreePlus_tags_1,
298 sizeof(asn_DEF_ThreePlus_tags_1)
299 /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */
300 asn_DEF_ThreePlus_tags_1, /* Same as above */
301 sizeof(asn_DEF_ThreePlus_tags_1)
302 /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400303 0, /* No OER visible constraints */
Lev Walkin171487e2006-03-21 07:25:18 +0000304 0, /* No PER visible constraints */
305 0, 0, /* No members */
306 0 /* No specifics */
307};
308