blob: 8599d4b63aafc6f5a0ddf694f21ea06679fdf9dc [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 Walkin171487e2006-03-21 07:25:18 +000069 if(!td->per_constraints)
70 td->per_constraints = asn_DEF_INTEGER.per_constraints;
71 td->elements = asn_DEF_INTEGER.elements;
72 td->elements_count = asn_DEF_INTEGER.elements_count;
73 td->specifics = asn_DEF_INTEGER.specifics;
74}
75
76void
77MinMax_16P0_free(asn_TYPE_descriptor_t *td,
78 void *struct_ptr, int contents_only) {
79 MinMax_16P0_1_inherit_TYPE_descriptor(td);
80 td->free_struct(td, struct_ptr, contents_only);
81}
82
83int
84MinMax_16P0_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
85 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
86 MinMax_16P0_1_inherit_TYPE_descriptor(td);
87 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
88}
89
90asn_dec_rval_t
91MinMax_16P0_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
92 void **structure, const void *bufptr, size_t size, int tag_mode) {
93 MinMax_16P0_1_inherit_TYPE_descriptor(td);
94 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
95}
96
97asn_enc_rval_t
98MinMax_16P0_encode_der(asn_TYPE_descriptor_t *td,
99 void *structure, int tag_mode, ber_tlv_tag_t tag,
100 asn_app_consume_bytes_f *cb, void *app_key) {
101 MinMax_16P0_1_inherit_TYPE_descriptor(td);
102 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
103}
104
105asn_dec_rval_t
106MinMax_16P0_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
107 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
108 MinMax_16P0_1_inherit_TYPE_descriptor(td);
109 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
110}
111
112asn_enc_rval_t
113MinMax_16P0_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
114 int ilevel, enum xer_encoder_flags_e flags,
115 asn_app_consume_bytes_f *cb, void *app_key) {
116 MinMax_16P0_1_inherit_TYPE_descriptor(td);
117 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
118}
119
120
121/*** <<< STAT-DEFS [MinMax] >>> ***/
122
Lev Walkina7591b52014-10-12 18:37:35 -0700123static const ber_tlv_tag_t asn_DEF_MinMax_16P0_tags_1[] = {
Lev Walkin171487e2006-03-21 07:25:18 +0000124 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
125};
126asn_TYPE_descriptor_t asn_DEF_MinMax_16P0 = {
127 "MinMax",
128 "MinMax",
129 MinMax_16P0_free,
130 MinMax_16P0_print,
131 MinMax_16P0_constraint,
132 MinMax_16P0_decode_ber,
133 MinMax_16P0_encode_der,
134 MinMax_16P0_decode_xer,
135 MinMax_16P0_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000136 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +0000137 0, /* Use generic outmost tag fetcher */
138 asn_DEF_MinMax_16P0_tags_1,
139 sizeof(asn_DEF_MinMax_16P0_tags_1)
140 /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */
141 asn_DEF_MinMax_16P0_tags_1, /* Same as above */
142 sizeof(asn_DEF_MinMax_16P0_tags_1)
143 /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */
144 0, /* No PER visible constraints */
145 0, 0, /* No members */
146 0 /* No specifics */
147};
148
149
150/*** <<< INCLUDES [ThreePlus] >>> ***/
151
Lev Walkin22b5ed42006-09-13 02:51:20 +0000152#include "MinMax.h"
Lev Walkin171487e2006-03-21 07:25:18 +0000153
154/*** <<< TYPE-DECLS [ThreePlus] >>> ***/
155
156typedef MinMax_16P0_t ThreePlus_t;
157
158/*** <<< FUNC-DECLS [ThreePlus] >>> ***/
159
160extern asn_TYPE_descriptor_t asn_DEF_ThreePlus;
161asn_struct_free_f ThreePlus_free;
162asn_struct_print_f ThreePlus_print;
163asn_constr_check_f ThreePlus_constraint;
164ber_type_decoder_f ThreePlus_decode_ber;
165der_type_encoder_f ThreePlus_encode_der;
166xer_type_decoder_f ThreePlus_decode_xer;
167xer_type_encoder_f ThreePlus_encode_xer;
168
169/*** <<< CODE [ThreePlus] >>> ***/
170
171int
172ThreePlus_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000173 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin171487e2006-03-21 07:25:18 +0000174 const MinMax_16P0_t *st = (const MinMax_16P0_t *)sptr;
175 long value;
176
177 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700178 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000179 "%s: value not given (%s:%d)",
180 td->name, __FILE__, __LINE__);
181 return -1;
182 }
183
184 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700185 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000186 "%s: value too large (%s:%d)",
187 td->name, __FILE__, __LINE__);
188 return -1;
189 }
190
191 if((value >= 3)) {
192 /* Constraint check succeeded */
193 return 0;
194 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700195 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000196 "%s: constraint failed (%s:%d)",
197 td->name, __FILE__, __LINE__);
198 return -1;
199 }
200}
201
202/*
203 * This type is implemented using MinMax_16P0,
204 * so here we adjust the DEF accordingly.
205 */
206static void
207ThreePlus_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
208 td->free_struct = asn_DEF_MinMax_16P0.free_struct;
209 td->print_struct = asn_DEF_MinMax_16P0.print_struct;
Lev Walkin6169b8d2013-12-07 11:02:44 -0800210 td->check_constraints = asn_DEF_MinMax_16P0.check_constraints;
Lev Walkin171487e2006-03-21 07:25:18 +0000211 td->ber_decoder = asn_DEF_MinMax_16P0.ber_decoder;
212 td->der_encoder = asn_DEF_MinMax_16P0.der_encoder;
213 td->xer_decoder = asn_DEF_MinMax_16P0.xer_decoder;
214 td->xer_encoder = asn_DEF_MinMax_16P0.xer_encoder;
215 td->uper_decoder = asn_DEF_MinMax_16P0.uper_decoder;
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000216 td->uper_encoder = asn_DEF_MinMax_16P0.uper_encoder;
Lev Walkin171487e2006-03-21 07:25:18 +0000217 if(!td->per_constraints)
218 td->per_constraints = asn_DEF_MinMax_16P0.per_constraints;
219 td->elements = asn_DEF_MinMax_16P0.elements;
220 td->elements_count = asn_DEF_MinMax_16P0.elements_count;
221 td->specifics = asn_DEF_MinMax_16P0.specifics;
222}
223
224void
225ThreePlus_free(asn_TYPE_descriptor_t *td,
226 void *struct_ptr, int contents_only) {
227 ThreePlus_1_inherit_TYPE_descriptor(td);
228 td->free_struct(td, struct_ptr, contents_only);
229}
230
231int
232ThreePlus_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
233 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
234 ThreePlus_1_inherit_TYPE_descriptor(td);
235 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
236}
237
238asn_dec_rval_t
239ThreePlus_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
240 void **structure, const void *bufptr, size_t size, int tag_mode) {
241 ThreePlus_1_inherit_TYPE_descriptor(td);
242 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
243}
244
245asn_enc_rval_t
246ThreePlus_encode_der(asn_TYPE_descriptor_t *td,
247 void *structure, int tag_mode, ber_tlv_tag_t tag,
248 asn_app_consume_bytes_f *cb, void *app_key) {
249 ThreePlus_1_inherit_TYPE_descriptor(td);
250 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
251}
252
253asn_dec_rval_t
254ThreePlus_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
255 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
256 ThreePlus_1_inherit_TYPE_descriptor(td);
257 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
258}
259
260asn_enc_rval_t
261ThreePlus_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
262 int ilevel, enum xer_encoder_flags_e flags,
263 asn_app_consume_bytes_f *cb, void *app_key) {
264 ThreePlus_1_inherit_TYPE_descriptor(td);
265 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
266}
267
268
269/*** <<< STAT-DEFS [ThreePlus] >>> ***/
270
Lev Walkina7591b52014-10-12 18:37:35 -0700271static const ber_tlv_tag_t asn_DEF_ThreePlus_tags_1[] = {
Lev Walkin171487e2006-03-21 07:25:18 +0000272 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
273};
274asn_TYPE_descriptor_t asn_DEF_ThreePlus = {
275 "ThreePlus",
276 "ThreePlus",
277 ThreePlus_free,
278 ThreePlus_print,
279 ThreePlus_constraint,
280 ThreePlus_decode_ber,
281 ThreePlus_encode_der,
282 ThreePlus_decode_xer,
283 ThreePlus_encode_xer,
Lev Walkin9f5bb3a2006-08-18 01:46:46 +0000284 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +0000285 0, /* Use generic outmost tag fetcher */
286 asn_DEF_ThreePlus_tags_1,
287 sizeof(asn_DEF_ThreePlus_tags_1)
288 /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */
289 asn_DEF_ThreePlus_tags_1, /* Same as above */
290 sizeof(asn_DEF_ThreePlus_tags_1)
291 /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */
292 0, /* No PER visible constraints */
293 0, 0, /* No members */
294 0 /* No specifics */
295};
296