blob: 56acdb9e9f2940cee1dfeaa7241e5a8fb86e06f3 [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
Lev Walkin006de1c2004-08-20 13:37:45 +00008typedef INTEGER_t Int1_t;
9
Lev Walkin006de1c2004-08-20 13:37:45 +000010/*** <<< FUNC-DECLS [Int1] >>> ***/
11
Lev Walkincaf0d5a2005-03-04 23:48:19 +000012extern asn_TYPE_descriptor_t asn_DEF_Int1;
13asn_struct_free_f Int1_free;
14asn_struct_print_f Int1_print;
15asn_constr_check_f Int1_constraint;
16ber_type_decoder_f Int1_decode_ber;
17der_type_encoder_f Int1_encode_der;
18xer_type_decoder_f Int1_decode_xer;
19xer_type_encoder_f Int1_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +000020
21/*** <<< CODE [Int1] >>> ***/
22
Lev Walkincaf0d5a2005-03-04 23:48:19 +000023int
24Int1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
25 asn_app_consume_bytes_f *app_errlog, void *app_key) {
26 /* Replace with underlying type checker */
27 td->check_constraints = asn_DEF_INTEGER.check_constraints;
28 return td->check_constraints(td, sptr, app_errlog, app_key);
29}
30
31/*
32 * This type is implemented using INTEGER,
33 * so here we adjust the DEF accordingly.
34 */
35static void
36Int1_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
37 td->free_struct = asn_DEF_INTEGER.free_struct;
38 td->print_struct = asn_DEF_INTEGER.print_struct;
39 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
40 td->der_encoder = asn_DEF_INTEGER.der_encoder;
41 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
42 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
43 td->elements = asn_DEF_INTEGER.elements;
44 td->elements_count = asn_DEF_INTEGER.elements_count;
45 td->specifics = asn_DEF_INTEGER.specifics;
46}
47
48void
49Int1_free(asn_TYPE_descriptor_t *td,
50 void *struct_ptr, int contents_only) {
51 Int1_0_inherit_TYPE_descriptor(td);
52 td->free_struct(td, struct_ptr, contents_only);
53}
54
55int
56Int1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
57 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
58 Int1_0_inherit_TYPE_descriptor(td);
59 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
60}
61
62asn_dec_rval_t
63Int1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
64 void **structure, void *bufptr, size_t size, int tag_mode) {
65 Int1_0_inherit_TYPE_descriptor(td);
66 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
67}
68
69asn_enc_rval_t
70Int1_encode_der(asn_TYPE_descriptor_t *td,
71 void *structure, int tag_mode, ber_tlv_tag_t tag,
72 asn_app_consume_bytes_f *cb, void *app_key) {
73 Int1_0_inherit_TYPE_descriptor(td);
74 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
75}
76
77asn_dec_rval_t
78Int1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
79 void **structure, const char *opt_mname, void *bufptr, size_t size) {
80 Int1_0_inherit_TYPE_descriptor(td);
81 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
82}
83
84asn_enc_rval_t
85Int1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
86 int ilevel, enum xer_encoder_flags_e flags,
87 asn_app_consume_bytes_f *cb, void *app_key) {
88 Int1_0_inherit_TYPE_descriptor(td);
89 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
90}
91
92
93/*** <<< STAT-DEFS [Int1] >>> ***/
94
95static ber_tlv_tag_t asn_DEF_Int1_0_tags[] = {
96 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
97};
98asn_TYPE_descriptor_t asn_DEF_Int1 = {
99 "Int1",
100 "Int1",
101 Int1_free,
102 Int1_print,
103 Int1_constraint,
104 Int1_decode_ber,
105 Int1_encode_der,
106 Int1_decode_xer,
107 Int1_encode_xer,
108 0, /* Use generic outmost tag fetcher */
109 asn_DEF_Int1_0_tags,
110 sizeof(asn_DEF_Int1_0_tags)
111 /sizeof(asn_DEF_Int1_0_tags[0]), /* 1 */
112 asn_DEF_Int1_0_tags, /* Same as above */
113 sizeof(asn_DEF_Int1_0_tags)
114 /sizeof(asn_DEF_Int1_0_tags[0]), /* 1 */
115 0, 0, /* No members */
116 0 /* No specifics */
117};
Lev Walkin006de1c2004-08-20 13:37:45 +0000118
119
120/*** <<< INCLUDES [Int2] >>> ***/
121
122#include <Int1.h>
123
124/*** <<< TYPE-DECLS [Int2] >>> ***/
125
Lev Walkin006de1c2004-08-20 13:37:45 +0000126typedef Int1_t Int2_t;
127
Lev Walkin006de1c2004-08-20 13:37:45 +0000128/*** <<< FUNC-DECLS [Int2] >>> ***/
129
Lev Walkindfae9752004-09-29 13:19:37 +0000130extern asn_TYPE_descriptor_t asn_DEF_Int2;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000131asn_struct_free_f Int2_free;
132asn_struct_print_f Int2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000133asn_constr_check_f Int2_constraint;
134ber_type_decoder_f Int2_decode_ber;
135der_type_encoder_f Int2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000136xer_type_decoder_f Int2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000137xer_type_encoder_f Int2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000138
139/*** <<< CODE [Int2] >>> ***/
140
141int
Lev Walkindfae9752004-09-29 13:19:37 +0000142Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000143 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000144 const Int1_t *st = (const Int1_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000145 long value;
146
147 if(!sptr) {
148 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000149 "%s: value not given (%s:%d)",
150 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000151 return -1;
152 }
153
Lev Walkin44467432004-09-07 06:43:57 +0000154 /* Check if the sign bit is present */
155 value = st->buf ? ((st->buf[0] & 0x80) ? -1 : 1) : 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000156
157 if((value >= 0)) {
158 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000159 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000160 } else {
161 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000162 "%s: constraint failed (%s:%d)",
163 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000164 return -1;
165 }
166}
167
168/*
169 * This type is implemented using Int1,
Lev Walkinc3808c12004-09-23 22:14:58 +0000170 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000171 */
172static void
Lev Walkine0272aa2005-03-04 11:26:08 +0000173Int2_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +0000174 td->free_struct = asn_DEF_Int1.free_struct;
175 td->print_struct = asn_DEF_Int1.print_struct;
176 td->ber_decoder = asn_DEF_Int1.ber_decoder;
177 td->der_encoder = asn_DEF_Int1.der_encoder;
178 td->xer_decoder = asn_DEF_Int1.xer_decoder;
179 td->xer_encoder = asn_DEF_Int1.xer_encoder;
180 td->elements = asn_DEF_Int1.elements;
181 td->elements_count = asn_DEF_Int1.elements_count;
182 td->specifics = asn_DEF_Int1.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +0000183}
184
Lev Walkina9cc46e2004-09-22 16:06:28 +0000185void
Lev Walkindfae9752004-09-29 13:19:37 +0000186Int2_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000187 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000188 Int2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000189 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +0000190}
191
192int
Lev Walkindfae9752004-09-29 13:19:37 +0000193Int2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000194 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000195 Int2_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +0000196 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
197}
198
Lev Walkindc06f6b2004-10-20 15:50:55 +0000199asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000200Int2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000201 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000202 Int2_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +0000203 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000204}
205
206asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000207Int2_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000208 void *structure, int tag_mode, ber_tlv_tag_t tag,
209 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000210 Int2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000211 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
212}
213
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000214asn_dec_rval_t
215Int2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
216 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000217 Int2_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000218 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
219}
220
Lev Walkina9cc46e2004-09-22 16:06:28 +0000221asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000222Int2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000223 int ilevel, enum xer_encoder_flags_e flags,
224 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000225 Int2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000226 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +0000227}
228
229
230/*** <<< STAT-DEFS [Int2] >>> ***/
231
Lev Walkine0272aa2005-03-04 11:26:08 +0000232static ber_tlv_tag_t asn_DEF_Int2_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000233 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000234};
Lev Walkindfae9752004-09-29 13:19:37 +0000235asn_TYPE_descriptor_t asn_DEF_Int2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000236 "Int2",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000237 "Int2",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000238 Int2_free,
239 Int2_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000240 Int2_constraint,
241 Int2_decode_ber,
242 Int2_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000243 Int2_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000244 Int2_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +0000245 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +0000246 asn_DEF_Int2_0_tags,
247 sizeof(asn_DEF_Int2_0_tags)
248 /sizeof(asn_DEF_Int2_0_tags[0]), /* 1 */
249 asn_DEF_Int2_0_tags, /* Same as above */
250 sizeof(asn_DEF_Int2_0_tags)
251 /sizeof(asn_DEF_Int2_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000252 0, 0, /* No members */
253 0 /* No specifics */
254};
255
256
257/*** <<< INCLUDES [Int3] >>> ***/
258
259#include <Int2.h>
260
261/*** <<< TYPE-DECLS [Int3] >>> ***/
262
Lev Walkin006de1c2004-08-20 13:37:45 +0000263typedef Int2_t Int3_t;
264
Lev Walkin006de1c2004-08-20 13:37:45 +0000265/*** <<< FUNC-DECLS [Int3] >>> ***/
266
Lev Walkindfae9752004-09-29 13:19:37 +0000267extern asn_TYPE_descriptor_t asn_DEF_Int3;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000268asn_struct_free_f Int3_free;
269asn_struct_print_f Int3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000270asn_constr_check_f Int3_constraint;
271ber_type_decoder_f Int3_decode_ber;
272der_type_encoder_f Int3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000273xer_type_decoder_f Int3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000274xer_type_encoder_f Int3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000275
276/*** <<< CODE [Int3] >>> ***/
277
278int
Lev Walkindfae9752004-09-29 13:19:37 +0000279Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000280 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000281 const Int2_t *st = (const Int2_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000282 long value;
283
284 if(!sptr) {
285 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000286 "%s: value not given (%s:%d)",
287 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000288 return -1;
289 }
290
Lev Walkindfae9752004-09-29 13:19:37 +0000291 if(asn_INTEGER2long(st, &value)) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000292 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000293 "%s: value too large (%s:%d)",
294 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000295 return -1;
296 }
297
298 if((value >= 0 && value <= 10)) {
299 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000300 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000301 } else {
302 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000303 "%s: constraint failed (%s:%d)",
304 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000305 return -1;
306 }
307}
308
309/*
310 * This type is implemented using Int2,
Lev Walkinc3808c12004-09-23 22:14:58 +0000311 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000312 */
313static void
Lev Walkine0272aa2005-03-04 11:26:08 +0000314Int3_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +0000315 td->free_struct = asn_DEF_Int2.free_struct;
316 td->print_struct = asn_DEF_Int2.print_struct;
317 td->ber_decoder = asn_DEF_Int2.ber_decoder;
318 td->der_encoder = asn_DEF_Int2.der_encoder;
319 td->xer_decoder = asn_DEF_Int2.xer_decoder;
320 td->xer_encoder = asn_DEF_Int2.xer_encoder;
321 td->elements = asn_DEF_Int2.elements;
322 td->elements_count = asn_DEF_Int2.elements_count;
323 td->specifics = asn_DEF_Int2.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +0000324}
325
Lev Walkina9cc46e2004-09-22 16:06:28 +0000326void
Lev Walkindfae9752004-09-29 13:19:37 +0000327Int3_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000328 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000329 Int3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000330 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +0000331}
332
333int
Lev Walkindfae9752004-09-29 13:19:37 +0000334Int3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000335 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000336 Int3_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +0000337 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
338}
339
Lev Walkindc06f6b2004-10-20 15:50:55 +0000340asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000341Int3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000342 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000343 Int3_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +0000344 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000345}
346
347asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000348Int3_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000349 void *structure, int tag_mode, ber_tlv_tag_t tag,
350 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000351 Int3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000352 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
353}
354
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000355asn_dec_rval_t
356Int3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
357 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000358 Int3_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000359 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
360}
361
Lev Walkina9cc46e2004-09-22 16:06:28 +0000362asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000363Int3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000364 int ilevel, enum xer_encoder_flags_e flags,
365 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000366 Int3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000367 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +0000368}
369
370
371/*** <<< STAT-DEFS [Int3] >>> ***/
372
Lev Walkine0272aa2005-03-04 11:26:08 +0000373static ber_tlv_tag_t asn_DEF_Int3_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000374 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000375};
Lev Walkindfae9752004-09-29 13:19:37 +0000376asn_TYPE_descriptor_t asn_DEF_Int3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000377 "Int3",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000378 "Int3",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000379 Int3_free,
380 Int3_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000381 Int3_constraint,
382 Int3_decode_ber,
383 Int3_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000384 Int3_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000385 Int3_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +0000386 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +0000387 asn_DEF_Int3_0_tags,
388 sizeof(asn_DEF_Int3_0_tags)
389 /sizeof(asn_DEF_Int3_0_tags[0]), /* 1 */
390 asn_DEF_Int3_0_tags, /* Same as above */
391 sizeof(asn_DEF_Int3_0_tags)
392 /sizeof(asn_DEF_Int3_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000393 0, 0, /* No members */
394 0 /* No specifics */
395};
396
397
398/*** <<< INCLUDES [Int4] >>> ***/
399
400#include <Int3.h>
401
402/*** <<< TYPE-DECLS [Int4] >>> ***/
403
Lev Walkin006de1c2004-08-20 13:37:45 +0000404typedef Int3_t Int4_t;
405
Lev Walkin006de1c2004-08-20 13:37:45 +0000406/*** <<< FUNC-DECLS [Int4] >>> ***/
407
Lev Walkindfae9752004-09-29 13:19:37 +0000408extern asn_TYPE_descriptor_t asn_DEF_Int4;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000409asn_struct_free_f Int4_free;
410asn_struct_print_f Int4_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000411asn_constr_check_f Int4_constraint;
412ber_type_decoder_f Int4_decode_ber;
413der_type_encoder_f Int4_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000414xer_type_decoder_f Int4_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000415xer_type_encoder_f Int4_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000416
417/*** <<< CODE [Int4] >>> ***/
418
419int
Lev Walkindfae9752004-09-29 13:19:37 +0000420Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000421 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000422 const Int3_t *st = (const Int3_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +0000423 long value;
Lev Walkin006de1c2004-08-20 13:37:45 +0000424
425 if(!sptr) {
426 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000427 "%s: value not given (%s:%d)",
428 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000429 return -1;
430 }
431
Lev Walkindfae9752004-09-29 13:19:37 +0000432 if(asn_INTEGER2long(st, &value)) {
Lev Walkind35c8b52004-08-25 02:08:08 +0000433 _ASN_ERRLOG(app_errlog, app_key,
434 "%s: value too large (%s:%d)",
435 td->name, __FILE__, __LINE__);
436 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000437 }
438
Lev Walkind35c8b52004-08-25 02:08:08 +0000439 if((value >= 1 && value <= 10)) {
440 /* Constraint check succeeded */
441 return 0;
442 } else {
443 _ASN_ERRLOG(app_errlog, app_key,
444 "%s: constraint failed (%s:%d)",
445 td->name, __FILE__, __LINE__);
446 return -1;
447 }
Lev Walkin006de1c2004-08-20 13:37:45 +0000448}
449
450/*
451 * This type is implemented using Int3,
Lev Walkinc3808c12004-09-23 22:14:58 +0000452 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000453 */
454static void
Lev Walkine0272aa2005-03-04 11:26:08 +0000455Int4_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +0000456 td->free_struct = asn_DEF_Int3.free_struct;
457 td->print_struct = asn_DEF_Int3.print_struct;
458 td->ber_decoder = asn_DEF_Int3.ber_decoder;
459 td->der_encoder = asn_DEF_Int3.der_encoder;
460 td->xer_decoder = asn_DEF_Int3.xer_decoder;
461 td->xer_encoder = asn_DEF_Int3.xer_encoder;
462 td->elements = asn_DEF_Int3.elements;
463 td->elements_count = asn_DEF_Int3.elements_count;
464 td->specifics = asn_DEF_Int3.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +0000465}
466
Lev Walkina9cc46e2004-09-22 16:06:28 +0000467void
Lev Walkindfae9752004-09-29 13:19:37 +0000468Int4_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000469 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000470 Int4_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000471 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +0000472}
473
474int
Lev Walkindfae9752004-09-29 13:19:37 +0000475Int4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000476 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000477 Int4_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +0000478 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
479}
480
Lev Walkindc06f6b2004-10-20 15:50:55 +0000481asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000482Int4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000483 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000484 Int4_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +0000485 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000486}
487
488asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000489Int4_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000490 void *structure, int tag_mode, ber_tlv_tag_t tag,
491 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000492 Int4_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000493 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
494}
495
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000496asn_dec_rval_t
497Int4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
498 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000499 Int4_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000500 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
501}
502
Lev Walkina9cc46e2004-09-22 16:06:28 +0000503asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000504Int4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000505 int ilevel, enum xer_encoder_flags_e flags,
506 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000507 Int4_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000508 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +0000509}
510
511
512/*** <<< STAT-DEFS [Int4] >>> ***/
513
Lev Walkine0272aa2005-03-04 11:26:08 +0000514static ber_tlv_tag_t asn_DEF_Int4_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000515 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000516};
Lev Walkindfae9752004-09-29 13:19:37 +0000517asn_TYPE_descriptor_t asn_DEF_Int4 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000518 "Int4",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000519 "Int4",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000520 Int4_free,
521 Int4_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000522 Int4_constraint,
523 Int4_decode_ber,
524 Int4_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000525 Int4_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000526 Int4_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +0000527 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +0000528 asn_DEF_Int4_0_tags,
529 sizeof(asn_DEF_Int4_0_tags)
530 /sizeof(asn_DEF_Int4_0_tags[0]), /* 1 */
531 asn_DEF_Int4_0_tags, /* Same as above */
532 sizeof(asn_DEF_Int4_0_tags)
533 /sizeof(asn_DEF_Int4_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000534 0, 0, /* No members */
535 0 /* No specifics */
536};
537
538
539/*** <<< INCLUDES [Int5] >>> ***/
540
541#include <Int4.h>
542
543/*** <<< TYPE-DECLS [Int5] >>> ***/
544
Lev Walkin006de1c2004-08-20 13:37:45 +0000545typedef Int4_t Int5_t;
546
Lev Walkin006de1c2004-08-20 13:37:45 +0000547/*** <<< FUNC-DECLS [Int5] >>> ***/
548
Lev Walkindfae9752004-09-29 13:19:37 +0000549extern asn_TYPE_descriptor_t asn_DEF_Int5;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000550asn_struct_free_f Int5_free;
551asn_struct_print_f Int5_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000552asn_constr_check_f Int5_constraint;
553ber_type_decoder_f Int5_decode_ber;
554der_type_encoder_f Int5_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000555xer_type_decoder_f Int5_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000556xer_type_encoder_f Int5_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000557
558/*** <<< CODE [Int5] >>> ***/
559
560int
Lev Walkindfae9752004-09-29 13:19:37 +0000561Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000562 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000563 const Int4_t *st = (const Int4_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000564 long value;
565
566 if(!sptr) {
567 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000568 "%s: value not given (%s:%d)",
569 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000570 return -1;
571 }
572
Lev Walkindfae9752004-09-29 13:19:37 +0000573 if(asn_INTEGER2long(st, &value)) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000574 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000575 "%s: value too large (%s:%d)",
576 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000577 return -1;
578 }
579
580 if((value == 5)) {
581 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000582 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000583 } else {
584 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000585 "%s: constraint failed (%s:%d)",
586 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000587 return -1;
588 }
589}
590
591/*
592 * This type is implemented using Int4,
Lev Walkinc3808c12004-09-23 22:14:58 +0000593 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000594 */
595static void
Lev Walkine0272aa2005-03-04 11:26:08 +0000596Int5_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +0000597 td->free_struct = asn_DEF_Int4.free_struct;
598 td->print_struct = asn_DEF_Int4.print_struct;
599 td->ber_decoder = asn_DEF_Int4.ber_decoder;
600 td->der_encoder = asn_DEF_Int4.der_encoder;
601 td->xer_decoder = asn_DEF_Int4.xer_decoder;
602 td->xer_encoder = asn_DEF_Int4.xer_encoder;
603 td->elements = asn_DEF_Int4.elements;
604 td->elements_count = asn_DEF_Int4.elements_count;
605 td->specifics = asn_DEF_Int4.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +0000606}
607
Lev Walkina9cc46e2004-09-22 16:06:28 +0000608void
Lev Walkindfae9752004-09-29 13:19:37 +0000609Int5_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000610 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000611 Int5_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000612 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +0000613}
614
615int
Lev Walkindfae9752004-09-29 13:19:37 +0000616Int5_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000617 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000618 Int5_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +0000619 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
620}
621
Lev Walkindc06f6b2004-10-20 15:50:55 +0000622asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000623Int5_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000624 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000625 Int5_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +0000626 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000627}
628
629asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000630Int5_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000631 void *structure, int tag_mode, ber_tlv_tag_t tag,
632 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000633 Int5_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000634 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
635}
636
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000637asn_dec_rval_t
638Int5_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
639 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000640 Int5_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000641 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
642}
643
Lev Walkina9cc46e2004-09-22 16:06:28 +0000644asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000645Int5_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000646 int ilevel, enum xer_encoder_flags_e flags,
647 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000648 Int5_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000649 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +0000650}
651
652
653/*** <<< STAT-DEFS [Int5] >>> ***/
654
Lev Walkine0272aa2005-03-04 11:26:08 +0000655static ber_tlv_tag_t asn_DEF_Int5_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +0000656 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +0000657};
Lev Walkindfae9752004-09-29 13:19:37 +0000658asn_TYPE_descriptor_t asn_DEF_Int5 = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000659 "Int5",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000660 "Int5",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000661 Int5_free,
662 Int5_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000663 Int5_constraint,
664 Int5_decode_ber,
665 Int5_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000666 Int5_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000667 Int5_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +0000668 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +0000669 asn_DEF_Int5_0_tags,
670 sizeof(asn_DEF_Int5_0_tags)
671 /sizeof(asn_DEF_Int5_0_tags[0]), /* 1 */
672 asn_DEF_Int5_0_tags, /* Same as above */
673 sizeof(asn_DEF_Int5_0_tags)
674 /sizeof(asn_DEF_Int5_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000675 0, 0, /* No members */
676 0 /* No specifics */
677};
678
679
680/*** <<< INCLUDES [ExtensibleExtensions] >>> ***/
681
682#include <INTEGER.h>
683
684/*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/
685
Lev Walkin006de1c2004-08-20 13:37:45 +0000686typedef INTEGER_t ExtensibleExtensions_t;
687
Lev Walkin006de1c2004-08-20 13:37:45 +0000688/*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/
689
Lev Walkindfae9752004-09-29 13:19:37 +0000690extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000691asn_struct_free_f ExtensibleExtensions_free;
692asn_struct_print_f ExtensibleExtensions_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000693asn_constr_check_f ExtensibleExtensions_constraint;
694ber_type_decoder_f ExtensibleExtensions_decode_ber;
695der_type_encoder_f ExtensibleExtensions_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000696xer_type_decoder_f ExtensibleExtensions_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000697xer_type_encoder_f ExtensibleExtensions_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000698
699/*** <<< CODE [ExtensibleExtensions] >>> ***/
700
701int
Lev Walkindfae9752004-09-29 13:19:37 +0000702ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000703 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000704 const INTEGER_t *st = (const INTEGER_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +0000705 long value;
Lev Walkin006de1c2004-08-20 13:37:45 +0000706
707 if(!sptr) {
708 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000709 "%s: value not given (%s:%d)",
710 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000711 return -1;
712 }
713
Lev Walkindfae9752004-09-29 13:19:37 +0000714 if(asn_INTEGER2long(st, &value)) {
Lev Walkind35c8b52004-08-25 02:08:08 +0000715 _ASN_ERRLOG(app_errlog, app_key,
716 "%s: value too large (%s:%d)",
717 td->name, __FILE__, __LINE__);
718 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000719 }
720
Lev Walkind35c8b52004-08-25 02:08:08 +0000721 if((value >= 1 && value <= 256)) {
722 /* Constraint check succeeded */
723 return 0;
724 } else {
725 _ASN_ERRLOG(app_errlog, app_key,
726 "%s: constraint failed (%s:%d)",
727 td->name, __FILE__, __LINE__);
728 return -1;
729 }
Lev Walkin006de1c2004-08-20 13:37:45 +0000730}
731
732/*
733 * This type is implemented using INTEGER,
Lev Walkinc3808c12004-09-23 22:14:58 +0000734 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +0000735 */
736static void
Lev Walkine0272aa2005-03-04 11:26:08 +0000737ExtensibleExtensions_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +0000738 td->free_struct = asn_DEF_INTEGER.free_struct;
739 td->print_struct = asn_DEF_INTEGER.print_struct;
740 td->ber_decoder = asn_DEF_INTEGER.ber_decoder;
741 td->der_encoder = asn_DEF_INTEGER.der_encoder;
742 td->xer_decoder = asn_DEF_INTEGER.xer_decoder;
743 td->xer_encoder = asn_DEF_INTEGER.xer_encoder;
744 td->elements = asn_DEF_INTEGER.elements;
745 td->elements_count = asn_DEF_INTEGER.elements_count;
746 td->specifics = asn_DEF_INTEGER.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +0000747}
748
Lev Walkina9cc46e2004-09-22 16:06:28 +0000749void
Lev Walkindfae9752004-09-29 13:19:37 +0000750ExtensibleExtensions_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000751 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000752 ExtensibleExtensions_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000753 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +0000754}
755
756int
Lev Walkindfae9752004-09-29 13:19:37 +0000757ExtensibleExtensions_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000758 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000759 ExtensibleExtensions_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +0000760 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
761}
762
Lev Walkindc06f6b2004-10-20 15:50:55 +0000763asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000764ExtensibleExtensions_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000765 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000766 ExtensibleExtensions_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +0000767 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000768}
769
770asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000771ExtensibleExtensions_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000772 void *structure, int tag_mode, ber_tlv_tag_t tag,
773 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000774 ExtensibleExtensions_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000775 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
776}
777
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000778asn_dec_rval_t
779ExtensibleExtensions_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
780 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000781 ExtensibleExtensions_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000782 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
783}
784
Lev Walkina9cc46e2004-09-22 16:06:28 +0000785asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +0000786ExtensibleExtensions_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000787 int ilevel, enum xer_encoder_flags_e flags,
788 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +0000789 ExtensibleExtensions_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +0000790 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +0000791}
792
793
794/*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/
795
Lev Walkine0272aa2005-03-04 11:26:08 +0000796static ber_tlv_tag_t asn_DEF_ExtensibleExtensions_0_tags[] = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000797 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
798};
Lev Walkindfae9752004-09-29 13:19:37 +0000799asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = {
Lev Walkin006de1c2004-08-20 13:37:45 +0000800 "ExtensibleExtensions",
Lev Walkindc06f6b2004-10-20 15:50:55 +0000801 "ExtensibleExtensions",
Lev Walkina9cc46e2004-09-22 16:06:28 +0000802 ExtensibleExtensions_free,
803 ExtensibleExtensions_print,
Lev Walkin006de1c2004-08-20 13:37:45 +0000804 ExtensibleExtensions_constraint,
805 ExtensibleExtensions_decode_ber,
806 ExtensibleExtensions_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000807 ExtensibleExtensions_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +0000808 ExtensibleExtensions_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +0000809 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +0000810 asn_DEF_ExtensibleExtensions_0_tags,
811 sizeof(asn_DEF_ExtensibleExtensions_0_tags)
812 /sizeof(asn_DEF_ExtensibleExtensions_0_tags[0]), /* 1 */
813 asn_DEF_ExtensibleExtensions_0_tags, /* Same as above */
814 sizeof(asn_DEF_ExtensibleExtensions_0_tags)
815 /sizeof(asn_DEF_ExtensibleExtensions_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +0000816 0, 0, /* No members */
817 0 /* No specifics */
818};
819
820
821/*** <<< INCLUDES [Str1] >>> ***/
822
823#include <IA5String.h>
824
825/*** <<< TYPE-DECLS [Str1] >>> ***/
826
Lev Walkin006de1c2004-08-20 13:37:45 +0000827typedef IA5String_t Str1_t;
828
Lev Walkin006de1c2004-08-20 13:37:45 +0000829/*** <<< FUNC-DECLS [Str1] >>> ***/
830
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000831extern asn_TYPE_descriptor_t asn_DEF_Str1;
832asn_struct_free_f Str1_free;
833asn_struct_print_f Str1_print;
834asn_constr_check_f Str1_constraint;
835ber_type_decoder_f Str1_decode_ber;
836der_type_encoder_f Str1_encode_der;
837xer_type_decoder_f Str1_decode_xer;
838xer_type_encoder_f Str1_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000839
840/*** <<< CODE [Str1] >>> ***/
841
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000842int
843Str1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
844 asn_app_consume_bytes_f *app_errlog, void *app_key) {
845 /* Replace with underlying type checker */
846 td->check_constraints = asn_DEF_IA5String.check_constraints;
847 return td->check_constraints(td, sptr, app_errlog, app_key);
848}
849
850/*
851 * This type is implemented using IA5String,
852 * so here we adjust the DEF accordingly.
853 */
854static void
855Str1_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
856 td->free_struct = asn_DEF_IA5String.free_struct;
857 td->print_struct = asn_DEF_IA5String.print_struct;
858 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
859 td->der_encoder = asn_DEF_IA5String.der_encoder;
860 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
861 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
862 td->elements = asn_DEF_IA5String.elements;
863 td->elements_count = asn_DEF_IA5String.elements_count;
864 td->specifics = asn_DEF_IA5String.specifics;
865}
866
867void
868Str1_free(asn_TYPE_descriptor_t *td,
869 void *struct_ptr, int contents_only) {
870 Str1_0_inherit_TYPE_descriptor(td);
871 td->free_struct(td, struct_ptr, contents_only);
872}
873
874int
875Str1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
876 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
877 Str1_0_inherit_TYPE_descriptor(td);
878 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
879}
880
881asn_dec_rval_t
882Str1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
883 void **structure, void *bufptr, size_t size, int tag_mode) {
884 Str1_0_inherit_TYPE_descriptor(td);
885 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
886}
887
888asn_enc_rval_t
889Str1_encode_der(asn_TYPE_descriptor_t *td,
890 void *structure, int tag_mode, ber_tlv_tag_t tag,
891 asn_app_consume_bytes_f *cb, void *app_key) {
892 Str1_0_inherit_TYPE_descriptor(td);
893 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
894}
895
896asn_dec_rval_t
897Str1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
898 void **structure, const char *opt_mname, void *bufptr, size_t size) {
899 Str1_0_inherit_TYPE_descriptor(td);
900 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
901}
902
903asn_enc_rval_t
904Str1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
905 int ilevel, enum xer_encoder_flags_e flags,
906 asn_app_consume_bytes_f *cb, void *app_key) {
907 Str1_0_inherit_TYPE_descriptor(td);
908 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
909}
910
911
912/*** <<< STAT-DEFS [Str1] >>> ***/
913
914static ber_tlv_tag_t asn_DEF_Str1_0_tags[] = {
915 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
916};
917asn_TYPE_descriptor_t asn_DEF_Str1 = {
918 "Str1",
919 "Str1",
920 Str1_free,
921 Str1_print,
922 Str1_constraint,
923 Str1_decode_ber,
924 Str1_encode_der,
925 Str1_decode_xer,
926 Str1_encode_xer,
927 0, /* Use generic outmost tag fetcher */
928 asn_DEF_Str1_0_tags,
929 sizeof(asn_DEF_Str1_0_tags)
930 /sizeof(asn_DEF_Str1_0_tags[0]), /* 1 */
931 asn_DEF_Str1_0_tags, /* Same as above */
932 sizeof(asn_DEF_Str1_0_tags)
933 /sizeof(asn_DEF_Str1_0_tags[0]), /* 1 */
934 0, 0, /* No members */
935 0 /* No specifics */
936};
Lev Walkin006de1c2004-08-20 13:37:45 +0000937
938
939/*** <<< INCLUDES [Str2] >>> ***/
940
941#include <Str1.h>
942
943/*** <<< TYPE-DECLS [Str2] >>> ***/
944
Lev Walkin006de1c2004-08-20 13:37:45 +0000945typedef Str1_t Str2_t;
946
Lev Walkin006de1c2004-08-20 13:37:45 +0000947/*** <<< FUNC-DECLS [Str2] >>> ***/
948
Lev Walkindfae9752004-09-29 13:19:37 +0000949extern asn_TYPE_descriptor_t asn_DEF_Str2;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000950asn_struct_free_f Str2_free;
951asn_struct_print_f Str2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +0000952asn_constr_check_f Str2_constraint;
953ber_type_decoder_f Str2_decode_ber;
954der_type_encoder_f Str2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +0000955xer_type_decoder_f Str2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +0000956xer_type_encoder_f Str2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +0000957
958/*** <<< CTABLES [Str2] >>> ***/
959
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000960static int check_permitted_alphabet_0(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000961 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000962 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +0000963 const uint8_t *ch = st->buf;
964 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +0000965
966 for(; ch < end; ch++) {
967 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +0000968 if(!(cv <= 127)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +0000969 }
Lev Walkin775885e2004-08-22 12:47:03 +0000970 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000971}
972
973
974/*** <<< CODE [Str2] >>> ***/
975
976int
Lev Walkindfae9752004-09-29 13:19:37 +0000977Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +0000978 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +0000979 const Str1_t *st = (const Str1_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +0000980 size_t size;
981
982 if(!sptr) {
983 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000984 "%s: value not given (%s:%d)",
985 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000986 return -1;
987 }
988
989 size = st->size;
990
991 if(((size <= 20) || (size >= 25 && size <= 30))
Lev Walkincaf0d5a2005-03-04 23:48:19 +0000992 && !check_permitted_alphabet_0(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +0000993 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +0000994 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +0000995 } else {
996 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +0000997 "%s: constraint failed (%s:%d)",
998 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +0000999 return -1;
1000 }
1001}
1002
1003/*
1004 * This type is implemented using Str1,
Lev Walkinc3808c12004-09-23 22:14:58 +00001005 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001006 */
1007static void
Lev Walkine0272aa2005-03-04 11:26:08 +00001008Str2_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00001009 td->free_struct = asn_DEF_Str1.free_struct;
1010 td->print_struct = asn_DEF_Str1.print_struct;
1011 td->ber_decoder = asn_DEF_Str1.ber_decoder;
1012 td->der_encoder = asn_DEF_Str1.der_encoder;
1013 td->xer_decoder = asn_DEF_Str1.xer_decoder;
1014 td->xer_encoder = asn_DEF_Str1.xer_encoder;
1015 td->elements = asn_DEF_Str1.elements;
1016 td->elements_count = asn_DEF_Str1.elements_count;
1017 td->specifics = asn_DEF_Str1.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00001018}
1019
Lev Walkina9cc46e2004-09-22 16:06:28 +00001020void
Lev Walkindfae9752004-09-29 13:19:37 +00001021Str2_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001022 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001023 Str2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001024 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00001025}
1026
1027int
Lev Walkindfae9752004-09-29 13:19:37 +00001028Str2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001029 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001030 Str2_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00001031 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1032}
1033
Lev Walkindc06f6b2004-10-20 15:50:55 +00001034asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001035Str2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001036 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001037 Str2_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001038 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001039}
1040
1041asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001042Str2_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001043 void *structure, int tag_mode, ber_tlv_tag_t tag,
1044 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001045 Str2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001046 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1047}
1048
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001049asn_dec_rval_t
1050Str2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1051 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001052 Str2_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001053 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1054}
1055
Lev Walkina9cc46e2004-09-22 16:06:28 +00001056asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001057Str2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001058 int ilevel, enum xer_encoder_flags_e flags,
1059 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001060 Str2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001061 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00001062}
1063
1064
1065/*** <<< STAT-DEFS [Str2] >>> ***/
1066
Lev Walkine0272aa2005-03-04 11:26:08 +00001067static ber_tlv_tag_t asn_DEF_Str2_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001068 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001069};
Lev Walkindfae9752004-09-29 13:19:37 +00001070asn_TYPE_descriptor_t asn_DEF_Str2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001071 "Str2",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001072 "Str2",
Lev Walkina9cc46e2004-09-22 16:06:28 +00001073 Str2_free,
1074 Str2_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001075 Str2_constraint,
1076 Str2_decode_ber,
1077 Str2_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001078 Str2_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001079 Str2_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00001080 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00001081 asn_DEF_Str2_0_tags,
1082 sizeof(asn_DEF_Str2_0_tags)
1083 /sizeof(asn_DEF_Str2_0_tags[0]), /* 1 */
1084 asn_DEF_Str2_0_tags, /* Same as above */
1085 sizeof(asn_DEF_Str2_0_tags)
1086 /sizeof(asn_DEF_Str2_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001087 0, 0, /* No members */
1088 0 /* No specifics */
1089};
1090
1091
1092/*** <<< INCLUDES [Str3] >>> ***/
1093
1094#include <Str2.h>
1095
1096/*** <<< TYPE-DECLS [Str3] >>> ***/
1097
Lev Walkin006de1c2004-08-20 13:37:45 +00001098typedef Str2_t Str3_t;
1099
Lev Walkin006de1c2004-08-20 13:37:45 +00001100/*** <<< FUNC-DECLS [Str3] >>> ***/
1101
Lev Walkindfae9752004-09-29 13:19:37 +00001102extern asn_TYPE_descriptor_t asn_DEF_Str3;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001103asn_struct_free_f Str3_free;
1104asn_struct_print_f Str3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001105asn_constr_check_f Str3_constraint;
1106ber_type_decoder_f Str3_decode_ber;
1107der_type_encoder_f Str3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001108xer_type_decoder_f Str3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001109xer_type_encoder_f Str3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001110
1111/*** <<< CTABLES [Str3] >>> ***/
1112
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001113static int permitted_alphabet_table_0[256] = {
Lev Walkin006de1c2004-08-20 13:37:45 +000011140,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
11150,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
11160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
11170,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
11180,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0, /* ABC */
11190,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
11200,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0, /* def */
1121};
1122
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001123static int check_permitted_alphabet_0(const void *sptr) {
1124 int *table = permitted_alphabet_table_0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001125 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001126 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001127 const uint8_t *ch = st->buf;
1128 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001129
1130 for(; ch < end; ch++) {
1131 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00001132 if(!table[cv]) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001133 }
Lev Walkin775885e2004-08-22 12:47:03 +00001134 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001135}
1136
1137
1138/*** <<< CODE [Str3] >>> ***/
1139
1140int
Lev Walkindfae9752004-09-29 13:19:37 +00001141Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001142 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001143 const Str2_t *st = (const Str2_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001144 size_t size;
1145
1146 if(!sptr) {
1147 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00001148 "%s: value not given (%s:%d)",
1149 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001150 return -1;
1151 }
1152
1153 size = st->size;
1154
1155 if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27))
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001156 && !check_permitted_alphabet_0(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001157 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001158 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001159 } else {
1160 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00001161 "%s: constraint failed (%s:%d)",
1162 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001163 return -1;
1164 }
1165}
1166
1167/*
1168 * This type is implemented using Str2,
Lev Walkinc3808c12004-09-23 22:14:58 +00001169 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001170 */
1171static void
Lev Walkine0272aa2005-03-04 11:26:08 +00001172Str3_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00001173 td->free_struct = asn_DEF_Str2.free_struct;
1174 td->print_struct = asn_DEF_Str2.print_struct;
1175 td->ber_decoder = asn_DEF_Str2.ber_decoder;
1176 td->der_encoder = asn_DEF_Str2.der_encoder;
1177 td->xer_decoder = asn_DEF_Str2.xer_decoder;
1178 td->xer_encoder = asn_DEF_Str2.xer_encoder;
1179 td->elements = asn_DEF_Str2.elements;
1180 td->elements_count = asn_DEF_Str2.elements_count;
1181 td->specifics = asn_DEF_Str2.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00001182}
1183
Lev Walkina9cc46e2004-09-22 16:06:28 +00001184void
Lev Walkindfae9752004-09-29 13:19:37 +00001185Str3_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001186 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001187 Str3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001188 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00001189}
1190
1191int
Lev Walkindfae9752004-09-29 13:19:37 +00001192Str3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001193 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001194 Str3_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00001195 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1196}
1197
Lev Walkindc06f6b2004-10-20 15:50:55 +00001198asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001199Str3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001200 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001201 Str3_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001202 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001203}
1204
1205asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001206Str3_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001207 void *structure, int tag_mode, ber_tlv_tag_t tag,
1208 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001209 Str3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001210 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1211}
1212
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001213asn_dec_rval_t
1214Str3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1215 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001216 Str3_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001217 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1218}
1219
Lev Walkina9cc46e2004-09-22 16:06:28 +00001220asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001221Str3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001222 int ilevel, enum xer_encoder_flags_e flags,
1223 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001224 Str3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001225 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00001226}
1227
1228
1229/*** <<< STAT-DEFS [Str3] >>> ***/
1230
Lev Walkine0272aa2005-03-04 11:26:08 +00001231static ber_tlv_tag_t asn_DEF_Str3_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001232 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001233};
Lev Walkindfae9752004-09-29 13:19:37 +00001234asn_TYPE_descriptor_t asn_DEF_Str3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001235 "Str3",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001236 "Str3",
Lev Walkina9cc46e2004-09-22 16:06:28 +00001237 Str3_free,
1238 Str3_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001239 Str3_constraint,
1240 Str3_decode_ber,
1241 Str3_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001242 Str3_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001243 Str3_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00001244 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00001245 asn_DEF_Str3_0_tags,
1246 sizeof(asn_DEF_Str3_0_tags)
1247 /sizeof(asn_DEF_Str3_0_tags[0]), /* 1 */
1248 asn_DEF_Str3_0_tags, /* Same as above */
1249 sizeof(asn_DEF_Str3_0_tags)
1250 /sizeof(asn_DEF_Str3_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001251 0, 0, /* No members */
1252 0 /* No specifics */
1253};
1254
1255
Lev Walkin8a99bf72004-09-10 06:07:39 +00001256/*** <<< INCLUDES [Str4] >>> ***/
1257
1258#include <IA5String.h>
1259
1260/*** <<< TYPE-DECLS [Str4] >>> ***/
1261
Lev Walkin8a99bf72004-09-10 06:07:39 +00001262typedef IA5String_t Str4_t;
1263
1264/*** <<< FUNC-DECLS [Str4] >>> ***/
1265
Lev Walkindfae9752004-09-29 13:19:37 +00001266extern asn_TYPE_descriptor_t asn_DEF_Str4;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001267asn_struct_free_f Str4_free;
1268asn_struct_print_f Str4_print;
Lev Walkin8a99bf72004-09-10 06:07:39 +00001269asn_constr_check_f Str4_constraint;
1270ber_type_decoder_f Str4_decode_ber;
1271der_type_encoder_f Str4_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001272xer_type_decoder_f Str4_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001273xer_type_encoder_f Str4_encode_xer;
Lev Walkin8a99bf72004-09-10 06:07:39 +00001274
1275/*** <<< CTABLES [Str4] >>> ***/
1276
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001277static int check_permitted_alphabet_0(const void *sptr) {
Lev Walkin8a99bf72004-09-10 06:07:39 +00001278 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001279 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin8a99bf72004-09-10 06:07:39 +00001280 const uint8_t *ch = st->buf;
1281 const uint8_t *end = ch + st->size;
1282
1283 for(; ch < end; ch++) {
1284 uint8_t cv = *ch;
1285 if(!(cv <= 127)) return -1;
1286 }
1287 return 0;
1288}
1289
1290
1291/*** <<< CODE [Str4] >>> ***/
1292
1293int
Lev Walkindfae9752004-09-29 13:19:37 +00001294Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin8a99bf72004-09-10 06:07:39 +00001295 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001296 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin8a99bf72004-09-10 06:07:39 +00001297
1298 if(!sptr) {
1299 _ASN_ERRLOG(app_errlog, app_key,
1300 "%s: value not given (%s:%d)",
1301 td->name, __FILE__, __LINE__);
1302 return -1;
1303 }
1304
1305
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001306 if(!check_permitted_alphabet_0(st)) {
Lev Walkin8a99bf72004-09-10 06:07:39 +00001307 /* Constraint check succeeded */
1308 return 0;
1309 } else {
1310 _ASN_ERRLOG(app_errlog, app_key,
1311 "%s: constraint failed (%s:%d)",
1312 td->name, __FILE__, __LINE__);
1313 return -1;
1314 }
1315}
1316
1317/*
1318 * This type is implemented using IA5String,
Lev Walkinc3808c12004-09-23 22:14:58 +00001319 * so here we adjust the DEF accordingly.
Lev Walkin8a99bf72004-09-10 06:07:39 +00001320 */
1321static void
Lev Walkine0272aa2005-03-04 11:26:08 +00001322Str4_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00001323 td->free_struct = asn_DEF_IA5String.free_struct;
1324 td->print_struct = asn_DEF_IA5String.print_struct;
1325 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1326 td->der_encoder = asn_DEF_IA5String.der_encoder;
1327 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1328 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1329 td->elements = asn_DEF_IA5String.elements;
1330 td->elements_count = asn_DEF_IA5String.elements_count;
1331 td->specifics = asn_DEF_IA5String.specifics;
Lev Walkin8a99bf72004-09-10 06:07:39 +00001332}
1333
Lev Walkina9cc46e2004-09-22 16:06:28 +00001334void
Lev Walkindfae9752004-09-29 13:19:37 +00001335Str4_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001336 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001337 Str4_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001338 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin8a99bf72004-09-10 06:07:39 +00001339}
1340
1341int
Lev Walkindfae9752004-09-29 13:19:37 +00001342Str4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin8a99bf72004-09-10 06:07:39 +00001343 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001344 Str4_0_inherit_TYPE_descriptor(td);
Lev Walkin8a99bf72004-09-10 06:07:39 +00001345 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1346}
1347
Lev Walkindc06f6b2004-10-20 15:50:55 +00001348asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001349Str4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001350 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001351 Str4_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001352 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001353}
1354
1355asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001356Str4_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001357 void *structure, int tag_mode, ber_tlv_tag_t tag,
1358 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001359 Str4_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001360 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1361}
1362
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001363asn_dec_rval_t
1364Str4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1365 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001366 Str4_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001367 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1368}
1369
Lev Walkina9cc46e2004-09-22 16:06:28 +00001370asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001371Str4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001372 int ilevel, enum xer_encoder_flags_e flags,
1373 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001374 Str4_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001375 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin8a99bf72004-09-10 06:07:39 +00001376}
1377
1378
1379/*** <<< STAT-DEFS [Str4] >>> ***/
1380
Lev Walkine0272aa2005-03-04 11:26:08 +00001381static ber_tlv_tag_t asn_DEF_Str4_0_tags[] = {
Lev Walkin8a99bf72004-09-10 06:07:39 +00001382 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1383};
Lev Walkindfae9752004-09-29 13:19:37 +00001384asn_TYPE_descriptor_t asn_DEF_Str4 = {
Lev Walkin8a99bf72004-09-10 06:07:39 +00001385 "Str4",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001386 "Str4",
Lev Walkina9cc46e2004-09-22 16:06:28 +00001387 Str4_free,
1388 Str4_print,
Lev Walkin8a99bf72004-09-10 06:07:39 +00001389 Str4_constraint,
1390 Str4_decode_ber,
1391 Str4_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001392 Str4_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001393 Str4_encode_xer,
Lev Walkin8a99bf72004-09-10 06:07:39 +00001394 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00001395 asn_DEF_Str4_0_tags,
1396 sizeof(asn_DEF_Str4_0_tags)
1397 /sizeof(asn_DEF_Str4_0_tags[0]), /* 1 */
1398 asn_DEF_Str4_0_tags, /* Same as above */
1399 sizeof(asn_DEF_Str4_0_tags)
1400 /sizeof(asn_DEF_Str4_0_tags[0]), /* 1 */
Lev Walkin8a99bf72004-09-10 06:07:39 +00001401 0, 0, /* No members */
1402 0 /* No specifics */
1403};
1404
1405
Lev Walkin006de1c2004-08-20 13:37:45 +00001406/*** <<< INCLUDES [PER-Visible] >>> ***/
1407
1408#include <IA5String.h>
1409
1410/*** <<< TYPE-DECLS [PER-Visible] >>> ***/
1411
Lev Walkin006de1c2004-08-20 13:37:45 +00001412typedef IA5String_t PER_Visible_t;
1413
Lev Walkin006de1c2004-08-20 13:37:45 +00001414/*** <<< FUNC-DECLS [PER-Visible] >>> ***/
1415
Lev Walkindfae9752004-09-29 13:19:37 +00001416extern asn_TYPE_descriptor_t asn_DEF_PER_Visible;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001417asn_struct_free_f PER_Visible_free;
1418asn_struct_print_f PER_Visible_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001419asn_constr_check_f PER_Visible_constraint;
1420ber_type_decoder_f PER_Visible_decode_ber;
1421der_type_encoder_f PER_Visible_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001422xer_type_decoder_f PER_Visible_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001423xer_type_encoder_f PER_Visible_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001424
1425/*** <<< CTABLES [PER-Visible] >>> ***/
1426
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001427static int check_permitted_alphabet_0(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001428 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001429 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001430 const uint8_t *ch = st->buf;
1431 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001432
1433 for(; ch < end; ch++) {
1434 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00001435 if(!(cv >= 65 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001436 }
Lev Walkin775885e2004-08-22 12:47:03 +00001437 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001438}
1439
1440
1441/*** <<< CODE [PER-Visible] >>> ***/
1442
1443int
Lev Walkindfae9752004-09-29 13:19:37 +00001444PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001445 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001446 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001447
1448 if(!sptr) {
1449 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00001450 "%s: value not given (%s:%d)",
1451 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001452 return -1;
1453 }
1454
1455
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001456 if(!check_permitted_alphabet_0(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001457 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001458 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001459 } else {
1460 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00001461 "%s: constraint failed (%s:%d)",
1462 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001463 return -1;
1464 }
1465}
1466
1467/*
1468 * This type is implemented using IA5String,
Lev Walkinc3808c12004-09-23 22:14:58 +00001469 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001470 */
1471static void
Lev Walkine0272aa2005-03-04 11:26:08 +00001472PER_Visible_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00001473 td->free_struct = asn_DEF_IA5String.free_struct;
1474 td->print_struct = asn_DEF_IA5String.print_struct;
1475 td->ber_decoder = asn_DEF_IA5String.ber_decoder;
1476 td->der_encoder = asn_DEF_IA5String.der_encoder;
1477 td->xer_decoder = asn_DEF_IA5String.xer_decoder;
1478 td->xer_encoder = asn_DEF_IA5String.xer_encoder;
1479 td->elements = asn_DEF_IA5String.elements;
1480 td->elements_count = asn_DEF_IA5String.elements_count;
1481 td->specifics = asn_DEF_IA5String.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00001482}
1483
Lev Walkina9cc46e2004-09-22 16:06:28 +00001484void
Lev Walkindfae9752004-09-29 13:19:37 +00001485PER_Visible_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001486 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001487 PER_Visible_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001488 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00001489}
1490
1491int
Lev Walkindfae9752004-09-29 13:19:37 +00001492PER_Visible_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001493 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001494 PER_Visible_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00001495 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1496}
1497
Lev Walkindc06f6b2004-10-20 15:50:55 +00001498asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001499PER_Visible_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001500 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001501 PER_Visible_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001502 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001503}
1504
1505asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001506PER_Visible_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001507 void *structure, int tag_mode, ber_tlv_tag_t tag,
1508 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001509 PER_Visible_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001510 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1511}
1512
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001513asn_dec_rval_t
1514PER_Visible_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1515 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001516 PER_Visible_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001517 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1518}
1519
Lev Walkina9cc46e2004-09-22 16:06:28 +00001520asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001521PER_Visible_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001522 int ilevel, enum xer_encoder_flags_e flags,
1523 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001524 PER_Visible_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001525 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00001526}
1527
1528
1529/*** <<< STAT-DEFS [PER-Visible] >>> ***/
1530
Lev Walkine0272aa2005-03-04 11:26:08 +00001531static ber_tlv_tag_t asn_DEF_PER_Visible_0_tags[] = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001532 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
1533};
Lev Walkindfae9752004-09-29 13:19:37 +00001534asn_TYPE_descriptor_t asn_DEF_PER_Visible = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001535 "PER-Visible",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001536 "PER-Visible",
Lev Walkina9cc46e2004-09-22 16:06:28 +00001537 PER_Visible_free,
1538 PER_Visible_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001539 PER_Visible_constraint,
1540 PER_Visible_decode_ber,
1541 PER_Visible_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001542 PER_Visible_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001543 PER_Visible_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00001544 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00001545 asn_DEF_PER_Visible_0_tags,
1546 sizeof(asn_DEF_PER_Visible_0_tags)
1547 /sizeof(asn_DEF_PER_Visible_0_tags[0]), /* 1 */
1548 asn_DEF_PER_Visible_0_tags, /* Same as above */
1549 sizeof(asn_DEF_PER_Visible_0_tags)
1550 /sizeof(asn_DEF_PER_Visible_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001551 0, 0, /* No members */
1552 0 /* No specifics */
1553};
1554
1555
1556/*** <<< INCLUDES [PER-Visible-2] >>> ***/
1557
1558#include <PER-Visible.h>
1559
1560/*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/
1561
Lev Walkin006de1c2004-08-20 13:37:45 +00001562typedef PER_Visible_t PER_Visible_2_t;
1563
Lev Walkin006de1c2004-08-20 13:37:45 +00001564/*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/
1565
Lev Walkindfae9752004-09-29 13:19:37 +00001566extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001567asn_struct_free_f PER_Visible_2_free;
1568asn_struct_print_f PER_Visible_2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001569asn_constr_check_f PER_Visible_2_constraint;
1570ber_type_decoder_f PER_Visible_2_decode_ber;
1571der_type_encoder_f PER_Visible_2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001572xer_type_decoder_f PER_Visible_2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001573xer_type_encoder_f PER_Visible_2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001574
1575/*** <<< CTABLES [PER-Visible-2] >>> ***/
1576
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001577static int check_permitted_alphabet_0(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001578 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001579 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001580 const uint8_t *ch = st->buf;
1581 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001582
1583 for(; ch < end; ch++) {
1584 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00001585 if(!(cv >= 69 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001586 }
Lev Walkin775885e2004-08-22 12:47:03 +00001587 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001588}
1589
1590
1591/*** <<< CODE [PER-Visible-2] >>> ***/
1592
1593int
Lev Walkindfae9752004-09-29 13:19:37 +00001594PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001595 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001596 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001597
1598 if(!sptr) {
1599 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00001600 "%s: value not given (%s:%d)",
1601 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001602 return -1;
1603 }
1604
1605
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001606 if(!check_permitted_alphabet_0(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001607 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001608 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001609 } else {
1610 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00001611 "%s: constraint failed (%s:%d)",
1612 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001613 return -1;
1614 }
1615}
1616
1617/*
1618 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001619 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001620 */
1621static void
Lev Walkine0272aa2005-03-04 11:26:08 +00001622PER_Visible_2_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00001623 td->free_struct = asn_DEF_PER_Visible.free_struct;
1624 td->print_struct = asn_DEF_PER_Visible.print_struct;
1625 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
1626 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
1627 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
1628 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
1629 td->elements = asn_DEF_PER_Visible.elements;
1630 td->elements_count = asn_DEF_PER_Visible.elements_count;
1631 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00001632}
1633
Lev Walkina9cc46e2004-09-22 16:06:28 +00001634void
Lev Walkindfae9752004-09-29 13:19:37 +00001635PER_Visible_2_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001636 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001637 PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001638 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00001639}
1640
1641int
Lev Walkindfae9752004-09-29 13:19:37 +00001642PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001643 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001644 PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00001645 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1646}
1647
Lev Walkindc06f6b2004-10-20 15:50:55 +00001648asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001649PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001650 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001651 PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001652 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001653}
1654
1655asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001656PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001657 void *structure, int tag_mode, ber_tlv_tag_t tag,
1658 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001659 PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001660 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1661}
1662
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001663asn_dec_rval_t
1664PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1665 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001666 PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001667 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1668}
1669
Lev Walkina9cc46e2004-09-22 16:06:28 +00001670asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001671PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001672 int ilevel, enum xer_encoder_flags_e flags,
1673 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001674 PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001675 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00001676}
1677
1678
1679/*** <<< STAT-DEFS [PER-Visible-2] >>> ***/
1680
Lev Walkine0272aa2005-03-04 11:26:08 +00001681static ber_tlv_tag_t asn_DEF_PER_Visible_2_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001682 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001683};
Lev Walkindfae9752004-09-29 13:19:37 +00001684asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001685 "PER-Visible-2",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001686 "PER-Visible-2",
Lev Walkina9cc46e2004-09-22 16:06:28 +00001687 PER_Visible_2_free,
1688 PER_Visible_2_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001689 PER_Visible_2_constraint,
1690 PER_Visible_2_decode_ber,
1691 PER_Visible_2_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001692 PER_Visible_2_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001693 PER_Visible_2_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00001694 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00001695 asn_DEF_PER_Visible_2_0_tags,
1696 sizeof(asn_DEF_PER_Visible_2_0_tags)
1697 /sizeof(asn_DEF_PER_Visible_2_0_tags[0]), /* 1 */
1698 asn_DEF_PER_Visible_2_0_tags, /* Same as above */
1699 sizeof(asn_DEF_PER_Visible_2_0_tags)
1700 /sizeof(asn_DEF_PER_Visible_2_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001701 0, 0, /* No members */
1702 0 /* No specifics */
1703};
1704
1705
1706/*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/
1707
1708#include <PER-Visible.h>
1709
1710/*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/
1711
Lev Walkin006de1c2004-08-20 13:37:45 +00001712typedef PER_Visible_t Not_PER_Visible_1_t;
1713
Lev Walkin006de1c2004-08-20 13:37:45 +00001714/*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/
1715
Lev Walkindfae9752004-09-29 13:19:37 +00001716extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001717asn_struct_free_f Not_PER_Visible_1_free;
1718asn_struct_print_f Not_PER_Visible_1_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001719asn_constr_check_f Not_PER_Visible_1_constraint;
1720ber_type_decoder_f Not_PER_Visible_1_decode_ber;
1721der_type_encoder_f Not_PER_Visible_1_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001722xer_type_decoder_f Not_PER_Visible_1_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001723xer_type_encoder_f Not_PER_Visible_1_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001724
1725/*** <<< CTABLES [Not-PER-Visible-1] >>> ***/
1726
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001727static int check_permitted_alphabet_0(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001728 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001729 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00001730 const uint8_t *ch = st->buf;
1731 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00001732
1733 for(; ch < end; ch++) {
1734 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00001735 if(!(cv >= 65 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001736 }
Lev Walkin775885e2004-08-22 12:47:03 +00001737 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001738}
1739
1740
1741/*** <<< CODE [Not-PER-Visible-1] >>> ***/
1742
1743int
Lev Walkindfae9752004-09-29 13:19:37 +00001744Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001745 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001746 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001747
1748 if(!sptr) {
1749 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00001750 "%s: value not given (%s:%d)",
1751 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001752 return -1;
1753 }
1754
1755
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001756 if(!check_permitted_alphabet_0(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00001757 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00001758 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00001759 } else {
1760 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00001761 "%s: constraint failed (%s:%d)",
1762 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001763 return -1;
1764 }
1765}
1766
1767/*
1768 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001769 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001770 */
1771static void
Lev Walkine0272aa2005-03-04 11:26:08 +00001772Not_PER_Visible_1_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00001773 td->free_struct = asn_DEF_PER_Visible.free_struct;
1774 td->print_struct = asn_DEF_PER_Visible.print_struct;
1775 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
1776 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
1777 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
1778 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
1779 td->elements = asn_DEF_PER_Visible.elements;
1780 td->elements_count = asn_DEF_PER_Visible.elements_count;
1781 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00001782}
1783
Lev Walkina9cc46e2004-09-22 16:06:28 +00001784void
Lev Walkindfae9752004-09-29 13:19:37 +00001785Not_PER_Visible_1_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001786 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001787 Not_PER_Visible_1_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001788 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00001789}
1790
1791int
Lev Walkindfae9752004-09-29 13:19:37 +00001792Not_PER_Visible_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001793 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001794 Not_PER_Visible_1_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00001795 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1796}
1797
Lev Walkindc06f6b2004-10-20 15:50:55 +00001798asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001799Not_PER_Visible_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001800 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001801 Not_PER_Visible_1_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001802 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001803}
1804
1805asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001806Not_PER_Visible_1_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001807 void *structure, int tag_mode, ber_tlv_tag_t tag,
1808 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001809 Not_PER_Visible_1_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001810 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1811}
1812
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001813asn_dec_rval_t
1814Not_PER_Visible_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1815 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001816 Not_PER_Visible_1_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001817 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1818}
1819
Lev Walkina9cc46e2004-09-22 16:06:28 +00001820asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001821Not_PER_Visible_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001822 int ilevel, enum xer_encoder_flags_e flags,
1823 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001824 Not_PER_Visible_1_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001825 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00001826}
1827
1828
1829/*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/
1830
Lev Walkine0272aa2005-03-04 11:26:08 +00001831static ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001832 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001833};
Lev Walkindfae9752004-09-29 13:19:37 +00001834asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001835 "Not-PER-Visible-1",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001836 "Not-PER-Visible-1",
Lev Walkina9cc46e2004-09-22 16:06:28 +00001837 Not_PER_Visible_1_free,
1838 Not_PER_Visible_1_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001839 Not_PER_Visible_1_constraint,
1840 Not_PER_Visible_1_decode_ber,
1841 Not_PER_Visible_1_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001842 Not_PER_Visible_1_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001843 Not_PER_Visible_1_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00001844 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00001845 asn_DEF_Not_PER_Visible_1_0_tags,
1846 sizeof(asn_DEF_Not_PER_Visible_1_0_tags)
1847 /sizeof(asn_DEF_Not_PER_Visible_1_0_tags[0]), /* 1 */
1848 asn_DEF_Not_PER_Visible_1_0_tags, /* Same as above */
1849 sizeof(asn_DEF_Not_PER_Visible_1_0_tags)
1850 /sizeof(asn_DEF_Not_PER_Visible_1_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00001851 0, 0, /* No members */
1852 0 /* No specifics */
1853};
1854
1855
1856/*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/
1857
1858#include <PER-Visible.h>
1859
1860/*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/
1861
Lev Walkin006de1c2004-08-20 13:37:45 +00001862typedef PER_Visible_t Not_PER_Visible_2_t;
1863
Lev Walkin006de1c2004-08-20 13:37:45 +00001864/*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/
1865
Lev Walkindfae9752004-09-29 13:19:37 +00001866extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001867asn_struct_free_f Not_PER_Visible_2_free;
1868asn_struct_print_f Not_PER_Visible_2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00001869asn_constr_check_f Not_PER_Visible_2_constraint;
1870ber_type_decoder_f Not_PER_Visible_2_decode_ber;
1871der_type_encoder_f Not_PER_Visible_2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001872xer_type_decoder_f Not_PER_Visible_2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00001873xer_type_encoder_f Not_PER_Visible_2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00001874
Lev Walkind35c8b52004-08-25 02:08:08 +00001875/*** <<< CTABLES [Not-PER-Visible-2] >>> ***/
1876
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001877static int check_permitted_alphabet_0(const void *sptr) {
Lev Walkind35c8b52004-08-25 02:08:08 +00001878 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001879 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +00001880 const uint8_t *ch = st->buf;
1881 const uint8_t *end = ch + st->size;
1882
1883 for(; ch < end; ch++) {
1884 uint8_t cv = *ch;
1885 if(!(cv >= 65 && cv <= 66)) return -1;
1886 }
1887 return 0;
1888}
1889
1890
Lev Walkin006de1c2004-08-20 13:37:45 +00001891/*** <<< CODE [Not-PER-Visible-2] >>> ***/
1892
1893int
Lev Walkindfae9752004-09-29 13:19:37 +00001894Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001895 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00001896 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00001897
1898 if(!sptr) {
1899 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00001900 "%s: value not given (%s:%d)",
1901 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00001902 return -1;
1903 }
1904
1905
Lev Walkincaf0d5a2005-03-04 23:48:19 +00001906 if(!check_permitted_alphabet_0(st)) {
Lev Walkind35c8b52004-08-25 02:08:08 +00001907 /* Constraint check succeeded */
1908 return 0;
1909 } else {
1910 _ASN_ERRLOG(app_errlog, app_key,
1911 "%s: constraint failed (%s:%d)",
1912 td->name, __FILE__, __LINE__);
1913 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00001914 }
Lev Walkin006de1c2004-08-20 13:37:45 +00001915}
1916
1917/*
1918 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00001919 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00001920 */
1921static void
Lev Walkine0272aa2005-03-04 11:26:08 +00001922Not_PER_Visible_2_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00001923 td->free_struct = asn_DEF_PER_Visible.free_struct;
1924 td->print_struct = asn_DEF_PER_Visible.print_struct;
1925 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
1926 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
1927 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
1928 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
1929 td->elements = asn_DEF_PER_Visible.elements;
1930 td->elements_count = asn_DEF_PER_Visible.elements_count;
1931 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00001932}
1933
Lev Walkina9cc46e2004-09-22 16:06:28 +00001934void
Lev Walkindfae9752004-09-29 13:19:37 +00001935Not_PER_Visible_2_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001936 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001937 Not_PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001938 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00001939}
1940
1941int
Lev Walkindfae9752004-09-29 13:19:37 +00001942Not_PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00001943 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001944 Not_PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00001945 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
1946}
1947
Lev Walkindc06f6b2004-10-20 15:50:55 +00001948asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001949Not_PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001950 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001951 Not_PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00001952 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001953}
1954
1955asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001956Not_PER_Visible_2_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001957 void *structure, int tag_mode, ber_tlv_tag_t tag,
1958 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001959 Not_PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001960 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
1961}
1962
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001963asn_dec_rval_t
1964Not_PER_Visible_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
1965 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001966 Not_PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001967 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
1968}
1969
Lev Walkina9cc46e2004-09-22 16:06:28 +00001970asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00001971Not_PER_Visible_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001972 int ilevel, enum xer_encoder_flags_e flags,
1973 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00001974 Not_PER_Visible_2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00001975 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00001976}
1977
1978
1979/*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/
1980
Lev Walkine0272aa2005-03-04 11:26:08 +00001981static ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00001982 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00001983};
Lev Walkindfae9752004-09-29 13:19:37 +00001984asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00001985 "Not-PER-Visible-2",
Lev Walkindc06f6b2004-10-20 15:50:55 +00001986 "Not-PER-Visible-2",
Lev Walkina9cc46e2004-09-22 16:06:28 +00001987 Not_PER_Visible_2_free,
1988 Not_PER_Visible_2_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00001989 Not_PER_Visible_2_constraint,
1990 Not_PER_Visible_2_decode_ber,
1991 Not_PER_Visible_2_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00001992 Not_PER_Visible_2_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00001993 Not_PER_Visible_2_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00001994 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00001995 asn_DEF_Not_PER_Visible_2_0_tags,
1996 sizeof(asn_DEF_Not_PER_Visible_2_0_tags)
1997 /sizeof(asn_DEF_Not_PER_Visible_2_0_tags[0]), /* 1 */
1998 asn_DEF_Not_PER_Visible_2_0_tags, /* Same as above */
1999 sizeof(asn_DEF_Not_PER_Visible_2_0_tags)
2000 /sizeof(asn_DEF_Not_PER_Visible_2_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00002001 0, 0, /* No members */
2002 0 /* No specifics */
2003};
2004
2005
2006/*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/
2007
2008#include <PER-Visible.h>
2009
2010/*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/
2011
Lev Walkin006de1c2004-08-20 13:37:45 +00002012typedef PER_Visible_t Not_PER_Visible_3_t;
2013
Lev Walkin006de1c2004-08-20 13:37:45 +00002014/*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/
2015
Lev Walkindfae9752004-09-29 13:19:37 +00002016extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002017asn_struct_free_f Not_PER_Visible_3_free;
2018asn_struct_print_f Not_PER_Visible_3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00002019asn_constr_check_f Not_PER_Visible_3_constraint;
2020ber_type_decoder_f Not_PER_Visible_3_decode_ber;
2021der_type_encoder_f Not_PER_Visible_3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002022xer_type_decoder_f Not_PER_Visible_3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002023xer_type_encoder_f Not_PER_Visible_3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00002024
Lev Walkind35c8b52004-08-25 02:08:08 +00002025/*** <<< CTABLES [Not-PER-Visible-3] >>> ***/
2026
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002027static int check_permitted_alphabet_0(const void *sptr) {
Lev Walkind35c8b52004-08-25 02:08:08 +00002028 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002029 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkind35c8b52004-08-25 02:08:08 +00002030 const uint8_t *ch = st->buf;
2031 const uint8_t *end = ch + st->size;
2032
2033 for(; ch < end; ch++) {
2034 uint8_t cv = *ch;
2035 if(!(cv >= 65 && cv <= 66)) return -1;
2036 }
2037 return 0;
2038}
2039
2040
Lev Walkin006de1c2004-08-20 13:37:45 +00002041/*** <<< CODE [Not-PER-Visible-3] >>> ***/
2042
2043int
Lev Walkindfae9752004-09-29 13:19:37 +00002044Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002045 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002046 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00002047
2048 if(!sptr) {
2049 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002050 "%s: value not given (%s:%d)",
2051 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002052 return -1;
2053 }
2054
2055
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002056 if(!check_permitted_alphabet_0(st)) {
Lev Walkind35c8b52004-08-25 02:08:08 +00002057 /* Constraint check succeeded */
2058 return 0;
2059 } else {
2060 _ASN_ERRLOG(app_errlog, app_key,
2061 "%s: constraint failed (%s:%d)",
2062 td->name, __FILE__, __LINE__);
2063 return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00002064 }
Lev Walkin006de1c2004-08-20 13:37:45 +00002065}
2066
2067/*
2068 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00002069 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00002070 */
2071static void
Lev Walkine0272aa2005-03-04 11:26:08 +00002072Not_PER_Visible_3_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00002073 td->free_struct = asn_DEF_PER_Visible.free_struct;
2074 td->print_struct = asn_DEF_PER_Visible.print_struct;
2075 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2076 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2077 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2078 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2079 td->elements = asn_DEF_PER_Visible.elements;
2080 td->elements_count = asn_DEF_PER_Visible.elements_count;
2081 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00002082}
2083
Lev Walkina9cc46e2004-09-22 16:06:28 +00002084void
Lev Walkindfae9752004-09-29 13:19:37 +00002085Not_PER_Visible_3_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002086 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002087 Not_PER_Visible_3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002088 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00002089}
2090
2091int
Lev Walkindfae9752004-09-29 13:19:37 +00002092Not_PER_Visible_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002093 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002094 Not_PER_Visible_3_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00002095 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2096}
2097
Lev Walkindc06f6b2004-10-20 15:50:55 +00002098asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002099Not_PER_Visible_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002100 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002101 Not_PER_Visible_3_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00002102 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002103}
2104
2105asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002106Not_PER_Visible_3_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002107 void *structure, int tag_mode, ber_tlv_tag_t tag,
2108 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002109 Not_PER_Visible_3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002110 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2111}
2112
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002113asn_dec_rval_t
2114Not_PER_Visible_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2115 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002116 Not_PER_Visible_3_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002117 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2118}
2119
Lev Walkina9cc46e2004-09-22 16:06:28 +00002120asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002121Not_PER_Visible_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002122 int ilevel, enum xer_encoder_flags_e flags,
2123 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002124 Not_PER_Visible_3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002125 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00002126}
2127
2128
2129/*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/
2130
Lev Walkine0272aa2005-03-04 11:26:08 +00002131static ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00002132 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00002133};
Lev Walkindfae9752004-09-29 13:19:37 +00002134asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00002135 "Not-PER-Visible-3",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002136 "Not-PER-Visible-3",
Lev Walkina9cc46e2004-09-22 16:06:28 +00002137 Not_PER_Visible_3_free,
2138 Not_PER_Visible_3_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00002139 Not_PER_Visible_3_constraint,
2140 Not_PER_Visible_3_decode_ber,
2141 Not_PER_Visible_3_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002142 Not_PER_Visible_3_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002143 Not_PER_Visible_3_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00002144 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00002145 asn_DEF_Not_PER_Visible_3_0_tags,
2146 sizeof(asn_DEF_Not_PER_Visible_3_0_tags)
2147 /sizeof(asn_DEF_Not_PER_Visible_3_0_tags[0]), /* 1 */
2148 asn_DEF_Not_PER_Visible_3_0_tags, /* Same as above */
2149 sizeof(asn_DEF_Not_PER_Visible_3_0_tags)
2150 /sizeof(asn_DEF_Not_PER_Visible_3_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00002151 0, 0, /* No members */
2152 0 /* No specifics */
2153};
2154
2155
2156/*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/
2157
2158#include <PER-Visible.h>
2159
2160/*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/
2161
Lev Walkin006de1c2004-08-20 13:37:45 +00002162typedef PER_Visible_t SIZE_but_not_FROM_t;
2163
Lev Walkin006de1c2004-08-20 13:37:45 +00002164/*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/
2165
Lev Walkindfae9752004-09-29 13:19:37 +00002166extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002167asn_struct_free_f SIZE_but_not_FROM_free;
2168asn_struct_print_f SIZE_but_not_FROM_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00002169asn_constr_check_f SIZE_but_not_FROM_constraint;
2170ber_type_decoder_f SIZE_but_not_FROM_decode_ber;
2171der_type_encoder_f SIZE_but_not_FROM_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002172xer_type_decoder_f SIZE_but_not_FROM_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002173xer_type_encoder_f SIZE_but_not_FROM_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00002174
2175/*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/
2176
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002177static int check_permitted_alphabet_0(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00002178 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002179 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00002180 const uint8_t *ch = st->buf;
2181 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00002182
2183 for(; ch < end; ch++) {
2184 uint8_t cv = *ch;
Lev Walkind35c8b52004-08-25 02:08:08 +00002185 if(!(cv >= 65 && cv <= 68)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00002186 }
Lev Walkin775885e2004-08-22 12:47:03 +00002187 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002188}
2189
2190
2191/*** <<< CODE [SIZE-but-not-FROM] >>> ***/
2192
2193int
Lev Walkindfae9752004-09-29 13:19:37 +00002194SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002195 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002196 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00002197 size_t size;
2198
2199 if(!sptr) {
2200 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002201 "%s: value not given (%s:%d)",
2202 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002203 return -1;
2204 }
2205
2206 size = st->size;
2207
2208 if((size >= 1 && size <= 4)
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002209 && !check_permitted_alphabet_0(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00002210 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00002211 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002212 } else {
2213 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002214 "%s: constraint failed (%s:%d)",
2215 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002216 return -1;
2217 }
2218}
2219
2220/*
2221 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00002222 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00002223 */
2224static void
Lev Walkine0272aa2005-03-04 11:26:08 +00002225SIZE_but_not_FROM_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00002226 td->free_struct = asn_DEF_PER_Visible.free_struct;
2227 td->print_struct = asn_DEF_PER_Visible.print_struct;
2228 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2229 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2230 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2231 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2232 td->elements = asn_DEF_PER_Visible.elements;
2233 td->elements_count = asn_DEF_PER_Visible.elements_count;
2234 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00002235}
2236
Lev Walkina9cc46e2004-09-22 16:06:28 +00002237void
Lev Walkindfae9752004-09-29 13:19:37 +00002238SIZE_but_not_FROM_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002239 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002240 SIZE_but_not_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002241 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00002242}
2243
2244int
Lev Walkindfae9752004-09-29 13:19:37 +00002245SIZE_but_not_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002246 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002247 SIZE_but_not_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00002248 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2249}
2250
Lev Walkindc06f6b2004-10-20 15:50:55 +00002251asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002252SIZE_but_not_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002253 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002254 SIZE_but_not_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00002255 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002256}
2257
2258asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002259SIZE_but_not_FROM_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002260 void *structure, int tag_mode, ber_tlv_tag_t tag,
2261 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002262 SIZE_but_not_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002263 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2264}
2265
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002266asn_dec_rval_t
2267SIZE_but_not_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2268 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002269 SIZE_but_not_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002270 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2271}
2272
Lev Walkina9cc46e2004-09-22 16:06:28 +00002273asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002274SIZE_but_not_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002275 int ilevel, enum xer_encoder_flags_e flags,
2276 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002277 SIZE_but_not_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002278 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00002279}
2280
2281
2282/*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/
2283
Lev Walkine0272aa2005-03-04 11:26:08 +00002284static ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00002285 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00002286};
Lev Walkindfae9752004-09-29 13:19:37 +00002287asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = {
Lev Walkin006de1c2004-08-20 13:37:45 +00002288 "SIZE-but-not-FROM",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002289 "SIZE-but-not-FROM",
Lev Walkina9cc46e2004-09-22 16:06:28 +00002290 SIZE_but_not_FROM_free,
2291 SIZE_but_not_FROM_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00002292 SIZE_but_not_FROM_constraint,
2293 SIZE_but_not_FROM_decode_ber,
2294 SIZE_but_not_FROM_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002295 SIZE_but_not_FROM_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002296 SIZE_but_not_FROM_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00002297 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00002298 asn_DEF_SIZE_but_not_FROM_0_tags,
2299 sizeof(asn_DEF_SIZE_but_not_FROM_0_tags)
2300 /sizeof(asn_DEF_SIZE_but_not_FROM_0_tags[0]), /* 1 */
2301 asn_DEF_SIZE_but_not_FROM_0_tags, /* Same as above */
2302 sizeof(asn_DEF_SIZE_but_not_FROM_0_tags)
2303 /sizeof(asn_DEF_SIZE_but_not_FROM_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00002304 0, 0, /* No members */
2305 0 /* No specifics */
2306};
2307
2308
2309/*** <<< INCLUDES [SIZE-and-FROM] >>> ***/
2310
2311#include <PER-Visible.h>
2312
2313/*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/
2314
Lev Walkin006de1c2004-08-20 13:37:45 +00002315typedef PER_Visible_t SIZE_and_FROM_t;
2316
Lev Walkin006de1c2004-08-20 13:37:45 +00002317/*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/
2318
Lev Walkindfae9752004-09-29 13:19:37 +00002319extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002320asn_struct_free_f SIZE_and_FROM_free;
2321asn_struct_print_f SIZE_and_FROM_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00002322asn_constr_check_f SIZE_and_FROM_constraint;
2323ber_type_decoder_f SIZE_and_FROM_decode_ber;
2324der_type_encoder_f SIZE_and_FROM_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002325xer_type_decoder_f SIZE_and_FROM_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002326xer_type_encoder_f SIZE_and_FROM_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00002327
2328/*** <<< CTABLES [SIZE-and-FROM] >>> ***/
2329
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002330static int check_permitted_alphabet_0(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00002331 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002332 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00002333 const uint8_t *ch = st->buf;
2334 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00002335
2336 for(; ch < end; ch++) {
2337 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00002338 if(!(cv >= 65 && cv <= 68)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00002339 }
Lev Walkin775885e2004-08-22 12:47:03 +00002340 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002341}
2342
2343
2344/*** <<< CODE [SIZE-and-FROM] >>> ***/
2345
2346int
Lev Walkindfae9752004-09-29 13:19:37 +00002347SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002348 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002349 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00002350 size_t size;
2351
2352 if(!sptr) {
2353 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002354 "%s: value not given (%s:%d)",
2355 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002356 return -1;
2357 }
2358
2359 size = st->size;
2360
2361 if((size >= 1 && size <= 4)
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002362 && !check_permitted_alphabet_0(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00002363 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00002364 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002365 } else {
2366 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002367 "%s: constraint failed (%s:%d)",
2368 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002369 return -1;
2370 }
2371}
2372
2373/*
2374 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00002375 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00002376 */
2377static void
Lev Walkine0272aa2005-03-04 11:26:08 +00002378SIZE_and_FROM_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00002379 td->free_struct = asn_DEF_PER_Visible.free_struct;
2380 td->print_struct = asn_DEF_PER_Visible.print_struct;
2381 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2382 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2383 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2384 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2385 td->elements = asn_DEF_PER_Visible.elements;
2386 td->elements_count = asn_DEF_PER_Visible.elements_count;
2387 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00002388}
2389
Lev Walkina9cc46e2004-09-22 16:06:28 +00002390void
Lev Walkindfae9752004-09-29 13:19:37 +00002391SIZE_and_FROM_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002392 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002393 SIZE_and_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002394 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00002395}
2396
2397int
Lev Walkindfae9752004-09-29 13:19:37 +00002398SIZE_and_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002399 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002400 SIZE_and_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00002401 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2402}
2403
Lev Walkindc06f6b2004-10-20 15:50:55 +00002404asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002405SIZE_and_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002406 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002407 SIZE_and_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00002408 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002409}
2410
2411asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002412SIZE_and_FROM_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002413 void *structure, int tag_mode, ber_tlv_tag_t tag,
2414 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002415 SIZE_and_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002416 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2417}
2418
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002419asn_dec_rval_t
2420SIZE_and_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2421 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002422 SIZE_and_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002423 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2424}
2425
Lev Walkina9cc46e2004-09-22 16:06:28 +00002426asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002427SIZE_and_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002428 int ilevel, enum xer_encoder_flags_e flags,
2429 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002430 SIZE_and_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002431 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00002432}
2433
2434
2435/*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/
2436
Lev Walkine0272aa2005-03-04 11:26:08 +00002437static ber_tlv_tag_t asn_DEF_SIZE_and_FROM_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00002438 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00002439};
Lev Walkindfae9752004-09-29 13:19:37 +00002440asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = {
Lev Walkin006de1c2004-08-20 13:37:45 +00002441 "SIZE-and-FROM",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002442 "SIZE-and-FROM",
Lev Walkina9cc46e2004-09-22 16:06:28 +00002443 SIZE_and_FROM_free,
2444 SIZE_and_FROM_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00002445 SIZE_and_FROM_constraint,
2446 SIZE_and_FROM_decode_ber,
2447 SIZE_and_FROM_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002448 SIZE_and_FROM_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002449 SIZE_and_FROM_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00002450 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00002451 asn_DEF_SIZE_and_FROM_0_tags,
2452 sizeof(asn_DEF_SIZE_and_FROM_0_tags)
2453 /sizeof(asn_DEF_SIZE_and_FROM_0_tags[0]), /* 1 */
2454 asn_DEF_SIZE_and_FROM_0_tags, /* Same as above */
2455 sizeof(asn_DEF_SIZE_and_FROM_0_tags)
2456 /sizeof(asn_DEF_SIZE_and_FROM_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00002457 0, 0, /* No members */
2458 0 /* No specifics */
2459};
2460
2461
2462/*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/
2463
2464#include <PER-Visible.h>
2465
2466/*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/
2467
Lev Walkin006de1c2004-08-20 13:37:45 +00002468typedef PER_Visible_t Neither_SIZE_nor_FROM_t;
2469
Lev Walkin006de1c2004-08-20 13:37:45 +00002470/*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/
2471
Lev Walkindfae9752004-09-29 13:19:37 +00002472extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002473asn_struct_free_f Neither_SIZE_nor_FROM_free;
2474asn_struct_print_f Neither_SIZE_nor_FROM_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00002475asn_constr_check_f Neither_SIZE_nor_FROM_constraint;
2476ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber;
2477der_type_encoder_f Neither_SIZE_nor_FROM_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002478xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002479xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00002480
2481/*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/
2482
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002483static int check_permitted_alphabet_0(const void *sptr) {
Lev Walkin006de1c2004-08-20 13:37:45 +00002484 /* The underlying type is IA5String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002485 const IA5String_t *st = (const IA5String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00002486 const uint8_t *ch = st->buf;
2487 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00002488
2489 for(; ch < end; ch++) {
2490 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00002491 if(!(cv >= 65 && cv <= 70)) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00002492 }
Lev Walkin775885e2004-08-22 12:47:03 +00002493 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002494}
2495
2496
2497/*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/
2498
2499int
Lev Walkindfae9752004-09-29 13:19:37 +00002500Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002501 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002502 const PER_Visible_t *st = (const PER_Visible_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00002503
2504 if(!sptr) {
2505 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002506 "%s: value not given (%s:%d)",
2507 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002508 return -1;
2509 }
2510
2511
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002512 if(!check_permitted_alphabet_0(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00002513 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00002514 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002515 } else {
2516 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002517 "%s: constraint failed (%s:%d)",
2518 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002519 return -1;
2520 }
2521}
2522
2523/*
2524 * This type is implemented using PER_Visible,
Lev Walkinc3808c12004-09-23 22:14:58 +00002525 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00002526 */
2527static void
Lev Walkine0272aa2005-03-04 11:26:08 +00002528Neither_SIZE_nor_FROM_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00002529 td->free_struct = asn_DEF_PER_Visible.free_struct;
2530 td->print_struct = asn_DEF_PER_Visible.print_struct;
2531 td->ber_decoder = asn_DEF_PER_Visible.ber_decoder;
2532 td->der_encoder = asn_DEF_PER_Visible.der_encoder;
2533 td->xer_decoder = asn_DEF_PER_Visible.xer_decoder;
2534 td->xer_encoder = asn_DEF_PER_Visible.xer_encoder;
2535 td->elements = asn_DEF_PER_Visible.elements;
2536 td->elements_count = asn_DEF_PER_Visible.elements_count;
2537 td->specifics = asn_DEF_PER_Visible.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00002538}
2539
Lev Walkina9cc46e2004-09-22 16:06:28 +00002540void
Lev Walkindfae9752004-09-29 13:19:37 +00002541Neither_SIZE_nor_FROM_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002542 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002543 Neither_SIZE_nor_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002544 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00002545}
2546
2547int
Lev Walkindfae9752004-09-29 13:19:37 +00002548Neither_SIZE_nor_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002549 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002550 Neither_SIZE_nor_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00002551 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2552}
2553
Lev Walkindc06f6b2004-10-20 15:50:55 +00002554asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002555Neither_SIZE_nor_FROM_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002556 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002557 Neither_SIZE_nor_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00002558 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002559}
2560
2561asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002562Neither_SIZE_nor_FROM_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002563 void *structure, int tag_mode, ber_tlv_tag_t tag,
2564 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002565 Neither_SIZE_nor_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002566 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2567}
2568
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002569asn_dec_rval_t
2570Neither_SIZE_nor_FROM_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2571 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002572 Neither_SIZE_nor_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002573 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2574}
2575
Lev Walkina9cc46e2004-09-22 16:06:28 +00002576asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002577Neither_SIZE_nor_FROM_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002578 int ilevel, enum xer_encoder_flags_e flags,
2579 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002580 Neither_SIZE_nor_FROM_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002581 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00002582}
2583
2584
2585/*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/
2586
Lev Walkine0272aa2005-03-04 11:26:08 +00002587static ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00002588 (ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00002589};
Lev Walkindfae9752004-09-29 13:19:37 +00002590asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = {
Lev Walkin006de1c2004-08-20 13:37:45 +00002591 "Neither-SIZE-nor-FROM",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002592 "Neither-SIZE-nor-FROM",
Lev Walkina9cc46e2004-09-22 16:06:28 +00002593 Neither_SIZE_nor_FROM_free,
2594 Neither_SIZE_nor_FROM_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00002595 Neither_SIZE_nor_FROM_constraint,
2596 Neither_SIZE_nor_FROM_decode_ber,
2597 Neither_SIZE_nor_FROM_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002598 Neither_SIZE_nor_FROM_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002599 Neither_SIZE_nor_FROM_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00002600 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00002601 asn_DEF_Neither_SIZE_nor_FROM_0_tags,
2602 sizeof(asn_DEF_Neither_SIZE_nor_FROM_0_tags)
2603 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_0_tags[0]), /* 1 */
2604 asn_DEF_Neither_SIZE_nor_FROM_0_tags, /* Same as above */
2605 sizeof(asn_DEF_Neither_SIZE_nor_FROM_0_tags)
2606 /sizeof(asn_DEF_Neither_SIZE_nor_FROM_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00002607 0, 0, /* No members */
2608 0 /* No specifics */
2609};
2610
2611
Lev Walkin55cc44a2004-10-03 09:14:32 +00002612/*** <<< INCLUDES [Utf8-4] >>> ***/
2613
2614#include <UTF8String.h>
2615
2616/*** <<< TYPE-DECLS [Utf8-4] >>> ***/
2617
Lev Walkin55cc44a2004-10-03 09:14:32 +00002618typedef UTF8String_t Utf8_4_t;
2619
2620/*** <<< FUNC-DECLS [Utf8-4] >>> ***/
2621
2622extern asn_TYPE_descriptor_t asn_DEF_Utf8_4;
2623asn_struct_free_f Utf8_4_free;
2624asn_struct_print_f Utf8_4_print;
2625asn_constr_check_f Utf8_4_constraint;
2626ber_type_decoder_f Utf8_4_decode_ber;
2627der_type_encoder_f Utf8_4_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002628xer_type_decoder_f Utf8_4_decode_xer;
Lev Walkin55cc44a2004-10-03 09:14:32 +00002629xer_type_encoder_f Utf8_4_encode_xer;
2630
2631/*** <<< CTABLES [Utf8-4] >>> ***/
2632
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002633static int check_permitted_alphabet_0(const void *sptr) {
Lev Walkin55cc44a2004-10-03 09:14:32 +00002634 if(UTF8String_length((const UTF8String_t *)sptr) < 0)
2635 return -1; /* Alphabet (sic!) test failed. */
2636
2637 return 0;
2638}
2639
2640
2641/*** <<< CODE [Utf8-4] >>> ***/
2642
2643int
2644Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
2645 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002646 const UTF8String_t *st = (const UTF8String_t *)sptr;
Lev Walkin55cc44a2004-10-03 09:14:32 +00002647
2648 if(!sptr) {
2649 _ASN_ERRLOG(app_errlog, app_key,
2650 "%s: value not given (%s:%d)",
2651 td->name, __FILE__, __LINE__);
2652 return -1;
2653 }
2654
2655
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002656 if(!check_permitted_alphabet_0(st)) {
Lev Walkin55cc44a2004-10-03 09:14:32 +00002657 /* Constraint check succeeded */
2658 return 0;
2659 } else {
2660 _ASN_ERRLOG(app_errlog, app_key,
2661 "%s: constraint failed (%s:%d)",
2662 td->name, __FILE__, __LINE__);
2663 return -1;
2664 }
2665}
2666
2667/*
2668 * This type is implemented using UTF8String,
2669 * so here we adjust the DEF accordingly.
2670 */
2671static void
Lev Walkine0272aa2005-03-04 11:26:08 +00002672Utf8_4_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkin55cc44a2004-10-03 09:14:32 +00002673 td->free_struct = asn_DEF_UTF8String.free_struct;
2674 td->print_struct = asn_DEF_UTF8String.print_struct;
2675 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
2676 td->der_encoder = asn_DEF_UTF8String.der_encoder;
2677 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
2678 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
2679 td->elements = asn_DEF_UTF8String.elements;
2680 td->elements_count = asn_DEF_UTF8String.elements_count;
2681 td->specifics = asn_DEF_UTF8String.specifics;
2682}
2683
2684void
2685Utf8_4_free(asn_TYPE_descriptor_t *td,
2686 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002687 Utf8_4_0_inherit_TYPE_descriptor(td);
Lev Walkin55cc44a2004-10-03 09:14:32 +00002688 td->free_struct(td, struct_ptr, contents_only);
2689}
2690
2691int
2692Utf8_4_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
2693 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002694 Utf8_4_0_inherit_TYPE_descriptor(td);
Lev Walkin55cc44a2004-10-03 09:14:32 +00002695 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2696}
2697
Lev Walkindc06f6b2004-10-20 15:50:55 +00002698asn_dec_rval_t
Lev Walkin55cc44a2004-10-03 09:14:32 +00002699Utf8_4_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2700 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002701 Utf8_4_0_inherit_TYPE_descriptor(td);
Lev Walkin55cc44a2004-10-03 09:14:32 +00002702 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
2703}
2704
2705asn_enc_rval_t
2706Utf8_4_encode_der(asn_TYPE_descriptor_t *td,
2707 void *structure, int tag_mode, ber_tlv_tag_t tag,
2708 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002709 Utf8_4_0_inherit_TYPE_descriptor(td);
Lev Walkin55cc44a2004-10-03 09:14:32 +00002710 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2711}
2712
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002713asn_dec_rval_t
2714Utf8_4_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2715 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002716 Utf8_4_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002717 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2718}
2719
Lev Walkin55cc44a2004-10-03 09:14:32 +00002720asn_enc_rval_t
2721Utf8_4_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
2722 int ilevel, enum xer_encoder_flags_e flags,
2723 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002724 Utf8_4_0_inherit_TYPE_descriptor(td);
Lev Walkin55cc44a2004-10-03 09:14:32 +00002725 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
2726}
2727
2728
2729/*** <<< STAT-DEFS [Utf8-4] >>> ***/
2730
Lev Walkine0272aa2005-03-04 11:26:08 +00002731static ber_tlv_tag_t asn_DEF_Utf8_4_0_tags[] = {
Lev Walkin55cc44a2004-10-03 09:14:32 +00002732 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
2733};
2734asn_TYPE_descriptor_t asn_DEF_Utf8_4 = {
2735 "Utf8-4",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002736 "Utf8-4",
Lev Walkin55cc44a2004-10-03 09:14:32 +00002737 Utf8_4_free,
2738 Utf8_4_print,
2739 Utf8_4_constraint,
2740 Utf8_4_decode_ber,
2741 Utf8_4_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002742 Utf8_4_decode_xer,
Lev Walkin55cc44a2004-10-03 09:14:32 +00002743 Utf8_4_encode_xer,
2744 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00002745 asn_DEF_Utf8_4_0_tags,
2746 sizeof(asn_DEF_Utf8_4_0_tags)
2747 /sizeof(asn_DEF_Utf8_4_0_tags[0]), /* 1 */
2748 asn_DEF_Utf8_4_0_tags, /* Same as above */
2749 sizeof(asn_DEF_Utf8_4_0_tags)
2750 /sizeof(asn_DEF_Utf8_4_0_tags[0]), /* 1 */
Lev Walkin55cc44a2004-10-03 09:14:32 +00002751 0, 0, /* No members */
2752 0 /* No specifics */
2753};
2754
2755
Lev Walkin006de1c2004-08-20 13:37:45 +00002756/*** <<< INCLUDES [Utf8-3] >>> ***/
2757
2758#include <Utf8-2.h>
2759
2760/*** <<< TYPE-DECLS [Utf8-3] >>> ***/
2761
Lev Walkin006de1c2004-08-20 13:37:45 +00002762typedef Utf8_2_t Utf8_3_t;
2763
Lev Walkin006de1c2004-08-20 13:37:45 +00002764/*** <<< FUNC-DECLS [Utf8-3] >>> ***/
2765
Lev Walkindfae9752004-09-29 13:19:37 +00002766extern asn_TYPE_descriptor_t asn_DEF_Utf8_3;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002767asn_struct_free_f Utf8_3_free;
2768asn_struct_print_f Utf8_3_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00002769asn_constr_check_f Utf8_3_constraint;
2770ber_type_decoder_f Utf8_3_decode_ber;
2771der_type_encoder_f Utf8_3_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002772xer_type_decoder_f Utf8_3_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002773xer_type_encoder_f Utf8_3_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00002774
2775/*** <<< CTABLES [Utf8-3] >>> ***/
2776
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002777static int permitted_alphabet_table_0[128] = {
Lev Walkin006de1c2004-08-20 13:37:45 +000027780,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
27790,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
27800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
27810,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
27820,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ABCDEFGHIJKLMNO */
27831,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, /* PQRSTUVWXYZ */
27840,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* abcdefghijklmno */
27851,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, /* pqrstuvwxyz */
2786};
2787
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002788static int check_permitted_alphabet_0(const void *sptr) {
2789 int *table = permitted_alphabet_table_0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002790 /* The underlying type is UTF8String */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002791 const UTF8String_t *st = (const UTF8String_t *)sptr;
Lev Walkin634a3b82004-08-22 03:30:05 +00002792 const uint8_t *ch = st->buf;
2793 const uint8_t *end = ch + st->size;
Lev Walkin006de1c2004-08-20 13:37:45 +00002794
2795 for(; ch < end; ch++) {
2796 uint8_t cv = *ch;
Lev Walkin775885e2004-08-22 12:47:03 +00002797 if(cv >= 0x80) return -1;
2798 if(!table[cv]) return -1;
Lev Walkin006de1c2004-08-20 13:37:45 +00002799 }
Lev Walkin775885e2004-08-22 12:47:03 +00002800 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002801}
2802
2803
2804/*** <<< CODE [Utf8-3] >>> ***/
2805
2806int
Lev Walkindfae9752004-09-29 13:19:37 +00002807Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002808 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002809 const Utf8_2_t *st = (const Utf8_2_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00002810 size_t size;
2811
2812 if(!sptr) {
2813 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002814 "%s: value not given (%s:%d)",
2815 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002816 return -1;
2817 }
2818
Lev Walkinfac2e942004-10-02 16:33:46 +00002819 size = UTF8String_length(st);
Lev Walkin00df16d2004-10-02 16:44:30 +00002820 if((ssize_t)size < 0) {
Lev Walkinfac2e942004-10-02 16:33:46 +00002821 _ASN_ERRLOG(app_errlog, app_key,
2822 "%s: UTF-8: broken encoding (%s:%d)",
2823 td->name, __FILE__, __LINE__);
2824 return -1;
2825 }
Lev Walkin006de1c2004-08-20 13:37:45 +00002826
2827 if((size >= 1 && size <= 2)
Lev Walkincaf0d5a2005-03-04 23:48:19 +00002828 && !check_permitted_alphabet_0(st)) {
Lev Walkin006de1c2004-08-20 13:37:45 +00002829 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00002830 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002831 } else {
2832 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002833 "%s: constraint failed (%s:%d)",
2834 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002835 return -1;
2836 }
2837}
2838
2839/*
2840 * This type is implemented using Utf8_2,
Lev Walkinc3808c12004-09-23 22:14:58 +00002841 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00002842 */
2843static void
Lev Walkine0272aa2005-03-04 11:26:08 +00002844Utf8_3_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00002845 td->free_struct = asn_DEF_Utf8_2.free_struct;
2846 td->print_struct = asn_DEF_Utf8_2.print_struct;
2847 td->ber_decoder = asn_DEF_Utf8_2.ber_decoder;
2848 td->der_encoder = asn_DEF_Utf8_2.der_encoder;
2849 td->xer_decoder = asn_DEF_Utf8_2.xer_decoder;
2850 td->xer_encoder = asn_DEF_Utf8_2.xer_encoder;
2851 td->elements = asn_DEF_Utf8_2.elements;
2852 td->elements_count = asn_DEF_Utf8_2.elements_count;
2853 td->specifics = asn_DEF_Utf8_2.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00002854}
2855
Lev Walkina9cc46e2004-09-22 16:06:28 +00002856void
Lev Walkindfae9752004-09-29 13:19:37 +00002857Utf8_3_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002858 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002859 Utf8_3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002860 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00002861}
2862
2863int
Lev Walkindfae9752004-09-29 13:19:37 +00002864Utf8_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002865 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002866 Utf8_3_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00002867 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
2868}
2869
Lev Walkindc06f6b2004-10-20 15:50:55 +00002870asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002871Utf8_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002872 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002873 Utf8_3_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00002874 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002875}
2876
2877asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002878Utf8_3_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002879 void *structure, int tag_mode, ber_tlv_tag_t tag,
2880 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002881 Utf8_3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002882 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
2883}
2884
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002885asn_dec_rval_t
2886Utf8_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
2887 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002888 Utf8_3_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002889 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
2890}
2891
Lev Walkina9cc46e2004-09-22 16:06:28 +00002892asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00002893Utf8_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002894 int ilevel, enum xer_encoder_flags_e flags,
2895 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00002896 Utf8_3_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00002897 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00002898}
2899
2900
2901/*** <<< STAT-DEFS [Utf8-3] >>> ***/
2902
Lev Walkine0272aa2005-03-04 11:26:08 +00002903static ber_tlv_tag_t asn_DEF_Utf8_3_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00002904 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00002905};
Lev Walkindfae9752004-09-29 13:19:37 +00002906asn_TYPE_descriptor_t asn_DEF_Utf8_3 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00002907 "Utf8-3",
Lev Walkindc06f6b2004-10-20 15:50:55 +00002908 "Utf8-3",
Lev Walkina9cc46e2004-09-22 16:06:28 +00002909 Utf8_3_free,
2910 Utf8_3_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00002911 Utf8_3_constraint,
2912 Utf8_3_decode_ber,
2913 Utf8_3_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002914 Utf8_3_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00002915 Utf8_3_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00002916 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00002917 asn_DEF_Utf8_3_0_tags,
2918 sizeof(asn_DEF_Utf8_3_0_tags)
2919 /sizeof(asn_DEF_Utf8_3_0_tags[0]), /* 1 */
2920 asn_DEF_Utf8_3_0_tags, /* Same as above */
2921 sizeof(asn_DEF_Utf8_3_0_tags)
2922 /sizeof(asn_DEF_Utf8_3_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00002923 0, 0, /* No members */
2924 0 /* No specifics */
2925};
2926
2927
2928/*** <<< INCLUDES [Utf8-2] >>> ***/
2929
2930#include <Utf8-1.h>
2931
2932/*** <<< TYPE-DECLS [Utf8-2] >>> ***/
2933
Lev Walkin006de1c2004-08-20 13:37:45 +00002934typedef Utf8_1_t Utf8_2_t;
2935
Lev Walkin006de1c2004-08-20 13:37:45 +00002936/*** <<< FUNC-DECLS [Utf8-2] >>> ***/
2937
Lev Walkindfae9752004-09-29 13:19:37 +00002938extern asn_TYPE_descriptor_t asn_DEF_Utf8_2;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002939asn_struct_free_f Utf8_2_free;
2940asn_struct_print_f Utf8_2_print;
Lev Walkin006de1c2004-08-20 13:37:45 +00002941asn_constr_check_f Utf8_2_constraint;
2942ber_type_decoder_f Utf8_2_decode_ber;
2943der_type_encoder_f Utf8_2_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00002944xer_type_decoder_f Utf8_2_decode_xer;
Lev Walkina9cc46e2004-09-22 16:06:28 +00002945xer_type_encoder_f Utf8_2_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00002946
2947/*** <<< CODE [Utf8-2] >>> ***/
2948
2949int
Lev Walkindfae9752004-09-29 13:19:37 +00002950Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00002951 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00002952 const Utf8_1_t *st = (const Utf8_1_t *)sptr;
Lev Walkin006de1c2004-08-20 13:37:45 +00002953 size_t size;
2954
2955 if(!sptr) {
2956 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002957 "%s: value not given (%s:%d)",
2958 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002959 return -1;
2960 }
2961
Lev Walkinfac2e942004-10-02 16:33:46 +00002962 size = UTF8String_length(st);
Lev Walkin00df16d2004-10-02 16:44:30 +00002963 if((ssize_t)size < 0) {
Lev Walkinfac2e942004-10-02 16:33:46 +00002964 _ASN_ERRLOG(app_errlog, app_key,
2965 "%s: UTF-8: broken encoding (%s:%d)",
2966 td->name, __FILE__, __LINE__);
2967 return -1;
2968 }
Lev Walkin006de1c2004-08-20 13:37:45 +00002969
2970 if((size >= 1 && size <= 2)) {
2971 /* Constraint check succeeded */
Lev Walkin775885e2004-08-22 12:47:03 +00002972 return 0;
Lev Walkin006de1c2004-08-20 13:37:45 +00002973 } else {
2974 _ASN_ERRLOG(app_errlog, app_key,
Lev Walkin16835b62004-08-22 13:47:59 +00002975 "%s: constraint failed (%s:%d)",
2976 td->name, __FILE__, __LINE__);
Lev Walkin006de1c2004-08-20 13:37:45 +00002977 return -1;
2978 }
2979}
2980
2981/*
2982 * This type is implemented using Utf8_1,
Lev Walkinc3808c12004-09-23 22:14:58 +00002983 * so here we adjust the DEF accordingly.
Lev Walkin006de1c2004-08-20 13:37:45 +00002984 */
2985static void
Lev Walkine0272aa2005-03-04 11:26:08 +00002986Utf8_2_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00002987 td->free_struct = asn_DEF_Utf8_1.free_struct;
2988 td->print_struct = asn_DEF_Utf8_1.print_struct;
2989 td->ber_decoder = asn_DEF_Utf8_1.ber_decoder;
2990 td->der_encoder = asn_DEF_Utf8_1.der_encoder;
2991 td->xer_decoder = asn_DEF_Utf8_1.xer_decoder;
2992 td->xer_encoder = asn_DEF_Utf8_1.xer_encoder;
2993 td->elements = asn_DEF_Utf8_1.elements;
2994 td->elements_count = asn_DEF_Utf8_1.elements_count;
2995 td->specifics = asn_DEF_Utf8_1.specifics;
Lev Walkin006de1c2004-08-20 13:37:45 +00002996}
2997
Lev Walkina9cc46e2004-09-22 16:06:28 +00002998void
Lev Walkindfae9752004-09-29 13:19:37 +00002999Utf8_2_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003000 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00003001 Utf8_2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003002 td->free_struct(td, struct_ptr, contents_only);
Lev Walkin006de1c2004-08-20 13:37:45 +00003003}
3004
3005int
Lev Walkindfae9752004-09-29 13:19:37 +00003006Utf8_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkin006de1c2004-08-20 13:37:45 +00003007 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00003008 Utf8_2_0_inherit_TYPE_descriptor(td);
Lev Walkin006de1c2004-08-20 13:37:45 +00003009 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3010}
3011
Lev Walkindc06f6b2004-10-20 15:50:55 +00003012asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00003013Utf8_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003014 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00003015 Utf8_2_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00003016 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003017}
3018
3019asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00003020Utf8_2_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003021 void *structure, int tag_mode, ber_tlv_tag_t tag,
3022 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00003023 Utf8_2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003024 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3025}
3026
Lev Walkin0ebe8b32004-10-23 13:26:56 +00003027asn_dec_rval_t
3028Utf8_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3029 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00003030 Utf8_2_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00003031 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3032}
3033
Lev Walkina9cc46e2004-09-22 16:06:28 +00003034asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00003035Utf8_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003036 int ilevel, enum xer_encoder_flags_e flags,
3037 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00003038 Utf8_2_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003039 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkin006de1c2004-08-20 13:37:45 +00003040}
3041
3042
3043/*** <<< STAT-DEFS [Utf8-2] >>> ***/
3044
Lev Walkine0272aa2005-03-04 11:26:08 +00003045static ber_tlv_tag_t asn_DEF_Utf8_2_0_tags[] = {
Lev Walkin906654e2004-09-10 15:49:15 +00003046 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
Lev Walkin006de1c2004-08-20 13:37:45 +00003047};
Lev Walkindfae9752004-09-29 13:19:37 +00003048asn_TYPE_descriptor_t asn_DEF_Utf8_2 = {
Lev Walkin006de1c2004-08-20 13:37:45 +00003049 "Utf8-2",
Lev Walkindc06f6b2004-10-20 15:50:55 +00003050 "Utf8-2",
Lev Walkina9cc46e2004-09-22 16:06:28 +00003051 Utf8_2_free,
3052 Utf8_2_print,
Lev Walkin006de1c2004-08-20 13:37:45 +00003053 Utf8_2_constraint,
3054 Utf8_2_decode_ber,
3055 Utf8_2_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00003056 Utf8_2_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003057 Utf8_2_encode_xer,
Lev Walkin006de1c2004-08-20 13:37:45 +00003058 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00003059 asn_DEF_Utf8_2_0_tags,
3060 sizeof(asn_DEF_Utf8_2_0_tags)
3061 /sizeof(asn_DEF_Utf8_2_0_tags[0]), /* 1 */
3062 asn_DEF_Utf8_2_0_tags, /* Same as above */
3063 sizeof(asn_DEF_Utf8_2_0_tags)
3064 /sizeof(asn_DEF_Utf8_2_0_tags[0]), /* 1 */
Lev Walkin006de1c2004-08-20 13:37:45 +00003065 0, 0, /* No members */
3066 0 /* No specifics */
3067};
3068
3069
3070/*** <<< INCLUDES [Utf8-1] >>> ***/
3071
3072#include <UTF8String.h>
3073
3074/*** <<< TYPE-DECLS [Utf8-1] >>> ***/
3075
Lev Walkin006de1c2004-08-20 13:37:45 +00003076typedef UTF8String_t Utf8_1_t;
3077
Lev Walkin006de1c2004-08-20 13:37:45 +00003078/*** <<< FUNC-DECLS [Utf8-1] >>> ***/
3079
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003080extern asn_TYPE_descriptor_t asn_DEF_Utf8_1;
3081asn_struct_free_f Utf8_1_free;
3082asn_struct_print_f Utf8_1_print;
3083asn_constr_check_f Utf8_1_constraint;
3084ber_type_decoder_f Utf8_1_decode_ber;
3085der_type_encoder_f Utf8_1_encode_der;
3086xer_type_decoder_f Utf8_1_decode_xer;
3087xer_type_encoder_f Utf8_1_encode_xer;
Lev Walkin006de1c2004-08-20 13:37:45 +00003088
3089/*** <<< CODE [Utf8-1] >>> ***/
3090
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003091int
3092Utf8_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
3093 asn_app_consume_bytes_f *app_errlog, void *app_key) {
3094 /* Replace with underlying type checker */
3095 td->check_constraints = asn_DEF_UTF8String.check_constraints;
3096 return td->check_constraints(td, sptr, app_errlog, app_key);
3097}
3098
3099/*
3100 * This type is implemented using UTF8String,
3101 * so here we adjust the DEF accordingly.
3102 */
3103static void
3104Utf8_1_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3105 td->free_struct = asn_DEF_UTF8String.free_struct;
3106 td->print_struct = asn_DEF_UTF8String.print_struct;
3107 td->ber_decoder = asn_DEF_UTF8String.ber_decoder;
3108 td->der_encoder = asn_DEF_UTF8String.der_encoder;
3109 td->xer_decoder = asn_DEF_UTF8String.xer_decoder;
3110 td->xer_encoder = asn_DEF_UTF8String.xer_encoder;
3111 td->elements = asn_DEF_UTF8String.elements;
3112 td->elements_count = asn_DEF_UTF8String.elements_count;
3113 td->specifics = asn_DEF_UTF8String.specifics;
3114}
3115
3116void
3117Utf8_1_free(asn_TYPE_descriptor_t *td,
3118 void *struct_ptr, int contents_only) {
3119 Utf8_1_0_inherit_TYPE_descriptor(td);
3120 td->free_struct(td, struct_ptr, contents_only);
3121}
3122
3123int
3124Utf8_1_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3125 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3126 Utf8_1_0_inherit_TYPE_descriptor(td);
3127 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3128}
3129
3130asn_dec_rval_t
3131Utf8_1_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3132 void **structure, void *bufptr, size_t size, int tag_mode) {
3133 Utf8_1_0_inherit_TYPE_descriptor(td);
3134 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3135}
3136
3137asn_enc_rval_t
3138Utf8_1_encode_der(asn_TYPE_descriptor_t *td,
3139 void *structure, int tag_mode, ber_tlv_tag_t tag,
3140 asn_app_consume_bytes_f *cb, void *app_key) {
3141 Utf8_1_0_inherit_TYPE_descriptor(td);
3142 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3143}
3144
3145asn_dec_rval_t
3146Utf8_1_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3147 void **structure, const char *opt_mname, void *bufptr, size_t size) {
3148 Utf8_1_0_inherit_TYPE_descriptor(td);
3149 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3150}
3151
3152asn_enc_rval_t
3153Utf8_1_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3154 int ilevel, enum xer_encoder_flags_e flags,
3155 asn_app_consume_bytes_f *cb, void *app_key) {
3156 Utf8_1_0_inherit_TYPE_descriptor(td);
3157 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3158}
3159
3160
3161/*** <<< STAT-DEFS [Utf8-1] >>> ***/
3162
3163static ber_tlv_tag_t asn_DEF_Utf8_1_0_tags[] = {
3164 (ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
3165};
3166asn_TYPE_descriptor_t asn_DEF_Utf8_1 = {
3167 "Utf8-1",
3168 "Utf8-1",
3169 Utf8_1_free,
3170 Utf8_1_print,
3171 Utf8_1_constraint,
3172 Utf8_1_decode_ber,
3173 Utf8_1_encode_der,
3174 Utf8_1_decode_xer,
3175 Utf8_1_encode_xer,
3176 0, /* Use generic outmost tag fetcher */
3177 asn_DEF_Utf8_1_0_tags,
3178 sizeof(asn_DEF_Utf8_1_0_tags)
3179 /sizeof(asn_DEF_Utf8_1_0_tags[0]), /* 1 */
3180 asn_DEF_Utf8_1_0_tags, /* Same as above */
3181 sizeof(asn_DEF_Utf8_1_0_tags)
3182 /sizeof(asn_DEF_Utf8_1_0_tags[0]), /* 1 */
3183 0, 0, /* No members */
3184 0 /* No specifics */
3185};
Lev Walkin006de1c2004-08-20 13:37:45 +00003186
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003187
3188/*** <<< INCLUDES [VisibleIdentifier] >>> ***/
3189
3190#include <Identifier.h>
3191
3192/*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/
3193
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003194typedef Identifier_t VisibleIdentifier_t;
3195
3196/*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/
3197
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003198extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier;
3199asn_struct_free_f VisibleIdentifier_free;
3200asn_struct_print_f VisibleIdentifier_print;
3201asn_constr_check_f VisibleIdentifier_constraint;
3202ber_type_decoder_f VisibleIdentifier_decode_ber;
3203der_type_encoder_f VisibleIdentifier_encode_der;
3204xer_type_decoder_f VisibleIdentifier_decode_xer;
3205xer_type_encoder_f VisibleIdentifier_encode_xer;
3206
3207/*** <<< CTABLES [VisibleIdentifier] >>> ***/
3208
3209static int permitted_alphabet_table_0[256] = {
32100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
32110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
32120,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0, /* $ */
32131,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, /* 0123456789 */
32140,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ABCDEFGHIJKLMNO */
32151,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1, /* PQRSTUVWXYZ _ */
32160,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* abcdefghijklmno */
32171,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, /* pqrstuvwxyz */
3218};
3219
3220static int check_permitted_alphabet_0(const void *sptr) {
3221 int *table = permitted_alphabet_table_0;
3222 /* The underlying type is VisibleString */
3223 const VisibleString_t *st = (const VisibleString_t *)sptr;
3224 const uint8_t *ch = st->buf;
3225 const uint8_t *end = ch + st->size;
3226
3227 for(; ch < end; ch++) {
3228 uint8_t cv = *ch;
3229 if(!table[cv]) return -1;
3230 }
3231 return 0;
3232}
3233
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003234
Lev Walkin154aa182004-09-26 13:12:56 +00003235/*** <<< CODE [VisibleIdentifier] >>> ***/
3236
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003237int
3238VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
3239 asn_app_consume_bytes_f *app_errlog, void *app_key) {
3240 const Identifier_t *st = (const Identifier_t *)sptr;
3241 size_t size;
3242
3243 if(!sptr) {
3244 _ASN_ERRLOG(app_errlog, app_key,
3245 "%s: value not given (%s:%d)",
3246 td->name, __FILE__, __LINE__);
3247 return -1;
3248 }
3249
3250 size = st->size;
3251
3252 if((size >= 1 && size <= 32)
3253 && !check_permitted_alphabet_0(st)) {
3254 /* Constraint check succeeded */
3255 return 0;
3256 } else {
3257 _ASN_ERRLOG(app_errlog, app_key,
3258 "%s: constraint failed (%s:%d)",
3259 td->name, __FILE__, __LINE__);
3260 return -1;
3261 }
3262}
3263
3264/*
3265 * This type is implemented using Identifier,
3266 * so here we adjust the DEF accordingly.
3267 */
3268static void
3269VisibleIdentifier_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
3270 td->free_struct = asn_DEF_Identifier.free_struct;
3271 td->print_struct = asn_DEF_Identifier.print_struct;
3272 td->ber_decoder = asn_DEF_Identifier.ber_decoder;
3273 td->der_encoder = asn_DEF_Identifier.der_encoder;
3274 td->xer_decoder = asn_DEF_Identifier.xer_decoder;
3275 td->xer_encoder = asn_DEF_Identifier.xer_encoder;
3276 td->elements = asn_DEF_Identifier.elements;
3277 td->elements_count = asn_DEF_Identifier.elements_count;
3278 td->specifics = asn_DEF_Identifier.specifics;
3279}
3280
3281void
3282VisibleIdentifier_free(asn_TYPE_descriptor_t *td,
3283 void *struct_ptr, int contents_only) {
3284 VisibleIdentifier_0_inherit_TYPE_descriptor(td);
3285 td->free_struct(td, struct_ptr, contents_only);
3286}
3287
3288int
3289VisibleIdentifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
3290 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
3291 VisibleIdentifier_0_inherit_TYPE_descriptor(td);
3292 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3293}
3294
3295asn_dec_rval_t
3296VisibleIdentifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3297 void **structure, void *bufptr, size_t size, int tag_mode) {
3298 VisibleIdentifier_0_inherit_TYPE_descriptor(td);
3299 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
3300}
3301
3302asn_enc_rval_t
3303VisibleIdentifier_encode_der(asn_TYPE_descriptor_t *td,
3304 void *structure, int tag_mode, ber_tlv_tag_t tag,
3305 asn_app_consume_bytes_f *cb, void *app_key) {
3306 VisibleIdentifier_0_inherit_TYPE_descriptor(td);
3307 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3308}
3309
3310asn_dec_rval_t
3311VisibleIdentifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3312 void **structure, const char *opt_mname, void *bufptr, size_t size) {
3313 VisibleIdentifier_0_inherit_TYPE_descriptor(td);
3314 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3315}
3316
3317asn_enc_rval_t
3318VisibleIdentifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
3319 int ilevel, enum xer_encoder_flags_e flags,
3320 asn_app_consume_bytes_f *cb, void *app_key) {
3321 VisibleIdentifier_0_inherit_TYPE_descriptor(td);
3322 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
3323}
3324
3325
3326/*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/
3327
3328static ber_tlv_tag_t asn_DEF_VisibleIdentifier_0_tags[] = {
3329 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
3330};
3331asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = {
3332 "VisibleIdentifier",
3333 "VisibleIdentifier",
3334 VisibleIdentifier_free,
3335 VisibleIdentifier_print,
3336 VisibleIdentifier_constraint,
3337 VisibleIdentifier_decode_ber,
3338 VisibleIdentifier_encode_der,
3339 VisibleIdentifier_decode_xer,
3340 VisibleIdentifier_encode_xer,
3341 0, /* Use generic outmost tag fetcher */
3342 asn_DEF_VisibleIdentifier_0_tags,
3343 sizeof(asn_DEF_VisibleIdentifier_0_tags)
3344 /sizeof(asn_DEF_VisibleIdentifier_0_tags[0]), /* 1 */
3345 asn_DEF_VisibleIdentifier_0_tags, /* Same as above */
3346 sizeof(asn_DEF_VisibleIdentifier_0_tags)
3347 /sizeof(asn_DEF_VisibleIdentifier_0_tags[0]), /* 1 */
3348 0, 0, /* No members */
3349 0 /* No specifics */
3350};
Lev Walkin154aa182004-09-26 13:12:56 +00003351
3352
3353/*** <<< INCLUDES [Identifier] >>> ***/
3354
3355#include <VisibleString.h>
3356
3357/*** <<< TYPE-DECLS [Identifier] >>> ***/
3358
Lev Walkin154aa182004-09-26 13:12:56 +00003359typedef VisibleString_t Identifier_t;
3360
3361/*** <<< FUNC-DECLS [Identifier] >>> ***/
3362
Lev Walkindfae9752004-09-29 13:19:37 +00003363extern asn_TYPE_descriptor_t asn_DEF_Identifier;
Lev Walkin154aa182004-09-26 13:12:56 +00003364asn_struct_free_f Identifier_free;
3365asn_struct_print_f Identifier_print;
3366asn_constr_check_f Identifier_constraint;
3367ber_type_decoder_f Identifier_decode_ber;
3368der_type_encoder_f Identifier_encode_der;
Lev Walkin0ebe8b32004-10-23 13:26:56 +00003369xer_type_decoder_f Identifier_decode_xer;
Lev Walkin154aa182004-09-26 13:12:56 +00003370xer_type_encoder_f Identifier_encode_xer;
3371
3372/*** <<< CTABLES [Identifier] >>> ***/
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003373
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003374static int permitted_alphabet_table_0[256] = {
Lev Walkine4ca5ce2004-09-15 11:44:13 +000033750,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
33760,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* */
33770,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0, /* $ */
33781,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, /* 0123456789 */
33790,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ABCDEFGHIJKLMNO */
33801,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1, /* PQRSTUVWXYZ _ */
33810,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* abcdefghijklmno */
33821,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, /* pqrstuvwxyz */
3383};
3384
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003385static int check_permitted_alphabet_0(const void *sptr) {
3386 int *table = permitted_alphabet_table_0;
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003387 /* The underlying type is VisibleString */
Lev Walkin8a7af0e2005-02-15 03:40:07 +00003388 const VisibleString_t *st = (const VisibleString_t *)sptr;
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003389 const uint8_t *ch = st->buf;
3390 const uint8_t *end = ch + st->size;
3391
3392 for(; ch < end; ch++) {
3393 uint8_t cv = *ch;
3394 if(!table[cv]) return -1;
3395 }
3396 return 0;
3397}
3398
3399
Lev Walkin154aa182004-09-26 13:12:56 +00003400/*** <<< CODE [Identifier] >>> ***/
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003401
3402int
Lev Walkindfae9752004-09-29 13:19:37 +00003403Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003404 asn_app_consume_bytes_f *app_errlog, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +00003405 const VisibleString_t *st = (const VisibleString_t *)sptr;
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003406 size_t size;
3407
3408 if(!sptr) {
3409 _ASN_ERRLOG(app_errlog, app_key,
3410 "%s: value not given (%s:%d)",
3411 td->name, __FILE__, __LINE__);
3412 return -1;
3413 }
3414
3415 size = st->size;
3416
3417 if((size >= 1 && size <= 32)
Lev Walkincaf0d5a2005-03-04 23:48:19 +00003418 && !check_permitted_alphabet_0(st)) {
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003419 /* Constraint check succeeded */
3420 return 0;
3421 } else {
3422 _ASN_ERRLOG(app_errlog, app_key,
3423 "%s: constraint failed (%s:%d)",
3424 td->name, __FILE__, __LINE__);
3425 return -1;
3426 }
3427}
3428
3429/*
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003430 * This type is implemented using VisibleString,
Lev Walkinc3808c12004-09-23 22:14:58 +00003431 * so here we adjust the DEF accordingly.
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003432 */
3433static void
Lev Walkine0272aa2005-03-04 11:26:08 +00003434Identifier_0_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
Lev Walkindfae9752004-09-29 13:19:37 +00003435 td->free_struct = asn_DEF_VisibleString.free_struct;
3436 td->print_struct = asn_DEF_VisibleString.print_struct;
3437 td->ber_decoder = asn_DEF_VisibleString.ber_decoder;
3438 td->der_encoder = asn_DEF_VisibleString.der_encoder;
3439 td->xer_decoder = asn_DEF_VisibleString.xer_decoder;
3440 td->xer_encoder = asn_DEF_VisibleString.xer_encoder;
3441 td->elements = asn_DEF_VisibleString.elements;
3442 td->elements_count = asn_DEF_VisibleString.elements_count;
3443 td->specifics = asn_DEF_VisibleString.specifics;
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003444}
3445
Lev Walkina9cc46e2004-09-22 16:06:28 +00003446void
Lev Walkindfae9752004-09-29 13:19:37 +00003447Identifier_free(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003448 void *struct_ptr, int contents_only) {
Lev Walkine0272aa2005-03-04 11:26:08 +00003449 Identifier_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003450 td->free_struct(td, struct_ptr, contents_only);
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003451}
3452
3453int
Lev Walkindfae9752004-09-29 13:19:37 +00003454Identifier_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003455 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00003456 Identifier_0_inherit_TYPE_descriptor(td);
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003457 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
3458}
3459
Lev Walkindc06f6b2004-10-20 15:50:55 +00003460asn_dec_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00003461Identifier_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003462 void **structure, void *bufptr, size_t size, int tag_mode) {
Lev Walkine0272aa2005-03-04 11:26:08 +00003463 Identifier_0_inherit_TYPE_descriptor(td);
Lev Walkindfae9752004-09-29 13:19:37 +00003464 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003465}
3466
3467asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00003468Identifier_encode_der(asn_TYPE_descriptor_t *td,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003469 void *structure, int tag_mode, ber_tlv_tag_t tag,
3470 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00003471 Identifier_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003472 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
3473}
3474
Lev Walkin0ebe8b32004-10-23 13:26:56 +00003475asn_dec_rval_t
3476Identifier_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
3477 void **structure, const char *opt_mname, void *bufptr, size_t size) {
Lev Walkine0272aa2005-03-04 11:26:08 +00003478 Identifier_0_inherit_TYPE_descriptor(td);
Lev Walkin0ebe8b32004-10-23 13:26:56 +00003479 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
3480}
3481
Lev Walkina9cc46e2004-09-22 16:06:28 +00003482asn_enc_rval_t
Lev Walkindfae9752004-09-29 13:19:37 +00003483Identifier_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003484 int ilevel, enum xer_encoder_flags_e flags,
3485 asn_app_consume_bytes_f *cb, void *app_key) {
Lev Walkine0272aa2005-03-04 11:26:08 +00003486 Identifier_0_inherit_TYPE_descriptor(td);
Lev Walkina9cc46e2004-09-22 16:06:28 +00003487 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003488}
3489
3490
3491/*** <<< STAT-DEFS [Identifier] >>> ***/
3492
Lev Walkine0272aa2005-03-04 11:26:08 +00003493static ber_tlv_tag_t asn_DEF_Identifier_0_tags[] = {
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003494 (ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
3495};
Lev Walkindfae9752004-09-29 13:19:37 +00003496asn_TYPE_descriptor_t asn_DEF_Identifier = {
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003497 "Identifier",
Lev Walkindc06f6b2004-10-20 15:50:55 +00003498 "Identifier",
Lev Walkina9cc46e2004-09-22 16:06:28 +00003499 Identifier_free,
3500 Identifier_print,
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003501 Identifier_constraint,
3502 Identifier_decode_ber,
3503 Identifier_encode_der,
Lev Walkin0ebe8b32004-10-23 13:26:56 +00003504 Identifier_decode_xer,
Lev Walkina9cc46e2004-09-22 16:06:28 +00003505 Identifier_encode_xer,
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003506 0, /* Use generic outmost tag fetcher */
Lev Walkine0272aa2005-03-04 11:26:08 +00003507 asn_DEF_Identifier_0_tags,
3508 sizeof(asn_DEF_Identifier_0_tags)
3509 /sizeof(asn_DEF_Identifier_0_tags[0]), /* 1 */
3510 asn_DEF_Identifier_0_tags, /* Same as above */
3511 sizeof(asn_DEF_Identifier_0_tags)
3512 /sizeof(asn_DEF_Identifier_0_tags[0]), /* 1 */
Lev Walkine4ca5ce2004-09-15 11:44:13 +00003513 0, 0, /* No members */
3514 0 /* No specifics */
3515};
3516