Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [Int1] >>> ***/ |
| 3 | |
| 4 | #include <INTEGER.h> |
| 5 | |
| 6 | /*** <<< TYPE-DECLS [Int1] >>> ***/ |
| 7 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 8 | typedef INTEGER_t Int1_t; |
| 9 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 10 | /*** <<< FUNC-DECLS [Int1] >>> ***/ |
| 11 | |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 12 | extern asn_TYPE_descriptor_t asn_DEF_Int1; |
| 13 | asn_struct_free_f Int1_free; |
| 14 | asn_struct_print_f Int1_print; |
| 15 | asn_constr_check_f Int1_constraint; |
| 16 | ber_type_decoder_f Int1_decode_ber; |
| 17 | der_type_encoder_f Int1_encode_der; |
| 18 | xer_type_decoder_f Int1_decode_xer; |
| 19 | xer_type_encoder_f Int1_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 20 | |
| 21 | /*** <<< CODE [Int1] >>> ***/ |
| 22 | |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 23 | /* |
| 24 | * This type is implemented using INTEGER, |
| 25 | * so here we adjust the DEF accordingly. |
| 26 | */ |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 27 | |
| 28 | /*** <<< STAT-DEFS [Int1] >>> ***/ |
| 29 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 30 | static const ber_tlv_tag_t asn_DEF_Int1_tags_1[] = { |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 31 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 32 | }; |
| 33 | asn_TYPE_descriptor_t asn_DEF_Int1 = { |
| 34 | "Int1", |
| 35 | "Int1", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 36 | &asn_OP_INTEGER, |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 37 | INTEGER_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 38 | asn_DEF_Int1_tags_1, |
| 39 | sizeof(asn_DEF_Int1_tags_1) |
| 40 | /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */ |
| 41 | asn_DEF_Int1_tags_1, /* Same as above */ |
| 42 | sizeof(asn_DEF_Int1_tags_1) |
| 43 | /sizeof(asn_DEF_Int1_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 44 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 45 | 0, /* No PER visible constraints */ |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 46 | 0, 0, /* No members */ |
| 47 | 0 /* No specifics */ |
| 48 | }; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 49 | |
| 50 | |
| 51 | /*** <<< INCLUDES [Int2] >>> ***/ |
| 52 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 53 | #include "Int1.h" |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 54 | |
| 55 | /*** <<< TYPE-DECLS [Int2] >>> ***/ |
| 56 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 57 | typedef Int1_t Int2_t; |
| 58 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 59 | /*** <<< FUNC-DECLS [Int2] >>> ***/ |
| 60 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 61 | extern asn_TYPE_descriptor_t asn_DEF_Int2; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 62 | asn_struct_free_f Int2_free; |
| 63 | asn_struct_print_f Int2_print; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 64 | asn_constr_check_f Int2_constraint; |
| 65 | ber_type_decoder_f Int2_decode_ber; |
| 66 | der_type_encoder_f Int2_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 67 | xer_type_decoder_f Int2_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 68 | xer_type_encoder_f Int2_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 69 | |
| 70 | /*** <<< CODE [Int2] >>> ***/ |
| 71 | |
| 72 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 73 | Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 74 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 75 | const Int1_t *st = (const Int1_t *)sptr; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 76 | long value; |
| 77 | |
| 78 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 79 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 80 | "%s: value not given (%s:%d)", |
| 81 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 82 | return -1; |
| 83 | } |
| 84 | |
Lev Walkin | 4446743 | 2004-09-07 06:43:57 +0000 | [diff] [blame] | 85 | /* Check if the sign bit is present */ |
| 86 | value = st->buf ? ((st->buf[0] & 0x80) ? -1 : 1) : 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 87 | |
| 88 | if((value >= 0)) { |
| 89 | /* Constraint check succeeded */ |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 90 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 91 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 92 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 93 | "%s: constraint failed (%s:%d)", |
| 94 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 95 | return -1; |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | /* |
| 100 | * This type is implemented using Int1, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 101 | * so here we adjust the DEF accordingly. |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 102 | */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 103 | |
| 104 | /*** <<< STAT-DEFS [Int2] >>> ***/ |
| 105 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 106 | static const ber_tlv_tag_t asn_DEF_Int2_tags_1[] = { |
Lev Walkin | 906654e | 2004-09-10 15:49:15 +0000 | [diff] [blame] | 107 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 108 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 109 | asn_TYPE_descriptor_t asn_DEF_Int2 = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 110 | "Int2", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 111 | "Int2", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 112 | &asn_OP_INTEGER, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 113 | Int2_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 114 | asn_DEF_Int2_tags_1, |
| 115 | sizeof(asn_DEF_Int2_tags_1) |
| 116 | /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */ |
| 117 | asn_DEF_Int2_tags_1, /* Same as above */ |
| 118 | sizeof(asn_DEF_Int2_tags_1) |
| 119 | /sizeof(asn_DEF_Int2_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 120 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 121 | 0, /* No PER visible constraints */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 122 | 0, 0, /* No members */ |
| 123 | 0 /* No specifics */ |
| 124 | }; |
| 125 | |
| 126 | |
| 127 | /*** <<< INCLUDES [Int3] >>> ***/ |
| 128 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 129 | #include "Int2.h" |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 130 | |
| 131 | /*** <<< TYPE-DECLS [Int3] >>> ***/ |
| 132 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 133 | typedef Int2_t Int3_t; |
| 134 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 135 | /*** <<< FUNC-DECLS [Int3] >>> ***/ |
| 136 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 137 | extern asn_TYPE_descriptor_t asn_DEF_Int3; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 138 | asn_struct_free_f Int3_free; |
| 139 | asn_struct_print_f Int3_print; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 140 | asn_constr_check_f Int3_constraint; |
| 141 | ber_type_decoder_f Int3_decode_ber; |
| 142 | der_type_encoder_f Int3_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 143 | xer_type_decoder_f Int3_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 144 | xer_type_encoder_f Int3_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 145 | |
| 146 | /*** <<< CODE [Int3] >>> ***/ |
| 147 | |
| 148 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 149 | Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 150 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 151 | const Int2_t *st = (const Int2_t *)sptr; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 152 | long value; |
| 153 | |
| 154 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 155 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 156 | "%s: value not given (%s:%d)", |
| 157 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 158 | return -1; |
| 159 | } |
| 160 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 161 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 162 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 163 | "%s: value too large (%s:%d)", |
| 164 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 165 | return -1; |
| 166 | } |
| 167 | |
| 168 | if((value >= 0 && value <= 10)) { |
| 169 | /* Constraint check succeeded */ |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 170 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 171 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 172 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 173 | "%s: constraint failed (%s:%d)", |
| 174 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 175 | return -1; |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | /* |
| 180 | * This type is implemented using Int2, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 181 | * so here we adjust the DEF accordingly. |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 182 | */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 183 | |
| 184 | /*** <<< STAT-DEFS [Int3] >>> ***/ |
| 185 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 186 | static const ber_tlv_tag_t asn_DEF_Int3_tags_1[] = { |
Lev Walkin | 906654e | 2004-09-10 15:49:15 +0000 | [diff] [blame] | 187 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 188 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 189 | asn_TYPE_descriptor_t asn_DEF_Int3 = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 190 | "Int3", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 191 | "Int3", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 192 | &asn_OP_INTEGER, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 193 | Int3_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 194 | asn_DEF_Int3_tags_1, |
| 195 | sizeof(asn_DEF_Int3_tags_1) |
| 196 | /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */ |
| 197 | asn_DEF_Int3_tags_1, /* Same as above */ |
| 198 | sizeof(asn_DEF_Int3_tags_1) |
| 199 | /sizeof(asn_DEF_Int3_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 200 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 201 | 0, /* No PER visible constraints */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 202 | 0, 0, /* No members */ |
| 203 | 0 /* No specifics */ |
| 204 | }; |
| 205 | |
| 206 | |
| 207 | /*** <<< INCLUDES [Int4] >>> ***/ |
| 208 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 209 | #include "Int3.h" |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 210 | |
| 211 | /*** <<< TYPE-DECLS [Int4] >>> ***/ |
| 212 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 213 | typedef Int3_t Int4_t; |
| 214 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 215 | /*** <<< FUNC-DECLS [Int4] >>> ***/ |
| 216 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 217 | extern asn_TYPE_descriptor_t asn_DEF_Int4; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 218 | asn_struct_free_f Int4_free; |
| 219 | asn_struct_print_f Int4_print; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 220 | asn_constr_check_f Int4_constraint; |
| 221 | ber_type_decoder_f Int4_decode_ber; |
| 222 | der_type_encoder_f Int4_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 223 | xer_type_decoder_f Int4_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 224 | xer_type_encoder_f Int4_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 225 | |
| 226 | /*** <<< CODE [Int4] >>> ***/ |
| 227 | |
| 228 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 229 | Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 230 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 231 | const Int3_t *st = (const Int3_t *)sptr; |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 232 | long value; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 233 | |
| 234 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 235 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 236 | "%s: value not given (%s:%d)", |
| 237 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 238 | return -1; |
| 239 | } |
| 240 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 241 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 242 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 243 | "%s: value too large (%s:%d)", |
| 244 | td->name, __FILE__, __LINE__); |
| 245 | return -1; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 246 | } |
| 247 | |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 248 | if((value >= 1 && value <= 10)) { |
| 249 | /* Constraint check succeeded */ |
| 250 | return 0; |
| 251 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 252 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 253 | "%s: constraint failed (%s:%d)", |
| 254 | td->name, __FILE__, __LINE__); |
| 255 | return -1; |
| 256 | } |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 257 | } |
| 258 | |
| 259 | /* |
| 260 | * This type is implemented using Int3, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 261 | * so here we adjust the DEF accordingly. |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 262 | */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 263 | |
| 264 | /*** <<< STAT-DEFS [Int4] >>> ***/ |
| 265 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 266 | static const ber_tlv_tag_t asn_DEF_Int4_tags_1[] = { |
Lev Walkin | 906654e | 2004-09-10 15:49:15 +0000 | [diff] [blame] | 267 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 268 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 269 | asn_TYPE_descriptor_t asn_DEF_Int4 = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 270 | "Int4", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 271 | "Int4", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 272 | &asn_OP_INTEGER, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 273 | Int4_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 274 | asn_DEF_Int4_tags_1, |
| 275 | sizeof(asn_DEF_Int4_tags_1) |
| 276 | /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */ |
| 277 | asn_DEF_Int4_tags_1, /* Same as above */ |
| 278 | sizeof(asn_DEF_Int4_tags_1) |
| 279 | /sizeof(asn_DEF_Int4_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 280 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 281 | 0, /* No PER visible constraints */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 282 | 0, 0, /* No members */ |
| 283 | 0 /* No specifics */ |
| 284 | }; |
| 285 | |
| 286 | |
| 287 | /*** <<< INCLUDES [Int5] >>> ***/ |
| 288 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 289 | #include "Int4.h" |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 290 | |
| 291 | /*** <<< TYPE-DECLS [Int5] >>> ***/ |
| 292 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 293 | typedef Int4_t Int5_t; |
| 294 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 295 | /*** <<< FUNC-DECLS [Int5] >>> ***/ |
| 296 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 297 | extern asn_TYPE_descriptor_t asn_DEF_Int5; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 298 | asn_struct_free_f Int5_free; |
| 299 | asn_struct_print_f Int5_print; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 300 | asn_constr_check_f Int5_constraint; |
| 301 | ber_type_decoder_f Int5_decode_ber; |
| 302 | der_type_encoder_f Int5_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 303 | xer_type_decoder_f Int5_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 304 | xer_type_encoder_f Int5_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 305 | |
| 306 | /*** <<< CODE [Int5] >>> ***/ |
| 307 | |
| 308 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 309 | Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 310 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 311 | const Int4_t *st = (const Int4_t *)sptr; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 312 | long value; |
| 313 | |
| 314 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 315 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 316 | "%s: value not given (%s:%d)", |
| 317 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 318 | return -1; |
| 319 | } |
| 320 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 321 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 322 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 323 | "%s: value too large (%s:%d)", |
| 324 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 325 | return -1; |
| 326 | } |
| 327 | |
| 328 | if((value == 5)) { |
| 329 | /* Constraint check succeeded */ |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 330 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 331 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 332 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 333 | "%s: constraint failed (%s:%d)", |
| 334 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 335 | return -1; |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | /* |
| 340 | * This type is implemented using Int4, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 341 | * so here we adjust the DEF accordingly. |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 342 | */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 343 | |
| 344 | /*** <<< STAT-DEFS [Int5] >>> ***/ |
| 345 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 346 | static const ber_tlv_tag_t asn_DEF_Int5_tags_1[] = { |
Lev Walkin | 906654e | 2004-09-10 15:49:15 +0000 | [diff] [blame] | 347 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 348 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 349 | asn_TYPE_descriptor_t asn_DEF_Int5 = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 350 | "Int5", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 351 | "Int5", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 352 | &asn_OP_INTEGER, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 353 | Int5_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 354 | asn_DEF_Int5_tags_1, |
| 355 | sizeof(asn_DEF_Int5_tags_1) |
| 356 | /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */ |
| 357 | asn_DEF_Int5_tags_1, /* Same as above */ |
| 358 | sizeof(asn_DEF_Int5_tags_1) |
| 359 | /sizeof(asn_DEF_Int5_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 360 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 361 | 0, /* No PER visible constraints */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 362 | 0, 0, /* No members */ |
| 363 | 0 /* No specifics */ |
| 364 | }; |
| 365 | |
| 366 | |
| 367 | /*** <<< INCLUDES [ExtensibleExtensions] >>> ***/ |
| 368 | |
| 369 | #include <INTEGER.h> |
| 370 | |
| 371 | /*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/ |
| 372 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 373 | typedef INTEGER_t ExtensibleExtensions_t; |
| 374 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 375 | /*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/ |
| 376 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 377 | extern asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 378 | asn_struct_free_f ExtensibleExtensions_free; |
| 379 | asn_struct_print_f ExtensibleExtensions_print; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 380 | asn_constr_check_f ExtensibleExtensions_constraint; |
| 381 | ber_type_decoder_f ExtensibleExtensions_decode_ber; |
| 382 | der_type_encoder_f ExtensibleExtensions_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 383 | xer_type_decoder_f ExtensibleExtensions_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 384 | xer_type_encoder_f ExtensibleExtensions_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 385 | |
| 386 | /*** <<< CODE [ExtensibleExtensions] >>> ***/ |
| 387 | |
| 388 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 389 | ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 390 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 391 | const INTEGER_t *st = (const INTEGER_t *)sptr; |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 392 | long value; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 393 | |
| 394 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 395 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 396 | "%s: value not given (%s:%d)", |
| 397 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 398 | return -1; |
| 399 | } |
| 400 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 401 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 402 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 403 | "%s: value too large (%s:%d)", |
| 404 | td->name, __FILE__, __LINE__); |
| 405 | return -1; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 406 | } |
| 407 | |
Lev Walkin | 0c68645 | 2017-09-07 22:59:36 -0700 | [diff] [blame] | 408 | if((value >= 1 && value <= 255)) { |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 409 | /* Constraint check succeeded */ |
| 410 | return 0; |
| 411 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 412 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 413 | "%s: constraint failed (%s:%d)", |
| 414 | td->name, __FILE__, __LINE__); |
| 415 | return -1; |
| 416 | } |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 417 | } |
| 418 | |
| 419 | /* |
| 420 | * This type is implemented using INTEGER, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 421 | * so here we adjust the DEF accordingly. |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 422 | */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 423 | |
| 424 | /*** <<< STAT-DEFS [ExtensibleExtensions] >>> ***/ |
| 425 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 426 | static const ber_tlv_tag_t asn_DEF_ExtensibleExtensions_tags_1[] = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 427 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 428 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 429 | asn_TYPE_descriptor_t asn_DEF_ExtensibleExtensions = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 430 | "ExtensibleExtensions", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 431 | "ExtensibleExtensions", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 432 | &asn_OP_INTEGER, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 433 | ExtensibleExtensions_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 434 | asn_DEF_ExtensibleExtensions_tags_1, |
| 435 | sizeof(asn_DEF_ExtensibleExtensions_tags_1) |
| 436 | /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */ |
| 437 | asn_DEF_ExtensibleExtensions_tags_1, /* Same as above */ |
| 438 | sizeof(asn_DEF_ExtensibleExtensions_tags_1) |
| 439 | /sizeof(asn_DEF_ExtensibleExtensions_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 440 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 441 | 0, /* No PER visible constraints */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 442 | 0, 0, /* No members */ |
| 443 | 0 /* No specifics */ |
| 444 | }; |
| 445 | |
| 446 | |
| 447 | /*** <<< INCLUDES [Str1] >>> ***/ |
| 448 | |
| 449 | #include <IA5String.h> |
| 450 | |
| 451 | /*** <<< TYPE-DECLS [Str1] >>> ***/ |
| 452 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 453 | typedef IA5String_t Str1_t; |
| 454 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 455 | /*** <<< FUNC-DECLS [Str1] >>> ***/ |
| 456 | |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 457 | extern asn_TYPE_descriptor_t asn_DEF_Str1; |
| 458 | asn_struct_free_f Str1_free; |
| 459 | asn_struct_print_f Str1_print; |
| 460 | asn_constr_check_f Str1_constraint; |
| 461 | ber_type_decoder_f Str1_decode_ber; |
| 462 | der_type_encoder_f Str1_encode_der; |
| 463 | xer_type_decoder_f Str1_decode_xer; |
| 464 | xer_type_encoder_f Str1_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 465 | |
| 466 | /*** <<< CODE [Str1] >>> ***/ |
| 467 | |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 468 | /* |
| 469 | * This type is implemented using IA5String, |
| 470 | * so here we adjust the DEF accordingly. |
| 471 | */ |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 472 | |
| 473 | /*** <<< STAT-DEFS [Str1] >>> ***/ |
| 474 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 475 | static const ber_tlv_tag_t asn_DEF_Str1_tags_1[] = { |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 476 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
| 477 | }; |
| 478 | asn_TYPE_descriptor_t asn_DEF_Str1 = { |
| 479 | "Str1", |
| 480 | "Str1", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 481 | &asn_OP_IA5String, |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 482 | IA5String_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 483 | asn_DEF_Str1_tags_1, |
| 484 | sizeof(asn_DEF_Str1_tags_1) |
| 485 | /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */ |
| 486 | asn_DEF_Str1_tags_1, /* Same as above */ |
| 487 | sizeof(asn_DEF_Str1_tags_1) |
| 488 | /sizeof(asn_DEF_Str1_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 489 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 490 | 0, /* No PER visible constraints */ |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 491 | 0, 0, /* No members */ |
| 492 | 0 /* No specifics */ |
| 493 | }; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 494 | |
| 495 | |
| 496 | /*** <<< INCLUDES [Str2] >>> ***/ |
| 497 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 498 | #include "Str1.h" |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 499 | |
| 500 | /*** <<< TYPE-DECLS [Str2] >>> ***/ |
| 501 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 502 | typedef Str1_t Str2_t; |
| 503 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 504 | /*** <<< FUNC-DECLS [Str2] >>> ***/ |
| 505 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 506 | extern asn_TYPE_descriptor_t asn_DEF_Str2; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 507 | asn_struct_free_f Str2_free; |
| 508 | asn_struct_print_f Str2_print; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 509 | asn_constr_check_f Str2_constraint; |
| 510 | ber_type_decoder_f Str2_decode_ber; |
| 511 | der_type_encoder_f Str2_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 512 | xer_type_decoder_f Str2_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 513 | xer_type_encoder_f Str2_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 514 | |
| 515 | /*** <<< CTABLES [Str2] >>> ***/ |
| 516 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 517 | static int check_permitted_alphabet_1(const void *sptr) { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 518 | /* The underlying type is IA5String */ |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 519 | const IA5String_t *st = (const IA5String_t *)sptr; |
Lev Walkin | 634a3b8 | 2004-08-22 03:30:05 +0000 | [diff] [blame] | 520 | const uint8_t *ch = st->buf; |
| 521 | const uint8_t *end = ch + st->size; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 522 | |
| 523 | for(; ch < end; ch++) { |
| 524 | uint8_t cv = *ch; |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 525 | if(!(cv <= 127)) return -1; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 526 | } |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 527 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 528 | } |
| 529 | |
| 530 | |
| 531 | /*** <<< CODE [Str2] >>> ***/ |
| 532 | |
| 533 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 534 | Str2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 535 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 536 | const Str1_t *st = (const Str1_t *)sptr; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 537 | size_t size; |
| 538 | |
| 539 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 540 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 541 | "%s: value not given (%s:%d)", |
| 542 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 543 | return -1; |
| 544 | } |
| 545 | |
| 546 | size = st->size; |
| 547 | |
| 548 | if(((size <= 20) || (size >= 25 && size <= 30)) |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 549 | && !check_permitted_alphabet_1(st)) { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 550 | /* Constraint check succeeded */ |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 551 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 552 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 553 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 554 | "%s: constraint failed (%s:%d)", |
| 555 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 556 | return -1; |
| 557 | } |
| 558 | } |
| 559 | |
| 560 | /* |
| 561 | * This type is implemented using Str1, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 562 | * so here we adjust the DEF accordingly. |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 563 | */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 564 | |
| 565 | /*** <<< STAT-DEFS [Str2] >>> ***/ |
| 566 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 567 | static const ber_tlv_tag_t asn_DEF_Str2_tags_1[] = { |
Lev Walkin | 906654e | 2004-09-10 15:49:15 +0000 | [diff] [blame] | 568 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 569 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 570 | asn_TYPE_descriptor_t asn_DEF_Str2 = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 571 | "Str2", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 572 | "Str2", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 573 | &asn_OP_IA5String, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 574 | Str2_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 575 | asn_DEF_Str2_tags_1, |
| 576 | sizeof(asn_DEF_Str2_tags_1) |
| 577 | /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */ |
| 578 | asn_DEF_Str2_tags_1, /* Same as above */ |
| 579 | sizeof(asn_DEF_Str2_tags_1) |
| 580 | /sizeof(asn_DEF_Str2_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 581 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 582 | 0, /* No PER visible constraints */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 583 | 0, 0, /* No members */ |
| 584 | 0 /* No specifics */ |
| 585 | }; |
| 586 | |
| 587 | |
| 588 | /*** <<< INCLUDES [Str3] >>> ***/ |
| 589 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 590 | #include "Str2.h" |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 591 | |
| 592 | /*** <<< TYPE-DECLS [Str3] >>> ***/ |
| 593 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 594 | typedef Str2_t Str3_t; |
| 595 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 596 | /*** <<< FUNC-DECLS [Str3] >>> ***/ |
| 597 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 598 | extern asn_TYPE_descriptor_t asn_DEF_Str3; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 599 | asn_struct_free_f Str3_free; |
| 600 | asn_struct_print_f Str3_print; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 601 | asn_constr_check_f Str3_constraint; |
| 602 | ber_type_decoder_f Str3_decode_ber; |
| 603 | der_type_encoder_f Str3_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 604 | xer_type_decoder_f Str3_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 605 | xer_type_encoder_f Str3_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 606 | |
| 607 | /*** <<< CTABLES [Str3] >>> ***/ |
| 608 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 609 | static const int permitted_alphabet_table_1[256] = { |
Lev Walkin | 5b62ca8 | 2006-09-21 01:52:07 +0000 | [diff] [blame] | 610 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 611 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 612 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 613 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 614 | 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ABC */ |
| 615 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 616 | 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* def */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 617 | }; |
| 618 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 619 | static int check_permitted_alphabet_1(const void *sptr) { |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 620 | const int *table = permitted_alphabet_table_1; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 621 | /* The underlying type is IA5String */ |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 622 | const IA5String_t *st = (const IA5String_t *)sptr; |
Lev Walkin | 634a3b8 | 2004-08-22 03:30:05 +0000 | [diff] [blame] | 623 | const uint8_t *ch = st->buf; |
| 624 | const uint8_t *end = ch + st->size; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 625 | |
| 626 | for(; ch < end; ch++) { |
| 627 | uint8_t cv = *ch; |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 628 | if(!table[cv]) return -1; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 629 | } |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 630 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 631 | } |
| 632 | |
| 633 | |
| 634 | /*** <<< CODE [Str3] >>> ***/ |
| 635 | |
| 636 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 637 | Str3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 638 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 639 | const Str2_t *st = (const Str2_t *)sptr; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 640 | size_t size; |
| 641 | |
| 642 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 643 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 644 | "%s: value not given (%s:%d)", |
| 645 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 646 | return -1; |
| 647 | } |
| 648 | |
| 649 | size = st->size; |
| 650 | |
| 651 | if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27)) |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 652 | && !check_permitted_alphabet_1(st)) { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 653 | /* Constraint check succeeded */ |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 654 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 655 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 656 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 657 | "%s: constraint failed (%s:%d)", |
| 658 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 659 | return -1; |
| 660 | } |
| 661 | } |
| 662 | |
| 663 | /* |
| 664 | * This type is implemented using Str2, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 665 | * so here we adjust the DEF accordingly. |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 666 | */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 667 | |
| 668 | /*** <<< STAT-DEFS [Str3] >>> ***/ |
| 669 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 670 | static const ber_tlv_tag_t asn_DEF_Str3_tags_1[] = { |
Lev Walkin | 906654e | 2004-09-10 15:49:15 +0000 | [diff] [blame] | 671 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 672 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 673 | asn_TYPE_descriptor_t asn_DEF_Str3 = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 674 | "Str3", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 675 | "Str3", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 676 | &asn_OP_IA5String, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 677 | Str3_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 678 | asn_DEF_Str3_tags_1, |
| 679 | sizeof(asn_DEF_Str3_tags_1) |
| 680 | /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */ |
| 681 | asn_DEF_Str3_tags_1, /* Same as above */ |
| 682 | sizeof(asn_DEF_Str3_tags_1) |
| 683 | /sizeof(asn_DEF_Str3_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 684 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 685 | 0, /* No PER visible constraints */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 686 | 0, 0, /* No members */ |
| 687 | 0 /* No specifics */ |
| 688 | }; |
| 689 | |
| 690 | |
Lev Walkin | 8a99bf7 | 2004-09-10 06:07:39 +0000 | [diff] [blame] | 691 | /*** <<< INCLUDES [Str4] >>> ***/ |
| 692 | |
| 693 | #include <IA5String.h> |
| 694 | |
| 695 | /*** <<< TYPE-DECLS [Str4] >>> ***/ |
| 696 | |
Lev Walkin | 8a99bf7 | 2004-09-10 06:07:39 +0000 | [diff] [blame] | 697 | typedef IA5String_t Str4_t; |
| 698 | |
| 699 | /*** <<< FUNC-DECLS [Str4] >>> ***/ |
| 700 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 701 | extern asn_TYPE_descriptor_t asn_DEF_Str4; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 702 | asn_struct_free_f Str4_free; |
| 703 | asn_struct_print_f Str4_print; |
Lev Walkin | 8a99bf7 | 2004-09-10 06:07:39 +0000 | [diff] [blame] | 704 | asn_constr_check_f Str4_constraint; |
| 705 | ber_type_decoder_f Str4_decode_ber; |
| 706 | der_type_encoder_f Str4_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 707 | xer_type_decoder_f Str4_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 708 | xer_type_encoder_f Str4_encode_xer; |
Lev Walkin | 8a99bf7 | 2004-09-10 06:07:39 +0000 | [diff] [blame] | 709 | |
| 710 | /*** <<< CTABLES [Str4] >>> ***/ |
| 711 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 712 | static int check_permitted_alphabet_1(const void *sptr) { |
Lev Walkin | 8a99bf7 | 2004-09-10 06:07:39 +0000 | [diff] [blame] | 713 | /* The underlying type is IA5String */ |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 714 | const IA5String_t *st = (const IA5String_t *)sptr; |
Lev Walkin | 8a99bf7 | 2004-09-10 06:07:39 +0000 | [diff] [blame] | 715 | const uint8_t *ch = st->buf; |
| 716 | const uint8_t *end = ch + st->size; |
| 717 | |
| 718 | for(; ch < end; ch++) { |
| 719 | uint8_t cv = *ch; |
| 720 | if(!(cv <= 127)) return -1; |
| 721 | } |
| 722 | return 0; |
| 723 | } |
| 724 | |
| 725 | |
| 726 | /*** <<< CODE [Str4] >>> ***/ |
| 727 | |
| 728 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 729 | Str4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 730 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 731 | const IA5String_t *st = (const IA5String_t *)sptr; |
Lev Walkin | 8a99bf7 | 2004-09-10 06:07:39 +0000 | [diff] [blame] | 732 | |
| 733 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 734 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 8a99bf7 | 2004-09-10 06:07:39 +0000 | [diff] [blame] | 735 | "%s: value not given (%s:%d)", |
| 736 | td->name, __FILE__, __LINE__); |
| 737 | return -1; |
| 738 | } |
| 739 | |
| 740 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 741 | if(!check_permitted_alphabet_1(st)) { |
Lev Walkin | 8a99bf7 | 2004-09-10 06:07:39 +0000 | [diff] [blame] | 742 | /* Constraint check succeeded */ |
| 743 | return 0; |
| 744 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 745 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 8a99bf7 | 2004-09-10 06:07:39 +0000 | [diff] [blame] | 746 | "%s: constraint failed (%s:%d)", |
| 747 | td->name, __FILE__, __LINE__); |
| 748 | return -1; |
| 749 | } |
| 750 | } |
| 751 | |
| 752 | /* |
| 753 | * This type is implemented using IA5String, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 754 | * so here we adjust the DEF accordingly. |
Lev Walkin | 8a99bf7 | 2004-09-10 06:07:39 +0000 | [diff] [blame] | 755 | */ |
Lev Walkin | 8a99bf7 | 2004-09-10 06:07:39 +0000 | [diff] [blame] | 756 | |
| 757 | /*** <<< STAT-DEFS [Str4] >>> ***/ |
| 758 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 759 | static const ber_tlv_tag_t asn_DEF_Str4_tags_1[] = { |
Lev Walkin | 8a99bf7 | 2004-09-10 06:07:39 +0000 | [diff] [blame] | 760 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
| 761 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 762 | asn_TYPE_descriptor_t asn_DEF_Str4 = { |
Lev Walkin | 8a99bf7 | 2004-09-10 06:07:39 +0000 | [diff] [blame] | 763 | "Str4", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 764 | "Str4", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 765 | &asn_OP_IA5String, |
Lev Walkin | 8a99bf7 | 2004-09-10 06:07:39 +0000 | [diff] [blame] | 766 | Str4_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 767 | asn_DEF_Str4_tags_1, |
| 768 | sizeof(asn_DEF_Str4_tags_1) |
| 769 | /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */ |
| 770 | asn_DEF_Str4_tags_1, /* Same as above */ |
| 771 | sizeof(asn_DEF_Str4_tags_1) |
| 772 | /sizeof(asn_DEF_Str4_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 773 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 774 | 0, /* No PER visible constraints */ |
Lev Walkin | 8a99bf7 | 2004-09-10 06:07:39 +0000 | [diff] [blame] | 775 | 0, 0, /* No members */ |
| 776 | 0 /* No specifics */ |
| 777 | }; |
| 778 | |
| 779 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 780 | /*** <<< INCLUDES [PER-Visible] >>> ***/ |
| 781 | |
| 782 | #include <IA5String.h> |
| 783 | |
| 784 | /*** <<< TYPE-DECLS [PER-Visible] >>> ***/ |
| 785 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 786 | typedef IA5String_t PER_Visible_t; |
| 787 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 788 | /*** <<< FUNC-DECLS [PER-Visible] >>> ***/ |
| 789 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 790 | extern asn_TYPE_descriptor_t asn_DEF_PER_Visible; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 791 | asn_struct_free_f PER_Visible_free; |
| 792 | asn_struct_print_f PER_Visible_print; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 793 | asn_constr_check_f PER_Visible_constraint; |
| 794 | ber_type_decoder_f PER_Visible_decode_ber; |
| 795 | der_type_encoder_f PER_Visible_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 796 | xer_type_decoder_f PER_Visible_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 797 | xer_type_encoder_f PER_Visible_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 798 | |
| 799 | /*** <<< CTABLES [PER-Visible] >>> ***/ |
| 800 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 801 | static int check_permitted_alphabet_1(const void *sptr) { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 802 | /* The underlying type is IA5String */ |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 803 | const IA5String_t *st = (const IA5String_t *)sptr; |
Lev Walkin | 634a3b8 | 2004-08-22 03:30:05 +0000 | [diff] [blame] | 804 | const uint8_t *ch = st->buf; |
| 805 | const uint8_t *end = ch + st->size; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 806 | |
| 807 | for(; ch < end; ch++) { |
| 808 | uint8_t cv = *ch; |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 809 | if(!(cv >= 65 && cv <= 70)) return -1; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 810 | } |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 811 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 812 | } |
| 813 | |
| 814 | |
| 815 | /*** <<< CODE [PER-Visible] >>> ***/ |
| 816 | |
| 817 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 818 | PER_Visible_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 819 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 820 | const IA5String_t *st = (const IA5String_t *)sptr; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 821 | |
| 822 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 823 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 824 | "%s: value not given (%s:%d)", |
| 825 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 826 | return -1; |
| 827 | } |
| 828 | |
| 829 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 830 | if(!check_permitted_alphabet_1(st)) { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 831 | /* Constraint check succeeded */ |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 832 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 833 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 834 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 835 | "%s: constraint failed (%s:%d)", |
| 836 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 837 | return -1; |
| 838 | } |
| 839 | } |
| 840 | |
| 841 | /* |
| 842 | * This type is implemented using IA5String, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 843 | * so here we adjust the DEF accordingly. |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 844 | */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 845 | |
| 846 | /*** <<< STAT-DEFS [PER-Visible] >>> ***/ |
| 847 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 848 | static const ber_tlv_tag_t asn_DEF_PER_Visible_tags_1[] = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 849 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
| 850 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 851 | asn_TYPE_descriptor_t asn_DEF_PER_Visible = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 852 | "PER-Visible", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 853 | "PER-Visible", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 854 | &asn_OP_IA5String, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 855 | PER_Visible_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 856 | asn_DEF_PER_Visible_tags_1, |
| 857 | sizeof(asn_DEF_PER_Visible_tags_1) |
| 858 | /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */ |
| 859 | asn_DEF_PER_Visible_tags_1, /* Same as above */ |
| 860 | sizeof(asn_DEF_PER_Visible_tags_1) |
| 861 | /sizeof(asn_DEF_PER_Visible_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 862 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 863 | 0, /* No PER visible constraints */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 864 | 0, 0, /* No members */ |
| 865 | 0 /* No specifics */ |
| 866 | }; |
| 867 | |
| 868 | |
| 869 | /*** <<< INCLUDES [PER-Visible-2] >>> ***/ |
| 870 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 871 | #include "PER-Visible.h" |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 872 | |
| 873 | /*** <<< TYPE-DECLS [PER-Visible-2] >>> ***/ |
| 874 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 875 | typedef PER_Visible_t PER_Visible_2_t; |
| 876 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 877 | /*** <<< FUNC-DECLS [PER-Visible-2] >>> ***/ |
| 878 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 879 | extern asn_TYPE_descriptor_t asn_DEF_PER_Visible_2; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 880 | asn_struct_free_f PER_Visible_2_free; |
| 881 | asn_struct_print_f PER_Visible_2_print; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 882 | asn_constr_check_f PER_Visible_2_constraint; |
| 883 | ber_type_decoder_f PER_Visible_2_decode_ber; |
| 884 | der_type_encoder_f PER_Visible_2_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 885 | xer_type_decoder_f PER_Visible_2_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 886 | xer_type_encoder_f PER_Visible_2_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 887 | |
| 888 | /*** <<< CTABLES [PER-Visible-2] >>> ***/ |
| 889 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 890 | static int check_permitted_alphabet_1(const void *sptr) { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 891 | /* The underlying type is IA5String */ |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 892 | const IA5String_t *st = (const IA5String_t *)sptr; |
Lev Walkin | 634a3b8 | 2004-08-22 03:30:05 +0000 | [diff] [blame] | 893 | const uint8_t *ch = st->buf; |
| 894 | const uint8_t *end = ch + st->size; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 895 | |
| 896 | for(; ch < end; ch++) { |
| 897 | uint8_t cv = *ch; |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 898 | if(!(cv >= 69 && cv <= 70)) return -1; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 899 | } |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 900 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 901 | } |
| 902 | |
| 903 | |
| 904 | /*** <<< CODE [PER-Visible-2] >>> ***/ |
| 905 | |
| 906 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 907 | PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 908 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 909 | const PER_Visible_t *st = (const PER_Visible_t *)sptr; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 910 | |
| 911 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 912 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 913 | "%s: value not given (%s:%d)", |
| 914 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 915 | return -1; |
| 916 | } |
| 917 | |
| 918 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 919 | if(!check_permitted_alphabet_1(st)) { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 920 | /* Constraint check succeeded */ |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 921 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 922 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 923 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 924 | "%s: constraint failed (%s:%d)", |
| 925 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 926 | return -1; |
| 927 | } |
| 928 | } |
| 929 | |
| 930 | /* |
| 931 | * This type is implemented using PER_Visible, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 932 | * so here we adjust the DEF accordingly. |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 933 | */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 934 | |
| 935 | /*** <<< STAT-DEFS [PER-Visible-2] >>> ***/ |
| 936 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 937 | static const ber_tlv_tag_t asn_DEF_PER_Visible_2_tags_1[] = { |
Lev Walkin | 906654e | 2004-09-10 15:49:15 +0000 | [diff] [blame] | 938 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 939 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 940 | asn_TYPE_descriptor_t asn_DEF_PER_Visible_2 = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 941 | "PER-Visible-2", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 942 | "PER-Visible-2", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 943 | &asn_OP_IA5String, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 944 | PER_Visible_2_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 945 | asn_DEF_PER_Visible_2_tags_1, |
| 946 | sizeof(asn_DEF_PER_Visible_2_tags_1) |
| 947 | /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */ |
| 948 | asn_DEF_PER_Visible_2_tags_1, /* Same as above */ |
| 949 | sizeof(asn_DEF_PER_Visible_2_tags_1) |
| 950 | /sizeof(asn_DEF_PER_Visible_2_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 951 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 952 | 0, /* No PER visible constraints */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 953 | 0, 0, /* No members */ |
| 954 | 0 /* No specifics */ |
| 955 | }; |
| 956 | |
| 957 | |
| 958 | /*** <<< INCLUDES [Not-PER-Visible-1] >>> ***/ |
| 959 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 960 | #include "PER-Visible.h" |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 961 | |
| 962 | /*** <<< TYPE-DECLS [Not-PER-Visible-1] >>> ***/ |
| 963 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 964 | typedef PER_Visible_t Not_PER_Visible_1_t; |
| 965 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 966 | /*** <<< FUNC-DECLS [Not-PER-Visible-1] >>> ***/ |
| 967 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 968 | extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 969 | asn_struct_free_f Not_PER_Visible_1_free; |
| 970 | asn_struct_print_f Not_PER_Visible_1_print; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 971 | asn_constr_check_f Not_PER_Visible_1_constraint; |
| 972 | ber_type_decoder_f Not_PER_Visible_1_decode_ber; |
| 973 | der_type_encoder_f Not_PER_Visible_1_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 974 | xer_type_decoder_f Not_PER_Visible_1_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 975 | xer_type_encoder_f Not_PER_Visible_1_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 976 | |
| 977 | /*** <<< CTABLES [Not-PER-Visible-1] >>> ***/ |
| 978 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 979 | static int check_permitted_alphabet_1(const void *sptr) { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 980 | /* The underlying type is IA5String */ |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 981 | const IA5String_t *st = (const IA5String_t *)sptr; |
Lev Walkin | 634a3b8 | 2004-08-22 03:30:05 +0000 | [diff] [blame] | 982 | const uint8_t *ch = st->buf; |
| 983 | const uint8_t *end = ch + st->size; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 984 | |
| 985 | for(; ch < end; ch++) { |
| 986 | uint8_t cv = *ch; |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 987 | if(!(cv >= 65 && cv <= 70)) return -1; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 988 | } |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 989 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 990 | } |
| 991 | |
| 992 | |
| 993 | /*** <<< CODE [Not-PER-Visible-1] >>> ***/ |
| 994 | |
| 995 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 996 | Not_PER_Visible_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 997 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 998 | const PER_Visible_t *st = (const PER_Visible_t *)sptr; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 999 | |
| 1000 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1001 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 1002 | "%s: value not given (%s:%d)", |
| 1003 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1004 | return -1; |
| 1005 | } |
| 1006 | |
| 1007 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 1008 | if(!check_permitted_alphabet_1(st)) { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1009 | /* Constraint check succeeded */ |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 1010 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1011 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1012 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 1013 | "%s: constraint failed (%s:%d)", |
| 1014 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1015 | return -1; |
| 1016 | } |
| 1017 | } |
| 1018 | |
| 1019 | /* |
| 1020 | * This type is implemented using PER_Visible, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 1021 | * so here we adjust the DEF accordingly. |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1022 | */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1023 | |
| 1024 | /*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/ |
| 1025 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1026 | static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_tags_1[] = { |
Lev Walkin | 906654e | 2004-09-10 15:49:15 +0000 | [diff] [blame] | 1027 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1028 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1029 | asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1030 | "Not-PER-Visible-1", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 1031 | "Not-PER-Visible-1", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 1032 | &asn_OP_IA5String, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1033 | Not_PER_Visible_1_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1034 | asn_DEF_Not_PER_Visible_1_tags_1, |
| 1035 | sizeof(asn_DEF_Not_PER_Visible_1_tags_1) |
| 1036 | /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */ |
| 1037 | asn_DEF_Not_PER_Visible_1_tags_1, /* Same as above */ |
| 1038 | sizeof(asn_DEF_Not_PER_Visible_1_tags_1) |
| 1039 | /sizeof(asn_DEF_Not_PER_Visible_1_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1040 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1041 | 0, /* No PER visible constraints */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1042 | 0, 0, /* No members */ |
| 1043 | 0 /* No specifics */ |
| 1044 | }; |
| 1045 | |
| 1046 | |
| 1047 | /*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/ |
| 1048 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 1049 | #include "PER-Visible.h" |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1050 | |
| 1051 | /*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/ |
| 1052 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1053 | typedef PER_Visible_t Not_PER_Visible_2_t; |
| 1054 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1055 | /*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/ |
| 1056 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1057 | extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 1058 | asn_struct_free_f Not_PER_Visible_2_free; |
| 1059 | asn_struct_print_f Not_PER_Visible_2_print; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1060 | asn_constr_check_f Not_PER_Visible_2_constraint; |
| 1061 | ber_type_decoder_f Not_PER_Visible_2_decode_ber; |
| 1062 | der_type_encoder_f Not_PER_Visible_2_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 1063 | xer_type_decoder_f Not_PER_Visible_2_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 1064 | xer_type_encoder_f Not_PER_Visible_2_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1065 | |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 1066 | /*** <<< CTABLES [Not-PER-Visible-2] >>> ***/ |
| 1067 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 1068 | static int check_permitted_alphabet_1(const void *sptr) { |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 1069 | /* The underlying type is IA5String */ |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 1070 | const IA5String_t *st = (const IA5String_t *)sptr; |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 1071 | const uint8_t *ch = st->buf; |
| 1072 | const uint8_t *end = ch + st->size; |
| 1073 | |
| 1074 | for(; ch < end; ch++) { |
| 1075 | uint8_t cv = *ch; |
| 1076 | if(!(cv >= 65 && cv <= 66)) return -1; |
| 1077 | } |
| 1078 | return 0; |
| 1079 | } |
| 1080 | |
| 1081 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1082 | /*** <<< CODE [Not-PER-Visible-2] >>> ***/ |
| 1083 | |
| 1084 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1085 | Not_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1086 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 1087 | const PER_Visible_t *st = (const PER_Visible_t *)sptr; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1088 | |
| 1089 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1090 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 1091 | "%s: value not given (%s:%d)", |
| 1092 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1093 | return -1; |
| 1094 | } |
| 1095 | |
| 1096 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 1097 | if(!check_permitted_alphabet_1(st)) { |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 1098 | /* Constraint check succeeded */ |
| 1099 | return 0; |
| 1100 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1101 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 1102 | "%s: constraint failed (%s:%d)", |
| 1103 | td->name, __FILE__, __LINE__); |
| 1104 | return -1; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1105 | } |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1106 | } |
| 1107 | |
| 1108 | /* |
| 1109 | * This type is implemented using PER_Visible, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 1110 | * so here we adjust the DEF accordingly. |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1111 | */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1112 | |
| 1113 | /*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/ |
| 1114 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1115 | static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_tags_1[] = { |
Lev Walkin | 906654e | 2004-09-10 15:49:15 +0000 | [diff] [blame] | 1116 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1117 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1118 | asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1119 | "Not-PER-Visible-2", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 1120 | "Not-PER-Visible-2", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 1121 | &asn_OP_IA5String, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1122 | Not_PER_Visible_2_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1123 | asn_DEF_Not_PER_Visible_2_tags_1, |
| 1124 | sizeof(asn_DEF_Not_PER_Visible_2_tags_1) |
| 1125 | /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */ |
| 1126 | asn_DEF_Not_PER_Visible_2_tags_1, /* Same as above */ |
| 1127 | sizeof(asn_DEF_Not_PER_Visible_2_tags_1) |
| 1128 | /sizeof(asn_DEF_Not_PER_Visible_2_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1129 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1130 | 0, /* No PER visible constraints */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1131 | 0, 0, /* No members */ |
| 1132 | 0 /* No specifics */ |
| 1133 | }; |
| 1134 | |
| 1135 | |
| 1136 | /*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/ |
| 1137 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 1138 | #include "PER-Visible.h" |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1139 | |
| 1140 | /*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/ |
| 1141 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1142 | typedef PER_Visible_t Not_PER_Visible_3_t; |
| 1143 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1144 | /*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/ |
| 1145 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1146 | extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 1147 | asn_struct_free_f Not_PER_Visible_3_free; |
| 1148 | asn_struct_print_f Not_PER_Visible_3_print; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1149 | asn_constr_check_f Not_PER_Visible_3_constraint; |
| 1150 | ber_type_decoder_f Not_PER_Visible_3_decode_ber; |
| 1151 | der_type_encoder_f Not_PER_Visible_3_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 1152 | xer_type_decoder_f Not_PER_Visible_3_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 1153 | xer_type_encoder_f Not_PER_Visible_3_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1154 | |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 1155 | /*** <<< CTABLES [Not-PER-Visible-3] >>> ***/ |
| 1156 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 1157 | static int check_permitted_alphabet_1(const void *sptr) { |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 1158 | /* The underlying type is IA5String */ |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 1159 | const IA5String_t *st = (const IA5String_t *)sptr; |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 1160 | const uint8_t *ch = st->buf; |
| 1161 | const uint8_t *end = ch + st->size; |
| 1162 | |
| 1163 | for(; ch < end; ch++) { |
| 1164 | uint8_t cv = *ch; |
| 1165 | if(!(cv >= 65 && cv <= 66)) return -1; |
| 1166 | } |
| 1167 | return 0; |
| 1168 | } |
| 1169 | |
| 1170 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1171 | /*** <<< CODE [Not-PER-Visible-3] >>> ***/ |
| 1172 | |
| 1173 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1174 | Not_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1175 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 1176 | const PER_Visible_t *st = (const PER_Visible_t *)sptr; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1177 | |
| 1178 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1179 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 1180 | "%s: value not given (%s:%d)", |
| 1181 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1182 | return -1; |
| 1183 | } |
| 1184 | |
| 1185 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 1186 | if(!check_permitted_alphabet_1(st)) { |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 1187 | /* Constraint check succeeded */ |
| 1188 | return 0; |
| 1189 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1190 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 1191 | "%s: constraint failed (%s:%d)", |
| 1192 | td->name, __FILE__, __LINE__); |
| 1193 | return -1; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1194 | } |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1195 | } |
| 1196 | |
| 1197 | /* |
| 1198 | * This type is implemented using PER_Visible, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 1199 | * so here we adjust the DEF accordingly. |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1200 | */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1201 | |
| 1202 | /*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/ |
| 1203 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1204 | static const ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_tags_1[] = { |
Lev Walkin | 906654e | 2004-09-10 15:49:15 +0000 | [diff] [blame] | 1205 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1206 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1207 | asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1208 | "Not-PER-Visible-3", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 1209 | "Not-PER-Visible-3", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 1210 | &asn_OP_IA5String, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1211 | Not_PER_Visible_3_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1212 | asn_DEF_Not_PER_Visible_3_tags_1, |
| 1213 | sizeof(asn_DEF_Not_PER_Visible_3_tags_1) |
| 1214 | /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */ |
| 1215 | asn_DEF_Not_PER_Visible_3_tags_1, /* Same as above */ |
| 1216 | sizeof(asn_DEF_Not_PER_Visible_3_tags_1) |
| 1217 | /sizeof(asn_DEF_Not_PER_Visible_3_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1218 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1219 | 0, /* No PER visible constraints */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1220 | 0, 0, /* No members */ |
| 1221 | 0 /* No specifics */ |
| 1222 | }; |
| 1223 | |
| 1224 | |
| 1225 | /*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/ |
| 1226 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 1227 | #include "PER-Visible.h" |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1228 | |
| 1229 | /*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/ |
| 1230 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1231 | typedef PER_Visible_t SIZE_but_not_FROM_t; |
| 1232 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1233 | /*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/ |
| 1234 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1235 | extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 1236 | asn_struct_free_f SIZE_but_not_FROM_free; |
| 1237 | asn_struct_print_f SIZE_but_not_FROM_print; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1238 | asn_constr_check_f SIZE_but_not_FROM_constraint; |
| 1239 | ber_type_decoder_f SIZE_but_not_FROM_decode_ber; |
| 1240 | der_type_encoder_f SIZE_but_not_FROM_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 1241 | xer_type_decoder_f SIZE_but_not_FROM_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 1242 | xer_type_encoder_f SIZE_but_not_FROM_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1243 | |
| 1244 | /*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/ |
| 1245 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 1246 | static int check_permitted_alphabet_1(const void *sptr) { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1247 | /* The underlying type is IA5String */ |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 1248 | const IA5String_t *st = (const IA5String_t *)sptr; |
Lev Walkin | 634a3b8 | 2004-08-22 03:30:05 +0000 | [diff] [blame] | 1249 | const uint8_t *ch = st->buf; |
| 1250 | const uint8_t *end = ch + st->size; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1251 | |
| 1252 | for(; ch < end; ch++) { |
| 1253 | uint8_t cv = *ch; |
Lev Walkin | d35c8b5 | 2004-08-25 02:08:08 +0000 | [diff] [blame] | 1254 | if(!(cv >= 65 && cv <= 68)) return -1; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1255 | } |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 1256 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1257 | } |
| 1258 | |
| 1259 | |
| 1260 | /*** <<< CODE [SIZE-but-not-FROM] >>> ***/ |
| 1261 | |
| 1262 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1263 | SIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1264 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 1265 | const PER_Visible_t *st = (const PER_Visible_t *)sptr; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1266 | size_t size; |
| 1267 | |
| 1268 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1269 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 1270 | "%s: value not given (%s:%d)", |
| 1271 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1272 | return -1; |
| 1273 | } |
| 1274 | |
| 1275 | size = st->size; |
| 1276 | |
| 1277 | if((size >= 1 && size <= 4) |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 1278 | && !check_permitted_alphabet_1(st)) { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1279 | /* Constraint check succeeded */ |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 1280 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1281 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1282 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 1283 | "%s: constraint failed (%s:%d)", |
| 1284 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1285 | return -1; |
| 1286 | } |
| 1287 | } |
| 1288 | |
| 1289 | /* |
| 1290 | * This type is implemented using PER_Visible, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 1291 | * so here we adjust the DEF accordingly. |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1292 | */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1293 | |
| 1294 | /*** <<< STAT-DEFS [SIZE-but-not-FROM] >>> ***/ |
| 1295 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1296 | static const ber_tlv_tag_t asn_DEF_SIZE_but_not_FROM_tags_1[] = { |
Lev Walkin | 906654e | 2004-09-10 15:49:15 +0000 | [diff] [blame] | 1297 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1298 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1299 | asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1300 | "SIZE-but-not-FROM", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 1301 | "SIZE-but-not-FROM", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 1302 | &asn_OP_IA5String, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1303 | SIZE_but_not_FROM_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1304 | asn_DEF_SIZE_but_not_FROM_tags_1, |
| 1305 | sizeof(asn_DEF_SIZE_but_not_FROM_tags_1) |
| 1306 | /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */ |
| 1307 | asn_DEF_SIZE_but_not_FROM_tags_1, /* Same as above */ |
| 1308 | sizeof(asn_DEF_SIZE_but_not_FROM_tags_1) |
| 1309 | /sizeof(asn_DEF_SIZE_but_not_FROM_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1310 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1311 | 0, /* No PER visible constraints */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1312 | 0, 0, /* No members */ |
| 1313 | 0 /* No specifics */ |
| 1314 | }; |
| 1315 | |
| 1316 | |
| 1317 | /*** <<< INCLUDES [SIZE-and-FROM] >>> ***/ |
| 1318 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 1319 | #include "PER-Visible.h" |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1320 | |
| 1321 | /*** <<< TYPE-DECLS [SIZE-and-FROM] >>> ***/ |
| 1322 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1323 | typedef PER_Visible_t SIZE_and_FROM_t; |
| 1324 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1325 | /*** <<< FUNC-DECLS [SIZE-and-FROM] >>> ***/ |
| 1326 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1327 | extern asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 1328 | asn_struct_free_f SIZE_and_FROM_free; |
| 1329 | asn_struct_print_f SIZE_and_FROM_print; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1330 | asn_constr_check_f SIZE_and_FROM_constraint; |
| 1331 | ber_type_decoder_f SIZE_and_FROM_decode_ber; |
| 1332 | der_type_encoder_f SIZE_and_FROM_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 1333 | xer_type_decoder_f SIZE_and_FROM_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 1334 | xer_type_encoder_f SIZE_and_FROM_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1335 | |
| 1336 | /*** <<< CTABLES [SIZE-and-FROM] >>> ***/ |
| 1337 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 1338 | static int check_permitted_alphabet_1(const void *sptr) { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1339 | /* The underlying type is IA5String */ |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 1340 | const IA5String_t *st = (const IA5String_t *)sptr; |
Lev Walkin | 634a3b8 | 2004-08-22 03:30:05 +0000 | [diff] [blame] | 1341 | const uint8_t *ch = st->buf; |
| 1342 | const uint8_t *end = ch + st->size; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1343 | |
| 1344 | for(; ch < end; ch++) { |
| 1345 | uint8_t cv = *ch; |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 1346 | if(!(cv >= 65 && cv <= 68)) return -1; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1347 | } |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 1348 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1349 | } |
| 1350 | |
| 1351 | |
| 1352 | /*** <<< CODE [SIZE-and-FROM] >>> ***/ |
| 1353 | |
| 1354 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1355 | SIZE_and_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1356 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 1357 | const PER_Visible_t *st = (const PER_Visible_t *)sptr; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1358 | size_t size; |
| 1359 | |
| 1360 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1361 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 1362 | "%s: value not given (%s:%d)", |
| 1363 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1364 | return -1; |
| 1365 | } |
| 1366 | |
| 1367 | size = st->size; |
| 1368 | |
| 1369 | if((size >= 1 && size <= 4) |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 1370 | && !check_permitted_alphabet_1(st)) { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1371 | /* Constraint check succeeded */ |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 1372 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1373 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1374 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 1375 | "%s: constraint failed (%s:%d)", |
| 1376 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1377 | return -1; |
| 1378 | } |
| 1379 | } |
| 1380 | |
| 1381 | /* |
| 1382 | * This type is implemented using PER_Visible, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 1383 | * so here we adjust the DEF accordingly. |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1384 | */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1385 | |
| 1386 | /*** <<< STAT-DEFS [SIZE-and-FROM] >>> ***/ |
| 1387 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1388 | static const ber_tlv_tag_t asn_DEF_SIZE_and_FROM_tags_1[] = { |
Lev Walkin | 906654e | 2004-09-10 15:49:15 +0000 | [diff] [blame] | 1389 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1390 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1391 | asn_TYPE_descriptor_t asn_DEF_SIZE_and_FROM = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1392 | "SIZE-and-FROM", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 1393 | "SIZE-and-FROM", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 1394 | &asn_OP_IA5String, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1395 | SIZE_and_FROM_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1396 | asn_DEF_SIZE_and_FROM_tags_1, |
| 1397 | sizeof(asn_DEF_SIZE_and_FROM_tags_1) |
| 1398 | /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */ |
| 1399 | asn_DEF_SIZE_and_FROM_tags_1, /* Same as above */ |
| 1400 | sizeof(asn_DEF_SIZE_and_FROM_tags_1) |
| 1401 | /sizeof(asn_DEF_SIZE_and_FROM_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1402 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1403 | 0, /* No PER visible constraints */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1404 | 0, 0, /* No members */ |
| 1405 | 0 /* No specifics */ |
| 1406 | }; |
| 1407 | |
| 1408 | |
| 1409 | /*** <<< INCLUDES [Neither-SIZE-nor-FROM] >>> ***/ |
| 1410 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 1411 | #include "PER-Visible.h" |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1412 | |
| 1413 | /*** <<< TYPE-DECLS [Neither-SIZE-nor-FROM] >>> ***/ |
| 1414 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1415 | typedef PER_Visible_t Neither_SIZE_nor_FROM_t; |
| 1416 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1417 | /*** <<< FUNC-DECLS [Neither-SIZE-nor-FROM] >>> ***/ |
| 1418 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1419 | extern asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 1420 | asn_struct_free_f Neither_SIZE_nor_FROM_free; |
| 1421 | asn_struct_print_f Neither_SIZE_nor_FROM_print; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1422 | asn_constr_check_f Neither_SIZE_nor_FROM_constraint; |
| 1423 | ber_type_decoder_f Neither_SIZE_nor_FROM_decode_ber; |
| 1424 | der_type_encoder_f Neither_SIZE_nor_FROM_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 1425 | xer_type_decoder_f Neither_SIZE_nor_FROM_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 1426 | xer_type_encoder_f Neither_SIZE_nor_FROM_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1427 | |
| 1428 | /*** <<< CTABLES [Neither-SIZE-nor-FROM] >>> ***/ |
| 1429 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 1430 | static int check_permitted_alphabet_1(const void *sptr) { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1431 | /* The underlying type is IA5String */ |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 1432 | const IA5String_t *st = (const IA5String_t *)sptr; |
Lev Walkin | 634a3b8 | 2004-08-22 03:30:05 +0000 | [diff] [blame] | 1433 | const uint8_t *ch = st->buf; |
| 1434 | const uint8_t *end = ch + st->size; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1435 | |
| 1436 | for(; ch < end; ch++) { |
| 1437 | uint8_t cv = *ch; |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 1438 | if(!(cv >= 65 && cv <= 70)) return -1; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1439 | } |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 1440 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1441 | } |
| 1442 | |
| 1443 | |
| 1444 | /*** <<< CODE [Neither-SIZE-nor-FROM] >>> ***/ |
| 1445 | |
| 1446 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1447 | Neither_SIZE_nor_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1448 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 1449 | const PER_Visible_t *st = (const PER_Visible_t *)sptr; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1450 | |
| 1451 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1452 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 1453 | "%s: value not given (%s:%d)", |
| 1454 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1455 | return -1; |
| 1456 | } |
| 1457 | |
| 1458 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 1459 | if(!check_permitted_alphabet_1(st)) { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1460 | /* Constraint check succeeded */ |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 1461 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1462 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1463 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 1464 | "%s: constraint failed (%s:%d)", |
| 1465 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1466 | return -1; |
| 1467 | } |
| 1468 | } |
| 1469 | |
| 1470 | /* |
| 1471 | * This type is implemented using PER_Visible, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 1472 | * so here we adjust the DEF accordingly. |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1473 | */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1474 | |
| 1475 | /*** <<< STAT-DEFS [Neither-SIZE-nor-FROM] >>> ***/ |
| 1476 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1477 | static const ber_tlv_tag_t asn_DEF_Neither_SIZE_nor_FROM_tags_1[] = { |
Lev Walkin | 906654e | 2004-09-10 15:49:15 +0000 | [diff] [blame] | 1478 | (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)) |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1479 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1480 | asn_TYPE_descriptor_t asn_DEF_Neither_SIZE_nor_FROM = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1481 | "Neither-SIZE-nor-FROM", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 1482 | "Neither-SIZE-nor-FROM", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 1483 | &asn_OP_IA5String, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1484 | Neither_SIZE_nor_FROM_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1485 | asn_DEF_Neither_SIZE_nor_FROM_tags_1, |
| 1486 | sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1) |
| 1487 | /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */ |
| 1488 | asn_DEF_Neither_SIZE_nor_FROM_tags_1, /* Same as above */ |
| 1489 | sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1) |
| 1490 | /sizeof(asn_DEF_Neither_SIZE_nor_FROM_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1491 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1492 | 0, /* No PER visible constraints */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1493 | 0, 0, /* No members */ |
| 1494 | 0 /* No specifics */ |
| 1495 | }; |
| 1496 | |
| 1497 | |
Lev Walkin | 55cc44a | 2004-10-03 09:14:32 +0000 | [diff] [blame] | 1498 | /*** <<< INCLUDES [Utf8-4] >>> ***/ |
| 1499 | |
| 1500 | #include <UTF8String.h> |
| 1501 | |
| 1502 | /*** <<< TYPE-DECLS [Utf8-4] >>> ***/ |
| 1503 | |
Lev Walkin | 55cc44a | 2004-10-03 09:14:32 +0000 | [diff] [blame] | 1504 | typedef UTF8String_t Utf8_4_t; |
| 1505 | |
| 1506 | /*** <<< FUNC-DECLS [Utf8-4] >>> ***/ |
| 1507 | |
| 1508 | extern asn_TYPE_descriptor_t asn_DEF_Utf8_4; |
| 1509 | asn_struct_free_f Utf8_4_free; |
| 1510 | asn_struct_print_f Utf8_4_print; |
| 1511 | asn_constr_check_f Utf8_4_constraint; |
| 1512 | ber_type_decoder_f Utf8_4_decode_ber; |
| 1513 | der_type_encoder_f Utf8_4_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 1514 | xer_type_decoder_f Utf8_4_decode_xer; |
Lev Walkin | 55cc44a | 2004-10-03 09:14:32 +0000 | [diff] [blame] | 1515 | xer_type_encoder_f Utf8_4_encode_xer; |
| 1516 | |
| 1517 | /*** <<< CTABLES [Utf8-4] >>> ***/ |
| 1518 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 1519 | static int check_permitted_alphabet_1(const void *sptr) { |
Lev Walkin | 55cc44a | 2004-10-03 09:14:32 +0000 | [diff] [blame] | 1520 | if(UTF8String_length((const UTF8String_t *)sptr) < 0) |
| 1521 | return -1; /* Alphabet (sic!) test failed. */ |
| 1522 | |
| 1523 | return 0; |
| 1524 | } |
| 1525 | |
| 1526 | |
| 1527 | /*** <<< CODE [Utf8-4] >>> ***/ |
| 1528 | |
| 1529 | int |
| 1530 | Utf8_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1531 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 1532 | const UTF8String_t *st = (const UTF8String_t *)sptr; |
Lev Walkin | 55cc44a | 2004-10-03 09:14:32 +0000 | [diff] [blame] | 1533 | |
| 1534 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1535 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 55cc44a | 2004-10-03 09:14:32 +0000 | [diff] [blame] | 1536 | "%s: value not given (%s:%d)", |
| 1537 | td->name, __FILE__, __LINE__); |
| 1538 | return -1; |
| 1539 | } |
| 1540 | |
| 1541 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 1542 | if(!check_permitted_alphabet_1(st)) { |
Lev Walkin | 55cc44a | 2004-10-03 09:14:32 +0000 | [diff] [blame] | 1543 | /* Constraint check succeeded */ |
| 1544 | return 0; |
| 1545 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1546 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 55cc44a | 2004-10-03 09:14:32 +0000 | [diff] [blame] | 1547 | "%s: constraint failed (%s:%d)", |
| 1548 | td->name, __FILE__, __LINE__); |
| 1549 | return -1; |
| 1550 | } |
| 1551 | } |
| 1552 | |
| 1553 | /* |
| 1554 | * This type is implemented using UTF8String, |
| 1555 | * so here we adjust the DEF accordingly. |
| 1556 | */ |
Lev Walkin | 55cc44a | 2004-10-03 09:14:32 +0000 | [diff] [blame] | 1557 | |
| 1558 | /*** <<< STAT-DEFS [Utf8-4] >>> ***/ |
| 1559 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1560 | static const ber_tlv_tag_t asn_DEF_Utf8_4_tags_1[] = { |
Lev Walkin | 55cc44a | 2004-10-03 09:14:32 +0000 | [diff] [blame] | 1561 | (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)) |
| 1562 | }; |
| 1563 | asn_TYPE_descriptor_t asn_DEF_Utf8_4 = { |
| 1564 | "Utf8-4", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 1565 | "Utf8-4", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 1566 | &asn_OP_UTF8String, |
Lev Walkin | 55cc44a | 2004-10-03 09:14:32 +0000 | [diff] [blame] | 1567 | Utf8_4_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1568 | asn_DEF_Utf8_4_tags_1, |
| 1569 | sizeof(asn_DEF_Utf8_4_tags_1) |
| 1570 | /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */ |
| 1571 | asn_DEF_Utf8_4_tags_1, /* Same as above */ |
| 1572 | sizeof(asn_DEF_Utf8_4_tags_1) |
| 1573 | /sizeof(asn_DEF_Utf8_4_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1574 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1575 | 0, /* No PER visible constraints */ |
Lev Walkin | 55cc44a | 2004-10-03 09:14:32 +0000 | [diff] [blame] | 1576 | 0, 0, /* No members */ |
| 1577 | 0 /* No specifics */ |
| 1578 | }; |
| 1579 | |
| 1580 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1581 | /*** <<< INCLUDES [Utf8-3] >>> ***/ |
| 1582 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 1583 | #include "Utf8-2.h" |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1584 | |
| 1585 | /*** <<< TYPE-DECLS [Utf8-3] >>> ***/ |
| 1586 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1587 | typedef Utf8_2_t Utf8_3_t; |
| 1588 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1589 | /*** <<< FUNC-DECLS [Utf8-3] >>> ***/ |
| 1590 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1591 | extern asn_TYPE_descriptor_t asn_DEF_Utf8_3; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 1592 | asn_struct_free_f Utf8_3_free; |
| 1593 | asn_struct_print_f Utf8_3_print; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1594 | asn_constr_check_f Utf8_3_constraint; |
| 1595 | ber_type_decoder_f Utf8_3_decode_ber; |
| 1596 | der_type_encoder_f Utf8_3_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 1597 | xer_type_decoder_f Utf8_3_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 1598 | xer_type_encoder_f Utf8_3_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1599 | |
| 1600 | /*** <<< CTABLES [Utf8-3] >>> ***/ |
| 1601 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1602 | static const int permitted_alphabet_table_1[128] = { |
Lev Walkin | 5b62ca8 | 2006-09-21 01:52:07 +0000 | [diff] [blame] | 1603 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 1604 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 1605 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 1606 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 1607 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, /* ABCDEFGHIJKLMNO */ |
| 1608 | 16,17,18,19,20,21,22,23,24,25,26, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ */ |
| 1609 | 0,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41, /* abcdefghijklmno */ |
| 1610 | 42,43,44,45,46,47,48,49,50,51,52, 0, 0, 0, 0, 0, /* pqrstuvwxyz */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1611 | }; |
| 1612 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 1613 | static int check_permitted_alphabet_1(const void *sptr) { |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1614 | const int *table = permitted_alphabet_table_1; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1615 | /* The underlying type is UTF8String */ |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 1616 | const UTF8String_t *st = (const UTF8String_t *)sptr; |
Lev Walkin | 634a3b8 | 2004-08-22 03:30:05 +0000 | [diff] [blame] | 1617 | const uint8_t *ch = st->buf; |
| 1618 | const uint8_t *end = ch + st->size; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1619 | |
| 1620 | for(; ch < end; ch++) { |
| 1621 | uint8_t cv = *ch; |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 1622 | if(cv >= 0x80) return -1; |
| 1623 | if(!table[cv]) return -1; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1624 | } |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 1625 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1626 | } |
| 1627 | |
| 1628 | |
| 1629 | /*** <<< CODE [Utf8-3] >>> ***/ |
| 1630 | |
| 1631 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1632 | Utf8_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1633 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 1634 | const Utf8_2_t *st = (const Utf8_2_t *)sptr; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1635 | size_t size; |
| 1636 | |
| 1637 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1638 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 1639 | "%s: value not given (%s:%d)", |
| 1640 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1641 | return -1; |
| 1642 | } |
| 1643 | |
Lev Walkin | fac2e94 | 2004-10-02 16:33:46 +0000 | [diff] [blame] | 1644 | size = UTF8String_length(st); |
Lev Walkin | 00df16d | 2004-10-02 16:44:30 +0000 | [diff] [blame] | 1645 | if((ssize_t)size < 0) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1646 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | fac2e94 | 2004-10-02 16:33:46 +0000 | [diff] [blame] | 1647 | "%s: UTF-8: broken encoding (%s:%d)", |
| 1648 | td->name, __FILE__, __LINE__); |
| 1649 | return -1; |
| 1650 | } |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1651 | |
| 1652 | if((size >= 1 && size <= 2) |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 1653 | && !check_permitted_alphabet_1(st)) { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1654 | /* Constraint check succeeded */ |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 1655 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1656 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1657 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 1658 | "%s: constraint failed (%s:%d)", |
| 1659 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1660 | return -1; |
| 1661 | } |
| 1662 | } |
| 1663 | |
| 1664 | /* |
| 1665 | * This type is implemented using Utf8_2, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 1666 | * so here we adjust the DEF accordingly. |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1667 | */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1668 | |
| 1669 | /*** <<< STAT-DEFS [Utf8-3] >>> ***/ |
| 1670 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1671 | static const ber_tlv_tag_t asn_DEF_Utf8_3_tags_1[] = { |
Lev Walkin | 906654e | 2004-09-10 15:49:15 +0000 | [diff] [blame] | 1672 | (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)) |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1673 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1674 | asn_TYPE_descriptor_t asn_DEF_Utf8_3 = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1675 | "Utf8-3", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 1676 | "Utf8-3", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 1677 | &asn_OP_UTF8String, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1678 | Utf8_3_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1679 | asn_DEF_Utf8_3_tags_1, |
| 1680 | sizeof(asn_DEF_Utf8_3_tags_1) |
| 1681 | /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */ |
| 1682 | asn_DEF_Utf8_3_tags_1, /* Same as above */ |
| 1683 | sizeof(asn_DEF_Utf8_3_tags_1) |
| 1684 | /sizeof(asn_DEF_Utf8_3_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1685 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1686 | 0, /* No PER visible constraints */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1687 | 0, 0, /* No members */ |
| 1688 | 0 /* No specifics */ |
| 1689 | }; |
| 1690 | |
| 1691 | |
| 1692 | /*** <<< INCLUDES [Utf8-2] >>> ***/ |
| 1693 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 1694 | #include "Utf8-1.h" |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1695 | |
| 1696 | /*** <<< TYPE-DECLS [Utf8-2] >>> ***/ |
| 1697 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1698 | typedef Utf8_1_t Utf8_2_t; |
| 1699 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1700 | /*** <<< FUNC-DECLS [Utf8-2] >>> ***/ |
| 1701 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1702 | extern asn_TYPE_descriptor_t asn_DEF_Utf8_2; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 1703 | asn_struct_free_f Utf8_2_free; |
| 1704 | asn_struct_print_f Utf8_2_print; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1705 | asn_constr_check_f Utf8_2_constraint; |
| 1706 | ber_type_decoder_f Utf8_2_decode_ber; |
| 1707 | der_type_encoder_f Utf8_2_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 1708 | xer_type_decoder_f Utf8_2_decode_xer; |
Lev Walkin | a9cc46e | 2004-09-22 16:06:28 +0000 | [diff] [blame] | 1709 | xer_type_encoder_f Utf8_2_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1710 | |
| 1711 | /*** <<< CODE [Utf8-2] >>> ***/ |
| 1712 | |
| 1713 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1714 | Utf8_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1715 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 1716 | const Utf8_1_t *st = (const Utf8_1_t *)sptr; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1717 | size_t size; |
| 1718 | |
| 1719 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1720 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 1721 | "%s: value not given (%s:%d)", |
| 1722 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1723 | return -1; |
| 1724 | } |
| 1725 | |
Lev Walkin | fac2e94 | 2004-10-02 16:33:46 +0000 | [diff] [blame] | 1726 | size = UTF8String_length(st); |
Lev Walkin | 00df16d | 2004-10-02 16:44:30 +0000 | [diff] [blame] | 1727 | if((ssize_t)size < 0) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1728 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | fac2e94 | 2004-10-02 16:33:46 +0000 | [diff] [blame] | 1729 | "%s: UTF-8: broken encoding (%s:%d)", |
| 1730 | td->name, __FILE__, __LINE__); |
| 1731 | return -1; |
| 1732 | } |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1733 | |
| 1734 | if((size >= 1 && size <= 2)) { |
| 1735 | /* Constraint check succeeded */ |
Lev Walkin | 775885e | 2004-08-22 12:47:03 +0000 | [diff] [blame] | 1736 | return 0; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1737 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1738 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 16835b6 | 2004-08-22 13:47:59 +0000 | [diff] [blame] | 1739 | "%s: constraint failed (%s:%d)", |
| 1740 | td->name, __FILE__, __LINE__); |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1741 | return -1; |
| 1742 | } |
| 1743 | } |
| 1744 | |
| 1745 | /* |
| 1746 | * This type is implemented using Utf8_1, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 1747 | * so here we adjust the DEF accordingly. |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1748 | */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1749 | |
| 1750 | /*** <<< STAT-DEFS [Utf8-2] >>> ***/ |
| 1751 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1752 | static const ber_tlv_tag_t asn_DEF_Utf8_2_tags_1[] = { |
Lev Walkin | 906654e | 2004-09-10 15:49:15 +0000 | [diff] [blame] | 1753 | (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)) |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1754 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 1755 | asn_TYPE_descriptor_t asn_DEF_Utf8_2 = { |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1756 | "Utf8-2", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 1757 | "Utf8-2", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 1758 | &asn_OP_UTF8String, |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1759 | Utf8_2_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1760 | asn_DEF_Utf8_2_tags_1, |
| 1761 | sizeof(asn_DEF_Utf8_2_tags_1) |
| 1762 | /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */ |
| 1763 | asn_DEF_Utf8_2_tags_1, /* Same as above */ |
| 1764 | sizeof(asn_DEF_Utf8_2_tags_1) |
| 1765 | /sizeof(asn_DEF_Utf8_2_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1766 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1767 | 0, /* No PER visible constraints */ |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1768 | 0, 0, /* No members */ |
| 1769 | 0 /* No specifics */ |
| 1770 | }; |
| 1771 | |
| 1772 | |
| 1773 | /*** <<< INCLUDES [Utf8-1] >>> ***/ |
| 1774 | |
| 1775 | #include <UTF8String.h> |
| 1776 | |
| 1777 | /*** <<< TYPE-DECLS [Utf8-1] >>> ***/ |
| 1778 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1779 | typedef UTF8String_t Utf8_1_t; |
| 1780 | |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1781 | /*** <<< FUNC-DECLS [Utf8-1] >>> ***/ |
| 1782 | |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 1783 | extern asn_TYPE_descriptor_t asn_DEF_Utf8_1; |
| 1784 | asn_struct_free_f Utf8_1_free; |
| 1785 | asn_struct_print_f Utf8_1_print; |
| 1786 | asn_constr_check_f Utf8_1_constraint; |
| 1787 | ber_type_decoder_f Utf8_1_decode_ber; |
| 1788 | der_type_encoder_f Utf8_1_encode_der; |
| 1789 | xer_type_decoder_f Utf8_1_decode_xer; |
| 1790 | xer_type_encoder_f Utf8_1_encode_xer; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1791 | |
| 1792 | /*** <<< CODE [Utf8-1] >>> ***/ |
| 1793 | |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 1794 | /* |
| 1795 | * This type is implemented using UTF8String, |
| 1796 | * so here we adjust the DEF accordingly. |
| 1797 | */ |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 1798 | |
| 1799 | /*** <<< STAT-DEFS [Utf8-1] >>> ***/ |
| 1800 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1801 | static const ber_tlv_tag_t asn_DEF_Utf8_1_tags_1[] = { |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 1802 | (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)) |
| 1803 | }; |
| 1804 | asn_TYPE_descriptor_t asn_DEF_Utf8_1 = { |
| 1805 | "Utf8-1", |
| 1806 | "Utf8-1", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 1807 | &asn_OP_UTF8String, |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 1808 | UTF8String_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1809 | asn_DEF_Utf8_1_tags_1, |
| 1810 | sizeof(asn_DEF_Utf8_1_tags_1) |
| 1811 | /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */ |
| 1812 | asn_DEF_Utf8_1_tags_1, /* Same as above */ |
| 1813 | sizeof(asn_DEF_Utf8_1_tags_1) |
| 1814 | /sizeof(asn_DEF_Utf8_1_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1815 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1816 | 0, /* No PER visible constraints */ |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 1817 | 0, 0, /* No members */ |
| 1818 | 0 /* No specifics */ |
| 1819 | }; |
Lev Walkin | 006de1c | 2004-08-20 13:37:45 +0000 | [diff] [blame] | 1820 | |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 1821 | |
| 1822 | /*** <<< INCLUDES [VisibleIdentifier] >>> ***/ |
| 1823 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 1824 | #include "Identifier.h" |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 1825 | |
| 1826 | /*** <<< TYPE-DECLS [VisibleIdentifier] >>> ***/ |
| 1827 | |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 1828 | typedef Identifier_t VisibleIdentifier_t; |
| 1829 | |
| 1830 | /*** <<< FUNC-DECLS [VisibleIdentifier] >>> ***/ |
| 1831 | |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 1832 | extern asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier; |
| 1833 | asn_struct_free_f VisibleIdentifier_free; |
| 1834 | asn_struct_print_f VisibleIdentifier_print; |
| 1835 | asn_constr_check_f VisibleIdentifier_constraint; |
| 1836 | ber_type_decoder_f VisibleIdentifier_decode_ber; |
| 1837 | der_type_encoder_f VisibleIdentifier_encode_der; |
| 1838 | xer_type_decoder_f VisibleIdentifier_decode_xer; |
| 1839 | xer_type_encoder_f VisibleIdentifier_encode_xer; |
| 1840 | |
| 1841 | /*** <<< CTABLES [VisibleIdentifier] >>> ***/ |
| 1842 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1843 | static const int permitted_alphabet_table_1[256] = { |
Lev Walkin | 5b62ca8 | 2006-09-21 01:52:07 +0000 | [diff] [blame] | 1844 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 1845 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 1846 | 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */ |
| 1847 | 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */ |
| 1848 | 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */ |
| 1849 | 27,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */ |
| 1850 | 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */ |
| 1851 | 54,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */ |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 1852 | }; |
| 1853 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 1854 | static int check_permitted_alphabet_1(const void *sptr) { |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1855 | const int *table = permitted_alphabet_table_1; |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 1856 | /* The underlying type is VisibleString */ |
| 1857 | const VisibleString_t *st = (const VisibleString_t *)sptr; |
| 1858 | const uint8_t *ch = st->buf; |
| 1859 | const uint8_t *end = ch + st->size; |
| 1860 | |
| 1861 | for(; ch < end; ch++) { |
| 1862 | uint8_t cv = *ch; |
| 1863 | if(!table[cv]) return -1; |
| 1864 | } |
| 1865 | return 0; |
| 1866 | } |
| 1867 | |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 1868 | |
Lev Walkin | 154aa18 | 2004-09-26 13:12:56 +0000 | [diff] [blame] | 1869 | /*** <<< CODE [VisibleIdentifier] >>> ***/ |
| 1870 | |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 1871 | int |
| 1872 | VisibleIdentifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1873 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 1874 | const Identifier_t *st = (const Identifier_t *)sptr; |
| 1875 | size_t size; |
| 1876 | |
| 1877 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1878 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 1879 | "%s: value not given (%s:%d)", |
| 1880 | td->name, __FILE__, __LINE__); |
| 1881 | return -1; |
| 1882 | } |
| 1883 | |
| 1884 | size = st->size; |
| 1885 | |
| 1886 | if((size >= 1 && size <= 32) |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 1887 | && !check_permitted_alphabet_1(st)) { |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 1888 | /* Constraint check succeeded */ |
| 1889 | return 0; |
| 1890 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1891 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 1892 | "%s: constraint failed (%s:%d)", |
| 1893 | td->name, __FILE__, __LINE__); |
| 1894 | return -1; |
| 1895 | } |
| 1896 | } |
| 1897 | |
| 1898 | /* |
| 1899 | * This type is implemented using Identifier, |
| 1900 | * so here we adjust the DEF accordingly. |
| 1901 | */ |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 1902 | |
| 1903 | /*** <<< STAT-DEFS [VisibleIdentifier] >>> ***/ |
| 1904 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1905 | static const ber_tlv_tag_t asn_DEF_VisibleIdentifier_tags_1[] = { |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 1906 | (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)) |
| 1907 | }; |
| 1908 | asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = { |
| 1909 | "VisibleIdentifier", |
| 1910 | "VisibleIdentifier", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 1911 | &asn_OP_VisibleString, |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 1912 | VisibleIdentifier_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1913 | asn_DEF_VisibleIdentifier_tags_1, |
| 1914 | sizeof(asn_DEF_VisibleIdentifier_tags_1) |
| 1915 | /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */ |
| 1916 | asn_DEF_VisibleIdentifier_tags_1, /* Same as above */ |
| 1917 | sizeof(asn_DEF_VisibleIdentifier_tags_1) |
| 1918 | /sizeof(asn_DEF_VisibleIdentifier_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1919 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1920 | 0, /* No PER visible constraints */ |
Lev Walkin | caf0d5a | 2005-03-04 23:48:19 +0000 | [diff] [blame] | 1921 | 0, 0, /* No members */ |
| 1922 | 0 /* No specifics */ |
| 1923 | }; |
Lev Walkin | 154aa18 | 2004-09-26 13:12:56 +0000 | [diff] [blame] | 1924 | |
| 1925 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1926 | /*** <<< INCLUDES [Sequence] >>> ***/ |
| 1927 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 1928 | #include "Int1.h" |
| 1929 | #include "Int4.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1930 | #include <BOOLEAN.h> |
| 1931 | #include <ENUMERATED.h> |
| 1932 | #include <NULL.h> |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 1933 | #include "Int5.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1934 | #include <constr_SEQUENCE.h> |
| 1935 | |
| 1936 | /*** <<< DEPS [Sequence] >>> ***/ |
| 1937 | |
| 1938 | typedef enum enum_c { |
| 1939 | enum_c_one = 1, |
| 1940 | enum_c_two = 2, |
| 1941 | /* |
| 1942 | * Enumeration is extensible |
| 1943 | */ |
| 1944 | enum_c_three = 3 |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 1945 | } e_enum_c; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1946 | |
| 1947 | /*** <<< TYPE-DECLS [Sequence] >>> ***/ |
| 1948 | |
| 1949 | typedef struct Sequence { |
| 1950 | Int1_t *int1_c /* DEFAULT 3 */; |
| 1951 | Int4_t int4; |
| 1952 | Int4_t int4_c; |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 1953 | BOOLEAN_t *Bool /* DEFAULT 1 */; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1954 | ENUMERATED_t enum_c; |
| 1955 | NULL_t *null /* OPTIONAL */; |
| 1956 | /* |
| 1957 | * This type is extensible, |
| 1958 | * possible extensions are below. |
| 1959 | */ |
| 1960 | Int5_t *int5_c /* OPTIONAL */; |
| 1961 | |
| 1962 | /* Context for parsing across buffer boundaries */ |
| 1963 | asn_struct_ctx_t _asn_ctx; |
| 1964 | } Sequence_t; |
| 1965 | |
| 1966 | /*** <<< FUNC-DECLS [Sequence] >>> ***/ |
| 1967 | |
| 1968 | /* extern asn_TYPE_descriptor_t asn_DEF_enum_c_6; // (Use -fall-defs-global to expose) */ |
| 1969 | extern asn_TYPE_descriptor_t asn_DEF_Sequence; |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 1970 | extern asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1; |
| 1971 | extern asn_TYPE_member_t asn_MBR_Sequence_1[7]; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1972 | |
| 1973 | /*** <<< CODE [Sequence] >>> ***/ |
| 1974 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1975 | /* |
| 1976 | * This type is implemented using ENUMERATED, |
| 1977 | * so here we adjust the DEF accordingly. |
| 1978 | */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1979 | static int |
| 1980 | memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1981 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1982 | const Int1_t *st = (const Int1_t *)sptr; |
| 1983 | long value; |
| 1984 | |
| 1985 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1986 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1987 | "%s: value not given (%s:%d)", |
| 1988 | td->name, __FILE__, __LINE__); |
| 1989 | return -1; |
| 1990 | } |
| 1991 | |
| 1992 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1993 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1994 | "%s: value too large (%s:%d)", |
| 1995 | td->name, __FILE__, __LINE__); |
| 1996 | return -1; |
| 1997 | } |
| 1998 | |
| 1999 | if((value >= -2)) { |
| 2000 | /* Constraint check succeeded */ |
| 2001 | return 0; |
| 2002 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2003 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2004 | "%s: constraint failed (%s:%d)", |
| 2005 | td->name, __FILE__, __LINE__); |
| 2006 | return -1; |
| 2007 | } |
| 2008 | } |
| 2009 | |
| 2010 | static int |
| 2011 | memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 2012 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2013 | const Int4_t *st = (const Int4_t *)sptr; |
| 2014 | long value; |
| 2015 | |
| 2016 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2017 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2018 | "%s: value not given (%s:%d)", |
| 2019 | td->name, __FILE__, __LINE__); |
| 2020 | return -1; |
| 2021 | } |
| 2022 | |
| 2023 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2024 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2025 | "%s: value too large (%s:%d)", |
| 2026 | td->name, __FILE__, __LINE__); |
| 2027 | return -1; |
| 2028 | } |
| 2029 | |
| 2030 | if((value >= 5 && value <= 7)) { |
| 2031 | /* Constraint check succeeded */ |
| 2032 | return 0; |
| 2033 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2034 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2035 | "%s: constraint failed (%s:%d)", |
| 2036 | td->name, __FILE__, __LINE__); |
| 2037 | return -1; |
| 2038 | } |
| 2039 | } |
| 2040 | |
| 2041 | static int |
| 2042 | memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 2043 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2044 | const Int5_t *st = (const Int5_t *)sptr; |
| 2045 | long value; |
| 2046 | |
| 2047 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2048 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2049 | "%s: value not given (%s:%d)", |
| 2050 | td->name, __FILE__, __LINE__); |
| 2051 | return -1; |
| 2052 | } |
| 2053 | |
| 2054 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2055 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2056 | "%s: value too large (%s:%d)", |
| 2057 | td->name, __FILE__, __LINE__); |
| 2058 | return -1; |
| 2059 | } |
| 2060 | |
| 2061 | if((value == 5)) { |
| 2062 | /* Constraint check succeeded */ |
| 2063 | return 0; |
| 2064 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2065 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2066 | "%s: constraint failed (%s:%d)", |
| 2067 | td->name, __FILE__, __LINE__); |
| 2068 | return -1; |
| 2069 | } |
| 2070 | } |
| 2071 | |
| 2072 | |
| 2073 | /*** <<< STAT-DEFS [Sequence] >>> ***/ |
| 2074 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2075 | static int asn_DFL_2_set_3(int set_value, void **sptr) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2076 | Int1_t *st = *sptr; |
| 2077 | |
| 2078 | if(!st) { |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2079 | if(!set_value) return -1; /* Not a default value */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2080 | st = (*sptr = CALLOC(1, sizeof(*st))); |
| 2081 | if(!st) return -1; |
| 2082 | } |
| 2083 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2084 | if(set_value) { |
| 2085 | /* Install default value 3 */ |
| 2086 | return asn_long2INTEGER(st, 3); |
| 2087 | } else { |
| 2088 | /* Test default value 3 */ |
| 2089 | long value; |
| 2090 | if(asn_INTEGER2long(st, &value)) |
| 2091 | return -1; |
| 2092 | return (value == 3); |
| 2093 | } |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2094 | } |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2095 | static int asn_DFL_5_set_1(int set_value, void **sptr) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2096 | BOOLEAN_t *st = *sptr; |
| 2097 | |
| 2098 | if(!st) { |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2099 | if(!set_value) return -1; /* Not a default value */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2100 | st = (*sptr = CALLOC(1, sizeof(*st))); |
| 2101 | if(!st) return -1; |
| 2102 | } |
| 2103 | |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 2104 | if(set_value) { |
| 2105 | /* Install default value 1 */ |
| 2106 | *st = 1; |
| 2107 | return 0; |
| 2108 | } else { |
| 2109 | /* Test default value 1 */ |
| 2110 | return (*st == 1); |
| 2111 | } |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2112 | } |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2113 | static const asn_INTEGER_enum_map_t asn_MAP_enum_c_value2enum_6[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2114 | { 1, 3, "one" }, |
| 2115 | { 2, 3, "two" }, |
| 2116 | { 3, 5, "three" } |
| 2117 | /* This list is extensible */ |
| 2118 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2119 | static const unsigned int asn_MAP_enum_c_enum2value_6[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2120 | 0, /* one(1) */ |
| 2121 | 2, /* three(3) */ |
| 2122 | 1 /* two(2) */ |
| 2123 | /* This list is extensible */ |
| 2124 | }; |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 2125 | static const asn_INTEGER_specifics_t asn_SPC_enum_c_specs_6 = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2126 | asn_MAP_enum_c_value2enum_6, /* "tag" => N; sorted by tag */ |
| 2127 | asn_MAP_enum_c_enum2value_6, /* N => "tag"; sorted by N */ |
| 2128 | 3, /* Number of elements in the maps */ |
| 2129 | 3, /* Extensions before this member */ |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 2130 | 1, /* Strict enumeration */ |
| 2131 | 0, /* Native long size */ |
| 2132 | 0 |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2133 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2134 | static const ber_tlv_tag_t asn_DEF_enum_c_tags_6[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2135 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) |
| 2136 | }; |
| 2137 | static /* Use -fall-defs-global to expose */ |
| 2138 | asn_TYPE_descriptor_t asn_DEF_enum_c_6 = { |
| 2139 | "enum-c", |
| 2140 | "enum-c", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 2141 | &asn_OP_ENUMERATED, |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 2142 | ENUMERATED_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2143 | asn_DEF_enum_c_tags_6, |
| 2144 | sizeof(asn_DEF_enum_c_tags_6) |
| 2145 | /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */ |
| 2146 | asn_DEF_enum_c_tags_6, /* Same as above */ |
| 2147 | sizeof(asn_DEF_enum_c_tags_6) |
| 2148 | /sizeof(asn_DEF_enum_c_tags_6[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2149 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2150 | 0, /* No PER visible constraints */ |
| 2151 | 0, 0, /* Defined elsewhere */ |
| 2152 | &asn_SPC_enum_c_specs_6 /* Additional specs */ |
| 2153 | }; |
| 2154 | |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 2155 | asn_TYPE_member_t asn_MBR_Sequence_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2156 | { ATF_POINTER, 1, offsetof(struct Sequence, int1_c), |
| 2157 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 2158 | .tag_mode = 0, |
| 2159 | .type = &asn_DEF_Int1, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 2160 | .type_selector = 0, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2161 | .memb_constraints = memb_int1_c_constraint_1, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2162 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2163 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 2164 | .default_value = asn_DFL_2_set_3, /* DEFAULT 3 */ |
| 2165 | .name = "int1-c" |
| 2166 | }, |
| 2167 | { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4), |
| 2168 | .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
| 2169 | .tag_mode = +1, /* EXPLICIT tag at current level */ |
| 2170 | .type = &asn_DEF_Int4, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 2171 | .type_selector = 0, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2172 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2173 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2174 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 2175 | .default_value = 0, |
| 2176 | .name = "int4" |
| 2177 | }, |
| 2178 | { ATF_NOFLAGS, 0, offsetof(struct Sequence, int4_c), |
| 2179 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 2180 | .tag_mode = 0, |
| 2181 | .type = &asn_DEF_Int4, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 2182 | .type_selector = 0, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2183 | .memb_constraints = memb_int4_c_constraint_1, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2184 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2185 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 2186 | .default_value = 0, |
| 2187 | .name = "int4-c" |
| 2188 | }, |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 2189 | { ATF_POINTER, 1, offsetof(struct Sequence, Bool), |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2190 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), |
| 2191 | .tag_mode = 0, |
| 2192 | .type = &asn_DEF_BOOLEAN, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 2193 | .type_selector = 0, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2194 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2195 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2196 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 2197 | .default_value = asn_DFL_5_set_1, /* DEFAULT 1 */ |
| 2198 | .name = "bool" |
| 2199 | }, |
| 2200 | { ATF_NOFLAGS, 0, offsetof(struct Sequence, enum_c), |
| 2201 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), |
| 2202 | .tag_mode = 0, |
| 2203 | .type = &asn_DEF_enum_c_6, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 2204 | .type_selector = 0, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2205 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2206 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2207 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 2208 | .default_value = 0, |
| 2209 | .name = "enum-c" |
| 2210 | }, |
| 2211 | { ATF_POINTER, 2, offsetof(struct Sequence, null), |
| 2212 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), |
| 2213 | .tag_mode = 0, |
| 2214 | .type = &asn_DEF_NULL, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 2215 | .type_selector = 0, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2216 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2217 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2218 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 2219 | .default_value = 0, |
| 2220 | .name = "null" |
| 2221 | }, |
| 2222 | { ATF_POINTER, 1, offsetof(struct Sequence, int5_c), |
| 2223 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 2224 | .tag_mode = 0, |
| 2225 | .type = &asn_DEF_Int5, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 2226 | .type_selector = 0, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2227 | .memb_constraints = memb_int5_c_constraint_1, |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2228 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2229 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 2230 | .default_value = 0, |
| 2231 | .name = "int5-c" |
| 2232 | }, |
| 2233 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2234 | static const ber_tlv_tag_t asn_DEF_Sequence_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2235 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 2236 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2237 | static const asn_TYPE_tag2member_t asn_MAP_Sequence_tag2el_1[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 2238 | { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */ |
| 2239 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 2 }, /* int1-c */ |
| 2240 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, -1, 1 }, /* int4-c */ |
| 2241 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 6, -2, 0 }, /* int5-c */ |
| 2242 | { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 5, 0, 0 }, /* null */ |
| 2243 | { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 4, 0, 0 }, /* enum-c */ |
| 2244 | { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 1, 0, 0 } /* int4 */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2245 | }; |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 2246 | asn_SEQUENCE_specifics_t asn_SPC_Sequence_specs_1 = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2247 | sizeof(struct Sequence), |
| 2248 | offsetof(struct Sequence, _asn_ctx), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 2249 | .tag2el = asn_MAP_Sequence_tag2el_1, |
| 2250 | .tag2el_count = 7, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2251 | 0, 0, 0, /* Optional elements (not needed) */ |
| 2252 | 5, /* Start extensions */ |
| 2253 | 8 /* Stop extensions */ |
| 2254 | }; |
| 2255 | asn_TYPE_descriptor_t asn_DEF_Sequence = { |
| 2256 | "Sequence", |
| 2257 | "Sequence", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 2258 | &asn_OP_SEQUENCE, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2259 | SEQUENCE_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2260 | asn_DEF_Sequence_tags_1, |
| 2261 | sizeof(asn_DEF_Sequence_tags_1) |
| 2262 | /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */ |
| 2263 | asn_DEF_Sequence_tags_1, /* Same as above */ |
| 2264 | sizeof(asn_DEF_Sequence_tags_1) |
| 2265 | /sizeof(asn_DEF_Sequence_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2266 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2267 | 0, /* No PER visible constraints */ |
| 2268 | asn_MBR_Sequence_1, |
| 2269 | 7, /* Elements count */ |
| 2270 | &asn_SPC_Sequence_specs_1 /* Additional specs */ |
| 2271 | }; |
| 2272 | |
| 2273 | |
| 2274 | /*** <<< INCLUDES [SequenceOf] >>> ***/ |
| 2275 | |
| 2276 | #include <asn_SEQUENCE_OF.h> |
| 2277 | #include <constr_SEQUENCE_OF.h> |
| 2278 | |
| 2279 | /*** <<< FWD-DECLS [SequenceOf] >>> ***/ |
| 2280 | |
| 2281 | struct Sequence; |
| 2282 | |
| 2283 | /*** <<< TYPE-DECLS [SequenceOf] >>> ***/ |
| 2284 | |
| 2285 | typedef struct SequenceOf { |
| 2286 | A_SEQUENCE_OF(struct Sequence) list; |
| 2287 | |
| 2288 | /* Context for parsing across buffer boundaries */ |
| 2289 | asn_struct_ctx_t _asn_ctx; |
| 2290 | } SequenceOf_t; |
| 2291 | |
| 2292 | /*** <<< FUNC-DECLS [SequenceOf] >>> ***/ |
| 2293 | |
| 2294 | extern asn_TYPE_descriptor_t asn_DEF_SequenceOf; |
| 2295 | |
| 2296 | /*** <<< POST-INCLUDE [SequenceOf] >>> ***/ |
| 2297 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 2298 | #include "Sequence.h" |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2299 | |
| 2300 | /*** <<< STAT-DEFS [SequenceOf] >>> ***/ |
| 2301 | |
| 2302 | static asn_TYPE_member_t asn_MBR_SequenceOf_1[] = { |
| 2303 | { ATF_POINTER, 0, 0, |
| 2304 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 2305 | .tag_mode = 0, |
| 2306 | .type = &asn_DEF_Sequence, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 2307 | .type_selector = 0, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2308 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2309 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2310 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 2311 | .default_value = 0, |
| 2312 | .name = "" |
| 2313 | }, |
| 2314 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2315 | static const ber_tlv_tag_t asn_DEF_SequenceOf_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2316 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 2317 | }; |
| 2318 | static asn_SET_OF_specifics_t asn_SPC_SequenceOf_specs_1 = { |
| 2319 | sizeof(struct SequenceOf), |
| 2320 | offsetof(struct SequenceOf, _asn_ctx), |
| 2321 | 0, /* XER encoding is XMLDelimitedItemList */ |
| 2322 | }; |
| 2323 | asn_TYPE_descriptor_t asn_DEF_SequenceOf = { |
| 2324 | "SequenceOf", |
| 2325 | "SequenceOf", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 2326 | &asn_OP_SEQUENCE_OF, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2327 | SEQUENCE_OF_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2328 | asn_DEF_SequenceOf_tags_1, |
| 2329 | sizeof(asn_DEF_SequenceOf_tags_1) |
| 2330 | /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */ |
| 2331 | asn_DEF_SequenceOf_tags_1, /* Same as above */ |
| 2332 | sizeof(asn_DEF_SequenceOf_tags_1) |
| 2333 | /sizeof(asn_DEF_SequenceOf_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2334 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2335 | 0, /* No PER visible constraints */ |
| 2336 | asn_MBR_SequenceOf_1, |
| 2337 | 1, /* Single element */ |
| 2338 | &asn_SPC_SequenceOf_specs_1 /* Additional specs */ |
| 2339 | }; |
| 2340 | |
| 2341 | |
| 2342 | /*** <<< INCLUDES [Enum0] >>> ***/ |
| 2343 | |
| 2344 | #include <ENUMERATED.h> |
| 2345 | |
| 2346 | /*** <<< DEPS [Enum0] >>> ***/ |
| 2347 | |
| 2348 | typedef enum Enum0 { |
| 2349 | Enum0_one = 0, |
| 2350 | Enum0_two = 1 |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 2351 | } e_Enum0; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2352 | |
| 2353 | /*** <<< TYPE-DECLS [Enum0] >>> ***/ |
| 2354 | |
| 2355 | typedef ENUMERATED_t Enum0_t; |
| 2356 | |
| 2357 | /*** <<< FUNC-DECLS [Enum0] >>> ***/ |
| 2358 | |
| 2359 | extern asn_TYPE_descriptor_t asn_DEF_Enum0; |
| 2360 | asn_struct_free_f Enum0_free; |
| 2361 | asn_struct_print_f Enum0_print; |
| 2362 | asn_constr_check_f Enum0_constraint; |
| 2363 | ber_type_decoder_f Enum0_decode_ber; |
| 2364 | der_type_encoder_f Enum0_encode_der; |
| 2365 | xer_type_decoder_f Enum0_decode_xer; |
| 2366 | xer_type_encoder_f Enum0_encode_xer; |
| 2367 | |
| 2368 | /*** <<< CODE [Enum0] >>> ***/ |
| 2369 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2370 | /* |
| 2371 | * This type is implemented using ENUMERATED, |
| 2372 | * so here we adjust the DEF accordingly. |
| 2373 | */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2374 | |
| 2375 | /*** <<< STAT-DEFS [Enum0] >>> ***/ |
| 2376 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2377 | static const asn_INTEGER_enum_map_t asn_MAP_Enum0_value2enum_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2378 | { 0, 3, "one" }, |
| 2379 | { 1, 3, "two" } |
| 2380 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2381 | static const unsigned int asn_MAP_Enum0_enum2value_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2382 | 0, /* one(0) */ |
| 2383 | 1 /* two(1) */ |
| 2384 | }; |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 2385 | static const asn_INTEGER_specifics_t asn_SPC_Enum0_specs_1 = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2386 | asn_MAP_Enum0_value2enum_1, /* "tag" => N; sorted by tag */ |
| 2387 | asn_MAP_Enum0_enum2value_1, /* N => "tag"; sorted by N */ |
| 2388 | 2, /* Number of elements in the maps */ |
| 2389 | 0, /* Enumeration is not extensible */ |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 2390 | 1, /* Strict enumeration */ |
| 2391 | 0, /* Native long size */ |
| 2392 | 0 |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2393 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2394 | static const ber_tlv_tag_t asn_DEF_Enum0_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2395 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) |
| 2396 | }; |
| 2397 | asn_TYPE_descriptor_t asn_DEF_Enum0 = { |
| 2398 | "Enum0", |
| 2399 | "Enum0", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 2400 | &asn_OP_ENUMERATED, |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 2401 | ENUMERATED_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2402 | asn_DEF_Enum0_tags_1, |
| 2403 | sizeof(asn_DEF_Enum0_tags_1) |
| 2404 | /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */ |
| 2405 | asn_DEF_Enum0_tags_1, /* Same as above */ |
| 2406 | sizeof(asn_DEF_Enum0_tags_1) |
| 2407 | /sizeof(asn_DEF_Enum0_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2408 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2409 | 0, /* No PER visible constraints */ |
| 2410 | 0, 0, /* Defined elsewhere */ |
| 2411 | &asn_SPC_Enum0_specs_1 /* Additional specs */ |
| 2412 | }; |
| 2413 | |
| 2414 | |
| 2415 | /*** <<< INCLUDES [Enum1] >>> ***/ |
| 2416 | |
| 2417 | #include <NativeEnumerated.h> |
| 2418 | |
| 2419 | /*** <<< DEPS [Enum1] >>> ***/ |
| 2420 | |
| 2421 | typedef enum Enum1 { |
| 2422 | Enum1_one = 0, |
| 2423 | Enum1_two = 1 |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 2424 | } e_Enum1; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2425 | |
| 2426 | /*** <<< TYPE-DECLS [Enum1] >>> ***/ |
| 2427 | |
| 2428 | typedef long Enum1_t; |
| 2429 | |
| 2430 | /*** <<< FUNC-DECLS [Enum1] >>> ***/ |
| 2431 | |
| 2432 | extern asn_TYPE_descriptor_t asn_DEF_Enum1; |
| 2433 | asn_struct_free_f Enum1_free; |
| 2434 | asn_struct_print_f Enum1_print; |
| 2435 | asn_constr_check_f Enum1_constraint; |
| 2436 | ber_type_decoder_f Enum1_decode_ber; |
| 2437 | der_type_encoder_f Enum1_encode_der; |
| 2438 | xer_type_decoder_f Enum1_decode_xer; |
| 2439 | xer_type_encoder_f Enum1_encode_xer; |
| 2440 | |
| 2441 | /*** <<< CODE [Enum1] >>> ***/ |
| 2442 | |
| 2443 | int |
| 2444 | Enum1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 2445 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2446 | long value; |
| 2447 | |
| 2448 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2449 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2450 | "%s: value not given (%s:%d)", |
| 2451 | td->name, __FILE__, __LINE__); |
| 2452 | return -1; |
| 2453 | } |
| 2454 | |
| 2455 | value = *(const long *)sptr; |
| 2456 | |
| 2457 | if((value == 0)) { |
| 2458 | /* Constraint check succeeded */ |
| 2459 | return 0; |
| 2460 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2461 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2462 | "%s: constraint failed (%s:%d)", |
| 2463 | td->name, __FILE__, __LINE__); |
| 2464 | return -1; |
| 2465 | } |
| 2466 | } |
| 2467 | |
| 2468 | /* |
| 2469 | * This type is implemented using NativeEnumerated, |
| 2470 | * so here we adjust the DEF accordingly. |
| 2471 | */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2472 | |
| 2473 | /*** <<< STAT-DEFS [Enum1] >>> ***/ |
| 2474 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2475 | static const asn_INTEGER_enum_map_t asn_MAP_Enum1_value2enum_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2476 | { 0, 3, "one" }, |
| 2477 | { 1, 3, "two" } |
| 2478 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2479 | static const unsigned int asn_MAP_Enum1_enum2value_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2480 | 0, /* one(0) */ |
| 2481 | 1 /* two(1) */ |
| 2482 | }; |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 2483 | static const asn_INTEGER_specifics_t asn_SPC_Enum1_specs_1 = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2484 | asn_MAP_Enum1_value2enum_1, /* "tag" => N; sorted by tag */ |
| 2485 | asn_MAP_Enum1_enum2value_1, /* N => "tag"; sorted by N */ |
| 2486 | 2, /* Number of elements in the maps */ |
| 2487 | 0, /* Enumeration is not extensible */ |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 2488 | 1, /* Strict enumeration */ |
| 2489 | 0, /* Native long size */ |
| 2490 | 0 |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2491 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2492 | static const ber_tlv_tag_t asn_DEF_Enum1_tags_1[] = { |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2493 | (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)) |
| 2494 | }; |
| 2495 | asn_TYPE_descriptor_t asn_DEF_Enum1 = { |
| 2496 | "Enum1", |
| 2497 | "Enum1", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 2498 | &asn_OP_NativeEnumerated, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2499 | Enum1_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2500 | asn_DEF_Enum1_tags_1, |
| 2501 | sizeof(asn_DEF_Enum1_tags_1) |
| 2502 | /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */ |
| 2503 | asn_DEF_Enum1_tags_1, /* Same as above */ |
| 2504 | sizeof(asn_DEF_Enum1_tags_1) |
| 2505 | /sizeof(asn_DEF_Enum1_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2506 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2507 | 0, /* No PER visible constraints */ |
| 2508 | 0, 0, /* Defined elsewhere */ |
| 2509 | &asn_SPC_Enum1_specs_1 /* Additional specs */ |
| 2510 | }; |
| 2511 | |
| 2512 | |
Lev Walkin | 154aa18 | 2004-09-26 13:12:56 +0000 | [diff] [blame] | 2513 | /*** <<< INCLUDES [Identifier] >>> ***/ |
| 2514 | |
| 2515 | #include <VisibleString.h> |
| 2516 | |
| 2517 | /*** <<< TYPE-DECLS [Identifier] >>> ***/ |
| 2518 | |
Lev Walkin | 154aa18 | 2004-09-26 13:12:56 +0000 | [diff] [blame] | 2519 | typedef VisibleString_t Identifier_t; |
| 2520 | |
| 2521 | /*** <<< FUNC-DECLS [Identifier] >>> ***/ |
| 2522 | |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 2523 | extern asn_TYPE_descriptor_t asn_DEF_Identifier; |
Lev Walkin | 154aa18 | 2004-09-26 13:12:56 +0000 | [diff] [blame] | 2524 | asn_struct_free_f Identifier_free; |
| 2525 | asn_struct_print_f Identifier_print; |
| 2526 | asn_constr_check_f Identifier_constraint; |
| 2527 | ber_type_decoder_f Identifier_decode_ber; |
| 2528 | der_type_encoder_f Identifier_encode_der; |
Lev Walkin | 0ebe8b3 | 2004-10-23 13:26:56 +0000 | [diff] [blame] | 2529 | xer_type_decoder_f Identifier_decode_xer; |
Lev Walkin | 154aa18 | 2004-09-26 13:12:56 +0000 | [diff] [blame] | 2530 | xer_type_encoder_f Identifier_encode_xer; |
| 2531 | |
| 2532 | /*** <<< CTABLES [Identifier] >>> ***/ |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 2533 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2534 | static const int permitted_alphabet_table_1[256] = { |
Lev Walkin | 5b62ca8 | 2006-09-21 01:52:07 +0000 | [diff] [blame] | 2535 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 2536 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ |
| 2537 | 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* $ */ |
| 2538 | 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0, 0, 0, 0, /* 0123456789 */ |
| 2539 | 0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26, /* ABCDEFGHIJKLMNO */ |
| 2540 | 27,28,29,30,31,32,33,34,35,36,37, 0, 0, 0, 0,38, /* PQRSTUVWXYZ _ */ |
| 2541 | 0,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53, /* abcdefghijklmno */ |
| 2542 | 54,55,56,57,58,59,60,61,62,63,64, 0, 0, 0, 0, 0, /* pqrstuvwxyz */ |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 2543 | }; |
| 2544 | |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 2545 | static int check_permitted_alphabet_1(const void *sptr) { |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2546 | const int *table = permitted_alphabet_table_1; |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 2547 | /* The underlying type is VisibleString */ |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 2548 | const VisibleString_t *st = (const VisibleString_t *)sptr; |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 2549 | const uint8_t *ch = st->buf; |
| 2550 | const uint8_t *end = ch + st->size; |
| 2551 | |
| 2552 | for(; ch < end; ch++) { |
| 2553 | uint8_t cv = *ch; |
| 2554 | if(!table[cv]) return -1; |
| 2555 | } |
| 2556 | return 0; |
| 2557 | } |
| 2558 | |
| 2559 | |
Lev Walkin | 154aa18 | 2004-09-26 13:12:56 +0000 | [diff] [blame] | 2560 | /*** <<< CODE [Identifier] >>> ***/ |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 2561 | |
| 2562 | int |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 2563 | Identifier_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 2564 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8a7af0e | 2005-02-15 03:40:07 +0000 | [diff] [blame] | 2565 | const VisibleString_t *st = (const VisibleString_t *)sptr; |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 2566 | size_t size; |
| 2567 | |
| 2568 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2569 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 2570 | "%s: value not given (%s:%d)", |
| 2571 | td->name, __FILE__, __LINE__); |
| 2572 | return -1; |
| 2573 | } |
| 2574 | |
| 2575 | size = st->size; |
| 2576 | |
| 2577 | if((size >= 1 && size <= 32) |
Lev Walkin | e8318b8 | 2005-03-06 09:29:03 +0000 | [diff] [blame] | 2578 | && !check_permitted_alphabet_1(st)) { |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 2579 | /* Constraint check succeeded */ |
| 2580 | return 0; |
| 2581 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 2582 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 2583 | "%s: constraint failed (%s:%d)", |
| 2584 | td->name, __FILE__, __LINE__); |
| 2585 | return -1; |
| 2586 | } |
| 2587 | } |
| 2588 | |
| 2589 | /* |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 2590 | * This type is implemented using VisibleString, |
Lev Walkin | c3808c1 | 2004-09-23 22:14:58 +0000 | [diff] [blame] | 2591 | * so here we adjust the DEF accordingly. |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 2592 | */ |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 2593 | |
| 2594 | /*** <<< STAT-DEFS [Identifier] >>> ***/ |
| 2595 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 2596 | static const ber_tlv_tag_t asn_DEF_Identifier_tags_1[] = { |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 2597 | (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)) |
| 2598 | }; |
Lev Walkin | dfae975 | 2004-09-29 13:19:37 +0000 | [diff] [blame] | 2599 | asn_TYPE_descriptor_t asn_DEF_Identifier = { |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 2600 | "Identifier", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 2601 | "Identifier", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 2602 | &asn_OP_VisibleString, |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 2603 | Identifier_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2604 | asn_DEF_Identifier_tags_1, |
| 2605 | sizeof(asn_DEF_Identifier_tags_1) |
| 2606 | /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */ |
| 2607 | asn_DEF_Identifier_tags_1, /* Same as above */ |
| 2608 | sizeof(asn_DEF_Identifier_tags_1) |
| 2609 | /sizeof(asn_DEF_Identifier_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 2610 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 2611 | 0, /* No PER visible constraints */ |
Lev Walkin | e4ca5ce | 2004-09-15 11:44:13 +0000 | [diff] [blame] | 2612 | 0, 0, /* No members */ |
| 2613 | 0 /* No specifics */ |
| 2614 | }; |
| 2615 | |