blob: 01131bf670225c2f081974e737818a00dc2d64bc [file] [log] [blame]
Lev Walkin006de1c2004-08-20 13:37:45 +00001
2/*** <<< INCLUDES [Int1] >>> ***/
3
4#include <INTEGER.h>
5
6/*** <<< TYPE-DECLS [Int1] >>> ***/
7
8
9typedef INTEGER_t Int1_t;
10
Lev Walkin006de1c2004-08-20 13:37:45 +000011/*** <<< FUNC-DECLS [Int1] >>> ***/
12
Lev Walkin154aa182004-09-26 13:12:56 +000013/* This type is equivalent to INTEGER */
Lev Walkindfae9752004-09-29 13:19:37 +000014#define asn_DEF_Int1 asn_DEF_INTEGER
Lev Walkin006de1c2004-08-20 13:37:45 +000015
16/*** <<< CODE [Int1] >>> ***/
17
Lev Walkin154aa182004-09-26 13:12:56 +000018/* This type is equivalent to INTEGER */
Lev Walkin006de1c2004-08-20 13:37:45 +000019
20
21/*** <<< INCLUDES [Int2] >>> ***/
22
23#include <Int1.h>
24
25/*** <<< TYPE-DECLS [Int2] >>> ***/
26
27
28typedef Int1_t Int2_t;
29
Lev Walkin006de1c2004-08-20 13:37:45 +000030/*** <<< FUNC-DECLS [Int2] >>> ***/
31
Lev Walkindfae9752004-09-29 13:19:37 +000032extern asn_TYPE_descriptor_t asn_DEF_Int2;
Lev Walkina9cc46e2004-09-22 16:06:28 +000033asn_struct_free_f Int2_free;
34asn_struct_print_f Int2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +000035asn_constr_check_f Int2_constraint;
36ber_type_decoder_f Int2_decode_ber;
37der_type_encoder_f Int2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +000038xer_type_decoder_f Int2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +000039xer_type_encoder_f Int2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +000040
41/*** <<< CODE [Int2] >>> ***/
42
43int
Lev Walkindfae9752004-09-29 13:19:37 +000044Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +000045 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +000046 const Int1_t *st = (const Int1_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +000047 long value;
48
49 if(!sptr) {
50 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +000051 "%s: value not given (%s:%d)",
52 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +000053 return -1;
54 }
55
Lev Walkin44467432004-09-07 06:43:57 +000056 /* Check if the sign bit is present */
57 value = st->buf ? ((st->buf[0] & 0x80) ? -1 : 1) : 0;
Lev Walkin006de1c2004-08-20 13:37:45 +000058
59 if((value >= 0)) {
60 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +000061 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +000062 } else {
63 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +000064 "%s: constraint failed (%s:%d)",
65 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +000066 return -1;
67 }
68}
69
70/*
71 * This type is implemented using Int1,
Lev Walkinc3808c12004-09-23 22:14:58 +000072 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +000073 */
74static void
Lev Walkine0272aa2005-03-04 11:26:08 +000075Int2_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +000076 td->free_struct = asn_DEF_Int1.free_struct;
77 td->print_struct = asn_DEF_Int1.print_struct;
78 td->ber_decoder = asn_DEF_Int1.ber_decoder;
79 td->der_encoder = asn_DEF_Int1.der_encoder;
80 td->xer_decoder = asn_DEF_Int1.xer_decoder;
81 td->xer_encoder = asn_DEF_Int1.xer_encoder;
82 td->elements = asn_DEF_Int1.elements;
83 td->elements_count = asn_DEF_Int1.elements_count;
84 td->specifics = asn_DEF_Int1.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +000085}
86
Lev Walkina9cc46e2004-09-22 16:06:28 +000087void
Lev Walkindfae9752004-09-29 13:19:37 +000088Int2_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +000089 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +000090 Int2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +000091 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +000092}
93
94int
Lev Walkindfae9752004-09-29 13:19:37 +000095Int2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +000096 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +000097 Int2_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +000098 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
99}
100
Lev Walkindc06f6b2004-10-20 15:50:55 +0000101asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000102Int2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000103 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000104 Int2_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +0000105 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000106}
107
108asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000109Int2_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000110 void *structure, int tag_mode, ber_tlv_tag_t tag,
111 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000112 Int2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000113 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
114}
115
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000116asn_dec_rval_t
117Int2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
118 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000119 Int2_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000120 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
121}
122
Lev Walkina9cc46e2004-09-22 16:06:28 +0000123asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000124Int2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000125 int ilevel, enum xer_encoder_flags_e flags,
126 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000127 Int2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000128 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +0000129}
130
131
132/*** <<< STAT-DEFS [Int2] >>> ***/
133
Lev Walkine0272aa2005-03-04 11:26:08 +0000134static ber_tlv_tag_t asn_DEF_Int2_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000135 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000136};
Lev Walkindfae9752004-09-29 13:19:37 +0000137asn_TYPE_descriptor_t asn_DEF_Int2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000138 "Int2",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000139 "Int2",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000140 Int2_free,
141 Int2_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000142 Int2_constraint,
143 Int2_decode_ber,
144 Int2_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000145 Int2_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000146 Int2_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +0000147 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +0000148 asn_DEF_Int2_0_tags,
149 sizeof(asn_DEF_Int2_0_tags)
150 /sizeof(asn_DEF_Int2_0_tags[0]), /* 1 */
151 asn_DEF_Int2_0_tags, /* Same as above */
152 sizeof(asn_DEF_Int2_0_tags)
153 /sizeof(asn_DEF_Int2_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000154 0, 0, /* No members */
155 0 /* No specifics */
156};
157
158
159/*** <<< INCLUDES [Int3] >>> ***/
160
161#include <Int2.h>
162
163/*** <<< TYPE-DECLS [Int3] >>> ***/
164
165
166typedef Int2_t Int3_t;
167
Lev Walkin006de1c2004-08-20 13:37:45 +0000168/*** <<< FUNC-DECLS [Int3] >>> ***/
169
Lev Walkindfae9752004-09-29 13:19:37 +0000170extern asn_TYPE_descriptor_t asn_DEF_Int3;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000171asn_struct_free_f Int3_free;
172asn_struct_print_f Int3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000173asn_constr_check_f Int3_constraint;
174ber_type_decoder_f Int3_decode_ber;
175der_type_encoder_f Int3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000176xer_type_decoder_f Int3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000177xer_type_encoder_f Int3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000178
179/*** <<< CODE [Int3] >>> ***/
180
181int
Lev Walkindfae9752004-09-29 13:19:37 +0000182Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000183 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000184 const Int2_t *st = (const Int2_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000185 long value;
186
187 if(!sptr) {
188 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000189 "%s: value not given (%s:%d)",
190 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000191 return -1;
192 }
193
Lev Walkindfae9752004-09-29 13:19:37 +0000194 if(asn_INTEGER2long(st, &value)) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000195 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000196 "%s: value too large (%s:%d)",
197 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000198 return -1;
199 }
200
201 if((value >= 0 && value <= 10)) {
202 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000203 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000204 } else {
205 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000206 "%s: constraint failed (%s:%d)",
207 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000208 return -1;
209 }
210}
211
212/*
213 * This type is implemented using Int2,
Lev Walkinc3808c12004-09-23 22:14:58 +0000214 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000215 */
216static void
Lev Walkine0272aa2005-03-04 11:26:08 +0000217Int3_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +0000218 td->free_struct = asn_DEF_Int2.free_struct;
219 td->print_struct = asn_DEF_Int2.print_struct;
220 td->ber_decoder = asn_DEF_Int2.ber_decoder;
221 td->der_encoder = asn_DEF_Int2.der_encoder;
222 td->xer_decoder = asn_DEF_Int2.xer_decoder;
223 td->xer_encoder = asn_DEF_Int2.xer_encoder;
224 td->elements = asn_DEF_Int2.elements;
225 td->elements_count = asn_DEF_Int2.elements_count;
226 td->specifics = asn_DEF_Int2.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +0000227}
228
Lev Walkina9cc46e2004-09-22 16:06:28 +0000229void
Lev Walkindfae9752004-09-29 13:19:37 +0000230Int3_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000231 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000232 Int3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000233 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +0000234}
235
236int
Lev Walkindfae9752004-09-29 13:19:37 +0000237Int3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000238 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000239 Int3_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +0000240 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
241}
242
Lev Walkindc06f6b2004-10-20 15:50:55 +0000243asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000244Int3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000245 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000246 Int3_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +0000247 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000248}
249
250asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000251Int3_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000252 void *structure, int tag_mode, ber_tlv_tag_t tag,
253 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000254 Int3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000255 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
256}
257
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000258asn_dec_rval_t
259Int3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
260 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000261 Int3_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000262 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
263}
264
Lev Walkina9cc46e2004-09-22 16:06:28 +0000265asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000266Int3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000267 int ilevel, enum xer_encoder_flags_e flags,
268 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000269 Int3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000270 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +0000271}
272
273
274/*** <<< STAT-DEFS [Int3] >>> ***/
275
Lev Walkine0272aa2005-03-04 11:26:08 +0000276static ber_tlv_tag_t asn_DEF_Int3_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000277 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000278};
Lev Walkindfae9752004-09-29 13:19:37 +0000279asn_TYPE_descriptor_t asn_DEF_Int3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000280 "Int3",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000281 "Int3",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000282 Int3_free,
283 Int3_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000284 Int3_constraint,
285 Int3_decode_ber,
286 Int3_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000287 Int3_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000288 Int3_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +0000289 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +0000290 asn_DEF_Int3_0_tags,
291 sizeof(asn_DEF_Int3_0_tags)
292 /sizeof(asn_DEF_Int3_0_tags[0]), /* 1 */
293 asn_DEF_Int3_0_tags, /* Same as above */
294 sizeof(asn_DEF_Int3_0_tags)
295 /sizeof(asn_DEF_Int3_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000296 0, 0, /* No members */
297 0 /* No specifics */
298};
299
300
301/*** <<< INCLUDES [Int4] >>> ***/
302
303#include <Int3.h>
304
305/*** <<< TYPE-DECLS [Int4] >>> ***/
306
307
308typedef Int3_t Int4_t;
309
Lev Walkin006de1c2004-08-20 13:37:45 +0000310/*** <<< FUNC-DECLS [Int4] >>> ***/
311
Lev Walkindfae9752004-09-29 13:19:37 +0000312extern asn_TYPE_descriptor_t asn_DEF_Int4;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000313asn_struct_free_f Int4_free;
314asn_struct_print_f Int4_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000315asn_constr_check_f Int4_constraint;
316ber_type_decoder_f Int4_decode_ber;
317der_type_encoder_f Int4_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000318xer_type_decoder_f Int4_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000319xer_type_encoder_f Int4_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000320
321/*** <<< CODE [Int4] >>> ***/
322
323int
Lev Walkindfae9752004-09-29 13:19:37 +0000324Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000325 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000326 const Int3_t *st = (const Int3_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +0000327 long value;
Lev Walkin006de1c2004-08-20 13:37:45 +0000328
329 if(!sptr) {
330 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000331 "%s: value not given (%s:%d)",
332 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000333 return -1;
334 }
335
Lev Walkindfae9752004-09-29 13:19:37 +0000336 if(asn_INTEGER2long(st, &value)) {
Lev Walkind35c8b52004-08-25 02:08:08 +0000337 _ASN_ERRLOG(app_errlog, app_key,
338 "%s: value too large (%s:%d)",
339 td->name, __FILE__, __LINE__);
340 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000341 }
342
Lev Walkind35c8b52004-08-25 02:08:08 +0000343 if((value >= 1 && value <= 10)) {
344 /* Constraint check succeeded */
345 return 0;
346 } else {
347 _ASN_ERRLOG(app_errlog, app_key,
348 "%s: constraint failed (%s:%d)",
349 td->name, __FILE__, __LINE__);
350 return -1;
351 }
Lev Walkin006de1c2004-08-20 13:37:45 +0000352}
353
354/*
355 * This type is implemented using Int3,
Lev Walkinc3808c12004-09-23 22:14:58 +0000356 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000357 */
358static void
Lev Walkine0272aa2005-03-04 11:26:08 +0000359Int4_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +0000360 td->free_struct = asn_DEF_Int3.free_struct;
361 td->print_struct = asn_DEF_Int3.print_struct;
362 td->ber_decoder = asn_DEF_Int3.ber_decoder;
363 td->der_encoder = asn_DEF_Int3.der_encoder;
364 td->xer_decoder = asn_DEF_Int3.xer_decoder;
365 td->xer_encoder = asn_DEF_Int3.xer_encoder;
366 td->elements = asn_DEF_Int3.elements;
367 td->elements_count = asn_DEF_Int3.elements_count;
368 td->specifics = asn_DEF_Int3.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +0000369}
370
Lev Walkina9cc46e2004-09-22 16:06:28 +0000371void
Lev Walkindfae9752004-09-29 13:19:37 +0000372Int4_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000373 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000374 Int4_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000375 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +0000376}
377
378int
Lev Walkindfae9752004-09-29 13:19:37 +0000379Int4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000380 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000381 Int4_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +0000382 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
383}
384
Lev Walkindc06f6b2004-10-20 15:50:55 +0000385asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000386Int4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000387 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000388 Int4_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +0000389 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000390}
391
392asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000393Int4_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000394 void *structure, int tag_mode, ber_tlv_tag_t tag,
395 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000396 Int4_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000397 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
398}
399
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000400asn_dec_rval_t
401Int4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
402 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000403 Int4_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000404 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
405}
406
Lev Walkina9cc46e2004-09-22 16:06:28 +0000407asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000408Int4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000409 int ilevel, enum xer_encoder_flags_e flags,
410 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000411 Int4_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000412 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +0000413}
414
415
416/*** <<< STAT-DEFS [Int4] >>> ***/
417
Lev Walkine0272aa2005-03-04 11:26:08 +0000418static ber_tlv_tag_t asn_DEF_Int4_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000419 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000420};
Lev Walkindfae9752004-09-29 13:19:37 +0000421asn_TYPE_descriptor_t asn_DEF_Int4 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000422 "Int4",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000423 "Int4",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000424 Int4_free,
425 Int4_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000426 Int4_constraint,
427 Int4_decode_ber,
428 Int4_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000429 Int4_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000430 Int4_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +0000431 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +0000432 asn_DEF_Int4_0_tags,
433 sizeof(asn_DEF_Int4_0_tags)
434 /sizeof(asn_DEF_Int4_0_tags[0]), /* 1 */
435 asn_DEF_Int4_0_tags, /* Same as above */
436 sizeof(asn_DEF_Int4_0_tags)
437 /sizeof(asn_DEF_Int4_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000438 0, 0, /* No members */
439 0 /* No specifics */
440};
441
442
443/*** <<< INCLUDES [Int5] >>> ***/
444
445#include <Int4.h>
446
447/*** <<< TYPE-DECLS [Int5] >>> ***/
448
449
450typedef Int4_t Int5_t;
451
Lev Walkin006de1c2004-08-20 13:37:45 +0000452/*** <<< FUNC-DECLS [Int5] >>> ***/
453
Lev Walkindfae9752004-09-29 13:19:37 +0000454extern asn_TYPE_descriptor_t asn_DEF_Int5;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000455asn_struct_free_f Int5_free;
456asn_struct_print_f Int5_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000457asn_constr_check_f Int5_constraint;
458ber_type_decoder_f Int5_decode_ber;
459der_type_encoder_f Int5_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000460xer_type_decoder_f Int5_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000461xer_type_encoder_f Int5_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000462
463/*** <<< CODE [Int5] >>> ***/
464
465int
Lev Walkindfae9752004-09-29 13:19:37 +0000466Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000467 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000468 const Int4_t *st = (const Int4_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000469 long value;
470
471 if(!sptr) {
472 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000473 "%s: value not given (%s:%d)",
474 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000475 return -1;
476 }
477
Lev Walkindfae9752004-09-29 13:19:37 +0000478 if(asn_INTEGER2long(st, &value)) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000479 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000480 "%s: value too large (%s:%d)",
481 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000482 return -1;
483 }
484
485 if((value == 5)) {
486 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000487 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000488 } else {
489 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000490 "%s: constraint failed (%s:%d)",
491 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000492 return -1;
493 }
494}
495
496/*
497 * This type is implemented using Int4,
Lev Walkinc3808c12004-09-23 22:14:58 +0000498 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000499 */
500static void
Lev Walkine0272aa2005-03-04 11:26:08 +0000501Int5_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +0000502 td->free_struct = asn_DEF_Int4.free_struct;
503 td->print_struct = asn_DEF_Int4.print_struct;
504 td->ber_decoder = asn_DEF_Int4.ber_decoder;
505 td->der_encoder = asn_DEF_Int4.der_encoder;
506 td->xer_decoder = asn_DEF_Int4.xer_decoder;
507 td->xer_encoder = asn_DEF_Int4.xer_encoder;
508 td->elements = asn_DEF_Int4.elements;
509 td->elements_count = asn_DEF_Int4.elements_count;
510 td->specifics = asn_DEF_Int4.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +0000511}
512
Lev Walkina9cc46e2004-09-22 16:06:28 +0000513void
Lev Walkindfae9752004-09-29 13:19:37 +0000514Int5_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000515 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000516 Int5_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000517 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +0000518}
519
520int
Lev Walkindfae9752004-09-29 13:19:37 +0000521Int5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000522 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000523 Int5_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +0000524 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
525}
526
Lev Walkindc06f6b2004-10-20 15:50:55 +0000527asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000528Int5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000529 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000530 Int5_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +0000531 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000532}
533
534asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000535Int5_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000536 void *structure, int tag_mode, ber_tlv_tag_t tag,
537 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000538 Int5_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000539 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
540}
541
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000542asn_dec_rval_t
543Int5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
544 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000545 Int5_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000546 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
547}
548
Lev Walkina9cc46e2004-09-22 16:06:28 +0000549asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000550Int5_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000551 int ilevel, enum xer_encoder_flags_e flags,
552 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000553 Int5_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000554 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +0000555}
556
557
558/*** <<< STAT-DEFS [Int5] >>> ***/
559
Lev Walkine0272aa2005-03-04 11:26:08 +0000560static ber_tlv_tag_t asn_DEF_Int5_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000561 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000562};
Lev Walkindfae9752004-09-29 13:19:37 +0000563asn_TYPE_descriptor_t asn_DEF_Int5 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000564 "Int5",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000565 "Int5",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000566 Int5_free,
567 Int5_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000568 Int5_constraint,
569 Int5_decode_ber,
570 Int5_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000571 Int5_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000572 Int5_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +0000573 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +0000574 asn_DEF_Int5_0_tags,
575 sizeof(asn_DEF_Int5_0_tags)
576 /sizeof(asn_DEF_Int5_0_tags[0]), /* 1 */
577 asn_DEF_Int5_0_tags, /* Same as above */
578 sizeof(asn_DEF_Int5_0_tags)
579 /sizeof(asn_DEF_Int5_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000580 0, 0, /* No members */
581 0 /* No specifics */
582};
583
584
585/*** <<< INCLUDES [ExtensibleExtensions] >>> ***/
586
587#include <INTEGER.h>
588
589/*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/
590
591
592typedef INTEGER_t ExtensibleExtensions_t;
593
Lev Walkin006de1c2004-08-20 13:37:45 +0000594/*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/
595
Lev Walkindfae9752004-09-29 13:19:37 +0000596extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000597asn_struct_free_f ExtensibleExtensions_free;
598asn_struct_print_f ExtensibleExtensions_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000599asn_constr_check_f ExtensibleExtensions_constraint;
600ber_type_decoder_f ExtensibleExtensions_decode_ber;
601der_type_encoder_f ExtensibleExtensions_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000602xer_type_decoder_f ExtensibleExtensions_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000603xer_type_encoder_f ExtensibleExtensions_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000604
605/*** <<< CODE [ExtensibleExtensions] >>> ***/
606
607int
Lev Walkindfae9752004-09-29 13:19:37 +0000608ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000609 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000610 const INTEGER_t *st = (const INTEGER_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +0000611 long value;
Lev Walkin006de1c2004-08-20 13:37:45 +0000612
613 if(!sptr) {
614 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000615 "%s: value not given (%s:%d)",
616 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000617 return -1;
618 }
619
Lev Walkindfae9752004-09-29 13:19:37 +0000620 if(asn_INTEGER2long(st, &value)) {
Lev Walkind35c8b52004-08-25 02:08:08 +0000621 _ASN_ERRLOG(app_errlog, app_key,
622 "%s: value too large (%s:%d)",
623 td->name, __FILE__, __LINE__);
624 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000625 }
626
Lev Walkind35c8b52004-08-25 02:08:08 +0000627 if((value >= 1 && value <= 256)) {
628 /* Constraint check succeeded */
629 return 0;
630 } else {
631 _ASN_ERRLOG(app_errlog, app_key,
632 "%s: constraint failed (%s:%d)",
633 td->name, __FILE__, __LINE__);
634 return -1;
635 }
Lev Walkin006de1c2004-08-20 13:37:45 +0000636}
637
638/*
639 * This type is implemented using INTEGER,
Lev Walkinc3808c12004-09-23 22:14:58 +0000640 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000641 */
642static void
Lev Walkine0272aa2005-03-04 11:26:08 +0000643ExtensibleExtensions_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +0000644 td->free_struct = asn_DEF_INTEGER.free_struct;
645 td->print_struct = asn_DEF_INTEGER.print_struct;
646 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
647 td->der_encoder = asn_DEF_INTEGER.der_encoder;
648 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
649 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
650 td->elements = asn_DEF_INTEGER.elements;
651 td->elements_count = asn_DEF_INTEGER.elements_count;
652 td->specifics = asn_DEF_INTEGER.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +0000653}
654
Lev Walkina9cc46e2004-09-22 16:06:28 +0000655void
Lev Walkindfae9752004-09-29 13:19:37 +0000656ExtensibleExtensions_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000657 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000658 ExtensibleExtensions_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000659 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +0000660}
661
662int
Lev Walkindfae9752004-09-29 13:19:37 +0000663ExtensibleExtensions_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000664 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000665 ExtensibleExtensions_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +0000666 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
667}
668
Lev Walkindc06f6b2004-10-20 15:50:55 +0000669asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000670ExtensibleExtensions_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000671 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000672 ExtensibleExtensions_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +0000673 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000674}
675
676asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000677ExtensibleExtensions_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000678 void *structure, int tag_mode, ber_tlv_tag_t tag,
679 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000680 ExtensibleExtensions_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000681 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
682}
683
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000684asn_dec_rval_t
685ExtensibleExtensions_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
686 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000687 ExtensibleExtensions_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000688 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
689}
690
Lev Walkina9cc46e2004-09-22 16:06:28 +0000691asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000692ExtensibleExtensions_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000693 int ilevel, enum xer_encoder_flags_e flags,
694 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000695 ExtensibleExtensions_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000696 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +0000697}
698
699
700/*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/
701
Lev Walkine0272aa2005-03-04 11:26:08 +0000702static ber_tlv_tag_t asn_DEF_ExtensibleExtensions_0_tags[] = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000703 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
704};
Lev Walkindfae9752004-09-29 13:19:37 +0000705asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000706 "ExtensibleExtensions",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000707 "ExtensibleExtensions",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000708 ExtensibleExtensions_free,
709 ExtensibleExtensions_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000710 ExtensibleExtensions_constraint,
711 ExtensibleExtensions_decode_ber,
712 ExtensibleExtensions_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000713 ExtensibleExtensions_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000714 ExtensibleExtensions_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +0000715 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +0000716 asn_DEF_ExtensibleExtensions_0_tags,
717 sizeof(asn_DEF_ExtensibleExtensions_0_tags)
718 /sizeof(asn_DEF_ExtensibleExtensions_0_tags[0]), /* 1 */
719 asn_DEF_ExtensibleExtensions_0_tags, /* Same as above */
720 sizeof(asn_DEF_ExtensibleExtensions_0_tags)
721 /sizeof(asn_DEF_ExtensibleExtensions_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000722 0, 0, /* No members */
723 0 /* No specifics */
724};
725
726
727/*** <<< INCLUDES [Str1] >>> ***/
728
729#include <IA5String.h>
730
731/*** <<< TYPE-DECLS [Str1] >>> ***/
732
733
734typedef IA5String_t Str1_t;
735
Lev Walkin006de1c2004-08-20 13:37:45 +0000736/*** <<< FUNC-DECLS [Str1] >>> ***/
737
Lev Walkin154aa182004-09-26 13:12:56 +0000738/* This type is equivalent to IA5String */
Lev Walkindfae9752004-09-29 13:19:37 +0000739#define asn_DEF_Str1 asn_DEF_IA5String
Lev Walkin006de1c2004-08-20 13:37:45 +0000740
741/*** <<< CODE [Str1] >>> ***/
742
Lev Walkin154aa182004-09-26 13:12:56 +0000743/* This type is equivalent to IA5String */
Lev Walkin006de1c2004-08-20 13:37:45 +0000744
745
746/*** <<< INCLUDES [Str2] >>> ***/
747
748#include <Str1.h>
749
750/*** <<< TYPE-DECLS [Str2] >>> ***/
751
752
753typedef Str1_t Str2_t;
754
Lev Walkin006de1c2004-08-20 13:37:45 +0000755/*** <<< FUNC-DECLS [Str2] >>> ***/
756
Lev Walkindfae9752004-09-29 13:19:37 +0000757extern asn_TYPE_descriptor_t asn_DEF_Str2;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000758asn_struct_free_f Str2_free;
759asn_struct_print_f Str2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000760asn_constr_check_f Str2_constraint;
761ber_type_decoder_f Str2_decode_ber;
762der_type_encoder_f Str2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000763xer_type_decoder_f Str2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000764xer_type_encoder_f Str2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000765
766/*** <<< CTABLES [Str2] >>> ***/
767
768static int check_permitted_alphabet_1(const void *sptr) {
769 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000770 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +0000771 const uint8_t *ch = st->buf;
772 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +0000773
774 for(; ch < end; ch++) {
775 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +0000776 if(!(cv <= 127)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000777 }
Lev Walkin775885e2004-08-22 12:47:03 +0000778 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000779}
780
781
782/*** <<< CODE [Str2] >>> ***/
783
784int
Lev Walkindfae9752004-09-29 13:19:37 +0000785Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000786 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000787 const Str1_t *st = (const Str1_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000788 size_t size;
789
790 if(!sptr) {
791 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000792 "%s: value not given (%s:%d)",
793 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000794 return -1;
795 }
796
797 size = st->size;
798
799 if(((size <= 20) || (size >= 25 && size <= 30))
Lev Walkin730b15a2004-08-22 13:11:40 +0000800 && !check_permitted_alphabet_1(sptr)) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000801 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000802 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000803 } else {
804 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000805 "%s: constraint failed (%s:%d)",
806 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000807 return -1;
808 }
809}
810
811/*
812 * This type is implemented using Str1,
Lev Walkinc3808c12004-09-23 22:14:58 +0000813 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000814 */
815static void
Lev Walkine0272aa2005-03-04 11:26:08 +0000816Str2_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +0000817 td->free_struct = asn_DEF_Str1.free_struct;
818 td->print_struct = asn_DEF_Str1.print_struct;
819 td->ber_decoder = asn_DEF_Str1.ber_decoder;
820 td->der_encoder = asn_DEF_Str1.der_encoder;
821 td->xer_decoder = asn_DEF_Str1.xer_decoder;
822 td->xer_encoder = asn_DEF_Str1.xer_encoder;
823 td->elements = asn_DEF_Str1.elements;
824 td->elements_count = asn_DEF_Str1.elements_count;
825 td->specifics = asn_DEF_Str1.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +0000826}
827
Lev Walkina9cc46e2004-09-22 16:06:28 +0000828void
Lev Walkindfae9752004-09-29 13:19:37 +0000829Str2_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000830 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000831 Str2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000832 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +0000833}
834
835int
Lev Walkindfae9752004-09-29 13:19:37 +0000836Str2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000837 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000838 Str2_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +0000839 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
840}
841
Lev Walkindc06f6b2004-10-20 15:50:55 +0000842asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000843Str2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000844 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000845 Str2_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +0000846 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000847}
848
849asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000850Str2_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000851 void *structure, int tag_mode, ber_tlv_tag_t tag,
852 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000853 Str2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000854 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
855}
856
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000857asn_dec_rval_t
858Str2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
859 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000860 Str2_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000861 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
862}
863
Lev Walkina9cc46e2004-09-22 16:06:28 +0000864asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000865Str2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000866 int ilevel, enum xer_encoder_flags_e flags,
867 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000868 Str2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000869 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +0000870}
871
872
873/*** <<< STAT-DEFS [Str2] >>> ***/
874
Lev Walkine0272aa2005-03-04 11:26:08 +0000875static ber_tlv_tag_t asn_DEF_Str2_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000876 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000877};
Lev Walkindfae9752004-09-29 13:19:37 +0000878asn_TYPE_descriptor_t asn_DEF_Str2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000879 "Str2",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000880 "Str2",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000881 Str2_free,
882 Str2_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000883 Str2_constraint,
884 Str2_decode_ber,
885 Str2_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000886 Str2_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000887 Str2_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +0000888 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +0000889 asn_DEF_Str2_0_tags,
890 sizeof(asn_DEF_Str2_0_tags)
891 /sizeof(asn_DEF_Str2_0_tags[0]), /* 1 */
892 asn_DEF_Str2_0_tags, /* Same as above */
893 sizeof(asn_DEF_Str2_0_tags)
894 /sizeof(asn_DEF_Str2_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000895 0, 0, /* No members */
896 0 /* No specifics */
897};
898
899
900/*** <<< INCLUDES [Str3] >>> ***/
901
902#include <Str2.h>
903
904/*** <<< TYPE-DECLS [Str3] >>> ***/
905
906
907typedef Str2_t Str3_t;
908
Lev Walkin006de1c2004-08-20 13:37:45 +0000909/*** <<< FUNC-DECLS [Str3] >>> ***/
910
Lev Walkindfae9752004-09-29 13:19:37 +0000911extern asn_TYPE_descriptor_t asn_DEF_Str3;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000912asn_struct_free_f Str3_free;
913asn_struct_print_f Str3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000914asn_constr_check_f Str3_constraint;
915ber_type_decoder_f Str3_decode_ber;
916der_type_encoder_f Str3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000917xer_type_decoder_f Str3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000918xer_type_encoder_f Str3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000919
920/*** <<< CTABLES [Str3] >>> ***/
921
922static int permitted_alphabet_table_2[256] = {
9230,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
9240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
9250,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
9260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
9270,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0, /* ABC */
9280,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
9290,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0, /* def */
930};
931
932static int check_permitted_alphabet_2(const void *sptr) {
933 int *table = permitted_alphabet_table_2;
934 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000935 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +0000936 const uint8_t *ch = st->buf;
937 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +0000938
939 for(; ch < end; ch++) {
940 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +0000941 if(!table[cv]) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000942 }
Lev Walkin775885e2004-08-22 12:47:03 +0000943 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000944}
945
946
947/*** <<< CODE [Str3] >>> ***/
948
949int
Lev Walkindfae9752004-09-29 13:19:37 +0000950Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000951 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000952 const Str2_t *st = (const Str2_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000953 size_t size;
954
955 if(!sptr) {
956 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000957 "%s: value not given (%s:%d)",
958 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000959 return -1;
960 }
961
962 size = st->size;
963
964 if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27))
Lev Walkin730b15a2004-08-22 13:11:40 +0000965 && !check_permitted_alphabet_2(sptr)) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000966 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000967 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000968 } else {
969 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000970 "%s: constraint failed (%s:%d)",
971 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000972 return -1;
973 }
974}
975
976/*
977 * This type is implemented using Str2,
Lev Walkinc3808c12004-09-23 22:14:58 +0000978 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000979 */
980static void
Lev Walkine0272aa2005-03-04 11:26:08 +0000981Str3_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +0000982 td->free_struct = asn_DEF_Str2.free_struct;
983 td->print_struct = asn_DEF_Str2.print_struct;
984 td->ber_decoder = asn_DEF_Str2.ber_decoder;
985 td->der_encoder = asn_DEF_Str2.der_encoder;
986 td->xer_decoder = asn_DEF_Str2.xer_decoder;
987 td->xer_encoder = asn_DEF_Str2.xer_encoder;
988 td->elements = asn_DEF_Str2.elements;
989 td->elements_count = asn_DEF_Str2.elements_count;
990 td->specifics = asn_DEF_Str2.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +0000991}
992
Lev Walkina9cc46e2004-09-22 16:06:28 +0000993void
Lev Walkindfae9752004-09-29 13:19:37 +0000994Str3_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000995 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000996 Str3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000997 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +0000998}
999
1000int
Lev Walkindfae9752004-09-29 13:19:37 +00001001Str3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001002 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001003 Str3_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00001004 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1005}
1006
Lev Walkindc06f6b2004-10-20 15:50:55 +00001007asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001008Str3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001009 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001010 Str3_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001011 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001012}
1013
1014asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001015Str3_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001016 void *structure, int tag_mode, ber_tlv_tag_t tag,
1017 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001018 Str3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001019 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1020}
1021
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001022asn_dec_rval_t
1023Str3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1024 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001025 Str3_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001026 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1027}
1028
Lev Walkina9cc46e2004-09-22 16:06:28 +00001029asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001030Str3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001031 int ilevel, enum xer_encoder_flags_e flags,
1032 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001033 Str3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001034 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00001035}
1036
1037
1038/*** <<< STAT-DEFS [Str3] >>> ***/
1039
Lev Walkine0272aa2005-03-04 11:26:08 +00001040static ber_tlv_tag_t asn_DEF_Str3_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001041 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001042};
Lev Walkindfae9752004-09-29 13:19:37 +00001043asn_TYPE_descriptor_t asn_DEF_Str3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001044 "Str3",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001045 "Str3",
Lev Walkina9cc46e2004-09-22 16:06:28 +00001046 Str3_free,
1047 Str3_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001048 Str3_constraint,
1049 Str3_decode_ber,
1050 Str3_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001051 Str3_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001052 Str3_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00001053 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00001054 asn_DEF_Str3_0_tags,
1055 sizeof(asn_DEF_Str3_0_tags)
1056 /sizeof(asn_DEF_Str3_0_tags[0]), /* 1 */
1057 asn_DEF_Str3_0_tags, /* Same as above */
1058 sizeof(asn_DEF_Str3_0_tags)
1059 /sizeof(asn_DEF_Str3_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001060 0, 0, /* No members */
1061 0 /* No specifics */
1062};
1063
1064
Lev Walkin8a99bf72004-09-10 06:07:39 +00001065/*** <<< INCLUDES [Str4] >>> ***/
1066
1067#include <IA5String.h>
1068
1069/*** <<< TYPE-DECLS [Str4] >>> ***/
1070
1071
1072typedef IA5String_t Str4_t;
1073
1074/*** <<< FUNC-DECLS [Str4] >>> ***/
1075
Lev Walkindfae9752004-09-29 13:19:37 +00001076extern asn_TYPE_descriptor_t asn_DEF_Str4;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001077asn_struct_free_f Str4_free;
1078asn_struct_print_f Str4_print;
Lev Walkin8a99bf72004-09-10 06:07:39 +00001079asn_constr_check_f Str4_constraint;
1080ber_type_decoder_f Str4_decode_ber;
1081der_type_encoder_f Str4_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001082xer_type_decoder_f Str4_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001083xer_type_encoder_f Str4_encode_xer;
Lev Walkin8a99bf72004-09-10 06:07:39 +00001084
1085/*** <<< CTABLES [Str4] >>> ***/
1086
1087static int check_permitted_alphabet_3(const void *sptr) {
1088 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001089 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin8a99bf72004-09-10 06:07:39 +00001090 const uint8_t *ch = st->buf;
1091 const uint8_t *end = ch + st->size;
1092
1093 for(; ch < end; ch++) {
1094 uint8_t cv = *ch;
1095 if(!(cv <= 127)) return -1;
1096 }
1097 return 0;
1098}
1099
1100
1101/*** <<< CODE [Str4] >>> ***/
1102
1103int
Lev Walkindfae9752004-09-29 13:19:37 +00001104Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin8a99bf72004-09-10 06:07:39 +00001105 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001106 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin8a99bf72004-09-10 06:07:39 +00001107
1108 if(!sptr) {
1109 _ASN_ERRLOG(app_errlog, app_key,
1110 "%s: value not given (%s:%d)",
1111 td->name, __FILE__, __LINE__);
1112 return -1;
1113 }
1114
1115
1116 if(!check_permitted_alphabet_3(sptr)) {
1117 /* Constraint check succeeded */
1118 return 0;
1119 } else {
1120 _ASN_ERRLOG(app_errlog, app_key,
1121 "%s: constraint failed (%s:%d)",
1122 td->name, __FILE__, __LINE__);
1123 return -1;
1124 }
1125}
1126
1127/*
1128 * This type is implemented using IA5String,
Lev Walkinc3808c12004-09-23 22:14:58 +00001129 * so here we adjust the DEF accordingly.
Lev Walkin8a99bf72004-09-10 06:07:39 +00001130 */
1131static void
Lev Walkine0272aa2005-03-04 11:26:08 +00001132Str4_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00001133 td->free_struct = asn_DEF_IA5String.free_struct;
1134 td->print_struct = asn_DEF_IA5String.print_struct;
1135 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1136 td->der_encoder = asn_DEF_IA5String.der_encoder;
1137 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1138 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1139 td->elements = asn_DEF_IA5String.elements;
1140 td->elements_count = asn_DEF_IA5String.elements_count;
1141 td->specifics = asn_DEF_IA5String.specifics;
Lev Walkin8a99bf72004-09-10 06:07:39 +00001142}
1143
Lev Walkina9cc46e2004-09-22 16:06:28 +00001144void
Lev Walkindfae9752004-09-29 13:19:37 +00001145Str4_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001146 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001147 Str4_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001148 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin8a99bf72004-09-10 06:07:39 +00001149}
1150
1151int
Lev Walkindfae9752004-09-29 13:19:37 +00001152Str4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin8a99bf72004-09-10 06:07:39 +00001153 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001154 Str4_0_inherit_TYPE_descriptor(td);
Lev Walkin8a99bf72004-09-10 06:07:39 +00001155 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1156}
1157
Lev Walkindc06f6b2004-10-20 15:50:55 +00001158asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001159Str4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001160 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001161 Str4_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001162 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001163}
1164
1165asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001166Str4_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001167 void *structure, int tag_mode, ber_tlv_tag_t tag,
1168 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001169 Str4_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001170 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1171}
1172
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001173asn_dec_rval_t
1174Str4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1175 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001176 Str4_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001177 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1178}
1179
Lev Walkina9cc46e2004-09-22 16:06:28 +00001180asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001181Str4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001182 int ilevel, enum xer_encoder_flags_e flags,
1183 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001184 Str4_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001185 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin8a99bf72004-09-10 06:07:39 +00001186}
1187
1188
1189/*** <<< STAT-DEFS [Str4] >>> ***/
1190
Lev Walkine0272aa2005-03-04 11:26:08 +00001191static ber_tlv_tag_t asn_DEF_Str4_0_tags[] = {
Lev Walkin8a99bf72004-09-10 06:07:39 +00001192 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1193};
Lev Walkindfae9752004-09-29 13:19:37 +00001194asn_TYPE_descriptor_t asn_DEF_Str4 = {
Lev Walkin8a99bf72004-09-10 06:07:39 +00001195 "Str4",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001196 "Str4",
Lev Walkina9cc46e2004-09-22 16:06:28 +00001197 Str4_free,
1198 Str4_print,
Lev Walkin8a99bf72004-09-10 06:07:39 +00001199 Str4_constraint,
1200 Str4_decode_ber,
1201 Str4_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001202 Str4_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001203 Str4_encode_xer,
Lev Walkin8a99bf72004-09-10 06:07:39 +00001204 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00001205 asn_DEF_Str4_0_tags,
1206 sizeof(asn_DEF_Str4_0_tags)
1207 /sizeof(asn_DEF_Str4_0_tags[0]), /* 1 */
1208 asn_DEF_Str4_0_tags, /* Same as above */
1209 sizeof(asn_DEF_Str4_0_tags)
1210 /sizeof(asn_DEF_Str4_0_tags[0]), /* 1 */
Lev Walkin8a99bf72004-09-10 06:07:39 +00001211 0, 0, /* No members */
1212 0 /* No specifics */
1213};
1214
1215
Lev Walkin006de1c2004-08-20 13:37:45 +00001216/*** <<< INCLUDES [PER-Visible] >>> ***/
1217
1218#include <IA5String.h>
1219
1220/*** <<< TYPE-DECLS [PER-Visible] >>> ***/
1221
1222
1223typedef IA5String_t PER_Visible_t;
1224
Lev Walkin006de1c2004-08-20 13:37:45 +00001225/*** <<< FUNC-DECLS [PER-Visible] >>> ***/
1226
Lev Walkindfae9752004-09-29 13:19:37 +00001227extern asn_TYPE_descriptor_t asn_DEF_PER_Visible;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001228asn_struct_free_f PER_Visible_free;
1229asn_struct_print_f PER_Visible_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001230asn_constr_check_f PER_Visible_constraint;
1231ber_type_decoder_f PER_Visible_decode_ber;
1232der_type_encoder_f PER_Visible_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001233xer_type_decoder_f PER_Visible_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001234xer_type_encoder_f PER_Visible_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001235
1236/*** <<< CTABLES [PER-Visible] >>> ***/
1237
Lev Walkin8a99bf72004-09-10 06:07:39 +00001238static int check_permitted_alphabet_4(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001239 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001240 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001241 const uint8_t *ch = st->buf;
1242 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001243
1244 for(; ch < end; ch++) {
1245 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00001246 if(!(cv >= 65 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001247 }
Lev Walkin775885e2004-08-22 12:47:03 +00001248 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001249}
1250
1251
1252/*** <<< CODE [PER-Visible] >>> ***/
1253
1254int
Lev Walkindfae9752004-09-29 13:19:37 +00001255PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001256 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001257 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001258
1259 if(!sptr) {
1260 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00001261 "%s: value not given (%s:%d)",
1262 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001263 return -1;
1264 }
1265
1266
Lev Walkin8a99bf72004-09-10 06:07:39 +00001267 if(!check_permitted_alphabet_4(sptr)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001268 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001269 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001270 } else {
1271 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00001272 "%s: constraint failed (%s:%d)",
1273 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001274 return -1;
1275 }
1276}
1277
1278/*
1279 * This type is implemented using IA5String,
Lev Walkinc3808c12004-09-23 22:14:58 +00001280 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001281 */
1282static void
Lev Walkine0272aa2005-03-04 11:26:08 +00001283PER_Visible_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00001284 td->free_struct = asn_DEF_IA5String.free_struct;
1285 td->print_struct = asn_DEF_IA5String.print_struct;
1286 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1287 td->der_encoder = asn_DEF_IA5String.der_encoder;
1288 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1289 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1290 td->elements = asn_DEF_IA5String.elements;
1291 td->elements_count = asn_DEF_IA5String.elements_count;
1292 td->specifics = asn_DEF_IA5String.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00001293}
1294
Lev Walkina9cc46e2004-09-22 16:06:28 +00001295void
Lev Walkindfae9752004-09-29 13:19:37 +00001296PER_Visible_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001297 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001298 PER_Visible_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001299 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00001300}
1301
1302int
Lev Walkindfae9752004-09-29 13:19:37 +00001303PER_Visible_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001304 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001305 PER_Visible_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00001306 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1307}
1308
Lev Walkindc06f6b2004-10-20 15:50:55 +00001309asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001310PER_Visible_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001311 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001312 PER_Visible_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001313 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001314}
1315
1316asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001317PER_Visible_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001318 void *structure, int tag_mode, ber_tlv_tag_t tag,
1319 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001320 PER_Visible_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001321 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1322}
1323
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001324asn_dec_rval_t
1325PER_Visible_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1326 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001327 PER_Visible_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001328 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1329}
1330
Lev Walkina9cc46e2004-09-22 16:06:28 +00001331asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001332PER_Visible_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001333 int ilevel, enum xer_encoder_flags_e flags,
1334 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001335 PER_Visible_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001336 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00001337}
1338
1339
1340/*** <<< STAT-DEFS [PER-Visible] >>> ***/
1341
Lev Walkine0272aa2005-03-04 11:26:08 +00001342static ber_tlv_tag_t asn_DEF_PER_Visible_0_tags[] = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001343 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1344};
Lev Walkindfae9752004-09-29 13:19:37 +00001345asn_TYPE_descriptor_t asn_DEF_PER_Visible = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001346 "PER-Visible",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001347 "PER-Visible",
Lev Walkina9cc46e2004-09-22 16:06:28 +00001348 PER_Visible_free,
1349 PER_Visible_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001350 PER_Visible_constraint,
1351 PER_Visible_decode_ber,
1352 PER_Visible_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001353 PER_Visible_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001354 PER_Visible_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00001355 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00001356 asn_DEF_PER_Visible_0_tags,
1357 sizeof(asn_DEF_PER_Visible_0_tags)
1358 /sizeof(asn_DEF_PER_Visible_0_tags[0]), /* 1 */
1359 asn_DEF_PER_Visible_0_tags, /* Same as above */
1360 sizeof(asn_DEF_PER_Visible_0_tags)
1361 /sizeof(asn_DEF_PER_Visible_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001362 0, 0, /* No members */
1363 0 /* No specifics */
1364};
1365
1366
1367/*** <<< INCLUDES [PER-Visible-2] >>> ***/
1368
1369#include <PER-Visible.h>
1370
1371/*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/
1372
1373
1374typedef PER_Visible_t PER_Visible_2_t;
1375
Lev Walkin006de1c2004-08-20 13:37:45 +00001376/*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/
1377
Lev Walkindfae9752004-09-29 13:19:37 +00001378extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001379asn_struct_free_f PER_Visible_2_free;
1380asn_struct_print_f PER_Visible_2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001381asn_constr_check_f PER_Visible_2_constraint;
1382ber_type_decoder_f PER_Visible_2_decode_ber;
1383der_type_encoder_f PER_Visible_2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001384xer_type_decoder_f PER_Visible_2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001385xer_type_encoder_f PER_Visible_2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001386
1387/*** <<< CTABLES [PER-Visible-2] >>> ***/
1388
Lev Walkin8a99bf72004-09-10 06:07:39 +00001389static int check_permitted_alphabet_5(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001390 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001391 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001392 const uint8_t *ch = st->buf;
1393 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001394
1395 for(; ch < end; ch++) {
1396 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00001397 if(!(cv >= 69 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001398 }
Lev Walkin775885e2004-08-22 12:47:03 +00001399 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001400}
1401
1402
1403/*** <<< CODE [PER-Visible-2] >>> ***/
1404
1405int
Lev Walkindfae9752004-09-29 13:19:37 +00001406PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001407 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001408 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001409
1410 if(!sptr) {
1411 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00001412 "%s: value not given (%s:%d)",
1413 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001414 return -1;
1415 }
1416
1417
Lev Walkin8a99bf72004-09-10 06:07:39 +00001418 if(!check_permitted_alphabet_5(sptr)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001419 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001420 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001421 } else {
1422 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00001423 "%s: constraint failed (%s:%d)",
1424 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001425 return -1;
1426 }
1427}
1428
1429/*
1430 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001431 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001432 */
1433static void
Lev Walkine0272aa2005-03-04 11:26:08 +00001434PER_Visible_2_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00001435 td->free_struct = asn_DEF_PER_Visible.free_struct;
1436 td->print_struct = asn_DEF_PER_Visible.print_struct;
1437 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
1438 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
1439 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
1440 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
1441 td->elements = asn_DEF_PER_Visible.elements;
1442 td->elements_count = asn_DEF_PER_Visible.elements_count;
1443 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00001444}
1445
Lev Walkina9cc46e2004-09-22 16:06:28 +00001446void
Lev Walkindfae9752004-09-29 13:19:37 +00001447PER_Visible_2_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001448 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001449 PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001450 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00001451}
1452
1453int
Lev Walkindfae9752004-09-29 13:19:37 +00001454PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001455 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001456 PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00001457 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1458}
1459
Lev Walkindc06f6b2004-10-20 15:50:55 +00001460asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001461PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001462 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001463 PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001464 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001465}
1466
1467asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001468PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001469 void *structure, int tag_mode, ber_tlv_tag_t tag,
1470 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001471 PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001472 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1473}
1474
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001475asn_dec_rval_t
1476PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1477 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001478 PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001479 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1480}
1481
Lev Walkina9cc46e2004-09-22 16:06:28 +00001482asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001483PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001484 int ilevel, enum xer_encoder_flags_e flags,
1485 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001486 PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001487 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00001488}
1489
1490
1491/*** <<< STAT-DEFS [PER-Visible-2] >>> ***/
1492
Lev Walkine0272aa2005-03-04 11:26:08 +00001493static ber_tlv_tag_t asn_DEF_PER_Visible_2_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001494 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001495};
Lev Walkindfae9752004-09-29 13:19:37 +00001496asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001497 "PER-Visible-2",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001498 "PER-Visible-2",
Lev Walkina9cc46e2004-09-22 16:06:28 +00001499 PER_Visible_2_free,
1500 PER_Visible_2_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001501 PER_Visible_2_constraint,
1502 PER_Visible_2_decode_ber,
1503 PER_Visible_2_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001504 PER_Visible_2_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001505 PER_Visible_2_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00001506 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00001507 asn_DEF_PER_Visible_2_0_tags,
1508 sizeof(asn_DEF_PER_Visible_2_0_tags)
1509 /sizeof(asn_DEF_PER_Visible_2_0_tags[0]), /* 1 */
1510 asn_DEF_PER_Visible_2_0_tags, /* Same as above */
1511 sizeof(asn_DEF_PER_Visible_2_0_tags)
1512 /sizeof(asn_DEF_PER_Visible_2_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001513 0, 0, /* No members */
1514 0 /* No specifics */
1515};
1516
1517
1518/*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/
1519
1520#include <PER-Visible.h>
1521
1522/*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/
1523
1524
1525typedef PER_Visible_t Not_PER_Visible_1_t;
1526
Lev Walkin006de1c2004-08-20 13:37:45 +00001527/*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/
1528
Lev Walkindfae9752004-09-29 13:19:37 +00001529extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001530asn_struct_free_f Not_PER_Visible_1_free;
1531asn_struct_print_f Not_PER_Visible_1_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001532asn_constr_check_f Not_PER_Visible_1_constraint;
1533ber_type_decoder_f Not_PER_Visible_1_decode_ber;
1534der_type_encoder_f Not_PER_Visible_1_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001535xer_type_decoder_f Not_PER_Visible_1_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001536xer_type_encoder_f Not_PER_Visible_1_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001537
1538/*** <<< CTABLES [Not-PER-Visible-1] >>> ***/
1539
Lev Walkin8a99bf72004-09-10 06:07:39 +00001540static int check_permitted_alphabet_6(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001541 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001542 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001543 const uint8_t *ch = st->buf;
1544 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001545
1546 for(; ch < end; ch++) {
1547 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00001548 if(!(cv >= 65 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001549 }
Lev Walkin775885e2004-08-22 12:47:03 +00001550 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001551}
1552
1553
1554/*** <<< CODE [Not-PER-Visible-1] >>> ***/
1555
1556int
Lev Walkindfae9752004-09-29 13:19:37 +00001557Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001558 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001559 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001560
1561 if(!sptr) {
1562 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00001563 "%s: value not given (%s:%d)",
1564 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001565 return -1;
1566 }
1567
1568
Lev Walkin8a99bf72004-09-10 06:07:39 +00001569 if(!check_permitted_alphabet_6(sptr)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001570 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001571 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001572 } else {
1573 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00001574 "%s: constraint failed (%s:%d)",
1575 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001576 return -1;
1577 }
1578}
1579
1580/*
1581 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001582 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001583 */
1584static void
Lev Walkine0272aa2005-03-04 11:26:08 +00001585Not_PER_Visible_1_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00001586 td->free_struct = asn_DEF_PER_Visible.free_struct;
1587 td->print_struct = asn_DEF_PER_Visible.print_struct;
1588 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
1589 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
1590 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
1591 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
1592 td->elements = asn_DEF_PER_Visible.elements;
1593 td->elements_count = asn_DEF_PER_Visible.elements_count;
1594 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00001595}
1596
Lev Walkina9cc46e2004-09-22 16:06:28 +00001597void
Lev Walkindfae9752004-09-29 13:19:37 +00001598Not_PER_Visible_1_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001599 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001600 Not_PER_Visible_1_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001601 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00001602}
1603
1604int
Lev Walkindfae9752004-09-29 13:19:37 +00001605Not_PER_Visible_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001606 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001607 Not_PER_Visible_1_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00001608 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1609}
1610
Lev Walkindc06f6b2004-10-20 15:50:55 +00001611asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001612Not_PER_Visible_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001613 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001614 Not_PER_Visible_1_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001615 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001616}
1617
1618asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001619Not_PER_Visible_1_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001620 void *structure, int tag_mode, ber_tlv_tag_t tag,
1621 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001622 Not_PER_Visible_1_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001623 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1624}
1625
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001626asn_dec_rval_t
1627Not_PER_Visible_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1628 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001629 Not_PER_Visible_1_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001630 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1631}
1632
Lev Walkina9cc46e2004-09-22 16:06:28 +00001633asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001634Not_PER_Visible_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001635 int ilevel, enum xer_encoder_flags_e flags,
1636 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001637 Not_PER_Visible_1_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001638 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00001639}
1640
1641
1642/*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/
1643
Lev Walkine0272aa2005-03-04 11:26:08 +00001644static ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001645 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001646};
Lev Walkindfae9752004-09-29 13:19:37 +00001647asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001648 "Not-PER-Visible-1",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001649 "Not-PER-Visible-1",
Lev Walkina9cc46e2004-09-22 16:06:28 +00001650 Not_PER_Visible_1_free,
1651 Not_PER_Visible_1_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001652 Not_PER_Visible_1_constraint,
1653 Not_PER_Visible_1_decode_ber,
1654 Not_PER_Visible_1_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001655 Not_PER_Visible_1_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001656 Not_PER_Visible_1_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00001657 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00001658 asn_DEF_Not_PER_Visible_1_0_tags,
1659 sizeof(asn_DEF_Not_PER_Visible_1_0_tags)
1660 /sizeof(asn_DEF_Not_PER_Visible_1_0_tags[0]), /* 1 */
1661 asn_DEF_Not_PER_Visible_1_0_tags, /* Same as above */
1662 sizeof(asn_DEF_Not_PER_Visible_1_0_tags)
1663 /sizeof(asn_DEF_Not_PER_Visible_1_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001664 0, 0, /* No members */
1665 0 /* No specifics */
1666};
1667
1668
1669/*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/
1670
1671#include <PER-Visible.h>
1672
1673/*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/
1674
1675
1676typedef PER_Visible_t Not_PER_Visible_2_t;
1677
Lev Walkin006de1c2004-08-20 13:37:45 +00001678/*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/
1679
Lev Walkindfae9752004-09-29 13:19:37 +00001680extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001681asn_struct_free_f Not_PER_Visible_2_free;
1682asn_struct_print_f Not_PER_Visible_2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001683asn_constr_check_f Not_PER_Visible_2_constraint;
1684ber_type_decoder_f Not_PER_Visible_2_decode_ber;
1685der_type_encoder_f Not_PER_Visible_2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001686xer_type_decoder_f Not_PER_Visible_2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001687xer_type_encoder_f Not_PER_Visible_2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001688
Lev Walkind35c8b52004-08-25 02:08:08 +00001689/*** <<< CTABLES [Not-PER-Visible-2] >>> ***/
1690
Lev Walkin8a99bf72004-09-10 06:07:39 +00001691static int check_permitted_alphabet_7(const void *sptr) {
Lev Walkind35c8b52004-08-25 02:08:08 +00001692 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001693 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +00001694 const uint8_t *ch = st->buf;
1695 const uint8_t *end = ch + st->size;
1696
1697 for(; ch < end; ch++) {
1698 uint8_t cv = *ch;
1699 if(!(cv >= 65 && cv <= 66)) return -1;
1700 }
1701 return 0;
1702}
1703
1704
Lev Walkin006de1c2004-08-20 13:37:45 +00001705/*** <<< CODE [Not-PER-Visible-2] >>> ***/
1706
1707int
Lev Walkindfae9752004-09-29 13:19:37 +00001708Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001709 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001710 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001711
1712 if(!sptr) {
1713 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00001714 "%s: value not given (%s:%d)",
1715 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001716 return -1;
1717 }
1718
1719
Lev Walkin8a99bf72004-09-10 06:07:39 +00001720 if(!check_permitted_alphabet_7(sptr)) {
Lev Walkind35c8b52004-08-25 02:08:08 +00001721 /* Constraint check succeeded */
1722 return 0;
1723 } else {
1724 _ASN_ERRLOG(app_errlog, app_key,
1725 "%s: constraint failed (%s:%d)",
1726 td->name, __FILE__, __LINE__);
1727 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001728 }
Lev Walkin006de1c2004-08-20 13:37:45 +00001729}
1730
1731/*
1732 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001733 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001734 */
1735static void
Lev Walkine0272aa2005-03-04 11:26:08 +00001736Not_PER_Visible_2_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00001737 td->free_struct = asn_DEF_PER_Visible.free_struct;
1738 td->print_struct = asn_DEF_PER_Visible.print_struct;
1739 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
1740 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
1741 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
1742 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
1743 td->elements = asn_DEF_PER_Visible.elements;
1744 td->elements_count = asn_DEF_PER_Visible.elements_count;
1745 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00001746}
1747
Lev Walkina9cc46e2004-09-22 16:06:28 +00001748void
Lev Walkindfae9752004-09-29 13:19:37 +00001749Not_PER_Visible_2_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001750 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001751 Not_PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001752 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00001753}
1754
1755int
Lev Walkindfae9752004-09-29 13:19:37 +00001756Not_PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001757 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001758 Not_PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00001759 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1760}
1761
Lev Walkindc06f6b2004-10-20 15:50:55 +00001762asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001763Not_PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001764 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001765 Not_PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001766 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001767}
1768
1769asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001770Not_PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001771 void *structure, int tag_mode, ber_tlv_tag_t tag,
1772 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001773 Not_PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001774 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1775}
1776
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001777asn_dec_rval_t
1778Not_PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1779 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001780 Not_PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001781 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1782}
1783
Lev Walkina9cc46e2004-09-22 16:06:28 +00001784asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001785Not_PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001786 int ilevel, enum xer_encoder_flags_e flags,
1787 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001788 Not_PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001789 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00001790}
1791
1792
1793/*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/
1794
Lev Walkine0272aa2005-03-04 11:26:08 +00001795static ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001796 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001797};
Lev Walkindfae9752004-09-29 13:19:37 +00001798asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001799 "Not-PER-Visible-2",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001800 "Not-PER-Visible-2",
Lev Walkina9cc46e2004-09-22 16:06:28 +00001801 Not_PER_Visible_2_free,
1802 Not_PER_Visible_2_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001803 Not_PER_Visible_2_constraint,
1804 Not_PER_Visible_2_decode_ber,
1805 Not_PER_Visible_2_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001806 Not_PER_Visible_2_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001807 Not_PER_Visible_2_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00001808 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00001809 asn_DEF_Not_PER_Visible_2_0_tags,
1810 sizeof(asn_DEF_Not_PER_Visible_2_0_tags)
1811 /sizeof(asn_DEF_Not_PER_Visible_2_0_tags[0]), /* 1 */
1812 asn_DEF_Not_PER_Visible_2_0_tags, /* Same as above */
1813 sizeof(asn_DEF_Not_PER_Visible_2_0_tags)
1814 /sizeof(asn_DEF_Not_PER_Visible_2_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001815 0, 0, /* No members */
1816 0 /* No specifics */
1817};
1818
1819
1820/*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/
1821
1822#include <PER-Visible.h>
1823
1824/*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/
1825
1826
1827typedef PER_Visible_t Not_PER_Visible_3_t;
1828
Lev Walkin006de1c2004-08-20 13:37:45 +00001829/*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/
1830
Lev Walkindfae9752004-09-29 13:19:37 +00001831extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001832asn_struct_free_f Not_PER_Visible_3_free;
1833asn_struct_print_f Not_PER_Visible_3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001834asn_constr_check_f Not_PER_Visible_3_constraint;
1835ber_type_decoder_f Not_PER_Visible_3_decode_ber;
1836der_type_encoder_f Not_PER_Visible_3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001837xer_type_decoder_f Not_PER_Visible_3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001838xer_type_encoder_f Not_PER_Visible_3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001839
Lev Walkind35c8b52004-08-25 02:08:08 +00001840/*** <<< CTABLES [Not-PER-Visible-3] >>> ***/
1841
Lev Walkin8a99bf72004-09-10 06:07:39 +00001842static int check_permitted_alphabet_8(const void *sptr) {
Lev Walkind35c8b52004-08-25 02:08:08 +00001843 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001844 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +00001845 const uint8_t *ch = st->buf;
1846 const uint8_t *end = ch + st->size;
1847
1848 for(; ch < end; ch++) {
1849 uint8_t cv = *ch;
1850 if(!(cv >= 65 && cv <= 66)) return -1;
1851 }
1852 return 0;
1853}
1854
1855
Lev Walkin006de1c2004-08-20 13:37:45 +00001856/*** <<< CODE [Not-PER-Visible-3] >>> ***/
1857
1858int
Lev Walkindfae9752004-09-29 13:19:37 +00001859Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001860 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001861 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001862
1863 if(!sptr) {
1864 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00001865 "%s: value not given (%s:%d)",
1866 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001867 return -1;
1868 }
1869
1870
Lev Walkin8a99bf72004-09-10 06:07:39 +00001871 if(!check_permitted_alphabet_8(sptr)) {
Lev Walkind35c8b52004-08-25 02:08:08 +00001872 /* Constraint check succeeded */
1873 return 0;
1874 } else {
1875 _ASN_ERRLOG(app_errlog, app_key,
1876 "%s: constraint failed (%s:%d)",
1877 td->name, __FILE__, __LINE__);
1878 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001879 }
Lev Walkin006de1c2004-08-20 13:37:45 +00001880}
1881
1882/*
1883 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001884 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001885 */
1886static void
Lev Walkine0272aa2005-03-04 11:26:08 +00001887Not_PER_Visible_3_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00001888 td->free_struct = asn_DEF_PER_Visible.free_struct;
1889 td->print_struct = asn_DEF_PER_Visible.print_struct;
1890 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
1891 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
1892 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
1893 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
1894 td->elements = asn_DEF_PER_Visible.elements;
1895 td->elements_count = asn_DEF_PER_Visible.elements_count;
1896 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00001897}
1898
Lev Walkina9cc46e2004-09-22 16:06:28 +00001899void
Lev Walkindfae9752004-09-29 13:19:37 +00001900Not_PER_Visible_3_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001901 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001902 Not_PER_Visible_3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001903 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00001904}
1905
1906int
Lev Walkindfae9752004-09-29 13:19:37 +00001907Not_PER_Visible_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001908 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001909 Not_PER_Visible_3_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00001910 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1911}
1912
Lev Walkindc06f6b2004-10-20 15:50:55 +00001913asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001914Not_PER_Visible_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001915 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001916 Not_PER_Visible_3_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001917 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001918}
1919
1920asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001921Not_PER_Visible_3_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001922 void *structure, int tag_mode, ber_tlv_tag_t tag,
1923 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001924 Not_PER_Visible_3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001925 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1926}
1927
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001928asn_dec_rval_t
1929Not_PER_Visible_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1930 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001931 Not_PER_Visible_3_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001932 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1933}
1934
Lev Walkina9cc46e2004-09-22 16:06:28 +00001935asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001936Not_PER_Visible_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001937 int ilevel, enum xer_encoder_flags_e flags,
1938 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001939 Not_PER_Visible_3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001940 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00001941}
1942
1943
1944/*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/
1945
Lev Walkine0272aa2005-03-04 11:26:08 +00001946static ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001947 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001948};
Lev Walkindfae9752004-09-29 13:19:37 +00001949asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001950 "Not-PER-Visible-3",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001951 "Not-PER-Visible-3",
Lev Walkina9cc46e2004-09-22 16:06:28 +00001952 Not_PER_Visible_3_free,
1953 Not_PER_Visible_3_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001954 Not_PER_Visible_3_constraint,
1955 Not_PER_Visible_3_decode_ber,
1956 Not_PER_Visible_3_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001957 Not_PER_Visible_3_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001958 Not_PER_Visible_3_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00001959 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00001960 asn_DEF_Not_PER_Visible_3_0_tags,
1961 sizeof(asn_DEF_Not_PER_Visible_3_0_tags)
1962 /sizeof(asn_DEF_Not_PER_Visible_3_0_tags[0]), /* 1 */
1963 asn_DEF_Not_PER_Visible_3_0_tags, /* Same as above */
1964 sizeof(asn_DEF_Not_PER_Visible_3_0_tags)
1965 /sizeof(asn_DEF_Not_PER_Visible_3_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001966 0, 0, /* No members */
1967 0 /* No specifics */
1968};
1969
1970
1971/*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/
1972
1973#include <PER-Visible.h>
1974
1975/*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/
1976
1977
1978typedef PER_Visible_t SIZE_but_not_FROM_t;
1979
Lev Walkin006de1c2004-08-20 13:37:45 +00001980/*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/
1981
Lev Walkindfae9752004-09-29 13:19:37 +00001982extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001983asn_struct_free_f SIZE_but_not_FROM_free;
1984asn_struct_print_f SIZE_but_not_FROM_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001985asn_constr_check_f SIZE_but_not_FROM_constraint;
1986ber_type_decoder_f SIZE_but_not_FROM_decode_ber;
1987der_type_encoder_f SIZE_but_not_FROM_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001988xer_type_decoder_f SIZE_but_not_FROM_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001989xer_type_encoder_f SIZE_but_not_FROM_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001990
1991/*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/
1992
Lev Walkin8a99bf72004-09-10 06:07:39 +00001993static int check_permitted_alphabet_9(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001994 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001995 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001996 const uint8_t *ch = st->buf;
1997 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001998
1999 for(; ch < end; ch++) {
2000 uint8_t cv = *ch;
Lev Walkind35c8b52004-08-25 02:08:08 +00002001 if(!(cv >= 65 && cv <= 68)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00002002 }
Lev Walkin775885e2004-08-22 12:47:03 +00002003 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002004}
2005
2006
2007/*** <<< CODE [SIZE-but-not-FROM] >>> ***/
2008
2009int
Lev Walkindfae9752004-09-29 13:19:37 +00002010SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002011 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002012 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00002013 size_t size;
2014
2015 if(!sptr) {
2016 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002017 "%s: value not given (%s:%d)",
2018 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002019 return -1;
2020 }
2021
2022 size = st->size;
2023
2024 if((size >= 1 && size <= 4)
Lev Walkin8a99bf72004-09-10 06:07:39 +00002025 && !check_permitted_alphabet_9(sptr)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00002026 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00002027 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002028 } else {
2029 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002030 "%s: constraint failed (%s:%d)",
2031 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002032 return -1;
2033 }
2034}
2035
2036/*
2037 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00002038 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00002039 */
2040static void
Lev Walkine0272aa2005-03-04 11:26:08 +00002041SIZE_but_not_FROM_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00002042 td->free_struct = asn_DEF_PER_Visible.free_struct;
2043 td->print_struct = asn_DEF_PER_Visible.print_struct;
2044 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2045 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2046 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2047 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2048 td->elements = asn_DEF_PER_Visible.elements;
2049 td->elements_count = asn_DEF_PER_Visible.elements_count;
2050 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00002051}
2052
Lev Walkina9cc46e2004-09-22 16:06:28 +00002053void
Lev Walkindfae9752004-09-29 13:19:37 +00002054SIZE_but_not_FROM_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002055 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002056 SIZE_but_not_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002057 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00002058}
2059
2060int
Lev Walkindfae9752004-09-29 13:19:37 +00002061SIZE_but_not_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002062 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002063 SIZE_but_not_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00002064 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2065}
2066
Lev Walkindc06f6b2004-10-20 15:50:55 +00002067asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002068SIZE_but_not_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002069 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002070 SIZE_but_not_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00002071 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002072}
2073
2074asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002075SIZE_but_not_FROM_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002076 void *structure, int tag_mode, ber_tlv_tag_t tag,
2077 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002078 SIZE_but_not_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002079 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2080}
2081
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002082asn_dec_rval_t
2083SIZE_but_not_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2084 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002085 SIZE_but_not_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002086 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2087}
2088
Lev Walkina9cc46e2004-09-22 16:06:28 +00002089asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002090SIZE_but_not_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002091 int ilevel, enum xer_encoder_flags_e flags,
2092 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002093 SIZE_but_not_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002094 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00002095}
2096
2097
2098/*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/
2099
Lev Walkine0272aa2005-03-04 11:26:08 +00002100static ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00002101 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00002102};
Lev Walkindfae9752004-09-29 13:19:37 +00002103asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = {
Lev Walkin006de1c2004-08-20 13:37:45 +00002104 "SIZE-but-not-FROM",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002105 "SIZE-but-not-FROM",
Lev Walkina9cc46e2004-09-22 16:06:28 +00002106 SIZE_but_not_FROM_free,
2107 SIZE_but_not_FROM_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00002108 SIZE_but_not_FROM_constraint,
2109 SIZE_but_not_FROM_decode_ber,
2110 SIZE_but_not_FROM_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002111 SIZE_but_not_FROM_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002112 SIZE_but_not_FROM_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00002113 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00002114 asn_DEF_SIZE_but_not_FROM_0_tags,
2115 sizeof(asn_DEF_SIZE_but_not_FROM_0_tags)
2116 /sizeof(asn_DEF_SIZE_but_not_FROM_0_tags[0]), /* 1 */
2117 asn_DEF_SIZE_but_not_FROM_0_tags, /* Same as above */
2118 sizeof(asn_DEF_SIZE_but_not_FROM_0_tags)
2119 /sizeof(asn_DEF_SIZE_but_not_FROM_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00002120 0, 0, /* No members */
2121 0 /* No specifics */
2122};
2123
2124
2125/*** <<< INCLUDES [SIZE-and-FROM] >>> ***/
2126
2127#include <PER-Visible.h>
2128
2129/*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/
2130
2131
2132typedef PER_Visible_t SIZE_and_FROM_t;
2133
Lev Walkin006de1c2004-08-20 13:37:45 +00002134/*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/
2135
Lev Walkindfae9752004-09-29 13:19:37 +00002136extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002137asn_struct_free_f SIZE_and_FROM_free;
2138asn_struct_print_f SIZE_and_FROM_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00002139asn_constr_check_f SIZE_and_FROM_constraint;
2140ber_type_decoder_f SIZE_and_FROM_decode_ber;
2141der_type_encoder_f SIZE_and_FROM_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002142xer_type_decoder_f SIZE_and_FROM_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002143xer_type_encoder_f SIZE_and_FROM_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00002144
2145/*** <<< CTABLES [SIZE-and-FROM] >>> ***/
2146
Lev Walkin8a99bf72004-09-10 06:07:39 +00002147static int check_permitted_alphabet_10(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00002148 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002149 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00002150 const uint8_t *ch = st->buf;
2151 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00002152
2153 for(; ch < end; ch++) {
2154 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00002155 if(!(cv >= 65 && cv <= 68)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00002156 }
Lev Walkin775885e2004-08-22 12:47:03 +00002157 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002158}
2159
2160
2161/*** <<< CODE [SIZE-and-FROM] >>> ***/
2162
2163int
Lev Walkindfae9752004-09-29 13:19:37 +00002164SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002165 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002166 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00002167 size_t size;
2168
2169 if(!sptr) {
2170 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002171 "%s: value not given (%s:%d)",
2172 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002173 return -1;
2174 }
2175
2176 size = st->size;
2177
2178 if((size >= 1 && size <= 4)
Lev Walkin8a99bf72004-09-10 06:07:39 +00002179 && !check_permitted_alphabet_10(sptr)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00002180 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00002181 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002182 } else {
2183 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002184 "%s: constraint failed (%s:%d)",
2185 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002186 return -1;
2187 }
2188}
2189
2190/*
2191 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00002192 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00002193 */
2194static void
Lev Walkine0272aa2005-03-04 11:26:08 +00002195SIZE_and_FROM_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00002196 td->free_struct = asn_DEF_PER_Visible.free_struct;
2197 td->print_struct = asn_DEF_PER_Visible.print_struct;
2198 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2199 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2200 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2201 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2202 td->elements = asn_DEF_PER_Visible.elements;
2203 td->elements_count = asn_DEF_PER_Visible.elements_count;
2204 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00002205}
2206
Lev Walkina9cc46e2004-09-22 16:06:28 +00002207void
Lev Walkindfae9752004-09-29 13:19:37 +00002208SIZE_and_FROM_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002209 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002210 SIZE_and_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002211 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00002212}
2213
2214int
Lev Walkindfae9752004-09-29 13:19:37 +00002215SIZE_and_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002216 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002217 SIZE_and_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00002218 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2219}
2220
Lev Walkindc06f6b2004-10-20 15:50:55 +00002221asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002222SIZE_and_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002223 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002224 SIZE_and_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00002225 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002226}
2227
2228asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002229SIZE_and_FROM_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002230 void *structure, int tag_mode, ber_tlv_tag_t tag,
2231 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002232 SIZE_and_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002233 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2234}
2235
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002236asn_dec_rval_t
2237SIZE_and_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2238 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002239 SIZE_and_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002240 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2241}
2242
Lev Walkina9cc46e2004-09-22 16:06:28 +00002243asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002244SIZE_and_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002245 int ilevel, enum xer_encoder_flags_e flags,
2246 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002247 SIZE_and_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002248 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00002249}
2250
2251
2252/*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/
2253
Lev Walkine0272aa2005-03-04 11:26:08 +00002254static ber_tlv_tag_t asn_DEF_SIZE_and_FROM_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00002255 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00002256};
Lev Walkindfae9752004-09-29 13:19:37 +00002257asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = {
Lev Walkin006de1c2004-08-20 13:37:45 +00002258 "SIZE-and-FROM",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002259 "SIZE-and-FROM",
Lev Walkina9cc46e2004-09-22 16:06:28 +00002260 SIZE_and_FROM_free,
2261 SIZE_and_FROM_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00002262 SIZE_and_FROM_constraint,
2263 SIZE_and_FROM_decode_ber,
2264 SIZE_and_FROM_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002265 SIZE_and_FROM_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002266 SIZE_and_FROM_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00002267 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00002268 asn_DEF_SIZE_and_FROM_0_tags,
2269 sizeof(asn_DEF_SIZE_and_FROM_0_tags)
2270 /sizeof(asn_DEF_SIZE_and_FROM_0_tags[0]), /* 1 */
2271 asn_DEF_SIZE_and_FROM_0_tags, /* Same as above */
2272 sizeof(asn_DEF_SIZE_and_FROM_0_tags)
2273 /sizeof(asn_DEF_SIZE_and_FROM_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00002274 0, 0, /* No members */
2275 0 /* No specifics */
2276};
2277
2278
2279/*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/
2280
2281#include <PER-Visible.h>
2282
2283/*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/
2284
2285
2286typedef PER_Visible_t Neither_SIZE_nor_FROM_t;
2287
Lev Walkin006de1c2004-08-20 13:37:45 +00002288/*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/
2289
Lev Walkindfae9752004-09-29 13:19:37 +00002290extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002291asn_struct_free_f Neither_SIZE_nor_FROM_free;
2292asn_struct_print_f Neither_SIZE_nor_FROM_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00002293asn_constr_check_f Neither_SIZE_nor_FROM_constraint;
2294ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber;
2295der_type_encoder_f Neither_SIZE_nor_FROM_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002296xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002297xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00002298
2299/*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/
2300
Lev Walkin8a99bf72004-09-10 06:07:39 +00002301static int check_permitted_alphabet_11(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00002302 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002303 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00002304 const uint8_t *ch = st->buf;
2305 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00002306
2307 for(; ch < end; ch++) {
2308 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00002309 if(!(cv >= 65 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00002310 }
Lev Walkin775885e2004-08-22 12:47:03 +00002311 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002312}
2313
2314
2315/*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/
2316
2317int
Lev Walkindfae9752004-09-29 13:19:37 +00002318Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002319 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002320 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00002321
2322 if(!sptr) {
2323 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002324 "%s: value not given (%s:%d)",
2325 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002326 return -1;
2327 }
2328
2329
Lev Walkin8a99bf72004-09-10 06:07:39 +00002330 if(!check_permitted_alphabet_11(sptr)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00002331 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00002332 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002333 } else {
2334 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002335 "%s: constraint failed (%s:%d)",
2336 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002337 return -1;
2338 }
2339}
2340
2341/*
2342 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00002343 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00002344 */
2345static void
Lev Walkine0272aa2005-03-04 11:26:08 +00002346Neither_SIZE_nor_FROM_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00002347 td->free_struct = asn_DEF_PER_Visible.free_struct;
2348 td->print_struct = asn_DEF_PER_Visible.print_struct;
2349 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2350 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2351 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2352 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2353 td->elements = asn_DEF_PER_Visible.elements;
2354 td->elements_count = asn_DEF_PER_Visible.elements_count;
2355 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00002356}
2357
Lev Walkina9cc46e2004-09-22 16:06:28 +00002358void
Lev Walkindfae9752004-09-29 13:19:37 +00002359Neither_SIZE_nor_FROM_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002360 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002361 Neither_SIZE_nor_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002362 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00002363}
2364
2365int
Lev Walkindfae9752004-09-29 13:19:37 +00002366Neither_SIZE_nor_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002367 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002368 Neither_SIZE_nor_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00002369 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2370}
2371
Lev Walkindc06f6b2004-10-20 15:50:55 +00002372asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002373Neither_SIZE_nor_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002374 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002375 Neither_SIZE_nor_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00002376 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002377}
2378
2379asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002380Neither_SIZE_nor_FROM_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002381 void *structure, int tag_mode, ber_tlv_tag_t tag,
2382 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002383 Neither_SIZE_nor_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002384 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2385}
2386
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002387asn_dec_rval_t
2388Neither_SIZE_nor_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2389 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002390 Neither_SIZE_nor_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002391 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2392}
2393
Lev Walkina9cc46e2004-09-22 16:06:28 +00002394asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002395Neither_SIZE_nor_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002396 int ilevel, enum xer_encoder_flags_e flags,
2397 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002398 Neither_SIZE_nor_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002399 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00002400}
2401
2402
2403/*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/
2404
Lev Walkine0272aa2005-03-04 11:26:08 +00002405static ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00002406 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00002407};
Lev Walkindfae9752004-09-29 13:19:37 +00002408asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = {
Lev Walkin006de1c2004-08-20 13:37:45 +00002409 "Neither-SIZE-nor-FROM",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002410 "Neither-SIZE-nor-FROM",
Lev Walkina9cc46e2004-09-22 16:06:28 +00002411 Neither_SIZE_nor_FROM_free,
2412 Neither_SIZE_nor_FROM_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00002413 Neither_SIZE_nor_FROM_constraint,
2414 Neither_SIZE_nor_FROM_decode_ber,
2415 Neither_SIZE_nor_FROM_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002416 Neither_SIZE_nor_FROM_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002417 Neither_SIZE_nor_FROM_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00002418 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00002419 asn_DEF_Neither_SIZE_nor_FROM_0_tags,
2420 sizeof(asn_DEF_Neither_SIZE_nor_FROM_0_tags)
2421 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_0_tags[0]), /* 1 */
2422 asn_DEF_Neither_SIZE_nor_FROM_0_tags, /* Same as above */
2423 sizeof(asn_DEF_Neither_SIZE_nor_FROM_0_tags)
2424 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00002425 0, 0, /* No members */
2426 0 /* No specifics */
2427};
2428
2429
Lev Walkin55cc44a2004-10-03 09:14:32 +00002430/*** <<< INCLUDES [Utf8-4] >>> ***/
2431
2432#include <UTF8String.h>
2433
2434/*** <<< TYPE-DECLS [Utf8-4] >>> ***/
2435
2436
2437typedef UTF8String_t Utf8_4_t;
2438
2439/*** <<< FUNC-DECLS [Utf8-4] >>> ***/
2440
2441extern asn_TYPE_descriptor_t asn_DEF_Utf8_4;
2442asn_struct_free_f Utf8_4_free;
2443asn_struct_print_f Utf8_4_print;
2444asn_constr_check_f Utf8_4_constraint;
2445ber_type_decoder_f Utf8_4_decode_ber;
2446der_type_encoder_f Utf8_4_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002447xer_type_decoder_f Utf8_4_decode_xer;
Lev Walkin55cc44a2004-10-03 09:14:32 +00002448xer_type_encoder_f Utf8_4_encode_xer;
2449
2450/*** <<< CTABLES [Utf8-4] >>> ***/
2451
2452static int check_permitted_alphabet_12(const void *sptr) {
2453 if(UTF8String_length((const UTF8String_t *)sptr) < 0)
2454 return -1; /* Alphabet (sic!) test failed. */
2455
2456 return 0;
2457}
2458
2459
2460/*** <<< CODE [Utf8-4] >>> ***/
2461
2462int
2463Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
2464 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002465 const UTF8String_t *st = (const UTF8String_t *)sptr;
Lev Walkin55cc44a2004-10-03 09:14:32 +00002466
2467 if(!sptr) {
2468 _ASN_ERRLOG(app_errlog, app_key,
2469 "%s: value not given (%s:%d)",
2470 td->name, __FILE__, __LINE__);
2471 return -1;
2472 }
2473
2474
2475 if(!check_permitted_alphabet_12(sptr)) {
2476 /* Constraint check succeeded */
2477 return 0;
2478 } else {
2479 _ASN_ERRLOG(app_errlog, app_key,
2480 "%s: constraint failed (%s:%d)",
2481 td->name, __FILE__, __LINE__);
2482 return -1;
2483 }
2484}
2485
2486/*
2487 * This type is implemented using UTF8String,
2488 * so here we adjust the DEF accordingly.
2489 */
2490static void
Lev Walkine0272aa2005-03-04 11:26:08 +00002491Utf8_4_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin55cc44a2004-10-03 09:14:32 +00002492 td->free_struct = asn_DEF_UTF8String.free_struct;
2493 td->print_struct = asn_DEF_UTF8String.print_struct;
2494 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
2495 td->der_encoder = asn_DEF_UTF8String.der_encoder;
2496 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
2497 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
2498 td->elements = asn_DEF_UTF8String.elements;
2499 td->elements_count = asn_DEF_UTF8String.elements_count;
2500 td->specifics = asn_DEF_UTF8String.specifics;
2501}
2502
2503void
2504Utf8_4_free(asn_TYPE_descriptor_t *td,
2505 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002506 Utf8_4_0_inherit_TYPE_descriptor(td);
Lev Walkin55cc44a2004-10-03 09:14:32 +00002507 td->free_struct(td, struct_ptr, contents_only);
2508}
2509
2510int
2511Utf8_4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2512 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002513 Utf8_4_0_inherit_TYPE_descriptor(td);
Lev Walkin55cc44a2004-10-03 09:14:32 +00002514 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2515}
2516
Lev Walkindc06f6b2004-10-20 15:50:55 +00002517asn_dec_rval_t
Lev Walkin55cc44a2004-10-03 09:14:32 +00002518Utf8_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2519 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002520 Utf8_4_0_inherit_TYPE_descriptor(td);
Lev Walkin55cc44a2004-10-03 09:14:32 +00002521 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2522}
2523
2524asn_enc_rval_t
2525Utf8_4_encode_der(asn_TYPE_descriptor_t *td,
2526 void *structure, int tag_mode, ber_tlv_tag_t tag,
2527 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002528 Utf8_4_0_inherit_TYPE_descriptor(td);
Lev Walkin55cc44a2004-10-03 09:14:32 +00002529 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2530}
2531
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002532asn_dec_rval_t
2533Utf8_4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2534 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002535 Utf8_4_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002536 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2537}
2538
Lev Walkin55cc44a2004-10-03 09:14:32 +00002539asn_enc_rval_t
2540Utf8_4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2541 int ilevel, enum xer_encoder_flags_e flags,
2542 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002543 Utf8_4_0_inherit_TYPE_descriptor(td);
Lev Walkin55cc44a2004-10-03 09:14:32 +00002544 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2545}
2546
2547
2548/*** <<< STAT-DEFS [Utf8-4] >>> ***/
2549
Lev Walkine0272aa2005-03-04 11:26:08 +00002550static ber_tlv_tag_t asn_DEF_Utf8_4_0_tags[] = {
Lev Walkin55cc44a2004-10-03 09:14:32 +00002551 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
2552};
2553asn_TYPE_descriptor_t asn_DEF_Utf8_4 = {
2554 "Utf8-4",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002555 "Utf8-4",
Lev Walkin55cc44a2004-10-03 09:14:32 +00002556 Utf8_4_free,
2557 Utf8_4_print,
2558 Utf8_4_constraint,
2559 Utf8_4_decode_ber,
2560 Utf8_4_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002561 Utf8_4_decode_xer,
Lev Walkin55cc44a2004-10-03 09:14:32 +00002562 Utf8_4_encode_xer,
2563 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00002564 asn_DEF_Utf8_4_0_tags,
2565 sizeof(asn_DEF_Utf8_4_0_tags)
2566 /sizeof(asn_DEF_Utf8_4_0_tags[0]), /* 1 */
2567 asn_DEF_Utf8_4_0_tags, /* Same as above */
2568 sizeof(asn_DEF_Utf8_4_0_tags)
2569 /sizeof(asn_DEF_Utf8_4_0_tags[0]), /* 1 */
Lev Walkin55cc44a2004-10-03 09:14:32 +00002570 0, 0, /* No members */
2571 0 /* No specifics */
2572};
2573
2574
Lev Walkin006de1c2004-08-20 13:37:45 +00002575/*** <<< INCLUDES [Utf8-3] >>> ***/
2576
2577#include <Utf8-2.h>
2578
2579/*** <<< TYPE-DECLS [Utf8-3] >>> ***/
2580
2581
2582typedef Utf8_2_t Utf8_3_t;
2583
Lev Walkin006de1c2004-08-20 13:37:45 +00002584/*** <<< FUNC-DECLS [Utf8-3] >>> ***/
2585
Lev Walkindfae9752004-09-29 13:19:37 +00002586extern asn_TYPE_descriptor_t asn_DEF_Utf8_3;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002587asn_struct_free_f Utf8_3_free;
2588asn_struct_print_f Utf8_3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00002589asn_constr_check_f Utf8_3_constraint;
2590ber_type_decoder_f Utf8_3_decode_ber;
2591der_type_encoder_f Utf8_3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002592xer_type_decoder_f Utf8_3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002593xer_type_encoder_f Utf8_3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00002594
2595/*** <<< CTABLES [Utf8-3] >>> ***/
2596
Lev Walkin55cc44a2004-10-03 09:14:32 +00002597static int permitted_alphabet_table_13[128] = {
Lev Walkin006de1c2004-08-20 13:37:45 +000025980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
25990,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
26000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
26010,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
26020,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ABCDEFGHIJKLMNO */
26031,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, /* PQRSTUVWXYZ */
26040,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* abcdefghijklmno */
26051,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, /* pqrstuvwxyz */
2606};
2607
Lev Walkin55cc44a2004-10-03 09:14:32 +00002608static int check_permitted_alphabet_13(const void *sptr) {
2609 int *table = permitted_alphabet_table_13;
Lev Walkin006de1c2004-08-20 13:37:45 +00002610 /* The underlying type is UTF8String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002611 const UTF8String_t *st = (const UTF8String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00002612 const uint8_t *ch = st->buf;
2613 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00002614
2615 for(; ch < end; ch++) {
2616 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00002617 if(cv >= 0x80) return -1;
2618 if(!table[cv]) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00002619 }
Lev Walkin775885e2004-08-22 12:47:03 +00002620 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002621}
2622
2623
2624/*** <<< CODE [Utf8-3] >>> ***/
2625
2626int
Lev Walkindfae9752004-09-29 13:19:37 +00002627Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002628 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002629 const Utf8_2_t *st = (const Utf8_2_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00002630 size_t size;
2631
2632 if(!sptr) {
2633 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002634 "%s: value not given (%s:%d)",
2635 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002636 return -1;
2637 }
2638
Lev Walkinfac2e942004-10-02 16:33:46 +00002639 size = UTF8String_length(st);
Lev Walkin00df16d2004-10-02 16:44:30 +00002640 if((ssize_t)size < 0) {
Lev Walkinfac2e942004-10-02 16:33:46 +00002641 _ASN_ERRLOG(app_errlog, app_key,
2642 "%s: UTF-8: broken encoding (%s:%d)",
2643 td->name, __FILE__, __LINE__);
2644 return -1;
2645 }
Lev Walkin006de1c2004-08-20 13:37:45 +00002646
2647 if((size >= 1 && size <= 2)
Lev Walkin55cc44a2004-10-03 09:14:32 +00002648 && !check_permitted_alphabet_13(sptr)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00002649 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00002650 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002651 } else {
2652 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002653 "%s: constraint failed (%s:%d)",
2654 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002655 return -1;
2656 }
2657}
2658
2659/*
2660 * This type is implemented using Utf8_2,
Lev Walkinc3808c12004-09-23 22:14:58 +00002661 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00002662 */
2663static void
Lev Walkine0272aa2005-03-04 11:26:08 +00002664Utf8_3_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00002665 td->free_struct = asn_DEF_Utf8_2.free_struct;
2666 td->print_struct = asn_DEF_Utf8_2.print_struct;
2667 td->ber_decoder = asn_DEF_Utf8_2.ber_decoder;
2668 td->der_encoder = asn_DEF_Utf8_2.der_encoder;
2669 td->xer_decoder = asn_DEF_Utf8_2.xer_decoder;
2670 td->xer_encoder = asn_DEF_Utf8_2.xer_encoder;
2671 td->elements = asn_DEF_Utf8_2.elements;
2672 td->elements_count = asn_DEF_Utf8_2.elements_count;
2673 td->specifics = asn_DEF_Utf8_2.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00002674}
2675
Lev Walkina9cc46e2004-09-22 16:06:28 +00002676void
Lev Walkindfae9752004-09-29 13:19:37 +00002677Utf8_3_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002678 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002679 Utf8_3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002680 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00002681}
2682
2683int
Lev Walkindfae9752004-09-29 13:19:37 +00002684Utf8_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002685 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002686 Utf8_3_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00002687 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2688}
2689
Lev Walkindc06f6b2004-10-20 15:50:55 +00002690asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002691Utf8_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002692 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002693 Utf8_3_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00002694 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002695}
2696
2697asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002698Utf8_3_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002699 void *structure, int tag_mode, ber_tlv_tag_t tag,
2700 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002701 Utf8_3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002702 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2703}
2704
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002705asn_dec_rval_t
2706Utf8_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2707 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002708 Utf8_3_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002709 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2710}
2711
Lev Walkina9cc46e2004-09-22 16:06:28 +00002712asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002713Utf8_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002714 int ilevel, enum xer_encoder_flags_e flags,
2715 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002716 Utf8_3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002717 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00002718}
2719
2720
2721/*** <<< STAT-DEFS [Utf8-3] >>> ***/
2722
Lev Walkine0272aa2005-03-04 11:26:08 +00002723static ber_tlv_tag_t asn_DEF_Utf8_3_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00002724 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00002725};
Lev Walkindfae9752004-09-29 13:19:37 +00002726asn_TYPE_descriptor_t asn_DEF_Utf8_3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00002727 "Utf8-3",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002728 "Utf8-3",
Lev Walkina9cc46e2004-09-22 16:06:28 +00002729 Utf8_3_free,
2730 Utf8_3_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00002731 Utf8_3_constraint,
2732 Utf8_3_decode_ber,
2733 Utf8_3_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002734 Utf8_3_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002735 Utf8_3_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00002736 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00002737 asn_DEF_Utf8_3_0_tags,
2738 sizeof(asn_DEF_Utf8_3_0_tags)
2739 /sizeof(asn_DEF_Utf8_3_0_tags[0]), /* 1 */
2740 asn_DEF_Utf8_3_0_tags, /* Same as above */
2741 sizeof(asn_DEF_Utf8_3_0_tags)
2742 /sizeof(asn_DEF_Utf8_3_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00002743 0, 0, /* No members */
2744 0 /* No specifics */
2745};
2746
2747
2748/*** <<< INCLUDES [Utf8-2] >>> ***/
2749
2750#include <Utf8-1.h>
2751
2752/*** <<< TYPE-DECLS [Utf8-2] >>> ***/
2753
2754
2755typedef Utf8_1_t Utf8_2_t;
2756
Lev Walkin006de1c2004-08-20 13:37:45 +00002757/*** <<< FUNC-DECLS [Utf8-2] >>> ***/
2758
Lev Walkindfae9752004-09-29 13:19:37 +00002759extern asn_TYPE_descriptor_t asn_DEF_Utf8_2;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002760asn_struct_free_f Utf8_2_free;
2761asn_struct_print_f Utf8_2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00002762asn_constr_check_f Utf8_2_constraint;
2763ber_type_decoder_f Utf8_2_decode_ber;
2764der_type_encoder_f Utf8_2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002765xer_type_decoder_f Utf8_2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002766xer_type_encoder_f Utf8_2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00002767
2768/*** <<< CODE [Utf8-2] >>> ***/
2769
2770int
Lev Walkindfae9752004-09-29 13:19:37 +00002771Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002772 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002773 const Utf8_1_t *st = (const Utf8_1_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00002774 size_t size;
2775
2776 if(!sptr) {
2777 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002778 "%s: value not given (%s:%d)",
2779 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002780 return -1;
2781 }
2782
Lev Walkinfac2e942004-10-02 16:33:46 +00002783 size = UTF8String_length(st);
Lev Walkin00df16d2004-10-02 16:44:30 +00002784 if((ssize_t)size < 0) {
Lev Walkinfac2e942004-10-02 16:33:46 +00002785 _ASN_ERRLOG(app_errlog, app_key,
2786 "%s: UTF-8: broken encoding (%s:%d)",
2787 td->name, __FILE__, __LINE__);
2788 return -1;
2789 }
Lev Walkin006de1c2004-08-20 13:37:45 +00002790
2791 if((size >= 1 && size <= 2)) {
2792 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00002793 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002794 } else {
2795 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002796 "%s: constraint failed (%s:%d)",
2797 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002798 return -1;
2799 }
2800}
2801
2802/*
2803 * This type is implemented using Utf8_1,
Lev Walkinc3808c12004-09-23 22:14:58 +00002804 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00002805 */
2806static void
Lev Walkine0272aa2005-03-04 11:26:08 +00002807Utf8_2_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00002808 td->free_struct = asn_DEF_Utf8_1.free_struct;
2809 td->print_struct = asn_DEF_Utf8_1.print_struct;
2810 td->ber_decoder = asn_DEF_Utf8_1.ber_decoder;
2811 td->der_encoder = asn_DEF_Utf8_1.der_encoder;
2812 td->xer_decoder = asn_DEF_Utf8_1.xer_decoder;
2813 td->xer_encoder = asn_DEF_Utf8_1.xer_encoder;
2814 td->elements = asn_DEF_Utf8_1.elements;
2815 td->elements_count = asn_DEF_Utf8_1.elements_count;
2816 td->specifics = asn_DEF_Utf8_1.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00002817}
2818
Lev Walkina9cc46e2004-09-22 16:06:28 +00002819void
Lev Walkindfae9752004-09-29 13:19:37 +00002820Utf8_2_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002821 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002822 Utf8_2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002823 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00002824}
2825
2826int
Lev Walkindfae9752004-09-29 13:19:37 +00002827Utf8_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002828 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002829 Utf8_2_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00002830 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2831}
2832
Lev Walkindc06f6b2004-10-20 15:50:55 +00002833asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002834Utf8_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002835 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002836 Utf8_2_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00002837 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002838}
2839
2840asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002841Utf8_2_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002842 void *structure, int tag_mode, ber_tlv_tag_t tag,
2843 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002844 Utf8_2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002845 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2846}
2847
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002848asn_dec_rval_t
2849Utf8_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2850 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002851 Utf8_2_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002852 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2853}
2854
Lev Walkina9cc46e2004-09-22 16:06:28 +00002855asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002856Utf8_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002857 int ilevel, enum xer_encoder_flags_e flags,
2858 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002859 Utf8_2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002860 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00002861}
2862
2863
2864/*** <<< STAT-DEFS [Utf8-2] >>> ***/
2865
Lev Walkine0272aa2005-03-04 11:26:08 +00002866static ber_tlv_tag_t asn_DEF_Utf8_2_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00002867 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00002868};
Lev Walkindfae9752004-09-29 13:19:37 +00002869asn_TYPE_descriptor_t asn_DEF_Utf8_2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00002870 "Utf8-2",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002871 "Utf8-2",
Lev Walkina9cc46e2004-09-22 16:06:28 +00002872 Utf8_2_free,
2873 Utf8_2_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00002874 Utf8_2_constraint,
2875 Utf8_2_decode_ber,
2876 Utf8_2_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002877 Utf8_2_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002878 Utf8_2_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00002879 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00002880 asn_DEF_Utf8_2_0_tags,
2881 sizeof(asn_DEF_Utf8_2_0_tags)
2882 /sizeof(asn_DEF_Utf8_2_0_tags[0]), /* 1 */
2883 asn_DEF_Utf8_2_0_tags, /* Same as above */
2884 sizeof(asn_DEF_Utf8_2_0_tags)
2885 /sizeof(asn_DEF_Utf8_2_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00002886 0, 0, /* No members */
2887 0 /* No specifics */
2888};
2889
2890
2891/*** <<< INCLUDES [Utf8-1] >>> ***/
2892
2893#include <UTF8String.h>
2894
2895/*** <<< TYPE-DECLS [Utf8-1] >>> ***/
2896
2897
2898typedef UTF8String_t Utf8_1_t;
2899
Lev Walkin006de1c2004-08-20 13:37:45 +00002900/*** <<< FUNC-DECLS [Utf8-1] >>> ***/
2901
Lev Walkin154aa182004-09-26 13:12:56 +00002902/* This type is equivalent to UTF8String */
Lev Walkindfae9752004-09-29 13:19:37 +00002903#define asn_DEF_Utf8_1 asn_DEF_UTF8String
Lev Walkin006de1c2004-08-20 13:37:45 +00002904
2905/*** <<< CODE [Utf8-1] >>> ***/
2906
Lev Walkin154aa182004-09-26 13:12:56 +00002907/* This type is equivalent to UTF8String */
Lev Walkin006de1c2004-08-20 13:37:45 +00002908
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002909
2910/*** <<< INCLUDES [VisibleIdentifier] >>> ***/
2911
2912#include <Identifier.h>
2913
2914/*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/
2915
2916
2917typedef Identifier_t VisibleIdentifier_t;
2918
2919/*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/
2920
Lev Walkin154aa182004-09-26 13:12:56 +00002921/* This type is equivalent to Identifier */
Lev Walkindfae9752004-09-29 13:19:37 +00002922#define asn_DEF_VisibleIdentifier asn_DEF_Identifier
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002923
Lev Walkin154aa182004-09-26 13:12:56 +00002924/*** <<< CODE [VisibleIdentifier] >>> ***/
2925
2926/* This type is equivalent to Identifier */
2927
2928
2929/*** <<< INCLUDES [Identifier] >>> ***/
2930
2931#include <VisibleString.h>
2932
2933/*** <<< TYPE-DECLS [Identifier] >>> ***/
2934
2935
2936typedef VisibleString_t Identifier_t;
2937
2938/*** <<< FUNC-DECLS [Identifier] >>> ***/
2939
Lev Walkindfae9752004-09-29 13:19:37 +00002940extern asn_TYPE_descriptor_t asn_DEF_Identifier;
Lev Walkin154aa182004-09-26 13:12:56 +00002941asn_struct_free_f Identifier_free;
2942asn_struct_print_f Identifier_print;
2943asn_constr_check_f Identifier_constraint;
2944ber_type_decoder_f Identifier_decode_ber;
2945der_type_encoder_f Identifier_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002946xer_type_decoder_f Identifier_decode_xer;
Lev Walkin154aa182004-09-26 13:12:56 +00002947xer_type_encoder_f Identifier_encode_xer;
2948
2949/*** <<< CTABLES [Identifier] >>> ***/
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002950
Lev Walkin55cc44a2004-10-03 09:14:32 +00002951static int permitted_alphabet_table_15[256] = {
Lev Walkine4ca5ce2004-09-15 11:44:13 +000029520,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
29530,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
29540,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0, /* $ */
29551,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, /* 0123456789 */
29560,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ABCDEFGHIJKLMNO */
29571,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1, /* PQRSTUVWXYZ _ */
29580,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* abcdefghijklmno */
29591,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, /* pqrstuvwxyz */
2960};
2961
Lev Walkin55cc44a2004-10-03 09:14:32 +00002962static int check_permitted_alphabet_15(const void *sptr) {
2963 int *table = permitted_alphabet_table_15;
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002964 /* The underlying type is VisibleString */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002965 const VisibleString_t *st = (const VisibleString_t *)sptr;
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002966 const uint8_t *ch = st->buf;
2967 const uint8_t *end = ch + st->size;
2968
2969 for(; ch < end; ch++) {
2970 uint8_t cv = *ch;
2971 if(!table[cv]) return -1;
2972 }
2973 return 0;
2974}
2975
2976
Lev Walkin154aa182004-09-26 13:12:56 +00002977/*** <<< CODE [Identifier] >>> ***/
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002978
2979int
Lev Walkindfae9752004-09-29 13:19:37 +00002980Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002981 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002982 const VisibleString_t *st = (const VisibleString_t *)sptr;
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002983 size_t size;
2984
2985 if(!sptr) {
2986 _ASN_ERRLOG(app_errlog, app_key,
2987 "%s: value not given (%s:%d)",
2988 td->name, __FILE__, __LINE__);
2989 return -1;
2990 }
2991
2992 size = st->size;
2993
2994 if((size >= 1 && size <= 32)
Lev Walkin55cc44a2004-10-03 09:14:32 +00002995 && !check_permitted_alphabet_15(sptr)) {
Lev Walkine4ca5ce2004-09-15 11:44:13 +00002996 /* Constraint check succeeded */
2997 return 0;
2998 } else {
2999 _ASN_ERRLOG(app_errlog, app_key,
3000 "%s: constraint failed (%s:%d)",
3001 td->name, __FILE__, __LINE__);
3002 return -1;
3003 }
3004}
3005
3006/*
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003007 * This type is implemented using VisibleString,
Lev Walkinc3808c12004-09-23 22:14:58 +00003008 * so here we adjust the DEF accordingly.
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003009 */
3010static void
Lev Walkine0272aa2005-03-04 11:26:08 +00003011Identifier_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00003012 td->free_struct = asn_DEF_VisibleString.free_struct;
3013 td->print_struct = asn_DEF_VisibleString.print_struct;
3014 td->ber_decoder = asn_DEF_VisibleString.ber_decoder;
3015 td->der_encoder = asn_DEF_VisibleString.der_encoder;
3016 td->xer_decoder = asn_DEF_VisibleString.xer_decoder;
3017 td->xer_encoder = asn_DEF_VisibleString.xer_encoder;
3018 td->elements = asn_DEF_VisibleString.elements;
3019 td->elements_count = asn_DEF_VisibleString.elements_count;
3020 td->specifics = asn_DEF_VisibleString.specifics;
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003021}
3022
Lev Walkina9cc46e2004-09-22 16:06:28 +00003023void
Lev Walkindfae9752004-09-29 13:19:37 +00003024Identifier_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003025 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00003026 Identifier_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003027 td->free_struct(td, struct_ptr, contents_only);
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003028}
3029
3030int
Lev Walkindfae9752004-09-29 13:19:37 +00003031Identifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003032 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00003033 Identifier_0_inherit_TYPE_descriptor(td);
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003034 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3035}
3036
Lev Walkindc06f6b2004-10-20 15:50:55 +00003037asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00003038Identifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003039 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00003040 Identifier_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00003041 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003042}
3043
3044asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00003045Identifier_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003046 void *structure, int tag_mode, ber_tlv_tag_t tag,
3047 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00003048 Identifier_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003049 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3050}
3051
Lev Walkin0ebe8b32004-10-23 13:26:56 +00003052asn_dec_rval_t
3053Identifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3054 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00003055 Identifier_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00003056 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3057}
3058
Lev Walkina9cc46e2004-09-22 16:06:28 +00003059asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00003060Identifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003061 int ilevel, enum xer_encoder_flags_e flags,
3062 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00003063 Identifier_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003064 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003065}
3066
3067
3068/*** <<< STAT-DEFS [Identifier] >>> ***/
3069
Lev Walkine0272aa2005-03-04 11:26:08 +00003070static ber_tlv_tag_t asn_DEF_Identifier_0_tags[] = {
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003071 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
3072};
Lev Walkindfae9752004-09-29 13:19:37 +00003073asn_TYPE_descriptor_t asn_DEF_Identifier = {
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003074 "Identifier",
Lev Walkindc06f6b2004-10-20 15:50:55 +00003075 "Identifier",
Lev Walkina9cc46e2004-09-22 16:06:28 +00003076 Identifier_free,
3077 Identifier_print,
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003078 Identifier_constraint,
3079 Identifier_decode_ber,
3080 Identifier_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00003081 Identifier_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003082 Identifier_encode_xer,
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003083 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00003084 asn_DEF_Identifier_0_tags,
3085 sizeof(asn_DEF_Identifier_0_tags)
3086 /sizeof(asn_DEF_Identifier_0_tags[0]), /* 1 */
3087 asn_DEF_Identifier_0_tags, /* Same as above */
3088 sizeof(asn_DEF_Identifier_0_tags)
3089 /sizeof(asn_DEF_Identifier_0_tags[0]), /* 1 */
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003090 0, 0, /* No members */
3091 0 /* No specifics */
3092};
3093